diff --git a/.gitattributes b/.gitattributes index 7ddf2c67aaf86c90a7f86ad27e90fe4d1a6635f6..bf2af30a53e968f8c6559686d6aee177164a65b8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -718,3 +718,32 @@ shared/package-files/99/998fef1dd6b7136df657284a08466c5be4c05ff233fd661a445ab5d6 shared/package-files/99/99acc1ddb4b5e74695bb8c19520ce6daa6f54afe1a03b420a38597979c29cf96/blob filter=lfs diff=lfs merge=lfs -text shared/package-files/9a/9af2493792b640a5019720c3d6fae7fcb63d6e502cf7b43782374df87061b6d2/blob filter=lfs diff=lfs merge=lfs -text shared/package-files/9b/9b0619ffc84440db3692b21c6de5e750acc668490c4ba38610192bb3553343b5/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9b/9b156a37c540d4ea39994bad9664abd0a4bd57acfa72ffec72409c36a4532f2c/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9b/9b16c7223d8223a77cbb4db2ee2fcc0dc2008526d6d3256a2e2fb3f2a95820fe/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9b/9b185eeba218c0a82e52dc46741cc08f676740e184182013738b2589c1fe99cb/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9b/9b73f686d2ddb70d184f449d22d666b0a1ea63797ad578875be8245c4efa817e/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9c/9c5d4a71ea3cf87a657612cc682a348304d22d0458ff270f0695aeaf9388a2aa/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9c/9c8f332f0979366cc303a064494a5e1538bd5859013021e7e6901ac47548cf9f/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9d/9d75321ee95050c17ee5243dd85bb792a35ef9e24d33e9f0a8e87453afe397fb/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9d/9daa832cd9158824f01bbccaf05916cb941f548fa6bedefc3257fca7ca81fd02/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9e/9e37252bab966a08b28b2f6f5e4400812fcdfd0355cb307230ac59a2a57847cc/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9e/9e580e6e2aede262d752c93d6e3f25ae62b3bd8fdb92764ac53297bc8e97642c/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9e/9e7299a7432e9a547825e22403aeac2260f98cca8336c69f213120527273a9e9/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9e/9e76d8350e857eba01bcd350d267300f0f924f152c0f486f21bfb46178ab071a/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9e/9ea0a9db09e8e6688e31eb05f151e16da850fc93f94574f6d72b06f596717889/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9e/9ea3b595a1060ba582a495c81145da0ef01e092303974cce944d5dffa42e9deb/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9e/9ecd558955082ec491fe4f93fe8f816702b0bb14b25553c26ccafcb8a57f5ee2/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9e/9ed4b4373dce636ead027ad1db453ba4788d4db0e6ab7f38f189b3eabe6810bc/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9e/9ed8b3e7c98810034cc77adfbd8ce318397f0adc944db4364d7dd63e4b05ee27/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9f/9f24f334e5a0a152c73c36a7cdb8e7c77c1c8a47e6195a59ac7428ed04ea006a/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9f/9fa802bd46564846ee1d22e5ee7afa55da41d774b55ce3d85759171f8d76f2bd/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/9f/9faa58d24167d58a5cd87235f0727540ae015e8ada86d16df5ab0efb95153c52/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/a0/a0381910c322639fa56d516170f1497a8ebf92365c14ae478447b9aa257cfe55/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/a0/a076c9c834d073f49c19eaacf3021d247342088a7622153a0671aa2cf5d0abfd/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/a1/a13dad3c4f0cd7a1917d5b6763b27aaf3d38f3b7d775e747b61241ea36b681e0/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/a1/a14c7ed45816ea9c2404967c7b302ff4c3b181d5a547d4a47714c4dbd00a6b07/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/a1/a167fb78147766d380f75393bdd790258a2cd5a9f9ea6b06b09c2118e6a7de5a/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/a1/a16a23abdb9d9e88968ffe09beea9eccc9f9dcee84dbc61660b6bab1a83f0728/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/a1/a19740619863873a7fbece730f37e8c577889aab3ac5bfc303a09ac4868cf090/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/a1/a1e7d0bb7e8168c32be5773a7bae2fedd3e926237cbcd36cfe26b44b0f40e160/blob filter=lfs diff=lfs merge=lfs -text +shared/package-files/a2/a20bb2a7d5f35f2a502756822e79a2ecc09f43473ef17f1468e0cce7b42baecf/blob filter=lfs diff=lfs merge=lfs -text diff --git a/shared/package-files/9b/9b0e6d6337bf04cb3aba018465f83999c5e8227198767edfbd20984948bd06ac/blob b/shared/package-files/9b/9b0e6d6337bf04cb3aba018465f83999c5e8227198767edfbd20984948bd06ac/blob new file mode 100644 index 0000000000000000000000000000000000000000..1e92073d375c78a5e4520fe412a19d723c59a6ea --- /dev/null +++ b/shared/package-files/9b/9b0e6d6337bf04cb3aba018465f83999c5e8227198767edfbd20984948bd06ac/blob @@ -0,0 +1,1429 @@ +dtype,input,output,ulperrortol +np.float32,0x3f338252,0x3f1c8d9c,3 +np.float32,0x7e569df2,0x3fc90fdb,3 +np.float32,0xbf347e25,0xbf1d361f,3 +np.float32,0xbf0a654e,0xbefdbfd2,3 +np.float32,0x8070968e,0x8070968e,3 +np.float32,0x803cfb27,0x803cfb27,3 +np.float32,0x8024362e,0x8024362e,3 +np.float32,0xfd55dca0,0xbfc90fdb,3 +np.float32,0x592b82,0x592b82,3 +np.float32,0x802eb8e1,0x802eb8e1,3 +np.float32,0xbc5fef40,0xbc5febae,3 +np.float32,0x3f1f6ce8,0x3f0e967c,3 +np.float32,0x20bedc,0x20bedc,3 +np.float32,0xbf058860,0xbef629c7,3 +np.float32,0x311504,0x311504,3 +np.float32,0xbd23f560,0xbd23defa,3 +np.float32,0x800ff4e8,0x800ff4e8,3 +np.float32,0x355009,0x355009,3 +np.float32,0x3f7be42e,0x3f46fdb3,3 +np.float32,0xbf225f7c,0xbf10b364,3 +np.float32,0x8074fa9e,0x8074fa9e,3 +np.float32,0xbea4b418,0xbe9f59ce,3 +np.float32,0xbe909c14,0xbe8cf045,3 +np.float32,0x80026bee,0x80026bee,3 +np.float32,0x3d789c20,0x3d784e25,3 +np.float32,0x7f56a4ba,0x3fc90fdb,3 +np.float32,0xbf70d141,0xbf413db7,3 +np.float32,0xbf2c4886,0xbf17a505,3 +np.float32,0x7e2993bf,0x3fc90fdb,3 +np.float32,0xbe2c8a30,0xbe2aef28,3 +np.float32,0x803f82d9,0x803f82d9,3 +np.float32,0x3f062fbc,0x3ef730a1,3 +np.float32,0x3f349ee0,0x3f1d4bfa,3 +np.float32,0x3eccfb69,0x3ec2f9e8,3 +np.float32,0x7e8a85dd,0x3fc90fdb,3 +np.float32,0x25331,0x25331,3 +np.float32,0x464f19,0x464f19,3 +np.float32,0x8035c818,0x8035c818,3 +np.float32,0x802e5799,0x802e5799,3 +np.float32,0x64e1c0,0x64e1c0,3 +np.float32,0x701cc2,0x701cc2,3 +np.float32,0x265c57,0x265c57,3 +np.float32,0x807a053f,0x807a053f,3 +np.float32,0x3bd2c412,0x3bd2c354,3 +np.float32,0xff28f1c8,0xbfc90fdb,3 +np.float32,0x7f08f08b,0x3fc90fdb,3 +np.float32,0x800c50e4,0x800c50e4,3 +np.float32,0x369674,0x369674,3 +np.float32,0xbf5b7db3,0xbf3571bf,3 +np.float32,0x7edcf5e2,0x3fc90fdb,3 +np.float32,0x800e5d4b,0x800e5d4b,3 +np.float32,0x80722554,0x80722554,3 +np.float32,0x693f33,0x693f33,3 +np.float32,0x800844e4,0x800844e4,3 +np.float32,0xbf111b82,0xbf0402ec,3 +np.float32,0x7df9c9ac,0x3fc90fdb,3 +np.float32,0xbf6619a6,0xbf3b6f57,3 +np.float32,0x8002fafe,0x8002fafe,3 +np.float32,0xfe1e67f8,0xbfc90fdb,3 +np.float32,0x3f7f4bf8,0x3f48b5b7,3 +np.float32,0x7f017b20,0x3fc90fdb,3 +np.float32,0x2d9b07,0x2d9b07,3 +np.float32,0x803aa174,0x803aa174,3 +np.float32,0x7d530336,0x3fc90fdb,3 +np.float32,0x80662195,0x80662195,3 +np.float32,0xfd5ebcf0,0xbfc90fdb,3 +np.float32,0xbe7b8dcc,0xbe76ab59,3 +np.float32,0x7f2bacaf,0x3fc90fdb,3 +np.float32,0x3f194fc4,0x3f0a229e,3 +np.float32,0x7ee21cdf,0x3fc90fdb,3 +np.float32,0x3f5a17fc,0x3f34a307,3 +np.float32,0x7f100c58,0x3fc90fdb,3 +np.float32,0x7e9128f5,0x3fc90fdb,3 +np.float32,0xbf2107c6,0xbf0fbdb4,3 +np.float32,0xbd29c800,0xbd29af22,3 +np.float32,0xbf5af499,0xbf3522a6,3 +np.float32,0x801bde44,0x801bde44,3 +np.float32,0xfeb4761a,0xbfc90fdb,3 +np.float32,0x3d88aa1b,0x3d887650,3 +np.float32,0x7eba5e0b,0x3fc90fdb,3 +np.float32,0x803906bd,0x803906bd,3 +np.float32,0x80101512,0x80101512,3 +np.float32,0x7e898f83,0x3fc90fdb,3 +np.float32,0x806406d3,0x806406d3,3 +np.float32,0x7ed20fc0,0x3fc90fdb,3 +np.float32,0x20827d,0x20827d,3 +np.float32,0x3f361359,0x3f1e43fe,3 +np.float32,0xfe4ef8d8,0xbfc90fdb,3 +np.float32,0x805e7d2d,0x805e7d2d,3 +np.float32,0xbe4316b0,0xbe40c745,3 +np.float32,0xbf0a1c06,0xbefd4e5a,3 +np.float32,0x3e202860,0x3e1edee1,3 +np.float32,0xbeb32a2c,0xbeac5899,3 +np.float32,0xfe528838,0xbfc90fdb,3 +np.float32,0x2f73e2,0x2f73e2,3 +np.float32,0xbe16e010,0xbe15cc27,3 +np.float32,0x3f50d6c5,0x3f2f2d75,3 +np.float32,0xbe88a6a2,0xbe8589c7,3 +np.float32,0x3ee36060,0x3ed5fb36,3 +np.float32,0x6c978b,0x6c978b,3 +np.float32,0x7f1b735f,0x3fc90fdb,3 +np.float32,0x3dad8256,0x3dad1885,3 +np.float32,0x807f5094,0x807f5094,3 +np.float32,0x65c358,0x65c358,3 +np.float32,0xff315ce4,0xbfc90fdb,3 +np.float32,0x7411a6,0x7411a6,3 +np.float32,0x80757b04,0x80757b04,3 +np.float32,0x3eec73a6,0x3edd82f4,3 +np.float32,0xfe9f69e8,0xbfc90fdb,3 +np.float32,0x801f4fa8,0x801f4fa8,3 +np.float32,0xbf6f2fae,0xbf405f79,3 +np.float32,0xfea206b6,0xbfc90fdb,3 +np.float32,0x3f257301,0x3f12e1ee,3 +np.float32,0x7ea6a506,0x3fc90fdb,3 +np.float32,0x80800000,0x80800000,3 +np.float32,0xff735c2d,0xbfc90fdb,3 +np.float32,0x80197f95,0x80197f95,3 +np.float32,0x7f4a354f,0x3fc90fdb,3 +np.float32,0xff320c00,0xbfc90fdb,3 +np.float32,0x3f2659de,0x3f138484,3 +np.float32,0xbe5451bc,0xbe515a52,3 +np.float32,0x3f6e228c,0x3f3fcf7c,3 +np.float32,0x66855a,0x66855a,3 +np.float32,0x8034b3a3,0x8034b3a3,3 +np.float32,0xbe21a2fc,0xbe20505d,3 +np.float32,0x7f79e2dc,0x3fc90fdb,3 +np.float32,0xbe19a8e0,0xbe18858c,3 +np.float32,0x10802c,0x10802c,3 +np.float32,0xfeee579e,0xbfc90fdb,3 +np.float32,0x3f3292c8,0x3f1becc0,3 +np.float32,0xbf595a71,0xbf34350a,3 +np.float32,0xbf7c3373,0xbf4725f4,3 +np.float32,0xbdd30938,0xbdd24b36,3 +np.float32,0x153a17,0x153a17,3 +np.float32,0x807282a0,0x807282a0,3 +np.float32,0xfe817322,0xbfc90fdb,3 +np.float32,0x3f1b3628,0x3f0b8771,3 +np.float32,0x41be8f,0x41be8f,3 +np.float32,0x7f4a8343,0x3fc90fdb,3 +np.float32,0x3dc4ea2b,0x3dc44fae,3 +np.float32,0x802aac25,0x802aac25,3 +np.float32,0xbf20e1d7,0xbf0fa284,3 +np.float32,0xfd91a1b0,0xbfc90fdb,3 +np.float32,0x3f0d5476,0x3f012265,3 +np.float32,0x21c916,0x21c916,3 +np.float32,0x807df399,0x807df399,3 +np.float32,0x7e207b4c,0x3fc90fdb,3 +np.float32,0x8055f8ff,0x8055f8ff,3 +np.float32,0x7edf3b01,0x3fc90fdb,3 +np.float32,0x803a8df3,0x803a8df3,3 +np.float32,0x3ce3b002,0x3ce3a101,3 +np.float32,0x3f62dd54,0x3f39a248,3 +np.float32,0xff33ae10,0xbfc90fdb,3 +np.float32,0x7e3de69d,0x3fc90fdb,3 +np.float32,0x8024581e,0x8024581e,3 +np.float32,0xbf4ac99d,0xbf2b807a,3 +np.float32,0x3f157d19,0x3f074d8c,3 +np.float32,0xfed383f4,0xbfc90fdb,3 +np.float32,0xbf5a39fa,0xbf34b6b8,3 +np.float32,0x800d757d,0x800d757d,3 +np.float32,0x807d606b,0x807d606b,3 +np.float32,0x3e828f89,0x3e7fac2d,3 +np.float32,0x7a6604,0x7a6604,3 +np.float32,0x7dc7e72b,0x3fc90fdb,3 +np.float32,0x80144146,0x80144146,3 +np.float32,0x7c2eed69,0x3fc90fdb,3 +np.float32,0x3f5b4d8c,0x3f3555fc,3 +np.float32,0xfd8b7778,0xbfc90fdb,3 +np.float32,0xfc9d9140,0xbfc90fdb,3 +np.float32,0xbea265d4,0xbe9d4232,3 +np.float32,0xbe9344d0,0xbe8f65da,3 +np.float32,0x3f71f19a,0x3f41d65b,3 +np.float32,0x804a3f59,0x804a3f59,3 +np.float32,0x3e596290,0x3e563476,3 +np.float32,0x3e994ee4,0x3e94f546,3 +np.float32,0xbc103e00,0xbc103d0c,3 +np.float32,0xbf1cd896,0xbf0cb889,3 +np.float32,0x7f52b080,0x3fc90fdb,3 +np.float32,0xff584452,0xbfc90fdb,3 +np.float32,0x58b26b,0x58b26b,3 +np.float32,0x3f23cd4c,0x3f11b799,3 +np.float32,0x707d7,0x707d7,3 +np.float32,0xff732cff,0xbfc90fdb,3 +np.float32,0x3e41c2a6,0x3e3f7f0f,3 +np.float32,0xbf7058e9,0xbf40fdcf,3 +np.float32,0x7dca9857,0x3fc90fdb,3 +np.float32,0x7f0eb44b,0x3fc90fdb,3 +np.float32,0x8000405c,0x8000405c,3 +np.float32,0x4916ab,0x4916ab,3 +np.float32,0x4811a8,0x4811a8,3 +np.float32,0x3d69bf,0x3d69bf,3 +np.float32,0xfeadcf1e,0xbfc90fdb,3 +np.float32,0x3e08dbbf,0x3e080d58,3 +np.float32,0xff031f88,0xbfc90fdb,3 +np.float32,0xbe09cab8,0xbe08f818,3 +np.float32,0x21d7cd,0x21d7cd,3 +np.float32,0x3f23230d,0x3f113ea9,3 +np.float32,0x7e8a48d4,0x3fc90fdb,3 +np.float32,0x413869,0x413869,3 +np.float32,0x7e832990,0x3fc90fdb,3 +np.float32,0x800f5c09,0x800f5c09,3 +np.float32,0x7f5893b6,0x3fc90fdb,3 +np.float32,0x7f06b5b1,0x3fc90fdb,3 +np.float32,0xbe1cbee8,0xbe1b89d6,3 +np.float32,0xbf279f14,0xbf1468a8,3 +np.float32,0xfea86060,0xbfc90fdb,3 +np.float32,0x3e828174,0x3e7f91bb,3 +np.float32,0xff682c82,0xbfc90fdb,3 +np.float32,0x4e20f3,0x4e20f3,3 +np.float32,0x7f17d7e9,0x3fc90fdb,3 +np.float32,0x80671f92,0x80671f92,3 +np.float32,0x7f6dd100,0x3fc90fdb,3 +np.float32,0x3f219a4d,0x3f102695,3 +np.float32,0x803c9808,0x803c9808,3 +np.float32,0x3c432ada,0x3c43287d,3 +np.float32,0xbd3db450,0xbd3d91a2,3 +np.float32,0x3baac135,0x3baac0d0,3 +np.float32,0xff7fffe1,0xbfc90fdb,3 +np.float32,0xfe38a6f4,0xbfc90fdb,3 +np.float32,0x3dfb0a04,0x3df9cb04,3 +np.float32,0x800b05c2,0x800b05c2,3 +np.float32,0x644163,0x644163,3 +np.float32,0xff03a025,0xbfc90fdb,3 +np.float32,0x3f7d506c,0x3f47b641,3 +np.float32,0xff0e682a,0xbfc90fdb,3 +np.float32,0x3e09b7b0,0x3e08e567,3 +np.float32,0x7f72a216,0x3fc90fdb,3 +np.float32,0x7f800000,0x3fc90fdb,3 +np.float32,0x8050a281,0x8050a281,3 +np.float32,0x7edafa2f,0x3fc90fdb,3 +np.float32,0x3f4e0df6,0x3f2d7f2f,3 +np.float32,0xbf6728e0,0xbf3c050f,3 +np.float32,0x3e904ce4,0x3e8ca6eb,3 +np.float32,0x0,0x0,3 +np.float32,0xfd215070,0xbfc90fdb,3 +np.float32,0x7e406b15,0x3fc90fdb,3 +np.float32,0xbf2803c9,0xbf14af18,3 +np.float32,0x5950c8,0x5950c8,3 +np.float32,0xbeddcec8,0xbed14faa,3 +np.float32,0xbec6457e,0xbebd2aa5,3 +np.float32,0xbf42843c,0xbf2656db,3 +np.float32,0x3ee9cba8,0x3edb5163,3 +np.float32,0xbe30c954,0xbe2f0f90,3 +np.float32,0xbeee6b44,0xbedf216f,3 +np.float32,0xbe35d818,0xbe33f7cd,3 +np.float32,0xbe47c630,0xbe454bc6,3 +np.float32,0x801b146f,0x801b146f,3 +np.float32,0x7f6788da,0x3fc90fdb,3 +np.float32,0x3eaef088,0x3ea8927d,3 +np.float32,0x3eb5983e,0x3eae81fc,3 +np.float32,0x40b51d,0x40b51d,3 +np.float32,0xfebddd04,0xbfc90fdb,3 +np.float32,0x3e591aee,0x3e55efea,3 +np.float32,0xbe2b6b48,0xbe29d81f,3 +np.float32,0xff4a8826,0xbfc90fdb,3 +np.float32,0x3e791df0,0x3e745eac,3 +np.float32,0x7c8f681f,0x3fc90fdb,3 +np.float32,0xfe7a15c4,0xbfc90fdb,3 +np.float32,0x3c8963,0x3c8963,3 +np.float32,0x3f0afa0a,0x3efea5cc,3 +np.float32,0xbf0d2680,0xbf00ff29,3 +np.float32,0x3dc306b0,0x3dc27096,3 +np.float32,0x7f4cf105,0x3fc90fdb,3 +np.float32,0xbe196060,0xbe183ea4,3 +np.float32,0x5caf1c,0x5caf1c,3 +np.float32,0x801f2852,0x801f2852,3 +np.float32,0xbe01aa0c,0xbe00fa53,3 +np.float32,0x3f0cfd32,0x3f00df7a,3 +np.float32,0x7d82038e,0x3fc90fdb,3 +np.float32,0x7f7b927f,0x3fc90fdb,3 +np.float32,0xbe93b2e4,0xbe8fcb7f,3 +np.float32,0x1ffe8c,0x1ffe8c,3 +np.float32,0x3faaf6,0x3faaf6,3 +np.float32,0x3e32b1b8,0x3e30e9ab,3 +np.float32,0x802953c0,0x802953c0,3 +np.float32,0xfe5d9844,0xbfc90fdb,3 +np.float32,0x3e1a59d0,0x3e193292,3 +np.float32,0x801c6edc,0x801c6edc,3 +np.float32,0x1ecf41,0x1ecf41,3 +np.float32,0xfe56b09c,0xbfc90fdb,3 +np.float32,0x7e878351,0x3fc90fdb,3 +np.float32,0x3f401e2c,0x3f24cfcb,3 +np.float32,0xbf204a40,0xbf0f35bb,3 +np.float32,0x3e155a98,0x3e144ee1,3 +np.float32,0xbf34f929,0xbf1d8838,3 +np.float32,0x801bbf70,0x801bbf70,3 +np.float32,0x7e7c9730,0x3fc90fdb,3 +np.float32,0x7cc23432,0x3fc90fdb,3 +np.float32,0xbf351638,0xbf1d9b97,3 +np.float32,0x80152094,0x80152094,3 +np.float32,0x3f2d731c,0x3f187219,3 +np.float32,0x804ab0b7,0x804ab0b7,3 +np.float32,0x37d6db,0x37d6db,3 +np.float32,0xbf3ccc56,0xbf22acbf,3 +np.float32,0x3e546f8c,0x3e5176e7,3 +np.float32,0xbe90e87e,0xbe8d3707,3 +np.float32,0x48256c,0x48256c,3 +np.float32,0x7e2468d0,0x3fc90fdb,3 +np.float32,0x807af47e,0x807af47e,3 +np.float32,0x3ed4b221,0x3ec996f0,3 +np.float32,0x3d3b1956,0x3d3af811,3 +np.float32,0xbe69d93c,0xbe65e7f0,3 +np.float32,0xff03ff14,0xbfc90fdb,3 +np.float32,0x801e79dc,0x801e79dc,3 +np.float32,0x3f467c53,0x3f28d63d,3 +np.float32,0x3eab6baa,0x3ea56a1c,3 +np.float32,0xbf15519c,0xbf072d1c,3 +np.float32,0x7f0bd8e8,0x3fc90fdb,3 +np.float32,0xbe1e0d1c,0xbe1cd053,3 +np.float32,0x8016edab,0x8016edab,3 +np.float32,0x7ecaa09b,0x3fc90fdb,3 +np.float32,0x3f72e6d9,0x3f4257a8,3 +np.float32,0xbefe787e,0xbeec29a4,3 +np.float32,0xbee989e8,0xbedb1af9,3 +np.float32,0xbe662db0,0xbe626a45,3 +np.float32,0x495bf7,0x495bf7,3 +np.float32,0x26c379,0x26c379,3 +np.float32,0x7f54d41a,0x3fc90fdb,3 +np.float32,0x801e7dd9,0x801e7dd9,3 +np.float32,0x80000000,0x80000000,3 +np.float32,0xfa3d3000,0xbfc90fdb,3 +np.float32,0xfa3cb800,0xbfc90fdb,3 +np.float32,0x264894,0x264894,3 +np.float32,0xff6de011,0xbfc90fdb,3 +np.float32,0x7e9045b2,0x3fc90fdb,3 +np.float32,0x3f2253a8,0x3f10aaf4,3 +np.float32,0xbd462bf0,0xbd460469,3 +np.float32,0x7f1796af,0x3fc90fdb,3 +np.float32,0x3e718858,0x3e6d3279,3 +np.float32,0xff437d7e,0xbfc90fdb,3 +np.float32,0x805ae7cb,0x805ae7cb,3 +np.float32,0x807e32e9,0x807e32e9,3 +np.float32,0x3ee0bafc,0x3ed3c453,3 +np.float32,0xbf721dee,0xbf41edc3,3 +np.float32,0xfec9f792,0xbfc90fdb,3 +np.float32,0x7f050720,0x3fc90fdb,3 +np.float32,0x182261,0x182261,3 +np.float32,0x3e39e678,0x3e37e5be,3 +np.float32,0x7e096e4b,0x3fc90fdb,3 +np.float32,0x103715,0x103715,3 +np.float32,0x3f7e7741,0x3f484ae4,3 +np.float32,0x3e29aea5,0x3e28277c,3 +np.float32,0x58c183,0x58c183,3 +np.float32,0xff72fdb2,0xbfc90fdb,3 +np.float32,0xbd9a9420,0xbd9a493c,3 +np.float32,0x7f1e07e7,0x3fc90fdb,3 +np.float32,0xff79f522,0xbfc90fdb,3 +np.float32,0x7c7d0e96,0x3fc90fdb,3 +np.float32,0xbeba9e8e,0xbeb2f504,3 +np.float32,0xfd880a80,0xbfc90fdb,3 +np.float32,0xff7f2a33,0xbfc90fdb,3 +np.float32,0x3e861ae0,0x3e83289c,3 +np.float32,0x7f0161c1,0x3fc90fdb,3 +np.float32,0xfe844ff8,0xbfc90fdb,3 +np.float32,0xbebf4b98,0xbeb7128e,3 +np.float32,0x652bee,0x652bee,3 +np.float32,0xff188a4b,0xbfc90fdb,3 +np.float32,0xbf800000,0xbf490fdb,3 +np.float32,0x80418711,0x80418711,3 +np.float32,0xbeb712d4,0xbeafd1f6,3 +np.float32,0xbf7cee28,0xbf478491,3 +np.float32,0xfe66c59c,0xbfc90fdb,3 +np.float32,0x4166a2,0x4166a2,3 +np.float32,0x3dfa1a2c,0x3df8deb5,3 +np.float32,0xbdbfbcb8,0xbdbf2e0f,3 +np.float32,0xfe60ef70,0xbfc90fdb,3 +np.float32,0xfe009444,0xbfc90fdb,3 +np.float32,0xfeb27aa0,0xbfc90fdb,3 +np.float32,0xbe99f7bc,0xbe95902b,3 +np.float32,0x8043d28d,0x8043d28d,3 +np.float32,0xfe5328c4,0xbfc90fdb,3 +np.float32,0x8017b27e,0x8017b27e,3 +np.float32,0x3ef1d2cf,0x3ee1ebd7,3 +np.float32,0x805ddd90,0x805ddd90,3 +np.float32,0xbf424263,0xbf262d17,3 +np.float32,0xfc99dde0,0xbfc90fdb,3 +np.float32,0xbf7ec13b,0xbf487015,3 +np.float32,0xbef727ea,0xbee64377,3 +np.float32,0xff15ce95,0xbfc90fdb,3 +np.float32,0x1fbba4,0x1fbba4,3 +np.float32,0x3f3b2368,0x3f2198a9,3 +np.float32,0xfefda26e,0xbfc90fdb,3 +np.float32,0x801519ad,0x801519ad,3 +np.float32,0x80473fa2,0x80473fa2,3 +np.float32,0x7e7a8bc1,0x3fc90fdb,3 +np.float32,0x3e8a9289,0x3e87548a,3 +np.float32,0x3ed68987,0x3ecb2872,3 +np.float32,0x805bca66,0x805bca66,3 +np.float32,0x8079c4e3,0x8079c4e3,3 +np.float32,0x3a2510,0x3a2510,3 +np.float32,0x7eedc598,0x3fc90fdb,3 +np.float32,0x80681956,0x80681956,3 +np.float32,0xff64c778,0xbfc90fdb,3 +np.float32,0x806bbc46,0x806bbc46,3 +np.float32,0x433643,0x433643,3 +np.float32,0x705b92,0x705b92,3 +np.float32,0xff359392,0xbfc90fdb,3 +np.float32,0xbee78672,0xbed96fa7,3 +np.float32,0x3e21717b,0x3e202010,3 +np.float32,0xfea13c34,0xbfc90fdb,3 +np.float32,0x2c8895,0x2c8895,3 +np.float32,0x3ed33290,0x3ec84f7c,3 +np.float32,0x3e63031e,0x3e5f662e,3 +np.float32,0x7e30907b,0x3fc90fdb,3 +np.float32,0xbe293708,0xbe27b310,3 +np.float32,0x3ed93738,0x3ecd6ea3,3 +np.float32,0x9db7e,0x9db7e,3 +np.float32,0x3f7cd1b8,0x3f47762c,3 +np.float32,0x3eb5143c,0x3eae0cb0,3 +np.float32,0xbe69b234,0xbe65c2d7,3 +np.float32,0x3f6e74de,0x3f3ffb97,3 +np.float32,0x5d0559,0x5d0559,3 +np.float32,0x3e1e8c30,0x3e1d4c70,3 +np.float32,0xbf2d1878,0xbf1833ef,3 +np.float32,0xff2adf82,0xbfc90fdb,3 +np.float32,0x8012e2c1,0x8012e2c1,3 +np.float32,0x7f031be3,0x3fc90fdb,3 +np.float32,0x805ff94e,0x805ff94e,3 +np.float32,0x3e9d5b27,0x3e98aa31,3 +np.float32,0x3f56d5cf,0x3f32bc9e,3 +np.float32,0x3eaa0412,0x3ea4267f,3 +np.float32,0xbe899ea4,0xbe86712f,3 +np.float32,0x800f2f48,0x800f2f48,3 +np.float32,0x3f1c2269,0x3f0c33ea,3 +np.float32,0x3f4a5f64,0x3f2b3f28,3 +np.float32,0x80739318,0x80739318,3 +np.float32,0x806e9b47,0x806e9b47,3 +np.float32,0x3c8cd300,0x3c8ccf73,3 +np.float32,0x7f39a39d,0x3fc90fdb,3 +np.float32,0x3ec95d61,0x3ebfd9dc,3 +np.float32,0xff351ff8,0xbfc90fdb,3 +np.float32,0xff3a8f58,0xbfc90fdb,3 +np.float32,0x7f313ec0,0x3fc90fdb,3 +np.float32,0x803aed13,0x803aed13,3 +np.float32,0x7f771d9b,0x3fc90fdb,3 +np.float32,0x8045a6d6,0x8045a6d6,3 +np.float32,0xbc85f280,0xbc85ef72,3 +np.float32,0x7e9c68f5,0x3fc90fdb,3 +np.float32,0xbf0f9379,0xbf02d975,3 +np.float32,0x7e97bcb1,0x3fc90fdb,3 +np.float32,0x804a07d5,0x804a07d5,3 +np.float32,0x802e6117,0x802e6117,3 +np.float32,0x7ed5e388,0x3fc90fdb,3 +np.float32,0x80750455,0x80750455,3 +np.float32,0xff4a8325,0xbfc90fdb,3 +np.float32,0xbedb6866,0xbecf497c,3 +np.float32,0x52ea3b,0x52ea3b,3 +np.float32,0xff773172,0xbfc90fdb,3 +np.float32,0xbeaa8ff0,0xbea4a46e,3 +np.float32,0x7eef2058,0x3fc90fdb,3 +np.float32,0x3f712472,0x3f4169d3,3 +np.float32,0xff6c8608,0xbfc90fdb,3 +np.float32,0xbf6eaa41,0xbf40182a,3 +np.float32,0x3eb03c24,0x3ea9bb34,3 +np.float32,0xfe118cd4,0xbfc90fdb,3 +np.float32,0x3e5b03b0,0x3e57c378,3 +np.float32,0x7f34d92d,0x3fc90fdb,3 +np.float32,0x806c3418,0x806c3418,3 +np.float32,0x7f3074e3,0x3fc90fdb,3 +np.float32,0x8002df02,0x8002df02,3 +np.float32,0x3f6df63a,0x3f3fb7b7,3 +np.float32,0xfd2b4100,0xbfc90fdb,3 +np.float32,0x80363d5c,0x80363d5c,3 +np.float32,0xbeac1f98,0xbea60bd6,3 +np.float32,0xff7fffff,0xbfc90fdb,3 +np.float32,0x80045097,0x80045097,3 +np.float32,0xfe011100,0xbfc90fdb,3 +np.float32,0x80739ef5,0x80739ef5,3 +np.float32,0xff3976ed,0xbfc90fdb,3 +np.float32,0xbe18e3a0,0xbe17c49e,3 +np.float32,0xbe289294,0xbe2712f6,3 +np.float32,0x3f1d41e7,0x3f0d050e,3 +np.float32,0x39364a,0x39364a,3 +np.float32,0x8072b77e,0x8072b77e,3 +np.float32,0x3f7cfec0,0x3f478cf6,3 +np.float32,0x2f68f6,0x2f68f6,3 +np.float32,0xbf031fb8,0xbef25c84,3 +np.float32,0xbf0b842c,0xbeff7afc,3 +np.float32,0x3f081e7e,0x3efa3676,3 +np.float32,0x7f7fffff,0x3fc90fdb,3 +np.float32,0xff15da0e,0xbfc90fdb,3 +np.float32,0x3d2001b2,0x3d1fece1,3 +np.float32,0x7f76efef,0x3fc90fdb,3 +np.float32,0x3f2405dd,0x3f11dfb7,3 +np.float32,0xa0319,0xa0319,3 +np.float32,0x3e23d2bd,0x3e227255,3 +np.float32,0xbd4d4c50,0xbd4d205e,3 +np.float32,0x382344,0x382344,3 +np.float32,0x21bbf,0x21bbf,3 +np.float32,0xbf209e82,0xbf0f7239,3 +np.float32,0xff03bf9f,0xbfc90fdb,3 +np.float32,0x7b1789,0x7b1789,3 +np.float32,0xff314944,0xbfc90fdb,3 +np.float32,0x1a63eb,0x1a63eb,3 +np.float32,0x803dc983,0x803dc983,3 +np.float32,0x3f0ff558,0x3f0323dc,3 +np.float32,0x3f544f2c,0x3f313f58,3 +np.float32,0xff032948,0xbfc90fdb,3 +np.float32,0x7f4933cc,0x3fc90fdb,3 +np.float32,0x7f14c5ed,0x3fc90fdb,3 +np.float32,0x803aeebf,0x803aeebf,3 +np.float32,0xbf0d4c0f,0xbf011bf5,3 +np.float32,0xbeaf8de2,0xbea91f57,3 +np.float32,0xff3ae030,0xbfc90fdb,3 +np.float32,0xbb362d00,0xbb362ce1,3 +np.float32,0x3d1f79e0,0x3d1f6544,3 +np.float32,0x3f56e9d9,0x3f32c860,3 +np.float32,0x3f723e5e,0x3f41fee2,3 +np.float32,0x4c0179,0x4c0179,3 +np.float32,0xfee36132,0xbfc90fdb,3 +np.float32,0x619ae6,0x619ae6,3 +np.float32,0xfde5d670,0xbfc90fdb,3 +np.float32,0xff079ac5,0xbfc90fdb,3 +np.float32,0x3e974fbd,0x3e931fae,3 +np.float32,0x8020ae6b,0x8020ae6b,3 +np.float32,0x6b5af1,0x6b5af1,3 +np.float32,0xbeb57cd6,0xbeae69a3,3 +np.float32,0x806e7eb2,0x806e7eb2,3 +np.float32,0x7e666edb,0x3fc90fdb,3 +np.float32,0xbf458c18,0xbf283ff0,3 +np.float32,0x3e50518e,0x3e4d8399,3 +np.float32,0x3e9ce224,0x3e983b98,3 +np.float32,0x3e6bc067,0x3e67b6c6,3 +np.float32,0x13783d,0x13783d,3 +np.float32,0xff3d518c,0xbfc90fdb,3 +np.float32,0xfeba5968,0xbfc90fdb,3 +np.float32,0xbf0b9f76,0xbeffa50f,3 +np.float32,0xfe174900,0xbfc90fdb,3 +np.float32,0x3f38bb0a,0x3f200527,3 +np.float32,0x7e94a77d,0x3fc90fdb,3 +np.float32,0x29d776,0x29d776,3 +np.float32,0xbf4e058d,0xbf2d7a15,3 +np.float32,0xbd94abc8,0xbd946923,3 +np.float32,0xbee62db0,0xbed85124,3 +np.float32,0x800000,0x800000,3 +np.float32,0xbef1df7e,0xbee1f636,3 +np.float32,0xbcf3cd20,0xbcf3bab5,3 +np.float32,0x80007b05,0x80007b05,3 +np.float32,0x3d9b3f2e,0x3d9af351,3 +np.float32,0xbf714a68,0xbf417dee,3 +np.float32,0xbf2a2d37,0xbf163069,3 +np.float32,0x8055104f,0x8055104f,3 +np.float32,0x7f5c40d7,0x3fc90fdb,3 +np.float32,0x1,0x1,3 +np.float32,0xff35f3a6,0xbfc90fdb,3 +np.float32,0xd9c7c,0xd9c7c,3 +np.float32,0xbf440cfc,0xbf274f22,3 +np.float32,0x8050ac43,0x8050ac43,3 +np.float32,0x63ee16,0x63ee16,3 +np.float32,0x7d90419b,0x3fc90fdb,3 +np.float32,0xfee22198,0xbfc90fdb,3 +np.float32,0xc2ead,0xc2ead,3 +np.float32,0x7f5cd6a6,0x3fc90fdb,3 +np.float32,0x3f6fab7e,0x3f40a184,3 +np.float32,0x3ecf998c,0x3ec53a73,3 +np.float32,0x7e5271f0,0x3fc90fdb,3 +np.float32,0x67c016,0x67c016,3 +np.float32,0x2189c8,0x2189c8,3 +np.float32,0x27d892,0x27d892,3 +np.float32,0x3f0d02c4,0x3f00e3c0,3 +np.float32,0xbf69ebca,0xbf3d8862,3 +np.float32,0x3e60c0d6,0x3e5d3ebb,3 +np.float32,0x3f45206c,0x3f27fc66,3 +np.float32,0xbf6b47dc,0xbf3e4592,3 +np.float32,0xfe9be2e2,0xbfc90fdb,3 +np.float32,0x7fa00000,0x7fe00000,3 +np.float32,0xff271562,0xbfc90fdb,3 +np.float32,0x3e2e5270,0x3e2caaaf,3 +np.float32,0x80222934,0x80222934,3 +np.float32,0xbd01d220,0xbd01c701,3 +np.float32,0x223aa0,0x223aa0,3 +np.float32,0x3f4b5a7e,0x3f2bd967,3 +np.float32,0x3f217d85,0x3f101200,3 +np.float32,0xbf57663a,0xbf331144,3 +np.float32,0x3f219862,0x3f102536,3 +np.float32,0x28a28c,0x28a28c,3 +np.float32,0xbf3f55f4,0xbf244f86,3 +np.float32,0xbf3de287,0xbf236092,3 +np.float32,0xbf1c1ce2,0xbf0c2fe3,3 +np.float32,0x80000001,0x80000001,3 +np.float32,0x3db695d0,0x3db61a90,3 +np.float32,0x6c39bf,0x6c39bf,3 +np.float32,0x7e33a12f,0x3fc90fdb,3 +np.float32,0x67623a,0x67623a,3 +np.float32,0x3e45dc54,0x3e4373b6,3 +np.float32,0x7f62fa68,0x3fc90fdb,3 +np.float32,0x3f0e1d01,0x3f01bbe5,3 +np.float32,0x3f13dc69,0x3f0615f5,3 +np.float32,0x246703,0x246703,3 +np.float32,0xbf1055b5,0xbf036d07,3 +np.float32,0x7f46d3d0,0x3fc90fdb,3 +np.float32,0x3d2b8086,0x3d2b66e5,3 +np.float32,0xbf03be44,0xbef35776,3 +np.float32,0x3f800000,0x3f490fdb,3 +np.float32,0xbec8d226,0xbebf613d,3 +np.float32,0x3d8faf00,0x3d8f72d4,3 +np.float32,0x170c4e,0x170c4e,3 +np.float32,0xff14c0f0,0xbfc90fdb,3 +np.float32,0xff16245d,0xbfc90fdb,3 +np.float32,0x7f44ce6d,0x3fc90fdb,3 +np.float32,0xbe8175d8,0xbe7d9aeb,3 +np.float32,0x3df7a4a1,0x3df67254,3 +np.float32,0xfe2cc46c,0xbfc90fdb,3 +np.float32,0x3f284e63,0x3f14e335,3 +np.float32,0x7e46e5d6,0x3fc90fdb,3 +np.float32,0x397be4,0x397be4,3 +np.float32,0xbf2560bc,0xbf12d50b,3 +np.float32,0x3ed9b8c1,0x3ecddc60,3 +np.float32,0xfec18c5a,0xbfc90fdb,3 +np.float32,0x64894d,0x64894d,3 +np.float32,0x36a65d,0x36a65d,3 +np.float32,0x804ffcd7,0x804ffcd7,3 +np.float32,0x800f79e4,0x800f79e4,3 +np.float32,0x5d45ac,0x5d45ac,3 +np.float32,0x6cdda0,0x6cdda0,3 +np.float32,0xbf7f2077,0xbf489fe5,3 +np.float32,0xbf152f78,0xbf0713a1,3 +np.float32,0x807bf344,0x807bf344,3 +np.float32,0x3f775023,0x3f44a4d8,3 +np.float32,0xbf3edf67,0xbf240365,3 +np.float32,0x7eed729c,0x3fc90fdb,3 +np.float32,0x14cc29,0x14cc29,3 +np.float32,0x7edd7b6b,0x3fc90fdb,3 +np.float32,0xbf3c6e2c,0xbf226fb7,3 +np.float32,0x51b9ad,0x51b9ad,3 +np.float32,0x3f617ee8,0x3f38dd7c,3 +np.float32,0xff800000,0xbfc90fdb,3 +np.float32,0x7f440ea0,0x3fc90fdb,3 +np.float32,0x3e639893,0x3e5ff49e,3 +np.float32,0xbd791bb0,0xbd78cd3c,3 +np.float32,0x8059fcbc,0x8059fcbc,3 +np.float32,0xbf7d1214,0xbf4796bd,3 +np.float32,0x3ef368fa,0x3ee33788,3 +np.float32,0xbecec0f4,0xbec48055,3 +np.float32,0xbc83d940,0xbc83d656,3 +np.float32,0xbce01220,0xbce003d4,3 +np.float32,0x803192a5,0x803192a5,3 +np.float32,0xbe40e0c0,0xbe3ea4f0,3 +np.float32,0xfb692600,0xbfc90fdb,3 +np.float32,0x3f1bec65,0x3f0c0c88,3 +np.float32,0x7f042798,0x3fc90fdb,3 +np.float32,0xbe047374,0xbe03b83b,3 +np.float32,0x7f7c6630,0x3fc90fdb,3 +np.float32,0x7f58dae3,0x3fc90fdb,3 +np.float32,0x80691c92,0x80691c92,3 +np.float32,0x7dbe76,0x7dbe76,3 +np.float32,0xbf231384,0xbf11339d,3 +np.float32,0xbef4acf8,0xbee43f8b,3 +np.float32,0x3ee9f9d0,0x3edb7793,3 +np.float32,0x3f0064f6,0x3eee04a8,3 +np.float32,0x313732,0x313732,3 +np.float32,0xfd58cf80,0xbfc90fdb,3 +np.float32,0x3f7a2bc9,0x3f461d30,3 +np.float32,0x7f7681af,0x3fc90fdb,3 +np.float32,0x7f504211,0x3fc90fdb,3 +np.float32,0xfeae0c00,0xbfc90fdb,3 +np.float32,0xbee14396,0xbed436d1,3 +np.float32,0x7fc00000,0x7fc00000,3 +np.float32,0x693406,0x693406,3 +np.float32,0x3eb4a679,0x3eadab1b,3 +np.float32,0x550505,0x550505,3 +np.float32,0xfd493d10,0xbfc90fdb,3 +np.float32,0x3f4fc907,0x3f2e8b2c,3 +np.float32,0x80799aa4,0x80799aa4,3 +np.float32,0xff1ea89b,0xbfc90fdb,3 +np.float32,0xff424510,0xbfc90fdb,3 +np.float32,0x7f68d026,0x3fc90fdb,3 +np.float32,0xbea230ca,0xbe9d1200,3 +np.float32,0x7ea585da,0x3fc90fdb,3 +np.float32,0x3f3db211,0x3f23414c,3 +np.float32,0xfea4d964,0xbfc90fdb,3 +np.float32,0xbf17fe18,0xbf092984,3 +np.float32,0x7cc8a2,0x7cc8a2,3 +np.float32,0xff0330ba,0xbfc90fdb,3 +np.float32,0x3f769835,0x3f444592,3 +np.float32,0xeb0ac,0xeb0ac,3 +np.float32,0x7f7e45de,0x3fc90fdb,3 +np.float32,0xbdb510a8,0xbdb49873,3 +np.float32,0x3ebf900b,0x3eb74e9c,3 +np.float32,0xbf21bbce,0xbf103e89,3 +np.float32,0xbf3f4682,0xbf24459d,3 +np.float32,0x7eb6e9c8,0x3fc90fdb,3 +np.float32,0xbf42532d,0xbf2637be,3 +np.float32,0xbd3b2600,0xbd3b04b4,3 +np.float32,0x3f1fa9aa,0x3f0ec23e,3 +np.float32,0x7ed6a0f1,0x3fc90fdb,3 +np.float32,0xff4759a1,0xbfc90fdb,3 +np.float32,0x6d26e3,0x6d26e3,3 +np.float32,0xfe1108e0,0xbfc90fdb,3 +np.float32,0xfdf76900,0xbfc90fdb,3 +np.float32,0xfec66f22,0xbfc90fdb,3 +np.float32,0xbf3d097f,0xbf22d458,3 +np.float32,0x3d85be25,0x3d858d99,3 +np.float32,0x7f36739f,0x3fc90fdb,3 +np.float32,0x7bc0a304,0x3fc90fdb,3 +np.float32,0xff48dd90,0xbfc90fdb,3 +np.float32,0x48cab0,0x48cab0,3 +np.float32,0x3ed3943c,0x3ec8a2ef,3 +np.float32,0xbf61488e,0xbf38bede,3 +np.float32,0x3f543df5,0x3f313525,3 +np.float32,0x5cf2ca,0x5cf2ca,3 +np.float32,0x572686,0x572686,3 +np.float32,0x80369c7c,0x80369c7c,3 +np.float32,0xbd2c1d20,0xbd2c0338,3 +np.float32,0x3e255428,0x3e23ea0b,3 +np.float32,0xbeba9ee0,0xbeb2f54c,3 +np.float32,0x8015c165,0x8015c165,3 +np.float32,0x3d31f488,0x3d31d7e6,3 +np.float32,0x3f68591c,0x3f3cac43,3 +np.float32,0xf5ed5,0xf5ed5,3 +np.float32,0xbf3b1d34,0xbf21949e,3 +np.float32,0x1f0343,0x1f0343,3 +np.float32,0x3f0e52b5,0x3f01e4ef,3 +np.float32,0x7f57c596,0x3fc90fdb,3 +np.float64,0x7fd8e333ddb1c667,0x3ff921fb54442d18,3 +np.float64,0x800bcc9cdad7993a,0x800bcc9cdad7993a,3 +np.float64,0x3fcd6f81df3adf00,0x3fcceebbafc5d55e,3 +np.float64,0x3fed7338a57ae671,0x3fe7ce3e5811fc0a,3 +np.float64,0x7fe64994fcac9329,0x3ff921fb54442d18,3 +np.float64,0xfa5a6345f4b4d,0xfa5a6345f4b4d,3 +np.float64,0xe9dcd865d3b9b,0xe9dcd865d3b9b,3 +np.float64,0x7fea6cffabf4d9fe,0x3ff921fb54442d18,3 +np.float64,0xa9e1de6153c3c,0xa9e1de6153c3c,3 +np.float64,0xab6bdc5356d7c,0xab6bdc5356d7c,3 +np.float64,0x80062864a02c50ca,0x80062864a02c50ca,3 +np.float64,0xbfdac03aa7b58076,0xbfd9569f3230128d,3 +np.float64,0xbfe61b77752c36ef,0xbfe3588f51b8be8f,3 +np.float64,0x800bc854c8d790aa,0x800bc854c8d790aa,3 +np.float64,0x3feed1a2da3da346,0x3fe887f9b8ea031f,3 +np.float64,0x3fe910d3697221a7,0x3fe54365a53d840e,3 +np.float64,0x7fe7ab4944ef5692,0x3ff921fb54442d18,3 +np.float64,0x3fa462f1a028c5e3,0x3fa460303a6a4e69,3 +np.float64,0x800794f1a3af29e4,0x800794f1a3af29e4,3 +np.float64,0x3fee6fe7fafcdfd0,0x3fe854f863816d55,3 +np.float64,0x8000000000000000,0x8000000000000000,3 +np.float64,0x7f336472fe66d,0x7f336472fe66d,3 +np.float64,0xffb1623ac822c478,0xbff921fb54442d18,3 +np.float64,0x3fbacd68ce359ad2,0x3fbab480b3638846,3 +np.float64,0xffd5c02706ab804e,0xbff921fb54442d18,3 +np.float64,0xbfd4daf03d29b5e0,0xbfd42928f069c062,3 +np.float64,0x800c6e85dbd8dd0c,0x800c6e85dbd8dd0c,3 +np.float64,0x800e3599c5bc6b34,0x800e3599c5bc6b34,3 +np.float64,0x2c0d654c581ad,0x2c0d654c581ad,3 +np.float64,0xbfdd3eb13fba7d62,0xbfdb6e8143302de7,3 +np.float64,0x800b60cb8776c197,0x800b60cb8776c197,3 +np.float64,0x80089819ad113034,0x80089819ad113034,3 +np.float64,0x29fe721453fcf,0x29fe721453fcf,3 +np.float64,0x3fe8722f4df0e45f,0x3fe4e026d9eadb4d,3 +np.float64,0xffd1fbcd01a3f79a,0xbff921fb54442d18,3 +np.float64,0x7fc74e1e982e9c3c,0x3ff921fb54442d18,3 +np.float64,0x800c09d3d15813a8,0x800c09d3d15813a8,3 +np.float64,0xbfeee4578b3dc8af,0xbfe891ab3d6c3ce4,3 +np.float64,0xffdd01a6f33a034e,0xbff921fb54442d18,3 +np.float64,0x7fcc130480382608,0x3ff921fb54442d18,3 +np.float64,0xffcbb6bd1d376d7c,0xbff921fb54442d18,3 +np.float64,0xc068a53780d15,0xc068a53780d15,3 +np.float64,0xbfc974f15532e9e4,0xbfc92100b355f3e7,3 +np.float64,0x3fe6da79442db4f3,0x3fe3d87393b082e7,3 +np.float64,0xd9d9be4db3b38,0xd9d9be4db3b38,3 +np.float64,0x5ea50a20bd4a2,0x5ea50a20bd4a2,3 +np.float64,0xbfe5597f7d2ab2ff,0xbfe2d3ccc544b52b,3 +np.float64,0x80019364e4e326cb,0x80019364e4e326cb,3 +np.float64,0x3fed2902c3fa5206,0x3fe7a5e1df07e5c1,3 +np.float64,0xbfa7b72b5c2f6e50,0xbfa7b2d545b3cc1f,3 +np.float64,0xffdb60dd43b6c1ba,0xbff921fb54442d18,3 +np.float64,0x81a65d8b034cc,0x81a65d8b034cc,3 +np.float64,0x8000c30385818608,0x8000c30385818608,3 +np.float64,0x6022f5f4c045f,0x6022f5f4c045f,3 +np.float64,0x8007a2bb810f4578,0x8007a2bb810f4578,3 +np.float64,0x7fdc68893238d111,0x3ff921fb54442d18,3 +np.float64,0x7fd443454ea8868a,0x3ff921fb54442d18,3 +np.float64,0xffe6b04209ed6084,0xbff921fb54442d18,3 +np.float64,0x7fcd9733d13b2e67,0x3ff921fb54442d18,3 +np.float64,0xf5ee80a9ebdd0,0xf5ee80a9ebdd0,3 +np.float64,0x3fe3788e8de6f11e,0x3fe17dec7e6843a0,3 +np.float64,0x3fee36f62f7c6dec,0x3fe836f832515b43,3 +np.float64,0xf6cb49aded969,0xf6cb49aded969,3 +np.float64,0x3fd2b15ea4a562bc,0x3fd22fdc09920e67,3 +np.float64,0x7fccf6aef139ed5d,0x3ff921fb54442d18,3 +np.float64,0x3fd396b8ce272d72,0x3fd3026118857bd4,3 +np.float64,0x7fe53d3c80ea7a78,0x3ff921fb54442d18,3 +np.float64,0x3feae88fc4f5d120,0x3fe65fb04b18ef7a,3 +np.float64,0x3fedc643747b8c86,0x3fe7fafa6c20e25a,3 +np.float64,0xffdb2dc0df365b82,0xbff921fb54442d18,3 +np.float64,0xbfa2af3658255e70,0xbfa2ad17348f4253,3 +np.float64,0x3f8aa77b30354ef6,0x3f8aa71892336a69,3 +np.float64,0xbfdd1b1efbba363e,0xbfdb510dcd186820,3 +np.float64,0x800f50d99c5ea1b3,0x800f50d99c5ea1b3,3 +np.float64,0xff6ed602403dac00,0xbff921fb54442d18,3 +np.float64,0x800477d71aa8efaf,0x800477d71aa8efaf,3 +np.float64,0xbfe729a9e86e5354,0xbfe40ca78d9eefcf,3 +np.float64,0x3fd81ab2d4303566,0x3fd70d7e3937ea22,3 +np.float64,0xb617cbab6c2fa,0xb617cbab6c2fa,3 +np.float64,0x7fefffffffffffff,0x3ff921fb54442d18,3 +np.float64,0xffa40933ac281260,0xbff921fb54442d18,3 +np.float64,0xbfe1ede621e3dbcc,0xbfe057bb2b341ced,3 +np.float64,0xbfec700f03b8e01e,0xbfe73fb190bc722e,3 +np.float64,0x6e28af02dc517,0x6e28af02dc517,3 +np.float64,0x3fe37ad37ae6f5a7,0x3fe17f94674818a9,3 +np.float64,0x8000cbdeeae197bf,0x8000cbdeeae197bf,3 +np.float64,0x3fe8fd1f01f1fa3e,0x3fe5372bbec5d72c,3 +np.float64,0x3f8f9229103f2452,0x3f8f918531894256,3 +np.float64,0x800536858e0a6d0c,0x800536858e0a6d0c,3 +np.float64,0x7fe82bb4f9f05769,0x3ff921fb54442d18,3 +np.float64,0xffc1c2fb592385f8,0xbff921fb54442d18,3 +np.float64,0x7f924ddfc0249bbf,0x3ff921fb54442d18,3 +np.float64,0xffd5e125c52bc24c,0xbff921fb54442d18,3 +np.float64,0xbfef0d8738be1b0e,0xbfe8a6ef17b16c10,3 +np.float64,0x3fc9c8875233910f,0x3fc9715e708503cb,3 +np.float64,0xbfe2d926f4e5b24e,0xbfe108956e61cbb3,3 +np.float64,0x7fd61c496dac3892,0x3ff921fb54442d18,3 +np.float64,0x7fed545c6b7aa8b8,0x3ff921fb54442d18,3 +np.float64,0x8003746fea86e8e1,0x8003746fea86e8e1,3 +np.float64,0x3fdf515e75bea2bd,0x3fdd201a5585caa3,3 +np.float64,0xffda87c8ee350f92,0xbff921fb54442d18,3 +np.float64,0xffc675d8e22cebb0,0xbff921fb54442d18,3 +np.float64,0xffcdc173433b82e8,0xbff921fb54442d18,3 +np.float64,0xffed9df1517b3be2,0xbff921fb54442d18,3 +np.float64,0x3fd6a2eec72d45de,0x3fd5c1f1d7dcddcf,3 +np.float64,0xffec116a66f822d4,0xbff921fb54442d18,3 +np.float64,0x8007c2a2458f8545,0x8007c2a2458f8545,3 +np.float64,0x3fe4ee80d969dd02,0x3fe2895076094668,3 +np.float64,0x3fe3cae7116795ce,0x3fe1b9c07e0d03a7,3 +np.float64,0xbfd81bf8d8b037f2,0xbfd70e9bbbb4ca57,3 +np.float64,0x800c88ccd1f9119a,0x800c88ccd1f9119a,3 +np.float64,0xffdab2aee2b5655e,0xbff921fb54442d18,3 +np.float64,0x3fe743d227ee87a4,0x3fe41dcaef186d96,3 +np.float64,0x3fb060fd0220c1fa,0x3fb05b47f56ebbb4,3 +np.float64,0xbfd3f03772a7e06e,0xbfd3541522377291,3 +np.float64,0x190a5ae03216,0x190a5ae03216,3 +np.float64,0x3fe48c71916918e4,0x3fe24442f45b3183,3 +np.float64,0x800862470590c48e,0x800862470590c48e,3 +np.float64,0x7fd3ced89d279db0,0x3ff921fb54442d18,3 +np.float64,0x3feb3d9b4ab67b37,0x3fe69140cf2623f7,3 +np.float64,0xbc3f296b787e5,0xbc3f296b787e5,3 +np.float64,0xbfed6b905dfad721,0xbfe7ca1881a8c0fd,3 +np.float64,0xbfe621c2aaac4386,0xbfe35cd1969a82db,3 +np.float64,0x8009e7b17593cf63,0x8009e7b17593cf63,3 +np.float64,0x80045f580ca8beb1,0x80045f580ca8beb1,3 +np.float64,0xbfea2e177e745c2f,0xbfe5f13971633339,3 +np.float64,0x3fee655787fccab0,0x3fe84f6b98b6de26,3 +np.float64,0x3fc9cde92f339bd0,0x3fc9768a88b2c97c,3 +np.float64,0x3fc819c3b3303388,0x3fc7d25e1526e731,3 +np.float64,0x3fd3e848d2a7d090,0x3fd34cd9e6af558f,3 +np.float64,0x3fe19dacac633b5a,0x3fe01a6b4d27adc2,3 +np.float64,0x800b190da316321c,0x800b190da316321c,3 +np.float64,0xd5c69711ab8d3,0xd5c69711ab8d3,3 +np.float64,0xbfdc31bed7b8637e,0xbfda8ea3c1309d6d,3 +np.float64,0xbfd02ba007a05740,0xbfcfad86f0d756dc,3 +np.float64,0x3fe874473d70e88e,0x3fe4e1793cd82123,3 +np.float64,0xffb465585c28cab0,0xbff921fb54442d18,3 +np.float64,0xbfb5d8e13e2bb1c0,0xbfb5cb5c7807fc4d,3 +np.float64,0xffe80f933bf01f26,0xbff921fb54442d18,3 +np.float64,0x7feea783f5fd4f07,0x3ff921fb54442d18,3 +np.float64,0xbfae6665f43cccd0,0xbfae5d45b0a6f90a,3 +np.float64,0x800bd6ef5a77addf,0x800bd6ef5a77addf,3 +np.float64,0x800d145babda28b8,0x800d145babda28b8,3 +np.float64,0x39de155473bc3,0x39de155473bc3,3 +np.float64,0x3fefbd6bb1ff7ad8,0x3fe9008e73a3296e,3 +np.float64,0x3fc40bca3d281798,0x3fc3e2710e167007,3 +np.float64,0x3fcae0918335c120,0x3fca7e09e704a678,3 +np.float64,0x51287fbea2511,0x51287fbea2511,3 +np.float64,0x7fa6bc33a82d7866,0x3ff921fb54442d18,3 +np.float64,0xe72a2bebce546,0xe72a2bebce546,3 +np.float64,0x3fe1c8fd686391fa,0x3fe03b9622aeb4e3,3 +np.float64,0x3fe2a73ac3654e76,0x3fe0e36bc1ee4ac4,3 +np.float64,0x59895218b312b,0x59895218b312b,3 +np.float64,0xc6dc25c78db85,0xc6dc25c78db85,3 +np.float64,0xbfc06cfac520d9f4,0xbfc0561f85d2c907,3 +np.float64,0xbfea912dc4f5225c,0xbfe62c3b1c01c793,3 +np.float64,0x3fb78ce89a2f19d0,0x3fb77bfcb65a67d3,3 +np.float64,0xbfece5cdea39cb9c,0xbfe78103d24099e5,3 +np.float64,0x30d3054e61a61,0x30d3054e61a61,3 +np.float64,0xbfd3fe26fba7fc4e,0xbfd360c8447c4f7a,3 +np.float64,0x800956072a92ac0f,0x800956072a92ac0f,3 +np.float64,0x7fe639b3b6ec7366,0x3ff921fb54442d18,3 +np.float64,0x800ee30240bdc605,0x800ee30240bdc605,3 +np.float64,0x7fef6af0d2bed5e1,0x3ff921fb54442d18,3 +np.float64,0xffefce8725ff9d0d,0xbff921fb54442d18,3 +np.float64,0x3fe2e311da65c624,0x3fe10ff1623089dc,3 +np.float64,0xbfe7e5cbe56fcb98,0xbfe486c3daeda67c,3 +np.float64,0x80095bc14472b783,0x80095bc14472b783,3 +np.float64,0xffef0cb4553e1968,0xbff921fb54442d18,3 +np.float64,0xe3e60567c7cc1,0xe3e60567c7cc1,3 +np.float64,0xffde919f06bd233e,0xbff921fb54442d18,3 +np.float64,0x3fe3f9632e27f2c6,0x3fe1db49ebd21c4e,3 +np.float64,0x9dee9a233bdd4,0x9dee9a233bdd4,3 +np.float64,0xbfe3bb0602e7760c,0xbfe1ae41b6d4c488,3 +np.float64,0x3fc46945a128d288,0x3fc43da54c6c6a2a,3 +np.float64,0x7fdef149ac3de292,0x3ff921fb54442d18,3 +np.float64,0x800a96c76d752d8f,0x800a96c76d752d8f,3 +np.float64,0x3f971a32382e3464,0x3f9719316b9e9baf,3 +np.float64,0x7fe97bcf15b2f79d,0x3ff921fb54442d18,3 +np.float64,0x7fea894558f5128a,0x3ff921fb54442d18,3 +np.float64,0x3fc9e3be1933c780,0x3fc98b847c3923eb,3 +np.float64,0x3f7accac40359959,0x3f7acc9330741b64,3 +np.float64,0xa80c136950183,0xa80c136950183,3 +np.float64,0x3fe408732b2810e6,0x3fe1e61e7cbc8824,3 +np.float64,0xffa775bc042eeb80,0xbff921fb54442d18,3 +np.float64,0x3fbf04bd223e0980,0x3fbede37b8fc697e,3 +np.float64,0x7fd999b34c333366,0x3ff921fb54442d18,3 +np.float64,0xe72146dfce429,0xe72146dfce429,3 +np.float64,0x4f511ee49ea24,0x4f511ee49ea24,3 +np.float64,0xffb3e6e58827cdc8,0xbff921fb54442d18,3 +np.float64,0x3fd1f180cfa3e300,0x3fd17e85b2871de2,3 +np.float64,0x97c8e45b2f91d,0x97c8e45b2f91d,3 +np.float64,0xbfeeb20e88fd641d,0xbfe8778f878440bf,3 +np.float64,0xbfe1fc6dee23f8dc,0xbfe062c815a93cde,3 +np.float64,0xab4bf71f5697f,0xab4bf71f5697f,3 +np.float64,0xa9675a2952cec,0xa9675a2952cec,3 +np.float64,0xbfef3ea4a33e7d49,0xbfe8c02743ebc1b6,3 +np.float64,0x3fe22a2eafa4545d,0x3fe08577afca52a9,3 +np.float64,0x3fe8a08daaf1411c,0x3fe4fd5a34f05305,3 +np.float64,0xbfc6cda77b2d9b50,0xbfc6910bcfa0cf4f,3 +np.float64,0x3fec398394387307,0x3fe7211dd5276500,3 +np.float64,0x3fe36c95c626d92c,0x3fe1752e5aa2357b,3 +np.float64,0xffd8b9e7073173ce,0xbff921fb54442d18,3 +np.float64,0xffe19f043ae33e08,0xbff921fb54442d18,3 +np.float64,0x800e3640709c6c81,0x800e3640709c6c81,3 +np.float64,0x3fe7d6c20aafad84,0x3fe47d1a3307d9c8,3 +np.float64,0x80093fd63b727fad,0x80093fd63b727fad,3 +np.float64,0xffe1a671a4634ce3,0xbff921fb54442d18,3 +np.float64,0xbfe53a6b386a74d6,0xbfe2be41859cb10d,3 +np.float64,0xbfed149a097a2934,0xbfe79ab7e3e93c1c,3 +np.float64,0x7fc2769a5724ed34,0x3ff921fb54442d18,3 +np.float64,0xffd01e4e99a03c9e,0xbff921fb54442d18,3 +np.float64,0xa61f38434c3e7,0xa61f38434c3e7,3 +np.float64,0x800ad4ac5195a959,0x800ad4ac5195a959,3 +np.float64,0x7ff8000000000000,0x7ff8000000000000,3 +np.float64,0x80034a45b6c6948c,0x80034a45b6c6948c,3 +np.float64,0x6350b218c6a17,0x6350b218c6a17,3 +np.float64,0xfff0000000000000,0xbff921fb54442d18,3 +np.float64,0x3fe363e759e6c7cf,0x3fe16ed58d80f9ce,3 +np.float64,0xffe3b98e59e7731c,0xbff921fb54442d18,3 +np.float64,0x3fdbf7b40337ef68,0x3fda5df7ad3c80f9,3 +np.float64,0xbfe9cdf784739bef,0xbfe5b74f346ef93d,3 +np.float64,0xbfc321bea326437c,0xbfc2fdc0d4ff7561,3 +np.float64,0xbfe40f77d2a81ef0,0xbfe1eb28c4ae4dde,3 +np.float64,0x7fe071806960e300,0x3ff921fb54442d18,3 +np.float64,0x7fd269006ea4d200,0x3ff921fb54442d18,3 +np.float64,0x80017a56e0e2f4af,0x80017a56e0e2f4af,3 +np.float64,0x8004b4ea09a969d5,0x8004b4ea09a969d5,3 +np.float64,0xbfedbb01e63b7604,0xbfe7f4f0e84297df,3 +np.float64,0x3fe44454826888a9,0x3fe210ff6d005706,3 +np.float64,0xbfe0e77e6ea1cefd,0xbfdf1a977da33402,3 +np.float64,0xbfed6d4c8c3ada99,0xbfe7cb0932093f60,3 +np.float64,0x1d74cb9e3ae9a,0x1d74cb9e3ae9a,3 +np.float64,0x80082a785d1054f1,0x80082a785d1054f1,3 +np.float64,0x3fe58393266b0726,0x3fe2f0d8e91d4887,3 +np.float64,0xffe4028899680510,0xbff921fb54442d18,3 +np.float64,0x783a2e5af0746,0x783a2e5af0746,3 +np.float64,0x7fcdce88e73b9d11,0x3ff921fb54442d18,3 +np.float64,0x3fc58672a72b0ce5,0x3fc5535e090e56e2,3 +np.float64,0x800889c839b11391,0x800889c839b11391,3 +np.float64,0xffe5e05c466bc0b8,0xbff921fb54442d18,3 +np.float64,0xbfcbef6ebe37dedc,0xbfcb810752468f49,3 +np.float64,0xffe9408563b2810a,0xbff921fb54442d18,3 +np.float64,0xbfee4738367c8e70,0xbfe83f8e5dd7602f,3 +np.float64,0xbfe4aeb587295d6b,0xbfe25c7a0c76a454,3 +np.float64,0xffc9aea0a7335d40,0xbff921fb54442d18,3 +np.float64,0xe1e02199c3c04,0xe1e02199c3c04,3 +np.float64,0xbfbd9400783b2800,0xbfbd729345d1d14f,3 +np.float64,0x7a5418bcf4a84,0x7a5418bcf4a84,3 +np.float64,0x3fdc1c2fa5b83860,0x3fda7c935965ae72,3 +np.float64,0x80076a9f58ced53f,0x80076a9f58ced53f,3 +np.float64,0x3fedc4bf957b897f,0x3fe7fa2a83148f1c,3 +np.float64,0x800981b8a9d30372,0x800981b8a9d30372,3 +np.float64,0xffe1082311621046,0xbff921fb54442d18,3 +np.float64,0xe0091f89c0124,0xe0091f89c0124,3 +np.float64,0xbfce8d674f3d1ad0,0xbfcdfdbf2ddaa0ca,3 +np.float64,0x800516e72eaa2dcf,0x800516e72eaa2dcf,3 +np.float64,0xffe61ee64c6c3dcc,0xbff921fb54442d18,3 +np.float64,0x7fed2683cafa4d07,0x3ff921fb54442d18,3 +np.float64,0xffd4faf27729f5e4,0xbff921fb54442d18,3 +np.float64,0x7fe308fa842611f4,0x3ff921fb54442d18,3 +np.float64,0x3fc612a62b2c2550,0x3fc5db9ddbd4e159,3 +np.float64,0xbfe5b01e766b603d,0xbfe30f72a875e988,3 +np.float64,0x3fc2dd8b9a25bb17,0x3fc2bb06246b9f78,3 +np.float64,0x8170908102e12,0x8170908102e12,3 +np.float64,0x800c1c8a8a583915,0x800c1c8a8a583915,3 +np.float64,0xffe5d91e8b6bb23c,0xbff921fb54442d18,3 +np.float64,0xffd140adee22815c,0xbff921fb54442d18,3 +np.float64,0xbfe2f1f5f8e5e3ec,0xbfe11afa5d749952,3 +np.float64,0xbfed6d1d587ada3b,0xbfe7caef9ecf7651,3 +np.float64,0x3fe9b85e67f370bd,0x3fe5aa3474768982,3 +np.float64,0x7fdc8932edb91265,0x3ff921fb54442d18,3 +np.float64,0x7fd136bc54a26d78,0x3ff921fb54442d18,3 +np.float64,0x800a1ea12a343d43,0x800a1ea12a343d43,3 +np.float64,0x3fec6a5c1b78d4b8,0x3fe73c82235c3f8f,3 +np.float64,0x800fbf6a00df7ed4,0x800fbf6a00df7ed4,3 +np.float64,0xbfd0e6e0cda1cdc2,0xbfd0864bf8cad294,3 +np.float64,0x3fc716df482e2dbf,0x3fc6d7fbfd4a8470,3 +np.float64,0xbfe75990936eb321,0xbfe42bffec3fa0d7,3 +np.float64,0x3fd58e54a02b1ca9,0x3fd4cace1107a5cc,3 +np.float64,0xbfc9c04136338084,0xbfc9696ad2591d54,3 +np.float64,0xdd1f0147ba3e0,0xdd1f0147ba3e0,3 +np.float64,0x5c86a940b90e,0x5c86a940b90e,3 +np.float64,0xbfecae3b8e795c77,0xbfe7624d4988c612,3 +np.float64,0xffd0370595206e0c,0xbff921fb54442d18,3 +np.float64,0xbfdc26d443384da8,0xbfda857ecd33ba9f,3 +np.float64,0xbfd1c849d9a39094,0xbfd15849449cc378,3 +np.float64,0xffee04acdb3c0959,0xbff921fb54442d18,3 +np.float64,0xbfded1056dbda20a,0xbfdcb83b30e1528c,3 +np.float64,0x7fb7b826622f704c,0x3ff921fb54442d18,3 +np.float64,0xbfee4df8ae7c9bf1,0xbfe8431df9dfd05d,3 +np.float64,0x7fe7f3670e2fe6cd,0x3ff921fb54442d18,3 +np.float64,0x8008ac9ae0d15936,0x8008ac9ae0d15936,3 +np.float64,0x800dce9f3b3b9d3f,0x800dce9f3b3b9d3f,3 +np.float64,0x7fbb19db203633b5,0x3ff921fb54442d18,3 +np.float64,0x3fe56c7f302ad8fe,0x3fe2e0eec3ad45fd,3 +np.float64,0x7fe82c05c570580b,0x3ff921fb54442d18,3 +np.float64,0xc0552b7780aa6,0xc0552b7780aa6,3 +np.float64,0x39d40e3073a83,0x39d40e3073a83,3 +np.float64,0x3fd8db54d731b6aa,0x3fd7b589b3ee9b20,3 +np.float64,0xffcdd355233ba6ac,0xbff921fb54442d18,3 +np.float64,0x3fbe97b3a43d2f67,0x3fbe72bca9be0348,3 +np.float64,0xbff0000000000000,0xbfe921fb54442d18,3 +np.float64,0xbfb4f55e6229eac0,0xbfb4e96df18a75a7,3 +np.float64,0xbfc66399ba2cc734,0xbfc62a3298bd96fc,3 +np.float64,0x3fd00988bb201311,0x3fcf6d67a9374c38,3 +np.float64,0x7fe471867d28e30c,0x3ff921fb54442d18,3 +np.float64,0xbfe38e0e64271c1d,0xbfe18d9888b7523b,3 +np.float64,0x8009dc127573b825,0x8009dc127573b825,3 +np.float64,0x800047bde4608f7d,0x800047bde4608f7d,3 +np.float64,0xffeede42c77dbc85,0xbff921fb54442d18,3 +np.float64,0xd8cf6d13b19ee,0xd8cf6d13b19ee,3 +np.float64,0xbfd08fb302a11f66,0xbfd034b1f8235e23,3 +np.float64,0x7fdb404c0b368097,0x3ff921fb54442d18,3 +np.float64,0xbfd6ba0438ad7408,0xbfd5d673e3276ec1,3 +np.float64,0xffd9568027b2ad00,0xbff921fb54442d18,3 +np.float64,0xbfb313b73e262770,0xbfb30ab4acb4fa67,3 +np.float64,0xbfe2dc1a15e5b834,0xbfe10ac5f8f3acd3,3 +np.float64,0xbfee426bf4bc84d8,0xbfe83d061df91edd,3 +np.float64,0xd9142c2fb2286,0xd9142c2fb2286,3 +np.float64,0x7feb0d11dff61a23,0x3ff921fb54442d18,3 +np.float64,0x800fea5b509fd4b7,0x800fea5b509fd4b7,3 +np.float64,0x3fe1a8818da35103,0x3fe022ba1bdf366e,3 +np.float64,0x8010000000000000,0x8010000000000000,3 +np.float64,0xbfd8fc6de6b1f8dc,0xbfd7d24726ed8dcc,3 +np.float64,0xf4b3dc2de967c,0xf4b3dc2de967c,3 +np.float64,0x8af0409b15e08,0x8af0409b15e08,3 +np.float64,0x3fb21e6934243cd2,0x3fb216b065f8709a,3 +np.float64,0x3fc53069392a60d2,0x3fc4ffa931211fb9,3 +np.float64,0xffc955812c32ab04,0xbff921fb54442d18,3 +np.float64,0xbfe3de42b1a7bc86,0xbfe1c7bd1324de75,3 +np.float64,0x1dc149a03b82a,0x1dc149a03b82a,3 +np.float64,0x8001bc5a24a378b5,0x8001bc5a24a378b5,3 +np.float64,0x3da14c407b44,0x3da14c407b44,3 +np.float64,0x80025e8da924bd1c,0x80025e8da924bd1c,3 +np.float64,0xbfcb0141c9360284,0xbfca9d572ea5e1f3,3 +np.float64,0xc90036fd92007,0xc90036fd92007,3 +np.float64,0x138312c427063,0x138312c427063,3 +np.float64,0x800dda3a963bb475,0x800dda3a963bb475,3 +np.float64,0x3fe9339934f26732,0x3fe558e723291f78,3 +np.float64,0xbfea8357027506ae,0xbfe6240826faaf48,3 +np.float64,0x7fe04735cae08e6b,0x3ff921fb54442d18,3 +np.float64,0x3fe29aca3c653594,0x3fe0da214c8bc6a4,3 +np.float64,0x3fbe1f09a03c3e13,0x3fbdfbbefef0155b,3 +np.float64,0x816ee4ad02ddd,0x816ee4ad02ddd,3 +np.float64,0xffddd1b31d3ba366,0xbff921fb54442d18,3 +np.float64,0x3fe2e01e0625c03c,0x3fe10dc0bd6677c2,3 +np.float64,0x3fec6bcf1978d79e,0x3fe73d518cddeb7c,3 +np.float64,0x7fe01aaaf8603555,0x3ff921fb54442d18,3 +np.float64,0xdf300cc5be602,0xdf300cc5be602,3 +np.float64,0xbfe71c01a36e3804,0xbfe403af80ce47b8,3 +np.float64,0xffa5be00ac2b7c00,0xbff921fb54442d18,3 +np.float64,0xbfda9ba711b5374e,0xbfd93775e3ac6bda,3 +np.float64,0xbfe56d8a27eadb14,0xbfe2e1a7185e8e6d,3 +np.float64,0x800f1bc937be3792,0x800f1bc937be3792,3 +np.float64,0x800a61d93c74c3b3,0x800a61d93c74c3b3,3 +np.float64,0x7fe71a52fcae34a5,0x3ff921fb54442d18,3 +np.float64,0x7fb4aef256295de4,0x3ff921fb54442d18,3 +np.float64,0x3fe6c1e861ed83d1,0x3fe3c828f281a7ef,3 +np.float64,0x3fba128402342508,0x3fb9fb94cf141860,3 +np.float64,0x3fee55a7ecfcab50,0x3fe8472a9af893ee,3 +np.float64,0x3fe586f31b2b0de6,0x3fe2f32bce9e91bc,3 +np.float64,0xbfbb1d1442363a28,0xbfbb034c7729d5f2,3 +np.float64,0xc78b4d3f8f16a,0xc78b4d3f8f16a,3 +np.float64,0x7fdbc277d4b784ef,0x3ff921fb54442d18,3 +np.float64,0xbfa728ca2c2e5190,0xbfa724c04e73ccbd,3 +np.float64,0x7fefc7b2143f8f63,0x3ff921fb54442d18,3 +np.float64,0x3fd153a3dda2a748,0x3fd0ebccd33a4dca,3 +np.float64,0xbfe18a6eace314de,0xbfe00ba32ec89d30,3 +np.float64,0x7feef518537dea30,0x3ff921fb54442d18,3 +np.float64,0x8005f007cd4be010,0x8005f007cd4be010,3 +np.float64,0x7fd890b840b12170,0x3ff921fb54442d18,3 +np.float64,0x7feed0582ebda0af,0x3ff921fb54442d18,3 +np.float64,0x1013f53220280,0x1013f53220280,3 +np.float64,0xbfe77273986ee4e7,0xbfe43c375a8bf6de,3 +np.float64,0x7fe3ab8918675711,0x3ff921fb54442d18,3 +np.float64,0xbfc6ad515b2d5aa4,0xbfc671b2f7f86624,3 +np.float64,0x7fcd86231d3b0c45,0x3ff921fb54442d18,3 +np.float64,0xffe2523299a4a464,0xbff921fb54442d18,3 +np.float64,0x7fcadc5a1b35b8b3,0x3ff921fb54442d18,3 +np.float64,0x3fe5e020c4ebc042,0x3fe330418eec75bd,3 +np.float64,0x7fe332a9dc266553,0x3ff921fb54442d18,3 +np.float64,0xfa11dc21f425,0xfa11dc21f425,3 +np.float64,0xbec800177d900,0xbec800177d900,3 +np.float64,0x3fcadd057835ba0b,0x3fca7aa42face8bc,3 +np.float64,0xbfe6b9a206ad7344,0xbfe3c2a9719803de,3 +np.float64,0x3fbb4250b63684a0,0x3fbb281e9cefc519,3 +np.float64,0x7fef8787517f0f0e,0x3ff921fb54442d18,3 +np.float64,0x8001315c2d6262b9,0x8001315c2d6262b9,3 +np.float64,0xbfd94e3cf2b29c7a,0xbfd819257d36f56c,3 +np.float64,0xf1f325abe3e65,0xf1f325abe3e65,3 +np.float64,0x7fd6c07079ad80e0,0x3ff921fb54442d18,3 +np.float64,0x7fe328b075a65160,0x3ff921fb54442d18,3 +np.float64,0x7fe7998f812f331e,0x3ff921fb54442d18,3 +np.float64,0xffe026bb65604d76,0xbff921fb54442d18,3 +np.float64,0xffd6c06de8ad80dc,0xbff921fb54442d18,3 +np.float64,0x3fcd5a37bf3ab46f,0x3fccda82935d98ce,3 +np.float64,0xffc3e5a45227cb48,0xbff921fb54442d18,3 +np.float64,0x3febf7dd8177efbc,0x3fe6fc0bb999883e,3 +np.float64,0x7fd7047ea92e08fc,0x3ff921fb54442d18,3 +np.float64,0x35b3fc406b680,0x35b3fc406b680,3 +np.float64,0x7fd52e97632a5d2e,0x3ff921fb54442d18,3 +np.float64,0x3fd464d401a8c9a8,0x3fd3be2967fc97c3,3 +np.float64,0x800e815b2ebd02b6,0x800e815b2ebd02b6,3 +np.float64,0x3fca8428af350850,0x3fca257b466b8970,3 +np.float64,0x8007b7526f6f6ea6,0x8007b7526f6f6ea6,3 +np.float64,0x82f60a8f05ec2,0x82f60a8f05ec2,3 +np.float64,0x3fb71a5d0a2e34c0,0x3fb70a629ef8e2a2,3 +np.float64,0x7fc8570c7d30ae18,0x3ff921fb54442d18,3 +np.float64,0x7fe5528e77eaa51c,0x3ff921fb54442d18,3 +np.float64,0xffc20dbbf1241b78,0xbff921fb54442d18,3 +np.float64,0xeb13368fd6267,0xeb13368fd6267,3 +np.float64,0x7fe7d529056faa51,0x3ff921fb54442d18,3 +np.float64,0x3fecd02eabf9a05d,0x3fe77516f0ba1ac4,3 +np.float64,0x800fcba6a09f974d,0x800fcba6a09f974d,3 +np.float64,0x7fe7e8e015afd1bf,0x3ff921fb54442d18,3 +np.float64,0xbfd271a382a4e348,0xbfd1f513a191c595,3 +np.float64,0x9f1014013e21,0x9f1014013e21,3 +np.float64,0x3fc05da47f20bb49,0x3fc04708a13a3a47,3 +np.float64,0x3fe0f427dda1e850,0x3fdf2e60ba8678b9,3 +np.float64,0xbfecb29fa539653f,0xbfe764bc791c45dd,3 +np.float64,0x45881ec68b104,0x45881ec68b104,3 +np.float64,0x8000000000000001,0x8000000000000001,3 +np.float64,0x3fe9c67ee1338cfe,0x3fe5b2c7b3df6ce8,3 +np.float64,0x7fedb8fef6bb71fd,0x3ff921fb54442d18,3 +np.float64,0x3fe54f6aaaea9ed6,0x3fe2ccd1df2abaa9,3 +np.float64,0x7feff58a1bbfeb13,0x3ff921fb54442d18,3 +np.float64,0x7fe3b62827276c4f,0x3ff921fb54442d18,3 +np.float64,0x3fe5feb682ebfd6d,0x3fe345105bc6d980,3 +np.float64,0x3fe49f38d9693e72,0x3fe2518b2824757f,3 +np.float64,0x8006bfd27c6d7fa6,0x8006bfd27c6d7fa6,3 +np.float64,0x3fc13409e2226814,0x3fc119ce0c01a5a2,3 +np.float64,0x95f8c7212bf19,0x95f8c7212bf19,3 +np.float64,0x3fd9f0fa6133e1f5,0x3fd8a567515edecf,3 +np.float64,0x3fef95cbe5ff2b98,0x3fe8ec88c768ba0b,3 +np.float64,0x3fbed28bba3da510,0x3fbeacbf136e51c2,3 +np.float64,0xbfd3987aeca730f6,0xbfd303fca58e3e60,3 +np.float64,0xbfed0f90cbfa1f22,0xbfe797f59249410d,3 +np.float64,0xffe55d8cbf2abb19,0xbff921fb54442d18,3 +np.float64,0x3feb4d9fc6769b40,0x3fe69a88131a1f1f,3 +np.float64,0x80085569acd0aad4,0x80085569acd0aad4,3 +np.float64,0x20557a6e40ab0,0x20557a6e40ab0,3 +np.float64,0x3fead2fd5df5a5fb,0x3fe653091f33b27f,3 +np.float64,0x3fe7b9983eaf7330,0x3fe46a50c4b5235e,3 +np.float64,0xffdad237ffb5a470,0xbff921fb54442d18,3 +np.float64,0xbfe5cc39a4eb9874,0xbfe322ad3a903f93,3 +np.float64,0x800ad6eecb35adde,0x800ad6eecb35adde,3 +np.float64,0xffec620f6438c41e,0xbff921fb54442d18,3 +np.float64,0xbfe5ef29122bde52,0xbfe33a7dfcc255e2,3 +np.float64,0x3fd451e7d0a8a3d0,0x3fd3acfa4939af10,3 +np.float64,0x8003ea93c127d528,0x8003ea93c127d528,3 +np.float64,0x800b48d37c9691a7,0x800b48d37c9691a7,3 +np.float64,0x3fe7e202acafc405,0x3fe484558246069b,3 +np.float64,0x80070c9b686e1938,0x80070c9b686e1938,3 +np.float64,0xbfda90bbc6352178,0xbfd92e25fcd12288,3 +np.float64,0x800e1ffebb1c3ffe,0x800e1ffebb1c3ffe,3 +np.float64,0x3ff0000000000000,0x3fe921fb54442d18,3 +np.float64,0xffd8cfdd46319fba,0xbff921fb54442d18,3 +np.float64,0x7fd8cd4182319a82,0x3ff921fb54442d18,3 +np.float64,0x3fed8bb778bb176f,0x3fe7db7c77c4c694,3 +np.float64,0x3fc74a70302e94e0,0x3fc709e95d6defec,3 +np.float64,0x3fe87269d070e4d4,0x3fe4e04bcc4a2137,3 +np.float64,0x7fb48223f6290447,0x3ff921fb54442d18,3 +np.float64,0xffe8ec444b71d888,0xbff921fb54442d18,3 +np.float64,0x7fde17d280bc2fa4,0x3ff921fb54442d18,3 +np.float64,0x3fd1cbde01a397bc,0x3fd15b9bb7b3147b,3 +np.float64,0x800883a64451074d,0x800883a64451074d,3 +np.float64,0x7fe3160a3f262c13,0x3ff921fb54442d18,3 +np.float64,0xbfe051d4d9a0a3aa,0xbfde2ecf14dc75fb,3 +np.float64,0xbfd89de689b13bce,0xbfd780176d1a28a3,3 +np.float64,0x3fecde2bf779bc58,0x3fe77ccf10bdd8e2,3 +np.float64,0xffe75774dc6eaee9,0xbff921fb54442d18,3 +np.float64,0x7fe834414d706882,0x3ff921fb54442d18,3 +np.float64,0x1,0x1,3 +np.float64,0xbfea5e4e4a74bc9c,0xbfe60e0601711835,3 +np.float64,0xffec248d4cb8491a,0xbff921fb54442d18,3 +np.float64,0xffd9942c2c332858,0xbff921fb54442d18,3 +np.float64,0xa9db36a553b67,0xa9db36a553b67,3 +np.float64,0x7fec630718b8c60d,0x3ff921fb54442d18,3 +np.float64,0xbfd062188f20c432,0xbfd009ecd652be89,3 +np.float64,0x8001b84e3023709d,0x8001b84e3023709d,3 +np.float64,0xbfe9e26d7cb3c4db,0xbfe5c3b157ecf668,3 +np.float64,0xbfef66ddf33ecdbc,0xbfe8d4b1f6410a24,3 +np.float64,0x3fd8d7109431ae21,0x3fd7b1d4860719a2,3 +np.float64,0xffee0f53107c1ea5,0xbff921fb54442d18,3 +np.float64,0x80000b4fd60016a0,0x80000b4fd60016a0,3 +np.float64,0xbfd99ff6e5333fee,0xbfd85fb3cbdaa049,3 +np.float64,0xbfe9cfd268339fa5,0xbfe5b86ef021a1b1,3 +np.float64,0xe32eace1c65d6,0xe32eace1c65d6,3 +np.float64,0xffc81f6627303ecc,0xbff921fb54442d18,3 +np.float64,0x7fe98dadde331b5b,0x3ff921fb54442d18,3 +np.float64,0xbfbcebd11e39d7a0,0xbfbccc8ec47883c7,3 +np.float64,0x7fe164880f22c90f,0x3ff921fb54442d18,3 +np.float64,0x800467c0cae8cf82,0x800467c0cae8cf82,3 +np.float64,0x800071e4b140e3ca,0x800071e4b140e3ca,3 +np.float64,0xbfc87a7eae30f4fc,0xbfc82fbc55bb0f24,3 +np.float64,0xffb2e0e23225c1c8,0xbff921fb54442d18,3 +np.float64,0x20ef338041df,0x20ef338041df,3 +np.float64,0x7fe6de71ca6dbce3,0x3ff921fb54442d18,3 +np.float64,0x5d1fa026ba3f5,0x5d1fa026ba3f5,3 +np.float64,0xffd112a9ce222554,0xbff921fb54442d18,3 +np.float64,0x3fb351f66626a3ed,0x3fb3489ab578c452,3 +np.float64,0x7fef7b2bd3bef657,0x3ff921fb54442d18,3 +np.float64,0xffe144f5d4e289eb,0xbff921fb54442d18,3 +np.float64,0xffd63a6750ac74ce,0xbff921fb54442d18,3 +np.float64,0x7fd2d8bb25a5b175,0x3ff921fb54442d18,3 +np.float64,0x3fec5920a078b242,0x3fe732dcffcf6521,3 +np.float64,0x80009a8b7f813518,0x80009a8b7f813518,3 +np.float64,0x3fdea220893d4441,0x3fdc921edf6bf3d8,3 +np.float64,0x8006cee2208d9dc5,0x8006cee2208d9dc5,3 +np.float64,0xdd0b0081ba17,0xdd0b0081ba17,3 +np.float64,0x7ff4000000000000,0x7ffc000000000000,3 +np.float64,0xbfdac33955358672,0xbfd9592bce7daf1f,3 +np.float64,0x7fe8301d7170603a,0x3ff921fb54442d18,3 +np.float64,0xbfc1d34d8523a69c,0xbfc1b62449af9684,3 +np.float64,0x800c62239458c447,0x800c62239458c447,3 +np.float64,0xffd398c009a73180,0xbff921fb54442d18,3 +np.float64,0xbfe0c6d9ee218db4,0xbfdee777557f4401,3 +np.float64,0x3feccdd373799ba7,0x3fe773c9c2263f89,3 +np.float64,0xbfd21898bda43132,0xbfd1a2be8545fcc5,3 +np.float64,0x3fd77019b62ee033,0x3fd67793cabdf267,3 +np.float64,0x7fa609cad42c1395,0x3ff921fb54442d18,3 +np.float64,0x7fb4eaea5a29d5d4,0x3ff921fb54442d18,3 +np.float64,0x3fc570dc9a2ae1b9,0x3fc53e5f6218a799,3 +np.float64,0x800344ae8466895e,0x800344ae8466895e,3 +np.float64,0xbfc7c985252f930c,0xbfc784d60fa27bac,3 +np.float64,0xffaa2929fc345250,0xbff921fb54442d18,3 +np.float64,0xffe63e5ee9ac7cbe,0xbff921fb54442d18,3 +np.float64,0x73f0280ce7e06,0x73f0280ce7e06,3 +np.float64,0xffc525f8822a4bf0,0xbff921fb54442d18,3 +np.float64,0x7fd744d00aae899f,0x3ff921fb54442d18,3 +np.float64,0xbfe0fe590761fcb2,0xbfdf3e493e8b1f32,3 +np.float64,0xfae04ae7f5c0a,0xfae04ae7f5c0a,3 +np.float64,0xef821939df043,0xef821939df043,3 +np.float64,0x7fef6135843ec26a,0x3ff921fb54442d18,3 +np.float64,0xbfebf34dcbf7e69c,0xbfe6f97588a8f911,3 +np.float64,0xbfeec0b498fd8169,0xbfe87f2eceeead12,3 +np.float64,0x7fb67161b42ce2c2,0x3ff921fb54442d18,3 +np.float64,0x3fdcfd998639fb33,0x3fdb38934927c096,3 +np.float64,0xffda5960bc34b2c2,0xbff921fb54442d18,3 +np.float64,0xbfe11f8c71223f19,0xbfdf71fe770c96ab,3 +np.float64,0x3fe4ac1bab695838,0x3fe25aa4517b8322,3 +np.float64,0x3f730458a02608b1,0x3f73044fabb5e999,3 +np.float64,0x3fdb14ffcdb62a00,0x3fd99ea6c241a3ed,3 +np.float64,0xbfc93208cd326410,0xbfc8e09d78b6d4db,3 +np.float64,0x19e734dc33ce8,0x19e734dc33ce8,3 +np.float64,0x3fe5e98428abd308,0x3fe336a6a085eb55,3 +np.float64,0x7fec672a1378ce53,0x3ff921fb54442d18,3 +np.float64,0x800f8bd8d4ff17b2,0x800f8bd8d4ff17b2,3 +np.float64,0xbfe5a12e4e6b425c,0xbfe30533f99d5d06,3 +np.float64,0x75a34cb0eb46a,0x75a34cb0eb46a,3 +np.float64,0x7fe1d21d16a3a439,0x3ff921fb54442d18,3 +np.float64,0x7ff0000000000000,0x3ff921fb54442d18,3 +np.float64,0xffe0f50db261ea1b,0xbff921fb54442d18,3 +np.float64,0xbfd9dc22feb3b846,0xbfd8937ec965a501,3 +np.float64,0x8009d68e48d3ad1d,0x8009d68e48d3ad1d,3 +np.float64,0xbfe2eba620e5d74c,0xbfe1164d7d273c60,3 +np.float64,0x992efa09325e0,0x992efa09325e0,3 +np.float64,0x3fdab640ea356c82,0x3fd94e20cab88db2,3 +np.float64,0x69a6f04ad34df,0x69a6f04ad34df,3 +np.float64,0x3fe397df25272fbe,0x3fe194bd1a3a6192,3 +np.float64,0xebcce9fdd799d,0xebcce9fdd799d,3 +np.float64,0x3fbb49490c369292,0x3fbb2f02eccc497d,3 +np.float64,0xffd871f980b0e3f4,0xbff921fb54442d18,3 +np.float64,0x800348f6966691ee,0x800348f6966691ee,3 +np.float64,0xbfebc270a7f784e1,0xbfe6dda8d0d80f26,3 +np.float64,0xffd6d559b1adaab4,0xbff921fb54442d18,3 +np.float64,0x3fec3635c0b86c6c,0x3fe71f420256e43e,3 +np.float64,0x7fbc82ad7039055a,0x3ff921fb54442d18,3 +np.float64,0x7f873050602e60a0,0x3ff921fb54442d18,3 +np.float64,0x3fca44b8c3348970,0x3fc9e8a1a1a2d96e,3 +np.float64,0x3fe0fc308fe1f861,0x3fdf3aeb469ea225,3 +np.float64,0x7fefc27de8bf84fb,0x3ff921fb54442d18,3 +np.float64,0x8005f3f3916be7e8,0x8005f3f3916be7e8,3 +np.float64,0xbfd4278c7c284f18,0xbfd38678988873b6,3 +np.float64,0x435eafc486bd7,0x435eafc486bd7,3 +np.float64,0xbfd01f5199203ea4,0xbfcf96631f2108a3,3 +np.float64,0xffd5ee9185abdd24,0xbff921fb54442d18,3 +np.float64,0xffedb363257b66c5,0xbff921fb54442d18,3 +np.float64,0x800d68e6e11ad1ce,0x800d68e6e11ad1ce,3 +np.float64,0xbfcf687f8e3ed100,0xbfceccb771b0d39a,3 +np.float64,0x7feb3b9ef2f6773d,0x3ff921fb54442d18,3 +np.float64,0x3fe15ec5ca62bd8c,0x3fdfd3fab9d96f81,3 +np.float64,0x10000000000000,0x10000000000000,3 +np.float64,0xd2386f81a470e,0xd2386f81a470e,3 +np.float64,0xb9feed4573fde,0xb9feed4573fde,3 +np.float64,0x3fe7ed25c9efda4c,0x3fe48b7b72db4014,3 +np.float64,0xbfe01478726028f1,0xbfddcd1f5a2efc59,3 +np.float64,0x9946d02f328da,0x9946d02f328da,3 +np.float64,0xbfe3bb67f06776d0,0xbfe1ae88aa81c5a6,3 +np.float64,0xbfd3fd8a4c27fb14,0xbfd3603982e3b78d,3 +np.float64,0xffd5c3ab912b8758,0xbff921fb54442d18,3 +np.float64,0xffd5f502b12bea06,0xbff921fb54442d18,3 +np.float64,0xbfc64981ec2c9304,0xbfc610e0382b1fa6,3 +np.float64,0xffec42e3413885c6,0xbff921fb54442d18,3 +np.float64,0x80084eb4ed109d6a,0x80084eb4ed109d6a,3 +np.float64,0xbfd17cac9fa2f95a,0xbfd112020588a4b3,3 +np.float64,0xbfd06c1359a0d826,0xbfd0134a28aa9a66,3 +np.float64,0x7fdc3d7c03b87af7,0x3ff921fb54442d18,3 +np.float64,0x7bdf5aaaf7bec,0x7bdf5aaaf7bec,3 +np.float64,0xbfee3cd966fc79b3,0xbfe83a14bc07ac3b,3 +np.float64,0x7fec910da3f9221a,0x3ff921fb54442d18,3 +np.float64,0xffb4ea667029d4d0,0xbff921fb54442d18,3 +np.float64,0x800103d7cce207b0,0x800103d7cce207b0,3 +np.float64,0x7fbb229a6c364534,0x3ff921fb54442d18,3 +np.float64,0x0,0x0,3 +np.float64,0xffd8fccd0331f99a,0xbff921fb54442d18,3 +np.float64,0xbfd0784ae1a0f096,0xbfd01ebff62e39ad,3 +np.float64,0xbfed2ec9b3ba5d93,0xbfe7a9099410bc76,3 +np.float64,0x800690b8d16d2172,0x800690b8d16d2172,3 +np.float64,0x7fc061b26520c364,0x3ff921fb54442d18,3 +np.float64,0x8007ec47054fd88f,0x8007ec47054fd88f,3 +np.float64,0x775546b6eeaa9,0x775546b6eeaa9,3 +np.float64,0x8005e00fb56bc020,0x8005e00fb56bc020,3 +np.float64,0xbfe510f8d0ea21f2,0xbfe2a16862b5a37f,3 +np.float64,0xffd87a6bf3b0f4d8,0xbff921fb54442d18,3 +np.float64,0x800906e3d0520dc8,0x800906e3d0520dc8,3 +np.float64,0x2296f000452f,0x2296f000452f,3 +np.float64,0xbfe3189fa2e63140,0xbfe1378c0e005be4,3 +np.float64,0xb4d2447f69a49,0xb4d2447f69a49,3 +np.float64,0xffd056a24a20ad44,0xbff921fb54442d18,3 +np.float64,0xbfe3b23fe4e76480,0xbfe1a7e5840fcbeb,3 +np.float64,0x80018ee270831dc6,0x80018ee270831dc6,3 +np.float64,0x800df89f245bf13e,0x800df89f245bf13e,3 +np.float64,0x3fee1409d7bc2814,0x3fe824779d133232,3 +np.float64,0xbfef8d81667f1b03,0xbfe8e85523620368,3 +np.float64,0xffd8a6519b314ca4,0xbff921fb54442d18,3 +np.float64,0x7fc7bc86f32f790d,0x3ff921fb54442d18,3 +np.float64,0xffea6159e674c2b3,0xbff921fb54442d18,3 +np.float64,0x3fe153c3fba2a788,0x3fdfc2f74769d300,3 +np.float64,0xffc4261ef3284c3c,0xbff921fb54442d18,3 +np.float64,0x7fe8a8961ff1512b,0x3ff921fb54442d18,3 +np.float64,0xbfe3fb1fd167f640,0xbfe1dc89dcb7ecdf,3 +np.float64,0x3fd88577c2b10af0,0x3fd76acc09660704,3 +np.float64,0x3fe128ec27e251d8,0x3fdf808fc7ebcd8f,3 +np.float64,0xbfed6ca7c4fad950,0xbfe7caafe9a3e213,3 +np.float64,0xbf9a3912b8347220,0xbf9a379b3349352e,3 +np.float64,0xbfd724d7bcae49b0,0xbfd6351efa2a5fc5,3 +np.float64,0xbfed59700a7ab2e0,0xbfe7c043014c694c,3 +np.float64,0x8002ad435bc55a87,0x8002ad435bc55a87,3 +np.float64,0xffe46ed345a8dda6,0xbff921fb54442d18,3 +np.float64,0x7fd2f1d1d825e3a3,0x3ff921fb54442d18,3 +np.float64,0xbfea0265e23404cc,0xbfe5d6fb3fd30464,3 +np.float64,0xbfd17e049122fc0a,0xbfd113421078bbae,3 +np.float64,0xffea03b986b40772,0xbff921fb54442d18,3 +np.float64,0x800b55331a16aa67,0x800b55331a16aa67,3 +np.float64,0xbfc6fcafbf2df960,0xbfc6be9ecd0ebc1f,3 +np.float64,0xd6a36017ad46c,0xd6a36017ad46c,3 +np.float64,0xbfe9ba86dfb3750e,0xbfe5ab840cb0ef86,3 +np.float64,0x75c4a108eb895,0x75c4a108eb895,3 +np.float64,0x8008d6bc8051ad79,0x8008d6bc8051ad79,3 +np.float64,0xbfd3dc5984a7b8b4,0xbfd341f78e0528ec,3 +np.float64,0xffe1cbb01aa39760,0xbff921fb54442d18,3 +np.float64,0x3fc7e292f52fc526,0x3fc79d0ce9365767,3 +np.float64,0xbfcbeae2bd37d5c4,0xbfcb7cb034f82467,3 +np.float64,0x8000f0c62e21e18d,0x8000f0c62e21e18d,3 +np.float64,0xbfe23d8bc6247b18,0xbfe09418ee35c3c7,3 +np.float64,0x717394bae2e73,0x717394bae2e73,3 +np.float64,0xffa2ef1cc425de40,0xbff921fb54442d18,3 +np.float64,0x3fd938c229b27184,0x3fd806900735c99d,3 +np.float64,0x800bf3ec8a77e7d9,0x800bf3ec8a77e7d9,3 +np.float64,0xffeef41dd57de83b,0xbff921fb54442d18,3 +np.float64,0x8008df97e5b1bf30,0x8008df97e5b1bf30,3 +np.float64,0xffe9ab9d0db35739,0xbff921fb54442d18,3 +np.float64,0x99ff391333fe7,0x99ff391333fe7,3 +np.float64,0x3fb864b4a630c969,0x3fb851e883ea2cf9,3 +np.float64,0x22c1230a45825,0x22c1230a45825,3 +np.float64,0xff2336fbfe467,0xff2336fbfe467,3 +np.float64,0xbfd488f4cea911ea,0xbfd3def0490f5414,3 +np.float64,0x3fa379c78426f38f,0x3fa377607370800b,3 +np.float64,0xbfb0873302210e68,0xbfb08155b78dfd53,3 +np.float64,0xbfdf9ff7c2bf3ff0,0xbfdd5f658e357ad2,3 +np.float64,0x800978719192f0e4,0x800978719192f0e4,3 +np.float64,0xbfba8759ea350eb0,0xbfba6f325013b9e5,3 +np.float64,0xbfdd3e6b06ba7cd6,0xbfdb6e472b6091b0,3 +np.float64,0x7fe0c334a7a18668,0x3ff921fb54442d18,3 +np.float64,0xbfeb971feb772e40,0xbfe6c4e0f61404d1,3 +np.float64,0x3fe2a50968e54a13,0x3fe0e1c8b8d96e85,3 +np.float64,0x800fa9c5515f538b,0x800fa9c5515f538b,3 +np.float64,0x800f8532fbbf0a66,0x800f8532fbbf0a66,3 +np.float64,0x167d6f1e2cfaf,0x167d6f1e2cfaf,3 +np.float64,0xffee88e769fd11ce,0xbff921fb54442d18,3 +np.float64,0xbfeecc8529fd990a,0xbfe885520cdad8ea,3 +np.float64,0xffefffffffffffff,0xbff921fb54442d18,3 +np.float64,0xbfef6a566afed4ad,0xbfe8d6767b4c4235,3 +np.float64,0xffec12415af82482,0xbff921fb54442d18,3 +np.float64,0x3678a20a6cf15,0x3678a20a6cf15,3 +np.float64,0xffe468d54ee8d1aa,0xbff921fb54442d18,3 +np.float64,0x800ad6006795ac01,0x800ad6006795ac01,3 +np.float64,0x8001d5b61063ab6d,0x8001d5b61063ab6d,3 +np.float64,0x800dfcd1863bf9a3,0x800dfcd1863bf9a3,3 +np.float64,0xc9fbff6f93f80,0xc9fbff6f93f80,3 +np.float64,0xffe55c20f9eab842,0xbff921fb54442d18,3 +np.float64,0xbfcb596b6536b2d8,0xbfcaf1b339c5c615,3 +np.float64,0xbfe092689ea124d1,0xbfde94fa58946e51,3 +np.float64,0x3fe9ec733af3d8e6,0x3fe5c9bf5dee2623,3 +np.float64,0x3fe30f3d83261e7b,0x3fe1309fd6620e03,3 +np.float64,0xffd31d7f84263b00,0xbff921fb54442d18,3 +np.float64,0xbfe88d2d3e711a5a,0xbfe4f12b5a136178,3 +np.float64,0xffc81e4ce1303c98,0xbff921fb54442d18,3 +np.float64,0xffe5b96ebfab72dd,0xbff921fb54442d18,3 +np.float64,0x512f0502a25e1,0x512f0502a25e1,3 +np.float64,0x7fa3a376982746ec,0x3ff921fb54442d18,3 +np.float64,0x80005b5f2f60b6bf,0x80005b5f2f60b6bf,3 +np.float64,0xc337cc69866fa,0xc337cc69866fa,3 +np.float64,0x3fe7719c4caee339,0x3fe43bab42b19e64,3 +np.float64,0x7fde7ec1d93cfd83,0x3ff921fb54442d18,3 +np.float64,0x3fd2f38f3825e71e,0x3fd26cc7b1dd0acb,3 +np.float64,0x7fce298b993c5316,0x3ff921fb54442d18,3 +np.float64,0x56ae3b2cad5c8,0x56ae3b2cad5c8,3 +np.float64,0x3fe9299f2bf2533e,0x3fe552bddd999e72,3 +np.float64,0x7feff3a4823fe748,0x3ff921fb54442d18,3 +np.float64,0xbfd05c670aa0b8ce,0xbfd00494d78e9e97,3 +np.float64,0xffe745323eae8a64,0xbff921fb54442d18,3 diff --git a/shared/package-files/9b/9b0ff4cbf4f33264cfdb0515fe87c0c1c8a1d11ff29a1524401ac7063f64fe03/blob b/shared/package-files/9b/9b0ff4cbf4f33264cfdb0515fe87c0c1c8a1d11ff29a1524401ac7063f64fe03/blob new file mode 100644 index 0000000000000000000000000000000000000000..4f8288cf582ec3ec6ae35fed9afc00a1211b501f --- /dev/null +++ b/shared/package-files/9b/9b0ff4cbf4f33264cfdb0515fe87c0c1c8a1d11ff29a1524401ac7063f64fe03/blob @@ -0,0 +1,324 @@ +""" +Public testing utilities. + +See also _lib._testing for additional private testing utilities. +""" + +from __future__ import annotations + +import contextlib +from collections.abc import Callable, Iterable, Iterator, Sequence +from functools import wraps +from types import ModuleType +from typing import TYPE_CHECKING, Any, ParamSpec, TypeVar, cast + +from ._lib._utils._compat import is_dask_namespace, is_jax_namespace + +__all__ = ["lazy_xp_function", "patch_lazy_xp_functions"] + +if TYPE_CHECKING: # pragma: no cover + # TODO import override from typing (requires Python >=3.12) + import pytest + from dask.typing import Graph, Key, SchedulerGetCallable + from typing_extensions import override + +else: + # Sphinx hacks + SchedulerGetCallable = object + + def override(func: object) -> object: + return func + + +P = ParamSpec("P") +T = TypeVar("T") + +_ufuncs_tags: dict[object, dict[str, Any]] = {} # type: ignore[explicit-any] + + +def lazy_xp_function( # type: ignore[explicit-any] + func: Callable[..., Any], + *, + allow_dask_compute: int = 0, + jax_jit: bool = True, + static_argnums: int | Sequence[int] | None = None, + static_argnames: str | Iterable[str] | None = None, +) -> None: # numpydoc ignore=GL07 + """ + Tag a function to be tested on lazy backends. + + Tag a function so that when any tests are executed with ``xp=jax.numpy`` the + function is replaced with a jitted version of itself, and when it is executed with + ``xp=dask.array`` the function will raise if it attempts to materialize the graph. + This will be later expanded to provide test coverage for other lazy backends. + + In order for the tag to be effective, the test or a fixture must call + :func:`patch_lazy_xp_functions`. + + Parameters + ---------- + func : callable + Function to be tested. + allow_dask_compute : int, optional + Number of times `func` is allowed to internally materialize the Dask graph. This + is typically triggered by ``bool()``, ``float()``, or ``np.asarray()``. + + Set to 1 if you are aware that `func` converts the input parameters to NumPy and + want to let it do so at least for the time being, knowing that it is going to be + extremely detrimental for performance. + + If a test needs values higher than 1 to pass, it is a canary that the conversion + to NumPy/bool/float is happening multiple times, which translates to multiple + computations of the whole graph. Short of making the function fully lazy, you + should at least add explicit calls to ``np.asarray()`` early in the function. + *Note:* the counter of `allow_dask_compute` resets after each call to `func`, so + a test function that invokes `func` multiple times should still work with this + parameter set to 1. + + Default: 0, meaning that `func` must be fully lazy and never materialize the + graph. + jax_jit : bool, optional + Set to True to replace `func` with ``jax.jit(func)`` after calling the + :func:`patch_lazy_xp_functions` test helper with ``xp=jax.numpy``. Set to False + if `func` is only compatible with eager (non-jitted) JAX. Default: True. + static_argnums : int | Sequence[int], optional + Passed to jax.jit. Positional arguments to treat as static (compile-time + constant). Default: infer from `static_argnames` using + `inspect.signature(func)`. + static_argnames : str | Iterable[str], optional + Passed to jax.jit. Named arguments to treat as static (compile-time constant). + Default: infer from `static_argnums` using `inspect.signature(func)`. + + See Also + -------- + patch_lazy_xp_functions : Companion function to call from the test or fixture. + jax.jit : JAX function to compile a function for performance. + + Examples + -------- + In ``test_mymodule.py``:: + + from array_api_extra.testing import lazy_xp_function from mymodule import myfunc + + lazy_xp_function(myfunc) + + def test_myfunc(xp): + a = xp.asarray([1, 2]) + # When xp=jax.numpy, this is the same as `b = jax.jit(myfunc)(a)` + # When xp=dask.array, crash on compute() or persist() + b = myfunc(a) + + Notes + ----- + In order for this tag to be effective, the test function must be imported into the + test module globals without its namespace; alternatively its namespace must be + declared in a ``lazy_xp_modules`` list in the test module globals. + + Example 1:: + + from mymodule import myfunc + + lazy_xp_function(myfunc) + + def test_myfunc(xp): + x = myfunc(xp.asarray([1, 2])) + + Example 2:: + + import mymodule + + lazy_xp_modules = [mymodule] + lazy_xp_function(mymodule.myfunc) + + def test_myfunc(xp): + x = mymodule.myfunc(xp.asarray([1, 2])) + + A test function can circumvent this monkey-patching system by using a namespace + outside of the two above patterns. You need to sanitize your code to make sure this + only happens intentionally. + + Example 1:: + + import mymodule + from mymodule import myfunc + + lazy_xp_function(myfunc) + + def test_myfunc(xp): + a = xp.asarray([1, 2]) + b = myfunc(a) # This is wrapped when xp=jax.numpy or xp=dask.array + c = mymodule.myfunc(a) # This is not + + Example 2:: + + import mymodule + + class naked: + myfunc = mymodule.myfunc + + lazy_xp_modules = [mymodule] + lazy_xp_function(mymodule.myfunc) + + def test_myfunc(xp): + a = xp.asarray([1, 2]) + b = mymodule.myfunc(a) # This is wrapped when xp=jax.numpy or xp=dask.array + c = naked.myfunc(a) # This is not + """ + tags = { + "allow_dask_compute": allow_dask_compute, + "jax_jit": jax_jit, + "static_argnums": static_argnums, + "static_argnames": static_argnames, + } + try: + func._lazy_xp_function = tags # type: ignore[attr-defined] # pylint: disable=protected-access # pyright: ignore[reportFunctionMemberAccess] + except AttributeError: # @cython.vectorize + _ufuncs_tags[func] = tags + + +def patch_lazy_xp_functions( + request: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatch, *, xp: ModuleType +) -> None: + """ + Test lazy execution of functions tagged with :func:`lazy_xp_function`. + + If ``xp==jax.numpy``, search for all functions which have been tagged with + :func:`lazy_xp_function` in the globals of the module that defines the current test, + as well as in the ``lazy_xp_modules`` list in the globals of the same module, + and wrap them with :func:`jax.jit`. Unwrap them at the end of the test. + + If ``xp==dask.array``, wrap the functions with a decorator that disables + ``compute()`` and ``persist()`` and ensures that exceptions and warnings are raised + eagerly. + + This function should be typically called by your library's `xp` fixture that runs + tests on multiple backends:: + + @pytest.fixture(params=[numpy, array_api_strict, jax.numpy, dask.array]) + def xp(request, monkeypatch): + patch_lazy_xp_functions(request, monkeypatch, xp=request.param) + return request.param + + but it can be otherwise be called by the test itself too. + + Parameters + ---------- + request : pytest.FixtureRequest + Pytest fixture, as acquired by the test itself or by one of its fixtures. + monkeypatch : pytest.MonkeyPatch + Pytest fixture, as acquired by the test itself or by one of its fixtures. + xp : array_namespace + Array namespace to be tested. + + See Also + -------- + lazy_xp_function : Tag a function to be tested on lazy backends. + pytest.FixtureRequest : `request` test function parameter. + """ + mod = cast(ModuleType, request.module) + mods = [mod, *cast(list[ModuleType], getattr(mod, "lazy_xp_modules", []))] + + def iter_tagged() -> ( # type: ignore[explicit-any] + Iterator[tuple[ModuleType, str, Callable[..., Any], dict[str, Any]]] + ): + for mod in mods: + for name, func in mod.__dict__.items(): + tags: dict[str, Any] | None = None # type: ignore[explicit-any] + with contextlib.suppress(AttributeError): + tags = func._lazy_xp_function # pylint: disable=protected-access + if tags is None: + with contextlib.suppress(KeyError, TypeError): + tags = _ufuncs_tags[func] + if tags is not None: + yield mod, name, func, tags + + if is_dask_namespace(xp): + for mod, name, func, tags in iter_tagged(): + n = tags["allow_dask_compute"] + wrapped = _dask_wrap(func, n) + monkeypatch.setattr(mod, name, wrapped) + + elif is_jax_namespace(xp): + import jax + + for mod, name, func, tags in iter_tagged(): + if tags["jax_jit"]: + # suppress unused-ignore to run mypy in -e lint as well as -e dev + wrapped = cast( # type: ignore[explicit-any] + Callable[..., Any], + jax.jit( + func, + static_argnums=tags["static_argnums"], + static_argnames=tags["static_argnames"], + ), + ) + monkeypatch.setattr(mod, name, wrapped) + + +class CountingDaskScheduler(SchedulerGetCallable): + """ + Dask scheduler that counts how many times `dask.compute` is called. + + If the number of times exceeds 'max_count', it raises an error. + This is a wrapper around Dask's own 'synchronous' scheduler. + + Parameters + ---------- + max_count : int + Maximum number of allowed calls to `dask.compute`. + msg : str + Assertion to raise when the count exceeds `max_count`. + """ + + count: int + max_count: int + msg: str + + def __init__(self, max_count: int, msg: str): # numpydoc ignore=GL08 + self.count = 0 + self.max_count = max_count + self.msg = msg + + @override + def __call__(self, dsk: Graph, keys: Sequence[Key] | Key, **kwargs: Any) -> Any: # type: ignore[decorated-any,explicit-any] # numpydoc ignore=GL08 + import dask + + self.count += 1 + # This should yield a nice traceback to the + # offending line in the user's code + assert self.count <= self.max_count, self.msg + + return dask.get(dsk, keys, **kwargs) # type: ignore[attr-defined,no-untyped-call] # pyright: ignore[reportPrivateImportUsage] + + +def _dask_wrap( + func: Callable[P, T], n: int +) -> Callable[P, T]: # numpydoc ignore=PR01,RT01 + """ + Wrap `func` to raise if it attempts to call `dask.compute` more than `n` times. + + After the function returns, materialize the graph in order to re-raise exceptions. + """ + import dask + + func_name = getattr(func, "__name__", str(func)) + n_str = f"only up to {n}" if n else "no" + msg = ( + f"Called `dask.compute()` or `dask.persist()` {n + 1} times, " + f"but {n_str} calls are allowed. Set " + f"`lazy_xp_function({func_name}, allow_dask_compute={n + 1})` " + "to allow for more (but note that this will harm performance). " + ) + + @wraps(func) + def wrapper(*args: P.args, **kwargs: P.kwargs) -> T: # numpydoc ignore=GL08 + scheduler = CountingDaskScheduler(n, msg) + with dask.config.set({"scheduler": scheduler}): # pyright: ignore[reportPrivateImportUsage] + out = func(*args, **kwargs) + + # Block until the graph materializes and reraise exceptions. This allows + # `pytest.raises` and `pytest.warns` to work as expected. Note that this would + # not work on scheduler='distributed', as it would not block. + return dask.persist(out, scheduler="threads")[0] # type: ignore[attr-defined,no-untyped-call,func-returns-value,index] # pyright: ignore[reportPrivateImportUsage] + + return wrapper diff --git a/shared/package-files/9b/9b105adfedc6b6b82f4695ca9bfe232393034cdf79803523f397a6dc5bf824d1/blob b/shared/package-files/9b/9b105adfedc6b6b82f4695ca9bfe232393034cdf79803523f397a6dc5bf824d1/blob new file mode 100644 index 0000000000000000000000000000000000000000..8a1fa63fef0f636dd9fb6e9f60b91e0dca6ec495 Binary files /dev/null and b/shared/package-files/9b/9b105adfedc6b6b82f4695ca9bfe232393034cdf79803523f397a6dc5bf824d1/blob differ diff --git a/shared/package-files/9b/9b1066af79ac4795bb4446ba33581ace72de0ee3bd979905840badd5598bda7a/blob b/shared/package-files/9b/9b1066af79ac4795bb4446ba33581ace72de0ee3bd979905840badd5598bda7a/blob new file mode 100644 index 0000000000000000000000000000000000000000..69308dbcd5c5feba286cae33b831c2258ff5007a --- /dev/null +++ b/shared/package-files/9b/9b1066af79ac4795bb4446ba33581ace72de0ee3bd979905840badd5598bda7a/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _sparse_mm_reduce_impl { + using schema = ::std::tuple (const at::Tensor &, const at::Tensor &, c10::string_view); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_sparse_mm_reduce_impl") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_sparse_mm_reduce_impl(Tensor self, Tensor other, str reduce) -> (Tensor, Tensor)") + static ::std::tuple call(const at::Tensor & self, const at::Tensor & other, c10::string_view reduce); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other, c10::string_view reduce); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9b/9b110614ea0eefae7c0d74748c47bf4ed50dd144a134754cef1a24705b9fb377/blob b/shared/package-files/9b/9b110614ea0eefae7c0d74748c47bf4ed50dd144a134754cef1a24705b9fb377/blob new file mode 100644 index 0000000000000000000000000000000000000000..95e52c94377bf568060c25f887454dbbaf2054b7 --- /dev/null +++ b/shared/package-files/9b/9b110614ea0eefae7c0d74748c47bf4ed50dd144a134754cef1a24705b9fb377/blob @@ -0,0 +1,11 @@ +#pragma once +#include +namespace at::cuda { +// Forward-declares at::cuda::NVRTC +struct NVRTC; + +namespace detail { +extern NVRTC lazyNVRTC; +} // namespace detail + +} // namespace at::cuda diff --git a/shared/package-files/9b/9b149709fc0432cdc59b496b4e33cc35dafc99321bf7afd9092fe0400027a576/blob b/shared/package-files/9b/9b149709fc0432cdc59b496b4e33cc35dafc99321bf7afd9092fe0400027a576/blob new file mode 100644 index 0000000000000000000000000000000000000000..db74a162a98a0ec609b4c3c65e649dd784a626c4 --- /dev/null +++ b/shared/package-files/9b/9b149709fc0432cdc59b496b4e33cc35dafc99321bf7afd9092fe0400027a576/blob @@ -0,0 +1,39 @@ +""" +Shared result type for the AR/ARMA parameter estimation functions in +statsmodels.tsa.arima.estimators. + +Author: Chad Fulton +License: BSD-3 +""" +from typing import NamedTuple + + +class ARMAEstimationResult(NamedTuple): + """ + Result of an ARIMA parameter estimator. + + Common to :func:`~statsmodels.tsa.arima.estimators.burg.burg`, + :func:`~statsmodels.tsa.arima.estimators.gls.gls`, + :func:`~statsmodels.tsa.arima.estimators.hannan_rissanen.hannan_rissanen`, + :func:`~statsmodels.tsa.arima.estimators.innovations.innovations`, + :func:`~statsmodels.tsa.arima.estimators.innovations.innovations_mle`, + :func:`~statsmodels.tsa.arima.estimators.yule_walker.yule_walker`, + :func:`~statsmodels.tsa.arima.estimators.durbin_levinson.durbin_levinson`, + and :func:`~statsmodels.tsa.arima.estimators.statespace.statespace`. + + Parameters + ---------- + parameters : SARIMAXParams or list of SARIMAXParams + Contains the parameter estimates from the final iteration. A list + of ``SARIMAXParams`` objects for :func:`innovations` and + :func:`durbin_levinson`, which estimate at multiple orders; a + single ``SARIMAXParams`` object for all other estimators. + other_results : Bunch + Estimator-specific ancillary results, always including at least + ``spec``, the ``SARIMAXSpecification`` instance corresponding to + the input arguments. See the individual estimator's docstring for + the full set of components. + """ + + parameters: object + other_results: object diff --git a/shared/package-files/9b/9b14c96a807865ee74964fb64e0568a66aeb6ee41b12a52c6707372b51fcc3e4/blob b/shared/package-files/9b/9b14c96a807865ee74964fb64e0568a66aeb6ee41b12a52c6707372b51fcc3e4/blob new file mode 100644 index 0000000000000000000000000000000000000000..d98732e2751e53938d96d7ea56c916e6fee4578e --- /dev/null +++ b/shared/package-files/9b/9b14c96a807865ee74964fb64e0568a66aeb6ee41b12a52c6707372b51fcc3e4/blob @@ -0,0 +1,118 @@ +from sympy.core.symbol import symbols, Dummy +from sympy.matrices.expressions.applyfunc import ElementwiseApplyFunction +from sympy.core.function import Lambda +from sympy.functions.elementary.exponential import exp +from sympy.functions.elementary.trigonometric import sin +from sympy.matrices.dense import Matrix +from sympy.matrices.expressions.matexpr import MatrixSymbol +from sympy.matrices.expressions.matmul import MatMul +from sympy.simplify.simplify import simplify + + +X = MatrixSymbol("X", 3, 3) +Y = MatrixSymbol("Y", 3, 3) + +k = symbols("k") +Xk = MatrixSymbol("X", k, k) + +Xd = X.as_explicit() + +x, y, z, t = symbols("x y z t") + + +def test_applyfunc_matrix(): + x = Dummy('x') + double = Lambda(x, x**2) + + expr = ElementwiseApplyFunction(double, Xd) + assert isinstance(expr, ElementwiseApplyFunction) + assert expr.doit() == Xd.applyfunc(lambda x: x**2) + assert expr.shape == (3, 3) + assert expr.func(*expr.args) == expr + assert simplify(expr) == expr + assert expr[0, 0] == double(Xd[0, 0]) + + expr = ElementwiseApplyFunction(double, X) + assert isinstance(expr, ElementwiseApplyFunction) + assert isinstance(expr.doit(), ElementwiseApplyFunction) + assert expr == X.applyfunc(double) + assert expr.func(*expr.args) == expr + + expr = ElementwiseApplyFunction(exp, X*Y) + assert expr.expr == X*Y + assert expr.function.dummy_eq(Lambda(x, exp(x))) + assert expr.dummy_eq((X*Y).applyfunc(exp)) + assert expr.func(*expr.args) == expr + + assert isinstance(X*expr, MatMul) + assert (X*expr).shape == (3, 3) + Z = MatrixSymbol("Z", 2, 3) + assert (Z*expr).shape == (2, 3) + + expr = ElementwiseApplyFunction(exp, Z.T)*ElementwiseApplyFunction(exp, Z) + assert expr.shape == (3, 3) + expr = ElementwiseApplyFunction(exp, Z)*ElementwiseApplyFunction(exp, Z.T) + assert expr.shape == (2, 2) + + M = Matrix([[x, y], [z, t]]) + expr = ElementwiseApplyFunction(sin, M) + assert isinstance(expr, ElementwiseApplyFunction) + assert expr.function.dummy_eq(Lambda(x, sin(x))) + assert expr.expr == M + assert expr.doit() == M.applyfunc(sin) + assert expr.doit() == Matrix([[sin(x), sin(y)], [sin(z), sin(t)]]) + assert expr.func(*expr.args) == expr + + expr = ElementwiseApplyFunction(double, Xk) + assert expr.doit() == expr + assert expr.subs(k, 2).shape == (2, 2) + assert (expr*expr).shape == (k, k) + M = MatrixSymbol("M", k, t) + expr2 = M.T*expr*M + assert isinstance(expr2, MatMul) + assert expr2.args[1] == expr + assert expr2.shape == (t, t) + expr3 = expr*M + assert expr3.shape == (k, t) + + expr1 = ElementwiseApplyFunction(lambda x: x+1, Xk) + expr2 = ElementwiseApplyFunction(lambda x: x, Xk) + assert expr1 != expr2 + + +def test_applyfunc_entry(): + + af = X.applyfunc(sin) + assert af[0, 0] == sin(X[0, 0]) + + af = Xd.applyfunc(sin) + assert af[0, 0] == sin(X[0, 0]) + + +def test_applyfunc_as_explicit(): + + af = X.applyfunc(sin) + assert af.as_explicit() == Matrix([ + [sin(X[0, 0]), sin(X[0, 1]), sin(X[0, 2])], + [sin(X[1, 0]), sin(X[1, 1]), sin(X[1, 2])], + [sin(X[2, 0]), sin(X[2, 1]), sin(X[2, 2])], + ]) + + +def test_applyfunc_transpose(): + + af = Xk.applyfunc(sin) + assert af.T.dummy_eq(Xk.T.applyfunc(sin)) + + +def test_applyfunc_shape_11_matrices(): + M = MatrixSymbol("M", 1, 1) + + double = Lambda(x, x*2) + + expr = M.applyfunc(sin) + assert isinstance(expr, ElementwiseApplyFunction) + + expr = M.applyfunc(double) + assert isinstance(expr, MatMul) + assert expr == 2*M diff --git a/shared/package-files/9b/9b152deb0e3d095c45b1ce7937e25dc5c1d9e3aaf9bee11eb5b5444f590ab862/model.pt b/shared/package-files/9b/9b152deb0e3d095c45b1ce7937e25dc5c1d9e3aaf9bee11eb5b5444f590ab862/model.pt new file mode 100644 index 0000000000000000000000000000000000000000..f23801fb6ffb6a7f78ed47a8ab0bd8292f7e249c --- /dev/null +++ b/shared/package-files/9b/9b152deb0e3d095c45b1ce7937e25dc5c1d9e3aaf9bee11eb5b5444f590ab862/model.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b152deb0e3d095c45b1ce7937e25dc5c1d9e3aaf9bee11eb5b5444f590ab862 +size 2235917054 diff --git a/shared/package-files/9b/9b156a37c540d4ea39994bad9664abd0a4bd57acfa72ffec72409c36a4532f2c/blob b/shared/package-files/9b/9b156a37c540d4ea39994bad9664abd0a4bd57acfa72ffec72409c36a4532f2c/blob new file mode 100644 index 0000000000000000000000000000000000000000..d72c69f6769057ef4ba22fe9c567fcc71e4689d2 --- /dev/null +++ b/shared/package-files/9b/9b156a37c540d4ea39994bad9664abd0a4bd57acfa72ffec72409c36a4532f2c/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b156a37c540d4ea39994bad9664abd0a4bd57acfa72ffec72409c36a4532f2c +size 417616 diff --git a/shared/package-files/9b/9b15c668d6a6afe9d1ce1a3f5571f71da43266871a1cd698fb4913043d6d8c24/blob b/shared/package-files/9b/9b15c668d6a6afe9d1ce1a3f5571f71da43266871a1cd698fb4913043d6d8c24/blob new file mode 100644 index 0000000000000000000000000000000000000000..24abd8d61c504e34ffe5a93a27ce3ab59b649b52 --- /dev/null +++ b/shared/package-files/9b/9b15c668d6a6afe9d1ce1a3f5571f71da43266871a1cd698fb4913043d6d8c24/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor & logical_or_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & logical_or_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/9b/9b16504660713d61693f7c7ebfe677239a640f93fc572807f3739fba203a2cdd/blob b/shared/package-files/9b/9b16504660713d61693f7c7ebfe677239a640f93fc572807f3739fba203a2cdd/blob new file mode 100644 index 0000000000000000000000000000000000000000..3b05813779a41afcc0b75eb2208c95c5ac03fc5e --- /dev/null +++ b/shared/package-files/9b/9b16504660713d61693f7c7ebfe677239a640f93fc572807f3739fba203a2cdd/blob @@ -0,0 +1,468 @@ +SCHWERTDBAA +-0.01 +0.03 +0.01 +0.01 +0.04 +-0.03 +-0.01 +0.06 +0.12 +0.09 +0.08 +0 +0.01 +0 +-0.06 +-0.09 +-0.04 +0.03 +0.07 +0.01 +0.05 +0.03 +0 +-0.07 +-0.01 +0.02 +-0.02 +0 +0.02 +-0.01 +-0.06 +-0.03 +-0.01 +-0.01 +-0.04 +-0.07 +0 +0 +-0.01 +0.02 +0.03 +0.04 +-0.09 +-0.02 +0.01 +0 +-0.02 +-0.03 +-0.01 +0.07 +0.12 +0.05 +0.09 +0.04 +-0.03 +-0.04 +0.04 +0.06 +0.05 +-0.11 +0.03 +-0.02 +-0.01 +-0.01 +0.01 +0 +0.01 +0.01 +0.02 +-0.01 +-0.02 +0 +0.02 +0.04 +0.08 +0.13 +0.08 +0 +-0.01 +0.03 +-0.06 +-0.07 +-0.01 +-0.03 +-0.1 +-0.1 +-0.04 +0 +0.02 +0.01 +-0.01 +-0.02 +-0.01 +-0.01 +0 +0 +0.02 +0.01 +0.01 +0.01 +0.01 +0.01 +0.04 +0.03 +0 +-0.01 +0.04 +-0.02 +-0.02 +0.02 +0.08 +0.05 +0.03 +0.04 +0.13 +0.14 +0.1 +0.07 +0.13 +0.12 +-0.02 +-0.04 +0.01 +0.08 +0.11 +0.1 +0.09 +0.11 +0.06 +0.1 +-0.06 +-0.2 +-0.17 +0.02 +-0.01 +-0.05 +-0.07 +-0.02 +0.14 +0.2 +0.05 +-0.05 +-0.02 +0.02 +0.02 +-0.04 +0.01 +0.1 +0.08 +0.04 +0.01 +0.09 +0.1 +-0.02 +0.02 +0.06 +0 +-0.09 +-0.05 +0.08 +-0.02 +-0.04 +-0.14 +-0.07 +0.1 +-0.03 +0.02 +0 +-0.03 +-0.05 +-0.01 +0 +0.02 +0.06 +0.02 +0.01 +0.01 +-0.02 +-0.01 +-0.02 +-0.01 +-0.03 +-0.02 +-0.02 +0.02 +0.03 +0.01 +-0.03 +-0.04 +-0.03 +-0.04 +-0.01 +-0.02 +-0.01 +-0.01 +-0.02 +-0.01 +0 +-0.01 +0.01 +-0.01 +0.01 +0.01 +-0.02 +0 +0 +0.02 +0 +0 +-0.02 +-0.01 +0 +-0.01 +0 +0 +-0.01 +-0.02 +0 +0.02 +0.01 +0.04 +0.03 +0 +0.03 +0.02 +0.02 +0.07 +0.04 +0.06 +0.2 +0.09 +0.07 +0.1 +0.1 +0.15 +0.26 +0.01 +0.03 +0.05 +-0.21 +-0.15 +0.03 +-0.02 +0.13 +0.19 +0.11 +0.07 +0.07 +0.12 +0.2 +0.21 +-0.09 +-0.04 +0.05 +0.12 +0.06 +0.04 +-0.09 +-0.16 +-0.03 +0.05 +0.17 +0.22 +0.09 +-0.02 +0.21 +0.03 +-0.02 +0.18 +0.14 +0.02 +0.19 +0.17 +0.03 +0.4 +0.21 +-0.08 +-0.15 +0.07 +0.28 +0.27 +0.15 +0.04 +-0.05 +-0.06 +0.05 +-0.26 +-0.38 +-0.35 +0.07 +-0.01 +0.17 +0.13 +0.01 +0 +-0.17 +-0.11 +-0.1 +0 +-0.15 +0 +0 +0.01 +-0.01 +-0.03 +0.03 +-0.04 +-0.1 +-0.03 +-0.07 +-0.06 +-0.03 +0.07 +0.06 +0.06 +-0.03 +0.07 +0.11 +0.29 +0.1 +-0.22 +0.01 +0.06 +0 +0.05 +0.09 +0.25 +0.18 +0.22 +0.21 +0.29 +0.41 +0.3 +0.12 +0.03 +0.18 +-0.16 +-0.17 +0.1 +0.11 +-0.07 +-0.07 +0.04 +0.02 +0.01 +-0.06 +0 +-0.15 +-0.17 +-0.12 +-0.18 +-0.08 +0.03 +-0.07 +-0.18 +-0.24 +-0.11 +-0.06 +-0.11 +-0.04 +0.04 +0 +-0.05 +-0.06 +-0.1 +-0.04 +-0.05 +-0.02 +0.09 +0.06 +0.04 +0.18 +0.03 +0.02 +0.1 +0.17 +0.11 +0 +-0.12 +-0.06 +0.17 +0.24 +0.11 +0.19 +-0.05 +0.18 +0.07 +0.14 +-0.09 +-0.09 +0.06 +0.19 +0.86 +0.59 +0.07 +0.36 +1.15 +0.88 +-0.26 +-1.02 +-0.46 +-0.06 +0.5 +0.55 +0.53 +0.41 +0.5 +-0.11 +0.34 +-0.03 +0.22 +0.39 +-0.15 +0.37 +0.17 +0.58 +0.19 +-0.72 +0.16 +0.55 +0.08 +-0.36 +-0.04 +-0.14 +0.28 +-0.12 +-0.48 +-0.69 +-0.9 +-0.43 +-0.16 +-0.2 +0.01 +-0.34 +-0.32 +-0.2 +0.28 +0.02 +0.25 +-0.09 +-0.09 +0.15 +0.14 +-0.1 +-0.06 +0.4 +0.32 +0.43 +0.31 +0.1 +-0.52 +-0.28 +-0.41 +-0.46 +-0.08 +-0.14 +-0.03 +0.46 +-0.18 +-0.36 +-0.75 +0.03 +0.07 +-0.02 +-0.12 +-0.37 +-0.41 diff --git a/shared/package-files/9b/9b1676a9f2beda4d06310328bd464e716ce1fd334045af3425b820b172c51c83/blob b/shared/package-files/9b/9b1676a9f2beda4d06310328bd464e716ce1fd334045af3425b820b172c51c83/blob new file mode 100644 index 0000000000000000000000000000000000000000..955e3be107f7514b597f1a961dfc548367613c46 --- /dev/null +++ b/shared/package-files/9b/9b1676a9f2beda4d06310328bd464e716ce1fd334045af3425b820b172c51c83/blob @@ -0,0 +1,163 @@ +import numpy as np +import pytest + +from pandas._config import using_string_dtype +import pandas._config.config as cf + +from pandas import Index +import pandas._testing as tm + + +class TestIndexRendering: + def test_repr_is_valid_construction_code(self): + # for the case of Index, where the repr is traditional rather than + # stylized + idx = Index(["a", "b"]) + res = eval(repr(idx)) + tm.assert_index_equal(res, idx) + + @pytest.mark.xfail(using_string_dtype(), reason="repr different") + @pytest.mark.parametrize( + "index,expected", + [ + # ASCII + # short + ( + Index(["a", "bb", "ccc"]), + """Index(['a', 'bb', 'ccc'], dtype='object')""", + ), + # multiple lines + ( + Index(["a", "bb", "ccc"] * 10), + "Index(['a', 'bb', 'ccc', 'a', 'bb', 'ccc', 'a', " + "'bb', 'ccc', 'a', 'bb', 'ccc',\n" + " 'a', 'bb', 'ccc', 'a', 'bb', 'ccc', 'a', " + "'bb', 'ccc', 'a', 'bb', 'ccc',\n" + " 'a', 'bb', 'ccc', 'a', 'bb', 'ccc'],\n" + " dtype='object')", + ), + # truncated + ( + Index(["a", "bb", "ccc"] * 100), + "Index(['a', 'bb', 'ccc', 'a', 'bb', 'ccc', 'a', 'bb', 'ccc', 'a',\n" + " ...\n" + " 'ccc', 'a', 'bb', 'ccc', 'a', 'bb', 'ccc', 'a', 'bb', 'ccc'],\n" + " dtype='object', length=300)", + ), + # Non-ASCII + # short + ( + Index(["あ", "いい", "ううう"]), + """Index(['あ', 'いい', 'ううう'], dtype='object')""", + ), + # multiple lines + ( + Index(["あ", "いい", "ううう"] * 10), + ( + "Index(['あ', 'いい', 'ううう', 'あ', 'いい', 'ううう', " + "'あ', 'いい', 'ううう', 'あ', 'いい', 'ううう',\n" + " 'あ', 'いい', 'ううう', 'あ', 'いい', 'ううう', " + "'あ', 'いい', 'ううう', 'あ', 'いい', 'ううう',\n" + " 'あ', 'いい', 'ううう', 'あ', 'いい', " + "'ううう'],\n" + " dtype='object')" + ), + ), + # truncated + ( + Index(["あ", "いい", "ううう"] * 100), + ( + "Index(['あ', 'いい', 'ううう', 'あ', 'いい', 'ううう', " + "'あ', 'いい', 'ううう', 'あ',\n" + " ...\n" + " 'ううう', 'あ', 'いい', 'ううう', 'あ', 'いい', " + "'ううう', 'あ', 'いい', 'ううう'],\n" + " dtype='object', length=300)" + ), + ), + ], + ) + def test_string_index_repr(self, index, expected): + result = repr(index) + assert result == expected + + @pytest.mark.xfail(using_string_dtype(), reason="repr different") + @pytest.mark.parametrize( + "index,expected", + [ + # short + ( + Index(["あ", "いい", "ううう"]), + ("Index(['あ', 'いい', 'ううう'], dtype='object')"), + ), + # multiple lines + ( + Index(["あ", "いい", "ううう"] * 10), + ( + "Index(['あ', 'いい', 'ううう', 'あ', 'いい', " + "'ううう', 'あ', 'いい', 'ううう',\n" + " 'あ', 'いい', 'ううう', 'あ', 'いい', " + "'ううう', 'あ', 'いい', 'ううう',\n" + " 'あ', 'いい', 'ううう', 'あ', 'いい', " + "'ううう', 'あ', 'いい', 'ううう',\n" + " 'あ', 'いい', 'ううう'],\n" + " dtype='object')" + "" + ), + ), + # truncated + ( + Index(["あ", "いい", "ううう"] * 100), + ( + "Index(['あ', 'いい', 'ううう', 'あ', 'いい', " + "'ううう', 'あ', 'いい', 'ううう',\n" + " 'あ',\n" + " ...\n" + " 'ううう', 'あ', 'いい', 'ううう', 'あ', " + "'いい', 'ううう', 'あ', 'いい',\n" + " 'ううう'],\n" + " dtype='object', length=300)" + ), + ), + ], + ) + def test_string_index_repr_with_unicode_option(self, index, expected): + # Enable Unicode option ----------------------------------------- + with cf.option_context("display.unicode.east_asian_width", True): + result = repr(index) + assert result == expected + + def test_repr_summary(self): + with cf.option_context("display.max_seq_items", 10): + result = repr(Index(np.arange(1000))) + assert len(result) < 200 + assert "..." in result + + def test_summary_bug(self): + # GH#3869 + ind = Index(["{other}%s", "~:{range}:0"], name="A") + result = ind._summary() + # shouldn't be formatted accidentally. + assert "~:{range}:0" in result + assert "{other}%s" in result + + def test_index_repr_bool_nan(self): + # GH32146 + arr = Index([True, False, np.nan], dtype=object) + msg = "Index.format is deprecated" + with tm.assert_produces_warning(FutureWarning, match=msg): + exp1 = arr.format() + out1 = ["True", "False", "NaN"] + assert out1 == exp1 + + exp2 = repr(arr) + out2 = "Index([True, False, nan], dtype='object')" + assert out2 == exp2 + + def test_format_different_scalar_lengths(self): + # GH#35439 + idx = Index(["aaaaaaaaa", "b"]) + expected = ["aaaaaaaaa", "b"] + msg = r"Index\.format is deprecated" + with tm.assert_produces_warning(FutureWarning, match=msg): + assert idx.format() == expected diff --git a/shared/package-files/9b/9b16c7223d8223a77cbb4db2ee2fcc0dc2008526d6d3256a2e2fb3f2a95820fe/blob b/shared/package-files/9b/9b16c7223d8223a77cbb4db2ee2fcc0dc2008526d6d3256a2e2fb3f2a95820fe/blob new file mode 100644 index 0000000000000000000000000000000000000000..7b41c367e257e577986b44c2e8f529fe362a2f3e --- /dev/null +++ b/shared/package-files/9b/9b16c7223d8223a77cbb4db2ee2fcc0dc2008526d6d3256a2e2fb3f2a95820fe/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b16c7223d8223a77cbb4db2ee2fcc0dc2008526d6d3256a2e2fb3f2a95820fe +size 341496 diff --git a/shared/package-files/9b/9b17a60c7c785a7977fa093caca7705eb5730377a032a677f0500e979e459679/blob b/shared/package-files/9b/9b17a60c7c785a7977fa093caca7705eb5730377a032a677f0500e979e459679/blob new file mode 100644 index 0000000000000000000000000000000000000000..09ac34b8b4575837da4fa9ca4bf7ee0a9f550c85 --- /dev/null +++ b/shared/package-files/9b/9b17a60c7c785a7977fa093caca7705eb5730377a032a677f0500e979e459679/blob @@ -0,0 +1,123 @@ +# ### Convenience Functions to be moved to kerneltools #### +import numpy as np + + +def forrt(X, m=None): + """ + RFFT with order like Munro (1976) FORTT routine + + Parameters + ---------- + X : ndarray + The array to transform. + m : int, optional + The length used for the FFT. If None, ``len(X)`` is used. + + Returns + ------- + ndarray + The real and imaginary parts of the RFFT, concatenated in the + Munro (1976) FORTT order. + """ + if m is None: + m = len(X) + y = np.fft.rfft(X, m) / m + return np.r_[y.real, y[1:-1].imag] + + +def revrt(X, m=None): + """ + Inverse of forrt, equivalent to Munro (1976) REVRT routine + + Parameters + ---------- + X : ndarray + The array, in the Munro (1976) FORTT order, to invert. + m : int, optional + The length used for the inverse FFT. If None, ``len(X)`` is used. + + Returns + ------- + ndarray + The inverse real FFT of `X`. + """ + if m is None: + m = len(X) + i = int(m // 2 + 1) + y = X[:i] + np.r_[0, X[i:], 0] * 1j + return np.fft.irfft(y) * m + + +def silverman_transform(bw, M, RANGE): + """ + FFT of Gaussian kernel following to Silverman AS 176 + + Parameters + ---------- + bw : float + The bandwidth used in the Gaussian kernel. + M : int + The number of grid points. + RANGE : float + The range of the grid over which the kernel is evaluated. + + Returns + ------- + ndarray + The FFT of the Gaussian kernel evaluated at the grid points. + + Notes + ----- + Underflow is intentional as a dampener. + """ + J = np.arange(M / 2 + 1) + FAC1 = 2 * (np.pi * bw / RANGE) ** 2 + JFAC = J**2 * FAC1 + BC = 1 - 1.0 / 3 * (J * 1.0 / M * np.pi) ** 2 + FAC = np.exp(-JFAC) / BC + kern_est = np.r_[FAC, FAC[1:-1]] + return kern_est + + +def counts(x, v): + """ + Counts the number of elements of x that fall within the grid points v + + Parameters + ---------- + x : array_like + The data whose elements are counted. + v : array_like + The grid points (bin edges) used to bin `x`. + + Returns + ------- + ndarray + The number of elements of `x` falling in each bin defined by `v`. + + Notes + ----- + Using np.digitize and np.bincount + """ + idx = np.digitize(x, v) + return np.bincount(idx, minlength=len(v)) + + +def kdesum(x, axis=0): + """ + Computes the sum of pairwise differences of x along the given axis + + Parameters + ---------- + x : array_like + The data for which pairwise differences are summed. + axis : int, optional + The axis along which the differences ``x[i] - x`` are summed. + + Returns + ------- + ndarray + The array of summed pairwise differences, one entry per element + of `x`. + """ + return np.asarray([np.sum(x[i] - x, axis) for i in range(len(x))]) diff --git a/shared/package-files/9b/9b18078f5451cc903075e2ffd8a901d0db1e90d593b42adae53ee8664882709f/blob b/shared/package-files/9b/9b18078f5451cc903075e2ffd8a901d0db1e90d593b42adae53ee8664882709f/blob new file mode 100644 index 0000000000000000000000000000000000000000..4d28c4de3f7fb3242f947d13773ff17baef9ad23 --- /dev/null +++ b/shared/package-files/9b/9b18078f5451cc903075e2ffd8a901d0db1e90d593b42adae53ee8664882709f/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::addr(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1) -> Tensor +inline at::Tensor addr(const at::Tensor & self, const at::Tensor & vec1, const at::Tensor & vec2, const at::Scalar & beta=1, const at::Scalar & alpha=1) { + return at::_ops::addr::call(self, vec1, vec2, beta, alpha); +} + +// aten::addr.out(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & addr_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & vec1, const at::Tensor & vec2, const at::Scalar & beta=1, const at::Scalar & alpha=1) { + return at::_ops::addr_out::call(self, vec1, vec2, beta, alpha, out); +} +// aten::addr.out(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & addr_outf(const at::Tensor & self, const at::Tensor & vec1, const at::Tensor & vec2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out) { + return at::_ops::addr_out::call(self, vec1, vec2, beta, alpha, out); +} + +} diff --git a/shared/package-files/9b/9b185eeba218c0a82e52dc46741cc08f676740e184182013738b2589c1fe99cb/blob b/shared/package-files/9b/9b185eeba218c0a82e52dc46741cc08f676740e184182013738b2589c1fe99cb/blob new file mode 100644 index 0000000000000000000000000000000000000000..fc3cb1645bb97223858fbccd0b112c67eab07e92 --- /dev/null +++ b/shared/package-files/9b/9b185eeba218c0a82e52dc46741cc08f676740e184182013738b2589c1fe99cb/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b185eeba218c0a82e52dc46741cc08f676740e184182013738b2589c1fe99cb +size 105276 diff --git a/shared/package-files/9b/9b191f143dab35f83c9e7d69a7fe35dd2d2e09d617c9d3d605ccfd8a5806900d/blob b/shared/package-files/9b/9b191f143dab35f83c9e7d69a7fe35dd2d2e09d617c9d3d605ccfd8a5806900d/blob new file mode 100644 index 0000000000000000000000000000000000000000..45c9cdac1910def6b5a50a60b4ab5c8e0092af18 --- /dev/null +++ b/shared/package-files/9b/9b191f143dab35f83c9e7d69a7fe35dd2d2e09d617c9d3d605ccfd8a5806900d/blob @@ -0,0 +1,30 @@ +import numpy.distutils.fcompiler +from numpy.testing import assert_ + + +intel_32bit_version_strings = [ + ("Intel(R) Fortran Intel(R) 32-bit Compiler Professional for applications" + "running on Intel(R) 32, Version 11.1", '11.1'), +] + +intel_64bit_version_strings = [ + ("Intel(R) Fortran IA-64 Compiler Professional for applications" + "running on IA-64, Version 11.0", '11.0'), + ("Intel(R) Fortran Intel(R) 64 Compiler Professional for applications" + "running on Intel(R) 64, Version 11.1", '11.1') +] + +class TestIntelFCompilerVersions: + def test_32bit_version(self): + fc = numpy.distutils.fcompiler.new_fcompiler(compiler='intel') + for vs, version in intel_32bit_version_strings: + v = fc.version_match(vs) + assert_(v == version) + + +class TestIntelEM64TFCompilerVersions: + def test_64bit_version(self): + fc = numpy.distutils.fcompiler.new_fcompiler(compiler='intelem') + for vs, version in intel_64bit_version_strings: + v = fc.version_match(vs) + assert_(v == version) diff --git a/shared/package-files/9b/9b19609c87d0a3fecb06f22824bc0f37d67a64ad4847019250d0ff2509d160d0/blob b/shared/package-files/9b/9b19609c87d0a3fecb06f22824bc0f37d67a64ad4847019250d0ff2509d160d0/blob new file mode 100644 index 0000000000000000000000000000000000000000..4339631cddc52359312e12210be06ff7039a09a4 --- /dev/null +++ b/shared/package-files/9b/9b19609c87d0a3fecb06f22824bc0f37d67a64ad4847019250d0ff2509d160d0/blob @@ -0,0 +1,25 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API void _foreach_sigmoid_out(at::TensorList self, at::TensorList out); +TORCH_API ::std::vector foreach_tensor_sigmoid_slow(at::TensorList self); +TORCH_API void foreach_tensor_sigmoid_slow_(at::TensorList self); +TORCH_API ::std::vector foreach_tensor_sigmoid_cuda(at::TensorList self); +TORCH_API void foreach_tensor_sigmoid_cuda_(at::TensorList self); +} // namespace native +} // namespace at diff --git a/shared/package-files/9b/9b19d299da335885dc0cb64dcc28a6f809d3c9e82d9c09c43b9058eb4dc332c1/ring_fragments.py b/shared/package-files/9b/9b19d299da335885dc0cb64dcc28a6f809d3c9e82d9c09c43b9058eb4dc332c1/ring_fragments.py new file mode 100644 index 0000000000000000000000000000000000000000..e655aec20950c4221ef5e81c3a43e59fdd6771dc --- /dev/null +++ b/shared/package-files/9b/9b19d299da335885dc0cb64dcc28a6f809d3c9e82d9c09c43b9058eb4dc332c1/ring_fragments.py @@ -0,0 +1,42 @@ +"""Bounded two-ring-bond extension to the unchanged single-cut chemistry.""" +from itertools import combinations +import numpy as np +from rdkit import Chem +from graph_fragments import fragment_formulae as single_cut,INDEX,ELEMENTS,LOSSES +MAX_RING_BONDS=32 + +def fragment_formulae(smiles): + base=single_cut(smiles) + if base is None:return None + mol=Chem.MolFromSmiles(str(smiles));atoms=list(mol.GetAtoms()) + bonds=[(b.GetBeginAtomIdx(),b.GetEndAtomIdx()) for b in mol.GetBonds() if b.IsInRing()] + result=dict(base);result['ring_bonds']=len(bonds);result['ring_cut_pairs']=0 + result['ring_budget_skipped']=len(bonds)>MAX_RING_BONDS + if len(bonds)>MAX_RING_BONDS:return result + vectors=np.zeros((len(atoms),len(ELEMENTS)),np.int64) + for i,a in enumerate(atoms): + vectors[i,INDEX[a.GetAtomicNum()]]=1;vectors[i,INDEX[1]]=a.GetTotalNumHs() + whole=vectors.sum(0);adjacency=[set(n.GetIdx() for n in a.GetNeighbors()) for a in atoms] + direct=set(base['direct']);count=0 + for (a,b),(c,d) in combinations(bonds,2): + removed={(a,b),(b,a),(c,d),(d,c)};component={a};todo=[a] + while todo: + j=todo.pop() + for k in adjacency[j]: + if (j,k) in removed or k in component:continue + component.add(k);todo.append(k) + if len(component)==len(atoms):continue + left=vectors[sorted(component)].sum(0) + for side in (left,whole-left): + for shift in (-1,0,1): + value=side.copy();value[INDEX[1]]+=shift + if value[INDEX[1]]>=0:direct.add(tuple(value.tolist())) + count+=1 + extended=set(direct) + for formula in direct: + for loss in LOSSES: + value=tuple(a-b for a,b in zip(formula,loss)) + if min(value)>=0 and sum(value)>0:extended.add(value) + result.update(direct=sorted(direct),losses=sorted(extended),ring_cut_pairs=count) + assert set(base['direct']).issubset(direct) + return result diff --git a/shared/package-files/9b/9b218384eec238b9a6a2e721b23454e7b950a579c96a1cea69f7d79b26b8afa7/blob b/shared/package-files/9b/9b218384eec238b9a6a2e721b23454e7b950a579c96a1cea69f7d79b26b8afa7/blob new file mode 100644 index 0000000000000000000000000000000000000000..be262b34c2fd55b2f16c834eede0647db00870be --- /dev/null +++ b/shared/package-files/9b/9b218384eec238b9a6a2e721b23454e7b950a579c96a1cea69f7d79b26b8afa7/blob @@ -0,0 +1,12 @@ +from typing import Any, Optional + +from django.db.models.base import Model + +NOT_PROVIDED: Any + +class FieldCacheMixin: + def get_cache_name(self) -> str: ... + def get_cached_value(self, instance: Model, default: Any = ...) -> Optional[Model]: ... + def is_cached(self, instance: Model) -> bool: ... + def set_cached_value(self, instance: Model, value: Optional[Model]) -> None: ... + def delete_cached_value(self, instance: Model) -> None: ... diff --git a/shared/package-files/9b/9b23374ef43c10d49db0b72110877569dbd906b56d2c6747ef951c3c3152e868/blob b/shared/package-files/9b/9b23374ef43c10d49db0b72110877569dbd906b56d2c6747ef951c3c3152e868/blob new file mode 100644 index 0000000000000000000000000000000000000000..f4fd3b7bc461fbf82e8b4a16dd9453e46e124efa --- /dev/null +++ b/shared/package-files/9b/9b23374ef43c10d49db0b72110877569dbd906b56d2c6747ef951c3c3152e868/blob @@ -0,0 +1,522 @@ +#pragma once +/* + AVX implementation of sin, cos, sincos, exp and log + + Based on "sse_mathfun.h", by Julien Pommier + http://gruntthepeon.free.fr/ssemath/ + + Copyright (C) 2012 Giovanni Garberoglio + Interdisciplinary Laboratory for Computational Science (LISC) + Fondazione Bruno Kessler and University of Trento + via Sommarive, 18 + I-38123 Trento (Italy) + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + (this is the zlib license) +*/ + +#include + +/* The original source of this file has been modified. */ +#if defined(CPU_CAPABILITY_AVX2) + +#if defined(__GNUC__) +# define ALIGN32_BEG __attribute__((aligned(32))) +#elif defined(_WIN32) +# define ALIGN32_BEG __declspec(align(32)) +#endif + +typedef __m256 v8sf; // vector of 8 float (avx2) +typedef __m256i v8si; // vector of 8 int (avx2) + +/* declare some AVX constants -- why can't I figure a better way to do that? */ +#define _PS256_CONST(Name, Val) \ + static const ALIGN32_BEG float _ps256_##Name[8] = { Val, Val, Val, Val, Val, Val, Val, Val } +#define _PI32_CONST256(Name, Val) \ + static const ALIGN32_BEG int _pi32_256_##Name[8] = { Val, Val, Val, Val, Val, Val, Val, Val } +#define _PS256_CONST_TYPE(Name, Type, Val) \ + static const ALIGN32_BEG Type _ps256_##Name[8] = { Val, Val, Val, Val, Val, Val, Val, Val } + +_PS256_CONST(1 , 1.0f); +_PS256_CONST(0p5, 0.5f); +/* the smallest non denormalized float number */ +_PS256_CONST_TYPE(min_norm_pos, int, 0x00800000); +_PS256_CONST_TYPE(mant_mask, int, 0x7f800000); +_PS256_CONST_TYPE(inv_mant_mask, int, ~0x7f800000); + +_PS256_CONST_TYPE(sign_mask, int, (int)0x80000000); +_PS256_CONST_TYPE(inv_sign_mask, int, ~0x80000000); + +_PI32_CONST256(0, 0); +_PI32_CONST256(1, 1); +_PI32_CONST256(inv1, ~1); +_PI32_CONST256(2, 2); +_PI32_CONST256(4, 4); +_PI32_CONST256(0x7f, 0x7f); + +_PS256_CONST(cephes_SQRTHF, 0.707106781186547524); +_PS256_CONST(cephes_log_p0, 7.0376836292E-2); +_PS256_CONST(cephes_log_p1, - 1.1514610310E-1); +_PS256_CONST(cephes_log_p2, 1.1676998740E-1); +_PS256_CONST(cephes_log_p3, - 1.2420140846E-1); +_PS256_CONST(cephes_log_p4, + 1.4249322787E-1); +_PS256_CONST(cephes_log_p5, - 1.6668057665E-1); +_PS256_CONST(cephes_log_p6, + 2.0000714765E-1); +_PS256_CONST(cephes_log_p7, - 2.4999993993E-1); +_PS256_CONST(cephes_log_p8, + 3.3333331174E-1); +_PS256_CONST(cephes_log_q1, -2.12194440e-4); +_PS256_CONST(cephes_log_q2, 0.693359375); + + +/* natural logarithm computed for 8 simultaneous float + return NaN for x <= 0 +*/ +inline v8sf log256_ps(v8sf x) { + v8si imm0; + v8sf one = *(v8sf*)_ps256_1; + + //v8sf invalid_mask = _mm256_cmple_ps(x, _mm256_setzero_ps()); + v8sf invalid_mask = _mm256_cmp_ps(x, _mm256_setzero_ps(), _CMP_LE_OS); + + x = _mm256_max_ps(x, *(v8sf*)_ps256_min_norm_pos); /* cut off denormalized stuff */ + + // can be done with AVX2 + imm0 = _mm256_srli_epi32(_mm256_castps_si256(x), 23); + + /* keep only the fractional part */ + x = _mm256_and_ps(x, *(v8sf*)_ps256_inv_mant_mask); + x = _mm256_or_ps(x, *(v8sf*)_ps256_0p5); + + // this is again another AVX2 instruction + imm0 = _mm256_sub_epi32(imm0, *(v8si*)_pi32_256_0x7f); + v8sf e = _mm256_cvtepi32_ps(imm0); + + e = _mm256_add_ps(e, one); + + /* part2: + if( x < SQRTHF ) { + e -= 1; + x = x + x - 1.0; + } else { x = x - 1.0; } + */ + //v8sf mask = _mm256_cmplt_ps(x, *(v8sf*)_ps256_cephes_SQRTHF); + v8sf mask = _mm256_cmp_ps(x, *(v8sf*)_ps256_cephes_SQRTHF, _CMP_LT_OS); + v8sf tmp = _mm256_and_ps(x, mask); + x = _mm256_sub_ps(x, one); + e = _mm256_sub_ps(e, _mm256_and_ps(one, mask)); + x = _mm256_add_ps(x, tmp); + + v8sf z = _mm256_mul_ps(x,x); + + v8sf y = *(v8sf*)_ps256_cephes_log_p0; + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_log_p1); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_log_p2); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_log_p3); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_log_p4); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_log_p5); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_log_p6); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_log_p7); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_log_p8); + y = _mm256_mul_ps(y, x); + + y = _mm256_mul_ps(y, z); + + tmp = _mm256_mul_ps(e, *(v8sf*)_ps256_cephes_log_q1); + y = _mm256_add_ps(y, tmp); + + + tmp = _mm256_mul_ps(z, *(v8sf*)_ps256_0p5); + y = _mm256_sub_ps(y, tmp); + + tmp = _mm256_mul_ps(e, *(v8sf*)_ps256_cephes_log_q2); + x = _mm256_add_ps(x, y); + x = _mm256_add_ps(x, tmp); + x = _mm256_or_ps(x, invalid_mask); // negative arg will be NAN + return x; +} + +_PS256_CONST(exp_hi, 88.3762626647949f); +_PS256_CONST(exp_lo, -88.3762626647949f); + +_PS256_CONST(cephes_LOG2EF, 1.44269504088896341); +_PS256_CONST(cephes_exp_C1, 0.693359375); +_PS256_CONST(cephes_exp_C2, -2.12194440e-4); + +_PS256_CONST(cephes_exp_p0, 1.9875691500E-4); +_PS256_CONST(cephes_exp_p1, 1.3981999507E-3); +_PS256_CONST(cephes_exp_p2, 8.3334519073E-3); +_PS256_CONST(cephes_exp_p3, 4.1665795894E-2); +_PS256_CONST(cephes_exp_p4, 1.6666665459E-1); +_PS256_CONST(cephes_exp_p5, 5.0000001201E-1); + +inline v8sf exp256_ps(v8sf x) { + v8sf tmp = _mm256_setzero_ps(), fx; + v8si imm0; + v8sf one = *(v8sf*)_ps256_1; + + x = _mm256_min_ps(x, *(v8sf*)_ps256_exp_hi); + x = _mm256_max_ps(x, *(v8sf*)_ps256_exp_lo); + + /* express exp(x) as exp(g + n*log(2)) */ + fx = _mm256_mul_ps(x, *(v8sf*)_ps256_cephes_LOG2EF); + fx = _mm256_add_ps(fx, *(v8sf*)_ps256_0p5); + + /* how to perform a floorf with SSE: just below */ + //imm0 = _mm256_cvttps_epi32(fx); + //tmp = _mm256_cvtepi32_ps(imm0); + + tmp = _mm256_floor_ps(fx); + + /* if greater, subtract 1 */ + //v8sf mask = _mm256_cmpgt_ps(tmp, fx); + v8sf mask = _mm256_cmp_ps(tmp, fx, _CMP_GT_OS); + mask = _mm256_and_ps(mask, one); + fx = _mm256_sub_ps(tmp, mask); + + tmp = _mm256_mul_ps(fx, *(v8sf*)_ps256_cephes_exp_C1); + v8sf z = _mm256_mul_ps(fx, *(v8sf*)_ps256_cephes_exp_C2); + x = _mm256_sub_ps(x, tmp); + x = _mm256_sub_ps(x, z); + + z = _mm256_mul_ps(x,x); + + v8sf y = *(v8sf*)_ps256_cephes_exp_p0; + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_exp_p1); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_exp_p2); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_exp_p3); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_exp_p4); + y = _mm256_mul_ps(y, x); + y = _mm256_add_ps(y, *(v8sf*)_ps256_cephes_exp_p5); + y = _mm256_mul_ps(y, z); + y = _mm256_add_ps(y, x); + y = _mm256_add_ps(y, one); + + /* build 2^n */ + imm0 = _mm256_cvttps_epi32(fx); + // another two AVX2 instructions + imm0 = _mm256_add_epi32(imm0, *(v8si*)_pi32_256_0x7f); + imm0 = _mm256_slli_epi32(imm0, 23); + v8sf pow2n = _mm256_castsi256_ps(imm0); + y = _mm256_mul_ps(y, pow2n); + return y; +} + +_PS256_CONST(minus_cephes_DP1, -0.78515625); +_PS256_CONST(minus_cephes_DP2, -2.4187564849853515625e-4); +_PS256_CONST(minus_cephes_DP3, -3.77489497744594108e-8); +_PS256_CONST(sincof_p0, -1.9515295891E-4); +_PS256_CONST(sincof_p1, 8.3321608736E-3); +_PS256_CONST(sincof_p2, -1.6666654611E-1); +_PS256_CONST(coscof_p0, 2.443315711809948E-005); +_PS256_CONST(coscof_p1, -1.388731625493765E-003); +_PS256_CONST(coscof_p2, 4.166664568298827E-002); +_PS256_CONST(cephes_FOPI, 1.27323954473516); // 4 / M_PI + + +/* evaluation of 8 sines at onces using AVX intrinsics + + The code is the exact rewriting of the cephes sinf function. + Precision is excellent as long as x < 8192 (I did not bother to + take into account the special handling they have for greater values + -- it does not return garbage for arguments over 8192, though, but + the extra precision is missing). + + Note that it is such that sinf((float)M_PI) = 8.74e-8, which is the + surprising but correct result. + +*/ +inline v8sf sin256_ps(v8sf x) { // any x + v8sf xmm1, xmm2 = _mm256_setzero_ps(), xmm3, sign_bit, y; + v8si imm0, imm2; + + sign_bit = x; + /* take the absolute value */ + x = _mm256_and_ps(x, *(v8sf*)_ps256_inv_sign_mask); + /* extract the sign bit (upper one) */ + sign_bit = _mm256_and_ps(sign_bit, *(v8sf*)_ps256_sign_mask); + + /* scale by 4/Pi */ + y = _mm256_mul_ps(x, *(v8sf*)_ps256_cephes_FOPI); + + /* + Here we start a series of integer operations, which are in the + realm of AVX2. + If we don't have AVX, let's perform them using SSE2 directives + */ + + /* store the integer part of y in mm0 */ + imm2 = _mm256_cvttps_epi32(y); + /* j=(j+1) & (~1) (see the cephes sources) */ + // another two AVX2 instruction + imm2 = _mm256_add_epi32(imm2, *(v8si*)_pi32_256_1); + imm2 = _mm256_and_si256(imm2, *(v8si*)_pi32_256_inv1); + y = _mm256_cvtepi32_ps(imm2); + + /* get the swap sign flag */ + imm0 = _mm256_and_si256(imm2, *(v8si*)_pi32_256_4); + imm0 = _mm256_slli_epi32(imm0, 29); + /* get the polynom selection mask + there is one polynom for 0 <= x <= Pi/4 + and another one for Pi/4 +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor quantized_gru_cell(const at::Tensor & input, const at::Tensor & hx, const at::Tensor & w_ih, const at::Tensor & w_hh, const at::Tensor & b_ih, const at::Tensor & b_hh, const at::Tensor & packed_ih, const at::Tensor & packed_hh, const at::Tensor & col_offsets_ih, const at::Tensor & col_offsets_hh, const at::Scalar & scale_ih, const at::Scalar & scale_hh, const at::Scalar & zero_point_ih, const at::Scalar & zero_point_hh); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9b/9b2824a306502b0a6f1290bd19fd1fcd2869bb52c21a5c33a1bc9480da5752dd/blob b/shared/package-files/9b/9b2824a306502b0a6f1290bd19fd1fcd2869bb52c21a5c33a1bc9480da5752dd/blob new file mode 100644 index 0000000000000000000000000000000000000000..b8a8a35fb36b03d284d3e83cf4320ade0c3e8cde --- /dev/null +++ b/shared/package-files/9b/9b2824a306502b0a6f1290bd19fd1fcd2869bb52c21a5c33a1bc9480da5752dd/blob @@ -0,0 +1,413 @@ +from __future__ import annotations + +import abc +from functools import lru_cache +from typing import TYPE_CHECKING, Any, ClassVar, Final, Protocol, TypeVar, cast, overload + +import polars as pl + +from narwhals._duration import Interval +from narwhals._utils import ( + Implementation, + Version, + _DeferredIterable, + _StoresCompliant, + _StoresNative, + deep_getattr, + isinstance_or_issubclass, +) +from narwhals.exceptions import ( + ColumnNotFoundError, + ComputeError, + DuplicateError, + InvalidOperationError, + NarwhalsError, + ShapeError, +) + +if TYPE_CHECKING: + from collections.abc import Callable, Iterable, Iterator, Mapping + + from typing_extensions import TypeIs + + from narwhals._compliant.typing import Accessor + from narwhals._polars.dataframe import Method + from narwhals._polars.expr import PolarsExpr + from narwhals._polars.series import PolarsSeries + from narwhals.dtypes import DType + from narwhals.typing import IntoDType + + T = TypeVar("T") + NativeT = TypeVar( + "NativeT", bound="pl.DataFrame | pl.LazyFrame | pl.Series | pl.Expr" + ) + +NativeT_co = TypeVar("NativeT_co", "pl.Series", "pl.Expr", covariant=True) +CompliantT_co = TypeVar("CompliantT_co", "PolarsSeries", "PolarsExpr", covariant=True) +CompliantT = TypeVar("CompliantT", "PolarsSeries", "PolarsExpr") + +BACKEND_VERSION = Implementation.POLARS._backend_version() +"""Static backend version for `polars`.""" + +SERIES_ACCEPTS_PD_INDEX: Final[bool] = BACKEND_VERSION >= (0, 20, 7) +"""`pl.Series(values: pd.Index)` fixed in https://github.com/pola-rs/polars/pull/14087""" + +RESPECT_JOIN_NULL_SEMI_ANTI: Final[bool] = BACKEND_VERSION >= (0, 20, 22) +"""Polars < 0.20.22 treats `null == null` as a match in semi/anti joins. + +Dropping rows with null keys on the right removes these spurious matches, +which is always valid since narwhals treats nulls as non-matching. + +Fixed in https://github.com/pola-rs/polars/pull/15696 +""" + +SERIES_RESPECTS_DTYPE: Final[bool] = BACKEND_VERSION >= (0, 20, 26) +"""`pl.Series(dtype=...)` fixed in https://github.com/pola-rs/polars/pull/15962 + +Includes `SERIES_ACCEPTS_PD_INDEX`. +""" + +HAS_INT_128: Final[bool] = BACKEND_VERSION >= (1, 18, 0) +"""https://github.com/pola-rs/polars/pull/20232""" + +FROM_DICTS_ACCEPTS_MAPPINGS: Final[bool] = BACKEND_VERSION >= (1, 30, 0) +"""`pl.from_dicts(data: Iterable[Mapping[str, Any]])` since https://github.com/pola-rs/polars/pull/22638""" + +HAS_UINT_128: Final[bool] = BACKEND_VERSION >= (1, 34, 0) +"""https://github.com/pola-rs/polars/pull/24346""" + +HAS_FLOAT_16: Final[bool] = BACKEND_VERSION >= (1, 36, 0) +"""https://github.com/pola-rs/polars/pull/25185""" + +BINARY_ADD_UPCASTS_DECIMAL_TO_FLOAT: Final[bool] = BACKEND_VERSION >= (1, 34, 0) +"""Polars >= 1.34 upcasts `Decimal + float` to `Float64` (matching `int`/`Float32` promotion). + +https://github.com/pola-rs/polars/pull/24594 +""" + + +@overload +def extract_native(obj: _StoresNative[NativeT]) -> NativeT: ... +@overload +def extract_native(obj: T) -> T: ... +def extract_native(obj: _StoresNative[NativeT] | T) -> NativeT | T: + return obj.native if _is_compliant_polars(obj) else cast("T", obj) + + +def _is_compliant_polars( + obj: _StoresNative[NativeT] | Any, +) -> TypeIs[_StoresNative[NativeT]]: + from narwhals._polars.dataframe import PolarsDataFrame, PolarsLazyFrame + from narwhals._polars.expr import PolarsExpr + from narwhals._polars.series import PolarsSeries + + return isinstance(obj, (PolarsDataFrame, PolarsLazyFrame, PolarsSeries, PolarsExpr)) + + +def extract_args_kwargs( + args: Iterable[Any], kwds: Mapping[str, Any], / +) -> tuple[Iterator[Any], dict[str, Any]]: + it_args = (extract_native(arg) for arg in args) + return it_args, {k: extract_native(v) for k, v in kwds.items()} + + +@lru_cache(maxsize=128) +def native_to_narwhals_dtype( # noqa: C901, PLR0912 + dtype: pl.DataType, version: Version +) -> DType: + dtypes = version.dtypes + if dtype == pl.Float64: + return dtypes.Float64() + if dtype == pl.Float32: + return dtypes.Float32() + if HAS_FLOAT_16 and dtype == pl.Float16: + return dtypes.Float16() + if HAS_INT_128 and dtype == pl.Int128: + return dtypes.Int128() + if dtype == pl.Int64: + return dtypes.Int64() + if dtype == pl.Int32: + return dtypes.Int32() + if dtype == pl.Int16: + return dtypes.Int16() + if dtype == pl.Int8: + return dtypes.Int8() + if HAS_UINT_128 and dtype == pl.UInt128: + return dtypes.UInt128() + if dtype == pl.UInt64: + return dtypes.UInt64() + if dtype == pl.UInt32: + return dtypes.UInt32() + if dtype == pl.UInt16: + return dtypes.UInt16() + if dtype == pl.UInt8: + return dtypes.UInt8() + if dtype == pl.String: + return dtypes.String() + if dtype == pl.Boolean: + return dtypes.Boolean() + if dtype == pl.Object: + return dtypes.Object() + if isinstance(dtype, pl.Categorical): + return dtypes.Categorical() + if isinstance(dtype, pl.Enum): + if version is Version.V1: + return dtypes.Enum() # type: ignore[call-arg] + categories = _DeferredIterable(dtype.categories.to_list) + return dtypes.Enum(categories) + if dtype == pl.Date: + return dtypes.Date() + if isinstance(dtype, pl.Datetime): + return dtypes.Datetime(dtype.time_unit, dtype.time_zone) + if isinstance(dtype, pl.Duration): + return dtypes.Duration(dtype.time_unit) + if isinstance(dtype, pl.Struct): + fields = [ + dtypes.Field(name, native_to_narwhals_dtype(tp, version)) + for name, tp in dtype + ] + return dtypes.Struct(fields) + if isinstance(dtype, pl.List): + return dtypes.List(native_to_narwhals_dtype(dtype.inner, version)) + if isinstance(dtype, pl.Array): + outer_shape = dtype.width if BACKEND_VERSION < (0, 20, 30) else dtype.size # type: ignore[attr-defined] + return dtypes.Array(native_to_narwhals_dtype(dtype.inner, version), outer_shape) + if isinstance(dtype, pl.Decimal): + return dtypes.Decimal(dtype.precision, dtype.scale) + if dtype == pl.Time: + return dtypes.Time() + if dtype == pl.Binary: + return dtypes.Binary() + return dtypes.Unknown() + + +dtypes = Version.MAIN.dtypes + + +def _version_dependent_dtypes() -> dict[type[DType], pl.DataType]: + if not HAS_INT_128: # pragma: no cover + return {} + nw_to_pl: dict[type[DType], pl.DataType] = {dtypes.Int128: pl.Int128()} + nw_to_pl = nw_to_pl | {dtypes.UInt128: pl.UInt128()} if HAS_UINT_128 else nw_to_pl + return nw_to_pl | {dtypes.Float16: pl.Float16()} if HAS_FLOAT_16 else nw_to_pl + + +NW_TO_PL_DTYPES: Mapping[type[DType], pl.DataType] = { + dtypes.Float64: pl.Float64(), + dtypes.Float32: pl.Float32(), + dtypes.Binary: pl.Binary(), + dtypes.String: pl.String(), + dtypes.Boolean: pl.Boolean(), + dtypes.Categorical: pl.Categorical(), + dtypes.Date: pl.Date(), + dtypes.Time: pl.Time(), + dtypes.Int8: pl.Int8(), + dtypes.Int16: pl.Int16(), + dtypes.Int32: pl.Int32(), + dtypes.Int64: pl.Int64(), + dtypes.UInt8: pl.UInt8(), + dtypes.UInt16: pl.UInt16(), + dtypes.UInt32: pl.UInt32(), + dtypes.UInt64: pl.UInt64(), + dtypes.Object: pl.Object(), + dtypes.Unknown: pl.Unknown(), + **_version_dependent_dtypes(), +} + + +def narwhals_to_native_dtype( # noqa: C901 + dtype: IntoDType, version: Version +) -> pl.DataType: + dtypes = version.dtypes + base_type = dtype.base_type() + if pl_type := NW_TO_PL_DTYPES.get(base_type): + return pl_type + if isinstance_or_issubclass(dtype, dtypes.Enum): + if version is Version.V1: + msg = "Converting to Enum is not supported in narwhals.stable.v1" + raise NotImplementedError(msg) + if isinstance(dtype, dtypes.Enum): + return pl.Enum(dtype.categories) + msg = "Can not cast / initialize Enum without categories present" + raise ValueError(msg) + if isinstance_or_issubclass(dtype, dtypes.Datetime): + return pl.Datetime(dtype.time_unit, dtype.time_zone) # type: ignore[arg-type] + if isinstance_or_issubclass(dtype, dtypes.Duration): + return pl.Duration(dtype.time_unit) # type: ignore[arg-type] + if isinstance_or_issubclass(dtype, dtypes.List): + return pl.List(narwhals_to_native_dtype(dtype.inner, version)) + if isinstance_or_issubclass(dtype, dtypes.Struct): + fields = [ + pl.Field(field.name, narwhals_to_native_dtype(field.dtype, version)) + for field in dtype.fields + ] + return pl.Struct(fields) + if isinstance_or_issubclass(dtype, dtypes.Array): # pragma: no cover + size = dtype.size + kwargs = {"width": size} if BACKEND_VERSION < (0, 20, 30) else {"shape": size} + return pl.Array(narwhals_to_native_dtype(dtype.inner, version), **kwargs) + if isinstance_or_issubclass(dtype, dtypes.Decimal): + return pl.Decimal(dtype.precision, dtype.scale) + return pl.Unknown() # pragma: no cover + + +def _is_polars_exception(exception: Exception) -> bool: + if BACKEND_VERSION >= (1,): + # Old versions of Polars didn't have PolarsError. + return isinstance(exception, pl.exceptions.PolarsError) + # Last attempt, for old Polars versions. + return "polars.exceptions" in str(type(exception)) # pragma: no cover + + +def _is_cudf_exception(exception: Exception) -> bool: + # These exceptions are raised when running polars on GPUs via cuDF + return str(exception).startswith("CUDF failure") + + +def catch_polars_exception(exception: Exception) -> NarwhalsError | Exception: + if isinstance(exception, pl.exceptions.ColumnNotFoundError): + return ColumnNotFoundError(str(exception)) + if isinstance(exception, pl.exceptions.ShapeError): + return ShapeError(str(exception)) + if isinstance(exception, pl.exceptions.InvalidOperationError): + return InvalidOperationError(str(exception)) + if isinstance(exception, pl.exceptions.DuplicateError): + return DuplicateError(str(exception)) + if isinstance(exception, pl.exceptions.ComputeError): + return ComputeError(str(exception)) + if _is_polars_exception(exception) or _is_cudf_exception(exception): + return NarwhalsError(str(exception)) # pragma: no cover + # Just return exception as-is. + return exception + + +class PolarsAnyNamespace( + _StoresCompliant[CompliantT_co], + _StoresNative[NativeT_co], + Protocol[CompliantT_co, NativeT_co], +): + _accessor: ClassVar[Accessor] + + def __getattr__(self, attr: str) -> Callable[..., CompliantT_co]: + def func(*args: Any, **kwargs: Any) -> CompliantT_co: + pos, kwds = extract_args_kwargs(args, kwargs) + method = deep_getattr(self.native, self._accessor, attr) + return self.compliant._with_native(method(*pos, **kwds)) + + return func + + +class PolarsDateTimeNamespace(PolarsAnyNamespace[CompliantT, NativeT_co]): + _accessor: ClassVar[Accessor] = "dt" + + def truncate(self, every: str) -> CompliantT: + # Ensure consistent error message is raised. + Interval.parse(every) + return self.__getattr__("truncate")(every) + + def offset_by(self, by: str) -> CompliantT: + # Ensure consistent error message is raised. + Interval.parse_no_constraints(by) + return self.__getattr__("offset_by")(by) + + to_string: Method[CompliantT] + replace_time_zone: Method[CompliantT] + convert_time_zone: Method[CompliantT] + timestamp: Method[CompliantT] + date: Method[CompliantT] + year: Method[CompliantT] + month: Method[CompliantT] + day: Method[CompliantT] + hour: Method[CompliantT] + minute: Method[CompliantT] + second: Method[CompliantT] + millisecond: Method[CompliantT] + microsecond: Method[CompliantT] + nanosecond: Method[CompliantT] + ordinal_day: Method[CompliantT] + weekday: Method[CompliantT] + total_minutes: Method[CompliantT] + total_seconds: Method[CompliantT] + total_milliseconds: Method[CompliantT] + total_microseconds: Method[CompliantT] + total_nanoseconds: Method[CompliantT] + + +class PolarsStringNamespace(PolarsAnyNamespace[CompliantT, NativeT_co]): + _accessor: ClassVar[Accessor] = "str" + + # NOTE: Use `abstractmethod` if we have defs to implement, but also `Method` usage + @abc.abstractmethod + def to_titlecase(self) -> CompliantT: ... + + @abc.abstractmethod + def zfill(self, width: int) -> CompliantT: ... + + @abc.abstractmethod + def slice(self, offset: int, length: int | None) -> CompliantT: ... + + len_chars: Method[CompliantT] + replace: Method[CompliantT] + replace_all: Method[CompliantT] + strip_chars: Method[CompliantT] + strip_chars_start: Method[CompliantT] + strip_chars_end: Method[CompliantT] + starts_with: Method[CompliantT] + ends_with: Method[CompliantT] + contains: Method[CompliantT] + split: Method[CompliantT] + to_date: Method[CompliantT] + to_datetime: Method[CompliantT] + to_time: Method[CompliantT] + to_lowercase: Method[CompliantT] + to_uppercase: Method[CompliantT] + pad_start: Method[CompliantT] + pad_end: Method[CompliantT] + + +def native_get_categories(native: pl.Series) -> pl.Series: + # NOTE: Polars deprecated `cat.get_categories` in v1.44 and removed it + # in v2.0, so we use the workaround they suggest. + # See https://github.com/narwhals-dev/narwhals/issues/3895. + # + # For `Enum`, the declared categories are already unique, ordered, and + # null-free, so we can return `dtype.categories` directly. + dtype = native.dtype + if isinstance(dtype, pl.Enum): + return dtype.categories + return native.unique(maintain_order=True).drop_nulls().cast(pl.String) + + +class PolarsCatNamespace(PolarsAnyNamespace[CompliantT, NativeT_co]): + _accessor: ClassVar[Accessor] = "cat" + + @abc.abstractmethod + def get_categories(self) -> CompliantT: ... + + +class PolarsListNamespace(PolarsAnyNamespace[CompliantT, NativeT_co]): + _accessor: ClassVar[Accessor] = "list" + + @abc.abstractmethod + def len(self) -> CompliantT: ... + + get: Method[CompliantT] + + unique: Method[CompliantT] + + max: Method[CompliantT] + + mean: Method[CompliantT] + + median: Method[CompliantT] + + min: Method[CompliantT] + + sort: Method[CompliantT] + + sum: Method[CompliantT] + + +class PolarsStructNamespace(PolarsAnyNamespace[CompliantT, NativeT_co]): + _accessor: ClassVar[Accessor] = "struct" + field: Method[CompliantT] diff --git a/shared/package-files/9b/9b29fc93ae95aef6672fa47a556e880cf4df3baf15c636c9f14a7922e4a314be/blob b/shared/package-files/9b/9b29fc93ae95aef6672fa47a556e880cf4df3baf15c636c9f14a7922e4a314be/blob new file mode 100644 index 0000000000000000000000000000000000000000..c29589013e4b7863705e1de4cf8c69293451eb8b --- /dev/null +++ b/shared/package-files/9b/9b29fc93ae95aef6672fa47a556e880cf4df3baf15c636c9f14a7922e4a314be/blob @@ -0,0 +1,88 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +#pragma once + +#include + +#include "arrow/util/bit_util.h" +#include "arrow/util/bitmap_reader.h" + +namespace arrow { +namespace internal { + +// A function that visits each bit in a bitmap and calls a visitor function with a +// boolean representation of that bit. This is intended to be analogous to +// GenerateBits. +template +void VisitBits(const uint8_t* bitmap, int64_t start_offset, int64_t length, + Visitor&& visit) { + BitmapReader reader(bitmap, start_offset, length); + for (int64_t index = 0; index < length; ++index) { + visit(reader.IsSet()); + reader.Next(); + } +} + +// Like VisitBits(), but unrolls its main loop for better performance. +template +void VisitBitsUnrolled(const uint8_t* bitmap, int64_t start_offset, int64_t length, + Visitor&& visit) { + if (length == 0) { + return; + } + + // Start by visiting any bits preceding the first full byte. + int64_t num_bits_before_full_bytes = + bit_util::RoundUpToMultipleOf8(start_offset) - start_offset; + // Truncate num_bits_before_full_bytes if it is greater than length. + if (num_bits_before_full_bytes > length) { + num_bits_before_full_bytes = length; + } + // Use the non loop-unrolled VisitBits since we don't want to add branches + VisitBits(bitmap, start_offset, num_bits_before_full_bytes, visit); + + // Shift the start pointer to the first full byte and compute the + // number of full bytes to be read. + const uint8_t* first_full_byte = bitmap + bit_util::CeilDiv(start_offset, 8); + const int64_t num_full_bytes = (length - num_bits_before_full_bytes) / 8; + + // Iterate over each full byte of the input bitmap and call the visitor in + // a loop-unrolled manner. + for (int64_t byte_index = 0; byte_index < num_full_bytes; ++byte_index) { + // Get the current bit-packed byte value from the bitmap. + const uint8_t byte = *(first_full_byte + byte_index); + + // Execute the visitor function on each bit of the current byte. + visit(bit_util::GetBitFromByte(byte, 0)); + visit(bit_util::GetBitFromByte(byte, 1)); + visit(bit_util::GetBitFromByte(byte, 2)); + visit(bit_util::GetBitFromByte(byte, 3)); + visit(bit_util::GetBitFromByte(byte, 4)); + visit(bit_util::GetBitFromByte(byte, 5)); + visit(bit_util::GetBitFromByte(byte, 6)); + visit(bit_util::GetBitFromByte(byte, 7)); + } + + // Write any leftover bits in the last byte. + const int64_t num_bits_after_full_bytes = (length - num_bits_before_full_bytes) % 8; + VisitBits(first_full_byte + num_full_bytes, 0, num_bits_after_full_bytes, + visit); +} + +} // namespace internal +} // namespace arrow diff --git a/shared/package-files/9b/9b2c1a62c96e69385c72c6f7d5499d217c1773c48436f016e83412ea582aace6/blob b/shared/package-files/9b/9b2c1a62c96e69385c72c6f7d5499d217c1773c48436f016e83412ea582aace6/blob new file mode 100644 index 0000000000000000000000000000000000000000..e0494e342e44dff73fa405aac21cc30d584c8758 --- /dev/null +++ b/shared/package-files/9b/9b2c1a62c96e69385c72c6f7d5499d217c1773c48436f016e83412ea582aace6/blob @@ -0,0 +1,57 @@ +#pragma once + +#include +#include + +#include +#include +#include + +struct CUevent_st; + +namespace torch { +namespace profiler { +namespace impl { + +// ---------------------------------------------------------------------------- +// -- Annotation -------------------------------------------------------------- +// ---------------------------------------------------------------------------- +using ProfilerEventStub = std::shared_ptr; +using ProfilerVoidEventStub = std::shared_ptr; + +struct TORCH_API ProfilerStubs { + virtual void record( + c10::DeviceIndex* device, + ProfilerVoidEventStub* event, + int64_t* cpu_ns) const = 0; + virtual float elapsed( + const ProfilerVoidEventStub* event, + const ProfilerVoidEventStub* event2) const = 0; + virtual void mark(const char* name) const = 0; + virtual void rangePush(const char* name) const = 0; + virtual void rangePop() const = 0; + virtual bool enabled() const { + return false; + } + virtual void onEachDevice(std::function op) const = 0; + virtual void synchronize() const = 0; + virtual ~ProfilerStubs(); +}; + +TORCH_API void registerCUDAMethods(ProfilerStubs* stubs); +TORCH_API const ProfilerStubs* cudaStubs(); +TORCH_API void registerITTMethods(ProfilerStubs* stubs); +TORCH_API const ProfilerStubs* ittStubs(); +TORCH_API void registerPrivateUse1Methods(ProfilerStubs* stubs); +TORCH_API const ProfilerStubs* privateuse1Stubs(); + +using vulkan_id_t = strong::type< + int64_t, + struct _VulkanID, + strong::regular, + strong::convertible_to, + strong::hashable>; + +} // namespace impl +} // namespace profiler +} // namespace torch diff --git a/shared/package-files/9b/9b2e55e0f1d3df31cb2b442f6a712a427eb98c9e7f9cd572eae97fd301d14f5f/blob b/shared/package-files/9b/9b2e55e0f1d3df31cb2b442f6a712a427eb98c9e7f9cd572eae97fd301d14f5f/blob new file mode 100644 index 0000000000000000000000000000000000000000..b68312855e77fe5165040b3034a1c83f9bfd843a --- /dev/null +++ b/shared/package-files/9b/9b2e55e0f1d3df31cb2b442f6a712a427eb98c9e7f9cd572eae97fd301d14f5f/blob @@ -0,0 +1,140 @@ +""" Functions related to graph covers.""" + +from functools import partial +from itertools import chain + +import networkx as nx +from networkx.utils import arbitrary_element, not_implemented_for + +__all__ = ["min_edge_cover", "is_edge_cover"] + + +@not_implemented_for("directed") +@not_implemented_for("multigraph") +def min_edge_cover(G, matching_algorithm=None): + """Returns the min cardinality edge cover of the graph as a set of edges. + + A smallest edge cover can be found in polynomial time by finding + a maximum matching and extending it greedily so that all nodes + are covered. This function follows that process. A maximum matching + algorithm can be specified for the first step of the algorithm. + The resulting set may return a set with one 2-tuple for each edge, + (the usual case) or with both 2-tuples `(u, v)` and `(v, u)` for + each edge. The latter is only done when a bipartite matching algorithm + is specified as `matching_algorithm`. + + Parameters + ---------- + G : NetworkX graph + An undirected graph. + + matching_algorithm : function + A function that returns a maximum cardinality matching for `G`. + The function must take one input, the graph `G`, and return + either a set of edges (with only one direction for the pair of nodes) + or a dictionary mapping each node to its mate. If not specified, + :func:`~networkx.algorithms.matching.max_weight_matching` is used. + Common bipartite matching functions include + :func:`~networkx.algorithms.bipartite.matching.hopcroft_karp_matching` + or + :func:`~networkx.algorithms.bipartite.matching.eppstein_matching`. + + Returns + ------- + min_cover : set + + A set of the edges in a minimum edge cover in the form of tuples. + It contains only one of the equivalent 2-tuples `(u, v)` and `(v, u)` + for each edge. If a bipartite method is used to compute the matching, + the returned set contains both the 2-tuples `(u, v)` and `(v, u)` + for each edge of a minimum edge cover. + + Examples + -------- + >>> G = nx.Graph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3)]) + >>> sorted(nx.min_edge_cover(G)) + [(2, 1), (3, 0)] + + Notes + ----- + An edge cover of a graph is a set of edges such that every node of + the graph is incident to at least one edge of the set. + The minimum edge cover is an edge covering of smallest cardinality. + + Due to its implementation, the worst-case running time of this algorithm + is bounded by the worst-case running time of the function + ``matching_algorithm``. + + Minimum edge cover for `G` can also be found using the `min_edge_covering` + function in :mod:`networkx.algorithms.bipartite.covering` which is + simply this function with a default matching algorithm of + :func:`~networkx.algorithms.bipartite.matching.hopcraft_karp_matching` + """ + if len(G) == 0: + return set() + if nx.number_of_isolates(G) > 0: + # ``min_cover`` does not exist as there is an isolated node + raise nx.NetworkXException( + "Graph has a node with no edge incident on it, " "so no edge cover exists." + ) + if matching_algorithm is None: + matching_algorithm = partial(nx.max_weight_matching, maxcardinality=True) + maximum_matching = matching_algorithm(G) + # ``min_cover`` is superset of ``maximum_matching`` + try: + # bipartite matching algs return dict so convert if needed + min_cover = set(maximum_matching.items()) + bipartite_cover = True + except AttributeError: + min_cover = maximum_matching + bipartite_cover = False + # iterate for uncovered nodes + uncovered_nodes = set(G) - {v for u, v in min_cover} - {u for u, v in min_cover} + for v in uncovered_nodes: + # Since `v` is uncovered, each edge incident to `v` will join it + # with a covered node (otherwise, if there were an edge joining + # uncovered nodes `u` and `v`, the maximum matching algorithm + # would have found it), so we can choose an arbitrary edge + # incident to `v`. (This applies only in a simple graph, not a + # multigraph.) + u = arbitrary_element(G[v]) + min_cover.add((u, v)) + if bipartite_cover: + min_cover.add((v, u)) + return min_cover + + +@not_implemented_for("directed") +def is_edge_cover(G, cover): + """Decides whether a set of edges is a valid edge cover of the graph. + + Given a set of edges, whether it is an edge covering can + be decided if we just check whether all nodes of the graph + has an edge from the set, incident on it. + + Parameters + ---------- + G : NetworkX graph + An undirected bipartite graph. + + cover : set + Set of edges to be checked. + + Returns + ------- + bool + Whether the set of edges is a valid edge cover of the graph. + + Examples + -------- + >>> G = nx.Graph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3)]) + >>> cover = {(2, 1), (3, 0)} + >>> nx.is_edge_cover(G, cover) + True + + Notes + ----- + An edge cover of a graph is a set of edges such that every node of + the graph is incident to at least one edge of the set. + """ + return set(G) <= set(chain.from_iterable(cover)) diff --git a/shared/package-files/9b/9b2f91be34024fbcf645f6ef92460e5f944ca6a16268b79478ab904b2934d357/blob b/shared/package-files/9b/9b2f91be34024fbcf645f6ef92460e5f944ca6a16268b79478ab904b2934d357/blob new file mode 100644 index 0000000000000000000000000000000000000000..ac19f62def15335167aa126a5bd6650c4bedd1ca --- /dev/null +++ b/shared/package-files/9b/9b2f91be34024fbcf645f6ef92460e5f944ca6a16268b79478ab904b2934d357/blob @@ -0,0 +1,52 @@ +# created by tools/loadICU.tcl -- do not edit +namespace eval ::tcl::clock { + ::msgcat::mcset el DAYS_OF_WEEK_ABBREV [list \ + "\u039a\u03c5\u03c1"\ + "\u0394\u03b5\u03c5"\ + "\u03a4\u03c1\u03b9"\ + "\u03a4\u03b5\u03c4"\ + "\u03a0\u03b5\u03bc"\ + "\u03a0\u03b1\u03c1"\ + "\u03a3\u03b1\u03b2"] + ::msgcat::mcset el DAYS_OF_WEEK_FULL [list \ + "\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae"\ + "\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1"\ + "\u03a4\u03c1\u03af\u03c4\u03b7"\ + "\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7"\ + "\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7"\ + "\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae"\ + "\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"] + ::msgcat::mcset el MONTHS_ABBREV [list \ + "\u0399\u03b1\u03bd"\ + "\u03a6\u03b5\u03b2"\ + "\u039c\u03b1\u03c1"\ + "\u0391\u03c0\u03c1"\ + "\u039c\u03b1\u03ca"\ + "\u0399\u03bf\u03c5\u03bd"\ + "\u0399\u03bf\u03c5\u03bb"\ + "\u0391\u03c5\u03b3"\ + "\u03a3\u03b5\u03c0"\ + "\u039f\u03ba\u03c4"\ + "\u039d\u03bf\u03b5"\ + "\u0394\u03b5\u03ba"\ + ""] + ::msgcat::mcset el MONTHS_FULL [list \ + "\u0399\u03b1\u03bd\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2"\ + "\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2"\ + "\u039c\u03ac\u03c1\u03c4\u03b9\u03bf\u03c2"\ + "\u0391\u03c0\u03c1\u03af\u03bb\u03b9\u03bf\u03c2"\ + "\u039c\u03ac\u03ca\u03bf\u03c2"\ + "\u0399\u03bf\u03cd\u03bd\u03b9\u03bf\u03c2"\ + "\u0399\u03bf\u03cd\u03bb\u03b9\u03bf\u03c2"\ + "\u0391\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2"\ + "\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2"\ + "\u039f\u03ba\u03c4\u03ce\u03b2\u03c1\u03b9\u03bf\u03c2"\ + "\u039d\u03bf\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2"\ + "\u0394\u03b5\u03ba\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2"\ + ""] + ::msgcat::mcset el AM "\u03c0\u03bc" + ::msgcat::mcset el PM "\u03bc\u03bc" + ::msgcat::mcset el DATE_FORMAT "%e/%m/%Y" + ::msgcat::mcset el TIME_FORMAT_12 "%l:%M:%S %P" + ::msgcat::mcset el DATE_TIME_FORMAT "%e/%m/%Y %l:%M:%S %P %z" +} diff --git a/shared/package-files/9b/9b2ff15cb3d217ce7ef0b06547f16743aef6d5363072c505bff85d03e769596e/blob b/shared/package-files/9b/9b2ff15cb3d217ce7ef0b06547f16743aef6d5363072c505bff85d03e769596e/blob new file mode 100644 index 0000000000000000000000000000000000000000..9914060907ade42fa6f7dc62e42fa63935603712 --- /dev/null +++ b/shared/package-files/9b/9b2ff15cb3d217ce7ef0b06547f16743aef6d5363072c505bff85d03e769596e/blob @@ -0,0 +1,360 @@ +Metadata-Version: 2.1 +Name: pyOpenSSL +Version: 24.0.0 +Summary: Python wrapper module around the OpenSSL library +Home-page: https://pyopenssl.org/ +Author: The pyOpenSSL developers +Author-email: cryptography-dev@python.org +License: Apache License, Version 2.0 +Project-URL: Source, https://github.com/pyca/pyopenssl +Classifier: Development Status :: 6 - Mature +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: POSIX +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Security :: Cryptography +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: System :: Networking +Requires-Python: >=3.7 +License-File: LICENSE +Requires-Dist: cryptography <43,>=41.0.5 +Provides-Extra: docs +Requires-Dist: sphinx !=5.2.0,!=5.2.0.post0,!=7.2.5 ; extra == 'docs' +Requires-Dist: sphinx-rtd-theme ; extra == 'docs' +Provides-Extra: test +Requires-Dist: flaky ; extra == 'test' +Requires-Dist: pretend ; extra == 'test' +Requires-Dist: pytest >=3.0.1 ; extra == 'test' + +======================================================== +pyOpenSSL -- A Python wrapper around the OpenSSL library +======================================================== + +.. image:: https://readthedocs.org/projects/pyopenssl/badge/?version=stable + :target: https://pyopenssl.org/en/stable/ + :alt: Stable Docs + +.. image:: https://github.com/pyca/pyopenssl/workflows/CI/badge.svg?branch=main + :target: https://github.com/pyca/pyopenssl/actions?query=workflow%3ACI+branch%3Amain + +.. image:: https://codecov.io/github/pyca/pyopenssl/branch/main/graph/badge.svg + :target: https://codecov.io/github/pyca/pyopenssl + :alt: Test coverage + +**Note:** The Python Cryptographic Authority **strongly suggests** the use of `pyca/cryptography`_ +where possible. If you are using pyOpenSSL for anything other than making a TLS connection +**you should move to cryptography and drop your pyOpenSSL dependency**. + +High-level wrapper around a subset of the OpenSSL library. Includes + +* ``SSL.Connection`` objects, wrapping the methods of Python's portable sockets +* Callbacks written in Python +* Extensive error-handling mechanism, mirroring OpenSSL's error codes + +... and much more. + +You can find more information in the documentation_. +Development takes place on GitHub_. + + +Discussion +========== + +If you run into bugs, you can file them in our `issue tracker`_. + +We maintain a cryptography-dev_ mailing list for both user and development discussions. + +You can also join ``#pyca`` on ``irc.libera.chat`` to ask questions or get involved. + + +.. _documentation: https://pyopenssl.org/ +.. _`issue tracker`: https://github.com/pyca/pyopenssl/issues +.. _cryptography-dev: https://mail.python.org/mailman/listinfo/cryptography-dev +.. _GitHub: https://github.com/pyca/pyopenssl +.. _`pyca/cryptography`: https://github.com/pyca/cryptography + + +Release Information +=================== + +24.0.0 (2024-01-22) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Deprecations: +^^^^^^^^^^^^^ + +Changes: +^^^^^^^^ + +- Added ``OpenSSL.SSL.Connection.get_selected_srtp_profile`` to determine which SRTP profile was negotiated. + `#1279 `_. + +23.3.0 (2023-10-25) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Dropped support for Python 3.6. +- The minimum ``cryptography`` version is now 41.0.5. +- Removed ``OpenSSL.crypto.loads_pkcs7`` and ``OpenSSL.crypto.loads_pkcs12`` which had been deprecated for 3 years. +- Added ``OpenSSL.SSL.OP_LEGACY_SERVER_CONNECT`` to allow legacy insecure renegotiation between OpenSSL and unpatched servers. + `#1234 `_. + +Deprecations: +^^^^^^^^^^^^^ + +- Deprecated ``OpenSSL.crypto.PKCS12`` (which was intended to have been deprecated at the same time as ``OpenSSL.crypto.load_pkcs12``). +- Deprecated ``OpenSSL.crypto.NetscapeSPKI``. +- Deprecated ``OpenSSL.crypto.CRL`` +- Deprecated ``OpenSSL.crypto.Revoked`` +- Deprecated ``OpenSSL.crypto.load_crl`` and ``OpenSSL.crypto.dump_crl`` +- Deprecated ``OpenSSL.crypto.sign`` and ``OpenSSL.crypto.verify`` +- Deprecated ``OpenSSL.crypto.X509Extension`` + +Changes: +^^^^^^^^ + +- Changed ``OpenSSL.crypto.X509Store.add_crl`` to also accept + ``cryptography``'s ``x509.CertificateRevocationList`` arguments in addition + to the now deprecated ``OpenSSL.crypto.CRL`` arguments. +- Fixed ``test_set_default_verify_paths`` test so that it is skipped if no + network connection is available. + +23.2.0 (2023-05-30) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Removed ``X509StoreFlags.NOTIFY_POLICY``. + `#1213 `_. + +Deprecations: +^^^^^^^^^^^^^ + +Changes: +^^^^^^^^ + +- ``cryptography`` maximum version has been increased to 41.0.x. +- Invalid versions are now rejected in ``OpenSSL.crypto.X509Req.set_version``. +- Added ``X509VerificationCodes`` to ``OpenSSL.SSL``. + `#1202 `_. + +23.1.1 (2023-03-28) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Deprecations: +^^^^^^^^^^^^^ + +Changes: +^^^^^^^^ + +- Worked around an issue in OpenSSL 3.1.0 which caused `X509Extension.get_short_name` to raise an exception when no short name was known to OpenSSL. + `#1204 `_. + +23.1.0 (2023-03-24) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Deprecations: +^^^^^^^^^^^^^ + +Changes: +^^^^^^^^ + +- ``cryptography`` maximum version has been increased to 40.0.x. +- Add ``OpenSSL.SSL.Connection.DTLSv1_get_timeout`` and ``OpenSSL.SSL.Connection.DTLSv1_handle_timeout`` + to support DTLS timeouts `#1180 `_. + +23.0.0 (2023-01-01) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Deprecations: +^^^^^^^^^^^^^ + +Changes: +^^^^^^^^ + +- Add ``OpenSSL.SSL.X509StoreFlags.PARTIAL_CHAIN`` constant to allow for users + to perform certificate verification on partial certificate chains. + `#1166 `_ +- ``cryptography`` maximum version has been increased to 39.0.x. + +22.1.0 (2022-09-25) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Remove support for SSLv2 and SSLv3. +- The minimum ``cryptography`` version is now 38.0.x (and we now pin releases + against ``cryptography`` major versions to prevent future breakage) +- The ``OpenSSL.crypto.X509StoreContextError`` exception has been refactored, + changing its internal attributes. + `#1133 `_ + +Deprecations: +^^^^^^^^^^^^^ + +- ``OpenSSL.SSL.SSLeay_version`` is deprecated in favor of + ``OpenSSL.SSL.OpenSSL_version``. The constants ``OpenSSL.SSL.SSLEAY_*`` are + deprecated in favor of ``OpenSSL.SSL.OPENSSL_*``. + +Changes: +^^^^^^^^ + +- Add ``OpenSSL.SSL.Connection.set_verify`` and ``OpenSSL.SSL.Connection.get_verify_mode`` + to override the context object's verification flags. + `#1073 `_ +- Add ``OpenSSL.SSL.Connection.use_certificate`` and ``OpenSSL.SSL.Connection.use_privatekey`` + to set a certificate per connection (and not just per context) `#1121 `_. + +22.0.0 (2022-01-29) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Drop support for Python 2.7. + `#1047 `_ +- The minimum ``cryptography`` version is now 35.0. + +Deprecations: +^^^^^^^^^^^^^ + +Changes: +^^^^^^^^ + +- Expose wrappers for some `DTLS + `_ + primitives. `#1026 `_ + +21.0.0 (2021-09-28) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- The minimum ``cryptography`` version is now 3.3. +- Drop support for Python 3.5 + +Deprecations: +^^^^^^^^^^^^^ + +Changes: +^^^^^^^^ + +- Raise an error when an invalid ALPN value is set. + `#993 `_ +- Added ``OpenSSL.SSL.Context.set_min_proto_version`` and ``OpenSSL.SSL.Context.set_max_proto_version`` + to set the minimum and maximum supported TLS version `#985 `_. +- Updated ``to_cryptography`` and ``from_cryptography`` methods to support an upcoming release of ``cryptography`` without raising deprecation warnings. + `#1030 `_ + +20.0.1 (2020-12-15) +------------------- + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Deprecations: +^^^^^^^^^^^^^ + +Changes: +^^^^^^^^ + +- Fixed compatibility with OpenSSL 1.1.0. + +20.0.0 (2020-11-27) +------------------- + + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- The minimum ``cryptography`` version is now 3.2. +- Remove deprecated ``OpenSSL.tsafe`` module. +- Removed deprecated ``OpenSSL.SSL.Context.set_npn_advertise_callback``, ``OpenSSL.SSL.Context.set_npn_select_callback``, and ``OpenSSL.SSL.Connection.get_next_proto_negotiated``. +- Drop support for Python 3.4 +- Drop support for OpenSSL 1.0.1 and 1.0.2 + +Deprecations: +^^^^^^^^^^^^^ + +- Deprecated ``OpenSSL.crypto.loads_pkcs7`` and ``OpenSSL.crypto.loads_pkcs12``. + +Changes: +^^^^^^^^ + +- Added a new optional ``chain`` parameter to ``OpenSSL.crypto.X509StoreContext()`` + where additional untrusted certificates can be specified to help chain building. + `#948 `_ +- Added ``OpenSSL.crypto.X509Store.load_locations`` to set trusted + certificate file bundles and/or directories for verification. + `#943 `_ +- Added ``Context.set_keylog_callback`` to log key material. + `#910 `_ +- Added ``OpenSSL.SSL.Connection.get_verified_chain`` to retrieve the + verified certificate chain of the peer. + `#894 `_. +- Make verification callback optional in ``Context.set_verify``. + If omitted, OpenSSL's default verification is used. + `#933 `_ +- Fixed a bug that could truncate or cause a zero-length key error due to a + null byte in private key passphrase in ``OpenSSL.crypto.load_privatekey`` + and ``OpenSSL.crypto.dump_privatekey``. + `#947 `_ + +19.1.0 (2019-11-18) +------------------- + + +Backward-incompatible changes: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Removed deprecated ``ContextType``, ``ConnectionType``, ``PKeyType``, ``X509NameType``, ``X509ReqType``, ``X509Type``, ``X509StoreType``, ``CRLType``, ``PKCS7Type``, ``PKCS12Type``, and ``NetscapeSPKIType`` aliases. + Use the classes without the ``Type`` suffix instead. + `#814 `_ +- The minimum ``cryptography`` version is now 2.8 due to issues on macOS with a transitive dependency. + `#875 `_ + +Deprecations: +^^^^^^^^^^^^^ + +- Deprecated ``OpenSSL.SSL.Context.set_npn_advertise_callback``, ``OpenSSL.SSL.Context.set_npn_select_callback``, and ``OpenSSL.SSL.Connection.get_next_proto_negotiated``. + ALPN should be used instead. + `#820 `_ + + +Changes: +^^^^^^^^ + +- Support ``bytearray`` in ``SSL.Connection.send()`` by using cffi's from_buffer. + `#852 `_ +- The ``OpenSSL.SSL.Context.set_alpn_select_callback`` can return a new ``NO_OVERLAPPING_PROTOCOLS`` sentinel value + to allow a TLS handshake to complete without an application protocol. + +`Full changelog `_. + diff --git a/shared/package-files/9b/9b34108030dba74e01d372b226ba2cb0ba7c62aef6449ce3a7edc0adf8db307f/blob b/shared/package-files/9b/9b34108030dba74e01d372b226ba2cb0ba7c62aef6449ce3a7edc0adf8db307f/blob new file mode 100644 index 0000000000000000000000000000000000000000..43b882ca18274dcdb273cf35680016453db3c698 --- /dev/null +++ b/shared/package-files/9b/9b34108030dba74e01d372b226ba2cb0ba7c62aef6449ce3a7edc0adf8db307f/blob @@ -0,0 +1,188 @@ +try: + from ctypes import c_float, c_int, c_double +except ImportError: + pass + +import pyglet.gl as pgl +from sympy.core import S + + +def get_model_matrix(array_type=c_float, glGetMethod=pgl.glGetFloatv): + """ + Returns the current modelview matrix. + """ + m = (array_type*16)() + glGetMethod(pgl.GL_MODELVIEW_MATRIX, m) + return m + + +def get_projection_matrix(array_type=c_float, glGetMethod=pgl.glGetFloatv): + """ + Returns the current modelview matrix. + """ + m = (array_type*16)() + glGetMethod(pgl.GL_PROJECTION_MATRIX, m) + return m + + +def get_viewport(): + """ + Returns the current viewport. + """ + m = (c_int*4)() + pgl.glGetIntegerv(pgl.GL_VIEWPORT, m) + return m + + +def get_direction_vectors(): + m = get_model_matrix() + return ((m[0], m[4], m[8]), + (m[1], m[5], m[9]), + (m[2], m[6], m[10])) + + +def get_view_direction_vectors(): + m = get_model_matrix() + return ((m[0], m[1], m[2]), + (m[4], m[5], m[6]), + (m[8], m[9], m[10])) + + +def get_basis_vectors(): + return ((1, 0, 0), (0, 1, 0), (0, 0, 1)) + + +def screen_to_model(x, y, z): + m = get_model_matrix(c_double, pgl.glGetDoublev) + p = get_projection_matrix(c_double, pgl.glGetDoublev) + w = get_viewport() + mx, my, mz = c_double(), c_double(), c_double() + pgl.gluUnProject(x, y, z, m, p, w, mx, my, mz) + return float(mx.value), float(my.value), float(mz.value) + + +def model_to_screen(x, y, z): + m = get_model_matrix(c_double, pgl.glGetDoublev) + p = get_projection_matrix(c_double, pgl.glGetDoublev) + w = get_viewport() + mx, my, mz = c_double(), c_double(), c_double() + pgl.gluProject(x, y, z, m, p, w, mx, my, mz) + return float(mx.value), float(my.value), float(mz.value) + + +def vec_subs(a, b): + return tuple(a[i] - b[i] for i in range(len(a))) + + +def billboard_matrix(): + """ + Removes rotational components of + current matrix so that primitives + are always drawn facing the viewer. + + |1|0|0|x| + |0|1|0|x| + |0|0|1|x| (x means left unchanged) + |x|x|x|x| + """ + m = get_model_matrix() + # XXX: for i in range(11): m[i] = i ? + m[0] = 1 + m[1] = 0 + m[2] = 0 + m[4] = 0 + m[5] = 1 + m[6] = 0 + m[8] = 0 + m[9] = 0 + m[10] = 1 + pgl.glLoadMatrixf(m) + + +def create_bounds(): + return [[S.Infinity, S.NegativeInfinity, 0], + [S.Infinity, S.NegativeInfinity, 0], + [S.Infinity, S.NegativeInfinity, 0]] + + +def update_bounds(b, v): + if v is None: + return + for axis in range(3): + b[axis][0] = min([b[axis][0], v[axis]]) + b[axis][1] = max([b[axis][1], v[axis]]) + + +def interpolate(a_min, a_max, a_ratio): + return a_min + a_ratio * (a_max - a_min) + + +def rinterpolate(a_min, a_max, a_value): + a_range = a_max - a_min + if a_max == a_min: + a_range = 1.0 + return (a_value - a_min) / float(a_range) + + +def interpolate_color(color1, color2, ratio): + return tuple(interpolate(color1[i], color2[i], ratio) for i in range(3)) + + +def scale_value(v, v_min, v_len): + return (v - v_min) / v_len + + +def scale_value_list(flist): + v_min, v_max = min(flist), max(flist) + v_len = v_max - v_min + return [scale_value(f, v_min, v_len) for f in flist] + + +def strided_range(r_min, r_max, stride, max_steps=50): + o_min, o_max = r_min, r_max + if abs(r_min - r_max) < 0.001: + return [] + try: + range(int(r_min - r_max)) + except (TypeError, OverflowError): + return [] + if r_min > r_max: + raise ValueError("r_min cannot be greater than r_max") + r_min_s = (r_min % stride) + r_max_s = stride - (r_max % stride) + if abs(r_max_s - stride) < 0.001: + r_max_s = 0.0 + r_min -= r_min_s + r_max += r_max_s + r_steps = int((r_max - r_min)/stride) + if max_steps and r_steps > max_steps: + return strided_range(o_min, o_max, stride*2) + return [r_min] + [r_min + e*stride for e in range(1, r_steps + 1)] + [r_max] + + +def parse_option_string(s): + if not isinstance(s, str): + return None + options = {} + for token in s.split(';'): + pieces = token.split('=') + if len(pieces) == 1: + option, value = pieces[0], "" + elif len(pieces) == 2: + option, value = pieces + else: + raise ValueError("Plot option string '%s' is malformed." % (s)) + options[option.strip()] = value.strip() + return options + + +def dot_product(v1, v2): + return sum(v1[i]*v2[i] for i in range(3)) + + +def vec_sub(v1, v2): + return tuple(v1[i] - v2[i] for i in range(3)) + + +def vec_mag(v): + return sum(v[i]**2 for i in range(3))**(0.5) diff --git a/shared/package-files/9b/9b3bb70cade8184ee8eca3239aa7e6762ad6be906e15e8ea42ed5629b8abdafa/blob b/shared/package-files/9b/9b3bb70cade8184ee8eca3239aa7e6762ad6be906e15e8ea42ed5629b8abdafa/blob new file mode 100644 index 0000000000000000000000000000000000000000..4d26b64e02aa3f65a97d99160047efd76e7f121d --- /dev/null +++ b/shared/package-files/9b/9b3bb70cade8184ee8eca3239aa7e6762ad6be906e15e8ea42ed5629b8abdafa/blob @@ -0,0 +1,200 @@ +/* Translated from Cython into C++ by SciPy developers in 2024. + * Original header with Copyright information appears below. + */ + +/* Implementation of sin/cos/sinh/cosh integrals for complex arguments + * + * Sources + * [1] Fredrik Johansson and others. mpmath: a Python library for + * arbitrary-precision floating-point arithmetic (version 0.19), + * December 2013. http://mpmath.org/. + * [2] NIST, "Digital Library of Mathematical Functions", + * https://dlmf.nist.gov/ + */ + +#pragma once + +#include "config.h" +#include "error.h" + +#include "expint.h" +#include "cephes/const.h" +#include "cephes/sici.h" +#include "cephes/shichi.h" + +namespace xsf { +namespace detail { + + XSF_HOST_DEVICE inline void sici_power_series(int sgn, std::complex z, + std::complex *s, std::complex *c) { + /* DLMF 6.6.5 and 6.6.6. If sgn = -1 computes si/ci, and if sgn = 1 + * computes shi/chi. + */ + std::complex fac = z; + *s = fac; + *c = 0; + std::complex term1, term2; + for (int n = 1; n < 100; n++) { + fac *= static_cast(sgn)*z/(2.0*n); + term2 = fac/(2.0*n); + *c += term2; + fac *= z/(2.0*n + 1.0); + term1 = fac/(2.0*n + 1.0); + *s += term1; + constexpr double tol = std::numeric_limits::epsilon(); + if (std::abs(term1) < tol*std::abs(*s) && std::abs(term2) < tol*std::abs(*c)) { + break; + } + } + } + +} + + +XSF_HOST_DEVICE inline int sici(std::complex z, + std::complex *si, std::complex *ci) { + /* Compute sin/cos integrals at complex arguments. The algorithm + * largely follows that of [1]. + */ + + constexpr double EULER = xsf::cephes::detail::SCIPY_EULER; + + if (z == std::numeric_limits::infinity()) { + *si = M_PI_2; + *ci = 0; + return 0; + } + if (z == -std::numeric_limits::infinity()) { + *si = -M_PI_2; + *ci = {0.0, M_PI}; + return 0; + } + + if (std::abs(z) < 0.8) { + // Use the series to avoid cancellation in si + detail::sici_power_series(-1, z, si, ci); + + if (z == 0.0) { + set_error("sici", SF_ERROR_DOMAIN, NULL); + *ci = {-std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN()}; + } else { + *ci += EULER + std::log(z); + } + return 0; + } + + // DLMF 6.5.5/6.5.6 plus DLMF 6.4.4/6.4.6/6.4.7 + std::complex jz = std::complex(0.0, 1.0) * z; + std::complex term1 = expi(jz); + std::complex term2 = expi(-jz); + *si = std::complex(0.0, -0.5)*(term1 - term2); + *ci = 0.5*(term1 + term2); + if (z.real() == 0) { + if (z.imag() > 0) { + *ci += std::complex(0.0, M_PI_2); + } else if (z.imag() < 0) { + *ci -= std::complex(0.0, M_PI_2); + } + } else if (z.real() > 0) { + *si -= M_PI_2; + } else { + *si += M_PI_2; + if (z.imag() >= 0) { + *ci += std::complex(0.0, M_PI); + } else { + *ci -= std::complex(0.0, M_PI); + } + } + return 0; +} + +XSF_HOST_DEVICE inline int sici(std::complex z, + std::complex *si_f, std::complex *ci_f) { + std::complex si; + std::complex ci; + int res = sici(z, &si, &ci); + *si_f = si; + *ci_f = ci; + return res; +} + +XSF_HOST_DEVICE inline int shichi(std::complex z, + std::complex *shi, std::complex *chi) { + /* Compute sinh/cosh integrals at complex arguments. The algorithm + * largely follows that of [1]. + */ + constexpr double EULER = xsf::cephes::detail::SCIPY_EULER; + if (z == std::numeric_limits::infinity()) { + *shi = std::numeric_limits::infinity(); + *chi = std::numeric_limits::infinity(); + return 0; + } + if (z == -std::numeric_limits::infinity()) { + *shi = -std::numeric_limits::infinity(); + *chi = std::numeric_limits::infinity(); + return 0; + } + if (std::abs(z) < 0.8) { + // Use the series to avoid cancellation in shi + detail::sici_power_series(1, z, shi, chi); + if (z == 0.0) { + set_error("shichi", SF_ERROR_DOMAIN, NULL); + *chi = {-std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN()}; + } else { + *chi += EULER + std::log(z); + } + return 0; + } + + std::complex term1 = expi(z); + std::complex term2 = expi(-z); + *shi = 0.5*(term1 - term2); + *chi = 0.5*(term1 + term2); + if (z.imag() > 0) { + *shi -= std::complex(0.0, 0.5*M_PI); + *chi += std::complex(0.0, 0.5*M_PI); + } else if (z.imag() < 0) { + *shi += std::complex(0.0, 0.5*M_PI); + *chi -= std::complex(0.0, 0.5*M_PI); + } else if (z.real() < 0) { + *chi += std::complex(0.0, M_PI); + } + return 0; +} + +XSF_HOST_DEVICE inline int shichi(std::complex z, + std::complex *shi_f, std::complex *chi_f) { + std::complex shi; + std::complex chi; + int res = shichi(z, &shi, &chi); + *shi_f = shi; + *chi_f = chi; + return res; +} + +XSF_HOST_DEVICE inline int sici(double x, double *si, double *ci) { + return cephes::sici(x, si, ci); +} + +XSF_HOST_DEVICE inline int shichi(double x, double *shi, double *chi) { + return cephes::shichi(x, shi, chi); +} + +XSF_HOST_DEVICE inline int sici(float x, float *si_f, float *ci_f) { + double si; + double ci; + int res = cephes::sici(x, &si, &ci); + *si_f = si; + *ci_f = ci; + return res; +} + +XSF_HOST_DEVICE inline int shichi(float x, float *shi_f, float *chi_f) { + double shi; + double chi; + int res = cephes::shichi(x, &shi, &chi); + *shi_f = shi; + *chi_f = chi; + return res; +} +} diff --git a/shared/package-files/9b/9b3e92596047cab99a939229b56d656a7862d617eacf9291d7fa6f6c95f80e36/blob b/shared/package-files/9b/9b3e92596047cab99a939229b56d656a7862d617eacf9291d7fa6f6c95f80e36/blob new file mode 100644 index 0000000000000000000000000000000000000000..fbdd8a3cd81c9a0f435f9ce26b18957b0516980e --- /dev/null +++ b/shared/package-files/9b/9b3e92596047cab99a939229b56d656a7862d617eacf9291d7fa6f6c95f80e36/blob @@ -0,0 +1,570 @@ +from collections import defaultdict + +import numpy as np + +import statsmodels.base.model as base +import statsmodels.base.wrapper as wrap +from statsmodels.formula.formulatools import advance_eval_env +from statsmodels.genmod import families +from statsmodels.genmod.families import links, varfuncs +from statsmodels.genmod.generalized_linear_model import GLM +import statsmodels.regression.linear_model as lm +from statsmodels.tools._decorators import cache_readonly + + +class QIFCovariance: + """ + A covariance model for quadratic inference function regression. + + The mat method returns a basis matrix B such that the inverse + of the working covariance lies in the linear span of the + basis matrices. + + Subclasses should set the number of basis matrices `num_terms`, + so that `mat(d, j)` for j=0, ..., num_terms-1 gives the basis + of dimension d. + """ + + def mat(self, dim, term): + """ + Returns the term'th basis matrix, which is a dim x dim + matrix. + + Parameters + ---------- + dim : int + The dimension of the basis matrix. + term : int + The index of the basis matrix to return, ranging from 0 + to `num_terms` - 1. + + Returns + ------- + ndarray or None + The dim x dim basis matrix for `term`, or None if `term` + is greater than or equal to `num_terms`. + """ + raise NotImplementedError + + +class QIFIndependence(QIFCovariance): + """ + Independent working covariance for QIF regression. This covariance + model gives identical results to GEE with the independence working + covariance. When using QIFIndependence as the working covariance, + the QIF value will be zero, and cannot be used for chi^2 testing, or + for model selection using AIC, BIC, etc. + """ + + def __init__(self): + self.num_terms = 1 + + def mat(self, dim, term): + if term == 0: + return np.eye(dim) + else: + return None + + +class QIFExchangeable(QIFCovariance): + """ + Exchangeable working covariance for QIF regression. + """ + + def __init__(self): + self.num_terms = 2 + + def mat(self, dim, term): + if term == 0: + return np.eye(dim) + elif term == 1: + return np.ones((dim, dim)) + else: + return None + + +class QIFAutoregressive(QIFCovariance): + """ + Autoregressive working covariance for QIF regression. + """ + + def __init__(self): + self.num_terms = 3 + + def mat(self, dim, term): + + if dim < 3: + msg = ("Groups must have size at least 3 for " + "autoregressive covariance.") + raise ValueError(msg) + + if term == 0: + return np.eye(dim) + elif term == 1: + mat = np.zeros((dim, dim)) + mat.flat[1::(dim+1)] = 1 + mat += mat.T + return mat + elif term == 2: + mat = np.zeros((dim, dim)) + mat[0, 0] = 1 + mat[dim-1, dim-1] = 1 + return mat + else: + return None + + +class QIF(base.Model): + """ + Fit a regression model using quadratic inference functions (QIF). + + QIF is an alternative to GEE that can be more efficient, and that + offers different approaches for model selection and inference. + + Parameters + ---------- + endog : array_like + The dependent variables of the regression. + exog : array_like + The independent variables of the regression. + groups : array_like + Labels indicating which group each observation belongs to. + Observations in different groups should be independent. + family : genmod family, optional + An instance of a GLM family. The default is Gaussian. + cov_struct : QIFCovariance instance, optional + An instance of a QIFCovariance. The default is + QIFIndependence. + missing : str, optional + Available options are 'none', 'drop', and 'raise'. If 'none', no nan + checking is done. If 'drop', any observations with nans are dropped. + If 'raise', an error is raised. + + References + ---------- + A. Qu, B. Lindsay, B. Li (2000). Improving Generalized Estimating + Equations using Quadratic Inference Functions, Biometrika 87:4. + www.jstor.org/stable/2673612 + """ + + def __init__(self, endog, exog, groups, family=None, + cov_struct=None, missing="none", **kwargs): + + # Handle the family argument + if family is None: + family = families.Gaussian() + elif not issubclass(family.__class__, families.Family): + raise ValueError("QIF: `family` must be a genmod " + "family instance") + self.family = family + + self._fit_history = defaultdict(list) + + # Handle the cov_struct argument + if cov_struct is None: + cov_struct = QIFIndependence() + elif not isinstance(cov_struct, QIFCovariance): + raise ValueError( + "QIF: `cov_struct` must be a QIFCovariance instance") + self.cov_struct = cov_struct + + groups = np.asarray(groups) + + super().__init__(endog, exog, groups=groups, + missing=missing, **kwargs) + + self.group_names = list(set(groups)) + self.nobs = len(self.endog) + + groups_ix = defaultdict(list) + for i, g in enumerate(groups): + groups_ix[g].append(i) + self.groups_ix = [groups_ix[na] for na in self.group_names] + + self._check_args(groups) + + def _check_args(self, groups): + + if len(groups) != len(self.endog): + msg = "QIF: groups and endog should have the same length" + raise ValueError(msg) + + if len(self.endog) != self.exog.shape[0]: + msg = ("QIF: the length of endog should be equal to the " + "number of rows of exog.") + raise ValueError(msg) + + def objective(self, params): + """ + Calculate the QIF objective function and its gradient. + + Parameters + ---------- + params : array_like + The model parameters at which the objective function and + its gradient are evaluated. + + Returns + ------- + qif : float + The value of the QIF objective function. + grad : ndarray + The gradient vector of the QIF objective function. + cmat : ndarray + The estimated covariance matrix of the estimating + equations. + gn : ndarray + The moment vector, i.e., the average of the estimating + equations over the groups. + gn_deriv : ndarray + The gradients of each estimating equation with + respect to the parameter. + """ + + endog = self.endog + exog = self.exog + lpr = np.dot(exog, params) + mean = self.family.link.inverse(lpr) + va = self.family.variance(mean) + + # Mean derivative + idl = self.family.link.inverse_deriv(lpr) + idl2 = self.family.link.inverse_deriv2(lpr) + vd = self.family.variance.deriv(mean) + + m = self.cov_struct.num_terms + p = exog.shape[1] + + d = p * m + gn = np.zeros(d) + gi = np.zeros(d) + gi_deriv = np.zeros((d, p)) + gn_deriv = np.zeros((d, p)) + cn_deriv = [0] * p + cmat = np.zeros((d, d)) + + fastvar = self.family.variance is varfuncs.constant + fastlink = isinstance( + self.family.link, + # TODO: Remove links.identity after deprecation final + (links.Identity, links.identity) + ) + + for ix in self.groups_ix: + sd = np.sqrt(va[ix]) + resid = endog[ix] - mean[ix] + sresid = resid / sd + deriv = exog[ix, :] * idl[ix, None] + + jj = 0 + for j in range(m): + # The derivative of each term in (5) of Qu et al. + # There are four terms involving beta in a product. + # Iterated application of the product rule gives + # the gradient as a sum of four terms. + c = self.cov_struct.mat(len(ix), j) + crs1 = np.dot(c, sresid) / sd + gi[jj:jj+p] = np.dot(deriv.T, crs1) + crs2 = np.dot(c, -deriv / sd[:, None]) / sd[:, None] + gi_deriv[jj:jj+p, :] = np.dot(deriv.T, crs2) + if not (fastlink and fastvar): + for k in range(p): + m1 = np.dot(exog[ix, :].T, + idl2[ix] * exog[ix, k] * crs1) + if not fastvar: + vx = -0.5 * vd[ix] * deriv[:, k] / va[ix]**1.5 + m2 = np.dot(deriv.T, vx * np.dot(c, sresid)) + m3 = np.dot(deriv.T, np.dot(c, vx * resid) / sd) + else: + m2, m3 = 0, 0 + gi_deriv[jj:jj+p, k] += m1 + m2 + m3 + jj += p + + for j in range(p): + u = np.outer(gi, gi_deriv[:, j]) + cn_deriv[j] += u + u.T + + gn += gi + gn_deriv += gi_deriv + + cmat += np.outer(gi, gi) + + ngrp = len(self.groups_ix) + gn /= ngrp + gn_deriv /= ngrp + cmat /= ngrp**2 + + qif = np.dot(gn, np.linalg.solve(cmat, gn)) + + gcg = np.zeros(p) + for j in range(p): + cn_deriv[j] /= len(self.groups_ix)**2 + u = np.linalg.solve(cmat, cn_deriv[j]).T + u = np.linalg.solve(cmat, u) + gcg[j] = np.dot(gn, np.dot(u, gn)) + + grad = 2 * np.dot(gn_deriv.T, np.linalg.solve(cmat, gn)) - gcg + + return qif, grad, cmat, gn, gn_deriv + + def estimate_scale(self, params): + """ + Estimate the dispersion/scale. + + The scale parameter for binomial and Poisson families is + fixed at 1, otherwise it is estimated from the data. + + Parameters + ---------- + params : array_like + The regression coefficients at which the scale is + estimated. + + Returns + ------- + float + The estimated scale parameter. + """ + + if isinstance(self.family, (families.Binomial, families.Poisson)): + return 1. + + if hasattr(self, "ddof_scale"): + ddof_scale = self.ddof_scale + else: + ddof_scale = self.exog[1] + + lpr = np.dot(self.exog, params) + mean = self.family.link.inverse(lpr) + resid = self.endog - mean + scale = np.sum(resid**2) / (self.nobs - ddof_scale) + + return scale + + @classmethod + def from_formula(cls, formula, groups, data, subset=None, + *args, **kwargs): + """ + Create a QIF model instance from a formula and dataframe. + + Parameters + ---------- + formula : str or generic Formula object + The formula specifying the model + groups : array_like or str + Array of grouping labels. If a string, this is the name + of a variable in `data` that contains the grouping labels. + data : array_like + The data for the model. + subset : array_like, optional + An array_like object of booleans, integers, or index + values that indicate the subset of the data to use when + fitting the model. + + Returns + ------- + model : QIF model instance + """ + + if isinstance(groups, str): + groups = data[groups] + advance_eval_env(kwargs) + model = super().from_formula( + formula, data, *args, subset=subset, groups=groups, **kwargs + ) + + return model + + def fit(self, maxiter=100, start_params=None, tol=1e-6, gtol=1e-4, + ddof_scale=None): + """ + Fit a GLM to correlated data using QIF. + + Parameters + ---------- + maxiter : int, optional + Maximum number of iterations. + start_params : array_like, optional + Starting values + tol : float, optional + Convergence threshold for difference of successive + estimates. + gtol : float, optional + Convergence threshold for gradient. + ddof_scale : int, optional + Degrees of freedom for the scale parameter + + Returns + ------- + QIFResults object + """ + + if ddof_scale is None: + self.ddof_scale = self.exog.shape[1] + else: + self.ddof_scale = ddof_scale + + if start_params is None: + model = GLM(self.endog, self.exog, family=self.family) + result = model.fit() + params = result.params + else: + params = start_params + + for _ in range(maxiter): + + qif, grad, cmat, _, gn_deriv = self.objective(params) + + gnorm = np.sqrt(np.sum(grad * grad)) + self._fit_history["qif"].append(qif) + self._fit_history["gradnorm"].append(gnorm) + + if gnorm < gtol: + break + + cjac = 2 * np.dot(gn_deriv.T, np.linalg.solve(cmat, gn_deriv)) + step = np.linalg.solve(cjac, grad) + + snorm = np.sqrt(np.sum(step * step)) + self._fit_history["stepnorm"].append(snorm) + if snorm < tol: + break + params -= step + + vcov = np.dot(gn_deriv.T, np.linalg.solve(cmat, gn_deriv)) + vcov = np.linalg.inv(vcov) + scale = self.estimate_scale(params) + + rslt = QIFResults(self, params, vcov / scale, scale) + rslt.fit_history = self._fit_history + self._fit_history = defaultdict(list) + + return QIFResultsWrapper(rslt) + + +class QIFResults(base.LikelihoodModelResults): + """ + Results class for QIF Regression + + Attributes + ---------- + qif : float + The value of the QIF objective function at the estimated + parameters. + """ + def __init__(self, model, params, cov_params, scale, + use_t=False, **kwds): + + super().__init__( + model, params, normalized_cov_params=cov_params, + scale=scale) + + self.qif, _, _, _, _ = self.model.objective(params) + + @cache_readonly + def aic(self): + """ + An AIC-like statistic for models fit using QIF. + """ + if isinstance(self.model.cov_struct, QIFIndependence): + msg = "AIC not available with QIFIndependence covariance" + raise ValueError(msg) + df = self.model.exog.shape[1] + return self.qif + 2*df + + @cache_readonly + def bic(self): + """ + A BIC-like statistic for models fit using QIF. + """ + if isinstance(self.model.cov_struct, QIFIndependence): + msg = "BIC not available with QIFIndependence covariance" + raise ValueError(msg) + df = self.model.exog.shape[1] + return self.qif + np.log(self.model.nobs)*df + + @cache_readonly + def fittedvalues(self): + """ + Returns the fitted values from the model. + """ + return self.model.family.link.inverse( + np.dot(self.model.exog, self.params)) + + def summary(self, yname=None, xname=None, title=None, alpha=.05): + """ + Summarize the QIF regression results + + Parameters + ---------- + yname : str, optional + Default is `y` + xname : list of str, optional + Names for the exogenous variables, default is `var_#` where `#` + is the 0-based index of the regressor. Must match the number of + parameters in the model + title : str, optional + Title for the top table. If not None, then this replaces + the default title + alpha : float, optional + significance level for the confidence intervals + + Returns + ------- + smry : Summary instance + this holds the summary tables and text, which can be + printed or converted to various output formats. + + See Also + -------- + statsmodels.iolib.summary.Summary : class to hold summary results + """ + + top_left = [("Dep. Variable:", None), + ("Method:", ["QIF"]), + ("Family:", [self.model.family.__class__.__name__]), + ("Covariance structure:", + [self.model.cov_struct.__class__.__name__]), + ("Date:", None), + ("Time:", None), + ] + + NY = [len(y) for y in self.model.groups_ix] + + top_right = [("No. Observations:", [sum(NY)]), + ("No. clusters:", [len(NY)]), + ("Min. cluster size:", [min(NY)]), + ("Max. cluster size:", [max(NY)]), + ("Mean cluster size:", [f"{np.mean(NY):.1f}"]), + ("Scale:", [f"{self.scale:.3f}"]), + ] + + if title is None: + title = self.model.__class__.__name__ + " " +\ + "Regression Results" + + # Override the exog variable names if xname is provided as an + # argument. + if xname is None: + xname = self.model.exog_names + + if yname is None: + yname = self.model.endog_names + + # Create summary table instance + from statsmodels.iolib.summary import Summary + smry = Summary() + smry.add_table_2cols(self, gleft=top_left, gright=top_right, + yname=yname, xname=xname, + title=title) + smry.add_table_params(self, yname=yname, xname=xname, + alpha=alpha, use_t=False) + + return smry + + +class QIFResultsWrapper(lm.RegressionResultsWrapper): + pass + + +wrap.populate_wrapper(QIFResultsWrapper, QIFResults) diff --git a/shared/package-files/9b/9b45a809e914c434a5fedb1bcfe7f9bd9ee4471fd5d828bcafa59cd50b502507/blob b/shared/package-files/9b/9b45a809e914c434a5fedb1bcfe7f9bd9ee4471fd5d828bcafa59cd50b502507/blob new file mode 100644 index 0000000000000000000000000000000000000000..de70cea3a1d50a515143feb2ec04393addc3df98 --- /dev/null +++ b/shared/package-files/9b/9b45a809e914c434a5fedb1bcfe7f9bd9ee4471fd5d828bcafa59cd50b502507/blob @@ -0,0 +1,884 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace torch::jit { +constexpr inline c10::AliasAnalysisKind aliasAnalysisFromSchema() { + return c10::AliasAnalysisKind::FROM_SCHEMA; +} + +constexpr inline c10::AliasAnalysisKind aliasAnalysisConservative() { + return c10::AliasAnalysisKind::CONSERVATIVE; +} + +constexpr inline c10::AliasAnalysisKind aliasAnalysisSpecialCase() { + return c10::AliasAnalysisKind::INTERNAL_SPECIAL_CASE; +} + +template +c10::List make_result_list(const TypePtr& elemType) { + return c10::List(); +} + +template <> +c10::impl::GenericList make_result_list(const TypePtr& elemType); + +// As described in https://docs.python.org/3/library/functions.html#round +// When a number is exactly halfway between two integers, python builtin round +// function will round to even number. We use round(x/2)*2 to handle the +// special halfway case. For positive 'x', round(x/2)*2 = +// round((x_e + x_r)/2)*2 = x_e + round(x_r/2)*2, where x_e is an even integer, +// x_r is either 0.5 of 1.5, round(x_r/2)*2 results a 0 or 2, so the final +// result will always be a even number. Due to symmetricity, it also applies to +// negative cases. +inline double round_to_even(double a) { + return a - std::floor(a) == 0.5 ? (std::round(a * 0.5) * 2.0) : std::round(a); +} + +// using the rules from python_arg_parser FunctionParameter::check +// tensor cannot have grad set, tensor must be 0 dim, +// and if the dest is an int the source must be integral type +void checkImplicitTensorToNum(const at::Tensor& t, bool toInt); + +static C10_UNUSED int64_t floordiv(int64_t a, int64_t b) { + if (b == 0) { + throw std::runtime_error("division by 0"); + } + if ((a > 0) == (b > 0)) { + // simple case, both have same sign + return a / b; + } else { + // in python division rounds down, it doesn't not truncate like in c++ + auto r = lldiv(a, b); + return (r.rem) ? r.quot - 1 : r.quot; + } +} +TORCH_API void checkDoubleInRange(double a); +static C10_UNUSED int64_t floor(double a) { + checkDoubleInRange(a); + return std::floor(a); +} +static C10_UNUSED int64_t ceil(double a) { + checkDoubleInRange(a); + return std::ceil(a); +} + +static C10_UNUSED int64_t gcd(int64_t a, int64_t b) { + while (b != 0) { + int64_t r = a % b; + a = b; + b = r; + } + // in python gcd returns non-negative values + return std::abs(a); +} + +int64_t partProduct(int n, int m); + +void loop(int n, int64_t& p, int64_t& r); + +int nminussumofbits(int v); + +int64_t factorial(int n); +static const double degToRad = std::acos(-1.0) / 180.0; +static const double radToDeg = 180.0 / std::acos(-1.0); +double degrees(double x); +double radians(double x); + +// Convert an python index (which may be negative) into an index usable for a +// C++ container + +// Equivalent to list.at(idx) +template +decltype(auto) getItem(const c10::List& list, int64_t idx) { + const int64_t list_size = list.size(); + const int64_t normalized_idx = normalizeIndex(idx, list_size); + if (normalized_idx < 0 || normalized_idx >= list_size) { + throw std::out_of_range("list index out of range"); + } + return list.get(normalized_idx); +} + +template +void setItem(const c10::List& list, int64_t idx, T&& value) { + const int64_t list_size = list.size(); + const int64_t normalized_idx = normalizeIndex(idx, list_size); + if (normalized_idx < 0 || normalized_idx >= list_size) { + throw std::out_of_range("list index out of range"); + } + list.set(normalized_idx, std::forward(value)); +} + +void listAppend(Stack& stack); + +void listReverse(Stack& stack); + +template +void minList(Stack& stack) { + c10::List a = pop(stack).to>(); + c10::List b = pop(stack).to>(); + + size_t min_size = std::min(a.size(), b.size()); + for (const auto i : c10::irange(min_size)) { + if (a[i] == b[i]) { + continue; + } + + push(stack, a[i] < b[i] ? a : b); + return; + } + + push(stack, b.size() < a.size() ? b : a); +} + +template +void maxList(Stack& stack) { + c10::List a = pop(stack).to>(); + c10::List b = pop(stack).to>(); + + size_t min_size = std::min(a.size(), b.size()); + for (const auto i : c10::irange(min_size)) { + if (a[i] == b[i]) { + continue; + } + + push(stack, a[i] > b[i] ? a : b); + return; + } + + push(stack, b.size() > a.size() ? b : a); +} + +void listPopImpl(Stack& stack, const char* empty_message); + +void listPop(Stack& stack); + +void listClear(Stack& stack); + +void listDelete(Stack& stack); + +void listInsert(Stack& stack); + +template +void listRemove(Stack& stack) { + T elem = pop(stack).to(); + c10::List list = pop(stack).to>(); + + auto pos = std::find(list.begin(), list.end(), elem); + + if (pos != list.end()) { + list.erase(pos); + } else { + AT_ERROR("list.remove(x): x not in list"); + } +} + +template +void listMin(Stack& stack) { + c10::List list = pop(stack).to>(); + size_t list_size = list.size(); + if (list_size == 0) { + throw std::runtime_error("min() arg is an empty sequence"); + } + + T min_elem = list[0]; + for (const auto i : c10::irange(1, list_size)) { + T elem = list[i]; + min_elem = elem < min_elem ? elem : min_elem; + } + + stack.push_back(min_elem); +} + +template +void listMax(Stack& stack) { + c10::List list = pop(stack).to>(); + size_t list_size = list.size(); + if (list_size == 0) { + throw std::runtime_error("max() arg is an empty sequence"); + } + + T max_elem = list[0]; + for (const auto i : c10::irange(1, list_size)) { + T elem = list[i]; + max_elem = elem > max_elem ? elem : max_elem; + } + + stack.push_back(max_elem); +} + +template <> +void listRemove(Stack& stack); + +template +void listIndex(Stack& stack) { + T elem = pop(stack).to(); + c10::List list = pop(stack).to>(); + + auto pos = std::find(list.begin(), list.end(), elem); + + if (pos != list.end()) { + push(stack, static_cast(std::distance(list.begin(), pos))); + } else { + AT_ERROR("'", elem, "' is not in list"); + } +} + +template <> +void listIndex(Stack& stack); + +template +void listCount(Stack& stack) { + T elem = pop(stack).to(); + c10::List list = pop(stack).to>(); + + const int64_t count = std::count(list.begin(), list.end(), elem); + push(stack, count); +} + +template <> +void listCount(Stack& stack); + +void listExtend(Stack& stack); + +void listCopy(Stack& stack); + +void listSelect(Stack& stack); + +void listLen(Stack& stack); + +template +void listEq(Stack& stack) { + c10::List b = pop(stack).to>(); + c10::List a = pop(stack).to>(); + push(stack, a == b); +} + +template +void listNe(Stack& stack) { + c10::List b = pop(stack).to>(); + c10::List a = pop(stack).to>(); + push(stack, a != b); +} + +inline bool tensor_list_equal( + const c10::List& a, + const c10::List& b) { + if (a.size() != b.size()) { + return false; + } + + for (const auto i : c10::irange(a.size())) { + const at::Tensor& a_element = a[i]; + const at::Tensor& b_element = b[i]; + // This preserves Python's semantics, which uses eq() to compare two + // elements, then passes the result to bool(). + // see: https://docs.python.org/3.4/reference/datamodel.html#object.__ge__ + const auto cmp_result = a_element.eq(b_element); + if (!at::native::is_nonzero(cmp_result)) { + return false; + } + } + + return true; +} + +// Specialization for at::Tensor, since it doesn't define operator== +template <> +void listEq(Stack& stack); + +// Specialization for at::Tensor, since it doesn't define operator== +template <> +void listNe(Stack& stack); + +void listList(Stack& stack); + +template +void listContains(Stack& stack) { + auto key = pop(stack).to(); + auto list = pop(stack).to>(); + // NOLINTNEXTLINE(performance-implicit-conversion-in-loop) + for (const T& item : list) { + if (item == key) { + push(stack, true); + return; + } + } + push(stack, false); +} + +void listAdd(Stack& stack); + +void listInplaceAdd(Stack& stack); + +void listMulIntLeftInPlace(Stack& stack); + +void listMulIntLeft(Stack& stack); + +void listMulIntRight(Stack& stack); + +void listSlice(Stack& stack); + +template +void listSort(Stack& stack) { + bool reverse = pop(stack).toBool(); + c10::List list = pop(stack).to>(); + std::sort(list.begin(), list.end(), [reverse](const T& a, const T& b) { + // FBCode errors without this check - "strict weak ordering" + // TODO: remove when possible, since it just slows down + // sorting and doesn't do anything useful + if (a == b) { + return false; + } + return (a < b) != reverse; + }); +} + +// Specialization for at::Tensor +template <> +void listSort(Stack& stack); + +template +void listCopyAndSort(Stack& stack) { + c10::List list = pop(stack).to>(); + auto list_copied = list.copy(); + std::sort(list_copied.begin(), list_copied.end(), [](const T& a, const T& b) { + // "strict weak ordering" issue - see other sort + if (a == b) { + return false; + } + return a < b; + }); + push(stack, list_copied); +} + +// Specialization for at::Tensor +template <> +void listCopyAndSort(Stack& stack); + +void listSetItem(Stack& stack); + +struct OperatorGeneratorArgs { + const char* schema_str; + bool isOperationCreator; + union { + void (*operation)(Stack&); + OperationCreator operationCreator; + }; + AliasAnalysisKind aliasAnalysis; + + explicit constexpr OperatorGeneratorArgs( + torch::detail::SelectiveStr schema_str, + void (*op)(Stack&), + AliasAnalysisKind aa) + : schema_str(schema_str), + isOperationCreator(false), + operation(op), + aliasAnalysis(aa) {} + + explicit constexpr OperatorGeneratorArgs( + torch::detail::SelectiveStr schema_str, + OperationCreator opCreator, + AliasAnalysisKind aa) + : schema_str(schema_str), + isOperationCreator(true), + operationCreator(opCreator), + aliasAnalysis(aa) {} + + template + explicit constexpr OperatorGeneratorArgs( + torch::detail::SelectiveStr, + Args...) + : schema_str(nullptr), + isOperationCreator(false), + operation(nullptr), + aliasAnalysis(AliasAnalysisKind::INTERNAL_SPECIAL_CASE) {} +}; + +#define DEFINE_GENERIC_BINARY_OP( \ + aten_op, op, int_float_result, complex_result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op \ + ".int_int(int a, int b) -> " #int_float_result), \ + [](Stack& stack) { \ + int64_t a, b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA( \ + #aten_op \ + ".float_float(float a, float b) -> " #int_float_result), \ + [](Stack& stack) { \ + double a, b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA( \ + #aten_op \ + ".complex_complex(complex a, complex b) -> " #complex_result), \ + [](Stack& stack) { \ + c10::complex a, b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()) + +// define implementations for primitive number ops +#define DEFINE_GENERIC_OP(aten_op, int_op, float_op, int_result, float_result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".int(int a, int b) -> " #int_result), \ + [](Stack& stack) { \ + int64_t a, b; \ + pop(stack, a, b); \ + push(stack, int_op); \ + }, \ + aliasAnalysisFromSchema()), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA( \ + #aten_op ".float(float a, float b) -> " #float_result), \ + [](Stack& stack) { \ + double a, b; \ + pop(stack, a, b); \ + push(stack, float_op); \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_INT_FLOAT_OP(aten_op, op, result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op \ + ".int_float(int a, float b) -> " #result), \ + [](Stack& stack) { \ + int64_t a; \ + double b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op \ + ".float_int(float a, int b) -> " #result), \ + [](Stack& stack) { \ + double a; \ + int64_t b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_INT_OP(aten_op, op) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".int(int a, int b) -> int"), \ + [](Stack& stack) { \ + int64_t a, b; \ + pop(stack, a, b); \ + push(stack, op); /* NOLINT(hicpp-signed-bitwise) */ \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_STR_CMP_OP(aten_op, op) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".str(str a, str b) -> bool"), \ + [](Stack& stack) { \ + auto b = pop(stack).toStringRef(); \ + auto a = pop(stack).toStringRef(); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()) + +// define a primitive op over Scalar operands. +// it's necessary to register this overload following +// int/float variations to avoid trapping Scalar args +// in unintended implicit conversions +#define DEFINE_SCALAR_BINARY_OP_AVOID_COLLISION_GENERIC( \ + aten_op, int_op, float_op, result, string_val) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op string_val \ + "(Scalar a, Scalar b) -> " #result), \ + [](Stack& stack) { \ + IValue x, y; \ + pop(stack, x, y); \ + if (x.isDouble()) { \ + if (y.isDouble()) { \ + double a = x.toDouble(); \ + double b = y.toDouble(); \ + push(stack, float_op); \ + } else { \ + double a = x.toDouble(); \ + int64_t b = y.toInt(); \ + push(stack, float_op); \ + } \ + } else { \ + if (y.isDouble()) { \ + int64_t a = x.toInt(); \ + double b = y.toDouble(); \ + push(stack, float_op); \ + } else { \ + int64_t a = x.toInt(); \ + int64_t b = y.toInt(); \ + push(stack, int_op); \ + } \ + } \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_SCALAR_BINARY_OP(aten_op, int_op, float_op, result) \ + DEFINE_SCALAR_BINARY_OP_AVOID_COLLISION_GENERIC( \ + aten_op, int_op, float_op, result, "") + +#define DEFINE_SCALAR_BINARY_OP_AVOID_COLLISION( \ + aten_op, int_op, float_op, result) \ + DEFINE_SCALAR_BINARY_OP_AVOID_COLLISION_GENERIC( \ + aten_op, int_op, float_op, result, ".Scalar_Scalar") + +#define DEFINE_BINARY_OP(aten_op, op) \ + DEFINE_GENERIC_OP(aten_op, op, op, int, float), \ + DEFINE_INT_FLOAT_OP(aten_op, op, float), \ + DEFINE_SCALAR_BINARY_OP(aten_op, op, op, Scalar) + +#define DEFINE_BINARY_FLOAT_OP(aten_op, op) \ + DEFINE_GENERIC_OP(aten_op, op, op, float, float), \ + DEFINE_INT_FLOAT_OP(aten_op, op, float), \ + DEFINE_SCALAR_BINARY_OP(aten_op, op, op, float) + +#define DEFINE_COMPARISON_OP(aten_op, op) \ + DEFINE_GENERIC_OP(aten_op, op, op, bool, bool), \ + DEFINE_INT_FLOAT_OP(aten_op, op, bool), \ + DEFINE_SCALAR_BINARY_OP(aten_op, op, op, bool), \ + DEFINE_STR_CMP_OP(aten_op, op) + +#define DEFINE_UNARY_INT_OP(aten_op, op, result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".int(int a) -> " #result), \ + [](Stack& stack) { \ + int64_t a; \ + pop(stack, a); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_UNARY_FLOAT_OP(aten_op, op, result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".float(float a) -> " #result), \ + [](Stack& stack) { \ + double a; \ + pop(stack, a); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_UNARY_OP(aten_op, op, int_result, float_result) \ + DEFINE_UNARY_INT_OP(aten_op, op, int_result), \ + DEFINE_UNARY_FLOAT_OP(aten_op, op, float_result), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".Scalar(Scalar a) -> Scalar"), \ + [](Stack& stack) { \ + IValue x; \ + pop(stack, x); \ + if (x.isDouble()) { \ + double a = x.toDouble(); \ + push(stack, static_cast(op)); \ + } else { \ + int64_t a = x.toInt(); \ + push(stack, static_cast(op)); \ + } \ + }, \ + aliasAnalysisFromSchema()) +#define DEFINE_BOOL_OP(aten_op, op) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".bool(bool a, bool b) -> bool"), \ + [](Stack& stack) { \ + bool a, b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()) +#define DEFINE_STRING_OP(op_name, string_op, result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#op_name ".str(str a, str b) ->" #result), \ + [](Stack& stack) { \ + auto b = pop(stack).toStringRef(); \ + auto a = pop(stack).toStringRef(); \ + push(stack, string_op); \ + }, \ + aliasAnalysisFromSchema()) + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +#define DEFINE_UNARY_COMPLEX_OP(aten_op, op, result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".complex(complex a) -> " #result), \ + [](Stack& stack) { \ + c10::complex a; \ + pop(stack, a); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()) + +// Some complex unary ops (like abs, angle) return real valued output, but most +// other unary ops return complex valued output. So, this macro is used in the +// former case where we can explicitly pass complex_result_cast argument, which +// is set to c10::complex in the macro `DEFINE_UNARY_OP_WITH_COMPLEX` +// defined below. +#define DEFINE_UNARY_OP_WITH_COMPLEX_CAST( \ + aten_op, \ + op, \ + int_result, \ + float_result, \ + complex_result, \ + complex_result_cast) \ + DEFINE_UNARY_INT_OP(aten_op, op, int_result), \ + DEFINE_UNARY_FLOAT_OP(aten_op, op, float_result), \ + DEFINE_UNARY_COMPLEX_OP(aten_op, op, complex_result), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".Scalar(Scalar a) -> Scalar"), \ + [](Stack& stack) { \ + IValue x; \ + pop(stack, x); \ + if (x.isDouble()) { \ + double a = x.toDouble(); \ + push(stack, static_cast(op)); \ + } else if (x.isComplexDouble()) { \ + c10::complex a = x.toComplexDouble(); \ + push(stack, static_cast(op)); \ + } else { \ + int64_t a = x.toInt(); \ + push(stack, static_cast(op)); \ + } \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_UNARY_OP_WITH_COMPLEX(aten_op, op, int_result, float_result) \ + DEFINE_UNARY_OP_WITH_COMPLEX_CAST( \ + aten_op, op, int_result, float_result, complex, c10::complex) + +#define DEFINE_GENERIC_OP_WITH_COMPLEX( \ + aten_op, \ + int_op, \ + float_op, \ + complex_op, \ + int_result, \ + float_result, \ + complex_result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op ".int(int a, int b) -> " #int_result), \ + [](Stack& stack) { \ + int64_t a, b; \ + pop(stack, a, b); \ + push(stack, int_op); \ + }, \ + aliasAnalysisFromSchema()), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA( \ + #aten_op ".complex(complex a, complex b) -> " #complex_result), \ + [](Stack& stack) { \ + c10::complex a, b; \ + pop(stack, a, b); \ + push(stack, complex_op); \ + }, \ + aliasAnalysisFromSchema()), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA( \ + #aten_op ".float(float a, float b) -> " #float_result), \ + [](Stack& stack) { \ + double a, b; \ + pop(stack, a, b); \ + push(stack, float_op); \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_INT_COMPLEX_OP(aten_op, op, result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op \ + ".int_complex(int a, complex b) -> " #result), \ + [](Stack& stack) { \ + int64_t a; \ + c10::complex b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA( \ + #aten_op ".complex_int(complex a, int b) -> " #result), \ + [](Stack& stack) { \ + c10::complex a; \ + int64_t b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_FLOAT_COMPLEX_OP(aten_op, op, result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA( \ + #aten_op ".float_complex(float a, complex b) -> " #result), \ + [](Stack& stack) { \ + double a; \ + c10::complex b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()), \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA( \ + #aten_op ".complex_float(complex a, float b) -> " #result), \ + [](Stack& stack) { \ + c10::complex a; \ + double b; \ + pop(stack, a, b); \ + push(stack, op); \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_SCALAR_BINARY_OP_WITH_COMPLEX_AVOID_COLLISION_GENERIC( \ + aten_op, int_op, float_op, complex_op, result, string_val) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op string_val \ + "(Scalar a, Scalar b) -> " #result), \ + [](Stack& stack) { \ + IValue x, y; \ + pop(stack, x, y); \ + if (x.isComplexDouble()) { \ + c10::complex a = x.toComplexDouble(); \ + if (y.isComplexDouble()) { \ + c10::complex b = y.toComplexDouble(); \ + push(stack, complex_op); \ + } else if (y.isDouble()) { \ + double b = y.toDouble(); \ + push(stack, complex_op); \ + } else { \ + int64_t b = y.toInt(); \ + push(stack, complex_op); \ + } \ + } else if (x.isDouble()) { \ + double a = x.toDouble(); \ + if (y.isComplexDouble()) { \ + c10::complex b = y.toComplexDouble(); \ + push(stack, complex_op); \ + } else if (y.isDouble()) { \ + double b = y.toDouble(); \ + push(stack, float_op); \ + } else { \ + int64_t b = y.toInt(); \ + push(stack, float_op); \ + } \ + } else { \ + int64_t a = x.toInt(); \ + if (y.isComplexDouble()) { \ + c10::complex b = y.toComplexDouble(); \ + push(stack, complex_op); \ + } else if (y.isDouble()) { \ + double b = y.toDouble(); \ + push(stack, float_op); \ + } else { \ + int64_t b = y.toInt(); \ + push(stack, int_op); \ + } \ + } \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_SCALAR_BINARY_OP_WITH_COMPLEX_WITHOUT_INT_COMPLEX_PAIR( \ + aten_op, int_op, float_op, complex_op, result) \ + OperatorGeneratorArgs( \ + TORCH_SELECTIVE_SCHEMA(#aten_op "(Scalar a, Scalar b) -> " #result), \ + [](Stack& stack) { \ + IValue x, y; \ + pop(stack, x, y); \ + if (x.isComplexDouble()) { \ + c10::complex a = x.toComplexDouble(); \ + if (y.isComplexDouble()) { \ + c10::complex b = y.toComplexDouble(); \ + push(stack, complex_op); \ + } else if (y.isDouble()) { \ + double b = y.toDouble(); \ + push(stack, complex_op); \ + } \ + } else if (x.isDouble()) { \ + double a = x.toDouble(); \ + if (y.isComplexDouble()) { \ + c10::complex b = y.toComplexDouble(); \ + push(stack, complex_op); \ + } else if (y.isDouble()) { \ + double b = y.toDouble(); \ + push(stack, float_op); \ + } else { \ + int64_t b = y.toInt(); \ + push(stack, float_op); \ + } \ + } else { \ + int64_t a = x.toInt(); \ + if (y.isDouble()) { \ + double b = y.toDouble(); \ + push(stack, float_op); \ + } else if (y.isInt()) { \ + int64_t b = y.toInt(); \ + push(stack, int_op); \ + } \ + } \ + }, \ + aliasAnalysisFromSchema()) + +#define DEFINE_SCALAR_BINARY_OP_WITH_COMPLEX( \ + aten_op, int_op, float_op, complex_op, result) \ + DEFINE_SCALAR_BINARY_OP_WITH_COMPLEX_AVOID_COLLISION_GENERIC( \ + aten_op, int_op, float_op, complex_op, result, "") + +#define DEFINE_BINARY_OP_WITH_COMPLEX(aten_op, op) \ + DEFINE_GENERIC_OP_WITH_COMPLEX(aten_op, op, op, op, int, float, complex), \ + DEFINE_INT_COMPLEX_OP(aten_op, op, complex), \ + DEFINE_FLOAT_COMPLEX_OP(aten_op, op, complex), \ + DEFINE_INT_FLOAT_OP(aten_op, op, float), \ + DEFINE_SCALAR_BINARY_OP_WITH_COMPLEX(aten_op, op, op, op, Scalar) + +#define DEFINE_COMPARISON_OP_WITH_COMPLEX(aten_op, op) \ + DEFINE_GENERIC_OP_WITH_COMPLEX(aten_op, op, op, op, bool, bool, bool), \ + DEFINE_INT_FLOAT_OP(aten_op, op, bool), \ + DEFINE_FLOAT_COMPLEX_OP(aten_op, op, bool), \ + DEFINE_SCALAR_BINARY_OP_WITH_COMPLEX_WITHOUT_INT_COMPLEX_PAIR( \ + aten_op, op, op, op, bool), \ + DEFINE_STR_CMP_OP(aten_op, op) + +TORCH_API at::Generator make_generator_for_device( + c10::Device device, + c10::optional seed = c10::nullopt); + +} // namespace torch::jit diff --git a/shared/package-files/9b/9b484599c4f3bd9f2c65b6e759e10dc332b2b9fa44f735b0651f96088e247695/blob b/shared/package-files/9b/9b484599c4f3bd9f2c65b6e759e10dc332b2b9fa44f735b0651f96088e247695/blob new file mode 100644 index 0000000000000000000000000000000000000000..2e63838e09ed9b9436a58a7d8041175e731bc4ef --- /dev/null +++ b/shared/package-files/9b/9b484599c4f3bd9f2c65b6e759e10dc332b2b9fa44f735b0651f96088e247695/blob @@ -0,0 +1,113 @@ +"""Tests for homomorphisms.""" + +from sympy.core.singleton import S +from sympy.polys.domains.rationalfield import QQ +from sympy.abc import x, y +from sympy.polys.agca import homomorphism +from sympy.testing.pytest import raises + + +def test_printing(): + R = QQ.old_poly_ring(x) + + assert str(homomorphism(R.free_module(1), R.free_module(1), [0])) == \ + 'Matrix([[0]]) : QQ[x]**1 -> QQ[x]**1' + assert str(homomorphism(R.free_module(2), R.free_module(2), [0, 0])) == \ + 'Matrix([ \n[0, 0], : QQ[x]**2 -> QQ[x]**2\n[0, 0]]) ' + assert str(homomorphism(R.free_module(1), R.free_module(1) / [[x]], [0])) == \ + 'Matrix([[0]]) : QQ[x]**1 -> QQ[x]**1/<[x]>' + assert str(R.free_module(0).identity_hom()) == 'Matrix(0, 0, []) : QQ[x]**0 -> QQ[x]**0' + +def test_operations(): + F = QQ.old_poly_ring(x).free_module(2) + G = QQ.old_poly_ring(x).free_module(3) + f = F.identity_hom() + g = homomorphism(F, F, [0, [1, x]]) + h = homomorphism(F, F, [[1, 0], 0]) + i = homomorphism(F, G, [[1, 0, 0], [0, 1, 0]]) + + assert f == f + assert f != g + assert f != i + assert (f != F.identity_hom()) is False + assert 2*f == f*2 == homomorphism(F, F, [[2, 0], [0, 2]]) + assert f/2 == homomorphism(F, F, [[S.Half, 0], [0, S.Half]]) + assert f + g == homomorphism(F, F, [[1, 0], [1, x + 1]]) + assert f - g == homomorphism(F, F, [[1, 0], [-1, 1 - x]]) + assert f*g == g == g*f + assert h*g == homomorphism(F, F, [0, [1, 0]]) + assert g*h == homomorphism(F, F, [0, 0]) + assert i*f == i + assert f([1, 2]) == [1, 2] + assert g([1, 2]) == [2, 2*x] + + assert i.restrict_domain(F.submodule([x, x]))([x, x]) == i([x, x]) + h1 = h.quotient_domain(F.submodule([0, 1])) + assert h1([1, 0]) == h([1, 0]) + assert h1.restrict_domain(h1.domain.submodule([x, 0]))([x, 0]) == h([x, 0]) + + raises(TypeError, lambda: f/g) + raises(TypeError, lambda: f + 1) + raises(TypeError, lambda: f + i) + raises(TypeError, lambda: f - 1) + raises(TypeError, lambda: f*i) + + +def test_creation(): + F = QQ.old_poly_ring(x).free_module(3) + G = QQ.old_poly_ring(x).free_module(2) + SM = F.submodule([1, 1, 1]) + Q = F / SM + SQ = Q.submodule([1, 0, 0]) + + matrix = [[1, 0], [0, 1], [-1, -1]] + h = homomorphism(F, G, matrix) + h2 = homomorphism(Q, G, matrix) + assert h.quotient_domain(SM) == h2 + raises(ValueError, lambda: h.quotient_domain(F.submodule([1, 0, 0]))) + assert h2.restrict_domain(SQ) == homomorphism(SQ, G, matrix) + raises(ValueError, lambda: h.restrict_domain(G)) + raises(ValueError, lambda: h.restrict_codomain(G.submodule([1, 0]))) + raises(ValueError, lambda: h.quotient_codomain(F)) + + im = [[1, 0, 0], [0, 1, 0], [0, 0, 1]] + for M in [F, SM, Q, SQ]: + assert M.identity_hom() == homomorphism(M, M, im) + assert SM.inclusion_hom() == homomorphism(SM, F, im) + assert SQ.inclusion_hom() == homomorphism(SQ, Q, im) + assert Q.quotient_hom() == homomorphism(F, Q, im) + assert SQ.quotient_hom() == homomorphism(SQ.base, SQ, im) + + class conv: + def convert(x, y=None): + return x + + class dummy: + container = conv() + + def submodule(*args): + return None + raises(TypeError, lambda: homomorphism(dummy(), G, matrix)) + raises(TypeError, lambda: homomorphism(F, dummy(), matrix)) + raises( + ValueError, lambda: homomorphism(QQ.old_poly_ring(x, y).free_module(3), G, matrix)) + raises(ValueError, lambda: homomorphism(F, G, [0, 0])) + + +def test_properties(): + R = QQ.old_poly_ring(x, y) + F = R.free_module(2) + h = homomorphism(F, F, [[x, 0], [y, 0]]) + assert h.kernel() == F.submodule([-y, x]) + assert h.image() == F.submodule([x, 0], [y, 0]) + assert not h.is_injective() + assert not h.is_surjective() + assert h.restrict_codomain(h.image()).is_surjective() + assert h.restrict_domain(F.submodule([1, 0])).is_injective() + assert h.quotient_domain( + h.kernel()).restrict_codomain(h.image()).is_isomorphism() + + R2 = QQ.old_poly_ring(x, y, order=(("lex", x), ("ilex", y))) / [x**2 + 1] + F = R2.free_module(2) + h = homomorphism(F, F, [[x, 0], [y, y + 1]]) + assert h.is_isomorphism() diff --git a/shared/package-files/9b/9b4b2ab4ef7b3c4bfcfff6eca7136078b7c168c81adab9d952790797eea37249/blob b/shared/package-files/9b/9b4b2ab4ef7b3c4bfcfff6eca7136078b7c168c81adab9d952790797eea37249/blob new file mode 100644 index 0000000000000000000000000000000000000000..69f522af9f825e97b774632a6efb78aecaac9b8d --- /dev/null +++ b/shared/package-files/9b/9b4b2ab4ef7b3c4bfcfff6eca7136078b7c168c81adab9d952790797eea37249/blob @@ -0,0 +1,63 @@ +from typing import Any, Dict, Optional, TypeVar, Union + +from django.db.models.expressions import Combinable, CombinedExpression, Func, Value, _OutputField +from django.db.models.lookups import Lookup + +from django.db.models import Field + +_Expression = Union[str, Combinable, "SearchQueryCombinable"] + +class SearchVectorExact(Lookup): ... +class SearchVectorField(Field): ... +class SearchQueryField(Field): ... + +class SearchVectorCombinable: + ADD: str = ... + +class SearchVector(SearchVectorCombinable, Func): + config: Optional[Any] = ... + def __init__(self, *expressions: _Expression, **extra: Any): ... + +class CombinedSearchVector(SearchVectorCombinable, CombinedExpression): + def __init__( + self, lhs, connector, rhs, config: Optional[_Expression] = ..., output_field: Optional[_OutputField] = ... + ): ... + +_T = TypeVar("_T", bound="SearchQueryCombinable") + +class SearchQueryCombinable: + BITAND: str = ... + BITOR: str = ... + def __or__(self: _T, other: SearchQueryCombinable) -> _T: ... + def __ror__(self: _T, other: SearchQueryCombinable) -> _T: ... + def __and__(self: _T, other: SearchQueryCombinable) -> _T: ... + def __rand__(self: _T, other: SearchQueryCombinable) -> _T: ... + +class SearchQuery(SearchQueryCombinable, Value): # type: ignore + SEARCH_TYPES: Dict[str, str] = ... + def __init__( + self, + value: str, + output_field: Optional[_OutputField] = ..., + *, + config: Optional[_Expression] = ..., + invert: bool = ..., + search_type: str = ... + ): ... + def __invert__(self: _T) -> _T: ... + +class CombinedSearchQuery(SearchQueryCombinable, CombinedExpression): # type: ignore + def __init__( + self, lhs, connector, rhs, config: Optional[_Expression] = ..., output_field: Optional[_OutputField] = ... + ) -> None: ... + +class SearchRank(Func): + def __init__( + self, vector: Union[SearchVector, _Expression], query: Union[SearchQuery, _Expression], **extra: Any + ) -> None: ... + +class TrigramBase(Func): + def __init__(self, expression: _Expression, string, **extra: Any) -> None: ... + +class TrigramSimilarity(TrigramBase): ... +class TrigramDistance(TrigramBase): ... diff --git a/shared/package-files/9b/9b4d6e6e077c5be4e16cbf790138fb75158aea70027ab99005cd0cac43cf42bf/blob b/shared/package-files/9b/9b4d6e6e077c5be4e16cbf790138fb75158aea70027ab99005cd0cac43cf42bf/blob new file mode 100644 index 0000000000000000000000000000000000000000..a48ba4d9a4490df59b8503f0b8768c7a986537a9 --- /dev/null +++ b/shared/package-files/9b/9b4d6e6e077c5be4e16cbf790138fb75158aea70027ab99005cd0cac43cf42bf/blob @@ -0,0 +1,68 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + + +def _check_feature_names(X, feature_names=None): + """Check feature names. + + Parameters + ---------- + X : array-like of shape (n_samples, n_features) + Input data. + + feature_names : None or array-like of shape (n_names,), dtype=str + Feature names to check or `None`. + + Returns + ------- + feature_names : list of str + Feature names validated. If `feature_names` is `None`, then a list of + feature names is provided, i.e. the column names of a pandas dataframe + or a generic list of feature names (e.g. `["x0", "x1", ...]`) for a + NumPy array. + """ + if feature_names is None: + if hasattr(X, "columns") and hasattr(X.columns, "tolist"): + # get the column names for a pandas dataframe + feature_names = X.columns.tolist() + else: + # define a list of numbered indices for a numpy array + feature_names = [f"x{i}" for i in range(X.shape[1])] + elif hasattr(feature_names, "tolist"): + # convert numpy array or pandas index to a list + feature_names = feature_names.tolist() + if len(set(feature_names)) != len(feature_names): + raise ValueError("feature_names should not contain duplicates.") + + return feature_names + + +def _get_feature_index(fx, feature_names=None): + """Get feature index. + + Parameters + ---------- + fx : int or str + Feature index or name. + + feature_names : list of str, default=None + All feature names from which to search the indices. + + Returns + ------- + idx : int + Feature index. + """ + if isinstance(fx, str): + if feature_names is None: + raise ValueError( + f"Cannot plot partial dependence for feature {fx!r} since " + "the list of feature names was not provided, neither as " + "column names of a pandas data-frame nor via the feature_names " + "parameter." + ) + try: + return feature_names.index(fx) + except ValueError as e: + raise ValueError(f"Feature {fx!r} not in feature_names") from e + return fx diff --git a/shared/package-files/9b/9b4fa9e614c6536132eee050ac1ecb48f813bd2d02f05afe480f5dd81017e8c9/blob b/shared/package-files/9b/9b4fa9e614c6536132eee050ac1ecb48f813bd2d02f05afe480f5dd81017e8c9/blob new file mode 100644 index 0000000000000000000000000000000000000000..4e5301bf537f6e4aeba288603d8cad8ac0c6790d --- /dev/null +++ b/shared/package-files/9b/9b4fa9e614c6536132eee050ac1ecb48f813bd2d02f05afe480f5dd81017e8c9/blob @@ -0,0 +1,687 @@ +import itertools + +from sympy.concrete.summations import Sum +from sympy.core.add import Add +from sympy.core.expr import Expr +from sympy.core.function import expand as _expand +from sympy.core.mul import Mul +from sympy.core.relational import Eq +from sympy.core.singleton import S +from sympy.core.symbol import Symbol +from sympy.integrals.integrals import Integral +from sympy.logic.boolalg import Not +from sympy.core.parameters import global_parameters +from sympy.core.sorting import default_sort_key +from sympy.core.sympify import _sympify +from sympy.core.relational import Relational +from sympy.logic.boolalg import Boolean +from sympy.stats import variance, covariance +from sympy.stats.rv import (RandomSymbol, pspace, dependent, + given, sampling_E, RandomIndexedSymbol, is_random, + PSpace, sampling_P, random_symbols) + +__all__ = ['Probability', 'Expectation', 'Variance', 'Covariance'] + + +@is_random.register(Expr) +def _(x): + atoms = x.free_symbols + if len(atoms) == 1 and next(iter(atoms)) == x: + return False + return any(is_random(i) for i in atoms) + +@is_random.register(RandomSymbol) # type: ignore +def _(x): + return True + + +class Probability(Expr): + """ + Symbolic expression for the probability. + + Examples + ======== + + >>> from sympy.stats import Probability, Normal + >>> from sympy import Integral + >>> X = Normal("X", 0, 1) + >>> prob = Probability(X > 1) + >>> prob + Probability(X > 1) + + Integral representation: + + >>> prob.rewrite(Integral) + Integral(sqrt(2)*exp(-_z**2/2)/(2*sqrt(pi)), (_z, 1, oo)) + + Evaluation of the integral: + + >>> prob.evaluate_integral() + sqrt(2)*(-sqrt(2)*sqrt(pi)*erf(sqrt(2)/2) + sqrt(2)*sqrt(pi))/(4*sqrt(pi)) + """ + def __new__(cls, prob, condition=None, **kwargs): + prob = _sympify(prob) + if condition is None: + obj = Expr.__new__(cls, prob) + else: + condition = _sympify(condition) + obj = Expr.__new__(cls, prob, condition) + obj._condition = condition + return obj + + def doit(self, **hints): + condition = self.args[0] + given_condition = self._condition + numsamples = hints.get('numsamples', False) + for_rewrite = not hints.get('for_rewrite', False) + + if isinstance(condition, Not): + return S.One - self.func(condition.args[0], given_condition, + evaluate=for_rewrite).doit(**hints) + + if condition.has(RandomIndexedSymbol): + return pspace(condition).probability(condition, given_condition, + evaluate=for_rewrite) + + if isinstance(given_condition, RandomSymbol): + condrv = random_symbols(condition) + if len(condrv) == 1 and condrv[0] == given_condition: + from sympy.stats.frv_types import BernoulliDistribution + return BernoulliDistribution(self.func(condition).doit(**hints), 0, 1) + if any(dependent(rv, given_condition) for rv in condrv): + return Probability(condition, given_condition) + else: + return Probability(condition).doit() + + if given_condition is not None and \ + not isinstance(given_condition, (Relational, Boolean)): + raise ValueError("%s is not a relational or combination of relationals" + % (given_condition)) + + if given_condition == False or condition is S.false: + return S.Zero + if not isinstance(condition, (Relational, Boolean)): + raise ValueError("%s is not a relational or combination of relationals" + % (condition)) + if condition is S.true: + return S.One + + if numsamples: + return sampling_P(condition, given_condition, numsamples=numsamples) + if given_condition is not None: # If there is a condition + # Recompute on new conditional expr + return Probability(given(condition, given_condition)).doit() + + # Otherwise pass work off to the ProbabilitySpace + if pspace(condition) == PSpace(): + return Probability(condition, given_condition) + + result = pspace(condition).probability(condition) + if hasattr(result, 'doit') and for_rewrite: + return result.doit() + else: + return result + + def _eval_rewrite_as_Integral(self, arg, condition=None, **kwargs): + return self.func(arg, condition=condition).doit(for_rewrite=True) + + _eval_rewrite_as_Sum = _eval_rewrite_as_Integral + + def evaluate_integral(self): + return self.rewrite(Integral).doit() + + +class Expectation(Expr): + """ + Symbolic expression for the expectation. + + Examples + ======== + + >>> from sympy.stats import Expectation, Normal, Probability, Poisson + >>> from sympy import symbols, Integral, Sum + >>> mu = symbols("mu") + >>> sigma = symbols("sigma", positive=True) + >>> X = Normal("X", mu, sigma) + >>> Expectation(X) + Expectation(X) + >>> Expectation(X).evaluate_integral().simplify() + mu + + To get the integral expression of the expectation: + + >>> Expectation(X).rewrite(Integral) + Integral(sqrt(2)*X*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo)) + + The same integral expression, in more abstract terms: + + >>> Expectation(X).rewrite(Probability) + Integral(x*Probability(Eq(X, x)), (x, -oo, oo)) + + To get the Summation expression of the expectation for discrete random variables: + + >>> lamda = symbols('lamda', positive=True) + >>> Z = Poisson('Z', lamda) + >>> Expectation(Z).rewrite(Sum) + Sum(Z*lamda**Z*exp(-lamda)/factorial(Z), (Z, 0, oo)) + + This class is aware of some properties of the expectation: + + >>> from sympy.abc import a + >>> Expectation(a*X) + Expectation(a*X) + >>> Y = Normal("Y", 1, 2) + >>> Expectation(X + Y) + Expectation(X + Y) + + To expand the ``Expectation`` into its expression, use ``expand()``: + + >>> Expectation(X + Y).expand() + Expectation(X) + Expectation(Y) + >>> Expectation(a*X + Y).expand() + a*Expectation(X) + Expectation(Y) + >>> Expectation(a*X + Y) + Expectation(a*X + Y) + >>> Expectation((X + Y)*(X - Y)).expand() + Expectation(X**2) - Expectation(Y**2) + + To evaluate the ``Expectation``, use ``doit()``: + + >>> Expectation(X + Y).doit() + mu + 1 + >>> Expectation(X + Expectation(Y + Expectation(2*X))).doit() + 3*mu + 1 + + To prevent evaluating nested ``Expectation``, use ``doit(deep=False)`` + + >>> Expectation(X + Expectation(Y)).doit(deep=False) + mu + Expectation(Expectation(Y)) + >>> Expectation(X + Expectation(Y + Expectation(2*X))).doit(deep=False) + mu + Expectation(Expectation(Y + Expectation(2*X))) + + """ + + def __new__(cls, expr, condition=None, **kwargs): + expr = _sympify(expr) + if expr.is_Matrix: + from sympy.stats.symbolic_multivariate_probability import ExpectationMatrix + return ExpectationMatrix(expr, condition) + if condition is None: + if not is_random(expr): + return expr + obj = Expr.__new__(cls, expr) + else: + condition = _sympify(condition) + obj = Expr.__new__(cls, expr, condition) + obj._condition = condition + return obj + + def expand(self, **hints): + expr = self.args[0] + condition = self._condition + + if not is_random(expr): + return expr + + if isinstance(expr, Add): + return Add.fromiter(Expectation(a, condition=condition).expand() + for a in expr.args) + + expand_expr = _expand(expr) + if isinstance(expand_expr, Add): + return Add.fromiter(Expectation(a, condition=condition).expand() + for a in expand_expr.args) + + elif isinstance(expr, Mul): + rv = [] + nonrv = [] + for a in expr.args: + if is_random(a): + rv.append(a) + else: + nonrv.append(a) + return Mul.fromiter(nonrv)*Expectation(Mul.fromiter(rv), condition=condition) + + return self + + def doit(self, **hints): + deep = hints.get('deep', True) + condition = self._condition + expr = self.args[0] + numsamples = hints.get('numsamples', False) + for_rewrite = not hints.get('for_rewrite', False) + + if deep: + expr = expr.doit(**hints) + + if not is_random(expr) or isinstance(expr, Expectation): # expr isn't random? + return expr + if numsamples: # Computing by monte carlo sampling? + evalf = hints.get('evalf', True) + return sampling_E(expr, condition, numsamples=numsamples, evalf=evalf) + + if expr.has(RandomIndexedSymbol): + return pspace(expr).compute_expectation(expr, condition) + + # Create new expr and recompute E + if condition is not None: # If there is a condition + return self.func(given(expr, condition)).doit(**hints) + + # A few known statements for efficiency + + if expr.is_Add: # We know that E is Linear + return Add(*[self.func(arg, condition).doit(**hints) + if not isinstance(arg, Expectation) else self.func(arg, condition) + for arg in expr.args]) + if expr.is_Mul: + if expr.atoms(Expectation): + return expr + + if pspace(expr) == PSpace(): + return self.func(expr) + # Otherwise case is simple, pass work off to the ProbabilitySpace + result = pspace(expr).compute_expectation(expr, evaluate=for_rewrite) + if hasattr(result, 'doit') and for_rewrite: + return result.doit(**hints) + else: + return result + + + def _eval_rewrite_as_Probability(self, arg, condition=None, **kwargs): + rvs = arg.atoms(RandomSymbol) + if len(rvs) > 1: + raise NotImplementedError() + if len(rvs) == 0: + return arg + + rv = rvs.pop() + if rv.pspace is None: + raise ValueError("Probability space not known") + + symbol = rv.symbol + if symbol.name[0].isupper(): + symbol = Symbol(symbol.name.lower()) + else : + symbol = Symbol(symbol.name + "_1") + + if rv.pspace.is_Continuous: + return Integral(arg.replace(rv, symbol)*Probability(Eq(rv, symbol), condition), (symbol, rv.pspace.domain.set.inf, rv.pspace.domain.set.sup)) + else: + if rv.pspace.is_Finite: + raise NotImplementedError + else: + return Sum(arg.replace(rv, symbol)*Probability(Eq(rv, symbol), condition), (symbol, rv.pspace.domain.set.inf, rv.pspace.set.sup)) + + def _eval_rewrite_as_Integral(self, arg, condition=None, **kwargs): + return self.func(arg, condition=condition).doit(deep=False, for_rewrite=True) + + _eval_rewrite_as_Sum = _eval_rewrite_as_Integral # For discrete this will be Sum + + def evaluate_integral(self): + return self.rewrite(Integral).doit() + + evaluate_sum = evaluate_integral + +class Variance(Expr): + """ + Symbolic expression for the variance. + + Examples + ======== + + >>> from sympy import symbols, Integral + >>> from sympy.stats import Normal, Expectation, Variance, Probability + >>> mu = symbols("mu", positive=True) + >>> sigma = symbols("sigma", positive=True) + >>> X = Normal("X", mu, sigma) + >>> Variance(X) + Variance(X) + >>> Variance(X).evaluate_integral() + sigma**2 + + Integral representation of the underlying calculations: + + >>> Variance(X).rewrite(Integral) + Integral(sqrt(2)*(X - Integral(sqrt(2)*X*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo)))**2*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo)) + + Integral representation, without expanding the PDF: + + >>> Variance(X).rewrite(Probability) + -Integral(x*Probability(Eq(X, x)), (x, -oo, oo))**2 + Integral(x**2*Probability(Eq(X, x)), (x, -oo, oo)) + + Rewrite the variance in terms of the expectation + + >>> Variance(X).rewrite(Expectation) + -Expectation(X)**2 + Expectation(X**2) + + Some transformations based on the properties of the variance may happen: + + >>> from sympy.abc import a + >>> Y = Normal("Y", 0, 1) + >>> Variance(a*X) + Variance(a*X) + + To expand the variance in its expression, use ``expand()``: + + >>> Variance(a*X).expand() + a**2*Variance(X) + >>> Variance(X + Y) + Variance(X + Y) + >>> Variance(X + Y).expand() + 2*Covariance(X, Y) + Variance(X) + Variance(Y) + + """ + def __new__(cls, arg, condition=None, **kwargs): + arg = _sympify(arg) + + if arg.is_Matrix: + from sympy.stats.symbolic_multivariate_probability import VarianceMatrix + return VarianceMatrix(arg, condition) + if condition is None: + obj = Expr.__new__(cls, arg) + else: + condition = _sympify(condition) + obj = Expr.__new__(cls, arg, condition) + obj._condition = condition + return obj + + def expand(self, **hints): + arg = self.args[0] + condition = self._condition + + if not is_random(arg): + return S.Zero + + if isinstance(arg, RandomSymbol): + return self + elif isinstance(arg, Add): + rv = [] + for a in arg.args: + if is_random(a): + rv.append(a) + variances = Add(*(Variance(xv, condition).expand() for xv in rv)) + map_to_covar = lambda x: 2*Covariance(*x, condition=condition).expand() + covariances = Add(*map(map_to_covar, itertools.combinations(rv, 2))) + return variances + covariances + elif isinstance(arg, Mul): + nonrv = [] + rv = [] + for a in arg.args: + if is_random(a): + rv.append(a) + else: + nonrv.append(a**2) + if len(rv) == 0: + return S.Zero + return Mul.fromiter(nonrv)*Variance(Mul.fromiter(rv), condition) + + # this expression contains a RandomSymbol somehow: + return self + + def _eval_rewrite_as_Expectation(self, arg, condition=None, **kwargs): + e1 = Expectation(arg**2, condition) + e2 = Expectation(arg, condition)**2 + return e1 - e2 + + def _eval_rewrite_as_Probability(self, arg, condition=None, **kwargs): + return self.rewrite(Expectation).rewrite(Probability) + + def _eval_rewrite_as_Integral(self, arg, condition=None, **kwargs): + return variance(self.args[0], self._condition, evaluate=False) + + _eval_rewrite_as_Sum = _eval_rewrite_as_Integral + + def evaluate_integral(self): + return self.rewrite(Integral).doit() + + +class Covariance(Expr): + """ + Symbolic expression for the covariance. + + Examples + ======== + + >>> from sympy.stats import Covariance + >>> from sympy.stats import Normal + >>> X = Normal("X", 3, 2) + >>> Y = Normal("Y", 0, 1) + >>> Z = Normal("Z", 0, 1) + >>> W = Normal("W", 0, 1) + >>> cexpr = Covariance(X, Y) + >>> cexpr + Covariance(X, Y) + + Evaluate the covariance, `X` and `Y` are independent, + therefore zero is the result: + + >>> cexpr.evaluate_integral() + 0 + + Rewrite the covariance expression in terms of expectations: + + >>> from sympy.stats import Expectation + >>> cexpr.rewrite(Expectation) + Expectation(X*Y) - Expectation(X)*Expectation(Y) + + In order to expand the argument, use ``expand()``: + + >>> from sympy.abc import a, b, c, d + >>> Covariance(a*X + b*Y, c*Z + d*W) + Covariance(a*X + b*Y, c*Z + d*W) + >>> Covariance(a*X + b*Y, c*Z + d*W).expand() + a*c*Covariance(X, Z) + a*d*Covariance(W, X) + b*c*Covariance(Y, Z) + b*d*Covariance(W, Y) + + This class is aware of some properties of the covariance: + + >>> Covariance(X, X).expand() + Variance(X) + >>> Covariance(a*X, b*Y).expand() + a*b*Covariance(X, Y) + """ + + def __new__(cls, arg1, arg2, condition=None, **kwargs): + arg1 = _sympify(arg1) + arg2 = _sympify(arg2) + + if arg1.is_Matrix or arg2.is_Matrix: + from sympy.stats.symbolic_multivariate_probability import CrossCovarianceMatrix + return CrossCovarianceMatrix(arg1, arg2, condition) + + if kwargs.pop('evaluate', global_parameters.evaluate): + arg1, arg2 = sorted([arg1, arg2], key=default_sort_key) + + if condition is None: + obj = Expr.__new__(cls, arg1, arg2) + else: + condition = _sympify(condition) + obj = Expr.__new__(cls, arg1, arg2, condition) + obj._condition = condition + return obj + + def expand(self, **hints): + arg1 = self.args[0] + arg2 = self.args[1] + condition = self._condition + + if arg1 == arg2: + return Variance(arg1, condition).expand() + + if not is_random(arg1): + return S.Zero + if not is_random(arg2): + return S.Zero + + arg1, arg2 = sorted([arg1, arg2], key=default_sort_key) + + if isinstance(arg1, RandomSymbol) and isinstance(arg2, RandomSymbol): + return Covariance(arg1, arg2, condition) + + coeff_rv_list1 = self._expand_single_argument(arg1.expand()) + coeff_rv_list2 = self._expand_single_argument(arg2.expand()) + + addends = [a*b*Covariance(*sorted([r1, r2], key=default_sort_key), condition=condition) + for (a, r1) in coeff_rv_list1 for (b, r2) in coeff_rv_list2] + return Add.fromiter(addends) + + @classmethod + def _expand_single_argument(cls, expr): + # return (coefficient, random_symbol) pairs: + if isinstance(expr, RandomSymbol): + return [(S.One, expr)] + elif isinstance(expr, Add): + outval = [] + for a in expr.args: + if isinstance(a, Mul): + outval.append(cls._get_mul_nonrv_rv_tuple(a)) + elif is_random(a): + outval.append((S.One, a)) + + return outval + elif isinstance(expr, Mul): + return [cls._get_mul_nonrv_rv_tuple(expr)] + elif is_random(expr): + return [(S.One, expr)] + + @classmethod + def _get_mul_nonrv_rv_tuple(cls, m): + rv = [] + nonrv = [] + for a in m.args: + if is_random(a): + rv.append(a) + else: + nonrv.append(a) + return (Mul.fromiter(nonrv), Mul.fromiter(rv)) + + def _eval_rewrite_as_Expectation(self, arg1, arg2, condition=None, **kwargs): + e1 = Expectation(arg1*arg2, condition) + e2 = Expectation(arg1, condition)*Expectation(arg2, condition) + return e1 - e2 + + def _eval_rewrite_as_Probability(self, arg1, arg2, condition=None, **kwargs): + return self.rewrite(Expectation).rewrite(Probability) + + def _eval_rewrite_as_Integral(self, arg1, arg2, condition=None, **kwargs): + return covariance(self.args[0], self.args[1], self._condition, evaluate=False) + + _eval_rewrite_as_Sum = _eval_rewrite_as_Integral + + def evaluate_integral(self): + return self.rewrite(Integral).doit() + + +class Moment(Expr): + """ + Symbolic class for Moment + + Examples + ======== + + >>> from sympy import Symbol, Integral + >>> from sympy.stats import Normal, Expectation, Probability, Moment + >>> mu = Symbol('mu', real=True) + >>> sigma = Symbol('sigma', positive=True) + >>> X = Normal('X', mu, sigma) + >>> M = Moment(X, 3, 1) + + To evaluate the result of Moment use `doit`: + + >>> M.doit() + mu**3 - 3*mu**2 + 3*mu*sigma**2 + 3*mu - 3*sigma**2 - 1 + + Rewrite the Moment expression in terms of Expectation: + + >>> M.rewrite(Expectation) + Expectation((X - 1)**3) + + Rewrite the Moment expression in terms of Probability: + + >>> M.rewrite(Probability) + Integral((x - 1)**3*Probability(Eq(X, x)), (x, -oo, oo)) + + Rewrite the Moment expression in terms of Integral: + + >>> M.rewrite(Integral) + Integral(sqrt(2)*(X - 1)**3*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo)) + + """ + def __new__(cls, X, n, c=0, condition=None, **kwargs): + X = _sympify(X) + n = _sympify(n) + c = _sympify(c) + if condition is not None: + condition = _sympify(condition) + return super().__new__(cls, X, n, c, condition) + else: + return super().__new__(cls, X, n, c) + + def doit(self, **hints): + return self.rewrite(Expectation).doit(**hints) + + def _eval_rewrite_as_Expectation(self, X, n, c=0, condition=None, **kwargs): + return Expectation((X - c)**n, condition) + + def _eval_rewrite_as_Probability(self, X, n, c=0, condition=None, **kwargs): + return self.rewrite(Expectation).rewrite(Probability) + + def _eval_rewrite_as_Integral(self, X, n, c=0, condition=None, **kwargs): + return self.rewrite(Expectation).rewrite(Integral) + + +class CentralMoment(Expr): + """ + Symbolic class Central Moment + + Examples + ======== + + >>> from sympy import Symbol, Integral + >>> from sympy.stats import Normal, Expectation, Probability, CentralMoment + >>> mu = Symbol('mu', real=True) + >>> sigma = Symbol('sigma', positive=True) + >>> X = Normal('X', mu, sigma) + >>> CM = CentralMoment(X, 4) + + To evaluate the result of CentralMoment use `doit`: + + >>> CM.doit().simplify() + 3*sigma**4 + + Rewrite the CentralMoment expression in terms of Expectation: + + >>> CM.rewrite(Expectation) + Expectation((X - Expectation(X))**4) + + Rewrite the CentralMoment expression in terms of Probability: + + >>> CM.rewrite(Probability) + Integral((x - Integral(x*Probability(True), (x, -oo, oo)))**4*Probability(Eq(X, x)), (x, -oo, oo)) + + Rewrite the CentralMoment expression in terms of Integral: + + >>> CM.rewrite(Integral) + Integral(sqrt(2)*(X - Integral(sqrt(2)*X*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo)))**4*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo)) + + """ + def __new__(cls, X, n, condition=None, **kwargs): + X = _sympify(X) + n = _sympify(n) + if condition is not None: + condition = _sympify(condition) + return super().__new__(cls, X, n, condition) + else: + return super().__new__(cls, X, n) + + def doit(self, **hints): + return self.rewrite(Expectation).doit(**hints) + + def _eval_rewrite_as_Expectation(self, X, n, condition=None, **kwargs): + mu = Expectation(X, condition, **kwargs) + return Moment(X, n, mu, condition, **kwargs).rewrite(Expectation) + + def _eval_rewrite_as_Probability(self, X, n, condition=None, **kwargs): + return self.rewrite(Expectation).rewrite(Probability) + + def _eval_rewrite_as_Integral(self, X, n, condition=None, **kwargs): + return self.rewrite(Expectation).rewrite(Integral) diff --git a/shared/package-files/9b/9b542cdd392345b80afdab68e0f7056548da6fee5a1315a7bf918d1b54bd957b/blob b/shared/package-files/9b/9b542cdd392345b80afdab68e0f7056548da6fee5a1315a7bf918d1b54bd957b/blob new file mode 100644 index 0000000000000000000000000000000000000000..0f475331c168677de6ff760350e797565957eb51 --- /dev/null +++ b/shared/package-files/9b/9b542cdd392345b80afdab68e0f7056548da6fee5a1315a7bf918d1b54bd957b/blob @@ -0,0 +1,11 @@ +from .optimizer import Optimizer, ParamsT + +class Adadelta(Optimizer): + def __init__( + self, + params: ParamsT, + lr: float = ..., + rho: float = ..., + eps: float = ..., + weight_decay: float = ..., + ) -> None: ... diff --git a/shared/package-files/9b/9b5b3703806bbd17835f93e58836a5639dd884f7ef875b3ec7879f6b57e521a1/blob b/shared/package-files/9b/9b5b3703806bbd17835f93e58836a5639dd884f7ef875b3ec7879f6b57e521a1/blob new file mode 100644 index 0000000000000000000000000000000000000000..541f164daf46a336719b4148b7b25cea73fe212c --- /dev/null +++ b/shared/package-files/9b/9b5b3703806bbd17835f93e58836a5639dd884f7ef875b3ec7879f6b57e521a1/blob @@ -0,0 +1,95 @@ +"""A variety of linear models.""" + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +# See http://scikit-learn.sourceforge.net/modules/sgd.html and +# http://scikit-learn.sourceforge.net/modules/linear_model.html for +# complete documentation. + +from ._base import LinearRegression +from ._bayes import ARDRegression, BayesianRidge +from ._coordinate_descent import ( + ElasticNet, + ElasticNetCV, + Lasso, + LassoCV, + MultiTaskElasticNet, + MultiTaskElasticNetCV, + MultiTaskLasso, + MultiTaskLassoCV, + enet_path, + lasso_path, +) +from ._glm import GammaRegressor, PoissonRegressor, TweedieRegressor +from ._huber import HuberRegressor +from ._least_angle import ( + Lars, + LarsCV, + LassoLars, + LassoLarsCV, + LassoLarsIC, + lars_path, + lars_path_gram, +) +from ._logistic import LogisticRegression, LogisticRegressionCV +from ._omp import ( + OrthogonalMatchingPursuit, + OrthogonalMatchingPursuitCV, + orthogonal_mp, + orthogonal_mp_gram, +) +from ._passive_aggressive import PassiveAggressiveClassifier, PassiveAggressiveRegressor +from ._perceptron import Perceptron +from ._quantile import QuantileRegressor +from ._ransac import RANSACRegressor +from ._ridge import Ridge, RidgeClassifier, RidgeClassifierCV, RidgeCV, ridge_regression +from ._stochastic_gradient import SGDClassifier, SGDOneClassSVM, SGDRegressor +from ._theil_sen import TheilSenRegressor + +__all__ = [ + "ARDRegression", + "BayesianRidge", + "ElasticNet", + "ElasticNetCV", + "GammaRegressor", + "HuberRegressor", + "Lars", + "LarsCV", + "Lasso", + "LassoCV", + "LassoLars", + "LassoLarsCV", + "LassoLarsIC", + "LinearRegression", + "LogisticRegression", + "LogisticRegressionCV", + "MultiTaskElasticNet", + "MultiTaskElasticNetCV", + "MultiTaskLasso", + "MultiTaskLassoCV", + "OrthogonalMatchingPursuit", + "OrthogonalMatchingPursuitCV", + "PassiveAggressiveClassifier", + "PassiveAggressiveRegressor", + "Perceptron", + "PoissonRegressor", + "QuantileRegressor", + "RANSACRegressor", + "Ridge", + "RidgeCV", + "RidgeClassifier", + "RidgeClassifierCV", + "SGDClassifier", + "SGDOneClassSVM", + "SGDRegressor", + "TheilSenRegressor", + "TweedieRegressor", + "enet_path", + "lars_path", + "lars_path_gram", + "lasso_path", + "orthogonal_mp", + "orthogonal_mp_gram", + "ridge_regression", +] diff --git a/shared/package-files/9b/9b62149e65ae88c6dd4da6bc3fd68cac9355d5be78045d9faf3270495fdc5451/blob b/shared/package-files/9b/9b62149e65ae88c6dd4da6bc3fd68cac9355d5be78045d9faf3270495fdc5451/blob new file mode 100644 index 0000000000000000000000000000000000000000..403760bce79d351e1dc09e980290c4650232db22 --- /dev/null +++ b/shared/package-files/9b/9b62149e65ae88c6dd4da6bc3fd68cac9355d5be78045d9faf3270495fdc5451/blob @@ -0,0 +1,160 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from narwhals._compliant.any_namespace import StringNamespace +from narwhals._pandas_like.utils import ( + PandasLikeSeriesNamespace, + align_and_extract_native, + get_dtype_backend, + is_dtype_pyarrow, +) +from narwhals._utils import str_slice_stop + +if TYPE_CHECKING: + from narwhals._pandas_like.series import PandasLikeSeries + + +class PandasLikeSeriesStringNamespace( + PandasLikeSeriesNamespace, StringNamespace["PandasLikeSeries"] +): + def _with_native_bool(self, result: Any) -> PandasLikeSeries: + # See https://narwhals-dev.github.io/narwhals/concepts/boolean/. + if ( + result.dtype == object + and get_dtype_backend(self.native.dtype, self.implementation) is None + ): + not_na = result.notna() + all_valid = not_na.all() + if not all_valid and self.implementation._backend_version() < (3,): + result.where(not_na, False, inplace=True) + result = result.astype(bool, copy=False) + elif not all_valid: + result = result.where(not_na, False).astype(bool) + else: # pragma: no cover + pass + return self.with_native(result) + + def len_chars(self) -> PandasLikeSeries: + result = self.native.str.len() + if result.dtype == object: + # pandas returns `object` instead of a number for an all-null `object` column. + result = self.implementation.to_native_namespace().to_numeric(result) + return self.with_native(result) + + def replace( + self, value: PandasLikeSeries, pattern: str, *, literal: bool, n: int + ) -> PandasLikeSeries: + if n == 0: + return self.compliant + _, value_native = align_and_extract_native(self.compliant, value) + if not isinstance(value_native, str): + msg = f"{self.compliant._implementation} backed `.str.replace` only supports str replacement values" + raise TypeError(msg) + series = self.native.str.replace( + pat=pattern, repl=value_native, n=n, regex=not literal + ) + return self.with_native(series) + + def replace_all( + self, value: PandasLikeSeries, pattern: str, *, literal: bool + ) -> PandasLikeSeries: + return self.replace(value, pattern, literal=literal, n=-1) + + def strip_chars(self, characters: str | None) -> PandasLikeSeries: + return self.with_native(self.native.str.strip(characters)) + + def strip_chars_start(self, characters: str) -> PandasLikeSeries: + return self.with_native(self.native.str.lstrip(characters)) + + def strip_chars_end(self, characters: str) -> PandasLikeSeries: + return self.with_native(self.native.str.rstrip(characters)) + + def starts_with(self, prefix: PandasLikeSeries) -> PandasLikeSeries: + _, prefix_native = align_and_extract_native(self.compliant, prefix) + if not isinstance(prefix_native, str): + msg = f"`.str.starts_with` only supports prefix values for {self.compliant._implementation} backend" + raise TypeError(msg) + return self._with_native_bool(self.native.str.startswith(prefix_native)) + + def ends_with(self, suffix: PandasLikeSeries) -> PandasLikeSeries: + _, suffix_native = align_and_extract_native(self.compliant, suffix) + if not isinstance(suffix_native, str): + msg = f"`.str.ends_with` only supports suffix values for {self.compliant._implementation} backend" + raise TypeError(msg) + return self._with_native_bool(self.native.str.endswith(suffix_native)) + + def contains(self, pattern: PandasLikeSeries, *, literal: bool) -> PandasLikeSeries: + _, pattern_native = align_and_extract_native(self.compliant, pattern) + if not isinstance(pattern_native, str): + msg = f"`.str.contains` only supports str pattern values for {self.compliant._implementation} backend" + raise TypeError(msg) + return self._with_native_bool( + self.native.str.contains(pat=pattern_native, regex=not literal) + ) + + def slice(self, offset: int, length: int | None) -> PandasLikeSeries: + stop = str_slice_stop(offset, length) + return self.with_native(self.native.str.slice(start=offset, stop=stop)) + + def split(self, by: str) -> PandasLikeSeries: + implementation = self.implementation + if not implementation.is_cudf() and not is_dtype_pyarrow(self.native.dtype): + msg = ( + "This operation requires a pyarrow-backed series. " + "Please refer to https://narwhals-dev.github.io/narwhals/api-reference/narwhals/#narwhals.maybe_convert_dtypes " + "and ensure you are using dtype_backend='pyarrow'. " + "Additionally, make sure you have pandas version 1.5+ and pyarrow installed. " + ) + raise TypeError(msg) + return self.with_native(self.native.str.split(pat=by)) + + def to_datetime(self, format: str | None) -> PandasLikeSeries: + # If we know inputs are timezone-aware, we can pass `utc=True` for better performance. + if format and any(x in format for x in ("%z", "Z")): + return self.with_native(self._to_datetime(format, utc=True)) + result = self.with_native(self._to_datetime(format, utc=False)) + if (tz := getattr(result.dtype, "time_zone", None)) and tz != "UTC": + return result.dt.convert_time_zone("UTC") + return result + + def _to_datetime(self, format: str | None, *, utc: bool) -> Any: + result = self.implementation.to_native_namespace().to_datetime( + self.native, format=format, utc=utc + ) + return ( + result.convert_dtypes(dtype_backend="pyarrow") + if is_dtype_pyarrow(self.native.dtype) + else result + ) + + def to_date(self, format: str | None) -> PandasLikeSeries: + return self.to_datetime(format=format).dt.date() + + def to_time(self, format: str | None) -> PandasLikeSeries: + time_dtype = self.version.dtypes.Time() + return self.with_native(self._to_datetime(format, utc=False)).cast(time_dtype) + + def to_uppercase(self) -> PandasLikeSeries: + return self.with_native(self.native.str.upper()) + + def to_lowercase(self) -> PandasLikeSeries: + return self.with_native(self.native.str.lower()) + + def to_titlecase(self) -> PandasLikeSeries: + return self.with_native(self.native.str.title()) + + def zfill(self, width: int) -> PandasLikeSeries: + if width == 0: + return self.compliant + return self.with_native(self.native.str.zfill(width)) + + def pad_start(self, length: int, fill_char: str) -> PandasLikeSeries: + return self.with_native( + self.native.str.pad(width=length, fillchar=fill_char, side="left") + ) + + def pad_end(self, length: int, fill_char: str) -> PandasLikeSeries: + return self.with_native( + self.native.str.pad(width=length, fillchar=fill_char, side="right") + ) diff --git a/shared/package-files/9b/9b633e2d6aa5d803d19bb099de8163f7b49408a1bfaea3fe3e7d519e15dda808/blob b/shared/package-files/9b/9b633e2d6aa5d803d19bb099de8163f7b49408a1bfaea3fe3e7d519e15dda808/blob new file mode 100644 index 0000000000000000000000000000000000000000..b6c975440222677f559b00fdd9dcd576855663dc --- /dev/null +++ b/shared/package-files/9b/9b633e2d6aa5d803d19bb099de8163f7b49408a1bfaea3fe3e7d519e15dda808/blob @@ -0,0 +1,50 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API ldexp_Tensor { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::ldexp") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "ldexp.Tensor(Tensor self, Tensor other) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Tensor & other); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other); +}; + +struct TORCH_API ldexp_ { + using schema = at::Tensor & (at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::ldexp_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "ldexp_(Tensor(a!) self, Tensor other) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, const at::Tensor & other); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Tensor & other); +}; + +struct TORCH_API ldexp_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::ldexp") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "ldexp.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9b/9b65eeebf6d708da9966136f37d3d3eef925cdce7587f22da457eeee1f8ba83e/blob b/shared/package-files/9b/9b65eeebf6d708da9966136f37d3d3eef925cdce7587f22da457eeee1f8ba83e/blob new file mode 100644 index 0000000000000000000000000000000000000000..c0df1c17e3a7c5276ff055e4fe23b5fca90988ca --- /dev/null +++ b/shared/package-files/9b/9b65eeebf6d708da9966136f37d3d3eef925cdce7587f22da457eeee1f8ba83e/blob @@ -0,0 +1,557 @@ +from __future__ import annotations + +import ctypes +import re +from typing import Any + +import numpy as np + +from pandas._config import using_string_dtype + +from pandas.compat._optional import import_optional_dependency +from pandas.errors import SettingWithCopyError + +import pandas as pd +from pandas.core.interchange.dataframe_protocol import ( + Buffer, + Column, + ColumnNullType, + DataFrame as DataFrameXchg, + DtypeKind, +) +from pandas.core.interchange.utils import ( + ArrowCTypes, + Endianness, +) + +_NP_DTYPES: dict[DtypeKind, dict[int, Any]] = { + DtypeKind.INT: {8: np.int8, 16: np.int16, 32: np.int32, 64: np.int64}, + DtypeKind.UINT: {8: np.uint8, 16: np.uint16, 32: np.uint32, 64: np.uint64}, + DtypeKind.FLOAT: {32: np.float32, 64: np.float64}, + DtypeKind.BOOL: {1: bool, 8: bool}, +} + + +def from_dataframe(df, allow_copy: bool = True) -> pd.DataFrame: + """ + Build a ``pd.DataFrame`` from any DataFrame supporting the interchange protocol. + + .. note:: + + For new development, we highly recommend using the Arrow C Data Interface + alongside the Arrow PyCapsule Interface instead of the interchange protocol. + From pandas 2.3 onwards, `from_dataframe` uses the PyCapsule Interface, + only falling back to the interchange protocol if that fails. + + .. warning:: + + Due to severe implementation issues, we recommend only considering using the + interchange protocol in the following cases: + + - converting to pandas: for pandas >= 2.0.3 + - converting from pandas: for pandas >= 3.0.0 + + Parameters + ---------- + df : DataFrameXchg + Object supporting the interchange protocol, i.e. `__dataframe__` method. + allow_copy : bool, default: True + Whether to allow copying the memory to perform the conversion + (if false then zero-copy approach is requested). + + Returns + ------- + pd.DataFrame + + Examples + -------- + >>> df_not_necessarily_pandas = pd.DataFrame({'A': [1, 2], 'B': [3, 4]}) + >>> interchange_object = df_not_necessarily_pandas.__dataframe__() + >>> interchange_object.column_names() + Index(['A', 'B'], dtype='object') + >>> df_pandas = (pd.api.interchange.from_dataframe + ... (interchange_object.select_columns_by_name(['A']))) + >>> df_pandas + A + 0 1 + 1 2 + + These methods (``column_names``, ``select_columns_by_name``) should work + for any dataframe library which implements the interchange protocol. + """ + if isinstance(df, pd.DataFrame): + return df + + if hasattr(df, "__arrow_c_stream__"): + try: + pa = import_optional_dependency("pyarrow", min_version="14.0.0") + except ImportError: + # fallback to _from_dataframe + pass + else: + try: + return pa.table(df).to_pandas(zero_copy_only=not allow_copy) + except pa.ArrowInvalid as e: + raise RuntimeError(e) from e + + if not hasattr(df, "__dataframe__"): + raise ValueError("`df` does not support __dataframe__") + + return _from_dataframe( + df.__dataframe__(allow_copy=allow_copy), allow_copy=allow_copy + ) + + +def _from_dataframe(df: DataFrameXchg, allow_copy: bool = True): + """ + Build a ``pd.DataFrame`` from the DataFrame interchange object. + + Parameters + ---------- + df : DataFrameXchg + Object supporting the interchange protocol, i.e. `__dataframe__` method. + allow_copy : bool, default: True + Whether to allow copying the memory to perform the conversion + (if false then zero-copy approach is requested). + + Returns + ------- + pd.DataFrame + """ + pandas_dfs = [] + for chunk in df.get_chunks(): + pandas_df = protocol_df_chunk_to_pandas(chunk) + pandas_dfs.append(pandas_df) + + if not allow_copy and len(pandas_dfs) > 1: + raise RuntimeError( + "To join chunks a copy is required which is forbidden by allow_copy=False" + ) + if not pandas_dfs: + pandas_df = protocol_df_chunk_to_pandas(df) + elif len(pandas_dfs) == 1: + pandas_df = pandas_dfs[0] + else: + pandas_df = pd.concat(pandas_dfs, axis=0, ignore_index=True, copy=False) + + index_obj = df.metadata.get("pandas.index", None) + if index_obj is not None: + pandas_df.index = index_obj + + return pandas_df + + +def protocol_df_chunk_to_pandas(df: DataFrameXchg) -> pd.DataFrame: + """ + Convert interchange protocol chunk to ``pd.DataFrame``. + + Parameters + ---------- + df : DataFrameXchg + + Returns + ------- + pd.DataFrame + """ + columns: dict[str, Any] = {} + buffers = [] # hold on to buffers, keeps memory alive + for name in df.column_names(): + if not isinstance(name, str): + raise ValueError(f"Column {name} is not a string") + if name in columns: + raise ValueError(f"Column {name} is not unique") + col = df.get_column_by_name(name) + dtype = col.dtype[0] + if dtype in ( + DtypeKind.INT, + DtypeKind.UINT, + DtypeKind.FLOAT, + DtypeKind.BOOL, + ): + columns[name], buf = primitive_column_to_ndarray(col) + elif dtype == DtypeKind.CATEGORICAL: + columns[name], buf = categorical_column_to_series(col) + elif dtype == DtypeKind.STRING: + columns[name], buf = string_column_to_ndarray(col) + elif dtype == DtypeKind.DATETIME: + columns[name], buf = datetime_column_to_ndarray(col) + else: + raise NotImplementedError(f"Data type {dtype} not handled yet") + + buffers.append(buf) + + pandas_df = pd.DataFrame(columns) + pandas_df.attrs["_INTERCHANGE_PROTOCOL_BUFFERS"] = buffers + return pandas_df + + +def primitive_column_to_ndarray(col: Column) -> tuple[np.ndarray, Any]: + """ + Convert a column holding one of the primitive dtypes to a NumPy array. + + A primitive type is one of: int, uint, float, bool. + + Parameters + ---------- + col : Column + + Returns + ------- + tuple + Tuple of np.ndarray holding the data and the memory owner object + that keeps the memory alive. + """ + buffers = col.get_buffers() + + data_buff, data_dtype = buffers["data"] + data = buffer_to_ndarray( + data_buff, data_dtype, offset=col.offset, length=col.size() + ) + + data = set_nulls(data, col, buffers["validity"]) + return data, buffers + + +def categorical_column_to_series(col: Column) -> tuple[pd.Series, Any]: + """ + Convert a column holding categorical data to a pandas Series. + + Parameters + ---------- + col : Column + + Returns + ------- + tuple + Tuple of pd.Series holding the data and the memory owner object + that keeps the memory alive. + """ + categorical = col.describe_categorical + + if not categorical["is_dictionary"]: + raise NotImplementedError("Non-dictionary categoricals not supported yet") + + cat_column = categorical["categories"] + if hasattr(cat_column, "_col"): + # Item "Column" of "Optional[Column]" has no attribute "_col" + # Item "None" of "Optional[Column]" has no attribute "_col" + categories = np.array(cat_column._col) # type: ignore[union-attr] + else: + raise NotImplementedError( + "Interchanging categorical columns isn't supported yet, and our " + "fallback of using the `col._col` attribute (a ndarray) failed." + ) + buffers = col.get_buffers() + + codes_buff, codes_dtype = buffers["data"] + codes = buffer_to_ndarray( + codes_buff, codes_dtype, offset=col.offset, length=col.size() + ) + + # Doing module in order to not get ``IndexError`` for + # out-of-bounds sentinel values in `codes` + if len(categories) > 0: + values = categories[codes % len(categories)] + else: + values = codes + + cat = pd.Categorical( + values, categories=categories, ordered=categorical["is_ordered"] + ) + data = pd.Series(cat) + + data = set_nulls(data, col, buffers["validity"]) + return data, buffers + + +def string_column_to_ndarray(col: Column) -> tuple[np.ndarray, Any]: + """ + Convert a column holding string data to a NumPy array. + + Parameters + ---------- + col : Column + + Returns + ------- + tuple + Tuple of np.ndarray holding the data and the memory owner object + that keeps the memory alive. + """ + null_kind, sentinel_val = col.describe_null + + if null_kind not in ( + ColumnNullType.NON_NULLABLE, + ColumnNullType.USE_BITMASK, + ColumnNullType.USE_BYTEMASK, + ): + raise NotImplementedError( + f"{null_kind} null kind is not yet supported for string columns." + ) + + buffers = col.get_buffers() + + assert buffers["offsets"], "String buffers must contain offsets" + # Retrieve the data buffer containing the UTF-8 code units + data_buff, _ = buffers["data"] + # We're going to reinterpret the buffer as uint8, so make sure we can do it safely + assert col.dtype[2] in ( + ArrowCTypes.STRING, + ArrowCTypes.LARGE_STRING, + ) # format_str == utf-8 + # Convert the buffers to NumPy arrays. In order to go from STRING to + # an equivalent ndarray, we claim that the buffer is uint8 (i.e., a byte array) + data_dtype = ( + DtypeKind.UINT, + 8, + ArrowCTypes.UINT8, + Endianness.NATIVE, + ) + # Specify zero offset as we don't want to chunk the string data + data = buffer_to_ndarray(data_buff, data_dtype, offset=0, length=data_buff.bufsize) + + # Retrieve the offsets buffer containing the index offsets demarcating + # the beginning and the ending of each string + offset_buff, offset_dtype = buffers["offsets"] + # Offsets buffer contains start-stop positions of strings in the data buffer, + # meaning that it has more elements than in the data buffer, do `col.size() + 1` + # here to pass a proper offsets buffer size + offsets = buffer_to_ndarray( + offset_buff, offset_dtype, offset=col.offset, length=col.size() + 1 + ) + + null_pos = None + if null_kind in (ColumnNullType.USE_BITMASK, ColumnNullType.USE_BYTEMASK): + validity = buffers["validity"] + if validity is not None: + valid_buff, valid_dtype = validity + null_pos = buffer_to_ndarray( + valid_buff, valid_dtype, offset=col.offset, length=col.size() + ) + if sentinel_val == 0: + null_pos = ~null_pos + + # Assemble the strings from the code units + str_list: list[None | float | str] = [None] * col.size() + for i in range(col.size()): + # Check for missing values + if null_pos is not None and null_pos[i]: + str_list[i] = np.nan + continue + + # Extract a range of code units + units = data[offsets[i] : offsets[i + 1]] + + # Convert the list of code units to bytes + str_bytes = bytes(units) + + # Create the string + string = str_bytes.decode(encoding="utf-8") + + # Add to our list of strings + str_list[i] = string + + if using_string_dtype(): + res = pd.Series(str_list, dtype="str") + else: + res = np.asarray(str_list, dtype="object") # type: ignore[assignment] + + return res, buffers # type: ignore[return-value] + + +def parse_datetime_format_str(format_str, data) -> pd.Series | np.ndarray: + """Parse datetime `format_str` to interpret the `data`.""" + # timestamp 'ts{unit}:tz' + timestamp_meta = re.match(r"ts([smun]):(.*)", format_str) + if timestamp_meta: + unit, tz = timestamp_meta.group(1), timestamp_meta.group(2) + if unit != "s": + # the format string describes only a first letter of the unit, so + # add one extra letter to convert the unit to numpy-style: + # 'm' -> 'ms', 'u' -> 'us', 'n' -> 'ns' + unit += "s" + data = data.astype(f"datetime64[{unit}]") + if tz != "": + data = pd.Series(data).dt.tz_localize("UTC").dt.tz_convert(tz) + return data + + # date 'td{Days/Ms}' + date_meta = re.match(r"td([Dm])", format_str) + if date_meta: + unit = date_meta.group(1) + if unit == "D": + # NumPy doesn't support DAY unit, so converting days to seconds + # (converting to uint64 to avoid overflow) + data = (data.astype(np.uint64) * (24 * 60 * 60)).astype("datetime64[s]") + elif unit == "m": + data = data.astype("datetime64[ms]") + else: + raise NotImplementedError(f"Date unit is not supported: {unit}") + return data + + raise NotImplementedError(f"DateTime kind is not supported: {format_str}") + + +def datetime_column_to_ndarray(col: Column) -> tuple[np.ndarray | pd.Series, Any]: + """ + Convert a column holding DateTime data to a NumPy array. + + Parameters + ---------- + col : Column + + Returns + ------- + tuple + Tuple of np.ndarray holding the data and the memory owner object + that keeps the memory alive. + """ + buffers = col.get_buffers() + + _, col_bit_width, format_str, _ = col.dtype + dbuf, _ = buffers["data"] + # Consider dtype being `uint` to get number of units passed since the 01.01.1970 + + data = buffer_to_ndarray( + dbuf, + ( + DtypeKind.INT, + col_bit_width, + getattr(ArrowCTypes, f"INT{col_bit_width}"), + Endianness.NATIVE, + ), + offset=col.offset, + length=col.size(), + ) + + data = parse_datetime_format_str(format_str, data) # type: ignore[assignment] + data = set_nulls(data, col, buffers["validity"]) + return data, buffers + + +def buffer_to_ndarray( + buffer: Buffer, + dtype: tuple[DtypeKind, int, str, str], + *, + length: int, + offset: int = 0, +) -> np.ndarray: + """ + Build a NumPy array from the passed buffer. + + Parameters + ---------- + buffer : Buffer + Buffer to build a NumPy array from. + dtype : tuple + Data type of the buffer conforming protocol dtypes format. + offset : int, default: 0 + Number of elements to offset from the start of the buffer. + length : int, optional + If the buffer is a bit-mask, specifies a number of bits to read + from the buffer. Has no effect otherwise. + + Returns + ------- + np.ndarray + + Notes + ----- + The returned array doesn't own the memory. The caller of this function is + responsible for keeping the memory owner object alive as long as + the returned NumPy array is being used. + """ + kind, bit_width, _, _ = dtype + + column_dtype = _NP_DTYPES.get(kind, {}).get(bit_width, None) + if column_dtype is None: + raise NotImplementedError(f"Conversion for {dtype} is not yet supported.") + + # TODO: No DLPack yet, so need to construct a new ndarray from the data pointer + # and size in the buffer plus the dtype on the column. Use DLPack as NumPy supports + # it since https://github.com/numpy/numpy/pull/19083 + ctypes_type = np.ctypeslib.as_ctypes_type(column_dtype) + + if bit_width == 1: + assert length is not None, "`length` must be specified for a bit-mask buffer." + pa = import_optional_dependency("pyarrow") + arr = pa.BooleanArray.from_buffers( + pa.bool_(), + length, + [None, pa.foreign_buffer(buffer.ptr, length)], + offset=offset, + ) + return np.asarray(arr) + else: + data_pointer = ctypes.cast( + buffer.ptr + (offset * bit_width // 8), ctypes.POINTER(ctypes_type) + ) + if length > 0: + return np.ctypeslib.as_array(data_pointer, shape=(length,)) + return np.array([], dtype=ctypes_type) + + +def set_nulls( + data: np.ndarray | pd.Series, + col: Column, + validity: tuple[Buffer, tuple[DtypeKind, int, str, str]] | None, + allow_modify_inplace: bool = True, +): + """ + Set null values for the data according to the column null kind. + + Parameters + ---------- + data : np.ndarray or pd.Series + Data to set nulls in. + col : Column + Column object that describes the `data`. + validity : tuple(Buffer, dtype) or None + The return value of ``col.buffers()``. We do not access the ``col.buffers()`` + here to not take the ownership of the memory of buffer objects. + allow_modify_inplace : bool, default: True + Whether to modify the `data` inplace when zero-copy is possible (True) or always + modify a copy of the `data` (False). + + Returns + ------- + np.ndarray or pd.Series + Data with the nulls being set. + """ + if validity is None: + return data + null_kind, sentinel_val = col.describe_null + null_pos = None + + if null_kind == ColumnNullType.USE_SENTINEL: + null_pos = pd.Series(data) == sentinel_val + elif null_kind in (ColumnNullType.USE_BITMASK, ColumnNullType.USE_BYTEMASK): + assert validity, "Expected to have a validity buffer for the mask" + valid_buff, valid_dtype = validity + null_pos = buffer_to_ndarray( + valid_buff, valid_dtype, offset=col.offset, length=col.size() + ) + if sentinel_val == 0: + null_pos = ~null_pos + elif null_kind in (ColumnNullType.NON_NULLABLE, ColumnNullType.USE_NAN): + pass + else: + raise NotImplementedError(f"Null kind {null_kind} is not yet supported.") + + if null_pos is not None and np.any(null_pos): + if not allow_modify_inplace: + data = data.copy() + try: + data[null_pos] = None + except TypeError: + # TypeError happens if the `data` dtype appears to be non-nullable + # in numpy notation (bool, int, uint). If this happens, + # cast the `data` to nullable float dtype. + data = data.astype(float) + data[null_pos] = None + except SettingWithCopyError: + # `SettingWithCopyError` may happen for datetime-like with missing values. + data = data.copy() + data[null_pos] = None + + return data diff --git a/shared/package-files/9b/9b66f7e1cf75ec85b9a3e43fe936081e5b0af6549494d8b2ac84d3507ff3c1ec/blob b/shared/package-files/9b/9b66f7e1cf75ec85b9a3e43fe936081e5b0af6549494d8b2ac84d3507ff3c1ec/blob new file mode 100644 index 0000000000000000000000000000000000000000..ee511ff20d73bb245fe7ae0c1fc31a41c33e7d29 --- /dev/null +++ b/shared/package-files/9b/9b66f7e1cf75ec85b9a3e43fe936081e5b0af6549494d8b2ac84d3507ff3c1ec/blob @@ -0,0 +1,353 @@ +"""This is invoked in a subprocess to call the build backend hooks. + +It expects: +- Command line args: hook_name, control_dir +- Environment variables: + PEP517_BUILD_BACKEND=entry.point:spec + PEP517_BACKEND_PATH=paths (separated with os.pathsep) +- control_dir/input.json: + - {"kwargs": {...}} + +Results: +- control_dir/output.json + - {"return_val": ...} +""" +import json +import os +import os.path +import re +import shutil +import sys +import traceback +from glob import glob +from importlib import import_module +from os.path import join as pjoin + +# This file is run as a script, and `import wrappers` is not zip-safe, so we +# include write_json() and read_json() from wrappers.py. + + +def write_json(obj, path, **kwargs): + with open(path, 'w', encoding='utf-8') as f: + json.dump(obj, f, **kwargs) + + +def read_json(path): + with open(path, encoding='utf-8') as f: + return json.load(f) + + +class BackendUnavailable(Exception): + """Raised if we cannot import the backend""" + def __init__(self, traceback): + self.traceback = traceback + + +class BackendInvalid(Exception): + """Raised if the backend is invalid""" + def __init__(self, message): + self.message = message + + +class HookMissing(Exception): + """Raised if a hook is missing and we are not executing the fallback""" + def __init__(self, hook_name=None): + super().__init__(hook_name) + self.hook_name = hook_name + + +def contained_in(filename, directory): + """Test if a file is located within the given directory.""" + filename = os.path.normcase(os.path.abspath(filename)) + directory = os.path.normcase(os.path.abspath(directory)) + return os.path.commonprefix([filename, directory]) == directory + + +def _build_backend(): + """Find and load the build backend""" + # Add in-tree backend directories to the front of sys.path. + backend_path = os.environ.get('PEP517_BACKEND_PATH') + if backend_path: + extra_pathitems = backend_path.split(os.pathsep) + sys.path[:0] = extra_pathitems + + ep = os.environ['PEP517_BUILD_BACKEND'] + mod_path, _, obj_path = ep.partition(':') + try: + obj = import_module(mod_path) + except ImportError: + raise BackendUnavailable(traceback.format_exc()) + + if backend_path: + if not any( + contained_in(obj.__file__, path) + for path in extra_pathitems + ): + raise BackendInvalid("Backend was not loaded from backend-path") + + if obj_path: + for path_part in obj_path.split('.'): + obj = getattr(obj, path_part) + return obj + + +def _supported_features(): + """Return the list of options features supported by the backend. + + Returns a list of strings. + The only possible value is 'build_editable'. + """ + backend = _build_backend() + features = [] + if hasattr(backend, "build_editable"): + features.append("build_editable") + return features + + +def get_requires_for_build_wheel(config_settings): + """Invoke the optional get_requires_for_build_wheel hook + + Returns [] if the hook is not defined. + """ + backend = _build_backend() + try: + hook = backend.get_requires_for_build_wheel + except AttributeError: + return [] + else: + return hook(config_settings) + + +def get_requires_for_build_editable(config_settings): + """Invoke the optional get_requires_for_build_editable hook + + Returns [] if the hook is not defined. + """ + backend = _build_backend() + try: + hook = backend.get_requires_for_build_editable + except AttributeError: + return [] + else: + return hook(config_settings) + + +def prepare_metadata_for_build_wheel( + metadata_directory, config_settings, _allow_fallback): + """Invoke optional prepare_metadata_for_build_wheel + + Implements a fallback by building a wheel if the hook isn't defined, + unless _allow_fallback is False in which case HookMissing is raised. + """ + backend = _build_backend() + try: + hook = backend.prepare_metadata_for_build_wheel + except AttributeError: + if not _allow_fallback: + raise HookMissing() + else: + return hook(metadata_directory, config_settings) + # fallback to build_wheel outside the try block to avoid exception chaining + # which can be confusing to users and is not relevant + whl_basename = backend.build_wheel(metadata_directory, config_settings) + return _get_wheel_metadata_from_wheel(whl_basename, metadata_directory, + config_settings) + + +def prepare_metadata_for_build_editable( + metadata_directory, config_settings, _allow_fallback): + """Invoke optional prepare_metadata_for_build_editable + + Implements a fallback by building an editable wheel if the hook isn't + defined, unless _allow_fallback is False in which case HookMissing is + raised. + """ + backend = _build_backend() + try: + hook = backend.prepare_metadata_for_build_editable + except AttributeError: + if not _allow_fallback: + raise HookMissing() + try: + build_hook = backend.build_editable + except AttributeError: + raise HookMissing(hook_name='build_editable') + else: + whl_basename = build_hook(metadata_directory, config_settings) + return _get_wheel_metadata_from_wheel(whl_basename, + metadata_directory, + config_settings) + else: + return hook(metadata_directory, config_settings) + + +WHEEL_BUILT_MARKER = 'PEP517_ALREADY_BUILT_WHEEL' + + +def _dist_info_files(whl_zip): + """Identify the .dist-info folder inside a wheel ZipFile.""" + res = [] + for path in whl_zip.namelist(): + m = re.match(r'[^/\\]+-[^/\\]+\.dist-info/', path) + if m: + res.append(path) + if res: + return res + raise Exception("No .dist-info folder found in wheel") + + +def _get_wheel_metadata_from_wheel( + whl_basename, metadata_directory, config_settings): + """Extract the metadata from a wheel. + + Fallback for when the build backend does not + define the 'get_wheel_metadata' hook. + """ + from zipfile import ZipFile + with open(os.path.join(metadata_directory, WHEEL_BUILT_MARKER), 'wb'): + pass # Touch marker file + + whl_file = os.path.join(metadata_directory, whl_basename) + with ZipFile(whl_file) as zipf: + dist_info = _dist_info_files(zipf) + zipf.extractall(path=metadata_directory, members=dist_info) + return dist_info[0].split('/')[0] + + +def _find_already_built_wheel(metadata_directory): + """Check for a wheel already built during the get_wheel_metadata hook. + """ + if not metadata_directory: + return None + metadata_parent = os.path.dirname(metadata_directory) + if not os.path.isfile(pjoin(metadata_parent, WHEEL_BUILT_MARKER)): + return None + + whl_files = glob(os.path.join(metadata_parent, '*.whl')) + if not whl_files: + print('Found wheel built marker, but no .whl files') + return None + if len(whl_files) > 1: + print('Found multiple .whl files; unspecified behaviour. ' + 'Will call build_wheel.') + return None + + # Exactly one .whl file + return whl_files[0] + + +def build_wheel(wheel_directory, config_settings, metadata_directory=None): + """Invoke the mandatory build_wheel hook. + + If a wheel was already built in the + prepare_metadata_for_build_wheel fallback, this + will copy it rather than rebuilding the wheel. + """ + prebuilt_whl = _find_already_built_wheel(metadata_directory) + if prebuilt_whl: + shutil.copy2(prebuilt_whl, wheel_directory) + return os.path.basename(prebuilt_whl) + + return _build_backend().build_wheel(wheel_directory, config_settings, + metadata_directory) + + +def build_editable(wheel_directory, config_settings, metadata_directory=None): + """Invoke the optional build_editable hook. + + If a wheel was already built in the + prepare_metadata_for_build_editable fallback, this + will copy it rather than rebuilding the wheel. + """ + backend = _build_backend() + try: + hook = backend.build_editable + except AttributeError: + raise HookMissing() + else: + prebuilt_whl = _find_already_built_wheel(metadata_directory) + if prebuilt_whl: + shutil.copy2(prebuilt_whl, wheel_directory) + return os.path.basename(prebuilt_whl) + + return hook(wheel_directory, config_settings, metadata_directory) + + +def get_requires_for_build_sdist(config_settings): + """Invoke the optional get_requires_for_build_wheel hook + + Returns [] if the hook is not defined. + """ + backend = _build_backend() + try: + hook = backend.get_requires_for_build_sdist + except AttributeError: + return [] + else: + return hook(config_settings) + + +class _DummyException(Exception): + """Nothing should ever raise this exception""" + + +class GotUnsupportedOperation(Exception): + """For internal use when backend raises UnsupportedOperation""" + def __init__(self, traceback): + self.traceback = traceback + + +def build_sdist(sdist_directory, config_settings): + """Invoke the mandatory build_sdist hook.""" + backend = _build_backend() + try: + return backend.build_sdist(sdist_directory, config_settings) + except getattr(backend, 'UnsupportedOperation', _DummyException): + raise GotUnsupportedOperation(traceback.format_exc()) + + +HOOK_NAMES = { + 'get_requires_for_build_wheel', + 'prepare_metadata_for_build_wheel', + 'build_wheel', + 'get_requires_for_build_editable', + 'prepare_metadata_for_build_editable', + 'build_editable', + 'get_requires_for_build_sdist', + 'build_sdist', + '_supported_features', +} + + +def main(): + if len(sys.argv) < 3: + sys.exit("Needs args: hook_name, control_dir") + hook_name = sys.argv[1] + control_dir = sys.argv[2] + if hook_name not in HOOK_NAMES: + sys.exit("Unknown hook: %s" % hook_name) + hook = globals()[hook_name] + + hook_input = read_json(pjoin(control_dir, 'input.json')) + + json_out = {'unsupported': False, 'return_val': None} + try: + json_out['return_val'] = hook(**hook_input['kwargs']) + except BackendUnavailable as e: + json_out['no_backend'] = True + json_out['traceback'] = e.traceback + except BackendInvalid as e: + json_out['backend_invalid'] = True + json_out['backend_error'] = e.message + except GotUnsupportedOperation as e: + json_out['unsupported'] = True + json_out['traceback'] = e.traceback + except HookMissing as e: + json_out['hook_missing'] = True + json_out['missing_hook_name'] = e.hook_name or hook_name + + write_json(json_out, pjoin(control_dir, 'output.json'), indent=2) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/9b/9b6742f1d21425a930997735c01c838096af851948a118f4923bade4c777e9e7/blob b/shared/package-files/9b/9b6742f1d21425a930997735c01c838096af851948a118f4923bade4c777e9e7/blob new file mode 100644 index 0000000000000000000000000000000000000000..e139801693bb40534468e6913afea195aa40b8fd --- /dev/null +++ b/shared/package-files/9b/9b6742f1d21425a930997735c01c838096af851948a118f4923bade4c777e9e7/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor _upsample_bilinear2d_aa(const at::Tensor & input, at::OptionalIntArrayRef output_size, bool align_corners, c10::optional> scale_factors); +TORCH_API at::Tensor _upsample_bilinear2d_aa_symint(const at::Tensor & input, at::OptionalSymIntArrayRef output_size, bool align_corners, c10::optional> scale_factors); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9b/9b6cdb3f80bbf7a16f415b15566b175028b3f0fae3d8efa94f9e6b6c70363700/blob b/shared/package-files/9b/9b6cdb3f80bbf7a16f415b15566b175028b3f0fae3d8efa94f9e6b6c70363700/blob new file mode 100644 index 0000000000000000000000000000000000000000..90e4910e96a347215d587d879bdcee0f52ffbb9f --- /dev/null +++ b/shared/package-files/9b/9b6cdb3f80bbf7a16f415b15566b175028b3f0fae3d8efa94f9e6b6c70363700/blob @@ -0,0 +1,25 @@ +#pragma once + +#include + +// @generated from ../tools/autograd/templates/python_functions.h + +// Python bindings for automatically generated autograd functions + +namespace torch { namespace autograd { namespace generated { + +void initialize_autogenerated_functions_0(PyObject* module); +void initialize_autogenerated_functions_1(PyObject* module); +void initialize_autogenerated_functions_2(PyObject* module); +void initialize_autogenerated_functions_3(PyObject* module); +void initialize_autogenerated_functions_4(PyObject* module); + +inline void initialize_autogenerated_functions(PyObject* module) { + initialize_autogenerated_functions_0(module); + initialize_autogenerated_functions_1(module); + initialize_autogenerated_functions_2(module); + initialize_autogenerated_functions_3(module); + initialize_autogenerated_functions_4(module); +} + +}}} // namespace torch::autograd::generated diff --git a/shared/package-files/9b/9b6d58df002d41cfa38ba55e6fa93f33983a034672148e1e81c853767c21fa94/blob b/shared/package-files/9b/9b6d58df002d41cfa38ba55e6fa93f33983a034672148e1e81c853767c21fa94/blob new file mode 100644 index 0000000000000000000000000000000000000000..8668b3b0ec1deec2aeb7ff6bd94265d6705e05bf --- /dev/null +++ b/shared/package-files/9b/9b6d58df002d41cfa38ba55e6fa93f33983a034672148e1e81c853767c21fa94/blob @@ -0,0 +1,11 @@ +"""For when pip wants to check the date or time. +""" + +import datetime + + +def today_is_later_than(year: int, month: int, day: int) -> bool: + today = datetime.date.today() + given = datetime.date(year, month, day) + + return today > given diff --git a/shared/package-files/9b/9b6e400eb85440ec64ab66b4ac111546585740c9ca61fd156400d7153cbad9f4/blob b/shared/package-files/9b/9b6e400eb85440ec64ab66b4ac111546585740c9ca61fd156400d7153cbad9f4/blob new file mode 100644 index 0000000000000000000000000000000000000000..ef9099be5b68d29604b0af394e371b0301a78bc7 --- /dev/null +++ b/shared/package-files/9b/9b6e400eb85440ec64ab66b4ac111546585740c9ca61fd156400d7153cbad9f4/blob @@ -0,0 +1,335 @@ +# history.tcl -- +# +# Implementation of the history command. +# +# Copyright (c) 1997 Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution of +# this file, and for a DISCLAIMER OF ALL WARRANTIES. +# + +# The tcl::history array holds the history list and some additional +# bookkeeping variables. +# +# nextid the index used for the next history list item. +# keep the max size of the history list +# oldest the index of the oldest item in the history. + +namespace eval ::tcl { + variable history + if {![info exists history]} { + array set history { + nextid 0 + keep 20 + oldest -20 + } + } + + namespace ensemble create -command ::tcl::history -map { + add ::tcl::HistAdd + change ::tcl::HistChange + clear ::tcl::HistClear + event ::tcl::HistEvent + info ::tcl::HistInfo + keep ::tcl::HistKeep + nextid ::tcl::HistNextID + redo ::tcl::HistRedo + } +} + +# history -- +# +# This is the main history command. See the man page for its interface. +# This does some argument checking and calls the helper ensemble in the +# tcl namespace. + +proc ::history {args} { + # If no command given, we're doing 'history info'. Can't be done with an + # ensemble unknown handler, as those don't fire when no subcommand is + # given at all. + + if {![llength $args]} { + set args info + } + + # Tricky stuff needed to make stack and errors come out right! + tailcall apply {arglist {tailcall history {*}$arglist} ::tcl} $args +} + +# (unnamed) -- +# +# Callback when [::history] is destroyed. Destroys the implementation. +# +# Parameters: +# oldName what the command was called. +# newName what the command is now called (an empty string). +# op the operation (= delete). +# +# Results: +# none +# +# Side Effects: +# The implementation of the [::history] command ceases to exist. + +trace add command ::history delete [list apply {{oldName newName op} { + variable history + unset -nocomplain history + foreach c [info procs ::tcl::Hist*] { + rename $c {} + } + rename ::tcl::history {} +} ::tcl}] + +# tcl::HistAdd -- +# +# Add an item to the history, and optionally eval it at the global scope +# +# Parameters: +# event the command to add +# exec (optional) a substring of "exec" causes the command to +# be evaled. +# Results: +# If executing, then the results of the command are returned +# +# Side Effects: +# Adds to the history list + +proc ::tcl::HistAdd {event {exec {}}} { + variable history + + if { + [prefix longest {exec {}} $exec] eq "" + && [llength [info level 0]] == 3 + } then { + return -code error "bad argument \"$exec\": should be \"exec\"" + } + + # Do not add empty commands to the history + if {[string trim $event] eq ""} { + return "" + } + + # Maintain the history + set history([incr history(nextid)]) $event + unset -nocomplain history([incr history(oldest)]) + + # Only execute if 'exec' (or non-empty prefix of it) given + if {$exec eq ""} { + return "" + } + tailcall eval $event +} + +# tcl::HistKeep -- +# +# Set or query the limit on the length of the history list +# +# Parameters: +# limit (optional) the length of the history list +# +# Results: +# If no limit is specified, the current limit is returned +# +# Side Effects: +# Updates history(keep) if a limit is specified + +proc ::tcl::HistKeep {{count {}}} { + variable history + if {[llength [info level 0]] == 1} { + return $history(keep) + } + if {![string is integer -strict $count] || ($count < 0)} { + return -code error "illegal keep count \"$count\"" + } + set oldold $history(oldest) + set history(oldest) [expr {$history(nextid) - $count}] + for {} {$oldold <= $history(oldest)} {incr oldold} { + unset -nocomplain history($oldold) + } + set history(keep) $count +} + +# tcl::HistClear -- +# +# Erase the history list +# +# Parameters: +# none +# +# Results: +# none +# +# Side Effects: +# Resets the history array, except for the keep limit + +proc ::tcl::HistClear {} { + variable history + set keep $history(keep) + unset history + array set history [list \ + nextid 0 \ + keep $keep \ + oldest -$keep \ + ] +} + +# tcl::HistInfo -- +# +# Return a pretty-printed version of the history list +# +# Parameters: +# num (optional) the length of the history list to return +# +# Results: +# A formatted history list + +proc ::tcl::HistInfo {{count {}}} { + variable history + if {[llength [info level 0]] == 1} { + set count [expr {$history(keep) + 1}] + } elseif {![string is integer -strict $count]} { + return -code error "bad integer \"$count\"" + } + set result {} + set newline "" + for {set i [expr {$history(nextid) - $count + 1}]} \ + {$i <= $history(nextid)} {incr i} { + if {![info exists history($i)]} { + continue + } + set cmd [string map [list \n \n\t] [string trimright $history($i) \ \n]] + append result $newline[format "%6d %s" $i $cmd] + set newline \n + } + return $result +} + +# tcl::HistRedo -- +# +# Fetch the previous or specified event, execute it, and then replace +# the current history item with that event. +# +# Parameters: +# event (optional) index of history item to redo. Defaults to -1, +# which means the previous event. +# +# Results: +# Those of the command being redone. +# +# Side Effects: +# Replaces the current history list item with the one being redone. + +proc ::tcl::HistRedo {{event -1}} { + variable history + + set i [HistIndex $event] + if {$i == $history(nextid)} { + return -code error "cannot redo the current event" + } + set cmd $history($i) + HistChange $cmd 0 + tailcall eval $cmd +} + +# tcl::HistIndex -- +# +# Map from an event specifier to an index in the history list. +# +# Parameters: +# event index of history item to redo. +# If this is a positive number, it is used directly. +# If it is a negative number, then it counts back to a previous +# event, where -1 is the most recent event. +# A string can be matched, either by being the prefix of a +# command or by matching a command with string match. +# +# Results: +# The index into history, or an error if the index didn't match. + +proc ::tcl::HistIndex {event} { + variable history + if {![string is integer -strict $event]} { + for {set i [expr {$history(nextid)-1}]} {[info exists history($i)]} \ + {incr i -1} { + if {[string match $event* $history($i)]} { + return $i + } + if {[string match $event $history($i)]} { + return $i + } + } + return -code error "no event matches \"$event\"" + } elseif {$event <= 0} { + set i [expr {$history(nextid) + $event}] + } else { + set i $event + } + if {$i <= $history(oldest)} { + return -code error "event \"$event\" is too far in the past" + } + if {$i > $history(nextid)} { + return -code error "event \"$event\" hasn't occured yet" + } + return $i +} + +# tcl::HistEvent -- +# +# Map from an event specifier to the value in the history list. +# +# Parameters: +# event index of history item to redo. See index for a description of +# possible event patterns. +# +# Results: +# The value from the history list. + +proc ::tcl::HistEvent {{event -1}} { + variable history + set i [HistIndex $event] + if {![info exists history($i)]} { + return "" + } + return [string trimright $history($i) \ \n] +} + +# tcl::HistChange -- +# +# Replace a value in the history list. +# +# Parameters: +# newValue The new value to put into the history list. +# event (optional) index of history item to redo. See index for a +# description of possible event patterns. This defaults to 0, +# which specifies the current event. +# +# Side Effects: +# Changes the history list. + +proc ::tcl::HistChange {newValue {event 0}} { + variable history + set i [HistIndex $event] + set history($i) $newValue +} + +# tcl::HistNextID -- +# +# Returns the number of the next history event. +# +# Parameters: +# None. +# +# Side Effects: +# None. + +proc ::tcl::HistNextID {} { + variable history + return [expr {$history(nextid) + 1}] +} + +return + +# Local Variables: +# mode: tcl +# fill-column: 78 +# End: diff --git a/shared/package-files/9b/9b6fd8df3c9d5193733e9bbcf27f303cd5aa6b17da01330a128ff30205ccab26/blob b/shared/package-files/9b/9b6fd8df3c9d5193733e9bbcf27f303cd5aa6b17da01330a128ff30205ccab26/blob new file mode 100644 index 0000000000000000000000000000000000000000..4ab14e48c92aff0766e51afd69a875cdba81712d --- /dev/null +++ b/shared/package-files/9b/9b6fd8df3c9d5193733e9bbcf27f303cd5aa6b17da01330a128ff30205ccab26/blob @@ -0,0 +1,166 @@ +from __future__ import annotations + +import dataclasses +import inspect +from types import FunctionType +from typing import Any +from typing import final +from typing import Generic +from typing import TypeVar +import warnings + + +class PytestWarning(UserWarning): + """Base class for all warnings emitted by pytest.""" + + __module__ = "pytest" + + +@final +class PytestAssertRewriteWarning(PytestWarning): + """Warning emitted by the pytest assert rewrite module.""" + + __module__ = "pytest" + + +@final +class PytestCacheWarning(PytestWarning): + """Warning emitted by the cache plugin in various situations.""" + + __module__ = "pytest" + + +@final +class PytestConfigWarning(PytestWarning): + """Warning emitted for configuration issues.""" + + __module__ = "pytest" + + +@final +class PytestCollectionWarning(PytestWarning): + """Warning emitted when pytest is not able to collect a file or symbol in a module.""" + + __module__ = "pytest" + + +class PytestDeprecationWarning(PytestWarning, DeprecationWarning): + """Warning class for features that will be removed in a future version.""" + + __module__ = "pytest" + + +class PytestRemovedIn9Warning(PytestDeprecationWarning): + """Warning class for features that will be removed in pytest 9.""" + + __module__ = "pytest" + + +class PytestReturnNotNoneWarning(PytestWarning): + """Warning emitted when a test function is returning value other than None.""" + + __module__ = "pytest" + + +@final +class PytestExperimentalApiWarning(PytestWarning, FutureWarning): + """Warning category used to denote experiments in pytest. + + Use sparingly as the API might change or even be removed completely in a + future version. + """ + + __module__ = "pytest" + + @classmethod + def simple(cls, apiname: str) -> PytestExperimentalApiWarning: + return cls(f"{apiname} is an experimental api that may change over time") + + +@final +class PytestUnhandledCoroutineWarning(PytestReturnNotNoneWarning): + """Warning emitted for an unhandled coroutine. + + A coroutine was encountered when collecting test functions, but was not + handled by any async-aware plugin. + Coroutine test functions are not natively supported. + """ + + __module__ = "pytest" + + +@final +class PytestUnknownMarkWarning(PytestWarning): + """Warning emitted on use of unknown markers. + + See :ref:`mark` for details. + """ + + __module__ = "pytest" + + +@final +class PytestUnraisableExceptionWarning(PytestWarning): + """An unraisable exception was reported. + + Unraisable exceptions are exceptions raised in :meth:`__del__ ` + implementations and similar situations when the exception cannot be raised + as normal. + """ + + __module__ = "pytest" + + +@final +class PytestUnhandledThreadExceptionWarning(PytestWarning): + """An unhandled exception occurred in a :class:`~threading.Thread`. + + Such exceptions don't propagate normally. + """ + + __module__ = "pytest" + + +_W = TypeVar("_W", bound=PytestWarning) + + +@final +@dataclasses.dataclass +class UnformattedWarning(Generic[_W]): + """A warning meant to be formatted during runtime. + + This is used to hold warnings that need to format their message at runtime, + as opposed to a direct message. + """ + + category: type[_W] + template: str + + def format(self, **kwargs: Any) -> _W: + """Return an instance of the warning category, formatted with given kwargs.""" + return self.category(self.template.format(**kwargs)) + + +def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: + """ + Issue the warning :param:`message` for the definition of the given :param:`method` + + this helps to log warnings for functions defined prior to finding an issue with them + (like hook wrappers being marked in a legacy mechanism) + """ + lineno = method.__code__.co_firstlineno + filename = inspect.getfile(method) + module = method.__module__ + mod_globals = method.__globals__ + try: + warnings.warn_explicit( + message, + type(message), + filename=filename, + module=module, + registry=mod_globals.setdefault("__warningregistry__", {}), + lineno=lineno, + ) + except Warning as w: + # If warnings are errors (e.g. -Werror), location information gets lost, so we add it to the message. + raise type(w)(f"{w}\n at {filename}:{lineno}") from None diff --git a/shared/package-files/9b/9b717166deba6db15d053b26793d1c34c4a756495065bafecb0657dd9461794f/blob b/shared/package-files/9b/9b717166deba6db15d053b26793d1c34c4a756495065bafecb0657dd9461794f/blob new file mode 100644 index 0000000000000000000000000000000000000000..d098fdc68ca872d73ddec423aa38e4a928cacfb9 --- /dev/null +++ b/shared/package-files/9b/9b717166deba6db15d053b26793d1c34c4a756495065bafecb0657dd9461794f/blob @@ -0,0 +1,57 @@ +from .module import Module +from .. import functional as F + +from torch import Tensor + +__all__ = ['ChannelShuffle'] + +class ChannelShuffle(Module): + r"""Divides and rearranges the channels in a tensor. + + This operation divides the channels in a tensor of shape :math:`(*, C , H, W)` + into g groups and rearranges them as :math:`(*, \frac{C}{g}, g, H, W)`, + while keeping the original tensor shape. + + Args: + groups (int): number of groups to divide channels in. + + Examples:: + + >>> # xdoctest: +IGNORE_WANT("FIXME: incorrect want") + >>> channel_shuffle = nn.ChannelShuffle(2) + >>> input = torch.randn(1, 4, 2, 2) + >>> print(input) + [[[[1, 2], + [3, 4]], + [[5, 6], + [7, 8]], + [[9, 10], + [11, 12]], + [[13, 14], + [15, 16]], + ]] + >>> output = channel_shuffle(input) + >>> print(output) + [[[[1, 2], + [3, 4]], + [[9, 10], + [11, 12]], + [[5, 6], + [7, 8]], + [[13, 14], + [15, 16]], + ]] + """ + + __constants__ = ['groups'] + groups: int + + def __init__(self, groups: int) -> None: + super().__init__() + self.groups = groups + + def forward(self, input: Tensor) -> Tensor: + return F.channel_shuffle(input, self.groups) + + def extra_repr(self) -> str: + return f'groups={self.groups}' diff --git a/shared/package-files/9b/9b7207dba4c2ccb0e94bc72dbf324a2c0f31e35e2eaf98e55f7b1d4f8b01e26f/blob b/shared/package-files/9b/9b7207dba4c2ccb0e94bc72dbf324a2c0f31e35e2eaf98e55f7b1d4f8b01e26f/blob new file mode 100644 index 0000000000000000000000000000000000000000..62582b212eb387c94b095ca54029f971dc54e777 --- /dev/null +++ b/shared/package-files/9b/9b7207dba4c2ccb0e94bc72dbf324a2c0f31e35e2eaf98e55f7b1d4f8b01e26f/blob @@ -0,0 +1,50 @@ +from collections.abc import Generator +from contextlib import contextmanager +import pathlib +import tempfile + +import pytest + +from pandas.io.pytables import HDFStore + +tables = pytest.importorskip("tables") +# set these parameters so we don't have file sharing +tables.parameters.MAX_NUMEXPR_THREADS = 1 +tables.parameters.MAX_BLOSC_THREADS = 1 +tables.parameters.MAX_THREADS = 1 + + +def safe_close(store): + try: + if store is not None: + store.close() + except OSError: + pass + + +# contextmanager to ensure the file cleanup +@contextmanager +def ensure_clean_store( + path, mode="a", complevel=None, complib=None, fletcher32=False +) -> Generator[HDFStore, None, None]: + with tempfile.TemporaryDirectory() as tmpdirname: + tmp_path = pathlib.Path(tmpdirname, path) + with HDFStore( + tmp_path, + mode=mode, + complevel=complevel, + complib=complib, + fletcher32=fletcher32, + ) as store: + yield store + + +def _maybe_remove(store, key): + """ + For tests using tables, try removing the table to be sure there is + no content from previous tests using the same table name. + """ + try: + store.remove(key) + except (ValueError, KeyError): + pass diff --git a/shared/package-files/9b/9b72799855182eb383e06337a6fb5c8a9e01872fcdf9c1e1adcb01a3915657a7/blob b/shared/package-files/9b/9b72799855182eb383e06337a6fb5c8a9e01872fcdf9c1e1adcb01a3915657a7/blob new file mode 100644 index 0000000000000000000000000000000000000000..dae7711ba7a43506d4db9fec94a932baf302dd6f --- /dev/null +++ b/shared/package-files/9b/9b72799855182eb383e06337a6fb5c8a9e01872fcdf9c1e1adcb01a3915657a7/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_upsample_trilinear3d : public at::impl::MetaBase { + + + void meta(const at::Tensor & self, at::ArrayRef output_size, bool align_corners, c10::optional scales_d, c10::optional scales_h, c10::optional scales_w); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/9b/9b73f686d2ddb70d184f449d22d666b0a1ea63797ad578875be8245c4efa817e/blob b/shared/package-files/9b/9b73f686d2ddb70d184f449d22d666b0a1ea63797ad578875be8245c4efa817e/blob new file mode 100644 index 0000000000000000000000000000000000000000..4bf37499644f4b01ae16001d2ae8b90d4ebd8c53 --- /dev/null +++ b/shared/package-files/9b/9b73f686d2ddb70d184f449d22d666b0a1ea63797ad578875be8245c4efa817e/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b73f686d2ddb70d184f449d22d666b0a1ea63797ad578875be8245c4efa817e +size 831312 diff --git a/shared/package-files/9b/9b754b17f8c1e4f6d11f3ae7c0f25b6bfcfb78c73ce79016075e681189215e73/blob b/shared/package-files/9b/9b754b17f8c1e4f6d11f3ae7c0f25b6bfcfb78c73ce79016075e681189215e73/blob new file mode 100644 index 0000000000000000000000000000000000000000..296bea9a2405dda5109861ede57bd6ba067756ae --- /dev/null +++ b/shared/package-files/9b/9b754b17f8c1e4f6d11f3ae7c0f25b6bfcfb78c73ce79016075e681189215e73/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API avg_pool1d { + using schema = at::Tensor (const at::Tensor &, at::IntArrayRef, at::IntArrayRef, at::IntArrayRef, bool, bool); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::avg_pool1d") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "avg_pool1d(Tensor self, int[1] kernel_size, int[1] stride=[], int[1] padding=0, bool ceil_mode=False, bool count_include_pad=True) -> Tensor") + static at::Tensor call(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9b/9b75f170af5486c48214aefebeb394eb3b67f9e69e5ca2ee4bc74ff3c418eb3c/blob b/shared/package-files/9b/9b75f170af5486c48214aefebeb394eb3b67f9e69e5ca2ee4bc74ff3c418eb3c/blob new file mode 100644 index 0000000000000000000000000000000000000000..ad6d737ddf444c42933a882ed1e520a9c0be6bb2 --- /dev/null +++ b/shared/package-files/9b/9b75f170af5486c48214aefebeb394eb3b67f9e69e5ca2ee4bc74ff3c418eb3c/blob @@ -0,0 +1,480 @@ +from functools import lru_cache +from typing import Optional, List + +from charset_normalizer.constant import UNICODE_SECONDARY_RANGE_KEYWORD +from charset_normalizer.utils import is_punctuation, is_symbol, unicode_range, is_accentuated, is_latin, \ + remove_accent, is_separator, is_cjk, is_case_variable, is_hangul, is_katakana, is_hiragana, is_ascii, is_thai + + +class MessDetectorPlugin: + """ + Base abstract class used for mess detection plugins. + All detectors MUST extend and implement given methods. + """ + + def eligible(self, character: str) -> bool: + """ + Determine if given character should be fed in. + """ + raise NotImplementedError # pragma: nocover + + def feed(self, character: str) -> None: + """ + The main routine to be executed upon character. + Insert the logic in witch the text would be considered chaotic. + """ + raise NotImplementedError # pragma: nocover + + def reset(self) -> None: + """ + Permit to reset the plugin to the initial state. + """ + raise NotImplementedError # pragma: nocover + + @property + def ratio(self) -> float: + """ + Compute the chaos ratio based on what your feed() has seen. + Must NOT be lower than 0.; No restriction gt 0. + """ + raise NotImplementedError # pragma: nocover + + +class TooManySymbolOrPunctuationPlugin(MessDetectorPlugin): + + def __init__(self): + self._punctuation_count = 0 # type: int + self._symbol_count = 0 # type: int + self._character_count = 0 # type: int + + self._last_printable_char = None # type: Optional[str] + self._frenzy_symbol_in_word = False # type: bool + + def eligible(self, character: str) -> bool: + return character.isprintable() + + def feed(self, character: str) -> None: + self._character_count += 1 + + if character != self._last_printable_char and character not in ["<", ">", "=", ":", "/", "&", ";", "{", "}", "[", "]", ",", "|", '"']: + if is_punctuation(character): + self._punctuation_count += 1 + elif character.isdigit() is False and is_symbol(character): + self._symbol_count += 2 + + self._last_printable_char = character + + def reset(self) -> None: + self._punctuation_count = 0 + self._character_count = 0 + self._symbol_count = 0 + + @property + def ratio(self) -> float: + if self._character_count == 0: + return 0. + + ratio_of_punctuation = (self._punctuation_count + self._symbol_count) / self._character_count # type: float + + return ratio_of_punctuation if ratio_of_punctuation >= 0.3 else 0. + + +class TooManyAccentuatedPlugin(MessDetectorPlugin): + + def __init__(self): + self._character_count = 0 # type: int + self._accentuated_count = 0 # type: int + + def eligible(self, character: str) -> bool: + return character.isalpha() + + def feed(self, character: str) -> None: + self._character_count += 1 + + if is_accentuated(character): + self._accentuated_count += 1 + + def reset(self) -> None: + self._character_count = 0 + self._accentuated_count = 0 + + @property + def ratio(self) -> float: + if self._character_count == 0: + return 0. + ratio_of_accentuation = self._accentuated_count / self._character_count # type: float + return ratio_of_accentuation if ratio_of_accentuation >= 0.35 else 0. + + +class UnprintablePlugin(MessDetectorPlugin): + + def __init__(self): + self._unprintable_count = 0 # type: int + self._character_count = 0 # type: int + + def eligible(self, character: str) -> bool: + return True + + def feed(self, character: str) -> None: + if character not in {'\n', '\t', '\r', '\v'} and character.isprintable() is False: + self._unprintable_count += 1 + self._character_count += 1 + + def reset(self) -> None: + self._unprintable_count = 0 + + @property + def ratio(self) -> float: + if self._character_count == 0: + return 0. + + return (self._unprintable_count * 8) / self._character_count + + +class SuspiciousDuplicateAccentPlugin(MessDetectorPlugin): + + def __init__(self): + self._successive_count = 0 # type: int + self._character_count = 0 # type: int + + self._last_latin_character = None # type: Optional[str] + + def eligible(self, character: str) -> bool: + return character.isalpha() and is_latin(character) + + def feed(self, character: str) -> None: + self._character_count += 1 + if self._last_latin_character is not None: + if is_accentuated(character) and is_accentuated(self._last_latin_character): + if character.isupper() and self._last_latin_character.isupper(): + self._successive_count += 1 + # Worse if its the same char duplicated with different accent. + if remove_accent(character) == remove_accent(self._last_latin_character): + self._successive_count += 1 + self._last_latin_character = character + + def reset(self) -> None: + self._successive_count = 0 + self._character_count = 0 + self._last_latin_character = None + + @property + def ratio(self) -> float: + if self._character_count == 0: + return 0. + + return (self._successive_count * 2) / self._character_count + + +class SuspiciousRange(MessDetectorPlugin): + + def __init__(self): + self._suspicious_successive_range_count = 0 # type: int + self._character_count = 0 # type: int + self._last_printable_seen = None # type: Optional[str] + + def eligible(self, character: str) -> bool: + return character.isprintable() + + def feed(self, character: str) -> None: + self._character_count += 1 + + if character.isspace() or is_punctuation(character): + self._last_printable_seen = None + return + + if self._last_printable_seen is None: + self._last_printable_seen = character + return + + unicode_range_a = unicode_range(self._last_printable_seen) # type: Optional[str] + unicode_range_b = unicode_range(character) # type: Optional[str] + + if is_suspiciously_successive_range(unicode_range_a, unicode_range_b): + self._suspicious_successive_range_count += 1 + + self._last_printable_seen = character + + def reset(self) -> None: + self._character_count = 0 + self._suspicious_successive_range_count = 0 + self._last_printable_seen = None + + @property + def ratio(self) -> float: + if self._character_count == 0: + return 0. + + ratio_of_suspicious_range_usage = (self._suspicious_successive_range_count * 2) / self._character_count # type: float + + if ratio_of_suspicious_range_usage < 0.1: + return 0. + + return ratio_of_suspicious_range_usage + + +class SuperWeirdWordPlugin(MessDetectorPlugin): + + def __init__(self): + self._word_count = 0 # type: int + self._bad_word_count = 0 # type: int + self._is_current_word_bad = False # type: bool + self._foreign_long_watch = False # type: bool + + self._character_count = 0 # type: int + self._bad_character_count = 0 # type: int + + self._buffer = "" # type: str + self._buffer_accent_count = 0 # type: int + + def eligible(self, character: str) -> bool: + return True + + def feed(self, character: str) -> None: + if character.isalpha(): + self._buffer = "".join([self._buffer, character]) + if is_accentuated(character): + self._buffer_accent_count += 1 + if self._foreign_long_watch is False and is_latin(character) is False and is_cjk(character) is False and is_hangul(character) is False and is_katakana(character) is False and is_hiragana(character) is False and is_thai(character) is False: + self._foreign_long_watch = True + return + if not self._buffer: + return + if (character.isspace() or is_punctuation(character) or is_separator(character)) and self._buffer: + self._word_count += 1 + buffer_length = len(self._buffer) # type: int + + self._character_count += buffer_length + + if buffer_length >= 4 and self._buffer_accent_count / buffer_length >= 0.3: + self._is_current_word_bad = True + if buffer_length >= 24 and self._foreign_long_watch: + self._is_current_word_bad = True + + if self._is_current_word_bad: + self._bad_word_count += 1 + self._bad_character_count += len(self._buffer) + self._is_current_word_bad = False + + self._foreign_long_watch = False + self._buffer = "" + self._buffer_accent_count = 0 + elif character not in {"<", ">", "-", "="} and character.isdigit() is False and is_symbol(character): + self._is_current_word_bad = True + self._buffer += character + + def reset(self) -> None: + self._buffer = "" + self._is_current_word_bad = False + self._foreign_long_watch = False + self._bad_word_count = 0 + self._word_count = 0 + self._character_count = 0 + self._bad_character_count = 0 + + @property + def ratio(self) -> float: + if self._word_count <= 10: + return 0. + + return self._bad_character_count / self._character_count + + +class CjkInvalidStopPlugin(MessDetectorPlugin): + """ + GB(Chinese) based encoding often render the stop incorrectly when the content does not fit and can be easily detected. + Searching for the overuse of '丅' and '丄'. + """ + + def __init__(self): + self._wrong_stop_count = 0 # type: int + self._cjk_character_count = 0 # type: int + + def eligible(self, character: str) -> bool: + return True + + def feed(self, character: str) -> None: + if character in ["丅", "丄"]: + self._wrong_stop_count += 1 + return + if is_cjk(character): + self._cjk_character_count += 1 + + def reset(self) -> None: + self._wrong_stop_count = 0 + self._cjk_character_count = 0 + + @property + def ratio(self) -> float: + if self._cjk_character_count < 16: + return 0. + return self._wrong_stop_count / self._cjk_character_count + + +class ArchaicUpperLowerPlugin(MessDetectorPlugin): + + def __init__(self): + self._buf = False # type: bool + + self._character_count_since_last_sep = 0 # type: int + + self._successive_upper_lower_count = 0 # type: int + self._successive_upper_lower_count_final = 0 # type: int + + self._character_count = 0 # type: int + + self._last_alpha_seen = None # type: Optional[str] + self._current_ascii_only = True # type: bool + + def eligible(self, character: str) -> bool: + return True + + def feed(self, character: str) -> None: + is_concerned = character.isalpha() and is_case_variable(character) + chunk_sep = is_concerned is False + + if chunk_sep and self._character_count_since_last_sep > 0: + if self._character_count_since_last_sep <= 64 and character.isdigit() is False and self._current_ascii_only is False: + self._successive_upper_lower_count_final += self._successive_upper_lower_count + + self._successive_upper_lower_count = 0 + self._character_count_since_last_sep = 0 + self._last_alpha_seen = None + self._buf = False + self._character_count += 1 + self._current_ascii_only = True + + return + + if self._current_ascii_only is True and is_ascii(character) is False: + self._current_ascii_only = False + + if self._last_alpha_seen is not None: + if (character.isupper() and self._last_alpha_seen.islower()) or (character.islower() and self._last_alpha_seen.isupper()): + if self._buf is True: + self._successive_upper_lower_count += 2 + self._buf = False + else: + self._buf = True + else: + self._buf = False + + self._character_count += 1 + self._character_count_since_last_sep += 1 + self._last_alpha_seen = character + + def reset(self) -> None: + self._character_count = 0 + self._character_count_since_last_sep = 0 + self._successive_upper_lower_count = 0 + self._successive_upper_lower_count_final = 0 + self._last_alpha_seen = None + self._buf = False + self._current_ascii_only = True + + @property + def ratio(self) -> float: + if self._character_count == 0: + return 0. + + return self._successive_upper_lower_count_final / self._character_count + + +def is_suspiciously_successive_range(unicode_range_a: Optional[str], unicode_range_b: Optional[str]) -> bool: + """ + Determine if two Unicode range seen next to each other can be considered as suspicious. + """ + if unicode_range_a is None or unicode_range_b is None: + return True + + if unicode_range_a == unicode_range_b: + return False + + if "Latin" in unicode_range_a and "Latin" in unicode_range_b: + return False + + if "Emoticons" in unicode_range_a or "Emoticons" in unicode_range_b: + return False + + keywords_range_a, keywords_range_b = unicode_range_a.split(" "), unicode_range_b.split(" ") + + for el in keywords_range_a: + if el in UNICODE_SECONDARY_RANGE_KEYWORD: + continue + if el in keywords_range_b: + return False + + # Japanese Exception + if unicode_range_a in ['Katakana', 'Hiragana'] and unicode_range_b in ['Katakana', 'Hiragana']: + return False + + if unicode_range_a in ['Katakana', 'Hiragana'] or unicode_range_b in ['Katakana', 'Hiragana']: + if "CJK" in unicode_range_a or "CJK" in unicode_range_b: + return False + + if "Hangul" in unicode_range_a or "Hangul" in unicode_range_b: + if "CJK" in unicode_range_a or "CJK" in unicode_range_b: + return False + if unicode_range_a == "Basic Latin" or unicode_range_b == "Basic Latin": + return False + + # Chinese/Japanese use dedicated range for punctuation and/or separators. + if ('CJK' in unicode_range_a or 'CJK' in unicode_range_b) or (unicode_range_a in ['Katakana', 'Hiragana'] and unicode_range_b in ['Katakana', 'Hiragana']): + if 'Punctuation' in unicode_range_a or 'Punctuation' in unicode_range_b: + return False + if 'Forms' in unicode_range_a or 'Forms' in unicode_range_b: + return False + + return True + + +@lru_cache(maxsize=2048) +def mess_ratio(decoded_sequence: str, maximum_threshold: float = 0.2, debug: bool = False) -> float: + """ + Compute a mess ratio given a decoded bytes sequence. The maximum threshold does stop the computation earlier. + """ + detectors = [] # type: List[MessDetectorPlugin] + + for md_class in MessDetectorPlugin.__subclasses__(): + detectors.append( + md_class() + ) + + length = len(decoded_sequence) # type: int + + mean_mess_ratio = 0. # type: float + + if length < 512: + intermediary_mean_mess_ratio_calc = 32 # type: int + elif length <= 1024: + intermediary_mean_mess_ratio_calc = 64 + else: + intermediary_mean_mess_ratio_calc = 128 + + for character, index in zip(decoded_sequence, range(0, length)): + for detector in detectors: + if detector.eligible(character): + detector.feed(character) + + if (index > 0 and index % intermediary_mean_mess_ratio_calc == 0) or index == length-1: + mean_mess_ratio = sum( + [ + dt.ratio for dt in detectors + ] + ) + + if mean_mess_ratio >= maximum_threshold: + break + + if debug: + for dt in detectors: # pragma: nocover + print( + dt.__class__, + dt.ratio + ) + + return round( + mean_mess_ratio, + 3 + ) + diff --git a/shared/package-files/9b/9b79065dfee170914ab9ff6306eddbabe921f4c432484396c6011b04497447c4/blob b/shared/package-files/9b/9b79065dfee170914ab9ff6306eddbabe921f4c432484396c6011b04497447c4/blob new file mode 100644 index 0000000000000000000000000000000000000000..f091dd47d031126efcf62060df0215a685da673e --- /dev/null +++ b/shared/package-files/9b/9b79065dfee170914ab9ff6306eddbabe921f4c432484396c6011b04497447c4/blob @@ -0,0 +1,1202 @@ +import collections +import dataclasses +import enum +import itertools as it +import logging +from typing import ( + Any, + cast, + DefaultDict, + Dict, + Iterator, + List, + Optional, + Set, + Tuple, + Union, +) + +from typing_extensions import Literal + +import torch +from torch._C import FunctionSchema +from torch._C._autograd import _ProfilerResult +from torch._C._profiler import ( + _EventType, + _ExtraFields_Allocation, + _ExtraFields_TorchOp, + _ProfilerEvent, + _TensorMetadata, + RecordScope, +) +from torch._utils import _element_size +from torch.profiler import _utils + +KeyAndID = Tuple["Key", int] +TensorAndID = Tuple["TensorKey", int] + +log = logging.getLogger(__name__) + + +class Category(enum.Enum): + INPUT = enum.auto() + TEMPORARY = enum.auto() + ACTIVATION = enum.auto() + GRADIENT = enum.auto() + AUTOGRAD_DETAIL = enum.auto() + PARAMETER = enum.auto() + OPTIMIZER_STATE = enum.auto() + + +_CATEGORY_TO_COLORS = { + Category.PARAMETER: "darkgreen", + Category.OPTIMIZER_STATE: "goldenrod", + Category.INPUT: "black", + Category.TEMPORARY: "mediumpurple", + Category.ACTIVATION: "red", + Category.GRADIENT: "mediumblue", + Category.AUTOGRAD_DETAIL: "royalblue", + None: "grey", +} + +_CATEGORY_TO_INDEX = {c: i for i, c in enumerate(_CATEGORY_TO_COLORS)} + + +class Action(enum.Enum): + PREEXISTING = enum.auto() + CREATE = enum.auto() + INCREMENT_VERSION = enum.auto() + DESTROY = enum.auto() + + +_ACTION_TO_INDEX = {i: i.value for i in Action} + + +@dataclasses.dataclass(eq=True, unsafe_hash=False, frozen=True) +class Key: + device: torch.device + + +@dataclasses.dataclass +class _Storage: + """Bundle storage pointer and id. + + All profiling logic should use `allocation_id`, however it is useful to + print storage pointers for debugging and unit tests sometimes look up + values using the storage data pointer of a live Tensor.""" + + ptr: int + allocation_id: int + + def __repr__(self) -> str: + return f"{hex(self.ptr):>18} ({self.allocation_id})" + + def __eq__(self, other: object) -> bool: + return isinstance(other, _Storage) and self.allocation_id == other.allocation_id + + def __hash__(self) -> int: + return hash(self.allocation_id) + + +@dataclasses.dataclass(eq=True, unsafe_hash=True, frozen=True) +class TensorKey(Key): + """Hashable identifier for a storage which has been asigned an ID. + + A detailed description of Tensor IDs and why they are needed is given in + `torch/csrc/profiler/collection.h` when `TensorID` is declared. To + summarize, multiple Storage buffers can map to the same logical Tensor. + This dataclass is used to refer to a concrete in-memory StorageImpl of + a Tensor. + """ + + id: int + storage: _Storage + + def __repr__(self) -> str: + return f"id={self.id}: {repr(self.storage):<24} ({self.device})" + + def __lt__(self, other: "TensorKey") -> bool: + return self._as_sortable < other._as_sortable + + @staticmethod + def _make( + tensor_id: Optional[int], + storage_ptr: Optional[int], + allocation_id: Optional[int], + device: torch.device, + ) -> Optional["TensorKey"]: + if ( + tensor_id is not None + and storage_ptr is not None + and allocation_id is not None + ): + return TensorKey(device, tensor_id, _Storage(storage_ptr, allocation_id)) + return None + + @classmethod + def from_allocation(cls, alloc: _ExtraFields_Allocation) -> Optional["TensorKey"]: + return cls._make(alloc.id, alloc.ptr, alloc.allocation_id, alloc.device) + + @classmethod + def from_tensor(cls, t: Optional[_TensorMetadata]) -> Optional["TensorKey"]: + if t is not None: + return cls._make(t.id, t.storage_data_ptr, t.allocation_id, t.device) + return None + + @property + def _as_sortable(self) -> Tuple[int, int, str, int]: + return self.id, self.storage.allocation_id, self.device.type, self.device.index + + +def _extract_parameters_and_gradients( + node: _ProfilerEvent, +) -> Iterator[Tuple[Optional[TensorKey], Optional[TensorKey]]]: + children = node.children + + # AccumulateGrad is used in the Autograd engine to handle gradient updates. + # There are two possible cases: + # 1) This is a newly created gradient Tensor. In that case there is nothing + # to accumulate, so autograd simply detaches the Tensor. + # + # 2) There is a preexisting gradient Tensor and we need to add the newly + # computed update. This is done with an in-place add (aten::add_) op. + # (The underscore suffix denotes "in-place".) + if ( + node.typed[0] == _EventType.TorchOp + and node.typed[1].scope == RecordScope.BACKWARD_FUNCTION + # TODO(robieta): Move away from load bearing names + and node.name == "torch::autograd::AccumulateGrad" + and children + and children[0].typed[0] == _EventType.TorchOp + and children[0].name in ("aten::detach", "aten::add_") + and children[0].typed[1].inputs + and isinstance(children[0].typed[1].inputs[0], _TensorMetadata) + ): + yield None, TensorKey.from_tensor(children[0].typed[1].inputs[0]) + + # We directly instrument `torch.nn.Module` and `torch.optim.Optimizer` + # NOTE: The values captured by the python tracer are cached; they can be + # used to build up labels but do not imply that a Tensor was live at + # a particular time. + elif node.typed[0] == _EventType.PyCall: + typed_fields = node.typed[1] + assert typed_fields.module is None or typed_fields.optimizer is None + if typed_fields.module is not None: + for _, p, p_grad in typed_fields.module.parameters: + yield TensorKey.from_tensor(p), TensorKey.from_tensor(p_grad) + + if typed_fields.optimizer is not None: + for p, p_grad, _ in typed_fields.optimizer.parameters: + yield TensorKey.from_tensor(p), TensorKey.from_tensor(p_grad) + + +def extract_parameters(node: _ProfilerEvent) -> Iterator[TensorKey]: + for p, p_grad in _extract_parameters_and_gradients(node): + if p is not None: + yield p + + +def extract_gradients( + node: _ProfilerEvent, +) -> Iterator[Tuple[Optional[TensorKey], TensorKey]]: + for p, p_grad in _extract_parameters_and_gradients(node): + if p_grad is not None: + yield p, p_grad + + +def get_scopes(event: Optional[_ProfilerEvent]) -> Tuple[RecordScope, ...]: + scopes = [] + while event: + if event.typed[0] == _EventType.TorchOp: + scopes.append(event.typed[1].scope) + event = event.parent + return tuple(scopes) + + +class SchemaMatcher: + """Lookup operator schema based on profiled name. + + When profiling we record the operator's name but not the schema. However + some analysis requires that information. Fortunately we can look up + registered schema from the recorded name. We do not, however, record the + overload and so we must compare the profiled arguments with all overloads + to determine viable matches. + + Note: Once https://github.com/pytorch/pytorch/issues/78871 is completed + this code will be obsolete. + """ + + @classmethod + def inputs_are_mutable(cls, t: _ExtraFields_TorchOp) -> Tuple[Optional[bool], ...]: + """Determine which inputs may have mutated based on function schema. + + Note that we don't need to resolve down to a single schema to perform + this analysis. An input is mutable if it is mutable in any overload. In + practice, however, it is overwhelmingly common to match a single + overload. If we cannot find any valid schema then we must be + conservative and assume all inputs are mutable. + """ + mutable: Optional[List[bool]] = None + for schema in cls.match_schemas(t): + mutable = mutable or [False for _ in schema.arguments] + for i, arg in enumerate(schema.arguments): + mutable[i] |= getattr(arg.alias_info, "is_write", False) + + return tuple(mutable or (None for _ in t.inputs)) + + @classmethod + def match_schemas(cls, t: _ExtraFields_TorchOp) -> Tuple[FunctionSchema, ...]: + signature = tuple( + # Tensor + TensorKey.from_tensor(i) if isinstance(i, _TensorMetadata) + # + # TensorList + else [TensorKey.from_tensor(j) for j in i] if isinstance(i, list) + # + # Scalar and uncaptured inputs. + else i + for i in t.inputs + ) + + def matches(schema) -> bool: + return len(schema.arguments) == len(signature) and all( + cls._types_match(observed, schema_arg.type) + for observed, schema_arg in zip(signature, schema.arguments) + ) + + return tuple(s for s in cls.lookup_schemas(t.name) or () if matches(s)) + + @classmethod + def _types_match(cls, observed, schema_type) -> bool: + if isinstance(schema_type, torch._C.OptionalType): + schema_type = schema_type.getElementType() + return observed is None or cls._types_match(observed, schema_type) + + if isinstance(schema_type, torch._C.AnyType): + return True + + if schema_type.isSubtypeOf(torch._C.ListType.ofTensors()): + return isinstance(observed, list) and all( + isinstance(i, TensorKey) for i in observed + ) + + type_map: Tuple[Tuple[Any, Union[type, Tuple[type, ...]]], ...] = ( + (torch._C.TensorType, TensorKey), + (torch._C.NoneType, type(None)), + (torch._C.BoolType, bool), + (torch._C.IntType, int), + (torch._C.FloatType, float), + (torch._C.ComplexType, complex), + (torch._C.NumberType, (bool, int, float, complex)), + ) + + for jit_type, py_types in type_map: + if isinstance(schema_type, jit_type): + return isinstance(observed, py_types) + + # Profiler only records a subset of possible argument types. If we + # reach this point then the schema must call for a type that profiler + # does not record. Thus, the schema can only be a match if `observed` + # is also None. + return observed is None + + @staticmethod + def lookup_schemas(name: str) -> Optional[Tuple[FunctionSchema, ...]]: + # TODO(robieta): + # _jit_get_schemas_for_operator is quite expensive. (~100us / call) + # Consider adding `functools.lru_cache` if that becomes an issue. + + try: + # Schema lookup will throw if `name` is malformed. (For example, + # schemas must be namespaced and schema lookup will fail if name + # does not include "::".) We simply catch the exception and return + # `None` to denote that `name` cannot be an operator name. + # + # Note that record_function annotations also go through this path, + # so it is expected that some names will not correspond to PyTorch + # operators. + if "::" not in name: + return None + return tuple(torch._C._jit_get_schemas_for_operator(name)) + except RuntimeError: + return None + + +class OpTree: + def __init__(self, result: _ProfilerResult) -> None: + self._root_nodes = result.experimental_event_tree() + self._sorted_nodes = tuple(sorted(self.dfs(), key=lambda x: x.start_time_ns)) + + def dfs(self, *args, **kwargs) -> Iterator[_ProfilerEvent]: + yield from _utils.traverse_dfs(self._root_nodes, *args, **kwargs) + + @property + def sorted_nodes(self) -> Tuple[_ProfilerEvent, ...]: + return self._sorted_nodes + + +class SizeMap: + def __init__(self, op_tree: OpTree) -> None: + self._values: Dict[TensorKey, int] = {} + + for node in op_tree.sorted_nodes: + if node.typed[0] == _EventType.TorchOp: + for t in self._flat_tensor_inputs(node.typed[1]): + self._update_values(t) + + elif node.typed[0] == _EventType.PyCall: + typed_fields = node.typed[1] + assert typed_fields.module is None or typed_fields.optimizer is None + if typed_fields.module is not None: + for _, p, p_grad in typed_fields.module.parameters: + self._update_values(p) + self._update_values(p_grad) + + if typed_fields.optimizer is not None: + for p, p_grad, state in typed_fields.optimizer.parameters: + self._update_values(p) + self._update_values(p_grad) + for _, t in state: + self._update_values(t) + + allocations: Dict[TensorKey, int] = {} + for node in op_tree.sorted_nodes: + if node.typed[0] == _EventType.Allocation: + alloc_fields = node.typed[1] + key = TensorKey.from_allocation(alloc_fields) + if key: + new_size = abs(alloc_fields.alloc_size) + prior_size = allocations.setdefault(key, new_size) + + # It is possible to resize Storage in PyTorch, however we + # key on data pointer so most resizes will be treated as a + # change in storage. The one corner case that cannot be + # handled is `realloc` which successfully resizes the + # storage. At time of writing this is not done anywhere in + # the core PyTorch codebase. + if prior_size != new_size: + delta = f"{prior_size} vs. {new_size}" + log.warning("Mismatch between allocation and free: %s", delta) + + self._values.update(allocations) + + def _update_values(self, t: Optional[_TensorMetadata]) -> None: + key = TensorKey.from_tensor(t) + if key is not None and t is not None and t.layout == torch.strided: + # Scalars are represented as zero dim Tensors + n = max(i[0] * i[1] for i in zip(t.sizes or [1], t.strides or [1])) + + num_bytes = n * _element_size(t.dtype) + assert num_bytes >= 0, f"{num_bytes}" + self._values[key] = max(self._values.get(key, 0), num_bytes) + + @staticmethod + def _flat_tensor_inputs(op: _ExtraFields_TorchOp) -> Iterator[_TensorMetadata]: + for i in op.inputs: + if isinstance(i, _TensorMetadata): + yield i + elif isinstance(i, list): + yield from i + + def __getitem__(self, key: TensorKey): + return self._values[key] + + +@dataclasses.dataclass() +class DataFlowEdge: + input_version: Optional[int] = None + mutated: Optional[bool] = False + + @property + def is_allocation(self) -> bool: + return self.input_version is None + + @property + def is_deletion(self) -> bool: + return self.mutated is None + + +class DataFlowNode: + def __init__(self, event: _ProfilerEvent, graph: "DataFlowGraph") -> None: + self._event = event + self._graph = graph + self._edges: Dict[TensorKey, DataFlowEdge] = self._determine_edges() + + for key, edge in self._edges.items(): + if edge.mutated and not edge.is_allocation: + self._graph.bump(key) + + # Make sure the version bumping behavior matches what we expect. + versions = {k: (v, self._graph.lookup(k)) for k, v in self.outputs.items()} + assert all(i == j for i, j in versions.values()), f"{versions}, {self._edges}" + + def _determine_edges(self) -> Dict[TensorKey, DataFlowEdge]: + subtree = tuple(_utils.traverse_dfs([self._event])) + + # Start by populating edges from op inputs and outputs. + mutable_by_key: Dict[Optional[TensorKey], Set[Optional[bool]]] = {} + for op in (i.typed[1] for i in subtree if i.typed[0] == _EventType.TorchOp): + for op_input, mutable in zip( + op.inputs, SchemaMatcher.inputs_are_mutable(op) + ): + # Tensor + if isinstance(op_input, _TensorMetadata): + key = TensorKey.from_tensor(op_input) + mutable_by_key.setdefault(key, set()).add(mutable) + + # TensorList + elif isinstance(op_input, list): + for op_input_i in op_input: + key = TensorKey.from_tensor(op_input_i) + mutable_by_key.setdefault(key, set()).add(mutable) + + edges: DefaultDict[Optional[TensorKey], DataFlowEdge] + edges = collections.defaultdict(DataFlowEdge) + for key, mutable_set in mutable_by_key.items(): + if key is not None: + edges[key].input_version = self._graph.lookup(key) if key else -1 + + # We consider an op to be mutated if we encounter a schema where it + # is a mutable argument OR if it is ambiguous. (We never explicitly + # see it in any schema.) + mutated = (True in mutable_set) or (tuple(mutable_set) == (None,)) + edges[key].mutated = mutated + + # Then handle deletions. Note that deleting a Tensor implicitly adds + # it as an input edge. + for i in subtree: + if i.typed[0] == _EventType.Allocation and i.typed[1].alloc_size < 0: + key = TensorKey.from_allocation(i.typed[1]) + edge = edges[key] + assert key is None or edge.mutated is not None, f"Double delete: {key}" + edge.mutated = None + edge.input_version = self._graph.lookup(key) if key else -1 + + # And finally handle allocations. This step must be last, because the + # previous two steps optimistically add input edges. + for i in subtree: + if i.typed[0] == _EventType.Allocation and i.typed[1].alloc_size > 0: + edges[TensorKey.from_allocation(i.typed[1])].input_version = None + + # We don't need to sort the inputs, but it makes debugging and unit tests nicer. + return dict(sorted((k, v) for k, v in edges.items() if k is not None)) + + @property + def inputs(self) -> Dict[TensorKey, Tuple[bool, int]]: + return { + # MyPy can't see through `is_allocation` to know that + # `v.input_version` is not None. + k: (bool(v.mutated), cast(int, v.input_version)) + for k, v in self._edges.items() + if not v.is_allocation + } + + @property + def outputs(self) -> Dict[TensorKey, int]: + return { + k: 0 if v.input_version is None else v.input_version + 1 + for k, v in self._edges.items() + if (v.is_allocation and not v.is_deletion) or v.mutated + } + + @property + def intermediates(self) -> Tuple[TensorKey, ...]: + return tuple( + k for k, v in self._edges.items() if v.is_allocation and v.is_deletion + ) + + @property + def start_time(self) -> int: + return self._event.start_time_ns + + +class DataFlowGraph: + def __init__(self, op_tree: OpTree) -> None: + self._op_tree = op_tree + self._leaf_events = self._extract_leaf_events(op_tree) + self._active_version: Dict[TensorKey, Optional[int]] = {} + self._flow_nodes = [DataFlowNode(e, self) for e in self.leaf_events] + self._flow_nodes.sort(key=lambda x: x.start_time) + self.validate() + + @property + def flow_nodes(self) -> Tuple[DataFlowNode, ...]: + return tuple(self._flow_nodes) + + def validate(self): + # Check that each (Tensor, version) pair has a unique creation node + outputs: Set[Tuple[TensorKey, int]] = set() + for node in self.flow_nodes: + node_outputs = set(node.outputs.items()) + duplicates = outputs & node_outputs + assert not duplicates, f"{node._event.name} {node._edges} {duplicates}" + outputs |= node_outputs + + # And check that `self._nodes` forms a valid topologically sorted DAG. + tensor_versions: Dict[TensorKey, int] = {} + for node in self.flow_nodes: + for key, (_, version) in node.inputs.items(): + expected = tensor_versions.get(key, 0) + assert expected == version, (expected, version) + + for key, version in node.outputs.items(): + prior_version = tensor_versions.get(key, version) + assert version >= prior_version, (version, prior_version) + tensor_versions[key] = version + + @property + def leaf_events(self) -> Tuple[_ProfilerEvent, ...]: + return self._leaf_events + + @staticmethod + def _extract_leaf_events(op_tree: OpTree) -> Tuple[_ProfilerEvent, ...]: + """Partially traverse the op tree and extract top level ops. + + Consider the following code: + ``` + with record_function("My annotation"): + x.zero_() + y.zero_() + ``` + + The op tree (assuming no Autograd) will look like: + + TorchOp: "My annotation" + TorchOp: zero_ + TorchOp: fill_ + TorchOp: zero_ + TorchOp: fill_ + + The recursive structure of operator calls makes data flow unwieldy. + In order to simplify analysis we would like to select the highest level + ops to represent in the graph. In this case those are the `zero_` ops; + the fact that `fill_` is called is an implementation detail. We also + do not want to group everything under "My annotation" as this could + create overly coarse bundles and lose critical semantics. + + To address this issue we walk over the graph and select the topmost + torch ops ** which match at least one operator schema **. These form + the leaves of the first pass through the op tree. (As well as any + allocations or frees which do are not part of a kernel.) These events + form the logical nodes in our data flow graph. + """ + + leaf_events: List[_ProfilerEvent] = [] + + def leaf_op(e: _ProfilerEvent) -> bool: + return e.typed[0] == _EventType.TorchOp and ( + e.typed[1].scope == RecordScope.BACKWARD_FUNCTION + or bool(SchemaMatcher.match_schemas(e.typed[1])) + ) + + def children_fn(e: _ProfilerEvent): + if leaf_op(e) or e.tag == _EventType.Allocation: + leaf_events.append(e) + return [] + + return e.children + + for _ in op_tree.dfs(children_fn=children_fn): + pass + + return tuple(sorted(leaf_events, key=lambda x: x.start_time_ns)) + + def lookup(self, key: TensorKey) -> int: + version = self._active_version.setdefault(key, 0) + assert version is not None + return version + + def bump(self, key: TensorKey) -> None: + prior_version = self._active_version.get(key, None) + assert prior_version is not None + self._active_version[key] = prior_version + 1 + + def delete(self, key: TensorKey) -> None: + assert self._active_version.setdefault(key, 0) is not None + self._active_version[key] = None + + +@dataclasses.dataclass +class CategoryElement: + by_id: Optional[Category] = None + by_key: Dict[TensorKey, Category] = dataclasses.field(default_factory=dict) + by_version: Dict[TensorAndID, Category] = dataclasses.field(default_factory=dict) + + # Used by unit tests to check internals. (And consequently by + # MemoryProfile.lookup) This should not be used in any other capacity. + _by_id_keyset: Set[TensorKey] = dataclasses.field(default_factory=set) + + +@dataclasses.dataclass +class CategoryDict: + _values: DefaultDict[int, CategoryElement] = dataclasses.field( + default_factory=lambda: collections.defaultdict(CategoryElement) + ) + + def set_by_id(self, key: TensorKey, category: Category) -> None: + self._values[key.id].by_id = category + self._values[key.id]._by_id_keyset.add(key) + + def set_by_key(self, key: TensorKey, category: Category) -> None: + self._values[key.id].by_key[key] = category + + def set_by_version(self, key: TensorKey, version: int, category: Category) -> None: + self._values[key.id].by_version[(key, version)] = category + + def setdefault_by_version( + self, key: TensorKey, version: int, category: Category + ) -> None: + self._values[key.id].by_version.setdefault((key, version), category) + + def get(self, key: Key, version: int) -> Optional[Category]: + if isinstance(key, Key) and not isinstance(key, TensorKey): + return None + element = self._values[key.id] + return ( + element.by_id + or element.by_key.get(key, None) + or element.by_version.get((key, version), None) + ) + + +class MemoryProfile: + def __init__(self, result: _ProfilerResult) -> None: + self._op_tree = OpTree(result) + self._data_flow_graph = DataFlowGraph(self._op_tree) + self._size_map = SizeMap(self._op_tree) + self._categories = CategoryDict() + + self._set_gradients_and_temporaries() + self._set_parameters_using_python_tracer() + self._set_inputs() + self._set_parameters_using_data_flow() + self._set_activations() + self._set_optimizer_state() + self._set_autograd_detail() + + @property + def timeline(self) -> Tuple[Tuple[int, Action, KeyAndID, int], ...]: + output: List[Tuple[int, Action, KeyAndID, int]] = [] + allocation_times: Dict[Tuple[TensorKey, bool], int] = {} + live_unknown: Dict[Tuple[int, torch.device], Literal[True]] = {} + for event in self._op_tree.dfs(): + if event.typed[0] == _EventType.Allocation: + alloc_fields = event.typed[1] + alloc_size = alloc_fields.alloc_size + is_allocation = alloc_size > 0 + t = event.start_time_ns + + tkey = TensorKey.from_allocation(alloc_fields) + if tkey is not None: + allocation_times[(tkey, is_allocation)] = t + + else: + key = Key(alloc_fields.device) + ptr_and_device = (alloc_fields.ptr, key.device) + if is_allocation: + if ptr_and_device in live_unknown: + output.append( + (t, Action.INCREMENT_VERSION, (key, 0), alloc_size) + ) + else: + live_unknown[ptr_and_device] = True + output.append((t, Action.CREATE, (key, 0), alloc_size)) + else: + output.append((t, Action.DESTROY, (key, 0), -alloc_size)) + if not live_unknown.pop(ptr_and_device, False): + output.append( + (-1, Action.PREEXISTING, (key, 0), -alloc_size) + ) + + snapshot = self._category_snapshot() + last_version = dict(sorted(snapshot.keys())) + + events: List[Tuple[int, Action, TensorAndID]] = [ + (-1, Action.PREEXISTING, (key, version)) + for key, version in snapshot.keys() + if (key, True) not in allocation_times and version == 0 + ] + + for node in self._data_flow_graph.flow_nodes: + for key, edge in node._edges.items(): + if edge.is_allocation: + t = allocation_times[(key, True)] + events.append((t, Action.CREATE, (key, 0))) + + elif edge.mutated: + t = node._event.start_time_ns + version = edge.input_version + assert version is not None + events.append((t, Action.INCREMENT_VERSION, (key, version))) + + if edge.is_deletion: + t = allocation_times[(key, False)] + events.append((t, Action.DESTROY, (key, last_version[key]))) + + output.extend( + (time, action, (key, version), self._size_map[key]) + for time, action, (key, version) in events + ) + + output.sort(key=lambda x: (x[0], x[1].value)) + return tuple(output) + + def _is_gradient(self, *args, **kwargs) -> bool: + return self._categories.get(*args, **kwargs) == Category.GRADIENT + + def _category_snapshot(self) -> Dict[TensorAndID, Optional[Category]]: + all_tensor_versions: Set[TensorAndID] = set() + + for node in self._data_flow_graph.flow_nodes: + all_tensor_versions.update(((k, v) for k, (_, v) in node.inputs.items())) + all_tensor_versions.update((key, 0) for key in node.intermediates) + all_tensor_versions.update(node.outputs.items()) + + for i in self._categories._values.values(): + all_tensor_versions.update((key, 0) for key in i._by_id_keyset) + + return { + (key, version): self._categories.get(key, version) + for key, version in sorted(all_tensor_versions) + } + + def _any_version_depends_on_gradient(self) -> Set[int]: + """Extract IDs of Tensors which depend or will depend on a gradient. + + Note that this weakened definition of "depends" requires us to loop + over the data flow graph multiple times because it allows dependency + information to flow backward through edges and removes the guarantee + that nodes are topologically sorted. (Or indeed, even that a valid + topological order exists.) Put another way, we have converted an + acyclic data flow graph into a cyclic graph and we are attempting to + partition cycles involving a gradient from the rest of the graph. + """ + depends_on_gradient: Set[int] = set() + while True: + start_size = len(depends_on_gradient) + for node in self._data_flow_graph.flow_nodes: + ids = tuple( + key.id + for key, (_, version) in node.inputs.items() + if self._categories.get(key, version) + in (Category.GRADIENT, Category.PARAMETER) + or key.id in depends_on_gradient + ) + + if ids: + depends_on_gradient.update(ids) + depends_on_gradient.update(key.id for key in node.outputs) + + # We are guaranteed to exit because there is a finite set of + # TensorAndID pairs. In practice we do not expect to loop more than + # three times: once to identify the core parameter update loop, + # once to fold the first step into that loop, and a third time + # where no new elements are added. + if len(depends_on_gradient) == start_size: + return depends_on_gradient + + def _set_gradients_and_temporaries(self) -> None: + """Mark Tensors which are unambiguous and simple to reason about.""" + + # Gradients are straightforward to detect. We directly check the + # `.grad` property in the Python tracer, and we can detect any new + # gradient Tensors from `AccumulateGrad` ops. + for event in self._op_tree.dfs(): + for _, p_grad in extract_gradients(event): + self._categories.set_by_id(p_grad, Category.GRADIENT) + + # Similarly, temporary Tensors are easy to identify and are useful to + # flag since they can make memory use "spikier" than one would + # otherwise expect. + for node in self._data_flow_graph.flow_nodes: + for i in node.intermediates: + self._categories.set_by_key(i, Category.TEMPORARY) + + def _set_parameters_using_python_tracer(self) -> None: + for event in self._op_tree.dfs(): + for p in extract_parameters(event): + if p is not None: + self._categories.set_by_id(p, Category.PARAMETER) + + def _set_inputs(self) -> None: + """Mark inputs based on which Tensors are updated using gradients. + + The process for differentiating between inputs and activations is more + involved. Most Tensors in a training loop depend on at least one + gradient: parameters depend on them through updates, and activations + and optimizer state depend on them transitively through parameters. + Critically, we do not need to know which Tensors are parameters to + apply this method; we can simply walk the data flow graph to build the + set of all values which depend on a gradient and then obtain the set + of inputs from the conjugate set. + + There is, however, one hiccup. The first time we see a parameter is + generally on the forward pass of the first step. We know from + inspection of the data flow graph that v1 of that Tensor depends on + a gradient (provided we profile an optimizer step), but not v0. To + address this problem we weaken the definition of "depends on a + gradient" to "any version of this Tensor depends on a gradient", + which in turn strengthens the criteria for the input set enough to + filter the activations in the forward pass of the first step.""" + + # All of this analysis is predicated on using at least one training + # step (or parameters from the python tracer) to partition the graph. + # Absent that we cannot determine which Tensors are inputs and which + # ones are part of the model. + depends_on_gradient = self._any_version_depends_on_gradient() + + # We only want to annotate Tensors which actually contribute to the + # model calculation. + produces_gradient: Set[TensorAndID] = set() + for node in reversed(self._data_flow_graph.flow_nodes): + tensors = {(key, version) for key, (_, version) in node.inputs.items()} + tensors |= node.outputs.items() + if any( + self._categories.get(*i) in (Category.GRADIENT, Category.PARAMETER) + or i in produces_gradient + for i in tensors + ): + produces_gradient |= tensors + + # Don't include Tensors created in the backward pass, as these are + # generally Autograd implementation details rather than proper inputs. + input_candidates = produces_gradient.copy() + for node in self._data_flow_graph.flow_nodes: + if RecordScope.BACKWARD_FUNCTION in get_scopes(node._event): + input_candidates -= set(node.outputs.items()) + + for key, version in input_candidates: + if key.id not in depends_on_gradient: + self._categories.setdefault_by_version(key, version, Category.INPUT) + + def _set_parameters_using_data_flow(self) -> None: + """Deduce which Tensors are parameters. + + Consider the following code for the step of SGD with momentum + (nesterov=False), where `d_p` is the gradient of `param` and `buf` is + the momentum buffer. + ``` + buf.mul_(momentum).add_(d_p, alpha=1 - dampening) + d_p = buf + param.add_(d_p, alpha=-lr) + ``` + Both `param` and `buf` take a gradient and perform an in-place update. + + The python tracer will inspect calls to `nn.Module.forward` and + `optim.Optimizer.step` to extract parameter and optimizer state + respectively (including parameters), so this is generally a non-issue. + + However as a fallback we can also exploit several properties of + parameters to distinguish them from other model state. + + First, they are directly used in the forward pass. (At this point we + haven't established which parts of the graph correspond to the forward + pass but we can deduce enough to suffice.) Some mutable state such as + batch norm moving averages also contribute to the forward pass, but + optimizer state does not. + + Second, a parameter is by definition used to compute at least one + gradient and depends on at least one gradient. + """ + snapshot = self._category_snapshot() + + # Determine which Tensors might be parameters based on forward pass + # data flow. Note this these are only candidates; we filter nodes that + # we know are part of the backward pass but that doesn't guarantee that + # they are part of the forward pass. + candidate_parameters: Set[TensorAndID] = set() + candidate_fwd_tensors: Set[TensorAndID] = { + i for i, category in snapshot.items() if category == Category.INPUT + } + + for node in self._data_flow_graph.flow_nodes: + inputs = {(key, value) for key, (_, value) in node.inputs.items()} + if ( + # Don't check nodes in the backward pass. + RecordScope.BACKWARD_FUNCTION not in get_scopes(node._event) + and not any(self._is_gradient(*i) for i in inputs) + and not any(self._is_gradient(*i) for i in node.outputs.items()) + # + # and only check nodes which depend on an input. + and candidate_fwd_tensors.intersection(inputs) + ): + candidate_fwd_tensors |= node.outputs.items() + candidate_parameters |= inputs.difference(candidate_fwd_tensors) + + # Require that each parameter eventually contributes to the value of a gradient + used_for_gradient: Set[TensorAndID] = set() + for node in reversed(self._data_flow_graph.flow_nodes): + if any( + self._is_gradient(*i) or i in used_for_gradient + for i in node.outputs.items() + ): + for key, (_, version) in node.inputs.items(): + used_for_gradient.add((key, version)) + candidate_parameters.intersection_update(used_for_gradient) + + # and depends on a gradient. + parameter_keys = {key.id for key, _ in candidate_parameters} + parameter_keys &= self._any_version_depends_on_gradient() + + for key, _ in snapshot.keys(): + if key.id in parameter_keys: + self._categories.set_by_id(key, Category.PARAMETER) + + def _set_activations(self) -> None: + """Flood the graph to identify activations.""" + + required = {Category.INPUT, Category.ACTIVATION} + also_allowed = {Category.PARAMETER, Category.TEMPORARY} + for node in self._data_flow_graph.flow_nodes: + inputs = {(key, value) for key, (_, value) in node.inputs.items()} + input_categories = {self._categories.get(*i) for i in inputs} + + if ( + (input_categories & required) + and not (input_categories - (required | also_allowed)) + # + # Stop filling when we reach the backward pass. + and RecordScope.BACKWARD_FUNCTION not in get_scopes(node._event) + ): + for i in node.outputs.items(): + self._categories.setdefault_by_version(*i, Category.ACTIVATION) + + def _set_optimizer_state(self) -> None: + for event in self._op_tree.dfs(): + if event.typed[0] == _EventType.PyCall and event.typed[1].optimizer: + parameters = event.typed[1].optimizer.parameters + for _, t in it.chain(*[state for _, _, state in parameters]): + key = TensorKey.from_tensor(t) + if key is not None: + self._categories.set_by_id(key, Category.OPTIMIZER_STATE) + + def _set_autograd_detail(self): + prior = {None, Category.AUTOGRAD_DETAIL} + for node in self._data_flow_graph.flow_nodes: + if RecordScope.BACKWARD_FUNCTION in get_scopes(node._event): + for key, version in node.outputs.items(): + if version == 0 or self._categories.get(key, version - 1) in prior: + self._categories.setdefault_by_version( + key, version, Category.AUTOGRAD_DETAIL + ) + + +class MemoryProfileTimeline: + def __init__(self, memory_profile): + """The minimum representation of the memory profile timeline + includes the memory timeline and categories. The timeline + consists of [timestamp, action, (TensorKey, version), numbytes] + elements, to denote any actions (pre-existing, create, destroy, + or increment_version) that occurred to a specific Tensor for a + chunk of memory. The categories help map each (TensorKey, + version) pair into a category.""" + self.timeline = memory_profile.timeline + self.categories = memory_profile._categories + + def _coalesce_timeline(self, device_str): + """Convert the memory timeline and categories into a memory plot + consisting of timestamps and their respective sizes by category + for a given device. + + Input: device + Output: [timestamps, sizes by category] + """ + device = torch.device(device_str) + times: List[int] = [] + sizes: List[List[int]] = [] + + def update(key, version, delta): + category = ( + self.categories.get(key, version) + if isinstance(key, TensorKey) + else None + ) + index = _CATEGORY_TO_INDEX[category] + 1 + sizes[-1][index] += int(delta) + + t_min = -1 + for t, action, (key, version), numbytes in self.timeline: + if key.device != device: + continue + + # Convert timestamps from ns to us, to match trace events. + if t != -1: + t = int(t / 1000) + + # Save the smallest timestamp to populate pre-existing allocs. + if t_min == -1 or (t < t_min and t > 0): + t_min = t + + # Handle timestep + if len(times) == 0: + times.append(t) + sizes.append([0] + [0 for _ in _CATEGORY_TO_INDEX]) + + elif t != times[-1]: + times.append(t) + sizes.append(sizes[-1].copy()) + + # Handle memory and categories + if action in (Action.PREEXISTING, Action.CREATE): + update(key, version, numbytes) + + elif action == Action.INCREMENT_VERSION: + update(key, version, -numbytes) + update(key, version + 1, numbytes) + + elif action == Action.DESTROY: + update(key, version, -numbytes) + + else: + raise ValueError(f"Unknown action: {action}") + + times = [t_min if t < 0 else t for t in times] + return times, sizes + + def export_memory_timeline(self, path, device_str) -> None: + """Saves the memory timeline as [times, sizes by category] + as a JSON formatted file to the given path for the given + device.""" + times, sizes = self._coalesce_timeline(device_str) + # TODO: Write a faster serialize (orjson not available in CI) + import json + + with open(path, "w") as f: + json.dump([times, sizes], f) + + def export_memory_timeline_raw(self, path, device_str) -> None: + """Saves the memory timeline as raw memory event tuples in the + form of (timestamp, action, numbytes, category) + as a JSON formatted file to the given path for the given + device.""" + device = torch.device(device_str) + raw_events: List[Tuple[int, int, int, int]] = [] + + def get_category_index(key, version): + category = ( + self.categories.get(key, version) + if isinstance(key, TensorKey) + else None + ) + return _CATEGORY_TO_INDEX[category] + + for t, action, (key, version), numbytes in self.timeline: + if key.device != device: + continue + + if action in (Action.PREEXISTING, Action.CREATE): + raw_events.append( + ( + t, + _ACTION_TO_INDEX[action], + numbytes, + get_category_index(key, version), + ) + ) + + elif action == Action.INCREMENT_VERSION: + raw_events.append( + ( + t, + _ACTION_TO_INDEX[action], + -numbytes, + get_category_index(key, version), + ) + ) + raw_events.append( + ( + t, + _ACTION_TO_INDEX[action], + numbytes, + get_category_index(key, version + 1), + ) + ) + + elif action == Action.DESTROY: + raw_events.append( + ( + t, + _ACTION_TO_INDEX[action], + -numbytes, + get_category_index(key, version), + ) + ) + + else: + raise ValueError(f"Unknown action: {action}") + + import json + + with open(path, "w") as f: + json.dump(raw_events, f) + + def export_memory_timeline_html( + self, path, device_str, figsize=(20, 12), title=None + ) -> None: + """Exports the memory timeline as an HTML file which contains + the memory timeline plot embedded as a PNG file.""" + # Check if user has matplotlib installed, return gracefully if not. + import importlib.util + + matplotlib_spec = importlib.util.find_spec("matplotlib") + if matplotlib_spec is None: + print( + "export_memory_timeline_html failed because matplotlib was not found." + ) + return + + from base64 import b64encode + from os import remove + from tempfile import NamedTemporaryFile + + import matplotlib.pyplot as plt + import numpy as np + + mt = self._coalesce_timeline(device_str) + times, sizes = np.array(mt[0]), np.array(mt[1]) + # For this timeline, start at 0 to match Chrome traces. + t_min = min(times) + times -= t_min + stacked = np.cumsum(sizes, axis=1) / 1024**3 + device = torch.device(device_str) + max_memory_allocated = torch.cuda.max_memory_allocated(device) + max_memory_reserved = torch.cuda.max_memory_reserved(device) + + # Plot memory timeline as stacked data + fig = plt.figure(figsize=figsize, dpi=80) + axes = fig.gca() + for category, color in _CATEGORY_TO_COLORS.items(): + i = _CATEGORY_TO_INDEX[category] + axes.fill_between( + times / 1e3, stacked[:, i], stacked[:, i + 1], color=color, alpha=0.7 + ) + fig.legend(["Unknown" if i is None else i.name for i in _CATEGORY_TO_COLORS]) + # Usually training steps are in magnitude of ms. + axes.set_xlabel("Time (ms)") + axes.set_ylabel("Memory (GB)") + title = "\n\n".join( + ([title] if title else []) + + [ + f"Max memory allocated: {max_memory_allocated/(1024**3):.2f} GiB \n" + f"Max memory reserved: {max_memory_reserved/(1024**3):.2f} GiB" + ] + ) + axes.set_title(title) + + # Embed the memory timeline image into the HTML file + tmpfile = NamedTemporaryFile("wb", suffix=".png", delete=False) + tmpfile.close() + fig.savefig(tmpfile.name, format="png") + + with open(tmpfile.name, "rb") as tmp: + encoded = b64encode(tmp.read()).decode("utf-8") + html = f""" +GPU Memory Timeline HTML + + + +""" + + with open(path, "w") as f: + f.write(html) + remove(tmpfile.name) diff --git a/shared/package-files/9b/9b7ac2e8ca2073a71cd5af5727c14f21885969214d758931699fa97c7846dd7e/blob b/shared/package-files/9b/9b7ac2e8ca2073a71cd5af5727c14f21885969214d758931699fa97c7846dd7e/blob new file mode 100644 index 0000000000000000000000000000000000000000..25c0232d95492333e8c1aef7321a24a331e2e24a Binary files /dev/null and b/shared/package-files/9b/9b7ac2e8ca2073a71cd5af5727c14f21885969214d758931699fa97c7846dd7e/blob differ diff --git a/shared/package-files/9b/9b7c8bd1d4c05d73ca75e619a0bf9958598fd50abe57a63d5f11bb10c43ba2f1/blob b/shared/package-files/9b/9b7c8bd1d4c05d73ca75e619a0bf9958598fd50abe57a63d5f11bb10c43ba2f1/blob new file mode 100644 index 0000000000000000000000000000000000000000..a8a861be0f43531819fcc17ecdf817bce8194950 --- /dev/null +++ b/shared/package-files/9b/9b7c8bd1d4c05d73ca75e619a0bf9958598fd50abe57a63d5f11bb10c43ba2f1/blob @@ -0,0 +1,329 @@ +from torch.fx.passes.utils.fuser_utils import fuse_by_partitions +import collections +import itertools +import logging + +from copy import copy +from typing import Dict, Iterable, List, Optional, Sequence, Set + +from torch.fx.graph_module import GraphModule +from torch.fx.node import Node, _get_qualified_name +from torch.fx.passes.operator_support import OperatorSupportBase + + +logger = logging.getLogger(__name__) +logger.setLevel(logging.WARNING) + +class Partition: + def __init__(self, id: Optional[int] = None, nodes: Optional[Iterable[Node]] = None): + self.id = id + self.nodes: Set[Node] = set(nodes) if nodes is not None else set() + + def __repr__(self) -> str: + return str(self.nodes) + + def add_node(self, node: Node): + self.nodes.add(node) + + def remove_node(self, node: Node): + self.nodes.remove(node) + + def size(self): + return len(self.nodes) + +class _DependencyViewer: + def __init__(self, graph_module: GraphModule): + self.upstreams = collections.defaultdict(set) + self.downstreams = collections.defaultdict(set) + + for node in graph_module.graph.nodes: + for input_node in node.all_input_nodes: + # add input_node and input_node's upstream dependency + self.upstreams[node].add(input_node) + self.upstreams[node].update(self.upstreams[input_node]) + + for node in reversed(graph_module.graph.nodes): + for output_node in node.users: + # add output_node and output_node's downstream dependency + self.downstreams[node].add(output_node) + self.downstreams[node].update(self.downstreams[output_node]) + + def downstreams_of(self, node: Node) -> Set[Node]: + return self.downstreams[node] + + def upstreams_of(self, node: Node) -> Set[Node]: + return self.upstreams[node] + +class CapabilityBasedPartitioner: + + def __init__(self, + graph_module: GraphModule, + operator_support: OperatorSupportBase, + allows_single_node_partition: bool = False, + non_compute_ops: Optional[Sequence[str]] = None, + allowed_single_node_partition_ops: Optional[Sequence[str]] = None, + ) -> None: + self.graph_module = graph_module + self.operator_support = operator_support + self.allows_single_node_partition = allows_single_node_partition + self.non_compute_ops = non_compute_ops if non_compute_ops is not None else [] + self.allowed_single_node_partition_ops = ( + allowed_single_node_partition_ops + if allowed_single_node_partition_ops is not None + else [] + ) + self.dependency_viewer = _DependencyViewer(graph_module) + + def __is_node_supported(self, node: Node) -> bool: + return ( + self.operator_support.is_node_supported(dict(self.graph_module.named_modules()), node) + ) + + def propose_partitions(self) -> List[Partition]: + # partition_map is a mapping from partition id to a set of partition id's. + # The value set contains all the partition ids that can be reached by doing a + # DFS starting from the partition id in the key. + partition_map : Dict[int, Set] = collections.defaultdict(set) + + # assumptions: nodes in candidate list is sorted in topological order + assignment: Dict[Node, int] = {} # mapping from node to partition_id + partitions_by_id: Dict[int, Partition] = {} # mapping from partition_id to partition + new_partition_id = itertools.count() + + # try to merge partition other_id into partition self_id + # merge only happens if the end graph doesn't contain cyclic dependency + # returns `True` when merge happens, `False` otherwise. + def maybe_merge_partition(self_id: int, other_id: int): + # merged_nodes is the union of nodes in two partition to-be-merged + merged_nodes = copy(partitions_by_id[self_id].nodes) + merged_nodes.update(partitions_by_id[other_id].nodes) + + def dfs_iter_find_cycle(all_user_nodes: List[Node]): + for user_node in all_user_nodes: + visited_partition_ids = set() + + for path_node in self.dependency_viewer.downstreams_of(user_node): + # If any of the nodes in the dfs path of this node are in the merged_nodes + # list then there is a cycle in the graph. + if path_node in merged_nodes: + return True + + # If any of the nodes in the dfs path of this node are in the assignment + # map then we have to make sure that the partitions that these nodes belong + # to do not form a cycle with the current partitions being merged. This means + # iterating through all the nodes in all the parititons that are traversed in + # the dfs path and checking if they are in the merged_nodes list. + if path_node in assignment: + partition_id = assignment[path_node] + # If the partition id has already been visited then we know that it doesn't + # form a cycle with the current partitions being merged. + if partition_id in visited_partition_ids: + continue + p_map = partition_map[partition_id] + if self_id in p_map or other_id in p_map: + return True + + visited_partition_ids.add(partition_id) + + return False + + # check if merge would create cyclic dependency. + all_user_nodes = [] + for node in merged_nodes: + for user_node in node.users: + if user_node not in merged_nodes: + all_user_nodes.append(user_node) + + if dfs_iter_find_cycle(all_user_nodes): + # return false indicating cyclic dependency found and + # merge is aborted + return False + + # no cyclic dependency found, move forward with the merge + # updating partition nodes + partitions_by_id[self_id].nodes = merged_nodes + # updating assignment map + for node in partitions_by_id[other_id].nodes: + assignment[node] = self_id + # delete other partition + del partitions_by_id[other_id] + + partition_map[self_id] = partition_map[self_id].union(partition_map[other_id]) + del partition_map[other_id] + + return True + + def merge_single_node(node: Node, id: Optional[int]): + def _update_partition_map(node: Node, id: int): + # Iterate through all the downstream nodes of this node and update the partition map + # to indicate that there is a path from the partition id of this node to the target + # partition id. + downstream_nodes = self.dependency_viewer.downstreams_of(node) + for curr_node in downstream_nodes: + target_id = assignment.get(curr_node, None) + if target_id is not None: + partition_map[id].add(target_id) + + # Iterate through all the upstream nodes of this node and update the partition map + # to indicate that there is a path from the partition id of the upstream node to the + # current node's partition id. + upstream_nodes = self.dependency_viewer.upstreams_of(node) + for curr_node in upstream_nodes: + source_id = assignment.get(curr_node, None) + if source_id is not None: + partition_map[source_id].add(id) + + if node in assignment: + partitions_by_id[assignment[node]].remove_node(node) + + if id is None: + assignment.pop(node) + elif id not in partitions_by_id: + assignment[node] = id + partitions_by_id[id] = Partition(id=id, nodes=[node]) + _update_partition_map(node, id) + else: + assignment[node] = id + partitions_by_id[id].add_node(node) + _update_partition_map(node, id) + + logger.debug("Proposing partitions...") + + for node in reversed(self.graph_module.graph.nodes): + # use Dict as an ordered set to ensure deterministic partitioning result, don't care value + merge_candidates: Dict[int, None] = {} + + # Note a limited horizontal fusion is enabled: + # when `node` is not supported, the code below attempts to fuse consumer of `node`. + # + # I don't see a need to add a knob to disable horizontal fusion yet, we can short-cut + # the fusion by adding an `else` block here to skip horizontal fusion. + if self.__is_node_supported(node) and node not in assignment: + partition_id = next(new_partition_id) + merge_single_node(node, partition_id) + merge_candidates[partition_id] = None + + # merge all possible partitions + for node in assignment: + merge_candidates[assignment[node]] = None + + merge_candidates_list = list(merge_candidates.keys()) + if len(merge_candidates_list) > 1: + self_id = merge_candidates_list[0] + for other_id in merge_candidates_list[1:]: + # note: merge partition `other_id` into partition `self_id` if + # it doesn't create cyclic dependency in the graph, otherwise, + # this is a no-op + maybe_merge_partition(self_id, other_id) + + # post processing to re-assign "getitem" nodes into upstream partition + logger.debug("Reassigning getitem nodes to its producer node's partition...") + nodes_reassignment: Dict[Node, int] = {} + for node in self.graph_module.graph.nodes: + is_tuple_output = True + for user in node.users: + if user.op != "call_function" or \ + _get_qualified_name(user.target) != "_operator.getitem": # type: ignore[arg-type] + is_tuple_output = False + break + + # node has tuple outputs, re-assign all following getitem node into node's partition + if is_tuple_output: + id = assignment.get(node, None) # type: ignore[arg-type] + for user in node.users: + if assignment.get(user, None) != id: # type: ignore[arg-type] + nodes_reassignment[user] = id # type: ignore[assignment] + for node, id in nodes_reassignment.items(): + merge_single_node(node, id) + + # filter out single node partitions + if not self.allows_single_node_partition: + logger.debug("Filtering out single node partitions...") + default_non_compute_ops = {"torch.ops.aten.view", "_operator.getitem"} + non_compute_ops = default_non_compute_ops.union(set(self.non_compute_ops)) + partitions_to_remove: List[int] = [] + for id, partition in partitions_by_id.items(): + compute_node_count = 0 + for node in partition.nodes: + if node.op == "call_function": + assert callable(node.target) + if _get_qualified_name(node.target) not in non_compute_ops: + compute_node_count += 1 + if _get_qualified_name(node.target) in self.allowed_single_node_partition_ops: + compute_node_count += 1 + if compute_node_count <= 1: + partitions_to_remove.append(id) + for id in partitions_to_remove: + del partitions_by_id[id] + + logger.debug("Partitions proposed:") + for id, partition in partitions_by_id.items(): + logger.debug("partition #%s: %s", id, [node.name for node in partition.nodes]) + + return list(partitions_by_id.values()) + + def fuse_partitions(self, partitions: List[Partition]) -> GraphModule: + logger.debug("Fusing partitions...") + # fuse_by_partitions expects partitions in List[List[Node]]: [ [node0, node1], [node2, node3] ] + return fuse_by_partitions(self.graph_module, [list(partition.nodes) for partition in partitions]) + + # remove non-compute-ops that sits at the boundary of a partition. + def remove_bookend_non_compute_ops(self, partitions: List[Partition]): + non_compute_ops = set(self.non_compute_ops) + + def is_non_compute_node(node: Node): + return node.op == "call_function" and \ + _get_qualified_name(node.target) in non_compute_ops # type: ignore[arg-type] + + # cache transparent nodes + transparent_input_nodes: Dict[Node, bool] = {} + transparent_output_nodes: Dict[Node, bool] = {} + + def is_transparent_input_node(node: Node, partition: Set[Node], removed_nodes: Set[Node]): + if node.op == "placeholder" or (node not in partition) or (node in removed_nodes): + return True + if node in transparent_input_nodes: + return transparent_input_nodes[node] + if is_non_compute_node(node): + for input_n in node.all_input_nodes: + if not is_transparent_input_node(input_n, partition, removed_nodes): + transparent_input_nodes[node] = False + return False + transparent_input_nodes[node] = True + return True + transparent_input_nodes[node] = False + return False + + def is_transparent_output_node(node: Node, partition: Set[Node], removed_nodes: Set[Node]): + if node.op == "placeholder" or (node not in partition) or (node in removed_nodes): + return True + if node in transparent_output_nodes: + return transparent_output_nodes[node] + if is_non_compute_node(node): + for output_n in node.users: + if not is_transparent_output_node(output_n, partition, removed_nodes): + transparent_output_nodes[node] = False + return False + transparent_output_nodes[node] = True + return True + transparent_output_nodes[node] = False + return False + + for partition in partitions: + # Note it's ok to use `set` here, since we are only query if a node + # has been removed. We are NEVER going to iterate on nodes inside + # the set. + remove_node: Set[Node] = set() + for node in partition.nodes: + if is_non_compute_node(node) and \ + (is_transparent_input_node(node, partition.nodes, remove_node) or + is_transparent_output_node(node, partition.nodes, remove_node)): + remove_node.add(node) + + if len(remove_node) != 0: + partition.nodes = partition.nodes - remove_node + + def partition_and_fuse(self) -> GraphModule: + partitions = self.propose_partitions() + fused_gm = self.fuse_partitions(partitions) + return fused_gm diff --git a/shared/package-files/9b/9b7d4f55a4e2fdb02c430068fdffabc732addce238da3f1df2690249c3353274/blob b/shared/package-files/9b/9b7d4f55a4e2fdb02c430068fdffabc732addce238da3f1df2690249c3353274/blob new file mode 100644 index 0000000000000000000000000000000000000000..f6752a8efbeb74a7b7b2e74cbb272c422a975363 --- /dev/null +++ b/shared/package-files/9b/9b7d4f55a4e2fdb02c430068fdffabc732addce238da3f1df2690249c3353274/blob @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "contentSchema": { "$recursiveRef": "#" } + } +} diff --git a/shared/package-files/9b/9b7d69d168dc15419c91b2621e70a949a2101aabfe2eae6788862475ddf760ca/blob b/shared/package-files/9b/9b7d69d168dc15419c91b2621e70a949a2101aabfe2eae6788862475ddf760ca/blob new file mode 100644 index 0000000000000000000000000000000000000000..0fc070b34c381ecdf8e8bb0d015bb799313a232e --- /dev/null +++ b/shared/package-files/9b/9b7d69d168dc15419c91b2621e70a949a2101aabfe2eae6788862475ddf760ca/blob @@ -0,0 +1,234 @@ +""" +Array methods which are called by both the C-code for the method +and the Python code for the NumPy-namespace function + +""" +import warnings +from contextlib import nullcontext + +from numpy.core import multiarray as mu +from numpy.core import umath as um +from numpy.core.multiarray import asanyarray +from numpy.core import numerictypes as nt +from numpy.core import _exceptions +from numpy.core._ufunc_config import _no_nep50_warning +from numpy._globals import _NoValue +from numpy.compat import pickle, os_fspath + +# save those O(100) nanoseconds! +umr_maximum = um.maximum.reduce +umr_minimum = um.minimum.reduce +umr_sum = um.add.reduce +umr_prod = um.multiply.reduce +umr_any = um.logical_or.reduce +umr_all = um.logical_and.reduce + +# Complex types to -> (2,)float view for fast-path computation in _var() +_complex_to_float = { + nt.dtype(nt.csingle) : nt.dtype(nt.single), + nt.dtype(nt.cdouble) : nt.dtype(nt.double), +} +# Special case for windows: ensure double takes precedence +if nt.dtype(nt.longdouble) != nt.dtype(nt.double): + _complex_to_float.update({ + nt.dtype(nt.clongdouble) : nt.dtype(nt.longdouble), + }) + +# avoid keyword arguments to speed up parsing, saves about 15%-20% for very +# small reductions +def _amax(a, axis=None, out=None, keepdims=False, + initial=_NoValue, where=True): + return umr_maximum(a, axis, None, out, keepdims, initial, where) + +def _amin(a, axis=None, out=None, keepdims=False, + initial=_NoValue, where=True): + return umr_minimum(a, axis, None, out, keepdims, initial, where) + +def _sum(a, axis=None, dtype=None, out=None, keepdims=False, + initial=_NoValue, where=True): + return umr_sum(a, axis, dtype, out, keepdims, initial, where) + +def _prod(a, axis=None, dtype=None, out=None, keepdims=False, + initial=_NoValue, where=True): + return umr_prod(a, axis, dtype, out, keepdims, initial, where) + +def _any(a, axis=None, dtype=None, out=None, keepdims=False, *, where=True): + # Parsing keyword arguments is currently fairly slow, so avoid it for now + if where is True: + return umr_any(a, axis, dtype, out, keepdims) + return umr_any(a, axis, dtype, out, keepdims, where=where) + +def _all(a, axis=None, dtype=None, out=None, keepdims=False, *, where=True): + # Parsing keyword arguments is currently fairly slow, so avoid it for now + if where is True: + return umr_all(a, axis, dtype, out, keepdims) + return umr_all(a, axis, dtype, out, keepdims, where=where) + +def _count_reduce_items(arr, axis, keepdims=False, where=True): + # fast-path for the default case + if where is True: + # no boolean mask given, calculate items according to axis + if axis is None: + axis = tuple(range(arr.ndim)) + elif not isinstance(axis, tuple): + axis = (axis,) + items = 1 + for ax in axis: + items *= arr.shape[mu.normalize_axis_index(ax, arr.ndim)] + items = nt.intp(items) + else: + # TODO: Optimize case when `where` is broadcast along a non-reduction + # axis and full sum is more excessive than needed. + + # guarded to protect circular imports + from numpy.lib.stride_tricks import broadcast_to + # count True values in (potentially broadcasted) boolean mask + items = umr_sum(broadcast_to(where, arr.shape), axis, nt.intp, None, + keepdims) + return items + +def _clip(a, min=None, max=None, out=None, **kwargs): + if min is None and max is None: + raise ValueError("One of max or min must be given") + + if min is None: + return um.minimum(a, max, out=out, **kwargs) + elif max is None: + return um.maximum(a, min, out=out, **kwargs) + else: + return um.clip(a, min, max, out=out, **kwargs) + +def _mean(a, axis=None, dtype=None, out=None, keepdims=False, *, where=True): + arr = asanyarray(a) + + is_float16_result = False + + rcount = _count_reduce_items(arr, axis, keepdims=keepdims, where=where) + if rcount == 0 if where is True else umr_any(rcount == 0, axis=None): + warnings.warn("Mean of empty slice.", RuntimeWarning, stacklevel=2) + + # Cast bool, unsigned int, and int to float64 by default + if dtype is None: + if issubclass(arr.dtype.type, (nt.integer, nt.bool_)): + dtype = mu.dtype('f8') + elif issubclass(arr.dtype.type, nt.float16): + dtype = mu.dtype('f4') + is_float16_result = True + + ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) + if isinstance(ret, mu.ndarray): + with _no_nep50_warning(): + ret = um.true_divide( + ret, rcount, out=ret, casting='unsafe', subok=False) + if is_float16_result and out is None: + ret = arr.dtype.type(ret) + elif hasattr(ret, 'dtype'): + if is_float16_result: + ret = arr.dtype.type(ret / rcount) + else: + ret = ret.dtype.type(ret / rcount) + else: + ret = ret / rcount + + return ret + +def _var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, + where=True): + arr = asanyarray(a) + + rcount = _count_reduce_items(arr, axis, keepdims=keepdims, where=where) + # Make this warning show up on top. + if ddof >= rcount if where is True else umr_any(ddof >= rcount, axis=None): + warnings.warn("Degrees of freedom <= 0 for slice", RuntimeWarning, + stacklevel=2) + + # Cast bool, unsigned int, and int to float64 by default + if dtype is None and issubclass(arr.dtype.type, (nt.integer, nt.bool_)): + dtype = mu.dtype('f8') + + # Compute the mean. + # Note that if dtype is not of inexact type then arraymean will + # not be either. + arrmean = umr_sum(arr, axis, dtype, keepdims=True, where=where) + # The shape of rcount has to match arrmean to not change the shape of out + # in broadcasting. Otherwise, it cannot be stored back to arrmean. + if rcount.ndim == 0: + # fast-path for default case when where is True + div = rcount + else: + # matching rcount to arrmean when where is specified as array + div = rcount.reshape(arrmean.shape) + if isinstance(arrmean, mu.ndarray): + with _no_nep50_warning(): + arrmean = um.true_divide(arrmean, div, out=arrmean, + casting='unsafe', subok=False) + elif hasattr(arrmean, "dtype"): + arrmean = arrmean.dtype.type(arrmean / rcount) + else: + arrmean = arrmean / rcount + + # Compute sum of squared deviations from mean + # Note that x may not be inexact and that we need it to be an array, + # not a scalar. + x = asanyarray(arr - arrmean) + + if issubclass(arr.dtype.type, (nt.floating, nt.integer)): + x = um.multiply(x, x, out=x) + # Fast-paths for built-in complex types + elif x.dtype in _complex_to_float: + xv = x.view(dtype=(_complex_to_float[x.dtype], (2,))) + um.multiply(xv, xv, out=xv) + x = um.add(xv[..., 0], xv[..., 1], out=x.real).real + # Most general case; includes handling object arrays containing imaginary + # numbers and complex types with non-native byteorder + else: + x = um.multiply(x, um.conjugate(x), out=x).real + + ret = umr_sum(x, axis, dtype, out, keepdims=keepdims, where=where) + + # Compute degrees of freedom and make sure it is not negative. + rcount = um.maximum(rcount - ddof, 0) + + # divide by degrees of freedom + if isinstance(ret, mu.ndarray): + with _no_nep50_warning(): + ret = um.true_divide( + ret, rcount, out=ret, casting='unsafe', subok=False) + elif hasattr(ret, 'dtype'): + ret = ret.dtype.type(ret / rcount) + else: + ret = ret / rcount + + return ret + +def _std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, + where=True): + ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof, + keepdims=keepdims, where=where) + + if isinstance(ret, mu.ndarray): + ret = um.sqrt(ret, out=ret) + elif hasattr(ret, 'dtype'): + ret = ret.dtype.type(um.sqrt(ret)) + else: + ret = um.sqrt(ret) + + return ret + +def _ptp(a, axis=None, out=None, keepdims=False): + return um.subtract( + umr_maximum(a, axis, None, out, keepdims), + umr_minimum(a, axis, None, None, keepdims), + out + ) + +def _dump(self, file, protocol=2): + if hasattr(file, 'write'): + ctx = nullcontext(file) + else: + ctx = open(os_fspath(file), "wb") + with ctx as f: + pickle.dump(self, f, protocol=protocol) + +def _dumps(self, protocol=2): + return pickle.dumps(self, protocol=protocol) diff --git a/shared/package-files/9b/9b7e40ee33b9e3130d800e30e44767d62fd21db5d6065a504d12cc47c1a06d91/blob b/shared/package-files/9b/9b7e40ee33b9e3130d800e30e44767d62fd21db5d6065a504d12cc47c1a06d91/blob new file mode 100644 index 0000000000000000000000000000000000000000..ed78f6ee78676cd429cb9ad11a28e9046745e5d3 --- /dev/null +++ b/shared/package-files/9b/9b7e40ee33b9e3130d800e30e44767d62fd21db5d6065a504d12cc47c1a06d91/blob @@ -0,0 +1,109 @@ +"""Numerical Methods for Holonomic Functions""" + +from sympy.core.sympify import sympify +from sympy.holonomic.holonomic import DMFsubs + +from mpmath import mp + + +def _evalf(func, points, derivatives=False, method='RK4'): + """ + Numerical methods for numerical integration along a given set of + points in the complex plane. + """ + + ann = func.annihilator + a = ann.order + R = ann.parent.base + K = R.get_field() + + if method == 'Euler': + meth = _euler + else: + meth = _rk4 + + dmf = [] + for j in ann.listofpoly: + dmf.append(K.new(j.rep)) + + red = [-dmf[i] / dmf[a] for i in range(a)] + + y0 = func.y0 + if len(y0) < a: + raise TypeError("Not Enough Initial Conditions") + x0 = func.x0 + sol = [meth(red, x0, points[0], y0, a)] + + for i, j in enumerate(points[1:]): + sol.append(meth(red, points[i], j, sol[-1], a)) + + if not derivatives: + return [sympify(i[0]) for i in sol] + else: + return sympify(sol) + + +def _euler(red, x0, x1, y0, a): + """ + Euler's method for numerical integration. + From x0 to x1 with initial values given at x0 as vector y0. + """ + + A = sympify(x0)._to_mpmath(mp.prec) + B = sympify(x1)._to_mpmath(mp.prec) + y_0 = [sympify(i)._to_mpmath(mp.prec) for i in y0] + h = B - A + f_0 = y_0[1:] + f_0_n = 0 + + for i in range(a): + f_0_n += sympify(DMFsubs(red[i], A, mpm=True))._to_mpmath(mp.prec) * y_0[i] + f_0.append(f_0_n) + + sol = [] + for i in range(a): + sol.append(y_0[i] + h * f_0[i]) + + return sol + + +def _rk4(red, x0, x1, y0, a): + """ + Runge-Kutta 4th order numerical method. + """ + + A = sympify(x0)._to_mpmath(mp.prec) + B = sympify(x1)._to_mpmath(mp.prec) + y_0 = [sympify(i)._to_mpmath(mp.prec) for i in y0] + h = B - A + + f_0_n = 0 + f_1_n = 0 + f_2_n = 0 + f_3_n = 0 + + f_0 = y_0[1:] + for i in range(a): + f_0_n += sympify(DMFsubs(red[i], A, mpm=True))._to_mpmath(mp.prec) * y_0[i] + f_0.append(f_0_n) + + f_1 = [y_0[i] + f_0[i]*h/2 for i in range(1, a)] + for i in range(a): + f_1_n += sympify(DMFsubs(red[i], A + h/2, mpm=True))._to_mpmath(mp.prec) * (y_0[i] + f_0[i]*h/2) + f_1.append(f_1_n) + + f_2 = [y_0[i] + f_1[i]*h/2 for i in range(1, a)] + for i in range(a): + f_2_n += sympify(DMFsubs(red[i], A + h/2, mpm=True))._to_mpmath(mp.prec) * (y_0[i] + f_1[i]*h/2) + f_2.append(f_2_n) + + f_3 = [y_0[i] + f_2[i]*h for i in range(1, a)] + for i in range(a): + f_3_n += sympify(DMFsubs(red[i], A + h, mpm=True))._to_mpmath(mp.prec) * (y_0[i] + f_2[i]*h) + f_3.append(f_3_n) + + sol = [] + for i in range(a): + sol.append(y_0[i] + h * (f_0[i]+2*f_1[i]+2*f_2[i]+f_3[i])/6) + + return sol diff --git a/shared/package-files/9b/9b8280d86ff5b59acd6ff6f3f7773279ffddb6a6f7f90befc8516f754879e456/blob b/shared/package-files/9b/9b8280d86ff5b59acd6ff6f3f7773279ffddb6a6f7f90befc8516f754879e456/blob new file mode 100644 index 0000000000000000000000000000000000000000..ebd57885f7a3e2baf6413c8a80dee50f3b225512 --- /dev/null +++ b/shared/package-files/9b/9b8280d86ff5b59acd6ff6f3f7773279ffddb6a6f7f90befc8516f754879e456/blob @@ -0,0 +1,8292 @@ +error(0.005738792515934738013) D0 D3 +error(0.002892177266741002666) D0 D3 ^ D17 +error(0.005000000000000000104) D0 D4 +error(0.04529947568678773656) D0 D13 +error(0.00196214642863473546) D0 D13 ^ D16 D17 +error(0.001926440274912942204) D0 D13 ^ D17 +error(0.003068862807239747595) D0 D18 +error(0.004668379659950527664) D0 D18 ^ D16 +error(0.0006604984858497493522) D0 D18 ^ D16 ^ D17 +error(0.004685577192470240931) D0 D19 +error(0.001166192889339129173) D0 D19 ^ D16 +error(0.001212436291195728233) D0 D19 ^ D16 D17 +error(0.0006831780515242269394) D0 D19 ^ D17 +error(0.01000000000000000021) D0 L0 +error(0.005000000000000000104) D1 D4 +error(0.003859687226969412983) D1 D4 ^ D23 +error(0.007518540583631383445) D1 D5 +error(0.02540081698367964783) D1 D18 +error(0.00260621747142614343) D1 D18 ^ D22 D23 +error(0.0003165905433926746097) D1 D18 ^ D23 +error(0.002186016812537448176) D1 D26 +error(0.001798305660625366953) D1 D26 ^ D22 +error(0.0003544721554983746919) D1 D26 ^ D22 ^ D23 +error(0.006298954618930087575) D1 D27 +error(0.001105305570498567877) D1 D27 ^ D22 +error(0.001522811927043724554) D1 D27 ^ D22 D23 +error(0.002114448571588042197) D1 D27 ^ D23 +error(0.01000000000000000021) D1 L0 +error(0.007415987773362442415) D2 D5 +error(0.01247031654893260288) D2 D26 +error(0.006931786126200884489) D2 L0 +error(0.006008748248773621015) D3 D6 +error(0.002953765812142654032) D3 D13 +error(0.002109456899423808873) D3 D13 ^ D17 +error(0.02179741968703418145) D3 D14 +error(0.01133861275399818472) D3 D14 ^ D17 +error(0.00246829274596901526) D3 D19 +error(0.0008602119285307474562) D3 D19 ^ D17 +error(0.006960308529301790885) D3 D20 +error(0.002366894229640046591) D3 D20 ^ D17 +error(0.008455938530586969842) D4 D6 +error(0.004037578125479839193) D4 D6 ^ D24 +error(0.005000000000000000104) D4 D7 +error(0.00149619995641523079) D4 D18 +error(0.000983190648075908365) D4 D18 ^ D23 +error(0.0002682778572938893948) D4 D18 ^ D23 ^ D24 +error(0.0004632420954550846943) D4 D18 ^ D24 +error(0.03409301179824574674) D4 D19 +error(0.001214303828703351077) D4 D19 ^ D23 D24 +error(0.001332293947278176925) D4 D19 ^ D24 +error(0.001352666227257557155) D4 D27 +error(0.002998103899736318662) D4 D27 ^ D23 +error(0.0006823534041407382537) D4 D27 ^ D23 ^ D24 +error(0.0001709168941434724399) D4 D27 ^ D24 +error(0.002582818430563622696) D4 D28 +error(0.001907874531502393471) D4 D28 ^ D23 D24 +error(0.002908053071078907804) D4 D28 ^ D24 +error(0.01367043250640035193) D5 D7 +error(0.006788509964381764412) D5 D7 ^ D30 +error(0.007728737658688256129) D5 D8 +error(0.005249191482489023834) D5 D26 +error(0.0002994755199555485621) D5 D26 ^ D30 +error(0.02427113519844152634) D5 D27 +error(0.006154414678477593964) D5 D27 ^ D30 +error(0.00241062540922135863) D5 D33 +error(0.004304069228454017633) D5 D33 ^ D30 +error(0.006775624584694583605) D6 D9 +error(0.005583375675962063897) D6 D9 ^ D25 +error(0.005000000000000000104) D6 D10 +error(0.001505317074853314459) D6 D19 +error(0.003374319247706229416) D6 D19 ^ D24 +error(0.0003052041305345725721) D6 D19 ^ D24 ^ D25 +error(0.01599898167300038698) D6 D20 +error(0.001188534204403670844) D6 D20 ^ D24 +error(0.00310531214035007384) D6 D20 ^ D24 D25 +error(0.0009548779057798816809) D6 D20 ^ D25 +error(0.001192181949886745489) D6 D28 +error(0.00256880464658883808) D6 D28 ^ D24 +error(0.003643486705044700173) D6 D29 +error(0.0001456528223701083927) D6 D29 ^ D24 +error(0.00161068544681789382) D6 D29 ^ D24 D25 +error(0.002105979911457814616) D6 D29 ^ D25 +error(0.005197578107814205053) D7 D10 +error(0.003717905448097484113) D7 D10 ^ D31 +error(0.006390941378249415106) D7 D11 +error(0.004980903558889576178) D7 D27 +error(0.006140700770709178573) D7 D27 ^ D30 +error(0.001102120692382148629) D7 D27 ^ D30 ^ D31 +error(0.0002501508098055737084) D7 D27 ^ D31 +error(0.01550728083098681064) D7 D28 +error(0.002173537872414004011) D7 D28 ^ D30 +error(0.002215994309159653383) D7 D28 ^ D30 D31 +error(0.001104452598548275087) D7 D28 ^ D31 +error(0.002149741333732394736) D7 D33 +error(0.001537104131125324432) D7 D33 ^ D30 +error(0.0003612093722035652002) D7 D33 ^ D30 ^ D31 +error(0.0001842879220985582547) D7 D33 ^ D31 +error(0.005754412845639877983) D7 D34 +error(0.001411602780875293546) D7 D34 ^ D30 +error(0.0008242961330851771799) D7 D34 ^ D30 D31 +error(0.001832572725604204736) D7 D34 ^ D31 +error(0.006188293188413740431) D8 D11 +error(0.02953083908936599) D8 D33 +error(0.008088106449506396803) D9 +error(0.002626896330917793693) D9 D20 +error(0.003014572524307634286) D9 D20 ^ D25 +error(0.02795928419704436785) D9 D21 +error(0.002408274182559920918) D9 D21 ^ D25 +error(0.002734696091652129464) D9 D29 +error(0.002073837572745514026) D9 D29 ^ D25 +error(0.01136741043149903756) D10 +error(0.00180143927858043471) D10 D28 +error(0.003020610275846448509) D10 D28 ^ D31 +error(0.0008372242571019296092) D10 D28 ^ D32 +error(0.01837772139621235076) D10 D29 +error(0.001700099765263150429) D10 D29 ^ D31 +error(0.0003507125407660387586) D10 D29 ^ D31 D32 +error(0.001510477911537713887) D10 D29 ^ D32 +error(0.001906935849810612949) D10 D34 +error(0.001384168503225886599) D10 D34 ^ D31 +error(0.0041378623226094478) D10 ^ D32 +error(0.01381916498082217011) D11 +error(0.00337553939489320309) D11 D33 +error(0.0004679260902118626301) D11 D33 ^ D35 +error(0.0215123520092380463) D11 D34 +error(0.003397444934549738275) D11 D34 ^ D35 +error(0.006585360881193089155) D11 ^ D35 +error(0.01409875423794876292) D12 +error(0.01330946953528408354) D12 D16 +error(0.01238062660195660483) D12 D16 ^ D13 L0 +error(0.0272133096145726304) D12 D36 +error(0.009354172066671974373) D12 D36 ^ D37 L0 +error(0.006575429550073013871) D12 D40 +error(0.006606814816559495283) D12 D40 ^ D13 L0 +error(0.00570203587243049443) D12 D40 ^ D37 L0 +error(0.004394467297965208054) D12 D40 ^ D37 L0 ^ D13 L0 +error(0.003141484544212969771) D12 D41 +error(0.002866645116274591214) D12 D41 ^ D13 D37 +error(0.0007467639087963555584) D12 D41 ^ D13 L0 +error(0.00100340881217143808) D12 D41 ^ D37 L0 +error(0.005000000000000000104) D12 ^ D13 L0 +error(0.006716177406890511993) D13 D37 ^ D12 +error(0.005000000000000000104) D13 D14 +error(0.001542670624795642849) D13 D14 ^ D12 +error(0.0001779973062472341389) D13 D14 ^ D16 D17 +error(0.0005690671345596917631) D13 D14 ^ D16 D41 +error(0.01043349291829406833) D13 D14 ^ D17 +error(0.004686760244772980415) D13 D14 ^ D17 D41 +error(0.003622701663117294888) D13 D14 ^ D41 +error(0.0006213698150018824758) D13 D14 ^ D41 ^ D12 +error(0.0223391519007514229) D13 D19 +error(0.01155662502264459199) D13 D19 ^ D16 D17 +error(0.05139236901086036841) D13 D37 +error(0.003561108508096676607) D13 D37 ^ D40 D41 +error(0.0046639615040387555) D13 D37 ^ D41 +error(0.004108367013198443128) D13 D42 +error(0.001863368595620282274) D13 D42 ^ D16 D40 +error(0.0002077739562874012804) D13 D42 ^ D16 D41 +error(0.0001534208996732992975) D13 D42 ^ D40 D41 +error(0.002474351314484049547) D13 D43 +error(0.001842181383880251615) D13 D43 ^ D16 D17 +error(0.0007357888818581343913) D13 D43 ^ D16 D40 +error(0.002176810431023448646) D13 D43 ^ D16 D41 +error(0.0009865289460392872439) D13 D43 ^ D17 D41 +error(0.002351214005477396222) D13 D43 ^ D40 D41 +error(0.01000000000000000021) D13 L0 +error(0.01587609383139901992) D14 D20 +error(0.01341176736532151588) D14 D20 ^ D17 +error(0.005959798576863498468) D14 D37 +error(0.000405679075595877963) D14 D37 ^ D12 +error(0.006365081479756801858) D14 D37 ^ D41 +error(0.0006185446772456166349) D14 D37 ^ D41 ^ D12 +error(0.02877376894243781) D14 D38 +error(0.01462010353799540405) D14 D38 ^ D41 +error(0.00255626787296149658) D14 D43 +error(0.0003462302675103233517) D14 D43 ^ D16 D17 +error(0.0006259573259455081164) D14 D43 ^ D16 D41 +error(0.001780026776757265587) D14 D43 ^ D17 D41 +error(0.0007765183634651079674) D14 D43 ^ D41 +error(0.004204068823748800116) D14 D44 +error(0.004448751937011490021) D14 D44 ^ D17 +error(0.002493712434291736613) D14 D44 ^ D41 +error(0.002122847769795885211) D14 D44 ^ D41 ^ D17 +error(0.007761620805083521007) D15 +error(0.008857394850643147272) D15 D16 +error(0.001203993110484637271) D15 D16 ^ D13 L0 +error(0.0002307699939975541058) D15 D16 ^ D18 D19 +error(0.002505525127704565005) D15 D16 ^ D18 D42 +error(0.009342171882740092637) D15 D16 ^ D18 L0 +error(0.0001464483877319481696) D15 D16 ^ D19 D42 +error(0.001791079838534594517) D15 D16 ^ D42 L0 +error(0.000306018137642829612) D15 D16 ^ D42 L0 ^ D13 L0 +error(0.01304724050509726424) D15 D22 +error(0.01383866552888161211) D15 D22 ^ D18 L0 +error(0.02308764085533153432) D15 D39 +error(0.00431467884365783691) D15 D39 ^ D42 L0 +error(0.001931307837553560523) D15 D40 +error(0.0008665267816730684537) D15 D40 ^ D13 L0 +error(0.002496274199622507042) D15 D40 ^ D42 L0 +error(0.0003964385681257144838) D15 D40 ^ D42 L0 ^ D13 L0 +error(0.003466727401050739669) D15 D46 +error(0.004164332635934311043) D15 D46 ^ D18 L0 +error(0.002681973973769409981) D15 D46 ^ D42 L0 +error(0.001643190028824071487) D15 D46 ^ D42 L0 ^ D18 L0 +error(0.002347213007440165141) D15 D47 +error(1.438422088529517882e-05) D15 D47 ^ D18 D19 +error(0.001602485993920255191) D15 D47 ^ D18 D42 +error(0.0003906309354926121866) D15 D47 ^ D18 L0 +error(0.0002462750543915511142) D15 D47 ^ D19 D42 +error(0.0003195674037454942704) D15 D47 ^ D42 L0 +error(0.005000000000000000104) D15 ^ D18 L0 +error(0.01000000000000000021) D16 +error(0.009903132076893897753) D16 D17 +error(0.000223206317989857716) D16 D17 ^ D19 D20 +error(0.00193254128555270981) D16 D17 ^ D19 D43 +error(6.236263047404961928e-05) D16 D17 ^ D20 D43 +error(0.01082633342882985926) D16 D23 +error(0.01060000277676159154) D16 D23 ^ D18 D19 +error(0.02897098431077184053) D16 D40 +error(0.009580229984338856086) D16 D40 ^ D13 L0 +error(0.003392722770150778579) D16 D40 ^ D42 D43 +error(0.0009747224564062936412) D16 D40 ^ D42 L0 +error(0.002252326138938211871) D16 D41 +error(0.0005634108258186226606) D16 D41 ^ D42 D43 +error(0.002115175773512700461) D16 D47 +error(0.0030608781621897568) D16 D47 ^ D18 D19 +error(0.001270789941476938327) D16 D47 ^ D18 D42 +error(0.001939096001487852121) D16 D47 ^ D19 D42 +error(0.001187976190653792109) D16 D47 ^ D19 D43 +error(0.002026211267946444097) D16 D47 ^ D42 D43 +error(0.0009157719035976701148) D16 D48 +error(0.0001672286054041389081) D16 D48 ^ D19 D20 +error(0.0005353541060028568126) D16 D48 ^ D19 D42 +error(0.001349693943062659982) D16 D48 ^ D19 D43 +error(0.0001999317661850497118) D16 D48 ^ D20 D43 +error(0.0005670826236588418032) D16 D48 ^ D42 D43 +error(0.003823649697720203373) D16 ^ D0 L0 +error(0.00156650374511192454) D16 ^ D13 L0 ^ D0 L0 +error(0.0009892992248723901476) D16 ^ D17 ^ D0 L0 +error(0.02366479428246713243) D17 +error(0.02450788402153993364) D17 D24 +error(0.02637112022883449439) D17 D24 ^ D19 D20 +error(0.03329807480613649479) D17 D41 +error(0.002054421110880488236) D17 D41 ^ D43 D44 +error(0.005139440185035600017) D17 D48 +error(0.002101194335119418565) D17 D48 ^ D19 D20 +error(0.0008922567876475901794) D17 D48 ^ D19 D43 +error(0.002032431206016870138) D17 D48 ^ D20 D43 +error(0.0005572318529482796516) D17 D48 ^ D20 D44 +error(0.002750366226549339366) D17 D48 ^ D43 D44 +error(0.001460790359938684765) D17 D49 +error(0.0004147934522296172497) D17 D49 ^ D20 D43 +error(0.001498989588066860232) D17 D49 ^ D20 D44 +error(0.003458180810413204794) D17 ^ D0 L0 +error(0.001204110904397977504) D17 ^ D13 L0 +error(0.009956528137369443157) D18 D19 +error(0.002800070822904534868) D18 D19 ^ D16 +error(0.0005316714048711027344) D18 D19 ^ D17 +error(0.0009830014189152035814) D18 D19 ^ D22 D23 +error(0.0001425002969150308049) D18 D19 ^ D22 D47 +error(0.003116901364237378153) D18 D19 ^ D23 D47 +error(0.00173146917282060572) D18 D19 ^ D23 ^ D24 +error(0.001449507818786465547) D18 D19 ^ D24 +error(0.01370951511733036268) D18 D27 +error(0.01303722507250428854) D18 D27 ^ D22 D23 +error(0.03336402185735180131) D18 D42 +error(0.00244917592564833364) D18 D42 ^ D46 D47 +error(0.002462421301947203146) D18 D50 +error(0.001960634436970778299) D18 D50 ^ D22 D46 +error(3.566087944092823308e-06) D18 D50 ^ D22 D47 +error(0.0001637216941453993634) D18 D50 ^ D46 D47 +error(0.004695941015552158003) D18 D51 +error(0.00205837118508770409) D18 D51 ^ D22 D23 +error(0.002163953410575679935) D18 D51 ^ D22 D46 +error(0.001554394982217835453) D18 D51 ^ D22 D47 +error(0.0008879695541101345754) D18 D51 ^ D23 D47 +error(0.002096192257208842526) D18 D51 ^ D46 D47 +error(0.01000000000000000021) D18 L0 +error(0.004381884530454759931) D22 D46 ^ D18 L0 +error(0.005000000000000000104) D19 D20 +error(0.001981828399244284482) D19 D20 ^ D17 +error(0.0006853110733534035093) D19 D20 ^ D23 D24 +error(0.0008131714298475562147) D19 D20 ^ D23 D48 +error(0.003608661191744129242) D19 D20 ^ D24 +error(0.001649440750181971295) D19 D20 ^ D24 D48 +error(0.003448990255769575092) D19 D20 ^ D25 +error(0.01713460274526635782) D19 D28 +error(0.01539457679976539636) D19 D28 ^ D23 D24 +error(0.003194379691095217307) D19 D42 +error(0.000203690984695900824) D19 D42 ^ D47 D48 +error(0.04189958697952669148) D19 D43 +error(0.002152911101466412069) D19 D43 ^ D47 D48 +error(0.00127605215256659083) D19 D51 +error(0.0001706398503003628525) D19 D51 ^ D22 D23 +error(0.0005783336597214276545) D19 D51 ^ D22 D47 +error(0.002016020127898890141) D19 D51 ^ D23 D47 +error(0.0001968335352046341011) D19 D51 ^ D23 D48 +error(0.0001375362953422371091) D19 D51 ^ D47 D48 +error(0.0009834825476811148021) D19 D52 +error(0.00207981557623123552) D19 D52 ^ D23 D24 +error(0.001841441603780133614) D19 D52 ^ D23 D47 +error(0.002505923860524120889) D19 D52 ^ D23 D48 +error(0.001419084695213386135) D19 D52 ^ D24 D48 +error(0.002852296504457221913) D19 D52 ^ D47 D48 +error(0.005229254977955974035) D20 D21 +error(0.001756748588152476408) D20 D21 ^ D17 +error(0.0006494764614559878557) D20 D21 ^ D24 D25 +error(0.000553630490138258915) D20 D21 ^ D24 D49 +error(0.01219799792520794013) D20 D21 ^ D25 +error(0.005790639639282292236) D20 D21 ^ D25 D49 +error(0.001145685949262297476) D20 D21 ^ D49 +error(0.0003259075124975205589) D20 D21 ^ D49 ^ D17 +error(0.01611799871484921251) D20 D29 +error(0.01131163576983915467) D20 D29 ^ D24 D25 +error(0.003447214799424203578) D20 D43 +error(0.0003666576516136855319) D20 D43 ^ D48 D49 +error(0.02223358031578045318) D20 D44 +error(0.005543803677485251852) D20 D44 ^ D17 +error(0.002210910752504785439) D20 D44 ^ D48 D49 +error(0.001379541549716805683) D20 D44 ^ D49 +error(0.002924885832784762055) D20 D52 +error(0.001574022131985900515) D20 D52 ^ D24 D48 +error(0.0003547034745176052173) D20 D52 ^ D24 D49 +error(0.0002399940007932416046) D20 D52 ^ D48 D49 +error(0.002619265017415267974) D20 D53 +error(0.00158241141465816147) D20 D53 ^ D24 D25 +error(0.0004730953369301131323) D20 D53 ^ D24 D48 +error(0.002269905077607368895) D20 D53 ^ D24 D49 +error(0.0006264493750148219901) D20 D53 ^ D25 D49 +error(0.001918993207104307793) D20 D53 ^ D48 D49 +error(0.02100584660398151227) D21 +error(0.002469986989841304811) D21 D44 +error(8.555696620424324658e-05) D21 D44 ^ D17 +error(0.002594304494337347066) D21 D44 ^ D49 +error(0.0001376299769938429572) D21 D44 ^ D49 ^ D17 +error(0.03458993767437905376) D21 D45 +error(0.00595402342578680091) D21 D45 ^ D49 +error(0.00245631142944030675) D21 D53 +error(0.0003152919029694442122) D21 D53 ^ D24 D25 +error(0.0001612541715673219793) D21 D53 ^ D24 D49 +error(0.002267685579689308461) D21 D53 ^ D25 D49 +error(0.02297746819885376421) D21 ^ D25 +error(0.002041494666156196645) D21 ^ D49 ^ D25 +error(0.05460050140733203189) D22 +error(0.01039915513394729964) D22 D23 +error(0.0001527565957248858022) D22 D23 ^ D27 D28 +error(0.001982134764997857141) D22 D23 ^ D27 D51 +error(0.000425289327455776172) D22 D23 ^ D28 D51 +error(0.05297676665932575524) D22 D46 +error(0.003462771653202506312) D22 D46 ^ D50 D51 +error(0.00322690889612168132) D22 D47 +error(0.000497833939171843853) D22 D47 ^ D50 D51 +error(0.002260264554825750123) D22 D54 +error(0.0003473527278594572667) D22 D54 ^ D27 D28 +error(0.0008431892706171371455) D22 D54 ^ D27 D51 +error(0.0003892606543198490589) D22 D54 ^ D28 D51 +error(0.003448769764004406581) D22 ^ D1 L0 +error(0.0008327205743476681762) D22 ^ D18 L0 ^ D1 L0 +error(0.0002010494444407226065) D22 ^ D23 ^ D18 L0 +error(0.01430414767928336016) D22 ^ D26 L0 +error(0.004358707189286150849) D26 D50 ^ D22 +error(0.01000000000000000021) D23 +error(0.0127239052165365827) D23 D24 +error(0.001472212060453364189) D23 D24 ^ D28 D29 +error(0.001718406529616470267) D23 D24 ^ D28 D52 +error(0.0003621508437235534191) D23 D24 ^ D29 D52 +error(0.01894572334774670061) D23 D30 +error(0.01666646270499232488) D23 D30 ^ D27 D28 +error(0.02960309792484100769) D23 D47 +error(0.002696425463454497993) D23 D47 ^ D51 D52 +error(0.004542445374810293035) D23 D48 +error(0.0004787390755988302541) D23 D48 ^ D51 D52 +error(0.005783598058333213297) D23 D54 +error(0.006313383773074134758) D23 D54 ^ D27 D28 +error(0.001741030225433118535) D23 D54 ^ D27 D51 +error(0.007616179929498220411) D23 D54 ^ D28 D51 +error(0.002095215870669062119) D23 D54 ^ D28 D52 +error(0.003866228108010479232) D23 D54 ^ D51 D52 +error(0.001007778755732767137) D23 D55 +error(0.000791992306397491623) D23 D55 ^ D28 D29 +error(0.000442838744421881808) D23 D55 ^ D28 D51 +error(0.0011264348417513437) D23 D55 ^ D28 D52 +error(0.0007294911408703053015) D23 D55 ^ D29 D52 +error(0.0006790628791750554817) D23 D55 ^ D51 D52 +error(0.0007870291495151385134) D23 ^ D1 L0 +error(0.01000000000000000021) D24 +error(0.007852585727606671562) D24 D25 +error(0.001830493767202687975) D24 D25 ^ D29 D53 +error(2.861025836566403991e-05) D24 D25 ^ D53 +error(0.01163625754281121839) D24 D31 +error(0.009198099824959622695) D24 D31 ^ D28 D29 +error(0.02213619326971636922) D24 D48 +error(0.002579554369470707462) D24 D48 ^ D52 D53 +error(0.003236307905156624899) D24 D49 +error(0.0005079835293430067563) D24 D49 ^ D52 D53 +error(0.001390683905584838868) D24 D55 +error(0.002396077516820634395) D24 D55 ^ D28 D29 +error(0.001515604606709302846) D24 D55 ^ D28 D52 +error(0.002611050841900463149) D24 D55 ^ D29 D52 +error(0.001030212141032500316) D24 D55 ^ D29 D53 +error(0.003086746265355783374) D24 D55 ^ D52 D53 +error(0.001205642639412828282) D24 D56 +error(5.413361691145458354e-05) D24 D56 ^ D29 +error(0.0006132114541846075744) D24 D56 ^ D29 D52 +error(0.001417719826750507691) D24 D56 ^ D29 D53 +error(0.0005980895653587027776) D24 D56 ^ D52 D53 +error(0.03718073126371301829) D25 +error(0.01448264191068634153) D25 D32 +error(0.01532547334685789055) D25 D32 ^ D29 +error(0.02381232961817726645) D25 D49 +error(0.002637023807817020799) D25 D49 ^ D53 +error(0.003450945788882907317) D25 D56 +error(0.002599654021808480656) D25 D56 ^ D29 +error(0.004061933355944112936) D25 D56 ^ D53 +error(0.0009592071290398953122) D25 D56 ^ D53 ^ D29 +error(0.002701545344306040351) D25 ^ D9 +error(0.005964967045139260224) D25 ^ D29 +error(0.02134387155224583624) D26 D27 +error(0.02137060146187551302) D26 D27 ^ D22 +error(0.0003958716806699283039) D26 D27 ^ D22 ^ D23 +error(0.02525902938098234171) D26 D50 +error(0.02209453340770627452) D26 L0 +error(0.01413822208225478001) D27 D28 +error(0.001260123247430201907) D27 D28 ^ D23 +error(0.001315045671082107565) D27 D28 ^ D24 +error(0.002436288539328775211) D27 D28 ^ D30 +error(0.004601701592776456101) D27 D28 ^ D30 D54 +error(0.0001593711159397171936) D27 D28 ^ D30 ^ D31 +error(0.0004392522027559170382) D27 D28 ^ D31 +error(0.0138612810929308293) D27 D33 +error(0.01416333340398687364) D27 D33 ^ D30 +error(0.004365491728138845215) D27 D50 +error(0.002695027976132394112) D27 D50 ^ D22 +error(0.0003027628658435273408) D27 D50 ^ D54 ^ D22 +error(0.02723315102725440418) D27 D51 +error(0.00140205973473897039) D27 D51 ^ D22 +error(0.005203451391324077739) D27 D51 ^ D54 +error(0.00255544150013453002) D27 D57 +error(0.001808009258848390166) D27 D57 ^ D30 +error(0.002707021320884218929) D27 D57 ^ D54 +error(0.0006088424000031264971) D27 D57 ^ D54 ^ D30 +error(0.01158105831802376876) D28 D29 +error(0.001838569108560266863) D28 D29 ^ D24 ^ D25 +error(0.0004434226054838874857) D28 D29 ^ D30 D55 +error(0.003045602539330864375) D28 D29 ^ D31 D55 +error(0.000161745849084175288) D28 D29 ^ D31 ^ D32 +error(0.0001296942189272207754) D28 D29 ^ D32 +error(0.01374251547494504538) D28 D34 +error(0.01315730660692127421) D28 D34 ^ D30 D31 +error(0.007525476540747918358) D28 D51 +error(0.0006137602329925614204) D28 D51 ^ D54 D55 +error(0.02902365595154616021) D28 D52 +error(0.002401197642609727463) D28 D52 ^ D54 D55 +error(0.002408909711435769981) D28 D57 +error(0.0002707484224426097191) D28 D57 ^ D30 +error(0.001527963667674685309) D28 D57 ^ D30 D54 +error(0.0001105290094925922439) D28 D57 ^ D30 D55 +error(0.0005441160428730808241) D28 D57 ^ D54 +error(0.000356573641289079893) D28 D57 ^ D54 D55 +error(0.003107337702078268298) D28 D58 +error(0.00148514416775588306) D28 D58 ^ D30 D31 +error(0.0009343659549481646417) D28 D58 ^ D30 D54 +error(0.001133507027766949074) D28 D58 ^ D30 D55 +error(0.000964158168953031477) D28 D58 ^ D31 D55 +error(0.001858972200881762581) D28 D58 ^ D54 D55 +error(0.01000000000000000021) D29 +error(0.004493550144293693982) D29 D52 +error(0.0004616573460695907647) D29 D52 ^ D55 D56 +error(0.02153375451966943119) D29 D53 +error(0.001571041344134688862) D29 D53 ^ D55 D56 +error(0.001727413411201550366) D29 D58 +error(6.892623931214466931e-05) D29 D58 ^ D30 D31 +error(0.000533806835748320543) D29 D58 ^ D30 D55 +error(0.001001657939292958282) D29 D58 ^ D31 D55 +error(0.005000000000000000104) D29 ^ D32 +error(0.02835617466703097347) D30 +error(0.006342692074361023884) D30 D31 +error(5.203212457675011931e-05) D30 D31 ^ D34 +error(0.002491417993463262287) D30 D31 ^ D34 D58 +error(0.0005065788208640180758) D30 D31 ^ D58 +error(0.0367379142487225252) D30 D54 +error(0.004448757689050466223) D30 D54 ^ D57 D58 +error(0.003134023997971539712) D30 D55 +error(0.0003650194631049960385) D30 D55 ^ D57 D58 +error(0.001406953404968496737) D30 D59 +error(0.000258713445676149944) D30 D59 ^ D34 +error(0.001311719158548649289) D30 D59 ^ D34 D58 +error(0.01000000000000000021) D31 +error(0.01121770461104829898) D31 D32 +error(0.00242678597799335892) D31 D32 ^ D10 +error(0.01264474091765310608) D31 D32 ^ D29 +error(0.01811954199118512299) D31 D35 +error(0.01392061633866547438) D31 D35 ^ D34 +error(0.02102885356741089617) D31 D55 +error(0.001690237581495826133) D31 D55 ^ D29 +error(0.00359606707161589734) D31 D55 ^ D58 +error(0.003107887681254754581) D31 D56 +error(0.003382303353831740949) D31 D56 ^ D29 +error(0.0001913183606313894702) D31 D56 ^ D58 +error(0.0002941212067804130489) D31 D56 ^ D58 ^ D29 +error(0.003693046244270884078) D31 D59 +error(0.003186564243865780671) D31 D59 ^ D34 +error(0.004755038122238004067) D31 D59 ^ D58 +error(0.001954054770515154492) D31 D59 ^ D58 ^ D34 +error(0.0002120161730050280121) D31 ^ D10 +error(0.02789100868359535232) D32 +error(0.02640784577619364679) D32 D56 +error(0.00290739257373180118) D32 D56 ^ D29 +error(0.005000000000000000104) D33 D34 +error(0.01762411789509398322) D33 D34 ^ D30 +error(0.0004175576180327294725) D33 D34 ^ D30 ^ D31 +error(0.002119781521700018524) D33 D34 ^ D31 +error(0.001804900471941472788) D33 D34 ^ D35 +error(0.03275880248144626833) D33 D57 +error(0.00429567725900462799) D33 D57 ^ D30 +error(0.0256614311222976392) D34 +error(0.002509590526077771534) D34 D57 +error(0.003096878840847453254) D34 D57 ^ D30 +error(0.0004658229008440930739) D34 D57 ^ D59 +error(0.0006984840680404692847) D34 D57 ^ D59 ^ D30 +error(0.02371714611383288207) D34 D58 +error(0.001691210042327366938) D34 D58 ^ D30 +error(0.002968485154357761256) D34 D58 ^ D59 +error(0.0005214837151206510582) D34 ^ D10 ^ D32 +error(0.01622064511789986577) D34 ^ D35 +error(0.001107203287059167415) D34 ^ D59 +error(0.004560533548355043092) D35 D59 ^ D34 +error(0.02431640923887455619) D35 +error(0.01983080680743972563) D35 D59 +error(0.005000000000000000104) D36 +error(0.01768647969650154195) D36 D40 +error(0.01997660103599073478) D36 D40 ^ D37 L0 +error(0.0272133096145726304) D36 D60 +error(0.009354172066671974373) D36 D60 ^ D61 L0 +error(0.006575429550073013871) D36 D64 +error(0.006606814816559495283) D36 D64 ^ D37 L0 +error(0.00570203587243049443) D36 D64 ^ D61 L0 +error(0.004394467297965208054) D36 D64 ^ D61 L0 ^ D37 L0 +error(0.003141484544212969771) D36 D65 +error(0.002866645116274591214) D36 D65 ^ D37 D61 +error(0.0007467639087963555584) D36 D65 ^ D37 L0 +error(0.00100340881217143808) D36 D65 ^ D61 L0 +error(0.005000000000000000104) D36 ^ D37 L0 +error(0.006716177406890511993) D37 D61 ^ D36 +error(0.006831737513122857625) D37 D38 +error(0.000925383923960359611) D37 D38 ^ D36 +error(0.0002795442616193875634) D37 D38 ^ D40 D41 +error(0.0005690671345596917631) D37 D38 ^ D40 D65 +error(0.01632363663664802497) D37 D38 ^ D41 +error(0.004686760244772980415) D37 D38 ^ D41 D65 +error(0.003622701663117294888) D37 D38 ^ D65 +error(0.0006213698150018824758) D37 D38 ^ D65 ^ D36 +error(0.02092676657561087783) D37 D43 +error(0.0132551803359697469) D37 D43 ^ D40 D41 +error(0.05139236901086036841) D37 D61 +error(0.003561108508096676607) D37 D61 ^ D64 D65 +error(0.0046639615040387555) D37 D61 ^ D65 +error(0.004108367013198443128) D37 D66 +error(0.001863368595620282274) D37 D66 ^ D40 D64 +error(0.0002077739562874012804) D37 D66 ^ D40 D65 +error(0.0001534208996732992975) D37 D66 ^ D64 D65 +error(0.002474351314484049547) D37 D67 +error(0.001842181383880251615) D37 D67 ^ D40 D41 +error(0.0007357888818581343913) D37 D67 ^ D40 D64 +error(0.002176810431023448646) D37 D67 ^ D40 D65 +error(0.0009865289460392872439) D37 D67 ^ D41 D65 +error(0.002351214005477396222) D37 D67 ^ D64 D65 +error(0.01000000000000000021) D37 L0 +error(0.01700103788466153509) D38 D44 +error(0.01657742774919643974) D38 D44 ^ D41 +error(0.005959798576863498468) D38 D61 +error(0.000405679075595877963) D38 D61 ^ D36 +error(0.006365081479756801858) D38 D61 ^ D65 +error(0.0006185446772456166349) D38 D61 ^ D65 ^ D36 +error(0.02877376894243781) D38 D62 +error(0.01462010353799540405) D38 D62 ^ D65 +error(0.00255626787296149658) D38 D67 +error(0.0003462302675103233517) D38 D67 ^ D40 D41 +error(0.0006259573259455081164) D38 D67 ^ D40 D65 +error(0.001780026776757265587) D38 D67 ^ D41 D65 +error(0.0007765183634651079674) D38 D67 ^ D65 +error(0.004204068823748800116) D38 D68 +error(0.004448751937011490021) D38 D68 ^ D41 +error(0.002493712434291736613) D38 D68 ^ D65 +error(0.002122847769795885211) D38 D68 ^ D65 ^ D41 +error(0.008073481635886498378) D39 D40 +error(0.0005730018563843651807) D39 D40 ^ D37 L0 +error(0.0004628308648474659527) D39 D40 ^ D42 D43 +error(0.002505525127704565005) D39 D40 ^ D42 D66 +error(0.009108311699216133789) D39 D40 ^ D42 L0 +error(0.0001464483877319481696) D39 D40 ^ D43 D66 +error(0.001791079838534594517) D39 D40 ^ D66 L0 +error(0.000306018137642829612) D39 D40 ^ D66 L0 ^ D37 L0 +error(0.01557841355567917037) D39 D46 +error(0.01435979479825004283) D39 D46 ^ D42 L0 +error(0.02308764085533153432) D39 D63 +error(0.00431467884365783691) D39 D63 ^ D66 L0 +error(0.001931307837553560523) D39 D64 +error(0.0008665267816730684537) D39 D64 ^ D37 L0 +error(0.002496274199622507042) D39 D64 ^ D66 L0 +error(0.0003964385681257144838) D39 D64 ^ D66 L0 ^ D37 L0 +error(0.003466727401050739669) D39 D70 +error(0.004164332635934311043) D39 D70 ^ D42 L0 +error(0.002681973973769409981) D39 D70 ^ D66 L0 +error(0.001643190028824071487) D39 D70 ^ D66 L0 ^ D42 L0 +error(0.002347213007440165141) D39 D71 +error(1.438422088529517882e-05) D39 D71 ^ D42 D43 +error(0.001602485993920255191) D39 D71 ^ D42 D66 +error(0.0003906309354926121866) D39 D71 ^ D42 L0 +error(0.0002462750543915511142) D39 D71 ^ D43 D66 +error(0.0003195674037454942704) D39 D71 ^ D66 L0 +error(0.009374789236906273804) D40 D41 +error(0.0005590529469528864254) D40 D41 ^ D13 L0 +error(0.0001530608469217417504) D40 D41 ^ D37 L0 +error(0.0008647203357822550026) D40 D41 ^ D42 D43 +error(0.000648659578791030509) D40 D41 ^ D43 D44 +error(0.00193254128555270981) D40 D41 ^ D43 D67 +error(6.236263047404961928e-05) D40 D41 ^ D44 D67 +error(0.01492810779744833949) D40 D47 +error(0.01018712175352179221) D40 D47 ^ D42 D43 +error(0.02897098431077184053) D40 D64 +error(0.009580229984338856086) D40 D64 ^ D37 L0 +error(0.003392722770150778579) D40 D64 ^ D66 D67 +error(0.0009747224564062936412) D40 D64 ^ D66 L0 +error(0.002252326138938211871) D40 D65 +error(0.0005634108258186226606) D40 D65 ^ D66 D67 +error(0.002115175773512700461) D40 D71 +error(0.0030608781621897568) D40 D71 ^ D42 D43 +error(0.001270789941476938327) D40 D71 ^ D42 D66 +error(0.001939096001487852121) D40 D71 ^ D43 D66 +error(0.001187976190653792109) D40 D71 ^ D43 D67 +error(0.002026211267946444097) D40 D71 ^ D66 D67 +error(0.0009157719035976701148) D40 D72 +error(0.0001672286054041389081) D40 D72 ^ D43 D44 +error(0.0005353541060028568126) D40 D72 ^ D43 D66 +error(0.001349693943062659982) D40 D72 ^ D43 D67 +error(0.0001999317661850497118) D40 D72 ^ D44 D67 +error(0.0005670826236588418032) D40 D72 ^ D66 D67 +error(0.01000000000000000021) D41 +error(0.02725063153630395349) D41 D48 +error(0.02389252453306664817) D41 D48 ^ D43 D44 +error(0.03329807480613649479) D41 D65 +error(0.002054421110880488236) D41 D65 ^ D67 D68 +error(0.005139440185035600017) D41 D72 +error(0.002101194335119418565) D41 D72 ^ D43 D44 +error(0.0008922567876475901794) D41 D72 ^ D43 D67 +error(0.002032431206016870138) D41 D72 ^ D44 D67 +error(0.0005572318529482796516) D41 D72 ^ D44 D68 +error(0.002750366226549339366) D41 D72 ^ D67 D68 +error(0.001460790359938684765) D41 D73 +error(0.0004147934522296172497) D41 D73 ^ D44 D67 +error(0.001498989588066860232) D41 D73 ^ D44 D68 +error(0.007007209720512256115) D42 D43 +error(0.0004546663148800625083) D42 D43 ^ D46 D47 +error(0.0001425002969150308049) D42 D43 ^ D46 D71 +error(0.0005696660143250861785) D42 D43 ^ D47 D48 +error(0.003116901364237378153) D42 D43 ^ D47 D71 +error(0.01566705597438649775) D42 D51 +error(0.01186724049158091772) D42 D51 ^ D46 D47 +error(0.03336402185735180131) D42 D66 +error(0.00244917592564833364) D42 D66 ^ D70 D71 +error(0.002462421301947203146) D42 D74 +error(0.001960634436970778299) D42 D74 ^ D46 D70 +error(3.566087944092823308e-06) D42 D74 ^ D46 D71 +error(0.0001637216941453993634) D42 D74 ^ D70 D71 +error(0.004695941015552158003) D42 D75 +error(0.00205837118508770409) D42 D75 ^ D46 D47 +error(0.002163953410575679935) D42 D75 ^ D46 D70 +error(0.001554394982217835453) D42 D75 ^ D46 D71 +error(0.0008879695541101345754) D42 D75 ^ D47 D71 +error(0.002096192257208842526) D42 D75 ^ D70 D71 +error(0.01000000000000000021) D42 L0 +error(0.004381884530454759931) D46 D70 ^ D42 L0 +error(0.008692175163913264807) D43 D44 +error(0.0006905029968304733732) D43 D44 ^ D17 +error(0.00015945046755517543) D43 D44 ^ D41 +error(0.001006504109593458303) D43 D44 ^ D47 D48 +error(0.0008131714298475562147) D43 D44 ^ D47 D72 +error(0.0001651771561405014556) D43 D44 ^ D48 D49 +error(0.001649440750181971295) D43 D44 ^ D48 D72 +error(0.01789251364993136792) D43 D52 +error(0.01500802532656671066) D43 D52 ^ D47 D48 +error(0.003194379691095217307) D43 D66 +error(0.000203690984695900824) D43 D66 ^ D71 D72 +error(0.04189958697952669148) D43 D67 +error(0.002152911101466412069) D43 D67 ^ D71 D72 +error(0.00127605215256659083) D43 D75 +error(0.0001706398503003628525) D43 D75 ^ D46 D47 +error(0.0005783336597214276545) D43 D75 ^ D46 D71 +error(0.002016020127898890141) D43 D75 ^ D47 D71 +error(0.0001968335352046341011) D43 D75 ^ D47 D72 +error(0.0001375362953422371091) D43 D75 ^ D71 D72 +error(0.0009834825476811148021) D43 D76 +error(0.00207981557623123552) D43 D76 ^ D47 D48 +error(0.001841441603780133614) D43 D76 ^ D47 D71 +error(0.002505923860524120889) D43 D76 ^ D47 D72 +error(0.001419084695213386135) D43 D76 ^ D48 D72 +error(0.002852296504457221913) D43 D76 ^ D71 D72 +error(0.009019350943902253864) D44 D45 +error(0.0001633354758280312132) D44 D45 ^ D41 +error(0.0005572855800292770244) D44 D45 ^ D48 D49 +error(0.000553630490138258915) D44 D45 ^ D48 D73 +error(0.01251672150946384239) D44 D45 ^ D49 +error(0.005790639639282292236) D44 D45 ^ D49 D73 +error(0.001145685949262297476) D44 D45 ^ D73 +error(0.0003259075124975205589) D44 D45 ^ D73 ^ D41 +error(0.01461905296180973472) D44 D53 +error(0.01098538498491322471) D44 D53 ^ D48 D49 +error(0.003447214799424203578) D44 D67 +error(0.0003666576516136855319) D44 D67 ^ D72 D73 +error(0.02223358031578045318) D44 D68 +error(0.005543803677485251852) D44 D68 ^ D41 +error(0.002210910752504785439) D44 D68 ^ D72 D73 +error(0.001379541549716805683) D44 D68 ^ D73 +error(0.002924885832784762055) D44 D76 +error(0.001574022131985900515) D44 D76 ^ D48 D72 +error(0.0003547034745176052173) D44 D76 ^ D48 D73 +error(0.0002399940007932416046) D44 D76 ^ D72 D73 +error(0.002619265017415267974) D44 D77 +error(0.00158241141465816147) D44 D77 ^ D48 D49 +error(0.0004730953369301131323) D44 D77 ^ D48 D72 +error(0.002269905077607368895) D44 D77 ^ D48 D73 +error(0.0006264493750148219901) D44 D77 ^ D49 D73 +error(0.001918993207104307793) D44 D77 ^ D72 D73 +error(0.01377675457637685119) D45 +error(0.002469986989841304811) D45 D68 +error(8.555696620424324658e-05) D45 D68 ^ D41 +error(0.002594304494337347066) D45 D68 ^ D73 +error(0.0001376299769938429572) D45 D68 ^ D73 ^ D41 +error(0.03458993767437905376) D45 D69 +error(0.00595402342578680091) D45 D69 ^ D73 +error(0.00245631142944030675) D45 D77 +error(0.0003152919029694442122) D45 D77 ^ D48 D49 +error(0.0001612541715673219793) D45 D77 ^ D48 D73 +error(0.002267685579689308461) D45 D77 ^ D49 D73 +error(0.02509039495427965033) D45 ^ D49 +error(0.002041494666156196645) D45 ^ D73 ^ D49 +error(0.01000000000000000021) D46 +error(0.01187707629310352439) D46 D47 +error(0.001215264942972966392) D46 D47 ^ D50 D51 +error(0.0005861090175784376428) D46 D47 ^ D51 D52 +error(0.001982134764997857141) D46 D47 ^ D51 D75 +error(0.000425289327455776172) D46 D47 ^ D52 D75 +error(0.05297676665932575524) D46 D70 +error(0.003462771653202506312) D46 D70 ^ D74 D75 +error(0.00322690889612168132) D46 D71 +error(0.000497833939171843853) D46 D71 ^ D74 D75 +error(0.002260264554825750123) D46 D78 +error(0.0003473527278594572667) D46 D78 ^ D51 D52 +error(0.0008431892706171371455) D46 D78 ^ D51 D75 +error(0.0003892606543198490589) D46 D78 ^ D52 D75 +error(0.01190612723083741761) D46 ^ D50 L0 +error(0.004358707189286150849) D50 D74 ^ D46 +error(0.01780468578502405336) D47 D48 +error(0.0004696046272799186939) D47 D48 ^ D51 D52 +error(0.0008851561914086082629) D47 D48 ^ D52 D53 +error(0.001718406529616470267) D47 D48 ^ D52 D76 +error(0.0003621508437235534191) D47 D48 ^ D53 D76 +error(0.02155444020316826109) D47 D54 +error(0.02009756387803195501) D47 D54 ^ D51 D52 +error(0.02960309792484100769) D47 D71 +error(0.002696425463454497993) D47 D71 ^ D75 D76 +error(0.004542445374810293035) D47 D72 +error(0.0004787390755988302541) D47 D72 ^ D75 D76 +error(0.005783598058333213297) D47 D78 +error(0.006313383773074134758) D47 D78 ^ D51 D52 +error(0.001741030225433118535) D47 D78 ^ D51 D75 +error(0.007616179929498220411) D47 D78 ^ D52 D75 +error(0.002095215870669062119) D47 D78 ^ D52 D76 +error(0.003866228108010479232) D47 D78 ^ D75 D76 +error(0.001007778755732767137) D47 D79 +error(0.000791992306397491623) D47 D79 ^ D52 D53 +error(0.000442838744421881808) D47 D79 ^ D52 D75 +error(0.0011264348417513437) D47 D79 ^ D52 D76 +error(0.0007294911408703053015) D47 D79 ^ D53 D76 +error(0.0006790628791750554817) D47 D79 ^ D75 D76 +error(0.007519668875887872833) D48 D49 +error(0.000367564866391688718) D48 D49 ^ D52 D53 +error(4.196227388522683093e-05) D48 D49 ^ D53 +error(0.001830493767202687975) D48 D49 ^ D53 D77 +error(2.861025836566403991e-05) D48 D49 ^ D77 +error(0.0150479596563341516) D48 D55 +error(0.01110180417699024001) D48 D55 ^ D52 D53 +error(0.02213619326971636922) D48 D72 +error(0.002579554369470707462) D48 D72 ^ D76 D77 +error(0.003236307905156624899) D48 D73 +error(0.0005079835293430067563) D48 D73 ^ D76 D77 +error(0.001390683905584838868) D48 D79 +error(0.002396077516820634395) D48 D79 ^ D52 D53 +error(0.001515604606709302846) D48 D79 ^ D52 D76 +error(0.002611050841900463149) D48 D79 ^ D53 D76 +error(0.001030212141032500316) D48 D79 ^ D53 D77 +error(0.003086746265355783374) D48 D79 ^ D76 D77 +error(0.001205642639412828282) D48 D80 +error(5.413361691145458354e-05) D48 D80 ^ D53 +error(0.0006132114541846075744) D48 D80 ^ D53 D76 +error(0.001417719826750507691) D48 D80 ^ D53 D77 +error(0.0005980895653587027776) D48 D80 ^ D76 D77 +error(0.01000000000000000021) D49 +error(0.01636000547734253047) D49 D56 +error(0.01796233722540469674) D49 D56 ^ D53 +error(0.02381232961817726645) D49 D73 +error(0.002637023807817020799) D49 D73 ^ D77 +error(0.003450945788882907317) D49 D80 +error(0.002599654021808480656) D49 D80 ^ D53 +error(0.004061933355944112936) D49 D80 ^ D77 +error(0.0009592071290398953122) D49 D80 ^ D77 ^ D53 +error(0.01363803936237644246) D50 D51 +error(0.003930263821803167863) D50 D51 ^ D22 +error(0.01802560496900905418) D50 D51 ^ D46 +error(8.589436615621441292e-05) D50 D51 ^ D54 ^ D22 +error(0.02525902938098234171) D50 D74 +error(0.00574306903657622117) D50 L0 +error(0.0009470563290373274889) D50 L0 ^ D18 L0 ^ D22 +error(0.0008800554094711328119) D50 L0 ^ D18 L0 ^ D46 +error(0.001457843699669428847) D50 L0 ^ D46 ^ D22 +error(0.01450534184220186006) D51 D52 +error(0.0005721110364468817927) D51 D52 ^ D54 D55 +error(0.004601701592776456101) D51 D52 ^ D54 D78 +error(0.01329762689544615982) D51 D57 +error(0.01235795010597530268) D51 D57 ^ D54 +error(0.004365491728138845215) D51 D74 +error(0.002695027976132394112) D51 D74 ^ D46 +error(0.0003027628658435273408) D51 D74 ^ D78 ^ D46 +error(0.02723315102725440418) D51 D75 +error(0.00140205973473897039) D51 D75 ^ D46 +error(0.005203451391324077739) D51 D75 ^ D78 +error(0.00255544150013453002) D51 D81 +error(0.001808009258848390166) D51 D81 ^ D54 +error(0.002707021320884218929) D51 D81 ^ D78 +error(0.0006088424000031264971) D51 D81 ^ D78 ^ D54 +error(0.006472003059864666653) D52 D53 +error(0.0003994528074094950672) D52 D53 ^ D54 D55 +error(0.0004434226054838874857) D52 D53 ^ D54 D79 +error(0.0008751552090033030192) D52 D53 ^ D55 D56 +error(0.003045602539330864375) D52 D53 ^ D55 D79 +error(0.01325582626527719958) D52 D58 +error(0.01125502755749200473) D52 D58 ^ D54 D55 +error(0.007525476540747918358) D52 D75 +error(0.0006137602329925614204) D52 D75 ^ D78 D79 +error(0.02902365595154616021) D52 D76 +error(0.002401197642609727463) D52 D76 ^ D78 D79 +error(0.002408909711435769981) D52 D81 +error(0.0002707484224426097191) D52 D81 ^ D54 +error(0.001527963667674685309) D52 D81 ^ D54 D78 +error(0.0001105290094925922439) D52 D81 ^ D54 D79 +error(0.0005441160428730808241) D52 D81 ^ D78 +error(0.000356573641289079893) D52 D81 ^ D78 D79 +error(0.003107337702078268298) D52 D82 +error(0.00148514416775588306) D52 D82 ^ D54 D55 +error(0.0009343659549481646417) D52 D82 ^ D54 D78 +error(0.001133507027766949074) D52 D82 ^ D54 D79 +error(0.000964158168953031477) D52 D82 ^ D55 D79 +error(0.001858972200881762581) D52 D82 ^ D78 D79 +error(0.01000000000000000021) D53 +error(0.004493550144293693982) D53 D76 +error(0.0004616573460695907647) D53 D76 ^ D79 D80 +error(0.02153375451966943119) D53 D77 +error(0.001571041344134688862) D53 D77 ^ D79 D80 +error(0.001727413411201550366) D53 D82 +error(6.892623931214466931e-05) D53 D82 ^ D54 D55 +error(0.000533806835748320543) D53 D82 ^ D54 D79 +error(0.001001657939292958282) D53 D82 ^ D55 D79 +error(0.0006587014447459603635) D53 ^ D21 ^ D25 +error(0.0009512945064856004112) D53 ^ D21 ^ D49 +error(0.0004374836472664517121) D53 ^ D25 +error(0.01000000000000000021) D54 +error(0.006089189670584919251) D54 D55 +error(0.0003733339846648112744) D54 D55 ^ D57 D58 +error(0.002491417993463262287) D54 D55 ^ D58 D82 +error(0.0005065788208640180758) D54 D55 ^ D82 +error(0.0367379142487225252) D54 D78 +error(0.004448757689050466223) D54 D78 ^ D81 D82 +error(0.003134023997971539712) D54 D79 +error(0.0003650194631049960385) D54 D79 ^ D81 D82 +error(0.001406953404968496737) D54 D83 +error(0.000258713445676149944) D54 D83 ^ D58 +error(0.001311719158548649289) D54 D83 ^ D58 D82 +error(0.01016476222491488092) D55 D56 +error(0.002108544545389898564) D55 D56 ^ D29 +error(0.01205056218453301811) D55 D56 ^ D53 +error(8.106206907232670631e-05) D55 D56 ^ D58 +error(0.0003126805541716948288) D55 D56 ^ D58 ^ D29 +error(0.01810275288528837012) D55 D59 +error(0.01637617210264374554) D55 D59 ^ D58 +error(0.02102885356741089617) D55 D79 +error(0.001690237581495826133) D55 D79 ^ D53 +error(0.00359606707161589734) D55 D79 ^ D82 +error(0.003107887681254754581) D55 D80 +error(0.003382303353831740949) D55 D80 ^ D53 +error(0.0001913183606313894702) D55 D80 ^ D82 +error(0.0002941212067804130489) D55 D80 ^ D82 ^ D53 +error(0.003693046244270884078) D55 D83 +error(0.003186564243865780671) D55 D83 ^ D58 +error(0.004755038122238004067) D55 D83 ^ D82 +error(0.001954054770515154492) D55 D83 ^ D82 ^ D58 +error(0.02640784577619364679) D56 D80 +error(0.00290739257373180118) D56 D80 ^ D53 +error(0.006564866789739933102) D57 D58 +error(0.001832679987383818189) D57 D58 ^ D30 +error(0.01288524193192810627) D57 D58 ^ D54 +error(0.0006173749993255437177) D57 D58 ^ D59 +error(0.0004559863367010421231) D57 D58 ^ D59 ^ D30 +error(0.03275880248144626833) D57 D81 +error(0.00429567725900462799) D57 D81 ^ D54 +error(0.01072741549435932314) D58 +error(0.002509590526077771534) D58 D81 +error(0.003096878840847453254) D58 D81 ^ D54 +error(0.0004658229008440930739) D58 D81 ^ D83 +error(0.0006984840680404692847) D58 D81 ^ D83 ^ D54 +error(0.02371714611383288207) D58 D82 +error(0.001691210042327366938) D58 D82 ^ D54 +error(0.002968485154357761256) D58 D82 ^ D83 +error(0.01188288263817612218) D58 ^ D59 +error(0.001107203287059167415) D58 ^ D83 +error(0.004560533548355043092) D59 D83 ^ D58 +error(0.005000000000000000104) D59 +error(0.01983080680743972563) D59 D83 +error(0.005000000000000000104) D60 +error(0.01768647969650154195) D60 D64 +error(0.01997660103599073478) D60 D64 ^ D61 L0 +error(0.0272133096145726304) D60 D84 +error(0.009354172066671974373) D60 D84 ^ D85 L0 +error(0.006575429550073013871) D60 D88 +error(0.006606814816559495283) D60 D88 ^ D61 L0 +error(0.00570203587243049443) D60 D88 ^ D85 L0 +error(0.004394467297965208054) D60 D88 ^ D85 L0 ^ D61 L0 +error(0.003141484544212969771) D60 D89 +error(0.002866645116274591214) D60 D89 ^ D61 D85 +error(0.0007467639087963555584) D60 D89 ^ D61 L0 +error(0.00100340881217143808) D60 D89 ^ D85 L0 +error(0.005000000000000000104) D60 ^ D61 L0 +error(0.006716177406890511993) D61 D85 ^ D60 +error(0.006831737513122857625) D61 D62 +error(0.000925383923960359611) D61 D62 ^ D60 +error(0.0002795442616193875634) D61 D62 ^ D64 D65 +error(0.0005690671345596917631) D61 D62 ^ D64 D89 +error(0.01632363663664802497) D61 D62 ^ D65 +error(0.004686760244772980415) D61 D62 ^ D65 D89 +error(0.003622701663117294888) D61 D62 ^ D89 +error(0.0006213698150018824758) D61 D62 ^ D89 ^ D60 +error(0.02092676657561087783) D61 D67 +error(0.0132551803359697469) D61 D67 ^ D64 D65 +error(0.05139236901086036841) D61 D85 +error(0.003561108508096676607) D61 D85 ^ D88 D89 +error(0.0046639615040387555) D61 D85 ^ D89 +error(0.004108367013198443128) D61 D90 +error(0.001863368595620282274) D61 D90 ^ D64 D88 +error(0.0002077739562874012804) D61 D90 ^ D64 D89 +error(0.0001534208996732992975) D61 D90 ^ D88 D89 +error(0.002474351314484049547) D61 D91 +error(0.001842181383880251615) D61 D91 ^ D64 D65 +error(0.0007357888818581343913) D61 D91 ^ D64 D88 +error(0.002176810431023448646) D61 D91 ^ D64 D89 +error(0.0009865289460392872439) D61 D91 ^ D65 D89 +error(0.002351214005477396222) D61 D91 ^ D88 D89 +error(0.01000000000000000021) D61 L0 +error(0.01700103788466153509) D62 D68 +error(0.01657742774919643974) D62 D68 ^ D65 +error(0.005959798576863498468) D62 D85 +error(0.000405679075595877963) D62 D85 ^ D60 +error(0.006365081479756801858) D62 D85 ^ D89 +error(0.0006185446772456166349) D62 D85 ^ D89 ^ D60 +error(0.02877376894243781) D62 D86 +error(0.01462010353799540405) D62 D86 ^ D89 +error(0.00255626787296149658) D62 D91 +error(0.0003462302675103233517) D62 D91 ^ D64 D65 +error(0.0006259573259455081164) D62 D91 ^ D64 D89 +error(0.001780026776757265587) D62 D91 ^ D65 D89 +error(0.0007765183634651079674) D62 D91 ^ D89 +error(0.004204068823748800116) D62 D92 +error(0.004448751937011490021) D62 D92 ^ D65 +error(0.002493712434291736613) D62 D92 ^ D89 +error(0.002122847769795885211) D62 D92 ^ D89 ^ D65 +error(0.008073481635886498378) D63 D64 +error(0.0005730018563843651807) D63 D64 ^ D61 L0 +error(0.0004628308648474659527) D63 D64 ^ D66 D67 +error(0.002505525127704565005) D63 D64 ^ D66 D90 +error(0.009108311699216133789) D63 D64 ^ D66 L0 +error(0.0001464483877319481696) D63 D64 ^ D67 D90 +error(0.001791079838534594517) D63 D64 ^ D90 L0 +error(0.000306018137642829612) D63 D64 ^ D90 L0 ^ D61 L0 +error(0.01557841355567917037) D63 D70 +error(0.01435979479825004283) D63 D70 ^ D66 L0 +error(0.02308764085533153432) D63 D87 +error(0.00431467884365783691) D63 D87 ^ D90 L0 +error(0.001931307837553560523) D63 D88 +error(0.0008665267816730684537) D63 D88 ^ D61 L0 +error(0.002496274199622507042) D63 D88 ^ D90 L0 +error(0.0003964385681257144838) D63 D88 ^ D90 L0 ^ D61 L0 +error(0.003466727401050739669) D63 D94 +error(0.004164332635934311043) D63 D94 ^ D66 L0 +error(0.002681973973769409981) D63 D94 ^ D90 L0 +error(0.001643190028824071487) D63 D94 ^ D90 L0 ^ D66 L0 +error(0.002347213007440165141) D63 D95 +error(1.438422088529517882e-05) D63 D95 ^ D66 D67 +error(0.001602485993920255191) D63 D95 ^ D66 D90 +error(0.0003906309354926121866) D63 D95 ^ D66 L0 +error(0.0002462750543915511142) D63 D95 ^ D67 D90 +error(0.0003195674037454942704) D63 D95 ^ D90 L0 +error(0.009374789236906273804) D64 D65 +error(0.0005590529469528864254) D64 D65 ^ D37 L0 +error(0.0001530608469217417504) D64 D65 ^ D61 L0 +error(0.0008647203357822550026) D64 D65 ^ D66 D67 +error(0.000648659578791030509) D64 D65 ^ D67 D68 +error(0.00193254128555270981) D64 D65 ^ D67 D91 +error(6.236263047404961928e-05) D64 D65 ^ D68 D91 +error(0.01492810779744833949) D64 D71 +error(0.01018712175352179221) D64 D71 ^ D66 D67 +error(0.02897098431077184053) D64 D88 +error(0.009580229984338856086) D64 D88 ^ D61 L0 +error(0.003392722770150778579) D64 D88 ^ D90 D91 +error(0.0009747224564062936412) D64 D88 ^ D90 L0 +error(0.002252326138938211871) D64 D89 +error(0.0005634108258186226606) D64 D89 ^ D90 D91 +error(0.002115175773512700461) D64 D95 +error(0.0030608781621897568) D64 D95 ^ D66 D67 +error(0.001270789941476938327) D64 D95 ^ D66 D90 +error(0.001939096001487852121) D64 D95 ^ D67 D90 +error(0.001187976190653792109) D64 D95 ^ D67 D91 +error(0.002026211267946444097) D64 D95 ^ D90 D91 +error(0.0009157719035976701148) D64 D96 +error(0.0001672286054041389081) D64 D96 ^ D67 D68 +error(0.0005353541060028568126) D64 D96 ^ D67 D90 +error(0.001349693943062659982) D64 D96 ^ D67 D91 +error(0.0001999317661850497118) D64 D96 ^ D68 D91 +error(0.0005670826236588418032) D64 D96 ^ D90 D91 +error(0.01000000000000000021) D65 +error(0.02725063153630395349) D65 D72 +error(0.02389252453306664817) D65 D72 ^ D67 D68 +error(0.03329807480613649479) D65 D89 +error(0.002054421110880488236) D65 D89 ^ D91 D92 +error(0.005139440185035600017) D65 D96 +error(0.002101194335119418565) D65 D96 ^ D67 D68 +error(0.0008922567876475901794) D65 D96 ^ D67 D91 +error(0.002032431206016870138) D65 D96 ^ D68 D91 +error(0.0005572318529482796516) D65 D96 ^ D68 D92 +error(0.002750366226549339366) D65 D96 ^ D91 D92 +error(0.001460790359938684765) D65 D97 +error(0.0004147934522296172497) D65 D97 ^ D68 D91 +error(0.001498989588066860232) D65 D97 ^ D68 D92 +error(0.007007209720512256115) D66 D67 +error(0.0004546663148800625083) D66 D67 ^ D70 D71 +error(0.0001425002969150308049) D66 D67 ^ D70 D95 +error(0.0005696660143250861785) D66 D67 ^ D71 D72 +error(0.003116901364237378153) D66 D67 ^ D71 D95 +error(0.01566705597438649775) D66 D75 +error(0.01186724049158091772) D66 D75 ^ D70 D71 +error(0.03336402185735180131) D66 D90 +error(0.00244917592564833364) D66 D90 ^ D94 D95 +error(0.002462421301947203146) D66 D98 +error(0.001960634436970778299) D66 D98 ^ D70 D94 +error(3.566087944092823308e-06) D66 D98 ^ D70 D95 +error(0.0001637216941453993634) D66 D98 ^ D94 D95 +error(0.004695941015552158003) D66 D99 +error(0.00205837118508770409) D66 D99 ^ D70 D71 +error(0.002163953410575679935) D66 D99 ^ D70 D94 +error(0.001554394982217835453) D66 D99 ^ D70 D95 +error(0.0008879695541101345754) D66 D99 ^ D71 D95 +error(0.002096192257208842526) D66 D99 ^ D94 D95 +error(0.01000000000000000021) D66 L0 +error(0.004381884530454759931) D70 D94 ^ D66 L0 +error(0.008692175163913264807) D67 D68 +error(0.0006905029968304733732) D67 D68 ^ D41 +error(0.00015945046755517543) D67 D68 ^ D65 +error(0.001006504109593458303) D67 D68 ^ D71 D72 +error(0.0008131714298475562147) D67 D68 ^ D71 D96 +error(0.0001651771561405014556) D67 D68 ^ D72 D73 +error(0.001649440750181971295) D67 D68 ^ D72 D96 +error(0.01789251364993136792) D67 D76 +error(0.01500802532656671066) D67 D76 ^ D71 D72 +error(0.003194379691095217307) D67 D90 +error(0.000203690984695900824) D67 D90 ^ D95 D96 +error(0.04189958697952669148) D67 D91 +error(0.002152911101466412069) D67 D91 ^ D95 D96 +error(0.00127605215256659083) D67 D99 +error(0.0001706398503003628525) D67 D99 ^ D70 D71 +error(0.0005783336597214276545) D67 D99 ^ D70 D95 +error(0.002016020127898890141) D67 D99 ^ D71 D95 +error(0.0001968335352046341011) D67 D99 ^ D71 D96 +error(0.0001375362953422371091) D67 D99 ^ D95 D96 +error(0.0009834825476811148021) D67 D100 +error(0.00207981557623123552) D67 D100 ^ D71 D72 +error(0.001841441603780133614) D67 D100 ^ D71 D95 +error(0.002505923860524120889) D67 D100 ^ D71 D96 +error(0.001419084695213386135) D67 D100 ^ D72 D96 +error(0.002852296504457221913) D67 D100 ^ D95 D96 +error(0.009019350943902253864) D68 D69 +error(0.0001633354758280312132) D68 D69 ^ D65 +error(0.0005572855800292770244) D68 D69 ^ D72 D73 +error(0.000553630490138258915) D68 D69 ^ D72 D97 +error(0.01251672150946384239) D68 D69 ^ D73 +error(0.005790639639282292236) D68 D69 ^ D73 D97 +error(0.001145685949262297476) D68 D69 ^ D97 +error(0.0003259075124975205589) D68 D69 ^ D97 ^ D65 +error(0.01461905296180973472) D68 D77 +error(0.01098538498491322471) D68 D77 ^ D72 D73 +error(0.003447214799424203578) D68 D91 +error(0.0003666576516136855319) D68 D91 ^ D96 D97 +error(0.02223358031578045318) D68 D92 +error(0.005543803677485251852) D68 D92 ^ D65 +error(0.002210910752504785439) D68 D92 ^ D96 D97 +error(0.001379541549716805683) D68 D92 ^ D97 +error(0.002924885832784762055) D68 D100 +error(0.001574022131985900515) D68 D100 ^ D72 D96 +error(0.0003547034745176052173) D68 D100 ^ D72 D97 +error(0.0002399940007932416046) D68 D100 ^ D96 D97 +error(0.002619265017415267974) D68 D101 +error(0.00158241141465816147) D68 D101 ^ D72 D73 +error(0.0004730953369301131323) D68 D101 ^ D72 D96 +error(0.002269905077607368895) D68 D101 ^ D72 D97 +error(0.0006264493750148219901) D68 D101 ^ D73 D97 +error(0.001918993207104307793) D68 D101 ^ D96 D97 +error(0.01377675457637685119) D69 +error(0.002469986989841304811) D69 D92 +error(8.555696620424324658e-05) D69 D92 ^ D65 +error(0.002594304494337347066) D69 D92 ^ D97 +error(0.0001376299769938429572) D69 D92 ^ D97 ^ D65 +error(0.03458993767437905376) D69 D93 +error(0.00595402342578680091) D69 D93 ^ D97 +error(0.00245631142944030675) D69 D101 +error(0.0003152919029694442122) D69 D101 ^ D72 D73 +error(0.0001612541715673219793) D69 D101 ^ D72 D97 +error(0.002267685579689308461) D69 D101 ^ D73 D97 +error(0.02509039495427965033) D69 ^ D73 +error(0.002041494666156196645) D69 ^ D97 ^ D73 +error(0.01000000000000000021) D70 +error(0.01187707629310352439) D70 D71 +error(0.001215264942972966392) D70 D71 ^ D74 D75 +error(0.0005861090175784376428) D70 D71 ^ D75 D76 +error(0.001982134764997857141) D70 D71 ^ D75 D99 +error(0.000425289327455776172) D70 D71 ^ D76 D99 +error(0.05297676665932575524) D70 D94 +error(0.003462771653202506312) D70 D94 ^ D98 D99 +error(0.00322690889612168132) D70 D95 +error(0.000497833939171843853) D70 D95 ^ D98 D99 +error(0.002260264554825750123) D70 D102 +error(0.0003473527278594572667) D70 D102 ^ D75 D76 +error(0.0008431892706171371455) D70 D102 ^ D75 D99 +error(0.0003892606543198490589) D70 D102 ^ D76 D99 +error(0.01190612723083741761) D70 ^ D74 L0 +error(0.004358707189286150849) D74 D98 ^ D70 +error(0.01780468578502405336) D71 D72 +error(0.0004696046272799186939) D71 D72 ^ D75 D76 +error(0.0008851561914086082629) D71 D72 ^ D76 D77 +error(0.001718406529616470267) D71 D72 ^ D76 D100 +error(0.0003621508437235534191) D71 D72 ^ D77 D100 +error(0.02155444020316826109) D71 D78 +error(0.02009756387803195501) D71 D78 ^ D75 D76 +error(0.02960309792484100769) D71 D95 +error(0.002696425463454497993) D71 D95 ^ D99 D100 +error(0.004542445374810293035) D71 D96 +error(0.0004787390755988302541) D71 D96 ^ D99 D100 +error(0.005783598058333213297) D71 D102 +error(0.006313383773074134758) D71 D102 ^ D75 D76 +error(0.001741030225433118535) D71 D102 ^ D75 D99 +error(0.007616179929498220411) D71 D102 ^ D76 D99 +error(0.002095215870669062119) D71 D102 ^ D76 D100 +error(0.003866228108010479232) D71 D102 ^ D99 D100 +error(0.001007778755732767137) D71 D103 +error(0.000791992306397491623) D71 D103 ^ D76 D77 +error(0.000442838744421881808) D71 D103 ^ D76 D99 +error(0.0011264348417513437) D71 D103 ^ D76 D100 +error(0.0007294911408703053015) D71 D103 ^ D77 D100 +error(0.0006790628791750554817) D71 D103 ^ D99 D100 +error(0.007519668875887872833) D72 D73 +error(0.000367564866391688718) D72 D73 ^ D76 D77 +error(4.196227388522683093e-05) D72 D73 ^ D77 +error(0.001830493767202687975) D72 D73 ^ D77 D101 +error(2.861025836566403991e-05) D72 D73 ^ D101 +error(0.0150479596563341516) D72 D79 +error(0.01110180417699024001) D72 D79 ^ D76 D77 +error(0.02213619326971636922) D72 D96 +error(0.002579554369470707462) D72 D96 ^ D100 D101 +error(0.003236307905156624899) D72 D97 +error(0.0005079835293430067563) D72 D97 ^ D100 D101 +error(0.001390683905584838868) D72 D103 +error(0.002396077516820634395) D72 D103 ^ D76 D77 +error(0.001515604606709302846) D72 D103 ^ D76 D100 +error(0.002611050841900463149) D72 D103 ^ D77 D100 +error(0.001030212141032500316) D72 D103 ^ D77 D101 +error(0.003086746265355783374) D72 D103 ^ D100 D101 +error(0.001205642639412828282) D72 D104 +error(5.413361691145458354e-05) D72 D104 ^ D77 +error(0.0006132114541846075744) D72 D104 ^ D77 D100 +error(0.001417719826750507691) D72 D104 ^ D77 D101 +error(0.0005980895653587027776) D72 D104 ^ D100 D101 +error(0.01000000000000000021) D73 +error(0.01636000547734253047) D73 D80 +error(0.01796233722540469674) D73 D80 ^ D77 +error(0.02381232961817726645) D73 D97 +error(0.002637023807817020799) D73 D97 ^ D101 +error(0.003450945788882907317) D73 D104 +error(0.002599654021808480656) D73 D104 ^ D77 +error(0.004061933355944112936) D73 D104 ^ D101 +error(0.0009592071290398953122) D73 D104 ^ D101 ^ D77 +error(0.01363803936237644246) D74 D75 +error(0.003930263821803167863) D74 D75 ^ D46 +error(0.01802560496900905418) D74 D75 ^ D70 +error(8.589436615621441292e-05) D74 D75 ^ D78 ^ D46 +error(0.02525902938098234171) D74 D98 +error(0.00574306903657622117) D74 L0 +error(0.0009470563290373274889) D74 L0 ^ D42 L0 ^ D46 +error(0.0008800554094711328119) D74 L0 ^ D42 L0 ^ D70 +error(0.001457843699669428847) D74 L0 ^ D70 ^ D46 +error(0.01450534184220186006) D75 D76 +error(0.0005721110364468817927) D75 D76 ^ D78 D79 +error(0.004601701592776456101) D75 D76 ^ D78 D102 +error(0.01329762689544615982) D75 D81 +error(0.01235795010597530268) D75 D81 ^ D78 +error(0.004365491728138845215) D75 D98 +error(0.002695027976132394112) D75 D98 ^ D70 +error(0.0003027628658435273408) D75 D98 ^ D102 ^ D70 +error(0.02723315102725440418) D75 D99 +error(0.00140205973473897039) D75 D99 ^ D70 +error(0.005203451391324077739) D75 D99 ^ D102 +error(0.00255544150013453002) D75 D105 +error(0.001808009258848390166) D75 D105 ^ D78 +error(0.002707021320884218929) D75 D105 ^ D102 +error(0.0006088424000031264971) D75 D105 ^ D102 ^ D78 +error(0.006472003059864666653) D76 D77 +error(0.0003994528074094950672) D76 D77 ^ D78 D79 +error(0.0004434226054838874857) D76 D77 ^ D78 D103 +error(0.0008751552090033030192) D76 D77 ^ D79 D80 +error(0.003045602539330864375) D76 D77 ^ D79 D103 +error(0.01325582626527719958) D76 D82 +error(0.01125502755749200473) D76 D82 ^ D78 D79 +error(0.007525476540747918358) D76 D99 +error(0.0006137602329925614204) D76 D99 ^ D102 D103 +error(0.02902365595154616021) D76 D100 +error(0.002401197642609727463) D76 D100 ^ D102 D103 +error(0.002408909711435769981) D76 D105 +error(0.0002707484224426097191) D76 D105 ^ D78 +error(0.001527963667674685309) D76 D105 ^ D78 D102 +error(0.0001105290094925922439) D76 D105 ^ D78 D103 +error(0.0005441160428730808241) D76 D105 ^ D102 +error(0.000356573641289079893) D76 D105 ^ D102 D103 +error(0.003107337702078268298) D76 D106 +error(0.00148514416775588306) D76 D106 ^ D78 D79 +error(0.0009343659549481646417) D76 D106 ^ D78 D102 +error(0.001133507027766949074) D76 D106 ^ D78 D103 +error(0.000964158168953031477) D76 D106 ^ D79 D103 +error(0.001858972200881762581) D76 D106 ^ D102 D103 +error(0.01000000000000000021) D77 +error(0.004493550144293693982) D77 D100 +error(0.0004616573460695907647) D77 D100 ^ D103 D104 +error(0.02153375451966943119) D77 D101 +error(0.001571041344134688862) D77 D101 ^ D103 D104 +error(0.001727413411201550366) D77 D106 +error(6.892623931214466931e-05) D77 D106 ^ D78 D79 +error(0.000533806835748320543) D77 D106 ^ D78 D103 +error(0.001001657939292958282) D77 D106 ^ D79 D103 +error(0.0006587014447459603635) D77 ^ D45 ^ D49 +error(0.0009512945064856004112) D77 ^ D45 ^ D73 +error(0.0004374836472664517121) D77 ^ D49 +error(0.01000000000000000021) D78 +error(0.006089189670584919251) D78 D79 +error(0.0003733339846648112744) D78 D79 ^ D81 D82 +error(0.002491417993463262287) D78 D79 ^ D82 D106 +error(0.0005065788208640180758) D78 D79 ^ D106 +error(0.0367379142487225252) D78 D102 +error(0.004448757689050466223) D78 D102 ^ D105 D106 +error(0.003134023997971539712) D78 D103 +error(0.0003650194631049960385) D78 D103 ^ D105 D106 +error(0.001406953404968496737) D78 D107 +error(0.000258713445676149944) D78 D107 ^ D82 +error(0.001311719158548649289) D78 D107 ^ D82 D106 +error(0.01016476222491488092) D79 D80 +error(0.002108544545389898564) D79 D80 ^ D53 +error(0.01205056218453301811) D79 D80 ^ D77 +error(8.106206907232670631e-05) D79 D80 ^ D82 +error(0.0003126805541716948288) D79 D80 ^ D82 ^ D53 +error(0.01810275288528837012) D79 D83 +error(0.01637617210264374554) D79 D83 ^ D82 +error(0.02102885356741089617) D79 D103 +error(0.001690237581495826133) D79 D103 ^ D77 +error(0.00359606707161589734) D79 D103 ^ D106 +error(0.003107887681254754581) D79 D104 +error(0.003382303353831740949) D79 D104 ^ D77 +error(0.0001913183606313894702) D79 D104 ^ D106 +error(0.0002941212067804130489) D79 D104 ^ D106 ^ D77 +error(0.003693046244270884078) D79 D107 +error(0.003186564243865780671) D79 D107 ^ D82 +error(0.004755038122238004067) D79 D107 ^ D106 +error(0.001954054770515154492) D79 D107 ^ D106 ^ D82 +error(0.02640784577619364679) D80 D104 +error(0.00290739257373180118) D80 D104 ^ D77 +error(0.006564866789739933102) D81 D82 +error(0.001832679987383818189) D81 D82 ^ D54 +error(0.01288524193192810627) D81 D82 ^ D78 +error(0.0006173749993255437177) D81 D82 ^ D83 +error(0.0004559863367010421231) D81 D82 ^ D83 ^ D54 +error(0.03275880248144626833) D81 D105 +error(0.00429567725900462799) D81 D105 ^ D78 +error(0.01072741549435932314) D82 +error(0.002509590526077771534) D82 D105 +error(0.003096878840847453254) D82 D105 ^ D78 +error(0.0004658229008440930739) D82 D105 ^ D107 +error(0.0006984840680404692847) D82 D105 ^ D107 ^ D78 +error(0.02371714611383288207) D82 D106 +error(0.001691210042327366938) D82 D106 ^ D78 +error(0.002968485154357761256) D82 D106 ^ D107 +error(0.01188288263817612218) D82 ^ D83 +error(0.001107203287059167415) D82 ^ D107 +error(0.004560533548355043092) D83 D107 ^ D82 +error(0.005000000000000000104) D83 +error(0.01983080680743972563) D83 D107 +error(0.005000000000000000104) D84 +error(0.01768647969650154195) D84 D88 +error(0.01997660103599073478) D84 D88 ^ D85 L0 +error(0.0272133096145726304) D84 D108 +error(0.009354172066671974373) D84 D108 ^ D109 L0 +error(0.006575429550073013871) D84 D112 +error(0.006606814816559495283) D84 D112 ^ D85 L0 +error(0.00570203587243049443) D84 D112 ^ D109 L0 +error(0.004394467297965208054) D84 D112 ^ D109 L0 ^ D85 L0 +error(0.003141484544212969771) D84 D113 +error(0.002866645116274591214) D84 D113 ^ D85 D109 +error(0.0007467639087963555584) D84 D113 ^ D85 L0 +error(0.00100340881217143808) D84 D113 ^ D109 L0 +error(0.005000000000000000104) D84 ^ D85 L0 +error(0.006716177406890511993) D85 D109 ^ D84 +error(0.006831737513122857625) D85 D86 +error(0.000925383923960359611) D85 D86 ^ D84 +error(0.0002795442616193875634) D85 D86 ^ D88 D89 +error(0.0005690671345596917631) D85 D86 ^ D88 D113 +error(0.01632363663664802497) D85 D86 ^ D89 +error(0.004686760244772980415) D85 D86 ^ D89 D113 +error(0.003622701663117294888) D85 D86 ^ D113 +error(0.0006213698150018824758) D85 D86 ^ D113 ^ D84 +error(0.02092676657561087783) D85 D91 +error(0.0132551803359697469) D85 D91 ^ D88 D89 +error(0.05139236901086036841) D85 D109 +error(0.003561108508096676607) D85 D109 ^ D112 D113 +error(0.0046639615040387555) D85 D109 ^ D113 +error(0.004108367013198443128) D85 D114 +error(0.001863368595620282274) D85 D114 ^ D88 D112 +error(0.0002077739562874012804) D85 D114 ^ D88 D113 +error(0.0001534208996732992975) D85 D114 ^ D112 D113 +error(0.002474351314484049547) D85 D115 +error(0.001842181383880251615) D85 D115 ^ D88 D89 +error(0.0007357888818581343913) D85 D115 ^ D88 D112 +error(0.002176810431023448646) D85 D115 ^ D88 D113 +error(0.0009865289460392872439) D85 D115 ^ D89 D113 +error(0.002351214005477396222) D85 D115 ^ D112 D113 +error(0.01000000000000000021) D85 L0 +error(0.01700103788466153509) D86 D92 +error(0.01657742774919643974) D86 D92 ^ D89 +error(0.005959798576863498468) D86 D109 +error(0.000405679075595877963) D86 D109 ^ D84 +error(0.006365081479756801858) D86 D109 ^ D113 +error(0.0006185446772456166349) D86 D109 ^ D113 ^ D84 +error(0.02877376894243781) D86 D110 +error(0.01462010353799540405) D86 D110 ^ D113 +error(0.00255626787296149658) D86 D115 +error(0.0003462302675103233517) D86 D115 ^ D88 D89 +error(0.0006259573259455081164) D86 D115 ^ D88 D113 +error(0.001780026776757265587) D86 D115 ^ D89 D113 +error(0.0007765183634651079674) D86 D115 ^ D113 +error(0.004204068823748800116) D86 D116 +error(0.004448751937011490021) D86 D116 ^ D89 +error(0.002493712434291736613) D86 D116 ^ D113 +error(0.002122847769795885211) D86 D116 ^ D113 ^ D89 +error(0.008073481635886498378) D87 D88 +error(0.0005730018563843651807) D87 D88 ^ D85 L0 +error(0.0004628308648474659527) D87 D88 ^ D90 D91 +error(0.002505525127704565005) D87 D88 ^ D90 D114 +error(0.009108311699216133789) D87 D88 ^ D90 L0 +error(0.0001464483877319481696) D87 D88 ^ D91 D114 +error(0.001791079838534594517) D87 D88 ^ D114 L0 +error(0.000306018137642829612) D87 D88 ^ D114 L0 ^ D85 L0 +error(0.01557841355567917037) D87 D94 +error(0.01435979479825004283) D87 D94 ^ D90 L0 +error(0.02308764085533153432) D87 D111 +error(0.00431467884365783691) D87 D111 ^ D114 L0 +error(0.001931307837553560523) D87 D112 +error(0.0008665267816730684537) D87 D112 ^ D85 L0 +error(0.002496274199622507042) D87 D112 ^ D114 L0 +error(0.0003964385681257144838) D87 D112 ^ D114 L0 ^ D85 L0 +error(0.003466727401050739669) D87 D118 +error(0.004164332635934311043) D87 D118 ^ D90 L0 +error(0.002681973973769409981) D87 D118 ^ D114 L0 +error(0.001643190028824071487) D87 D118 ^ D114 L0 ^ D90 L0 +error(0.002347213007440165141) D87 D119 +error(1.438422088529517882e-05) D87 D119 ^ D90 D91 +error(0.001602485993920255191) D87 D119 ^ D90 D114 +error(0.0003906309354926121866) D87 D119 ^ D90 L0 +error(0.0002462750543915511142) D87 D119 ^ D91 D114 +error(0.0003195674037454942704) D87 D119 ^ D114 L0 +error(0.009374789236906273804) D88 D89 +error(0.0005590529469528864254) D88 D89 ^ D61 L0 +error(0.0001530608469217417504) D88 D89 ^ D85 L0 +error(0.0008647203357822550026) D88 D89 ^ D90 D91 +error(0.000648659578791030509) D88 D89 ^ D91 D92 +error(0.00193254128555270981) D88 D89 ^ D91 D115 +error(6.236263047404961928e-05) D88 D89 ^ D92 D115 +error(0.01492810779744833949) D88 D95 +error(0.01018712175352179221) D88 D95 ^ D90 D91 +error(0.02897098431077184053) D88 D112 +error(0.009580229984338856086) D88 D112 ^ D85 L0 +error(0.003392722770150778579) D88 D112 ^ D114 D115 +error(0.0009747224564062936412) D88 D112 ^ D114 L0 +error(0.002252326138938211871) D88 D113 +error(0.0005634108258186226606) D88 D113 ^ D114 D115 +error(0.002115175773512700461) D88 D119 +error(0.0030608781621897568) D88 D119 ^ D90 D91 +error(0.001270789941476938327) D88 D119 ^ D90 D114 +error(0.001939096001487852121) D88 D119 ^ D91 D114 +error(0.001187976190653792109) D88 D119 ^ D91 D115 +error(0.002026211267946444097) D88 D119 ^ D114 D115 +error(0.0009157719035976701148) D88 D120 +error(0.0001672286054041389081) D88 D120 ^ D91 D92 +error(0.0005353541060028568126) D88 D120 ^ D91 D114 +error(0.001349693943062659982) D88 D120 ^ D91 D115 +error(0.0001999317661850497118) D88 D120 ^ D92 D115 +error(0.0005670826236588418032) D88 D120 ^ D114 D115 +error(0.01000000000000000021) D89 +error(0.02725063153630395349) D89 D96 +error(0.02389252453306664817) D89 D96 ^ D91 D92 +error(0.03329807480613649479) D89 D113 +error(0.002054421110880488236) D89 D113 ^ D115 D116 +error(0.005139440185035600017) D89 D120 +error(0.002101194335119418565) D89 D120 ^ D91 D92 +error(0.0008922567876475901794) D89 D120 ^ D91 D115 +error(0.002032431206016870138) D89 D120 ^ D92 D115 +error(0.0005572318529482796516) D89 D120 ^ D92 D116 +error(0.002750366226549339366) D89 D120 ^ D115 D116 +error(0.001460790359938684765) D89 D121 +error(0.0004147934522296172497) D89 D121 ^ D92 D115 +error(0.001498989588066860232) D89 D121 ^ D92 D116 +error(0.007007209720512256115) D90 D91 +error(0.0004546663148800625083) D90 D91 ^ D94 D95 +error(0.0001425002969150308049) D90 D91 ^ D94 D119 +error(0.0005696660143250861785) D90 D91 ^ D95 D96 +error(0.003116901364237378153) D90 D91 ^ D95 D119 +error(0.01566705597438649775) D90 D99 +error(0.01186724049158091772) D90 D99 ^ D94 D95 +error(0.03336402185735180131) D90 D114 +error(0.00244917592564833364) D90 D114 ^ D118 D119 +error(0.002462421301947203146) D90 D122 +error(0.001960634436970778299) D90 D122 ^ D94 D118 +error(3.566087944092823308e-06) D90 D122 ^ D94 D119 +error(0.0001637216941453993634) D90 D122 ^ D118 D119 +error(0.004695941015552158003) D90 D123 +error(0.00205837118508770409) D90 D123 ^ D94 D95 +error(0.002163953410575679935) D90 D123 ^ D94 D118 +error(0.001554394982217835453) D90 D123 ^ D94 D119 +error(0.0008879695541101345754) D90 D123 ^ D95 D119 +error(0.002096192257208842526) D90 D123 ^ D118 D119 +error(0.01000000000000000021) D90 L0 +error(0.004381884530454759931) D94 D118 ^ D90 L0 +error(0.008692175163913264807) D91 D92 +error(0.0006905029968304733732) D91 D92 ^ D65 +error(0.00015945046755517543) D91 D92 ^ D89 +error(0.001006504109593458303) D91 D92 ^ D95 D96 +error(0.0008131714298475562147) D91 D92 ^ D95 D120 +error(0.0001651771561405014556) D91 D92 ^ D96 D97 +error(0.001649440750181971295) D91 D92 ^ D96 D120 +error(0.01789251364993136792) D91 D100 +error(0.01500802532656671066) D91 D100 ^ D95 D96 +error(0.003194379691095217307) D91 D114 +error(0.000203690984695900824) D91 D114 ^ D119 D120 +error(0.04189958697952669148) D91 D115 +error(0.002152911101466412069) D91 D115 ^ D119 D120 +error(0.00127605215256659083) D91 D123 +error(0.0001706398503003628525) D91 D123 ^ D94 D95 +error(0.0005783336597214276545) D91 D123 ^ D94 D119 +error(0.002016020127898890141) D91 D123 ^ D95 D119 +error(0.0001968335352046341011) D91 D123 ^ D95 D120 +error(0.0001375362953422371091) D91 D123 ^ D119 D120 +error(0.0009834825476811148021) D91 D124 +error(0.00207981557623123552) D91 D124 ^ D95 D96 +error(0.001841441603780133614) D91 D124 ^ D95 D119 +error(0.002505923860524120889) D91 D124 ^ D95 D120 +error(0.001419084695213386135) D91 D124 ^ D96 D120 +error(0.002852296504457221913) D91 D124 ^ D119 D120 +error(0.009019350943902253864) D92 D93 +error(0.0001633354758280312132) D92 D93 ^ D89 +error(0.0005572855800292770244) D92 D93 ^ D96 D97 +error(0.000553630490138258915) D92 D93 ^ D96 D121 +error(0.01251672150946384239) D92 D93 ^ D97 +error(0.005790639639282292236) D92 D93 ^ D97 D121 +error(0.001145685949262297476) D92 D93 ^ D121 +error(0.0003259075124975205589) D92 D93 ^ D121 ^ D89 +error(0.01461905296180973472) D92 D101 +error(0.01098538498491322471) D92 D101 ^ D96 D97 +error(0.003447214799424203578) D92 D115 +error(0.0003666576516136855319) D92 D115 ^ D120 D121 +error(0.02223358031578045318) D92 D116 +error(0.005543803677485251852) D92 D116 ^ D89 +error(0.002210910752504785439) D92 D116 ^ D120 D121 +error(0.001379541549716805683) D92 D116 ^ D121 +error(0.002924885832784762055) D92 D124 +error(0.001574022131985900515) D92 D124 ^ D96 D120 +error(0.0003547034745176052173) D92 D124 ^ D96 D121 +error(0.0002399940007932416046) D92 D124 ^ D120 D121 +error(0.002619265017415267974) D92 D125 +error(0.00158241141465816147) D92 D125 ^ D96 D97 +error(0.0004730953369301131323) D92 D125 ^ D96 D120 +error(0.002269905077607368895) D92 D125 ^ D96 D121 +error(0.0006264493750148219901) D92 D125 ^ D97 D121 +error(0.001918993207104307793) D92 D125 ^ D120 D121 +error(0.01377675457637685119) D93 +error(0.002469986989841304811) D93 D116 +error(8.555696620424324658e-05) D93 D116 ^ D89 +error(0.002594304494337347066) D93 D116 ^ D121 +error(0.0001376299769938429572) D93 D116 ^ D121 ^ D89 +error(0.03458993767437905376) D93 D117 +error(0.00595402342578680091) D93 D117 ^ D121 +error(0.00245631142944030675) D93 D125 +error(0.0003152919029694442122) D93 D125 ^ D96 D97 +error(0.0001612541715673219793) D93 D125 ^ D96 D121 +error(0.002267685579689308461) D93 D125 ^ D97 D121 +error(0.02509039495427965033) D93 ^ D97 +error(0.002041494666156196645) D93 ^ D121 ^ D97 +error(0.01000000000000000021) D94 +error(0.01187707629310352439) D94 D95 +error(0.001215264942972966392) D94 D95 ^ D98 D99 +error(0.0005861090175784376428) D94 D95 ^ D99 D100 +error(0.001982134764997857141) D94 D95 ^ D99 D123 +error(0.000425289327455776172) D94 D95 ^ D100 D123 +error(0.05297676665932575524) D94 D118 +error(0.003462771653202506312) D94 D118 ^ D122 D123 +error(0.00322690889612168132) D94 D119 +error(0.000497833939171843853) D94 D119 ^ D122 D123 +error(0.002260264554825750123) D94 D126 +error(0.0003473527278594572667) D94 D126 ^ D99 D100 +error(0.0008431892706171371455) D94 D126 ^ D99 D123 +error(0.0003892606543198490589) D94 D126 ^ D100 D123 +error(0.01190612723083741761) D94 ^ D98 L0 +error(0.004358707189286150849) D98 D122 ^ D94 +error(0.01780468578502405336) D95 D96 +error(0.0004696046272799186939) D95 D96 ^ D99 D100 +error(0.0008851561914086082629) D95 D96 ^ D100 D101 +error(0.001718406529616470267) D95 D96 ^ D100 D124 +error(0.0003621508437235534191) D95 D96 ^ D101 D124 +error(0.02155444020316826109) D95 D102 +error(0.02009756387803195501) D95 D102 ^ D99 D100 +error(0.02960309792484100769) D95 D119 +error(0.002696425463454497993) D95 D119 ^ D123 D124 +error(0.004542445374810293035) D95 D120 +error(0.0004787390755988302541) D95 D120 ^ D123 D124 +error(0.005783598058333213297) D95 D126 +error(0.006313383773074134758) D95 D126 ^ D99 D100 +error(0.001741030225433118535) D95 D126 ^ D99 D123 +error(0.007616179929498220411) D95 D126 ^ D100 D123 +error(0.002095215870669062119) D95 D126 ^ D100 D124 +error(0.003866228108010479232) D95 D126 ^ D123 D124 +error(0.001007778755732767137) D95 D127 +error(0.000791992306397491623) D95 D127 ^ D100 D101 +error(0.000442838744421881808) D95 D127 ^ D100 D123 +error(0.0011264348417513437) D95 D127 ^ D100 D124 +error(0.0007294911408703053015) D95 D127 ^ D101 D124 +error(0.0006790628791750554817) D95 D127 ^ D123 D124 +error(0.007519668875887872833) D96 D97 +error(0.000367564866391688718) D96 D97 ^ D100 D101 +error(4.196227388522683093e-05) D96 D97 ^ D101 +error(0.001830493767202687975) D96 D97 ^ D101 D125 +error(2.861025836566403991e-05) D96 D97 ^ D125 +error(0.0150479596563341516) D96 D103 +error(0.01110180417699024001) D96 D103 ^ D100 D101 +error(0.02213619326971636922) D96 D120 +error(0.002579554369470707462) D96 D120 ^ D124 D125 +error(0.003236307905156624899) D96 D121 +error(0.0005079835293430067563) D96 D121 ^ D124 D125 +error(0.001390683905584838868) D96 D127 +error(0.002396077516820634395) D96 D127 ^ D100 D101 +error(0.001515604606709302846) D96 D127 ^ D100 D124 +error(0.002611050841900463149) D96 D127 ^ D101 D124 +error(0.001030212141032500316) D96 D127 ^ D101 D125 +error(0.003086746265355783374) D96 D127 ^ D124 D125 +error(0.001205642639412828282) D96 D128 +error(5.413361691145458354e-05) D96 D128 ^ D101 +error(0.0006132114541846075744) D96 D128 ^ D101 D124 +error(0.001417719826750507691) D96 D128 ^ D101 D125 +error(0.0005980895653587027776) D96 D128 ^ D124 D125 +error(0.01000000000000000021) D97 +error(0.01636000547734253047) D97 D104 +error(0.01796233722540469674) D97 D104 ^ D101 +error(0.02381232961817726645) D97 D121 +error(0.002637023807817020799) D97 D121 ^ D125 +error(0.003450945788882907317) D97 D128 +error(0.002599654021808480656) D97 D128 ^ D101 +error(0.004061933355944112936) D97 D128 ^ D125 +error(0.0009592071290398953122) D97 D128 ^ D125 ^ D101 +error(0.01363803936237644246) D98 D99 +error(0.003930263821803167863) D98 D99 ^ D70 +error(0.01802560496900905418) D98 D99 ^ D94 +error(8.589436615621441292e-05) D98 D99 ^ D102 ^ D70 +error(0.02525902938098234171) D98 D122 +error(0.00574306903657622117) D98 L0 +error(0.0009470563290373274889) D98 L0 ^ D66 L0 ^ D70 +error(0.0008800554094711328119) D98 L0 ^ D66 L0 ^ D94 +error(0.001457843699669428847) D98 L0 ^ D94 ^ D70 +error(0.01450534184220186006) D99 D100 +error(0.0005721110364468817927) D99 D100 ^ D102 D103 +error(0.004601701592776456101) D99 D100 ^ D102 D126 +error(0.01329762689544615982) D99 D105 +error(0.01235795010597530268) D99 D105 ^ D102 +error(0.004365491728138845215) D99 D122 +error(0.002695027976132394112) D99 D122 ^ D94 +error(0.0003027628658435273408) D99 D122 ^ D126 ^ D94 +error(0.02723315102725440418) D99 D123 +error(0.00140205973473897039) D99 D123 ^ D94 +error(0.005203451391324077739) D99 D123 ^ D126 +error(0.00255544150013453002) D99 D129 +error(0.001808009258848390166) D99 D129 ^ D102 +error(0.002707021320884218929) D99 D129 ^ D126 +error(0.0006088424000031264971) D99 D129 ^ D126 ^ D102 +error(0.006472003059864666653) D100 D101 +error(0.0003994528074094950672) D100 D101 ^ D102 D103 +error(0.0004434226054838874857) D100 D101 ^ D102 D127 +error(0.0008751552090033030192) D100 D101 ^ D103 D104 +error(0.003045602539330864375) D100 D101 ^ D103 D127 +error(0.01325582626527719958) D100 D106 +error(0.01125502755749200473) D100 D106 ^ D102 D103 +error(0.007525476540747918358) D100 D123 +error(0.0006137602329925614204) D100 D123 ^ D126 D127 +error(0.02902365595154616021) D100 D124 +error(0.002401197642609727463) D100 D124 ^ D126 D127 +error(0.002408909711435769981) D100 D129 +error(0.0002707484224426097191) D100 D129 ^ D102 +error(0.001527963667674685309) D100 D129 ^ D102 D126 +error(0.0001105290094925922439) D100 D129 ^ D102 D127 +error(0.0005441160428730808241) D100 D129 ^ D126 +error(0.000356573641289079893) D100 D129 ^ D126 D127 +error(0.003107337702078268298) D100 D130 +error(0.00148514416775588306) D100 D130 ^ D102 D103 +error(0.0009343659549481646417) D100 D130 ^ D102 D126 +error(0.001133507027766949074) D100 D130 ^ D102 D127 +error(0.000964158168953031477) D100 D130 ^ D103 D127 +error(0.001858972200881762581) D100 D130 ^ D126 D127 +error(0.01000000000000000021) D101 +error(0.004493550144293693982) D101 D124 +error(0.0004616573460695907647) D101 D124 ^ D127 D128 +error(0.02153375451966943119) D101 D125 +error(0.001571041344134688862) D101 D125 ^ D127 D128 +error(0.001727413411201550366) D101 D130 +error(6.892623931214466931e-05) D101 D130 ^ D102 D103 +error(0.000533806835748320543) D101 D130 ^ D102 D127 +error(0.001001657939292958282) D101 D130 ^ D103 D127 +error(0.0006587014447459603635) D101 ^ D69 ^ D73 +error(0.0009512945064856004112) D101 ^ D69 ^ D97 +error(0.0004374836472664517121) D101 ^ D73 +error(0.01000000000000000021) D102 +error(0.006089189670584919251) D102 D103 +error(0.0003733339846648112744) D102 D103 ^ D105 D106 +error(0.002491417993463262287) D102 D103 ^ D106 D130 +error(0.0005065788208640180758) D102 D103 ^ D130 +error(0.0367379142487225252) D102 D126 +error(0.004448757689050466223) D102 D126 ^ D129 D130 +error(0.003134023997971539712) D102 D127 +error(0.0003650194631049960385) D102 D127 ^ D129 D130 +error(0.001406953404968496737) D102 D131 +error(0.000258713445676149944) D102 D131 ^ D106 +error(0.001311719158548649289) D102 D131 ^ D106 D130 +error(0.01016476222491488092) D103 D104 +error(0.002108544545389898564) D103 D104 ^ D77 +error(0.01205056218453301811) D103 D104 ^ D101 +error(8.106206907232670631e-05) D103 D104 ^ D106 +error(0.0003126805541716948288) D103 D104 ^ D106 ^ D77 +error(0.01810275288528837012) D103 D107 +error(0.01637617210264374554) D103 D107 ^ D106 +error(0.02102885356741089617) D103 D127 +error(0.001690237581495826133) D103 D127 ^ D101 +error(0.00359606707161589734) D103 D127 ^ D130 +error(0.003107887681254754581) D103 D128 +error(0.003382303353831740949) D103 D128 ^ D101 +error(0.0001913183606313894702) D103 D128 ^ D130 +error(0.0002941212067804130489) D103 D128 ^ D130 ^ D101 +error(0.003693046244270884078) D103 D131 +error(0.003186564243865780671) D103 D131 ^ D106 +error(0.004755038122238004067) D103 D131 ^ D130 +error(0.001954054770515154492) D103 D131 ^ D130 ^ D106 +error(0.02640784577619364679) D104 D128 +error(0.00290739257373180118) D104 D128 ^ D101 +error(0.006564866789739933102) D105 D106 +error(0.001832679987383818189) D105 D106 ^ D78 +error(0.01288524193192810627) D105 D106 ^ D102 +error(0.0006173749993255437177) D105 D106 ^ D107 +error(0.0004559863367010421231) D105 D106 ^ D107 ^ D78 +error(0.03275880248144626833) D105 D129 +error(0.00429567725900462799) D105 D129 ^ D102 +error(0.01072741549435932314) D106 +error(0.002509590526077771534) D106 D129 +error(0.003096878840847453254) D106 D129 ^ D102 +error(0.0004658229008440930739) D106 D129 ^ D131 +error(0.0006984840680404692847) D106 D129 ^ D131 ^ D102 +error(0.02371714611383288207) D106 D130 +error(0.001691210042327366938) D106 D130 ^ D102 +error(0.002968485154357761256) D106 D130 ^ D131 +error(0.01188288263817612218) D106 ^ D107 +error(0.001107203287059167415) D106 ^ D131 +error(0.004560533548355043092) D107 D131 ^ D106 +error(0.005000000000000000104) D107 +error(0.01983080680743972563) D107 D131 +error(0.005000000000000000104) D108 +error(0.01768647969650154195) D108 D112 +error(0.01997660103599073478) D108 D112 ^ D109 L0 +error(0.0272133096145726304) D108 D132 +error(0.009354172066671974373) D108 D132 ^ D133 L0 +error(0.006575429550073013871) D108 D136 +error(0.006606814816559495283) D108 D136 ^ D109 L0 +error(0.00570203587243049443) D108 D136 ^ D133 L0 +error(0.004394467297965208054) D108 D136 ^ D133 L0 ^ D109 L0 +error(0.003141484544212969771) D108 D137 +error(0.002866645116274591214) D108 D137 ^ D109 D133 +error(0.0007467639087963555584) D108 D137 ^ D109 L0 +error(0.00100340881217143808) D108 D137 ^ D133 L0 +error(0.005000000000000000104) D108 ^ D109 L0 +error(0.006716177406890511993) D109 D133 ^ D108 +error(0.006831737513122857625) D109 D110 +error(0.000925383923960359611) D109 D110 ^ D108 +error(0.0002795442616193875634) D109 D110 ^ D112 D113 +error(0.0005690671345596917631) D109 D110 ^ D112 D137 +error(0.01632363663664802497) D109 D110 ^ D113 +error(0.004686760244772980415) D109 D110 ^ D113 D137 +error(0.003622701663117294888) D109 D110 ^ D137 +error(0.0006213698150018824758) D109 D110 ^ D137 ^ D108 +error(0.02092676657561087783) D109 D115 +error(0.0132551803359697469) D109 D115 ^ D112 D113 +error(0.05139236901086036841) D109 D133 +error(0.003561108508096676607) D109 D133 ^ D136 D137 +error(0.0046639615040387555) D109 D133 ^ D137 +error(0.004108367013198443128) D109 D138 +error(0.001863368595620282274) D109 D138 ^ D112 D136 +error(0.0002077739562874012804) D109 D138 ^ D112 D137 +error(0.0001534208996732992975) D109 D138 ^ D136 D137 +error(0.002474351314484049547) D109 D139 +error(0.001842181383880251615) D109 D139 ^ D112 D113 +error(0.0007357888818581343913) D109 D139 ^ D112 D136 +error(0.002176810431023448646) D109 D139 ^ D112 D137 +error(0.0009865289460392872439) D109 D139 ^ D113 D137 +error(0.002351214005477396222) D109 D139 ^ D136 D137 +error(0.01000000000000000021) D109 L0 +error(0.01700103788466153509) D110 D116 +error(0.01657742774919643974) D110 D116 ^ D113 +error(0.005959798576863498468) D110 D133 +error(0.000405679075595877963) D110 D133 ^ D108 +error(0.006365081479756801858) D110 D133 ^ D137 +error(0.0006185446772456166349) D110 D133 ^ D137 ^ D108 +error(0.02877376894243781) D110 D134 +error(0.01462010353799540405) D110 D134 ^ D137 +error(0.00255626787296149658) D110 D139 +error(0.0003462302675103233517) D110 D139 ^ D112 D113 +error(0.0006259573259455081164) D110 D139 ^ D112 D137 +error(0.001780026776757265587) D110 D139 ^ D113 D137 +error(0.0007765183634651079674) D110 D139 ^ D137 +error(0.004204068823748800116) D110 D140 +error(0.004448751937011490021) D110 D140 ^ D113 +error(0.002493712434291736613) D110 D140 ^ D137 +error(0.002122847769795885211) D110 D140 ^ D137 ^ D113 +error(0.008073481635886498378) D111 D112 +error(0.0005730018563843651807) D111 D112 ^ D109 L0 +error(0.0004628308648474659527) D111 D112 ^ D114 D115 +error(0.002505525127704565005) D111 D112 ^ D114 D138 +error(0.009108311699216133789) D111 D112 ^ D114 L0 +error(0.0001464483877319481696) D111 D112 ^ D115 D138 +error(0.001791079838534594517) D111 D112 ^ D138 L0 +error(0.000306018137642829612) D111 D112 ^ D138 L0 ^ D109 L0 +error(0.01557841355567917037) D111 D118 +error(0.01435979479825004283) D111 D118 ^ D114 L0 +error(0.02308764085533153432) D111 D135 +error(0.00431467884365783691) D111 D135 ^ D138 L0 +error(0.001931307837553560523) D111 D136 +error(0.0008665267816730684537) D111 D136 ^ D109 L0 +error(0.002496274199622507042) D111 D136 ^ D138 L0 +error(0.0003964385681257144838) D111 D136 ^ D138 L0 ^ D109 L0 +error(0.003466727401050739669) D111 D142 +error(0.004164332635934311043) D111 D142 ^ D114 L0 +error(0.002681973973769409981) D111 D142 ^ D138 L0 +error(0.001643190028824071487) D111 D142 ^ D138 L0 ^ D114 L0 +error(0.002347213007440165141) D111 D143 +error(1.438422088529517882e-05) D111 D143 ^ D114 D115 +error(0.001602485993920255191) D111 D143 ^ D114 D138 +error(0.0003906309354926121866) D111 D143 ^ D114 L0 +error(0.0002462750543915511142) D111 D143 ^ D115 D138 +error(0.0003195674037454942704) D111 D143 ^ D138 L0 +error(0.009374789236906273804) D112 D113 +error(0.0005590529469528864254) D112 D113 ^ D85 L0 +error(0.0001530608469217417504) D112 D113 ^ D109 L0 +error(0.0008647203357822550026) D112 D113 ^ D114 D115 +error(0.000648659578791030509) D112 D113 ^ D115 D116 +error(0.00193254128555270981) D112 D113 ^ D115 D139 +error(6.236263047404961928e-05) D112 D113 ^ D116 D139 +error(0.01492810779744833949) D112 D119 +error(0.01018712175352179221) D112 D119 ^ D114 D115 +error(0.02897098431077184053) D112 D136 +error(0.009580229984338856086) D112 D136 ^ D109 L0 +error(0.003392722770150778579) D112 D136 ^ D138 D139 +error(0.0009747224564062936412) D112 D136 ^ D138 L0 +error(0.002252326138938211871) D112 D137 +error(0.0005634108258186226606) D112 D137 ^ D138 D139 +error(0.002115175773512700461) D112 D143 +error(0.0030608781621897568) D112 D143 ^ D114 D115 +error(0.001270789941476938327) D112 D143 ^ D114 D138 +error(0.001939096001487852121) D112 D143 ^ D115 D138 +error(0.001187976190653792109) D112 D143 ^ D115 D139 +error(0.002026211267946444097) D112 D143 ^ D138 D139 +error(0.0009157719035976701148) D112 D144 +error(0.0001672286054041389081) D112 D144 ^ D115 D116 +error(0.0005353541060028568126) D112 D144 ^ D115 D138 +error(0.001349693943062659982) D112 D144 ^ D115 D139 +error(0.0001999317661850497118) D112 D144 ^ D116 D139 +error(0.0005670826236588418032) D112 D144 ^ D138 D139 +error(0.01000000000000000021) D113 +error(0.02725063153630395349) D113 D120 +error(0.02389252453306664817) D113 D120 ^ D115 D116 +error(0.03329807480613649479) D113 D137 +error(0.002054421110880488236) D113 D137 ^ D139 D140 +error(0.005139440185035600017) D113 D144 +error(0.002101194335119418565) D113 D144 ^ D115 D116 +error(0.0008922567876475901794) D113 D144 ^ D115 D139 +error(0.002032431206016870138) D113 D144 ^ D116 D139 +error(0.0005572318529482796516) D113 D144 ^ D116 D140 +error(0.002750366226549339366) D113 D144 ^ D139 D140 +error(0.001460790359938684765) D113 D145 +error(0.0004147934522296172497) D113 D145 ^ D116 D139 +error(0.001498989588066860232) D113 D145 ^ D116 D140 +error(0.007007209720512256115) D114 D115 +error(0.0004546663148800625083) D114 D115 ^ D118 D119 +error(0.0001425002969150308049) D114 D115 ^ D118 D143 +error(0.0005696660143250861785) D114 D115 ^ D119 D120 +error(0.003116901364237378153) D114 D115 ^ D119 D143 +error(0.01566705597438649775) D114 D123 +error(0.01186724049158091772) D114 D123 ^ D118 D119 +error(0.03336402185735180131) D114 D138 +error(0.00244917592564833364) D114 D138 ^ D142 D143 +error(0.002462421301947203146) D114 D146 +error(0.001960634436970778299) D114 D146 ^ D118 D142 +error(3.566087944092823308e-06) D114 D146 ^ D118 D143 +error(0.0001637216941453993634) D114 D146 ^ D142 D143 +error(0.004695941015552158003) D114 D147 +error(0.00205837118508770409) D114 D147 ^ D118 D119 +error(0.002163953410575679935) D114 D147 ^ D118 D142 +error(0.001554394982217835453) D114 D147 ^ D118 D143 +error(0.0008879695541101345754) D114 D147 ^ D119 D143 +error(0.002096192257208842526) D114 D147 ^ D142 D143 +error(0.01000000000000000021) D114 L0 +error(0.004381884530454759931) D118 D142 ^ D114 L0 +error(0.008692175163913264807) D115 D116 +error(0.0006905029968304733732) D115 D116 ^ D89 +error(0.00015945046755517543) D115 D116 ^ D113 +error(0.001006504109593458303) D115 D116 ^ D119 D120 +error(0.0008131714298475562147) D115 D116 ^ D119 D144 +error(0.0001651771561405014556) D115 D116 ^ D120 D121 +error(0.001649440750181971295) D115 D116 ^ D120 D144 +error(0.01789251364993136792) D115 D124 +error(0.01500802532656671066) D115 D124 ^ D119 D120 +error(0.003194379691095217307) D115 D138 +error(0.000203690984695900824) D115 D138 ^ D143 D144 +error(0.04189958697952669148) D115 D139 +error(0.002152911101466412069) D115 D139 ^ D143 D144 +error(0.00127605215256659083) D115 D147 +error(0.0001706398503003628525) D115 D147 ^ D118 D119 +error(0.0005783336597214276545) D115 D147 ^ D118 D143 +error(0.002016020127898890141) D115 D147 ^ D119 D143 +error(0.0001968335352046341011) D115 D147 ^ D119 D144 +error(0.0001375362953422371091) D115 D147 ^ D143 D144 +error(0.0009834825476811148021) D115 D148 +error(0.00207981557623123552) D115 D148 ^ D119 D120 +error(0.001841441603780133614) D115 D148 ^ D119 D143 +error(0.002505923860524120889) D115 D148 ^ D119 D144 +error(0.001419084695213386135) D115 D148 ^ D120 D144 +error(0.002852296504457221913) D115 D148 ^ D143 D144 +error(0.009019350943902253864) D116 D117 +error(0.0001633354758280312132) D116 D117 ^ D113 +error(0.0005572855800292770244) D116 D117 ^ D120 D121 +error(0.000553630490138258915) D116 D117 ^ D120 D145 +error(0.01251672150946384239) D116 D117 ^ D121 +error(0.005790639639282292236) D116 D117 ^ D121 D145 +error(0.001145685949262297476) D116 D117 ^ D145 +error(0.0003259075124975205589) D116 D117 ^ D145 ^ D113 +error(0.01461905296180973472) D116 D125 +error(0.01098538498491322471) D116 D125 ^ D120 D121 +error(0.003447214799424203578) D116 D139 +error(0.0003666576516136855319) D116 D139 ^ D144 D145 +error(0.02223358031578045318) D116 D140 +error(0.005543803677485251852) D116 D140 ^ D113 +error(0.002210910752504785439) D116 D140 ^ D144 D145 +error(0.001379541549716805683) D116 D140 ^ D145 +error(0.002924885832784762055) D116 D148 +error(0.001574022131985900515) D116 D148 ^ D120 D144 +error(0.0003547034745176052173) D116 D148 ^ D120 D145 +error(0.0002399940007932416046) D116 D148 ^ D144 D145 +error(0.002619265017415267974) D116 D149 +error(0.00158241141465816147) D116 D149 ^ D120 D121 +error(0.0004730953369301131323) D116 D149 ^ D120 D144 +error(0.002269905077607368895) D116 D149 ^ D120 D145 +error(0.0006264493750148219901) D116 D149 ^ D121 D145 +error(0.001918993207104307793) D116 D149 ^ D144 D145 +error(0.01377675457637685119) D117 +error(0.002469986989841304811) D117 D140 +error(8.555696620424324658e-05) D117 D140 ^ D113 +error(0.002594304494337347066) D117 D140 ^ D145 +error(0.0001376299769938429572) D117 D140 ^ D145 ^ D113 +error(0.03458993767437905376) D117 D141 +error(0.00595402342578680091) D117 D141 ^ D145 +error(0.00245631142944030675) D117 D149 +error(0.0003152919029694442122) D117 D149 ^ D120 D121 +error(0.0001612541715673219793) D117 D149 ^ D120 D145 +error(0.002267685579689308461) D117 D149 ^ D121 D145 +error(0.02509039495427965033) D117 ^ D121 +error(0.002041494666156196645) D117 ^ D145 ^ D121 +error(0.01000000000000000021) D118 +error(0.01187707629310352439) D118 D119 +error(0.001215264942972966392) D118 D119 ^ D122 D123 +error(0.0005861090175784376428) D118 D119 ^ D123 D124 +error(0.001982134764997857141) D118 D119 ^ D123 D147 +error(0.000425289327455776172) D118 D119 ^ D124 D147 +error(0.05297676665932575524) D118 D142 +error(0.003462771653202506312) D118 D142 ^ D146 D147 +error(0.00322690889612168132) D118 D143 +error(0.000497833939171843853) D118 D143 ^ D146 D147 +error(0.002260264554825750123) D118 D150 +error(0.0003473527278594572667) D118 D150 ^ D123 D124 +error(0.0008431892706171371455) D118 D150 ^ D123 D147 +error(0.0003892606543198490589) D118 D150 ^ D124 D147 +error(0.01190612723083741761) D118 ^ D122 L0 +error(0.004358707189286150849) D122 D146 ^ D118 +error(0.01780468578502405336) D119 D120 +error(0.0004696046272799186939) D119 D120 ^ D123 D124 +error(0.0008851561914086082629) D119 D120 ^ D124 D125 +error(0.001718406529616470267) D119 D120 ^ D124 D148 +error(0.0003621508437235534191) D119 D120 ^ D125 D148 +error(0.02155444020316826109) D119 D126 +error(0.02009756387803195501) D119 D126 ^ D123 D124 +error(0.02960309792484100769) D119 D143 +error(0.002696425463454497993) D119 D143 ^ D147 D148 +error(0.004542445374810293035) D119 D144 +error(0.0004787390755988302541) D119 D144 ^ D147 D148 +error(0.005783598058333213297) D119 D150 +error(0.006313383773074134758) D119 D150 ^ D123 D124 +error(0.001741030225433118535) D119 D150 ^ D123 D147 +error(0.007616179929498220411) D119 D150 ^ D124 D147 +error(0.002095215870669062119) D119 D150 ^ D124 D148 +error(0.003866228108010479232) D119 D150 ^ D147 D148 +error(0.001007778755732767137) D119 D151 +error(0.000791992306397491623) D119 D151 ^ D124 D125 +error(0.000442838744421881808) D119 D151 ^ D124 D147 +error(0.0011264348417513437) D119 D151 ^ D124 D148 +error(0.0007294911408703053015) D119 D151 ^ D125 D148 +error(0.0006790628791750554817) D119 D151 ^ D147 D148 +error(0.007519668875887872833) D120 D121 +error(0.000367564866391688718) D120 D121 ^ D124 D125 +error(4.196227388522683093e-05) D120 D121 ^ D125 +error(0.001830493767202687975) D120 D121 ^ D125 D149 +error(2.861025836566403991e-05) D120 D121 ^ D149 +error(0.0150479596563341516) D120 D127 +error(0.01110180417699024001) D120 D127 ^ D124 D125 +error(0.02213619326971636922) D120 D144 +error(0.002579554369470707462) D120 D144 ^ D148 D149 +error(0.003236307905156624899) D120 D145 +error(0.0005079835293430067563) D120 D145 ^ D148 D149 +error(0.001390683905584838868) D120 D151 +error(0.002396077516820634395) D120 D151 ^ D124 D125 +error(0.001515604606709302846) D120 D151 ^ D124 D148 +error(0.002611050841900463149) D120 D151 ^ D125 D148 +error(0.001030212141032500316) D120 D151 ^ D125 D149 +error(0.003086746265355783374) D120 D151 ^ D148 D149 +error(0.001205642639412828282) D120 D152 +error(5.413361691145458354e-05) D120 D152 ^ D125 +error(0.0006132114541846075744) D120 D152 ^ D125 D148 +error(0.001417719826750507691) D120 D152 ^ D125 D149 +error(0.0005980895653587027776) D120 D152 ^ D148 D149 +error(0.01000000000000000021) D121 +error(0.01636000547734253047) D121 D128 +error(0.01796233722540469674) D121 D128 ^ D125 +error(0.02381232961817726645) D121 D145 +error(0.002637023807817020799) D121 D145 ^ D149 +error(0.003450945788882907317) D121 D152 +error(0.002599654021808480656) D121 D152 ^ D125 +error(0.004061933355944112936) D121 D152 ^ D149 +error(0.0009592071290398953122) D121 D152 ^ D149 ^ D125 +error(0.01363803936237644246) D122 D123 +error(0.003930263821803167863) D122 D123 ^ D94 +error(0.01802560496900905418) D122 D123 ^ D118 +error(8.589436615621441292e-05) D122 D123 ^ D126 ^ D94 +error(0.02525902938098234171) D122 D146 +error(0.00574306903657622117) D122 L0 +error(0.0009470563290373274889) D122 L0 ^ D90 L0 ^ D94 +error(0.0008800554094711328119) D122 L0 ^ D90 L0 ^ D118 +error(0.001457843699669428847) D122 L0 ^ D118 ^ D94 +error(0.01450534184220186006) D123 D124 +error(0.0005721110364468817927) D123 D124 ^ D126 D127 +error(0.004601701592776456101) D123 D124 ^ D126 D150 +error(0.01329762689544615982) D123 D129 +error(0.01235795010597530268) D123 D129 ^ D126 +error(0.004365491728138845215) D123 D146 +error(0.002695027976132394112) D123 D146 ^ D118 +error(0.0003027628658435273408) D123 D146 ^ D150 ^ D118 +error(0.02723315102725440418) D123 D147 +error(0.00140205973473897039) D123 D147 ^ D118 +error(0.005203451391324077739) D123 D147 ^ D150 +error(0.00255544150013453002) D123 D153 +error(0.001808009258848390166) D123 D153 ^ D126 +error(0.002707021320884218929) D123 D153 ^ D150 +error(0.0006088424000031264971) D123 D153 ^ D150 ^ D126 +error(0.006472003059864666653) D124 D125 +error(0.0003994528074094950672) D124 D125 ^ D126 D127 +error(0.0004434226054838874857) D124 D125 ^ D126 D151 +error(0.0008751552090033030192) D124 D125 ^ D127 D128 +error(0.003045602539330864375) D124 D125 ^ D127 D151 +error(0.01325582626527719958) D124 D130 +error(0.01125502755749200473) D124 D130 ^ D126 D127 +error(0.007525476540747918358) D124 D147 +error(0.0006137602329925614204) D124 D147 ^ D150 D151 +error(0.02902365595154616021) D124 D148 +error(0.002401197642609727463) D124 D148 ^ D150 D151 +error(0.002408909711435769981) D124 D153 +error(0.0002707484224426097191) D124 D153 ^ D126 +error(0.001527963667674685309) D124 D153 ^ D126 D150 +error(0.0001105290094925922439) D124 D153 ^ D126 D151 +error(0.0005441160428730808241) D124 D153 ^ D150 +error(0.000356573641289079893) D124 D153 ^ D150 D151 +error(0.003107337702078268298) D124 D154 +error(0.00148514416775588306) D124 D154 ^ D126 D127 +error(0.0009343659549481646417) D124 D154 ^ D126 D150 +error(0.001133507027766949074) D124 D154 ^ D126 D151 +error(0.000964158168953031477) D124 D154 ^ D127 D151 +error(0.001858972200881762581) D124 D154 ^ D150 D151 +error(0.01000000000000000021) D125 +error(0.004493550144293693982) D125 D148 +error(0.0004616573460695907647) D125 D148 ^ D151 D152 +error(0.02153375451966943119) D125 D149 +error(0.001571041344134688862) D125 D149 ^ D151 D152 +error(0.001727413411201550366) D125 D154 +error(6.892623931214466931e-05) D125 D154 ^ D126 D127 +error(0.000533806835748320543) D125 D154 ^ D126 D151 +error(0.001001657939292958282) D125 D154 ^ D127 D151 +error(0.0006587014447459603635) D125 ^ D93 ^ D97 +error(0.0009512945064856004112) D125 ^ D93 ^ D121 +error(0.0004374836472664517121) D125 ^ D97 +error(0.01000000000000000021) D126 +error(0.006089189670584919251) D126 D127 +error(0.0003733339846648112744) D126 D127 ^ D129 D130 +error(0.002491417993463262287) D126 D127 ^ D130 D154 +error(0.0005065788208640180758) D126 D127 ^ D154 +error(0.0367379142487225252) D126 D150 +error(0.004448757689050466223) D126 D150 ^ D153 D154 +error(0.003134023997971539712) D126 D151 +error(0.0003650194631049960385) D126 D151 ^ D153 D154 +error(0.001406953404968496737) D126 D155 +error(0.000258713445676149944) D126 D155 ^ D130 +error(0.001311719158548649289) D126 D155 ^ D130 D154 +error(0.01016476222491488092) D127 D128 +error(0.002108544545389898564) D127 D128 ^ D101 +error(0.01205056218453301811) D127 D128 ^ D125 +error(8.106206907232670631e-05) D127 D128 ^ D130 +error(0.0003126805541716948288) D127 D128 ^ D130 ^ D101 +error(0.01810275288528837012) D127 D131 +error(0.01637617210264374554) D127 D131 ^ D130 +error(0.02102885356741089617) D127 D151 +error(0.001690237581495826133) D127 D151 ^ D125 +error(0.00359606707161589734) D127 D151 ^ D154 +error(0.003107887681254754581) D127 D152 +error(0.003382303353831740949) D127 D152 ^ D125 +error(0.0001913183606313894702) D127 D152 ^ D154 +error(0.0002941212067804130489) D127 D152 ^ D154 ^ D125 +error(0.003693046244270884078) D127 D155 +error(0.003186564243865780671) D127 D155 ^ D130 +error(0.004755038122238004067) D127 D155 ^ D154 +error(0.001954054770515154492) D127 D155 ^ D154 ^ D130 +error(0.02640784577619364679) D128 D152 +error(0.00290739257373180118) D128 D152 ^ D125 +error(0.006564866789739933102) D129 D130 +error(0.001832679987383818189) D129 D130 ^ D102 +error(0.01288524193192810627) D129 D130 ^ D126 +error(0.0006173749993255437177) D129 D130 ^ D131 +error(0.0004559863367010421231) D129 D130 ^ D131 ^ D102 +error(0.03275880248144626833) D129 D153 +error(0.00429567725900462799) D129 D153 ^ D126 +error(0.01072741549435932314) D130 +error(0.002509590526077771534) D130 D153 +error(0.003096878840847453254) D130 D153 ^ D126 +error(0.0004658229008440930739) D130 D153 ^ D155 +error(0.0006984840680404692847) D130 D153 ^ D155 ^ D126 +error(0.02371714611383288207) D130 D154 +error(0.001691210042327366938) D130 D154 ^ D126 +error(0.002968485154357761256) D130 D154 ^ D155 +error(0.01188288263817612218) D130 ^ D131 +error(0.001107203287059167415) D130 ^ D155 +error(0.004560533548355043092) D131 D155 ^ D130 +error(0.005000000000000000104) D131 +error(0.01983080680743972563) D131 D155 +error(0.005000000000000000104) D132 +error(0.01768647969650154195) D132 D136 +error(0.01997660103599073478) D132 D136 ^ D133 L0 +error(0.0272133096145726304) D132 D156 +error(0.009354172066671974373) D132 D156 ^ D157 L0 +error(0.006575429550073013871) D132 D160 +error(0.006606814816559495283) D132 D160 ^ D133 L0 +error(0.00570203587243049443) D132 D160 ^ D157 L0 +error(0.004394467297965208054) D132 D160 ^ D157 L0 ^ D133 L0 +error(0.003141484544212969771) D132 D161 +error(0.002866645116274591214) D132 D161 ^ D133 D157 +error(0.0007467639087963555584) D132 D161 ^ D133 L0 +error(0.00100340881217143808) D132 D161 ^ D157 L0 +error(0.005000000000000000104) D132 ^ D133 L0 +error(0.006716177406890511993) D133 D157 ^ D132 +error(0.006831737513122857625) D133 D134 +error(0.000925383923960359611) D133 D134 ^ D132 +error(0.0002795442616193875634) D133 D134 ^ D136 D137 +error(0.0005690671345596917631) D133 D134 ^ D136 D161 +error(0.01632363663664802497) D133 D134 ^ D137 +error(0.004686760244772980415) D133 D134 ^ D137 D161 +error(0.003622701663117294888) D133 D134 ^ D161 +error(0.0006213698150018824758) D133 D134 ^ D161 ^ D132 +error(0.02092676657561087783) D133 D139 +error(0.0132551803359697469) D133 D139 ^ D136 D137 +error(0.05139236901086036841) D133 D157 +error(0.003561108508096676607) D133 D157 ^ D160 D161 +error(0.0046639615040387555) D133 D157 ^ D161 +error(0.004108367013198443128) D133 D162 +error(0.001863368595620282274) D133 D162 ^ D136 D160 +error(0.0002077739562874012804) D133 D162 ^ D136 D161 +error(0.0001534208996732992975) D133 D162 ^ D160 D161 +error(0.002474351314484049547) D133 D163 +error(0.001842181383880251615) D133 D163 ^ D136 D137 +error(0.0007357888818581343913) D133 D163 ^ D136 D160 +error(0.002176810431023448646) D133 D163 ^ D136 D161 +error(0.0009865289460392872439) D133 D163 ^ D137 D161 +error(0.002351214005477396222) D133 D163 ^ D160 D161 +error(0.01000000000000000021) D133 L0 +error(0.01700103788466153509) D134 D140 +error(0.01657742774919643974) D134 D140 ^ D137 +error(0.005959798576863498468) D134 D157 +error(0.000405679075595877963) D134 D157 ^ D132 +error(0.006365081479756801858) D134 D157 ^ D161 +error(0.0006185446772456166349) D134 D157 ^ D161 ^ D132 +error(0.02877376894243781) D134 D158 +error(0.01462010353799540405) D134 D158 ^ D161 +error(0.00255626787296149658) D134 D163 +error(0.0003462302675103233517) D134 D163 ^ D136 D137 +error(0.0006259573259455081164) D134 D163 ^ D136 D161 +error(0.001780026776757265587) D134 D163 ^ D137 D161 +error(0.0007765183634651079674) D134 D163 ^ D161 +error(0.004204068823748800116) D134 D164 +error(0.004448751937011490021) D134 D164 ^ D137 +error(0.002493712434291736613) D134 D164 ^ D161 +error(0.002122847769795885211) D134 D164 ^ D161 ^ D137 +error(0.008073481635886498378) D135 D136 +error(0.0005730018563843651807) D135 D136 ^ D133 L0 +error(0.0004628308648474659527) D135 D136 ^ D138 D139 +error(0.002505525127704565005) D135 D136 ^ D138 D162 +error(0.009108311699216133789) D135 D136 ^ D138 L0 +error(0.0001464483877319481696) D135 D136 ^ D139 D162 +error(0.001791079838534594517) D135 D136 ^ D162 L0 +error(0.000306018137642829612) D135 D136 ^ D162 L0 ^ D133 L0 +error(0.01557841355567917037) D135 D142 +error(0.01435979479825004283) D135 D142 ^ D138 L0 +error(0.02308764085533153432) D135 D159 +error(0.00431467884365783691) D135 D159 ^ D162 L0 +error(0.001931307837553560523) D135 D160 +error(0.0008665267816730684537) D135 D160 ^ D133 L0 +error(0.002496274199622507042) D135 D160 ^ D162 L0 +error(0.0003964385681257144838) D135 D160 ^ D162 L0 ^ D133 L0 +error(0.003466727401050739669) D135 D166 +error(0.004164332635934311043) D135 D166 ^ D138 L0 +error(0.002681973973769409981) D135 D166 ^ D162 L0 +error(0.001643190028824071487) D135 D166 ^ D162 L0 ^ D138 L0 +error(0.002347213007440165141) D135 D167 +error(1.438422088529517882e-05) D135 D167 ^ D138 D139 +error(0.001602485993920255191) D135 D167 ^ D138 D162 +error(0.0003906309354926121866) D135 D167 ^ D138 L0 +error(0.0002462750543915511142) D135 D167 ^ D139 D162 +error(0.0003195674037454942704) D135 D167 ^ D162 L0 +error(0.009374789236906273804) D136 D137 +error(0.0005590529469528864254) D136 D137 ^ D109 L0 +error(0.0001530608469217417504) D136 D137 ^ D133 L0 +error(0.0008647203357822550026) D136 D137 ^ D138 D139 +error(0.000648659578791030509) D136 D137 ^ D139 D140 +error(0.00193254128555270981) D136 D137 ^ D139 D163 +error(6.236263047404961928e-05) D136 D137 ^ D140 D163 +error(0.01492810779744833949) D136 D143 +error(0.01018712175352179221) D136 D143 ^ D138 D139 +error(0.02897098431077184053) D136 D160 +error(0.009580229984338856086) D136 D160 ^ D133 L0 +error(0.003392722770150778579) D136 D160 ^ D162 D163 +error(0.0009747224564062936412) D136 D160 ^ D162 L0 +error(0.002252326138938211871) D136 D161 +error(0.0005634108258186226606) D136 D161 ^ D162 D163 +error(0.002115175773512700461) D136 D167 +error(0.0030608781621897568) D136 D167 ^ D138 D139 +error(0.001270789941476938327) D136 D167 ^ D138 D162 +error(0.001939096001487852121) D136 D167 ^ D139 D162 +error(0.001187976190653792109) D136 D167 ^ D139 D163 +error(0.002026211267946444097) D136 D167 ^ D162 D163 +error(0.0009157719035976701148) D136 D168 +error(0.0001672286054041389081) D136 D168 ^ D139 D140 +error(0.0005353541060028568126) D136 D168 ^ D139 D162 +error(0.001349693943062659982) D136 D168 ^ D139 D163 +error(0.0001999317661850497118) D136 D168 ^ D140 D163 +error(0.0005670826236588418032) D136 D168 ^ D162 D163 +error(0.01000000000000000021) D137 +error(0.02725063153630395349) D137 D144 +error(0.02389252453306664817) D137 D144 ^ D139 D140 +error(0.03329807480613649479) D137 D161 +error(0.002054421110880488236) D137 D161 ^ D163 D164 +error(0.005139440185035600017) D137 D168 +error(0.002101194335119418565) D137 D168 ^ D139 D140 +error(0.0008922567876475901794) D137 D168 ^ D139 D163 +error(0.002032431206016870138) D137 D168 ^ D140 D163 +error(0.0005572318529482796516) D137 D168 ^ D140 D164 +error(0.002750366226549339366) D137 D168 ^ D163 D164 +error(0.001460790359938684765) D137 D169 +error(0.0004147934522296172497) D137 D169 ^ D140 D163 +error(0.001498989588066860232) D137 D169 ^ D140 D164 +error(0.007007209720512256115) D138 D139 +error(0.0004546663148800625083) D138 D139 ^ D142 D143 +error(0.0001425002969150308049) D138 D139 ^ D142 D167 +error(0.0005696660143250861785) D138 D139 ^ D143 D144 +error(0.003116901364237378153) D138 D139 ^ D143 D167 +error(0.01566705597438649775) D138 D147 +error(0.01186724049158091772) D138 D147 ^ D142 D143 +error(0.03336402185735180131) D138 D162 +error(0.00244917592564833364) D138 D162 ^ D166 D167 +error(0.002462421301947203146) D138 D170 +error(0.001960634436970778299) D138 D170 ^ D142 D166 +error(3.566087944092823308e-06) D138 D170 ^ D142 D167 +error(0.0001637216941453993634) D138 D170 ^ D166 D167 +error(0.004695941015552158003) D138 D171 +error(0.00205837118508770409) D138 D171 ^ D142 D143 +error(0.002163953410575679935) D138 D171 ^ D142 D166 +error(0.001554394982217835453) D138 D171 ^ D142 D167 +error(0.0008879695541101345754) D138 D171 ^ D143 D167 +error(0.002096192257208842526) D138 D171 ^ D166 D167 +error(0.01000000000000000021) D138 L0 +error(0.004381884530454759931) D142 D166 ^ D138 L0 +error(0.008692175163913264807) D139 D140 +error(0.0006905029968304733732) D139 D140 ^ D113 +error(0.00015945046755517543) D139 D140 ^ D137 +error(0.001006504109593458303) D139 D140 ^ D143 D144 +error(0.0008131714298475562147) D139 D140 ^ D143 D168 +error(0.0001651771561405014556) D139 D140 ^ D144 D145 +error(0.001649440750181971295) D139 D140 ^ D144 D168 +error(0.01789251364993136792) D139 D148 +error(0.01500802532656671066) D139 D148 ^ D143 D144 +error(0.003194379691095217307) D139 D162 +error(0.000203690984695900824) D139 D162 ^ D167 D168 +error(0.04189958697952669148) D139 D163 +error(0.002152911101466412069) D139 D163 ^ D167 D168 +error(0.00127605215256659083) D139 D171 +error(0.0001706398503003628525) D139 D171 ^ D142 D143 +error(0.0005783336597214276545) D139 D171 ^ D142 D167 +error(0.002016020127898890141) D139 D171 ^ D143 D167 +error(0.0001968335352046341011) D139 D171 ^ D143 D168 +error(0.0001375362953422371091) D139 D171 ^ D167 D168 +error(0.0009834825476811148021) D139 D172 +error(0.00207981557623123552) D139 D172 ^ D143 D144 +error(0.001841441603780133614) D139 D172 ^ D143 D167 +error(0.002505923860524120889) D139 D172 ^ D143 D168 +error(0.001419084695213386135) D139 D172 ^ D144 D168 +error(0.002852296504457221913) D139 D172 ^ D167 D168 +error(0.009019350943902253864) D140 D141 +error(0.0001633354758280312132) D140 D141 ^ D137 +error(0.0005572855800292770244) D140 D141 ^ D144 D145 +error(0.000553630490138258915) D140 D141 ^ D144 D169 +error(0.01251672150946384239) D140 D141 ^ D145 +error(0.005790639639282292236) D140 D141 ^ D145 D169 +error(0.001145685949262297476) D140 D141 ^ D169 +error(0.0003259075124975205589) D140 D141 ^ D169 ^ D137 +error(0.01461905296180973472) D140 D149 +error(0.01098538498491322471) D140 D149 ^ D144 D145 +error(0.003447214799424203578) D140 D163 +error(0.0003666576516136855319) D140 D163 ^ D168 D169 +error(0.02223358031578045318) D140 D164 +error(0.005543803677485251852) D140 D164 ^ D137 +error(0.002210910752504785439) D140 D164 ^ D168 D169 +error(0.001379541549716805683) D140 D164 ^ D169 +error(0.002924885832784762055) D140 D172 +error(0.001574022131985900515) D140 D172 ^ D144 D168 +error(0.0003547034745176052173) D140 D172 ^ D144 D169 +error(0.0002399940007932416046) D140 D172 ^ D168 D169 +error(0.002619265017415267974) D140 D173 +error(0.00158241141465816147) D140 D173 ^ D144 D145 +error(0.0004730953369301131323) D140 D173 ^ D144 D168 +error(0.002269905077607368895) D140 D173 ^ D144 D169 +error(0.0006264493750148219901) D140 D173 ^ D145 D169 +error(0.001918993207104307793) D140 D173 ^ D168 D169 +error(0.01377675457637685119) D141 +error(0.002469986989841304811) D141 D164 +error(8.555696620424324658e-05) D141 D164 ^ D137 +error(0.002594304494337347066) D141 D164 ^ D169 +error(0.0001376299769938429572) D141 D164 ^ D169 ^ D137 +error(0.03458993767437905376) D141 D165 +error(0.00595402342578680091) D141 D165 ^ D169 +error(0.00245631142944030675) D141 D173 +error(0.0003152919029694442122) D141 D173 ^ D144 D145 +error(0.0001612541715673219793) D141 D173 ^ D144 D169 +error(0.002267685579689308461) D141 D173 ^ D145 D169 +error(0.02509039495427965033) D141 ^ D145 +error(0.002041494666156196645) D141 ^ D169 ^ D145 +error(0.01000000000000000021) D142 +error(0.01187707629310352439) D142 D143 +error(0.001215264942972966392) D142 D143 ^ D146 D147 +error(0.0005861090175784376428) D142 D143 ^ D147 D148 +error(0.001982134764997857141) D142 D143 ^ D147 D171 +error(0.000425289327455776172) D142 D143 ^ D148 D171 +error(0.05297676665932575524) D142 D166 +error(0.003462771653202506312) D142 D166 ^ D170 D171 +error(0.00322690889612168132) D142 D167 +error(0.000497833939171843853) D142 D167 ^ D170 D171 +error(0.002260264554825750123) D142 D174 +error(0.0003473527278594572667) D142 D174 ^ D147 D148 +error(0.0008431892706171371455) D142 D174 ^ D147 D171 +error(0.0003892606543198490589) D142 D174 ^ D148 D171 +error(0.01190612723083741761) D142 ^ D146 L0 +error(0.004358707189286150849) D146 D170 ^ D142 +error(0.01780468578502405336) D143 D144 +error(0.0004696046272799186939) D143 D144 ^ D147 D148 +error(0.0008851561914086082629) D143 D144 ^ D148 D149 +error(0.001718406529616470267) D143 D144 ^ D148 D172 +error(0.0003621508437235534191) D143 D144 ^ D149 D172 +error(0.02155444020316826109) D143 D150 +error(0.02009756387803195501) D143 D150 ^ D147 D148 +error(0.02960309792484100769) D143 D167 +error(0.002696425463454497993) D143 D167 ^ D171 D172 +error(0.004542445374810293035) D143 D168 +error(0.0004787390755988302541) D143 D168 ^ D171 D172 +error(0.005783598058333213297) D143 D174 +error(0.006313383773074134758) D143 D174 ^ D147 D148 +error(0.001741030225433118535) D143 D174 ^ D147 D171 +error(0.007616179929498220411) D143 D174 ^ D148 D171 +error(0.002095215870669062119) D143 D174 ^ D148 D172 +error(0.003866228108010479232) D143 D174 ^ D171 D172 +error(0.001007778755732767137) D143 D175 +error(0.000791992306397491623) D143 D175 ^ D148 D149 +error(0.000442838744421881808) D143 D175 ^ D148 D171 +error(0.0011264348417513437) D143 D175 ^ D148 D172 +error(0.0007294911408703053015) D143 D175 ^ D149 D172 +error(0.0006790628791750554817) D143 D175 ^ D171 D172 +error(0.007519668875887872833) D144 D145 +error(0.000367564866391688718) D144 D145 ^ D148 D149 +error(4.196227388522683093e-05) D144 D145 ^ D149 +error(0.001830493767202687975) D144 D145 ^ D149 D173 +error(2.861025836566403991e-05) D144 D145 ^ D173 +error(0.0150479596563341516) D144 D151 +error(0.01110180417699024001) D144 D151 ^ D148 D149 +error(0.02213619326971636922) D144 D168 +error(0.002579554369470707462) D144 D168 ^ D172 D173 +error(0.003236307905156624899) D144 D169 +error(0.0005079835293430067563) D144 D169 ^ D172 D173 +error(0.001390683905584838868) D144 D175 +error(0.002396077516820634395) D144 D175 ^ D148 D149 +error(0.001515604606709302846) D144 D175 ^ D148 D172 +error(0.002611050841900463149) D144 D175 ^ D149 D172 +error(0.001030212141032500316) D144 D175 ^ D149 D173 +error(0.003086746265355783374) D144 D175 ^ D172 D173 +error(0.001205642639412828282) D144 D176 +error(5.413361691145458354e-05) D144 D176 ^ D149 +error(0.0006132114541846075744) D144 D176 ^ D149 D172 +error(0.001417719826750507691) D144 D176 ^ D149 D173 +error(0.0005980895653587027776) D144 D176 ^ D172 D173 +error(0.01000000000000000021) D145 +error(0.01636000547734253047) D145 D152 +error(0.01796233722540469674) D145 D152 ^ D149 +error(0.02381232961817726645) D145 D169 +error(0.002637023807817020799) D145 D169 ^ D173 +error(0.003450945788882907317) D145 D176 +error(0.002599654021808480656) D145 D176 ^ D149 +error(0.004061933355944112936) D145 D176 ^ D173 +error(0.0009592071290398953122) D145 D176 ^ D173 ^ D149 +error(0.01363803936237644246) D146 D147 +error(0.003930263821803167863) D146 D147 ^ D118 +error(0.01802560496900905418) D146 D147 ^ D142 +error(8.589436615621441292e-05) D146 D147 ^ D150 ^ D118 +error(0.02525902938098234171) D146 D170 +error(0.00574306903657622117) D146 L0 +error(0.0009470563290373274889) D146 L0 ^ D114 L0 ^ D118 +error(0.0008800554094711328119) D146 L0 ^ D114 L0 ^ D142 +error(0.001457843699669428847) D146 L0 ^ D142 ^ D118 +error(0.01450534184220186006) D147 D148 +error(0.0005721110364468817927) D147 D148 ^ D150 D151 +error(0.004601701592776456101) D147 D148 ^ D150 D174 +error(0.01329762689544615982) D147 D153 +error(0.01235795010597530268) D147 D153 ^ D150 +error(0.004365491728138845215) D147 D170 +error(0.002695027976132394112) D147 D170 ^ D142 +error(0.0003027628658435273408) D147 D170 ^ D174 ^ D142 +error(0.02723315102725440418) D147 D171 +error(0.00140205973473897039) D147 D171 ^ D142 +error(0.005203451391324077739) D147 D171 ^ D174 +error(0.00255544150013453002) D147 D177 +error(0.001808009258848390166) D147 D177 ^ D150 +error(0.002707021320884218929) D147 D177 ^ D174 +error(0.0006088424000031264971) D147 D177 ^ D174 ^ D150 +error(0.006472003059864666653) D148 D149 +error(0.0003994528074094950672) D148 D149 ^ D150 D151 +error(0.0004434226054838874857) D148 D149 ^ D150 D175 +error(0.0008751552090033030192) D148 D149 ^ D151 D152 +error(0.003045602539330864375) D148 D149 ^ D151 D175 +error(0.01325582626527719958) D148 D154 +error(0.01125502755749200473) D148 D154 ^ D150 D151 +error(0.007525476540747918358) D148 D171 +error(0.0006137602329925614204) D148 D171 ^ D174 D175 +error(0.02902365595154616021) D148 D172 +error(0.002401197642609727463) D148 D172 ^ D174 D175 +error(0.002408909711435769981) D148 D177 +error(0.0002707484224426097191) D148 D177 ^ D150 +error(0.001527963667674685309) D148 D177 ^ D150 D174 +error(0.0001105290094925922439) D148 D177 ^ D150 D175 +error(0.0005441160428730808241) D148 D177 ^ D174 +error(0.000356573641289079893) D148 D177 ^ D174 D175 +error(0.003107337702078268298) D148 D178 +error(0.00148514416775588306) D148 D178 ^ D150 D151 +error(0.0009343659549481646417) D148 D178 ^ D150 D174 +error(0.001133507027766949074) D148 D178 ^ D150 D175 +error(0.000964158168953031477) D148 D178 ^ D151 D175 +error(0.001858972200881762581) D148 D178 ^ D174 D175 +error(0.01000000000000000021) D149 +error(0.004493550144293693982) D149 D172 +error(0.0004616573460695907647) D149 D172 ^ D175 D176 +error(0.02153375451966943119) D149 D173 +error(0.001571041344134688862) D149 D173 ^ D175 D176 +error(0.001727413411201550366) D149 D178 +error(6.892623931214466931e-05) D149 D178 ^ D150 D151 +error(0.000533806835748320543) D149 D178 ^ D150 D175 +error(0.001001657939292958282) D149 D178 ^ D151 D175 +error(0.0006587014447459603635) D149 ^ D117 ^ D121 +error(0.0009512945064856004112) D149 ^ D117 ^ D145 +error(0.0004374836472664517121) D149 ^ D121 +error(0.01000000000000000021) D150 +error(0.006089189670584919251) D150 D151 +error(0.0003733339846648112744) D150 D151 ^ D153 D154 +error(0.002491417993463262287) D150 D151 ^ D154 D178 +error(0.0005065788208640180758) D150 D151 ^ D178 +error(0.0367379142487225252) D150 D174 +error(0.004448757689050466223) D150 D174 ^ D177 D178 +error(0.003134023997971539712) D150 D175 +error(0.0003650194631049960385) D150 D175 ^ D177 D178 +error(0.001406953404968496737) D150 D179 +error(0.000258713445676149944) D150 D179 ^ D154 +error(0.001311719158548649289) D150 D179 ^ D154 D178 +error(0.01016476222491488092) D151 D152 +error(0.002108544545389898564) D151 D152 ^ D125 +error(0.01205056218453301811) D151 D152 ^ D149 +error(8.106206907232670631e-05) D151 D152 ^ D154 +error(0.0003126805541716948288) D151 D152 ^ D154 ^ D125 +error(0.01810275288528837012) D151 D155 +error(0.01637617210264374554) D151 D155 ^ D154 +error(0.02102885356741089617) D151 D175 +error(0.001690237581495826133) D151 D175 ^ D149 +error(0.00359606707161589734) D151 D175 ^ D178 +error(0.003107887681254754581) D151 D176 +error(0.003382303353831740949) D151 D176 ^ D149 +error(0.0001913183606313894702) D151 D176 ^ D178 +error(0.0002941212067804130489) D151 D176 ^ D178 ^ D149 +error(0.003693046244270884078) D151 D179 +error(0.003186564243865780671) D151 D179 ^ D154 +error(0.004755038122238004067) D151 D179 ^ D178 +error(0.001954054770515154492) D151 D179 ^ D178 ^ D154 +error(0.02640784577619364679) D152 D176 +error(0.00290739257373180118) D152 D176 ^ D149 +error(0.006564866789739933102) D153 D154 +error(0.001832679987383818189) D153 D154 ^ D126 +error(0.01288524193192810627) D153 D154 ^ D150 +error(0.0006173749993255437177) D153 D154 ^ D155 +error(0.0004559863367010421231) D153 D154 ^ D155 ^ D126 +error(0.03275880248144626833) D153 D177 +error(0.00429567725900462799) D153 D177 ^ D150 +error(0.01072741549435932314) D154 +error(0.002509590526077771534) D154 D177 +error(0.003096878840847453254) D154 D177 ^ D150 +error(0.0004658229008440930739) D154 D177 ^ D179 +error(0.0006984840680404692847) D154 D177 ^ D179 ^ D150 +error(0.02371714611383288207) D154 D178 +error(0.001691210042327366938) D154 D178 ^ D150 +error(0.002968485154357761256) D154 D178 ^ D179 +error(0.01188288263817612218) D154 ^ D155 +error(0.001107203287059167415) D154 ^ D179 +error(0.004560533548355043092) D155 D179 ^ D154 +error(0.005000000000000000104) D155 +error(0.01983080680743972563) D155 D179 +error(0.005000000000000000104) D156 +error(0.01768647969650154195) D156 D160 +error(0.01997660103599073478) D156 D160 ^ D157 L0 +error(0.0272133096145726304) D156 D180 +error(0.009354172066671974373) D156 D180 ^ D181 L0 +error(0.006575429550073013871) D156 D184 +error(0.006606814816559495283) D156 D184 ^ D157 L0 +error(0.00570203587243049443) D156 D184 ^ D181 L0 +error(0.004394467297965208054) D156 D184 ^ D181 L0 ^ D157 L0 +error(0.003141484544212969771) D156 D185 +error(0.002866645116274591214) D156 D185 ^ D157 D181 +error(0.0007467639087963555584) D156 D185 ^ D157 L0 +error(0.00100340881217143808) D156 D185 ^ D181 L0 +error(0.005000000000000000104) D156 ^ D157 L0 +error(0.006716177406890511993) D157 D181 ^ D156 +error(0.006831737513122857625) D157 D158 +error(0.000925383923960359611) D157 D158 ^ D156 +error(0.0002795442616193875634) D157 D158 ^ D160 D161 +error(0.0005690671345596917631) D157 D158 ^ D160 D185 +error(0.01632363663664802497) D157 D158 ^ D161 +error(0.004686760244772980415) D157 D158 ^ D161 D185 +error(0.003622701663117294888) D157 D158 ^ D185 +error(0.0006213698150018824758) D157 D158 ^ D185 ^ D156 +error(0.02092676657561087783) D157 D163 +error(0.0132551803359697469) D157 D163 ^ D160 D161 +error(0.05139236901086036841) D157 D181 +error(0.003561108508096676607) D157 D181 ^ D184 D185 +error(0.0046639615040387555) D157 D181 ^ D185 +error(0.004108367013198443128) D157 D186 +error(0.001863368595620282274) D157 D186 ^ D160 D184 +error(0.0002077739562874012804) D157 D186 ^ D160 D185 +error(0.0001534208996732992975) D157 D186 ^ D184 D185 +error(0.002474351314484049547) D157 D187 +error(0.001842181383880251615) D157 D187 ^ D160 D161 +error(0.0007357888818581343913) D157 D187 ^ D160 D184 +error(0.002176810431023448646) D157 D187 ^ D160 D185 +error(0.0009865289460392872439) D157 D187 ^ D161 D185 +error(0.002351214005477396222) D157 D187 ^ D184 D185 +error(0.01000000000000000021) D157 L0 +error(0.01700103788466153509) D158 D164 +error(0.01657742774919643974) D158 D164 ^ D161 +error(0.005959798576863498468) D158 D181 +error(0.000405679075595877963) D158 D181 ^ D156 +error(0.006365081479756801858) D158 D181 ^ D185 +error(0.0006185446772456166349) D158 D181 ^ D185 ^ D156 +error(0.02877376894243781) D158 D182 +error(0.01462010353799540405) D158 D182 ^ D185 +error(0.00255626787296149658) D158 D187 +error(0.0003462302675103233517) D158 D187 ^ D160 D161 +error(0.0006259573259455081164) D158 D187 ^ D160 D185 +error(0.001780026776757265587) D158 D187 ^ D161 D185 +error(0.0007765183634651079674) D158 D187 ^ D185 +error(0.004204068823748800116) D158 D188 +error(0.004448751937011490021) D158 D188 ^ D161 +error(0.002493712434291736613) D158 D188 ^ D185 +error(0.002122847769795885211) D158 D188 ^ D185 ^ D161 +error(0.008073481635886498378) D159 D160 +error(0.0005730018563843651807) D159 D160 ^ D157 L0 +error(0.0004628308648474659527) D159 D160 ^ D162 D163 +error(0.002505525127704565005) D159 D160 ^ D162 D186 +error(0.009108311699216133789) D159 D160 ^ D162 L0 +error(0.0001464483877319481696) D159 D160 ^ D163 D186 +error(0.001791079838534594517) D159 D160 ^ D186 L0 +error(0.000306018137642829612) D159 D160 ^ D186 L0 ^ D157 L0 +error(0.01557841355567917037) D159 D166 +error(0.01435979479825004283) D159 D166 ^ D162 L0 +error(0.02308764085533153432) D159 D183 +error(0.00431467884365783691) D159 D183 ^ D186 L0 +error(0.001931307837553560523) D159 D184 +error(0.0008665267816730684537) D159 D184 ^ D157 L0 +error(0.002496274199622507042) D159 D184 ^ D186 L0 +error(0.0003964385681257144838) D159 D184 ^ D186 L0 ^ D157 L0 +error(0.003466727401050739669) D159 D190 +error(0.004164332635934311043) D159 D190 ^ D162 L0 +error(0.002681973973769409981) D159 D190 ^ D186 L0 +error(0.001643190028824071487) D159 D190 ^ D186 L0 ^ D162 L0 +error(0.002347213007440165141) D159 D191 +error(1.438422088529517882e-05) D159 D191 ^ D162 D163 +error(0.001602485993920255191) D159 D191 ^ D162 D186 +error(0.0003906309354926121866) D159 D191 ^ D162 L0 +error(0.0002462750543915511142) D159 D191 ^ D163 D186 +error(0.0003195674037454942704) D159 D191 ^ D186 L0 +error(0.009374789236906273804) D160 D161 +error(0.0005590529469528864254) D160 D161 ^ D133 L0 +error(0.0001530608469217417504) D160 D161 ^ D157 L0 +error(0.0008647203357822550026) D160 D161 ^ D162 D163 +error(0.000648659578791030509) D160 D161 ^ D163 D164 +error(0.00193254128555270981) D160 D161 ^ D163 D187 +error(6.236263047404961928e-05) D160 D161 ^ D164 D187 +error(0.01492810779744833949) D160 D167 +error(0.01018712175352179221) D160 D167 ^ D162 D163 +error(0.02897098431077184053) D160 D184 +error(0.009580229984338856086) D160 D184 ^ D157 L0 +error(0.003392722770150778579) D160 D184 ^ D186 D187 +error(0.0009747224564062936412) D160 D184 ^ D186 L0 +error(0.002252326138938211871) D160 D185 +error(0.0005634108258186226606) D160 D185 ^ D186 D187 +error(0.002115175773512700461) D160 D191 +error(0.0030608781621897568) D160 D191 ^ D162 D163 +error(0.001270789941476938327) D160 D191 ^ D162 D186 +error(0.001939096001487852121) D160 D191 ^ D163 D186 +error(0.001187976190653792109) D160 D191 ^ D163 D187 +error(0.002026211267946444097) D160 D191 ^ D186 D187 +error(0.0009157719035976701148) D160 D192 +error(0.0001672286054041389081) D160 D192 ^ D163 D164 +error(0.0005353541060028568126) D160 D192 ^ D163 D186 +error(0.001349693943062659982) D160 D192 ^ D163 D187 +error(0.0001999317661850497118) D160 D192 ^ D164 D187 +error(0.0005670826236588418032) D160 D192 ^ D186 D187 +error(0.01000000000000000021) D161 +error(0.02725063153630395349) D161 D168 +error(0.02389252453306664817) D161 D168 ^ D163 D164 +error(0.03329807480613649479) D161 D185 +error(0.002054421110880488236) D161 D185 ^ D187 D188 +error(0.005139440185035600017) D161 D192 +error(0.002101194335119418565) D161 D192 ^ D163 D164 +error(0.0008922567876475901794) D161 D192 ^ D163 D187 +error(0.002032431206016870138) D161 D192 ^ D164 D187 +error(0.0005572318529482796516) D161 D192 ^ D164 D188 +error(0.002750366226549339366) D161 D192 ^ D187 D188 +error(0.001460790359938684765) D161 D193 +error(0.0004147934522296172497) D161 D193 ^ D164 D187 +error(0.001498989588066860232) D161 D193 ^ D164 D188 +error(0.007007209720512256115) D162 D163 +error(0.0004546663148800625083) D162 D163 ^ D166 D167 +error(0.0001425002969150308049) D162 D163 ^ D166 D191 +error(0.0005696660143250861785) D162 D163 ^ D167 D168 +error(0.003116901364237378153) D162 D163 ^ D167 D191 +error(0.01566705597438649775) D162 D171 +error(0.01186724049158091772) D162 D171 ^ D166 D167 +error(0.03336402185735180131) D162 D186 +error(0.00244917592564833364) D162 D186 ^ D190 D191 +error(0.002462421301947203146) D162 D194 +error(0.001960634436970778299) D162 D194 ^ D166 D190 +error(3.566087944092823308e-06) D162 D194 ^ D166 D191 +error(0.0001637216941453993634) D162 D194 ^ D190 D191 +error(0.004695941015552158003) D162 D195 +error(0.00205837118508770409) D162 D195 ^ D166 D167 +error(0.002163953410575679935) D162 D195 ^ D166 D190 +error(0.001554394982217835453) D162 D195 ^ D166 D191 +error(0.0008879695541101345754) D162 D195 ^ D167 D191 +error(0.002096192257208842526) D162 D195 ^ D190 D191 +error(0.01000000000000000021) D162 L0 +error(0.004381884530454759931) D166 D190 ^ D162 L0 +error(0.008692175163913264807) D163 D164 +error(0.0006905029968304733732) D163 D164 ^ D137 +error(0.00015945046755517543) D163 D164 ^ D161 +error(0.001006504109593458303) D163 D164 ^ D167 D168 +error(0.0008131714298475562147) D163 D164 ^ D167 D192 +error(0.0001651771561405014556) D163 D164 ^ D168 D169 +error(0.001649440750181971295) D163 D164 ^ D168 D192 +error(0.01789251364993136792) D163 D172 +error(0.01500802532656671066) D163 D172 ^ D167 D168 +error(0.003194379691095217307) D163 D186 +error(0.000203690984695900824) D163 D186 ^ D191 D192 +error(0.04189958697952669148) D163 D187 +error(0.002152911101466412069) D163 D187 ^ D191 D192 +error(0.00127605215256659083) D163 D195 +error(0.0001706398503003628525) D163 D195 ^ D166 D167 +error(0.0005783336597214276545) D163 D195 ^ D166 D191 +error(0.002016020127898890141) D163 D195 ^ D167 D191 +error(0.0001968335352046341011) D163 D195 ^ D167 D192 +error(0.0001375362953422371091) D163 D195 ^ D191 D192 +error(0.0009834825476811148021) D163 D196 +error(0.00207981557623123552) D163 D196 ^ D167 D168 +error(0.001841441603780133614) D163 D196 ^ D167 D191 +error(0.002505923860524120889) D163 D196 ^ D167 D192 +error(0.001419084695213386135) D163 D196 ^ D168 D192 +error(0.002852296504457221913) D163 D196 ^ D191 D192 +error(0.009019350943902253864) D164 D165 +error(0.0001633354758280312132) D164 D165 ^ D161 +error(0.0005572855800292770244) D164 D165 ^ D168 D169 +error(0.000553630490138258915) D164 D165 ^ D168 D193 +error(0.01251672150946384239) D164 D165 ^ D169 +error(0.005790639639282292236) D164 D165 ^ D169 D193 +error(0.001145685949262297476) D164 D165 ^ D193 +error(0.0003259075124975205589) D164 D165 ^ D193 ^ D161 +error(0.01461905296180973472) D164 D173 +error(0.01098538498491322471) D164 D173 ^ D168 D169 +error(0.003447214799424203578) D164 D187 +error(0.0003666576516136855319) D164 D187 ^ D192 D193 +error(0.02223358031578045318) D164 D188 +error(0.005543803677485251852) D164 D188 ^ D161 +error(0.002210910752504785439) D164 D188 ^ D192 D193 +error(0.001379541549716805683) D164 D188 ^ D193 +error(0.002924885832784762055) D164 D196 +error(0.001574022131985900515) D164 D196 ^ D168 D192 +error(0.0003547034745176052173) D164 D196 ^ D168 D193 +error(0.0002399940007932416046) D164 D196 ^ D192 D193 +error(0.002619265017415267974) D164 D197 +error(0.00158241141465816147) D164 D197 ^ D168 D169 +error(0.0004730953369301131323) D164 D197 ^ D168 D192 +error(0.002269905077607368895) D164 D197 ^ D168 D193 +error(0.0006264493750148219901) D164 D197 ^ D169 D193 +error(0.001918993207104307793) D164 D197 ^ D192 D193 +error(0.01377675457637685119) D165 +error(0.002469986989841304811) D165 D188 +error(8.555696620424324658e-05) D165 D188 ^ D161 +error(0.002594304494337347066) D165 D188 ^ D193 +error(0.0001376299769938429572) D165 D188 ^ D193 ^ D161 +error(0.03458993767437905376) D165 D189 +error(0.00595402342578680091) D165 D189 ^ D193 +error(0.00245631142944030675) D165 D197 +error(0.0003152919029694442122) D165 D197 ^ D168 D169 +error(0.0001612541715673219793) D165 D197 ^ D168 D193 +error(0.002267685579689308461) D165 D197 ^ D169 D193 +error(0.02509039495427965033) D165 ^ D169 +error(0.002041494666156196645) D165 ^ D193 ^ D169 +error(0.01000000000000000021) D166 +error(0.01187707629310352439) D166 D167 +error(0.001215264942972966392) D166 D167 ^ D170 D171 +error(0.0005861090175784376428) D166 D167 ^ D171 D172 +error(0.001982134764997857141) D166 D167 ^ D171 D195 +error(0.000425289327455776172) D166 D167 ^ D172 D195 +error(0.05297676665932575524) D166 D190 +error(0.003462771653202506312) D166 D190 ^ D194 D195 +error(0.00322690889612168132) D166 D191 +error(0.000497833939171843853) D166 D191 ^ D194 D195 +error(0.002260264554825750123) D166 D198 +error(0.0003473527278594572667) D166 D198 ^ D171 D172 +error(0.0008431892706171371455) D166 D198 ^ D171 D195 +error(0.0003892606543198490589) D166 D198 ^ D172 D195 +error(0.01190612723083741761) D166 ^ D170 L0 +error(0.004358707189286150849) D170 D194 ^ D166 +error(0.01780468578502405336) D167 D168 +error(0.0004696046272799186939) D167 D168 ^ D171 D172 +error(0.0008851561914086082629) D167 D168 ^ D172 D173 +error(0.001718406529616470267) D167 D168 ^ D172 D196 +error(0.0003621508437235534191) D167 D168 ^ D173 D196 +error(0.02155444020316826109) D167 D174 +error(0.02009756387803195501) D167 D174 ^ D171 D172 +error(0.02960309792484100769) D167 D191 +error(0.002696425463454497993) D167 D191 ^ D195 D196 +error(0.004542445374810293035) D167 D192 +error(0.0004787390755988302541) D167 D192 ^ D195 D196 +error(0.005783598058333213297) D167 D198 +error(0.006313383773074134758) D167 D198 ^ D171 D172 +error(0.001741030225433118535) D167 D198 ^ D171 D195 +error(0.007616179929498220411) D167 D198 ^ D172 D195 +error(0.002095215870669062119) D167 D198 ^ D172 D196 +error(0.003866228108010479232) D167 D198 ^ D195 D196 +error(0.001007778755732767137) D167 D199 +error(0.000791992306397491623) D167 D199 ^ D172 D173 +error(0.000442838744421881808) D167 D199 ^ D172 D195 +error(0.0011264348417513437) D167 D199 ^ D172 D196 +error(0.0007294911408703053015) D167 D199 ^ D173 D196 +error(0.0006790628791750554817) D167 D199 ^ D195 D196 +error(0.007519668875887872833) D168 D169 +error(0.000367564866391688718) D168 D169 ^ D172 D173 +error(4.196227388522683093e-05) D168 D169 ^ D173 +error(0.001830493767202687975) D168 D169 ^ D173 D197 +error(2.861025836566403991e-05) D168 D169 ^ D197 +error(0.0150479596563341516) D168 D175 +error(0.01110180417699024001) D168 D175 ^ D172 D173 +error(0.02213619326971636922) D168 D192 +error(0.002579554369470707462) D168 D192 ^ D196 D197 +error(0.003236307905156624899) D168 D193 +error(0.0005079835293430067563) D168 D193 ^ D196 D197 +error(0.001390683905584838868) D168 D199 +error(0.002396077516820634395) D168 D199 ^ D172 D173 +error(0.001515604606709302846) D168 D199 ^ D172 D196 +error(0.002611050841900463149) D168 D199 ^ D173 D196 +error(0.001030212141032500316) D168 D199 ^ D173 D197 +error(0.003086746265355783374) D168 D199 ^ D196 D197 +error(0.001205642639412828282) D168 D200 +error(5.413361691145458354e-05) D168 D200 ^ D173 +error(0.0006132114541846075744) D168 D200 ^ D173 D196 +error(0.001417719826750507691) D168 D200 ^ D173 D197 +error(0.0005980895653587027776) D168 D200 ^ D196 D197 +error(0.01000000000000000021) D169 +error(0.01636000547734253047) D169 D176 +error(0.01796233722540469674) D169 D176 ^ D173 +error(0.02381232961817726645) D169 D193 +error(0.002637023807817020799) D169 D193 ^ D197 +error(0.003450945788882907317) D169 D200 +error(0.002599654021808480656) D169 D200 ^ D173 +error(0.004061933355944112936) D169 D200 ^ D197 +error(0.0009592071290398953122) D169 D200 ^ D197 ^ D173 +error(0.01363803936237644246) D170 D171 +error(0.003930263821803167863) D170 D171 ^ D142 +error(0.01802560496900905418) D170 D171 ^ D166 +error(8.589436615621441292e-05) D170 D171 ^ D174 ^ D142 +error(0.02525902938098234171) D170 D194 +error(0.00574306903657622117) D170 L0 +error(0.0009470563290373274889) D170 L0 ^ D138 L0 ^ D142 +error(0.0008800554094711328119) D170 L0 ^ D138 L0 ^ D166 +error(0.001457843699669428847) D170 L0 ^ D166 ^ D142 +error(0.01450534184220186006) D171 D172 +error(0.0005721110364468817927) D171 D172 ^ D174 D175 +error(0.004601701592776456101) D171 D172 ^ D174 D198 +error(0.01329762689544615982) D171 D177 +error(0.01235795010597530268) D171 D177 ^ D174 +error(0.004365491728138845215) D171 D194 +error(0.002695027976132394112) D171 D194 ^ D166 +error(0.0003027628658435273408) D171 D194 ^ D198 ^ D166 +error(0.02723315102725440418) D171 D195 +error(0.00140205973473897039) D171 D195 ^ D166 +error(0.005203451391324077739) D171 D195 ^ D198 +error(0.00255544150013453002) D171 D201 +error(0.001808009258848390166) D171 D201 ^ D174 +error(0.002707021320884218929) D171 D201 ^ D198 +error(0.0006088424000031264971) D171 D201 ^ D198 ^ D174 +error(0.006472003059864666653) D172 D173 +error(0.0003994528074094950672) D172 D173 ^ D174 D175 +error(0.0004434226054838874857) D172 D173 ^ D174 D199 +error(0.0008751552090033030192) D172 D173 ^ D175 D176 +error(0.003045602539330864375) D172 D173 ^ D175 D199 +error(0.01325582626527719958) D172 D178 +error(0.01125502755749200473) D172 D178 ^ D174 D175 +error(0.007525476540747918358) D172 D195 +error(0.0006137602329925614204) D172 D195 ^ D198 D199 +error(0.02902365595154616021) D172 D196 +error(0.002401197642609727463) D172 D196 ^ D198 D199 +error(0.002408909711435769981) D172 D201 +error(0.0002707484224426097191) D172 D201 ^ D174 +error(0.001527963667674685309) D172 D201 ^ D174 D198 +error(0.0001105290094925922439) D172 D201 ^ D174 D199 +error(0.0005441160428730808241) D172 D201 ^ D198 +error(0.000356573641289079893) D172 D201 ^ D198 D199 +error(0.003107337702078268298) D172 D202 +error(0.00148514416775588306) D172 D202 ^ D174 D175 +error(0.0009343659549481646417) D172 D202 ^ D174 D198 +error(0.001133507027766949074) D172 D202 ^ D174 D199 +error(0.000964158168953031477) D172 D202 ^ D175 D199 +error(0.001858972200881762581) D172 D202 ^ D198 D199 +error(0.01000000000000000021) D173 +error(0.004493550144293693982) D173 D196 +error(0.0004616573460695907647) D173 D196 ^ D199 D200 +error(0.02153375451966943119) D173 D197 +error(0.001571041344134688862) D173 D197 ^ D199 D200 +error(0.001727413411201550366) D173 D202 +error(6.892623931214466931e-05) D173 D202 ^ D174 D175 +error(0.000533806835748320543) D173 D202 ^ D174 D199 +error(0.001001657939292958282) D173 D202 ^ D175 D199 +error(0.0006587014447459603635) D173 ^ D141 ^ D145 +error(0.0009512945064856004112) D173 ^ D141 ^ D169 +error(0.0004374836472664517121) D173 ^ D145 +error(0.01000000000000000021) D174 +error(0.006089189670584919251) D174 D175 +error(0.0003733339846648112744) D174 D175 ^ D177 D178 +error(0.002491417993463262287) D174 D175 ^ D178 D202 +error(0.0005065788208640180758) D174 D175 ^ D202 +error(0.0367379142487225252) D174 D198 +error(0.004448757689050466223) D174 D198 ^ D201 D202 +error(0.003134023997971539712) D174 D199 +error(0.0003650194631049960385) D174 D199 ^ D201 D202 +error(0.001406953404968496737) D174 D203 +error(0.000258713445676149944) D174 D203 ^ D178 +error(0.001311719158548649289) D174 D203 ^ D178 D202 +error(0.01016476222491488092) D175 D176 +error(0.002108544545389898564) D175 D176 ^ D149 +error(0.01205056218453301811) D175 D176 ^ D173 +error(8.106206907232670631e-05) D175 D176 ^ D178 +error(0.0003126805541716948288) D175 D176 ^ D178 ^ D149 +error(0.01810275288528837012) D175 D179 +error(0.01637617210264374554) D175 D179 ^ D178 +error(0.02102885356741089617) D175 D199 +error(0.001690237581495826133) D175 D199 ^ D173 +error(0.00359606707161589734) D175 D199 ^ D202 +error(0.003107887681254754581) D175 D200 +error(0.003382303353831740949) D175 D200 ^ D173 +error(0.0001913183606313894702) D175 D200 ^ D202 +error(0.0002941212067804130489) D175 D200 ^ D202 ^ D173 +error(0.003693046244270884078) D175 D203 +error(0.003186564243865780671) D175 D203 ^ D178 +error(0.004755038122238004067) D175 D203 ^ D202 +error(0.001954054770515154492) D175 D203 ^ D202 ^ D178 +error(0.02640784577619364679) D176 D200 +error(0.00290739257373180118) D176 D200 ^ D173 +error(0.006564866789739933102) D177 D178 +error(0.001832679987383818189) D177 D178 ^ D150 +error(0.01288524193192810627) D177 D178 ^ D174 +error(0.0006173749993255437177) D177 D178 ^ D179 +error(0.0004559863367010421231) D177 D178 ^ D179 ^ D150 +error(0.03275880248144626833) D177 D201 +error(0.00429567725900462799) D177 D201 ^ D174 +error(0.01072741549435932314) D178 +error(0.002509590526077771534) D178 D201 +error(0.003096878840847453254) D178 D201 ^ D174 +error(0.0004658229008440930739) D178 D201 ^ D203 +error(0.0006984840680404692847) D178 D201 ^ D203 ^ D174 +error(0.02371714611383288207) D178 D202 +error(0.001691210042327366938) D178 D202 ^ D174 +error(0.002968485154357761256) D178 D202 ^ D203 +error(0.01188288263817612218) D178 ^ D179 +error(0.001107203287059167415) D178 ^ D203 +error(0.004560533548355043092) D179 D203 ^ D178 +error(0.005000000000000000104) D179 +error(0.01983080680743972563) D179 D203 +error(0.005000000000000000104) D180 +error(0.01768647969650154195) D180 D184 +error(0.01997660103599073478) D180 D184 ^ D181 L0 +error(0.0272133096145726304) D180 D204 +error(0.009354172066671974373) D180 D204 ^ D205 L0 +error(0.006575429550073013871) D180 D208 +error(0.006606814816559495283) D180 D208 ^ D181 L0 +error(0.00570203587243049443) D180 D208 ^ D205 L0 +error(0.004394467297965208054) D180 D208 ^ D205 L0 ^ D181 L0 +error(0.003141484544212969771) D180 D209 +error(0.002866645116274591214) D180 D209 ^ D181 D205 +error(0.0007467639087963555584) D180 D209 ^ D181 L0 +error(0.00100340881217143808) D180 D209 ^ D205 L0 +error(0.005000000000000000104) D180 ^ D181 L0 +error(0.006716177406890511993) D181 D205 ^ D180 +error(0.006831737513122857625) D181 D182 +error(0.000925383923960359611) D181 D182 ^ D180 +error(0.0002795442616193875634) D181 D182 ^ D184 D185 +error(0.0005690671345596917631) D181 D182 ^ D184 D209 +error(0.01632363663664802497) D181 D182 ^ D185 +error(0.004686760244772980415) D181 D182 ^ D185 D209 +error(0.003622701663117294888) D181 D182 ^ D209 +error(0.0006213698150018824758) D181 D182 ^ D209 ^ D180 +error(0.02092676657561087783) D181 D187 +error(0.0132551803359697469) D181 D187 ^ D184 D185 +error(0.05139236901086036841) D181 D205 +error(0.003561108508096676607) D181 D205 ^ D208 D209 +error(0.0046639615040387555) D181 D205 ^ D209 +error(0.004108367013198443128) D181 D210 +error(0.001863368595620282274) D181 D210 ^ D184 D208 +error(0.0002077739562874012804) D181 D210 ^ D184 D209 +error(0.0001534208996732992975) D181 D210 ^ D208 D209 +error(0.002474351314484049547) D181 D211 +error(0.001842181383880251615) D181 D211 ^ D184 D185 +error(0.0007357888818581343913) D181 D211 ^ D184 D208 +error(0.002176810431023448646) D181 D211 ^ D184 D209 +error(0.0009865289460392872439) D181 D211 ^ D185 D209 +error(0.002351214005477396222) D181 D211 ^ D208 D209 +error(0.01000000000000000021) D181 L0 +error(0.01700103788466153509) D182 D188 +error(0.01657742774919643974) D182 D188 ^ D185 +error(0.005959798576863498468) D182 D205 +error(0.000405679075595877963) D182 D205 ^ D180 +error(0.006365081479756801858) D182 D205 ^ D209 +error(0.0006185446772456166349) D182 D205 ^ D209 ^ D180 +error(0.02877376894243781) D182 D206 +error(0.01462010353799540405) D182 D206 ^ D209 +error(0.00255626787296149658) D182 D211 +error(0.0003462302675103233517) D182 D211 ^ D184 D185 +error(0.0006259573259455081164) D182 D211 ^ D184 D209 +error(0.001780026776757265587) D182 D211 ^ D185 D209 +error(0.0007765183634651079674) D182 D211 ^ D209 +error(0.004204068823748800116) D182 D212 +error(0.004448751937011490021) D182 D212 ^ D185 +error(0.002493712434291736613) D182 D212 ^ D209 +error(0.002122847769795885211) D182 D212 ^ D209 ^ D185 +error(0.008073481635886498378) D183 D184 +error(0.0005730018563843651807) D183 D184 ^ D181 L0 +error(0.0004628308648474659527) D183 D184 ^ D186 D187 +error(0.002505525127704565005) D183 D184 ^ D186 D210 +error(0.009108311699216133789) D183 D184 ^ D186 L0 +error(0.0001464483877319481696) D183 D184 ^ D187 D210 +error(0.001791079838534594517) D183 D184 ^ D210 L0 +error(0.000306018137642829612) D183 D184 ^ D210 L0 ^ D181 L0 +error(0.01557841355567917037) D183 D190 +error(0.01435979479825004283) D183 D190 ^ D186 L0 +error(0.02308764085533153432) D183 D207 +error(0.00431467884365783691) D183 D207 ^ D210 L0 +error(0.001931307837553560523) D183 D208 +error(0.0008665267816730684537) D183 D208 ^ D181 L0 +error(0.002496274199622507042) D183 D208 ^ D210 L0 +error(0.0003964385681257144838) D183 D208 ^ D210 L0 ^ D181 L0 +error(0.003466727401050739669) D183 D214 +error(0.004164332635934311043) D183 D214 ^ D186 L0 +error(0.002681973973769409981) D183 D214 ^ D210 L0 +error(0.001643190028824071487) D183 D214 ^ D210 L0 ^ D186 L0 +error(0.002347213007440165141) D183 D215 +error(1.438422088529517882e-05) D183 D215 ^ D186 D187 +error(0.001602485993920255191) D183 D215 ^ D186 D210 +error(0.0003906309354926121866) D183 D215 ^ D186 L0 +error(0.0002462750543915511142) D183 D215 ^ D187 D210 +error(0.0003195674037454942704) D183 D215 ^ D210 L0 +error(0.009374789236906273804) D184 D185 +error(0.0005590529469528864254) D184 D185 ^ D157 L0 +error(0.0001530608469217417504) D184 D185 ^ D181 L0 +error(0.0008647203357822550026) D184 D185 ^ D186 D187 +error(0.000648659578791030509) D184 D185 ^ D187 D188 +error(0.00193254128555270981) D184 D185 ^ D187 D211 +error(6.236263047404961928e-05) D184 D185 ^ D188 D211 +error(0.01492810779744833949) D184 D191 +error(0.01018712175352179221) D184 D191 ^ D186 D187 +error(0.02897098431077184053) D184 D208 +error(0.009580229984338856086) D184 D208 ^ D181 L0 +error(0.003392722770150778579) D184 D208 ^ D210 D211 +error(0.0009747224564062936412) D184 D208 ^ D210 L0 +error(0.002252326138938211871) D184 D209 +error(0.0005634108258186226606) D184 D209 ^ D210 D211 +error(0.002115175773512700461) D184 D215 +error(0.0030608781621897568) D184 D215 ^ D186 D187 +error(0.001270789941476938327) D184 D215 ^ D186 D210 +error(0.001939096001487852121) D184 D215 ^ D187 D210 +error(0.001187976190653792109) D184 D215 ^ D187 D211 +error(0.002026211267946444097) D184 D215 ^ D210 D211 +error(0.0009157719035976701148) D184 D216 +error(0.0001672286054041389081) D184 D216 ^ D187 D188 +error(0.0005353541060028568126) D184 D216 ^ D187 D210 +error(0.001349693943062659982) D184 D216 ^ D187 D211 +error(0.0001999317661850497118) D184 D216 ^ D188 D211 +error(0.0005670826236588418032) D184 D216 ^ D210 D211 +error(0.01000000000000000021) D185 +error(0.02725063153630395349) D185 D192 +error(0.02389252453306664817) D185 D192 ^ D187 D188 +error(0.03329807480613649479) D185 D209 +error(0.002054421110880488236) D185 D209 ^ D211 D212 +error(0.005139440185035600017) D185 D216 +error(0.002101194335119418565) D185 D216 ^ D187 D188 +error(0.0008922567876475901794) D185 D216 ^ D187 D211 +error(0.002032431206016870138) D185 D216 ^ D188 D211 +error(0.0005572318529482796516) D185 D216 ^ D188 D212 +error(0.002750366226549339366) D185 D216 ^ D211 D212 +error(0.001460790359938684765) D185 D217 +error(0.0004147934522296172497) D185 D217 ^ D188 D211 +error(0.001498989588066860232) D185 D217 ^ D188 D212 +error(0.007007209720512256115) D186 D187 +error(0.0004546663148800625083) D186 D187 ^ D190 D191 +error(0.0001425002969150308049) D186 D187 ^ D190 D215 +error(0.0005696660143250861785) D186 D187 ^ D191 D192 +error(0.003116901364237378153) D186 D187 ^ D191 D215 +error(0.01566705597438649775) D186 D195 +error(0.01186724049158091772) D186 D195 ^ D190 D191 +error(0.03336402185735180131) D186 D210 +error(0.00244917592564833364) D186 D210 ^ D214 D215 +error(0.002462421301947203146) D186 D218 +error(0.001960634436970778299) D186 D218 ^ D190 D214 +error(3.566087944092823308e-06) D186 D218 ^ D190 D215 +error(0.0001637216941453993634) D186 D218 ^ D214 D215 +error(0.004695941015552158003) D186 D219 +error(0.00205837118508770409) D186 D219 ^ D190 D191 +error(0.002163953410575679935) D186 D219 ^ D190 D214 +error(0.001554394982217835453) D186 D219 ^ D190 D215 +error(0.0008879695541101345754) D186 D219 ^ D191 D215 +error(0.002096192257208842526) D186 D219 ^ D214 D215 +error(0.01000000000000000021) D186 L0 +error(0.004381884530454759931) D190 D214 ^ D186 L0 +error(0.008692175163913264807) D187 D188 +error(0.0006905029968304733732) D187 D188 ^ D161 +error(0.00015945046755517543) D187 D188 ^ D185 +error(0.001006504109593458303) D187 D188 ^ D191 D192 +error(0.0008131714298475562147) D187 D188 ^ D191 D216 +error(0.0001651771561405014556) D187 D188 ^ D192 D193 +error(0.001649440750181971295) D187 D188 ^ D192 D216 +error(0.01789251364993136792) D187 D196 +error(0.01500802532656671066) D187 D196 ^ D191 D192 +error(0.003194379691095217307) D187 D210 +error(0.000203690984695900824) D187 D210 ^ D215 D216 +error(0.04189958697952669148) D187 D211 +error(0.002152911101466412069) D187 D211 ^ D215 D216 +error(0.00127605215256659083) D187 D219 +error(0.0001706398503003628525) D187 D219 ^ D190 D191 +error(0.0005783336597214276545) D187 D219 ^ D190 D215 +error(0.002016020127898890141) D187 D219 ^ D191 D215 +error(0.0001968335352046341011) D187 D219 ^ D191 D216 +error(0.0001375362953422371091) D187 D219 ^ D215 D216 +error(0.0009834825476811148021) D187 D220 +error(0.00207981557623123552) D187 D220 ^ D191 D192 +error(0.001841441603780133614) D187 D220 ^ D191 D215 +error(0.002505923860524120889) D187 D220 ^ D191 D216 +error(0.001419084695213386135) D187 D220 ^ D192 D216 +error(0.002852296504457221913) D187 D220 ^ D215 D216 +error(0.009019350943902253864) D188 D189 +error(0.0001633354758280312132) D188 D189 ^ D185 +error(0.0005572855800292770244) D188 D189 ^ D192 D193 +error(0.000553630490138258915) D188 D189 ^ D192 D217 +error(0.01251672150946384239) D188 D189 ^ D193 +error(0.005790639639282292236) D188 D189 ^ D193 D217 +error(0.001145685949262297476) D188 D189 ^ D217 +error(0.0003259075124975205589) D188 D189 ^ D217 ^ D185 +error(0.01461905296180973472) D188 D197 +error(0.01098538498491322471) D188 D197 ^ D192 D193 +error(0.003447214799424203578) D188 D211 +error(0.0003666576516136855319) D188 D211 ^ D216 D217 +error(0.02223358031578045318) D188 D212 +error(0.005543803677485251852) D188 D212 ^ D185 +error(0.002210910752504785439) D188 D212 ^ D216 D217 +error(0.001379541549716805683) D188 D212 ^ D217 +error(0.002924885832784762055) D188 D220 +error(0.001574022131985900515) D188 D220 ^ D192 D216 +error(0.0003547034745176052173) D188 D220 ^ D192 D217 +error(0.0002399940007932416046) D188 D220 ^ D216 D217 +error(0.002619265017415267974) D188 D221 +error(0.00158241141465816147) D188 D221 ^ D192 D193 +error(0.0004730953369301131323) D188 D221 ^ D192 D216 +error(0.002269905077607368895) D188 D221 ^ D192 D217 +error(0.0006264493750148219901) D188 D221 ^ D193 D217 +error(0.001918993207104307793) D188 D221 ^ D216 D217 +error(0.01377675457637685119) D189 +error(0.002469986989841304811) D189 D212 +error(8.555696620424324658e-05) D189 D212 ^ D185 +error(0.002594304494337347066) D189 D212 ^ D217 +error(0.0001376299769938429572) D189 D212 ^ D217 ^ D185 +error(0.03458993767437905376) D189 D213 +error(0.00595402342578680091) D189 D213 ^ D217 +error(0.00245631142944030675) D189 D221 +error(0.0003152919029694442122) D189 D221 ^ D192 D193 +error(0.0001612541715673219793) D189 D221 ^ D192 D217 +error(0.002267685579689308461) D189 D221 ^ D193 D217 +error(0.02509039495427965033) D189 ^ D193 +error(0.002041494666156196645) D189 ^ D217 ^ D193 +error(0.01000000000000000021) D190 +error(0.01187707629310352439) D190 D191 +error(0.001215264942972966392) D190 D191 ^ D194 D195 +error(0.0005861090175784376428) D190 D191 ^ D195 D196 +error(0.001982134764997857141) D190 D191 ^ D195 D219 +error(0.000425289327455776172) D190 D191 ^ D196 D219 +error(0.05297676665932575524) D190 D214 +error(0.003462771653202506312) D190 D214 ^ D218 D219 +error(0.00322690889612168132) D190 D215 +error(0.000497833939171843853) D190 D215 ^ D218 D219 +error(0.002260264554825750123) D190 D222 +error(0.0003473527278594572667) D190 D222 ^ D195 D196 +error(0.0008431892706171371455) D190 D222 ^ D195 D219 +error(0.0003892606543198490589) D190 D222 ^ D196 D219 +error(0.01190612723083741761) D190 ^ D194 L0 +error(0.004358707189286150849) D194 D218 ^ D190 +error(0.01780468578502405336) D191 D192 +error(0.0004696046272799186939) D191 D192 ^ D195 D196 +error(0.0008851561914086082629) D191 D192 ^ D196 D197 +error(0.001718406529616470267) D191 D192 ^ D196 D220 +error(0.0003621508437235534191) D191 D192 ^ D197 D220 +error(0.02155444020316826109) D191 D198 +error(0.02009756387803195501) D191 D198 ^ D195 D196 +error(0.02960309792484100769) D191 D215 +error(0.002696425463454497993) D191 D215 ^ D219 D220 +error(0.004542445374810293035) D191 D216 +error(0.0004787390755988302541) D191 D216 ^ D219 D220 +error(0.005783598058333213297) D191 D222 +error(0.006313383773074134758) D191 D222 ^ D195 D196 +error(0.001741030225433118535) D191 D222 ^ D195 D219 +error(0.007616179929498220411) D191 D222 ^ D196 D219 +error(0.002095215870669062119) D191 D222 ^ D196 D220 +error(0.003866228108010479232) D191 D222 ^ D219 D220 +error(0.001007778755732767137) D191 D223 +error(0.000791992306397491623) D191 D223 ^ D196 D197 +error(0.000442838744421881808) D191 D223 ^ D196 D219 +error(0.0011264348417513437) D191 D223 ^ D196 D220 +error(0.0007294911408703053015) D191 D223 ^ D197 D220 +error(0.0006790628791750554817) D191 D223 ^ D219 D220 +error(0.007519668875887872833) D192 D193 +error(0.000367564866391688718) D192 D193 ^ D196 D197 +error(4.196227388522683093e-05) D192 D193 ^ D197 +error(0.001830493767202687975) D192 D193 ^ D197 D221 +error(2.861025836566403991e-05) D192 D193 ^ D221 +error(0.0150479596563341516) D192 D199 +error(0.01110180417699024001) D192 D199 ^ D196 D197 +error(0.02213619326971636922) D192 D216 +error(0.002579554369470707462) D192 D216 ^ D220 D221 +error(0.003236307905156624899) D192 D217 +error(0.0005079835293430067563) D192 D217 ^ D220 D221 +error(0.001390683905584838868) D192 D223 +error(0.002396077516820634395) D192 D223 ^ D196 D197 +error(0.001515604606709302846) D192 D223 ^ D196 D220 +error(0.002611050841900463149) D192 D223 ^ D197 D220 +error(0.001030212141032500316) D192 D223 ^ D197 D221 +error(0.003086746265355783374) D192 D223 ^ D220 D221 +error(0.001205642639412828282) D192 D224 +error(5.413361691145458354e-05) D192 D224 ^ D197 +error(0.0006132114541846075744) D192 D224 ^ D197 D220 +error(0.001417719826750507691) D192 D224 ^ D197 D221 +error(0.0005980895653587027776) D192 D224 ^ D220 D221 +error(0.01000000000000000021) D193 +error(0.01636000547734253047) D193 D200 +error(0.01796233722540469674) D193 D200 ^ D197 +error(0.02381232961817726645) D193 D217 +error(0.002637023807817020799) D193 D217 ^ D221 +error(0.003450945788882907317) D193 D224 +error(0.002599654021808480656) D193 D224 ^ D197 +error(0.004061933355944112936) D193 D224 ^ D221 +error(0.0009592071290398953122) D193 D224 ^ D221 ^ D197 +error(0.01363803936237644246) D194 D195 +error(0.003930263821803167863) D194 D195 ^ D166 +error(0.01802560496900905418) D194 D195 ^ D190 +error(8.589436615621441292e-05) D194 D195 ^ D198 ^ D166 +error(0.02525902938098234171) D194 D218 +error(0.00574306903657622117) D194 L0 +error(0.0009470563290373274889) D194 L0 ^ D162 L0 ^ D166 +error(0.0008800554094711328119) D194 L0 ^ D162 L0 ^ D190 +error(0.001457843699669428847) D194 L0 ^ D190 ^ D166 +error(0.01450534184220186006) D195 D196 +error(0.0005721110364468817927) D195 D196 ^ D198 D199 +error(0.004601701592776456101) D195 D196 ^ D198 D222 +error(0.01329762689544615982) D195 D201 +error(0.01235795010597530268) D195 D201 ^ D198 +error(0.004365491728138845215) D195 D218 +error(0.002695027976132394112) D195 D218 ^ D190 +error(0.0003027628658435273408) D195 D218 ^ D222 ^ D190 +error(0.02723315102725440418) D195 D219 +error(0.00140205973473897039) D195 D219 ^ D190 +error(0.005203451391324077739) D195 D219 ^ D222 +error(0.00255544150013453002) D195 D225 +error(0.001808009258848390166) D195 D225 ^ D198 +error(0.002707021320884218929) D195 D225 ^ D222 +error(0.0006088424000031264971) D195 D225 ^ D222 ^ D198 +error(0.006472003059864666653) D196 D197 +error(0.0003994528074094950672) D196 D197 ^ D198 D199 +error(0.0004434226054838874857) D196 D197 ^ D198 D223 +error(0.0008751552090033030192) D196 D197 ^ D199 D200 +error(0.003045602539330864375) D196 D197 ^ D199 D223 +error(0.01325582626527719958) D196 D202 +error(0.01125502755749200473) D196 D202 ^ D198 D199 +error(0.007525476540747918358) D196 D219 +error(0.0006137602329925614204) D196 D219 ^ D222 D223 +error(0.02902365595154616021) D196 D220 +error(0.002401197642609727463) D196 D220 ^ D222 D223 +error(0.002408909711435769981) D196 D225 +error(0.0002707484224426097191) D196 D225 ^ D198 +error(0.001527963667674685309) D196 D225 ^ D198 D222 +error(0.0001105290094925922439) D196 D225 ^ D198 D223 +error(0.0005441160428730808241) D196 D225 ^ D222 +error(0.000356573641289079893) D196 D225 ^ D222 D223 +error(0.003107337702078268298) D196 D226 +error(0.00148514416775588306) D196 D226 ^ D198 D199 +error(0.0009343659549481646417) D196 D226 ^ D198 D222 +error(0.001133507027766949074) D196 D226 ^ D198 D223 +error(0.000964158168953031477) D196 D226 ^ D199 D223 +error(0.001858972200881762581) D196 D226 ^ D222 D223 +error(0.01000000000000000021) D197 +error(0.004493550144293693982) D197 D220 +error(0.0004616573460695907647) D197 D220 ^ D223 D224 +error(0.02153375451966943119) D197 D221 +error(0.001571041344134688862) D197 D221 ^ D223 D224 +error(0.001727413411201550366) D197 D226 +error(6.892623931214466931e-05) D197 D226 ^ D198 D199 +error(0.000533806835748320543) D197 D226 ^ D198 D223 +error(0.001001657939292958282) D197 D226 ^ D199 D223 +error(0.0006587014447459603635) D197 ^ D165 ^ D169 +error(0.0009512945064856004112) D197 ^ D165 ^ D193 +error(0.0004374836472664517121) D197 ^ D169 +error(0.01000000000000000021) D198 +error(0.006089189670584919251) D198 D199 +error(0.0003733339846648112744) D198 D199 ^ D201 D202 +error(0.002491417993463262287) D198 D199 ^ D202 D226 +error(0.0005065788208640180758) D198 D199 ^ D226 +error(0.0367379142487225252) D198 D222 +error(0.004448757689050466223) D198 D222 ^ D225 D226 +error(0.003134023997971539712) D198 D223 +error(0.0003650194631049960385) D198 D223 ^ D225 D226 +error(0.001406953404968496737) D198 D227 +error(0.000258713445676149944) D198 D227 ^ D202 +error(0.001311719158548649289) D198 D227 ^ D202 D226 +error(0.01016476222491488092) D199 D200 +error(0.002108544545389898564) D199 D200 ^ D173 +error(0.01205056218453301811) D199 D200 ^ D197 +error(8.106206907232670631e-05) D199 D200 ^ D202 +error(0.0003126805541716948288) D199 D200 ^ D202 ^ D173 +error(0.01810275288528837012) D199 D203 +error(0.01637617210264374554) D199 D203 ^ D202 +error(0.02102885356741089617) D199 D223 +error(0.001690237581495826133) D199 D223 ^ D197 +error(0.00359606707161589734) D199 D223 ^ D226 +error(0.003107887681254754581) D199 D224 +error(0.003382303353831740949) D199 D224 ^ D197 +error(0.0001913183606313894702) D199 D224 ^ D226 +error(0.0002941212067804130489) D199 D224 ^ D226 ^ D197 +error(0.003693046244270884078) D199 D227 +error(0.003186564243865780671) D199 D227 ^ D202 +error(0.004755038122238004067) D199 D227 ^ D226 +error(0.001954054770515154492) D199 D227 ^ D226 ^ D202 +error(0.02640784577619364679) D200 D224 +error(0.00290739257373180118) D200 D224 ^ D197 +error(0.006564866789739933102) D201 D202 +error(0.001832679987383818189) D201 D202 ^ D174 +error(0.01288524193192810627) D201 D202 ^ D198 +error(0.0006173749993255437177) D201 D202 ^ D203 +error(0.0004559863367010421231) D201 D202 ^ D203 ^ D174 +error(0.03275880248144626833) D201 D225 +error(0.00429567725900462799) D201 D225 ^ D198 +error(0.01072741549435932314) D202 +error(0.002509590526077771534) D202 D225 +error(0.003096878840847453254) D202 D225 ^ D198 +error(0.0004658229008440930739) D202 D225 ^ D227 +error(0.0006984840680404692847) D202 D225 ^ D227 ^ D198 +error(0.02371714611383288207) D202 D226 +error(0.001691210042327366938) D202 D226 ^ D198 +error(0.002968485154357761256) D202 D226 ^ D227 +error(0.01188288263817612218) D202 ^ D203 +error(0.001107203287059167415) D202 ^ D227 +error(0.004560533548355043092) D203 D227 ^ D202 +error(0.005000000000000000104) D203 +error(0.01983080680743972563) D203 D227 +error(0.005000000000000000104) D204 +error(0.01768647969650154195) D204 D208 +error(0.01997660103599073478) D204 D208 ^ D205 L0 +error(0.0272133096145726304) D204 D228 +error(0.009354172066671974373) D204 D228 ^ D229 L0 +error(0.006575429550073013871) D204 D232 +error(0.006606814816559495283) D204 D232 ^ D205 L0 +error(0.00570203587243049443) D204 D232 ^ D229 L0 +error(0.004394467297965208054) D204 D232 ^ D229 L0 ^ D205 L0 +error(0.003141484544212969771) D204 D233 +error(0.002866645116274591214) D204 D233 ^ D205 D229 +error(0.0007467639087963555584) D204 D233 ^ D205 L0 +error(0.00100340881217143808) D204 D233 ^ D229 L0 +error(0.005000000000000000104) D204 ^ D205 L0 +error(0.006716177406890511993) D205 D229 ^ D204 +error(0.006831737513122857625) D205 D206 +error(0.000925383923960359611) D205 D206 ^ D204 +error(0.0002795442616193875634) D205 D206 ^ D208 D209 +error(0.0005690671345596917631) D205 D206 ^ D208 D233 +error(0.01632363663664802497) D205 D206 ^ D209 +error(0.004686760244772980415) D205 D206 ^ D209 D233 +error(0.003622701663117294888) D205 D206 ^ D233 +error(0.0006213698150018824758) D205 D206 ^ D233 ^ D204 +error(0.02092676657561087783) D205 D211 +error(0.0132551803359697469) D205 D211 ^ D208 D209 +error(0.05139236901086036841) D205 D229 +error(0.003561108508096676607) D205 D229 ^ D232 D233 +error(0.0046639615040387555) D205 D229 ^ D233 +error(0.004108367013198443128) D205 D234 +error(0.001863368595620282274) D205 D234 ^ D208 D232 +error(0.0002077739562874012804) D205 D234 ^ D208 D233 +error(0.0001534208996732992975) D205 D234 ^ D232 D233 +error(0.002474351314484049547) D205 D235 +error(0.001842181383880251615) D205 D235 ^ D208 D209 +error(0.0007357888818581343913) D205 D235 ^ D208 D232 +error(0.002176810431023448646) D205 D235 ^ D208 D233 +error(0.0009865289460392872439) D205 D235 ^ D209 D233 +error(0.002351214005477396222) D205 D235 ^ D232 D233 +error(0.01000000000000000021) D205 L0 +error(0.01700103788466153509) D206 D212 +error(0.01657742774919643974) D206 D212 ^ D209 +error(0.005959798576863498468) D206 D229 +error(0.000405679075595877963) D206 D229 ^ D204 +error(0.006365081479756801858) D206 D229 ^ D233 +error(0.0006185446772456166349) D206 D229 ^ D233 ^ D204 +error(0.02877376894243781) D206 D230 +error(0.01462010353799540405) D206 D230 ^ D233 +error(0.00255626787296149658) D206 D235 +error(0.0003462302675103233517) D206 D235 ^ D208 D209 +error(0.0006259573259455081164) D206 D235 ^ D208 D233 +error(0.001780026776757265587) D206 D235 ^ D209 D233 +error(0.0007765183634651079674) D206 D235 ^ D233 +error(0.004204068823748800116) D206 D236 +error(0.004448751937011490021) D206 D236 ^ D209 +error(0.002493712434291736613) D206 D236 ^ D233 +error(0.002122847769795885211) D206 D236 ^ D233 ^ D209 +error(0.008073481635886498378) D207 D208 +error(0.0005730018563843651807) D207 D208 ^ D205 L0 +error(0.0004628308648474659527) D207 D208 ^ D210 D211 +error(0.002505525127704565005) D207 D208 ^ D210 D234 +error(0.009108311699216133789) D207 D208 ^ D210 L0 +error(0.0001464483877319481696) D207 D208 ^ D211 D234 +error(0.001791079838534594517) D207 D208 ^ D234 L0 +error(0.000306018137642829612) D207 D208 ^ D234 L0 ^ D205 L0 +error(0.01557841355567917037) D207 D214 +error(0.01435979479825004283) D207 D214 ^ D210 L0 +error(0.02308764085533153432) D207 D231 +error(0.00431467884365783691) D207 D231 ^ D234 L0 +error(0.001931307837553560523) D207 D232 +error(0.0008665267816730684537) D207 D232 ^ D205 L0 +error(0.002496274199622507042) D207 D232 ^ D234 L0 +error(0.0003964385681257144838) D207 D232 ^ D234 L0 ^ D205 L0 +error(0.003466727401050739669) D207 D238 +error(0.004164332635934311043) D207 D238 ^ D210 L0 +error(0.002681973973769409981) D207 D238 ^ D234 L0 +error(0.001643190028824071487) D207 D238 ^ D234 L0 ^ D210 L0 +error(0.002347213007440165141) D207 D239 +error(1.438422088529517882e-05) D207 D239 ^ D210 D211 +error(0.001602485993920255191) D207 D239 ^ D210 D234 +error(0.0003906309354926121866) D207 D239 ^ D210 L0 +error(0.0002462750543915511142) D207 D239 ^ D211 D234 +error(0.0003195674037454942704) D207 D239 ^ D234 L0 +error(0.009374789236906273804) D208 D209 +error(0.0005590529469528864254) D208 D209 ^ D181 L0 +error(0.0001530608469217417504) D208 D209 ^ D205 L0 +error(0.0008647203357822550026) D208 D209 ^ D210 D211 +error(0.000648659578791030509) D208 D209 ^ D211 D212 +error(0.00193254128555270981) D208 D209 ^ D211 D235 +error(6.236263047404961928e-05) D208 D209 ^ D212 D235 +error(0.01492810779744833949) D208 D215 +error(0.01018712175352179221) D208 D215 ^ D210 D211 +error(0.02897098431077184053) D208 D232 +error(0.009580229984338856086) D208 D232 ^ D205 L0 +error(0.003392722770150778579) D208 D232 ^ D234 D235 +error(0.0009747224564062936412) D208 D232 ^ D234 L0 +error(0.002252326138938211871) D208 D233 +error(0.0005634108258186226606) D208 D233 ^ D234 D235 +error(0.002115175773512700461) D208 D239 +error(0.0030608781621897568) D208 D239 ^ D210 D211 +error(0.001270789941476938327) D208 D239 ^ D210 D234 +error(0.001939096001487852121) D208 D239 ^ D211 D234 +error(0.001187976190653792109) D208 D239 ^ D211 D235 +error(0.002026211267946444097) D208 D239 ^ D234 D235 +error(0.0009157719035976701148) D208 D240 +error(0.0001672286054041389081) D208 D240 ^ D211 D212 +error(0.0005353541060028568126) D208 D240 ^ D211 D234 +error(0.001349693943062659982) D208 D240 ^ D211 D235 +error(0.0001999317661850497118) D208 D240 ^ D212 D235 +error(0.0005670826236588418032) D208 D240 ^ D234 D235 +error(0.01000000000000000021) D209 +error(0.02725063153630395349) D209 D216 +error(0.02389252453306664817) D209 D216 ^ D211 D212 +error(0.03329807480613649479) D209 D233 +error(0.002054421110880488236) D209 D233 ^ D235 D236 +error(0.005139440185035600017) D209 D240 +error(0.002101194335119418565) D209 D240 ^ D211 D212 +error(0.0008922567876475901794) D209 D240 ^ D211 D235 +error(0.002032431206016870138) D209 D240 ^ D212 D235 +error(0.0005572318529482796516) D209 D240 ^ D212 D236 +error(0.002750366226549339366) D209 D240 ^ D235 D236 +error(0.001460790359938684765) D209 D241 +error(0.0004147934522296172497) D209 D241 ^ D212 D235 +error(0.001498989588066860232) D209 D241 ^ D212 D236 +error(0.007007209720512256115) D210 D211 +error(0.0004546663148800625083) D210 D211 ^ D214 D215 +error(0.0001425002969150308049) D210 D211 ^ D214 D239 +error(0.0005696660143250861785) D210 D211 ^ D215 D216 +error(0.003116901364237378153) D210 D211 ^ D215 D239 +error(0.01566705597438649775) D210 D219 +error(0.01186724049158091772) D210 D219 ^ D214 D215 +error(0.03336402185735180131) D210 D234 +error(0.00244917592564833364) D210 D234 ^ D238 D239 +error(0.002462421301947203146) D210 D242 +error(0.001960634436970778299) D210 D242 ^ D214 D238 +error(3.566087944092823308e-06) D210 D242 ^ D214 D239 +error(0.0001637216941453993634) D210 D242 ^ D238 D239 +error(0.004695941015552158003) D210 D243 +error(0.00205837118508770409) D210 D243 ^ D214 D215 +error(0.002163953410575679935) D210 D243 ^ D214 D238 +error(0.001554394982217835453) D210 D243 ^ D214 D239 +error(0.0008879695541101345754) D210 D243 ^ D215 D239 +error(0.002096192257208842526) D210 D243 ^ D238 D239 +error(0.01000000000000000021) D210 L0 +error(0.004381884530454759931) D214 D238 ^ D210 L0 +error(0.008692175163913264807) D211 D212 +error(0.0006905029968304733732) D211 D212 ^ D185 +error(0.00015945046755517543) D211 D212 ^ D209 +error(0.001006504109593458303) D211 D212 ^ D215 D216 +error(0.0008131714298475562147) D211 D212 ^ D215 D240 +error(0.0001651771561405014556) D211 D212 ^ D216 D217 +error(0.001649440750181971295) D211 D212 ^ D216 D240 +error(0.01789251364993136792) D211 D220 +error(0.01500802532656671066) D211 D220 ^ D215 D216 +error(0.003194379691095217307) D211 D234 +error(0.000203690984695900824) D211 D234 ^ D239 D240 +error(0.04189958697952669148) D211 D235 +error(0.002152911101466412069) D211 D235 ^ D239 D240 +error(0.00127605215256659083) D211 D243 +error(0.0001706398503003628525) D211 D243 ^ D214 D215 +error(0.0005783336597214276545) D211 D243 ^ D214 D239 +error(0.002016020127898890141) D211 D243 ^ D215 D239 +error(0.0001968335352046341011) D211 D243 ^ D215 D240 +error(0.0001375362953422371091) D211 D243 ^ D239 D240 +error(0.0009834825476811148021) D211 D244 +error(0.00207981557623123552) D211 D244 ^ D215 D216 +error(0.001841441603780133614) D211 D244 ^ D215 D239 +error(0.002505923860524120889) D211 D244 ^ D215 D240 +error(0.001419084695213386135) D211 D244 ^ D216 D240 +error(0.002852296504457221913) D211 D244 ^ D239 D240 +error(0.009019350943902253864) D212 D213 +error(0.0001633354758280312132) D212 D213 ^ D209 +error(0.0005572855800292770244) D212 D213 ^ D216 D217 +error(0.000553630490138258915) D212 D213 ^ D216 D241 +error(0.01251672150946384239) D212 D213 ^ D217 +error(0.005790639639282292236) D212 D213 ^ D217 D241 +error(0.001145685949262297476) D212 D213 ^ D241 +error(0.0003259075124975205589) D212 D213 ^ D241 ^ D209 +error(0.01461905296180973472) D212 D221 +error(0.01098538498491322471) D212 D221 ^ D216 D217 +error(0.003447214799424203578) D212 D235 +error(0.0003666576516136855319) D212 D235 ^ D240 D241 +error(0.02223358031578045318) D212 D236 +error(0.005543803677485251852) D212 D236 ^ D209 +error(0.002210910752504785439) D212 D236 ^ D240 D241 +error(0.001379541549716805683) D212 D236 ^ D241 +error(0.002924885832784762055) D212 D244 +error(0.001574022131985900515) D212 D244 ^ D216 D240 +error(0.0003547034745176052173) D212 D244 ^ D216 D241 +error(0.0002399940007932416046) D212 D244 ^ D240 D241 +error(0.002619265017415267974) D212 D245 +error(0.00158241141465816147) D212 D245 ^ D216 D217 +error(0.0004730953369301131323) D212 D245 ^ D216 D240 +error(0.002269905077607368895) D212 D245 ^ D216 D241 +error(0.0006264493750148219901) D212 D245 ^ D217 D241 +error(0.001918993207104307793) D212 D245 ^ D240 D241 +error(0.01377675457637685119) D213 +error(0.002469986989841304811) D213 D236 +error(8.555696620424324658e-05) D213 D236 ^ D209 +error(0.002594304494337347066) D213 D236 ^ D241 +error(0.0001376299769938429572) D213 D236 ^ D241 ^ D209 +error(0.03458993767437905376) D213 D237 +error(0.00595402342578680091) D213 D237 ^ D241 +error(0.00245631142944030675) D213 D245 +error(0.0003152919029694442122) D213 D245 ^ D216 D217 +error(0.0001612541715673219793) D213 D245 ^ D216 D241 +error(0.002267685579689308461) D213 D245 ^ D217 D241 +error(0.02509039495427965033) D213 ^ D217 +error(0.002041494666156196645) D213 ^ D241 ^ D217 +error(0.01000000000000000021) D214 +error(0.01187707629310352439) D214 D215 +error(0.001215264942972966392) D214 D215 ^ D218 D219 +error(0.0005861090175784376428) D214 D215 ^ D219 D220 +error(0.001982134764997857141) D214 D215 ^ D219 D243 +error(0.000425289327455776172) D214 D215 ^ D220 D243 +error(0.05297676665932575524) D214 D238 +error(0.003462771653202506312) D214 D238 ^ D242 D243 +error(0.00322690889612168132) D214 D239 +error(0.000497833939171843853) D214 D239 ^ D242 D243 +error(0.002260264554825750123) D214 D246 +error(0.0003473527278594572667) D214 D246 ^ D219 D220 +error(0.0008431892706171371455) D214 D246 ^ D219 D243 +error(0.0003892606543198490589) D214 D246 ^ D220 D243 +error(0.01190612723083741761) D214 ^ D218 L0 +error(0.004358707189286150849) D218 D242 ^ D214 +error(0.01780468578502405336) D215 D216 +error(0.0004696046272799186939) D215 D216 ^ D219 D220 +error(0.0008851561914086082629) D215 D216 ^ D220 D221 +error(0.001718406529616470267) D215 D216 ^ D220 D244 +error(0.0003621508437235534191) D215 D216 ^ D221 D244 +error(0.02155444020316826109) D215 D222 +error(0.02009756387803195501) D215 D222 ^ D219 D220 +error(0.02960309792484100769) D215 D239 +error(0.002696425463454497993) D215 D239 ^ D243 D244 +error(0.004542445374810293035) D215 D240 +error(0.0004787390755988302541) D215 D240 ^ D243 D244 +error(0.005783598058333213297) D215 D246 +error(0.006313383773074134758) D215 D246 ^ D219 D220 +error(0.001741030225433118535) D215 D246 ^ D219 D243 +error(0.007616179929498220411) D215 D246 ^ D220 D243 +error(0.002095215870669062119) D215 D246 ^ D220 D244 +error(0.003866228108010479232) D215 D246 ^ D243 D244 +error(0.001007778755732767137) D215 D247 +error(0.000791992306397491623) D215 D247 ^ D220 D221 +error(0.000442838744421881808) D215 D247 ^ D220 D243 +error(0.0011264348417513437) D215 D247 ^ D220 D244 +error(0.0007294911408703053015) D215 D247 ^ D221 D244 +error(0.0006790628791750554817) D215 D247 ^ D243 D244 +error(0.007519668875887872833) D216 D217 +error(0.000367564866391688718) D216 D217 ^ D220 D221 +error(4.196227388522683093e-05) D216 D217 ^ D221 +error(0.001830493767202687975) D216 D217 ^ D221 D245 +error(2.861025836566403991e-05) D216 D217 ^ D245 +error(0.0150479596563341516) D216 D223 +error(0.01110180417699024001) D216 D223 ^ D220 D221 +error(0.02213619326971636922) D216 D240 +error(0.002579554369470707462) D216 D240 ^ D244 D245 +error(0.003236307905156624899) D216 D241 +error(0.0005079835293430067563) D216 D241 ^ D244 D245 +error(0.001390683905584838868) D216 D247 +error(0.002396077516820634395) D216 D247 ^ D220 D221 +error(0.001515604606709302846) D216 D247 ^ D220 D244 +error(0.002611050841900463149) D216 D247 ^ D221 D244 +error(0.001030212141032500316) D216 D247 ^ D221 D245 +error(0.003086746265355783374) D216 D247 ^ D244 D245 +error(0.001205642639412828282) D216 D248 +error(5.413361691145458354e-05) D216 D248 ^ D221 +error(0.0006132114541846075744) D216 D248 ^ D221 D244 +error(0.001417719826750507691) D216 D248 ^ D221 D245 +error(0.0005980895653587027776) D216 D248 ^ D244 D245 +error(0.01000000000000000021) D217 +error(0.01636000547734253047) D217 D224 +error(0.01796233722540469674) D217 D224 ^ D221 +error(0.02381232961817726645) D217 D241 +error(0.002637023807817020799) D217 D241 ^ D245 +error(0.003450945788882907317) D217 D248 +error(0.002599654021808480656) D217 D248 ^ D221 +error(0.004061933355944112936) D217 D248 ^ D245 +error(0.0009592071290398953122) D217 D248 ^ D245 ^ D221 +error(0.01363803936237644246) D218 D219 +error(0.003930263821803167863) D218 D219 ^ D190 +error(0.01802560496900905418) D218 D219 ^ D214 +error(8.589436615621441292e-05) D218 D219 ^ D222 ^ D190 +error(0.02525902938098234171) D218 D242 +error(0.00574306903657622117) D218 L0 +error(0.0009470563290373274889) D218 L0 ^ D186 L0 ^ D190 +error(0.0008800554094711328119) D218 L0 ^ D186 L0 ^ D214 +error(0.001457843699669428847) D218 L0 ^ D214 ^ D190 +error(0.01450534184220186006) D219 D220 +error(0.0005721110364468817927) D219 D220 ^ D222 D223 +error(0.004601701592776456101) D219 D220 ^ D222 D246 +error(0.01329762689544615982) D219 D225 +error(0.01235795010597530268) D219 D225 ^ D222 +error(0.004365491728138845215) D219 D242 +error(0.002695027976132394112) D219 D242 ^ D214 +error(0.0003027628658435273408) D219 D242 ^ D246 ^ D214 +error(0.02723315102725440418) D219 D243 +error(0.00140205973473897039) D219 D243 ^ D214 +error(0.005203451391324077739) D219 D243 ^ D246 +error(0.00255544150013453002) D219 D249 +error(0.001808009258848390166) D219 D249 ^ D222 +error(0.002707021320884218929) D219 D249 ^ D246 +error(0.0006088424000031264971) D219 D249 ^ D246 ^ D222 +error(0.006472003059864666653) D220 D221 +error(0.0003994528074094950672) D220 D221 ^ D222 D223 +error(0.0004434226054838874857) D220 D221 ^ D222 D247 +error(0.0008751552090033030192) D220 D221 ^ D223 D224 +error(0.003045602539330864375) D220 D221 ^ D223 D247 +error(0.01325582626527719958) D220 D226 +error(0.01125502755749200473) D220 D226 ^ D222 D223 +error(0.007525476540747918358) D220 D243 +error(0.0006137602329925614204) D220 D243 ^ D246 D247 +error(0.02902365595154616021) D220 D244 +error(0.002401197642609727463) D220 D244 ^ D246 D247 +error(0.002408909711435769981) D220 D249 +error(0.0002707484224426097191) D220 D249 ^ D222 +error(0.001527963667674685309) D220 D249 ^ D222 D246 +error(0.0001105290094925922439) D220 D249 ^ D222 D247 +error(0.0005441160428730808241) D220 D249 ^ D246 +error(0.000356573641289079893) D220 D249 ^ D246 D247 +error(0.003107337702078268298) D220 D250 +error(0.00148514416775588306) D220 D250 ^ D222 D223 +error(0.0009343659549481646417) D220 D250 ^ D222 D246 +error(0.001133507027766949074) D220 D250 ^ D222 D247 +error(0.000964158168953031477) D220 D250 ^ D223 D247 +error(0.001858972200881762581) D220 D250 ^ D246 D247 +error(0.01000000000000000021) D221 +error(0.004493550144293693982) D221 D244 +error(0.0004616573460695907647) D221 D244 ^ D247 D248 +error(0.02153375451966943119) D221 D245 +error(0.001571041344134688862) D221 D245 ^ D247 D248 +error(0.001727413411201550366) D221 D250 +error(6.892623931214466931e-05) D221 D250 ^ D222 D223 +error(0.000533806835748320543) D221 D250 ^ D222 D247 +error(0.001001657939292958282) D221 D250 ^ D223 D247 +error(0.0006587014447459603635) D221 ^ D189 ^ D193 +error(0.0009512945064856004112) D221 ^ D189 ^ D217 +error(0.0004374836472664517121) D221 ^ D193 +error(0.01000000000000000021) D222 +error(0.006089189670584919251) D222 D223 +error(0.0003733339846648112744) D222 D223 ^ D225 D226 +error(0.002491417993463262287) D222 D223 ^ D226 D250 +error(0.0005065788208640180758) D222 D223 ^ D250 +error(0.0367379142487225252) D222 D246 +error(0.004448757689050466223) D222 D246 ^ D249 D250 +error(0.003134023997971539712) D222 D247 +error(0.0003650194631049960385) D222 D247 ^ D249 D250 +error(0.001406953404968496737) D222 D251 +error(0.000258713445676149944) D222 D251 ^ D226 +error(0.001311719158548649289) D222 D251 ^ D226 D250 +error(0.01016476222491488092) D223 D224 +error(0.002108544545389898564) D223 D224 ^ D197 +error(0.01205056218453301811) D223 D224 ^ D221 +error(8.106206907232670631e-05) D223 D224 ^ D226 +error(0.0003126805541716948288) D223 D224 ^ D226 ^ D197 +error(0.01810275288528837012) D223 D227 +error(0.01637617210264374554) D223 D227 ^ D226 +error(0.02102885356741089617) D223 D247 +error(0.001690237581495826133) D223 D247 ^ D221 +error(0.00359606707161589734) D223 D247 ^ D250 +error(0.003107887681254754581) D223 D248 +error(0.003382303353831740949) D223 D248 ^ D221 +error(0.0001913183606313894702) D223 D248 ^ D250 +error(0.0002941212067804130489) D223 D248 ^ D250 ^ D221 +error(0.003693046244270884078) D223 D251 +error(0.003186564243865780671) D223 D251 ^ D226 +error(0.004755038122238004067) D223 D251 ^ D250 +error(0.001954054770515154492) D223 D251 ^ D250 ^ D226 +error(0.02640784577619364679) D224 D248 +error(0.00290739257373180118) D224 D248 ^ D221 +error(0.006564866789739933102) D225 D226 +error(0.001832679987383818189) D225 D226 ^ D198 +error(0.01288524193192810627) D225 D226 ^ D222 +error(0.0006173749993255437177) D225 D226 ^ D227 +error(0.0004559863367010421231) D225 D226 ^ D227 ^ D198 +error(0.03275880248144626833) D225 D249 +error(0.00429567725900462799) D225 D249 ^ D222 +error(0.01072741549435932314) D226 +error(0.002509590526077771534) D226 D249 +error(0.003096878840847453254) D226 D249 ^ D222 +error(0.0004658229008440930739) D226 D249 ^ D251 +error(0.0006984840680404692847) D226 D249 ^ D251 ^ D222 +error(0.02371714611383288207) D226 D250 +error(0.001691210042327366938) D226 D250 ^ D222 +error(0.002968485154357761256) D226 D250 ^ D251 +error(0.01188288263817612218) D226 ^ D227 +error(0.001107203287059167415) D226 ^ D251 +error(0.004560533548355043092) D227 D251 ^ D226 +error(0.005000000000000000104) D227 +error(0.01983080680743972563) D227 D251 +error(0.005000000000000000104) D228 +error(0.01768647969650154195) D228 D232 +error(0.01997660103599073478) D228 D232 ^ D229 L0 +error(0.0272133096145726304) D228 D252 +error(0.009354172066671974373) D228 D252 ^ D253 L0 +error(0.006575429550073013871) D228 D256 +error(0.006606814816559495283) D228 D256 ^ D229 L0 +error(0.00570203587243049443) D228 D256 ^ D253 L0 +error(0.004394467297965208054) D228 D256 ^ D253 L0 ^ D229 L0 +error(0.003141484544212969771) D228 D257 +error(0.002866645116274591214) D228 D257 ^ D229 D253 +error(0.0007467639087963555584) D228 D257 ^ D229 L0 +error(0.00100340881217143808) D228 D257 ^ D253 L0 +error(0.005000000000000000104) D228 ^ D229 L0 +error(0.006716177406890511993) D229 D253 ^ D228 +error(0.006831737513122857625) D229 D230 +error(0.000925383923960359611) D229 D230 ^ D228 +error(0.0002795442616193875634) D229 D230 ^ D232 D233 +error(0.0005690671345596917631) D229 D230 ^ D232 D257 +error(0.01632363663664802497) D229 D230 ^ D233 +error(0.004686760244772980415) D229 D230 ^ D233 D257 +error(0.003622701663117294888) D229 D230 ^ D257 +error(0.0006213698150018824758) D229 D230 ^ D257 ^ D228 +error(0.02092676657561087783) D229 D235 +error(0.0132551803359697469) D229 D235 ^ D232 D233 +error(0.05139236901086036841) D229 D253 +error(0.003561108508096676607) D229 D253 ^ D256 D257 +error(0.0046639615040387555) D229 D253 ^ D257 +error(0.004108367013198443128) D229 D258 +error(0.001863368595620282274) D229 D258 ^ D232 D256 +error(0.0002077739562874012804) D229 D258 ^ D232 D257 +error(0.0001534208996732992975) D229 D258 ^ D256 D257 +error(0.002474351314484049547) D229 D259 +error(0.001842181383880251615) D229 D259 ^ D232 D233 +error(0.0007357888818581343913) D229 D259 ^ D232 D256 +error(0.002176810431023448646) D229 D259 ^ D232 D257 +error(0.0009865289460392872439) D229 D259 ^ D233 D257 +error(0.002351214005477396222) D229 D259 ^ D256 D257 +error(0.01000000000000000021) D229 L0 +error(0.01700103788466153509) D230 D236 +error(0.01657742774919643974) D230 D236 ^ D233 +error(0.005959798576863498468) D230 D253 +error(0.000405679075595877963) D230 D253 ^ D228 +error(0.006365081479756801858) D230 D253 ^ D257 +error(0.0006185446772456166349) D230 D253 ^ D257 ^ D228 +error(0.02877376894243781) D230 D254 +error(0.01462010353799540405) D230 D254 ^ D257 +error(0.00255626787296149658) D230 D259 +error(0.0003462302675103233517) D230 D259 ^ D232 D233 +error(0.0006259573259455081164) D230 D259 ^ D232 D257 +error(0.001780026776757265587) D230 D259 ^ D233 D257 +error(0.0007765183634651079674) D230 D259 ^ D257 +error(0.004204068823748800116) D230 D260 +error(0.004448751937011490021) D230 D260 ^ D233 +error(0.002493712434291736613) D230 D260 ^ D257 +error(0.002122847769795885211) D230 D260 ^ D257 ^ D233 +error(0.008073481635886498378) D231 D232 +error(0.0005730018563843651807) D231 D232 ^ D229 L0 +error(0.0004628308648474659527) D231 D232 ^ D234 D235 +error(0.002505525127704565005) D231 D232 ^ D234 D258 +error(0.009108311699216133789) D231 D232 ^ D234 L0 +error(0.0001464483877319481696) D231 D232 ^ D235 D258 +error(0.001791079838534594517) D231 D232 ^ D258 L0 +error(0.000306018137642829612) D231 D232 ^ D258 L0 ^ D229 L0 +error(0.01557841355567917037) D231 D238 +error(0.01435979479825004283) D231 D238 ^ D234 L0 +error(0.02308764085533153432) D231 D255 +error(0.00431467884365783691) D231 D255 ^ D258 L0 +error(0.001931307837553560523) D231 D256 +error(0.0008665267816730684537) D231 D256 ^ D229 L0 +error(0.002496274199622507042) D231 D256 ^ D258 L0 +error(0.0003964385681257144838) D231 D256 ^ D258 L0 ^ D229 L0 +error(0.003466727401050739669) D231 D262 +error(0.004164332635934311043) D231 D262 ^ D234 L0 +error(0.002681973973769409981) D231 D262 ^ D258 L0 +error(0.001643190028824071487) D231 D262 ^ D258 L0 ^ D234 L0 +error(0.002347213007440165141) D231 D263 +error(1.438422088529517882e-05) D231 D263 ^ D234 D235 +error(0.001602485993920255191) D231 D263 ^ D234 D258 +error(0.0003906309354926121866) D231 D263 ^ D234 L0 +error(0.0002462750543915511142) D231 D263 ^ D235 D258 +error(0.0003195674037454942704) D231 D263 ^ D258 L0 +error(0.009374789236906273804) D232 D233 +error(0.0005590529469528864254) D232 D233 ^ D205 L0 +error(0.0001530608469217417504) D232 D233 ^ D229 L0 +error(0.0008647203357822550026) D232 D233 ^ D234 D235 +error(0.000648659578791030509) D232 D233 ^ D235 D236 +error(0.00193254128555270981) D232 D233 ^ D235 D259 +error(6.236263047404961928e-05) D232 D233 ^ D236 D259 +error(0.01492810779744833949) D232 D239 +error(0.01018712175352179221) D232 D239 ^ D234 D235 +error(0.02897098431077184053) D232 D256 +error(0.009580229984338856086) D232 D256 ^ D229 L0 +error(0.003392722770150778579) D232 D256 ^ D258 D259 +error(0.0009747224564062936412) D232 D256 ^ D258 L0 +error(0.002252326138938211871) D232 D257 +error(0.0005634108258186226606) D232 D257 ^ D258 D259 +error(0.002115175773512700461) D232 D263 +error(0.0030608781621897568) D232 D263 ^ D234 D235 +error(0.001270789941476938327) D232 D263 ^ D234 D258 +error(0.001939096001487852121) D232 D263 ^ D235 D258 +error(0.001187976190653792109) D232 D263 ^ D235 D259 +error(0.002026211267946444097) D232 D263 ^ D258 D259 +error(0.0009157719035976701148) D232 D264 +error(0.0001672286054041389081) D232 D264 ^ D235 D236 +error(0.0005353541060028568126) D232 D264 ^ D235 D258 +error(0.001349693943062659982) D232 D264 ^ D235 D259 +error(0.0001999317661850497118) D232 D264 ^ D236 D259 +error(0.0005670826236588418032) D232 D264 ^ D258 D259 +error(0.01000000000000000021) D233 +error(0.02725063153630395349) D233 D240 +error(0.02389252453306664817) D233 D240 ^ D235 D236 +error(0.03329807480613649479) D233 D257 +error(0.002054421110880488236) D233 D257 ^ D259 D260 +error(0.005139440185035600017) D233 D264 +error(0.002101194335119418565) D233 D264 ^ D235 D236 +error(0.0008922567876475901794) D233 D264 ^ D235 D259 +error(0.002032431206016870138) D233 D264 ^ D236 D259 +error(0.0005572318529482796516) D233 D264 ^ D236 D260 +error(0.002750366226549339366) D233 D264 ^ D259 D260 +error(0.001460790359938684765) D233 D265 +error(0.0004147934522296172497) D233 D265 ^ D236 D259 +error(0.001498989588066860232) D233 D265 ^ D236 D260 +error(0.007007209720512256115) D234 D235 +error(0.0004546663148800625083) D234 D235 ^ D238 D239 +error(0.0001425002969150308049) D234 D235 ^ D238 D263 +error(0.0005696660143250861785) D234 D235 ^ D239 D240 +error(0.003116901364237378153) D234 D235 ^ D239 D263 +error(0.01566705597438649775) D234 D243 +error(0.01186724049158091772) D234 D243 ^ D238 D239 +error(0.03336402185735180131) D234 D258 +error(0.00244917592564833364) D234 D258 ^ D262 D263 +error(0.002462421301947203146) D234 D266 +error(0.001960634436970778299) D234 D266 ^ D238 D262 +error(3.566087944092823308e-06) D234 D266 ^ D238 D263 +error(0.0001637216941453993634) D234 D266 ^ D262 D263 +error(0.004695941015552158003) D234 D267 +error(0.00205837118508770409) D234 D267 ^ D238 D239 +error(0.002163953410575679935) D234 D267 ^ D238 D262 +error(0.001554394982217835453) D234 D267 ^ D238 D263 +error(0.0008879695541101345754) D234 D267 ^ D239 D263 +error(0.002096192257208842526) D234 D267 ^ D262 D263 +error(0.01000000000000000021) D234 L0 +error(0.004381884530454759931) D238 D262 ^ D234 L0 +error(0.008692175163913264807) D235 D236 +error(0.0006905029968304733732) D235 D236 ^ D209 +error(0.00015945046755517543) D235 D236 ^ D233 +error(0.001006504109593458303) D235 D236 ^ D239 D240 +error(0.0008131714298475562147) D235 D236 ^ D239 D264 +error(0.0001651771561405014556) D235 D236 ^ D240 D241 +error(0.001649440750181971295) D235 D236 ^ D240 D264 +error(0.01789251364993136792) D235 D244 +error(0.01500802532656671066) D235 D244 ^ D239 D240 +error(0.003194379691095217307) D235 D258 +error(0.000203690984695900824) D235 D258 ^ D263 D264 +error(0.04189958697952669148) D235 D259 +error(0.002152911101466412069) D235 D259 ^ D263 D264 +error(0.00127605215256659083) D235 D267 +error(0.0001706398503003628525) D235 D267 ^ D238 D239 +error(0.0005783336597214276545) D235 D267 ^ D238 D263 +error(0.002016020127898890141) D235 D267 ^ D239 D263 +error(0.0001968335352046341011) D235 D267 ^ D239 D264 +error(0.0001375362953422371091) D235 D267 ^ D263 D264 +error(0.0009834825476811148021) D235 D268 +error(0.00207981557623123552) D235 D268 ^ D239 D240 +error(0.001841441603780133614) D235 D268 ^ D239 D263 +error(0.002505923860524120889) D235 D268 ^ D239 D264 +error(0.001419084695213386135) D235 D268 ^ D240 D264 +error(0.002852296504457221913) D235 D268 ^ D263 D264 +error(0.009019350943902253864) D236 D237 +error(0.0001633354758280312132) D236 D237 ^ D233 +error(0.0005572855800292770244) D236 D237 ^ D240 D241 +error(0.000553630490138258915) D236 D237 ^ D240 D265 +error(0.01251672150946384239) D236 D237 ^ D241 +error(0.005790639639282292236) D236 D237 ^ D241 D265 +error(0.001145685949262297476) D236 D237 ^ D265 +error(0.0003259075124975205589) D236 D237 ^ D265 ^ D233 +error(0.01461905296180973472) D236 D245 +error(0.01098538498491322471) D236 D245 ^ D240 D241 +error(0.003447214799424203578) D236 D259 +error(0.0003666576516136855319) D236 D259 ^ D264 D265 +error(0.02223358031578045318) D236 D260 +error(0.005543803677485251852) D236 D260 ^ D233 +error(0.002210910752504785439) D236 D260 ^ D264 D265 +error(0.001379541549716805683) D236 D260 ^ D265 +error(0.002924885832784762055) D236 D268 +error(0.001574022131985900515) D236 D268 ^ D240 D264 +error(0.0003547034745176052173) D236 D268 ^ D240 D265 +error(0.0002399940007932416046) D236 D268 ^ D264 D265 +error(0.002619265017415267974) D236 D269 +error(0.00158241141465816147) D236 D269 ^ D240 D241 +error(0.0004730953369301131323) D236 D269 ^ D240 D264 +error(0.002269905077607368895) D236 D269 ^ D240 D265 +error(0.0006264493750148219901) D236 D269 ^ D241 D265 +error(0.001918993207104307793) D236 D269 ^ D264 D265 +error(0.01377675457637685119) D237 +error(0.002469986989841304811) D237 D260 +error(8.555696620424324658e-05) D237 D260 ^ D233 +error(0.002594304494337347066) D237 D260 ^ D265 +error(0.0001376299769938429572) D237 D260 ^ D265 ^ D233 +error(0.03458993767437905376) D237 D261 +error(0.00595402342578680091) D237 D261 ^ D265 +error(0.00245631142944030675) D237 D269 +error(0.0003152919029694442122) D237 D269 ^ D240 D241 +error(0.0001612541715673219793) D237 D269 ^ D240 D265 +error(0.002267685579689308461) D237 D269 ^ D241 D265 +error(0.02509039495427965033) D237 ^ D241 +error(0.002041494666156196645) D237 ^ D265 ^ D241 +error(0.01000000000000000021) D238 +error(0.01187707629310352439) D238 D239 +error(0.001215264942972966392) D238 D239 ^ D242 D243 +error(0.0005861090175784376428) D238 D239 ^ D243 D244 +error(0.001982134764997857141) D238 D239 ^ D243 D267 +error(0.000425289327455776172) D238 D239 ^ D244 D267 +error(0.05297676665932575524) D238 D262 +error(0.003462771653202506312) D238 D262 ^ D266 D267 +error(0.00322690889612168132) D238 D263 +error(0.000497833939171843853) D238 D263 ^ D266 D267 +error(0.002260264554825750123) D238 D270 +error(0.0003473527278594572667) D238 D270 ^ D243 D244 +error(0.0008431892706171371455) D238 D270 ^ D243 D267 +error(0.0003892606543198490589) D238 D270 ^ D244 D267 +error(0.01190612723083741761) D238 ^ D242 L0 +error(0.004358707189286150849) D242 D266 ^ D238 +error(0.01780468578502405336) D239 D240 +error(0.0004696046272799186939) D239 D240 ^ D243 D244 +error(0.0008851561914086082629) D239 D240 ^ D244 D245 +error(0.001718406529616470267) D239 D240 ^ D244 D268 +error(0.0003621508437235534191) D239 D240 ^ D245 D268 +error(0.02155444020316826109) D239 D246 +error(0.02009756387803195501) D239 D246 ^ D243 D244 +error(0.02960309792484100769) D239 D263 +error(0.002696425463454497993) D239 D263 ^ D267 D268 +error(0.004542445374810293035) D239 D264 +error(0.0004787390755988302541) D239 D264 ^ D267 D268 +error(0.005783598058333213297) D239 D270 +error(0.006313383773074134758) D239 D270 ^ D243 D244 +error(0.001741030225433118535) D239 D270 ^ D243 D267 +error(0.007616179929498220411) D239 D270 ^ D244 D267 +error(0.002095215870669062119) D239 D270 ^ D244 D268 +error(0.003866228108010479232) D239 D270 ^ D267 D268 +error(0.001007778755732767137) D239 D271 +error(0.000791992306397491623) D239 D271 ^ D244 D245 +error(0.000442838744421881808) D239 D271 ^ D244 D267 +error(0.0011264348417513437) D239 D271 ^ D244 D268 +error(0.0007294911408703053015) D239 D271 ^ D245 D268 +error(0.0006790628791750554817) D239 D271 ^ D267 D268 +error(0.007519668875887872833) D240 D241 +error(0.000367564866391688718) D240 D241 ^ D244 D245 +error(4.196227388522683093e-05) D240 D241 ^ D245 +error(0.001830493767202687975) D240 D241 ^ D245 D269 +error(2.861025836566403991e-05) D240 D241 ^ D269 +error(0.0150479596563341516) D240 D247 +error(0.01110180417699024001) D240 D247 ^ D244 D245 +error(0.02213619326971636922) D240 D264 +error(0.002579554369470707462) D240 D264 ^ D268 D269 +error(0.003236307905156624899) D240 D265 +error(0.0005079835293430067563) D240 D265 ^ D268 D269 +error(0.001390683905584838868) D240 D271 +error(0.002396077516820634395) D240 D271 ^ D244 D245 +error(0.001515604606709302846) D240 D271 ^ D244 D268 +error(0.002611050841900463149) D240 D271 ^ D245 D268 +error(0.001030212141032500316) D240 D271 ^ D245 D269 +error(0.003086746265355783374) D240 D271 ^ D268 D269 +error(0.001205642639412828282) D240 D272 +error(5.413361691145458354e-05) D240 D272 ^ D245 +error(0.0006132114541846075744) D240 D272 ^ D245 D268 +error(0.001417719826750507691) D240 D272 ^ D245 D269 +error(0.0005980895653587027776) D240 D272 ^ D268 D269 +error(0.01000000000000000021) D241 +error(0.01636000547734253047) D241 D248 +error(0.01796233722540469674) D241 D248 ^ D245 +error(0.02381232961817726645) D241 D265 +error(0.002637023807817020799) D241 D265 ^ D269 +error(0.003450945788882907317) D241 D272 +error(0.002599654021808480656) D241 D272 ^ D245 +error(0.004061933355944112936) D241 D272 ^ D269 +error(0.0009592071290398953122) D241 D272 ^ D269 ^ D245 +error(0.01363803936237644246) D242 D243 +error(0.003930263821803167863) D242 D243 ^ D214 +error(0.01802560496900905418) D242 D243 ^ D238 +error(8.589436615621441292e-05) D242 D243 ^ D246 ^ D214 +error(0.02525902938098234171) D242 D266 +error(0.00574306903657622117) D242 L0 +error(0.0009470563290373274889) D242 L0 ^ D210 L0 ^ D214 +error(0.0008800554094711328119) D242 L0 ^ D210 L0 ^ D238 +error(0.001457843699669428847) D242 L0 ^ D238 ^ D214 +error(0.01450534184220186006) D243 D244 +error(0.0005721110364468817927) D243 D244 ^ D246 D247 +error(0.004601701592776456101) D243 D244 ^ D246 D270 +error(0.01329762689544615982) D243 D249 +error(0.01235795010597530268) D243 D249 ^ D246 +error(0.004365491728138845215) D243 D266 +error(0.002695027976132394112) D243 D266 ^ D238 +error(0.0003027628658435273408) D243 D266 ^ D270 ^ D238 +error(0.02723315102725440418) D243 D267 +error(0.00140205973473897039) D243 D267 ^ D238 +error(0.005203451391324077739) D243 D267 ^ D270 +error(0.00255544150013453002) D243 D273 +error(0.001808009258848390166) D243 D273 ^ D246 +error(0.002707021320884218929) D243 D273 ^ D270 +error(0.0006088424000031264971) D243 D273 ^ D270 ^ D246 +error(0.006472003059864666653) D244 D245 +error(0.0003994528074094950672) D244 D245 ^ D246 D247 +error(0.0004434226054838874857) D244 D245 ^ D246 D271 +error(0.0008751552090033030192) D244 D245 ^ D247 D248 +error(0.003045602539330864375) D244 D245 ^ D247 D271 +error(0.01325582626527719958) D244 D250 +error(0.01125502755749200473) D244 D250 ^ D246 D247 +error(0.007525476540747918358) D244 D267 +error(0.0006137602329925614204) D244 D267 ^ D270 D271 +error(0.02902365595154616021) D244 D268 +error(0.002401197642609727463) D244 D268 ^ D270 D271 +error(0.002408909711435769981) D244 D273 +error(0.0002707484224426097191) D244 D273 ^ D246 +error(0.001527963667674685309) D244 D273 ^ D246 D270 +error(0.0001105290094925922439) D244 D273 ^ D246 D271 +error(0.0005441160428730808241) D244 D273 ^ D270 +error(0.000356573641289079893) D244 D273 ^ D270 D271 +error(0.003107337702078268298) D244 D274 +error(0.00148514416775588306) D244 D274 ^ D246 D247 +error(0.0009343659549481646417) D244 D274 ^ D246 D270 +error(0.001133507027766949074) D244 D274 ^ D246 D271 +error(0.000964158168953031477) D244 D274 ^ D247 D271 +error(0.001858972200881762581) D244 D274 ^ D270 D271 +error(0.01000000000000000021) D245 +error(0.004493550144293693982) D245 D268 +error(0.0004616573460695907647) D245 D268 ^ D271 D272 +error(0.02153375451966943119) D245 D269 +error(0.001571041344134688862) D245 D269 ^ D271 D272 +error(0.001727413411201550366) D245 D274 +error(6.892623931214466931e-05) D245 D274 ^ D246 D247 +error(0.000533806835748320543) D245 D274 ^ D246 D271 +error(0.001001657939292958282) D245 D274 ^ D247 D271 +error(0.0006587014447459603635) D245 ^ D213 ^ D217 +error(0.0009512945064856004112) D245 ^ D213 ^ D241 +error(0.0004374836472664517121) D245 ^ D217 +error(0.01000000000000000021) D246 +error(0.006089189670584919251) D246 D247 +error(0.0003733339846648112744) D246 D247 ^ D249 D250 +error(0.002491417993463262287) D246 D247 ^ D250 D274 +error(0.0005065788208640180758) D246 D247 ^ D274 +error(0.0367379142487225252) D246 D270 +error(0.004448757689050466223) D246 D270 ^ D273 D274 +error(0.003134023997971539712) D246 D271 +error(0.0003650194631049960385) D246 D271 ^ D273 D274 +error(0.001406953404968496737) D246 D275 +error(0.000258713445676149944) D246 D275 ^ D250 +error(0.001311719158548649289) D246 D275 ^ D250 D274 +error(0.01016476222491488092) D247 D248 +error(0.002108544545389898564) D247 D248 ^ D221 +error(0.01205056218453301811) D247 D248 ^ D245 +error(8.106206907232670631e-05) D247 D248 ^ D250 +error(0.0003126805541716948288) D247 D248 ^ D250 ^ D221 +error(0.01810275288528837012) D247 D251 +error(0.01637617210264374554) D247 D251 ^ D250 +error(0.02102885356741089617) D247 D271 +error(0.001690237581495826133) D247 D271 ^ D245 +error(0.00359606707161589734) D247 D271 ^ D274 +error(0.003107887681254754581) D247 D272 +error(0.003382303353831740949) D247 D272 ^ D245 +error(0.0001913183606313894702) D247 D272 ^ D274 +error(0.0002941212067804130489) D247 D272 ^ D274 ^ D245 +error(0.003693046244270884078) D247 D275 +error(0.003186564243865780671) D247 D275 ^ D250 +error(0.004755038122238004067) D247 D275 ^ D274 +error(0.001954054770515154492) D247 D275 ^ D274 ^ D250 +error(0.02640784577619364679) D248 D272 +error(0.00290739257373180118) D248 D272 ^ D245 +error(0.006564866789739933102) D249 D250 +error(0.001832679987383818189) D249 D250 ^ D222 +error(0.01288524193192810627) D249 D250 ^ D246 +error(0.0006173749993255437177) D249 D250 ^ D251 +error(0.0004559863367010421231) D249 D250 ^ D251 ^ D222 +error(0.03275880248144626833) D249 D273 +error(0.00429567725900462799) D249 D273 ^ D246 +error(0.01072741549435932314) D250 +error(0.002509590526077771534) D250 D273 +error(0.003096878840847453254) D250 D273 ^ D246 +error(0.0004658229008440930739) D250 D273 ^ D275 +error(0.0006984840680404692847) D250 D273 ^ D275 ^ D246 +error(0.02371714611383288207) D250 D274 +error(0.001691210042327366938) D250 D274 ^ D246 +error(0.002968485154357761256) D250 D274 ^ D275 +error(0.01188288263817612218) D250 ^ D251 +error(0.001107203287059167415) D250 ^ D275 +error(0.004560533548355043092) D251 D275 ^ D250 +error(0.005000000000000000104) D251 +error(0.01983080680743972563) D251 D275 +error(0.005000000000000000104) D252 +error(0.01768647969650154195) D252 D256 +error(0.01997660103599073478) D252 D256 ^ D253 L0 +error(0.0272133096145726304) D252 D276 +error(0.009354172066671974373) D252 D276 ^ D277 L0 +error(0.006575429550073013871) D252 D280 +error(0.006606814816559495283) D252 D280 ^ D253 L0 +error(0.00570203587243049443) D252 D280 ^ D277 L0 +error(0.004394467297965208054) D252 D280 ^ D277 L0 ^ D253 L0 +error(0.003141484544212969771) D252 D281 +error(0.002866645116274591214) D252 D281 ^ D253 D277 +error(0.0007467639087963555584) D252 D281 ^ D253 L0 +error(0.00100340881217143808) D252 D281 ^ D277 L0 +error(0.005000000000000000104) D252 ^ D253 L0 +error(0.006716177406890511993) D253 D277 ^ D252 +error(0.006831737513122857625) D253 D254 +error(0.000925383923960359611) D253 D254 ^ D252 +error(0.0002795442616193875634) D253 D254 ^ D256 D257 +error(0.0005690671345596917631) D253 D254 ^ D256 D281 +error(0.01632363663664802497) D253 D254 ^ D257 +error(0.004686760244772980415) D253 D254 ^ D257 D281 +error(0.003622701663117294888) D253 D254 ^ D281 +error(0.0006213698150018824758) D253 D254 ^ D281 ^ D252 +error(0.02092676657561087783) D253 D259 +error(0.0132551803359697469) D253 D259 ^ D256 D257 +error(0.05139236901086036841) D253 D277 +error(0.003561108508096676607) D253 D277 ^ D280 D281 +error(0.0046639615040387555) D253 D277 ^ D281 +error(0.004108367013198443128) D253 D282 +error(0.001863368595620282274) D253 D282 ^ D256 D280 +error(0.0002077739562874012804) D253 D282 ^ D256 D281 +error(0.0001534208996732992975) D253 D282 ^ D280 D281 +error(0.002474351314484049547) D253 D283 +error(0.001842181383880251615) D253 D283 ^ D256 D257 +error(0.0007357888818581343913) D253 D283 ^ D256 D280 +error(0.002176810431023448646) D253 D283 ^ D256 D281 +error(0.0009865289460392872439) D253 D283 ^ D257 D281 +error(0.002351214005477396222) D253 D283 ^ D280 D281 +error(0.01000000000000000021) D253 L0 +error(0.01700103788466153509) D254 D260 +error(0.01657742774919643974) D254 D260 ^ D257 +error(0.005959798576863498468) D254 D277 +error(0.000405679075595877963) D254 D277 ^ D252 +error(0.006365081479756801858) D254 D277 ^ D281 +error(0.0006185446772456166349) D254 D277 ^ D281 ^ D252 +error(0.02877376894243781) D254 D278 +error(0.01462010353799540405) D254 D278 ^ D281 +error(0.00255626787296149658) D254 D283 +error(0.0003462302675103233517) D254 D283 ^ D256 D257 +error(0.0006259573259455081164) D254 D283 ^ D256 D281 +error(0.001780026776757265587) D254 D283 ^ D257 D281 +error(0.0007765183634651079674) D254 D283 ^ D281 +error(0.004204068823748800116) D254 D284 +error(0.004448751937011490021) D254 D284 ^ D257 +error(0.002493712434291736613) D254 D284 ^ D281 +error(0.002122847769795885211) D254 D284 ^ D281 ^ D257 +error(0.008073481635886498378) D255 D256 +error(0.0005730018563843651807) D255 D256 ^ D253 L0 +error(0.0004628308648474659527) D255 D256 ^ D258 D259 +error(0.002505525127704565005) D255 D256 ^ D258 D282 +error(0.009108311699216133789) D255 D256 ^ D258 L0 +error(0.0001464483877319481696) D255 D256 ^ D259 D282 +error(0.001791079838534594517) D255 D256 ^ D282 L0 +error(0.000306018137642829612) D255 D256 ^ D282 L0 ^ D253 L0 +error(0.01557841355567917037) D255 D262 +error(0.01435979479825004283) D255 D262 ^ D258 L0 +error(0.02308764085533153432) D255 D279 +error(0.00431467884365783691) D255 D279 ^ D282 L0 +error(0.001931307837553560523) D255 D280 +error(0.0008665267816730684537) D255 D280 ^ D253 L0 +error(0.002496274199622507042) D255 D280 ^ D282 L0 +error(0.0003964385681257144838) D255 D280 ^ D282 L0 ^ D253 L0 +error(0.003466727401050739669) D255 D286 +error(0.004164332635934311043) D255 D286 ^ D258 L0 +error(0.002681973973769409981) D255 D286 ^ D282 L0 +error(0.001643190028824071487) D255 D286 ^ D282 L0 ^ D258 L0 +error(0.002347213007440165141) D255 D287 +error(1.438422088529517882e-05) D255 D287 ^ D258 D259 +error(0.001602485993920255191) D255 D287 ^ D258 D282 +error(0.0003906309354926121866) D255 D287 ^ D258 L0 +error(0.0002462750543915511142) D255 D287 ^ D259 D282 +error(0.0003195674037454942704) D255 D287 ^ D282 L0 +error(0.009374789236906273804) D256 D257 +error(0.0005590529469528864254) D256 D257 ^ D229 L0 +error(0.0001530608469217417504) D256 D257 ^ D253 L0 +error(0.0008647203357822550026) D256 D257 ^ D258 D259 +error(0.000648659578791030509) D256 D257 ^ D259 D260 +error(0.00193254128555270981) D256 D257 ^ D259 D283 +error(6.236263047404961928e-05) D256 D257 ^ D260 D283 +error(0.01492810779744833949) D256 D263 +error(0.01018712175352179221) D256 D263 ^ D258 D259 +error(0.02897098431077184053) D256 D280 +error(0.009580229984338856086) D256 D280 ^ D253 L0 +error(0.003392722770150778579) D256 D280 ^ D282 D283 +error(0.0009747224564062936412) D256 D280 ^ D282 L0 +error(0.002252326138938211871) D256 D281 +error(0.0005634108258186226606) D256 D281 ^ D282 D283 +error(0.002115175773512700461) D256 D287 +error(0.0030608781621897568) D256 D287 ^ D258 D259 +error(0.001270789941476938327) D256 D287 ^ D258 D282 +error(0.001939096001487852121) D256 D287 ^ D259 D282 +error(0.001187976190653792109) D256 D287 ^ D259 D283 +error(0.002026211267946444097) D256 D287 ^ D282 D283 +error(0.0009157719035976701148) D256 D288 +error(0.0001672286054041389081) D256 D288 ^ D259 D260 +error(0.0005353541060028568126) D256 D288 ^ D259 D282 +error(0.001349693943062659982) D256 D288 ^ D259 D283 +error(0.0001999317661850497118) D256 D288 ^ D260 D283 +error(0.0005670826236588418032) D256 D288 ^ D282 D283 +error(0.01000000000000000021) D257 +error(0.02725063153630395349) D257 D264 +error(0.02389252453306664817) D257 D264 ^ D259 D260 +error(0.03329807480613649479) D257 D281 +error(0.002054421110880488236) D257 D281 ^ D283 D284 +error(0.005139440185035600017) D257 D288 +error(0.002101194335119418565) D257 D288 ^ D259 D260 +error(0.0008922567876475901794) D257 D288 ^ D259 D283 +error(0.002032431206016870138) D257 D288 ^ D260 D283 +error(0.0005572318529482796516) D257 D288 ^ D260 D284 +error(0.002750366226549339366) D257 D288 ^ D283 D284 +error(0.001460790359938684765) D257 D289 +error(0.0004147934522296172497) D257 D289 ^ D260 D283 +error(0.001498989588066860232) D257 D289 ^ D260 D284 +error(0.007007209720512256115) D258 D259 +error(0.0004546663148800625083) D258 D259 ^ D262 D263 +error(0.0001425002969150308049) D258 D259 ^ D262 D287 +error(0.0005696660143250861785) D258 D259 ^ D263 D264 +error(0.003116901364237378153) D258 D259 ^ D263 D287 +error(0.01566705597438649775) D258 D267 +error(0.01186724049158091772) D258 D267 ^ D262 D263 +error(0.03336402185735180131) D258 D282 +error(0.00244917592564833364) D258 D282 ^ D286 D287 +error(0.002462421301947203146) D258 D290 +error(0.001960634436970778299) D258 D290 ^ D262 D286 +error(3.566087944092823308e-06) D258 D290 ^ D262 D287 +error(0.0001637216941453993634) D258 D290 ^ D286 D287 +error(0.004695941015552158003) D258 D291 +error(0.00205837118508770409) D258 D291 ^ D262 D263 +error(0.002163953410575679935) D258 D291 ^ D262 D286 +error(0.001554394982217835453) D258 D291 ^ D262 D287 +error(0.0008879695541101345754) D258 D291 ^ D263 D287 +error(0.002096192257208842526) D258 D291 ^ D286 D287 +error(0.01000000000000000021) D258 L0 +error(0.004381884530454759931) D262 D286 ^ D258 L0 +error(0.008692175163913264807) D259 D260 +error(0.0006905029968304733732) D259 D260 ^ D233 +error(0.00015945046755517543) D259 D260 ^ D257 +error(0.001006504109593458303) D259 D260 ^ D263 D264 +error(0.0008131714298475562147) D259 D260 ^ D263 D288 +error(0.0001651771561405014556) D259 D260 ^ D264 D265 +error(0.001649440750181971295) D259 D260 ^ D264 D288 +error(0.01789251364993136792) D259 D268 +error(0.01500802532656671066) D259 D268 ^ D263 D264 +error(0.003194379691095217307) D259 D282 +error(0.000203690984695900824) D259 D282 ^ D287 D288 +error(0.04189958697952669148) D259 D283 +error(0.002152911101466412069) D259 D283 ^ D287 D288 +error(0.00127605215256659083) D259 D291 +error(0.0001706398503003628525) D259 D291 ^ D262 D263 +error(0.0005783336597214276545) D259 D291 ^ D262 D287 +error(0.002016020127898890141) D259 D291 ^ D263 D287 +error(0.0001968335352046341011) D259 D291 ^ D263 D288 +error(0.0001375362953422371091) D259 D291 ^ D287 D288 +error(0.0009834825476811148021) D259 D292 +error(0.00207981557623123552) D259 D292 ^ D263 D264 +error(0.001841441603780133614) D259 D292 ^ D263 D287 +error(0.002505923860524120889) D259 D292 ^ D263 D288 +error(0.001419084695213386135) D259 D292 ^ D264 D288 +error(0.002852296504457221913) D259 D292 ^ D287 D288 +error(0.009019350943902253864) D260 D261 +error(0.0001633354758280312132) D260 D261 ^ D257 +error(0.0005572855800292770244) D260 D261 ^ D264 D265 +error(0.000553630490138258915) D260 D261 ^ D264 D289 +error(0.01251672150946384239) D260 D261 ^ D265 +error(0.005790639639282292236) D260 D261 ^ D265 D289 +error(0.001145685949262297476) D260 D261 ^ D289 +error(0.0003259075124975205589) D260 D261 ^ D289 ^ D257 +error(0.01461905296180973472) D260 D269 +error(0.01098538498491322471) D260 D269 ^ D264 D265 +error(0.003447214799424203578) D260 D283 +error(0.0003666576516136855319) D260 D283 ^ D288 D289 +error(0.02223358031578045318) D260 D284 +error(0.005543803677485251852) D260 D284 ^ D257 +error(0.002210910752504785439) D260 D284 ^ D288 D289 +error(0.001379541549716805683) D260 D284 ^ D289 +error(0.002924885832784762055) D260 D292 +error(0.001574022131985900515) D260 D292 ^ D264 D288 +error(0.0003547034745176052173) D260 D292 ^ D264 D289 +error(0.0002399940007932416046) D260 D292 ^ D288 D289 +error(0.002619265017415267974) D260 D293 +error(0.00158241141465816147) D260 D293 ^ D264 D265 +error(0.0004730953369301131323) D260 D293 ^ D264 D288 +error(0.002269905077607368895) D260 D293 ^ D264 D289 +error(0.0006264493750148219901) D260 D293 ^ D265 D289 +error(0.001918993207104307793) D260 D293 ^ D288 D289 +error(0.01377675457637685119) D261 +error(0.002469986989841304811) D261 D284 +error(8.555696620424324658e-05) D261 D284 ^ D257 +error(0.002594304494337347066) D261 D284 ^ D289 +error(0.0001376299769938429572) D261 D284 ^ D289 ^ D257 +error(0.03458993767437905376) D261 D285 +error(0.00595402342578680091) D261 D285 ^ D289 +error(0.00245631142944030675) D261 D293 +error(0.0003152919029694442122) D261 D293 ^ D264 D265 +error(0.0001612541715673219793) D261 D293 ^ D264 D289 +error(0.002267685579689308461) D261 D293 ^ D265 D289 +error(0.02509039495427965033) D261 ^ D265 +error(0.002041494666156196645) D261 ^ D289 ^ D265 +error(0.01000000000000000021) D262 +error(0.01187707629310352439) D262 D263 +error(0.001215264942972966392) D262 D263 ^ D266 D267 +error(0.0005861090175784376428) D262 D263 ^ D267 D268 +error(0.001982134764997857141) D262 D263 ^ D267 D291 +error(0.000425289327455776172) D262 D263 ^ D268 D291 +error(0.05297676665932575524) D262 D286 +error(0.003462771653202506312) D262 D286 ^ D290 D291 +error(0.00322690889612168132) D262 D287 +error(0.000497833939171843853) D262 D287 ^ D290 D291 +error(0.002260264554825750123) D262 D294 +error(0.0003473527278594572667) D262 D294 ^ D267 D268 +error(0.0008431892706171371455) D262 D294 ^ D267 D291 +error(0.0003892606543198490589) D262 D294 ^ D268 D291 +error(0.01190612723083741761) D262 ^ D266 L0 +error(0.004358707189286150849) D266 D290 ^ D262 +error(0.01780468578502405336) D263 D264 +error(0.0004696046272799186939) D263 D264 ^ D267 D268 +error(0.0008851561914086082629) D263 D264 ^ D268 D269 +error(0.001718406529616470267) D263 D264 ^ D268 D292 +error(0.0003621508437235534191) D263 D264 ^ D269 D292 +error(0.02155444020316826109) D263 D270 +error(0.02009756387803195501) D263 D270 ^ D267 D268 +error(0.02960309792484100769) D263 D287 +error(0.002696425463454497993) D263 D287 ^ D291 D292 +error(0.004542445374810293035) D263 D288 +error(0.0004787390755988302541) D263 D288 ^ D291 D292 +error(0.005783598058333213297) D263 D294 +error(0.006313383773074134758) D263 D294 ^ D267 D268 +error(0.001741030225433118535) D263 D294 ^ D267 D291 +error(0.007616179929498220411) D263 D294 ^ D268 D291 +error(0.002095215870669062119) D263 D294 ^ D268 D292 +error(0.003866228108010479232) D263 D294 ^ D291 D292 +error(0.001007778755732767137) D263 D295 +error(0.000791992306397491623) D263 D295 ^ D268 D269 +error(0.000442838744421881808) D263 D295 ^ D268 D291 +error(0.0011264348417513437) D263 D295 ^ D268 D292 +error(0.0007294911408703053015) D263 D295 ^ D269 D292 +error(0.0006790628791750554817) D263 D295 ^ D291 D292 +error(0.007519668875887872833) D264 D265 +error(0.000367564866391688718) D264 D265 ^ D268 D269 +error(4.196227388522683093e-05) D264 D265 ^ D269 +error(0.001830493767202687975) D264 D265 ^ D269 D293 +error(2.861025836566403991e-05) D264 D265 ^ D293 +error(0.0150479596563341516) D264 D271 +error(0.01110180417699024001) D264 D271 ^ D268 D269 +error(0.02213619326971636922) D264 D288 +error(0.002579554369470707462) D264 D288 ^ D292 D293 +error(0.003236307905156624899) D264 D289 +error(0.0005079835293430067563) D264 D289 ^ D292 D293 +error(0.001390683905584838868) D264 D295 +error(0.002396077516820634395) D264 D295 ^ D268 D269 +error(0.001515604606709302846) D264 D295 ^ D268 D292 +error(0.002611050841900463149) D264 D295 ^ D269 D292 +error(0.001030212141032500316) D264 D295 ^ D269 D293 +error(0.003086746265355783374) D264 D295 ^ D292 D293 +error(0.001205642639412828282) D264 D296 +error(5.413361691145458354e-05) D264 D296 ^ D269 +error(0.0006132114541846075744) D264 D296 ^ D269 D292 +error(0.001417719826750507691) D264 D296 ^ D269 D293 +error(0.0005980895653587027776) D264 D296 ^ D292 D293 +error(0.01000000000000000021) D265 +error(0.01636000547734253047) D265 D272 +error(0.01796233722540469674) D265 D272 ^ D269 +error(0.02381232961817726645) D265 D289 +error(0.002637023807817020799) D265 D289 ^ D293 +error(0.003450945788882907317) D265 D296 +error(0.002599654021808480656) D265 D296 ^ D269 +error(0.004061933355944112936) D265 D296 ^ D293 +error(0.0009592071290398953122) D265 D296 ^ D293 ^ D269 +error(0.01363803936237644246) D266 D267 +error(0.003930263821803167863) D266 D267 ^ D238 +error(0.01802560496900905418) D266 D267 ^ D262 +error(8.589436615621441292e-05) D266 D267 ^ D270 ^ D238 +error(0.02525902938098234171) D266 D290 +error(0.00574306903657622117) D266 L0 +error(0.0009470563290373274889) D266 L0 ^ D234 L0 ^ D238 +error(0.0008800554094711328119) D266 L0 ^ D234 L0 ^ D262 +error(0.001457843699669428847) D266 L0 ^ D262 ^ D238 +error(0.01450534184220186006) D267 D268 +error(0.0005721110364468817927) D267 D268 ^ D270 D271 +error(0.004601701592776456101) D267 D268 ^ D270 D294 +error(0.01329762689544615982) D267 D273 +error(0.01235795010597530268) D267 D273 ^ D270 +error(0.004365491728138845215) D267 D290 +error(0.002695027976132394112) D267 D290 ^ D262 +error(0.0003027628658435273408) D267 D290 ^ D294 ^ D262 +error(0.02723315102725440418) D267 D291 +error(0.00140205973473897039) D267 D291 ^ D262 +error(0.005203451391324077739) D267 D291 ^ D294 +error(0.00255544150013453002) D267 D297 +error(0.001808009258848390166) D267 D297 ^ D270 +error(0.002707021320884218929) D267 D297 ^ D294 +error(0.0006088424000031264971) D267 D297 ^ D294 ^ D270 +error(0.006472003059864666653) D268 D269 +error(0.0003994528074094950672) D268 D269 ^ D270 D271 +error(0.0004434226054838874857) D268 D269 ^ D270 D295 +error(0.0008751552090033030192) D268 D269 ^ D271 D272 +error(0.003045602539330864375) D268 D269 ^ D271 D295 +error(0.01325582626527719958) D268 D274 +error(0.01125502755749200473) D268 D274 ^ D270 D271 +error(0.007525476540747918358) D268 D291 +error(0.0006137602329925614204) D268 D291 ^ D294 D295 +error(0.02902365595154616021) D268 D292 +error(0.002401197642609727463) D268 D292 ^ D294 D295 +error(0.002408909711435769981) D268 D297 +error(0.0002707484224426097191) D268 D297 ^ D270 +error(0.001527963667674685309) D268 D297 ^ D270 D294 +error(0.0001105290094925922439) D268 D297 ^ D270 D295 +error(0.0005441160428730808241) D268 D297 ^ D294 +error(0.000356573641289079893) D268 D297 ^ D294 D295 +error(0.003107337702078268298) D268 D298 +error(0.00148514416775588306) D268 D298 ^ D270 D271 +error(0.0009343659549481646417) D268 D298 ^ D270 D294 +error(0.001133507027766949074) D268 D298 ^ D270 D295 +error(0.000964158168953031477) D268 D298 ^ D271 D295 +error(0.001858972200881762581) D268 D298 ^ D294 D295 +error(0.01000000000000000021) D269 +error(0.004493550144293693982) D269 D292 +error(0.0004616573460695907647) D269 D292 ^ D295 D296 +error(0.02153375451966943119) D269 D293 +error(0.001571041344134688862) D269 D293 ^ D295 D296 +error(0.001727413411201550366) D269 D298 +error(6.892623931214466931e-05) D269 D298 ^ D270 D271 +error(0.000533806835748320543) D269 D298 ^ D270 D295 +error(0.001001657939292958282) D269 D298 ^ D271 D295 +error(0.0006587014447459603635) D269 ^ D237 ^ D241 +error(0.0009512945064856004112) D269 ^ D237 ^ D265 +error(0.0004374836472664517121) D269 ^ D241 +error(0.01000000000000000021) D270 +error(0.006089189670584919251) D270 D271 +error(0.0003733339846648112744) D270 D271 ^ D273 D274 +error(0.002491417993463262287) D270 D271 ^ D274 D298 +error(0.0005065788208640180758) D270 D271 ^ D298 +error(0.0367379142487225252) D270 D294 +error(0.004448757689050466223) D270 D294 ^ D297 D298 +error(0.003134023997971539712) D270 D295 +error(0.0003650194631049960385) D270 D295 ^ D297 D298 +error(0.001406953404968496737) D270 D299 +error(0.000258713445676149944) D270 D299 ^ D274 +error(0.001311719158548649289) D270 D299 ^ D274 D298 +error(0.01016476222491488092) D271 D272 +error(0.002108544545389898564) D271 D272 ^ D245 +error(0.01205056218453301811) D271 D272 ^ D269 +error(8.106206907232670631e-05) D271 D272 ^ D274 +error(0.0003126805541716948288) D271 D272 ^ D274 ^ D245 +error(0.01810275288528837012) D271 D275 +error(0.01637617210264374554) D271 D275 ^ D274 +error(0.02102885356741089617) D271 D295 +error(0.001690237581495826133) D271 D295 ^ D269 +error(0.00359606707161589734) D271 D295 ^ D298 +error(0.003107887681254754581) D271 D296 +error(0.003382303353831740949) D271 D296 ^ D269 +error(0.0001913183606313894702) D271 D296 ^ D298 +error(0.0002941212067804130489) D271 D296 ^ D298 ^ D269 +error(0.003693046244270884078) D271 D299 +error(0.003186564243865780671) D271 D299 ^ D274 +error(0.004755038122238004067) D271 D299 ^ D298 +error(0.001954054770515154492) D271 D299 ^ D298 ^ D274 +error(0.02640784577619364679) D272 D296 +error(0.00290739257373180118) D272 D296 ^ D269 +error(0.006564866789739933102) D273 D274 +error(0.001832679987383818189) D273 D274 ^ D246 +error(0.01288524193192810627) D273 D274 ^ D270 +error(0.0006173749993255437177) D273 D274 ^ D275 +error(0.0004559863367010421231) D273 D274 ^ D275 ^ D246 +error(0.03275880248144626833) D273 D297 +error(0.00429567725900462799) D273 D297 ^ D270 +error(0.01072741549435932314) D274 +error(0.002509590526077771534) D274 D297 +error(0.003096878840847453254) D274 D297 ^ D270 +error(0.0004658229008440930739) D274 D297 ^ D299 +error(0.0006984840680404692847) D274 D297 ^ D299 ^ D270 +error(0.02371714611383288207) D274 D298 +error(0.001691210042327366938) D274 D298 ^ D270 +error(0.002968485154357761256) D274 D298 ^ D299 +error(0.01188288263817612218) D274 ^ D275 +error(0.001107203287059167415) D274 ^ D299 +error(0.004560533548355043092) D275 D299 ^ D274 +error(0.005000000000000000104) D275 +error(0.01983080680743972563) D275 D299 +error(0.005000000000000000104) D276 +error(0.01768647969650154195) D276 D280 +error(0.01997660103599073478) D276 D280 ^ D277 L0 +error(0.0272133096145726304) D276 D300 +error(0.009354172066671974373) D276 D300 ^ D301 L0 +error(0.006575429550073013871) D276 D304 +error(0.006606814816559495283) D276 D304 ^ D277 L0 +error(0.00570203587243049443) D276 D304 ^ D301 L0 +error(0.004394467297965208054) D276 D304 ^ D301 L0 ^ D277 L0 +error(0.003141484544212969771) D276 D305 +error(0.002866645116274591214) D276 D305 ^ D277 D301 +error(0.0007467639087963555584) D276 D305 ^ D277 L0 +error(0.00100340881217143808) D276 D305 ^ D301 L0 +error(0.005000000000000000104) D276 ^ D277 L0 +error(0.006716177406890511993) D277 D301 ^ D276 +error(0.006831737513122857625) D277 D278 +error(0.000925383923960359611) D277 D278 ^ D276 +error(0.0002795442616193875634) D277 D278 ^ D280 D281 +error(0.0005690671345596917631) D277 D278 ^ D280 D305 +error(0.01632363663664802497) D277 D278 ^ D281 +error(0.004686760244772980415) D277 D278 ^ D281 D305 +error(0.003622701663117294888) D277 D278 ^ D305 +error(0.0006213698150018824758) D277 D278 ^ D305 ^ D276 +error(0.02092676657561087783) D277 D283 +error(0.0132551803359697469) D277 D283 ^ D280 D281 +error(0.05139236901086036841) D277 D301 +error(0.003561108508096676607) D277 D301 ^ D304 D305 +error(0.0046639615040387555) D277 D301 ^ D305 +error(0.004108367013198443128) D277 D306 +error(0.001863368595620282274) D277 D306 ^ D280 D304 +error(0.0002077739562874012804) D277 D306 ^ D280 D305 +error(0.0001534208996732992975) D277 D306 ^ D304 D305 +error(0.002474351314484049547) D277 D307 +error(0.001842181383880251615) D277 D307 ^ D280 D281 +error(0.0007357888818581343913) D277 D307 ^ D280 D304 +error(0.002176810431023448646) D277 D307 ^ D280 D305 +error(0.0009865289460392872439) D277 D307 ^ D281 D305 +error(0.002351214005477396222) D277 D307 ^ D304 D305 +error(0.01000000000000000021) D277 L0 +error(0.01700103788466153509) D278 D284 +error(0.01657742774919643974) D278 D284 ^ D281 +error(0.005959798576863498468) D278 D301 +error(0.000405679075595877963) D278 D301 ^ D276 +error(0.006365081479756801858) D278 D301 ^ D305 +error(0.0006185446772456166349) D278 D301 ^ D305 ^ D276 +error(0.02877376894243781) D278 D302 +error(0.01462010353799540405) D278 D302 ^ D305 +error(0.00255626787296149658) D278 D307 +error(0.0003462302675103233517) D278 D307 ^ D280 D281 +error(0.0006259573259455081164) D278 D307 ^ D280 D305 +error(0.001780026776757265587) D278 D307 ^ D281 D305 +error(0.0007765183634651079674) D278 D307 ^ D305 +error(0.004204068823748800116) D278 D308 +error(0.004448751937011490021) D278 D308 ^ D281 +error(0.002493712434291736613) D278 D308 ^ D305 +error(0.002122847769795885211) D278 D308 ^ D305 ^ D281 +error(0.008073481635886498378) D279 D280 +error(0.0005730018563843651807) D279 D280 ^ D277 L0 +error(0.0004628308648474659527) D279 D280 ^ D282 D283 +error(0.002505525127704565005) D279 D280 ^ D282 D306 +error(0.009108311699216133789) D279 D280 ^ D282 L0 +error(0.0001464483877319481696) D279 D280 ^ D283 D306 +error(0.001791079838534594517) D279 D280 ^ D306 L0 +error(0.000306018137642829612) D279 D280 ^ D306 L0 ^ D277 L0 +error(0.01557841355567917037) D279 D286 +error(0.01435979479825004283) D279 D286 ^ D282 L0 +error(0.02308764085533153432) D279 D303 +error(0.00431467884365783691) D279 D303 ^ D306 L0 +error(0.001931307837553560523) D279 D304 +error(0.0008665267816730684537) D279 D304 ^ D277 L0 +error(0.002496274199622507042) D279 D304 ^ D306 L0 +error(0.0003964385681257144838) D279 D304 ^ D306 L0 ^ D277 L0 +error(0.003466727401050739669) D279 D310 +error(0.004164332635934311043) D279 D310 ^ D282 L0 +error(0.002681973973769409981) D279 D310 ^ D306 L0 +error(0.001643190028824071487) D279 D310 ^ D306 L0 ^ D282 L0 +error(0.002347213007440165141) D279 D311 +error(1.438422088529517882e-05) D279 D311 ^ D282 D283 +error(0.001602485993920255191) D279 D311 ^ D282 D306 +error(0.0003906309354926121866) D279 D311 ^ D282 L0 +error(0.0002462750543915511142) D279 D311 ^ D283 D306 +error(0.0003195674037454942704) D279 D311 ^ D306 L0 +error(0.009374789236906273804) D280 D281 +error(0.0005590529469528864254) D280 D281 ^ D253 L0 +error(0.0001530608469217417504) D280 D281 ^ D277 L0 +error(0.0008647203357822550026) D280 D281 ^ D282 D283 +error(0.000648659578791030509) D280 D281 ^ D283 D284 +error(0.00193254128555270981) D280 D281 ^ D283 D307 +error(6.236263047404961928e-05) D280 D281 ^ D284 D307 +error(0.01492810779744833949) D280 D287 +error(0.01018712175352179221) D280 D287 ^ D282 D283 +error(0.02897098431077184053) D280 D304 +error(0.009580229984338856086) D280 D304 ^ D277 L0 +error(0.003392722770150778579) D280 D304 ^ D306 D307 +error(0.0009747224564062936412) D280 D304 ^ D306 L0 +error(0.002252326138938211871) D280 D305 +error(0.0005634108258186226606) D280 D305 ^ D306 D307 +error(0.002115175773512700461) D280 D311 +error(0.0030608781621897568) D280 D311 ^ D282 D283 +error(0.001270789941476938327) D280 D311 ^ D282 D306 +error(0.001939096001487852121) D280 D311 ^ D283 D306 +error(0.001187976190653792109) D280 D311 ^ D283 D307 +error(0.002026211267946444097) D280 D311 ^ D306 D307 +error(0.0009157719035976701148) D280 D312 +error(0.0001672286054041389081) D280 D312 ^ D283 D284 +error(0.0005353541060028568126) D280 D312 ^ D283 D306 +error(0.001349693943062659982) D280 D312 ^ D283 D307 +error(0.0001999317661850497118) D280 D312 ^ D284 D307 +error(0.0005670826236588418032) D280 D312 ^ D306 D307 +error(0.01000000000000000021) D281 +error(0.02725063153630395349) D281 D288 +error(0.02389252453306664817) D281 D288 ^ D283 D284 +error(0.03329807480613649479) D281 D305 +error(0.002054421110880488236) D281 D305 ^ D307 D308 +error(0.005139440185035600017) D281 D312 +error(0.002101194335119418565) D281 D312 ^ D283 D284 +error(0.0008922567876475901794) D281 D312 ^ D283 D307 +error(0.002032431206016870138) D281 D312 ^ D284 D307 +error(0.0005572318529482796516) D281 D312 ^ D284 D308 +error(0.002750366226549339366) D281 D312 ^ D307 D308 +error(0.001460790359938684765) D281 D313 +error(0.0004147934522296172497) D281 D313 ^ D284 D307 +error(0.001498989588066860232) D281 D313 ^ D284 D308 +error(0.007007209720512256115) D282 D283 +error(0.0004546663148800625083) D282 D283 ^ D286 D287 +error(0.0001425002969150308049) D282 D283 ^ D286 D311 +error(0.0005696660143250861785) D282 D283 ^ D287 D288 +error(0.003116901364237378153) D282 D283 ^ D287 D311 +error(0.01566705597438649775) D282 D291 +error(0.01186724049158091772) D282 D291 ^ D286 D287 +error(0.03336402185735180131) D282 D306 +error(0.00244917592564833364) D282 D306 ^ D310 D311 +error(0.002462421301947203146) D282 D314 +error(0.001960634436970778299) D282 D314 ^ D286 D310 +error(3.566087944092823308e-06) D282 D314 ^ D286 D311 +error(0.0001637216941453993634) D282 D314 ^ D310 D311 +error(0.004695941015552158003) D282 D315 +error(0.00205837118508770409) D282 D315 ^ D286 D287 +error(0.002163953410575679935) D282 D315 ^ D286 D310 +error(0.001554394982217835453) D282 D315 ^ D286 D311 +error(0.0008879695541101345754) D282 D315 ^ D287 D311 +error(0.002096192257208842526) D282 D315 ^ D310 D311 +error(0.01000000000000000021) D282 L0 +error(0.004381884530454759931) D286 D310 ^ D282 L0 +error(0.008692175163913264807) D283 D284 +error(0.0006905029968304733732) D283 D284 ^ D257 +error(0.00015945046755517543) D283 D284 ^ D281 +error(0.001006504109593458303) D283 D284 ^ D287 D288 +error(0.0008131714298475562147) D283 D284 ^ D287 D312 +error(0.0001651771561405014556) D283 D284 ^ D288 D289 +error(0.001649440750181971295) D283 D284 ^ D288 D312 +error(0.01789251364993136792) D283 D292 +error(0.01500802532656671066) D283 D292 ^ D287 D288 +error(0.003194379691095217307) D283 D306 +error(0.000203690984695900824) D283 D306 ^ D311 D312 +error(0.04189958697952669148) D283 D307 +error(0.002152911101466412069) D283 D307 ^ D311 D312 +error(0.00127605215256659083) D283 D315 +error(0.0001706398503003628525) D283 D315 ^ D286 D287 +error(0.0005783336597214276545) D283 D315 ^ D286 D311 +error(0.002016020127898890141) D283 D315 ^ D287 D311 +error(0.0001968335352046341011) D283 D315 ^ D287 D312 +error(0.0001375362953422371091) D283 D315 ^ D311 D312 +error(0.0009834825476811148021) D283 D316 +error(0.00207981557623123552) D283 D316 ^ D287 D288 +error(0.001841441603780133614) D283 D316 ^ D287 D311 +error(0.002505923860524120889) D283 D316 ^ D287 D312 +error(0.001419084695213386135) D283 D316 ^ D288 D312 +error(0.002852296504457221913) D283 D316 ^ D311 D312 +error(0.009019350943902253864) D284 D285 +error(0.0001633354758280312132) D284 D285 ^ D281 +error(0.0005572855800292770244) D284 D285 ^ D288 D289 +error(0.000553630490138258915) D284 D285 ^ D288 D313 +error(0.01251672150946384239) D284 D285 ^ D289 +error(0.005790639639282292236) D284 D285 ^ D289 D313 +error(0.001145685949262297476) D284 D285 ^ D313 +error(0.0003259075124975205589) D284 D285 ^ D313 ^ D281 +error(0.01461905296180973472) D284 D293 +error(0.01098538498491322471) D284 D293 ^ D288 D289 +error(0.003447214799424203578) D284 D307 +error(0.0003666576516136855319) D284 D307 ^ D312 D313 +error(0.02223358031578045318) D284 D308 +error(0.005543803677485251852) D284 D308 ^ D281 +error(0.002210910752504785439) D284 D308 ^ D312 D313 +error(0.001379541549716805683) D284 D308 ^ D313 +error(0.002924885832784762055) D284 D316 +error(0.001574022131985900515) D284 D316 ^ D288 D312 +error(0.0003547034745176052173) D284 D316 ^ D288 D313 +error(0.0002399940007932416046) D284 D316 ^ D312 D313 +error(0.002619265017415267974) D284 D317 +error(0.00158241141465816147) D284 D317 ^ D288 D289 +error(0.0004730953369301131323) D284 D317 ^ D288 D312 +error(0.002269905077607368895) D284 D317 ^ D288 D313 +error(0.0006264493750148219901) D284 D317 ^ D289 D313 +error(0.001918993207104307793) D284 D317 ^ D312 D313 +error(0.01377675457637685119) D285 +error(0.002469986989841304811) D285 D308 +error(8.555696620424324658e-05) D285 D308 ^ D281 +error(0.002594304494337347066) D285 D308 ^ D313 +error(0.0001376299769938429572) D285 D308 ^ D313 ^ D281 +error(0.03458993767437905376) D285 D309 +error(0.00595402342578680091) D285 D309 ^ D313 +error(0.00245631142944030675) D285 D317 +error(0.0003152919029694442122) D285 D317 ^ D288 D289 +error(0.0001612541715673219793) D285 D317 ^ D288 D313 +error(0.002267685579689308461) D285 D317 ^ D289 D313 +error(0.02509039495427965033) D285 ^ D289 +error(0.002041494666156196645) D285 ^ D313 ^ D289 +error(0.01000000000000000021) D286 +error(0.01187707629310352439) D286 D287 +error(0.001215264942972966392) D286 D287 ^ D290 D291 +error(0.0005861090175784376428) D286 D287 ^ D291 D292 +error(0.001982134764997857141) D286 D287 ^ D291 D315 +error(0.000425289327455776172) D286 D287 ^ D292 D315 +error(0.05297676665932575524) D286 D310 +error(0.003462771653202506312) D286 D310 ^ D314 D315 +error(0.00322690889612168132) D286 D311 +error(0.000497833939171843853) D286 D311 ^ D314 D315 +error(0.002260264554825750123) D286 D318 +error(0.0003473527278594572667) D286 D318 ^ D291 D292 +error(0.0008431892706171371455) D286 D318 ^ D291 D315 +error(0.0003892606543198490589) D286 D318 ^ D292 D315 +error(0.01190612723083741761) D286 ^ D290 L0 +error(0.004358707189286150849) D290 D314 ^ D286 +error(0.01780468578502405336) D287 D288 +error(0.0004696046272799186939) D287 D288 ^ D291 D292 +error(0.0008851561914086082629) D287 D288 ^ D292 D293 +error(0.001718406529616470267) D287 D288 ^ D292 D316 +error(0.0003621508437235534191) D287 D288 ^ D293 D316 +error(0.02155444020316826109) D287 D294 +error(0.02009756387803195501) D287 D294 ^ D291 D292 +error(0.02960309792484100769) D287 D311 +error(0.002696425463454497993) D287 D311 ^ D315 D316 +error(0.004542445374810293035) D287 D312 +error(0.0004787390755988302541) D287 D312 ^ D315 D316 +error(0.005783598058333213297) D287 D318 +error(0.006313383773074134758) D287 D318 ^ D291 D292 +error(0.001741030225433118535) D287 D318 ^ D291 D315 +error(0.007616179929498220411) D287 D318 ^ D292 D315 +error(0.002095215870669062119) D287 D318 ^ D292 D316 +error(0.003866228108010479232) D287 D318 ^ D315 D316 +error(0.001007778755732767137) D287 D319 +error(0.000791992306397491623) D287 D319 ^ D292 D293 +error(0.000442838744421881808) D287 D319 ^ D292 D315 +error(0.0011264348417513437) D287 D319 ^ D292 D316 +error(0.0007294911408703053015) D287 D319 ^ D293 D316 +error(0.0006790628791750554817) D287 D319 ^ D315 D316 +error(0.007519668875887872833) D288 D289 +error(0.000367564866391688718) D288 D289 ^ D292 D293 +error(4.196227388522683093e-05) D288 D289 ^ D293 +error(0.001830493767202687975) D288 D289 ^ D293 D317 +error(2.861025836566403991e-05) D288 D289 ^ D317 +error(0.0150479596563341516) D288 D295 +error(0.01110180417699024001) D288 D295 ^ D292 D293 +error(0.02213619326971636922) D288 D312 +error(0.002579554369470707462) D288 D312 ^ D316 D317 +error(0.003236307905156624899) D288 D313 +error(0.0005079835293430067563) D288 D313 ^ D316 D317 +error(0.001390683905584838868) D288 D319 +error(0.002396077516820634395) D288 D319 ^ D292 D293 +error(0.001515604606709302846) D288 D319 ^ D292 D316 +error(0.002611050841900463149) D288 D319 ^ D293 D316 +error(0.001030212141032500316) D288 D319 ^ D293 D317 +error(0.003086746265355783374) D288 D319 ^ D316 D317 +error(0.001205642639412828282) D288 D320 +error(5.413361691145458354e-05) D288 D320 ^ D293 +error(0.0006132114541846075744) D288 D320 ^ D293 D316 +error(0.001417719826750507691) D288 D320 ^ D293 D317 +error(0.0005980895653587027776) D288 D320 ^ D316 D317 +error(0.01000000000000000021) D289 +error(0.01636000547734253047) D289 D296 +error(0.01796233722540469674) D289 D296 ^ D293 +error(0.02381232961817726645) D289 D313 +error(0.002637023807817020799) D289 D313 ^ D317 +error(0.003450945788882907317) D289 D320 +error(0.002599654021808480656) D289 D320 ^ D293 +error(0.004061933355944112936) D289 D320 ^ D317 +error(0.0009592071290398953122) D289 D320 ^ D317 ^ D293 +error(0.01363803936237644246) D290 D291 +error(0.003930263821803167863) D290 D291 ^ D262 +error(0.01802560496900905418) D290 D291 ^ D286 +error(8.589436615621441292e-05) D290 D291 ^ D294 ^ D262 +error(0.02525902938098234171) D290 D314 +error(0.00574306903657622117) D290 L0 +error(0.0009470563290373274889) D290 L0 ^ D258 L0 ^ D262 +error(0.0008800554094711328119) D290 L0 ^ D258 L0 ^ D286 +error(0.001457843699669428847) D290 L0 ^ D286 ^ D262 +error(0.01450534184220186006) D291 D292 +error(0.0005721110364468817927) D291 D292 ^ D294 D295 +error(0.004601701592776456101) D291 D292 ^ D294 D318 +error(0.01329762689544615982) D291 D297 +error(0.01235795010597530268) D291 D297 ^ D294 +error(0.004365491728138845215) D291 D314 +error(0.002695027976132394112) D291 D314 ^ D286 +error(0.0003027628658435273408) D291 D314 ^ D318 ^ D286 +error(0.02723315102725440418) D291 D315 +error(0.00140205973473897039) D291 D315 ^ D286 +error(0.005203451391324077739) D291 D315 ^ D318 +error(0.00255544150013453002) D291 D321 +error(0.001808009258848390166) D291 D321 ^ D294 +error(0.002707021320884218929) D291 D321 ^ D318 +error(0.0006088424000031264971) D291 D321 ^ D318 ^ D294 +error(0.006472003059864666653) D292 D293 +error(0.0003994528074094950672) D292 D293 ^ D294 D295 +error(0.0004434226054838874857) D292 D293 ^ D294 D319 +error(0.0008751552090033030192) D292 D293 ^ D295 D296 +error(0.003045602539330864375) D292 D293 ^ D295 D319 +error(0.01325582626527719958) D292 D298 +error(0.01125502755749200473) D292 D298 ^ D294 D295 +error(0.007525476540747918358) D292 D315 +error(0.0006137602329925614204) D292 D315 ^ D318 D319 +error(0.02902365595154616021) D292 D316 +error(0.002401197642609727463) D292 D316 ^ D318 D319 +error(0.002408909711435769981) D292 D321 +error(0.0002707484224426097191) D292 D321 ^ D294 +error(0.001527963667674685309) D292 D321 ^ D294 D318 +error(0.0001105290094925922439) D292 D321 ^ D294 D319 +error(0.0005441160428730808241) D292 D321 ^ D318 +error(0.000356573641289079893) D292 D321 ^ D318 D319 +error(0.003107337702078268298) D292 D322 +error(0.00148514416775588306) D292 D322 ^ D294 D295 +error(0.0009343659549481646417) D292 D322 ^ D294 D318 +error(0.001133507027766949074) D292 D322 ^ D294 D319 +error(0.000964158168953031477) D292 D322 ^ D295 D319 +error(0.001858972200881762581) D292 D322 ^ D318 D319 +error(0.01000000000000000021) D293 +error(0.004493550144293693982) D293 D316 +error(0.0004616573460695907647) D293 D316 ^ D319 D320 +error(0.02153375451966943119) D293 D317 +error(0.001571041344134688862) D293 D317 ^ D319 D320 +error(0.001727413411201550366) D293 D322 +error(6.892623931214466931e-05) D293 D322 ^ D294 D295 +error(0.000533806835748320543) D293 D322 ^ D294 D319 +error(0.001001657939292958282) D293 D322 ^ D295 D319 +error(0.0006587014447459603635) D293 ^ D261 ^ D265 +error(0.0009512945064856004112) D293 ^ D261 ^ D289 +error(0.0004374836472664517121) D293 ^ D265 +error(0.01000000000000000021) D294 +error(0.006089189670584919251) D294 D295 +error(0.0003733339846648112744) D294 D295 ^ D297 D298 +error(0.002491417993463262287) D294 D295 ^ D298 D322 +error(0.0005065788208640180758) D294 D295 ^ D322 +error(0.0367379142487225252) D294 D318 +error(0.004448757689050466223) D294 D318 ^ D321 D322 +error(0.003134023997971539712) D294 D319 +error(0.0003650194631049960385) D294 D319 ^ D321 D322 +error(0.001406953404968496737) D294 D323 +error(0.000258713445676149944) D294 D323 ^ D298 +error(0.001311719158548649289) D294 D323 ^ D298 D322 +error(0.01016476222491488092) D295 D296 +error(0.002108544545389898564) D295 D296 ^ D269 +error(0.01205056218453301811) D295 D296 ^ D293 +error(8.106206907232670631e-05) D295 D296 ^ D298 +error(0.0003126805541716948288) D295 D296 ^ D298 ^ D269 +error(0.01810275288528837012) D295 D299 +error(0.01637617210264374554) D295 D299 ^ D298 +error(0.02102885356741089617) D295 D319 +error(0.001690237581495826133) D295 D319 ^ D293 +error(0.00359606707161589734) D295 D319 ^ D322 +error(0.003107887681254754581) D295 D320 +error(0.003382303353831740949) D295 D320 ^ D293 +error(0.0001913183606313894702) D295 D320 ^ D322 +error(0.0002941212067804130489) D295 D320 ^ D322 ^ D293 +error(0.003693046244270884078) D295 D323 +error(0.003186564243865780671) D295 D323 ^ D298 +error(0.004755038122238004067) D295 D323 ^ D322 +error(0.001954054770515154492) D295 D323 ^ D322 ^ D298 +error(0.02640784577619364679) D296 D320 +error(0.00290739257373180118) D296 D320 ^ D293 +error(0.006564866789739933102) D297 D298 +error(0.001832679987383818189) D297 D298 ^ D270 +error(0.01288524193192810627) D297 D298 ^ D294 +error(0.0006173749993255437177) D297 D298 ^ D299 +error(0.0004559863367010421231) D297 D298 ^ D299 ^ D270 +error(0.03275880248144626833) D297 D321 +error(0.00429567725900462799) D297 D321 ^ D294 +error(0.01072741549435932314) D298 +error(0.002509590526077771534) D298 D321 +error(0.003096878840847453254) D298 D321 ^ D294 +error(0.0004658229008440930739) D298 D321 ^ D323 +error(0.0006984840680404692847) D298 D321 ^ D323 ^ D294 +error(0.02371714611383288207) D298 D322 +error(0.001691210042327366938) D298 D322 ^ D294 +error(0.002968485154357761256) D298 D322 ^ D323 +error(0.01188288263817612218) D298 ^ D299 +error(0.001107203287059167415) D298 ^ D323 +error(0.004560533548355043092) D299 D323 ^ D298 +error(0.005000000000000000104) D299 +error(0.01983080680743972563) D299 D323 +error(0.005000000000000000104) D300 +error(0.01768647969650154195) D300 D304 +error(0.01997660103599073478) D300 D304 ^ D301 L0 +error(0.0272133096145726304) D300 D324 +error(0.009354172066671974373) D300 D324 ^ D325 L0 +error(0.006575429550073013871) D300 D328 +error(0.006606814816559495283) D300 D328 ^ D301 L0 +error(0.00570203587243049443) D300 D328 ^ D325 L0 +error(0.004394467297965208054) D300 D328 ^ D325 L0 ^ D301 L0 +error(0.003141484544212969771) D300 D329 +error(0.002866645116274591214) D300 D329 ^ D301 D325 +error(0.0007467639087963555584) D300 D329 ^ D301 L0 +error(0.00100340881217143808) D300 D329 ^ D325 L0 +error(0.005000000000000000104) D300 ^ D301 L0 +error(0.006716177406890511993) D301 D325 ^ D300 +error(0.006831737513122857625) D301 D302 +error(0.000925383923960359611) D301 D302 ^ D300 +error(0.0002795442616193875634) D301 D302 ^ D304 D305 +error(0.0005690671345596917631) D301 D302 ^ D304 D329 +error(0.01632363663664802497) D301 D302 ^ D305 +error(0.004686760244772980415) D301 D302 ^ D305 D329 +error(0.003622701663117294888) D301 D302 ^ D329 +error(0.0006213698150018824758) D301 D302 ^ D329 ^ D300 +error(0.02092676657561087783) D301 D307 +error(0.0132551803359697469) D301 D307 ^ D304 D305 +error(0.05139236901086036841) D301 D325 +error(0.003561108508096676607) D301 D325 ^ D328 D329 +error(0.0046639615040387555) D301 D325 ^ D329 +error(0.004108367013198443128) D301 D330 +error(0.001863368595620282274) D301 D330 ^ D304 D328 +error(0.0002077739562874012804) D301 D330 ^ D304 D329 +error(0.0001534208996732992975) D301 D330 ^ D328 D329 +error(0.002474351314484049547) D301 D331 +error(0.001842181383880251615) D301 D331 ^ D304 D305 +error(0.0007357888818581343913) D301 D331 ^ D304 D328 +error(0.002176810431023448646) D301 D331 ^ D304 D329 +error(0.0009865289460392872439) D301 D331 ^ D305 D329 +error(0.002351214005477396222) D301 D331 ^ D328 D329 +error(0.01000000000000000021) D301 L0 +error(0.01700103788466153509) D302 D308 +error(0.01657742774919643974) D302 D308 ^ D305 +error(0.005959798576863498468) D302 D325 +error(0.000405679075595877963) D302 D325 ^ D300 +error(0.006365081479756801858) D302 D325 ^ D329 +error(0.0006185446772456166349) D302 D325 ^ D329 ^ D300 +error(0.02877376894243781) D302 D326 +error(0.01462010353799540405) D302 D326 ^ D329 +error(0.00255626787296149658) D302 D331 +error(0.0003462302675103233517) D302 D331 ^ D304 D305 +error(0.0006259573259455081164) D302 D331 ^ D304 D329 +error(0.001780026776757265587) D302 D331 ^ D305 D329 +error(0.0007765183634651079674) D302 D331 ^ D329 +error(0.004204068823748800116) D302 D332 +error(0.004448751937011490021) D302 D332 ^ D305 +error(0.002493712434291736613) D302 D332 ^ D329 +error(0.002122847769795885211) D302 D332 ^ D329 ^ D305 +error(0.008073481635886498378) D303 D304 +error(0.0005730018563843651807) D303 D304 ^ D301 L0 +error(0.0004628308648474659527) D303 D304 ^ D306 D307 +error(0.002505525127704565005) D303 D304 ^ D306 D330 +error(0.009108311699216133789) D303 D304 ^ D306 L0 +error(0.0001464483877319481696) D303 D304 ^ D307 D330 +error(0.001791079838534594517) D303 D304 ^ D330 L0 +error(0.000306018137642829612) D303 D304 ^ D330 L0 ^ D301 L0 +error(0.01557841355567917037) D303 D310 +error(0.01435979479825004283) D303 D310 ^ D306 L0 +error(0.02308764085533153432) D303 D327 +error(0.00431467884365783691) D303 D327 ^ D330 L0 +error(0.001931307837553560523) D303 D328 +error(0.0008665267816730684537) D303 D328 ^ D301 L0 +error(0.002496274199622507042) D303 D328 ^ D330 L0 +error(0.0003964385681257144838) D303 D328 ^ D330 L0 ^ D301 L0 +error(0.003466727401050739669) D303 D334 +error(0.004164332635934311043) D303 D334 ^ D306 L0 +error(0.002681973973769409981) D303 D334 ^ D330 L0 +error(0.001643190028824071487) D303 D334 ^ D330 L0 ^ D306 L0 +error(0.002347213007440165141) D303 D335 +error(1.438422088529517882e-05) D303 D335 ^ D306 D307 +error(0.001602485993920255191) D303 D335 ^ D306 D330 +error(0.0003906309354926121866) D303 D335 ^ D306 L0 +error(0.0002462750543915511142) D303 D335 ^ D307 D330 +error(0.0003195674037454942704) D303 D335 ^ D330 L0 +error(0.009374789236906273804) D304 D305 +error(0.0005590529469528864254) D304 D305 ^ D277 L0 +error(0.0001530608469217417504) D304 D305 ^ D301 L0 +error(0.0008647203357822550026) D304 D305 ^ D306 D307 +error(0.000648659578791030509) D304 D305 ^ D307 D308 +error(0.00193254128555270981) D304 D305 ^ D307 D331 +error(6.236263047404961928e-05) D304 D305 ^ D308 D331 +error(0.01492810779744833949) D304 D311 +error(0.01018712175352179221) D304 D311 ^ D306 D307 +error(0.02897098431077184053) D304 D328 +error(0.009580229984338856086) D304 D328 ^ D301 L0 +error(0.003392722770150778579) D304 D328 ^ D330 D331 +error(0.0009747224564062936412) D304 D328 ^ D330 L0 +error(0.002252326138938211871) D304 D329 +error(0.0005634108258186226606) D304 D329 ^ D330 D331 +error(0.002115175773512700461) D304 D335 +error(0.0030608781621897568) D304 D335 ^ D306 D307 +error(0.001270789941476938327) D304 D335 ^ D306 D330 +error(0.001939096001487852121) D304 D335 ^ D307 D330 +error(0.001187976190653792109) D304 D335 ^ D307 D331 +error(0.002026211267946444097) D304 D335 ^ D330 D331 +error(0.0009157719035976701148) D304 D336 +error(0.0001672286054041389081) D304 D336 ^ D307 D308 +error(0.0005353541060028568126) D304 D336 ^ D307 D330 +error(0.001349693943062659982) D304 D336 ^ D307 D331 +error(0.0001999317661850497118) D304 D336 ^ D308 D331 +error(0.0005670826236588418032) D304 D336 ^ D330 D331 +error(0.01000000000000000021) D305 +error(0.02725063153630395349) D305 D312 +error(0.02389252453306664817) D305 D312 ^ D307 D308 +error(0.03329807480613649479) D305 D329 +error(0.002054421110880488236) D305 D329 ^ D331 D332 +error(0.005139440185035600017) D305 D336 +error(0.002101194335119418565) D305 D336 ^ D307 D308 +error(0.0008922567876475901794) D305 D336 ^ D307 D331 +error(0.002032431206016870138) D305 D336 ^ D308 D331 +error(0.0005572318529482796516) D305 D336 ^ D308 D332 +error(0.002750366226549339366) D305 D336 ^ D331 D332 +error(0.001460790359938684765) D305 D337 +error(0.0004147934522296172497) D305 D337 ^ D308 D331 +error(0.001498989588066860232) D305 D337 ^ D308 D332 +error(0.007007209720512256115) D306 D307 +error(0.0004546663148800625083) D306 D307 ^ D310 D311 +error(0.0001425002969150308049) D306 D307 ^ D310 D335 +error(0.0005696660143250861785) D306 D307 ^ D311 D312 +error(0.003116901364237378153) D306 D307 ^ D311 D335 +error(0.01566705597438649775) D306 D315 +error(0.01186724049158091772) D306 D315 ^ D310 D311 +error(0.03336402185735180131) D306 D330 +error(0.00244917592564833364) D306 D330 ^ D334 D335 +error(0.002462421301947203146) D306 D338 +error(0.001960634436970778299) D306 D338 ^ D310 D334 +error(3.566087944092823308e-06) D306 D338 ^ D310 D335 +error(0.0001637216941453993634) D306 D338 ^ D334 D335 +error(0.004695941015552158003) D306 D339 +error(0.00205837118508770409) D306 D339 ^ D310 D311 +error(0.002163953410575679935) D306 D339 ^ D310 D334 +error(0.001554394982217835453) D306 D339 ^ D310 D335 +error(0.0008879695541101345754) D306 D339 ^ D311 D335 +error(0.002096192257208842526) D306 D339 ^ D334 D335 +error(0.01000000000000000021) D306 L0 +error(0.004381884530454759931) D310 D334 ^ D306 L0 +error(0.008692175163913264807) D307 D308 +error(0.0006905029968304733732) D307 D308 ^ D281 +error(0.00015945046755517543) D307 D308 ^ D305 +error(0.001006504109593458303) D307 D308 ^ D311 D312 +error(0.0008131714298475562147) D307 D308 ^ D311 D336 +error(0.0001651771561405014556) D307 D308 ^ D312 D313 +error(0.001649440750181971295) D307 D308 ^ D312 D336 +error(0.01789251364993136792) D307 D316 +error(0.01500802532656671066) D307 D316 ^ D311 D312 +error(0.003194379691095217307) D307 D330 +error(0.000203690984695900824) D307 D330 ^ D335 D336 +error(0.04189958697952669148) D307 D331 +error(0.002152911101466412069) D307 D331 ^ D335 D336 +error(0.00127605215256659083) D307 D339 +error(0.0001706398503003628525) D307 D339 ^ D310 D311 +error(0.0005783336597214276545) D307 D339 ^ D310 D335 +error(0.002016020127898890141) D307 D339 ^ D311 D335 +error(0.0001968335352046341011) D307 D339 ^ D311 D336 +error(0.0001375362953422371091) D307 D339 ^ D335 D336 +error(0.0009834825476811148021) D307 D340 +error(0.00207981557623123552) D307 D340 ^ D311 D312 +error(0.001841441603780133614) D307 D340 ^ D311 D335 +error(0.002505923860524120889) D307 D340 ^ D311 D336 +error(0.001419084695213386135) D307 D340 ^ D312 D336 +error(0.002852296504457221913) D307 D340 ^ D335 D336 +error(0.009019350943902253864) D308 D309 +error(0.0001633354758280312132) D308 D309 ^ D305 +error(0.0005572855800292770244) D308 D309 ^ D312 D313 +error(0.000553630490138258915) D308 D309 ^ D312 D337 +error(0.01251672150946384239) D308 D309 ^ D313 +error(0.005790639639282292236) D308 D309 ^ D313 D337 +error(0.001145685949262297476) D308 D309 ^ D337 +error(0.0003259075124975205589) D308 D309 ^ D337 ^ D305 +error(0.01461905296180973472) D308 D317 +error(0.01098538498491322471) D308 D317 ^ D312 D313 +error(0.003447214799424203578) D308 D331 +error(0.0003666576516136855319) D308 D331 ^ D336 D337 +error(0.02223358031578045318) D308 D332 +error(0.005543803677485251852) D308 D332 ^ D305 +error(0.002210910752504785439) D308 D332 ^ D336 D337 +error(0.001379541549716805683) D308 D332 ^ D337 +error(0.002924885832784762055) D308 D340 +error(0.001574022131985900515) D308 D340 ^ D312 D336 +error(0.0003547034745176052173) D308 D340 ^ D312 D337 +error(0.0002399940007932416046) D308 D340 ^ D336 D337 +error(0.002619265017415267974) D308 D341 +error(0.00158241141465816147) D308 D341 ^ D312 D313 +error(0.0004730953369301131323) D308 D341 ^ D312 D336 +error(0.002269905077607368895) D308 D341 ^ D312 D337 +error(0.0006264493750148219901) D308 D341 ^ D313 D337 +error(0.001918993207104307793) D308 D341 ^ D336 D337 +error(0.01377675457637685119) D309 +error(0.002469986989841304811) D309 D332 +error(8.555696620424324658e-05) D309 D332 ^ D305 +error(0.002594304494337347066) D309 D332 ^ D337 +error(0.0001376299769938429572) D309 D332 ^ D337 ^ D305 +error(0.03458993767437905376) D309 D333 +error(0.00595402342578680091) D309 D333 ^ D337 +error(0.00245631142944030675) D309 D341 +error(0.0003152919029694442122) D309 D341 ^ D312 D313 +error(0.0001612541715673219793) D309 D341 ^ D312 D337 +error(0.002267685579689308461) D309 D341 ^ D313 D337 +error(0.02509039495427965033) D309 ^ D313 +error(0.002041494666156196645) D309 ^ D337 ^ D313 +error(0.01000000000000000021) D310 +error(0.01187707629310352439) D310 D311 +error(0.001215264942972966392) D310 D311 ^ D314 D315 +error(0.0005861090175784376428) D310 D311 ^ D315 D316 +error(0.001982134764997857141) D310 D311 ^ D315 D339 +error(0.000425289327455776172) D310 D311 ^ D316 D339 +error(0.05297676665932575524) D310 D334 +error(0.003462771653202506312) D310 D334 ^ D338 D339 +error(0.00322690889612168132) D310 D335 +error(0.000497833939171843853) D310 D335 ^ D338 D339 +error(0.002260264554825750123) D310 D342 +error(0.0003473527278594572667) D310 D342 ^ D315 D316 +error(0.0008431892706171371455) D310 D342 ^ D315 D339 +error(0.0003892606543198490589) D310 D342 ^ D316 D339 +error(0.01190612723083741761) D310 ^ D314 L0 +error(0.004358707189286150849) D314 D338 ^ D310 +error(0.01780468578502405336) D311 D312 +error(0.0004696046272799186939) D311 D312 ^ D315 D316 +error(0.0008851561914086082629) D311 D312 ^ D316 D317 +error(0.001718406529616470267) D311 D312 ^ D316 D340 +error(0.0003621508437235534191) D311 D312 ^ D317 D340 +error(0.02155444020316826109) D311 D318 +error(0.02009756387803195501) D311 D318 ^ D315 D316 +error(0.02960309792484100769) D311 D335 +error(0.002696425463454497993) D311 D335 ^ D339 D340 +error(0.004542445374810293035) D311 D336 +error(0.0004787390755988302541) D311 D336 ^ D339 D340 +error(0.005783598058333213297) D311 D342 +error(0.006313383773074134758) D311 D342 ^ D315 D316 +error(0.001741030225433118535) D311 D342 ^ D315 D339 +error(0.007616179929498220411) D311 D342 ^ D316 D339 +error(0.002095215870669062119) D311 D342 ^ D316 D340 +error(0.003866228108010479232) D311 D342 ^ D339 D340 +error(0.001007778755732767137) D311 D343 +error(0.000791992306397491623) D311 D343 ^ D316 D317 +error(0.000442838744421881808) D311 D343 ^ D316 D339 +error(0.0011264348417513437) D311 D343 ^ D316 D340 +error(0.0007294911408703053015) D311 D343 ^ D317 D340 +error(0.0006790628791750554817) D311 D343 ^ D339 D340 +error(0.007519668875887872833) D312 D313 +error(0.000367564866391688718) D312 D313 ^ D316 D317 +error(4.196227388522683093e-05) D312 D313 ^ D317 +error(0.001830493767202687975) D312 D313 ^ D317 D341 +error(2.861025836566403991e-05) D312 D313 ^ D341 +error(0.0150479596563341516) D312 D319 +error(0.01110180417699024001) D312 D319 ^ D316 D317 +error(0.02213619326971636922) D312 D336 +error(0.002579554369470707462) D312 D336 ^ D340 D341 +error(0.003236307905156624899) D312 D337 +error(0.0005079835293430067563) D312 D337 ^ D340 D341 +error(0.001390683905584838868) D312 D343 +error(0.002396077516820634395) D312 D343 ^ D316 D317 +error(0.001515604606709302846) D312 D343 ^ D316 D340 +error(0.002611050841900463149) D312 D343 ^ D317 D340 +error(0.001030212141032500316) D312 D343 ^ D317 D341 +error(0.003086746265355783374) D312 D343 ^ D340 D341 +error(0.001205642639412828282) D312 D344 +error(5.413361691145458354e-05) D312 D344 ^ D317 +error(0.0006132114541846075744) D312 D344 ^ D317 D340 +error(0.001417719826750507691) D312 D344 ^ D317 D341 +error(0.0005980895653587027776) D312 D344 ^ D340 D341 +error(0.01000000000000000021) D313 +error(0.01636000547734253047) D313 D320 +error(0.01796233722540469674) D313 D320 ^ D317 +error(0.02381232961817726645) D313 D337 +error(0.002637023807817020799) D313 D337 ^ D341 +error(0.003450945788882907317) D313 D344 +error(0.002599654021808480656) D313 D344 ^ D317 +error(0.004061933355944112936) D313 D344 ^ D341 +error(0.0009592071290398953122) D313 D344 ^ D341 ^ D317 +error(0.01363803936237644246) D314 D315 +error(0.003930263821803167863) D314 D315 ^ D286 +error(0.01802560496900905418) D314 D315 ^ D310 +error(8.589436615621441292e-05) D314 D315 ^ D318 ^ D286 +error(0.02525902938098234171) D314 D338 +error(0.00574306903657622117) D314 L0 +error(0.0009470563290373274889) D314 L0 ^ D282 L0 ^ D286 +error(0.0008800554094711328119) D314 L0 ^ D282 L0 ^ D310 +error(0.001457843699669428847) D314 L0 ^ D310 ^ D286 +error(0.01450534184220186006) D315 D316 +error(0.0005721110364468817927) D315 D316 ^ D318 D319 +error(0.004601701592776456101) D315 D316 ^ D318 D342 +error(0.01329762689544615982) D315 D321 +error(0.01235795010597530268) D315 D321 ^ D318 +error(0.004365491728138845215) D315 D338 +error(0.002695027976132394112) D315 D338 ^ D310 +error(0.0003027628658435273408) D315 D338 ^ D342 ^ D310 +error(0.02723315102725440418) D315 D339 +error(0.00140205973473897039) D315 D339 ^ D310 +error(0.005203451391324077739) D315 D339 ^ D342 +error(0.00255544150013453002) D315 D345 +error(0.001808009258848390166) D315 D345 ^ D318 +error(0.002707021320884218929) D315 D345 ^ D342 +error(0.0006088424000031264971) D315 D345 ^ D342 ^ D318 +error(0.006472003059864666653) D316 D317 +error(0.0003994528074094950672) D316 D317 ^ D318 D319 +error(0.0004434226054838874857) D316 D317 ^ D318 D343 +error(0.0008751552090033030192) D316 D317 ^ D319 D320 +error(0.003045602539330864375) D316 D317 ^ D319 D343 +error(0.01325582626527719958) D316 D322 +error(0.01125502755749200473) D316 D322 ^ D318 D319 +error(0.007525476540747918358) D316 D339 +error(0.0006137602329925614204) D316 D339 ^ D342 D343 +error(0.02902365595154616021) D316 D340 +error(0.002401197642609727463) D316 D340 ^ D342 D343 +error(0.002408909711435769981) D316 D345 +error(0.0002707484224426097191) D316 D345 ^ D318 +error(0.001527963667674685309) D316 D345 ^ D318 D342 +error(0.0001105290094925922439) D316 D345 ^ D318 D343 +error(0.0005441160428730808241) D316 D345 ^ D342 +error(0.000356573641289079893) D316 D345 ^ D342 D343 +error(0.003107337702078268298) D316 D346 +error(0.00148514416775588306) D316 D346 ^ D318 D319 +error(0.0009343659549481646417) D316 D346 ^ D318 D342 +error(0.001133507027766949074) D316 D346 ^ D318 D343 +error(0.000964158168953031477) D316 D346 ^ D319 D343 +error(0.001858972200881762581) D316 D346 ^ D342 D343 +error(0.01000000000000000021) D317 +error(0.004493550144293693982) D317 D340 +error(0.0004616573460695907647) D317 D340 ^ D343 D344 +error(0.02153375451966943119) D317 D341 +error(0.001571041344134688862) D317 D341 ^ D343 D344 +error(0.001727413411201550366) D317 D346 +error(6.892623931214466931e-05) D317 D346 ^ D318 D319 +error(0.000533806835748320543) D317 D346 ^ D318 D343 +error(0.001001657939292958282) D317 D346 ^ D319 D343 +error(0.0006587014447459603635) D317 ^ D285 ^ D289 +error(0.0009512945064856004112) D317 ^ D285 ^ D313 +error(0.0004374836472664517121) D317 ^ D289 +error(0.01000000000000000021) D318 +error(0.006089189670584919251) D318 D319 +error(0.0003733339846648112744) D318 D319 ^ D321 D322 +error(0.002491417993463262287) D318 D319 ^ D322 D346 +error(0.0005065788208640180758) D318 D319 ^ D346 +error(0.0367379142487225252) D318 D342 +error(0.004448757689050466223) D318 D342 ^ D345 D346 +error(0.003134023997971539712) D318 D343 +error(0.0003650194631049960385) D318 D343 ^ D345 D346 +error(0.001406953404968496737) D318 D347 +error(0.000258713445676149944) D318 D347 ^ D322 +error(0.001311719158548649289) D318 D347 ^ D322 D346 +error(0.01016476222491488092) D319 D320 +error(0.002108544545389898564) D319 D320 ^ D293 +error(0.01205056218453301811) D319 D320 ^ D317 +error(8.106206907232670631e-05) D319 D320 ^ D322 +error(0.0003126805541716948288) D319 D320 ^ D322 ^ D293 +error(0.01810275288528837012) D319 D323 +error(0.01637617210264374554) D319 D323 ^ D322 +error(0.02102885356741089617) D319 D343 +error(0.001690237581495826133) D319 D343 ^ D317 +error(0.00359606707161589734) D319 D343 ^ D346 +error(0.003107887681254754581) D319 D344 +error(0.003382303353831740949) D319 D344 ^ D317 +error(0.0001913183606313894702) D319 D344 ^ D346 +error(0.0002941212067804130489) D319 D344 ^ D346 ^ D317 +error(0.003693046244270884078) D319 D347 +error(0.003186564243865780671) D319 D347 ^ D322 +error(0.004755038122238004067) D319 D347 ^ D346 +error(0.001954054770515154492) D319 D347 ^ D346 ^ D322 +error(0.02640784577619364679) D320 D344 +error(0.00290739257373180118) D320 D344 ^ D317 +error(0.006564866789739933102) D321 D322 +error(0.001832679987383818189) D321 D322 ^ D294 +error(0.01288524193192810627) D321 D322 ^ D318 +error(0.0006173749993255437177) D321 D322 ^ D323 +error(0.0004559863367010421231) D321 D322 ^ D323 ^ D294 +error(0.03275880248144626833) D321 D345 +error(0.00429567725900462799) D321 D345 ^ D318 +error(0.01072741549435932314) D322 +error(0.002509590526077771534) D322 D345 +error(0.003096878840847453254) D322 D345 ^ D318 +error(0.0004658229008440930739) D322 D345 ^ D347 +error(0.0006984840680404692847) D322 D345 ^ D347 ^ D318 +error(0.02371714611383288207) D322 D346 +error(0.001691210042327366938) D322 D346 ^ D318 +error(0.002968485154357761256) D322 D346 ^ D347 +error(0.01188288263817612218) D322 ^ D323 +error(0.001107203287059167415) D322 ^ D347 +error(0.004560533548355043092) D323 D347 ^ D322 +error(0.005000000000000000104) D323 +error(0.01983080680743972563) D323 D347 +error(0.005000000000000000104) D324 +error(0.01768647969650154195) D324 D328 +error(0.01997660103599073478) D324 D328 ^ D325 L0 +error(0.0272133096145726304) D324 D348 +error(0.009354172066671974373) D324 D348 ^ D349 L0 +error(0.006575429550073013871) D324 D352 +error(0.006606814816559495283) D324 D352 ^ D325 L0 +error(0.00570203587243049443) D324 D352 ^ D349 L0 +error(0.004394467297965208054) D324 D352 ^ D349 L0 ^ D325 L0 +error(0.003141484544212969771) D324 D353 +error(0.002866645116274591214) D324 D353 ^ D325 D349 +error(0.0007467639087963555584) D324 D353 ^ D325 L0 +error(0.00100340881217143808) D324 D353 ^ D349 L0 +error(0.005000000000000000104) D324 ^ D325 L0 +error(0.006716177406890511993) D325 D349 ^ D324 +error(0.006831737513122857625) D325 D326 +error(0.000925383923960359611) D325 D326 ^ D324 +error(0.0002795442616193875634) D325 D326 ^ D328 D329 +error(0.0005690671345596917631) D325 D326 ^ D328 D353 +error(0.01632363663664802497) D325 D326 ^ D329 +error(0.004686760244772980415) D325 D326 ^ D329 D353 +error(0.003622701663117294888) D325 D326 ^ D353 +error(0.0006213698150018824758) D325 D326 ^ D353 ^ D324 +error(0.02092676657561087783) D325 D331 +error(0.0132551803359697469) D325 D331 ^ D328 D329 +error(0.05139236901086036841) D325 D349 +error(0.003561108508096676607) D325 D349 ^ D352 D353 +error(0.0046639615040387555) D325 D349 ^ D353 +error(0.004108367013198443128) D325 D354 +error(0.001863368595620282274) D325 D354 ^ D328 D352 +error(0.0002077739562874012804) D325 D354 ^ D328 D353 +error(0.0001534208996732992975) D325 D354 ^ D352 D353 +error(0.002474351314484049547) D325 D355 +error(0.001842181383880251615) D325 D355 ^ D328 D329 +error(0.0007357888818581343913) D325 D355 ^ D328 D352 +error(0.002176810431023448646) D325 D355 ^ D328 D353 +error(0.0009865289460392872439) D325 D355 ^ D329 D353 +error(0.002351214005477396222) D325 D355 ^ D352 D353 +error(0.01000000000000000021) D325 L0 +error(0.01700103788466153509) D326 D332 +error(0.01657742774919643974) D326 D332 ^ D329 +error(0.005959798576863498468) D326 D349 +error(0.000405679075595877963) D326 D349 ^ D324 +error(0.006365081479756801858) D326 D349 ^ D353 +error(0.0006185446772456166349) D326 D349 ^ D353 ^ D324 +error(0.02877376894243781) D326 D350 +error(0.01462010353799540405) D326 D350 ^ D353 +error(0.00255626787296149658) D326 D355 +error(0.0003462302675103233517) D326 D355 ^ D328 D329 +error(0.0006259573259455081164) D326 D355 ^ D328 D353 +error(0.001780026776757265587) D326 D355 ^ D329 D353 +error(0.0007765183634651079674) D326 D355 ^ D353 +error(0.004204068823748800116) D326 D356 +error(0.004448751937011490021) D326 D356 ^ D329 +error(0.002493712434291736613) D326 D356 ^ D353 +error(0.002122847769795885211) D326 D356 ^ D353 ^ D329 +error(0.008073481635886498378) D327 D328 +error(0.0005730018563843651807) D327 D328 ^ D325 L0 +error(0.0004628308648474659527) D327 D328 ^ D330 D331 +error(0.002505525127704565005) D327 D328 ^ D330 D354 +error(0.009108311699216133789) D327 D328 ^ D330 L0 +error(0.0001464483877319481696) D327 D328 ^ D331 D354 +error(0.001791079838534594517) D327 D328 ^ D354 L0 +error(0.000306018137642829612) D327 D328 ^ D354 L0 ^ D325 L0 +error(0.01557841355567917037) D327 D334 +error(0.01435979479825004283) D327 D334 ^ D330 L0 +error(0.02308764085533153432) D327 D351 +error(0.00431467884365783691) D327 D351 ^ D354 L0 +error(0.001931307837553560523) D327 D352 +error(0.0008665267816730684537) D327 D352 ^ D325 L0 +error(0.002496274199622507042) D327 D352 ^ D354 L0 +error(0.0003964385681257144838) D327 D352 ^ D354 L0 ^ D325 L0 +error(0.003466727401050739669) D327 D358 +error(0.004164332635934311043) D327 D358 ^ D330 L0 +error(0.002681973973769409981) D327 D358 ^ D354 L0 +error(0.001643190028824071487) D327 D358 ^ D354 L0 ^ D330 L0 +error(0.002347213007440165141) D327 D359 +error(1.438422088529517882e-05) D327 D359 ^ D330 D331 +error(0.001602485993920255191) D327 D359 ^ D330 D354 +error(0.0003906309354926121866) D327 D359 ^ D330 L0 +error(0.0002462750543915511142) D327 D359 ^ D331 D354 +error(0.0003195674037454942704) D327 D359 ^ D354 L0 +error(0.009374789236906273804) D328 D329 +error(0.0005590529469528864254) D328 D329 ^ D301 L0 +error(0.0001530608469217417504) D328 D329 ^ D325 L0 +error(0.0008647203357822550026) D328 D329 ^ D330 D331 +error(0.000648659578791030509) D328 D329 ^ D331 D332 +error(0.00193254128555270981) D328 D329 ^ D331 D355 +error(6.236263047404961928e-05) D328 D329 ^ D332 D355 +error(0.01492810779744833949) D328 D335 +error(0.01018712175352179221) D328 D335 ^ D330 D331 +error(0.02897098431077184053) D328 D352 +error(0.009580229984338856086) D328 D352 ^ D325 L0 +error(0.003392722770150778579) D328 D352 ^ D354 D355 +error(0.0009747224564062936412) D328 D352 ^ D354 L0 +error(0.002252326138938211871) D328 D353 +error(0.0005634108258186226606) D328 D353 ^ D354 D355 +error(0.002115175773512700461) D328 D359 +error(0.0030608781621897568) D328 D359 ^ D330 D331 +error(0.001270789941476938327) D328 D359 ^ D330 D354 +error(0.001939096001487852121) D328 D359 ^ D331 D354 +error(0.001187976190653792109) D328 D359 ^ D331 D355 +error(0.002026211267946444097) D328 D359 ^ D354 D355 +error(0.0009157719035976701148) D328 D360 +error(0.0001672286054041389081) D328 D360 ^ D331 D332 +error(0.0005353541060028568126) D328 D360 ^ D331 D354 +error(0.001349693943062659982) D328 D360 ^ D331 D355 +error(0.0001999317661850497118) D328 D360 ^ D332 D355 +error(0.0005670826236588418032) D328 D360 ^ D354 D355 +error(0.01000000000000000021) D329 +error(0.02725063153630395349) D329 D336 +error(0.02389252453306664817) D329 D336 ^ D331 D332 +error(0.03329807480613649479) D329 D353 +error(0.002054421110880488236) D329 D353 ^ D355 D356 +error(0.005139440185035600017) D329 D360 +error(0.002101194335119418565) D329 D360 ^ D331 D332 +error(0.0008922567876475901794) D329 D360 ^ D331 D355 +error(0.002032431206016870138) D329 D360 ^ D332 D355 +error(0.0005572318529482796516) D329 D360 ^ D332 D356 +error(0.002750366226549339366) D329 D360 ^ D355 D356 +error(0.001460790359938684765) D329 D361 +error(0.0004147934522296172497) D329 D361 ^ D332 D355 +error(0.001498989588066860232) D329 D361 ^ D332 D356 +error(0.007007209720512256115) D330 D331 +error(0.0004546663148800625083) D330 D331 ^ D334 D335 +error(0.0001425002969150308049) D330 D331 ^ D334 D359 +error(0.0005696660143250861785) D330 D331 ^ D335 D336 +error(0.003116901364237378153) D330 D331 ^ D335 D359 +error(0.01566705597438649775) D330 D339 +error(0.01186724049158091772) D330 D339 ^ D334 D335 +error(0.03336402185735180131) D330 D354 +error(0.00244917592564833364) D330 D354 ^ D358 D359 +error(0.002462421301947203146) D330 D362 +error(0.001960634436970778299) D330 D362 ^ D334 D358 +error(3.566087944092823308e-06) D330 D362 ^ D334 D359 +error(0.0001637216941453993634) D330 D362 ^ D358 D359 +error(0.004695941015552158003) D330 D363 +error(0.00205837118508770409) D330 D363 ^ D334 D335 +error(0.002163953410575679935) D330 D363 ^ D334 D358 +error(0.001554394982217835453) D330 D363 ^ D334 D359 +error(0.0008879695541101345754) D330 D363 ^ D335 D359 +error(0.002096192257208842526) D330 D363 ^ D358 D359 +error(0.01000000000000000021) D330 L0 +error(0.004381884530454759931) D334 D358 ^ D330 L0 +error(0.008692175163913264807) D331 D332 +error(0.0006905029968304733732) D331 D332 ^ D305 +error(0.00015945046755517543) D331 D332 ^ D329 +error(0.001006504109593458303) D331 D332 ^ D335 D336 +error(0.0008131714298475562147) D331 D332 ^ D335 D360 +error(0.0001651771561405014556) D331 D332 ^ D336 D337 +error(0.001649440750181971295) D331 D332 ^ D336 D360 +error(0.01789251364993136792) D331 D340 +error(0.01500802532656671066) D331 D340 ^ D335 D336 +error(0.003194379691095217307) D331 D354 +error(0.000203690984695900824) D331 D354 ^ D359 D360 +error(0.04189958697952669148) D331 D355 +error(0.002152911101466412069) D331 D355 ^ D359 D360 +error(0.00127605215256659083) D331 D363 +error(0.0001706398503003628525) D331 D363 ^ D334 D335 +error(0.0005783336597214276545) D331 D363 ^ D334 D359 +error(0.002016020127898890141) D331 D363 ^ D335 D359 +error(0.0001968335352046341011) D331 D363 ^ D335 D360 +error(0.0001375362953422371091) D331 D363 ^ D359 D360 +error(0.0009834825476811148021) D331 D364 +error(0.00207981557623123552) D331 D364 ^ D335 D336 +error(0.001841441603780133614) D331 D364 ^ D335 D359 +error(0.002505923860524120889) D331 D364 ^ D335 D360 +error(0.001419084695213386135) D331 D364 ^ D336 D360 +error(0.002852296504457221913) D331 D364 ^ D359 D360 +error(0.009019350943902253864) D332 D333 +error(0.0001633354758280312132) D332 D333 ^ D329 +error(0.0005572855800292770244) D332 D333 ^ D336 D337 +error(0.000553630490138258915) D332 D333 ^ D336 D361 +error(0.01251672150946384239) D332 D333 ^ D337 +error(0.005790639639282292236) D332 D333 ^ D337 D361 +error(0.001145685949262297476) D332 D333 ^ D361 +error(0.0003259075124975205589) D332 D333 ^ D361 ^ D329 +error(0.01461905296180973472) D332 D341 +error(0.01098538498491322471) D332 D341 ^ D336 D337 +error(0.003447214799424203578) D332 D355 +error(0.0003666576516136855319) D332 D355 ^ D360 D361 +error(0.02223358031578045318) D332 D356 +error(0.005543803677485251852) D332 D356 ^ D329 +error(0.002210910752504785439) D332 D356 ^ D360 D361 +error(0.001379541549716805683) D332 D356 ^ D361 +error(0.002924885832784762055) D332 D364 +error(0.001574022131985900515) D332 D364 ^ D336 D360 +error(0.0003547034745176052173) D332 D364 ^ D336 D361 +error(0.0002399940007932416046) D332 D364 ^ D360 D361 +error(0.002619265017415267974) D332 D365 +error(0.00158241141465816147) D332 D365 ^ D336 D337 +error(0.0004730953369301131323) D332 D365 ^ D336 D360 +error(0.002269905077607368895) D332 D365 ^ D336 D361 +error(0.0006264493750148219901) D332 D365 ^ D337 D361 +error(0.001918993207104307793) D332 D365 ^ D360 D361 +error(0.01377675457637685119) D333 +error(0.002469986989841304811) D333 D356 +error(8.555696620424324658e-05) D333 D356 ^ D329 +error(0.002594304494337347066) D333 D356 ^ D361 +error(0.0001376299769938429572) D333 D356 ^ D361 ^ D329 +error(0.03458993767437905376) D333 D357 +error(0.00595402342578680091) D333 D357 ^ D361 +error(0.00245631142944030675) D333 D365 +error(0.0003152919029694442122) D333 D365 ^ D336 D337 +error(0.0001612541715673219793) D333 D365 ^ D336 D361 +error(0.002267685579689308461) D333 D365 ^ D337 D361 +error(0.02509039495427965033) D333 ^ D337 +error(0.002041494666156196645) D333 ^ D361 ^ D337 +error(0.01000000000000000021) D334 +error(0.01187707629310352439) D334 D335 +error(0.001215264942972966392) D334 D335 ^ D338 D339 +error(0.0005861090175784376428) D334 D335 ^ D339 D340 +error(0.001982134764997857141) D334 D335 ^ D339 D363 +error(0.000425289327455776172) D334 D335 ^ D340 D363 +error(0.05297676665932575524) D334 D358 +error(0.003462771653202506312) D334 D358 ^ D362 D363 +error(0.00322690889612168132) D334 D359 +error(0.000497833939171843853) D334 D359 ^ D362 D363 +error(0.002260264554825750123) D334 D366 +error(0.0003473527278594572667) D334 D366 ^ D339 D340 +error(0.0008431892706171371455) D334 D366 ^ D339 D363 +error(0.0003892606543198490589) D334 D366 ^ D340 D363 +error(0.01190612723083741761) D334 ^ D338 L0 +error(0.004358707189286150849) D338 D362 ^ D334 +error(0.01780468578502405336) D335 D336 +error(0.0004696046272799186939) D335 D336 ^ D339 D340 +error(0.0008851561914086082629) D335 D336 ^ D340 D341 +error(0.001718406529616470267) D335 D336 ^ D340 D364 +error(0.0003621508437235534191) D335 D336 ^ D341 D364 +error(0.02155444020316826109) D335 D342 +error(0.02009756387803195501) D335 D342 ^ D339 D340 +error(0.02960309792484100769) D335 D359 +error(0.002696425463454497993) D335 D359 ^ D363 D364 +error(0.004542445374810293035) D335 D360 +error(0.0004787390755988302541) D335 D360 ^ D363 D364 +error(0.005783598058333213297) D335 D366 +error(0.006313383773074134758) D335 D366 ^ D339 D340 +error(0.001741030225433118535) D335 D366 ^ D339 D363 +error(0.007616179929498220411) D335 D366 ^ D340 D363 +error(0.002095215870669062119) D335 D366 ^ D340 D364 +error(0.003866228108010479232) D335 D366 ^ D363 D364 +error(0.001007778755732767137) D335 D367 +error(0.000791992306397491623) D335 D367 ^ D340 D341 +error(0.000442838744421881808) D335 D367 ^ D340 D363 +error(0.0011264348417513437) D335 D367 ^ D340 D364 +error(0.0007294911408703053015) D335 D367 ^ D341 D364 +error(0.0006790628791750554817) D335 D367 ^ D363 D364 +error(0.007519668875887872833) D336 D337 +error(0.000367564866391688718) D336 D337 ^ D340 D341 +error(4.196227388522683093e-05) D336 D337 ^ D341 +error(0.001830493767202687975) D336 D337 ^ D341 D365 +error(2.861025836566403991e-05) D336 D337 ^ D365 +error(0.0150479596563341516) D336 D343 +error(0.01110180417699024001) D336 D343 ^ D340 D341 +error(0.02213619326971636922) D336 D360 +error(0.002579554369470707462) D336 D360 ^ D364 D365 +error(0.003236307905156624899) D336 D361 +error(0.0005079835293430067563) D336 D361 ^ D364 D365 +error(0.001390683905584838868) D336 D367 +error(0.002396077516820634395) D336 D367 ^ D340 D341 +error(0.001515604606709302846) D336 D367 ^ D340 D364 +error(0.002611050841900463149) D336 D367 ^ D341 D364 +error(0.001030212141032500316) D336 D367 ^ D341 D365 +error(0.003086746265355783374) D336 D367 ^ D364 D365 +error(0.001205642639412828282) D336 D368 +error(5.413361691145458354e-05) D336 D368 ^ D341 +error(0.0006132114541846075744) D336 D368 ^ D341 D364 +error(0.001417719826750507691) D336 D368 ^ D341 D365 +error(0.0005980895653587027776) D336 D368 ^ D364 D365 +error(0.01000000000000000021) D337 +error(0.01636000547734253047) D337 D344 +error(0.01796233722540469674) D337 D344 ^ D341 +error(0.02381232961817726645) D337 D361 +error(0.002637023807817020799) D337 D361 ^ D365 +error(0.003450945788882907317) D337 D368 +error(0.002599654021808480656) D337 D368 ^ D341 +error(0.004061933355944112936) D337 D368 ^ D365 +error(0.0009592071290398953122) D337 D368 ^ D365 ^ D341 +error(0.01363803936237644246) D338 D339 +error(0.003930263821803167863) D338 D339 ^ D310 +error(0.01802560496900905418) D338 D339 ^ D334 +error(8.589436615621441292e-05) D338 D339 ^ D342 ^ D310 +error(0.02525902938098234171) D338 D362 +error(0.00574306903657622117) D338 L0 +error(0.0009470563290373274889) D338 L0 ^ D306 L0 ^ D310 +error(0.0008800554094711328119) D338 L0 ^ D306 L0 ^ D334 +error(0.001457843699669428847) D338 L0 ^ D334 ^ D310 +error(0.01450534184220186006) D339 D340 +error(0.0005721110364468817927) D339 D340 ^ D342 D343 +error(0.004601701592776456101) D339 D340 ^ D342 D366 +error(0.01329762689544615982) D339 D345 +error(0.01235795010597530268) D339 D345 ^ D342 +error(0.004365491728138845215) D339 D362 +error(0.002695027976132394112) D339 D362 ^ D334 +error(0.0003027628658435273408) D339 D362 ^ D366 ^ D334 +error(0.02723315102725440418) D339 D363 +error(0.00140205973473897039) D339 D363 ^ D334 +error(0.005203451391324077739) D339 D363 ^ D366 +error(0.00255544150013453002) D339 D369 +error(0.001808009258848390166) D339 D369 ^ D342 +error(0.002707021320884218929) D339 D369 ^ D366 +error(0.0006088424000031264971) D339 D369 ^ D366 ^ D342 +error(0.006472003059864666653) D340 D341 +error(0.0003994528074094950672) D340 D341 ^ D342 D343 +error(0.0004434226054838874857) D340 D341 ^ D342 D367 +error(0.0008751552090033030192) D340 D341 ^ D343 D344 +error(0.003045602539330864375) D340 D341 ^ D343 D367 +error(0.01325582626527719958) D340 D346 +error(0.01125502755749200473) D340 D346 ^ D342 D343 +error(0.007525476540747918358) D340 D363 +error(0.0006137602329925614204) D340 D363 ^ D366 D367 +error(0.02902365595154616021) D340 D364 +error(0.002401197642609727463) D340 D364 ^ D366 D367 +error(0.002408909711435769981) D340 D369 +error(0.0002707484224426097191) D340 D369 ^ D342 +error(0.001527963667674685309) D340 D369 ^ D342 D366 +error(0.0001105290094925922439) D340 D369 ^ D342 D367 +error(0.0005441160428730808241) D340 D369 ^ D366 +error(0.000356573641289079893) D340 D369 ^ D366 D367 +error(0.003107337702078268298) D340 D370 +error(0.00148514416775588306) D340 D370 ^ D342 D343 +error(0.0009343659549481646417) D340 D370 ^ D342 D366 +error(0.001133507027766949074) D340 D370 ^ D342 D367 +error(0.000964158168953031477) D340 D370 ^ D343 D367 +error(0.001858972200881762581) D340 D370 ^ D366 D367 +error(0.01000000000000000021) D341 +error(0.004493550144293693982) D341 D364 +error(0.0004616573460695907647) D341 D364 ^ D367 D368 +error(0.02153375451966943119) D341 D365 +error(0.001571041344134688862) D341 D365 ^ D367 D368 +error(0.001727413411201550366) D341 D370 +error(6.892623931214466931e-05) D341 D370 ^ D342 D343 +error(0.000533806835748320543) D341 D370 ^ D342 D367 +error(0.001001657939292958282) D341 D370 ^ D343 D367 +error(0.0006587014447459603635) D341 ^ D309 ^ D313 +error(0.0009512945064856004112) D341 ^ D309 ^ D337 +error(0.0004374836472664517121) D341 ^ D313 +error(0.01000000000000000021) D342 +error(0.006089189670584919251) D342 D343 +error(0.0003733339846648112744) D342 D343 ^ D345 D346 +error(0.002491417993463262287) D342 D343 ^ D346 D370 +error(0.0005065788208640180758) D342 D343 ^ D370 +error(0.0367379142487225252) D342 D366 +error(0.004448757689050466223) D342 D366 ^ D369 D370 +error(0.003134023997971539712) D342 D367 +error(0.0003650194631049960385) D342 D367 ^ D369 D370 +error(0.001406953404968496737) D342 D371 +error(0.000258713445676149944) D342 D371 ^ D346 +error(0.001311719158548649289) D342 D371 ^ D346 D370 +error(0.01016476222491488092) D343 D344 +error(0.002108544545389898564) D343 D344 ^ D317 +error(0.01205056218453301811) D343 D344 ^ D341 +error(8.106206907232670631e-05) D343 D344 ^ D346 +error(0.0003126805541716948288) D343 D344 ^ D346 ^ D317 +error(0.01810275288528837012) D343 D347 +error(0.01637617210264374554) D343 D347 ^ D346 +error(0.02102885356741089617) D343 D367 +error(0.001690237581495826133) D343 D367 ^ D341 +error(0.00359606707161589734) D343 D367 ^ D370 +error(0.003107887681254754581) D343 D368 +error(0.003382303353831740949) D343 D368 ^ D341 +error(0.0001913183606313894702) D343 D368 ^ D370 +error(0.0002941212067804130489) D343 D368 ^ D370 ^ D341 +error(0.003693046244270884078) D343 D371 +error(0.003186564243865780671) D343 D371 ^ D346 +error(0.004755038122238004067) D343 D371 ^ D370 +error(0.001954054770515154492) D343 D371 ^ D370 ^ D346 +error(0.02640784577619364679) D344 D368 +error(0.00290739257373180118) D344 D368 ^ D341 +error(0.006564866789739933102) D345 D346 +error(0.001832679987383818189) D345 D346 ^ D318 +error(0.01288524193192810627) D345 D346 ^ D342 +error(0.0006173749993255437177) D345 D346 ^ D347 +error(0.0004559863367010421231) D345 D346 ^ D347 ^ D318 +error(0.03275880248144626833) D345 D369 +error(0.00429567725900462799) D345 D369 ^ D342 +error(0.01072741549435932314) D346 +error(0.002509590526077771534) D346 D369 +error(0.003096878840847453254) D346 D369 ^ D342 +error(0.0004658229008440930739) D346 D369 ^ D371 +error(0.0006984840680404692847) D346 D369 ^ D371 ^ D342 +error(0.02371714611383288207) D346 D370 +error(0.001691210042327366938) D346 D370 ^ D342 +error(0.002968485154357761256) D346 D370 ^ D371 +error(0.01188288263817612218) D346 ^ D347 +error(0.001107203287059167415) D346 ^ D371 +error(0.004560533548355043092) D347 D371 ^ D346 +error(0.005000000000000000104) D347 +error(0.01983080680743972563) D347 D371 +error(0.005000000000000000104) D348 +error(0.01768647969650154195) D348 D352 +error(0.01997660103599073478) D348 D352 ^ D349 L0 +error(0.0272133096145726304) D348 D372 +error(0.009354172066671974373) D348 D372 ^ D373 L0 +error(0.006575429550073013871) D348 D376 +error(0.006606814816559495283) D348 D376 ^ D349 L0 +error(0.00570203587243049443) D348 D376 ^ D373 L0 +error(0.004394467297965208054) D348 D376 ^ D373 L0 ^ D349 L0 +error(0.003141484544212969771) D348 D377 +error(0.002866645116274591214) D348 D377 ^ D349 D373 +error(0.0007467639087963555584) D348 D377 ^ D349 L0 +error(0.00100340881217143808) D348 D377 ^ D373 L0 +error(0.005000000000000000104) D348 ^ D349 L0 +error(0.006716177406890511993) D349 D373 ^ D348 +error(0.006831737513122857625) D349 D350 +error(0.000925383923960359611) D349 D350 ^ D348 +error(0.0002795442616193875634) D349 D350 ^ D352 D353 +error(0.0005690671345596917631) D349 D350 ^ D352 D377 +error(0.01632363663664802497) D349 D350 ^ D353 +error(0.004686760244772980415) D349 D350 ^ D353 D377 +error(0.003622701663117294888) D349 D350 ^ D377 +error(0.0006213698150018824758) D349 D350 ^ D377 ^ D348 +error(0.02092676657561087783) D349 D355 +error(0.0132551803359697469) D349 D355 ^ D352 D353 +error(0.05139236901086036841) D349 D373 +error(0.003561108508096676607) D349 D373 ^ D376 D377 +error(0.0046639615040387555) D349 D373 ^ D377 +error(0.004108367013198443128) D349 D378 +error(0.001863368595620282274) D349 D378 ^ D352 D376 +error(0.0002077739562874012804) D349 D378 ^ D352 D377 +error(0.0001534208996732992975) D349 D378 ^ D376 D377 +error(0.002474351314484049547) D349 D379 +error(0.001842181383880251615) D349 D379 ^ D352 D353 +error(0.0007357888818581343913) D349 D379 ^ D352 D376 +error(0.002176810431023448646) D349 D379 ^ D352 D377 +error(0.0009865289460392872439) D349 D379 ^ D353 D377 +error(0.002351214005477396222) D349 D379 ^ D376 D377 +error(0.01000000000000000021) D349 L0 +error(0.01700103788466153509) D350 D356 +error(0.01657742774919643974) D350 D356 ^ D353 +error(0.005959798576863498468) D350 D373 +error(0.000405679075595877963) D350 D373 ^ D348 +error(0.006365081479756801858) D350 D373 ^ D377 +error(0.0006185446772456166349) D350 D373 ^ D377 ^ D348 +error(0.02877376894243781) D350 D374 +error(0.01462010353799540405) D350 D374 ^ D377 +error(0.00255626787296149658) D350 D379 +error(0.0003462302675103233517) D350 D379 ^ D352 D353 +error(0.0006259573259455081164) D350 D379 ^ D352 D377 +error(0.001780026776757265587) D350 D379 ^ D353 D377 +error(0.0007765183634651079674) D350 D379 ^ D377 +error(0.004204068823748800116) D350 D380 +error(0.004448751937011490021) D350 D380 ^ D353 +error(0.002493712434291736613) D350 D380 ^ D377 +error(0.002122847769795885211) D350 D380 ^ D377 ^ D353 +error(0.008073481635886498378) D351 D352 +error(0.0005730018563843651807) D351 D352 ^ D349 L0 +error(0.0004628308648474659527) D351 D352 ^ D354 D355 +error(0.002505525127704565005) D351 D352 ^ D354 D378 +error(0.009108311699216133789) D351 D352 ^ D354 L0 +error(0.0001464483877319481696) D351 D352 ^ D355 D378 +error(0.001791079838534594517) D351 D352 ^ D378 L0 +error(0.000306018137642829612) D351 D352 ^ D378 L0 ^ D349 L0 +error(0.01557841355567917037) D351 D358 +error(0.01435979479825004283) D351 D358 ^ D354 L0 +error(0.02308764085533153432) D351 D375 +error(0.00431467884365783691) D351 D375 ^ D378 L0 +error(0.001931307837553560523) D351 D376 +error(0.0008665267816730684537) D351 D376 ^ D349 L0 +error(0.002496274199622507042) D351 D376 ^ D378 L0 +error(0.0003964385681257144838) D351 D376 ^ D378 L0 ^ D349 L0 +error(0.003466727401050739669) D351 D382 +error(0.004164332635934311043) D351 D382 ^ D354 L0 +error(0.002681973973769409981) D351 D382 ^ D378 L0 +error(0.001643190028824071487) D351 D382 ^ D378 L0 ^ D354 L0 +error(0.002347213007440165141) D351 D383 +error(1.438422088529517882e-05) D351 D383 ^ D354 D355 +error(0.001602485993920255191) D351 D383 ^ D354 D378 +error(0.0003906309354926121866) D351 D383 ^ D354 L0 +error(0.0002462750543915511142) D351 D383 ^ D355 D378 +error(0.0003195674037454942704) D351 D383 ^ D378 L0 +error(0.009374789236906273804) D352 D353 +error(0.0005590529469528864254) D352 D353 ^ D325 L0 +error(0.0001530608469217417504) D352 D353 ^ D349 L0 +error(0.0008647203357822550026) D352 D353 ^ D354 D355 +error(0.000648659578791030509) D352 D353 ^ D355 D356 +error(0.00193254128555270981) D352 D353 ^ D355 D379 +error(6.236263047404961928e-05) D352 D353 ^ D356 D379 +error(0.01492810779744833949) D352 D359 +error(0.01018712175352179221) D352 D359 ^ D354 D355 +error(0.02897098431077184053) D352 D376 +error(0.009580229984338856086) D352 D376 ^ D349 L0 +error(0.003392722770150778579) D352 D376 ^ D378 D379 +error(0.0009747224564062936412) D352 D376 ^ D378 L0 +error(0.002252326138938211871) D352 D377 +error(0.0005634108258186226606) D352 D377 ^ D378 D379 +error(0.002115175773512700461) D352 D383 +error(0.0030608781621897568) D352 D383 ^ D354 D355 +error(0.001270789941476938327) D352 D383 ^ D354 D378 +error(0.001939096001487852121) D352 D383 ^ D355 D378 +error(0.001187976190653792109) D352 D383 ^ D355 D379 +error(0.002026211267946444097) D352 D383 ^ D378 D379 +error(0.0009157719035976701148) D352 D384 +error(0.0001672286054041389081) D352 D384 ^ D355 D356 +error(0.0005353541060028568126) D352 D384 ^ D355 D378 +error(0.001349693943062659982) D352 D384 ^ D355 D379 +error(0.0001999317661850497118) D352 D384 ^ D356 D379 +error(0.0005670826236588418032) D352 D384 ^ D378 D379 +error(0.01000000000000000021) D353 +error(0.02725063153630395349) D353 D360 +error(0.02389252453306664817) D353 D360 ^ D355 D356 +error(0.03329807480613649479) D353 D377 +error(0.002054421110880488236) D353 D377 ^ D379 D380 +error(0.005139440185035600017) D353 D384 +error(0.002101194335119418565) D353 D384 ^ D355 D356 +error(0.0008922567876475901794) D353 D384 ^ D355 D379 +error(0.002032431206016870138) D353 D384 ^ D356 D379 +error(0.0005572318529482796516) D353 D384 ^ D356 D380 +error(0.002750366226549339366) D353 D384 ^ D379 D380 +error(0.001460790359938684765) D353 D385 +error(0.0004147934522296172497) D353 D385 ^ D356 D379 +error(0.001498989588066860232) D353 D385 ^ D356 D380 +error(0.007007209720512256115) D354 D355 +error(0.0004546663148800625083) D354 D355 ^ D358 D359 +error(0.0001425002969150308049) D354 D355 ^ D358 D383 +error(0.0005696660143250861785) D354 D355 ^ D359 D360 +error(0.003116901364237378153) D354 D355 ^ D359 D383 +error(0.01566705597438649775) D354 D363 +error(0.01186724049158091772) D354 D363 ^ D358 D359 +error(0.03336402185735180131) D354 D378 +error(0.00244917592564833364) D354 D378 ^ D382 D383 +error(0.002462421301947203146) D354 D386 +error(0.001960634436970778299) D354 D386 ^ D358 D382 +error(3.566087944092823308e-06) D354 D386 ^ D358 D383 +error(0.0001637216941453993634) D354 D386 ^ D382 D383 +error(0.004695941015552158003) D354 D387 +error(0.00205837118508770409) D354 D387 ^ D358 D359 +error(0.002163953410575679935) D354 D387 ^ D358 D382 +error(0.001554394982217835453) D354 D387 ^ D358 D383 +error(0.0008879695541101345754) D354 D387 ^ D359 D383 +error(0.002096192257208842526) D354 D387 ^ D382 D383 +error(0.01000000000000000021) D354 L0 +error(0.004381884530454759931) D358 D382 ^ D354 L0 +error(0.008692175163913264807) D355 D356 +error(0.0006905029968304733732) D355 D356 ^ D329 +error(0.00015945046755517543) D355 D356 ^ D353 +error(0.001006504109593458303) D355 D356 ^ D359 D360 +error(0.0008131714298475562147) D355 D356 ^ D359 D384 +error(0.0001651771561405014556) D355 D356 ^ D360 D361 +error(0.001649440750181971295) D355 D356 ^ D360 D384 +error(0.01789251364993136792) D355 D364 +error(0.01500802532656671066) D355 D364 ^ D359 D360 +error(0.003194379691095217307) D355 D378 +error(0.000203690984695900824) D355 D378 ^ D383 D384 +error(0.04189958697952669148) D355 D379 +error(0.002152911101466412069) D355 D379 ^ D383 D384 +error(0.00127605215256659083) D355 D387 +error(0.0001706398503003628525) D355 D387 ^ D358 D359 +error(0.0005783336597214276545) D355 D387 ^ D358 D383 +error(0.002016020127898890141) D355 D387 ^ D359 D383 +error(0.0001968335352046341011) D355 D387 ^ D359 D384 +error(0.0001375362953422371091) D355 D387 ^ D383 D384 +error(0.0009834825476811148021) D355 D388 +error(0.00207981557623123552) D355 D388 ^ D359 D360 +error(0.001841441603780133614) D355 D388 ^ D359 D383 +error(0.002505923860524120889) D355 D388 ^ D359 D384 +error(0.001419084695213386135) D355 D388 ^ D360 D384 +error(0.002852296504457221913) D355 D388 ^ D383 D384 +error(0.009019350943902253864) D356 D357 +error(0.0001633354758280312132) D356 D357 ^ D353 +error(0.0005572855800292770244) D356 D357 ^ D360 D361 +error(0.000553630490138258915) D356 D357 ^ D360 D385 +error(0.01251672150946384239) D356 D357 ^ D361 +error(0.005790639639282292236) D356 D357 ^ D361 D385 +error(0.001145685949262297476) D356 D357 ^ D385 +error(0.0003259075124975205589) D356 D357 ^ D385 ^ D353 +error(0.01461905296180973472) D356 D365 +error(0.01098538498491322471) D356 D365 ^ D360 D361 +error(0.003447214799424203578) D356 D379 +error(0.0003666576516136855319) D356 D379 ^ D384 D385 +error(0.02223358031578045318) D356 D380 +error(0.005543803677485251852) D356 D380 ^ D353 +error(0.002210910752504785439) D356 D380 ^ D384 D385 +error(0.001379541549716805683) D356 D380 ^ D385 +error(0.002924885832784762055) D356 D388 +error(0.001574022131985900515) D356 D388 ^ D360 D384 +error(0.0003547034745176052173) D356 D388 ^ D360 D385 +error(0.0002399940007932416046) D356 D388 ^ D384 D385 +error(0.002619265017415267974) D356 D389 +error(0.00158241141465816147) D356 D389 ^ D360 D361 +error(0.0004730953369301131323) D356 D389 ^ D360 D384 +error(0.002269905077607368895) D356 D389 ^ D360 D385 +error(0.0006264493750148219901) D356 D389 ^ D361 D385 +error(0.001918993207104307793) D356 D389 ^ D384 D385 +error(0.01377675457637685119) D357 +error(0.002469986989841304811) D357 D380 +error(8.555696620424324658e-05) D357 D380 ^ D353 +error(0.002594304494337347066) D357 D380 ^ D385 +error(0.0001376299769938429572) D357 D380 ^ D385 ^ D353 +error(0.03458993767437905376) D357 D381 +error(0.00595402342578680091) D357 D381 ^ D385 +error(0.00245631142944030675) D357 D389 +error(0.0003152919029694442122) D357 D389 ^ D360 D361 +error(0.0001612541715673219793) D357 D389 ^ D360 D385 +error(0.002267685579689308461) D357 D389 ^ D361 D385 +error(0.02509039495427965033) D357 ^ D361 +error(0.002041494666156196645) D357 ^ D385 ^ D361 +error(0.01000000000000000021) D358 +error(0.01187707629310352439) D358 D359 +error(0.001215264942972966392) D358 D359 ^ D362 D363 +error(0.0005861090175784376428) D358 D359 ^ D363 D364 +error(0.001982134764997857141) D358 D359 ^ D363 D387 +error(0.000425289327455776172) D358 D359 ^ D364 D387 +error(0.05297676665932575524) D358 D382 +error(0.003462771653202506312) D358 D382 ^ D386 D387 +error(0.00322690889612168132) D358 D383 +error(0.000497833939171843853) D358 D383 ^ D386 D387 +error(0.002260264554825750123) D358 D390 +error(0.0003473527278594572667) D358 D390 ^ D363 D364 +error(0.0008431892706171371455) D358 D390 ^ D363 D387 +error(0.0003892606543198490589) D358 D390 ^ D364 D387 +error(0.01190612723083741761) D358 ^ D362 L0 +error(0.004358707189286150849) D362 D386 ^ D358 +error(0.01780468578502405336) D359 D360 +error(0.0004696046272799186939) D359 D360 ^ D363 D364 +error(0.0008851561914086082629) D359 D360 ^ D364 D365 +error(0.001718406529616470267) D359 D360 ^ D364 D388 +error(0.0003621508437235534191) D359 D360 ^ D365 D388 +error(0.02155444020316826109) D359 D366 +error(0.02009756387803195501) D359 D366 ^ D363 D364 +error(0.02960309792484100769) D359 D383 +error(0.002696425463454497993) D359 D383 ^ D387 D388 +error(0.004542445374810293035) D359 D384 +error(0.0004787390755988302541) D359 D384 ^ D387 D388 +error(0.005783598058333213297) D359 D390 +error(0.006313383773074134758) D359 D390 ^ D363 D364 +error(0.001741030225433118535) D359 D390 ^ D363 D387 +error(0.007616179929498220411) D359 D390 ^ D364 D387 +error(0.002095215870669062119) D359 D390 ^ D364 D388 +error(0.003866228108010479232) D359 D390 ^ D387 D388 +error(0.001007778755732767137) D359 D391 +error(0.000791992306397491623) D359 D391 ^ D364 D365 +error(0.000442838744421881808) D359 D391 ^ D364 D387 +error(0.0011264348417513437) D359 D391 ^ D364 D388 +error(0.0007294911408703053015) D359 D391 ^ D365 D388 +error(0.0006790628791750554817) D359 D391 ^ D387 D388 +error(0.007519668875887872833) D360 D361 +error(0.000367564866391688718) D360 D361 ^ D364 D365 +error(4.196227388522683093e-05) D360 D361 ^ D365 +error(0.001830493767202687975) D360 D361 ^ D365 D389 +error(2.861025836566403991e-05) D360 D361 ^ D389 +error(0.0150479596563341516) D360 D367 +error(0.01110180417699024001) D360 D367 ^ D364 D365 +error(0.02213619326971636922) D360 D384 +error(0.002579554369470707462) D360 D384 ^ D388 D389 +error(0.003236307905156624899) D360 D385 +error(0.0005079835293430067563) D360 D385 ^ D388 D389 +error(0.001390683905584838868) D360 D391 +error(0.002396077516820634395) D360 D391 ^ D364 D365 +error(0.001515604606709302846) D360 D391 ^ D364 D388 +error(0.002611050841900463149) D360 D391 ^ D365 D388 +error(0.001030212141032500316) D360 D391 ^ D365 D389 +error(0.003086746265355783374) D360 D391 ^ D388 D389 +error(0.001205642639412828282) D360 D392 +error(5.413361691145458354e-05) D360 D392 ^ D365 +error(0.0006132114541846075744) D360 D392 ^ D365 D388 +error(0.001417719826750507691) D360 D392 ^ D365 D389 +error(0.0005980895653587027776) D360 D392 ^ D388 D389 +error(0.01000000000000000021) D361 +error(0.01636000547734253047) D361 D368 +error(0.01796233722540469674) D361 D368 ^ D365 +error(0.02381232961817726645) D361 D385 +error(0.002637023807817020799) D361 D385 ^ D389 +error(0.003450945788882907317) D361 D392 +error(0.002599654021808480656) D361 D392 ^ D365 +error(0.004061933355944112936) D361 D392 ^ D389 +error(0.0009592071290398953122) D361 D392 ^ D389 ^ D365 +error(0.01363803936237644246) D362 D363 +error(0.003930263821803167863) D362 D363 ^ D334 +error(0.01802560496900905418) D362 D363 ^ D358 +error(8.589436615621441292e-05) D362 D363 ^ D366 ^ D334 +error(0.02525902938098234171) D362 D386 +error(0.00574306903657622117) D362 L0 +error(0.0009470563290373274889) D362 L0 ^ D330 L0 ^ D334 +error(0.0008800554094711328119) D362 L0 ^ D330 L0 ^ D358 +error(0.001457843699669428847) D362 L0 ^ D358 ^ D334 +error(0.01450534184220186006) D363 D364 +error(0.0005721110364468817927) D363 D364 ^ D366 D367 +error(0.004601701592776456101) D363 D364 ^ D366 D390 +error(0.01329762689544615982) D363 D369 +error(0.01235795010597530268) D363 D369 ^ D366 +error(0.004365491728138845215) D363 D386 +error(0.002695027976132394112) D363 D386 ^ D358 +error(0.0003027628658435273408) D363 D386 ^ D390 ^ D358 +error(0.02723315102725440418) D363 D387 +error(0.00140205973473897039) D363 D387 ^ D358 +error(0.005203451391324077739) D363 D387 ^ D390 +error(0.00255544150013453002) D363 D393 +error(0.001808009258848390166) D363 D393 ^ D366 +error(0.002707021320884218929) D363 D393 ^ D390 +error(0.0006088424000031264971) D363 D393 ^ D390 ^ D366 +error(0.006472003059864666653) D364 D365 +error(0.0003994528074094950672) D364 D365 ^ D366 D367 +error(0.0004434226054838874857) D364 D365 ^ D366 D391 +error(0.0008751552090033030192) D364 D365 ^ D367 D368 +error(0.003045602539330864375) D364 D365 ^ D367 D391 +error(0.01325582626527719958) D364 D370 +error(0.01125502755749200473) D364 D370 ^ D366 D367 +error(0.007525476540747918358) D364 D387 +error(0.0006137602329925614204) D364 D387 ^ D390 D391 +error(0.02902365595154616021) D364 D388 +error(0.002401197642609727463) D364 D388 ^ D390 D391 +error(0.002408909711435769981) D364 D393 +error(0.0002707484224426097191) D364 D393 ^ D366 +error(0.001527963667674685309) D364 D393 ^ D366 D390 +error(0.0001105290094925922439) D364 D393 ^ D366 D391 +error(0.0005441160428730808241) D364 D393 ^ D390 +error(0.000356573641289079893) D364 D393 ^ D390 D391 +error(0.003107337702078268298) D364 D394 +error(0.00148514416775588306) D364 D394 ^ D366 D367 +error(0.0009343659549481646417) D364 D394 ^ D366 D390 +error(0.001133507027766949074) D364 D394 ^ D366 D391 +error(0.000964158168953031477) D364 D394 ^ D367 D391 +error(0.001858972200881762581) D364 D394 ^ D390 D391 +error(0.01000000000000000021) D365 +error(0.004493550144293693982) D365 D388 +error(0.0004616573460695907647) D365 D388 ^ D391 D392 +error(0.02153375451966943119) D365 D389 +error(0.001571041344134688862) D365 D389 ^ D391 D392 +error(0.001727413411201550366) D365 D394 +error(6.892623931214466931e-05) D365 D394 ^ D366 D367 +error(0.000533806835748320543) D365 D394 ^ D366 D391 +error(0.001001657939292958282) D365 D394 ^ D367 D391 +error(0.0006587014447459603635) D365 ^ D333 ^ D337 +error(0.0009512945064856004112) D365 ^ D333 ^ D361 +error(0.0004374836472664517121) D365 ^ D337 +error(0.01000000000000000021) D366 +error(0.006089189670584919251) D366 D367 +error(0.0003733339846648112744) D366 D367 ^ D369 D370 +error(0.002491417993463262287) D366 D367 ^ D370 D394 +error(0.0005065788208640180758) D366 D367 ^ D394 +error(0.0367379142487225252) D366 D390 +error(0.004448757689050466223) D366 D390 ^ D393 D394 +error(0.003134023997971539712) D366 D391 +error(0.0003650194631049960385) D366 D391 ^ D393 D394 +error(0.001406953404968496737) D366 D395 +error(0.000258713445676149944) D366 D395 ^ D370 +error(0.001311719158548649289) D366 D395 ^ D370 D394 +error(0.01016476222491488092) D367 D368 +error(0.002108544545389898564) D367 D368 ^ D341 +error(0.01205056218453301811) D367 D368 ^ D365 +error(8.106206907232670631e-05) D367 D368 ^ D370 +error(0.0003126805541716948288) D367 D368 ^ D370 ^ D341 +error(0.01810275288528837012) D367 D371 +error(0.01637617210264374554) D367 D371 ^ D370 +error(0.02102885356741089617) D367 D391 +error(0.001690237581495826133) D367 D391 ^ D365 +error(0.00359606707161589734) D367 D391 ^ D394 +error(0.003107887681254754581) D367 D392 +error(0.003382303353831740949) D367 D392 ^ D365 +error(0.0001913183606313894702) D367 D392 ^ D394 +error(0.0002941212067804130489) D367 D392 ^ D394 ^ D365 +error(0.003693046244270884078) D367 D395 +error(0.003186564243865780671) D367 D395 ^ D370 +error(0.004755038122238004067) D367 D395 ^ D394 +error(0.001954054770515154492) D367 D395 ^ D394 ^ D370 +error(0.02640784577619364679) D368 D392 +error(0.00290739257373180118) D368 D392 ^ D365 +error(0.006564866789739933102) D369 D370 +error(0.001832679987383818189) D369 D370 ^ D342 +error(0.01288524193192810627) D369 D370 ^ D366 +error(0.0006173749993255437177) D369 D370 ^ D371 +error(0.0004559863367010421231) D369 D370 ^ D371 ^ D342 +error(0.03275880248144626833) D369 D393 +error(0.00429567725900462799) D369 D393 ^ D366 +error(0.01072741549435932314) D370 +error(0.002509590526077771534) D370 D393 +error(0.003096878840847453254) D370 D393 ^ D366 +error(0.0004658229008440930739) D370 D393 ^ D395 +error(0.0006984840680404692847) D370 D393 ^ D395 ^ D366 +error(0.02371714611383288207) D370 D394 +error(0.001691210042327366938) D370 D394 ^ D366 +error(0.002968485154357761256) D370 D394 ^ D395 +error(0.01188288263817612218) D370 ^ D371 +error(0.001107203287059167415) D370 ^ D395 +error(0.004560533548355043092) D371 D395 ^ D370 +error(0.005000000000000000104) D371 +error(0.01983080680743972563) D371 D395 +error(0.005000000000000000104) D372 +error(0.01768647969650154195) D372 D376 +error(0.01997660103599073478) D372 D376 ^ D373 L0 +error(0.0272133096145726304) D372 D396 +error(0.009354172066671974373) D372 D396 ^ D397 L0 +error(0.006575429550073013871) D372 D400 +error(0.006606814816559495283) D372 D400 ^ D373 L0 +error(0.00570203587243049443) D372 D400 ^ D397 L0 +error(0.004394467297965208054) D372 D400 ^ D397 L0 ^ D373 L0 +error(0.003141484544212969771) D372 D401 +error(0.002866645116274591214) D372 D401 ^ D373 D397 +error(0.0007467639087963555584) D372 D401 ^ D373 L0 +error(0.00100340881217143808) D372 D401 ^ D397 L0 +error(0.005000000000000000104) D372 ^ D373 L0 +error(0.006716177406890511993) D373 D397 ^ D372 +error(0.006831737513122857625) D373 D374 +error(0.000925383923960359611) D373 D374 ^ D372 +error(0.0002795442616193875634) D373 D374 ^ D376 D377 +error(0.0005690671345596917631) D373 D374 ^ D376 D401 +error(0.01632363663664802497) D373 D374 ^ D377 +error(0.004686760244772980415) D373 D374 ^ D377 D401 +error(0.003622701663117294888) D373 D374 ^ D401 +error(0.0006213698150018824758) D373 D374 ^ D401 ^ D372 +error(0.02092676657561087783) D373 D379 +error(0.0132551803359697469) D373 D379 ^ D376 D377 +error(0.05139236901086036841) D373 D397 +error(0.003561108508096676607) D373 D397 ^ D400 D401 +error(0.0046639615040387555) D373 D397 ^ D401 +error(0.004108367013198443128) D373 D402 +error(0.001863368595620282274) D373 D402 ^ D376 D400 +error(0.0002077739562874012804) D373 D402 ^ D376 D401 +error(0.0001534208996732992975) D373 D402 ^ D400 D401 +error(0.002474351314484049547) D373 D403 +error(0.001842181383880251615) D373 D403 ^ D376 D377 +error(0.0007357888818581343913) D373 D403 ^ D376 D400 +error(0.002176810431023448646) D373 D403 ^ D376 D401 +error(0.0009865289460392872439) D373 D403 ^ D377 D401 +error(0.002351214005477396222) D373 D403 ^ D400 D401 +error(0.01000000000000000021) D373 L0 +error(0.01700103788466153509) D374 D380 +error(0.01657742774919643974) D374 D380 ^ D377 +error(0.005959798576863498468) D374 D397 +error(0.000405679075595877963) D374 D397 ^ D372 +error(0.006365081479756801858) D374 D397 ^ D401 +error(0.0006185446772456166349) D374 D397 ^ D401 ^ D372 +error(0.02877376894243781) D374 D398 +error(0.01462010353799540405) D374 D398 ^ D401 +error(0.00255626787296149658) D374 D403 +error(0.0003462302675103233517) D374 D403 ^ D376 D377 +error(0.0006259573259455081164) D374 D403 ^ D376 D401 +error(0.001780026776757265587) D374 D403 ^ D377 D401 +error(0.0007765183634651079674) D374 D403 ^ D401 +error(0.004204068823748800116) D374 D404 +error(0.004448751937011490021) D374 D404 ^ D377 +error(0.002493712434291736613) D374 D404 ^ D401 +error(0.002122847769795885211) D374 D404 ^ D401 ^ D377 +error(0.008073481635886498378) D375 D376 +error(0.0005730018563843651807) D375 D376 ^ D373 L0 +error(0.0004628308648474659527) D375 D376 ^ D378 D379 +error(0.002505525127704565005) D375 D376 ^ D378 D402 +error(0.009108311699216133789) D375 D376 ^ D378 L0 +error(0.0001464483877319481696) D375 D376 ^ D379 D402 +error(0.001791079838534594517) D375 D376 ^ D402 L0 +error(0.000306018137642829612) D375 D376 ^ D402 L0 ^ D373 L0 +error(0.01557841355567917037) D375 D382 +error(0.01435979479825004283) D375 D382 ^ D378 L0 +error(0.02308764085533153432) D375 D399 +error(0.00431467884365783691) D375 D399 ^ D402 L0 +error(0.001931307837553560523) D375 D400 +error(0.0008665267816730684537) D375 D400 ^ D373 L0 +error(0.002496274199622507042) D375 D400 ^ D402 L0 +error(0.0003964385681257144838) D375 D400 ^ D402 L0 ^ D373 L0 +error(0.003466727401050739669) D375 D406 +error(0.004164332635934311043) D375 D406 ^ D378 L0 +error(0.002681973973769409981) D375 D406 ^ D402 L0 +error(0.001643190028824071487) D375 D406 ^ D402 L0 ^ D378 L0 +error(0.002347213007440165141) D375 D407 +error(1.438422088529517882e-05) D375 D407 ^ D378 D379 +error(0.001602485993920255191) D375 D407 ^ D378 D402 +error(0.0003906309354926121866) D375 D407 ^ D378 L0 +error(0.0002462750543915511142) D375 D407 ^ D379 D402 +error(0.0003195674037454942704) D375 D407 ^ D402 L0 +error(0.009374789236906273804) D376 D377 +error(0.0005590529469528864254) D376 D377 ^ D349 L0 +error(0.0001530608469217417504) D376 D377 ^ D373 L0 +error(0.0008647203357822550026) D376 D377 ^ D378 D379 +error(0.000648659578791030509) D376 D377 ^ D379 D380 +error(0.00193254128555270981) D376 D377 ^ D379 D403 +error(6.236263047404961928e-05) D376 D377 ^ D380 D403 +error(0.01492810779744833949) D376 D383 +error(0.01018712175352179221) D376 D383 ^ D378 D379 +error(0.02897098431077184053) D376 D400 +error(0.009580229984338856086) D376 D400 ^ D373 L0 +error(0.003392722770150778579) D376 D400 ^ D402 D403 +error(0.0009747224564062936412) D376 D400 ^ D402 L0 +error(0.002252326138938211871) D376 D401 +error(0.0005634108258186226606) D376 D401 ^ D402 D403 +error(0.002115175773512700461) D376 D407 +error(0.0030608781621897568) D376 D407 ^ D378 D379 +error(0.001270789941476938327) D376 D407 ^ D378 D402 +error(0.001939096001487852121) D376 D407 ^ D379 D402 +error(0.001187976190653792109) D376 D407 ^ D379 D403 +error(0.002026211267946444097) D376 D407 ^ D402 D403 +error(0.0009157719035976701148) D376 D408 +error(0.0001672286054041389081) D376 D408 ^ D379 D380 +error(0.0005353541060028568126) D376 D408 ^ D379 D402 +error(0.001349693943062659982) D376 D408 ^ D379 D403 +error(0.0001999317661850497118) D376 D408 ^ D380 D403 +error(0.0005670826236588418032) D376 D408 ^ D402 D403 +error(0.01000000000000000021) D377 +error(0.02725063153630395349) D377 D384 +error(0.02389252453306664817) D377 D384 ^ D379 D380 +error(0.03329807480613649479) D377 D401 +error(0.002054421110880488236) D377 D401 ^ D403 D404 +error(0.005139440185035600017) D377 D408 +error(0.002101194335119418565) D377 D408 ^ D379 D380 +error(0.0008922567876475901794) D377 D408 ^ D379 D403 +error(0.002032431206016870138) D377 D408 ^ D380 D403 +error(0.0005572318529482796516) D377 D408 ^ D380 D404 +error(0.002750366226549339366) D377 D408 ^ D403 D404 +error(0.001460790359938684765) D377 D409 +error(0.0004147934522296172497) D377 D409 ^ D380 D403 +error(0.001498989588066860232) D377 D409 ^ D380 D404 +error(0.007007209720512256115) D378 D379 +error(0.0004546663148800625083) D378 D379 ^ D382 D383 +error(0.0001425002969150308049) D378 D379 ^ D382 D407 +error(0.0005696660143250861785) D378 D379 ^ D383 D384 +error(0.003116901364237378153) D378 D379 ^ D383 D407 +error(0.01566705597438649775) D378 D387 +error(0.01186724049158091772) D378 D387 ^ D382 D383 +error(0.03336402185735180131) D378 D402 +error(0.00244917592564833364) D378 D402 ^ D406 D407 +error(0.002462421301947203146) D378 D410 +error(0.001960634436970778299) D378 D410 ^ D382 D406 +error(3.566087944092823308e-06) D378 D410 ^ D382 D407 +error(0.0001637216941453993634) D378 D410 ^ D406 D407 +error(0.004695941015552158003) D378 D411 +error(0.00205837118508770409) D378 D411 ^ D382 D383 +error(0.002163953410575679935) D378 D411 ^ D382 D406 +error(0.001554394982217835453) D378 D411 ^ D382 D407 +error(0.0008879695541101345754) D378 D411 ^ D383 D407 +error(0.002096192257208842526) D378 D411 ^ D406 D407 +error(0.01000000000000000021) D378 L0 +error(0.004381884530454759931) D382 D406 ^ D378 L0 +error(0.008692175163913264807) D379 D380 +error(0.0006905029968304733732) D379 D380 ^ D353 +error(0.00015945046755517543) D379 D380 ^ D377 +error(0.001006504109593458303) D379 D380 ^ D383 D384 +error(0.0008131714298475562147) D379 D380 ^ D383 D408 +error(0.0001651771561405014556) D379 D380 ^ D384 D385 +error(0.001649440750181971295) D379 D380 ^ D384 D408 +error(0.01789251364993136792) D379 D388 +error(0.01500802532656671066) D379 D388 ^ D383 D384 +error(0.003194379691095217307) D379 D402 +error(0.000203690984695900824) D379 D402 ^ D407 D408 +error(0.04189958697952669148) D379 D403 +error(0.002152911101466412069) D379 D403 ^ D407 D408 +error(0.00127605215256659083) D379 D411 +error(0.0001706398503003628525) D379 D411 ^ D382 D383 +error(0.0005783336597214276545) D379 D411 ^ D382 D407 +error(0.002016020127898890141) D379 D411 ^ D383 D407 +error(0.0001968335352046341011) D379 D411 ^ D383 D408 +error(0.0001375362953422371091) D379 D411 ^ D407 D408 +error(0.0009834825476811148021) D379 D412 +error(0.00207981557623123552) D379 D412 ^ D383 D384 +error(0.001841441603780133614) D379 D412 ^ D383 D407 +error(0.002505923860524120889) D379 D412 ^ D383 D408 +error(0.001419084695213386135) D379 D412 ^ D384 D408 +error(0.002852296504457221913) D379 D412 ^ D407 D408 +error(0.009019350943902253864) D380 D381 +error(0.0001633354758280312132) D380 D381 ^ D377 +error(0.0005572855800292770244) D380 D381 ^ D384 D385 +error(0.000553630490138258915) D380 D381 ^ D384 D409 +error(0.01251672150946384239) D380 D381 ^ D385 +error(0.005790639639282292236) D380 D381 ^ D385 D409 +error(0.001145685949262297476) D380 D381 ^ D409 +error(0.0003259075124975205589) D380 D381 ^ D409 ^ D377 +error(0.01461905296180973472) D380 D389 +error(0.01098538498491322471) D380 D389 ^ D384 D385 +error(0.003447214799424203578) D380 D403 +error(0.0003666576516136855319) D380 D403 ^ D408 D409 +error(0.02223358031578045318) D380 D404 +error(0.005543803677485251852) D380 D404 ^ D377 +error(0.002210910752504785439) D380 D404 ^ D408 D409 +error(0.001379541549716805683) D380 D404 ^ D409 +error(0.002924885832784762055) D380 D412 +error(0.001574022131985900515) D380 D412 ^ D384 D408 +error(0.0003547034745176052173) D380 D412 ^ D384 D409 +error(0.0002399940007932416046) D380 D412 ^ D408 D409 +error(0.002619265017415267974) D380 D413 +error(0.00158241141465816147) D380 D413 ^ D384 D385 +error(0.0004730953369301131323) D380 D413 ^ D384 D408 +error(0.002269905077607368895) D380 D413 ^ D384 D409 +error(0.0006264493750148219901) D380 D413 ^ D385 D409 +error(0.001918993207104307793) D380 D413 ^ D408 D409 +error(0.01377675457637685119) D381 +error(0.002469986989841304811) D381 D404 +error(8.555696620424324658e-05) D381 D404 ^ D377 +error(0.002594304494337347066) D381 D404 ^ D409 +error(0.0001376299769938429572) D381 D404 ^ D409 ^ D377 +error(0.03458993767437905376) D381 D405 +error(0.00595402342578680091) D381 D405 ^ D409 +error(0.00245631142944030675) D381 D413 +error(0.0003152919029694442122) D381 D413 ^ D384 D385 +error(0.0001612541715673219793) D381 D413 ^ D384 D409 +error(0.002267685579689308461) D381 D413 ^ D385 D409 +error(0.02509039495427965033) D381 ^ D385 +error(0.002041494666156196645) D381 ^ D409 ^ D385 +error(0.01000000000000000021) D382 +error(0.01187707629310352439) D382 D383 +error(0.001215264942972966392) D382 D383 ^ D386 D387 +error(0.0005861090175784376428) D382 D383 ^ D387 D388 +error(0.001982134764997857141) D382 D383 ^ D387 D411 +error(0.000425289327455776172) D382 D383 ^ D388 D411 +error(0.05297676665932575524) D382 D406 +error(0.003462771653202506312) D382 D406 ^ D410 D411 +error(0.00322690889612168132) D382 D407 +error(0.000497833939171843853) D382 D407 ^ D410 D411 +error(0.002260264554825750123) D382 D414 +error(0.0003473527278594572667) D382 D414 ^ D387 D388 +error(0.0008431892706171371455) D382 D414 ^ D387 D411 +error(0.0003892606543198490589) D382 D414 ^ D388 D411 +error(0.01190612723083741761) D382 ^ D386 L0 +error(0.004358707189286150849) D386 D410 ^ D382 +error(0.01780468578502405336) D383 D384 +error(0.0004696046272799186939) D383 D384 ^ D387 D388 +error(0.0008851561914086082629) D383 D384 ^ D388 D389 +error(0.001718406529616470267) D383 D384 ^ D388 D412 +error(0.0003621508437235534191) D383 D384 ^ D389 D412 +error(0.02155444020316826109) D383 D390 +error(0.02009756387803195501) D383 D390 ^ D387 D388 +error(0.02960309792484100769) D383 D407 +error(0.002696425463454497993) D383 D407 ^ D411 D412 +error(0.004542445374810293035) D383 D408 +error(0.0004787390755988302541) D383 D408 ^ D411 D412 +error(0.005783598058333213297) D383 D414 +error(0.006313383773074134758) D383 D414 ^ D387 D388 +error(0.001741030225433118535) D383 D414 ^ D387 D411 +error(0.007616179929498220411) D383 D414 ^ D388 D411 +error(0.002095215870669062119) D383 D414 ^ D388 D412 +error(0.003866228108010479232) D383 D414 ^ D411 D412 +error(0.001007778755732767137) D383 D415 +error(0.000791992306397491623) D383 D415 ^ D388 D389 +error(0.000442838744421881808) D383 D415 ^ D388 D411 +error(0.0011264348417513437) D383 D415 ^ D388 D412 +error(0.0007294911408703053015) D383 D415 ^ D389 D412 +error(0.0006790628791750554817) D383 D415 ^ D411 D412 +error(0.007519668875887872833) D384 D385 +error(0.000367564866391688718) D384 D385 ^ D388 D389 +error(4.196227388522683093e-05) D384 D385 ^ D389 +error(0.001830493767202687975) D384 D385 ^ D389 D413 +error(2.861025836566403991e-05) D384 D385 ^ D413 +error(0.0150479596563341516) D384 D391 +error(0.01110180417699024001) D384 D391 ^ D388 D389 +error(0.02213619326971636922) D384 D408 +error(0.002579554369470707462) D384 D408 ^ D412 D413 +error(0.003236307905156624899) D384 D409 +error(0.0005079835293430067563) D384 D409 ^ D412 D413 +error(0.001390683905584838868) D384 D415 +error(0.002396077516820634395) D384 D415 ^ D388 D389 +error(0.001515604606709302846) D384 D415 ^ D388 D412 +error(0.002611050841900463149) D384 D415 ^ D389 D412 +error(0.001030212141032500316) D384 D415 ^ D389 D413 +error(0.003086746265355783374) D384 D415 ^ D412 D413 +error(0.001205642639412828282) D384 D416 +error(5.413361691145458354e-05) D384 D416 ^ D389 +error(0.0006132114541846075744) D384 D416 ^ D389 D412 +error(0.001417719826750507691) D384 D416 ^ D389 D413 +error(0.0005980895653587027776) D384 D416 ^ D412 D413 +error(0.01000000000000000021) D385 +error(0.01636000547734253047) D385 D392 +error(0.01796233722540469674) D385 D392 ^ D389 +error(0.02381232961817726645) D385 D409 +error(0.002637023807817020799) D385 D409 ^ D413 +error(0.003450945788882907317) D385 D416 +error(0.002599654021808480656) D385 D416 ^ D389 +error(0.004061933355944112936) D385 D416 ^ D413 +error(0.0009592071290398953122) D385 D416 ^ D413 ^ D389 +error(0.01363803936237644246) D386 D387 +error(0.003930263821803167863) D386 D387 ^ D358 +error(0.01802560496900905418) D386 D387 ^ D382 +error(8.589436615621441292e-05) D386 D387 ^ D390 ^ D358 +error(0.02525902938098234171) D386 D410 +error(0.00574306903657622117) D386 L0 +error(0.0009470563290373274889) D386 L0 ^ D354 L0 ^ D358 +error(0.0008800554094711328119) D386 L0 ^ D354 L0 ^ D382 +error(0.001457843699669428847) D386 L0 ^ D382 ^ D358 +error(0.01450534184220186006) D387 D388 +error(0.0005721110364468817927) D387 D388 ^ D390 D391 +error(0.004601701592776456101) D387 D388 ^ D390 D414 +error(0.01329762689544615982) D387 D393 +error(0.01235795010597530268) D387 D393 ^ D390 +error(0.004365491728138845215) D387 D410 +error(0.002695027976132394112) D387 D410 ^ D382 +error(0.0003027628658435273408) D387 D410 ^ D414 ^ D382 +error(0.02723315102725440418) D387 D411 +error(0.00140205973473897039) D387 D411 ^ D382 +error(0.005203451391324077739) D387 D411 ^ D414 +error(0.00255544150013453002) D387 D417 +error(0.001808009258848390166) D387 D417 ^ D390 +error(0.002707021320884218929) D387 D417 ^ D414 +error(0.0006088424000031264971) D387 D417 ^ D414 ^ D390 +error(0.006472003059864666653) D388 D389 +error(0.0003994528074094950672) D388 D389 ^ D390 D391 +error(0.0004434226054838874857) D388 D389 ^ D390 D415 +error(0.0008751552090033030192) D388 D389 ^ D391 D392 +error(0.003045602539330864375) D388 D389 ^ D391 D415 +error(0.01325582626527719958) D388 D394 +error(0.01125502755749200473) D388 D394 ^ D390 D391 +error(0.007525476540747918358) D388 D411 +error(0.0006137602329925614204) D388 D411 ^ D414 D415 +error(0.02902365595154616021) D388 D412 +error(0.002401197642609727463) D388 D412 ^ D414 D415 +error(0.002408909711435769981) D388 D417 +error(0.0002707484224426097191) D388 D417 ^ D390 +error(0.001527963667674685309) D388 D417 ^ D390 D414 +error(0.0001105290094925922439) D388 D417 ^ D390 D415 +error(0.0005441160428730808241) D388 D417 ^ D414 +error(0.000356573641289079893) D388 D417 ^ D414 D415 +error(0.003107337702078268298) D388 D418 +error(0.00148514416775588306) D388 D418 ^ D390 D391 +error(0.0009343659549481646417) D388 D418 ^ D390 D414 +error(0.001133507027766949074) D388 D418 ^ D390 D415 +error(0.000964158168953031477) D388 D418 ^ D391 D415 +error(0.001858972200881762581) D388 D418 ^ D414 D415 +error(0.01000000000000000021) D389 +error(0.004493550144293693982) D389 D412 +error(0.0004616573460695907647) D389 D412 ^ D415 D416 +error(0.02153375451966943119) D389 D413 +error(0.001571041344134688862) D389 D413 ^ D415 D416 +error(0.001727413411201550366) D389 D418 +error(6.892623931214466931e-05) D389 D418 ^ D390 D391 +error(0.000533806835748320543) D389 D418 ^ D390 D415 +error(0.001001657939292958282) D389 D418 ^ D391 D415 +error(0.0006587014447459603635) D389 ^ D357 ^ D361 +error(0.0009512945064856004112) D389 ^ D357 ^ D385 +error(0.0004374836472664517121) D389 ^ D361 +error(0.01000000000000000021) D390 +error(0.006089189670584919251) D390 D391 +error(0.0003733339846648112744) D390 D391 ^ D393 D394 +error(0.002491417993463262287) D390 D391 ^ D394 D418 +error(0.0005065788208640180758) D390 D391 ^ D418 +error(0.0367379142487225252) D390 D414 +error(0.004448757689050466223) D390 D414 ^ D417 D418 +error(0.003134023997971539712) D390 D415 +error(0.0003650194631049960385) D390 D415 ^ D417 D418 +error(0.001406953404968496737) D390 D419 +error(0.000258713445676149944) D390 D419 ^ D394 +error(0.001311719158548649289) D390 D419 ^ D394 D418 +error(0.01016476222491488092) D391 D392 +error(0.002108544545389898564) D391 D392 ^ D365 +error(0.01205056218453301811) D391 D392 ^ D389 +error(8.106206907232670631e-05) D391 D392 ^ D394 +error(0.0003126805541716948288) D391 D392 ^ D394 ^ D365 +error(0.01810275288528837012) D391 D395 +error(0.01637617210264374554) D391 D395 ^ D394 +error(0.02102885356741089617) D391 D415 +error(0.001690237581495826133) D391 D415 ^ D389 +error(0.00359606707161589734) D391 D415 ^ D418 +error(0.003107887681254754581) D391 D416 +error(0.003382303353831740949) D391 D416 ^ D389 +error(0.0001913183606313894702) D391 D416 ^ D418 +error(0.0002941212067804130489) D391 D416 ^ D418 ^ D389 +error(0.003693046244270884078) D391 D419 +error(0.003186564243865780671) D391 D419 ^ D394 +error(0.004755038122238004067) D391 D419 ^ D418 +error(0.001954054770515154492) D391 D419 ^ D418 ^ D394 +error(0.02640784577619364679) D392 D416 +error(0.00290739257373180118) D392 D416 ^ D389 +error(0.006564866789739933102) D393 D394 +error(0.001832679987383818189) D393 D394 ^ D366 +error(0.01288524193192810627) D393 D394 ^ D390 +error(0.0006173749993255437177) D393 D394 ^ D395 +error(0.0004559863367010421231) D393 D394 ^ D395 ^ D366 +error(0.03275880248144626833) D393 D417 +error(0.00429567725900462799) D393 D417 ^ D390 +error(0.01072741549435932314) D394 +error(0.002509590526077771534) D394 D417 +error(0.003096878840847453254) D394 D417 ^ D390 +error(0.0004658229008440930739) D394 D417 ^ D419 +error(0.0006984840680404692847) D394 D417 ^ D419 ^ D390 +error(0.02371714611383288207) D394 D418 +error(0.001691210042327366938) D394 D418 ^ D390 +error(0.002968485154357761256) D394 D418 ^ D419 +error(0.01188288263817612218) D394 ^ D395 +error(0.001107203287059167415) D394 ^ D419 +error(0.004560533548355043092) D395 D419 ^ D394 +error(0.005000000000000000104) D395 +error(0.01983080680743972563) D395 D419 +error(0.005000000000000000104) D396 +error(0.01768647969650154195) D396 D400 +error(0.01997660103599073478) D396 D400 ^ D397 L0 +error(0.0272133096145726304) D396 D420 +error(0.009354172066671974373) D396 D420 ^ D421 L0 +error(0.006575429550073013871) D396 D424 +error(0.006606814816559495283) D396 D424 ^ D397 L0 +error(0.00570203587243049443) D396 D424 ^ D421 L0 +error(0.004394467297965208054) D396 D424 ^ D421 L0 ^ D397 L0 +error(0.003141484544212969771) D396 D425 +error(0.002866645116274591214) D396 D425 ^ D397 D421 +error(0.0007467639087963555584) D396 D425 ^ D397 L0 +error(0.00100340881217143808) D396 D425 ^ D421 L0 +error(0.005000000000000000104) D396 ^ D397 L0 +error(0.006716177406890511993) D397 D421 ^ D396 +error(0.006831737513122857625) D397 D398 +error(0.000925383923960359611) D397 D398 ^ D396 +error(0.0002795442616193875634) D397 D398 ^ D400 D401 +error(0.0005690671345596917631) D397 D398 ^ D400 D425 +error(0.01632363663664802497) D397 D398 ^ D401 +error(0.004686760244772980415) D397 D398 ^ D401 D425 +error(0.003622701663117294888) D397 D398 ^ D425 +error(0.0006213698150018824758) D397 D398 ^ D425 ^ D396 +error(0.02092676657561087783) D397 D403 +error(0.0132551803359697469) D397 D403 ^ D400 D401 +error(0.05139236901086036841) D397 D421 +error(0.003561108508096676607) D397 D421 ^ D424 D425 +error(0.0046639615040387555) D397 D421 ^ D425 +error(0.004108367013198443128) D397 D426 +error(0.001863368595620282274) D397 D426 ^ D400 D424 +error(0.0002077739562874012804) D397 D426 ^ D400 D425 +error(0.0001534208996732992975) D397 D426 ^ D424 D425 +error(0.002474351314484049547) D397 D427 +error(0.001842181383880251615) D397 D427 ^ D400 D401 +error(0.0007357888818581343913) D397 D427 ^ D400 D424 +error(0.002176810431023448646) D397 D427 ^ D400 D425 +error(0.0009865289460392872439) D397 D427 ^ D401 D425 +error(0.002351214005477396222) D397 D427 ^ D424 D425 +error(0.01000000000000000021) D397 L0 +error(0.01700103788466153509) D398 D404 +error(0.01657742774919643974) D398 D404 ^ D401 +error(0.005959798576863498468) D398 D421 +error(0.000405679075595877963) D398 D421 ^ D396 +error(0.006365081479756801858) D398 D421 ^ D425 +error(0.0006185446772456166349) D398 D421 ^ D425 ^ D396 +error(0.02877376894243781) D398 D422 +error(0.01462010353799540405) D398 D422 ^ D425 +error(0.00255626787296149658) D398 D427 +error(0.0003462302675103233517) D398 D427 ^ D400 D401 +error(0.0006259573259455081164) D398 D427 ^ D400 D425 +error(0.001780026776757265587) D398 D427 ^ D401 D425 +error(0.0007765183634651079674) D398 D427 ^ D425 +error(0.004204068823748800116) D398 D428 +error(0.004448751937011490021) D398 D428 ^ D401 +error(0.002493712434291736613) D398 D428 ^ D425 +error(0.002122847769795885211) D398 D428 ^ D425 ^ D401 +error(0.008073481635886498378) D399 D400 +error(0.0005730018563843651807) D399 D400 ^ D397 L0 +error(0.0004628308648474659527) D399 D400 ^ D402 D403 +error(0.002505525127704565005) D399 D400 ^ D402 D426 +error(0.009108311699216133789) D399 D400 ^ D402 L0 +error(0.0001464483877319481696) D399 D400 ^ D403 D426 +error(0.001791079838534594517) D399 D400 ^ D426 L0 +error(0.000306018137642829612) D399 D400 ^ D426 L0 ^ D397 L0 +error(0.01557841355567917037) D399 D406 +error(0.01435979479825004283) D399 D406 ^ D402 L0 +error(0.02308764085533153432) D399 D423 +error(0.00431467884365783691) D399 D423 ^ D426 L0 +error(0.001931307837553560523) D399 D424 +error(0.0008665267816730684537) D399 D424 ^ D397 L0 +error(0.002496274199622507042) D399 D424 ^ D426 L0 +error(0.0003964385681257144838) D399 D424 ^ D426 L0 ^ D397 L0 +error(0.003466727401050739669) D399 D430 +error(0.004164332635934311043) D399 D430 ^ D402 L0 +error(0.002681973973769409981) D399 D430 ^ D426 L0 +error(0.001643190028824071487) D399 D430 ^ D426 L0 ^ D402 L0 +error(0.002347213007440165141) D399 D431 +error(1.438422088529517882e-05) D399 D431 ^ D402 D403 +error(0.001602485993920255191) D399 D431 ^ D402 D426 +error(0.0003906309354926121866) D399 D431 ^ D402 L0 +error(0.0002462750543915511142) D399 D431 ^ D403 D426 +error(0.0003195674037454942704) D399 D431 ^ D426 L0 +error(0.009374789236906273804) D400 D401 +error(0.0005590529469528864254) D400 D401 ^ D373 L0 +error(0.0001530608469217417504) D400 D401 ^ D397 L0 +error(0.0008647203357822550026) D400 D401 ^ D402 D403 +error(0.000648659578791030509) D400 D401 ^ D403 D404 +error(0.00193254128555270981) D400 D401 ^ D403 D427 +error(6.236263047404961928e-05) D400 D401 ^ D404 D427 +error(0.01492810779744833949) D400 D407 +error(0.01018712175352179221) D400 D407 ^ D402 D403 +error(0.02897098431077184053) D400 D424 +error(0.009580229984338856086) D400 D424 ^ D397 L0 +error(0.003392722770150778579) D400 D424 ^ D426 D427 +error(0.0009747224564062936412) D400 D424 ^ D426 L0 +error(0.002252326138938211871) D400 D425 +error(0.0005634108258186226606) D400 D425 ^ D426 D427 +error(0.002115175773512700461) D400 D431 +error(0.0030608781621897568) D400 D431 ^ D402 D403 +error(0.001270789941476938327) D400 D431 ^ D402 D426 +error(0.001939096001487852121) D400 D431 ^ D403 D426 +error(0.001187976190653792109) D400 D431 ^ D403 D427 +error(0.002026211267946444097) D400 D431 ^ D426 D427 +error(0.0009157719035976701148) D400 D432 +error(0.0001672286054041389081) D400 D432 ^ D403 D404 +error(0.0005353541060028568126) D400 D432 ^ D403 D426 +error(0.001349693943062659982) D400 D432 ^ D403 D427 +error(0.0001999317661850497118) D400 D432 ^ D404 D427 +error(0.0005670826236588418032) D400 D432 ^ D426 D427 +error(0.01000000000000000021) D401 +error(0.02725063153630395349) D401 D408 +error(0.02389252453306664817) D401 D408 ^ D403 D404 +error(0.03329807480613649479) D401 D425 +error(0.002054421110880488236) D401 D425 ^ D427 D428 +error(0.005139440185035600017) D401 D432 +error(0.002101194335119418565) D401 D432 ^ D403 D404 +error(0.0008922567876475901794) D401 D432 ^ D403 D427 +error(0.002032431206016870138) D401 D432 ^ D404 D427 +error(0.0005572318529482796516) D401 D432 ^ D404 D428 +error(0.002750366226549339366) D401 D432 ^ D427 D428 +error(0.001460790359938684765) D401 D433 +error(0.0004147934522296172497) D401 D433 ^ D404 D427 +error(0.001498989588066860232) D401 D433 ^ D404 D428 +error(0.007007209720512256115) D402 D403 +error(0.0004546663148800625083) D402 D403 ^ D406 D407 +error(0.0001425002969150308049) D402 D403 ^ D406 D431 +error(0.0005696660143250861785) D402 D403 ^ D407 D408 +error(0.003116901364237378153) D402 D403 ^ D407 D431 +error(0.01566705597438649775) D402 D411 +error(0.01186724049158091772) D402 D411 ^ D406 D407 +error(0.03336402185735180131) D402 D426 +error(0.00244917592564833364) D402 D426 ^ D430 D431 +error(0.002462421301947203146) D402 D434 +error(0.001960634436970778299) D402 D434 ^ D406 D430 +error(3.566087944092823308e-06) D402 D434 ^ D406 D431 +error(0.0001637216941453993634) D402 D434 ^ D430 D431 +error(0.004695941015552158003) D402 D435 +error(0.00205837118508770409) D402 D435 ^ D406 D407 +error(0.002163953410575679935) D402 D435 ^ D406 D430 +error(0.001554394982217835453) D402 D435 ^ D406 D431 +error(0.0008879695541101345754) D402 D435 ^ D407 D431 +error(0.002096192257208842526) D402 D435 ^ D430 D431 +error(0.01000000000000000021) D402 L0 +error(0.004381884530454759931) D406 D430 ^ D402 L0 +error(0.008692175163913264807) D403 D404 +error(0.0006905029968304733732) D403 D404 ^ D377 +error(0.00015945046755517543) D403 D404 ^ D401 +error(0.001006504109593458303) D403 D404 ^ D407 D408 +error(0.0008131714298475562147) D403 D404 ^ D407 D432 +error(0.0001651771561405014556) D403 D404 ^ D408 D409 +error(0.001649440750181971295) D403 D404 ^ D408 D432 +error(0.01789251364993136792) D403 D412 +error(0.01500802532656671066) D403 D412 ^ D407 D408 +error(0.003194379691095217307) D403 D426 +error(0.000203690984695900824) D403 D426 ^ D431 D432 +error(0.04189958697952669148) D403 D427 +error(0.002152911101466412069) D403 D427 ^ D431 D432 +error(0.00127605215256659083) D403 D435 +error(0.0001706398503003628525) D403 D435 ^ D406 D407 +error(0.0005783336597214276545) D403 D435 ^ D406 D431 +error(0.002016020127898890141) D403 D435 ^ D407 D431 +error(0.0001968335352046341011) D403 D435 ^ D407 D432 +error(0.0001375362953422371091) D403 D435 ^ D431 D432 +error(0.0009834825476811148021) D403 D436 +error(0.00207981557623123552) D403 D436 ^ D407 D408 +error(0.001841441603780133614) D403 D436 ^ D407 D431 +error(0.002505923860524120889) D403 D436 ^ D407 D432 +error(0.001419084695213386135) D403 D436 ^ D408 D432 +error(0.002852296504457221913) D403 D436 ^ D431 D432 +error(0.009019350943902253864) D404 D405 +error(0.0001633354758280312132) D404 D405 ^ D401 +error(0.0005572855800292770244) D404 D405 ^ D408 D409 +error(0.000553630490138258915) D404 D405 ^ D408 D433 +error(0.01251672150946384239) D404 D405 ^ D409 +error(0.005790639639282292236) D404 D405 ^ D409 D433 +error(0.001145685949262297476) D404 D405 ^ D433 +error(0.0003259075124975205589) D404 D405 ^ D433 ^ D401 +error(0.01461905296180973472) D404 D413 +error(0.01098538498491322471) D404 D413 ^ D408 D409 +error(0.003447214799424203578) D404 D427 +error(0.0003666576516136855319) D404 D427 ^ D432 D433 +error(0.02223358031578045318) D404 D428 +error(0.005543803677485251852) D404 D428 ^ D401 +error(0.002210910752504785439) D404 D428 ^ D432 D433 +error(0.001379541549716805683) D404 D428 ^ D433 +error(0.002924885832784762055) D404 D436 +error(0.001574022131985900515) D404 D436 ^ D408 D432 +error(0.0003547034745176052173) D404 D436 ^ D408 D433 +error(0.0002399940007932416046) D404 D436 ^ D432 D433 +error(0.002619265017415267974) D404 D437 +error(0.00158241141465816147) D404 D437 ^ D408 D409 +error(0.0004730953369301131323) D404 D437 ^ D408 D432 +error(0.002269905077607368895) D404 D437 ^ D408 D433 +error(0.0006264493750148219901) D404 D437 ^ D409 D433 +error(0.001918993207104307793) D404 D437 ^ D432 D433 +error(0.01377675457637685119) D405 +error(0.002469986989841304811) D405 D428 +error(8.555696620424324658e-05) D405 D428 ^ D401 +error(0.002594304494337347066) D405 D428 ^ D433 +error(0.0001376299769938429572) D405 D428 ^ D433 ^ D401 +error(0.03458993767437905376) D405 D429 +error(0.00595402342578680091) D405 D429 ^ D433 +error(0.00245631142944030675) D405 D437 +error(0.0003152919029694442122) D405 D437 ^ D408 D409 +error(0.0001612541715673219793) D405 D437 ^ D408 D433 +error(0.002267685579689308461) D405 D437 ^ D409 D433 +error(0.02509039495427965033) D405 ^ D409 +error(0.002041494666156196645) D405 ^ D433 ^ D409 +error(0.01000000000000000021) D406 +error(0.01187707629310352439) D406 D407 +error(0.001215264942972966392) D406 D407 ^ D410 D411 +error(0.0005861090175784376428) D406 D407 ^ D411 D412 +error(0.001982134764997857141) D406 D407 ^ D411 D435 +error(0.000425289327455776172) D406 D407 ^ D412 D435 +error(0.05297676665932575524) D406 D430 +error(0.003462771653202506312) D406 D430 ^ D434 D435 +error(0.00322690889612168132) D406 D431 +error(0.000497833939171843853) D406 D431 ^ D434 D435 +error(0.002260264554825750123) D406 D438 +error(0.0003473527278594572667) D406 D438 ^ D411 D412 +error(0.0008431892706171371455) D406 D438 ^ D411 D435 +error(0.0003892606543198490589) D406 D438 ^ D412 D435 +error(0.01190612723083741761) D406 ^ D410 L0 +error(0.004358707189286150849) D410 D434 ^ D406 +error(0.01780468578502405336) D407 D408 +error(0.0004696046272799186939) D407 D408 ^ D411 D412 +error(0.0008851561914086082629) D407 D408 ^ D412 D413 +error(0.001718406529616470267) D407 D408 ^ D412 D436 +error(0.0003621508437235534191) D407 D408 ^ D413 D436 +error(0.02155444020316826109) D407 D414 +error(0.02009756387803195501) D407 D414 ^ D411 D412 +error(0.02960309792484100769) D407 D431 +error(0.002696425463454497993) D407 D431 ^ D435 D436 +error(0.004542445374810293035) D407 D432 +error(0.0004787390755988302541) D407 D432 ^ D435 D436 +error(0.005783598058333213297) D407 D438 +error(0.006313383773074134758) D407 D438 ^ D411 D412 +error(0.001741030225433118535) D407 D438 ^ D411 D435 +error(0.007616179929498220411) D407 D438 ^ D412 D435 +error(0.002095215870669062119) D407 D438 ^ D412 D436 +error(0.003866228108010479232) D407 D438 ^ D435 D436 +error(0.001007778755732767137) D407 D439 +error(0.000791992306397491623) D407 D439 ^ D412 D413 +error(0.000442838744421881808) D407 D439 ^ D412 D435 +error(0.0011264348417513437) D407 D439 ^ D412 D436 +error(0.0007294911408703053015) D407 D439 ^ D413 D436 +error(0.0006790628791750554817) D407 D439 ^ D435 D436 +error(0.007519668875887872833) D408 D409 +error(0.000367564866391688718) D408 D409 ^ D412 D413 +error(4.196227388522683093e-05) D408 D409 ^ D413 +error(0.001830493767202687975) D408 D409 ^ D413 D437 +error(2.861025836566403991e-05) D408 D409 ^ D437 +error(0.0150479596563341516) D408 D415 +error(0.01110180417699024001) D408 D415 ^ D412 D413 +error(0.02213619326971636922) D408 D432 +error(0.002579554369470707462) D408 D432 ^ D436 D437 +error(0.003236307905156624899) D408 D433 +error(0.0005079835293430067563) D408 D433 ^ D436 D437 +error(0.001390683905584838868) D408 D439 +error(0.002396077516820634395) D408 D439 ^ D412 D413 +error(0.001515604606709302846) D408 D439 ^ D412 D436 +error(0.002611050841900463149) D408 D439 ^ D413 D436 +error(0.001030212141032500316) D408 D439 ^ D413 D437 +error(0.003086746265355783374) D408 D439 ^ D436 D437 +error(0.001205642639412828282) D408 D440 +error(5.413361691145458354e-05) D408 D440 ^ D413 +error(0.0006132114541846075744) D408 D440 ^ D413 D436 +error(0.001417719826750507691) D408 D440 ^ D413 D437 +error(0.0005980895653587027776) D408 D440 ^ D436 D437 +error(0.01000000000000000021) D409 +error(0.01636000547734253047) D409 D416 +error(0.01796233722540469674) D409 D416 ^ D413 +error(0.02381232961817726645) D409 D433 +error(0.002637023807817020799) D409 D433 ^ D437 +error(0.003450945788882907317) D409 D440 +error(0.002599654021808480656) D409 D440 ^ D413 +error(0.004061933355944112936) D409 D440 ^ D437 +error(0.0009592071290398953122) D409 D440 ^ D437 ^ D413 +error(0.01363803936237644246) D410 D411 +error(0.003930263821803167863) D410 D411 ^ D382 +error(0.01802560496900905418) D410 D411 ^ D406 +error(8.589436615621441292e-05) D410 D411 ^ D414 ^ D382 +error(0.02525902938098234171) D410 D434 +error(0.00574306903657622117) D410 L0 +error(0.0009470563290373274889) D410 L0 ^ D378 L0 ^ D382 +error(0.0008800554094711328119) D410 L0 ^ D378 L0 ^ D406 +error(0.001457843699669428847) D410 L0 ^ D406 ^ D382 +error(0.01450534184220186006) D411 D412 +error(0.0005721110364468817927) D411 D412 ^ D414 D415 +error(0.004601701592776456101) D411 D412 ^ D414 D438 +error(0.01329762689544615982) D411 D417 +error(0.01235795010597530268) D411 D417 ^ D414 +error(0.004365491728138845215) D411 D434 +error(0.002695027976132394112) D411 D434 ^ D406 +error(0.0003027628658435273408) D411 D434 ^ D438 ^ D406 +error(0.02723315102725440418) D411 D435 +error(0.00140205973473897039) D411 D435 ^ D406 +error(0.005203451391324077739) D411 D435 ^ D438 +error(0.00255544150013453002) D411 D441 +error(0.001808009258848390166) D411 D441 ^ D414 +error(0.002707021320884218929) D411 D441 ^ D438 +error(0.0006088424000031264971) D411 D441 ^ D438 ^ D414 +error(0.006472003059864666653) D412 D413 +error(0.0003994528074094950672) D412 D413 ^ D414 D415 +error(0.0004434226054838874857) D412 D413 ^ D414 D439 +error(0.0008751552090033030192) D412 D413 ^ D415 D416 +error(0.003045602539330864375) D412 D413 ^ D415 D439 +error(0.01325582626527719958) D412 D418 +error(0.01125502755749200473) D412 D418 ^ D414 D415 +error(0.007525476540747918358) D412 D435 +error(0.0006137602329925614204) D412 D435 ^ D438 D439 +error(0.02902365595154616021) D412 D436 +error(0.002401197642609727463) D412 D436 ^ D438 D439 +error(0.002408909711435769981) D412 D441 +error(0.0002707484224426097191) D412 D441 ^ D414 +error(0.001527963667674685309) D412 D441 ^ D414 D438 +error(0.0001105290094925922439) D412 D441 ^ D414 D439 +error(0.0005441160428730808241) D412 D441 ^ D438 +error(0.000356573641289079893) D412 D441 ^ D438 D439 +error(0.003107337702078268298) D412 D442 +error(0.00148514416775588306) D412 D442 ^ D414 D415 +error(0.0009343659549481646417) D412 D442 ^ D414 D438 +error(0.001133507027766949074) D412 D442 ^ D414 D439 +error(0.000964158168953031477) D412 D442 ^ D415 D439 +error(0.001858972200881762581) D412 D442 ^ D438 D439 +error(0.01000000000000000021) D413 +error(0.004493550144293693982) D413 D436 +error(0.0004616573460695907647) D413 D436 ^ D439 D440 +error(0.02153375451966943119) D413 D437 +error(0.001571041344134688862) D413 D437 ^ D439 D440 +error(0.001727413411201550366) D413 D442 +error(6.892623931214466931e-05) D413 D442 ^ D414 D415 +error(0.000533806835748320543) D413 D442 ^ D414 D439 +error(0.001001657939292958282) D413 D442 ^ D415 D439 +error(0.0006587014447459603635) D413 ^ D381 ^ D385 +error(0.0009512945064856004112) D413 ^ D381 ^ D409 +error(0.0004374836472664517121) D413 ^ D385 +error(0.01000000000000000021) D414 +error(0.006089189670584919251) D414 D415 +error(0.0003733339846648112744) D414 D415 ^ D417 D418 +error(0.002491417993463262287) D414 D415 ^ D418 D442 +error(0.0005065788208640180758) D414 D415 ^ D442 +error(0.0367379142487225252) D414 D438 +error(0.004448757689050466223) D414 D438 ^ D441 D442 +error(0.003134023997971539712) D414 D439 +error(0.0003650194631049960385) D414 D439 ^ D441 D442 +error(0.001406953404968496737) D414 D443 +error(0.000258713445676149944) D414 D443 ^ D418 +error(0.001311719158548649289) D414 D443 ^ D418 D442 +error(0.01016476222491488092) D415 D416 +error(0.002108544545389898564) D415 D416 ^ D389 +error(0.01205056218453301811) D415 D416 ^ D413 +error(8.106206907232670631e-05) D415 D416 ^ D418 +error(0.0003126805541716948288) D415 D416 ^ D418 ^ D389 +error(0.01810275288528837012) D415 D419 +error(0.01637617210264374554) D415 D419 ^ D418 +error(0.02102885356741089617) D415 D439 +error(0.001690237581495826133) D415 D439 ^ D413 +error(0.00359606707161589734) D415 D439 ^ D442 +error(0.003107887681254754581) D415 D440 +error(0.003382303353831740949) D415 D440 ^ D413 +error(0.0001913183606313894702) D415 D440 ^ D442 +error(0.0002941212067804130489) D415 D440 ^ D442 ^ D413 +error(0.003693046244270884078) D415 D443 +error(0.003186564243865780671) D415 D443 ^ D418 +error(0.004755038122238004067) D415 D443 ^ D442 +error(0.001954054770515154492) D415 D443 ^ D442 ^ D418 +error(0.02640784577619364679) D416 D440 +error(0.00290739257373180118) D416 D440 ^ D413 +error(0.006564866789739933102) D417 D418 +error(0.001832679987383818189) D417 D418 ^ D390 +error(0.01288524193192810627) D417 D418 ^ D414 +error(0.0006173749993255437177) D417 D418 ^ D419 +error(0.0004559863367010421231) D417 D418 ^ D419 ^ D390 +error(0.03275880248144626833) D417 D441 +error(0.00429567725900462799) D417 D441 ^ D414 +error(0.01072741549435932314) D418 +error(0.002509590526077771534) D418 D441 +error(0.003096878840847453254) D418 D441 ^ D414 +error(0.0004658229008440930739) D418 D441 ^ D443 +error(0.0006984840680404692847) D418 D441 ^ D443 ^ D414 +error(0.02371714611383288207) D418 D442 +error(0.001691210042327366938) D418 D442 ^ D414 +error(0.002968485154357761256) D418 D442 ^ D443 +error(0.01188288263817612218) D418 ^ D419 +error(0.001107203287059167415) D418 ^ D443 +error(0.004560533548355043092) D419 D443 ^ D418 +error(0.005000000000000000104) D419 +error(0.01983080680743972563) D419 D443 +error(0.005000000000000000104) D420 +error(0.01768647969650154195) D420 D424 +error(0.01997660103599073478) D420 D424 ^ D421 L0 +error(0.0272133096145726304) D420 D444 +error(0.009354172066671974373) D420 D444 ^ D445 L0 +error(0.006575429550073013871) D420 D448 +error(0.006606814816559495283) D420 D448 ^ D421 L0 +error(0.00570203587243049443) D420 D448 ^ D445 L0 +error(0.004394467297965208054) D420 D448 ^ D445 L0 ^ D421 L0 +error(0.003141484544212969771) D420 D449 +error(0.002866645116274591214) D420 D449 ^ D421 D445 +error(0.0007467639087963555584) D420 D449 ^ D421 L0 +error(0.00100340881217143808) D420 D449 ^ D445 L0 +error(0.005000000000000000104) D420 ^ D421 L0 +error(0.006716177406890511993) D421 D445 ^ D420 +error(0.006831737513122857625) D421 D422 +error(0.000925383923960359611) D421 D422 ^ D420 +error(0.0002795442616193875634) D421 D422 ^ D424 D425 +error(0.0005690671345596917631) D421 D422 ^ D424 D449 +error(0.01632363663664802497) D421 D422 ^ D425 +error(0.004686760244772980415) D421 D422 ^ D425 D449 +error(0.003622701663117294888) D421 D422 ^ D449 +error(0.0006213698150018824758) D421 D422 ^ D449 ^ D420 +error(0.02092676657561087783) D421 D427 +error(0.0132551803359697469) D421 D427 ^ D424 D425 +error(0.05139236901086036841) D421 D445 +error(0.003561108508096676607) D421 D445 ^ D448 D449 +error(0.0046639615040387555) D421 D445 ^ D449 +error(0.004108367013198443128) D421 D450 +error(0.001863368595620282274) D421 D450 ^ D424 D448 +error(0.0002077739562874012804) D421 D450 ^ D424 D449 +error(0.0001534208996732992975) D421 D450 ^ D448 D449 +error(0.002474351314484049547) D421 D451 +error(0.001842181383880251615) D421 D451 ^ D424 D425 +error(0.0007357888818581343913) D421 D451 ^ D424 D448 +error(0.002176810431023448646) D421 D451 ^ D424 D449 +error(0.0009865289460392872439) D421 D451 ^ D425 D449 +error(0.002351214005477396222) D421 D451 ^ D448 D449 +error(0.01000000000000000021) D421 L0 +error(0.01700103788466153509) D422 D428 +error(0.01657742774919643974) D422 D428 ^ D425 +error(0.005959798576863498468) D422 D445 +error(0.000405679075595877963) D422 D445 ^ D420 +error(0.006365081479756801858) D422 D445 ^ D449 +error(0.0006185446772456166349) D422 D445 ^ D449 ^ D420 +error(0.02877376894243781) D422 D446 +error(0.01462010353799540405) D422 D446 ^ D449 +error(0.00255626787296149658) D422 D451 +error(0.0003462302675103233517) D422 D451 ^ D424 D425 +error(0.0006259573259455081164) D422 D451 ^ D424 D449 +error(0.001780026776757265587) D422 D451 ^ D425 D449 +error(0.0007765183634651079674) D422 D451 ^ D449 +error(0.004204068823748800116) D422 D452 +error(0.004448751937011490021) D422 D452 ^ D425 +error(0.002493712434291736613) D422 D452 ^ D449 +error(0.002122847769795885211) D422 D452 ^ D449 ^ D425 +error(0.008073481635886498378) D423 D424 +error(0.0005730018563843651807) D423 D424 ^ D421 L0 +error(0.0004628308648474659527) D423 D424 ^ D426 D427 +error(0.002505525127704565005) D423 D424 ^ D426 D450 +error(0.009108311699216133789) D423 D424 ^ D426 L0 +error(0.0001464483877319481696) D423 D424 ^ D427 D450 +error(0.001791079838534594517) D423 D424 ^ D450 L0 +error(0.000306018137642829612) D423 D424 ^ D450 L0 ^ D421 L0 +error(0.01557841355567917037) D423 D430 +error(0.01435979479825004283) D423 D430 ^ D426 L0 +error(0.02308764085533153432) D423 D447 +error(0.00431467884365783691) D423 D447 ^ D450 L0 +error(0.001931307837553560523) D423 D448 +error(0.0008665267816730684537) D423 D448 ^ D421 L0 +error(0.002496274199622507042) D423 D448 ^ D450 L0 +error(0.0003964385681257144838) D423 D448 ^ D450 L0 ^ D421 L0 +error(0.003466727401050739669) D423 D454 +error(0.004164332635934311043) D423 D454 ^ D426 L0 +error(0.002681973973769409981) D423 D454 ^ D450 L0 +error(0.001643190028824071487) D423 D454 ^ D450 L0 ^ D426 L0 +error(0.002347213007440165141) D423 D455 +error(1.438422088529517882e-05) D423 D455 ^ D426 D427 +error(0.001602485993920255191) D423 D455 ^ D426 D450 +error(0.0003906309354926121866) D423 D455 ^ D426 L0 +error(0.0002462750543915511142) D423 D455 ^ D427 D450 +error(0.0003195674037454942704) D423 D455 ^ D450 L0 +error(0.009374789236906273804) D424 D425 +error(0.0005590529469528864254) D424 D425 ^ D397 L0 +error(0.0001530608469217417504) D424 D425 ^ D421 L0 +error(0.0008647203357822550026) D424 D425 ^ D426 D427 +error(0.000648659578791030509) D424 D425 ^ D427 D428 +error(0.00193254128555270981) D424 D425 ^ D427 D451 +error(6.236263047404961928e-05) D424 D425 ^ D428 D451 +error(0.01492810779744833949) D424 D431 +error(0.01018712175352179221) D424 D431 ^ D426 D427 +error(0.02897098431077184053) D424 D448 +error(0.009580229984338856086) D424 D448 ^ D421 L0 +error(0.003392722770150778579) D424 D448 ^ D450 D451 +error(0.0009747224564062936412) D424 D448 ^ D450 L0 +error(0.002252326138938211871) D424 D449 +error(0.0005634108258186226606) D424 D449 ^ D450 D451 +error(0.002115175773512700461) D424 D455 +error(0.0030608781621897568) D424 D455 ^ D426 D427 +error(0.001270789941476938327) D424 D455 ^ D426 D450 +error(0.001939096001487852121) D424 D455 ^ D427 D450 +error(0.001187976190653792109) D424 D455 ^ D427 D451 +error(0.002026211267946444097) D424 D455 ^ D450 D451 +error(0.0009157719035976701148) D424 D456 +error(0.0001672286054041389081) D424 D456 ^ D427 D428 +error(0.0005353541060028568126) D424 D456 ^ D427 D450 +error(0.001349693943062659982) D424 D456 ^ D427 D451 +error(0.0001999317661850497118) D424 D456 ^ D428 D451 +error(0.0005670826236588418032) D424 D456 ^ D450 D451 +error(0.01000000000000000021) D425 +error(0.02725063153630395349) D425 D432 +error(0.02389252453306664817) D425 D432 ^ D427 D428 +error(0.03329807480613649479) D425 D449 +error(0.002054421110880488236) D425 D449 ^ D451 D452 +error(0.005139440185035600017) D425 D456 +error(0.002101194335119418565) D425 D456 ^ D427 D428 +error(0.0008922567876475901794) D425 D456 ^ D427 D451 +error(0.002032431206016870138) D425 D456 ^ D428 D451 +error(0.0005572318529482796516) D425 D456 ^ D428 D452 +error(0.002750366226549339366) D425 D456 ^ D451 D452 +error(0.001460790359938684765) D425 D457 +error(0.0004147934522296172497) D425 D457 ^ D428 D451 +error(0.001498989588066860232) D425 D457 ^ D428 D452 +error(0.007007209720512256115) D426 D427 +error(0.0004546663148800625083) D426 D427 ^ D430 D431 +error(0.0001425002969150308049) D426 D427 ^ D430 D455 +error(0.0005696660143250861785) D426 D427 ^ D431 D432 +error(0.003116901364237378153) D426 D427 ^ D431 D455 +error(0.01566705597438649775) D426 D435 +error(0.01186724049158091772) D426 D435 ^ D430 D431 +error(0.03336402185735180131) D426 D450 +error(0.00244917592564833364) D426 D450 ^ D454 D455 +error(0.002462421301947203146) D426 D458 +error(0.001960634436970778299) D426 D458 ^ D430 D454 +error(3.566087944092823308e-06) D426 D458 ^ D430 D455 +error(0.0001637216941453993634) D426 D458 ^ D454 D455 +error(0.004695941015552158003) D426 D459 +error(0.00205837118508770409) D426 D459 ^ D430 D431 +error(0.002163953410575679935) D426 D459 ^ D430 D454 +error(0.001554394982217835453) D426 D459 ^ D430 D455 +error(0.0008879695541101345754) D426 D459 ^ D431 D455 +error(0.002096192257208842526) D426 D459 ^ D454 D455 +error(0.01000000000000000021) D426 L0 +error(0.004381884530454759931) D430 D454 ^ D426 L0 +error(0.008692175163913264807) D427 D428 +error(0.0006905029968304733732) D427 D428 ^ D401 +error(0.00015945046755517543) D427 D428 ^ D425 +error(0.001006504109593458303) D427 D428 ^ D431 D432 +error(0.0008131714298475562147) D427 D428 ^ D431 D456 +error(0.0001651771561405014556) D427 D428 ^ D432 D433 +error(0.001649440750181971295) D427 D428 ^ D432 D456 +error(0.01789251364993136792) D427 D436 +error(0.01500802532656671066) D427 D436 ^ D431 D432 +error(0.003194379691095217307) D427 D450 +error(0.000203690984695900824) D427 D450 ^ D455 D456 +error(0.04189958697952669148) D427 D451 +error(0.002152911101466412069) D427 D451 ^ D455 D456 +error(0.00127605215256659083) D427 D459 +error(0.0001706398503003628525) D427 D459 ^ D430 D431 +error(0.0005783336597214276545) D427 D459 ^ D430 D455 +error(0.002016020127898890141) D427 D459 ^ D431 D455 +error(0.0001968335352046341011) D427 D459 ^ D431 D456 +error(0.0001375362953422371091) D427 D459 ^ D455 D456 +error(0.0009834825476811148021) D427 D460 +error(0.00207981557623123552) D427 D460 ^ D431 D432 +error(0.001841441603780133614) D427 D460 ^ D431 D455 +error(0.002505923860524120889) D427 D460 ^ D431 D456 +error(0.001419084695213386135) D427 D460 ^ D432 D456 +error(0.002852296504457221913) D427 D460 ^ D455 D456 +error(0.009019350943902253864) D428 D429 +error(0.0001633354758280312132) D428 D429 ^ D425 +error(0.0005572855800292770244) D428 D429 ^ D432 D433 +error(0.000553630490138258915) D428 D429 ^ D432 D457 +error(0.01251672150946384239) D428 D429 ^ D433 +error(0.005790639639282292236) D428 D429 ^ D433 D457 +error(0.001145685949262297476) D428 D429 ^ D457 +error(0.0003259075124975205589) D428 D429 ^ D457 ^ D425 +error(0.01461905296180973472) D428 D437 +error(0.01098538498491322471) D428 D437 ^ D432 D433 +error(0.003447214799424203578) D428 D451 +error(0.0003666576516136855319) D428 D451 ^ D456 D457 +error(0.02223358031578045318) D428 D452 +error(0.005543803677485251852) D428 D452 ^ D425 +error(0.002210910752504785439) D428 D452 ^ D456 D457 +error(0.001379541549716805683) D428 D452 ^ D457 +error(0.002924885832784762055) D428 D460 +error(0.001574022131985900515) D428 D460 ^ D432 D456 +error(0.0003547034745176052173) D428 D460 ^ D432 D457 +error(0.0002399940007932416046) D428 D460 ^ D456 D457 +error(0.002619265017415267974) D428 D461 +error(0.00158241141465816147) D428 D461 ^ D432 D433 +error(0.0004730953369301131323) D428 D461 ^ D432 D456 +error(0.002269905077607368895) D428 D461 ^ D432 D457 +error(0.0006264493750148219901) D428 D461 ^ D433 D457 +error(0.001918993207104307793) D428 D461 ^ D456 D457 +error(0.01377675457637685119) D429 +error(0.002469986989841304811) D429 D452 +error(8.555696620424324658e-05) D429 D452 ^ D425 +error(0.002594304494337347066) D429 D452 ^ D457 +error(0.0001376299769938429572) D429 D452 ^ D457 ^ D425 +error(0.03458993767437905376) D429 D453 +error(0.00595402342578680091) D429 D453 ^ D457 +error(0.00245631142944030675) D429 D461 +error(0.0003152919029694442122) D429 D461 ^ D432 D433 +error(0.0001612541715673219793) D429 D461 ^ D432 D457 +error(0.002267685579689308461) D429 D461 ^ D433 D457 +error(0.02509039495427965033) D429 ^ D433 +error(0.002041494666156196645) D429 ^ D457 ^ D433 +error(0.01000000000000000021) D430 +error(0.01187707629310352439) D430 D431 +error(0.001215264942972966392) D430 D431 ^ D434 D435 +error(0.0005861090175784376428) D430 D431 ^ D435 D436 +error(0.001982134764997857141) D430 D431 ^ D435 D459 +error(0.000425289327455776172) D430 D431 ^ D436 D459 +error(0.05297676665932575524) D430 D454 +error(0.003462771653202506312) D430 D454 ^ D458 D459 +error(0.00322690889612168132) D430 D455 +error(0.000497833939171843853) D430 D455 ^ D458 D459 +error(0.002260264554825750123) D430 D462 +error(0.0003473527278594572667) D430 D462 ^ D435 D436 +error(0.0008431892706171371455) D430 D462 ^ D435 D459 +error(0.0003892606543198490589) D430 D462 ^ D436 D459 +error(0.01190612723083741761) D430 ^ D434 L0 +error(0.004358707189286150849) D434 D458 ^ D430 +error(0.01780468578502405336) D431 D432 +error(0.0004696046272799186939) D431 D432 ^ D435 D436 +error(0.0008851561914086082629) D431 D432 ^ D436 D437 +error(0.001718406529616470267) D431 D432 ^ D436 D460 +error(0.0003621508437235534191) D431 D432 ^ D437 D460 +error(0.02155444020316826109) D431 D438 +error(0.02009756387803195501) D431 D438 ^ D435 D436 +error(0.02960309792484100769) D431 D455 +error(0.002696425463454497993) D431 D455 ^ D459 D460 +error(0.004542445374810293035) D431 D456 +error(0.0004787390755988302541) D431 D456 ^ D459 D460 +error(0.005783598058333213297) D431 D462 +error(0.006313383773074134758) D431 D462 ^ D435 D436 +error(0.001741030225433118535) D431 D462 ^ D435 D459 +error(0.007616179929498220411) D431 D462 ^ D436 D459 +error(0.002095215870669062119) D431 D462 ^ D436 D460 +error(0.003866228108010479232) D431 D462 ^ D459 D460 +error(0.001007778755732767137) D431 D463 +error(0.000791992306397491623) D431 D463 ^ D436 D437 +error(0.000442838744421881808) D431 D463 ^ D436 D459 +error(0.0011264348417513437) D431 D463 ^ D436 D460 +error(0.0007294911408703053015) D431 D463 ^ D437 D460 +error(0.0006790628791750554817) D431 D463 ^ D459 D460 +error(0.007519668875887872833) D432 D433 +error(0.000367564866391688718) D432 D433 ^ D436 D437 +error(4.196227388522683093e-05) D432 D433 ^ D437 +error(0.001830493767202687975) D432 D433 ^ D437 D461 +error(2.861025836566403991e-05) D432 D433 ^ D461 +error(0.0150479596563341516) D432 D439 +error(0.01110180417699024001) D432 D439 ^ D436 D437 +error(0.02213619326971636922) D432 D456 +error(0.002579554369470707462) D432 D456 ^ D460 D461 +error(0.003236307905156624899) D432 D457 +error(0.0005079835293430067563) D432 D457 ^ D460 D461 +error(0.001390683905584838868) D432 D463 +error(0.002396077516820634395) D432 D463 ^ D436 D437 +error(0.001515604606709302846) D432 D463 ^ D436 D460 +error(0.002611050841900463149) D432 D463 ^ D437 D460 +error(0.001030212141032500316) D432 D463 ^ D437 D461 +error(0.003086746265355783374) D432 D463 ^ D460 D461 +error(0.001205642639412828282) D432 D464 +error(5.413361691145458354e-05) D432 D464 ^ D437 +error(0.0006132114541846075744) D432 D464 ^ D437 D460 +error(0.001417719826750507691) D432 D464 ^ D437 D461 +error(0.0005980895653587027776) D432 D464 ^ D460 D461 +error(0.01000000000000000021) D433 +error(0.01636000547734253047) D433 D440 +error(0.01796233722540469674) D433 D440 ^ D437 +error(0.02381232961817726645) D433 D457 +error(0.002637023807817020799) D433 D457 ^ D461 +error(0.003450945788882907317) D433 D464 +error(0.002599654021808480656) D433 D464 ^ D437 +error(0.004061933355944112936) D433 D464 ^ D461 +error(0.0009592071290398953122) D433 D464 ^ D461 ^ D437 +error(0.01363803936237644246) D434 D435 +error(0.003930263821803167863) D434 D435 ^ D406 +error(0.01802560496900905418) D434 D435 ^ D430 +error(8.589436615621441292e-05) D434 D435 ^ D438 ^ D406 +error(0.02525902938098234171) D434 D458 +error(0.00574306903657622117) D434 L0 +error(0.0009470563290373274889) D434 L0 ^ D402 L0 ^ D406 +error(0.0008800554094711328119) D434 L0 ^ D402 L0 ^ D430 +error(0.001457843699669428847) D434 L0 ^ D430 ^ D406 +error(0.01450534184220186006) D435 D436 +error(0.0005721110364468817927) D435 D436 ^ D438 D439 +error(0.004601701592776456101) D435 D436 ^ D438 D462 +error(0.01329762689544615982) D435 D441 +error(0.01235795010597530268) D435 D441 ^ D438 +error(0.004365491728138845215) D435 D458 +error(0.002695027976132394112) D435 D458 ^ D430 +error(0.0003027628658435273408) D435 D458 ^ D462 ^ D430 +error(0.02723315102725440418) D435 D459 +error(0.00140205973473897039) D435 D459 ^ D430 +error(0.005203451391324077739) D435 D459 ^ D462 +error(0.00255544150013453002) D435 D465 +error(0.001808009258848390166) D435 D465 ^ D438 +error(0.002707021320884218929) D435 D465 ^ D462 +error(0.0006088424000031264971) D435 D465 ^ D462 ^ D438 +error(0.006472003059864666653) D436 D437 +error(0.0003994528074094950672) D436 D437 ^ D438 D439 +error(0.0004434226054838874857) D436 D437 ^ D438 D463 +error(0.0008751552090033030192) D436 D437 ^ D439 D440 +error(0.003045602539330864375) D436 D437 ^ D439 D463 +error(0.01325582626527719958) D436 D442 +error(0.01125502755749200473) D436 D442 ^ D438 D439 +error(0.007525476540747918358) D436 D459 +error(0.0006137602329925614204) D436 D459 ^ D462 D463 +error(0.02902365595154616021) D436 D460 +error(0.002401197642609727463) D436 D460 ^ D462 D463 +error(0.002408909711435769981) D436 D465 +error(0.0002707484224426097191) D436 D465 ^ D438 +error(0.001527963667674685309) D436 D465 ^ D438 D462 +error(0.0001105290094925922439) D436 D465 ^ D438 D463 +error(0.0005441160428730808241) D436 D465 ^ D462 +error(0.000356573641289079893) D436 D465 ^ D462 D463 +error(0.003107337702078268298) D436 D466 +error(0.00148514416775588306) D436 D466 ^ D438 D439 +error(0.0009343659549481646417) D436 D466 ^ D438 D462 +error(0.001133507027766949074) D436 D466 ^ D438 D463 +error(0.000964158168953031477) D436 D466 ^ D439 D463 +error(0.001858972200881762581) D436 D466 ^ D462 D463 +error(0.01000000000000000021) D437 +error(0.004493550144293693982) D437 D460 +error(0.0004616573460695907647) D437 D460 ^ D463 D464 +error(0.02153375451966943119) D437 D461 +error(0.001571041344134688862) D437 D461 ^ D463 D464 +error(0.001727413411201550366) D437 D466 +error(6.892623931214466931e-05) D437 D466 ^ D438 D439 +error(0.000533806835748320543) D437 D466 ^ D438 D463 +error(0.001001657939292958282) D437 D466 ^ D439 D463 +error(0.0006587014447459603635) D437 ^ D405 ^ D409 +error(0.0009512945064856004112) D437 ^ D405 ^ D433 +error(0.0004374836472664517121) D437 ^ D409 +error(0.01000000000000000021) D438 +error(0.006089189670584919251) D438 D439 +error(0.0003733339846648112744) D438 D439 ^ D441 D442 +error(0.002491417993463262287) D438 D439 ^ D442 D466 +error(0.0005065788208640180758) D438 D439 ^ D466 +error(0.0367379142487225252) D438 D462 +error(0.004448757689050466223) D438 D462 ^ D465 D466 +error(0.003134023997971539712) D438 D463 +error(0.0003650194631049960385) D438 D463 ^ D465 D466 +error(0.001406953404968496737) D438 D467 +error(0.000258713445676149944) D438 D467 ^ D442 +error(0.001311719158548649289) D438 D467 ^ D442 D466 +error(0.01016476222491488092) D439 D440 +error(0.002108544545389898564) D439 D440 ^ D413 +error(0.01205056218453301811) D439 D440 ^ D437 +error(8.106206907232670631e-05) D439 D440 ^ D442 +error(0.0003126805541716948288) D439 D440 ^ D442 ^ D413 +error(0.01810275288528837012) D439 D443 +error(0.01637617210264374554) D439 D443 ^ D442 +error(0.02102885356741089617) D439 D463 +error(0.001690237581495826133) D439 D463 ^ D437 +error(0.00359606707161589734) D439 D463 ^ D466 +error(0.003107887681254754581) D439 D464 +error(0.003382303353831740949) D439 D464 ^ D437 +error(0.0001913183606313894702) D439 D464 ^ D466 +error(0.0002941212067804130489) D439 D464 ^ D466 ^ D437 +error(0.003693046244270884078) D439 D467 +error(0.003186564243865780671) D439 D467 ^ D442 +error(0.004755038122238004067) D439 D467 ^ D466 +error(0.001954054770515154492) D439 D467 ^ D466 ^ D442 +error(0.02640784577619364679) D440 D464 +error(0.00290739257373180118) D440 D464 ^ D437 +error(0.006564866789739933102) D441 D442 +error(0.001832679987383818189) D441 D442 ^ D414 +error(0.01288524193192810627) D441 D442 ^ D438 +error(0.0006173749993255437177) D441 D442 ^ D443 +error(0.0004559863367010421231) D441 D442 ^ D443 ^ D414 +error(0.03275880248144626833) D441 D465 +error(0.00429567725900462799) D441 D465 ^ D438 +error(0.01072741549435932314) D442 +error(0.002509590526077771534) D442 D465 +error(0.003096878840847453254) D442 D465 ^ D438 +error(0.0004658229008440930739) D442 D465 ^ D467 +error(0.0006984840680404692847) D442 D465 ^ D467 ^ D438 +error(0.02371714611383288207) D442 D466 +error(0.001691210042327366938) D442 D466 ^ D438 +error(0.002968485154357761256) D442 D466 ^ D467 +error(0.01188288263817612218) D442 ^ D443 +error(0.001107203287059167415) D442 ^ D467 +error(0.004560533548355043092) D443 D467 ^ D442 +error(0.005000000000000000104) D443 +error(0.01983080680743972563) D443 D467 +error(0.005000000000000000104) D444 +error(0.01768647969650154195) D444 D448 +error(0.01997660103599073478) D444 D448 ^ D445 L0 +error(0.0272133096145726304) D444 D468 +error(0.009354172066671974373) D444 D468 ^ D469 L0 +error(0.006575429550073013871) D444 D472 +error(0.006606814816559495283) D444 D472 ^ D445 L0 +error(0.00570203587243049443) D444 D472 ^ D469 L0 +error(0.004394467297965208054) D444 D472 ^ D469 L0 ^ D445 L0 +error(0.003141484544212969771) D444 D473 +error(0.002866645116274591214) D444 D473 ^ D445 D469 +error(0.0007467639087963555584) D444 D473 ^ D445 L0 +error(0.00100340881217143808) D444 D473 ^ D469 L0 +error(0.005000000000000000104) D444 ^ D445 L0 +error(0.006716177406890511993) D445 D469 ^ D444 +error(0.006831737513122857625) D445 D446 +error(0.000925383923960359611) D445 D446 ^ D444 +error(0.0002795442616193875634) D445 D446 ^ D448 D449 +error(0.0005690671345596917631) D445 D446 ^ D448 D473 +error(0.01632363663664802497) D445 D446 ^ D449 +error(0.004686760244772980415) D445 D446 ^ D449 D473 +error(0.003622701663117294888) D445 D446 ^ D473 +error(0.0006213698150018824758) D445 D446 ^ D473 ^ D444 +error(0.02092676657561087783) D445 D451 +error(0.0132551803359697469) D445 D451 ^ D448 D449 +error(0.05139236901086036841) D445 D469 +error(0.003561108508096676607) D445 D469 ^ D472 D473 +error(0.0046639615040387555) D445 D469 ^ D473 +error(0.004108367013198443128) D445 D474 +error(0.001863368595620282274) D445 D474 ^ D448 D472 +error(0.0002077739562874012804) D445 D474 ^ D448 D473 +error(0.0001534208996732992975) D445 D474 ^ D472 D473 +error(0.002474351314484049547) D445 D475 +error(0.001842181383880251615) D445 D475 ^ D448 D449 +error(0.0007357888818581343913) D445 D475 ^ D448 D472 +error(0.002176810431023448646) D445 D475 ^ D448 D473 +error(0.0009865289460392872439) D445 D475 ^ D449 D473 +error(0.002351214005477396222) D445 D475 ^ D472 D473 +error(0.01000000000000000021) D445 L0 +error(0.01700103788466153509) D446 D452 +error(0.01657742774919643974) D446 D452 ^ D449 +error(0.005959798576863498468) D446 D469 +error(0.000405679075595877963) D446 D469 ^ D444 +error(0.006365081479756801858) D446 D469 ^ D473 +error(0.0006185446772456166349) D446 D469 ^ D473 ^ D444 +error(0.02877376894243781) D446 D470 +error(0.01462010353799540405) D446 D470 ^ D473 +error(0.00255626787296149658) D446 D475 +error(0.0003462302675103233517) D446 D475 ^ D448 D449 +error(0.0006259573259455081164) D446 D475 ^ D448 D473 +error(0.001780026776757265587) D446 D475 ^ D449 D473 +error(0.0007765183634651079674) D446 D475 ^ D473 +error(0.004204068823748800116) D446 D476 +error(0.004448751937011490021) D446 D476 ^ D449 +error(0.002493712434291736613) D446 D476 ^ D473 +error(0.002122847769795885211) D446 D476 ^ D473 ^ D449 +error(0.008073481635886498378) D447 D448 +error(0.0005730018563843651807) D447 D448 ^ D445 L0 +error(0.0004628308648474659527) D447 D448 ^ D450 D451 +error(0.002505525127704565005) D447 D448 ^ D450 D474 +error(0.009108311699216133789) D447 D448 ^ D450 L0 +error(0.0001464483877319481696) D447 D448 ^ D451 D474 +error(0.001791079838534594517) D447 D448 ^ D474 L0 +error(0.000306018137642829612) D447 D448 ^ D474 L0 ^ D445 L0 +error(0.01557841355567917037) D447 D454 +error(0.01435979479825004283) D447 D454 ^ D450 L0 +error(0.02308764085533153432) D447 D471 +error(0.00431467884365783691) D447 D471 ^ D474 L0 +error(0.001931307837553560523) D447 D472 +error(0.0008665267816730684537) D447 D472 ^ D445 L0 +error(0.002496274199622507042) D447 D472 ^ D474 L0 +error(0.0003964385681257144838) D447 D472 ^ D474 L0 ^ D445 L0 +error(0.003466727401050739669) D447 D478 +error(0.004164332635934311043) D447 D478 ^ D450 L0 +error(0.002681973973769409981) D447 D478 ^ D474 L0 +error(0.001643190028824071487) D447 D478 ^ D474 L0 ^ D450 L0 +error(0.002347213007440165141) D447 D479 +error(1.438422088529517882e-05) D447 D479 ^ D450 D451 +error(0.001602485993920255191) D447 D479 ^ D450 D474 +error(0.0003906309354926121866) D447 D479 ^ D450 L0 +error(0.0002462750543915511142) D447 D479 ^ D451 D474 +error(0.0003195674037454942704) D447 D479 ^ D474 L0 +error(0.009374789236906273804) D448 D449 +error(0.0005590529469528864254) D448 D449 ^ D421 L0 +error(0.0001530608469217417504) D448 D449 ^ D445 L0 +error(0.0008647203357822550026) D448 D449 ^ D450 D451 +error(0.000648659578791030509) D448 D449 ^ D451 D452 +error(0.00193254128555270981) D448 D449 ^ D451 D475 +error(6.236263047404961928e-05) D448 D449 ^ D452 D475 +error(0.01492810779744833949) D448 D455 +error(0.01018712175352179221) D448 D455 ^ D450 D451 +error(0.02897098431077184053) D448 D472 +error(0.009580229984338856086) D448 D472 ^ D445 L0 +error(0.003392722770150778579) D448 D472 ^ D474 D475 +error(0.0009747224564062936412) D448 D472 ^ D474 L0 +error(0.002252326138938211871) D448 D473 +error(0.0005634108258186226606) D448 D473 ^ D474 D475 +error(0.002115175773512700461) D448 D479 +error(0.0030608781621897568) D448 D479 ^ D450 D451 +error(0.001270789941476938327) D448 D479 ^ D450 D474 +error(0.001939096001487852121) D448 D479 ^ D451 D474 +error(0.001187976190653792109) D448 D479 ^ D451 D475 +error(0.002026211267946444097) D448 D479 ^ D474 D475 +error(0.0009157719035976701148) D448 D480 +error(0.0001672286054041389081) D448 D480 ^ D451 D452 +error(0.0005353541060028568126) D448 D480 ^ D451 D474 +error(0.001349693943062659982) D448 D480 ^ D451 D475 +error(0.0001999317661850497118) D448 D480 ^ D452 D475 +error(0.0005670826236588418032) D448 D480 ^ D474 D475 +error(0.01000000000000000021) D449 +error(0.02725063153630395349) D449 D456 +error(0.02389252453306664817) D449 D456 ^ D451 D452 +error(0.03329807480613649479) D449 D473 +error(0.002054421110880488236) D449 D473 ^ D475 D476 +error(0.005139440185035600017) D449 D480 +error(0.002101194335119418565) D449 D480 ^ D451 D452 +error(0.0008922567876475901794) D449 D480 ^ D451 D475 +error(0.002032431206016870138) D449 D480 ^ D452 D475 +error(0.0005572318529482796516) D449 D480 ^ D452 D476 +error(0.002750366226549339366) D449 D480 ^ D475 D476 +error(0.001460790359938684765) D449 D481 +error(0.0004147934522296172497) D449 D481 ^ D452 D475 +error(0.001498989588066860232) D449 D481 ^ D452 D476 +error(0.007007209720512256115) D450 D451 +error(0.0004546663148800625083) D450 D451 ^ D454 D455 +error(0.0001425002969150308049) D450 D451 ^ D454 D479 +error(0.0005696660143250861785) D450 D451 ^ D455 D456 +error(0.003116901364237378153) D450 D451 ^ D455 D479 +error(0.01566705597438649775) D450 D459 +error(0.01186724049158091772) D450 D459 ^ D454 D455 +error(0.03336402185735180131) D450 D474 +error(0.00244917592564833364) D450 D474 ^ D478 D479 +error(0.002462421301947203146) D450 D482 +error(0.001960634436970778299) D450 D482 ^ D454 D478 +error(3.566087944092823308e-06) D450 D482 ^ D454 D479 +error(0.0001637216941453993634) D450 D482 ^ D478 D479 +error(0.004695941015552158003) D450 D483 +error(0.00205837118508770409) D450 D483 ^ D454 D455 +error(0.002163953410575679935) D450 D483 ^ D454 D478 +error(0.001554394982217835453) D450 D483 ^ D454 D479 +error(0.0008879695541101345754) D450 D483 ^ D455 D479 +error(0.002096192257208842526) D450 D483 ^ D478 D479 +error(0.01000000000000000021) D450 L0 +error(0.004381884530454759931) D454 D478 ^ D450 L0 +error(0.008692175163913264807) D451 D452 +error(0.0006905029968304733732) D451 D452 ^ D425 +error(0.00015945046755517543) D451 D452 ^ D449 +error(0.001006504109593458303) D451 D452 ^ D455 D456 +error(0.0008131714298475562147) D451 D452 ^ D455 D480 +error(0.0001651771561405014556) D451 D452 ^ D456 D457 +error(0.001649440750181971295) D451 D452 ^ D456 D480 +error(0.01789251364993136792) D451 D460 +error(0.01500802532656671066) D451 D460 ^ D455 D456 +error(0.003194379691095217307) D451 D474 +error(0.000203690984695900824) D451 D474 ^ D479 D480 +error(0.04189958697952669148) D451 D475 +error(0.002152911101466412069) D451 D475 ^ D479 D480 +error(0.00127605215256659083) D451 D483 +error(0.0001706398503003628525) D451 D483 ^ D454 D455 +error(0.0005783336597214276545) D451 D483 ^ D454 D479 +error(0.002016020127898890141) D451 D483 ^ D455 D479 +error(0.0001968335352046341011) D451 D483 ^ D455 D480 +error(0.0001375362953422371091) D451 D483 ^ D479 D480 +error(0.0009834825476811148021) D451 D484 +error(0.00207981557623123552) D451 D484 ^ D455 D456 +error(0.001841441603780133614) D451 D484 ^ D455 D479 +error(0.002505923860524120889) D451 D484 ^ D455 D480 +error(0.001419084695213386135) D451 D484 ^ D456 D480 +error(0.002852296504457221913) D451 D484 ^ D479 D480 +error(0.009019350943902253864) D452 D453 +error(0.0001633354758280312132) D452 D453 ^ D449 +error(0.0005572855800292770244) D452 D453 ^ D456 D457 +error(0.000553630490138258915) D452 D453 ^ D456 D481 +error(0.01251672150946384239) D452 D453 ^ D457 +error(0.005790639639282292236) D452 D453 ^ D457 D481 +error(0.001145685949262297476) D452 D453 ^ D481 +error(0.0003259075124975205589) D452 D453 ^ D481 ^ D449 +error(0.01461905296180973472) D452 D461 +error(0.01098538498491322471) D452 D461 ^ D456 D457 +error(0.003447214799424203578) D452 D475 +error(0.0003666576516136855319) D452 D475 ^ D480 D481 +error(0.02223358031578045318) D452 D476 +error(0.005543803677485251852) D452 D476 ^ D449 +error(0.002210910752504785439) D452 D476 ^ D480 D481 +error(0.001379541549716805683) D452 D476 ^ D481 +error(0.002924885832784762055) D452 D484 +error(0.001574022131985900515) D452 D484 ^ D456 D480 +error(0.0003547034745176052173) D452 D484 ^ D456 D481 +error(0.0002399940007932416046) D452 D484 ^ D480 D481 +error(0.002619265017415267974) D452 D485 +error(0.00158241141465816147) D452 D485 ^ D456 D457 +error(0.0004730953369301131323) D452 D485 ^ D456 D480 +error(0.002269905077607368895) D452 D485 ^ D456 D481 +error(0.0006264493750148219901) D452 D485 ^ D457 D481 +error(0.001918993207104307793) D452 D485 ^ D480 D481 +error(0.01377675457637685119) D453 +error(0.002469986989841304811) D453 D476 +error(8.555696620424324658e-05) D453 D476 ^ D449 +error(0.002594304494337347066) D453 D476 ^ D481 +error(0.0001376299769938429572) D453 D476 ^ D481 ^ D449 +error(0.03458993767437905376) D453 D477 +error(0.00595402342578680091) D453 D477 ^ D481 +error(0.00245631142944030675) D453 D485 +error(0.0003152919029694442122) D453 D485 ^ D456 D457 +error(0.0001612541715673219793) D453 D485 ^ D456 D481 +error(0.002267685579689308461) D453 D485 ^ D457 D481 +error(0.02509039495427965033) D453 ^ D457 +error(0.002041494666156196645) D453 ^ D481 ^ D457 +error(0.01000000000000000021) D454 +error(0.01187707629310352439) D454 D455 +error(0.001215264942972966392) D454 D455 ^ D458 D459 +error(0.0005861090175784376428) D454 D455 ^ D459 D460 +error(0.001982134764997857141) D454 D455 ^ D459 D483 +error(0.000425289327455776172) D454 D455 ^ D460 D483 +error(0.05297676665932575524) D454 D478 +error(0.003462771653202506312) D454 D478 ^ D482 D483 +error(0.00322690889612168132) D454 D479 +error(0.000497833939171843853) D454 D479 ^ D482 D483 +error(0.002260264554825750123) D454 D486 +error(0.0003473527278594572667) D454 D486 ^ D459 D460 +error(0.0008431892706171371455) D454 D486 ^ D459 D483 +error(0.0003892606543198490589) D454 D486 ^ D460 D483 +error(0.01190612723083741761) D454 ^ D458 L0 +error(0.004358707189286150849) D458 D482 ^ D454 +error(0.01780468578502405336) D455 D456 +error(0.0004696046272799186939) D455 D456 ^ D459 D460 +error(0.0008851561914086082629) D455 D456 ^ D460 D461 +error(0.001718406529616470267) D455 D456 ^ D460 D484 +error(0.0003621508437235534191) D455 D456 ^ D461 D484 +error(0.02155444020316826109) D455 D462 +error(0.02009756387803195501) D455 D462 ^ D459 D460 +error(0.02960309792484100769) D455 D479 +error(0.002696425463454497993) D455 D479 ^ D483 D484 +error(0.004542445374810293035) D455 D480 +error(0.0004787390755988302541) D455 D480 ^ D483 D484 +error(0.005783598058333213297) D455 D486 +error(0.006313383773074134758) D455 D486 ^ D459 D460 +error(0.001741030225433118535) D455 D486 ^ D459 D483 +error(0.007616179929498220411) D455 D486 ^ D460 D483 +error(0.002095215870669062119) D455 D486 ^ D460 D484 +error(0.003866228108010479232) D455 D486 ^ D483 D484 +error(0.001007778755732767137) D455 D487 +error(0.000791992306397491623) D455 D487 ^ D460 D461 +error(0.000442838744421881808) D455 D487 ^ D460 D483 +error(0.0011264348417513437) D455 D487 ^ D460 D484 +error(0.0007294911408703053015) D455 D487 ^ D461 D484 +error(0.0006790628791750554817) D455 D487 ^ D483 D484 +error(0.007519668875887872833) D456 D457 +error(0.000367564866391688718) D456 D457 ^ D460 D461 +error(4.196227388522683093e-05) D456 D457 ^ D461 +error(0.001830493767202687975) D456 D457 ^ D461 D485 +error(2.861025836566403991e-05) D456 D457 ^ D485 +error(0.0150479596563341516) D456 D463 +error(0.01110180417699024001) D456 D463 ^ D460 D461 +error(0.02213619326971636922) D456 D480 +error(0.002579554369470707462) D456 D480 ^ D484 D485 +error(0.003236307905156624899) D456 D481 +error(0.0005079835293430067563) D456 D481 ^ D484 D485 +error(0.001390683905584838868) D456 D487 +error(0.002396077516820634395) D456 D487 ^ D460 D461 +error(0.001515604606709302846) D456 D487 ^ D460 D484 +error(0.002611050841900463149) D456 D487 ^ D461 D484 +error(0.001030212141032500316) D456 D487 ^ D461 D485 +error(0.003086746265355783374) D456 D487 ^ D484 D485 +error(0.001205642639412828282) D456 D488 +error(5.413361691145458354e-05) D456 D488 ^ D461 +error(0.0006132114541846075744) D456 D488 ^ D461 D484 +error(0.001417719826750507691) D456 D488 ^ D461 D485 +error(0.0005980895653587027776) D456 D488 ^ D484 D485 +error(0.01000000000000000021) D457 +error(0.01636000547734253047) D457 D464 +error(0.01796233722540469674) D457 D464 ^ D461 +error(0.02381232961817726645) D457 D481 +error(0.002637023807817020799) D457 D481 ^ D485 +error(0.003450945788882907317) D457 D488 +error(0.002599654021808480656) D457 D488 ^ D461 +error(0.004061933355944112936) D457 D488 ^ D485 +error(0.0009592071290398953122) D457 D488 ^ D485 ^ D461 +error(0.01363803936237644246) D458 D459 +error(0.003930263821803167863) D458 D459 ^ D430 +error(0.01802560496900905418) D458 D459 ^ D454 +error(8.589436615621441292e-05) D458 D459 ^ D462 ^ D430 +error(0.02525902938098234171) D458 D482 +error(0.00574306903657622117) D458 L0 +error(0.0009470563290373274889) D458 L0 ^ D426 L0 ^ D430 +error(0.0008800554094711328119) D458 L0 ^ D426 L0 ^ D454 +error(0.001457843699669428847) D458 L0 ^ D454 ^ D430 +error(0.01450534184220186006) D459 D460 +error(0.0005721110364468817927) D459 D460 ^ D462 D463 +error(0.004601701592776456101) D459 D460 ^ D462 D486 +error(0.01329762689544615982) D459 D465 +error(0.01235795010597530268) D459 D465 ^ D462 +error(0.004365491728138845215) D459 D482 +error(0.002695027976132394112) D459 D482 ^ D454 +error(0.0003027628658435273408) D459 D482 ^ D486 ^ D454 +error(0.02723315102725440418) D459 D483 +error(0.00140205973473897039) D459 D483 ^ D454 +error(0.005203451391324077739) D459 D483 ^ D486 +error(0.00255544150013453002) D459 D489 +error(0.001808009258848390166) D459 D489 ^ D462 +error(0.002707021320884218929) D459 D489 ^ D486 +error(0.0006088424000031264971) D459 D489 ^ D486 ^ D462 +error(0.006472003059864666653) D460 D461 +error(0.0003994528074094950672) D460 D461 ^ D462 D463 +error(0.0004434226054838874857) D460 D461 ^ D462 D487 +error(0.0008751552090033030192) D460 D461 ^ D463 D464 +error(0.003045602539330864375) D460 D461 ^ D463 D487 +error(0.01325582626527719958) D460 D466 +error(0.01125502755749200473) D460 D466 ^ D462 D463 +error(0.007525476540747918358) D460 D483 +error(0.0006137602329925614204) D460 D483 ^ D486 D487 +error(0.02902365595154616021) D460 D484 +error(0.002401197642609727463) D460 D484 ^ D486 D487 +error(0.002408909711435769981) D460 D489 +error(0.0002707484224426097191) D460 D489 ^ D462 +error(0.001527963667674685309) D460 D489 ^ D462 D486 +error(0.0001105290094925922439) D460 D489 ^ D462 D487 +error(0.0005441160428730808241) D460 D489 ^ D486 +error(0.000356573641289079893) D460 D489 ^ D486 D487 +error(0.003107337702078268298) D460 D490 +error(0.00148514416775588306) D460 D490 ^ D462 D463 +error(0.0009343659549481646417) D460 D490 ^ D462 D486 +error(0.001133507027766949074) D460 D490 ^ D462 D487 +error(0.000964158168953031477) D460 D490 ^ D463 D487 +error(0.001858972200881762581) D460 D490 ^ D486 D487 +error(0.01000000000000000021) D461 +error(0.004493550144293693982) D461 D484 +error(0.0004616573460695907647) D461 D484 ^ D487 D488 +error(0.02153375451966943119) D461 D485 +error(0.001571041344134688862) D461 D485 ^ D487 D488 +error(0.001727413411201550366) D461 D490 +error(6.892623931214466931e-05) D461 D490 ^ D462 D463 +error(0.000533806835748320543) D461 D490 ^ D462 D487 +error(0.001001657939292958282) D461 D490 ^ D463 D487 +error(0.0006587014447459603635) D461 ^ D429 ^ D433 +error(0.0009512945064856004112) D461 ^ D429 ^ D457 +error(0.0004374836472664517121) D461 ^ D433 +error(0.01000000000000000021) D462 +error(0.006089189670584919251) D462 D463 +error(0.0003733339846648112744) D462 D463 ^ D465 D466 +error(0.002491417993463262287) D462 D463 ^ D466 D490 +error(0.0005065788208640180758) D462 D463 ^ D490 +error(0.0367379142487225252) D462 D486 +error(0.004448757689050466223) D462 D486 ^ D489 D490 +error(0.003134023997971539712) D462 D487 +error(0.0003650194631049960385) D462 D487 ^ D489 D490 +error(0.001406953404968496737) D462 D491 +error(0.000258713445676149944) D462 D491 ^ D466 +error(0.001311719158548649289) D462 D491 ^ D466 D490 +error(0.01016476222491488092) D463 D464 +error(0.002108544545389898564) D463 D464 ^ D437 +error(0.01205056218453301811) D463 D464 ^ D461 +error(8.106206907232670631e-05) D463 D464 ^ D466 +error(0.0003126805541716948288) D463 D464 ^ D466 ^ D437 +error(0.01810275288528837012) D463 D467 +error(0.01637617210264374554) D463 D467 ^ D466 +error(0.02102885356741089617) D463 D487 +error(0.001690237581495826133) D463 D487 ^ D461 +error(0.00359606707161589734) D463 D487 ^ D490 +error(0.003107887681254754581) D463 D488 +error(0.003382303353831740949) D463 D488 ^ D461 +error(0.0001913183606313894702) D463 D488 ^ D490 +error(0.0002941212067804130489) D463 D488 ^ D490 ^ D461 +error(0.003693046244270884078) D463 D491 +error(0.003186564243865780671) D463 D491 ^ D466 +error(0.004755038122238004067) D463 D491 ^ D490 +error(0.001954054770515154492) D463 D491 ^ D490 ^ D466 +error(0.02640784577619364679) D464 D488 +error(0.00290739257373180118) D464 D488 ^ D461 +error(0.006564866789739933102) D465 D466 +error(0.001832679987383818189) D465 D466 ^ D438 +error(0.01288524193192810627) D465 D466 ^ D462 +error(0.0006173749993255437177) D465 D466 ^ D467 +error(0.0004559863367010421231) D465 D466 ^ D467 ^ D438 +error(0.03275880248144626833) D465 D489 +error(0.00429567725900462799) D465 D489 ^ D462 +error(0.01072741549435932314) D466 +error(0.002509590526077771534) D466 D489 +error(0.003096878840847453254) D466 D489 ^ D462 +error(0.0004658229008440930739) D466 D489 ^ D491 +error(0.0006984840680404692847) D466 D489 ^ D491 ^ D462 +error(0.02371714611383288207) D466 D490 +error(0.001691210042327366938) D466 D490 ^ D462 +error(0.002968485154357761256) D466 D490 ^ D491 +error(0.01188288263817612218) D466 ^ D467 +error(0.001107203287059167415) D466 ^ D491 +error(0.004560533548355043092) D467 D491 ^ D466 +error(0.005000000000000000104) D467 +error(0.01983080680743972563) D467 D491 +error(0.02880918020350757905) D468 +error(0.02003957038212127173) D468 D472 +error(0.02244855104028874865) D468 D472 ^ D469 L0 +error(0.009025115718429595549) D468 ^ D469 L0 +error(0.01290486410099908436) D468 ^ D492 L0 +error(0.0206851198123324323) D469 D492 ^ D468 +error(0.006174483730010268089) D469 D470 +error(0.001947623143724570328) D469 D470 ^ D468 +error(0.001552966183064986806) D469 D470 ^ D472 +error(0.02377346622303552759) D469 D470 ^ D473 +error(0.02081050938390573146) D469 D475 +error(0.01260178367118845906) D469 D475 ^ D472 D473 +error(0.06717273647463013753) D469 D492 +error(0.00364358032944041765) D469 D493 +error(0.002171725293134066717) D469 D493 ^ D472 +error(0.002687829941371012478) D469 D496 +error(0.003562145314822662799) D469 D496 ^ D472 +error(0.001836832906821348962) D469 D496 ^ D473 +error(0.01000000000000000021) D469 L0 +error(0.001967250171280582847) D469 L0 ^ D471 +error(0.02008344052539562732) D470 D476 +error(0.01768405767480930868) D470 D476 ^ D473 +error(0.01998206979044500273) D470 D492 +error(0.00305172032302819746) D470 D492 ^ D468 +error(0.03650239096971852337) D470 D495 +error(0.005076191653693148953) D470 D496 +error(0.002924584336952379231) D470 D496 ^ D473 +error(0.0003368708768835744515) D470 D496 ^ D473 ^ D472 +error(0.01114574902729756865) D470 D498 +error(0.006710243364002461269) D470 D498 ^ D473 +error(0.01634434808138832823) D471 +error(0.009113249823642904229) D471 D472 +error(0.001664451563288719222) D471 D472 ^ D474 D493 +error(0.01050329413380788127) D471 D472 ^ D474 L0 +error(0.0035978572493953879) D471 D472 ^ D493 L0 +error(0.01657382563654344679) D471 D478 +error(0.01696716031085702611) D471 D478 ^ D474 L0 +error(0.005000000000000000104) D471 ^ D474 L0 +error(0.008657528659438223917) D471 ^ D493 L0 +error(0.005638979359590931377) D474 D493 ^ D471 +error(0.01000000000000000021) D472 +error(0.00883188325517115895) D472 D473 +error(0.0005590529469528864254) D472 D473 ^ D445 L0 +error(0.0001956520212512762274) D472 D473 ^ D469 L0 +error(0.001316613592681568435) D472 D473 ^ D475 D496 +error(0.008758900766310471694) D472 D479 +error(0.009729515521004100317) D472 D479 ^ D474 D475 +error(0.001457076801821935094) D472 ^ D469 L0 +error(0.001040252746733397963) D472 ^ D469 L0 ^ D471 +error(0.02225350015444733237) D473 +error(0.02703901807041386718) D473 D480 +error(0.02084456610492101472) D473 D480 ^ D475 D476 +error(0.0127823193126658588) D474 D475 +error(0.003172389698871251086) D474 D475 ^ D472 +error(0.003345459530527848929) D474 D475 ^ D478 +error(0.005435871674284658596) D474 D475 ^ D479 +error(0.01760431911344322378) D474 D483 +error(0.0101838032546384908) D474 D483 ^ D478 D479 +error(0.0348300631948146866) D474 D493 +error(0.002380819679841402955) D474 D493 ^ D472 +error(0.004174583926305682272) D474 D494 +error(0.002798376862325288421) D474 D494 ^ D478 +error(0.006276795527206408681) D474 D497 +error(0.004354933604443503997) D474 D497 ^ D478 +error(0.002873781619221763874) D474 D497 ^ D478 D479 +error(0.001263097674180198348) D474 D497 ^ D479 +error(0.01000000000000000021) D474 L0 +error(0.01275124817004063237) D475 D476 +error(0.0006905029968304733732) D475 D476 ^ D449 +error(0.0006754051867342412583) D475 D476 ^ D472 ^ D473 +error(0.00431758207017997591) D475 D476 ^ D473 +error(0.0002703480815135414213) D475 D476 ^ D479 +error(0.00340192912709614409) D475 D476 ^ D480 +error(0.0004078826059670124442) D475 D476 ^ D480 D481 +error(0.0168801570880338439) D475 D484 +error(0.0142868061070765065) D475 D484 ^ D479 D480 +error(0.004644277458918269312) D475 D493 +error(3.972856223321416459e-05) D475 D493 ^ D471 +error(0.004003610007050980787) D475 D493 ^ D472 +error(0.04641390524623390662) D475 D496 +error(0.002953725612198112877) D475 D496 ^ D472 +error(0.001344887377550819073) D475 D496 ^ D473 +error(0.0001706104615689129137) D475 D497 ^ D478 +error(0.003618665861389541803) D475 D497 ^ D479 +error(0.0001886244459799125885) D475 D497 ^ D479 ^ D478 +error(0.004666040570277685089) D475 D499 +error(0.001724648319000026547) D475 D499 ^ D479 +error(0.002191285134869398916) D475 D499 ^ D479 D480 +error(0.0004120528723099181915) D475 D499 ^ D480 +error(0.006427479462759957789) D476 D477 +error(0.002910507714247721409) D476 D477 ^ D473 +error(0.0007175593903123440691) D476 D477 ^ D480 +error(0.01812847651597346635) D476 D477 ^ D481 +error(0.0001644252224078595703) D476 D477 ^ D481 ^ D480 +error(0.01572529358049134032) D476 D485 +error(0.009986010938699831432) D476 D485 ^ D480 D481 +error(0.005865078293751420022) D476 D496 +error(6.186867738115648112e-05) D476 D496 ^ D472 ^ D473 +error(0.002202127844622605701) D476 D496 ^ D473 +error(0.02793143185684520552) D476 D498 +error(0.008182681825050254487) D476 D498 ^ D473 +error(0.002462436831343086958) D476 D499 +error(0.002642547038657644225) D476 D499 ^ D480 +error(0.003561220978726481294) D476 D502 +error(0.00223524801784844929) D476 D502 ^ D480 +error(0.003531927812468114297) D476 D502 ^ D480 D481 +error(0.001468201640135028243) D476 D502 ^ D481 +error(0.01263324104162899184) D477 +error(0.003630093830261312427) D477 D498 +error(0.001917533076795846069) D477 D498 ^ D473 +error(0.03873389071703270403) D477 D501 +error(0.004694252462767415854) D477 D502 +error(0.0006927661678410103373) D477 D502 ^ D480 +error(0.001846594966962702847) D477 D502 ^ D481 +error(0.0003135206109395635536) D477 D502 ^ D481 ^ D480 +error(0.03210957020253763644) D477 ^ D481 +error(0.06148133315875099758) D478 +error(0.01210078012187682656) D478 D479 +error(0.002108247216928614554) D478 D479 ^ D474 L0 +error(0.001588607435030572022) D478 D479 ^ D483 D497 +error(0.01002738106749426032) D478 ^ D482 L0 +error(0.00518483576366705369) D482 D494 ^ D478 +error(0.01000000000000000021) D479 +error(0.0217705705081630875) D479 D480 +error(0.001591663714993174147) D479 D480 ^ D484 D499 +error(0.0207765203844169459) D479 D486 +error(0.0221729097455438777) D479 D486 ^ D483 D484 +error(0.01000000000000000021) D480 +error(0.005479025053645372213) D480 D481 +error(0.001905143352721191865) D480 D481 ^ D484 D485 +error(0.002061212402680411351) D480 D481 ^ D485 D502 +error(0.01509056238609333619) D480 D487 +error(0.009760164660145100035) D480 D487 ^ D484 D485 +error(0.001186631121606961754) D480 ^ D502 +error(0.00436641395951607985) D485 D502 ^ D480 +error(0.03956166521251460594) D481 +error(0.01335712450206761465) D481 D488 +error(0.01754311344901773873) D481 D488 ^ D485 +error(0.0003255104030344797513) D481 ^ D485 +error(0.004243063097225959965) D481 ^ D502 +error(0.00284429333824764291) D481 ^ D502 ^ D485 +error(0.01294726591277541028) D482 D483 +error(0.003930263821803167863) D482 D483 ^ D454 +error(0.02121427469230691143) D482 D483 ^ D478 +error(8.589436615621441292e-05) D482 D483 ^ D486 ^ D454 +error(0.02562471561461093436) D482 D494 +error(0.008029709004877287268) D482 L0 +error(0.0009470563290373274889) D482 L0 ^ D450 L0 ^ D454 +error(0.0008800554094711328119) D482 L0 ^ D450 L0 ^ D478 +error(0.001457843699669428847) D482 L0 ^ D478 ^ D454 +error(0.01525990457373144378) D483 D484 +error(0.00113523042040268563) D483 D484 ^ D478 ^ D479 +error(0.003826011980558598983) D483 D484 ^ D479 +error(0.002695703087347527897) D483 D484 ^ D486 +error(0.0007426404408103719603) D483 D484 ^ D486 D487 +error(0.01393664149609949963) D483 D489 +error(0.01471827921748176775) D483 D489 ^ D486 +error(0.001807927301382823183) D483 D494 +error(0.00470754607961047615) D483 D494 ^ D478 +error(0.03207801623052895096) D483 D497 +error(0.002971837238251415735) D483 D497 ^ D478 +error(0.005006318833527182224) D483 D497 ^ D479 +error(0.004887998495181338811) D483 D500 +error(0.003203842071739687689) D483 D500 ^ D486 +error(0.007660385278868877233) D484 D485 +error(0.001406994508567791782) D484 D485 ^ D479 +error(0.001855704072760456852) D484 D485 ^ D480 +error(0.002205567943602341954) D484 D485 ^ D486 +error(0.001874384530407353444) D484 D485 ^ D487 +error(0.0005904000120528988659) D484 D485 ^ D487 D488 +error(0.01470473052459673156) D484 D490 +error(0.008313467622227345769) D484 D490 ^ D486 D487 +error(0.0102734519603547448) D484 D497 +error(0.002249114713961202633) D484 D497 ^ D478 ^ D479 +error(0.008388053949821540345) D484 D497 ^ D479 +error(0.03414276975558713789) D484 D499 +error(0.005363676085230706554) D484 D499 ^ D479 +error(0.00337753429542255422) D484 D499 ^ D480 +error(0.002174244521197999779) D484 D500 +error(0.0022674453134321048) D484 D500 ^ D486 +error(0.006155195938188455333) D484 D503 +error(0.001149565247104297489) D484 D503 ^ D486 +error(0.001322362211277889167) D484 D503 ^ D486 D487 +error(0.001958536113652691295) D484 D503 ^ D487 +error(0.01000000000000000021) D485 +error(0.003694997059128619313) D485 D499 +error(0.0004228638226307444414) D485 D499 ^ D479 +error(0.005914203606632783758) D485 D499 ^ D480 +error(0.01997693438009479419) D485 D502 +error(0.001516264646117756543) D485 D503 +error(2.492806422158910353e-07) D485 D503 ^ D486 +error(0.00243524371539907648) D485 D503 ^ D487 +error(0.0001188967747735599054) D485 D503 ^ D487 ^ D486 +error(0.0006587014447459603635) D485 ^ D453 ^ D457 +error(0.0009512945064856004112) D485 ^ D453 ^ D481 +error(0.0004374836472664517121) D485 ^ D457 +error(0.005483012712612369936) D485 ^ D487 +error(0.03074175013274606585) D486 +error(0.007418431920822890664) D486 D487 +error(0.002250128698595631107) D486 D487 ^ D490 D503 +error(0.0006386805785702037675) D486 ^ D487 ^ D490 +error(0.0004362399036226063693) D486 ^ D487 ^ D503 +error(0.0003552240780750595055) D486 ^ D503 +error(0.004580815034058316297) D490 D503 ^ D486 +error(0.01000000000000000021) D487 +error(0.009358569417840833723) D487 D488 +error(0.002108544545389898564) D487 D488 ^ D461 +error(0.01180923187285803748) D487 D488 ^ D485 +error(0.0003126805541716948288) D487 D488 ^ D490 ^ D461 +error(0.01753684437045568284) D487 D491 +error(0.01594737098522000171) D487 D491 ^ D490 +error(0.001440084511079942802) D487 ^ D490 +error(0.003111948311039872475) D487 ^ D503 +error(0.0008774289111448976787) D487 ^ D503 ^ D490 +error(0.02172341936375515523) D488 +error(0.005000000000000000104) D488 ^ D485 +error(0.005000000000000000104) D489 D490 +error(0.001832679987383818189) D489 D490 ^ D462 +error(0.01632425822839261506) D489 D490 ^ D486 +error(0.00108509516642776231) D489 D490 ^ D491 +error(0.0004559863367010421231) D489 D490 ^ D491 ^ D462 +error(0.03475077792955421491) D489 D500 +error(0.003801710064911876033) D489 D500 ^ D486 +error(0.01553124818048942819) D490 +error(0.004574228663280334797) D490 D500 +error(0.004111257710853064018) D490 D500 ^ D486 +error(0.02532543979866221442) D490 D503 +error(0.01688600226893464604) D490 ^ D491 +error(0.02066122814126422624) D491 +error(0.01616909857618875623) D492 D495 +error(0.01825835838303091485) D492 D496 +error(0.03335541900982209179) D492 L0 +error(0.014913161604346796) D493 D496 +error(0.004838344668267254532) D493 D496 ^ D472 +error(0.01451669854692977379) D493 D497 +error(0.01962360020040856967) D493 L0 +error(0.0003520070329553366402) D493 L0 ^ D469 L0 ^ D471 +error(0.01343114020393023147) D494 D497 +error(0.009747737265004767504) D494 D497 ^ D478 +error(0.0231934419158216637) D494 L0 +error(0.01180065225993759404) D495 D498 +error(0.0247066600584666049) D496 D498 +error(0.005218537566325277995) D496 D498 ^ D473 +error(0.02177532737360970971) D496 D499 +error(0.02115247411451316034) D497 D499 +error(0.008214700376359766396) D497 D499 ^ D479 +error(0.0153574913455339912) D497 D500 +error(0.01954445878048438612) D498 D501 +error(0.01479519795575456875) D498 D502 +error(0.01382251702182361874) D499 D502 +error(0.003695694747119084283) D499 D502 ^ D480 +error(0.01463590952346699448) D499 D503 +error(0.01845284089239894107) D500 D503 +error(0.007294042143318546847) D500 D503 ^ D486 +error(0.01511127811792763176) D501 +error(0.03081275684573673776) D502 +error(0.03481385430131373609) D503 +detector(2, 5, 0) D0 +detector(4, 3, 0) D1 +detector(6, 1, 0) D2 +detector(2, 7, 0) D3 +detector(4, 5, 0) D4 +detector(6, 3, 0) D5 +detector(4, 7, 0) D6 +detector(6, 5, 0) D7 +detector(8, 3, 0) D8 +detector(4, 9, 0) D9 +detector(6, 7, 0) D10 +detector(8, 5, 0) D11 +detector(1, 4, 1) D12 +detector(2, 5, 1) D13 +detector(2, 7, 1) D14 +detector(3, 2, 1) D15 +detector(3, 4, 1) D16 +detector(3, 6, 1) D17 +detector(4, 3, 1) D18 +detector(4, 5, 1) D19 +detector(4, 7, 1) D20 +detector(4, 9, 1) D21 +detector(5, 2, 1) D22 +detector(5, 4, 1) D23 +detector(5, 6, 1) D24 +detector(5, 8, 1) D25 +detector(6, 1, 1) D26 +detector(6, 3, 1) D27 +detector(6, 5, 1) D28 +detector(6, 7, 1) D29 +detector(7, 4, 1) D30 +detector(7, 6, 1) D31 +detector(7, 8, 1) D32 +detector(8, 3, 1) D33 +detector(8, 5, 1) D34 +detector(9, 6, 1) D35 +detector(1, 4, 2) D36 +detector(2, 5, 2) D37 +detector(2, 7, 2) D38 +detector(3, 2, 2) D39 +detector(3, 4, 2) D40 +detector(3, 6, 2) D41 +detector(4, 3, 2) D42 +detector(4, 5, 2) D43 +detector(4, 7, 2) D44 +detector(4, 9, 2) D45 +detector(5, 2, 2) D46 +detector(5, 4, 2) D47 +detector(5, 6, 2) D48 +detector(5, 8, 2) D49 +detector(6, 1, 2) D50 +detector(6, 3, 2) D51 +detector(6, 5, 2) D52 +detector(6, 7, 2) D53 +detector(7, 4, 2) D54 +detector(7, 6, 2) D55 +detector(7, 8, 2) D56 +detector(8, 3, 2) D57 +detector(8, 5, 2) D58 +detector(9, 6, 2) D59 +detector(1, 4, 3) D60 +detector(2, 5, 3) D61 +detector(2, 7, 3) D62 +detector(3, 2, 3) D63 +detector(3, 4, 3) D64 +detector(3, 6, 3) D65 +detector(4, 3, 3) D66 +detector(4, 5, 3) D67 +detector(4, 7, 3) D68 +detector(4, 9, 3) D69 +detector(5, 2, 3) D70 +detector(5, 4, 3) D71 +detector(5, 6, 3) D72 +detector(5, 8, 3) D73 +detector(6, 1, 3) D74 +detector(6, 3, 3) D75 +detector(6, 5, 3) D76 +detector(6, 7, 3) D77 +detector(7, 4, 3) D78 +detector(7, 6, 3) D79 +detector(7, 8, 3) D80 +detector(8, 3, 3) D81 +detector(8, 5, 3) D82 +detector(9, 6, 3) D83 +detector(1, 4, 4) D84 +detector(2, 5, 4) D85 +detector(2, 7, 4) D86 +detector(3, 2, 4) D87 +detector(3, 4, 4) D88 +detector(3, 6, 4) D89 +detector(4, 3, 4) D90 +detector(4, 5, 4) D91 +detector(4, 7, 4) D92 +detector(4, 9, 4) D93 +detector(5, 2, 4) D94 +detector(5, 4, 4) D95 +detector(5, 6, 4) D96 +detector(5, 8, 4) D97 +detector(6, 1, 4) D98 +detector(6, 3, 4) D99 +detector(6, 5, 4) D100 +detector(6, 7, 4) D101 +detector(7, 4, 4) D102 +detector(7, 6, 4) D103 +detector(7, 8, 4) D104 +detector(8, 3, 4) D105 +detector(8, 5, 4) D106 +detector(9, 6, 4) D107 +detector(1, 4, 5) D108 +detector(2, 5, 5) D109 +detector(2, 7, 5) D110 +detector(3, 2, 5) D111 +detector(3, 4, 5) D112 +detector(3, 6, 5) D113 +detector(4, 3, 5) D114 +detector(4, 5, 5) D115 +detector(4, 7, 5) D116 +detector(4, 9, 5) D117 +detector(5, 2, 5) D118 +detector(5, 4, 5) D119 +detector(5, 6, 5) D120 +detector(5, 8, 5) D121 +detector(6, 1, 5) D122 +detector(6, 3, 5) D123 +detector(6, 5, 5) D124 +detector(6, 7, 5) D125 +detector(7, 4, 5) D126 +detector(7, 6, 5) D127 +detector(7, 8, 5) D128 +detector(8, 3, 5) D129 +detector(8, 5, 5) D130 +detector(9, 6, 5) D131 +detector(1, 4, 6) D132 +detector(2, 5, 6) D133 +detector(2, 7, 6) D134 +detector(3, 2, 6) D135 +detector(3, 4, 6) D136 +detector(3, 6, 6) D137 +detector(4, 3, 6) D138 +detector(4, 5, 6) D139 +detector(4, 7, 6) D140 +detector(4, 9, 6) D141 +detector(5, 2, 6) D142 +detector(5, 4, 6) D143 +detector(5, 6, 6) D144 +detector(5, 8, 6) D145 +detector(6, 1, 6) D146 +detector(6, 3, 6) D147 +detector(6, 5, 6) D148 +detector(6, 7, 6) D149 +detector(7, 4, 6) D150 +detector(7, 6, 6) D151 +detector(7, 8, 6) D152 +detector(8, 3, 6) D153 +detector(8, 5, 6) D154 +detector(9, 6, 6) D155 +detector(1, 4, 7) D156 +detector(2, 5, 7) D157 +detector(2, 7, 7) D158 +detector(3, 2, 7) D159 +detector(3, 4, 7) D160 +detector(3, 6, 7) D161 +detector(4, 3, 7) D162 +detector(4, 5, 7) D163 +detector(4, 7, 7) D164 +detector(4, 9, 7) D165 +detector(5, 2, 7) D166 +detector(5, 4, 7) D167 +detector(5, 6, 7) D168 +detector(5, 8, 7) D169 +detector(6, 1, 7) D170 +detector(6, 3, 7) D171 +detector(6, 5, 7) D172 +detector(6, 7, 7) D173 +detector(7, 4, 7) D174 +detector(7, 6, 7) D175 +detector(7, 8, 7) D176 +detector(8, 3, 7) D177 +detector(8, 5, 7) D178 +detector(9, 6, 7) D179 +detector(1, 4, 8) D180 +detector(2, 5, 8) D181 +detector(2, 7, 8) D182 +detector(3, 2, 8) D183 +detector(3, 4, 8) D184 +detector(3, 6, 8) D185 +detector(4, 3, 8) D186 +detector(4, 5, 8) D187 +detector(4, 7, 8) D188 +detector(4, 9, 8) D189 +detector(5, 2, 8) D190 +detector(5, 4, 8) D191 +detector(5, 6, 8) D192 +detector(5, 8, 8) D193 +detector(6, 1, 8) D194 +detector(6, 3, 8) D195 +detector(6, 5, 8) D196 +detector(6, 7, 8) D197 +detector(7, 4, 8) D198 +detector(7, 6, 8) D199 +detector(7, 8, 8) D200 +detector(8, 3, 8) D201 +detector(8, 5, 8) D202 +detector(9, 6, 8) D203 +detector(1, 4, 9) D204 +detector(2, 5, 9) D205 +detector(2, 7, 9) D206 +detector(3, 2, 9) D207 +detector(3, 4, 9) D208 +detector(3, 6, 9) D209 +detector(4, 3, 9) D210 +detector(4, 5, 9) D211 +detector(4, 7, 9) D212 +detector(4, 9, 9) D213 +detector(5, 2, 9) D214 +detector(5, 4, 9) D215 +detector(5, 6, 9) D216 +detector(5, 8, 9) D217 +detector(6, 1, 9) D218 +detector(6, 3, 9) D219 +detector(6, 5, 9) D220 +detector(6, 7, 9) D221 +detector(7, 4, 9) D222 +detector(7, 6, 9) D223 +detector(7, 8, 9) D224 +detector(8, 3, 9) D225 +detector(8, 5, 9) D226 +detector(9, 6, 9) D227 +detector(1, 4, 10) D228 +detector(2, 5, 10) D229 +detector(2, 7, 10) D230 +detector(3, 2, 10) D231 +detector(3, 4, 10) D232 +detector(3, 6, 10) D233 +detector(4, 3, 10) D234 +detector(4, 5, 10) D235 +detector(4, 7, 10) D236 +detector(4, 9, 10) D237 +detector(5, 2, 10) D238 +detector(5, 4, 10) D239 +detector(5, 6, 10) D240 +detector(5, 8, 10) D241 +detector(6, 1, 10) D242 +detector(6, 3, 10) D243 +detector(6, 5, 10) D244 +detector(6, 7, 10) D245 +detector(7, 4, 10) D246 +detector(7, 6, 10) D247 +detector(7, 8, 10) D248 +detector(8, 3, 10) D249 +detector(8, 5, 10) D250 +detector(9, 6, 10) D251 +detector(1, 4, 11) D252 +detector(2, 5, 11) D253 +detector(2, 7, 11) D254 +detector(3, 2, 11) D255 +detector(3, 4, 11) D256 +detector(3, 6, 11) D257 +detector(4, 3, 11) D258 +detector(4, 5, 11) D259 +detector(4, 7, 11) D260 +detector(4, 9, 11) D261 +detector(5, 2, 11) D262 +detector(5, 4, 11) D263 +detector(5, 6, 11) D264 +detector(5, 8, 11) D265 +detector(6, 1, 11) D266 +detector(6, 3, 11) D267 +detector(6, 5, 11) D268 +detector(6, 7, 11) D269 +detector(7, 4, 11) D270 +detector(7, 6, 11) D271 +detector(7, 8, 11) D272 +detector(8, 3, 11) D273 +detector(8, 5, 11) D274 +detector(9, 6, 11) D275 +detector(1, 4, 12) D276 +detector(2, 5, 12) D277 +detector(2, 7, 12) D278 +detector(3, 2, 12) D279 +detector(3, 4, 12) D280 +detector(3, 6, 12) D281 +detector(4, 3, 12) D282 +detector(4, 5, 12) D283 +detector(4, 7, 12) D284 +detector(4, 9, 12) D285 +detector(5, 2, 12) D286 +detector(5, 4, 12) D287 +detector(5, 6, 12) D288 +detector(5, 8, 12) D289 +detector(6, 1, 12) D290 +detector(6, 3, 12) D291 +detector(6, 5, 12) D292 +detector(6, 7, 12) D293 +detector(7, 4, 12) D294 +detector(7, 6, 12) D295 +detector(7, 8, 12) D296 +detector(8, 3, 12) D297 +detector(8, 5, 12) D298 +detector(9, 6, 12) D299 +detector(1, 4, 13) D300 +detector(2, 5, 13) D301 +detector(2, 7, 13) D302 +detector(3, 2, 13) D303 +detector(3, 4, 13) D304 +detector(3, 6, 13) D305 +detector(4, 3, 13) D306 +detector(4, 5, 13) D307 +detector(4, 7, 13) D308 +detector(4, 9, 13) D309 +detector(5, 2, 13) D310 +detector(5, 4, 13) D311 +detector(5, 6, 13) D312 +detector(5, 8, 13) D313 +detector(6, 1, 13) D314 +detector(6, 3, 13) D315 +detector(6, 5, 13) D316 +detector(6, 7, 13) D317 +detector(7, 4, 13) D318 +detector(7, 6, 13) D319 +detector(7, 8, 13) D320 +detector(8, 3, 13) D321 +detector(8, 5, 13) D322 +detector(9, 6, 13) D323 +detector(1, 4, 14) D324 +detector(2, 5, 14) D325 +detector(2, 7, 14) D326 +detector(3, 2, 14) D327 +detector(3, 4, 14) D328 +detector(3, 6, 14) D329 +detector(4, 3, 14) D330 +detector(4, 5, 14) D331 +detector(4, 7, 14) D332 +detector(4, 9, 14) D333 +detector(5, 2, 14) D334 +detector(5, 4, 14) D335 +detector(5, 6, 14) D336 +detector(5, 8, 14) D337 +detector(6, 1, 14) D338 +detector(6, 3, 14) D339 +detector(6, 5, 14) D340 +detector(6, 7, 14) D341 +detector(7, 4, 14) D342 +detector(7, 6, 14) D343 +detector(7, 8, 14) D344 +detector(8, 3, 14) D345 +detector(8, 5, 14) D346 +detector(9, 6, 14) D347 +detector(1, 4, 15) D348 +detector(2, 5, 15) D349 +detector(2, 7, 15) D350 +detector(3, 2, 15) D351 +detector(3, 4, 15) D352 +detector(3, 6, 15) D353 +detector(4, 3, 15) D354 +detector(4, 5, 15) D355 +detector(4, 7, 15) D356 +detector(4, 9, 15) D357 +detector(5, 2, 15) D358 +detector(5, 4, 15) D359 +detector(5, 6, 15) D360 +detector(5, 8, 15) D361 +detector(6, 1, 15) D362 +detector(6, 3, 15) D363 +detector(6, 5, 15) D364 +detector(6, 7, 15) D365 +detector(7, 4, 15) D366 +detector(7, 6, 15) D367 +detector(7, 8, 15) D368 +detector(8, 3, 15) D369 +detector(8, 5, 15) D370 +detector(9, 6, 15) D371 +detector(1, 4, 16) D372 +detector(2, 5, 16) D373 +detector(2, 7, 16) D374 +detector(3, 2, 16) D375 +detector(3, 4, 16) D376 +detector(3, 6, 16) D377 +detector(4, 3, 16) D378 +detector(4, 5, 16) D379 +detector(4, 7, 16) D380 +detector(4, 9, 16) D381 +detector(5, 2, 16) D382 +detector(5, 4, 16) D383 +detector(5, 6, 16) D384 +detector(5, 8, 16) D385 +detector(6, 1, 16) D386 +detector(6, 3, 16) D387 +detector(6, 5, 16) D388 +detector(6, 7, 16) D389 +detector(7, 4, 16) D390 +detector(7, 6, 16) D391 +detector(7, 8, 16) D392 +detector(8, 3, 16) D393 +detector(8, 5, 16) D394 +detector(9, 6, 16) D395 +detector(1, 4, 17) D396 +detector(2, 5, 17) D397 +detector(2, 7, 17) D398 +detector(3, 2, 17) D399 +detector(3, 4, 17) D400 +detector(3, 6, 17) D401 +detector(4, 3, 17) D402 +detector(4, 5, 17) D403 +detector(4, 7, 17) D404 +detector(4, 9, 17) D405 +detector(5, 2, 17) D406 +detector(5, 4, 17) D407 +detector(5, 6, 17) D408 +detector(5, 8, 17) D409 +detector(6, 1, 17) D410 +detector(6, 3, 17) D411 +detector(6, 5, 17) D412 +detector(6, 7, 17) D413 +detector(7, 4, 17) D414 +detector(7, 6, 17) D415 +detector(7, 8, 17) D416 +detector(8, 3, 17) D417 +detector(8, 5, 17) D418 +detector(9, 6, 17) D419 +detector(1, 4, 18) D420 +detector(2, 5, 18) D421 +detector(2, 7, 18) D422 +detector(3, 2, 18) D423 +detector(3, 4, 18) D424 +detector(3, 6, 18) D425 +detector(4, 3, 18) D426 +detector(4, 5, 18) D427 +detector(4, 7, 18) D428 +detector(4, 9, 18) D429 +detector(5, 2, 18) D430 +detector(5, 4, 18) D431 +detector(5, 6, 18) D432 +detector(5, 8, 18) D433 +detector(6, 1, 18) D434 +detector(6, 3, 18) D435 +detector(6, 5, 18) D436 +detector(6, 7, 18) D437 +detector(7, 4, 18) D438 +detector(7, 6, 18) D439 +detector(7, 8, 18) D440 +detector(8, 3, 18) D441 +detector(8, 5, 18) D442 +detector(9, 6, 18) D443 +detector(1, 4, 19) D444 +detector(2, 5, 19) D445 +detector(2, 7, 19) D446 +detector(3, 2, 19) D447 +detector(3, 4, 19) D448 +detector(3, 6, 19) D449 +detector(4, 3, 19) D450 +detector(4, 5, 19) D451 +detector(4, 7, 19) D452 +detector(4, 9, 19) D453 +detector(5, 2, 19) D454 +detector(5, 4, 19) D455 +detector(5, 6, 19) D456 +detector(5, 8, 19) D457 +detector(6, 1, 19) D458 +detector(6, 3, 19) D459 +detector(6, 5, 19) D460 +detector(6, 7, 19) D461 +detector(7, 4, 19) D462 +detector(7, 6, 19) D463 +detector(7, 8, 19) D464 +detector(8, 3, 19) D465 +detector(8, 5, 19) D466 +detector(9, 6, 19) D467 +detector(1, 4, 20) D468 +detector(2, 5, 20) D469 +detector(2, 7, 20) D470 +detector(3, 2, 20) D471 +detector(3, 4, 20) D472 +detector(3, 6, 20) D473 +detector(4, 3, 20) D474 +detector(4, 5, 20) D475 +detector(4, 7, 20) D476 +detector(4, 9, 20) D477 +detector(5, 2, 20) D478 +detector(5, 4, 20) D479 +detector(5, 6, 20) D480 +detector(5, 8, 20) D481 +detector(6, 1, 20) D482 +detector(6, 3, 20) D483 +detector(6, 5, 20) D484 +detector(6, 7, 20) D485 +detector(7, 4, 20) D486 +detector(7, 6, 20) D487 +detector(7, 8, 20) D488 +detector(8, 3, 20) D489 +detector(8, 5, 20) D490 +detector(9, 6, 20) D491 +detector(2, 5, 21) D492 +detector(4, 3, 21) D493 +detector(6, 1, 21) D494 +detector(2, 7, 21) D495 +detector(4, 5, 21) D496 +detector(6, 3, 21) D497 +detector(4, 7, 21) D498 +detector(6, 5, 21) D499 +detector(8, 3, 21) D500 +detector(4, 9, 21) D501 +detector(6, 7, 21) D502 +detector(8, 5, 21) D503 diff --git a/shared/package-files/9b/9b8648ab7c6ea7dec4c0aab3db5e6fd033f3925eb80c627c7248893b35a43c78/blob b/shared/package-files/9b/9b8648ab7c6ea7dec4c0aab3db5e6fd033f3925eb80c627c7248893b35a43c78/blob new file mode 100644 index 0000000000000000000000000000000000000000..91674f3cd5536c63526635404f6aa39e9ce63121 --- /dev/null +++ b/shared/package-files/9b/9b8648ab7c6ea7dec4c0aab3db5e6fd033f3925eb80c627c7248893b35a43c78/blob @@ -0,0 +1,17 @@ +from typing import Dict, Tuple + +from django.db.backends.base.base import BaseDatabaseWrapper + +def psycopg2_version() -> Tuple[int, ...]: ... + +PSYCOPG2_VERSION: Tuple[int, ...] = ... + +class DatabaseWrapper(BaseDatabaseWrapper): + operators: Dict[str, str] = ... + pattern_esc: str = ... + pattern_ops: Dict[str, str] = ... + + # PostgreSQL backend-specific attributes. + _named_cursor_idx: int = ... + @property + def pg_version(self) -> str: ... diff --git a/shared/package-files/9b/9b86cb0749eb28f07811ecd87954712f8bacda87a621d2d31e209acfbab4be1a/blob b/shared/package-files/9b/9b86cb0749eb28f07811ecd87954712f8bacda87a621d2d31e209acfbab4be1a/blob new file mode 100644 index 0000000000000000000000000000000000000000..f0275c1cc1db504e96be2748c43c3aea896222cf --- /dev/null +++ b/shared/package-files/9b/9b86cb0749eb28f07811ecd87954712f8bacda87a621d2d31e209acfbab4be1a/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_fractional_max_pool2d_backward : public at::impl::MetaBase { + + + void meta(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/9b/9b8b84fe0598495357e29ad58df7c0c4bd126e2514fec2e861a167606009660b/blob b/shared/package-files/9b/9b8b84fe0598495357e29ad58df7c0c4bd126e2514fec2e861a167606009660b/blob new file mode 100644 index 0000000000000000000000000000000000000000..7ac3b1dc4f199095ee91985301209d121b3194e3 --- /dev/null +++ b/shared/package-files/9b/9b8b84fe0598495357e29ad58df7c0c4bd126e2514fec2e861a167606009660b/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_cdist_forward(Tensor x1, Tensor x2, float p, int? compute_mode) -> Tensor +inline at::Tensor _cdist_forward(const at::Tensor & x1, const at::Tensor & x2, double p, c10::optional compute_mode) { + return at::_ops::_cdist_forward::call(x1, x2, p, compute_mode); +} + +// aten::_cdist_forward.out(Tensor x1, Tensor x2, float p, int? compute_mode, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _cdist_forward_out(at::Tensor & out, const at::Tensor & x1, const at::Tensor & x2, double p, c10::optional compute_mode) { + return at::_ops::_cdist_forward_out::call(x1, x2, p, compute_mode, out); +} +// aten::_cdist_forward.out(Tensor x1, Tensor x2, float p, int? compute_mode, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _cdist_forward_outf(const at::Tensor & x1, const at::Tensor & x2, double p, c10::optional compute_mode, at::Tensor & out) { + return at::_ops::_cdist_forward_out::call(x1, x2, p, compute_mode, out); +} + +} diff --git a/shared/package-files/9b/9b8c6edddc57710cdff7af9638a24f14d9b0d0611517b243e7294c45c79f760d/blob b/shared/package-files/9b/9b8c6edddc57710cdff7af9638a24f14d9b0d0611517b243e7294c45c79f760d/blob new file mode 100644 index 0000000000000000000000000000000000000000..76bc565e859d61789cafbdb8157874cfa219d33f --- /dev/null +++ b/shared/package-files/9b/9b8c6edddc57710cdff7af9638a24f14d9b0d0611517b243e7294c45c79f760d/blob @@ -0,0 +1,288 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from narwhals._compliant.any_namespace import DateTimeNamespace +from narwhals._constants import ( + MS_PER_SECOND, + NS_PER_SECOND, + SECONDS_PER_DAY, + US_PER_SECOND, +) +from narwhals._duration import Interval +from narwhals._pandas_like.utils import ( + ALIAS_DICT, + UNITS_DICT, + PandasLikeSeriesNamespace, + calculate_timestamp_date, + calculate_timestamp_datetime, + get_dtype_backend, + int_dtype_mapper, + is_dtype_pyarrow, +) + +if TYPE_CHECKING: + from datetime import timedelta + + import pandas as pd + + from narwhals._pandas_like.series import PandasLikeSeries + from narwhals.typing import TimeUnit + + +class PandasLikeSeriesDateTimeNamespace( + PandasLikeSeriesNamespace, DateTimeNamespace["PandasLikeSeries"] +): + def date(self) -> PandasLikeSeries: + result = self.with_native(self.native.dt.date) + if str(result.dtype).lower() == "object": + msg = ( + "Accessing `date` on the default pandas backend " + "will return a Series of type `object`." + "\nThis differs from polars API and will prevent `.dt` chaining. " + "Please switch to the `pyarrow` backend:" + '\ndf.convert_dtypes(dtype_backend="pyarrow")' + ) + raise NotImplementedError(msg) + return result + + def year(self) -> PandasLikeSeries: + return self.with_native(self.native.dt.year) + + def month(self) -> PandasLikeSeries: + return self.with_native(self.native.dt.month) + + def day(self) -> PandasLikeSeries: + return self.with_native(self.native.dt.day) + + def hour(self) -> PandasLikeSeries: + return self.with_native(self.native.dt.hour) + + def minute(self) -> PandasLikeSeries: + return self.with_native(self.native.dt.minute) + + def second(self) -> PandasLikeSeries: + return self.with_native(self.native.dt.second) + + def millisecond(self) -> PandasLikeSeries: + return self.microsecond() // 1000 + + def microsecond(self) -> PandasLikeSeries: + if self.backend_version < (3, 0, 0) and self._is_pyarrow(): + # crazy workaround for https://github.com/pandas-dev/pandas/issues/59154 + import pyarrow.compute as pc # ignore-banned-import() + + from narwhals._arrow.utils import lit + + arr_ns = self.native.array + arr = arr_ns.__arrow_array__() + result_arr = pc.add( + pc.multiply(pc.millisecond(arr), lit(1_000)), pc.microsecond(arr) + ) + result = type(self.native)(type(arr_ns)(result_arr), name=self.native.name) + return self.with_native(result) + + return self.with_native(self.native.dt.microsecond) + + def nanosecond(self) -> PandasLikeSeries: + return self.microsecond() * 1_000 + self.native.dt.nanosecond + + def ordinal_day(self) -> PandasLikeSeries: + return self.with_native(self.native.dt.day_of_year) + + def weekday(self) -> PandasLikeSeries: + # Pandas is 0-6 while Polars is 1-7 + impl = self.compliant._implementation + native = self.native + result = ( + native.dt.day_of_week + if impl.is_pandas() and impl._backend_version() >= (1, 5) + else native.dt.weekday + ) + return self.with_native(result) + 1 + + def _is_pyarrow(self) -> bool: + return is_dtype_pyarrow(self.native.dtype) + + def _get_total_seconds(self) -> Any: + if hasattr(self.native.dt, "total_seconds"): + return self.native.dt.total_seconds() + return ( # pragma: no cover + self.native.dt.days * SECONDS_PER_DAY + + self.native.dt.seconds + + (self.native.dt.microseconds / US_PER_SECOND) + + (self.native.dt.nanoseconds / NS_PER_SECOND) + ) + + def total_minutes(self) -> PandasLikeSeries: + s = self._get_total_seconds() + # this calculates the sign of each series element + s_sign = 2 * (s > 0).astype(int_dtype_mapper(s.dtype)) - 1 + s_abs = s.abs() // 60 + if ~s.isna().any(): + s_abs = s_abs.astype(int_dtype_mapper(s.dtype)) + return self.with_native(s_abs * s_sign) + + def total_seconds(self) -> PandasLikeSeries: + s = self._get_total_seconds() + # this calculates the sign of each series element + s_sign = 2 * (s > 0).astype(int_dtype_mapper(s.dtype)) - 1 + s_abs = s.abs() // 1 + if ~s.isna().any(): + s_abs = s_abs.astype(int_dtype_mapper(s.dtype)) + return self.with_native(s_abs * s_sign) + + def total_milliseconds(self) -> PandasLikeSeries: + s = self._get_total_seconds() * MS_PER_SECOND + # this calculates the sign of each series element + s_sign = 2 * (s > 0).astype(int_dtype_mapper(s.dtype)) - 1 + s_abs = s.abs() // 1 + if ~s.isna().any(): + s_abs = s_abs.astype(int_dtype_mapper(s.dtype)) + return self.with_native(s_abs * s_sign) + + def total_microseconds(self) -> PandasLikeSeries: + s = self._get_total_seconds() * US_PER_SECOND + # this calculates the sign of each series element + s_sign = 2 * (s > 0).astype(int_dtype_mapper(s.dtype)) - 1 + s_abs = s.abs() // 1 + if ~s.isna().any(): + s_abs = s_abs.astype(int_dtype_mapper(s.dtype)) + return self.with_native(s_abs * s_sign) + + def total_nanoseconds(self) -> PandasLikeSeries: + s = self._get_total_seconds() * NS_PER_SECOND + # this calculates the sign of each series element + s_sign = 2 * (s > 0).astype(int_dtype_mapper(s.dtype)) - 1 + s_abs = s.abs() // 1 + if ~s.isna().any(): + s_abs = s_abs.astype(int_dtype_mapper(s.dtype)) + return self.with_native(s_abs * s_sign) + + def to_string(self, format: str) -> PandasLikeSeries: + # Polars' parser treats `'%.f'` as pandas does `'.%f'` + # PyArrow interprets `'%S'` as "seconds, plus fractional seconds" + # and doesn't support `%f` + if not self._is_pyarrow(): + format = format.replace("%S%.f", "%S.%f") + else: + format = format.replace("%S.%f", "%S").replace("%S%.f", "%S") + return self.with_native(self.native.dt.strftime(format)) + + def replace_time_zone(self, time_zone: str | None) -> PandasLikeSeries: + de_zone = self.native.dt.tz_localize(None) + result = de_zone.dt.tz_localize(time_zone) if time_zone is not None else de_zone + return self.with_native(result) + + def convert_time_zone(self, time_zone: str) -> PandasLikeSeries: + if self.compliant.dtype.time_zone is None: # type: ignore[attr-defined] + result = self.native.dt.tz_localize("UTC").dt.tz_convert(time_zone) + else: + result = self.native.dt.tz_convert(time_zone) + return self.with_native(result) + + def timestamp(self, time_unit: TimeUnit) -> PandasLikeSeries: + s = self.native + dtype = self.compliant.dtype + mask_na = s.isna() + dtypes = self.version.dtypes + if dtype == dtypes.Date: + # Date is only supported in pandas dtypes if pyarrow-backed + s_cast = s.astype("Int32[pyarrow]") + result = calculate_timestamp_date(s_cast, time_unit) + elif isinstance(dtype, dtypes.Datetime): + fn = ( + s.view + if (self.implementation.is_pandas() and self.backend_version < (2,)) + else s.astype + ) + s_cast = fn("Int64[pyarrow]") if self._is_pyarrow() else fn("int64") + result = calculate_timestamp_datetime(s_cast, dtype.time_unit, time_unit) + else: + msg = "Input should be either of Date or Datetime type" + raise TypeError(msg) + result[mask_na] = None + return self.with_native(result) + + def truncate(self, every: str) -> PandasLikeSeries: + interval = Interval.parse(every) + multiple, unit = interval.multiple, interval.unit + native = self.native + if self.implementation.is_cudf(): + if multiple != 1: + msg = f"Only multiple `1` is supported for cuDF, got: {multiple}." + raise NotImplementedError(msg) + return self.with_native(self.native.dt.floor(ALIAS_DICT.get(unit, unit))) + dtype_backend = get_dtype_backend(native.dtype, self.compliant._implementation) + if unit in {"mo", "q", "y"}: + if self.implementation.is_cudf(): + msg = f"Truncating to {unit} is not supported yet for cuDF." + raise NotImplementedError(msg) + if dtype_backend == "pyarrow": + import pyarrow.compute as pc # ignore-banned-import + + ca = native.array._pa_array + result_arr = pc.floor_temporal(ca, multiple, UNITS_DICT[unit]) + else: + if unit == "q": + multiple *= 3 + np_unit = "M" + elif unit == "mo": + np_unit = "M" + else: + np_unit = "Y" + arr = native.values # noqa: PD011 + arr_dtype = arr.dtype + result_arr = arr.astype(f"datetime64[{multiple}{np_unit}]").astype( + arr_dtype + ) + result_native = type(native)( + result_arr, dtype=native.dtype, index=native.index, name=native.name + ) + return self.with_native(result_native) + return self.with_native( + self.native.dt.floor(f"{multiple}{ALIAS_DICT.get(unit, unit)}") + ) + + def offset_by(self, by: str) -> PandasLikeSeries: + native = self.native + pdx = self.compliant.__native_namespace__() + if self._is_pyarrow(): + import pyarrow as pa # ignore-banned-import + + compliant = self.compliant + ca = pa.chunked_array([compliant.to_arrow()]) + result = ( + compliant._version.namespace.from_backend("pyarrow") + .compliant.from_native(ca) + .dt.offset_by(by) + .native + ) + result_pd = native.__class__( + result, dtype=native.dtype, index=native.index, name=native.name + ) + else: + interval = Interval.parse_no_constraints(by) + multiple, unit = interval.multiple, interval.unit + if unit == "q": + multiple *= 3 + unit = "mo" + offset: pd.DateOffset | timedelta + if unit == "y": + offset = pdx.DateOffset(years=multiple) + elif unit == "mo": + offset = pdx.DateOffset(months=multiple) + elif unit == "ns": + offset = pdx.Timedelta(multiple, unit=UNITS_DICT[unit]) + else: + offset = interval.to_timedelta() + dtype = self.compliant.dtype + datetime_dtype = self.version.dtypes.Datetime + if unit == "d" and isinstance(dtype, datetime_dtype) and dtype.time_zone: + native_without_timezone = native.dt.tz_localize(None) + result_pd = native_without_timezone + offset + result_pd = result_pd.dt.tz_localize(dtype.time_zone) + else: + result_pd = native + offset + + return self.with_native(result_pd) diff --git a/shared/package-files/9b/9b8d9aaa3bcbfbf84b3f67da398e1ab16ea4ed4cbe2f859f853e6fcaac7ddb6a/blob b/shared/package-files/9b/9b8d9aaa3bcbfbf84b3f67da398e1ab16ea4ed4cbe2f859f853e6fcaac7ddb6a/blob new file mode 100644 index 0000000000000000000000000000000000000000..d09d9f45c7d056adf962b753b5643b0fc037e0c9 --- /dev/null +++ b/shared/package-files/9b/9b8d9aaa3bcbfbf84b3f67da398e1ab16ea4ed4cbe2f859f853e6fcaac7ddb6a/blob @@ -0,0 +1,4400 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +from collections.abc import Iterable +import datetime +import decimal +import hypothesis as h +import hypothesis.strategies as st +import itertools +import pytest +import struct +import subprocess +import sys +import weakref + +try: + import numpy as np +except ImportError: + np = None + +import pyarrow as pa +import pyarrow.tests.strategies as past +from pyarrow.vendored.version import Version + + +@pytest.mark.processes +def test_total_bytes_allocated(): + code = """if 1: + import pyarrow as pa + + assert pa.total_allocated_bytes() == 0 + """ + res = subprocess.run([sys.executable, "-c", code], + universal_newlines=True, stderr=subprocess.PIPE) + if res.returncode != 0: + print(res.stderr, file=sys.stderr) + res.check_returncode() # fail + assert len(res.stderr.splitlines()) == 0 + + +def test_weakref(): + arr = pa.array([1, 2, 3]) + wr = weakref.ref(arr) + assert wr() is not None + del arr + assert wr() is None + + +def test_getitem_NULL(): + arr = pa.array([1, None, 2]) + assert arr[1].as_py() is None + assert arr[1].is_valid is False + assert isinstance(arr[1], pa.Int64Scalar) + + +def test_constructor_raises(): + # This could happen by wrong capitalization. + # ARROW-2638: prevent calling extension class constructors directly + with pytest.raises(TypeError): + pa.Array([1, 2]) + + +def test_list_format(): + arr = pa.array([["foo"], None, ["bar", "a longer string", None]]) + result = arr.to_string() + expected = """\ +[ + [ + "foo" + ], + null, + [ + "bar", + "a longer string", + null + ] +]""" + assert result == expected + + result = arr.to_string(element_size_limit=10) + expected = """\ +[ + [ + "foo" + ], + null, + [ + "bar", + "a longer (... 7 chars omitted)", + null + ] +]""" + assert result == expected + + +def test_string_format(): + arr = pa.array(['', None, 'foo']) + result = arr.to_string() + expected = """\ +[ + "", + null, + "foo" +]""" + assert result == expected + + +def test_long_array_format(): + arr = pa.array(range(100)) + result = arr.to_string(window=2) + expected = """\ +[ + 0, + 1, + ... + 98, + 99 +]""" + assert result == expected + + +def test_indented_string_format(): + arr = pa.array(['', None, 'foo']) + result = arr.to_string(indent=1) + expected = '[\n "",\n null,\n "foo"\n]' + + assert result == expected + + +def test_top_level_indented_string_format(): + arr = pa.array(['', None, 'foo']) + result = arr.to_string(top_level_indent=1) + expected = ' [\n "",\n null,\n "foo"\n ]' + + assert result == expected + + +def test_binary_format(): + arr = pa.array([b'\x00', b'', None, b'\x01foo', b'\x80\xff']) + result = arr.to_string() + expected = """\ +[ + 00, + , + null, + 01666F6F, + 80FF +]""" + assert result == expected + + +def test_binary_total_values_length(): + arr = pa.array([b'0000', None, b'11111', b'222222', b'3333333'], + type='binary') + large_arr = pa.array([b'0000', None, b'11111', b'222222', b'3333333'], + type='large_binary') + + assert arr.total_values_length == 22 + assert arr.slice(1, 3).total_values_length == 11 + assert large_arr.total_values_length == 22 + assert large_arr.slice(1, 3).total_values_length == 11 + + +@pytest.mark.numpy +def test_to_numpy_zero_copy(): + arr = pa.array(range(10)) + + np_arr = arr.to_numpy() + + # check for zero copy (both arrays using same memory) + arrow_buf = arr.buffers()[1] + assert arrow_buf.address == np_arr.ctypes.data + + arr = None + import gc + gc.collect() + + # Ensure base is still valid + assert np_arr.base is not None + expected = np.arange(10) + np.testing.assert_array_equal(np_arr, expected) + + +@pytest.mark.numpy +def test_chunked_array_to_numpy_zero_copy(): + elements = [[2, 2, 4], [4, 5, 100]] + + chunked_arr = pa.chunked_array(elements) + + msg = "zero_copy_only must be False for pyarrow.ChunkedArray.to_numpy" + + with pytest.raises(ValueError, match=msg): + chunked_arr.to_numpy(zero_copy_only=True) + + np_arr = chunked_arr.to_numpy() + expected = [2, 2, 4, 4, 5, 100] + np.testing.assert_array_equal(np_arr, expected) + + +@pytest.mark.numpy +def test_to_numpy_unsupported_types(): + # ARROW-2871: Some primitive types are not yet supported in to_numpy + bool_arr = pa.array([True, False, True]) + + with pytest.raises(ValueError): + bool_arr.to_numpy() + + result = bool_arr.to_numpy(zero_copy_only=False) + expected = np.array([True, False, True]) + np.testing.assert_array_equal(result, expected) + + null_arr = pa.array([None, None, None]) + + with pytest.raises(ValueError): + null_arr.to_numpy() + + result = null_arr.to_numpy(zero_copy_only=False) + expected = np.array([None, None, None], dtype=object) + np.testing.assert_array_equal(result, expected) + + arr = pa.array([1, 2, None]) + + with pytest.raises(ValueError, match="with 1 nulls"): + arr.to_numpy() + + +@pytest.mark.numpy +def test_to_numpy_writable(): + arr = pa.array(range(10)) + np_arr = arr.to_numpy() + + # by default not writable for zero-copy conversion + with pytest.raises(ValueError): + np_arr[0] = 10 + + np_arr2 = arr.to_numpy(zero_copy_only=False, writable=True) + np_arr2[0] = 10 + assert arr[0].as_py() == 0 + + # when asking for writable, cannot do zero-copy + with pytest.raises(ValueError): + arr.to_numpy(zero_copy_only=True, writable=True) + + +@pytest.mark.numpy +@pytest.mark.parametrize('unit', ['s', 'ms', 'us', 'ns']) +@pytest.mark.parametrize('tz', [None, "UTC"]) +def test_to_numpy_datetime64(unit, tz): + arr = pa.array([1, 2, 3], pa.timestamp(unit, tz=tz)) + expected = np.array([1, 2, 3], dtype=f"datetime64[{unit}]") + np_arr = arr.to_numpy() + np.testing.assert_array_equal(np_arr, expected) + + +@pytest.mark.numpy +@pytest.mark.parametrize('unit', ['s', 'ms', 'us', 'ns']) +def test_to_numpy_timedelta64(unit): + arr = pa.array([1, 2, 3], pa.duration(unit)) + expected = np.array([1, 2, 3], dtype=f"timedelta64[{unit}]") + np_arr = arr.to_numpy() + np.testing.assert_array_equal(np_arr, expected) + + +@pytest.mark.numpy +def test_to_numpy_dictionary(): + # ARROW-7591 + arr = pa.array(["a", "b", "a"]).dictionary_encode() + expected = np.array(["a", "b", "a"], dtype=object) + np_arr = arr.to_numpy(zero_copy_only=False) + np.testing.assert_array_equal(np_arr, expected) + + +@pytest.mark.pandas +def test_to_pandas_zero_copy(): + import gc + + arr = pa.array(range(10)) + + for i in range(10): + series = arr.to_pandas() + # In Python 3.14 interpreter might avoid some + # reference count modifications + assert sys.getrefcount(series) in (1, 2) + series = None # noqa + + assert sys.getrefcount(arr) in (1, 2) + + for i in range(10): + arr = pa.array(range(10)) + series = arr.to_pandas() + arr = None + gc.collect() + + # Ensure base is still valid + + # Because of py.test's assert inspection magic, if you put getrefcount + # on the line being examined, it will be 1 higher than you expect + base_refcount = sys.getrefcount(series.values.base) + assert base_refcount == 2 + series.sum() + + +@pytest.mark.nopandas +@pytest.mark.pandas +def test_asarray(): + # ensure this is tested both when pandas is present or not (ARROW-6564) + + arr = pa.array(range(4)) + + # The iterator interface gives back an array of Int64Value's + np_arr = np.asarray([_ for _ in arr]) + assert np_arr.tolist() == [0, 1, 2, 3] + assert np_arr.dtype == np.dtype('O') + assert isinstance(np_arr[0], pa.lib.Int64Value) + + # Calling with the arrow array gives back an array with 'int64' dtype + np_arr = np.asarray(arr) + assert np_arr.tolist() == [0, 1, 2, 3] + assert np_arr.dtype == np.dtype('int64') + + # An optional type can be specified when calling np.asarray + np_arr = np.asarray(arr, dtype='str') + assert np_arr.tolist() == ['0', '1', '2', '3'] + + # If PyArrow array has null values, numpy type will be changed as needed + # to support nulls. + arr = pa.array([0, 1, 2, None]) + assert arr.type == pa.int64() + np_arr = np.asarray(arr) + elements = np_arr.tolist() + assert elements[:3] == [0., 1., 2.] + assert np.isnan(elements[3]) + assert np_arr.dtype == np.dtype('float64') + + # DictionaryType data will be converted to dense numpy array + arr = pa.DictionaryArray.from_arrays( + pa.array([0, 1, 2, 0, 1]), pa.array(['a', 'b', 'c'])) + np_arr = np.asarray(arr) + assert np_arr.dtype == np.dtype('object') + assert np_arr.tolist() == ['a', 'b', 'c', 'a', 'b'] + + +@pytest.mark.parametrize('ty', [ + None, + pa.null(), + pa.int8(), + pa.string() +]) +def test_nulls(ty): + arr = pa.nulls(3, type=ty) + expected = pa.array([None, None, None], type=ty) + + assert len(arr) == 3 + assert arr.equals(expected) + + if ty is None: + assert arr.type == pa.null() + else: + assert arr.type == ty + + +def test_array_from_scalar(): + pytz = pytest.importorskip("pytz") + + today = datetime.date.today() + now = datetime.datetime.now() + now_utc = now.replace(tzinfo=pytz.utc) + now_with_tz = now_utc.astimezone(pytz.timezone('US/Eastern')) + oneday = datetime.timedelta(days=1) + + cases = [ + (None, 1, pa.array([None])), + (None, 10, pa.nulls(10)), + (-1, 3, pa.array([-1, -1, -1], type=pa.int64())), + (2.71, 2, pa.array([2.71, 2.71], type=pa.float64())), + ("string", 4, pa.array(["string"] * 4)), + ( + pa.scalar(8, type=pa.uint8()), + 17, + pa.array([8] * 17, type=pa.uint8()) + ), + (pa.scalar(None), 3, pa.array([None, None, None])), + (pa.scalar(True), 11, pa.array([True] * 11)), + (today, 2, pa.array([today] * 2)), + (now, 10, pa.array([now] * 10)), + ( + now_with_tz, + 2, + pa.array( + [now_utc] * 2, + type=pa.timestamp('us', tz=pytz.timezone('US/Eastern')) + ) + ), + (now.time(), 9, pa.array([now.time()] * 9)), + (oneday, 4, pa.array([oneday] * 4)), + (False, 9, pa.array([False] * 9)), + ([1, 2], 2, pa.array([[1, 2], [1, 2]])), + ( + pa.scalar([-1, 3], type=pa.large_list(pa.int8())), + 5, + pa.array([[-1, 3]] * 5, type=pa.large_list(pa.int8())) + ), + ({'a': 1, 'b': 2}, 3, pa.array([{'a': 1, 'b': 2}] * 3)) + ] + + for value, size, expected in cases: + arr = pa.repeat(value, size) + assert len(arr) == size + assert arr.type.equals(expected.type) + assert arr.equals(expected) + if expected.type == pa.null(): + assert arr.null_count == size + else: + assert arr.null_count == 0 + + +def test_array_from_dictionary_scalar(): + dictionary = ['foo', 'bar', 'baz'] + arr = pa.DictionaryArray.from_arrays([2, 1, 2, 0], dictionary=dictionary) + + result = pa.repeat(arr[0], 5) + expected = pa.DictionaryArray.from_arrays([2] * 5, dictionary=dictionary) + assert result.equals(expected) + + result = pa.repeat(arr[3], 5) + expected = pa.DictionaryArray.from_arrays([0] * 5, dictionary=dictionary) + assert result.equals(expected) + + +def test_array_getitem(): + arr = pa.array(range(10, 15)) + lst = arr.to_pylist() + + for idx in range(-len(arr), len(arr)): + assert arr[idx].as_py() == lst[idx] + for idx in range(-2 * len(arr), -len(arr)): + with pytest.raises(IndexError): + arr[idx] + for idx in range(len(arr), 2 * len(arr)): + with pytest.raises(IndexError): + arr[idx] + + +@pytest.mark.numpy +def test_array_getitem_numpy_scalars(): + arr = pa.array(range(10, 15)) + lst = arr.to_pylist() + # check that numpy scalars are supported + for idx in range(-len(arr), len(arr)): + assert arr[np.int32(idx)].as_py() == lst[idx] + + +def test_array_slice(): + arr = pa.array(range(10)) + + sliced = arr.slice(2) + expected = pa.array(range(2, 10)) + assert sliced.equals(expected) + + sliced2 = arr.slice(2, 4) + expected2 = pa.array(range(2, 6)) + assert sliced2.equals(expected2) + + # 0 offset + assert arr.slice(0).equals(arr) + + # Slice past end of array + assert len(arr.slice(len(arr))) == 0 + assert len(arr.slice(len(arr) + 2)) == 0 + assert len(arr.slice(len(arr) + 2, 100)) == 0 + + with pytest.raises(IndexError): + arr.slice(-1) + + with pytest.raises(ValueError): + arr.slice(2, -1) + + # Test slice notation + assert arr[2:].equals(arr.slice(2)) + assert arr[2:5].equals(arr.slice(2, 3)) + assert arr[-5:].equals(arr.slice(len(arr) - 5)) + + n = len(arr) + for start in range(-n * 2, n * 2): + for stop in range(-n * 2, n * 2): + res = arr[start:stop] + res.validate() + expected = arr.to_pylist()[start:stop] + assert res.to_pylist() == expected + if np is not None: + assert res.to_numpy().tolist() == expected + + +def test_array_slice_negative_step(): + # ARROW-2714 + values = list(range(20)) + arr = pa.array(values) + chunked_arr = pa.chunked_array([arr]) + + cases = [ + slice(None, None, -1), # GH-46606 + slice(None, 6, -2), + slice(10, 6, -2), + slice(8, None, -2), + slice(2, 10, -2), + slice(10, 2, -2), + slice(None, None, 2), + slice(0, 10, 2), + slice(15, -25, -1), # GH-38768 + slice(-22, -22, -1), # GH-40642 + ] + + for case in cases: + result = arr[case] + expected = pa.array(values[case], type=arr.type) + assert result.equals(expected) + + result = pa.record_batch([arr], names=['f0'])[case] + expected = pa.record_batch([expected], names=['f0']) + assert result.equals(expected) + + result = chunked_arr[case] + expected = pa.chunked_array([values[case]], type=arr.type) + assert result.equals(expected) + + +def test_arange(): + cases = [ + (5, 103), # Default step + (-2, 128, 3), + (4, 103, 5), + (10, -7, -1), + (100, -20, -3), + (0, 0), # Empty array + (2, 10, -1), # Empty array + (10, 3, 1), # Empty array + ] + for case in cases: + result = pa.arange(*case) + result.validate(full=True) + assert result.equals(pa.array(list(range(*case)), type=pa.int64())) + + # Validate memory_pool keyword argument + result = pa.arange(-1, 101, memory_pool=pa.default_memory_pool()) + result.validate(full=True) + assert result.equals(pa.array(list(range(-1, 101)), type=pa.int64())) + + # Special case for invalid step (arange does not accept step of 0) + with pytest.raises(pa.ArrowInvalid): + pa.arange(0, 10, 0) + + +def test_array_diff(): + # ARROW-6252 + arr1 = pa.array(['foo'], type=pa.utf8()) + arr2 = pa.array(['foo', 'bar', None], type=pa.utf8()) + arr3 = pa.array([1, 2, 3]) + arr4 = pa.array([[], [1], None], type=pa.list_(pa.int64())) + arr5 = pa.array([1.5, 3, 6], type=pa.float16()) + arr6 = pa.array([1, 3], type=pa.float16()) + + assert arr1.diff(arr1) == '' + assert arr1.diff(arr2) == ''' +@@ -1, +1 @@ ++"bar" ++null +''' + assert arr1.diff(arr3).strip() == '# Array types differed: string vs int64' + assert arr1.diff(arr3).strip() == '# Array types differed: string vs int64' + assert arr1.diff(arr4).strip() == ('# Array types differed: string vs ' + 'list') + assert arr5.diff(arr5) == '' + assert arr5.diff(arr6) == ''' +@@ -0, +0 @@ +-1.5 ++1 +@@ -2, +2 @@ +-6 +''' + + +def test_array_iter(): + arr = pa.array(range(10)) + + for i, j in zip(range(10), arr): + assert i == j.as_py() + + assert isinstance(arr, Iterable) + + +def test_struct_array_slice(): + # ARROW-2311: slicing nested arrays needs special care + ty = pa.struct([pa.field('a', pa.int8()), + pa.field('b', pa.float32())]) + arr = pa.array([(1, 2.5), (3, 4.5), (5, 6.5)], type=ty) + assert arr[1:].to_pylist() == [{'a': 3, 'b': 4.5}, + {'a': 5, 'b': 6.5}] + + +@pytest.mark.numpy +def test_array_factory_invalid_type(): + + class MyObject: + pass + + arr = np.array([MyObject()]) + with pytest.raises(ValueError): + pa.array(arr) + + +@pytest.mark.numpy +def test_array_ref_to_ndarray_base(): + arr = np.array([1, 2, 3]) + + refcount = sys.getrefcount(arr) + arr2 = pa.array(arr) # noqa + assert sys.getrefcount(arr) == (refcount + 1) + + +def test_array_eq(): + # ARROW-2150 / ARROW-9445: we define the __eq__ behavior to be + # data equality (not element-wise equality) + arr1 = pa.array([1, 2, 3], type=pa.int32()) + arr2 = pa.array([1, 2, 3], type=pa.int32()) + arr3 = pa.array([1, 2, 3], type=pa.int64()) + + assert (arr1 == arr2) is True + assert (arr1 != arr2) is False + assert (arr1 == arr3) is False + assert (arr1 != arr3) is True + + assert (arr1 == 1) is False + assert (arr1 == None) is False # noqa: E711 + + +@pytest.mark.numpy +def test_array_from_buffers(): + values_buf = pa.py_buffer(np.int16([4, 5, 6, 7])) + nulls_buf = pa.py_buffer(np.uint8([0b00001101])) + arr = pa.Array.from_buffers(pa.int16(), 4, [nulls_buf, values_buf]) + assert arr.type == pa.int16() + assert arr.to_pylist() == [4, None, 6, 7] + + arr = pa.Array.from_buffers(pa.int16(), 4, [None, values_buf]) + assert arr.type == pa.int16() + assert arr.to_pylist() == [4, 5, 6, 7] + + arr = pa.Array.from_buffers(pa.int16(), 3, [nulls_buf, values_buf], + offset=1) + assert arr.type == pa.int16() + assert arr.to_pylist() == [None, 6, 7] + + with pytest.raises(TypeError): + pa.Array.from_buffers(pa.int16(), 3, ['', ''], offset=1) + + +def test_string_binary_from_buffers(): + array = pa.array(["a", None, "b", "c"]) + + buffers = array.buffers() + copied = pa.StringArray.from_buffers( + len(array), buffers[1], buffers[2], buffers[0], array.null_count, + array.offset) + assert copied.to_pylist() == ["a", None, "b", "c"] + + binary_copy = pa.Array.from_buffers(pa.binary(), len(array), + array.buffers(), array.null_count, + array.offset) + assert binary_copy.to_pylist() == [b"a", None, b"b", b"c"] + + copied = pa.StringArray.from_buffers( + len(array), buffers[1], buffers[2], buffers[0]) + assert copied.to_pylist() == ["a", None, "b", "c"] + + sliced = array[1:] + buffers = sliced.buffers() + copied = pa.StringArray.from_buffers( + len(sliced), buffers[1], buffers[2], buffers[0], -1, sliced.offset) + assert copied.to_pylist() == [None, "b", "c"] + assert copied.null_count == 1 + + # Slice but exclude all null entries so that we don't need to pass + # the null bitmap. + sliced = array[2:] + buffers = sliced.buffers() + copied = pa.StringArray.from_buffers( + len(sliced), buffers[1], buffers[2], None, -1, sliced.offset) + assert copied.to_pylist() == ["b", "c"] + assert copied.null_count == 0 + + +def test_string_view_from_buffers(): + array = pa.array( + [ + "String longer than 12 characters", + None, + "short", + "Length is 12" + ], type=pa.string_view()) + + buffers = array.buffers() + copied = pa.StringViewArray.from_buffers( + pa.string_view(), len(array), buffers) + copied.validate(full=True) + assert copied.to_pylist() == [ + "String longer than 12 characters", + None, + "short", + "Length is 12" + ] + + match = r"number of buffers is at least 2" + with pytest.raises(ValueError, match=match): + pa.StringViewArray.from_buffers( + pa.string_view(), len(array), buffers[0:1]) + + +@pytest.mark.parametrize('list_type_factory', [ + pa.list_, pa.large_list, pa.list_view, pa.large_list_view]) +def test_list_from_buffers(list_type_factory): + ty = list_type_factory(pa.int16()) + array = pa.array([[0, 1, 2], None, [], [3, 4, 5]], type=ty) + assert array.type == ty + + buffers = array.buffers() + + with pytest.raises(ValueError): + # No children + pa.Array.from_buffers(ty, 4, buffers[:ty.num_buffers]) + + child = pa.Array.from_buffers(pa.int16(), 6, buffers[ty.num_buffers:]) + copied = pa.Array.from_buffers(ty, 4, buffers[:ty.num_buffers], children=[child]) + assert copied.equals(array) + + with pytest.raises(ValueError): + # too many children + pa.Array.from_buffers(ty, 4, buffers[:ty.num_buffers], + children=[child, child]) + + +def test_struct_from_buffers(): + ty = pa.struct([pa.field('a', pa.int16()), pa.field('b', pa.utf8())]) + array = pa.array([{'a': 0, 'b': 'foo'}, None, {'a': 5, 'b': ''}], + type=ty) + buffers = array.buffers() + + with pytest.raises(ValueError): + # No children + pa.Array.from_buffers(ty, 3, [None, buffers[1]]) + + children = [pa.Array.from_buffers(pa.int16(), 3, buffers[1:3]), + pa.Array.from_buffers(pa.utf8(), 3, buffers[3:])] + copied = pa.Array.from_buffers(ty, 3, buffers[:1], children=children) + assert copied.equals(array) + + with pytest.raises(ValueError): + # not enough many children + pa.Array.from_buffers(ty, 3, [buffers[0]], + children=children[:1]) + + +def test_struct_from_arrays(): + a = pa.array([4, 5, 6], type=pa.int64()) + b = pa.array(["bar", None, ""]) + c = pa.array([[1, 2], None, [3, None]]) + expected_list = [ + {'a': 4, 'b': 'bar', 'c': [1, 2]}, + {'a': 5, 'b': None, 'c': None}, + {'a': 6, 'b': '', 'c': [3, None]}, + ] + + # From field names + arr = pa.StructArray.from_arrays([a, b, c], ["a", "b", "c"]) + assert arr.type == pa.struct( + [("a", a.type), ("b", b.type), ("c", c.type)]) + assert arr.to_pylist() == expected_list + + with pytest.raises(ValueError): + pa.StructArray.from_arrays([a, b, c], ["a", "b"]) + + arr = pa.StructArray.from_arrays([], []) + assert arr.type == pa.struct([]) + assert arr.to_pylist() == [] + + # From fields + fa = pa.field("a", a.type, nullable=False) + fb = pa.field("b", b.type) + fc = pa.field("c", c.type) + arr = pa.StructArray.from_arrays([a, b, c], fields=[fa, fb, fc]) + assert arr.type == pa.struct([fa, fb, fc]) + assert not arr.type[0].nullable + assert arr.to_pylist() == expected_list + + # From structtype + structtype = pa.struct([fa, fb, fc]) + arr = pa.StructArray.from_arrays([a, b, c], type=structtype) + assert arr.type == pa.struct([fa, fb, fc]) + assert not arr.type[0].nullable + assert arr.to_pylist() == expected_list + + with pytest.raises(ValueError): + pa.StructArray.from_arrays([a, b, c], fields=[fa, fb]) + + arr = pa.StructArray.from_arrays([], fields=[]) + assert arr.type == pa.struct([]) + assert arr.to_pylist() == [] + + # Inconsistent fields + fa2 = pa.field("a", pa.int32()) + with pytest.raises(ValueError, match="int64 vs int32"): + pa.StructArray.from_arrays([a, b, c], fields=[fa2, fb, fc]) + + arrays = [a, b, c] + fields = [fa, fb, fc] + # With mask + mask = pa.array([True, False, False]) + arr = pa.StructArray.from_arrays(arrays, fields=fields, mask=mask) + assert arr.to_pylist() == [None] + expected_list[1:] + + arr = pa.StructArray.from_arrays(arrays, names=['a', 'b', 'c'], mask=mask) + assert arr.to_pylist() == [None] + expected_list[1:] + + # Bad masks + with pytest.raises(TypeError, match='Mask must be'): + pa.StructArray.from_arrays(arrays, fields, mask=[True, False, False]) + + with pytest.raises(ValueError, match='not contain nulls'): + pa.StructArray.from_arrays( + arrays, fields, mask=pa.array([True, False, None])) + + with pytest.raises(TypeError, match='Mask must be'): + pa.StructArray.from_arrays( + arrays, fields, mask=pa.chunked_array([mask])) + + # Non-empty array with no fields https://github.com/apache/arrow/issues/15109 + arr = pa.StructArray.from_arrays([], [], mask=mask) + assert arr.is_null() == mask + assert arr.to_pylist() == [None, {}, {}] + + +def test_struct_array_from_chunked(): + # ARROW-11780 + # Check that we don't segfault when trying to build + # a StructArray from a chunked array. + chunked_arr = pa.chunked_array([[1, 2, 3], [4, 5, 6]]) + + with pytest.raises(TypeError, match="Expected Array"): + pa.StructArray.from_arrays([chunked_arr], ["foo"]) + + +@pytest.mark.parametrize("offset", (0, 1)) +def test_dictionary_from_buffers(offset): + a = pa.array(["one", "two", "three", "two", "one"]).dictionary_encode() + b = pa.DictionaryArray.from_buffers(a.type, len(a)-offset, + a.indices.buffers(), a.dictionary, + offset=offset) + assert a[offset:] == b + + +@pytest.mark.numpy +def test_dictionary_from_numpy(): + indices = np.repeat([0, 1, 2], 2) + dictionary = np.array(['foo', 'bar', 'baz'], dtype=object) + mask = np.array([False, False, True, False, False, False]) + + d1 = pa.DictionaryArray.from_arrays(indices, dictionary) + d2 = pa.DictionaryArray.from_arrays(indices, dictionary, mask=mask) + + assert d1.indices.to_pylist() == indices.tolist() + assert d1.indices.to_pylist() == indices.tolist() + assert d1.dictionary.to_pylist() == dictionary.tolist() + assert d2.dictionary.to_pylist() == dictionary.tolist() + + for i in range(len(indices)): + assert d1[i].as_py() == dictionary[indices[i]] + + if mask[i]: + assert d2[i].as_py() is None + else: + assert d2[i].as_py() == dictionary[indices[i]] + + +@pytest.mark.numpy +def test_dictionary_to_numpy(): + expected = pa.array( + ["foo", "bar", None, "foo"] + ).to_numpy(zero_copy_only=False) + a = pa.DictionaryArray.from_arrays( + pa.array([0, 1, None, 0]), + pa.array(['foo', 'bar']) + ) + np.testing.assert_array_equal(a.to_numpy(zero_copy_only=False), + expected) + + with pytest.raises(pa.ArrowInvalid): + # If this would be changed to no longer raise in the future, + # ensure to test the actual result because, currently, to_numpy takes + # for granted that when zero_copy_only=True there will be no nulls + # (it's the decoding of the DictionaryArray that handles the nulls and + # this is only activated with zero_copy_only=False) + a.to_numpy(zero_copy_only=True) + + anonulls = pa.DictionaryArray.from_arrays( + pa.array([0, 1, 1, 0]), + pa.array(['foo', 'bar']) + ) + expected = pa.array( + ["foo", "bar", "bar", "foo"] + ).to_numpy(zero_copy_only=False) + np.testing.assert_array_equal(anonulls.to_numpy(zero_copy_only=False), + expected) + + with pytest.raises(pa.ArrowInvalid): + anonulls.to_numpy(zero_copy_only=True) + + afloat = pa.DictionaryArray.from_arrays( + pa.array([0, 1, 1, 0]), + pa.array([13.7, 11.0]) + ) + expected = pa.array([13.7, 11.0, 11.0, 13.7]).to_numpy() + np.testing.assert_array_equal(afloat.to_numpy(zero_copy_only=True), + expected) + np.testing.assert_array_equal(afloat.to_numpy(zero_copy_only=False), + expected) + + afloat2 = pa.DictionaryArray.from_arrays( + pa.array([0, 1, None, 0]), + pa.array([13.7, 11.0]) + ) + expected = pa.array( + [13.7, 11.0, None, 13.7] + ).to_numpy(zero_copy_only=False) + np.testing.assert_allclose( + afloat2.to_numpy(zero_copy_only=False), + expected, + equal_nan=True + ) + + # Testing for integers can reveal problems related to dealing + # with None values, as a numpy array of int dtype + # can't contain NaN nor None. + aints = pa.DictionaryArray.from_arrays( + pa.array([0, 1, None, 0]), + pa.array([7, 11]) + ) + expected = pa.array([7, 11, None, 7]).to_numpy(zero_copy_only=False) + np.testing.assert_allclose( + aints.to_numpy(zero_copy_only=False), + expected, + equal_nan=True + ) + + +@pytest.mark.numpy +def test_dictionary_from_boxed_arrays(): + indices = np.repeat([0, 1, 2], 2) + dictionary = np.array(['foo', 'bar', 'baz'], dtype=object) + + iarr = pa.array(indices) + darr = pa.array(dictionary) + + d1 = pa.DictionaryArray.from_arrays(iarr, darr) + + assert d1.indices.to_pylist() == indices.tolist() + assert d1.dictionary.to_pylist() == dictionary.tolist() + + for i in range(len(indices)): + assert d1[i].as_py() == dictionary[indices[i]] + + +def test_dictionary_from_arrays_boundscheck(): + indices1 = pa.array([0, 1, 2, 0, 1, 2]) + indices2 = pa.array([0, -1, 2]) + indices3 = pa.array([0, 1, 2, 3]) + + dictionary = pa.array(['foo', 'bar', 'baz']) + + # Works fine + pa.DictionaryArray.from_arrays(indices1, dictionary) + + with pytest.raises(pa.ArrowException): + pa.DictionaryArray.from_arrays(indices2, dictionary) + + with pytest.raises(pa.ArrowException): + pa.DictionaryArray.from_arrays(indices3, dictionary) + + # If we are confident that the indices are "safe" we can pass safe=False to + # disable the boundschecking + pa.DictionaryArray.from_arrays(indices2, dictionary, safe=False) + + +def test_dictionary_indices(): + # https://issues.apache.org/jira/browse/ARROW-6882 + indices = pa.array([0, 1, 2, 0, 1, 2]) + dictionary = pa.array(['foo', 'bar', 'baz']) + arr = pa.DictionaryArray.from_arrays(indices, dictionary) + arr.indices.validate(full=True) + + +@pytest.mark.numpy +@pytest.mark.parametrize(('list_array_type', 'list_type_factory'), + [(pa.ListArray, pa.list_), + (pa.LargeListArray, pa.large_list)]) +def test_list_from_arrays(list_array_type, list_type_factory): + offsets_arr = np.array([0, 2, 5, 8], dtype='i4') + offsets = pa.array(offsets_arr, type='int32') + pyvalues = [b'a', b'b', b'c', b'd', b'e', b'f', b'g', b'h'] + values = pa.array(pyvalues, type='binary') + + result = list_array_type.from_arrays(offsets, values) + expected = pa.array([pyvalues[:2], pyvalues[2:5], pyvalues[5:8]], + type=list_type_factory(pa.binary())) + + assert result.equals(expected) + + # With specified type + typ = list_type_factory(pa.field("name", pa.binary())) + result = list_array_type.from_arrays(offsets, values, typ) + assert result.type == typ + assert result.type.value_field.name == "name" + + # With nulls + offsets = [0, None, 2, 6] + values = [b'a', b'b', b'c', b'd', b'e', b'f'] + + result = list_array_type.from_arrays(offsets, values) + expected = pa.array([values[:2], None, values[2:]], + type=list_type_factory(pa.binary())) + + assert result.equals(expected) + + # Another edge case + offsets2 = [0, 2, None, 6] + result = list_array_type.from_arrays(offsets2, values) + expected = pa.array([values[:2], values[2:], None], + type=list_type_factory(pa.binary())) + assert result.equals(expected) + + # raise on invalid array + offsets = [1, 3, 10] + values = np.arange(5) + with pytest.raises(ValueError): + list_array_type.from_arrays(offsets, values) + + # Non-monotonic offsets + offsets = [0, 3, 2, 6] + values = list(range(6)) + result = list_array_type.from_arrays(offsets, values) + with pytest.raises(ValueError): + result.validate(full=True) + + # mismatching type + typ = list_type_factory(pa.binary()) + with pytest.raises(TypeError): + list_array_type.from_arrays(offsets, values, type=typ) + + +@pytest.mark.parametrize(('list_array_type', 'list_type_factory'), ( + (pa.ListArray, pa.list_), + (pa.LargeListArray, pa.large_list) +)) +@pytest.mark.parametrize("arr", ( + [None, [0]], + [None, [0, None], [0]], + [[0], [1]], +)) +def test_list_array_types_from_arrays( + list_array_type, list_type_factory, arr +): + arr = pa.array(arr, list_type_factory(pa.int8())) + reconstructed_arr = list_array_type.from_arrays( + arr.offsets, arr.values, mask=arr.is_null()) + assert arr == reconstructed_arr + + +@pytest.mark.parametrize(('list_array_type', 'list_type_factory'), ( + (pa.ListArray, pa.list_), + (pa.LargeListArray, pa.large_list) +)) +def test_list_array_types_from_arrays_fail(list_array_type, list_type_factory): + # Fail when manual offsets include nulls and mask passed + # ListArray.offsets doesn't report nulls. + + # This test case arr.offsets == [0, 1, 1, 3, 4] + arr = pa.array([[0], None, [0, None], [0]], list_type_factory(pa.int8())) + offsets = pa.array([0, None, 1, 3, 4]) + + # Using array's offset has no nulls; gives empty lists on top level + reconstructed_arr = list_array_type.from_arrays(arr.offsets, arr.values) + assert reconstructed_arr.to_pylist() == [[0], [], [0, None], [0]] + + # Manually specifying offsets (with nulls) is same as mask at top level + reconstructed_arr = list_array_type.from_arrays(offsets, arr.values) + assert arr == reconstructed_arr + reconstructed_arr = list_array_type.from_arrays(arr.offsets, + arr.values, + mask=arr.is_null()) + assert arr == reconstructed_arr + + # But using both is ambiguous, in this case `offsets` has nulls + with pytest.raises(ValueError, match="Ambiguous to specify both "): + list_array_type.from_arrays(offsets, arr.values, mask=arr.is_null()) + + # Not supported to reconstruct from a slice. + arr_slice = arr[1:] + msg = "Null bitmap with offsets slice not supported." + with pytest.raises(NotImplementedError, match=msg): + list_array_type.from_arrays( + arr_slice.offsets, arr_slice.values, mask=arr_slice.is_null()) + + +def test_map_cast(): + # GH-38553 + t = pa.map_(pa.int64(), pa.int64()) + arr = pa.array([{1: 2}], type=t) + result = arr.cast(pa.map_(pa.int32(), pa.int64())) + + t_expected = pa.map_(pa.int32(), pa.int64()) + expected = pa.array([{1: 2}], type=t_expected) + + assert result.equals(expected) + + +def test_map_labelled(): + # ARROW-13735 + t = pa.map_(pa.field("name", "string", nullable=False), "int64") + arr = pa.array([[('a', 1), ('b', 2)], [('c', 3)]], type=t) + assert arr.type.key_field == pa.field("name", pa.utf8(), nullable=False) + assert arr.type.item_field == pa.field("value", pa.int64()) + assert len(arr) == 2 + + +def test_map_from_dict(): + # ARROW-17832 + tup_arr = pa.array([[('a', 1), ('b', 2)], [('c', 3)]], + pa.map_(pa.string(), pa.int64())) + dict_arr = pa.array([{'a': 1, 'b': 2}, {'c': 3}], + pa.map_(pa.string(), pa.int64())) + + assert tup_arr.equals(dict_arr) + + +@pytest.mark.numpy +def test_map_from_arrays(): + offsets_arr = np.array([0, 2, 5, 8], dtype='i4') + offsets = pa.array(offsets_arr, type='int32') + pykeys = [b'a', b'b', b'c', b'd', b'e', b'f', b'g', b'h'] + pyitems = list(range(len(pykeys))) + pypairs = list(zip(pykeys, pyitems)) + pyentries = [pypairs[:2], pypairs[2:5], pypairs[5:8]] + keys = pa.array(pykeys, type='binary') + items = pa.array(pyitems, type='i4') + + result = pa.MapArray.from_arrays(offsets, keys, items) + expected = pa.array(pyentries, type=pa.map_(pa.binary(), pa.int32())) + + assert result.equals(expected) + + # With nulls + offsets = [0, None, 2, 6] + pykeys = [b'a', b'b', b'c', b'd', b'e', b'f'] + pyitems = [1, 2, 3, None, 4, 5] + pypairs = list(zip(pykeys, pyitems)) + pyentries = [pypairs[:2], None, pypairs[2:]] + keys = pa.array(pykeys, type='binary') + items = pa.array(pyitems, type='i4') + + result = pa.MapArray.from_arrays(offsets, keys, items) + expected = pa.array(pyentries, type=pa.map_(pa.binary(), pa.int32())) + + assert result.equals(expected) + + # pass in the type explicitly + result = pa.MapArray.from_arrays(offsets, keys, items, pa.map_( + keys.type, + items.type + )) + assert result.equals(expected) + + # pass in invalid types + with pytest.raises(pa.ArrowTypeError, match='Expected map type, got string'): + pa.MapArray.from_arrays(offsets, keys, items, pa.string()) + + with pytest.raises(pa.ArrowTypeError, match='Mismatching map items type'): + pa.MapArray.from_arrays(offsets, keys, items, pa.map_( + keys.type, + # Larger than the original i4 + pa.int64() + )) + + # pass in null bitmap with type + result = pa.MapArray.from_arrays([0, 2, 2, 6], keys, items, pa.map_( + keys.type, + items.type), + mask=pa.array([False, True, False], type=pa.bool_()) + ) + assert result.null_count == 1 + assert result.equals(expected) + + # pass in null bitmap without the type + result = pa.MapArray.from_arrays([0, 2, 2, 6], keys, items, + mask=pa.array([False, True, False], + type=pa.bool_()) + ) + assert result.equals(expected) + + # pass in null bitmap with two nulls + offsets = [0, None, None, 6] + pyentries = [None, None, pypairs[2:]] + + result = pa.MapArray.from_arrays([0, 2, 2, 6], keys, items, pa.map_( + keys.type, + items.type), + mask=pa.array([True, True, False], type=pa.bool_()) + ) + expected = pa.array(pyentries, type=pa.map_(pa.binary(), pa.int32())) + assert result.null_count == 2 + assert result.equals(expected) + + # error if null bitmap and offsets with nulls passed + msg1 = 'Ambiguous to specify both validity map and offsets with nulls' + with pytest.raises(pa.ArrowInvalid, match=msg1): + pa.MapArray.from_arrays(offsets, keys, items, pa.map_( + keys.type, + items.type), + mask=pa.array([False, True, False], type=pa.bool_()) + ) + + # error if null bitmap passed to sliced offset + msg2 = 'Null bitmap with offsets slice not supported.' + offsets = pa.array([0, 2, 2, 6], pa.int32()) + with pytest.raises(pa.ArrowNotImplementedError, match=msg2): + pa.MapArray.from_arrays(offsets.slice(2), keys, items, pa.map_( + keys.type, + items.type), + mask=pa.array([False, True, False], type=pa.bool_()) + ) + + # check invalid usage + offsets = [0, 1, 3, 5] + keys = np.arange(5) + items = np.arange(5) + _ = pa.MapArray.from_arrays(offsets, keys, items) + + # raise on invalid offsets + with pytest.raises(ValueError): + pa.MapArray.from_arrays(offsets + [6], keys, items) + + # raise on length of keys != items + with pytest.raises(ValueError): + pa.MapArray.from_arrays(offsets, keys, np.concatenate([items, items])) + + # raise on keys with null + keys_with_null = list(keys)[:-1] + [None] + assert len(keys_with_null) == len(items) + with pytest.raises(ValueError): + pa.MapArray.from_arrays(offsets, keys_with_null, items) + + # Check if offset in offsets > 0 + offsets = pa.array(offsets, pa.int32()) + result = pa.MapArray.from_arrays(offsets.slice(1), keys, items) + expected = pa.MapArray.from_arrays([1, 3, 5], keys, items) + + assert result.equals(expected) + assert result.offset == 1 + assert expected.offset == 0 + + offsets = pa.array([0, 0, 0, 0, 0, 0], pa.int32()) + result = pa.MapArray.from_arrays( + offsets.slice(1), + pa.array([], pa.string()), + pa.array([], pa.string()), + ) + expected = pa.MapArray.from_arrays( + [0, 0, 0, 0, 0], + pa.array([], pa.string()), + pa.array([], pa.string()), + ) + assert result.equals(expected) + assert result.offset == 1 + assert expected.offset == 0 + + +def test_fixed_size_list_from_arrays(): + values = pa.array(range(12), pa.int64()) + result = pa.FixedSizeListArray.from_arrays(values, 4) + assert result.to_pylist() == [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] + assert result.type.equals(pa.list_(pa.int64(), 4)) + + typ = pa.list_(pa.field("name", pa.int64()), 4) + result = pa.FixedSizeListArray.from_arrays(values, type=typ) + assert result.to_pylist() == [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] + assert result.type.equals(typ) + assert result.type.value_field.name == "name" + + result = pa.FixedSizeListArray.from_arrays(values, + type=typ, + mask=pa.array([False, True, False])) + assert result.to_pylist() == [[0, 1, 2, 3], None, [8, 9, 10, 11]] + + result = pa.FixedSizeListArray.from_arrays(values, + list_size=4, + mask=pa.array([False, True, False])) + assert result.to_pylist() == [[0, 1, 2, 3], None, [8, 9, 10, 11]] + + # raise on invalid values / list_size + with pytest.raises(ValueError): + pa.FixedSizeListArray.from_arrays(values, -4) + + with pytest.raises(ValueError): + # array with list size 0 cannot be constructed with from_arrays + pa.FixedSizeListArray.from_arrays(pa.array([], pa.int64()), 0) + + with pytest.raises(ValueError): + # length of values not multiple of 5 + pa.FixedSizeListArray.from_arrays(values, 5) + + typ = pa.list_(pa.int64(), 5) + with pytest.raises(ValueError): + pa.FixedSizeListArray.from_arrays(values, type=typ) + + # raise on mismatching values type + typ = pa.list_(pa.float64(), 4) + with pytest.raises(TypeError): + pa.FixedSizeListArray.from_arrays(values, type=typ) + + # raise on specifying none or both of list_size / type + with pytest.raises(ValueError): + pa.FixedSizeListArray.from_arrays(values) + + typ = pa.list_(pa.int64(), 4) + with pytest.raises(ValueError): + pa.FixedSizeListArray.from_arrays(values, list_size=4, type=typ) + + +def test_variable_list_from_arrays(): + values = pa.array([1, 2, 3, 4], pa.int64()) + offsets = pa.array([0, 2, 4]) + result = pa.ListArray.from_arrays(offsets, values) + assert result.to_pylist() == [[1, 2], [3, 4]] + assert result.type.equals(pa.list_(pa.int64())) + + offsets = pa.array([0, None, 2, 4]) + result = pa.ListArray.from_arrays(offsets, values) + assert result.to_pylist() == [[1, 2], None, [3, 4]] + + # raise if offset out of bounds + with pytest.raises(ValueError): + pa.ListArray.from_arrays(pa.array([-1, 2, 4]), values) + + with pytest.raises(ValueError): + pa.ListArray.from_arrays(pa.array([0, 2, 5]), values) + + +def test_union_from_dense(): + binary = pa.array([b'a', b'b', b'c', b'd'], type='binary') + int64 = pa.array([1, 2, 3], type='int64') + types = pa.array([0, 1, 0, 0, 1, 1, 0], type='int8') + logical_types = pa.array([11, 13, 11, 11, 13, 13, 11], type='int8') + value_offsets = pa.array([0, 0, 1, 2, 1, 2, 3], type='int32') + py_value = [b'a', 1, b'b', b'c', 2, 3, b'd'] + + def check_result(result, expected_field_names, expected_type_codes, + expected_type_code_values): + result.validate(full=True) + actual_field_names = [result.type[i].name + for i in range(result.type.num_fields)] + assert actual_field_names == expected_field_names + assert result.type.mode == "dense" + assert result.type.type_codes == expected_type_codes + assert result.to_pylist() == py_value + assert expected_type_code_values.equals(result.type_codes) + assert value_offsets.equals(result.offsets) + assert result.field(0).equals(binary) + assert result.field(1).equals(int64) + with pytest.raises(KeyError): + result.field(-1) + with pytest.raises(KeyError): + result.field(2) + + # without field names and type codes + check_result(pa.UnionArray.from_dense(types, value_offsets, + [binary, int64]), + expected_field_names=['0', '1'], + expected_type_codes=[0, 1], + expected_type_code_values=types) + + # with field names + check_result(pa.UnionArray.from_dense(types, value_offsets, + [binary, int64], + ['bin', 'int']), + expected_field_names=['bin', 'int'], + expected_type_codes=[0, 1], + expected_type_code_values=types) + + # with type codes + check_result(pa.UnionArray.from_dense(logical_types, value_offsets, + [binary, int64], + type_codes=[11, 13]), + expected_field_names=['0', '1'], + expected_type_codes=[11, 13], + expected_type_code_values=logical_types) + + # with field names and type codes + check_result(pa.UnionArray.from_dense(logical_types, value_offsets, + [binary, int64], + ['bin', 'int'], [11, 13]), + expected_field_names=['bin', 'int'], + expected_type_codes=[11, 13], + expected_type_code_values=logical_types) + + # Bad type ids + arr = pa.UnionArray.from_dense(logical_types, value_offsets, + [binary, int64]) + with pytest.raises(pa.ArrowInvalid): + arr.validate(full=True) + arr = pa.UnionArray.from_dense(types, value_offsets, [binary, int64], + type_codes=[11, 13]) + with pytest.raises(pa.ArrowInvalid): + arr.validate(full=True) + + # Offset larger than child size + bad_offsets = pa.array([0, 0, 1, 2, 1, 2, 4], type='int32') + arr = pa.UnionArray.from_dense(types, bad_offsets, [binary, int64]) + with pytest.raises(pa.ArrowInvalid): + arr.validate(full=True) + + +def test_union_from_sparse(): + binary = pa.array([b'a', b' ', b'b', b'c', b' ', b' ', b'd'], + type='binary') + int64 = pa.array([0, 1, 0, 0, 2, 3, 0], type='int64') + types = pa.array([0, 1, 0, 0, 1, 1, 0], type='int8') + logical_types = pa.array([11, 13, 11, 11, 13, 13, 11], type='int8') + py_value = [b'a', 1, b'b', b'c', 2, 3, b'd'] + + def check_result(result, expected_field_names, expected_type_codes, + expected_type_code_values): + result.validate(full=True) + assert result.to_pylist() == py_value + actual_field_names = [result.type[i].name + for i in range(result.type.num_fields)] + assert actual_field_names == expected_field_names + assert result.type.mode == "sparse" + assert result.type.type_codes == expected_type_codes + assert expected_type_code_values.equals(result.type_codes) + assert result.field(0).equals(binary) + assert result.field(1).equals(int64) + with pytest.raises(pa.ArrowTypeError): + result.offsets + with pytest.raises(KeyError): + result.field(-1) + with pytest.raises(KeyError): + result.field(2) + + # without field names and type codes + check_result(pa.UnionArray.from_sparse(types, [binary, int64]), + expected_field_names=['0', '1'], + expected_type_codes=[0, 1], + expected_type_code_values=types) + + # with field names + check_result(pa.UnionArray.from_sparse(types, [binary, int64], + ['bin', 'int']), + expected_field_names=['bin', 'int'], + expected_type_codes=[0, 1], + expected_type_code_values=types) + + # with type codes + check_result(pa.UnionArray.from_sparse(logical_types, [binary, int64], + type_codes=[11, 13]), + expected_field_names=['0', '1'], + expected_type_codes=[11, 13], + expected_type_code_values=logical_types) + + # with field names and type codes + check_result(pa.UnionArray.from_sparse(logical_types, [binary, int64], + ['bin', 'int'], + [11, 13]), + expected_field_names=['bin', 'int'], + expected_type_codes=[11, 13], + expected_type_code_values=logical_types) + + # Bad type ids + arr = pa.UnionArray.from_sparse(logical_types, [binary, int64]) + with pytest.raises(pa.ArrowInvalid): + arr.validate(full=True) + arr = pa.UnionArray.from_sparse(types, [binary, int64], + type_codes=[11, 13]) + with pytest.raises(pa.ArrowInvalid): + arr.validate(full=True) + + # Invalid child length + with pytest.raises(pa.ArrowInvalid): + arr = pa.UnionArray.from_sparse(logical_types, [binary, int64[1:]]) + + +def test_union_array_to_pylist_with_nulls(): + # ARROW-9556 + arr = pa.UnionArray.from_sparse( + pa.array([0, 1, 0, 0, 1], type=pa.int8()), + [ + pa.array([0.0, 1.1, None, 3.3, 4.4]), + pa.array([True, None, False, True, False]), + ] + ) + assert arr.to_pylist() == [0.0, None, None, 3.3, False] + + arr = pa.UnionArray.from_dense( + pa.array([0, 1, 0, 0, 0, 1, 1], type=pa.int8()), + pa.array([0, 0, 1, 2, 3, 1, 2], type=pa.int32()), + [ + pa.array([0.0, 1.1, None, 3.3]), + pa.array([True, None, False]) + ] + ) + assert arr.to_pylist() == [0.0, True, 1.1, None, 3.3, None, False] + + +def test_union_array_slice(): + # ARROW-2314 + arr = pa.UnionArray.from_sparse(pa.array([0, 0, 1, 1], type=pa.int8()), + [pa.array(["a", "b", "c", "d"]), + pa.array([1, 2, 3, 4])]) + assert arr[1:].to_pylist() == ["b", 3, 4] + + binary = pa.array([b'a', b'b', b'c', b'd'], type='binary') + int64 = pa.array([1, 2, 3], type='int64') + types = pa.array([0, 1, 0, 0, 1, 1, 0], type='int8') + value_offsets = pa.array([0, 0, 2, 1, 1, 2, 3], type='int32') + + arr = pa.UnionArray.from_dense(types, value_offsets, [binary, int64]) + lst = arr.to_pylist() + for i in range(len(arr)): + for j in range(i, len(arr)): + assert arr[i:j].to_pylist() == lst[i:j] + + +def _check_cast_case(case, *, safe=True, check_array_construction=True): + in_data, in_type, out_data, out_type = case + if isinstance(out_data, pa.Array): + assert out_data.type == out_type + expected = out_data + else: + expected = pa.array(out_data, type=out_type) + + # check casting an already created array + if isinstance(in_data, pa.Array): + assert in_data.type == in_type + in_arr = in_data + else: + in_arr = pa.array(in_data, type=in_type) + casted = in_arr.cast(out_type, safe=safe) + casted.validate(full=True) + assert casted.equals(expected) + + # constructing an array with out type which optionally involves casting + # for more see ARROW-1949 + if check_array_construction: + in_arr = pa.array(in_data, type=out_type, safe=safe) + assert in_arr.equals(expected) + + +@pytest.mark.numpy +def test_cast_integers_safe(): + safe_cases = [ + (np.array([0, 1, 2, 3], dtype='i1'), 'int8', + np.array([0, 1, 2, 3], dtype='i4'), pa.int32()), + (np.array([0, 1, 2, 3], dtype='i1'), 'int8', + np.array([0, 1, 2, 3], dtype='u4'), pa.uint16()), + (np.array([0, 1, 2, 3], dtype='i1'), 'int8', + np.array([0, 1, 2, 3], dtype='u1'), pa.uint8()), + (np.array([0, 1, 2, 3], dtype='i1'), 'int8', + np.array([0, 1, 2, 3], dtype='f8'), pa.float64()) + ] + + for case in safe_cases: + _check_cast_case(case) + + unsafe_cases = [ + (np.array([50000], dtype='i4'), 'int32', 'int16'), + (np.array([70000], dtype='i4'), 'int32', 'uint16'), + (np.array([-1], dtype='i4'), 'int32', 'uint16'), + (np.array([50000], dtype='u2'), 'uint16', 'int16') + ] + for in_data, in_type, out_type in unsafe_cases: + in_arr = pa.array(in_data, type=in_type) + + with pytest.raises(pa.ArrowInvalid): + in_arr.cast(out_type) + + +def test_cast_none(): + # ARROW-3735: Ensure that calling cast(None) doesn't segfault. + arr = pa.array([1, 2, 3]) + + with pytest.raises(TypeError): + arr.cast(None) + + +def test_cast_list_to_primitive(): + # ARROW-8070: cast segfaults on unsupported cast from list to utf8 + arr = pa.array([[1, 2], [3, 4]]) + with pytest.raises(NotImplementedError): + arr.cast(pa.int8()) + + arr = pa.array([[b"a", b"b"], [b"c"]], pa.list_(pa.binary())) + with pytest.raises(NotImplementedError): + arr.cast(pa.binary()) + + +def test_slice_chunked_array_zero_chunks(): + # ARROW-8911 + arr = pa.chunked_array([], type='int8') + assert arr.num_chunks == 0 + + result = arr[:] + assert result.equals(arr) + + # Do not crash + arr[:5] + + +def test_cast_chunked_array(): + arrays = [pa.array([1, 2, 3]), pa.array([4, 5, 6])] + carr = pa.chunked_array(arrays) + + target = pa.float64() + casted = carr.cast(target) + expected = pa.chunked_array([x.cast(target) for x in arrays]) + assert casted.equals(expected) + + +def test_cast_chunked_array_empty(): + # ARROW-8142 + for typ1, typ2 in [(pa.dictionary(pa.int8(), pa.string()), pa.string()), + (pa.int64(), pa.int32())]: + + arr = pa.chunked_array([], type=typ1) + result = arr.cast(typ2) + expected = pa.chunked_array([], type=typ2) + assert result.equals(expected) + + +def test_chunked_array_data_warns(): + with pytest.warns(FutureWarning): + res = pa.chunked_array([[]]).data + assert isinstance(res, pa.ChunkedArray) + + +@pytest.mark.numpy +def test_cast_integers_unsafe(): + # We let NumPy do the unsafe casting. + # Note that NEP50 in the NumPy spec no longer allows + # the np.array() constructor to pass the dtype directly + # if it results in an unsafe cast. + unsafe_cases = [ + (np.array([50000], dtype='i4'), 'int32', + np.array([50000]).astype(dtype='i2'), pa.int16()), + (np.array([70000], dtype='i4'), 'int32', + np.array([70000]).astype(dtype='u2'), pa.uint16()), + (np.array([-1], dtype='i4'), 'int32', + np.array([-1]).astype(dtype='u2'), pa.uint16()), + (np.array([50000], dtype='u2'), pa.uint16(), + np.array([50000]).astype(dtype='i2'), pa.int16()) + ] + + for case in unsafe_cases: + _check_cast_case(case, safe=False) + + +@pytest.mark.numpy +def test_floating_point_truncate_safe(): + safe_cases = [ + (np.array([1.0, 2.0, 3.0], dtype='float32'), 'float32', + np.array([1, 2, 3], dtype='i4'), pa.int32()), + (np.array([1.0, 2.0, 3.0], dtype='float64'), 'float64', + np.array([1, 2, 3], dtype='i4'), pa.int32()), + (np.array([-10.0, 20.0, -30.0], dtype='float64'), 'float64', + np.array([-10, 20, -30], dtype='i4'), pa.int32()), + ] + for case in safe_cases: + _check_cast_case(case, safe=True) + + +@pytest.mark.numpy +def test_floating_point_truncate_unsafe(): + unsafe_cases = [ + (np.array([1.1, 2.2, 3.3], dtype='float32'), 'float32', + np.array([1, 2, 3], dtype='i4'), pa.int32()), + (np.array([1.1, 2.2, 3.3], dtype='float64'), 'float64', + np.array([1, 2, 3], dtype='i4'), pa.int32()), + (np.array([-10.1, 20.2, -30.3], dtype='float64'), 'float64', + np.array([-10, 20, -30], dtype='i4'), pa.int32()), + ] + for case in unsafe_cases: + # test safe casting raises + with pytest.raises(pa.ArrowInvalid, match='truncated'): + _check_cast_case(case, safe=True) + + # test unsafe casting truncates + _check_cast_case(case, safe=False) + + +def test_half_float_array_from_python(): + # GH-46611 + vals = [-5, 0, 1.0, 2.0, 3, None, 12345.6789, 1.234567, float('inf')] + arr = pa.array(vals, type=pa.float16()) + assert arr.type == pa.float16() + assert arr.to_pylist() == [-5, 0, 1.0, 2.0, 3, None, 12344.0, + 1.234375, float('inf')] + assert str(arr) == ("[\n -5,\n 0,\n 1,\n 2,\n 3,\n null,\n 12344," + "\n 1.234375,\n inf\n]") + msg1 = "Could not convert 'a' with type str: tried to convert to float16" + with pytest.raises(pa.ArrowInvalid, match=msg1): + arr = pa.array(['a', 3, None], type=pa.float16()) + + +def test_decimal_to_int_safe(): + safe_cases = [ + ( + [decimal.Decimal("123456"), None, decimal.Decimal("-912345")], + pa.decimal128(32, 5), + [123456, None, -912345], + pa.int32() + ), + ( + [decimal.Decimal("1234"), None, decimal.Decimal("-9123")], + pa.decimal128(19, 10), + [1234, None, -9123], + pa.int16() + ), + ( + [decimal.Decimal("123"), None, decimal.Decimal("-91")], + pa.decimal128(19, 10), + [123, None, -91], + pa.int8() + ), + ] + for case in safe_cases: + _check_cast_case(case) + _check_cast_case(case, safe=True) + + +@pytest.mark.numpy +def test_decimal_to_int_value_out_of_bounds(): + out_of_bounds_cases = [ + ( + np.array([ + decimal.Decimal("1234567890123"), + None, + decimal.Decimal("-912345678901234") + ]), + pa.decimal128(32, 5), + [1912276171, None, -135950322], + pa.int32() + ), + ( + [decimal.Decimal("123456"), None, decimal.Decimal("-912345678")], + pa.decimal128(32, 5), + [-7616, None, -19022], + pa.int16() + ), + ( + [decimal.Decimal("1234"), None, decimal.Decimal("-9123")], + pa.decimal128(32, 5), + [-46, None, 93], + pa.int8() + ), + ] + + for case in out_of_bounds_cases: + # test safe casting raises + with pytest.raises(pa.ArrowInvalid, + match='Integer value out of bounds'): + _check_cast_case(case) + + # XXX `safe=False` can be ignored when constructing an array + # from a sequence of Python objects (ARROW-8567) + _check_cast_case(case, safe=False, check_array_construction=False) + + +def test_decimal_to_int_non_integer(): + non_integer_cases = [ + ( + [ + decimal.Decimal("123456.21"), + None, + decimal.Decimal("-912345.13") + ], + pa.decimal128(32, 5), + [123456, None, -912345], + pa.int32() + ), + ( + [decimal.Decimal("1234.134"), None, decimal.Decimal("-9123.1")], + pa.decimal128(19, 10), + [1234, None, -9123], + pa.int16() + ), + ( + [decimal.Decimal("123.1451"), None, decimal.Decimal("-91.21")], + pa.decimal128(19, 10), + [123, None, -91], + pa.int8() + ), + ] + + for case in non_integer_cases: + # test safe casting raises + msg_regexp = 'Rescaling Decimal value would cause data loss' + with pytest.raises(pa.ArrowInvalid, match=msg_regexp): + _check_cast_case(case) + + _check_cast_case(case, safe=False) + + +def test_decimal_to_decimal(): + arr = pa.array( + [decimal.Decimal("1234.12"), None], + type=pa.decimal128(19, 10) + ) + result = arr.cast(pa.decimal128(15, 6)) + expected = pa.array( + [decimal.Decimal("1234.12"), None], + type=pa.decimal128(15, 6) + ) + assert result.equals(expected) + + msg_regexp = 'Rescaling Decimal value would cause data loss' + with pytest.raises(pa.ArrowInvalid, match=msg_regexp): + result = arr.cast(pa.decimal128(9, 1)) + + result = arr.cast(pa.decimal128(9, 1), safe=False) + expected = pa.array( + [decimal.Decimal("1234.1"), None], + type=pa.decimal128(9, 1) + ) + assert result.equals(expected) + + with pytest.raises(pa.ArrowInvalid, + match='Decimal value does not fit in precision'): + result = arr.cast(pa.decimal128(5, 2)) + + +@pytest.mark.numpy +def test_safe_cast_nan_to_int_raises(): + arr = pa.array([np.nan, 1.]) + + with pytest.raises(pa.ArrowInvalid, match='truncated'): + arr.cast(pa.int64(), safe=True) + + +@pytest.mark.numpy +def test_cast_signed_to_unsigned(): + safe_cases = [ + (np.array([0, 1, 2, 3], dtype='i1'), pa.uint8(), + np.array([0, 1, 2, 3], dtype='u1'), pa.uint8()), + (np.array([0, 1, 2, 3], dtype='i2'), pa.uint16(), + np.array([0, 1, 2, 3], dtype='u2'), pa.uint16()) + ] + + for case in safe_cases: + _check_cast_case(case) + + +def test_cast_from_null(): + in_data = [None] * 3 + in_type = pa.null() + out_types = [ + pa.null(), + pa.uint8(), + pa.float16(), + pa.utf8(), + pa.binary(), + pa.binary(10), + pa.list_(pa.int16()), + pa.list_(pa.int32(), 4), + pa.large_list(pa.uint8()), + pa.decimal128(19, 4), + pa.timestamp('us'), + pa.timestamp('us', tz='UTC'), + pa.timestamp('us', tz='Europe/Paris'), + pa.duration('us'), + pa.month_day_nano_interval(), + pa.struct([pa.field('a', pa.int32()), + pa.field('b', pa.list_(pa.int8())), + pa.field('c', pa.string())]), + pa.dictionary(pa.int32(), pa.string()), + ] + for out_type in out_types: + _check_cast_case((in_data, in_type, in_data, out_type)) + + out_types = [ + + pa.union([pa.field('a', pa.binary(10)), + pa.field('b', pa.string())], mode=pa.lib.UnionMode_DENSE), + pa.union([pa.field('a', pa.binary(10)), + pa.field('b', pa.string())], mode=pa.lib.UnionMode_SPARSE), + ] + in_arr = pa.array(in_data, type=pa.null()) + for out_type in out_types: + with pytest.raises(NotImplementedError): + in_arr.cast(out_type) + + +def test_cast_string_to_number_roundtrip(): + cases = [ + (pa.array(["1", "127", "-128"]), + pa.array([1, 127, -128], type=pa.int8())), + (pa.array([None, "18446744073709551615"]), + pa.array([None, 18446744073709551615], type=pa.uint64())), + ] + for in_arr, expected in cases: + casted = in_arr.cast(expected.type, safe=True) + casted.validate(full=True) + assert casted.equals(expected) + casted_back = casted.cast(in_arr.type, safe=True) + casted_back.validate(full=True) + assert casted_back.equals(in_arr) + + +def test_cast_dictionary(): + # cast to the value type + arr = pa.array( + ["foo", "bar", None], + type=pa.dictionary(pa.int64(), pa.string()) + ) + expected = pa.array(["foo", "bar", None]) + assert arr.type == pa.dictionary(pa.int64(), pa.string()) + assert arr.cast(pa.string()) == expected + + # cast to a different key type + for key_type in [pa.int8(), pa.int16(), pa.int32()]: + typ = pa.dictionary(key_type, pa.string()) + expected = pa.array( + ["foo", "bar", None], + type=pa.dictionary(key_type, pa.string()) + ) + assert arr.cast(typ) == expected + + # shouldn't crash (ARROW-7077) + with pytest.raises(pa.ArrowInvalid): + arr.cast(pa.int32()) + + +def test_view(): + # ARROW-5992 + arr = pa.array(['foo', 'bar', 'baz'], type=pa.utf8()) + expected = pa.array(['foo', 'bar', 'baz'], type=pa.binary()) + + assert arr.view(pa.binary()).equals(expected) + assert arr.view('binary').equals(expected) + + +def test_unique_simple(): + cases = [ + (pa.array([1, 2, 3, 1, 2, 3]), pa.array([1, 2, 3])), + (pa.array(['foo', None, 'bar', 'foo']), + pa.array(['foo', None, 'bar'])), + (pa.array(['foo', None, 'bar', 'foo'], pa.large_binary()), + pa.array(['foo', None, 'bar'], pa.large_binary())), + ] + for arr, expected in cases: + result = arr.unique() + assert result.equals(expected) + result = pa.chunked_array([arr]).unique() + assert result.equals(expected) + + +def test_value_counts_simple(): + cases = [ + (pa.array([1, 2, 3, 1, 2, 3]), + pa.array([1, 2, 3]), + pa.array([2, 2, 2], type=pa.int64())), + (pa.array(['foo', None, 'bar', 'foo']), + pa.array(['foo', None, 'bar']), + pa.array([2, 1, 1], type=pa.int64())), + (pa.array(['foo', None, 'bar', 'foo'], pa.large_binary()), + pa.array(['foo', None, 'bar'], pa.large_binary()), + pa.array([2, 1, 1], type=pa.int64())), + ] + for arr, expected_values, expected_counts in cases: + for arr_in in (arr, pa.chunked_array([arr])): + result = arr_in.value_counts() + assert result.type.equals( + pa.struct([pa.field("values", arr.type), + pa.field("counts", pa.int64())])) + assert result.field("values").equals(expected_values) + assert result.field("counts").equals(expected_counts) + + +def test_unique_value_counts_dictionary_type(): + indices = pa.array([3, 0, 0, 0, 1, 1, 3, 0, 1, 3, 0, 1]) + dictionary = pa.array(['foo', 'bar', 'baz', 'qux']) + + arr = pa.DictionaryArray.from_arrays(indices, dictionary) + + unique_result = arr.unique() + expected = pa.DictionaryArray.from_arrays(indices.unique(), dictionary) + assert unique_result.equals(expected) + + result = arr.value_counts() + assert result.field('values').equals(unique_result) + assert result.field('counts').equals(pa.array([3, 5, 4], type='int64')) + + arr = pa.DictionaryArray.from_arrays( + pa.array([], type='int64'), dictionary) + unique_result = arr.unique() + expected = pa.DictionaryArray.from_arrays(pa.array([], type='int64'), + pa.array([], type='utf8')) + assert unique_result.equals(expected) + + result = arr.value_counts() + assert result.field('values').equals(unique_result) + assert result.field('counts').equals(pa.array([], type='int64')) + + +def test_dictionary_encode_simple(): + cases = [ + (pa.array([1, 2, 3, None, 1, 2, 3]), + pa.DictionaryArray.from_arrays( + pa.array([0, 1, 2, None, 0, 1, 2], type='int32'), + [1, 2, 3])), + (pa.array(['foo', None, 'bar', 'foo']), + pa.DictionaryArray.from_arrays( + pa.array([0, None, 1, 0], type='int32'), + ['foo', 'bar'])), + (pa.array(['foo', None, 'bar', 'foo'], type=pa.large_binary()), + pa.DictionaryArray.from_arrays( + pa.array([0, None, 1, 0], type='int32'), + pa.array(['foo', 'bar'], type=pa.large_binary()))), + ] + for arr, expected in cases: + result = arr.dictionary_encode() + assert result.equals(expected) + result = pa.chunked_array([arr]).dictionary_encode() + assert result.num_chunks == 1 + assert result.chunk(0).equals(expected) + result = pa.chunked_array([], type=arr.type).dictionary_encode() + assert result.num_chunks == 0 + assert result.type == expected.type + + +def test_dictionary_encode_sliced(): + cases = [ + (pa.array([1, 2, 3, None, 1, 2, 3])[1:-1], + pa.DictionaryArray.from_arrays( + pa.array([0, 1, None, 2, 0], type='int32'), + [2, 3, 1])), + (pa.array([None, 'foo', 'bar', 'foo', 'xyzzy'])[1:-1], + pa.DictionaryArray.from_arrays( + pa.array([0, 1, 0], type='int32'), + ['foo', 'bar'])), + (pa.array([None, 'foo', 'bar', 'foo', 'xyzzy'], + type=pa.large_string())[1:-1], + pa.DictionaryArray.from_arrays( + pa.array([0, 1, 0], type='int32'), + pa.array(['foo', 'bar'], type=pa.large_string()))), + ] + for arr, expected in cases: + result = arr.dictionary_encode() + assert result.equals(expected) + result = pa.chunked_array([arr]).dictionary_encode() + assert result.num_chunks == 1 + assert result.type == expected.type + assert result.chunk(0).equals(expected) + result = pa.chunked_array([], type=arr.type).dictionary_encode() + assert result.num_chunks == 0 + assert result.type == expected.type + + # ARROW-9143 dictionary_encode after slice was segfaulting + array = pa.array(['foo', 'bar', 'baz']) + array.slice(1).dictionary_encode() + + +def test_dictionary_encode_zero_length(): + # User-facing experience of ARROW-7008 + arr = pa.array([], type=pa.string()) + encoded = arr.dictionary_encode() + assert len(encoded.dictionary) == 0 + encoded.validate(full=True) + + +def test_dictionary_decode(): + cases = [ + (pa.array([1, 2, 3, None, 1, 2, 3]), + pa.DictionaryArray.from_arrays( + pa.array([0, 1, 2, None, 0, 1, 2], type='int32'), + [1, 2, 3])), + (pa.array(['foo', None, 'bar', 'foo']), + pa.DictionaryArray.from_arrays( + pa.array([0, None, 1, 0], type='int32'), + ['foo', 'bar'])), + (pa.array(['foo', None, 'bar', 'foo'], type=pa.large_binary()), + pa.DictionaryArray.from_arrays( + pa.array([0, None, 1, 0], type='int32'), + pa.array(['foo', 'bar'], type=pa.large_binary()))), + ] + for expected, arr in cases: + result = arr.dictionary_decode() + assert result.equals(expected) + + +@pytest.mark.numpy +def test_cast_time32_to_int(): + arr = pa.array(np.array([0, 1, 2], dtype='int32'), + type=pa.time32('s')) + expected = pa.array([0, 1, 2], type='i4') + + result = arr.cast('i4') + assert result.equals(expected) + + +@pytest.mark.numpy +def test_cast_time64_to_int(): + arr = pa.array(np.array([0, 1, 2], dtype='int64'), + type=pa.time64('us')) + expected = pa.array([0, 1, 2], type='i8') + + result = arr.cast('i8') + assert result.equals(expected) + + +@pytest.mark.numpy +def test_cast_timestamp_to_int(): + arr = pa.array(np.array([0, 1, 2], dtype='int64'), + type=pa.timestamp('us')) + expected = pa.array([0, 1, 2], type='i8') + + result = arr.cast('i8') + assert result.equals(expected) + + +def test_cast_date32_to_int(): + arr = pa.array([0, 1, 2], type='i4') + + result1 = arr.cast('date32') + result2 = result1.cast('i4') + + expected1 = pa.array([ + datetime.date(1970, 1, 1), + datetime.date(1970, 1, 2), + datetime.date(1970, 1, 3) + ]).cast('date32') + + assert result1.equals(expected1) + assert result2.equals(arr) + + +@pytest.mark.numpy +def test_cast_duration_to_int(): + arr = pa.array(np.array([0, 1, 2], dtype='int64'), + type=pa.duration('us')) + expected = pa.array([0, 1, 2], type='i8') + + result = arr.cast('i8') + assert result.equals(expected) + + +@pytest.mark.numpy +def test_cast_binary_to_utf8(): + binary_arr = pa.array([b'foo', b'bar', b'baz'], type=pa.binary()) + utf8_arr = binary_arr.cast(pa.utf8()) + expected = pa.array(['foo', 'bar', 'baz'], type=pa.utf8()) + + assert utf8_arr.equals(expected) + + non_utf8_values = [('mañana').encode('utf-16-le')] + non_utf8_binary = pa.array(non_utf8_values) + assert non_utf8_binary.type == pa.binary() + with pytest.raises(ValueError): + non_utf8_binary.cast(pa.string()) + + non_utf8_all_null = pa.array(non_utf8_values, mask=np.array([True]), + type=pa.binary()) + # No error + casted = non_utf8_all_null.cast(pa.string()) + assert casted.null_count == 1 + + +@pytest.mark.numpy +def test_cast_date64_to_int(): + arr = pa.array(np.array([0, 1, 2], dtype='int64'), + type=pa.date64()) + expected = pa.array([0, 1, 2], type='i8') + + result = arr.cast('i8') + + assert result.equals(expected) + + +def test_date64_from_builtin_datetime(): + val1 = datetime.datetime(2000, 1, 1, 12, 34, 56, 123456) + val2 = datetime.datetime(2000, 1, 1) + result = pa.array([val1, val2], type='date64') + result2 = pa.array([val1.date(), val2.date()], type='date64') + + assert result.equals(result2) + + as_i8 = result.view('int64') + assert as_i8[0].as_py() == as_i8[1].as_py() + + +def test_create_date32_and_date64_arrays_with_mask(): + # Test Date32 array creation from Python list with mask + arr_date32 = pa.array([0, 0, 1, 2], + mask=[False, False, True, False], + type=pa.date32()) + expected_date32 = pa.array([ + datetime.date(1970, 1, 1), + datetime.date(1970, 1, 1), + None, + datetime.date(1970, 1, 3), + ], type=pa.date32()) + assert arr_date32.equals(expected_date32) + + # Test Date32 array creation from Python dates + arr_date32_dates = pa.array([ + datetime.date(2023, 1, 1), + datetime.date(2023, 1, 2), + None, + datetime.date(2023, 1, 4), + ], type=pa.date32()) + assert arr_date32_dates.null_count == 1 + assert arr_date32_dates[2].as_py() is None + + # Test Date64 array creation from Python list with mask + arr_date64 = pa.array([0, 86400000, 172800000, 259200000], + mask=[False, False, True, False], + type=pa.date64()) + expected_date64 = pa.array([ + datetime.date(1970, 1, 1), + datetime.date(1970, 1, 2), + None, + datetime.date(1970, 1, 4), + ], type=pa.date64()) + assert arr_date64.equals(expected_date64) + + # Test Date64 array creation from Python dates + arr_date64_dates = pa.array([ + datetime.date(2023, 1, 1), + datetime.date(2023, 1, 2), + None, + datetime.date(2023, 1, 4), + ], type=pa.date64()) + assert arr_date64_dates.null_count == 1 + assert arr_date64_dates[2].as_py() is None + + # Test Date32 with all nulls mask + arr_all_null = pa.array([0, 1, 2, 3], + mask=[True, True, True, True], + type=pa.date32()) + assert arr_all_null.null_count == 4 + + +@pytest.mark.parametrize(('ty', 'values'), [ + ('bool', [True, False, True]), + ('uint8', range(0, 255)), + ('int8', range(0, 128)), + ('uint16', range(0, 10)), + ('int16', range(0, 10)), + ('uint32', range(0, 10)), + ('int32', range(0, 10)), + ('uint64', range(0, 10)), + ('int64', range(0, 10)), + ('float', [0.0, 0.1, 0.2]), + ('double', [0.0, 0.1, 0.2]), + ('string', ['a', 'b', 'c']), + ('binary', [b'a', b'b', b'c']), + (pa.binary(3), [b'abc', b'bcd', b'cde']) +]) +def test_cast_identities(ty, values): + arr = pa.array(values, type=ty) + assert arr.cast(ty).equals(arr) + + +pickle_test_parametrize = pytest.mark.parametrize( + ('data', 'typ'), + [ + ([True, False, True, True], pa.bool_()), + ([1, 2, 4, 6], pa.int64()), + ([1.0, 2.5, None], pa.float64()), + (['a', None, 'b'], pa.string()), + ([], None), + ([[1, 2], [3]], pa.list_(pa.int64())), + ([[4, 5], [6]], pa.large_list(pa.int16())), + ([['a'], None, ['b', 'c']], pa.list_(pa.string())), + ([[1, 2], [3]], pa.list_view(pa.int64())), + ([[4, 5], [6]], pa.large_list_view(pa.int16())), + ([['a'], None, ['b', 'c']], pa.list_view(pa.string())), + ([(1, 'a'), (2, 'c'), None], + pa.struct([pa.field('a', pa.int64()), pa.field('b', pa.string())])) + ] +) + + +@pickle_test_parametrize +def test_array_pickle(data, typ, pickle_module): + # Allocate here so that we don't have any Arrow data allocated. + # This is needed to ensure that allocator tests can be reliable. + array = pa.array(data, type=typ) + for proto in range(0, pickle_module.HIGHEST_PROTOCOL + 1): + result = pickle_module.loads(pickle_module.dumps(array, proto)) + assert array.equals(result) + + +def test_array_pickle_dictionary(pickle_module): + # not included in the above as dictionary array cannot be created with + # the pa.array function + array = pa.DictionaryArray.from_arrays([0, 1, 2, 0, 1], ['a', 'b', 'c']) + for proto in range(0, pickle_module.HIGHEST_PROTOCOL + 1): + result = pickle_module.loads(pickle_module.dumps(array, proto)) + assert array.equals(result) + + +@pytest.mark.numpy +@h.settings(suppress_health_check=(h.HealthCheck.too_slow,)) +@h.given( + past.arrays( + past.all_types, + size=st.integers(min_value=0, max_value=10) + ) +) +def test_pickling(pickle_module, arr): + data = pickle_module.dumps(arr) + restored = pickle_module.loads(data) + assert arr.equals(restored) + + +@pickle_test_parametrize +def test_array_pickle_protocol5(data, typ, pickle_module): + # Test zero-copy pickling with protocol 5 (PEP 574) + array = pa.array(data, type=typ) + addresses = [buf.address if buf is not None else 0 + for buf in array.buffers()] + + for proto in range(5, pickle_module.HIGHEST_PROTOCOL + 1): + buffers = [] + pickled = pickle_module.dumps(array, proto, buffer_callback=buffers.append) + result = pickle_module.loads(pickled, buffers=buffers) + assert array.equals(result) + + result_addresses = [buf.address if buf is not None else 0 + for buf in result.buffers()] + assert result_addresses == addresses + + +@pytest.mark.numpy +def test_to_numpy_roundtrip(): + for narr in [ + np.arange(10, dtype=np.int64), + np.arange(10, dtype=np.int32), + np.arange(10, dtype=np.int16), + np.arange(10, dtype=np.int8), + np.arange(10, dtype=np.uint64), + np.arange(10, dtype=np.uint32), + np.arange(10, dtype=np.uint16), + np.arange(10, dtype=np.uint8), + np.arange(10, dtype=np.float64), + np.arange(10, dtype=np.float32), + np.arange(10, dtype=np.float16), + ]: + arr = pa.array(narr) + assert narr.dtype == arr.to_numpy().dtype + np.testing.assert_array_equal(narr, arr.to_numpy()) + np.testing.assert_array_equal(narr[:6], arr[:6].to_numpy()) + np.testing.assert_array_equal(narr[2:], arr[2:].to_numpy()) + np.testing.assert_array_equal(narr[2:6], arr[2:6].to_numpy()) + + +@pytest.mark.numpy +def test_array_uint64_from_py_over_range(): + arr = pa.array([2 ** 63], type=pa.uint64()) + expected = pa.array(np.array([2 ** 63], dtype='u8')) + assert arr.equals(expected) + + +@pytest.mark.numpy +def test_array_conversions_no_sentinel_values(): + arr = np.array([1, 2, 3, 4], dtype='int8') + refcount = sys.getrefcount(arr) + arr2 = pa.array(arr) # noqa + assert sys.getrefcount(arr) == (refcount + 1) + + assert arr2.type == 'int8' + + for ty in ['float16', 'float32', 'float64']: + arr3 = pa.array(np.array([1, np.nan, 2, 3, np.nan, 4], dtype=ty), + type=ty) + assert arr3.type == ty + assert arr3.null_count == 0 + + +def test_time32_time64_from_integer(): + # ARROW-4111 + result = pa.array([1, 2, None], type=pa.time32('s')) + expected = pa.array([datetime.time(second=1), + datetime.time(second=2), None], + type=pa.time32('s')) + assert result.equals(expected) + + result = pa.array([1, 2, None], type=pa.time32('ms')) + expected = pa.array([datetime.time(microsecond=1000), + datetime.time(microsecond=2000), None], + type=pa.time32('ms')) + assert result.equals(expected) + + result = pa.array([1, 2, None], type=pa.time64('us')) + expected = pa.array([datetime.time(microsecond=1), + datetime.time(microsecond=2), None], + type=pa.time64('us')) + assert result.equals(expected) + + result = pa.array([1000, 2000, None], type=pa.time64('ns')) + expected = pa.array([datetime.time(microsecond=1), + datetime.time(microsecond=2), None], + type=pa.time64('ns')) + assert result.equals(expected) + + +@pytest.mark.numpy +def test_binary_string_pandas_null_sentinels(): + # ARROW-6227 + def _check_case(ty): + arr = pa.array(['string', np.nan], type=ty, from_pandas=True) + expected = pa.array(['string', None], type=ty) + assert arr.equals(expected) + _check_case('binary') + _check_case('utf8') + + +@pytest.mark.numpy +def test_pandas_null_sentinels_raise_error(): + # ARROW-6227 + cases = [ + ([None, np.nan], 'null'), + (['string', np.nan], 'binary'), + (['string', np.nan], 'utf8'), + (['string', np.nan], 'large_binary'), + (['string', np.nan], 'large_utf8'), + ([b'string', np.nan], pa.binary(6)), + ([True, np.nan], pa.bool_()), + ([decimal.Decimal('0'), np.nan], pa.decimal128(12, 2)), + ([0, np.nan], pa.date32()), + ([0, np.nan], pa.date32()), + ([0, np.nan], pa.date64()), + ([0, np.nan], pa.time32('s')), + ([0, np.nan], pa.time64('us')), + ([0, np.nan], pa.timestamp('us')), + ([0, np.nan], pa.duration('us')), + ] + for case, ty in cases: + # Both types of exceptions are raised. May want to clean that up + with pytest.raises((ValueError, TypeError)): + pa.array(case, type=ty) + + # from_pandas option suppresses failure + result = pa.array(case, type=ty, from_pandas=True) + assert result.null_count == (1 if ty != 'null' else 2) + + +@pytest.mark.pandas +def test_pandas_null_sentinels_index(): + # ARROW-7023 - ensure that when passing a pandas Index, "from_pandas" + # semantics are used + import pandas as pd + idx = pd.Index([1, 2, np.nan], dtype=object) + result = pa.array(idx) + expected = pa.array([1, 2, np.nan], from_pandas=True) + assert result.equals(expected) + + +@pytest.mark.numpy +def test_array_roundtrip_from_numpy_datetimeD(): + arr = np.array([None, datetime.date(2017, 4, 4)], dtype='datetime64[D]') + + result = pa.array(arr) + expected = pa.array([None, datetime.date(2017, 4, 4)], type=pa.date32()) + assert result.equals(expected) + result = result.to_numpy(zero_copy_only=False) + np.testing.assert_array_equal(result, arr) + assert result.dtype == arr.dtype + + +def test_array_from_naive_datetimes(): + arr = pa.array([ + None, + datetime.datetime(2017, 4, 4, 12, 11, 10), + datetime.datetime(2018, 1, 1, 0, 2, 0) + ]) + assert arr.type == pa.timestamp('us', tz=None) + + +@pytest.mark.numpy +@pytest.mark.parametrize(('dtype', 'type'), [ + ('datetime64[s]', pa.timestamp('s')), + ('datetime64[ms]', pa.timestamp('ms')), + ('datetime64[us]', pa.timestamp('us')), + ('datetime64[ns]', pa.timestamp('ns')) +]) +def test_array_from_numpy_datetime(dtype, type): + data = [ + None, + datetime.datetime(2017, 4, 4, 12, 11, 10), + datetime.datetime(2018, 1, 1, 0, 2, 0) + ] + + # from numpy array + arr = pa.array(np.array(data, dtype=dtype)) + expected = pa.array(data, type=type) + assert arr.equals(expected) + + # from list of numpy scalars + arr = pa.array(list(np.array(data, dtype=dtype))) + assert arr.equals(expected) + + +@pytest.mark.numpy +def test_array_from_different_numpy_datetime_units_raises(): + data = [ + None, + datetime.datetime(2017, 4, 4, 12, 11, 10), + datetime.datetime(2018, 1, 1, 0, 2, 0) + ] + s = np.array(data, dtype='datetime64[s]') + ms = np.array(data, dtype='datetime64[ms]') + data = list(s[:2]) + list(ms[2:]) + + with pytest.raises(pa.ArrowInvalid, + match="Cannot mix NumPy datetime64 units s and ms"): + pa.array(data) + + +@pytest.mark.numpy +@pytest.mark.parametrize('unit', [ + 'Y', # year + 'M', # month + 'W', # week + 'h', # hour + 'm', # minute + 'ps', # picosecond + 'fs', # femtosecond + 'as', # attosecond +]) +def test_array_from_unsupported_numpy_datetime_unit_names(unit): + s_data = [np.datetime64('2020-01-01', 's')] + unsupported_data = [np.datetime64('2020', unit)] + + # Mix supported unit (s) with unsupported unit + data = s_data + unsupported_data + + with pytest.raises(pa.ArrowInvalid, + match=f"Cannot mix NumPy datetime64 units s and {unit}"): + pa.array(data) + + +@pytest.mark.numpy +@pytest.mark.parametrize('unit', ['ns', 'us', 'ms', 's']) +def test_array_from_list_of_timestamps(unit): + n = np.datetime64('NaT', unit) + x = np.datetime64('2017-01-01 01:01:01.111111111', unit) + y = np.datetime64('2018-11-22 12:24:48.111111111', unit) + + a1 = pa.array([n, x, y]) + a2 = pa.array([n, x, y], type=pa.timestamp(unit)) + + assert a1.type == a2.type + assert a1.type.unit == unit + assert a1[0] == a2[0] + + +@pytest.mark.numpy +def test_array_from_timestamp_with_generic_unit(): + n = np.datetime64('NaT') + x = np.datetime64('2017-01-01 01:01:01.111111111') + y = np.datetime64('2018-11-22 12:24:48.111111111') + + with pytest.raises(pa.ArrowInvalid, + match='Cannot mix NumPy datetime64 units'): + pa.array([n, x, y]) + + +@pytest.mark.numpy +@pytest.mark.parametrize(('dtype', 'type'), [ + ('timedelta64[s]', pa.duration('s')), + ('timedelta64[ms]', pa.duration('ms')), + ('timedelta64[us]', pa.duration('us')), + ('timedelta64[ns]', pa.duration('ns')) +]) +def test_array_from_numpy_timedelta(dtype, type): + data = [ + None, + datetime.timedelta(1), + datetime.timedelta(0, 1) + ] + + # from numpy array + np_arr = np.array(data, dtype=dtype) + arr = pa.array(np_arr) + assert isinstance(arr, pa.DurationArray) + assert arr.type == type + expected = pa.array(data, type=type) + assert arr.equals(expected) + assert arr.to_pylist() == data + + # from list of numpy scalars + arr = pa.array(list(np.array(data, dtype=dtype))) + assert arr.equals(expected) + assert arr.to_pylist() == data + + +@pytest.mark.numpy +def test_array_from_numpy_timedelta_incorrect_unit(): + # generic (no unit) + td = np.timedelta64(1) + + for data in [[td], np.array([td])]: + with pytest.raises(NotImplementedError): + pa.array(data) + + # unsupported unit + td = np.timedelta64(1, 'M') + for data in [[td], np.array([td])]: + with pytest.raises(NotImplementedError): + pa.array(data) + + +@pytest.mark.numpy +@pytest.mark.parametrize('binary_type', [ + None, + pa.binary(), + pa.large_binary(), + pa.binary_view()]) +def test_array_from_numpy_ascii(binary_type): + # Default when no type is specified should be binary + expected_type = binary_type or pa.binary() + + arr = np.array(['abcde', 'abc', ''], dtype='|S5') + + arrow_arr = pa.array(arr, binary_type) + assert arrow_arr.type == expected_type + expected = pa.array(['abcde', 'abc', ''], type=expected_type) + assert arrow_arr.equals(expected) + + mask = np.array([False, True, False]) + arrow_arr = pa.array(arr, binary_type, mask=mask) + expected = pa.array(['abcde', None, ''], type=expected_type) + assert arrow_arr.equals(expected) + + # Strided variant + arr = np.array(['abcde', 'abc', ''] * 5, dtype='|S5')[::2] + mask = np.array([False, True, False] * 5)[::2] + arrow_arr = pa.array(arr, binary_type, mask=mask) + + expected = pa.array(['abcde', '', None, 'abcde', '', None, 'abcde', ''], + type=expected_type) + assert arrow_arr.equals(expected) + + # 0 itemsize + arr = np.array(['', '', ''], dtype='|S0') + arrow_arr = pa.array(arr, binary_type) + expected = pa.array(['', '', ''], type=expected_type) + assert arrow_arr.equals(expected) + + +def test_interval_array_from_timedelta(): + data = [ + None, + datetime.timedelta(days=1, seconds=1, microseconds=1, + milliseconds=1, minutes=1, hours=1, weeks=1)] + + # From timedelta (explicit type required) + arr = pa.array(data, pa.month_day_nano_interval()) + assert isinstance(arr, pa.MonthDayNanoIntervalArray) + assert arr.type == pa.month_day_nano_interval() + expected_list = [ + None, + pa.MonthDayNano([0, 8, + (datetime.timedelta(seconds=1, microseconds=1, + milliseconds=1, minutes=1, + hours=1) // + datetime.timedelta(microseconds=1)) * 1000])] + expected = pa.array(expected_list) + assert arr.equals(expected) + assert arr.to_pylist() == expected_list + + +@pytest.mark.pandas +def test_interval_array_from_relativedelta(): + # dateutil is dependency of pandas + from dateutil.relativedelta import relativedelta + from pandas import DateOffset + data = [ + None, + relativedelta(years=1, months=1, + days=1, seconds=1, microseconds=1, + minutes=1, hours=1, weeks=1, leapdays=1)] + # Note leapdays are ignored. + + # From relativedelta + arr = pa.array(data) + assert isinstance(arr, pa.MonthDayNanoIntervalArray) + assert arr.type == pa.month_day_nano_interval() + expected_list = [ + None, + pa.MonthDayNano([13, 8, + (datetime.timedelta(seconds=1, microseconds=1, + minutes=1, hours=1) // + datetime.timedelta(microseconds=1)) * 1000])] + expected = pa.array(expected_list) + assert arr.equals(expected) + assert arr.to_pandas().tolist() == [ + None, DateOffset(months=13, days=8, + microseconds=( + datetime.timedelta(seconds=1, microseconds=1, + minutes=1, hours=1) // + datetime.timedelta(microseconds=1)), + nanoseconds=0)] + with pytest.raises(ValueError): + pa.array([DateOffset(years=((1 << 32) // 12), months=100)]) + with pytest.raises(ValueError): + pa.array([DateOffset(weeks=((1 << 32) // 7), days=100)]) + with pytest.raises(ValueError): + pa.array([DateOffset(seconds=((1 << 64) // 1000000000), + nanoseconds=1)]) + with pytest.raises(ValueError): + pa.array([DateOffset(microseconds=((1 << 64) // 100))]) + + +def test_interval_array_from_tuple(): + data = [None, (1, 2, -3)] + + # From timedelta (explicit type required) + arr = pa.array(data, pa.month_day_nano_interval()) + assert isinstance(arr, pa.MonthDayNanoIntervalArray) + assert arr.type == pa.month_day_nano_interval() + expected_list = [ + None, + pa.MonthDayNano([1, 2, -3])] + expected = pa.array(expected_list) + assert arr.equals(expected) + assert arr.to_pylist() == expected_list + + +@pytest.mark.pandas +def test_interval_array_from_dateoffset(): + from pandas.tseries.offsets import DateOffset + data = [ + None, + DateOffset(years=1, months=1, + days=1, seconds=1, microseconds=1, + minutes=1, hours=1, weeks=1, nanoseconds=1), + DateOffset()] + + arr = pa.array(data) + assert isinstance(arr, pa.MonthDayNanoIntervalArray) + assert arr.type == pa.month_day_nano_interval() + expected_list = [ + None, + pa.MonthDayNano([13, 8, 3661000001001]), + pa.MonthDayNano([0, 0, 0])] + expected = pa.array(expected_list) + assert arr.equals(expected) + expected_from_pandas = [ + None, DateOffset(months=13, days=8, + microseconds=( + datetime.timedelta(seconds=1, microseconds=1, + minutes=1, hours=1) // + datetime.timedelta(microseconds=1)), + nanoseconds=1), + DateOffset(months=0, days=0, microseconds=0, nanoseconds=0)] + + assert arr.to_pandas().tolist() == expected_from_pandas + + # nested list array conversion + actual_list = pa.array([data]).to_pandas().tolist() + assert len(actual_list) == 1 + assert list(actual_list[0]) == expected_from_pandas + + +@pytest.mark.numpy +@pytest.mark.parametrize('string_type', [ + None, + pa.utf8(), + pa.large_utf8(), + pa.string_view()]) +def test_array_from_numpy_unicode(string_type): + # Default when no type is specified should be utf8 + expected_type = string_type or pa.utf8() + + dtypes = ['U5'] + + for dtype in dtypes: + arr = np.array(['abcde', 'abc', ''], dtype=dtype) + + arrow_arr = pa.array(arr, string_type) + assert arrow_arr.type == expected_type + expected = pa.array(['abcde', 'abc', ''], type=expected_type) + assert arrow_arr.equals(expected) + + mask = np.array([False, True, False]) + arrow_arr = pa.array(arr, string_type, mask=mask) + expected = pa.array(['abcde', None, ''], type=expected_type) + assert arrow_arr.equals(expected) + + # Strided variant + arr = np.array(['abcde', 'abc', ''] * 5, dtype=dtype)[::2] + mask = np.array([False, True, False] * 5)[::2] + arrow_arr = pa.array(arr, string_type, mask=mask) + + expected = pa.array(['abcde', '', None, 'abcde', '', None, + 'abcde', ''], type=expected_type) + assert arrow_arr.equals(expected) + + # 0 itemsize + arr = np.array(['', '', ''], dtype='= object.__sizeof__(a) + a.nbytes + a = pa.array([1, None, 3], type='int64') + assert a.nbytes == 8*3 + 1 + assert a.get_total_buffer_size() == 8*3 + 1 + assert sys.getsizeof(a) >= object.__sizeof__(a) + a.nbytes + a = pa.array([[1, 2], None, [3, None, 4, 5]], type=pa.list_(pa.int64())) + assert a.nbytes == 62 + assert a.get_total_buffer_size() == 1 + 4 * 4 + 1 + 6 * 8 + assert sys.getsizeof(a) >= object.__sizeof__(a) + a.nbytes + a = pa.array([[[5, 6, 7]], [[9, 10]]], type=pa.list_(pa.list_(pa.int8()))) + assert a.get_total_buffer_size() == (4 * 3) + (4 * 3) + (1 * 5) + assert a.nbytes == 21 + a = pa.array([[[1, 2], [3, 4]], [[5, 6, 7], None, [8]], [[9, 10]]], + type=pa.list_(pa.list_(pa.int8()))) + a1 = a.slice(1, 2) + assert a1.nbytes == (4 * 2) + 1 + (4 * 4) + (1 * 6) + assert a1.get_total_buffer_size() == (4 * 4) + 1 + (4 * 7) + (1 * 10) + + +def test_nbytes_size(): + a = pa.chunked_array([pa.array([1, None, 3], type=pa.int16()), + pa.array([4, 5, 6], type=pa.int16())]) + assert a.nbytes == 13 + + +def test_invalid_tensor_constructor_repr(): + # ARROW-2638: prevent calling extension class constructors directly + with pytest.raises(TypeError): + repr(pa.Tensor([1])) + + +def test_invalid_tensor_construction(): + with pytest.raises(TypeError): + pa.Tensor() + + +@pytest.mark.parametrize(('offset_type', 'list_type_factory'), + [(pa.int32(), pa.list_), (pa.int64(), pa.large_list)]) +def test_list_array_flatten(offset_type, list_type_factory): + typ2 = list_type_factory( + list_type_factory( + pa.int64() + ) + ) + arr2 = pa.array([ + None, + [ + [1, None, 2], + None, + [3, 4] + ], + [], + [ + [], + [5, 6], + None + ], + [ + [7, 8] + ] + ], type=typ2) + offsets2 = pa.array([0, 0, 3, 3, 6, 7], type=offset_type) + + typ1 = list_type_factory(pa.int64()) + arr1 = pa.array([ + [1, None, 2], + None, + [3, 4], + [], + [5, 6], + None, + [7, 8] + ], type=typ1) + offsets1 = pa.array([0, 3, 3, 5, 5, 7, 7, 9], type=offset_type) + + arr0 = pa.array([ + 1, None, 2, + 3, 4, + 5, 6, + 7, 8 + ], type=pa.int64()) + + assert arr2.flatten().equals(arr1) + assert arr2.offsets.equals(offsets2) + assert arr2.values.equals(arr1) + assert arr1.flatten().equals(arr0) + assert arr1.offsets.equals(offsets1) + assert arr1.values.equals(arr0) + assert arr2.flatten().flatten().equals(arr0) + assert arr2.values.values.equals(arr0) + assert arr2.flatten(True).equals(arr0) + + +@pytest.mark.parametrize('list_type', [ + pa.list_(pa.int32()), + pa.list_(pa.int32(), list_size=2), + pa.large_list(pa.int32())]) +def test_list_value_parent_indices(list_type): + arr = pa.array( + [ + [0, 1], + None, + [None, None], + [3, 4] + ], type=list_type) + expected = pa.array([0, 0, 2, 2, 3, 3], type=pa.int64()) + assert arr.value_parent_indices().equals(expected) + + +@pytest.mark.parametrize(('offset_type', 'list_type'), + [(pa.int32(), pa.list_(pa.int32())), + (pa.int32(), pa.list_(pa.int32(), list_size=2)), + (pa.int64(), pa.large_list(pa.int32())), + (pa.int32(), pa.list_view(pa.int32())), + (pa.int64(), pa.large_list_view(pa.int32()))]) +def test_list_value_lengths(offset_type, list_type): + + # FixedSizeListArray needs fixed list sizes + if getattr(list_type, "list_size", None): + arr = pa.array( + [ + [0, 1], + None, + [None, None], + [3, 4] + ], type=list_type) + expected = pa.array([2, None, 2, 2], type=offset_type) + + # Otherwise create variable list sizes + else: + arr = pa.array( + [ + [0, 1, 2], + None, + [], + [3, 4] + ], type=list_type) + expected = pa.array([3, None, 0, 2], type=offset_type) + assert arr.value_lengths().equals(expected) + + +@pytest.mark.parametrize('list_type_factory', [pa.list_, pa.large_list]) +def test_list_array_flatten_non_canonical(list_type_factory): + # Non-canonical list array (null elements backed by non-empty sublists) + typ = list_type_factory(pa.int64()) + arr = pa.array([[1], [2, 3], [4, 5, 6]], type=typ) + buffers = arr.buffers()[:2] + buffers[0] = pa.py_buffer(b"\x05") # validity bitmap + arr = arr.from_buffers(arr.type, len(arr), buffers, children=[arr.values]) + assert arr.to_pylist() == [[1], None, [4, 5, 6]] + assert arr.offsets.to_pylist() == [0, 1, 3, 6] + + flattened = arr.flatten() + flattened.validate(full=True) + assert flattened.type == typ.value_type + assert flattened.to_pylist() == [1, 4, 5, 6] + + # .values is the physical values array (including masked elements) + assert arr.values.to_pylist() == [1, 2, 3, 4, 5, 6] + + +@pytest.mark.parametrize('klass', [pa.ListArray, pa.LargeListArray]) +def test_list_array_values_offsets_sliced(klass): + # ARROW-7301 + arr = klass.from_arrays(offsets=[0, 3, 4, 6], values=[1, 2, 3, 4, 5, 6]) + assert arr.values.to_pylist() == [1, 2, 3, 4, 5, 6] + assert arr.offsets.to_pylist() == [0, 3, 4, 6] + + # sliced -> values keeps referring to full values buffer, but offsets is + # sliced as well so the offsets correctly point into the full values array + # sliced -> flatten() will return the sliced value array. + arr2 = arr[1:] + assert arr2.values.to_pylist() == [1, 2, 3, 4, 5, 6] + assert arr2.offsets.to_pylist() == [3, 4, 6] + assert arr2.flatten().to_pylist() == [4, 5, 6] + i = arr2.offsets[0].as_py() + j = arr2.offsets[1].as_py() + assert arr2[0].as_py() == arr2.values[i:j].to_pylist() == [4] + + +def test_fixed_size_list_array_flatten(): + typ2 = pa.list_(pa.list_(pa.int64(), 2), 3) + arr2 = pa.array([ + [ + [1, 2], + [3, 4], + [5, 6], + ], + None, + [ + [7, None], + None, + [8, 9] + ], + ], type=typ2) + assert arr2.type.equals(typ2) + + typ1 = pa.list_(pa.int64(), 2) + arr1 = pa.array([ + [1, 2], [3, 4], [5, 6], + [7, None], None, [8, 9] + ], type=typ1) + assert arr1.type.equals(typ1) + assert arr2.flatten().equals(arr1) + + typ0 = pa.int64() + arr0 = pa.array([ + 1, 2, 3, 4, 5, 6, 7, None, 8, 9, + ], type=typ0) + assert arr0.type.equals(typ0) + assert arr1.flatten().equals(arr0) + assert arr2.flatten().flatten().equals(arr0) + assert arr2.flatten().equals(arr1) + assert arr2.flatten(True).equals(arr0) + + +def test_fixed_size_list_array_flatten_with_slice(): + array = pa.array([[1], [2], [3]], + type=pa.list_(pa.float64(), list_size=1)) + assert array[2:].flatten() == pa.array([3], type=pa.float64()) + + +def test_map_array_values_offsets(): + ty = pa.map_(pa.utf8(), pa.int32()) + ty_values = pa.struct([pa.field("key", pa.utf8(), nullable=False), + pa.field("value", pa.int32())]) + a = pa.array([[('a', 1), ('b', 2)], [('c', 3)]], type=ty) + + assert a.values.type.equals(ty_values) + assert a.values == pa.array([ + {'key': 'a', 'value': 1}, + {'key': 'b', 'value': 2}, + {'key': 'c', 'value': 3}, + ], type=ty_values) + assert a.keys.equals(pa.array(['a', 'b', 'c'])) + assert a.items.equals(pa.array([1, 2, 3], type=pa.int32())) + + assert pa.ListArray.from_arrays(a.offsets, a.keys).equals( + pa.array([['a', 'b'], ['c']])) + assert pa.ListArray.from_arrays(a.offsets, a.items).equals( + pa.array([[1, 2], [3]], type=pa.list_(pa.int32()))) + + with pytest.raises(NotImplementedError): + a.flatten() + + +def test_struct_array_flatten(): + ty = pa.struct([pa.field('x', pa.int16()), + pa.field('y', pa.float32())]) + a = pa.array([(1, 2.5), (3, 4.5), (5, 6.5)], type=ty) + xs, ys = a.flatten() + assert xs.type == pa.int16() + assert ys.type == pa.float32() + assert xs.to_pylist() == [1, 3, 5] + assert ys.to_pylist() == [2.5, 4.5, 6.5] + xs, ys = a[1:].flatten() + assert xs.to_pylist() == [3, 5] + assert ys.to_pylist() == [4.5, 6.5] + + a = pa.array([(1, 2.5), None, (3, 4.5)], type=ty) + xs, ys = a.flatten() + assert xs.to_pylist() == [1, None, 3] + assert ys.to_pylist() == [2.5, None, 4.5] + xs, ys = a[1:].flatten() + assert xs.to_pylist() == [None, 3] + assert ys.to_pylist() == [None, 4.5] + + a = pa.array([(1, None), (2, 3.5), (None, 4.5)], type=ty) + xs, ys = a.flatten() + assert xs.to_pylist() == [1, 2, None] + assert ys.to_pylist() == [None, 3.5, 4.5] + xs, ys = a[1:].flatten() + assert xs.to_pylist() == [2, None] + assert ys.to_pylist() == [3.5, 4.5] + + a = pa.array([(1, None), None, (None, 2.5)], type=ty) + xs, ys = a.flatten() + assert xs.to_pylist() == [1, None, None] + assert ys.to_pylist() == [None, None, 2.5] + xs, ys = a[1:].flatten() + assert xs.to_pylist() == [None, None] + assert ys.to_pylist() == [None, 2.5] + + +def test_struct_array_field(): + ty = pa.struct([pa.field('x', pa.int16()), + pa.field('y', pa.float32())]) + a = pa.array([(1, 2.5), (3, 4.5), (5, 6.5)], type=ty) + + x0 = a.field(0) + y0 = a.field(1) + x1 = a.field(-2) + y1 = a.field(-1) + x2 = a.field('x') + y2 = a.field('y') + + assert isinstance(x0, pa.lib.Int16Array) + assert isinstance(y1, pa.lib.FloatArray) + assert x0.equals(pa.array([1, 3, 5], type=pa.int16())) + assert y0.equals(pa.array([2.5, 4.5, 6.5], type=pa.float32())) + assert x0.equals(x1) + assert x0.equals(x2) + assert y0.equals(y1) + assert y0.equals(y2) + + for invalid_index in [None, pa.int16()]: + with pytest.raises(TypeError): + a.field(invalid_index) + + for invalid_index in [3, -3]: + with pytest.raises(IndexError): + a.field(invalid_index) + + for invalid_name in ['z', '']: + with pytest.raises(KeyError): + a.field(invalid_name) + + +def test_struct_array_flattened_field(): + ty = pa.struct([pa.field('x', pa.int16()), + pa.field('y', pa.float32())]) + a = pa.array([(1, 2.5), (3, 4.5), (5, 6.5)], type=ty, + mask=pa.array([False, True, False])) + + x0 = a._flattened_field(0) + y0 = a._flattened_field(1) + x1 = a._flattened_field(-2) + y1 = a._flattened_field(-1) + x2 = a._flattened_field('x') + y2 = a._flattened_field('y') + + assert isinstance(x0, pa.lib.Int16Array) + assert isinstance(y1, pa.lib.FloatArray) + assert x0.equals(pa.array([1, None, 5], type=pa.int16())) + assert y0.equals(pa.array([2.5, None, 6.5], type=pa.float32())) + assert x0.equals(x1) + assert x0.equals(x2) + assert y0.equals(y1) + assert y0.equals(y2) + + for invalid_index in [None, pa.int16()]: + with pytest.raises(TypeError): + a._flattened_field(invalid_index) + + for invalid_index in [3, -3]: + with pytest.raises(IndexError): + a._flattened_field(invalid_index) + + for invalid_name in ['z', '']: + with pytest.raises(KeyError): + a._flattened_field(invalid_name) + + +def test_empty_cast(): + types = [ + pa.null(), + pa.bool_(), + pa.int8(), + pa.int16(), + pa.int32(), + pa.int64(), + pa.uint8(), + pa.uint16(), + pa.uint32(), + pa.uint64(), + pa.float16(), + pa.float32(), + pa.float64(), + pa.date32(), + pa.date64(), + pa.binary(), + pa.binary(length=4), + pa.string(), + ] + + for (t1, t2) in itertools.product(types, types): + try: + # ARROW-4766: Ensure that supported types conversion don't segfault + # on empty arrays of common types + pa.array([], type=t1).cast(t2) + except (pa.lib.ArrowNotImplementedError, pa.ArrowInvalid): + continue + + +def test_nested_dictionary_array(): + dict_arr = pa.DictionaryArray.from_arrays([0, 1, 0], ['a', 'b']) + list_arr = pa.ListArray.from_arrays([0, 2, 3], dict_arr) + assert list_arr.to_pylist() == [['a', 'b'], ['a']] + + dict_arr = pa.DictionaryArray.from_arrays([0, 1, 0], ['a', 'b']) + dict_arr2 = pa.DictionaryArray.from_arrays([0, 1, 2, 1, 0], dict_arr) + assert dict_arr2.to_pylist() == ['a', 'b', 'a', 'b', 'a'] + + +@pytest.mark.numpy +def test_array_from_numpy_str_utf8(): + # ARROW-3890 -- in Python 3, NPY_UNICODE arrays are produced, but in Python + # 2 they are NPY_STRING (binary), so we must do UTF-8 validation + vec = np.array(["toto", "tata"]) + vec2 = np.array(["toto", "tata"], dtype=object) + + arr = pa.array(vec, pa.string()) + arr2 = pa.array(vec2, pa.string()) + expected = pa.array(["toto", "tata"]) + assert arr.equals(expected) + assert arr2.equals(expected) + + # with mask, separate code path + mask = np.array([False, False], dtype=bool) + arr = pa.array(vec, pa.string(), mask=mask) + assert arr.equals(expected) + + # UTF8 validation failures + vec = np.array([('mañana').encode('utf-16-le')]) + with pytest.raises(ValueError): + pa.array(vec, pa.string()) + + with pytest.raises(ValueError): + pa.array(vec, pa.string(), mask=np.array([False])) + + +@pytest.mark.numpy +@pytest.mark.slow +@pytest.mark.large_memory +@pytest.mark.parametrize('large_types', [False, True]) +def test_numpy_binary_overflow_to_chunked(large_types): + # ARROW-3762, ARROW-5966, GH-35289 + + # 2^31 + 1 bytes + values = [b'x'] + unicode_values = ['x'] + + # Make 10 unique 1MB strings then repeat then 2048 times + unique_strings = { + i: b'x' * ((1 << 20) - 1) + str(i % 10).encode('utf8') + for i in range(10) + } + unicode_unique_strings = {i: x.decode('utf8') + for i, x in unique_strings.items()} + values += [unique_strings[i % 10] for i in range(1 << 11)] + unicode_values += [unicode_unique_strings[i % 10] + for i in range(1 << 11)] + + binary_type = pa.large_binary() if large_types else pa.binary() + string_type = pa.large_utf8() if large_types else pa.utf8() + for case, ex_type in [(values, binary_type), + (unicode_values, string_type)]: + arr = np.array(case) + arrow_arr = pa.array(arr, ex_type) + arr = None + + assert arrow_arr.type == ex_type + if large_types: + # Large types shouldn't be chunked + assert isinstance(arrow_arr, pa.Array) + + for i in range(len(arrow_arr)): + val = arrow_arr[i] + assert val.as_py() == case[i] + else: + assert isinstance(arrow_arr, pa.ChunkedArray) + + # Split up into 16MB chunks. 128 * 16 = 2048, so 129 + assert arrow_arr.num_chunks == 129 + + value_index = 0 + for i in range(arrow_arr.num_chunks): + chunk = arrow_arr.chunk(i) + for val in chunk: + assert val.as_py() == case[value_index] + value_index += 1 + + +@pytest.mark.large_memory +def test_list_child_overflow_to_chunked(): + kilobyte_string = 'x' * 1024 + two_mega = 2**21 + + vals = [[kilobyte_string]] * (two_mega - 1) + arr = pa.array(vals) + assert isinstance(arr, pa.Array) + assert len(arr) == two_mega - 1 + + vals = [[kilobyte_string]] * two_mega + arr = pa.array(vals) + assert isinstance(arr, pa.ChunkedArray) + assert len(arr) == two_mega + assert len(arr.chunk(0)) == two_mega - 1 + assert len(arr.chunk(1)) == 1 + + +@pytest.mark.numpy +def test_infer_type_masked(): + # ARROW-5208 + ty = pa.infer_type(['foo', 'bar', None, 2], + mask=[False, False, False, True]) + assert ty == pa.utf8() + + # all masked + ty = pa.infer_type(['foo', 'bar', None, 2], + mask=np.array([True, True, True, True])) + assert ty == pa.null() + + # length 0 + assert pa.infer_type([], mask=[]) == pa.null() + + +@pytest.mark.numpy +def test_array_masked(): + # ARROW-5208 + arr = pa.array([4, None, 4, 3.], + mask=np.array([False, True, False, True])) + assert arr.type == pa.int64() + + # ndarray dtype=object argument + arr = pa.array(np.array([4, None, 4, 3.], dtype="O"), + mask=np.array([False, True, False, True])) + assert arr.type == pa.int64() + + +@pytest.mark.numpy +def test_array_supported_masks(): + # ARROW-13883 + arr = pa.array([4, None, 4, 3.], + mask=np.array([False, True, False, True])) + assert arr.to_pylist() == [4, None, 4, None] + + arr = pa.array([4, None, 4, 3], + mask=pa.array([False, True, False, True])) + assert arr.to_pylist() == [4, None, 4, None] + + arr = pa.array([4, None, 4, 3], + mask=[False, True, False, True]) + assert arr.to_pylist() == [4, None, 4, None] + + arr = pa.array([4, 3, None, 3], + mask=[False, True, False, True]) + assert arr.to_pylist() == [4, None, None, None] + + # Non boolean values + with pytest.raises(pa.ArrowTypeError): + arr = pa.array([4, None, 4, 3], + mask=pa.array([1.0, 2.0, 3.0, 4.0])) + + with pytest.raises(pa.ArrowTypeError): + arr = pa.array([4, None, 4, 3], + mask=[1.0, 2.0, 3.0, 4.0]) + + with pytest.raises(pa.ArrowTypeError): + arr = pa.array([4, None, 4, 3], + mask=np.array([1.0, 2.0, 3.0, 4.0])) + + with pytest.raises(pa.ArrowTypeError): + arr = pa.array([4, None, 4, 3], + mask=pa.array([False, True, False, True], + mask=pa.array([True, True, True, True]))) + + with pytest.raises(pa.ArrowTypeError): + arr = pa.array([4, None, 4, 3], + mask=pa.array([False, None, False, True])) + + # Numpy arrays only accepts numpy masks + with pytest.raises(TypeError): + arr = pa.array(np.array([4, None, 4, 3.]), + mask=[True, False, True, False]) + + with pytest.raises(TypeError): + arr = pa.array(np.array([4, None, 4, 3.]), + mask=pa.array([True, False, True, False])) + + +@pytest.mark.pandas +def test_array_supported_pandas_masks(): + import pandas + arr = pa.array(pandas.Series([0, 1], name="a", dtype="int64"), + mask=pandas.Series([True, False], dtype='bool')) + assert arr.to_pylist() == [None, 1] + + +@pytest.mark.numpy +def test_binary_array_masked(): + # ARROW-12431 + masked_basic = pa.array([b'\x05'], type=pa.binary(1), + mask=np.array([False])) + assert [b'\x05'] == masked_basic.to_pylist() + + # Fixed Length Binary + masked = pa.array(np.array([b'\x05']), type=pa.binary(1), + mask=np.array([False])) + assert [b'\x05'] == masked.to_pylist() + + masked_nulls = pa.array(np.array([b'\x05']), type=pa.binary(1), + mask=np.array([True])) + assert [None] == masked_nulls.to_pylist() + + # Variable Length Binary + masked = pa.array(np.array([b'\x05']), type=pa.binary(), + mask=np.array([False])) + assert [b'\x05'] == masked.to_pylist() + + masked_nulls = pa.array(np.array([b'\x05']), type=pa.binary(), + mask=np.array([True])) + assert [None] == masked_nulls.to_pylist() + + # Fixed Length Binary, copy + npa = np.array([b'aaa', b'bbb', b'ccc']*10) + arrow_array = pa.array(npa, type=pa.binary(3), + mask=np.array([False, False, False]*10)) + npa[npa == b"bbb"] = b"XXX" + assert ([b'aaa', b'bbb', b'ccc']*10) == arrow_array.to_pylist() + + +@pytest.mark.numpy +def test_binary_array_strided(): + # Masked + nparray = np.array([b"ab", b"cd", b"ef"]) + arrow_array = pa.array(nparray[::2], pa.binary(2), + mask=np.array([False, False])) + assert [b"ab", b"ef"] == arrow_array.to_pylist() + + # Unmasked + nparray = np.array([b"ab", b"cd", b"ef"]) + arrow_array = pa.array(nparray[::2], pa.binary(2)) + assert [b"ab", b"ef"] == arrow_array.to_pylist() + + +@pytest.mark.numpy +def test_array_invalid_mask_raises(): + # ARROW-10742 + cases = [ + ([1, 2], np.array([False, False], dtype="O"), + TypeError, "must be boolean dtype"), + + ([1, 2], np.array([[False], [False]]), + pa.ArrowInvalid, "must be 1D array"), + + ([1, 2, 3], np.array([False, False]), + pa.ArrowInvalid, "different length"), + + (np.array([1, 2]), np.array([False, False], dtype="O"), + TypeError, "must be boolean dtype"), + + (np.array([1, 2]), np.array([[False], [False]]), + ValueError, "must be 1D array"), + + (np.array([1, 2, 3]), np.array([False, False]), + ValueError, "different length"), + ] + for obj, mask, ex, msg in cases: + with pytest.raises(ex, match=msg): + pa.array(obj, mask=mask) + + +def test_array_from_large_pyints(): + # ARROW-5430 + with pytest.raises(OverflowError): + # too large for int64 so dtype must be explicitly provided + pa.array([int(2 ** 63)]) + + +@pytest.mark.numpy +def test_numpy_array_protocol(): + # test the __array__ method on pyarrow.Array + arr = pa.array([1, 2, 3]) + result = np.asarray(arr) + expected = np.array([1, 2, 3], dtype="int64") + np.testing.assert_array_equal(result, expected) + + # this should not raise a deprecation warning with numpy 2.0+ + result = np.array(arr, copy=False) + np.testing.assert_array_equal(result, expected) + + result = np.array(arr, dtype="int64", copy=False) + np.testing.assert_array_equal(result, expected) + + # no zero-copy is possible + arr = pa.array([1, 2, None]) + expected = np.array([1, 2, np.nan], dtype="float64") + result = np.asarray(arr) + np.testing.assert_array_equal(result, expected) + + if Version(np.__version__) < Version("2.0.0.dev0"): + # copy keyword is not strict and not passed down to __array__ + result = np.array(arr, copy=False) + np.testing.assert_array_equal(result, expected) + + result = np.array(arr, dtype="float64", copy=False) + np.testing.assert_array_equal(result, expected) + else: + # starting with numpy 2.0, the copy=False keyword is assumed to be strict + with pytest.raises(ValueError, match="Unable to avoid a copy"): + np.array(arr, copy=False) + + arr = pa.array([1, 2, 3]) + with pytest.raises(ValueError): + np.array(arr, dtype="float64", copy=False) + + # copy=True -> not yet passed by numpy, so we have to call this directly to test + arr = pa.array([1, 2, 3]) + result = arr.__array__(copy=True) + assert result.flags.writeable + + arr = pa.array([1, 2, 3]) + result = arr.__array__(dtype=np.dtype("float64"), copy=True) + assert result.dtype == "float64" + + +@pytest.mark.numpy +def test_array_protocol(): + + class MyArray: + def __init__(self, data): + self.data = data + + def __arrow_array__(self, type=None): + return pa.array(self.data, type=type) + + arr = MyArray(np.array([1, 2, 3], dtype='int64')) + result = pa.array(arr) + expected = pa.array([1, 2, 3], type=pa.int64()) + assert result.equals(expected) + result = pa.array(arr, type=pa.int64()) + expected = pa.array([1, 2, 3], type=pa.int64()) + assert result.equals(expected) + result = pa.array(arr, type=pa.float64()) + expected = pa.array([1, 2, 3], type=pa.float64()) + assert result.equals(expected) + + # raise error when passing size or mask keywords + with pytest.raises(ValueError): + pa.array(arr, mask=np.array([True, False, True])) + with pytest.raises(ValueError): + pa.array(arr, size=3) + + # ensure the return value is an Array + class MyArrayInvalid: + def __init__(self, data): + self.data = data + + def __arrow_array__(self, type=None): + return np.array(self.data) + + arr = MyArrayInvalid(np.array([1, 2, 3], dtype='int64')) + with pytest.raises(TypeError): + pa.array(arr) + + # ARROW-7066 - allow ChunkedArray output + # GH-33727 - if num_chunks=1 return Array + class MyArray2: + def __init__(self, data): + self.data = data + + def __arrow_array__(self, type=None): + return pa.chunked_array([self.data], type=type) + + arr = MyArray2(np.array([1, 2, 3], dtype='int64')) + result = pa.array(arr) + expected = pa.array([1, 2, 3], type=pa.int64()) + assert result.equals(expected) + + class MyArray3: + def __init__(self, data1, data2): + self.data1 = data1 + self.data2 = data2 + + def __arrow_array__(self, type=None): + return pa.chunked_array([self.data1, self.data2], type=type) + + np_arr = np.array([1, 2, 3], dtype='int64') + arr = MyArray3(np_arr, np_arr) + result = pa.array(arr) + expected = pa.chunked_array([[1, 2, 3], [1, 2, 3]], type=pa.int64()) + assert result.equals(expected) + + +class ArrayWrapper: + def __init__(self, data): + self.data = data + + def __arrow_c_array__(self, requested_schema=None): + return self.data.__arrow_c_array__(requested_schema) + + +class ArrayDeviceWrapper: + def __init__(self, data): + self.data = data + + def __arrow_c_device_array__(self, requested_schema=None, **kwargs): + return self.data.__arrow_c_device_array__(requested_schema, **kwargs) + + +@pytest.mark.parametrize("wrapper_class", [ArrayWrapper, ArrayDeviceWrapper]) +def test_c_array_protocol(wrapper_class): + + # Can roundtrip through the C array protocol + arr = wrapper_class(pa.array([1, 2, 3], type=pa.int64())) + result = pa.array(arr) + assert result == arr.data + + # Will cast to requested type + result = pa.array(arr, type=pa.int32()) + assert result == pa.array([1, 2, 3], type=pa.int32()) + + +def test_c_array_protocol_device_unsupported_keyword(): + # For the device-aware version, we raise a specific error for unsupported keywords + arr = pa.array([1, 2, 3], type=pa.int64()) + + with pytest.raises( + NotImplementedError, + match=r"Received unsupported keyword argument\(s\): \['other'\]" + ): + arr.__arrow_c_device_array__(other="not-none") + + # but with None value it is ignored + _ = arr.__arrow_c_device_array__(other=None) + + +def test_concat_array(): + concatenated = pa.concat_arrays( + [pa.array([1, 2]), pa.array([3, 4])]) + assert concatenated.equals(pa.array([1, 2, 3, 4])) + + +def test_concat_array_different_types(): + with pytest.raises(pa.ArrowInvalid): + pa.concat_arrays([pa.array([1]), pa.array([2.])]) + + +def test_concat_array_invalid_type(): + # ARROW-9920 - do not segfault on non-array input + + with pytest.raises(TypeError, match="should contain Array objects"): + pa.concat_arrays([None]) + + arr = pa.chunked_array([[0, 1], [3, 4]]) + with pytest.raises(TypeError, match="should contain Array objects"): + pa.concat_arrays(arr) + + +@pytest.mark.pandas +def test_to_pandas_timezone(): + # https://issues.apache.org/jira/browse/ARROW-6652 + arr = pa.array([1, 2, 3], type=pa.timestamp('s', tz='Europe/Brussels')) + s = arr.to_pandas() + assert s.dt.tz is not None + arr = pa.chunked_array([arr]) + s = arr.to_pandas() + assert s.dt.tz is not None + + +@pytest.mark.pandas +def test_to_pandas_float16_list(): + # https://github.com/apache/arrow/issues/36168 + expected = [[np.float16(1)], [np.float16(2)], [np.float16(3)]] + arr = pa.array(expected) + result = arr.to_pandas() + assert result[0].dtype == "float16" + assert result.tolist() == expected + + +def test_array_sort(): + arr = pa.array([5, 7, 35], type=pa.int64()) + sorted_arr = arr.sort("descending") + assert sorted_arr.to_pylist() == [35, 7, 5] + + arr = pa.chunked_array([[1, 2, 3], [4, 5, 6]]) + sorted_arr = arr.sort("descending") + assert sorted_arr.to_pylist() == [6, 5, 4, 3, 2, 1] + + arr = pa.array([5, 7, 35, None], type=pa.int64()) + sorted_arr = arr.sort("descending", null_placement="at_end") + assert sorted_arr.to_pylist() == [35, 7, 5, None] + sorted_arr = arr.sort("descending", null_placement="at_start") + assert sorted_arr.to_pylist() == [None, 35, 7, 5] + + +def test_struct_array_sort(): + arr = pa.StructArray.from_arrays([ + pa.array([5, 7, 7, 35], type=pa.int64()), + pa.array(["foo", "car", "bar", "foobar"]) + ], names=["a", "b"]) + + sorted_arr = arr.sort("descending", by="a") + assert sorted_arr.to_pylist() == [ + {"a": 35, "b": "foobar"}, + {"a": 7, "b": "car"}, + {"a": 7, "b": "bar"}, + {"a": 5, "b": "foo"}, + ] + + sorted_arr = arr.sort() + assert sorted_arr.to_pylist() == [ + {"a": 5, "b": "foo"}, + {"a": 7, "b": "bar"}, + {"a": 7, "b": "car"}, + {"a": 35, "b": "foobar"}, + ] + + arr_with_nulls = pa.StructArray.from_arrays([ + pa.array([5, 7, 7, 35], type=pa.int64()), + pa.array(["foo", "car", "bar", "foobar"]) + ], names=["a", "b"], mask=pa.array([False, False, True, False])) + + sorted_arr = arr_with_nulls.sort( + "descending", by="a", null_placement="at_start") + assert sorted_arr.to_pylist() == [ + None, + {"a": 35, "b": "foobar"}, + {"a": 7, "b": "car"}, + {"a": 5, "b": "foo"}, + ] + + sorted_arr = arr_with_nulls.sort( + "descending", by="a", null_placement="at_end") + assert sorted_arr.to_pylist() == [ + {"a": 35, "b": "foobar"}, + {"a": 7, "b": "car"}, + {"a": 5, "b": "foo"}, + None + ] + + +def test_array_accepts_pyarrow_array(): + arr = pa.array([1, 2, 3]) + result = pa.array(arr) + assert arr == result + + # Test casting to a different type + result = pa.array(arr, type=pa.uint8()) + expected = pa.array([1, 2, 3], type=pa.uint8()) + assert expected == result + assert expected.type == pa.uint8() + + # Test casting with safe keyword + arr = pa.array([2 ** 63 - 1], type=pa.int64()) + + with pytest.raises(pa.ArrowInvalid): + pa.array(arr, type=pa.int32()) + + expected = pa.array([-1], type=pa.int32()) + result = pa.array(arr, type=pa.int32(), safe=False) + assert result == expected + + # Test memory_pool keyword is accepted + result = pa.array(arr, memory_pool=pa.default_memory_pool()) + assert arr == result + + +def check_run_end_encoded(ree_array, run_ends, values, logical_length, physical_length, + physical_offset): + assert ree_array.run_ends.to_pylist() == run_ends + assert ree_array.values.to_pylist() == values + assert len(ree_array) == logical_length + assert ree_array.find_physical_length() == physical_length + assert ree_array.find_physical_offset() == physical_offset + + +def check_run_end_encoded_from_arrays_with_type(ree_type=None): + run_ends = [3, 5, 10, 19] + values = [1, 2, 1, 3] + ree_array = pa.RunEndEncodedArray.from_arrays(run_ends, values, ree_type) + check_run_end_encoded(ree_array, run_ends, values, 19, 4, 0) + + +def check_run_end_encoded_from_typed_arrays(ree_type): + run_ends = [3, 5, 10, 19] + values = [1, 2, 1, 3] + typed_run_ends = pa.array(run_ends, ree_type.run_end_type) + typed_values = pa.array(values, ree_type.value_type) + ree_array = pa.RunEndEncodedArray.from_arrays(typed_run_ends, typed_values) + assert ree_array.type == ree_type + check_run_end_encoded(ree_array, run_ends, values, 19, 4, 0) + + +def test_run_end_encoded_from_arrays(): + check_run_end_encoded_from_arrays_with_type() + for run_end_type in [pa.int16(), pa.int32(), pa.int64()]: + for value_type in [pa.uint32(), pa.int32(), pa.uint64(), pa.int64()]: + ree_type = pa.run_end_encoded(run_end_type, value_type) + check_run_end_encoded_from_arrays_with_type(ree_type) + check_run_end_encoded_from_typed_arrays(ree_type) + + +def test_run_end_encoded_from_buffers(): + run_ends = [3, 5, 10, 19] + values = [1, 2, 1, 3] + + ree_type = pa.run_end_encoded(run_end_type=pa.int32(), value_type=pa.uint8()) + length = 19 + buffers = [None] + null_count = 0 + offset = 0 + children = [run_ends, values] + + ree_array = pa.RunEndEncodedArray.from_buffers(ree_type, length, buffers, + null_count, offset, + children) + check_run_end_encoded(ree_array, run_ends, values, 19, 4, 0) + # buffers = [] + ree_array = pa.RunEndEncodedArray.from_buffers(ree_type, length, [], + null_count, offset, + children) + check_run_end_encoded(ree_array, run_ends, values, 19, 4, 0) + # null_count = -1 + ree_array = pa.RunEndEncodedArray.from_buffers(ree_type, length, buffers, + -1, offset, + children) + check_run_end_encoded(ree_array, run_ends, values, 19, 4, 0) + # offset = 4 + ree_array = pa.RunEndEncodedArray.from_buffers(ree_type, length - 4, buffers, + null_count, 4, children) + check_run_end_encoded(ree_array, run_ends, values, length - 4, 3, 1) + # buffers = [None, None] + with pytest.raises(ValueError): + pa.RunEndEncodedArray.from_buffers(ree_type, length, [None, None], + null_count, offset, children) + # children = None + with pytest.raises(ValueError): + pa.RunEndEncodedArray.from_buffers(ree_type, length, buffers, + null_count, offset, None) + # len(children) == 1 + with pytest.raises(ValueError): + pa.RunEndEncodedArray.from_buffers(ree_type, length, buffers, + null_count, offset, [run_ends]) + # null_count = 1 + with pytest.raises(ValueError): + pa.RunEndEncodedArray.from_buffers(ree_type, length, buffers, + 1, offset, children) + + +@pytest.mark.numpy +def test_run_end_encoded_from_array_with_type(): + run_ends = [1, 3, 6] + values = [1, 2, 3] + ree_type = pa.run_end_encoded(pa.int32(), pa.int64()) + expected = pa.RunEndEncodedArray.from_arrays(run_ends, values, + ree_type) + + arr = [1, 2, 2, 3, 3, 3] + result = pa.array(arr, type=ree_type) + assert result.equals(expected) + result = pa.array(np.array(arr), type=ree_type) + assert result.equals(expected) + + ree_type_2 = pa.run_end_encoded(pa.int16(), pa.float32()) + result = pa.array(arr, type=ree_type_2) + assert not result.equals(expected) + expected_2 = pa.RunEndEncodedArray.from_arrays(run_ends, values, + ree_type_2) + assert result.equals(expected_2) + + run_ends = [1, 3, 5, 6] + values = [1, 2, 3, None] + expected = pa.RunEndEncodedArray.from_arrays(run_ends, values, + ree_type) + + arr = [1, 2, 2, 3, 3, None] + result = pa.array(arr, type=ree_type) + assert result.equals(expected) + + run_ends = [1, 3, 4, 5, 6] + values = [1, 2, None, 3, None] + expected = pa.RunEndEncodedArray.from_arrays(run_ends, values, + ree_type) + + mask = pa.array([False, False, False, True, False, True]) + result = pa.array(arr, type=ree_type, mask=mask) + assert result.equals(expected) + + +@pytest.mark.numpy +def test_run_end_encoded_to_numpy(): + arr = [1, 2, 2, 3, 3, 3] + ree_array = pa.array(arr, pa.run_end_encoded(pa.int32(), pa.int64())) + expected = np.array(arr) + + np.testing.assert_array_equal(ree_array.to_numpy(zero_copy_only=False), expected) + + with pytest.raises(pa.ArrowInvalid): + ree_array.to_numpy() + + +@pytest.mark.pandas +def test_run_end_encoded_to_pandas(): + arr = [1, 2, 2, 3, 3, 3] + ree_array = pa.array(arr, pa.run_end_encoded(pa.int32(), pa.int64())) + + assert ree_array.to_pandas().tolist() == arr + + with pytest.raises(pa.ArrowInvalid): + ree_array.to_pandas(zero_copy_only=True) + + +@pytest.mark.parametrize(('list_array_type', 'list_type_factory'), + [(pa.ListViewArray, pa.list_view), + (pa.LargeListViewArray, pa.large_list_view)]) +def test_list_view_from_arrays(list_array_type, list_type_factory): + # test in order offsets, similar to ListArray representation + values = [1, 2, 3, 4, 5, 6, None, 7] + offsets = [0, 2, 4, 6] + sizes = [2, 2, 2, 2] + array = list_array_type.from_arrays(offsets, sizes, values) + + assert array.to_pylist() == [[1, 2], [3, 4], [5, 6], [None, 7]] + assert array.values.to_pylist() == values + assert array.offsets.to_pylist() == offsets + assert array.sizes.to_pylist() == sizes + + # with specified type + typ = list_type_factory(pa.field("name", pa.int64())) + result = list_array_type.from_arrays(offsets, sizes, values, typ) + assert result.type == typ + assert result.type.value_field.name == "name" + + # with mismatching type + typ = list_type_factory(pa.binary()) + with pytest.raises(TypeError): + list_array_type.from_arrays(offsets, sizes, values, type=typ) + + # test out of order offsets with overlapping values + values = [1, 2, 3, 4] + offsets = [2, 1, 0] + sizes = [2, 2, 2] + array = list_array_type.from_arrays(offsets, sizes, values) + + assert array.to_pylist() == [[3, 4], [2, 3], [1, 2]] + assert array.values.to_pylist() == values + assert array.offsets.to_pylist() == offsets + assert array.sizes.to_pylist() == sizes + + # test null offsets and empty list values + values = [] + offsets = [0, None] + sizes = [0, 0] + array = list_array_type.from_arrays(offsets, sizes, values) + + assert array.to_pylist() == [[], None] + assert array.values.to_pylist() == values + assert array.offsets.to_pylist() == [0, 0] + assert array.sizes.to_pylist() == sizes + + # test null sizes and empty list values + values = [] + offsets = [0, 0] + sizes = [None, 0] + array = list_array_type.from_arrays(offsets, sizes, values) + + assert array.to_pylist() == [None, []] + assert array.values.to_pylist() == values + assert array.offsets.to_pylist() == offsets + assert array.sizes.to_pylist() == [0, 0] + + # test null bitmask + values = [1, 2] + offsets = [0, 0, 1] + sizes = [1, 0, 1] + mask = pa.array([False, True, False]) + array = list_array_type.from_arrays(offsets, sizes, values, mask=mask) + + assert array.to_pylist() == [[1], None, [2]] + assert array.values.to_pylist() == values + assert array.offsets.to_pylist() == offsets + assert array.sizes.to_pylist() == sizes + + +@pytest.mark.parametrize(('list_array_type', 'list_type_factory'), + [(pa.ListViewArray, pa.list_view), + (pa.LargeListViewArray, pa.large_list_view)]) +def test_list_view_from_arrays_fails(list_array_type, list_type_factory): + values = [1, 2] + offsets = [0, 1, None] + sizes = [1, 1, 0] + mask = pa.array([False, False, True]) + + # Ambiguous to specify both validity map and offsets or sizes with nulls + with pytest.raises(pa.lib.ArrowInvalid): + list_array_type.from_arrays(offsets, sizes, values, mask=mask) + + offsets = [0, 1, 1] + array = list_array_type.from_arrays(offsets, sizes, values, mask=mask) + array_slice = array[1:] + + # List offsets and sizes must not be slices if a validity map is specified + with pytest.raises(pa.lib.ArrowInvalid): + list_array_type.from_arrays( + array_slice.offsets, array_slice.sizes, + array_slice.values, mask=array_slice.is_null()) + + +@pytest.mark.parametrize(('list_array_type', 'list_type_factory', 'offset_type'), + [(pa.ListViewArray, pa.list_view, pa.int32()), + (pa.LargeListViewArray, pa.large_list_view, pa.int64())]) +def test_list_view_flatten(list_array_type, list_type_factory, offset_type): + arr0 = pa.array([ + 1, None, 2, + 3, 4, + 5, 6, + 7, 8 + ], type=pa.int64()) + + typ1 = list_type_factory(pa.int64()) + arr1 = pa.array([ + [1, None, 2], + None, + [3, 4], + [], + [5, 6], + None, + [7, 8] + ], type=typ1) + offsets1 = pa.array([0, 3, 3, 5, 5, 7, 7], type=offset_type) + sizes1 = pa.array([3, 0, 2, 0, 2, 0, 2], type=offset_type) + + typ2 = list_type_factory( + list_type_factory( + pa.int64() + ) + ) + arr2 = pa.array([ + None, + [ + [1, None, 2], + None, + [3, 4] + ], + [], + [ + [], + [5, 6], + None + ], + [ + [7, 8] + ] + ], type=typ2) + offsets2 = pa.array([0, 0, 3, 3, 6], type=offset_type) + sizes2 = pa.array([0, 3, 0, 3, 1], type=offset_type) + + assert arr1.flatten().equals(arr0) + assert arr1.offsets.equals(offsets1) + assert arr1.sizes.equals(sizes1) + assert arr1.values.equals(arr0) + assert arr2.flatten().equals(arr1) + assert arr2.offsets.equals(offsets2) + assert arr2.sizes.equals(sizes2) + assert arr2.values.equals(arr1) + assert arr2.flatten().flatten().equals(arr0) + assert arr2.values.values.equals(arr0) + assert arr2.flatten(True).equals(arr0) + + # test out of order offsets + values = [1, 2, 3, 4] + offsets = [3, 2, 1, 0] + sizes = [1, 1, 1, 1] + array = list_array_type.from_arrays(offsets, sizes, values) + + assert array.flatten().to_pylist() == [4, 3, 2, 1] + + # test null elements backed by non-empty sublists + mask = pa.array([False, False, False, True]) + array = list_array_type.from_arrays(offsets, sizes, values, mask=mask) + + assert array.flatten().to_pylist() == [4, 3, 2] + assert array.values.to_pylist() == [1, 2, 3, 4] + + +@pytest.mark.parametrize('list_view_type', [pa.ListViewArray, pa.LargeListViewArray]) +def test_list_view_slice(list_view_type): + # sliced -> values keeps referring to full values buffer, but offsets is + # sliced as well so the offsets correctly point into the full values array + # sliced -> flatten() will return the sliced value array. + + array = list_view_type.from_arrays(offsets=[0, 3, 4], sizes=[ + 3, 1, 2], values=[1, 2, 3, 4, 5, 6]) + sliced_array = array[1:] + + assert sliced_array.values.to_pylist() == [1, 2, 3, 4, 5, 6] + assert sliced_array.offsets.to_pylist() == [3, 4] + assert sliced_array.flatten().to_pylist() == [4, 5, 6] + + i = sliced_array.offsets[0].as_py() + j = sliced_array.offsets[1].as_py() + + assert sliced_array[0].as_py() == sliced_array.values[i:j].to_pylist() == [4] + + +@pytest.mark.numpy +@pytest.mark.parametrize('numpy_native_dtype', ['u2', 'i4', 'f8']) +def test_swapped_byte_order_fails(numpy_native_dtype): + # ARROW-39129 + + numpy_swapped_dtype = np.dtype(numpy_native_dtype).newbyteorder() + np_arr = np.arange(10, dtype=numpy_swapped_dtype) + + # Primitive type array, type is inferred from the numpy array + with pytest.raises(pa.ArrowNotImplementedError): + pa.array(np_arr) + + # Primitive type array, type is explicitly provided + with pytest.raises(pa.ArrowNotImplementedError): + pa.array(np_arr, type=pa.float64()) + + # List type array + with pytest.raises(pa.ArrowNotImplementedError): + pa.array([np_arr]) + + # Struct type array + with pytest.raises(pa.ArrowNotImplementedError): + pa.StructArray.from_arrays([np_arr], names=['a']) + + +def test_non_cpu_array(): + cuda = pytest.importorskip("pyarrow.cuda") + ctx = cuda.Context(0) + + data = np.arange(4, dtype=np.int32) + validity = np.array([True, False, True, False], dtype=np.bool_) + cuda_data_buf = ctx.buffer_from_data(data) + cuda_validity_buf = ctx.buffer_from_data(validity) + arr = pa.Array.from_buffers(pa.int32(), 4, [None, cuda_data_buf]) + arr2 = pa.Array.from_buffers(pa.int32(), 4, [None, cuda_data_buf]) + arr_with_nulls = pa.Array.from_buffers( + pa.int32(), 4, [cuda_validity_buf, cuda_data_buf]) + + # Supported + arr.validate() + assert arr.offset == 0 + assert arr.buffers() == [None, cuda_data_buf] + assert arr.device_type == pa.DeviceAllocationType.CUDA + assert arr.is_cpu is False + assert len(arr) == 4 + assert arr.slice(2, 2).offset == 2 + assert repr(arr) + assert str(arr) + + # TODO support DLPack for CUDA + with pytest.raises(NotImplementedError): + arr.__dlpack__() + with pytest.raises(NotImplementedError): + arr.__dlpack_device__() + + # Not Supported + with pytest.raises(NotImplementedError): + arr.diff(arr2) + with pytest.raises(NotImplementedError): + arr.cast(pa.int64()) + with pytest.raises(NotImplementedError): + arr.view(pa.int64()) + with pytest.raises(NotImplementedError): + arr.sum() + with pytest.raises(NotImplementedError): + arr.unique() + with pytest.raises(NotImplementedError): + arr.dictionary_encode() + with pytest.raises(NotImplementedError): + arr.value_counts() + with pytest.raises(NotImplementedError): + arr_with_nulls.null_count + with pytest.raises(NotImplementedError): + arr.nbytes + with pytest.raises(NotImplementedError): + arr.get_total_buffer_size() + with pytest.raises(NotImplementedError): + [i for i in iter(arr)] + with pytest.raises(NotImplementedError): + arr == arr2 + with pytest.raises(NotImplementedError): + arr.is_null() + with pytest.raises(NotImplementedError): + arr.is_nan() + with pytest.raises(NotImplementedError): + arr.is_valid() + with pytest.raises(NotImplementedError): + arr.fill_null(0) + with pytest.raises(NotImplementedError): + arr[0] + with pytest.raises(NotImplementedError): + arr.take([0]) + with pytest.raises(NotImplementedError): + arr.drop_null() + with pytest.raises(NotImplementedError): + arr.filter([True, True, False, False]) + with pytest.raises(NotImplementedError): + arr.index(0) + with pytest.raises(NotImplementedError): + arr.sort() + with pytest.raises(NotImplementedError): + arr.__array__() + with pytest.raises(NotImplementedError): + arr.to_numpy() + with pytest.raises(NotImplementedError): + arr.tolist() + with pytest.raises(NotImplementedError): + arr.validate(full=True) diff --git a/shared/package-files/9b/9b9249bfb2c4ed5ba4a7c879d2bf74b027db392003d9b3152154145313597834/blob b/shared/package-files/9b/9b9249bfb2c4ed5ba4a7c879d2bf74b027db392003d9b3152154145313597834/blob new file mode 100644 index 0000000000000000000000000000000000000000..61ab3df106db0bc9b3034551dd68eab64d0d31b1 --- /dev/null +++ b/shared/package-files/9b/9b9249bfb2c4ed5ba4a7c879d2bf74b027db392003d9b3152154145313597834/blob @@ -0,0 +1,2808 @@ +#ifndef TZ_H +#define TZ_H + +// The MIT License (MIT) +// +// Copyright (c) 2015, 2016, 2017 Howard Hinnant +// Copyright (c) 2017 Jiangang Zhuang +// Copyright (c) 2017 Aaron Bishop +// Copyright (c) 2017 Tomasz Kamiński +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// Our apologies. When the previous paragraph was written, lowercase had not yet +// been invented (that would involve another several millennia of evolution). +// We did not mean to shout. + +// Get more recent database at http://www.iana.org/time-zones + +// The notion of "current timezone" is something the operating system is expected to "just +// know". How it knows this is system specific. It's often a value set by the user at OS +// installation time and recorded by the OS somewhere. On Linux and Mac systems the current +// timezone name is obtained by looking at the name or contents of a particular file on +// disk. On Windows the current timezone name comes from the registry. In either method, +// there is no guarantee that the "native" current timezone name obtained will match any +// of the "Standard" names in this library's "database". On Linux, the names usually do +// seem to match so mapping functions to map from native to "Standard" are typically not +// required. On Windows, the names are never "Standard" so mapping is always required. +// Technically any OS may use the mapping process but currently only Windows does use it. + +#ifndef USE_OS_TZDB +# define USE_OS_TZDB 0 +#endif + +#ifndef HAS_REMOTE_API +# if USE_OS_TZDB == 0 +# if defined _WIN32 || defined __ANDROID__ +# define HAS_REMOTE_API 0 +# else +# define HAS_REMOTE_API 1 +# endif +# else // HAS_REMOTE_API makes no sense when using the OS timezone database +# define HAS_REMOTE_API 0 +# endif +#endif + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wconstant-logical-operand" +#endif + +static_assert(!(USE_OS_TZDB && HAS_REMOTE_API), + "USE_OS_TZDB and HAS_REMOTE_API can not be used together"); + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +#ifndef AUTO_DOWNLOAD +# define AUTO_DOWNLOAD HAS_REMOTE_API +#endif + +static_assert(HAS_REMOTE_API == 0 ? AUTO_DOWNLOAD == 0 : true, + "AUTO_DOWNLOAD can not be turned on without HAS_REMOTE_API"); + +#ifndef USE_SHELL_API +# define USE_SHELL_API 1 +#endif + +#if USE_OS_TZDB +# ifdef _WIN32 +# error "USE_OS_TZDB can not be used on Windows" +# endif +#endif + +#ifndef HAS_DEDUCTION_GUIDES +# if __cplusplus >= 201703 +# define HAS_DEDUCTION_GUIDES 1 +# else +# define HAS_DEDUCTION_GUIDES 0 +# endif +#endif // HAS_DEDUCTION_GUIDES + +#include "date.h" + +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#include "tz_private.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 +# ifdef DATE_BUILD_DLL +# define DATE_API __declspec(dllexport) +# elif defined(DATE_USE_DLL) +# define DATE_API __declspec(dllimport) +# else +# define DATE_API +# endif +#else +# ifdef DATE_BUILD_DLL +# define DATE_API __attribute__ ((visibility ("default"))) +# else +# define DATE_API +# endif +#endif + +namespace arrow_vendored::date +{ + +enum class choose {earliest, latest}; + +#if defined(BUILD_TZ_LIB) +# if defined(ANDROID) || defined(__ANDROID__) +struct tzdb; +static std::unique_ptr init_tzdb(); +# endif // defined(ANDROID) || defined(__ANDROID__) +#endif // defined(BUILD_TZ_LIB) + +namespace detail +{ + struct undocumented; + + template + struct nodeduct + { + using type = T; + }; + + template + using nodeduct_t = typename nodeduct::type; +} + +struct sys_info +{ + sys_seconds begin; + sys_seconds end; + std::chrono::seconds offset; + std::chrono::minutes save; + std::string abbrev; +}; + +template +std::basic_ostream& +operator<<(std::basic_ostream& os, const sys_info& r) +{ + os << r.begin << '\n'; + os << r.end << '\n'; + os << make_time(r.offset) << "\n"; + os << make_time(r.save) << "\n"; + os << r.abbrev << '\n'; + return os; +} + +struct local_info +{ + enum {unique, nonexistent, ambiguous} result; + sys_info first; + sys_info second; +}; + +template +std::basic_ostream& +operator<<(std::basic_ostream& os, const local_info& r) +{ + if (r.result == local_info::nonexistent) + os << "nonexistent between\n"; + else if (r.result == local_info::ambiguous) + os << "ambiguous between\n"; + os << r.first; + if (r.result != local_info::unique) + { + os << "and\n"; + os << r.second; + } + return os; +} + +class nonexistent_local_time + : public std::runtime_error +{ +public: + template + nonexistent_local_time(local_time tp, const local_info& i); + +private: + template + static + std::string + make_msg(local_time tp, const local_info& i); +}; + +template +inline +nonexistent_local_time::nonexistent_local_time(local_time tp, + const local_info& i) + : std::runtime_error(make_msg(tp, i)) +{ +} + +template +std::string +nonexistent_local_time::make_msg(local_time tp, const local_info& i) +{ + assert(i.result == local_info::nonexistent); + std::ostringstream os; + os << tp << " is in a gap between\n" + << local_seconds{i.first.end.time_since_epoch()} + i.first.offset << ' ' + << i.first.abbrev << " and\n" + << local_seconds{i.second.begin.time_since_epoch()} + i.second.offset << ' ' + << i.second.abbrev + << " which are both equivalent to\n"; + date::operator<<(os, i.first.end) << " UTC"; + return os.str(); +} + +class ambiguous_local_time + : public std::runtime_error +{ +public: + template + ambiguous_local_time(local_time tp, const local_info& i); + +private: + template + static + std::string + make_msg(local_time tp, const local_info& i); +}; + +template +inline +ambiguous_local_time::ambiguous_local_time(local_time tp, const local_info& i) + : std::runtime_error(make_msg(tp, i)) +{ +} + +template +std::string +ambiguous_local_time::make_msg(local_time tp, const local_info& i) +{ + assert(i.result == local_info::ambiguous); + std::ostringstream os; + os << tp << " is ambiguous. It could be\n" + << tp << ' ' << i.first.abbrev << " == " + << tp - i.first.offset << " UTC or\n" + << tp << ' ' << i.second.abbrev << " == " + << tp - i.second.offset << " UTC"; + return os.str(); +} + +class time_zone; + +#if HAS_STRING_VIEW +DATE_API const time_zone* locate_zone(std::string_view tz_name); +#else +DATE_API const time_zone* locate_zone(const std::string& tz_name); +#endif + +DATE_API const time_zone* current_zone(); + +template +struct zoned_traits +{ +}; + +template <> +struct zoned_traits +{ + static + const time_zone* + default_zone() + { + return date::locate_zone("Etc/UTC"); + } + +#if HAS_STRING_VIEW + + static + const time_zone* + locate_zone(std::string_view name) + { + return date::locate_zone(name); + } + +#else // !HAS_STRING_VIEW + + static + const time_zone* + locate_zone(const std::string& name) + { + return date::locate_zone(name); + } + + static + const time_zone* + locate_zone(const char* name) + { + return date::locate_zone(name); + } + +#endif // !HAS_STRING_VIEW +}; + +template +class zoned_time; + +template +bool +operator==(const zoned_time& x, + const zoned_time& y); + +template +class zoned_time +{ +public: + using duration = typename std::common_type::type; + +private: + TimeZonePtr zone_; + sys_time tp_; + +public: +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ::default_zone())> +#endif + zoned_time(); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ::default_zone())> +#endif + zoned_time(const sys_time& st); + explicit zoned_time(TimeZonePtr z); + +#if HAS_STRING_VIEW + template ::locate_zone(std::string_view())) + >::value + >::type> + explicit zoned_time(std::string_view name); +#else +# if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ::locate_zone(std::string())) + >::value + >::type> +# endif + explicit zoned_time(const std::string& name); +#endif + + template , + sys_time>::value + >::type> + zoned_time(const zoned_time& zt) NOEXCEPT; + + zoned_time(TimeZonePtr z, const sys_time& st); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ()->to_sys(local_time{})), + sys_time + >::value + >::type> +#endif + zoned_time(TimeZonePtr z, const local_time& tp); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ()->to_sys(local_time{}, + choose::earliest)), + sys_time + >::value + >::type> +#endif + zoned_time(TimeZonePtr z, const local_time& tp, choose c); + + template , + sys_time>::value + >::type> + zoned_time(TimeZonePtr z, const zoned_time& zt); + + template , + sys_time>::value + >::type> + zoned_time(TimeZonePtr z, const zoned_time& zt, choose); + +#if HAS_STRING_VIEW + + template ::locate_zone(std::string_view())), + sys_time + >::value + >::type> + zoned_time(std::string_view name, detail::nodeduct_t&> st); + + template ::locate_zone(std::string_view())), + local_time + >::value + >::type> + zoned_time(std::string_view name, detail::nodeduct_t&> tp); + + template ::locate_zone(std::string_view())), + local_time, + choose + >::value + >::type> + zoned_time(std::string_view name, detail::nodeduct_t&> tp, choose c); + + template , + sys_time>::value && + std::is_constructible + < + zoned_time, + decltype(zoned_traits::locate_zone(std::string_view())), + zoned_time + >::value + >::type> + zoned_time(std::string_view name, const zoned_time& zt); + + template , + sys_time>::value && + std::is_constructible + < + zoned_time, + decltype(zoned_traits::locate_zone(std::string_view())), + zoned_time, + choose + >::value + >::type> + zoned_time(std::string_view name, const zoned_time& zt, choose); + +#else // !HAS_STRING_VIEW + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ::locate_zone(std::string())), + sys_time + >::value + >::type> +#endif + zoned_time(const std::string& name, const sys_time& st); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ::locate_zone(std::string())), + sys_time + >::value + >::type> +#endif + zoned_time(const char* name, const sys_time& st); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ::locate_zone(std::string())), + local_time + >::value + >::type> +#endif + zoned_time(const std::string& name, const local_time& tp); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ::locate_zone(std::string())), + local_time + >::value + >::type> +#endif + zoned_time(const char* name, const local_time& tp); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ::locate_zone(std::string())), + local_time, + choose + >::value + >::type> +#endif + zoned_time(const std::string& name, const local_time& tp, choose c); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template ::locate_zone(std::string())), + local_time, + choose + >::value + >::type> +#endif + zoned_time(const char* name, const local_time& tp, choose c); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template , + sys_time>::value && + std::is_constructible + < + zoned_time, + decltype(zoned_traits::locate_zone(std::string())), + zoned_time + >::value + >::type> +#else + template +#endif + zoned_time(const std::string& name, const zoned_time& zt); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template , + sys_time>::value && + std::is_constructible + < + zoned_time, + decltype(zoned_traits::locate_zone(std::string())), + zoned_time + >::value + >::type> +#else + template +#endif + zoned_time(const char* name, const zoned_time& zt); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template , + sys_time>::value && + std::is_constructible + < + zoned_time, + decltype(zoned_traits::locate_zone(std::string())), + zoned_time, + choose + >::value + >::type> +#else + template +#endif + zoned_time(const std::string& name, const zoned_time& zt, + choose); + +#if !defined(_MSC_VER) || (_MSC_VER > 1916) + template , + sys_time>::value && + std::is_constructible + < + zoned_time, + decltype(zoned_traits::locate_zone(std::string())), + zoned_time, + choose + >::value + >::type> +#else + template +#endif + zoned_time(const char* name, const zoned_time& zt, + choose); + +#endif // !HAS_STRING_VIEW + + zoned_time& operator=(const sys_time& st); + zoned_time& operator=(const local_time& ut); + + explicit operator sys_time() const; + explicit operator local_time() const; + + TimeZonePtr get_time_zone() const; + local_time get_local_time() const; + sys_time get_sys_time() const; + sys_info get_info() const; + + template + friend + bool + operator==(const zoned_time& x, + const zoned_time& y); + + template + friend + std::basic_ostream& + operator<<(std::basic_ostream& os, + const zoned_time& t); + +private: + template friend class zoned_time; + + template + static + TimeZonePtr2&& + check(TimeZonePtr2&& p); +}; + +using zoned_seconds = zoned_time; + +#if HAS_DEDUCTION_GUIDES + +namespace detail +{ + template + using time_zone_representation = + std::conditional_t + < + std::is_convertible::value, + time_zone const*, + std::remove_cv_t> + >; +} + +zoned_time() + -> zoned_time; + +template +zoned_time(sys_time) + -> zoned_time>; + +template +zoned_time(TimeZonePtrOrName&&) + -> zoned_time>; + +template +zoned_time(TimeZonePtrOrName&&, sys_time) + -> zoned_time, detail::time_zone_representation>; + +template +zoned_time(TimeZonePtrOrName&&, local_time, choose = choose::earliest) + -> zoned_time, detail::time_zone_representation>; + +template +zoned_time(TimeZonePtrOrName&&, zoned_time, choose = choose::earliest) + -> zoned_time, detail::time_zone_representation>; + +#endif // HAS_DEDUCTION_GUIDES + +template +inline +bool +operator==(const zoned_time& x, + const zoned_time& y) +{ + return x.zone_ == y.zone_ && x.tp_ == y.tp_; +} + +template +inline +bool +operator!=(const zoned_time& x, + const zoned_time& y) +{ + return !(x == y); +} + +#if !defined(_MSC_VER) || (_MSC_VER >= 1900) + +namespace detail +{ +# if USE_OS_TZDB + struct transition; + struct expanded_ttinfo; +# else // !USE_OS_TZDB + struct zonelet; + class Rule; +# endif // !USE_OS_TZDB +} + +#endif // !defined(_MSC_VER) || (_MSC_VER >= 1900) + +class time_zone +{ +private: + std::string name_; +#if USE_OS_TZDB + std::vector transitions_; + std::vector ttinfos_; +#else // !USE_OS_TZDB + std::vector zonelets_; +#endif // !USE_OS_TZDB + std::unique_ptr adjusted_; + +public: +#if !defined(_MSC_VER) || (_MSC_VER >= 1900) + time_zone(time_zone&&) = default; + time_zone& operator=(time_zone&&) = default; +#else // defined(_MSC_VER) && (_MSC_VER < 1900) + time_zone(time_zone&& src); + time_zone& operator=(time_zone&& src); +#endif // defined(_MSC_VER) && (_MSC_VER < 1900) + + DATE_API explicit time_zone(const std::string& s, detail::undocumented); + + const std::string& name() const NOEXCEPT; + + template sys_info get_info(sys_time st) const; + template local_info get_info(local_time tp) const; + + template + sys_time::type> + to_sys(local_time tp) const; + + template + sys_time::type> + to_sys(local_time tp, choose z) const; + + template + local_time::type> + to_local(sys_time tp) const; + + friend bool operator==(const time_zone& x, const time_zone& y) NOEXCEPT; + friend bool operator< (const time_zone& x, const time_zone& y) NOEXCEPT; + friend DATE_API std::ostream& operator<<(std::ostream& os, const time_zone& z); + +#if !USE_OS_TZDB + DATE_API void add(const std::string& s); +#else +# if defined(BUILD_TZ_LIB) +# if defined(ANDROID) || defined(__ANDROID__) + friend std::unique_ptr init_tzdb(); +# endif // defined(ANDROID) || defined(__ANDROID__) +# endif // defined(BUILD_TZ_LIB) +#endif // !USE_OS_TZDB + +private: + DATE_API sys_info get_info_impl(sys_seconds tp) const; + DATE_API local_info get_info_impl(local_seconds tp) const; + + template + sys_time::type> + to_sys_impl(local_time tp, choose z, std::false_type) const; + template + sys_time::type> + to_sys_impl(local_time tp, choose, std::true_type) const; + +#if USE_OS_TZDB + DATE_API void init() const; + DATE_API void init_impl(); + DATE_API sys_info + load_sys_info(std::vector::const_iterator i) const; + + template + DATE_API void + load_data(std::istream& inf, std::int32_t tzh_leapcnt, std::int32_t tzh_timecnt, + std::int32_t tzh_typecnt, std::int32_t tzh_charcnt); +# if defined(ANDROID) || defined(__ANDROID__) + void parse_from_android_tzdata(std::ifstream& inf, const std::size_t off); +# endif // defined(ANDROID) || defined(__ANDROID__) +#else // !USE_OS_TZDB + DATE_API sys_info get_info_impl(sys_seconds tp, int tz_int) const; + DATE_API void adjust_infos(const std::vector& rules); + DATE_API void parse_info(std::istream& in); +#endif // !USE_OS_TZDB +}; + +#if defined(_MSC_VER) && (_MSC_VER < 1900) + +inline +time_zone::time_zone(time_zone&& src) + : name_(std::move(src.name_)) + , zonelets_(std::move(src.zonelets_)) + , adjusted_(std::move(src.adjusted_)) + {} + +inline +time_zone& +time_zone::operator=(time_zone&& src) +{ + name_ = std::move(src.name_); + zonelets_ = std::move(src.zonelets_); + adjusted_ = std::move(src.adjusted_); + return *this; +} + +#endif // defined(_MSC_VER) && (_MSC_VER < 1900) + +inline +const std::string& +time_zone::name() const NOEXCEPT +{ + return name_; +} + +template +inline +sys_info +time_zone::get_info(sys_time st) const +{ + return get_info_impl(date::floor(st)); +} + +template +inline +local_info +time_zone::get_info(local_time tp) const +{ + return get_info_impl(date::floor(tp)); +} + +template +inline +sys_time::type> +time_zone::to_sys(local_time tp) const +{ + return to_sys_impl(tp, choose{}, std::true_type{}); +} + +template +inline +sys_time::type> +time_zone::to_sys(local_time tp, choose z) const +{ + return to_sys_impl(tp, z, std::false_type{}); +} + +template +inline +local_time::type> +time_zone::to_local(sys_time tp) const +{ + using LT = local_time::type>; + auto i = get_info(tp); + return LT{(tp + i.offset).time_since_epoch()}; +} + +inline bool operator==(const time_zone& x, const time_zone& y) NOEXCEPT {return x.name_ == y.name_;} +inline bool operator< (const time_zone& x, const time_zone& y) NOEXCEPT {return x.name_ < y.name_;} + +inline bool operator!=(const time_zone& x, const time_zone& y) NOEXCEPT {return !(x == y);} +inline bool operator> (const time_zone& x, const time_zone& y) NOEXCEPT {return y < x;} +inline bool operator<=(const time_zone& x, const time_zone& y) NOEXCEPT {return !(y < x);} +inline bool operator>=(const time_zone& x, const time_zone& y) NOEXCEPT {return !(x < y);} + +template +sys_time::type> +time_zone::to_sys_impl(local_time tp, choose z, std::false_type) const +{ + auto i = get_info(tp); + if (i.result == local_info::nonexistent) + { + return i.first.end; + } + else if (i.result == local_info::ambiguous) + { + if (z == choose::latest) + return sys_time{tp.time_since_epoch()} - i.second.offset; + } + return sys_time{tp.time_since_epoch()} - i.first.offset; +} + +template +sys_time::type> +time_zone::to_sys_impl(local_time tp, choose, std::true_type) const +{ + auto i = get_info(tp); + if (i.result == local_info::nonexistent) + throw nonexistent_local_time(tp, i); + else if (i.result == local_info::ambiguous) + throw ambiguous_local_time(tp, i); + return sys_time{tp.time_since_epoch()} - i.first.offset; +} + +#if !USE_OS_TZDB + +class time_zone_link +{ +private: + std::string name_; + std::string target_; +public: + DATE_API explicit time_zone_link(const std::string& s); + + const std::string& name() const {return name_;} + const std::string& target() const {return target_;} + + friend bool operator==(const time_zone_link& x, const time_zone_link& y) {return x.name_ == y.name_;} + friend bool operator< (const time_zone_link& x, const time_zone_link& y) {return x.name_ < y.name_;} + + friend DATE_API std::ostream& operator<<(std::ostream& os, const time_zone_link& x); +}; + +using link = time_zone_link; + +inline bool operator!=(const time_zone_link& x, const time_zone_link& y) {return !(x == y);} +inline bool operator> (const time_zone_link& x, const time_zone_link& y) {return y < x;} +inline bool operator<=(const time_zone_link& x, const time_zone_link& y) {return !(y < x);} +inline bool operator>=(const time_zone_link& x, const time_zone_link& y) {return !(x < y);} + +#endif // !USE_OS_TZDB + +class leap_second +{ +private: + sys_seconds date_; + +public: +#if USE_OS_TZDB + DATE_API explicit leap_second(const sys_seconds& s, detail::undocumented); +#else + DATE_API explicit leap_second(const std::string& s, detail::undocumented); +#endif + + sys_seconds date() const {return date_;} + + friend bool operator==(const leap_second& x, const leap_second& y) {return x.date_ == y.date_;} + friend bool operator< (const leap_second& x, const leap_second& y) {return x.date_ < y.date_;} + + template + friend + bool + operator==(const leap_second& x, const sys_time& y) + { + return x.date_ == y; + } + + template + friend + bool + operator< (const leap_second& x, const sys_time& y) + { + return x.date_ < y; + } + + template + friend + bool + operator< (const sys_time& x, const leap_second& y) + { + return x < y.date_; + } + + friend DATE_API std::ostream& operator<<(std::ostream& os, const leap_second& x); +}; + +inline bool operator!=(const leap_second& x, const leap_second& y) {return !(x == y);} +inline bool operator> (const leap_second& x, const leap_second& y) {return y < x;} +inline bool operator<=(const leap_second& x, const leap_second& y) {return !(y < x);} +inline bool operator>=(const leap_second& x, const leap_second& y) {return !(x < y);} + +template +inline +bool +operator==(const sys_time& x, const leap_second& y) +{ + return y == x; +} + +template +inline +bool +operator!=(const leap_second& x, const sys_time& y) +{ + return !(x == y); +} + +template +inline +bool +operator!=(const sys_time& x, const leap_second& y) +{ + return !(x == y); +} + +template +inline +bool +operator> (const leap_second& x, const sys_time& y) +{ + return y < x; +} + +template +inline +bool +operator> (const sys_time& x, const leap_second& y) +{ + return y < x; +} + +template +inline +bool +operator<=(const leap_second& x, const sys_time& y) +{ + return !(y < x); +} + +template +inline +bool +operator<=(const sys_time& x, const leap_second& y) +{ + return !(y < x); +} + +template +inline +bool +operator>=(const leap_second& x, const sys_time& y) +{ + return !(x < y); +} + +template +inline +bool +operator>=(const sys_time& x, const leap_second& y) +{ + return !(x < y); +} + +using leap = leap_second; + +#ifdef _WIN32 + +namespace detail +{ + +// The time zone mapping is modelled after this data file: +// http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml +// and the field names match the element names from the mapZone element +// of windowsZones.xml. +// The website displays this file here: +// http://www.unicode.org/cldr/charts/latest/supplemental/zone_tzid.html +// The html view is sorted before being displayed but is otherwise the same +// There is a mapping between the os centric view (in this case windows) +// the html displays uses and the generic view the xml file. +// That mapping is this: +// display column "windows" -> xml field "other". +// display column "region" -> xml field "territory". +// display column "tzid" -> xml field "type". +// This structure uses the generic terminology because it could be +// used to to support other os/native name conversions, not just windows, +// and using the same generic names helps retain the connection to the +// origin of the data that we are using. +struct timezone_mapping +{ + timezone_mapping(const char* other, const char* territory, const char* type) + : other(other), territory(territory), type(type) + { + } + timezone_mapping() = default; + std::string other; + std::string territory; + std::string type; +}; + +} // detail + +#endif // _WIN32 + +struct tzdb +{ + std::string version = "unknown"; + std::vector zones; +#if !USE_OS_TZDB + std::vector links; +#endif + std::vector leap_seconds; +#if !USE_OS_TZDB + std::vector rules; +#endif +#ifdef _WIN32 + std::vector mappings; +#endif + tzdb* next = nullptr; + + tzdb() = default; +#if !defined(_MSC_VER) || (_MSC_VER >= 1900) + tzdb(tzdb&&) = default; + tzdb& operator=(tzdb&&) = default; +#else // defined(_MSC_VER) && (_MSC_VER < 1900) + tzdb(tzdb&& src) + : version(std::move(src.version)) + , zones(std::move(src.zones)) + , links(std::move(src.links)) + , leap_seconds(std::move(src.leap_seconds)) + , rules(std::move(src.rules)) + , mappings(std::move(src.mappings)) + {} + + tzdb& operator=(tzdb&& src) + { + version = std::move(src.version); + zones = std::move(src.zones); + links = std::move(src.links); + leap_seconds = std::move(src.leap_seconds); + rules = std::move(src.rules); + mappings = std::move(src.mappings); + return *this; + } +#endif // defined(_MSC_VER) && (_MSC_VER < 1900) + +#if HAS_STRING_VIEW + DATE_API const time_zone* locate_zone(std::string_view tz_name) const; +#else + DATE_API const time_zone* locate_zone(const std::string& tz_name) const; +#endif + DATE_API const time_zone* current_zone() const; +}; + +using TZ_DB = tzdb; + +DATE_API std::ostream& +operator<<(std::ostream& os, const tzdb& db); + +DATE_API const tzdb& get_tzdb(); + +class tzdb_list +{ + std::atomic head_{nullptr}; + +public: + DATE_API ~tzdb_list(); + tzdb_list() = default; + DATE_API tzdb_list(tzdb_list&& x) NOEXCEPT; + + const tzdb& front() const NOEXCEPT {return *head_;} + tzdb& front() NOEXCEPT {return *head_;} + + class const_iterator; + + const_iterator begin() const NOEXCEPT; + const_iterator end() const NOEXCEPT; + + const_iterator cbegin() const NOEXCEPT; + const_iterator cend() const NOEXCEPT; + + DATE_API const_iterator erase_after(const_iterator p) NOEXCEPT; + + struct undocumented_helper; +private: + void push_front(tzdb* tzdb) NOEXCEPT; +}; + +class tzdb_list::const_iterator +{ + tzdb* p_ = nullptr; + + explicit const_iterator(tzdb* p) NOEXCEPT : p_{p} {} +public: + const_iterator() = default; + + using iterator_category = std::forward_iterator_tag; + using value_type = tzdb; + using reference = const value_type&; + using pointer = const value_type*; + using difference_type = std::ptrdiff_t; + + reference operator*() const NOEXCEPT {return *p_;} + pointer operator->() const NOEXCEPT {return p_;} + + const_iterator& operator++() NOEXCEPT {p_ = p_->next; return *this;} + const_iterator operator++(int) NOEXCEPT {auto t = *this; ++(*this); return t;} + + friend + bool + operator==(const const_iterator& x, const const_iterator& y) NOEXCEPT + {return x.p_ == y.p_;} + + friend + bool + operator!=(const const_iterator& x, const const_iterator& y) NOEXCEPT + {return !(x == y);} + + friend class tzdb_list; +}; + +inline +tzdb_list::const_iterator +tzdb_list::begin() const NOEXCEPT +{ + return const_iterator{head_}; +} + +inline +tzdb_list::const_iterator +tzdb_list::end() const NOEXCEPT +{ + return const_iterator{nullptr}; +} + +inline +tzdb_list::const_iterator +tzdb_list::cbegin() const NOEXCEPT +{ + return begin(); +} + +inline +tzdb_list::const_iterator +tzdb_list::cend() const NOEXCEPT +{ + return end(); +} + +DATE_API tzdb_list& get_tzdb_list(); + +#if !USE_OS_TZDB + +DATE_API const tzdb& reload_tzdb(); +DATE_API void set_install(const std::string& install); + +#endif // !USE_OS_TZDB + +#if HAS_REMOTE_API + +DATE_API std::string remote_version(); +// if provided error_buffer size should be at least CURL_ERROR_SIZE +DATE_API bool remote_download(const std::string& version, char* error_buffer = nullptr); +DATE_API bool remote_install(const std::string& version); + +#endif + +// zoned_time + +namespace detail +{ + +template +inline +T* +to_raw_pointer(T* p) NOEXCEPT +{ + return p; +} + +template +inline +auto +to_raw_pointer(Pointer p) NOEXCEPT + -> decltype(detail::to_raw_pointer(p.operator->())) +{ + return detail::to_raw_pointer(p.operator->()); +} + +} // namespace detail + +template +template +inline +TimeZonePtr2&& +zoned_time::check(TimeZonePtr2&& p) +{ + if (detail::to_raw_pointer(p) == nullptr) + throw std::runtime_error( + "zoned_time constructed with a time zone pointer == nullptr"); + return std::forward(p); +} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time() + : zone_(check(zoned_traits::default_zone())) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(const sys_time& st) + : zone_(check(zoned_traits::default_zone())) + , tp_(st) + {} + +template +inline +zoned_time::zoned_time(TimeZonePtr z) + : zone_(check(std::move(z))) + {} + +#if HAS_STRING_VIEW + +template +template +inline +zoned_time::zoned_time(std::string_view name) + : zoned_time(zoned_traits::locate_zone(name)) + {} + +#else // !HAS_STRING_VIEW + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(const std::string& name) + : zoned_time(zoned_traits::locate_zone(name)) + {} + +#endif // !HAS_STRING_VIEW + +template +template +inline +zoned_time::zoned_time(const zoned_time& zt) NOEXCEPT + : zone_(zt.zone_) + , tp_(zt.tp_) + {} + +template +inline +zoned_time::zoned_time(TimeZonePtr z, const sys_time& st) + : zone_(check(std::move(z))) + , tp_(st) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(TimeZonePtr z, const local_time& t) + : zone_(check(std::move(z))) + , tp_(zone_->to_sys(t)) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(TimeZonePtr z, const local_time& t, + choose c) + : zone_(check(std::move(z))) + , tp_(zone_->to_sys(t, c)) + {} + +template +template +inline +zoned_time::zoned_time(TimeZonePtr z, + const zoned_time& zt) + : zone_(check(std::move(z))) + , tp_(zt.tp_) + {} + +template +template +inline +zoned_time::zoned_time(TimeZonePtr z, + const zoned_time& zt, choose) + : zoned_time(std::move(z), zt) + {} + +#if HAS_STRING_VIEW + +template +template +inline +zoned_time::zoned_time(std::string_view name, + detail::nodeduct_t&> st) + : zoned_time(zoned_traits::locate_zone(name), st) + {} + +template +template +inline +zoned_time::zoned_time(std::string_view name, + detail::nodeduct_t&> t) + : zoned_time(zoned_traits::locate_zone(name), t) + {} + +template +template +inline +zoned_time::zoned_time(std::string_view name, + detail::nodeduct_t&> t, choose c) + : zoned_time(zoned_traits::locate_zone(name), t, c) + {} + +template +template +inline +zoned_time::zoned_time(std::string_view name, + const zoned_time& zt) + : zoned_time(zoned_traits::locate_zone(name), zt) + {} + +template +template +inline +zoned_time::zoned_time(std::string_view name, + const zoned_time& zt, + choose c) + : zoned_time(zoned_traits::locate_zone(name), zt, c) + {} + +#else // !HAS_STRING_VIEW + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(const std::string& name, + const sys_time& st) + : zoned_time(zoned_traits::locate_zone(name), st) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(const char* name, + const sys_time& st) + : zoned_time(zoned_traits::locate_zone(name), st) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(const std::string& name, + const local_time& t) + : zoned_time(zoned_traits::locate_zone(name), t) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(const char* name, + const local_time& t) + : zoned_time(zoned_traits::locate_zone(name), t) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(const std::string& name, + const local_time& t, choose c) + : zoned_time(zoned_traits::locate_zone(name), t, c) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#endif +inline +zoned_time::zoned_time(const char* name, + const local_time& t, choose c) + : zoned_time(zoned_traits::locate_zone(name), t, c) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#else +template +#endif +inline +zoned_time::zoned_time(const std::string& name, + const zoned_time& zt) + : zoned_time(zoned_traits::locate_zone(name), zt) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#else +template +#endif +inline +zoned_time::zoned_time(const char* name, + const zoned_time& zt) + : zoned_time(zoned_traits::locate_zone(name), zt) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#else +template +#endif +inline +zoned_time::zoned_time(const std::string& name, + const zoned_time& zt, + choose c) + : zoned_time(zoned_traits::locate_zone(name), zt, c) + {} + +template +#if !defined(_MSC_VER) || (_MSC_VER > 1916) +template +#else +template +#endif +inline +zoned_time::zoned_time(const char* name, + const zoned_time& zt, + choose c) + : zoned_time(zoned_traits::locate_zone(name), zt, c) + {} + +#endif // HAS_STRING_VIEW + +template +inline +zoned_time& +zoned_time::operator=(const sys_time& st) +{ + tp_ = st; + return *this; +} + +template +inline +zoned_time& +zoned_time::operator=(const local_time& ut) +{ + tp_ = zone_->to_sys(ut); + return *this; +} + +template +inline +zoned_time::operator local_time::duration>() const +{ + return get_local_time(); +} + +template +inline +zoned_time::operator sys_time::duration>() const +{ + return get_sys_time(); +} + +template +inline +TimeZonePtr +zoned_time::get_time_zone() const +{ + return zone_; +} + +template +inline +local_time::duration> +zoned_time::get_local_time() const +{ + return zone_->to_local(tp_); +} + +template +inline +sys_time::duration> +zoned_time::get_sys_time() const +{ + return tp_; +} + +template +inline +sys_info +zoned_time::get_info() const +{ + return zone_->get_info(tp_); +} + +// make_zoned_time + +inline +zoned_time +make_zoned() +{ + return zoned_time(); +} + +template +inline +zoned_time::type> +make_zoned(const sys_time& tp) +{ + return zoned_time::type>(tp); +} + +template 1916) +#if !defined(__INTEL_COMPILER) || (__INTEL_COMPILER > 1600) + , class = typename std::enable_if + < + std::is_class + < + typename std::decay + < + decltype(*detail::to_raw_pointer(std::declval())) + >::type + >{} + >::type +#endif +#endif + > +inline +zoned_time +make_zoned(TimeZonePtr z) +{ + return zoned_time(std::move(z)); +} + +inline +zoned_seconds +make_zoned(const std::string& name) +{ + return zoned_seconds(name); +} + +template 1916) +#if !defined(__INTEL_COMPILER) || (__INTEL_COMPILER > 1600) + , class = typename std::enable_if + < + std::is_class())>::type>{} + >::type +#endif +#endif + > +inline +zoned_time::type, TimeZonePtr> +make_zoned(TimeZonePtr zone, const local_time& tp) +{ + return zoned_time::type, + TimeZonePtr>(std::move(zone), tp); +} + +template 1916) +#if !defined(__INTEL_COMPILER) || (__INTEL_COMPILER > 1600) + , class = typename std::enable_if + < + std::is_class())>::type>{} + >::type +#endif +#endif + > +inline +zoned_time::type, TimeZonePtr> +make_zoned(TimeZonePtr zone, const local_time& tp, choose c) +{ + return zoned_time::type, + TimeZonePtr>(std::move(zone), tp, c); +} + +template +inline +zoned_time::type> +make_zoned(const std::string& name, const local_time& tp) +{ + return zoned_time::type>(name, tp); +} + +template +inline +zoned_time::type> +make_zoned(const std::string& name, const local_time& tp, choose c) +{ + return zoned_time::type>(name, tp, c); +} + +template +inline +zoned_time +make_zoned(TimeZonePtr zone, const zoned_time& zt) +{ + return zoned_time(std::move(zone), zt); +} + +template +inline +zoned_time +make_zoned(const std::string& name, const zoned_time& zt) +{ + return zoned_time(name, zt); +} + +template +inline +zoned_time +make_zoned(TimeZonePtr zone, const zoned_time& zt, choose c) +{ + return zoned_time(std::move(zone), zt, c); +} + +template +inline +zoned_time +make_zoned(const std::string& name, const zoned_time& zt, choose c) +{ + return zoned_time(name, zt, c); +} + +template 1916) +#if !defined(__INTEL_COMPILER) || (__INTEL_COMPILER > 1600) + , class = typename std::enable_if + < + std::is_class())>::type>{} + >::type +#endif +#endif + > +inline +zoned_time::type, TimeZonePtr> +make_zoned(TimeZonePtr zone, const sys_time& st) +{ + return zoned_time::type, + TimeZonePtr>(std::move(zone), st); +} + +template +inline +zoned_time::type> +make_zoned(const std::string& name, const sys_time& st) +{ + return zoned_time::type>(name, st); +} + +template +std::basic_ostream& +to_stream(std::basic_ostream& os, const CharT* fmt, + const zoned_time& tp) +{ + using duration = typename zoned_time::duration; + using LT = local_time; + auto const st = tp.get_sys_time(); + auto const info = tp.get_time_zone()->get_info(st); + return to_stream(os, fmt, LT{(st+info.offset).time_since_epoch()}, + &info.abbrev, &info.offset); +} + +template +inline +std::basic_ostream& +operator<<(std::basic_ostream& os, const zoned_time& t) +{ + const CharT fmt[] = {'%', 'F', ' ', '%', 'T', ' ', '%', 'Z', CharT{}}; + return to_stream(os, fmt, t); +} + +class utc_clock +{ +public: + using duration = std::chrono::system_clock::duration; + using rep = duration::rep; + using period = duration::period; + using time_point = std::chrono::time_point; + static CONSTDATA bool is_steady = false; + + static time_point now(); + + template + static + std::chrono::time_point::type> + to_sys(const std::chrono::time_point&); + + template + static + std::chrono::time_point::type> + from_sys(const std::chrono::time_point&); + + template + static + std::chrono::time_point::type> + to_local(const std::chrono::time_point&); + + template + static + std::chrono::time_point::type> + from_local(const std::chrono::time_point&); +}; + +template + using utc_time = std::chrono::time_point; + +using utc_seconds = utc_time; + +template +utc_time::type> +utc_clock::from_sys(const sys_time& st) +{ + using std::chrono::seconds; + using CD = typename std::common_type::type; + auto const& leaps = get_tzdb().leap_seconds; + auto const lt = std::upper_bound(leaps.begin(), leaps.end(), st); + return utc_time{st.time_since_epoch() + seconds{lt-leaps.begin()}}; +} + +// Return pair +// first is true if ut is during a leap second insertion, otherwise false. +// If ut is during a leap second insertion, that leap second is included in the count +template +std::pair +is_leap_second(date::utc_time const& ut) +{ + using std::chrono::seconds; + using duration = typename std::common_type::type; + auto const& leaps = get_tzdb().leap_seconds; + auto tp = sys_time{ut.time_since_epoch()}; + auto const lt = std::upper_bound(leaps.begin(), leaps.end(), tp); + auto ds = seconds{lt-leaps.begin()}; + tp -= ds; + auto ls = false; + if (lt > leaps.begin()) + { + if (tp < lt[-1]) + { + if (tp >= lt[-1].date() - seconds{1}) + ls = true; + else + --ds; + } + } + return {ls, ds}; +} + +struct leap_second_info +{ + bool is_leap_second; + std::chrono::seconds elapsed; +}; + +template +leap_second_info +get_leap_second_info(date::utc_time const& ut) +{ + auto p = is_leap_second(ut); + return {p.first, p.second}; +} + +template +sys_time::type> +utc_clock::to_sys(const utc_time& ut) +{ + using std::chrono::seconds; + using CD = typename std::common_type::type; + auto ls = is_leap_second(ut); + auto tp = sys_time{ut.time_since_epoch() - ls.second}; + if (ls.first) + tp = floor(tp) + seconds{1} - CD{1}; + return tp; +} + +inline +utc_clock::time_point +utc_clock::now() +{ + return from_sys(std::chrono::system_clock::now()); +} + +template +utc_time::type> +utc_clock::from_local(const local_time& st) +{ + return from_sys(sys_time{st.time_since_epoch()}); +} + +template +local_time::type> +utc_clock::to_local(const utc_time& ut) +{ + using CD = typename std::common_type::type; + return local_time{to_sys(ut).time_since_epoch()}; +} + +template +std::basic_ostream& +to_stream(std::basic_ostream& os, const CharT* fmt, + const utc_time& t) +{ + using std::chrono::seconds; + using CT = typename std::common_type::type; + const std::string abbrev("UTC"); + CONSTDATA seconds offset{0}; + auto ls = is_leap_second(t); + auto tp = sys_time{t.time_since_epoch() - ls.second}; + auto const sd = floor(tp); + year_month_day ymd = sd; + auto time = make_time(tp - sys_seconds{sd}); + time.seconds(detail::undocumented{}) += seconds{ls.first}; + fields fds{ymd, time}; + return to_stream(os, fmt, fds, &abbrev, &offset); +} + +template +std::basic_ostream& +operator<<(std::basic_ostream& os, const utc_time& t) +{ + const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}}; + return to_stream(os, fmt, t); +} + +template > +std::basic_istream& +from_stream(std::basic_istream& is, const CharT* fmt, + utc_time& tp, std::basic_string* abbrev = nullptr, + std::chrono::minutes* offset = nullptr) +{ + using std::chrono::seconds; + using std::chrono::minutes; + using CT = typename std::common_type::type; + minutes offset_local{}; + auto offptr = offset ? offset : &offset_local; + fields fds{}; + fds.has_tod = true; + from_stream(is, fmt, fds, abbrev, offptr); + if (!fds.ymd.ok()) + is.setstate(std::ios::failbit); + if (!is.fail()) + { + bool is_60_sec = fds.tod.seconds() == seconds{60}; + if (is_60_sec) + fds.tod.seconds(detail::undocumented{}) -= seconds{1}; + auto tmp = utc_clock::from_sys(sys_days(fds.ymd) - *offptr + fds.tod.to_duration()); + if (is_60_sec) + tmp += seconds{1}; + if (is_60_sec != is_leap_second(tmp).first || !fds.tod.in_conventional_range()) + { + is.setstate(std::ios::failbit); + return is; + } + tp = std::chrono::time_point_cast(tmp); + } + return is; +} + +// tai_clock + +class tai_clock +{ +public: + using duration = std::chrono::system_clock::duration; + using rep = duration::rep; + using period = duration::period; + using time_point = std::chrono::time_point; + static const bool is_steady = false; + + static time_point now(); + + template + static + std::chrono::time_point::type> + to_utc(const std::chrono::time_point&) NOEXCEPT; + + template + static + std::chrono::time_point::type> + from_utc(const std::chrono::time_point&) NOEXCEPT; + + template + static + std::chrono::time_point::type> + to_local(const std::chrono::time_point&) NOEXCEPT; + + template + static + std::chrono::time_point::type> + from_local(const std::chrono::time_point&) NOEXCEPT; +}; + +template + using tai_time = std::chrono::time_point; + +using tai_seconds = tai_time; + +template +inline +utc_time::type> +tai_clock::to_utc(const tai_time& t) NOEXCEPT +{ + using std::chrono::seconds; + using CD = typename std::common_type::type; + return utc_time{t.time_since_epoch()} - + (sys_days(year{1970}/January/1) - sys_days(year{1958}/January/1) + seconds{10}); +} + +template +inline +tai_time::type> +tai_clock::from_utc(const utc_time& t) NOEXCEPT +{ + using std::chrono::seconds; + using CD = typename std::common_type::type; + return tai_time{t.time_since_epoch()} + + (sys_days(year{1970}/January/1) - sys_days(year{1958}/January/1) + seconds{10}); +} + +inline +tai_clock::time_point +tai_clock::now() +{ + return from_utc(utc_clock::now()); +} + +template +inline +local_time::type> +tai_clock::to_local(const tai_time& t) NOEXCEPT +{ + using CD = typename std::common_type::type; + return local_time{t.time_since_epoch()} - + (local_days(year{1970}/January/1) - local_days(year{1958}/January/1)); +} + +template +inline +tai_time::type> +tai_clock::from_local(const local_time& t) NOEXCEPT +{ + using CD = typename std::common_type::type; + return tai_time{t.time_since_epoch()} + + (local_days(year{1970}/January/1) - local_days(year{1958}/January/1)); +} + +template +std::basic_ostream& +to_stream(std::basic_ostream& os, const CharT* fmt, + const tai_time& t) +{ + const std::string abbrev("TAI"); + CONSTDATA std::chrono::seconds offset{0}; + return to_stream(os, fmt, tai_clock::to_local(t), &abbrev, &offset); +} + +template +std::basic_ostream& +operator<<(std::basic_ostream& os, const tai_time& t) +{ + const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}}; + return to_stream(os, fmt, t); +} + +template > +std::basic_istream& +from_stream(std::basic_istream& is, const CharT* fmt, + tai_time& tp, + std::basic_string* abbrev = nullptr, + std::chrono::minutes* offset = nullptr) +{ + local_time lp; + from_stream(is, fmt, lp, abbrev, offset); + if (!is.fail()) + tp = tai_clock::from_local(lp); + return is; +} + +// gps_clock + +class gps_clock +{ +public: + using duration = std::chrono::system_clock::duration; + using rep = duration::rep; + using period = duration::period; + using time_point = std::chrono::time_point; + static const bool is_steady = false; + + static time_point now(); + + template + static + std::chrono::time_point::type> + to_utc(const std::chrono::time_point&) NOEXCEPT; + + template + static + std::chrono::time_point::type> + from_utc(const std::chrono::time_point&) NOEXCEPT; + + template + static + std::chrono::time_point::type> + to_local(const std::chrono::time_point&) NOEXCEPT; + + template + static + std::chrono::time_point::type> + from_local(const std::chrono::time_point&) NOEXCEPT; +}; + +template + using gps_time = std::chrono::time_point; + +using gps_seconds = gps_time; + +template +inline +utc_time::type> +gps_clock::to_utc(const gps_time& t) NOEXCEPT +{ + using std::chrono::seconds; + using CD = typename std::common_type::type; + return utc_time{t.time_since_epoch()} + + (sys_days(year{1980}/January/Sunday[1]) - sys_days(year{1970}/January/1) + + seconds{9}); +} + +template +inline +gps_time::type> +gps_clock::from_utc(const utc_time& t) NOEXCEPT +{ + using std::chrono::seconds; + using CD = typename std::common_type::type; + return gps_time{t.time_since_epoch()} - + (sys_days(year{1980}/January/Sunday[1]) - sys_days(year{1970}/January/1) + + seconds{9}); +} + +inline +gps_clock::time_point +gps_clock::now() +{ + return from_utc(utc_clock::now()); +} + +template +inline +local_time::type> +gps_clock::to_local(const gps_time& t) NOEXCEPT +{ + using CD = typename std::common_type::type; + return local_time{t.time_since_epoch()} + + (local_days(year{1980}/January/Sunday[1]) - local_days(year{1970}/January/1)); +} + +template +inline +gps_time::type> +gps_clock::from_local(const local_time& t) NOEXCEPT +{ + using CD = typename std::common_type::type; + return gps_time{t.time_since_epoch()} - + (local_days(year{1980}/January/Sunday[1]) - local_days(year{1970}/January/1)); +} + + +template +std::basic_ostream& +to_stream(std::basic_ostream& os, const CharT* fmt, + const gps_time& t) +{ + const std::string abbrev("GPS"); + CONSTDATA std::chrono::seconds offset{0}; + return to_stream(os, fmt, gps_clock::to_local(t), &abbrev, &offset); +} + +template +std::basic_ostream& +operator<<(std::basic_ostream& os, const gps_time& t) +{ + const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}}; + return to_stream(os, fmt, t); +} + +template > +std::basic_istream& +from_stream(std::basic_istream& is, const CharT* fmt, + gps_time& tp, + std::basic_string* abbrev = nullptr, + std::chrono::minutes* offset = nullptr) +{ + local_time lp; + from_stream(is, fmt, lp, abbrev, offset); + if (!is.fail()) + tp = gps_clock::from_local(lp); + return is; +} + +// clock_time_conversion + +template +struct clock_time_conversion +{}; + +template <> +struct clock_time_conversion +{ + template + CONSTCD14 + sys_time + operator()(const sys_time& st) const + { + return st; + } +}; + +template <> +struct clock_time_conversion +{ + template + CONSTCD14 + utc_time + operator()(const utc_time& ut) const + { + return ut; + } +}; + +template<> +struct clock_time_conversion +{ + template + CONSTCD14 + local_time + operator()(const local_time& lt) const + { + return lt; + } +}; + +template <> +struct clock_time_conversion +{ + template + utc_time::type> + operator()(const sys_time& st) const + { + return utc_clock::from_sys(st); + } +}; + +template <> +struct clock_time_conversion +{ + template + sys_time::type> + operator()(const utc_time& ut) const + { + return utc_clock::to_sys(ut); + } +}; + +template<> +struct clock_time_conversion +{ + template + CONSTCD14 + local_time + operator()(const sys_time& st) const + { + return local_time{st.time_since_epoch()}; + } +}; + +template<> +struct clock_time_conversion +{ + template + CONSTCD14 + sys_time + operator()(const local_time& lt) const + { + return sys_time{lt.time_since_epoch()}; + } +}; + +template<> +struct clock_time_conversion +{ + template + utc_time::type> + operator()(const local_time& lt) const + { + return utc_clock::from_local(lt); + } +}; + +template<> +struct clock_time_conversion +{ + template + local_time::type> + operator()(const utc_time& ut) const + { + return utc_clock::to_local(ut); + } +}; + +template +struct clock_time_conversion +{ + template + CONSTCD14 + std::chrono::time_point + operator()(const std::chrono::time_point& tp) const + { + return tp; + } +}; + +namespace ctc_detail +{ + +template + using time_point = std::chrono::time_point; + +using std::declval; +using std::chrono::system_clock; + +//Check if TimePoint is time for given clock, +//if not emits hard error +template +struct return_clock_time +{ + using clock_time_point = time_point; + using type = TimePoint; + + static_assert(std::is_same::value, + "time point with appropariate clock shall be returned"); +}; + +// Check if Clock has to_sys method accepting TimePoint with given duration const& and +// returning sys_time. If so has nested type member equal to return type to_sys. +template +struct return_to_sys +{}; + +template +struct return_to_sys + < + Clock, Duration, + decltype(Clock::to_sys(declval const&>()), void()) + > + : return_clock_time + < + system_clock, + decltype(Clock::to_sys(declval const&>())) + > +{}; + +// Similiar to above +template +struct return_from_sys +{}; + +template +struct return_from_sys + < + Clock, Duration, + decltype(Clock::from_sys(declval const&>()), + void()) + > + : return_clock_time + < + Clock, + decltype(Clock::from_sys(declval const&>())) + > +{}; + +// Similiar to above +template +struct return_to_utc +{}; + +template +struct return_to_utc + < + Clock, Duration, + decltype(Clock::to_utc(declval const&>()), void()) + > + : return_clock_time + < + utc_clock, + decltype(Clock::to_utc(declval const&>()))> +{}; + +// Similiar to above +template +struct return_from_utc +{}; + +template +struct return_from_utc + < + Clock, Duration, + decltype(Clock::from_utc(declval const&>()), + void()) + > + : return_clock_time + < + Clock, + decltype(Clock::from_utc(declval const&>())) + > +{}; + +// Similiar to above +template +struct return_to_local +{}; + +template +struct return_to_local + < + Clock, Duration, + decltype(Clock::to_local(declval const&>()), + void()) + > + : return_clock_time + < + local_t, + decltype(Clock::to_local(declval const&>())) + > +{}; + +// Similiar to above +template +struct return_from_local +{}; + +template +struct return_from_local + < + Clock, Duration, + decltype(Clock::from_local(declval const&>()), + void()) + > + : return_clock_time + < + Clock, + decltype(Clock::from_local(declval const&>())) + > +{}; + +} // namespace ctc_detail + +template +struct clock_time_conversion +{ + template + CONSTCD14 + typename ctc_detail::return_to_sys::type + operator()(const std::chrono::time_point& tp) const + { + return SrcClock::to_sys(tp); + } +}; + +template +struct clock_time_conversion +{ + template + CONSTCD14 + typename ctc_detail::return_from_sys::type + operator()(const sys_time& st) const + { + return DstClock::from_sys(st); + } +}; + +template +struct clock_time_conversion +{ + template + CONSTCD14 + typename ctc_detail::return_to_utc::type + operator()(const std::chrono::time_point& tp) const + { + return SrcClock::to_utc(tp); + } +}; + +template +struct clock_time_conversion +{ + template + CONSTCD14 + typename ctc_detail::return_from_utc::type + operator()(const utc_time& ut) const + { + return DstClock::from_utc(ut); + } +}; + +template +struct clock_time_conversion +{ + template + CONSTCD14 + typename ctc_detail::return_to_local::type + operator()(const std::chrono::time_point& tp) const + { + return SrcClock::to_local(tp); + } +}; + +template +struct clock_time_conversion +{ + template + CONSTCD14 + typename ctc_detail::return_from_local::type + operator()(const local_time& lt) const + { + return DstClock::from_local(lt); + } +}; + +namespace clock_cast_detail +{ + +template + using time_point = std::chrono::time_point; +using std::chrono::system_clock; + +template +CONSTCD14 +auto +conv_clock(const time_point& t) + -> decltype(std::declval>()(t)) +{ + return clock_time_conversion{}(t); +} + +//direct trait conversion, 1st candidate +template +CONSTCD14 +auto +cc_impl(const time_point& t, const time_point*) + -> decltype(conv_clock(t)) +{ + return conv_clock(t); +} + +//conversion through sys, 2nd candidate +template +CONSTCD14 +auto +cc_impl(const time_point& t, const void*) + -> decltype(conv_clock(conv_clock(t))) +{ + return conv_clock(conv_clock(t)); +} + +//conversion through utc, 2nd candidate +template +CONSTCD14 +auto +cc_impl(const time_point& t, const void*) + -> decltype(0, // MSVC_WORKAROUND + conv_clock(conv_clock(t))) +{ + return conv_clock(conv_clock(t)); +} + +//conversion through sys and utc, 3rd candidate +template +CONSTCD14 +auto +cc_impl(const time_point& t, ...) + -> decltype(conv_clock(conv_clock(conv_clock(t)))) +{ + return conv_clock(conv_clock(conv_clock(t))); +} + +//conversion through utc and sys, 3rd candidate +template +CONSTCD14 +auto +cc_impl(const time_point& t, ...) + -> decltype(0, // MSVC_WORKAROUND + conv_clock(conv_clock(conv_clock(t)))) +{ + return conv_clock(conv_clock(conv_clock(t))); +} + +} // namespace clock_cast_detail + +template +CONSTCD14 +auto +clock_cast(const std::chrono::time_point& tp) + -> decltype(clock_cast_detail::cc_impl(tp, &tp)) +{ + return clock_cast_detail::cc_impl(tp, &tp); +} + +// Deprecated API + +template +inline +sys_time::type> +to_sys_time(const utc_time& t) +{ + return utc_clock::to_sys(t); +} + +template +inline +sys_time::type> +to_sys_time(const tai_time& t) +{ + return utc_clock::to_sys(tai_clock::to_utc(t)); +} + +template +inline +sys_time::type> +to_sys_time(const gps_time& t) +{ + return utc_clock::to_sys(gps_clock::to_utc(t)); +} + + +template +inline +utc_time::type> +to_utc_time(const sys_time& t) +{ + return utc_clock::from_sys(t); +} + +template +inline +utc_time::type> +to_utc_time(const tai_time& t) +{ + return tai_clock::to_utc(t); +} + +template +inline +utc_time::type> +to_utc_time(const gps_time& t) +{ + return gps_clock::to_utc(t); +} + + +template +inline +tai_time::type> +to_tai_time(const sys_time& t) +{ + return tai_clock::from_utc(utc_clock::from_sys(t)); +} + +template +inline +tai_time::type> +to_tai_time(const utc_time& t) +{ + return tai_clock::from_utc(t); +} + +template +inline +tai_time::type> +to_tai_time(const gps_time& t) +{ + return tai_clock::from_utc(gps_clock::to_utc(t)); +} + + +template +inline +gps_time::type> +to_gps_time(const sys_time& t) +{ + return gps_clock::from_utc(utc_clock::from_sys(t)); +} + +template +inline +gps_time::type> +to_gps_time(const utc_time& t) +{ + return gps_clock::from_utc(t); +} + +template +inline +gps_time::type> +to_gps_time(const tai_time& t) +{ + return gps_clock::from_utc(tai_clock::to_utc(t)); +} + +} // namespace arrow_vendored::date + +#endif // TZ_H diff --git a/shared/package-files/9b/9b99fa34cb2c454490337a62a9d91f5828c1a4f1ac22d94d94fffea34a2d612e/blob b/shared/package-files/9b/9b99fa34cb2c454490337a62a9d91f5828c1a4f1ac22d94d94fffea34a2d612e/blob new file mode 100644 index 0000000000000000000000000000000000000000..4afa4ebd4224934904e3817d91dcbb45722a7c5a --- /dev/null +++ b/shared/package-files/9b/9b99fa34cb2c454490337a62a9d91f5828c1a4f1ac22d94d94fffea34a2d612e/blob @@ -0,0 +1,563 @@ +"""create and manipulate C data types in Python""" + +import os as _os, sys as _sys +import types as _types + +__version__ = "1.1.0" + +from _ctypes import Union, Structure, Array +from _ctypes import _Pointer +from _ctypes import CFuncPtr as _CFuncPtr +from _ctypes import __version__ as _ctypes_version +from _ctypes import RTLD_LOCAL, RTLD_GLOBAL +from _ctypes import ArgumentError + +from struct import calcsize as _calcsize + +if __version__ != _ctypes_version: + raise Exception("Version number mismatch", __version__, _ctypes_version) + +if _os.name == "nt": + from _ctypes import FormatError + +DEFAULT_MODE = RTLD_LOCAL +if _os.name == "posix" and _sys.platform == "darwin": + # On OS X 10.3, we use RTLD_GLOBAL as default mode + # because RTLD_LOCAL does not work at least on some + # libraries. OS X 10.3 is Darwin 7, so we check for + # that. + + if int(_os.uname().release.split('.')[0]) < 8: + DEFAULT_MODE = RTLD_GLOBAL + +from _ctypes import FUNCFLAG_CDECL as _FUNCFLAG_CDECL, \ + FUNCFLAG_PYTHONAPI as _FUNCFLAG_PYTHONAPI, \ + FUNCFLAG_USE_ERRNO as _FUNCFLAG_USE_ERRNO, \ + FUNCFLAG_USE_LASTERROR as _FUNCFLAG_USE_LASTERROR + +# WINOLEAPI -> HRESULT +# WINOLEAPI_(type) +# +# STDMETHODCALLTYPE +# +# STDMETHOD(name) +# STDMETHOD_(type, name) +# +# STDAPICALLTYPE + +def create_string_buffer(init, size=None): + """create_string_buffer(aBytes) -> character array + create_string_buffer(anInteger) -> character array + create_string_buffer(aBytes, anInteger) -> character array + """ + if isinstance(init, bytes): + if size is None: + size = len(init)+1 + _sys.audit("ctypes.create_string_buffer", init, size) + buftype = c_char * size + buf = buftype() + buf.value = init + return buf + elif isinstance(init, int): + _sys.audit("ctypes.create_string_buffer", None, init) + buftype = c_char * init + buf = buftype() + return buf + raise TypeError(init) + +def c_buffer(init, size=None): +## "deprecated, use create_string_buffer instead" +## import warnings +## warnings.warn("c_buffer is deprecated, use create_string_buffer instead", +## DeprecationWarning, stacklevel=2) + return create_string_buffer(init, size) + +_c_functype_cache = {} +def CFUNCTYPE(restype, *argtypes, **kw): + """CFUNCTYPE(restype, *argtypes, + use_errno=False, use_last_error=False) -> function prototype. + + restype: the result type + argtypes: a sequence specifying the argument types + + The function prototype can be called in different ways to create a + callable object: + + prototype(integer address) -> foreign function + prototype(callable) -> create and return a C callable function from callable + prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method + prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal + prototype((function name, dll object)[, paramflags]) -> foreign function exported by name + """ + flags = _FUNCFLAG_CDECL + if kw.pop("use_errno", False): + flags |= _FUNCFLAG_USE_ERRNO + if kw.pop("use_last_error", False): + flags |= _FUNCFLAG_USE_LASTERROR + if kw: + raise ValueError("unexpected keyword argument(s) %s" % kw.keys()) + try: + return _c_functype_cache[(restype, argtypes, flags)] + except KeyError: + class CFunctionType(_CFuncPtr): + _argtypes_ = argtypes + _restype_ = restype + _flags_ = flags + _c_functype_cache[(restype, argtypes, flags)] = CFunctionType + return CFunctionType + +if _os.name == "nt": + from _ctypes import LoadLibrary as _dlopen + from _ctypes import FUNCFLAG_STDCALL as _FUNCFLAG_STDCALL + + _win_functype_cache = {} + def WINFUNCTYPE(restype, *argtypes, **kw): + # docstring set later (very similar to CFUNCTYPE.__doc__) + flags = _FUNCFLAG_STDCALL + if kw.pop("use_errno", False): + flags |= _FUNCFLAG_USE_ERRNO + if kw.pop("use_last_error", False): + flags |= _FUNCFLAG_USE_LASTERROR + if kw: + raise ValueError("unexpected keyword argument(s) %s" % kw.keys()) + try: + return _win_functype_cache[(restype, argtypes, flags)] + except KeyError: + class WinFunctionType(_CFuncPtr): + _argtypes_ = argtypes + _restype_ = restype + _flags_ = flags + _win_functype_cache[(restype, argtypes, flags)] = WinFunctionType + return WinFunctionType + if WINFUNCTYPE.__doc__: + WINFUNCTYPE.__doc__ = CFUNCTYPE.__doc__.replace("CFUNCTYPE", "WINFUNCTYPE") + +elif _os.name == "posix": + from _ctypes import dlopen as _dlopen + +from _ctypes import sizeof, byref, addressof, alignment, resize +from _ctypes import get_errno, set_errno +from _ctypes import _SimpleCData + +def _check_size(typ, typecode=None): + # Check if sizeof(ctypes_type) against struct.calcsize. This + # should protect somewhat against a misconfigured libffi. + from struct import calcsize + if typecode is None: + # Most _type_ codes are the same as used in struct + typecode = typ._type_ + actual, required = sizeof(typ), calcsize(typecode) + if actual != required: + raise SystemError("sizeof(%s) wrong: %d instead of %d" % \ + (typ, actual, required)) + +class py_object(_SimpleCData): + _type_ = "O" + def __repr__(self): + try: + return super().__repr__() + except ValueError: + return "%s()" % type(self).__name__ +_check_size(py_object, "P") + +class c_short(_SimpleCData): + _type_ = "h" +_check_size(c_short) + +class c_ushort(_SimpleCData): + _type_ = "H" +_check_size(c_ushort) + +class c_long(_SimpleCData): + _type_ = "l" +_check_size(c_long) + +class c_ulong(_SimpleCData): + _type_ = "L" +_check_size(c_ulong) + +if _calcsize("i") == _calcsize("l"): + # if int and long have the same size, make c_int an alias for c_long + c_int = c_long + c_uint = c_ulong +else: + class c_int(_SimpleCData): + _type_ = "i" + _check_size(c_int) + + class c_uint(_SimpleCData): + _type_ = "I" + _check_size(c_uint) + +class c_float(_SimpleCData): + _type_ = "f" +_check_size(c_float) + +class c_double(_SimpleCData): + _type_ = "d" +_check_size(c_double) + +class c_longdouble(_SimpleCData): + _type_ = "g" +if sizeof(c_longdouble) == sizeof(c_double): + c_longdouble = c_double + +if _calcsize("l") == _calcsize("q"): + # if long and long long have the same size, make c_longlong an alias for c_long + c_longlong = c_long + c_ulonglong = c_ulong +else: + class c_longlong(_SimpleCData): + _type_ = "q" + _check_size(c_longlong) + + class c_ulonglong(_SimpleCData): + _type_ = "Q" + ## def from_param(cls, val): + ## return ('d', float(val), val) + ## from_param = classmethod(from_param) + _check_size(c_ulonglong) + +class c_ubyte(_SimpleCData): + _type_ = "B" +c_ubyte.__ctype_le__ = c_ubyte.__ctype_be__ = c_ubyte +# backward compatibility: +##c_uchar = c_ubyte +_check_size(c_ubyte) + +class c_byte(_SimpleCData): + _type_ = "b" +c_byte.__ctype_le__ = c_byte.__ctype_be__ = c_byte +_check_size(c_byte) + +class c_char(_SimpleCData): + _type_ = "c" +c_char.__ctype_le__ = c_char.__ctype_be__ = c_char +_check_size(c_char) + +class c_char_p(_SimpleCData): + _type_ = "z" + def __repr__(self): + return "%s(%s)" % (self.__class__.__name__, c_void_p.from_buffer(self).value) +_check_size(c_char_p, "P") + +class c_void_p(_SimpleCData): + _type_ = "P" +c_voidp = c_void_p # backwards compatibility (to a bug) +_check_size(c_void_p) + +class c_bool(_SimpleCData): + _type_ = "?" + +from _ctypes import POINTER, pointer, _pointer_type_cache + +class c_wchar_p(_SimpleCData): + _type_ = "Z" + def __repr__(self): + return "%s(%s)" % (self.__class__.__name__, c_void_p.from_buffer(self).value) + +class c_wchar(_SimpleCData): + _type_ = "u" + +def _reset_cache(): + _pointer_type_cache.clear() + _c_functype_cache.clear() + if _os.name == "nt": + _win_functype_cache.clear() + # _SimpleCData.c_wchar_p_from_param + POINTER(c_wchar).from_param = c_wchar_p.from_param + # _SimpleCData.c_char_p_from_param + POINTER(c_char).from_param = c_char_p.from_param + _pointer_type_cache[None] = c_void_p + +def create_unicode_buffer(init, size=None): + """create_unicode_buffer(aString) -> character array + create_unicode_buffer(anInteger) -> character array + create_unicode_buffer(aString, anInteger) -> character array + """ + if isinstance(init, str): + if size is None: + if sizeof(c_wchar) == 2: + # UTF-16 requires a surrogate pair (2 wchar_t) for non-BMP + # characters (outside [U+0000; U+FFFF] range). +1 for trailing + # NUL character. + size = sum(2 if ord(c) > 0xFFFF else 1 for c in init) + 1 + else: + # 32-bit wchar_t (1 wchar_t per Unicode character). +1 for + # trailing NUL character. + size = len(init) + 1 + _sys.audit("ctypes.create_unicode_buffer", init, size) + buftype = c_wchar * size + buf = buftype() + buf.value = init + return buf + elif isinstance(init, int): + _sys.audit("ctypes.create_unicode_buffer", None, init) + buftype = c_wchar * init + buf = buftype() + return buf + raise TypeError(init) + + +# XXX Deprecated +def SetPointerType(pointer, cls): + if _pointer_type_cache.get(cls, None) is not None: + raise RuntimeError("This type already exists in the cache") + if id(pointer) not in _pointer_type_cache: + raise RuntimeError("What's this???") + pointer.set_type(cls) + _pointer_type_cache[cls] = pointer + del _pointer_type_cache[id(pointer)] + +# XXX Deprecated +def ARRAY(typ, len): + return typ * len + +################################################################ + + +class CDLL(object): + """An instance of this class represents a loaded dll/shared + library, exporting functions using the standard C calling + convention (named 'cdecl' on Windows). + + The exported functions can be accessed as attributes, or by + indexing with the function name. Examples: + + .qsort -> callable object + ['qsort'] -> callable object + + Calling the functions releases the Python GIL during the call and + reacquires it afterwards. + """ + _func_flags_ = _FUNCFLAG_CDECL + _func_restype_ = c_int + # default values for repr + _name = '' + _handle = 0 + _FuncPtr = None + + def __init__(self, name, mode=DEFAULT_MODE, handle=None, + use_errno=False, + use_last_error=False, + winmode=None): + self._name = name + flags = self._func_flags_ + if use_errno: + flags |= _FUNCFLAG_USE_ERRNO + if use_last_error: + flags |= _FUNCFLAG_USE_LASTERROR + if _sys.platform.startswith("aix"): + """When the name contains ".a(" and ends with ")", + e.g., "libFOO.a(libFOO.so)" - this is taken to be an + archive(member) syntax for dlopen(), and the mode is adjusted. + Otherwise, name is presented to dlopen() as a file argument. + """ + if name and name.endswith(")") and ".a(" in name: + mode |= ( _os.RTLD_MEMBER | _os.RTLD_NOW ) + if _os.name == "nt": + if winmode is not None: + mode = winmode + else: + import nt + mode = nt._LOAD_LIBRARY_SEARCH_DEFAULT_DIRS + if '/' in name or '\\' in name: + self._name = nt._getfullpathname(self._name) + mode |= nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR + + class _FuncPtr(_CFuncPtr): + _flags_ = flags + _restype_ = self._func_restype_ + self._FuncPtr = _FuncPtr + + if handle is None: + self._handle = _dlopen(self._name, mode) + else: + self._handle = handle + + def __repr__(self): + return "<%s '%s', handle %x at %#x>" % \ + (self.__class__.__name__, self._name, + (self._handle & (_sys.maxsize*2 + 1)), + id(self) & (_sys.maxsize*2 + 1)) + + def __getattr__(self, name): + if name.startswith('__') and name.endswith('__'): + raise AttributeError(name) + func = self.__getitem__(name) + setattr(self, name, func) + return func + + def __getitem__(self, name_or_ordinal): + func = self._FuncPtr((name_or_ordinal, self)) + if not isinstance(name_or_ordinal, int): + func.__name__ = name_or_ordinal + return func + +class PyDLL(CDLL): + """This class represents the Python library itself. It allows + accessing Python API functions. The GIL is not released, and + Python exceptions are handled correctly. + """ + _func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI + +if _os.name == "nt": + + class WinDLL(CDLL): + """This class represents a dll exporting functions using the + Windows stdcall calling convention. + """ + _func_flags_ = _FUNCFLAG_STDCALL + + # XXX Hm, what about HRESULT as normal parameter? + # Mustn't it derive from c_long then? + from _ctypes import _check_HRESULT, _SimpleCData + class HRESULT(_SimpleCData): + _type_ = "l" + # _check_retval_ is called with the function's result when it + # is used as restype. It checks for the FAILED bit, and + # raises an OSError if it is set. + # + # The _check_retval_ method is implemented in C, so that the + # method definition itself is not included in the traceback + # when it raises an error - that is what we want (and Python + # doesn't have a way to raise an exception in the caller's + # frame). + _check_retval_ = _check_HRESULT + + class OleDLL(CDLL): + """This class represents a dll exporting functions using the + Windows stdcall calling convention, and returning HRESULT. + HRESULT error values are automatically raised as OSError + exceptions. + """ + _func_flags_ = _FUNCFLAG_STDCALL + _func_restype_ = HRESULT + +class LibraryLoader(object): + def __init__(self, dlltype): + self._dlltype = dlltype + + def __getattr__(self, name): + if name[0] == '_': + raise AttributeError(name) + dll = self._dlltype(name) + setattr(self, name, dll) + return dll + + def __getitem__(self, name): + return getattr(self, name) + + def LoadLibrary(self, name): + return self._dlltype(name) + + __class_getitem__ = classmethod(_types.GenericAlias) + +cdll = LibraryLoader(CDLL) +pydll = LibraryLoader(PyDLL) + +if _os.name == "nt": + pythonapi = PyDLL("python dll", None, _sys.dllhandle) +elif _sys.platform == "cygwin": + pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) +else: + pythonapi = PyDLL(None) + + +if _os.name == "nt": + windll = LibraryLoader(WinDLL) + oledll = LibraryLoader(OleDLL) + + GetLastError = windll.kernel32.GetLastError + from _ctypes import get_last_error, set_last_error + + def WinError(code=None, descr=None): + if code is None: + code = GetLastError() + if descr is None: + descr = FormatError(code).strip() + return OSError(None, descr, None, code) + +if sizeof(c_uint) == sizeof(c_void_p): + c_size_t = c_uint + c_ssize_t = c_int +elif sizeof(c_ulong) == sizeof(c_void_p): + c_size_t = c_ulong + c_ssize_t = c_long +elif sizeof(c_ulonglong) == sizeof(c_void_p): + c_size_t = c_ulonglong + c_ssize_t = c_longlong + +# functions + +from _ctypes import _memmove_addr, _memset_addr, _string_at_addr, _cast_addr + +## void *memmove(void *, const void *, size_t); +memmove = CFUNCTYPE(c_void_p, c_void_p, c_void_p, c_size_t)(_memmove_addr) + +## void *memset(void *, int, size_t) +memset = CFUNCTYPE(c_void_p, c_void_p, c_int, c_size_t)(_memset_addr) + +def PYFUNCTYPE(restype, *argtypes): + class CFunctionType(_CFuncPtr): + _argtypes_ = argtypes + _restype_ = restype + _flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI + return CFunctionType + +_cast = PYFUNCTYPE(py_object, c_void_p, py_object, py_object)(_cast_addr) +def cast(obj, typ): + return _cast(obj, obj, typ) + +_string_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_string_at_addr) +def string_at(ptr, size=-1): + """string_at(addr[, size]) -> string + + Return the string at addr.""" + return _string_at(ptr, size) + +try: + from _ctypes import _wstring_at_addr +except ImportError: + pass +else: + _wstring_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_wstring_at_addr) + def wstring_at(ptr, size=-1): + """wstring_at(addr[, size]) -> string + + Return the string at addr.""" + return _wstring_at(ptr, size) + + +if _os.name == "nt": # COM stuff + def DllGetClassObject(rclsid, riid, ppv): + try: + ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*']) + except ImportError: + return -2147221231 # CLASS_E_CLASSNOTAVAILABLE + else: + return ccom.DllGetClassObject(rclsid, riid, ppv) + + def DllCanUnloadNow(): + try: + ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*']) + except ImportError: + return 0 # S_OK + return ccom.DllCanUnloadNow() + +from ctypes._endian import BigEndianStructure, LittleEndianStructure + +# Fill in specifically-sized types +c_int8 = c_byte +c_uint8 = c_ubyte +for kind in [c_short, c_int, c_long, c_longlong]: + if sizeof(kind) == 2: c_int16 = kind + elif sizeof(kind) == 4: c_int32 = kind + elif sizeof(kind) == 8: c_int64 = kind +for kind in [c_ushort, c_uint, c_ulong, c_ulonglong]: + if sizeof(kind) == 2: c_uint16 = kind + elif sizeof(kind) == 4: c_uint32 = kind + elif sizeof(kind) == 8: c_uint64 = kind +del(kind) + +_reset_cache() diff --git a/shared/package-files/9b/9ba27558c729a3ded33a153652e663250379593d748ad9c473f4942553ddd247/blob b/shared/package-files/9b/9ba27558c729a3ded33a153652e663250379593d748ad9c473f4942553ddd247/blob new file mode 100644 index 0000000000000000000000000000000000000000..5c5abdae7a021497d69c61c6b1e75e47a39d00b2 --- /dev/null +++ b/shared/package-files/9b/9ba27558c729a3ded33a153652e663250379593d748ad9c473f4942553ddd247/blob @@ -0,0 +1,106 @@ +import numpy as np + +from pandas.compat import WARNING_CHECK_DISABLED + +from pandas import ( + DataFrame, + option_context, +) +import pandas._testing as tm +from pandas.tests.copy_view.util import get_array + + +def test_clip_inplace_reference(using_copy_on_write, warn_copy_on_write): + df = DataFrame({"a": [1.5, 2, 3]}) + df_copy = df.copy() + arr_a = get_array(df, "a") + view = df[:] + if warn_copy_on_write: + with tm.assert_cow_warning(): + df.clip(lower=2, inplace=True) + else: + df.clip(lower=2, inplace=True) + + if using_copy_on_write: + assert not np.shares_memory(get_array(df, "a"), arr_a) + assert df._mgr._has_no_reference(0) + assert view._mgr._has_no_reference(0) + tm.assert_frame_equal(df_copy, view) + else: + assert np.shares_memory(get_array(df, "a"), arr_a) + + +def test_clip_inplace_reference_no_op(using_copy_on_write): + df = DataFrame({"a": [1.5, 2, 3]}) + df_copy = df.copy() + arr_a = get_array(df, "a") + view = df[:] + df.clip(lower=0, inplace=True) + + assert np.shares_memory(get_array(df, "a"), arr_a) + + if using_copy_on_write: + assert not df._mgr._has_no_reference(0) + assert not view._mgr._has_no_reference(0) + tm.assert_frame_equal(df_copy, view) + + +def test_clip_inplace(using_copy_on_write): + df = DataFrame({"a": [1.5, 2, 3]}) + arr_a = get_array(df, "a") + df.clip(lower=2, inplace=True) + + assert np.shares_memory(get_array(df, "a"), arr_a) + + if using_copy_on_write: + assert df._mgr._has_no_reference(0) + + +def test_clip(using_copy_on_write): + df = DataFrame({"a": [1.5, 2, 3]}) + df_orig = df.copy() + df2 = df.clip(lower=2) + + assert not np.shares_memory(get_array(df2, "a"), get_array(df, "a")) + + if using_copy_on_write: + assert df._mgr._has_no_reference(0) + tm.assert_frame_equal(df_orig, df) + + +def test_clip_no_op(using_copy_on_write): + df = DataFrame({"a": [1.5, 2, 3]}) + df2 = df.clip(lower=0) + + if using_copy_on_write: + assert not df._mgr._has_no_reference(0) + assert np.shares_memory(get_array(df2, "a"), get_array(df, "a")) + else: + assert not np.shares_memory(get_array(df2, "a"), get_array(df, "a")) + + +def test_clip_chained_inplace(using_copy_on_write): + df = DataFrame({"a": [1, 4, 2], "b": 1}) + df_orig = df.copy() + if using_copy_on_write: + with tm.raises_chained_assignment_error(): + df["a"].clip(1, 2, inplace=True) + tm.assert_frame_equal(df, df_orig) + + with tm.raises_chained_assignment_error(): + df[["a"]].clip(1, 2, inplace=True) + tm.assert_frame_equal(df, df_orig) + else: + with tm.assert_produces_warning( + FutureWarning if not WARNING_CHECK_DISABLED else None, + match="inplace method", + ): + df["a"].clip(1, 2, inplace=True) + + with tm.assert_produces_warning(None): + with option_context("mode.chained_assignment", None): + df[["a"]].clip(1, 2, inplace=True) + + with tm.assert_produces_warning(None): + with option_context("mode.chained_assignment", None): + df[df["a"] > 1].clip(1, 2, inplace=True) diff --git a/shared/package-files/9b/9ba2eb28230878d7ae89c7ee30c146dfe29efbba328d3b03d5045b29d4d15589/blob b/shared/package-files/9b/9ba2eb28230878d7ae89c7ee30c146dfe29efbba328d3b03d5045b29d4d15589/blob new file mode 100644 index 0000000000000000000000000000000000000000..0c125f21a26a9e6df8ba7743c9d90e3480d06531 --- /dev/null +++ b/shared/package-files/9b/9ba2eb28230878d7ae89c7ee30c146dfe29efbba328d3b03d5045b29d4d15589/blob @@ -0,0 +1,365 @@ +from sympy.core.numbers import (E, Rational, pi) +from sympy.functions.elementary.exponential import exp +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.core import S, symbols, I +from sympy.discrete.convolutions import ( + convolution, convolution_fft, convolution_ntt, convolution_fwht, + convolution_subset, covering_product, intersecting_product) +from sympy.testing.pytest import raises +from sympy.abc import x, y + +def test_convolution(): + # fft + a = [1, Rational(5, 3), sqrt(3), Rational(7, 5)] + b = [9, 5, 5, 4, 3, 2] + c = [3, 5, 3, 7, 8] + d = [1422, 6572, 3213, 5552] + + assert convolution(a, b) == convolution_fft(a, b) + assert convolution(a, b, dps=9) == convolution_fft(a, b, dps=9) + assert convolution(a, d, dps=7) == convolution_fft(d, a, dps=7) + assert convolution(a, d[1:], dps=3) == convolution_fft(d[1:], a, dps=3) + + # prime moduli of the form (m*2**k + 1), sequence length + # should be a divisor of 2**k + p = 7*17*2**23 + 1 + q = 19*2**10 + 1 + + # ntt + assert convolution(d, b, prime=q) == convolution_ntt(b, d, prime=q) + assert convolution(c, b, prime=p) == convolution_ntt(b, c, prime=p) + assert convolution(d, c, prime=p) == convolution_ntt(c, d, prime=p) + raises(TypeError, lambda: convolution(b, d, dps=5, prime=q)) + raises(TypeError, lambda: convolution(b, d, dps=6, prime=q)) + + # fwht + assert convolution(a, b, dyadic=True) == convolution_fwht(a, b) + assert convolution(a, b, dyadic=False) == convolution(a, b) + raises(TypeError, lambda: convolution(b, d, dps=2, dyadic=True)) + raises(TypeError, lambda: convolution(b, d, prime=p, dyadic=True)) + raises(TypeError, lambda: convolution(a, b, dps=2, dyadic=True)) + raises(TypeError, lambda: convolution(b, c, prime=p, dyadic=True)) + + # subset + assert convolution(a, b, subset=True) == convolution_subset(a, b) == \ + convolution(a, b, subset=True, dyadic=False) == \ + convolution(a, b, subset=True) + assert convolution(a, b, subset=False) == convolution(a, b) + raises(TypeError, lambda: convolution(a, b, subset=True, dyadic=True)) + raises(TypeError, lambda: convolution(c, d, subset=True, dps=6)) + raises(TypeError, lambda: convolution(a, c, subset=True, prime=q)) + + +def test_cyclic_convolution(): + # fft + a = [1, Rational(5, 3), sqrt(3), Rational(7, 5)] + b = [9, 5, 5, 4, 3, 2] + + assert convolution([1, 2, 3], [4, 5, 6], cycle=0) == \ + convolution([1, 2, 3], [4, 5, 6], cycle=5) == \ + convolution([1, 2, 3], [4, 5, 6]) + + assert convolution([1, 2, 3], [4, 5, 6], cycle=3) == [31, 31, 28] + + a = [Rational(1, 3), Rational(7, 3), Rational(5, 9), Rational(2, 7), Rational(5, 8)] + b = [Rational(3, 5), Rational(4, 7), Rational(7, 8), Rational(8, 9)] + + assert convolution(a, b, cycle=0) == \ + convolution(a, b, cycle=len(a) + len(b) - 1) + + assert convolution(a, b, cycle=4) == [Rational(87277, 26460), Rational(30521, 11340), + Rational(11125, 4032), Rational(3653, 1080)] + + assert convolution(a, b, cycle=6) == [Rational(20177, 20160), Rational(676, 315), Rational(47, 24), + Rational(3053, 1080), Rational(16397, 5292), Rational(2497, 2268)] + + assert convolution(a, b, cycle=9) == \ + convolution(a, b, cycle=0) + [S.Zero] + + # ntt + a = [2313, 5323532, S(3232), 42142, 42242421] + b = [S(33456), 56757, 45754, 432423] + + assert convolution(a, b, prime=19*2**10 + 1, cycle=0) == \ + convolution(a, b, prime=19*2**10 + 1, cycle=8) == \ + convolution(a, b, prime=19*2**10 + 1) + + assert convolution(a, b, prime=19*2**10 + 1, cycle=5) == [96, 17146, 2664, + 15534, 3517] + + assert convolution(a, b, prime=19*2**10 + 1, cycle=7) == [4643, 3458, 1260, + 15534, 3517, 16314, 13688] + + assert convolution(a, b, prime=19*2**10 + 1, cycle=9) == \ + convolution(a, b, prime=19*2**10 + 1) + [0] + + # fwht + u, v, w, x, y = symbols('u v w x y') + p, q, r, s, t = symbols('p q r s t') + c = [u, v, w, x, y] + d = [p, q, r, s, t] + + assert convolution(a, b, dyadic=True, cycle=3) == \ + [2499522285783, 19861417974796, 4702176579021] + + assert convolution(a, b, dyadic=True, cycle=5) == [2718149225143, + 2114320852171, 20571217906407, 246166418903, 1413262436976] + + assert convolution(c, d, dyadic=True, cycle=4) == \ + [p*u + p*y + q*v + r*w + s*x + t*u + t*y, + p*v + q*u + q*y + r*x + s*w + t*v, + p*w + q*x + r*u + r*y + s*v + t*w, + p*x + q*w + r*v + s*u + s*y + t*x] + + assert convolution(c, d, dyadic=True, cycle=6) == \ + [p*u + q*v + r*w + r*y + s*x + t*w + t*y, + p*v + q*u + r*x + s*w + s*y + t*x, + p*w + q*x + r*u + s*v, + p*x + q*w + r*v + s*u, + p*y + t*u, + q*y + t*v] + + # subset + assert convolution(a, b, subset=True, cycle=7) == [18266671799811, + 178235365533, 213958794, 246166418903, 1413262436976, + 2397553088697, 1932759730434] + + assert convolution(a[1:], b, subset=True, cycle=4) == \ + [178104086592, 302255835516, 244982785880, 3717819845434] + + assert convolution(a, b[:-1], subset=True, cycle=6) == [1932837114162, + 178235365533, 213958794, 245166224504, 1413262436976, 2397553088697] + + assert convolution(c, d, subset=True, cycle=3) == \ + [p*u + p*x + q*w + r*v + r*y + s*u + t*w, + p*v + p*y + q*u + s*y + t*u + t*x, + p*w + q*y + r*u + t*v] + + assert convolution(c, d, subset=True, cycle=5) == \ + [p*u + q*y + t*v, + p*v + q*u + r*y + t*w, + p*w + r*u + s*y + t*x, + p*x + q*w + r*v + s*u, + p*y + t*u] + + raises(ValueError, lambda: convolution([1, 2, 3], [4, 5, 6], cycle=-1)) + + +def test_convolution_fft(): + assert all(convolution_fft([], x, dps=y) == [] for x in ([], [1]) for y in (None, 3)) + assert convolution_fft([1, 2, 3], [4, 5, 6]) == [4, 13, 28, 27, 18] + assert convolution_fft([1], [5, 6, 7]) == [5, 6, 7] + assert convolution_fft([1, 3], [5, 6, 7]) == [5, 21, 25, 21] + + assert convolution_fft([1 + 2*I], [2 + 3*I]) == [-4 + 7*I] + assert convolution_fft([1 + 2*I, 3 + 4*I, 5 + 3*I/5], [Rational(2, 5) + 4*I/7]) == \ + [Rational(-26, 35) + I*48/35, Rational(-38, 35) + I*116/35, Rational(58, 35) + I*542/175] + + assert convolution_fft([Rational(3, 4), Rational(5, 6)], [Rational(7, 8), Rational(1, 3), Rational(2, 5)]) == \ + [Rational(21, 32), Rational(47, 48), Rational(26, 45), Rational(1, 3)] + + assert convolution_fft([Rational(1, 9), Rational(2, 3), Rational(3, 5)], [Rational(2, 5), Rational(3, 7), Rational(4, 9)]) == \ + [Rational(2, 45), Rational(11, 35), Rational(8152, 14175), Rational(523, 945), Rational(4, 15)] + + assert convolution_fft([pi, E, sqrt(2)], [sqrt(3), 1/pi, 1/E]) == \ + [sqrt(3)*pi, 1 + sqrt(3)*E, E/pi + pi*exp(-1) + sqrt(6), + sqrt(2)/pi + 1, sqrt(2)*exp(-1)] + + assert convolution_fft([2321, 33123], [5321, 6321, 71323]) == \ + [12350041, 190918524, 374911166, 2362431729] + + assert convolution_fft([312313, 31278232], [32139631, 319631]) == \ + [10037624576503, 1005370659728895, 9997492572392] + + raises(TypeError, lambda: convolution_fft(x, y)) + raises(ValueError, lambda: convolution_fft([x, y], [y, x])) + + +def test_convolution_ntt(): + # prime moduli of the form (m*2**k + 1), sequence length + # should be a divisor of 2**k + p = 7*17*2**23 + 1 + q = 19*2**10 + 1 + r = 2*500000003 + 1 # only for sequences of length 1 or 2 + # s = 2*3*5*7 # composite modulus + + assert all(convolution_ntt([], x, prime=y) == [] for x in ([], [1]) for y in (p, q, r)) + assert convolution_ntt([2], [3], r) == [6] + assert convolution_ntt([2, 3], [4], r) == [8, 12] + + assert convolution_ntt([32121, 42144, 4214, 4241], [32132, 3232, 87242], p) == [33867619, + 459741727, 79180879, 831885249, 381344700, 369993322] + assert convolution_ntt([121913, 3171831, 31888131, 12], [17882, 21292, 29921, 312], q) == \ + [8158, 3065, 3682, 7090, 1239, 2232, 3744] + + assert convolution_ntt([12, 19, 21, 98, 67], [2, 6, 7, 8, 9], p) == \ + convolution_ntt([12, 19, 21, 98, 67], [2, 6, 7, 8, 9], q) + assert convolution_ntt([12, 19, 21, 98, 67], [21, 76, 17, 78, 69], p) == \ + convolution_ntt([12, 19, 21, 98, 67], [21, 76, 17, 78, 69], q) + + raises(ValueError, lambda: convolution_ntt([2, 3], [4, 5], r)) + raises(ValueError, lambda: convolution_ntt([x, y], [y, x], q)) + raises(TypeError, lambda: convolution_ntt(x, y, p)) + + +def test_convolution_fwht(): + assert convolution_fwht([], []) == [] + assert convolution_fwht([], [1]) == [] + assert convolution_fwht([1, 2, 3], [4, 5, 6]) == [32, 13, 18, 27] + + assert convolution_fwht([Rational(5, 7), Rational(6, 8), Rational(7, 3)], [2, 4, Rational(6, 7)]) == \ + [Rational(45, 7), Rational(61, 14), Rational(776, 147), Rational(419, 42)] + + a = [1, Rational(5, 3), sqrt(3), Rational(7, 5), 4 + 5*I] + b = [94, 51, 53, 45, 31, 27, 13] + c = [3 + 4*I, 5 + 7*I, 3, Rational(7, 6), 8] + + assert convolution_fwht(a, b) == [53*sqrt(3) + 366 + 155*I, + 45*sqrt(3) + Rational(5848, 15) + 135*I, + 94*sqrt(3) + Rational(1257, 5) + 65*I, + 51*sqrt(3) + Rational(3974, 15), + 13*sqrt(3) + 452 + 470*I, + Rational(4513, 15) + 255*I, + 31*sqrt(3) + Rational(1314, 5) + 265*I, + 27*sqrt(3) + Rational(3676, 15) + 225*I] + + assert convolution_fwht(b, c) == [Rational(1993, 2) + 733*I, Rational(6215, 6) + 862*I, + Rational(1659, 2) + 527*I, Rational(1988, 3) + 551*I, 1019 + 313*I, Rational(3955, 6) + 325*I, + Rational(1175, 2) + 52*I, Rational(3253, 6) + 91*I] + + assert convolution_fwht(a[3:], c) == [Rational(-54, 5) + I*293/5, -1 + I*204/5, + Rational(133, 15) + I*35/6, Rational(409, 30) + 15*I, Rational(56, 5), 32 + 40*I, 0, 0] + + u, v, w, x, y, z = symbols('u v w x y z') + + assert convolution_fwht([u, v], [x, y]) == [u*x + v*y, u*y + v*x] + + assert convolution_fwht([u, v, w], [x, y]) == \ + [u*x + v*y, u*y + v*x, w*x, w*y] + + assert convolution_fwht([u, v, w], [x, y, z]) == \ + [u*x + v*y + w*z, u*y + v*x, u*z + w*x, v*z + w*y] + + raises(TypeError, lambda: convolution_fwht(x, y)) + raises(TypeError, lambda: convolution_fwht(x*y, u + v)) + + +def test_convolution_subset(): + assert convolution_subset([], []) == [] + assert convolution_subset([], [Rational(1, 3)]) == [] + assert convolution_subset([6 + I*3/7], [Rational(2, 3)]) == [4 + I*2/7] + + a = [1, Rational(5, 3), sqrt(3), 4 + 5*I] + b = [64, 71, 55, 47, 33, 29, 15] + c = [3 + I*2/3, 5 + 7*I, 7, Rational(7, 5), 9] + + assert convolution_subset(a, b) == [64, Rational(533, 3), 55 + 64*sqrt(3), + 71*sqrt(3) + Rational(1184, 3) + 320*I, 33, 84, + 15 + 33*sqrt(3), 29*sqrt(3) + 157 + 165*I] + + assert convolution_subset(b, c) == [192 + I*128/3, 533 + I*1486/3, + 613 + I*110/3, Rational(5013, 5) + I*1249/3, + 675 + 22*I, 891 + I*751/3, + 771 + 10*I, Rational(3736, 5) + 105*I] + + assert convolution_subset(a, c) == convolution_subset(c, a) + assert convolution_subset(a[:2], b) == \ + [64, Rational(533, 3), 55, Rational(416, 3), 33, 84, 15, 25] + + assert convolution_subset(a[:2], c) == \ + [3 + I*2/3, 10 + I*73/9, 7, Rational(196, 15), 9, 15, 0, 0] + + u, v, w, x, y, z = symbols('u v w x y z') + + assert convolution_subset([u, v, w], [x, y]) == [u*x, u*y + v*x, w*x, w*y] + assert convolution_subset([u, v, w, x], [y, z]) == \ + [u*y, u*z + v*y, w*y, w*z + x*y] + + assert convolution_subset([u, v], [x, y, z]) == \ + convolution_subset([x, y, z], [u, v]) + + raises(TypeError, lambda: convolution_subset(x, z)) + raises(TypeError, lambda: convolution_subset(Rational(7, 3), u)) + + +def test_covering_product(): + assert covering_product([], []) == [] + assert covering_product([], [Rational(1, 3)]) == [] + assert covering_product([6 + I*3/7], [Rational(2, 3)]) == [4 + I*2/7] + + a = [1, Rational(5, 8), sqrt(7), 4 + 9*I] + b = [66, 81, 95, 49, 37, 89, 17] + c = [3 + I*2/3, 51 + 72*I, 7, Rational(7, 15), 91] + + assert covering_product(a, b) == [66, Rational(1383, 8), 95 + 161*sqrt(7), + 130*sqrt(7) + 1303 + 2619*I, 37, + Rational(671, 4), 17 + 54*sqrt(7), + 89*sqrt(7) + Rational(4661, 8) + 1287*I] + + assert covering_product(b, c) == [198 + 44*I, 7740 + 10638*I, + 1412 + I*190/3, Rational(42684, 5) + I*31202/3, + 9484 + I*74/3, 22163 + I*27394/3, + 10621 + I*34/3, Rational(90236, 15) + 1224*I] + + assert covering_product(a, c) == covering_product(c, a) + assert covering_product(b, c[:-1]) == [198 + 44*I, 7740 + 10638*I, + 1412 + I*190/3, Rational(42684, 5) + I*31202/3, + 111 + I*74/3, 6693 + I*27394/3, + 429 + I*34/3, Rational(23351, 15) + 1224*I] + + assert covering_product(a, c[:-1]) == [3 + I*2/3, + Rational(339, 4) + I*1409/12, 7 + 10*sqrt(7) + 2*sqrt(7)*I/3, + -403 + 772*sqrt(7)/15 + 72*sqrt(7)*I + I*12658/15] + + u, v, w, x, y, z = symbols('u v w x y z') + + assert covering_product([u, v, w], [x, y]) == \ + [u*x, u*y + v*x + v*y, w*x, w*y] + + assert covering_product([u, v, w, x], [y, z]) == \ + [u*y, u*z + v*y + v*z, w*y, w*z + x*y + x*z] + + assert covering_product([u, v], [x, y, z]) == \ + covering_product([x, y, z], [u, v]) + + raises(TypeError, lambda: covering_product(x, z)) + raises(TypeError, lambda: covering_product(Rational(7, 3), u)) + + +def test_intersecting_product(): + assert intersecting_product([], []) == [] + assert intersecting_product([], [Rational(1, 3)]) == [] + assert intersecting_product([6 + I*3/7], [Rational(2, 3)]) == [4 + I*2/7] + + a = [1, sqrt(5), Rational(3, 8) + 5*I, 4 + 7*I] + b = [67, 51, 65, 48, 36, 79, 27] + c = [3 + I*2/5, 5 + 9*I, 7, Rational(7, 19), 13] + + assert intersecting_product(a, b) == [195*sqrt(5) + Rational(6979, 8) + 1886*I, + 178*sqrt(5) + 520 + 910*I, Rational(841, 2) + 1344*I, + 192 + 336*I, 0, 0, 0, 0] + + assert intersecting_product(b, c) == [Rational(128553, 19) + I*9521/5, + Rational(17820, 19) + 1602*I, Rational(19264, 19), Rational(336, 19), 1846, 0, 0, 0] + + assert intersecting_product(a, c) == intersecting_product(c, a) + assert intersecting_product(b[1:], c[:-1]) == [Rational(64788, 19) + I*8622/5, + Rational(12804, 19) + 1152*I, Rational(11508, 19), Rational(252, 19), 0, 0, 0, 0] + + assert intersecting_product(a, c[:-2]) == \ + [Rational(-99, 5) + 10*sqrt(5) + 2*sqrt(5)*I/5 + I*3021/40, + -43 + 5*sqrt(5) + 9*sqrt(5)*I + 71*I, Rational(245, 8) + 84*I, 0] + + u, v, w, x, y, z = symbols('u v w x y z') + + assert intersecting_product([u, v, w], [x, y]) == \ + [u*x + u*y + v*x + w*x + w*y, v*y, 0, 0] + + assert intersecting_product([u, v, w, x], [y, z]) == \ + [u*y + u*z + v*y + w*y + w*z + x*y, v*z + x*z, 0, 0] + + assert intersecting_product([u, v], [x, y, z]) == \ + intersecting_product([x, y, z], [u, v]) + + raises(TypeError, lambda: intersecting_product(x, z)) + raises(TypeError, lambda: intersecting_product(u, Rational(8, 3))) diff --git a/shared/package-files/9b/9ba3dbd2b159c35b0bad95c6b8c54bf2ba8da83afa007f930f298988ea22d915/blob b/shared/package-files/9b/9ba3dbd2b159c35b0bad95c6b8c54bf2ba8da83afa007f930f298988ea22d915/blob new file mode 100644 index 0000000000000000000000000000000000000000..efc40536d56beb94b5a3f72f36267bd15cc72702 --- /dev/null +++ b/shared/package-files/9b/9ba3dbd2b159c35b0bad95c6b8c54bf2ba8da83afa007f930f298988ea22d915/blob @@ -0,0 +1,3387 @@ +import array +from collections import ( + OrderedDict, + abc, + defaultdict, + namedtuple, +) +from collections.abc import Iterator +from dataclasses import make_dataclass +from datetime import ( + date, + datetime, + timedelta, +) +import functools +import re + +import numpy as np +from numpy import ma +from numpy.ma import mrecords +import pytest +import pytz + +from pandas._libs import lib +from pandas.compat.numpy import np_version_gt2 +from pandas.errors import IntCastingNaNError +import pandas.util._test_decorators as td + +from pandas.core.dtypes.common import is_integer_dtype +from pandas.core.dtypes.dtypes import ( + DatetimeTZDtype, + IntervalDtype, + NumpyEADtype, + PeriodDtype, +) + +import pandas as pd +from pandas import ( + Categorical, + CategoricalIndex, + DataFrame, + DatetimeIndex, + Index, + Interval, + MultiIndex, + Period, + RangeIndex, + Series, + Timedelta, + Timestamp, + cut, + date_range, + isna, +) +import pandas._testing as tm +from pandas.arrays import ( + DatetimeArray, + IntervalArray, + PeriodArray, + SparseArray, + TimedeltaArray, +) + +MIXED_FLOAT_DTYPES = ["float16", "float32", "float64"] +MIXED_INT_DTYPES = [ + "uint8", + "uint16", + "uint32", + "uint64", + "int8", + "int16", + "int32", + "int64", +] + + +class TestDataFrameConstructors: + def test_constructor_from_ndarray_with_str_dtype(self): + # If we don't ravel/reshape around ensure_str_array, we end up + # with an array of strings each of which is e.g. "[0 1 2]" + arr = np.arange(12).reshape(4, 3) + df = DataFrame(arr, dtype=str) + expected = DataFrame(arr.astype(str), dtype="str") + tm.assert_frame_equal(df, expected) + + def test_constructor_from_2d_datetimearray(self, using_array_manager): + dti = date_range("2016-01-01", periods=6, tz="US/Pacific") + dta = dti._data.reshape(3, 2) + + df = DataFrame(dta) + expected = DataFrame({0: dta[:, 0], 1: dta[:, 1]}) + tm.assert_frame_equal(df, expected) + if not using_array_manager: + # GH#44724 big performance hit if we de-consolidate + assert len(df._mgr.blocks) == 1 + + def test_constructor_dict_with_tzaware_scalar(self): + # GH#42505 + dt = Timestamp("2019-11-03 01:00:00-0700").tz_convert("America/Los_Angeles") + dt = dt.as_unit("ns") + + df = DataFrame({"dt": dt}, index=[0]) + expected = DataFrame({"dt": [dt]}) + tm.assert_frame_equal(df, expected) + + # Non-homogeneous + df = DataFrame({"dt": dt, "value": [1]}) + expected = DataFrame({"dt": [dt], "value": [1]}) + tm.assert_frame_equal(df, expected) + + def test_construct_ndarray_with_nas_and_int_dtype(self): + # GH#26919 match Series by not casting np.nan to meaningless int + arr = np.array([[1, np.nan], [2, 3]]) + msg = r"Cannot convert non-finite values \(NA or inf\) to integer" + with pytest.raises(IntCastingNaNError, match=msg): + DataFrame(arr, dtype="i8") + + # check this matches Series behavior + with pytest.raises(IntCastingNaNError, match=msg): + Series(arr[0], dtype="i8", name=0) + + def test_construct_from_list_of_datetimes(self): + df = DataFrame([datetime.now(), datetime.now()]) + assert df[0].dtype == np.dtype("M8[ns]") + + def test_constructor_from_tzaware_datetimeindex(self): + # don't cast a DatetimeIndex WITH a tz, leave as object + # GH#6032 + naive = DatetimeIndex(["2013-1-1 13:00", "2013-1-2 14:00"], name="B") + idx = naive.tz_localize("US/Pacific") + + expected = Series(np.array(idx.tolist(), dtype="object"), name="B") + assert expected.dtype == idx.dtype + + # convert index to series + result = Series(idx) + tm.assert_series_equal(result, expected) + + def test_columns_with_leading_underscore_work_with_to_dict(self): + col_underscore = "_b" + df = DataFrame({"a": [1, 2], col_underscore: [3, 4]}) + d = df.to_dict(orient="records") + + ref_d = [{"a": 1, col_underscore: 3}, {"a": 2, col_underscore: 4}] + + assert ref_d == d + + def test_columns_with_leading_number_and_underscore_work_with_to_dict(self): + col_with_num = "1_b" + df = DataFrame({"a": [1, 2], col_with_num: [3, 4]}) + d = df.to_dict(orient="records") + + ref_d = [{"a": 1, col_with_num: 3}, {"a": 2, col_with_num: 4}] + + assert ref_d == d + + def test_array_of_dt64_nat_with_td64dtype_raises(self, frame_or_series): + # GH#39462 + nat = np.datetime64("NaT", "ns") + arr = np.array([nat], dtype=object) + if frame_or_series is DataFrame: + arr = arr.reshape(1, 1) + + msg = "Invalid type for timedelta scalar: " + with pytest.raises(TypeError, match=msg): + frame_or_series(arr, dtype="m8[ns]") + + @pytest.mark.parametrize("kind", ["m", "M"]) + def test_datetimelike_values_with_object_dtype(self, kind, frame_or_series): + # with dtype=object, we should cast dt64 values to Timestamps, not pydatetimes + if kind == "M": + dtype = "M8[ns]" + scalar_type = Timestamp + else: + dtype = "m8[ns]" + scalar_type = Timedelta + + arr = np.arange(6, dtype="i8").view(dtype).reshape(3, 2) + if frame_or_series is Series: + arr = arr[:, 0] + + obj = frame_or_series(arr, dtype=object) + assert obj._mgr.arrays[0].dtype == object + assert isinstance(obj._mgr.arrays[0].ravel()[0], scalar_type) + + # go through a different path in internals.construction + obj = frame_or_series(frame_or_series(arr), dtype=object) + assert obj._mgr.arrays[0].dtype == object + assert isinstance(obj._mgr.arrays[0].ravel()[0], scalar_type) + + obj = frame_or_series(frame_or_series(arr), dtype=NumpyEADtype(object)) + assert obj._mgr.arrays[0].dtype == object + assert isinstance(obj._mgr.arrays[0].ravel()[0], scalar_type) + + if frame_or_series is DataFrame: + # other paths through internals.construction + sers = [Series(x) for x in arr] + obj = frame_or_series(sers, dtype=object) + assert obj._mgr.arrays[0].dtype == object + assert isinstance(obj._mgr.arrays[0].ravel()[0], scalar_type) + + def test_series_with_name_not_matching_column(self): + # GH#9232 + x = Series(range(5), name=1) + y = Series(range(5), name=0) + + result = DataFrame(x, columns=[0]) + expected = DataFrame([], columns=[0]) + tm.assert_frame_equal(result, expected) + + result = DataFrame(y, columns=[1]) + expected = DataFrame([], columns=[1]) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize( + "constructor", + [ + lambda: DataFrame(), + lambda: DataFrame(None), + lambda: DataFrame(()), + lambda: DataFrame([]), + lambda: DataFrame(_ for _ in []), + lambda: DataFrame(range(0)), + lambda: DataFrame(data=None), + lambda: DataFrame(data=()), + lambda: DataFrame(data=[]), + lambda: DataFrame(data=(_ for _ in [])), + lambda: DataFrame(data=range(0)), + ], + ) + def test_empty_constructor(self, constructor): + expected = DataFrame() + result = constructor() + assert len(result.index) == 0 + assert len(result.columns) == 0 + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize( + "constructor", + [ + lambda: DataFrame({}), + lambda: DataFrame(data={}), + ], + ) + def test_empty_constructor_object_index(self, constructor): + expected = DataFrame(index=RangeIndex(0), columns=RangeIndex(0)) + result = constructor() + assert len(result.index) == 0 + assert len(result.columns) == 0 + tm.assert_frame_equal(result, expected, check_index_type=True) + + @pytest.mark.parametrize( + "emptylike,expected_index,expected_columns", + [ + ([[]], RangeIndex(1), RangeIndex(0)), + ([[], []], RangeIndex(2), RangeIndex(0)), + ([(_ for _ in [])], RangeIndex(1), RangeIndex(0)), + ], + ) + def test_emptylike_constructor(self, emptylike, expected_index, expected_columns): + expected = DataFrame(index=expected_index, columns=expected_columns) + result = DataFrame(emptylike) + tm.assert_frame_equal(result, expected) + + def test_constructor_mixed(self, float_string_frame, using_infer_string): + dtype = "str" if using_infer_string else np.object_ + assert float_string_frame["foo"].dtype == dtype + + def test_constructor_cast_failure(self): + # as of 2.0, we raise if we can't respect "dtype", previously we + # silently ignored + msg = "could not convert string to float" + with pytest.raises(ValueError, match=msg): + DataFrame({"a": ["a", "b", "c"]}, dtype=np.float64) + + # GH 3010, constructing with odd arrays + df = DataFrame(np.ones((4, 2))) + + # this is ok + df["foo"] = np.ones((4, 2)).tolist() + + # this is not ok + msg = "Expected a 1D array, got an array with shape \\(4, 2\\)" + with pytest.raises(ValueError, match=msg): + df["test"] = np.ones((4, 2)) + + # this is ok + df["foo2"] = np.ones((4, 2)).tolist() + + def test_constructor_dtype_copy(self): + orig_df = DataFrame({"col1": [1.0], "col2": [2.0], "col3": [3.0]}) + + new_df = DataFrame(orig_df, dtype=float, copy=True) + + new_df["col1"] = 200.0 + assert orig_df["col1"][0] == 1.0 + + def test_constructor_dtype_nocast_view_dataframe( + self, using_copy_on_write, warn_copy_on_write + ): + df = DataFrame([[1, 2]]) + should_be_view = DataFrame(df, dtype=df[0].dtype) + if using_copy_on_write: + should_be_view.iloc[0, 0] = 99 + assert df.values[0, 0] == 1 + else: + with tm.assert_cow_warning(warn_copy_on_write): + should_be_view.iloc[0, 0] = 99 + assert df.values[0, 0] == 99 + + def test_constructor_dtype_nocast_view_2d_array( + self, using_array_manager, using_copy_on_write, warn_copy_on_write + ): + df = DataFrame([[1, 2], [3, 4]], dtype="int64") + if not using_array_manager and not using_copy_on_write: + should_be_view = DataFrame(df.values, dtype=df[0].dtype) + # TODO(CoW-warn) this should warn + # with tm.assert_cow_warning(warn_copy_on_write): + should_be_view.iloc[0, 0] = 97 + assert df.values[0, 0] == 97 + else: + # INFO(ArrayManager) DataFrame(ndarray) doesn't necessarily preserve + # a view on the array to ensure contiguous 1D arrays + df2 = DataFrame(df.values, dtype=df[0].dtype) + assert df2._mgr.arrays[0].flags.c_contiguous + + @td.skip_array_manager_invalid_test + def test_1d_object_array_does_not_copy(self, using_infer_string): + # https://github.com/pandas-dev/pandas/issues/39272 + arr = np.array(["a", "b"], dtype="object") + df = DataFrame(arr, copy=False) + if using_infer_string: + if df[0].dtype.storage == "pyarrow": + # object dtype strings are converted to arrow memory, + # no numpy arrays to compare + pass + else: + assert np.shares_memory(df[0].to_numpy(), arr) + else: + assert np.shares_memory(df.values, arr) + + df = DataFrame(arr, dtype=object, copy=False) + assert np.shares_memory(df.values, arr) + + @td.skip_array_manager_invalid_test + def test_2d_object_array_does_not_copy(self, using_infer_string): + # https://github.com/pandas-dev/pandas/issues/39272 + arr = np.array([["a", "b"], ["c", "d"]], dtype="object") + df = DataFrame(arr, copy=False) + if using_infer_string: + if df[0].dtype.storage == "pyarrow": + # object dtype strings are converted to arrow memory, + # no numpy arrays to compare + pass + else: + assert np.shares_memory(df[0].to_numpy(), arr) + else: + assert np.shares_memory(df.values, arr) + + df = DataFrame(arr, dtype=object, copy=False) + assert np.shares_memory(df.values, arr) + + def test_constructor_dtype_list_data(self): + df = DataFrame([[1, "2"], [None, "a"]], dtype=object) + assert df.loc[1, 0] is None + assert df.loc[0, 1] == "2" + + def test_constructor_list_of_2d_raises(self): + # https://github.com/pandas-dev/pandas/issues/32289 + a = DataFrame() + b = np.empty((0, 0)) + with pytest.raises(ValueError, match=r"shape=\(1, 0, 0\)"): + DataFrame([a]) + + with pytest.raises(ValueError, match=r"shape=\(1, 0, 0\)"): + DataFrame([b]) + + a = DataFrame({"A": [1, 2]}) + with pytest.raises(ValueError, match=r"shape=\(2, 2, 1\)"): + DataFrame([a, a]) + + @pytest.mark.parametrize( + "typ, ad", + [ + # mixed floating and integer coexist in the same frame + ["float", {}], + # add lots of types + ["float", {"A": 1, "B": "foo", "C": "bar"}], + # GH 622 + ["int", {}], + ], + ) + def test_constructor_mixed_dtypes(self, typ, ad): + if typ == "int": + dtypes = MIXED_INT_DTYPES + arrays = [ + np.array(np.random.default_rng(2).random(10), dtype=d) for d in dtypes + ] + elif typ == "float": + dtypes = MIXED_FLOAT_DTYPES + arrays = [ + np.array(np.random.default_rng(2).integers(10, size=10), dtype=d) + for d in dtypes + ] + + for d, a in zip(dtypes, arrays): + assert a.dtype == d + ad.update(dict(zip(dtypes, arrays))) + df = DataFrame(ad) + + dtypes = MIXED_FLOAT_DTYPES + MIXED_INT_DTYPES + for d in dtypes: + if d in df: + assert df.dtypes[d] == d + + def test_constructor_complex_dtypes(self): + # GH10952 + a = np.random.default_rng(2).random(10).astype(np.complex64) + b = np.random.default_rng(2).random(10).astype(np.complex128) + + df = DataFrame({"a": a, "b": b}) + assert a.dtype == df.a.dtype + assert b.dtype == df.b.dtype + + def test_constructor_dtype_str_na_values(self, string_dtype): + # https://github.com/pandas-dev/pandas/issues/21083 + df = DataFrame({"A": ["x", None]}, dtype=string_dtype) + result = df.isna() + expected = DataFrame({"A": [False, True]}) + tm.assert_frame_equal(result, expected) + assert df.iloc[1, 0] is None + + df = DataFrame({"A": ["x", np.nan]}, dtype=string_dtype) + assert np.isnan(df.iloc[1, 0]) + + def test_constructor_rec(self, float_frame): + rec = float_frame.to_records(index=False) + rec.dtype.names = list(rec.dtype.names)[::-1] + + index = float_frame.index + + df = DataFrame(rec) + tm.assert_index_equal(df.columns, Index(rec.dtype.names)) + + df2 = DataFrame(rec, index=index) + tm.assert_index_equal(df2.columns, Index(rec.dtype.names)) + tm.assert_index_equal(df2.index, index) + + # case with columns != the ones we would infer from the data + rng = np.arange(len(rec))[::-1] + df3 = DataFrame(rec, index=rng, columns=["C", "B"]) + expected = DataFrame(rec, index=rng).reindex(columns=["C", "B"]) + tm.assert_frame_equal(df3, expected) + + def test_constructor_bool(self): + df = DataFrame({0: np.ones(10, dtype=bool), 1: np.zeros(10, dtype=bool)}) + assert df.values.dtype == np.bool_ + + def test_constructor_overflow_int64(self): + # see gh-14881 + values = np.array([2**64 - i for i in range(1, 10)], dtype=np.uint64) + + result = DataFrame({"a": values}) + assert result["a"].dtype == np.uint64 + + # see gh-2355 + data_scores = [ + (6311132704823138710, 273), + (2685045978526272070, 23), + (8921811264899370420, 45), + (17019687244989530680, 270), + (9930107427299601010, 273), + ] + dtype = [("uid", "u8"), ("score", "u8")] + data = np.zeros((len(data_scores),), dtype=dtype) + data[:] = data_scores + df_crawls = DataFrame(data) + assert df_crawls["uid"].dtype == np.uint64 + + @pytest.mark.parametrize( + "values", + [ + np.array([2**64], dtype=object), + np.array([2**65]), + [2**64 + 1], + np.array([-(2**63) - 4], dtype=object), + np.array([-(2**64) - 1]), + [-(2**65) - 2], + ], + ) + def test_constructor_int_overflow(self, values): + # see gh-18584 + value = values[0] + result = DataFrame(values) + + assert result[0].dtype == object + assert result[0][0] == value + + @pytest.mark.parametrize( + "values", + [ + np.array([1], dtype=np.uint16), + np.array([1], dtype=np.uint32), + np.array([1], dtype=np.uint64), + [np.uint16(1)], + [np.uint32(1)], + [np.uint64(1)], + ], + ) + def test_constructor_numpy_uints(self, values): + # GH#47294 + value = values[0] + result = DataFrame(values) + + assert result[0].dtype == value.dtype + assert result[0][0] == value + + def test_constructor_ordereddict(self): + nitems = 100 + nums = list(range(nitems)) + np.random.default_rng(2).shuffle(nums) + expected = [f"A{i:d}" for i in nums] + df = DataFrame(OrderedDict(zip(expected, [[0]] * nitems))) + assert expected == list(df.columns) + + def test_constructor_dict(self): + datetime_series = Series( + np.arange(30, dtype=np.float64), index=date_range("2020-01-01", periods=30) + ) + # test expects index shifted by 5 + datetime_series_short = datetime_series[5:] + + frame = DataFrame({"col1": datetime_series, "col2": datetime_series_short}) + + # col2 is padded with NaN + assert len(datetime_series) == 30 + assert len(datetime_series_short) == 25 + + tm.assert_series_equal(frame["col1"], datetime_series.rename("col1")) + + exp = Series( + np.concatenate([[np.nan] * 5, datetime_series_short.values]), + index=datetime_series.index, + name="col2", + ) + tm.assert_series_equal(exp, frame["col2"]) + + frame = DataFrame( + {"col1": datetime_series, "col2": datetime_series_short}, + columns=["col2", "col3", "col4"], + ) + + assert len(frame) == len(datetime_series_short) + assert "col1" not in frame + assert isna(frame["col3"]).all() + + # Corner cases + assert len(DataFrame()) == 0 + + # mix dict and array, wrong size - no spec for which error should raise + # first + msg = "Mixing dicts with non-Series may lead to ambiguous ordering." + with pytest.raises(ValueError, match=msg): + DataFrame({"A": {"a": "a", "b": "b"}, "B": ["a", "b", "c"]}) + + def test_constructor_dict_length1(self): + # Length-one dict micro-optimization + frame = DataFrame({"A": {"1": 1, "2": 2}}) + tm.assert_index_equal(frame.index, Index(["1", "2"])) + + def test_constructor_dict_with_index(self): + # empty dict plus index + idx = Index([0, 1, 2]) + frame = DataFrame({}, index=idx) + assert frame.index is idx + + def test_constructor_dict_with_index_and_columns(self): + # empty dict with index and columns + idx = Index([0, 1, 2]) + frame = DataFrame({}, index=idx, columns=idx) + assert frame.index is idx + assert frame.columns is idx + assert len(frame._series) == 3 + + def test_constructor_dict_of_empty_lists(self): + # with dict of empty list and Series + frame = DataFrame({"A": [], "B": []}, columns=["A", "B"]) + tm.assert_index_equal(frame.index, RangeIndex(0), exact=True) + + def test_constructor_dict_with_none(self): + # GH 14381 + # Dict with None value + frame_none = DataFrame({"a": None}, index=[0]) + frame_none_list = DataFrame({"a": [None]}, index=[0]) + assert frame_none._get_value(0, "a") is None + assert frame_none_list._get_value(0, "a") is None + tm.assert_frame_equal(frame_none, frame_none_list) + + def test_constructor_dict_errors(self): + # GH10856 + # dict with scalar values should raise error, even if columns passed + msg = "If using all scalar values, you must pass an index" + with pytest.raises(ValueError, match=msg): + DataFrame({"a": 0.7}) + + with pytest.raises(ValueError, match=msg): + DataFrame({"a": 0.7}, columns=["a"]) + + @pytest.mark.parametrize("scalar", [2, np.nan, None, "D"]) + def test_constructor_invalid_items_unused(self, scalar): + # No error if invalid (scalar) value is in fact not used: + result = DataFrame({"a": scalar}, columns=["b"]) + expected = DataFrame(columns=["b"]) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize("value", [2, np.nan, None, float("nan")]) + def test_constructor_dict_nan_key(self, value): + # GH 18455 + cols = [1, value, 3] + idx = ["a", value] + values = [[0, 3], [1, 4], [2, 5]] + data = {cols[c]: Series(values[c], index=idx) for c in range(3)} + result = DataFrame(data).sort_values(1).sort_values("a", axis=1) + expected = DataFrame( + np.arange(6, dtype="int64").reshape(2, 3), index=idx, columns=cols + ) + tm.assert_frame_equal(result, expected) + + result = DataFrame(data, index=idx).sort_values("a", axis=1) + tm.assert_frame_equal(result, expected) + + result = DataFrame(data, index=idx, columns=cols) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize("value", [np.nan, None, float("nan")]) + def test_constructor_dict_nan_tuple_key(self, value): + # GH 18455 + cols = Index([(11, 21), (value, 22), (13, value)]) + idx = Index([("a", value), (value, 2)]) + values = [[0, 3], [1, 4], [2, 5]] + data = {cols[c]: Series(values[c], index=idx) for c in range(3)} + result = DataFrame(data).sort_values((11, 21)).sort_values(("a", value), axis=1) + expected = DataFrame( + np.arange(6, dtype="int64").reshape(2, 3), index=idx, columns=cols + ) + tm.assert_frame_equal(result, expected) + + result = DataFrame(data, index=idx).sort_values(("a", value), axis=1) + tm.assert_frame_equal(result, expected) + + result = DataFrame(data, index=idx, columns=cols) + tm.assert_frame_equal(result, expected) + + def test_constructor_dict_order_insertion(self): + datetime_series = Series( + np.arange(10, dtype=np.float64), index=date_range("2020-01-01", periods=10) + ) + datetime_series_short = datetime_series[:5] + + # GH19018 + # initialization ordering: by insertion order if python>= 3.6 + d = {"b": datetime_series_short, "a": datetime_series} + frame = DataFrame(data=d) + expected = DataFrame(data=d, columns=list("ba")) + tm.assert_frame_equal(frame, expected) + + def test_constructor_dict_nan_key_and_columns(self): + # GH 16894 + result = DataFrame({np.nan: [1, 2], 2: [2, 3]}, columns=[np.nan, 2]) + expected = DataFrame([[1, 2], [2, 3]], columns=[np.nan, 2]) + tm.assert_frame_equal(result, expected) + + def test_constructor_multi_index(self): + # GH 4078 + # construction error with mi and all-nan frame + tuples = [(2, 3), (3, 3), (3, 3)] + mi = MultiIndex.from_tuples(tuples) + df = DataFrame(index=mi, columns=mi) + assert isna(df).values.ravel().all() + + tuples = [(3, 3), (2, 3), (3, 3)] + mi = MultiIndex.from_tuples(tuples) + df = DataFrame(index=mi, columns=mi) + assert isna(df).values.ravel().all() + + def test_constructor_2d_index(self): + # GH 25416 + # handling of 2d index in construction + df = DataFrame([[1]], columns=[[1]], index=[1, 2]) + expected = DataFrame( + [1, 1], + index=Index([1, 2], dtype="int64"), + columns=MultiIndex(levels=[[1]], codes=[[0]]), + ) + tm.assert_frame_equal(df, expected) + + df = DataFrame([[1]], columns=[[1]], index=[[1, 2]]) + expected = DataFrame( + [1, 1], + index=MultiIndex(levels=[[1, 2]], codes=[[0, 1]]), + columns=MultiIndex(levels=[[1]], codes=[[0]]), + ) + tm.assert_frame_equal(df, expected) + + def test_constructor_error_msgs(self): + msg = "Empty data passed with indices specified." + # passing an empty array with columns specified. + with pytest.raises(ValueError, match=msg): + DataFrame(np.empty(0), index=[1]) + + msg = "Mixing dicts with non-Series may lead to ambiguous ordering." + # mix dict and array, wrong size + with pytest.raises(ValueError, match=msg): + DataFrame({"A": {"a": "a", "b": "b"}, "B": ["a", "b", "c"]}) + + # wrong size ndarray, GH 3105 + msg = r"Shape of passed values is \(4, 3\), indices imply \(3, 3\)" + with pytest.raises(ValueError, match=msg): + DataFrame( + np.arange(12).reshape((4, 3)), + columns=["foo", "bar", "baz"], + index=date_range("2000-01-01", periods=3), + ) + + arr = np.array([[4, 5, 6]]) + msg = r"Shape of passed values is \(1, 3\), indices imply \(1, 4\)" + with pytest.raises(ValueError, match=msg): + DataFrame(index=[0], columns=range(4), data=arr) + + arr = np.array([4, 5, 6]) + msg = r"Shape of passed values is \(3, 1\), indices imply \(1, 4\)" + with pytest.raises(ValueError, match=msg): + DataFrame(index=[0], columns=range(4), data=arr) + + # higher dim raise exception + with pytest.raises(ValueError, match="Must pass 2-d input"): + DataFrame(np.zeros((3, 3, 3)), columns=["A", "B", "C"], index=[1]) + + # wrong size axis labels + msg = r"Shape of passed values is \(2, 3\), indices imply \(1, 3\)" + with pytest.raises(ValueError, match=msg): + DataFrame( + np.random.default_rng(2).random((2, 3)), + columns=["A", "B", "C"], + index=[1], + ) + + msg = r"Shape of passed values is \(2, 3\), indices imply \(2, 2\)" + with pytest.raises(ValueError, match=msg): + DataFrame( + np.random.default_rng(2).random((2, 3)), + columns=["A", "B"], + index=[1, 2], + ) + + # gh-26429 + msg = "2 columns passed, passed data had 10 columns" + with pytest.raises(ValueError, match=msg): + DataFrame((range(10), range(10, 20)), columns=("ones", "twos")) + + msg = "If using all scalar values, you must pass an index" + with pytest.raises(ValueError, match=msg): + DataFrame({"a": False, "b": True}) + + def test_constructor_subclass_dict(self, dict_subclass): + # Test for passing dict subclass to constructor + data = { + "col1": dict_subclass((x, 10.0 * x) for x in range(10)), + "col2": dict_subclass((x, 20.0 * x) for x in range(10)), + } + df = DataFrame(data) + refdf = DataFrame({col: dict(val.items()) for col, val in data.items()}) + tm.assert_frame_equal(refdf, df) + + data = dict_subclass(data.items()) + df = DataFrame(data) + tm.assert_frame_equal(refdf, df) + + def test_constructor_defaultdict(self, float_frame): + # try with defaultdict + data = {} + float_frame.loc[: float_frame.index[10], "B"] = np.nan + + for k, v in float_frame.items(): + dct = defaultdict(dict) + dct.update(v.to_dict()) + data[k] = dct + frame = DataFrame(data) + expected = frame.reindex(index=float_frame.index) + tm.assert_frame_equal(float_frame, expected) + + def test_constructor_dict_block(self): + expected = np.array([[4.0, 3.0, 2.0, 1.0]]) + df = DataFrame( + {"d": [4.0], "c": [3.0], "b": [2.0], "a": [1.0]}, + columns=["d", "c", "b", "a"], + ) + tm.assert_numpy_array_equal(df.values, expected) + + def test_constructor_dict_cast(self, using_infer_string): + # cast float tests + test_data = {"A": {"1": 1, "2": 2}, "B": {"1": "1", "2": "2", "3": "3"}} + frame = DataFrame(test_data, dtype=float) + assert len(frame) == 3 + assert frame["B"].dtype == np.float64 + assert frame["A"].dtype == np.float64 + + frame = DataFrame(test_data) + assert len(frame) == 3 + assert frame["B"].dtype == np.object_ if not using_infer_string else "str" + assert frame["A"].dtype == np.float64 + + def test_constructor_dict_cast2(self): + # can't cast to float + test_data = { + "A": dict(zip(range(20), [f"word_{i}" for i in range(20)])), + "B": dict(zip(range(15), np.random.default_rng(2).standard_normal(15))), + } + with pytest.raises(ValueError, match="could not convert string"): + DataFrame(test_data, dtype=float) + + def test_constructor_dict_dont_upcast(self): + d = {"Col1": {"Row1": "A String", "Row2": np.nan}} + df = DataFrame(d) + assert isinstance(df["Col1"]["Row2"], float) + + def test_constructor_dict_dont_upcast2(self): + dm = DataFrame([[1, 2], ["a", "b"]], index=[1, 2], columns=[1, 2]) + assert isinstance(dm[1][1], int) + + def test_constructor_dict_of_tuples(self): + # GH #1491 + data = {"a": (1, 2, 3), "b": (4, 5, 6)} + + result = DataFrame(data) + expected = DataFrame({k: list(v) for k, v in data.items()}) + tm.assert_frame_equal(result, expected, check_dtype=False) + + def test_constructor_dict_of_ranges(self): + # GH 26356 + data = {"a": range(3), "b": range(3, 6)} + + result = DataFrame(data) + expected = DataFrame({"a": [0, 1, 2], "b": [3, 4, 5]}) + tm.assert_frame_equal(result, expected) + + def test_constructor_dict_of_iterators(self): + # GH 26349 + data = {"a": iter(range(3)), "b": reversed(range(3))} + + result = DataFrame(data) + expected = DataFrame({"a": [0, 1, 2], "b": [2, 1, 0]}) + tm.assert_frame_equal(result, expected) + + def test_constructor_dict_of_generators(self): + # GH 26349 + data = {"a": (i for i in (range(3))), "b": (i for i in reversed(range(3)))} + result = DataFrame(data) + expected = DataFrame({"a": [0, 1, 2], "b": [2, 1, 0]}) + tm.assert_frame_equal(result, expected) + + def test_constructor_dict_multiindex(self): + d = { + ("a", "a"): {("i", "i"): 0, ("i", "j"): 1, ("j", "i"): 2}, + ("b", "a"): {("i", "i"): 6, ("i", "j"): 5, ("j", "i"): 4}, + ("b", "c"): {("i", "i"): 7, ("i", "j"): 8, ("j", "i"): 9}, + } + _d = sorted(d.items()) + df = DataFrame(d) + expected = DataFrame( + [x[1] for x in _d], index=MultiIndex.from_tuples([x[0] for x in _d]) + ).T + expected.index = MultiIndex.from_tuples(expected.index) + tm.assert_frame_equal( + df, + expected, + ) + + d["z"] = {"y": 123.0, ("i", "i"): 111, ("i", "j"): 111, ("j", "i"): 111} + _d.insert(0, ("z", d["z"])) + expected = DataFrame( + [x[1] for x in _d], index=Index([x[0] for x in _d], tupleize_cols=False) + ).T + expected.index = Index(expected.index, tupleize_cols=False) + df = DataFrame(d) + df = df.reindex(columns=expected.columns, index=expected.index) + tm.assert_frame_equal(df, expected) + + def test_constructor_dict_datetime64_index(self): + # GH 10160 + dates_as_str = ["1984-02-19", "1988-11-06", "1989-12-03", "1990-03-15"] + + def create_data(constructor): + return {i: {constructor(s): 2 * i} for i, s in enumerate(dates_as_str)} + + data_datetime64 = create_data(np.datetime64) + data_datetime = create_data(lambda x: datetime.strptime(x, "%Y-%m-%d")) + data_Timestamp = create_data(Timestamp) + + expected = DataFrame( + [ + {0: 0, 1: None, 2: None, 3: None}, + {0: None, 1: 2, 2: None, 3: None}, + {0: None, 1: None, 2: 4, 3: None}, + {0: None, 1: None, 2: None, 3: 6}, + ], + index=[Timestamp(dt) for dt in dates_as_str], + ) + + result_datetime64 = DataFrame(data_datetime64) + result_datetime = DataFrame(data_datetime) + result_Timestamp = DataFrame(data_Timestamp) + tm.assert_frame_equal(result_datetime64, expected) + tm.assert_frame_equal(result_datetime, expected) + tm.assert_frame_equal(result_Timestamp, expected) + + @pytest.mark.parametrize( + "klass,name", + [ + (lambda x: np.timedelta64(x, "D"), "timedelta64"), + (lambda x: timedelta(days=x), "pytimedelta"), + (lambda x: Timedelta(x, "D"), "Timedelta[ns]"), + (lambda x: Timedelta(x, "D").as_unit("s"), "Timedelta[s]"), + ], + ) + def test_constructor_dict_timedelta64_index(self, klass, name): + # GH 10160 + td_as_int = [1, 2, 3, 4] + + data = {i: {klass(s): 2 * i} for i, s in enumerate(td_as_int)} + + expected = DataFrame( + [ + {0: 0, 1: None, 2: None, 3: None}, + {0: None, 1: 2, 2: None, 3: None}, + {0: None, 1: None, 2: 4, 3: None}, + {0: None, 1: None, 2: None, 3: 6}, + ], + index=[Timedelta(td, "D") for td in td_as_int], + ) + + result = DataFrame(data) + + tm.assert_frame_equal(result, expected) + + def test_constructor_period_dict(self): + # PeriodIndex + a = pd.PeriodIndex(["2012-01", "NaT", "2012-04"], freq="M") + b = pd.PeriodIndex(["2012-02-01", "2012-03-01", "NaT"], freq="D") + df = DataFrame({"a": a, "b": b}) + assert df["a"].dtype == a.dtype + assert df["b"].dtype == b.dtype + + # list of periods + df = DataFrame({"a": a.astype(object).tolist(), "b": b.astype(object).tolist()}) + assert df["a"].dtype == a.dtype + assert df["b"].dtype == b.dtype + + def test_constructor_dict_extension_scalar(self, ea_scalar_and_dtype): + ea_scalar, ea_dtype = ea_scalar_and_dtype + df = DataFrame({"a": ea_scalar}, index=[0]) + assert df["a"].dtype == ea_dtype + + expected = DataFrame(index=[0], columns=["a"], data=ea_scalar) + + tm.assert_frame_equal(df, expected) + + @pytest.mark.parametrize( + "data,dtype", + [ + (Period("2020-01"), PeriodDtype("M")), + (Interval(left=0, right=5), IntervalDtype("int64", "right")), + ( + Timestamp("2011-01-01", tz="US/Eastern"), + DatetimeTZDtype(unit="s", tz="US/Eastern"), + ), + ], + ) + def test_constructor_extension_scalar_data(self, data, dtype): + # GH 34832 + df = DataFrame(index=[0, 1], columns=["a", "b"], data=data) + + assert df["a"].dtype == dtype + assert df["b"].dtype == dtype + + arr = pd.array([data] * 2, dtype=dtype) + expected = DataFrame({"a": arr, "b": arr}) + + tm.assert_frame_equal(df, expected) + + def test_nested_dict_frame_constructor(self): + rng = pd.period_range("1/1/2000", periods=5) + df = DataFrame(np.random.default_rng(2).standard_normal((10, 5)), columns=rng) + + data = {} + for col in df.columns: + for row in df.index: + data.setdefault(col, {})[row] = df._get_value(row, col) + + result = DataFrame(data, columns=rng) + tm.assert_frame_equal(result, df) + + data = {} + for col in df.columns: + for row in df.index: + data.setdefault(row, {})[col] = df._get_value(row, col) + + result = DataFrame(data, index=rng).T + tm.assert_frame_equal(result, df) + + def _check_basic_constructor(self, empty): + # mat: 2d matrix with shape (3, 2) to input. empty - makes sized + # objects + mat = empty((2, 3), dtype=float) + # 2-D input + frame = DataFrame(mat, columns=["A", "B", "C"], index=[1, 2]) + + assert len(frame.index) == 2 + assert len(frame.columns) == 3 + + # 1-D input + frame = DataFrame(empty((3,)), columns=["A"], index=[1, 2, 3]) + assert len(frame.index) == 3 + assert len(frame.columns) == 1 + + if empty is not np.ones: + msg = r"Cannot convert non-finite values \(NA or inf\) to integer" + with pytest.raises(IntCastingNaNError, match=msg): + DataFrame(mat, columns=["A", "B", "C"], index=[1, 2], dtype=np.int64) + return + else: + frame = DataFrame( + mat, columns=["A", "B", "C"], index=[1, 2], dtype=np.int64 + ) + assert frame.values.dtype == np.int64 + + # wrong size axis labels + msg = r"Shape of passed values is \(2, 3\), indices imply \(1, 3\)" + with pytest.raises(ValueError, match=msg): + DataFrame(mat, columns=["A", "B", "C"], index=[1]) + msg = r"Shape of passed values is \(2, 3\), indices imply \(2, 2\)" + with pytest.raises(ValueError, match=msg): + DataFrame(mat, columns=["A", "B"], index=[1, 2]) + + # higher dim raise exception + with pytest.raises(ValueError, match="Must pass 2-d input"): + DataFrame(empty((3, 3, 3)), columns=["A", "B", "C"], index=[1]) + + # automatic labeling + frame = DataFrame(mat) + tm.assert_index_equal(frame.index, Index(range(2)), exact=True) + tm.assert_index_equal(frame.columns, Index(range(3)), exact=True) + + frame = DataFrame(mat, index=[1, 2]) + tm.assert_index_equal(frame.columns, Index(range(3)), exact=True) + + frame = DataFrame(mat, columns=["A", "B", "C"]) + tm.assert_index_equal(frame.index, Index(range(2)), exact=True) + + # 0-length axis + frame = DataFrame(empty((0, 3))) + assert len(frame.index) == 0 + + frame = DataFrame(empty((3, 0))) + assert len(frame.columns) == 0 + + def test_constructor_ndarray(self): + self._check_basic_constructor(np.ones) + + frame = DataFrame(["foo", "bar"], index=[0, 1], columns=["A"]) + assert len(frame) == 2 + + def test_constructor_maskedarray(self): + self._check_basic_constructor(ma.masked_all) + + # Check non-masked values + mat = ma.masked_all((2, 3), dtype=float) + mat[0, 0] = 1.0 + mat[1, 2] = 2.0 + frame = DataFrame(mat, columns=["A", "B", "C"], index=[1, 2]) + assert 1.0 == frame["A"][1] + assert 2.0 == frame["C"][2] + + # what is this even checking?? + mat = ma.masked_all((2, 3), dtype=float) + frame = DataFrame(mat, columns=["A", "B", "C"], index=[1, 2]) + assert np.all(~np.asarray(frame == frame)) + + @pytest.mark.filterwarnings( + "ignore:elementwise comparison failed:DeprecationWarning" + ) + def test_constructor_maskedarray_nonfloat(self): + # masked int promoted to float + mat = ma.masked_all((2, 3), dtype=int) + # 2-D input + frame = DataFrame(mat, columns=["A", "B", "C"], index=[1, 2]) + + assert len(frame.index) == 2 + assert len(frame.columns) == 3 + assert np.all(~np.asarray(frame == frame)) + + # cast type + frame = DataFrame(mat, columns=["A", "B", "C"], index=[1, 2], dtype=np.float64) + assert frame.values.dtype == np.float64 + + # Check non-masked values + mat2 = ma.copy(mat) + mat2[0, 0] = 1 + mat2[1, 2] = 2 + frame = DataFrame(mat2, columns=["A", "B", "C"], index=[1, 2]) + assert 1 == frame["A"][1] + assert 2 == frame["C"][2] + + # masked np.datetime64 stays (use NaT as null) + mat = ma.masked_all((2, 3), dtype="M8[ns]") + # 2-D input + frame = DataFrame(mat, columns=["A", "B", "C"], index=[1, 2]) + + assert len(frame.index) == 2 + assert len(frame.columns) == 3 + assert isna(frame).values.all() + + # cast type + msg = r"datetime64\[ns\] values and dtype=int64 is not supported" + with pytest.raises(TypeError, match=msg): + DataFrame(mat, columns=["A", "B", "C"], index=[1, 2], dtype=np.int64) + + # Check non-masked values + mat2 = ma.copy(mat) + mat2[0, 0] = 1 + mat2[1, 2] = 2 + frame = DataFrame(mat2, columns=["A", "B", "C"], index=[1, 2]) + assert 1 == frame["A"].astype("i8")[1] + assert 2 == frame["C"].astype("i8")[2] + + # masked bool promoted to object + mat = ma.masked_all((2, 3), dtype=bool) + # 2-D input + frame = DataFrame(mat, columns=["A", "B", "C"], index=[1, 2]) + + assert len(frame.index) == 2 + assert len(frame.columns) == 3 + assert np.all(~np.asarray(frame == frame)) + + # cast type + frame = DataFrame(mat, columns=["A", "B", "C"], index=[1, 2], dtype=object) + assert frame.values.dtype == object + + # Check non-masked values + mat2 = ma.copy(mat) + mat2[0, 0] = True + mat2[1, 2] = False + frame = DataFrame(mat2, columns=["A", "B", "C"], index=[1, 2]) + assert frame["A"][1] is True + assert frame["C"][2] is False + + def test_constructor_maskedarray_hardened(self): + # Check numpy masked arrays with hard masks -- from GH24574 + mat_hard = ma.masked_all((2, 2), dtype=float).harden_mask() + result = DataFrame(mat_hard, columns=["A", "B"], index=[1, 2]) + expected = DataFrame( + {"A": [np.nan, np.nan], "B": [np.nan, np.nan]}, + columns=["A", "B"], + index=[1, 2], + dtype=float, + ) + tm.assert_frame_equal(result, expected) + # Check case where mask is hard but no data are masked + mat_hard = ma.ones((2, 2), dtype=float).harden_mask() + result = DataFrame(mat_hard, columns=["A", "B"], index=[1, 2]) + expected = DataFrame( + {"A": [1.0, 1.0], "B": [1.0, 1.0]}, + columns=["A", "B"], + index=[1, 2], + dtype=float, + ) + tm.assert_frame_equal(result, expected) + + def test_constructor_maskedrecarray_dtype(self): + # Ensure constructor honors dtype + data = np.ma.array( + np.ma.zeros(5, dtype=[("date", " None: + self._lst = lst + + def __getitem__(self, n): + return self._lst.__getitem__(n) + + def __len__(self) -> int: + return self._lst.__len__() + + lst_containers = [DummyContainer([1, "a"]), DummyContainer([2, "b"])] + columns = ["num", "str"] + result = DataFrame(lst_containers, columns=columns) + expected = DataFrame([[1, "a"], [2, "b"]], columns=columns) + tm.assert_frame_equal(result, expected, check_dtype=False) + + def test_constructor_stdlib_array(self): + # GH 4297 + # support Array + result = DataFrame({"A": array.array("i", range(10))}) + expected = DataFrame({"A": list(range(10))}) + tm.assert_frame_equal(result, expected, check_dtype=False) + + expected = DataFrame([list(range(10)), list(range(10))]) + result = DataFrame([array.array("i", range(10)), array.array("i", range(10))]) + tm.assert_frame_equal(result, expected, check_dtype=False) + + def test_constructor_range(self): + # GH26342 + result = DataFrame(range(10)) + expected = DataFrame(list(range(10))) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_of_ranges(self): + result = DataFrame([range(10), range(10)]) + expected = DataFrame([list(range(10)), list(range(10))]) + tm.assert_frame_equal(result, expected) + + def test_constructor_iterable(self): + # GH 21987 + class Iter: + def __iter__(self) -> Iterator: + for i in range(10): + yield [1, 2, 3] + + expected = DataFrame([[1, 2, 3]] * 10) + result = DataFrame(Iter()) + tm.assert_frame_equal(result, expected) + + def test_constructor_iterator(self): + result = DataFrame(iter(range(10))) + expected = DataFrame(list(range(10))) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_of_iterators(self): + result = DataFrame([iter(range(10)), iter(range(10))]) + expected = DataFrame([list(range(10)), list(range(10))]) + tm.assert_frame_equal(result, expected) + + def test_constructor_generator(self): + # related #2305 + + gen1 = (i for i in range(10)) + gen2 = (i for i in range(10)) + + expected = DataFrame([list(range(10)), list(range(10))]) + result = DataFrame([gen1, gen2]) + tm.assert_frame_equal(result, expected) + + gen = ([i, "a"] for i in range(10)) + result = DataFrame(gen) + expected = DataFrame({0: range(10), 1: "a"}) + tm.assert_frame_equal(result, expected, check_dtype=False) + + def test_constructor_list_of_dicts(self): + result = DataFrame([{}]) + expected = DataFrame(index=RangeIndex(1), columns=[]) + tm.assert_frame_equal(result, expected) + + def test_constructor_ordered_dict_nested_preserve_order(self): + # see gh-18166 + nested1 = OrderedDict([("b", 1), ("a", 2)]) + nested2 = OrderedDict([("b", 2), ("a", 5)]) + data = OrderedDict([("col2", nested1), ("col1", nested2)]) + result = DataFrame(data) + data = {"col2": [1, 2], "col1": [2, 5]} + expected = DataFrame(data=data, index=["b", "a"]) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize("dict_type", [dict, OrderedDict]) + def test_constructor_ordered_dict_preserve_order(self, dict_type): + # see gh-13304 + expected = DataFrame([[2, 1]], columns=["b", "a"]) + + data = dict_type() + data["b"] = [2] + data["a"] = [1] + + result = DataFrame(data) + tm.assert_frame_equal(result, expected) + + data = dict_type() + data["b"] = 2 + data["a"] = 1 + + result = DataFrame([data]) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize("dict_type", [dict, OrderedDict]) + def test_constructor_ordered_dict_conflicting_orders(self, dict_type): + # the first dict element sets the ordering for the DataFrame, + # even if there are conflicting orders from subsequent ones + row_one = dict_type() + row_one["b"] = 2 + row_one["a"] = 1 + + row_two = dict_type() + row_two["a"] = 1 + row_two["b"] = 2 + + row_three = {"b": 2, "a": 1} + + expected = DataFrame([[2, 1], [2, 1]], columns=["b", "a"]) + result = DataFrame([row_one, row_two]) + tm.assert_frame_equal(result, expected) + + expected = DataFrame([[2, 1], [2, 1], [2, 1]], columns=["b", "a"]) + result = DataFrame([row_one, row_two, row_three]) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_of_series_aligned_index(self): + series = [Series(i, index=["b", "a", "c"], name=str(i)) for i in range(3)] + result = DataFrame(series) + expected = DataFrame( + {"b": [0, 1, 2], "a": [0, 1, 2], "c": [0, 1, 2]}, + columns=["b", "a", "c"], + index=["0", "1", "2"], + ) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_of_derived_dicts(self): + class CustomDict(dict): + pass + + d = {"a": 1.5, "b": 3} + + data_custom = [CustomDict(d)] + data = [d] + + result_custom = DataFrame(data_custom) + result = DataFrame(data) + tm.assert_frame_equal(result, result_custom) + + def test_constructor_ragged(self): + data = { + "A": np.random.default_rng(2).standard_normal(10), + "B": np.random.default_rng(2).standard_normal(8), + } + with pytest.raises(ValueError, match="All arrays must be of the same length"): + DataFrame(data) + + def test_constructor_scalar(self): + idx = Index(range(3)) + df = DataFrame({"a": 0}, index=idx) + expected = DataFrame({"a": [0, 0, 0]}, index=idx) + tm.assert_frame_equal(df, expected, check_dtype=False) + + def test_constructor_Series_copy_bug(self, float_frame): + df = DataFrame(float_frame["A"], index=float_frame.index, columns=["A"]) + df.copy() + + def test_constructor_mixed_dict_and_Series(self): + data = {} + data["A"] = {"foo": 1, "bar": 2, "baz": 3} + data["B"] = Series([4, 3, 2, 1], index=["bar", "qux", "baz", "foo"]) + + result = DataFrame(data) + assert result.index.is_monotonic_increasing + + # ordering ambiguous, raise exception + with pytest.raises(ValueError, match="ambiguous ordering"): + DataFrame({"A": ["a", "b"], "B": {"a": "a", "b": "b"}}) + + # this is OK though + result = DataFrame({"A": ["a", "b"], "B": Series(["a", "b"], index=["a", "b"])}) + expected = DataFrame({"A": ["a", "b"], "B": ["a", "b"]}, index=["a", "b"]) + tm.assert_frame_equal(result, expected) + + def test_constructor_mixed_type_rows(self): + # Issue 25075 + data = [[1, 2], (3, 4)] + result = DataFrame(data) + expected = DataFrame([[1, 2], [3, 4]]) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize( + "tuples,lists", + [ + ((), []), + ((()), []), + (((), ()), [(), ()]), + (((), ()), [[], []]), + (([], []), [[], []]), + (([1], [2]), [[1], [2]]), # GH 32776 + (([1, 2, 3], [4, 5, 6]), [[1, 2, 3], [4, 5, 6]]), + ], + ) + def test_constructor_tuple(self, tuples, lists): + # GH 25691 + result = DataFrame(tuples) + expected = DataFrame(lists) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_of_tuples(self): + result = DataFrame({"A": [(1, 2), (3, 4)]}) + expected = DataFrame({"A": Series([(1, 2), (3, 4)])}) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_of_namedtuples(self): + # GH11181 + named_tuple = namedtuple("Pandas", list("ab")) + tuples = [named_tuple(1, 3), named_tuple(2, 4)] + expected = DataFrame({"a": [1, 2], "b": [3, 4]}) + result = DataFrame(tuples) + tm.assert_frame_equal(result, expected) + + # with columns + expected = DataFrame({"y": [1, 2], "z": [3, 4]}) + result = DataFrame(tuples, columns=["y", "z"]) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_of_dataclasses(self): + # GH21910 + Point = make_dataclass("Point", [("x", int), ("y", int)]) + + data = [Point(0, 3), Point(1, 3)] + expected = DataFrame({"x": [0, 1], "y": [3, 3]}) + result = DataFrame(data) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_of_dataclasses_with_varying_types(self): + # GH21910 + # varying types + Point = make_dataclass("Point", [("x", int), ("y", int)]) + HLine = make_dataclass("HLine", [("x0", int), ("x1", int), ("y", int)]) + + data = [Point(0, 3), HLine(1, 3, 3)] + + expected = DataFrame( + {"x": [0, np.nan], "y": [3, 3], "x0": [np.nan, 1], "x1": [np.nan, 3]} + ) + result = DataFrame(data) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_of_dataclasses_error_thrown(self): + # GH21910 + Point = make_dataclass("Point", [("x", int), ("y", int)]) + + # expect TypeError + msg = "asdict() should be called on dataclass instances" + with pytest.raises(TypeError, match=re.escape(msg)): + DataFrame([Point(0, 0), {"x": 1, "y": 0}]) + + def test_constructor_list_of_dict_order(self): + # GH10056 + data = [ + {"First": 1, "Second": 4, "Third": 7, "Fourth": 10}, + {"Second": 5, "First": 2, "Fourth": 11, "Third": 8}, + {"Second": 6, "First": 3, "Fourth": 12, "Third": 9, "YYY": 14, "XXX": 13}, + ] + expected = DataFrame( + { + "First": [1, 2, 3], + "Second": [4, 5, 6], + "Third": [7, 8, 9], + "Fourth": [10, 11, 12], + "YYY": [None, None, 14], + "XXX": [None, None, 13], + } + ) + result = DataFrame(data) + tm.assert_frame_equal(result, expected) + + def test_constructor_Series_named(self): + a = Series([1, 2, 3], index=["a", "b", "c"], name="x") + df = DataFrame(a) + assert df.columns[0] == "x" + tm.assert_index_equal(df.index, a.index) + + # ndarray like + arr = np.random.default_rng(2).standard_normal(10) + s = Series(arr, name="x") + df = DataFrame(s) + expected = DataFrame({"x": s}) + tm.assert_frame_equal(df, expected) + + s = Series(arr, index=range(3, 13)) + df = DataFrame(s) + expected = DataFrame({0: s}) + tm.assert_frame_equal(df, expected) + + msg = r"Shape of passed values is \(10, 1\), indices imply \(10, 2\)" + with pytest.raises(ValueError, match=msg): + DataFrame(s, columns=[1, 2]) + + # #2234 + a = Series([], name="x", dtype=object) + df = DataFrame(a) + assert df.columns[0] == "x" + + # series with name and w/o + s1 = Series(arr, name="x") + df = DataFrame([s1, arr]).T + expected = DataFrame({"x": s1, "Unnamed 0": arr}, columns=["x", "Unnamed 0"]) + tm.assert_frame_equal(df, expected) + + # this is a bit non-intuitive here; the series collapse down to arrays + df = DataFrame([arr, s1]).T + expected = DataFrame({1: s1, 0: arr}, columns=[0, 1]) + tm.assert_frame_equal(df, expected) + + def test_constructor_Series_named_and_columns(self): + # GH 9232 validation + + s0 = Series(range(5), name=0) + s1 = Series(range(5), name=1) + + # matching name and column gives standard frame + tm.assert_frame_equal(DataFrame(s0, columns=[0]), s0.to_frame()) + tm.assert_frame_equal(DataFrame(s1, columns=[1]), s1.to_frame()) + + # non-matching produces empty frame + assert DataFrame(s0, columns=[1]).empty + assert DataFrame(s1, columns=[0]).empty + + def test_constructor_Series_differently_indexed(self): + # name + s1 = Series([1, 2, 3], index=["a", "b", "c"], name="x") + + # no name + s2 = Series([1, 2, 3], index=["a", "b", "c"]) + + other_index = Index(["a", "b"]) + + df1 = DataFrame(s1, index=other_index) + exp1 = DataFrame(s1.reindex(other_index)) + assert df1.columns[0] == "x" + tm.assert_frame_equal(df1, exp1) + + df2 = DataFrame(s2, index=other_index) + exp2 = DataFrame(s2.reindex(other_index)) + assert df2.columns[0] == 0 + tm.assert_index_equal(df2.index, other_index) + tm.assert_frame_equal(df2, exp2) + + @pytest.mark.parametrize( + "name_in1,name_in2,name_in3,name_out", + [ + ("idx", "idx", "idx", "idx"), + ("idx", "idx", None, None), + ("idx", None, None, None), + ("idx1", "idx2", None, None), + ("idx1", "idx1", "idx2", None), + ("idx1", "idx2", "idx3", None), + (None, None, None, None), + ], + ) + def test_constructor_index_names(self, name_in1, name_in2, name_in3, name_out): + # GH13475 + indices = [ + Index(["a", "b", "c"], name=name_in1), + Index(["b", "c", "d"], name=name_in2), + Index(["c", "d", "e"], name=name_in3), + ] + series = { + c: Series([0, 1, 2], index=i) for i, c in zip(indices, ["x", "y", "z"]) + } + result = DataFrame(series) + + exp_ind = Index(["a", "b", "c", "d", "e"], name=name_out) + expected = DataFrame( + { + "x": [0, 1, 2, np.nan, np.nan], + "y": [np.nan, 0, 1, 2, np.nan], + "z": [np.nan, np.nan, 0, 1, 2], + }, + index=exp_ind, + ) + + tm.assert_frame_equal(result, expected) + + def test_constructor_manager_resize(self, float_frame): + index = list(float_frame.index[:5]) + columns = list(float_frame.columns[:3]) + + msg = "Passing a BlockManager to DataFrame" + with tm.assert_produces_warning( + DeprecationWarning, match=msg, check_stacklevel=False + ): + result = DataFrame(float_frame._mgr, index=index, columns=columns) + tm.assert_index_equal(result.index, Index(index)) + tm.assert_index_equal(result.columns, Index(columns)) + + def test_constructor_mix_series_nonseries(self, float_frame): + df = DataFrame( + {"A": float_frame["A"], "B": list(float_frame["B"])}, columns=["A", "B"] + ) + tm.assert_frame_equal(df, float_frame.loc[:, ["A", "B"]]) + + msg = "does not match index length" + with pytest.raises(ValueError, match=msg): + DataFrame({"A": float_frame["A"], "B": list(float_frame["B"])[:-2]}) + + def test_constructor_miscast_na_int_dtype(self): + msg = r"Cannot convert non-finite values \(NA or inf\) to integer" + + with pytest.raises(IntCastingNaNError, match=msg): + DataFrame([[np.nan, 1], [1, 0]], dtype=np.int64) + + def test_constructor_column_duplicates(self): + # it works! #2079 + df = DataFrame([[8, 5]], columns=["a", "a"]) + edf = DataFrame([[8, 5]]) + edf.columns = ["a", "a"] + + tm.assert_frame_equal(df, edf) + + idf = DataFrame.from_records([(8, 5)], columns=["a", "a"]) + + tm.assert_frame_equal(idf, edf) + + def test_constructor_empty_with_string_dtype(self, using_infer_string): + # GH 9428 + expected = DataFrame(index=[0, 1], columns=[0, 1], dtype=object) + expected_str = DataFrame( + index=[0, 1], columns=[0, 1], dtype=pd.StringDtype(na_value=np.nan) + ) + + df = DataFrame(index=[0, 1], columns=[0, 1], dtype=str) + if using_infer_string: + tm.assert_frame_equal(df, expected_str) + else: + tm.assert_frame_equal(df, expected) + df = DataFrame(index=[0, 1], columns=[0, 1], dtype=np.str_) + tm.assert_frame_equal(df, expected) + df = DataFrame(index=[0, 1], columns=[0, 1], dtype="U5") + tm.assert_frame_equal(df, expected) + + def test_constructor_empty_with_string_extension(self, nullable_string_dtype): + # GH 34915 + expected = DataFrame(columns=["c1"], dtype=nullable_string_dtype) + df = DataFrame(columns=["c1"], dtype=nullable_string_dtype) + tm.assert_frame_equal(df, expected) + + def test_constructor_single_value(self): + # expecting single value upcasting here + df = DataFrame(0.0, index=[1, 2, 3], columns=["a", "b", "c"]) + tm.assert_frame_equal( + df, DataFrame(np.zeros(df.shape).astype("float64"), df.index, df.columns) + ) + + df = DataFrame(0, index=[1, 2, 3], columns=["a", "b", "c"]) + tm.assert_frame_equal( + df, DataFrame(np.zeros(df.shape).astype("int64"), df.index, df.columns) + ) + + df = DataFrame("a", index=[1, 2], columns=["a", "c"]) + tm.assert_frame_equal( + df, + DataFrame( + np.array([["a", "a"], ["a", "a"]], dtype=object), + index=[1, 2], + columns=["a", "c"], + ), + ) + + msg = "DataFrame constructor not properly called!" + with pytest.raises(ValueError, match=msg): + DataFrame("a", [1, 2]) + with pytest.raises(ValueError, match=msg): + DataFrame("a", columns=["a", "c"]) + + msg = "incompatible data and dtype" + with pytest.raises(TypeError, match=msg): + DataFrame("a", [1, 2], ["a", "c"], float) + + def test_constructor_with_datetimes(self, using_infer_string): + intname = np.dtype(int).name + floatname = np.dtype(np.float64).name + objectname = np.dtype(np.object_).name + + # single item + df = DataFrame( + { + "A": 1, + "B": "foo", + "C": "bar", + "D": Timestamp("20010101"), + "E": datetime(2001, 1, 2, 0, 0), + }, + index=np.arange(10), + ) + result = df.dtypes + expected = Series( + [np.dtype("int64")] + + [ + np.dtype(objectname) + if not using_infer_string + else pd.StringDtype(na_value=np.nan) + ] + * 2 + + [np.dtype("M8[s]"), np.dtype("M8[us]")], + index=list("ABCDE"), + ) + tm.assert_series_equal(result, expected) + + # check with ndarray construction ndim==0 (e.g. we are passing a ndim 0 + # ndarray with a dtype specified) + df = DataFrame( + { + "a": 1.0, + "b": 2, + "c": "foo", + floatname: np.array(1.0, dtype=floatname), + intname: np.array(1, dtype=intname), + }, + index=np.arange(10), + ) + result = df.dtypes + expected = Series( + [np.dtype("float64")] + + [np.dtype("int64")] + + [ + np.dtype("object") + if not using_infer_string + else pd.StringDtype(na_value=np.nan) + ] + + [np.dtype("float64")] + + [np.dtype(intname)], + index=["a", "b", "c", floatname, intname], + ) + tm.assert_series_equal(result, expected) + + # check with ndarray construction ndim>0 + df = DataFrame( + { + "a": 1.0, + "b": 2, + "c": "foo", + floatname: np.array([1.0] * 10, dtype=floatname), + intname: np.array([1] * 10, dtype=intname), + }, + index=np.arange(10), + ) + result = df.dtypes + expected = Series( + [np.dtype("float64")] + + [np.dtype("int64")] + + [ + np.dtype("object") + if not using_infer_string + else pd.StringDtype(na_value=np.nan) + ] + + [np.dtype("float64")] + + [np.dtype(intname)], + index=["a", "b", "c", floatname, intname], + ) + tm.assert_series_equal(result, expected) + + def test_constructor_with_datetimes1(self): + # GH 2809 + ind = date_range(start="2000-01-01", freq="D", periods=10) + datetimes = [ts.to_pydatetime() for ts in ind] + datetime_s = Series(datetimes) + assert datetime_s.dtype == "M8[ns]" + + def test_constructor_with_datetimes2(self): + # GH 2810 + ind = date_range(start="2000-01-01", freq="D", periods=10) + datetimes = [ts.to_pydatetime() for ts in ind] + dates = [ts.date() for ts in ind] + df = DataFrame(datetimes, columns=["datetimes"]) + df["dates"] = dates + result = df.dtypes + expected = Series( + [np.dtype("datetime64[ns]"), np.dtype("object")], + index=["datetimes", "dates"], + ) + tm.assert_series_equal(result, expected) + + def test_constructor_with_datetimes3(self): + # GH 7594 + # don't coerce tz-aware + tz = pytz.timezone("US/Eastern") + dt = tz.localize(datetime(2012, 1, 1)) + + df = DataFrame({"End Date": dt}, index=[0]) + assert df.iat[0, 0] == dt + tm.assert_series_equal( + df.dtypes, Series({"End Date": "datetime64[us, US/Eastern]"}, dtype=object) + ) + + df = DataFrame([{"End Date": dt}]) + assert df.iat[0, 0] == dt + tm.assert_series_equal( + df.dtypes, Series({"End Date": "datetime64[ns, US/Eastern]"}, dtype=object) + ) + + def test_constructor_with_datetimes4(self): + # tz-aware (UTC and other tz's) + # GH 8411 + dr = date_range("20130101", periods=3) + df = DataFrame({"value": dr}) + assert df.iat[0, 0].tz is None + dr = date_range("20130101", periods=3, tz="UTC") + df = DataFrame({"value": dr}) + assert str(df.iat[0, 0].tz) == "UTC" + dr = date_range("20130101", periods=3, tz="US/Eastern") + df = DataFrame({"value": dr}) + assert str(df.iat[0, 0].tz) == "US/Eastern" + + def test_constructor_with_datetimes5(self): + # GH 7822 + # preserver an index with a tz on dict construction + i = date_range("1/1/2011", periods=5, freq="10s", tz="US/Eastern") + + expected = DataFrame({"a": i.to_series().reset_index(drop=True)}) + df = DataFrame() + df["a"] = i + tm.assert_frame_equal(df, expected) + + df = DataFrame({"a": i}) + tm.assert_frame_equal(df, expected) + + def test_constructor_with_datetimes6(self): + # multiples + i = date_range("1/1/2011", periods=5, freq="10s", tz="US/Eastern") + i_no_tz = date_range("1/1/2011", periods=5, freq="10s") + df = DataFrame({"a": i, "b": i_no_tz}) + expected = DataFrame({"a": i.to_series().reset_index(drop=True), "b": i_no_tz}) + tm.assert_frame_equal(df, expected) + + @pytest.mark.parametrize( + "arr", + [ + np.array([None, None, None, None, datetime.now(), None]), + np.array([None, None, datetime.now(), None]), + [[np.datetime64("NaT")], [None]], + [[np.datetime64("NaT")], [pd.NaT]], + [[None], [np.datetime64("NaT")]], + [[None], [pd.NaT]], + [[pd.NaT], [np.datetime64("NaT")]], + [[pd.NaT], [None]], + ], + ) + def test_constructor_datetimes_with_nulls(self, arr): + # gh-15869, GH#11220 + result = DataFrame(arr).dtypes + expected = Series([np.dtype("datetime64[ns]")]) + tm.assert_series_equal(result, expected) + + @pytest.mark.parametrize("order", ["K", "A", "C", "F"]) + @pytest.mark.parametrize( + "unit", + ["M", "D", "h", "m", "s", "ms", "us", "ns"], + ) + def test_constructor_datetimes_non_ns(self, order, unit): + dtype = f"datetime64[{unit}]" + na = np.array( + [ + ["2015-01-01", "2015-01-02", "2015-01-03"], + ["2017-01-01", "2017-01-02", "2017-02-03"], + ], + dtype=dtype, + order=order, + ) + df = DataFrame(na) + expected = DataFrame(na.astype("M8[ns]")) + if unit in ["M", "D", "h", "m"]: + with pytest.raises(TypeError, match="Cannot cast"): + expected.astype(dtype) + + # instead the constructor casts to the closest supported reso, i.e. "s" + expected = expected.astype("datetime64[s]") + else: + expected = expected.astype(dtype=dtype) + + tm.assert_frame_equal(df, expected) + + @pytest.mark.parametrize("order", ["K", "A", "C", "F"]) + @pytest.mark.parametrize( + "unit", + [ + "D", + "h", + "m", + "s", + "ms", + "us", + "ns", + ], + ) + def test_constructor_timedelta_non_ns(self, order, unit): + dtype = f"timedelta64[{unit}]" + na = np.array( + [ + [np.timedelta64(1, "D"), np.timedelta64(2, "D")], + [np.timedelta64(4, "D"), np.timedelta64(5, "D")], + ], + dtype=dtype, + order=order, + ) + df = DataFrame(na) + if unit in ["D", "h", "m"]: + # we get the nearest supported unit, i.e. "s" + exp_unit = "s" + else: + exp_unit = unit + exp_dtype = np.dtype(f"m8[{exp_unit}]") + expected = DataFrame( + [ + [Timedelta(1, "D"), Timedelta(2, "D")], + [Timedelta(4, "D"), Timedelta(5, "D")], + ], + dtype=exp_dtype, + ) + # TODO(2.0): ideally we should get the same 'expected' without passing + # dtype=exp_dtype. + tm.assert_frame_equal(df, expected) + + def test_constructor_for_list_with_dtypes(self, using_infer_string): + # test list of lists/ndarrays + df = DataFrame([np.arange(5) for x in range(5)]) + result = df.dtypes + expected = Series([np.dtype("int")] * 5) + tm.assert_series_equal(result, expected) + + df = DataFrame([np.array(np.arange(5), dtype="int32") for x in range(5)]) + result = df.dtypes + expected = Series([np.dtype("int32")] * 5) + tm.assert_series_equal(result, expected) + + # overflow issue? (we always expected int64 upcasting here) + df = DataFrame({"a": [2**31, 2**31 + 1]}) + assert df.dtypes.iloc[0] == np.dtype("int64") + + # GH #2751 (construction with no index specified), make sure we cast to + # platform values + df = DataFrame([1, 2]) + assert df.dtypes.iloc[0] == np.dtype("int64") + + df = DataFrame([1.0, 2.0]) + assert df.dtypes.iloc[0] == np.dtype("float64") + + df = DataFrame({"a": [1, 2]}) + assert df.dtypes.iloc[0] == np.dtype("int64") + + df = DataFrame({"a": [1.0, 2.0]}) + assert df.dtypes.iloc[0] == np.dtype("float64") + + df = DataFrame({"a": 1}, index=range(3)) + assert df.dtypes.iloc[0] == np.dtype("int64") + + df = DataFrame({"a": 1.0}, index=range(3)) + assert df.dtypes.iloc[0] == np.dtype("float64") + + # with object list + df = DataFrame( + { + "a": [1, 2, 4, 7], + "b": [1.2, 2.3, 5.1, 6.3], + "c": list("abcd"), + "d": [datetime(2000, 1, 1) for i in range(4)], + "e": [1.0, 2, 4.0, 7], + } + ) + result = df.dtypes + expected = Series( + [ + np.dtype("int64"), + np.dtype("float64"), + np.dtype("object") + if not using_infer_string + else pd.StringDtype(na_value=np.nan), + np.dtype("datetime64[ns]"), + np.dtype("float64"), + ], + index=list("abcde"), + ) + tm.assert_series_equal(result, expected) + + def test_constructor_frame_copy(self, float_frame): + cop = DataFrame(float_frame, copy=True) + cop["A"] = 5 + assert (cop["A"] == 5).all() + assert not (float_frame["A"] == 5).all() + + def test_constructor_frame_shallow_copy(self, float_frame): + # constructing a DataFrame from DataFrame with copy=False should still + # give a "shallow" copy (share data, not attributes) + # https://github.com/pandas-dev/pandas/issues/49523 + orig = float_frame.copy() + cop = DataFrame(float_frame) + assert cop._mgr is not float_frame._mgr + # Overwriting index of copy doesn't change original + cop.index = np.arange(len(cop)) + tm.assert_frame_equal(float_frame, orig) + + def test_constructor_ndarray_copy( + self, float_frame, using_array_manager, using_copy_on_write + ): + if not using_array_manager: + arr = float_frame.values.copy() + df = DataFrame(arr) + + arr[5] = 5 + if using_copy_on_write: + assert not (df.values[5] == 5).all() + else: + assert (df.values[5] == 5).all() + + df = DataFrame(arr, copy=True) + arr[6] = 6 + assert not (df.values[6] == 6).all() + else: + arr = float_frame.values.copy() + # default: copy to ensure contiguous arrays + df = DataFrame(arr) + assert df._mgr.arrays[0].flags.c_contiguous + arr[0, 0] = 100 + assert df.iloc[0, 0] != 100 + + # manually specify copy=False + df = DataFrame(arr, copy=False) + assert not df._mgr.arrays[0].flags.c_contiguous + arr[0, 0] = 1000 + assert df.iloc[0, 0] == 1000 + + def test_constructor_series_copy(self, float_frame): + series = float_frame._series + + df = DataFrame({"A": series["A"]}, copy=True) + # TODO can be replaced with `df.loc[:, "A"] = 5` after deprecation about + # inplace mutation is enforced + df.loc[df.index[0] : df.index[-1], "A"] = 5 + + assert not (series["A"] == 5).all() + + @pytest.mark.parametrize( + "df", + [ + DataFrame([[1, 2, 3], [4, 5, 6]], index=[1, np.nan]), + DataFrame([[1, 2, 3], [4, 5, 6]], columns=[1.1, 2.2, np.nan]), + DataFrame([[0, 1, 2, 3], [4, 5, 6, 7]], columns=[np.nan, 1.1, 2.2, np.nan]), + DataFrame( + [[0.0, 1, 2, 3.0], [4, 5, 6, 7]], columns=[np.nan, 1.1, 2.2, np.nan] + ), + DataFrame([[0.0, 1, 2, 3.0], [4, 5, 6, 7]], columns=[np.nan, 1, 2, 2]), + ], + ) + def test_constructor_with_nas(self, df): + # GH 5016 + # na's in indices + # GH 21428 (non-unique columns) + + for i in range(len(df.columns)): + df.iloc[:, i] + + indexer = np.arange(len(df.columns))[isna(df.columns)] + + # No NaN found -> error + if len(indexer) == 0: + with pytest.raises(KeyError, match="^nan$"): + df.loc[:, np.nan] + # single nan should result in Series + elif len(indexer) == 1: + tm.assert_series_equal(df.iloc[:, indexer[0]], df.loc[:, np.nan]) + # multiple nans should result in DataFrame + else: + tm.assert_frame_equal(df.iloc[:, indexer], df.loc[:, np.nan]) + + def test_constructor_lists_to_object_dtype(self): + # from #1074 + d = DataFrame({"a": [np.nan, False]}) + assert d["a"].dtype == np.object_ + assert not d["a"][1] + + def test_constructor_ndarray_categorical_dtype(self): + cat = Categorical(["A", "B", "C"]) + arr = np.array(cat).reshape(-1, 1) + arr = np.broadcast_to(arr, (3, 4)) + + result = DataFrame(arr, dtype=cat.dtype) + + expected = DataFrame({0: cat, 1: cat, 2: cat, 3: cat}) + tm.assert_frame_equal(result, expected) + + def test_constructor_categorical(self): + # GH8626 + + # dict creation + df = DataFrame({"A": list("abc")}, dtype="category") + expected = Series(list("abc"), dtype="category", name="A") + tm.assert_series_equal(df["A"], expected) + + # to_frame + s = Series(list("abc"), dtype="category") + result = s.to_frame() + expected = Series(list("abc"), dtype="category", name=0) + tm.assert_series_equal(result[0], expected) + result = s.to_frame(name="foo") + expected = Series(list("abc"), dtype="category", name="foo") + tm.assert_series_equal(result["foo"], expected) + + # list-like creation + df = DataFrame(list("abc"), dtype="category") + expected = Series(list("abc"), dtype="category", name=0) + tm.assert_series_equal(df[0], expected) + + def test_construct_from_1item_list_of_categorical(self): + # pre-2.0 this behaved as DataFrame({0: cat}), in 2.0 we remove + # Categorical special case + # ndim != 1 + cat = Categorical(list("abc")) + df = DataFrame([cat]) + expected = DataFrame([cat.astype(object)]) + tm.assert_frame_equal(df, expected) + + def test_construct_from_list_of_categoricals(self): + # pre-2.0 this behaved as DataFrame({0: cat}), in 2.0 we remove + # Categorical special case + + df = DataFrame([Categorical(list("abc")), Categorical(list("abd"))]) + expected = DataFrame([["a", "b", "c"], ["a", "b", "d"]]) + tm.assert_frame_equal(df, expected) + + def test_from_nested_listlike_mixed_types(self): + # pre-2.0 this behaved as DataFrame({0: cat}), in 2.0 we remove + # Categorical special case + # mixed + df = DataFrame([Categorical(list("abc")), list("def")]) + expected = DataFrame([["a", "b", "c"], ["d", "e", "f"]]) + tm.assert_frame_equal(df, expected) + + def test_construct_from_listlikes_mismatched_lengths(self): + df = DataFrame([Categorical(list("abc")), Categorical(list("abdefg"))]) + expected = DataFrame([list("abc"), list("abdefg")]) + tm.assert_frame_equal(df, expected) + + def test_constructor_categorical_series(self): + items = [1, 2, 3, 1] + exp = Series(items).astype("category") + res = Series(items, dtype="category") + tm.assert_series_equal(res, exp) + + items = ["a", "b", "c", "a"] + exp = Series(items).astype("category") + res = Series(items, dtype="category") + tm.assert_series_equal(res, exp) + + # insert into frame with different index + # GH 8076 + index = date_range("20000101", periods=3) + expected = Series( + Categorical(values=[np.nan, np.nan, np.nan], categories=["a", "b", "c"]) + ) + expected.index = index + + expected = DataFrame({"x": expected}) + df = DataFrame({"x": Series(["a", "b", "c"], dtype="category")}, index=index) + tm.assert_frame_equal(df, expected) + + @pytest.mark.parametrize( + "dtype", + tm.ALL_NUMERIC_DTYPES + + tm.DATETIME64_DTYPES + + tm.TIMEDELTA64_DTYPES + + tm.BOOL_DTYPES, + ) + def test_check_dtype_empty_numeric_column(self, dtype): + # GH24386: Ensure dtypes are set correctly for an empty DataFrame. + # Empty DataFrame is generated via dictionary data with non-overlapping columns. + data = DataFrame({"a": [1, 2]}, columns=["b"], dtype=dtype) + + assert data.b.dtype == dtype + + @pytest.mark.parametrize( + "dtype", tm.STRING_DTYPES + tm.BYTES_DTYPES + tm.OBJECT_DTYPES + ) + def test_check_dtype_empty_string_column(self, request, dtype, using_array_manager): + # GH24386: Ensure dtypes are set correctly for an empty DataFrame. + # Empty DataFrame is generated via dictionary data with non-overlapping columns. + data = DataFrame({"a": [1, 2]}, columns=["b"], dtype=dtype) + + if using_array_manager and dtype in tm.BYTES_DTYPES: + # TODO(ArrayManager) astype to bytes dtypes does not yet give object dtype + td.mark_array_manager_not_yet_implemented(request) + + assert data.b.dtype.name == "object" + + def test_to_frame_with_falsey_names(self): + # GH 16114 + result = Series(name=0, dtype=object).to_frame().dtypes + expected = Series({0: object}) + tm.assert_series_equal(result, expected) + + result = DataFrame(Series(name=0, dtype=object)).dtypes + tm.assert_series_equal(result, expected) + + @pytest.mark.arm_slow + @pytest.mark.parametrize("dtype", [None, "uint8", "category"]) + def test_constructor_range_dtype(self, dtype): + expected = DataFrame({"A": [0, 1, 2, 3, 4]}, dtype=dtype or "int64") + + # GH 26342 + result = DataFrame(range(5), columns=["A"], dtype=dtype) + tm.assert_frame_equal(result, expected) + + # GH 16804 + result = DataFrame({"A": range(5)}, dtype=dtype) + tm.assert_frame_equal(result, expected) + + def test_frame_from_list_subclass(self): + # GH21226 + class List(list): + pass + + expected = DataFrame([[1, 2, 3], [4, 5, 6]]) + result = DataFrame(List([List([1, 2, 3]), List([4, 5, 6])])) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize( + "extension_arr", + [ + Categorical(list("aabbc")), + SparseArray([1, np.nan, np.nan, np.nan]), + IntervalArray([Interval(0, 1), Interval(1, 5)]), + PeriodArray(pd.period_range(start="1/1/2017", end="1/1/2018", freq="M")), + ], + ) + def test_constructor_with_extension_array(self, extension_arr): + # GH11363 + expected = DataFrame(Series(extension_arr)) + result = DataFrame(extension_arr) + tm.assert_frame_equal(result, expected) + + def test_datetime_date_tuple_columns_from_dict(self): + # GH 10863 + v = date.today() + tup = v, v + result = DataFrame({tup: Series(range(3), index=range(3))}, columns=[tup]) + expected = DataFrame([0, 1, 2], columns=Index(Series([tup]))) + tm.assert_frame_equal(result, expected) + + def test_construct_with_two_categoricalindex_series(self): + # GH 14600 + s1 = Series([39, 6, 4], index=CategoricalIndex(["female", "male", "unknown"])) + s2 = Series( + [2, 152, 2, 242, 150], + index=CategoricalIndex(["f", "female", "m", "male", "unknown"]), + ) + result = DataFrame([s1, s2]) + expected = DataFrame( + np.array([[39, 6, 4, np.nan, np.nan], [152.0, 242.0, 150.0, 2.0, 2.0]]), + columns=["female", "male", "unknown", "f", "m"], + ) + tm.assert_frame_equal(result, expected) + + @pytest.mark.filterwarnings( + "ignore:invalid value encountered in cast:RuntimeWarning" + ) + def test_constructor_series_nonexact_categoricalindex(self): + # GH 42424 + ser = Series(range(100)) + ser1 = cut(ser, 10).value_counts().head(5) + ser2 = cut(ser, 10).value_counts().tail(5) + result = DataFrame({"1": ser1, "2": ser2}) + index = CategoricalIndex( + [ + Interval(-0.099, 9.9, closed="right"), + Interval(9.9, 19.8, closed="right"), + Interval(19.8, 29.7, closed="right"), + Interval(29.7, 39.6, closed="right"), + Interval(39.6, 49.5, closed="right"), + Interval(49.5, 59.4, closed="right"), + Interval(59.4, 69.3, closed="right"), + Interval(69.3, 79.2, closed="right"), + Interval(79.2, 89.1, closed="right"), + Interval(89.1, 99, closed="right"), + ], + ordered=True, + ) + expected = DataFrame( + {"1": [10] * 5 + [np.nan] * 5, "2": [np.nan] * 5 + [10] * 5}, index=index + ) + tm.assert_frame_equal(expected, result) + + def test_from_M8_structured(self): + dates = [(datetime(2012, 9, 9, 0, 0), datetime(2012, 9, 8, 15, 10))] + arr = np.array(dates, dtype=[("Date", "M8[us]"), ("Forecasting", "M8[us]")]) + df = DataFrame(arr) + + assert df["Date"][0] == dates[0][0] + assert df["Forecasting"][0] == dates[0][1] + + s = Series(arr["Date"]) + assert isinstance(s[0], Timestamp) + assert s[0] == dates[0][0] + + def test_from_datetime_subclass(self): + # GH21142 Verify whether Datetime subclasses are also of dtype datetime + class DatetimeSubclass(datetime): + pass + + data = DataFrame({"datetime": [DatetimeSubclass(2020, 1, 1, 1, 1)]}) + assert data.datetime.dtype == "datetime64[ns]" + + def test_with_mismatched_index_length_raises(self): + # GH#33437 + dti = date_range("2016-01-01", periods=3, tz="US/Pacific") + msg = "Shape of passed values|Passed arrays should have the same length" + with pytest.raises(ValueError, match=msg): + DataFrame(dti, index=range(4)) + + def test_frame_ctor_datetime64_column(self): + rng = date_range("1/1/2000 00:00:00", "1/1/2000 1:59:50", freq="10s") + dates = np.asarray(rng) + + df = DataFrame( + {"A": np.random.default_rng(2).standard_normal(len(rng)), "B": dates} + ) + assert np.issubdtype(df["B"].dtype, np.dtype("M8[ns]")) + + def test_dataframe_constructor_infer_multiindex(self): + index_lists = [["a", "a", "b", "b"], ["x", "y", "x", "y"]] + + multi = DataFrame( + np.random.default_rng(2).standard_normal((4, 4)), + index=[np.array(x) for x in index_lists], + ) + assert isinstance(multi.index, MultiIndex) + assert not isinstance(multi.columns, MultiIndex) + + multi = DataFrame( + np.random.default_rng(2).standard_normal((4, 4)), columns=index_lists + ) + assert isinstance(multi.columns, MultiIndex) + + @pytest.mark.parametrize( + "input_vals", + [ + ([1, 2]), + (["1", "2"]), + (list(date_range("1/1/2011", periods=2, freq="h"))), + (list(date_range("1/1/2011", periods=2, freq="h", tz="US/Eastern"))), + ([Interval(left=0, right=5)]), + ], + ) + def test_constructor_list_str(self, input_vals, string_dtype): + # GH#16605 + # Ensure that data elements are converted to strings when + # dtype is str, 'str', or 'U' + + result = DataFrame({"A": input_vals}, dtype=string_dtype) + expected = DataFrame({"A": input_vals}).astype({"A": string_dtype}) + tm.assert_frame_equal(result, expected) + + def test_constructor_list_str_na(self, string_dtype): + result = DataFrame({"A": [1.0, 2.0, None]}, dtype=string_dtype) + expected = DataFrame({"A": ["1.0", "2.0", None]}, dtype=object) + tm.assert_frame_equal(result, expected) + + @pytest.mark.parametrize("copy", [False, True]) + def test_dict_nocopy( + self, + request, + copy, + any_numeric_ea_dtype, + any_numpy_dtype, + using_array_manager, + using_copy_on_write, + ): + if ( + using_array_manager + and not copy + and any_numpy_dtype not in tm.STRING_DTYPES + tm.BYTES_DTYPES + ): + # TODO(ArrayManager) properly honor copy keyword for dict input + td.mark_array_manager_not_yet_implemented(request) + + a = np.array([1, 2], dtype=any_numpy_dtype) + b = np.array([3, 4], dtype=any_numpy_dtype) + if b.dtype.kind in ["S", "U"]: + # These get cast, making the checks below more cumbersome + pytest.skip(f"{b.dtype} get cast, making the checks below more cumbersome") + + c = pd.array([1, 2], dtype=any_numeric_ea_dtype) + c_orig = c.copy() + df = DataFrame({"a": a, "b": b, "c": c}, copy=copy) + + def get_base(obj): + if isinstance(obj, np.ndarray): + return obj.base + elif isinstance(obj.dtype, np.dtype): + # i.e. DatetimeArray, TimedeltaArray + return obj._ndarray.base + else: + raise TypeError + + def check_views(c_only: bool = False): + # written to work for either BlockManager or ArrayManager + + # Check that the underlying data behind df["c"] is still `c` + # after setting with iloc. Since we don't know which entry in + # df._mgr.arrays corresponds to df["c"], we just check that exactly + # one of these arrays is `c`. GH#38939 + assert sum(x is c for x in df._mgr.arrays) == 1 + if c_only: + # If we ever stop consolidating in setitem_with_indexer, + # this will become unnecessary. + return + + assert ( + sum( + get_base(x) is a + for x in df._mgr.arrays + if isinstance(x.dtype, np.dtype) + ) + == 1 + ) + assert ( + sum( + get_base(x) is b + for x in df._mgr.arrays + if isinstance(x.dtype, np.dtype) + ) + == 1 + ) + + if not copy: + # constructor preserves views + check_views() + + # TODO: most of the rest of this test belongs in indexing tests + if lib.is_np_dtype(df.dtypes.iloc[0], "fciuO"): + warn = None + else: + warn = FutureWarning + with tm.assert_produces_warning(warn, match="incompatible dtype"): + df.iloc[0, 0] = 0 + df.iloc[0, 1] = 0 + if not copy: + check_views(True) + + # FIXME(GH#35417): until GH#35417, iloc.setitem into EA values does not preserve + # view, so we have to check in the other direction + df.iloc[:, 2] = pd.array([45, 46], dtype=c.dtype) + assert df.dtypes.iloc[2] == c.dtype + if not copy and not using_copy_on_write: + check_views(True) + + if copy: + if a.dtype.kind == "M": + assert a[0] == a.dtype.type(1, "ns") + assert b[0] == b.dtype.type(3, "ns") + else: + assert a[0] == a.dtype.type(1) + assert b[0] == b.dtype.type(3) + # FIXME(GH#35417): enable after GH#35417 + assert c[0] == c_orig[0] # i.e. df.iloc[0, 2]=45 did *not* update c + elif not using_copy_on_write: + # TODO: we can call check_views if we stop consolidating + # in setitem_with_indexer + assert c[0] == 45 # i.e. df.iloc[0, 2]=45 *did* update c + # TODO: we can check b[0] == 0 if we stop consolidating in + # setitem_with_indexer (except for datetimelike?) + + def test_construct_from_dict_ea_series(self): + # GH#53744 - default of copy=True should also apply for Series with + # extension dtype + ser = Series([1, 2, 3], dtype="Int64") + df = DataFrame({"a": ser}) + assert not np.shares_memory(ser.values._data, df["a"].values._data) + + def test_from_series_with_name_with_columns(self): + # GH 7893 + result = DataFrame(Series(1, name="foo"), columns=["bar"]) + expected = DataFrame(columns=["bar"]) + tm.assert_frame_equal(result, expected) + + def test_nested_list_columns(self): + # GH 14467 + result = DataFrame( + [[1, 2, 3], [4, 5, 6]], columns=[["A", "A", "A"], ["a", "b", "c"]] + ) + expected = DataFrame( + [[1, 2, 3], [4, 5, 6]], + columns=MultiIndex.from_tuples([("A", "a"), ("A", "b"), ("A", "c")]), + ) + tm.assert_frame_equal(result, expected) + + def test_from_2d_object_array_of_periods_or_intervals(self): + # Period analogue to GH#26825 + pi = pd.period_range("2016-04-05", periods=3) + data = pi._data.astype(object).reshape(1, -1) + df = DataFrame(data) + assert df.shape == (1, 3) + assert (df.dtypes == pi.dtype).all() + assert (df == pi).all().all() + + ii = pd.IntervalIndex.from_breaks([3, 4, 5, 6]) + data2 = ii._data.astype(object).reshape(1, -1) + df2 = DataFrame(data2) + assert df2.shape == (1, 3) + assert (df2.dtypes == ii.dtype).all() + assert (df2 == ii).all().all() + + # mixed + data3 = np.r_[data, data2, data, data2].T + df3 = DataFrame(data3) + expected = DataFrame({0: pi, 1: ii, 2: pi, 3: ii}) + tm.assert_frame_equal(df3, expected) + + @pytest.mark.parametrize( + "col_a, col_b", + [ + ([[1], [2]], np.array([[1], [2]])), + (np.array([[1], [2]]), [[1], [2]]), + (np.array([[1], [2]]), np.array([[1], [2]])), + ], + ) + def test_error_from_2darray(self, col_a, col_b): + msg = "Per-column arrays must each be 1-dimensional" + with pytest.raises(ValueError, match=msg): + DataFrame({"a": col_a, "b": col_b}) + + def test_from_dict_with_missing_copy_false(self): + # GH#45369 filled columns should not be views of one another + df = DataFrame(index=[1, 2, 3], columns=["a", "b", "c"], copy=False) + assert not np.shares_memory(df["a"]._values, df["b"]._values) + + df.iloc[0, 0] = 0 + expected = DataFrame( + { + "a": [0, np.nan, np.nan], + "b": [np.nan, np.nan, np.nan], + "c": [np.nan, np.nan, np.nan], + }, + index=[1, 2, 3], + dtype=object, + ) + tm.assert_frame_equal(df, expected) + + def test_construction_empty_array_multi_column_raises(self): + # GH#46822 + msg = r"Shape of passed values is \(0, 1\), indices imply \(0, 2\)" + with pytest.raises(ValueError, match=msg): + DataFrame(data=np.array([]), columns=["a", "b"]) + + def test_construct_with_strings_and_none(self): + # GH#32218 + df = DataFrame(["1", "2", None], columns=["a"], dtype="str") + expected = DataFrame({"a": ["1", "2", None]}, dtype="str") + tm.assert_frame_equal(df, expected) + + def test_frame_string_inference(self): + # GH#54430 + dtype = pd.StringDtype(na_value=np.nan) + expected = DataFrame( + {"a": ["a", "b"]}, dtype=dtype, columns=Index(["a"], dtype=dtype) + ) + with pd.option_context("future.infer_string", True): + df = DataFrame({"a": ["a", "b"]}) + tm.assert_frame_equal(df, expected) + + expected = DataFrame( + {"a": ["a", "b"]}, + dtype=dtype, + columns=Index(["a"], dtype=dtype), + index=Index(["x", "y"], dtype=dtype), + ) + with pd.option_context("future.infer_string", True): + df = DataFrame({"a": ["a", "b"]}, index=["x", "y"]) + tm.assert_frame_equal(df, expected) + + expected = DataFrame( + {"a": ["a", 1]}, dtype="object", columns=Index(["a"], dtype=dtype) + ) + with pd.option_context("future.infer_string", True): + df = DataFrame({"a": ["a", 1]}) + tm.assert_frame_equal(df, expected) + + expected = DataFrame( + {"a": ["a", "b"]}, dtype="object", columns=Index(["a"], dtype=dtype) + ) + with pd.option_context("future.infer_string", True): + df = DataFrame({"a": ["a", "b"]}, dtype="object") + tm.assert_frame_equal(df, expected) + + def test_frame_string_inference_array_string_dtype(self): + # GH#54496 + dtype = pd.StringDtype(na_value=np.nan) + expected = DataFrame( + {"a": ["a", "b"]}, dtype=dtype, columns=Index(["a"], dtype=dtype) + ) + with pd.option_context("future.infer_string", True): + df = DataFrame({"a": np.array(["a", "b"])}) + tm.assert_frame_equal(df, expected) + + expected = DataFrame({0: ["a", "b"], 1: ["c", "d"]}, dtype=dtype) + with pd.option_context("future.infer_string", True): + df = DataFrame(np.array([["a", "c"], ["b", "d"]])) + tm.assert_frame_equal(df, expected) + + expected = DataFrame( + {"a": ["a", "b"], "b": ["c", "d"]}, + dtype=dtype, + columns=Index(["a", "b"], dtype=dtype), + ) + with pd.option_context("future.infer_string", True): + df = DataFrame(np.array([["a", "c"], ["b", "d"]]), columns=["a", "b"]) + tm.assert_frame_equal(df, expected) + + def test_frame_string_inference_block_dim(self): + # GH#55363 + with pd.option_context("future.infer_string", True): + df = DataFrame(np.array([["hello", "goodbye"], ["hello", "Hello"]])) + assert df._mgr.blocks[0].ndim == 2 + + def test_inference_on_pandas_objects(self): + # GH#56012 + idx = Index([Timestamp("2019-12-31")], dtype=object) + with tm.assert_produces_warning(FutureWarning, match="Dtype inference"): + result = DataFrame(idx, columns=["a"]) + assert result.dtypes.iloc[0] != np.object_ + result = DataFrame({"a": idx}) + assert result.dtypes.iloc[0] == np.object_ + + ser = Series([Timestamp("2019-12-31")], dtype=object) + + with tm.assert_produces_warning(FutureWarning, match="Dtype inference"): + result = DataFrame(ser, columns=["a"]) + assert result.dtypes.iloc[0] != np.object_ + result = DataFrame({"a": ser}) + assert result.dtypes.iloc[0] == np.object_ + + +class TestDataFrameConstructorIndexInference: + def test_frame_from_dict_of_series_overlapping_monthly_period_indexes(self): + rng1 = pd.period_range("1/1/1999", "1/1/2012", freq="M") + s1 = Series(np.random.default_rng(2).standard_normal(len(rng1)), rng1) + + rng2 = pd.period_range("1/1/1980", "12/1/2001", freq="M") + s2 = Series(np.random.default_rng(2).standard_normal(len(rng2)), rng2) + df = DataFrame({"s1": s1, "s2": s2}) + + exp = pd.period_range("1/1/1980", "1/1/2012", freq="M") + tm.assert_index_equal(df.index, exp) + + def test_frame_from_dict_with_mixed_tzaware_indexes(self): + # GH#44091 + dti = date_range("2016-01-01", periods=3) + + ser1 = Series(range(3), index=dti) + ser2 = Series(range(3), index=dti.tz_localize("UTC")) + ser3 = Series(range(3), index=dti.tz_localize("US/Central")) + ser4 = Series(range(3)) + + # no tz-naive, but we do have mixed tzs and a non-DTI + df1 = DataFrame({"A": ser2, "B": ser3, "C": ser4}) + exp_index = Index( + list(ser2.index) + list(ser3.index) + list(ser4.index), dtype=object + ) + tm.assert_index_equal(df1.index, exp_index) + + df2 = DataFrame({"A": ser2, "C": ser4, "B": ser3}) + exp_index3 = Index( + list(ser2.index) + list(ser4.index) + list(ser3.index), dtype=object + ) + tm.assert_index_equal(df2.index, exp_index3) + + df3 = DataFrame({"B": ser3, "A": ser2, "C": ser4}) + exp_index3 = Index( + list(ser3.index) + list(ser2.index) + list(ser4.index), dtype=object + ) + tm.assert_index_equal(df3.index, exp_index3) + + df4 = DataFrame({"C": ser4, "B": ser3, "A": ser2}) + exp_index4 = Index( + list(ser4.index) + list(ser3.index) + list(ser2.index), dtype=object + ) + tm.assert_index_equal(df4.index, exp_index4) + + # TODO: not clear if these raising is desired (no extant tests), + # but this is de facto behavior 2021-12-22 + msg = "Cannot join tz-naive with tz-aware DatetimeIndex" + with pytest.raises(TypeError, match=msg): + DataFrame({"A": ser2, "B": ser3, "C": ser4, "D": ser1}) + with pytest.raises(TypeError, match=msg): + DataFrame({"A": ser2, "B": ser3, "D": ser1}) + with pytest.raises(TypeError, match=msg): + DataFrame({"D": ser1, "A": ser2, "B": ser3}) + + @pytest.mark.parametrize( + "key_val, col_vals, col_type", + [ + ["3", ["3", "4"], "utf8"], + [3, [3, 4], "int8"], + ], + ) + def test_dict_data_arrow_column_expansion(self, key_val, col_vals, col_type): + # GH 53617 + pa = pytest.importorskip("pyarrow") + cols = pd.arrays.ArrowExtensionArray( + pa.array(col_vals, type=pa.dictionary(pa.int8(), getattr(pa, col_type)())) + ) + result = DataFrame({key_val: [1, 2]}, columns=cols) + expected = DataFrame([[1, np.nan], [2, np.nan]], columns=cols) + expected.isetitem(1, expected.iloc[:, 1].astype(object)) + tm.assert_frame_equal(result, expected) + + +class TestDataFrameConstructorWithDtypeCoercion: + def test_floating_values_integer_dtype(self): + # GH#40110 make DataFrame behavior with arraylike floating data and + # inty dtype match Series behavior + + arr = np.random.default_rng(2).standard_normal((10, 5)) + + # GH#49599 in 2.0 we raise instead of either + # a) silently ignoring dtype and returningfloat (the old Series behavior) or + # b) rounding (the old DataFrame behavior) + msg = "Trying to coerce float values to integers" + with pytest.raises(ValueError, match=msg): + DataFrame(arr, dtype="i8") + + df = DataFrame(arr.round(), dtype="i8") + assert (df.dtypes == "i8").all() + + # with NaNs, we go through a different path with a different warning + arr[0, 0] = np.nan + msg = r"Cannot convert non-finite values \(NA or inf\) to integer" + with pytest.raises(IntCastingNaNError, match=msg): + DataFrame(arr, dtype="i8") + with pytest.raises(IntCastingNaNError, match=msg): + Series(arr[0], dtype="i8") + # The future (raising) behavior matches what we would get via astype: + msg = r"Cannot convert non-finite values \(NA or inf\) to integer" + with pytest.raises(IntCastingNaNError, match=msg): + DataFrame(arr).astype("i8") + with pytest.raises(IntCastingNaNError, match=msg): + Series(arr[0]).astype("i8") + + +class TestDataFrameConstructorWithDatetimeTZ: + @pytest.mark.parametrize("tz", ["US/Eastern", "dateutil/US/Eastern"]) + def test_construction_preserves_tzaware_dtypes(self, tz): + # after GH#7822 + # these retain the timezones on dict construction + dr = date_range("2011/1/1", "2012/1/1", freq="W-FRI") + dr_tz = dr.tz_localize(tz) + df = DataFrame({"A": "foo", "B": dr_tz}, index=dr) + tz_expected = DatetimeTZDtype("ns", dr_tz.tzinfo) + assert df["B"].dtype == tz_expected + + # GH#2810 (with timezones) + datetimes_naive = [ts.to_pydatetime() for ts in dr] + datetimes_with_tz = [ts.to_pydatetime() for ts in dr_tz] + df = DataFrame({"dr": dr}) + df["dr_tz"] = dr_tz + df["datetimes_naive"] = datetimes_naive + df["datetimes_with_tz"] = datetimes_with_tz + result = df.dtypes + expected = Series( + [ + np.dtype("datetime64[ns]"), + DatetimeTZDtype(tz=tz), + np.dtype("datetime64[ns]"), + DatetimeTZDtype(tz=tz), + ], + index=["dr", "dr_tz", "datetimes_naive", "datetimes_with_tz"], + ) + tm.assert_series_equal(result, expected) + + @pytest.mark.parametrize("pydt", [True, False]) + def test_constructor_data_aware_dtype_naive(self, tz_aware_fixture, pydt): + # GH#25843, GH#41555, GH#33401 + tz = tz_aware_fixture + ts = Timestamp("2019", tz=tz) + if pydt: + ts = ts.to_pydatetime() + + msg = ( + "Cannot convert timezone-aware data to timezone-naive dtype. " + r"Use pd.Series\(values\).dt.tz_localize\(None\) instead." + ) + with pytest.raises(ValueError, match=msg): + DataFrame({0: [ts]}, dtype="datetime64[ns]") + + msg2 = "Cannot unbox tzaware Timestamp to tznaive dtype" + with pytest.raises(TypeError, match=msg2): + DataFrame({0: ts}, index=[0], dtype="datetime64[ns]") + + with pytest.raises(ValueError, match=msg): + DataFrame([ts], dtype="datetime64[ns]") + + with pytest.raises(ValueError, match=msg): + DataFrame(np.array([ts], dtype=object), dtype="datetime64[ns]") + + with pytest.raises(TypeError, match=msg2): + DataFrame(ts, index=[0], columns=[0], dtype="datetime64[ns]") + + with pytest.raises(ValueError, match=msg): + DataFrame([Series([ts])], dtype="datetime64[ns]") + + with pytest.raises(ValueError, match=msg): + DataFrame([[ts]], columns=[0], dtype="datetime64[ns]") + + def test_from_dict(self): + # 8260 + # support datetime64 with tz + + idx = Index(date_range("20130101", periods=3, tz="US/Eastern"), name="foo") + dr = date_range("20130110", periods=3) + + # construction + df = DataFrame({"A": idx, "B": dr}) + assert df["A"].dtype, "M8[ns, US/Eastern" + assert df["A"].name == "A" + tm.assert_series_equal(df["A"], Series(idx, name="A")) + tm.assert_series_equal(df["B"], Series(dr, name="B")) + + def test_from_index(self): + # from index + idx2 = date_range("20130101", periods=3, tz="US/Eastern", name="foo") + df2 = DataFrame(idx2) + tm.assert_series_equal(df2["foo"], Series(idx2, name="foo")) + df2 = DataFrame(Series(idx2)) + tm.assert_series_equal(df2["foo"], Series(idx2, name="foo")) + + idx2 = date_range("20130101", periods=3, tz="US/Eastern") + df2 = DataFrame(idx2) + tm.assert_series_equal(df2[0], Series(idx2, name=0)) + df2 = DataFrame(Series(idx2)) + tm.assert_series_equal(df2[0], Series(idx2, name=0)) + + def test_frame_dict_constructor_datetime64_1680(self): + dr = date_range("1/1/2012", periods=10) + s = Series(dr, index=dr) + + # it works! + DataFrame({"a": "foo", "b": s}, index=dr) + DataFrame({"a": "foo", "b": s.values}, index=dr) + + def test_frame_datetime64_mixed_index_ctor_1681(self): + dr = date_range("2011/1/1", "2012/1/1", freq="W-FRI") + ts = Series(dr) + + # it works! + d = DataFrame({"A": "foo", "B": ts}, index=dr) + assert d["B"].isna().all() + + def test_frame_timeseries_column(self): + # GH19157 + dr = date_range( + start="20130101T10:00:00", periods=3, freq="min", tz="US/Eastern" + ) + result = DataFrame(dr, columns=["timestamps"]) + expected = DataFrame( + { + "timestamps": [ + Timestamp("20130101T10:00:00", tz="US/Eastern"), + Timestamp("20130101T10:01:00", tz="US/Eastern"), + Timestamp("20130101T10:02:00", tz="US/Eastern"), + ] + } + ) + tm.assert_frame_equal(result, expected) + + def test_nested_dict_construction(self): + # GH22227 + columns = ["Nevada", "Ohio"] + pop = { + "Nevada": {2001: 2.4, 2002: 2.9}, + "Ohio": {2000: 1.5, 2001: 1.7, 2002: 3.6}, + } + result = DataFrame(pop, index=[2001, 2002, 2003], columns=columns) + expected = DataFrame( + [(2.4, 1.7), (2.9, 3.6), (np.nan, np.nan)], + columns=columns, + index=Index([2001, 2002, 2003]), + ) + tm.assert_frame_equal(result, expected) + + def test_from_tzaware_object_array(self): + # GH#26825 2D object array of tzaware timestamps should not raise + dti = date_range("2016-04-05 04:30", periods=3, tz="UTC") + data = dti._data.astype(object).reshape(1, -1) + df = DataFrame(data) + assert df.shape == (1, 3) + assert (df.dtypes == dti.dtype).all() + assert (df == dti).all().all() + + def test_from_tzaware_mixed_object_array(self): + # GH#26825 + arr = np.array( + [ + [ + Timestamp("2013-01-01 00:00:00"), + Timestamp("2013-01-02 00:00:00"), + Timestamp("2013-01-03 00:00:00"), + ], + [ + Timestamp("2013-01-01 00:00:00-0500", tz="US/Eastern"), + pd.NaT, + Timestamp("2013-01-03 00:00:00-0500", tz="US/Eastern"), + ], + [ + Timestamp("2013-01-01 00:00:00+0100", tz="CET"), + pd.NaT, + Timestamp("2013-01-03 00:00:00+0100", tz="CET"), + ], + ], + dtype=object, + ).T + res = DataFrame(arr, columns=["A", "B", "C"]) + + expected_dtypes = [ + "datetime64[ns]", + "datetime64[ns, US/Eastern]", + "datetime64[ns, CET]", + ] + assert (res.dtypes == expected_dtypes).all() + + def test_from_2d_ndarray_with_dtype(self): + # GH#12513 + array_dim2 = np.arange(10).reshape((5, 2)) + df = DataFrame(array_dim2, dtype="datetime64[ns, UTC]") + + expected = DataFrame(array_dim2).astype("datetime64[ns, UTC]") + tm.assert_frame_equal(df, expected) + + @pytest.mark.parametrize("typ", [set, frozenset]) + def test_construction_from_set_raises(self, typ): + # https://github.com/pandas-dev/pandas/issues/32582 + values = typ({1, 2, 3}) + msg = f"'{typ.__name__}' type is unordered" + with pytest.raises(TypeError, match=msg): + DataFrame({"a": values}) + + with pytest.raises(TypeError, match=msg): + Series(values) + + def test_construction_from_ndarray_datetimelike(self): + # ensure the underlying arrays are properly wrapped as EA when + # constructed from 2D ndarray + arr = np.arange(0, 12, dtype="datetime64[ns]").reshape(4, 3) + df = DataFrame(arr) + assert all(isinstance(arr, DatetimeArray) for arr in df._mgr.arrays) + + def test_construction_from_ndarray_with_eadtype_mismatched_columns(self): + arr = np.random.default_rng(2).standard_normal((10, 2)) + dtype = pd.array([2.0]).dtype + msg = r"len\(arrays\) must match len\(columns\)" + with pytest.raises(ValueError, match=msg): + DataFrame(arr, columns=["foo"], dtype=dtype) + + arr2 = pd.array([2.0, 3.0, 4.0]) + with pytest.raises(ValueError, match=msg): + DataFrame(arr2, columns=["foo", "bar"]) + + def test_columns_indexes_raise_on_sets(self): + # GH 47215 + data = [[1, 2, 3], [4, 5, 6]] + with pytest.raises(ValueError, match="index cannot be a set"): + DataFrame(data, index={"a", "b"}) + with pytest.raises(ValueError, match="columns cannot be a set"): + DataFrame(data, columns={"a", "b", "c"}) + + # TODO: make this not cast to object in pandas 3.0 + @pytest.mark.skipif( + not np_version_gt2, reason="StringDType only available in numpy 2 and above" + ) + @pytest.mark.parametrize( + "data", + [ + {"a": ["a", "b", "c"], "b": [1.0, 2.0, 3.0], "c": ["d", "e", "f"]}, + ], + ) + def test_np_string_array_object_cast(self, data): + from numpy.dtypes import StringDType + + data["a"] = np.array(data["a"], dtype=StringDType()) + res = DataFrame(data) + assert res["a"].dtype == np.object_ + assert (res["a"] == data["a"]).all() + + +def get1(obj): # TODO: make a helper in tm? + if isinstance(obj, Series): + return obj.iloc[0] + else: + return obj.iloc[0, 0] + + +class TestFromScalar: + @pytest.fixture(params=[list, dict, None]) + def box(self, request): + return request.param + + @pytest.fixture + def constructor(self, frame_or_series, box): + extra = {"index": range(2)} + if frame_or_series is DataFrame: + extra["columns"] = ["A"] + + if box is None: + return functools.partial(frame_or_series, **extra) + + elif box is dict: + if frame_or_series is Series: + return lambda x, **kwargs: frame_or_series( + {0: x, 1: x}, **extra, **kwargs + ) + else: + return lambda x, **kwargs: frame_or_series({"A": x}, **extra, **kwargs) + elif frame_or_series is Series: + return lambda x, **kwargs: frame_or_series([x, x], **extra, **kwargs) + else: + return lambda x, **kwargs: frame_or_series({"A": [x, x]}, **extra, **kwargs) + + @pytest.mark.parametrize("dtype", ["M8[ns]", "m8[ns]"]) + def test_from_nat_scalar(self, dtype, constructor): + obj = constructor(pd.NaT, dtype=dtype) + assert np.all(obj.dtypes == dtype) + assert np.all(obj.isna()) + + def test_from_timedelta_scalar_preserves_nanos(self, constructor): + td = Timedelta(1) + + obj = constructor(td, dtype="m8[ns]") + assert get1(obj) == td + + def test_from_timestamp_scalar_preserves_nanos(self, constructor, fixed_now_ts): + ts = fixed_now_ts + Timedelta(1) + + obj = constructor(ts, dtype="M8[ns]") + assert get1(obj) == ts + + def test_from_timedelta64_scalar_object(self, constructor): + td = Timedelta(1) + td64 = td.to_timedelta64() + + obj = constructor(td64, dtype=object) + assert isinstance(get1(obj), np.timedelta64) + + @pytest.mark.parametrize("cls", [np.datetime64, np.timedelta64]) + def test_from_scalar_datetimelike_mismatched(self, constructor, cls): + scalar = cls("NaT", "ns") + dtype = {np.datetime64: "m8[ns]", np.timedelta64: "M8[ns]"}[cls] + + if cls is np.datetime64: + msg1 = "Invalid type for timedelta scalar: " + else: + msg1 = " is not convertible to datetime" + msg = "|".join(["Cannot cast", msg1]) + + with pytest.raises(TypeError, match=msg): + constructor(scalar, dtype=dtype) + + scalar = cls(4, "ns") + with pytest.raises(TypeError, match=msg): + constructor(scalar, dtype=dtype) + + @pytest.mark.parametrize("cls", [datetime, np.datetime64]) + def test_from_out_of_bounds_ns_datetime( + self, constructor, cls, request, box, frame_or_series + ): + # scalar that won't fit in nanosecond dt64, but will fit in microsecond + if box is list or (frame_or_series is Series and box is dict): + mark = pytest.mark.xfail( + reason="Timestamp constructor has been updated to cast dt64 to " + "non-nano, but DatetimeArray._from_sequence has not", + strict=True, + ) + request.applymarker(mark) + + scalar = datetime(9999, 1, 1) + exp_dtype = "M8[us]" # pydatetime objects default to this reso + + if cls is np.datetime64: + scalar = np.datetime64(scalar, "D") + exp_dtype = "M8[s]" # closest reso to input + result = constructor(scalar) + + item = get1(result) + dtype = tm.get_dtype(result) + + assert type(item) is Timestamp + assert item.asm8.dtype == exp_dtype + assert dtype == exp_dtype + + @pytest.mark.skip_ubsan + def test_out_of_s_bounds_datetime64(self, constructor): + scalar = np.datetime64(np.iinfo(np.int64).max, "D") + result = constructor(scalar) + item = get1(result) + assert type(item) is np.datetime64 + dtype = tm.get_dtype(result) + assert dtype == object + + @pytest.mark.parametrize("cls", [timedelta, np.timedelta64]) + def test_from_out_of_bounds_ns_timedelta( + self, constructor, cls, request, box, frame_or_series + ): + # scalar that won't fit in nanosecond td64, but will fit in microsecond + if box is list or (frame_or_series is Series and box is dict): + mark = pytest.mark.xfail( + reason="TimedeltaArray constructor has been updated to cast td64 " + "to non-nano, but TimedeltaArray._from_sequence has not", + strict=True, + ) + request.applymarker(mark) + + scalar = datetime(9999, 1, 1) - datetime(1970, 1, 1) + exp_dtype = "m8[us]" # smallest reso that fits + if cls is np.timedelta64: + scalar = np.timedelta64(scalar, "D") + exp_dtype = "m8[s]" # closest reso to input + result = constructor(scalar) + + item = get1(result) + dtype = tm.get_dtype(result) + + assert type(item) is Timedelta + assert item.asm8.dtype == exp_dtype + assert dtype == exp_dtype + + @pytest.mark.skip_ubsan + @pytest.mark.parametrize("cls", [np.datetime64, np.timedelta64]) + def test_out_of_s_bounds_timedelta64(self, constructor, cls): + scalar = cls(np.iinfo(np.int64).max, "D") + result = constructor(scalar) + item = get1(result) + assert type(item) is cls + dtype = tm.get_dtype(result) + assert dtype == object + + def test_tzaware_data_tznaive_dtype(self, constructor, box, frame_or_series): + tz = "US/Eastern" + ts = Timestamp("2019", tz=tz) + + if box is None or (frame_or_series is DataFrame and box is dict): + msg = "Cannot unbox tzaware Timestamp to tznaive dtype" + err = TypeError + else: + msg = ( + "Cannot convert timezone-aware data to timezone-naive dtype. " + r"Use pd.Series\(values\).dt.tz_localize\(None\) instead." + ) + err = ValueError + + with pytest.raises(err, match=msg): + constructor(ts, dtype="M8[ns]") + + +# TODO: better location for this test? +class TestAllowNonNano: + # Until 2.0, we do not preserve non-nano dt64/td64 when passed as ndarray, + # but do preserve it when passed as DTA/TDA + + @pytest.fixture(params=[True, False]) + def as_td(self, request): + return request.param + + @pytest.fixture + def arr(self, as_td): + values = np.arange(5).astype(np.int64).view("M8[s]") + if as_td: + values = values - values[0] + return TimedeltaArray._simple_new(values, dtype=values.dtype) + else: + return DatetimeArray._simple_new(values, dtype=values.dtype) + + def test_index_allow_non_nano(self, arr): + idx = Index(arr) + assert idx.dtype == arr.dtype + + def test_dti_tdi_allow_non_nano(self, arr, as_td): + if as_td: + idx = pd.TimedeltaIndex(arr) + else: + idx = DatetimeIndex(arr) + assert idx.dtype == arr.dtype + + def test_series_allow_non_nano(self, arr): + ser = Series(arr) + assert ser.dtype == arr.dtype + + def test_frame_allow_non_nano(self, arr): + df = DataFrame(arr) + assert df.dtypes[0] == arr.dtype + + def test_frame_from_dict_allow_non_nano(self, arr): + df = DataFrame({0: arr}) + assert df.dtypes[0] == arr.dtype diff --git a/shared/package-files/9b/9ba66c370c751a1b0492d42beb73715c74245f607b36d8b4d755d8b0f836c5fa/blob b/shared/package-files/9b/9ba66c370c751a1b0492d42beb73715c74245f607b36d8b4d755d8b0f836c5fa/blob new file mode 100644 index 0000000000000000000000000000000000000000..52a1e228e01f1d6c3c37a5e2d49d843f0a4573f9 --- /dev/null +++ b/shared/package-files/9b/9ba66c370c751a1b0492d42beb73715c74245f607b36d8b4d755d8b0f836c5fa/blob @@ -0,0 +1,112 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +#pragma once + +#include +#include + +#include "arrow/buffer.h" +#include "arrow/memory_pool.h" +#include "arrow/result.h" +#include "arrow/util/bit_util.h" +#include "arrow/util/visibility.h" + +namespace arrow { +namespace internal { + +// A std::generate() like function to write sequential bits into a bitmap area. +// Bits preceding the bitmap area are preserved, bits following the bitmap +// area may be clobbered. + +template +void GenerateBits(uint8_t* bitmap, int64_t start_offset, int64_t length, Generator&& g) { + if (length == 0) { + return; + } + uint8_t* cur = bitmap + start_offset / 8; + uint8_t bit_mask = bit_util::kBitmask[start_offset % 8]; + uint8_t current_byte = *cur & bit_util::kPrecedingBitmask[start_offset % 8]; + + for (int64_t index = 0; index < length; ++index) { + const bool bit = g(); + current_byte = bit ? (current_byte | bit_mask) : current_byte; + bit_mask = static_cast(bit_mask << 1); + if (bit_mask == 0) { + bit_mask = 1; + *cur++ = current_byte; + current_byte = 0; + } + } + if (bit_mask != 1) { + *cur++ = current_byte; + } +} + +// Like GenerateBits(), but unrolls its main loop for higher performance. + +template +void GenerateBitsUnrolled(uint8_t* bitmap, int64_t start_offset, int64_t length, + Generator&& g) { + static_assert(std::is_same()()), bool>::value, + "Functor passed to GenerateBitsUnrolled must return bool"); + + if (length == 0) { + return; + } + uint8_t current_byte; + uint8_t* cur = bitmap + start_offset / 8; + const uint64_t start_bit_offset = start_offset % 8; + uint8_t bit_mask = bit_util::kBitmask[start_bit_offset]; + int64_t remaining = length; + + if (bit_mask != 0x01) { + current_byte = *cur & bit_util::kPrecedingBitmask[start_bit_offset]; + while (bit_mask != 0 && remaining > 0) { + current_byte |= g() * bit_mask; + bit_mask = static_cast(bit_mask << 1); + --remaining; + } + *cur++ = current_byte; + } + + int64_t remaining_bytes = remaining / 8; + uint8_t out_results[8]; + while (remaining_bytes-- > 0) { + for (int i = 0; i < 8; ++i) { + out_results[i] = g(); + } + *cur++ = static_cast(out_results[0] | out_results[1] << 1 | + out_results[2] << 2 | out_results[3] << 3 | + out_results[4] << 4 | out_results[5] << 5 | + out_results[6] << 6 | out_results[7] << 7); + } + + int64_t remaining_bits = remaining % 8; + if (remaining_bits) { + current_byte = 0; + bit_mask = 0x01; + while (remaining_bits-- > 0) { + current_byte |= g() * bit_mask; + bit_mask = static_cast(bit_mask << 1); + } + *cur++ = current_byte; + } +} + +} // namespace internal +} // namespace arrow diff --git a/shared/package-files/9b/9ba7b5b1a97124d16a01ca9921b766b8f2bf995761f7f4d5a4776df91868353d/blob b/shared/package-files/9b/9ba7b5b1a97124d16a01ca9921b766b8f2bf995761f7f4d5a4776df91868353d/blob new file mode 100644 index 0000000000000000000000000000000000000000..bf1ffee2d0f43ffd4f9bf875043b3311034f1662 --- /dev/null +++ b/shared/package-files/9b/9ba7b5b1a97124d16a01ca9921b766b8f2bf995761f7f4d5a4776df91868353d/blob @@ -0,0 +1,13 @@ +*** Mon, 25 Jul 2016 11:30:46 *** +TEST FOR GRANGER-CAUSALITY: +H0: "Dp" do not Granger-cause "R" + +Test statistic l = 0.7474 +pval-F( l; 4, 176) = 0.5610 + +TEST FOR INSTANTANEOUS CAUSALITY: +H0: No instantaneous causality between "Dp" and "R" + +Test statistic: c = 0.4071 +pval-Chi( c; 1) = 0.5235 + diff --git a/shared/package-files/9b/9ba83d68aa04604bf5a01639e2de6d3a6d1664d53df4772464f89584fa6c8199/blob b/shared/package-files/9b/9ba83d68aa04604bf5a01639e2de6d3a6d1664d53df4772464f89584fa6c8199/blob new file mode 100644 index 0000000000000000000000000000000000000000..a0bcce549703213bb7dfb456bbb58d665d1c8689 --- /dev/null +++ b/shared/package-files/9b/9ba83d68aa04604bf5a01639e2de6d3a6d1664d53df4772464f89584fa6c8199/blob @@ -0,0 +1,134 @@ +"""Unit tests for the :mod:`networkx.generators.harary_graph` module. +""" + +import pytest + +import networkx as nx +from networkx.algorithms.isomorphism.isomorph import is_isomorphic +from networkx.generators.harary_graph import hkn_harary_graph, hnm_harary_graph + + +class TestHararyGraph: + """ + Suppose n nodes, m >= n-1 edges, d = 2m // n, r = 2m % n + """ + + def test_hnm_harary_graph(self): + # When d is even and r = 0, the hnm_harary_graph(n,m) is + # the circulant_graph(n, list(range(1,d/2+1))) + for n, m in [(5, 5), (6, 12), (7, 14)]: + G1 = hnm_harary_graph(n, m) + d = 2 * m // n + G2 = nx.circulant_graph(n, list(range(1, d // 2 + 1))) + assert is_isomorphic(G1, G2) + + # When d is even and r > 0, the hnm_harary_graph(n,m) is + # the circulant_graph(n, list(range(1,d/2+1))) + # with r edges added arbitrarily + for n, m in [(5, 7), (6, 13), (7, 16)]: + G1 = hnm_harary_graph(n, m) + d = 2 * m // n + G2 = nx.circulant_graph(n, list(range(1, d // 2 + 1))) + assert set(G2.edges) < set(G1.edges) + assert G1.number_of_edges() == m + + # When d is odd and n is even and r = 0, the hnm_harary_graph(n,m) + # is the circulant_graph(n, list(range(1,(d+1)/2) plus [n//2]) + for n, m in [(6, 9), (8, 12), (10, 15)]: + G1 = hnm_harary_graph(n, m) + d = 2 * m // n + L = list(range(1, (d + 1) // 2)) + L.append(n // 2) + G2 = nx.circulant_graph(n, L) + assert is_isomorphic(G1, G2) + + # When d is odd and n is even and r > 0, the hnm_harary_graph(n,m) + # is the circulant_graph(n, list(range(1,(d+1)/2) plus [n//2]) + # with r edges added arbitrarily + for n, m in [(6, 10), (8, 13), (10, 17)]: + G1 = hnm_harary_graph(n, m) + d = 2 * m // n + L = list(range(1, (d + 1) // 2)) + L.append(n // 2) + G2 = nx.circulant_graph(n, L) + assert set(G2.edges) < set(G1.edges) + assert G1.number_of_edges() == m + + # When d is odd and n is odd, the hnm_harary_graph(n,m) is + # the circulant_graph(n, list(range(1,(d+1)/2)) + # with m - n*(d-1)/2 edges added arbitrarily + for n, m in [(5, 4), (7, 12), (9, 14)]: + G1 = hnm_harary_graph(n, m) + d = 2 * m // n + L = list(range(1, (d + 1) // 2)) + G2 = nx.circulant_graph(n, L) + assert set(G2.edges) < set(G1.edges) + assert G1.number_of_edges() == m + + # Raise NetworkXError if n<1 + n = 0 + m = 0 + pytest.raises(nx.NetworkXError, hnm_harary_graph, n, m) + + # Raise NetworkXError if m < n-1 + n = 6 + m = 4 + pytest.raises(nx.NetworkXError, hnm_harary_graph, n, m) + + # Raise NetworkXError if m > n(n-1)/2 + n = 6 + m = 16 + pytest.raises(nx.NetworkXError, hnm_harary_graph, n, m) + + """ + Suppose connectivity k, number of nodes n + """ + + def test_hkn_harary_graph(self): + # When k == 1, the hkn_harary_graph(k,n) is + # the path_graph(n) + for k, n in [(1, 6), (1, 7)]: + G1 = hkn_harary_graph(k, n) + G2 = nx.path_graph(n) + assert is_isomorphic(G1, G2) + + # When k is even, the hkn_harary_graph(k,n) is + # the circulant_graph(n, list(range(1,k/2+1))) + for k, n in [(2, 6), (2, 7), (4, 6), (4, 7)]: + G1 = hkn_harary_graph(k, n) + G2 = nx.circulant_graph(n, list(range(1, k // 2 + 1))) + assert is_isomorphic(G1, G2) + + # When k is odd and n is even, the hkn_harary_graph(k,n) is + # the circulant_graph(n, list(range(1,(k+1)/2)) plus [n/2]) + for k, n in [(3, 6), (5, 8), (7, 10)]: + G1 = hkn_harary_graph(k, n) + L = list(range(1, (k + 1) // 2)) + L.append(n // 2) + G2 = nx.circulant_graph(n, L) + assert is_isomorphic(G1, G2) + + # When k is odd and n is odd, the hkn_harary_graph(k,n) is + # the circulant_graph(n, list(range(1,(k+1)/2))) with + # n//2+1 edges added between node i and node i+n//2+1 + for k, n in [(3, 5), (5, 9), (7, 11)]: + G1 = hkn_harary_graph(k, n) + G2 = nx.circulant_graph(n, list(range(1, (k + 1) // 2))) + eSet1 = set(G1.edges) + eSet2 = set(G2.edges) + eSet3 = set() + half = n // 2 + for i in range(0, half + 1): + # add half+1 edges between i and i+half + eSet3.add((i, (i + half) % n)) + assert eSet1 == eSet2 | eSet3 + + # Raise NetworkXError if k<1 + k = 0 + n = 0 + pytest.raises(nx.NetworkXError, hkn_harary_graph, k, n) + + # Raise NetworkXError if n +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API ::std::tuple _sparse_mm_reduce_impl_backward_sparse_csr_cpu(const at::Tensor & self, const at::Tensor & grad_out, const at::Tensor & weight, c10::string_view reduce, const at::Tensor & arg_out, ::std::array output_mask); +} // namespace native +} // namespace at diff --git a/shared/package-files/9b/9bad0d576be9d044a40fc47f63eef2405aa3c02802ab46cb5c458684f2d203e0/blob b/shared/package-files/9b/9bad0d576be9d044a40fc47f63eef2405aa3c02802ab46cb5c458684f2d203e0/blob new file mode 100644 index 0000000000000000000000000000000000000000..5e3c76c8a2911d5eb5783eb21ed027102cbacb8b --- /dev/null +++ b/shared/package-files/9b/9bad0d576be9d044a40fc47f63eef2405aa3c02802ab46cb5c458684f2d203e0/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::linalg_ldl_solve(Tensor LD, Tensor pivots, Tensor B, *, bool hermitian=False) -> Tensor +inline at::Tensor linalg_ldl_solve(const at::Tensor & LD, const at::Tensor & pivots, const at::Tensor & B, bool hermitian=false) { + return at::_ops::linalg_ldl_solve::call(LD, pivots, B, hermitian); +} + +// aten::linalg_ldl_solve.out(Tensor LD, Tensor pivots, Tensor B, *, bool hermitian=False, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & linalg_ldl_solve_out(at::Tensor & out, const at::Tensor & LD, const at::Tensor & pivots, const at::Tensor & B, bool hermitian=false) { + return at::_ops::linalg_ldl_solve_out::call(LD, pivots, B, hermitian, out); +} +// aten::linalg_ldl_solve.out(Tensor LD, Tensor pivots, Tensor B, *, bool hermitian=False, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & linalg_ldl_solve_outf(const at::Tensor & LD, const at::Tensor & pivots, const at::Tensor & B, bool hermitian, at::Tensor & out) { + return at::_ops::linalg_ldl_solve_out::call(LD, pivots, B, hermitian, out); +} + +} diff --git a/shared/package-files/9b/9bb2952f961048e8f48e61aca7a857e7d758275e1142060a8b2fbf90bdcfb324/blob b/shared/package-files/9b/9bb2952f961048e8f48e61aca7a857e7d758275e1142060a8b2fbf90bdcfb324/blob new file mode 100644 index 0000000000000000000000000000000000000000..9f7670c35a1a443d727d9e5e8d51099e124d48a6 --- /dev/null +++ b/shared/package-files/9b/9bb2952f961048e8f48e61aca7a857e7d758275e1142060a8b2fbf90bdcfb324/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & linalg_matrix_exp_out(at::Tensor & out, const at::Tensor & self); +TORCH_API at::Tensor & linalg_matrix_exp_outf(const at::Tensor & self, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9b/9bb4b26763bf28f482225d72a1f33a4133b04079de1f29b3f1182b0c36b420e4/blob b/shared/package-files/9b/9bb4b26763bf28f482225d72a1f33a4133b04079de1f29b3f1182b0c36b420e4/blob new file mode 100644 index 0000000000000000000000000000000000000000..9c5fc8786c7c63c589fb31df1baf2a48e0422ff4 --- /dev/null +++ b/shared/package-files/9b/9bb4b26763bf28f482225d72a1f33a4133b04079de1f29b3f1182b0c36b420e4/blob @@ -0,0 +1,87 @@ +import numpy as np +import pytest + +from pandas import ( + DataFrame, + HDFStore, + Index, + Series, + date_range, +) +from pandas.tests.io.pytables.common import ( + ensure_clean_store, + tables, +) + +pytestmark = [pytest.mark.single_cpu] + + +def test_keys(setup_path): + with ensure_clean_store(setup_path) as store: + store["a"] = Series( + np.arange(10, dtype=np.float64), index=date_range("2020-01-01", periods=10) + ) + store["b"] = Series( + range(10), dtype="float64", index=[f"i_{i}" for i in range(10)] + ) + store["c"] = DataFrame( + 1.1 * np.arange(120).reshape((30, 4)), + columns=Index(list("ABCD"), dtype=object), + index=Index([f"i-{i}" for i in range(30)], dtype=object), + ) + + assert len(store) == 3 + expected = {"/a", "/b", "/c"} + assert set(store.keys()) == expected + assert set(store) == expected + + +def test_non_pandas_keys(tmp_path, setup_path): + class Table1(tables.IsDescription): + value1 = tables.Float32Col() + + class Table2(tables.IsDescription): + value2 = tables.Float32Col() + + class Table3(tables.IsDescription): + value3 = tables.Float32Col() + + path = tmp_path / setup_path + with tables.open_file(path, mode="w") as h5file: + group = h5file.create_group("/", "group") + h5file.create_table(group, "table1", Table1, "Table 1") + h5file.create_table(group, "table2", Table2, "Table 2") + h5file.create_table(group, "table3", Table3, "Table 3") + with HDFStore(path) as store: + assert len(store.keys(include="native")) == 3 + expected = {"/group/table1", "/group/table2", "/group/table3"} + assert set(store.keys(include="native")) == expected + assert set(store.keys(include="pandas")) == set() + for name in expected: + df = store.get(name) + assert len(df.columns) == 1 + + +def test_keys_illegal_include_keyword_value(setup_path): + with ensure_clean_store(setup_path) as store: + with pytest.raises( + ValueError, + match="`include` should be either 'pandas' or 'native' but is 'illegal'", + ): + store.keys(include="illegal") + + +def test_keys_ignore_hdf_softlink(setup_path): + # GH 20523 + # Puts a softlink into HDF file and rereads + + with ensure_clean_store(setup_path) as store: + df = DataFrame({"A": range(5), "B": range(5)}) + store.put("df", df) + + assert store.keys() == ["/df"] + + store._handle.create_soft_link(store._handle.root, "symlink", "df") + + # Should ignore the softlink + assert store.keys() == ["/df"] diff --git a/shared/package-files/9b/9bb4d3489b79cd464a245f8c414793b42cb15bb6304414844c835718f16ef12e/blob b/shared/package-files/9b/9bb4d3489b79cd464a245f8c414793b42cb15bb6304414844c835718f16ef12e/blob new file mode 100644 index 0000000000000000000000000000000000000000..68c1b3b31c5dea2377fec414bb2dd3b95aa7c88a --- /dev/null +++ b/shared/package-files/9b/9bb4d3489b79cd464a245f8c414793b42cb15bb6304414844c835718f16ef12e/blob @@ -0,0 +1,27 @@ +import os +import sys +import pytest + +import numpy as np +from . import util + + +class TestCommonBlock(util.F2PyTest): + sources = [util.getpath("tests", "src", "common", "block.f")] + + @pytest.mark.skipif(sys.platform == "win32", + reason="Fails with MinGW64 Gfortran (Issue #9673)") + def test_common_block(self): + self.module.initcb() + assert self.module.block.long_bn == np.array(1.0, dtype=np.float64) + assert self.module.block.string_bn == np.array("2", dtype="|S1") + assert self.module.block.ok == np.array(3, dtype=np.int32) + + +class TestCommonWithUse(util.F2PyTest): + sources = [util.getpath("tests", "src", "common", "gh19161.f90")] + + @pytest.mark.skipif(sys.platform == "win32", + reason="Fails with MinGW64 Gfortran (Issue #9673)") + def test_common_gh19161(self): + assert self.module.data.x == 0 diff --git a/shared/package-files/9b/9bb5173540efe2a232bda716d98f832fef2d6f68a433c8af57ebc2e125987c7c/blob b/shared/package-files/9b/9bb5173540efe2a232bda716d98f832fef2d6f68a433c8af57ebc2e125987c7c/blob new file mode 100644 index 0000000000000000000000000000000000000000..f36837ed674e9e21511fb6a22834cab0ca1a0602 --- /dev/null +++ b/shared/package-files/9b/9bb5173540efe2a232bda716d98f832fef2d6f68a433c8af57ebc2e125987c7c/blob @@ -0,0 +1,238 @@ +# This module provides a FAST (on GPU) content addressable store for storages +# (and tensors on top of them) with VERY WEAK portability guarantees (e.g., +# don't expect CPU/CUDA to address to the same hash, don't expect it to be +# portable across devices) that is NOT cryptographically secure. In return, +# we are able to hash 40G of tensor data on GPU in less than a second, +# compared to running SHA-1 in CPU which would a minute or so. The primary +# use case is for efficiently snapshotting intermediate tensor data for +# offline debugging, but it's been put in this module in case you think of +# another use case for it. The hash function could be replaced with a +# straight reimplementation of SHA-1, which would give us much stronger +# portability guarantees. +# +# WARNING: THERE IS NO BC/FC GUARANTEE FOR THIS FORMAT! If you need to format +# shift the result, consider packing it into a single torch.save object +# with traditional view sharing. +# +# Because of the weak portability guarantees, you can only write to the +# content store from a single process; we don't provide any capability +# of "reopening" a content store to add more things to it. But we don't +# assume that you can keep all of the tensors you want to add to the store +# in memory at once, because you probably can't! Nor do we assume that +# you know a priori whether or not two storages can be deduplicated or not. +# +# Note: only storages are content-addressed; tensors are name addressed +# +# Note: our padding strategy means that [1, 0] and [1] int16 tensors would +# map to the same (padded) storage. We think this will be immaterial for most +# users. + +import ctypes +import functools +import hashlib +import os.path +import struct +from collections import defaultdict +from typing import Dict, Optional, Set + +import torch +import torch._prims as prims +import torch._utils +import torch.nn.functional as F +from torch._C import default_generator + +from torch.multiprocessing.reductions import StorageWeakRef + + +def lazy_compile(**compile_kwargs): + """Lazily wrap a function with torch.compile on the first call + + This avoids eagerly importing dynamo. + """ + + def decorate_fn(fn): + @functools.wraps(fn) + def compile_hook(*args, **kwargs): + compiled_fn = torch.compile(fn, **compile_kwargs) + globals()[fn.__name__] = functools.wraps(fn)(compiled_fn) + return compiled_fn(*args, **kwargs) + + return compile_hook + + return decorate_fn + + +# Use of torch.compile is mandatory for (1) good memory usage +# and (2) xor_sum implementation. This is our first instance of +# using PT2 to implement a kernel in PyTorch; if we get AOT capabilities +# it would be good to apply it here. +@lazy_compile(dynamic=True) +def hash_storage_kernel(x): + # The randint calls are carefully written to hit things we + # have lowerings for in inductor. Lack of unsigned 32-bit integer + # is a pain. + a = torch.randint( + -(2**31), 2**31, x.shape, device=x.device, dtype=torch.int32 + ).abs() + a = ((a % (2**31 - 1)) + 1).long() + b = ( + torch.randint(-(2**31), 2**31, x.shape, device=x.device, dtype=torch.int32) + .abs() + .long() + ) + # This is a standard shift-multiply universal hash family + # plus xor sum hash, using Philox to generate random numbers. + # Our Philox RNG is not deterministic across devices so + # don't use this for stable hashing. + # + # This assumes fixed length so you're also obligated to bucket + # by the length of tensor as well + return prims.xor_sum((a * x + b).int(), [0]) + + +# Returns a hex digest of the data in the storage. Guaranteed to be +# SHA-1 if stable_hash=True, otherwise it will consistent for a single +# process run but not necessarily across processes. +def hash_storage(storage: torch.UntypedStorage, *, stable_hash: bool = False) -> str: + import torch._dynamo + from torch._dynamo.utils import is_compile_supported + + device_type = storage.device.type + if stable_hash or not is_compile_supported(device_type): + cpu_storage = storage.cpu() + # TODO: make storage support buffer protocol so this isn't + # necessary + buf = (ctypes.c_byte * cpu_storage.nbytes()).from_address( + cpu_storage.data_ptr() + ) + sha1 = hashlib.sha1() + sha1.update(buf) + return sha1.hexdigest() + + # TODO: factor this into a random utility + if device_type == "cpu": + generator = default_generator + elif device_type == "cuda": + import torch.cuda + + generator = torch.cuda.default_generators[storage.device.index] + else: + raise AssertionError(f"unhandled device type {device_type}") + state = generator.get_state() + try: + generator.manual_seed(0) + x = torch.empty(0, dtype=torch.uint8, device=storage.device).set_(storage) # type: ignore[call-overload] + # The dtype-casting view cannot be compiled, and so the + # padding/reshaping also needs to be done externally even + # though it could be profitably fused + pad = -x.numel() % 4 + if pad > 0: + x = F.pad(x, (0, pad), "constant", 0) + x = x.view(torch.int32) + # We run the 32-bit hash five times with differing parameters to + # reduce chance of collision + ITER = 5 + cs = [hash_storage_kernel(x).item() for _ in range(ITER)] + return struct.pack(">" + "i" * ITER, *cs).hex() + finally: + generator.set_state(state) + + +class ContentStoreWriter: + # Structure: + # storages/ + # 00/ + # 0000..00 + # tensors/ + # name + def __init__(self, loc: str, stable_hash: bool = False) -> None: + self.loc: str = loc + self.seen_storage_hashes: Set[str] = set() + self.stable_hash = stable_hash + + # TODO: offer some sort of non-blocking API to speed things up + def write_storage(self, storage: torch.UntypedStorage) -> str: + h = hash_storage(storage, stable_hash=self.stable_hash) + if h in self.seen_storage_hashes: + return h + # TODO: consider not using torch.save for this; we don't actually + # need any metadata for the storage + subfolder = os.path.join(self.loc, "storages") + os.makedirs(subfolder, exist_ok=True) + target = os.path.join(subfolder, h) + if os.path.exists(target): + return h + torch.save(storage, target) + self.seen_storage_hashes.add(h) + return h + + def compute_tensor_metadata(self, t: torch.Tensor, h=None): + if h is None: + h = hash_storage(t.untyped_storage(), stable_hash=self.stable_hash) + return ( + t.dtype, + h, + t.storage_offset(), + tuple(t.shape), + t.stride(), + torch._utils.get_tensor_metadata(t), + ) + + def write_tensor(self, name: str, t: torch.Tensor) -> None: + storage = t.untyped_storage() + h = self.write_storage(storage) + # TODO: Support more advanced snapshotting of requires_grad/grad/etc + d, f = os.path.split(name) + payload = self.compute_tensor_metadata(t, h=h) + subfolder = os.path.join(self.loc, "tensors", d) + os.makedirs(subfolder, exist_ok=True) + torch.save(payload, os.path.join(subfolder, f)) + + +class ContentStoreReader: + def __init__(self, loc: str, *, cache=True) -> None: + self.loc = loc + self.storage_cache: Optional[ + Dict[Optional[torch.device], Dict[str, StorageWeakRef]] + ] = None + if cache: + self.storage_cache = defaultdict(dict) + + def read_storage(self, h: str, *, device=None) -> torch.UntypedStorage: + if device is not None: + device = torch.device(device) + ws = ( + self.storage_cache[device].get(h) + if self.storage_cache is not None + else None + ) + s: Optional[torch.UntypedStorage] + if ws is not None: + s = torch.UntypedStorage._new_with_weak_ptr(ws.cdata) + if s is not None: + return s + s = torch.load( + os.path.join(self.loc, "storages", h), + weights_only=True, + map_location=device, + )._untyped_storage + assert s is not None + if self.storage_cache is not None: + self.storage_cache[device][h] = StorageWeakRef(s) + return s + + def read_tensor_metadata(self, name: str): + fn = os.path.join(self.loc, "tensors", name) + if not os.path.exists(fn): + raise FileNotFoundError(fn) + return torch.load(fn, weights_only=True) + + def read_tensor(self, name: str, *, device=None) -> torch.Tensor: + dtype, h, storage_offset, size, stride, metadata = self.read_tensor_metadata( + name + ) + storage = self.read_storage(h, device=device) + t = torch.tensor([], dtype=dtype, device=storage.device) + t.set_(storage, storage_offset, size, stride) + torch._utils.set_tensor_metadata(t, metadata) + return t diff --git a/shared/package-files/9b/9bb66ea9004589c512c42082d0b3df13269584381b71d48b1fd653d087e57e05/blob b/shared/package-files/9b/9bb66ea9004589c512c42082d0b3df13269584381b71d48b1fd653d087e57e05/blob new file mode 100644 index 0000000000000000000000000000000000000000..5ae99c1e998cd07324c163d5b42686d33c57d66d --- /dev/null +++ b/shared/package-files/9b/9bb66ea9004589c512c42082d0b3df13269584381b71d48b1fd653d087e57e05/blob @@ -0,0 +1,24 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor __xor__(const at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor & __ixor__(at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor __xor__(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & __ixor__(at::Tensor & self, const at::Tensor & other); +} // namespace native +} // namespace at diff --git a/shared/package-files/9b/9bb703920eca4b6119e81a105583a4f6ca220651f13b418479ab7cd56c413f3e/blob b/shared/package-files/9b/9bb703920eca4b6119e81a105583a4f6ca220651f13b418479ab7cd56c413f3e/blob new file mode 100644 index 0000000000000000000000000000000000000000..09e54e5c7c5bb2384e37626d4b985cfad29ed29b Binary files /dev/null and b/shared/package-files/9b/9bb703920eca4b6119e81a105583a4f6ca220651f13b418479ab7cd56c413f3e/blob differ diff --git a/shared/package-files/9b/9bb75c27f1e031706112f6db5ea386184d3b5af076ce1d65456d3dbc1a3c0f14/README.md b/shared/package-files/9b/9bb75c27f1e031706112f6db5ea386184d3b5af076ce1d65456d3dbc1a3c0f14/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d3f9ff177f231c11e382c2509ccdfc37ba054182 --- /dev/null +++ b/shared/package-files/9b/9bb75c27f1e031706112f6db5ea386184d3b5af076ce1d65456d3dbc1a3c0f14/README.md @@ -0,0 +1 @@ +E315 selector component retains parent scoring source/config and all learned values except stored attention input projection weights/biases rounded to BF16. Modules load FP32 and run the unchanged CUDA BF16 autocast operations. E314 handprobes were exact; full score/order equality and unseen-input/immutability checks are required here. No fitted parameters, network or development cache is used. CPU FP32 equivalence is not claimed. This is a component qualification, not a complete hybrid publication. diff --git a/shared/package-files/9b/9bb921076b5ee8400fe3668bab7e67fbb6d29a58ebf2b39f9416c02b97c61c6e/blob b/shared/package-files/9b/9bb921076b5ee8400fe3668bab7e67fbb6d29a58ebf2b39f9416c02b97c61c6e/blob new file mode 100644 index 0000000000000000000000000000000000000000..94d038ba8f2d8afa655b6cc31feb104952892c17 --- /dev/null +++ b/shared/package-files/9b/9bb921076b5ee8400fe3668bab7e67fbb6d29a58ebf2b39f9416c02b97c61c6e/blob @@ -0,0 +1,201 @@ +"gau_d","biw_d","cos_d","tri_d","epa2_d" +0.00009381,0,0,0,0 +0.00013231,0,0,0,0 +0.00018439,0,0,0,0 +0.00025393,0,0,0,0 +0.00034562,0,0,0,0 +0.00046498,0,0,0,0 +0.0006185,0,0,0,0 +0.00081356,0,0,0,0 +0.00105852,0,0,0,0 +0.00136267,0,0,0,0 +0.0017362,0,0,0,0 +0.00219017,0,0,0,0 +0.0027365,0,0,0,0 +0.00338795,0,0,0,0 +0.00415821,0,0,0,0 +0.00506195,0,0,0,0 +0.0061151,0,0,0,0 +0.00733502,0,0,0,0 +0.00874092,0.00020854,0,0.00107764,0.00157238 +0.01035414,0.00176765,0,0.00333299,0.00457784 +0.01219855,0.00436915,0,0.00558835,0.00719716 +0.01430076,0.00750117,0,0.00784371,0.00943033 +0.01669027,0.01072729,0.00004805,0.01009907,0.01127736 +0.01939927,0.01368657,0.00580873,0.01235442,0.01273825 +0.0224622,0.01609351,0.01844236,0.01460978,0.013813 +0.02591477,0.01773818,0.03172485,0.01688807,0.01453597 +0.02979266,0.0193605,0.03911242,0.02139878,0.01802447 +0.03412959,0.02133444,0.03696552,0.02267659,0.02074068 +0.03895502,0.0231292,0.02634183,0.02267659,0.02268461 +0.04429143,0.0246441,0.01247523,0.02392925,0.02567568 +0.05015131,0.02675179,0.00417766,0.02618461,0.02905053 +0.05653417,0.02899337,0.01202681,0.02843997,0.03126694 +0.06342355,0.03097931,0.02588278,0.0311807,0.03304406 +0.07078456,0.03376134,0.03687718,0.03661567,0.03740444 +0.07856192,0.03905487,0.04581312,0.04459767,0.04530173 +0.08667899,0.04888146,0.0516481,0.05281647,0.05595714 +0.09503779,0.06310752,0.05150744,0.06624853,0.07133682 +0.10352027,0.07981936,0.04890039,0.08293684,0.08830426 +0.11199082,0.09932242,0.05663806,0.10033623,0.10769333 +0.12030006,0.120772,0.08402759,0.11957366,0.12663696 +0.12828972,0.14259043,0.12767597,0.1411433,0.14406836 +0.13579842,0.16421383,0.17792839,0.16390385,0.16076839 +0.14266819,0.18389775,0.22348251,0.18283039,0.17391627 +0.14875112,0.20088339,0.25220927,0.19770994,0.18737042 +0.15391607,0.215531,0.26016739,0.2127142,0.2050043 +0.15805487,0.22718651,0.25503439,0.22419394,0.21746332 +0.16108763,0.23548399,0.24522363,0.2311708,0.2265395 +0.16296699,0.23902764,0.23090367,0.23323565,0.23156378 +0.16368089,0.23653556,0.21907401,0.23206678,0.23221076 +0.16325381,0.23078086,0.2215286,0.22736868,0.22777582 +0.16174629,0.22262669,0.23543217,0.21991026,0.21728297 +0.15925289,0.2119324,0.24752062,0.21109428,0.20305927 +0.15589856,0.19819934,0.2379146,0.19758066,0.18841098 +0.15183373,0.1810455,0.21229341,0.17850266,0.17232382 +0.14722831,0.1612045,0.17703107,0.15803375,0.15378886 +0.14226495,0.14159841,0.14066037,0.14063218,0.14148154 +0.137132,0.12294327,0.11174618,0.12662328,0.1285499 +0.1320163,0.1052391,0.08331064,0.10861526,0.11452692 +0.12709643,0.08998303,0.05231773,0.09399908,0.10400642 +0.1225364,0.07773921,0.02872102,0.08084369,0.09102376 +0.11848034,0.06957168,0.02912958,0.07007509,0.07724958 +0.1150481,0.06503004,0.05273093,0.06493763,0.06816177 +0.11233202,0.06134347,0.07581425,0.06287934,0.06085808 +0.11039489,0.06021013,0.09005286,0.06678053,0.06343545 +0.10926904,0.0624555,0.08912999,0.06682922,0.06672777 +0.10895652,0.06806196,0.07350031,0.06917664,0.07017806 +0.1094303,0.07583526,0.05086395,0.07641592,0.07942878 +0.11063634,0.08353494,0.03656493,0.08092663,0.08659675 +0.1124964,0.089982,0.05014783,0.08642012,0.09211306 +0.11491158,0.09553421,0.08026058,0.0932396,0.09620446 +0.11776634,0.10063037,0.11962624,0.10226103,0.09992137 +0.12093307,0.10613734,0.15291059,0.11206129,0.10410675 +0.12427695,0.11513935,0.15964036,0.11879532,0.11497869 +0.12766116,0.12622229,0.14176464,0.12906577,0.1289534 +0.13095229,0.1385518,0.11451992,0.13921042,0.1425211 +0.13402569,0.15224395,0.09860478,0.14975433,0.15754469 +0.13677086,0.16604673,0.10997383,0.16328647,0.17088514 +0.13909642,0.17748269,0.14577949,0.17421535,0.17869979 +0.14093464,0.18624146,0.19565756,0.18430768,0.18279831 +0.14224529,0.19220639,0.24091965,0.19107375,0.1803324 +0.14301849,0.19562235,0.26914198,0.19255016,0.17715685 +0.14327658,0.19560363,0.2714122,0.19196501,0.17882583 +0.14307473,0.19137571,0.24306974,0.18716564,0.17605415 +0.14250027,0.18204324,0.19806001,0.1781986,0.17095763 +0.14167076,0.16832906,0.15139382,0.16391658,0.16499704 +0.14073085,0.15142581,0.11392236,0.14812908,0.15324429 +0.13984797,0.1332105,0.09522145,0.13409036,0.14131702 +0.13920717,0.11611128,0.09278098,0.1194339,0.12656216 +0.13900512,0.10229462,0.09725896,0.10812855,0.11123105 +0.13944366,0.09419658,0.09572799,0.10108883,0.10444556 +0.14072295,0.09107492,0.08657616,0.09561659,0.10076878 +0.14303453,0.09135817,0.07597788,0.09235218,0.0957939 +0.14655444,0.09332966,0.06814649,0.09028185,0.09209979 +0.15143666,0.09432421,0.07563769,0.09070888,0.09190716 +0.15780697,0.09409662,0.09639484,0.09296424,0.09110861 +0.1657576,0.09390389,0.11833544,0.09553617,0.09376037 +0.17534276,0.09549155,0.13053774,0.1016936,0.09878489 +0.18657536,0.09953186,0.1209363,0.10458107,0.10233286 +0.19942516,0.10676964,0.09392485,0.10933512,0.11357757 +0.21381851,0.11726314,0.0684453,0.12076689,0.13188795 +0.22963985,0.13574927,0.06566663,0.14107432,0.15673534 +0.24673509,0.16275294,0.09563856,0.17203463,0.18968819 +0.26491659,0.19696163,0.1432605,0.20444257,0.21888015 +0.28396978,0.23514804,0.19180734,0.23987024,0.24711993 +0.30366098,0.27779771,0.2510021,0.28136961,0.28801433 +0.32374584,0.32789852,0.32708704,0.32919361,0.33179631 +0.34397802,0.38056143,0.41774837,0.37776892,0.37201773 +0.36411738,0.42906085,0.4873674,0.42552352,0.41111963 +0.3839372,0.46833798,0.51982872,0.45820792,0.44133705 +0.40322984,0.4949142,0.53932352,0.48081583,0.46245561 +0.42181071,0.51053656,0.56438286,0.49271968,0.47977087 +0.4395201,0.51664627,0.58816292,0.50773693,0.49148453 +0.45622331,0.51586854,0.59879774,0.52022286,0.50004829 +0.47180907,0.51138864,0.56347885,0.5182117,0.51358699 +0.48618679,0.50722799,0.48858213,0.51119145,0.52153232 +0.4992832,0.50561464,0.40955218,0.50774203,0.52567273 +0.51103891,0.50953012,0.38057032,0.50657046,0.52719708 +0.5214054,0.52160183,0.41876431,0.52848149,0.54947733 +0.53034287,0.54395407,0.49280431,0.55467115,0.57066307 +0.53781917,0.56965054,0.5701936,0.57953261,0.58728 +0.54380984,0.59586495,0.6286099,0.59664954,0.5909748 +0.54829917,0.6238037,0.65874333,0.61599773,0.60022592 +0.55128193,0.6475999,0.7050987,0.63103011,0.61397644 +0.5527654,0.65936608,0.75330011,0.64407184,0.62248499 +0.5527713,0.65774964,0.76892131,0.64635443,0.62141071 +0.55133722,0.64207902,0.73643263,0.64213149,0.61438851 +0.54851721,0.61737894,0.67664207,0.61253024,0.60306271 +0.54438136,0.59133961,0.58962145,0.58953556,0.59538873 +0.53901435,0.56705778,0.50831494,0.57058604,0.58350714 +0.53251304,0.5443073,0.45219775,0.54982384,0.56176223 +0.52498329,0.52377197,0.43086972,0.52632655,0.54544289 +0.5165362,0.51111921,0.42568689,0.51916853,0.54034476 +0.50728417,0.5055003,0.45832441,0.51103925,0.52600608 +0.49733701,0.50385697,0.52034839,0.50562399,0.50478138 +0.48679819,0.50436088,0.5606284,0.50004523,0.48338309 +0.47576166,0.49968915,0.56779164,0.49473537,0.47575478 +0.46430914,0.48756734,0.56583409,0.47883062,0.46560033 +0.45250813,0.47017815,0.54429243,0.46173317,0.45118562 +0.44041062,0.45183767,0.50180175,0.45490831,0.43974234 +0.42805258,0.43023009,0.43886564,0.43535845,0.43225412 +0.41545435,0.40645854,0.36113015,0.40497675,0.41766376 +0.40262179,0.38204816,0.28513964,0.38108605,0.400837 +0.38954847,0.36185522,0.25460893,0.36350685,0.38113889 +0.37621863,0.34964892,0.29516787,0.35527884,0.36601475 +0.36261103,0.34543366,0.35128679,0.35478039,0.36100863 +0.34870329,0.34707041,0.37542051,0.35984464,0.36282389 +0.33447675,0.35106605,0.3705629,0.35706239,0.35709252 +0.31992128,0.35786764,0.35728521,0.34808557,0.34220027 +0.30503974,0.3619363,0.35601707,0.34471347,0.33656633 +0.28985172,0.3548517,0.37585029,0.34146377,0.32876005 +0.27439603,0.33690071,0.40675418,0.33068567,0.31469691 +0.25873191,0.31091652,0.41352403,0.31034805,0.29284408 +0.24293845,0.27925415,0.37137399,0.28117424,0.26504252 +0.22711249,0.24374974,0.28227634,0.24246699,0.23513069 +0.21136491,0.20614784,0.18015096,0.20174005,0.20427059 +0.19581573,0.16946245,0.09888718,0.16673536,0.17816184 +0.18058845,0.13529735,0.05406135,0.13903377,0.15553275 +0.16580398,0.10630444,0.04213071,0.11707989,0.13440767 +0.15157484,0.08435681,0.03916645,0.09617717,0.11015923 +0.13799997,0.07038304,0.03763828,0.07832477,0.08937779 +0.12516069,0.06354786,0.03940164,0.06631079,0.07242139 +0.11311784,0.06202238,0.05590692,0.05961444,0.05954521 +0.10191057,0.06254232,0.08380778,0.06063125,0.05546416 +0.09155642,0.0617411,0.105318,0.06092246,0.05334754 +0.08205272,0.05841608,0.10418951,0.05964647,0.05117674 +0.07337908,0.05379463,0.08093498,0.05430719,0.05048445 +0.06550052,0.04899241,0.04701099,0.04754112,0.04786143 +0.05837108,0.04423741,0.01850412,0.04196387,0.04514459 +0.05193744,0.03861254,0.00244562,0.03745315,0.04243979 +0.04614234,0.03244199,0.00219727,0.03294244,0.03819043 +0.04092761,0.02655619,0.01247523,0.02843172,0.03239649 +0.03623662,0.02208741,0.02634183,0.02392101,0.02505798 +0.03201614,0.01945479,0.03696552,0.02160139,0.01964376 +0.02821757,0.01849146,0.03911242,0.01929508,0.01506477 +0.02479754,0.01773808,0.03172485,0.01686514,0.0145016 +0.02171813,0.01609351,0.01844236,0.01460978,0.013813 +0.01894663,0.01368657,0.00580873,0.01235442,0.01273825 +0.01645504,0.01072729,0.00004805,0.01009907,0.01127736 +0.01421941,0.00750117,0,0.00784371,0.00943033 +0.01221912,0.00436915,0,0.00558835,0.00719716 +0.01043612,0.00176765,0,0.00333299,0.00457784 +0.00885424,0.00020854,0,0.00107764,0.00157238 +0.00745864,0,0,0,0 +0.0062353,0,0,0,0 +0.0051707,0,0,0,0 +0.0042516,0,0,0,0 +0.00346494,0,0,0,0 +0.00279782,0,0,0,0 +0.00223757,0,0,0,0 +0.00177186,0,0,0,0 +0.00138884,0,0,0,0 +0.00107728,0,0,0,0 +0.0008267,0,0,0,0 +0.00062751,0,0,0,0 +0.00047103,0,0,0,0 +0.00034959,0,0,0,0 +0.00025649,0,0,0,0 +0.000186,0,0,0,0 +0.0001333,0,0,0,0 +0.0000944,0,0,0,0 diff --git a/shared/package-files/9b/9bbad327e13dc59ac1a17cdfd29d1522b3c32b4d6f10b144764136491fbbaad7/blob b/shared/package-files/9b/9bbad327e13dc59ac1a17cdfd29d1522b3c32b4d6f10b144764136491fbbaad7/blob new file mode 100644 index 0000000000000000000000000000000000000000..2e30d6841e829aadf3b3c9351e55a17b38c96359 Binary files /dev/null and b/shared/package-files/9b/9bbad327e13dc59ac1a17cdfd29d1522b3c32b4d6f10b144764136491fbbaad7/blob differ diff --git a/shared/package-files/9b/9bbbbfae7f713875aa3498fb65bb9244e653354297ba8e86b6b72e896bb408d7/blob b/shared/package-files/9b/9bbbbfae7f713875aa3498fb65bb9244e653354297ba8e86b6b72e896bb408d7/blob new file mode 100644 index 0000000000000000000000000000000000000000..3e09f99979ed28c4b0728150dfba27bbed24b36c --- /dev/null +++ b/shared/package-files/9b/9bbbbfae7f713875aa3498fb65bb9244e653354297ba8e86b6b72e896bb408d7/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::fractional_max_pool2d_backward.grad_input(Tensor grad_output, Tensor self, int[2] kernel_size, int[2] output_size, Tensor indices, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & fractional_max_pool2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices) { + return at::_ops::fractional_max_pool2d_backward_grad_input::call(grad_output, self, kernel_size, output_size, indices, grad_input); +} +// aten::fractional_max_pool2d_backward.grad_input(Tensor grad_output, Tensor self, int[2] kernel_size, int[2] output_size, Tensor indices, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & fractional_max_pool2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices, at::Tensor & grad_input) { + return at::_ops::fractional_max_pool2d_backward_grad_input::call(grad_output, self, kernel_size, output_size, indices, grad_input); +} + +// aten::fractional_max_pool2d_backward(Tensor grad_output, Tensor self, int[2] kernel_size, int[2] output_size, Tensor indices) -> Tensor +inline at::Tensor fractional_max_pool2d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices) { + return at::_ops::fractional_max_pool2d_backward::call(grad_output, self, kernel_size, output_size, indices); +} + +} diff --git a/shared/package-files/9b/9bbbc79df6418c14df978c42efb933234b42eec4a6dcfe174eb244da429cddc8/blob b/shared/package-files/9b/9bbbc79df6418c14df978c42efb933234b42eec4a6dcfe174eb244da429cddc8/blob new file mode 100644 index 0000000000000000000000000000000000000000..22b8f707a000e536d64e7db3c974a2b81cf27833 --- /dev/null +++ b/shared/package-files/9b/9bbbc79df6418c14df978c42efb933234b42eec4a6dcfe174eb244da429cddc8/blob @@ -0,0 +1,8 @@ +numpy==2.3.3 +scipy==1.16.2 +stim==1.15.0 +pymatching==2.3.1 +jax==0.7.2 +jaxlib==0.7.2 +jax-cuda12-plugin==0.7.2 +jax-cuda12-pjrt==0.7.2 diff --git a/shared/package-files/9b/9bbc958bf212b7efde4357ef39c2c8906a9f0534e93fe4222cd54ef7f6a046d7/blob b/shared/package-files/9b/9bbc958bf212b7efde4357ef39c2c8906a9f0534e93fe4222cd54ef7f6a046d7/blob new file mode 100644 index 0000000000000000000000000000000000000000..d39ba91cb084f0fae8cd89e323340465b8f90a72 Binary files /dev/null and b/shared/package-files/9b/9bbc958bf212b7efde4357ef39c2c8906a9f0534e93fe4222cd54ef7f6a046d7/blob differ diff --git a/shared/package-files/9b/9bc08fa72d90bb50d5465b89dcfecc62390de41354b9da6ce7c0df305efa5549/blob b/shared/package-files/9b/9bc08fa72d90bb50d5465b89dcfecc62390de41354b9da6ce7c0df305efa5549/blob new file mode 100644 index 0000000000000000000000000000000000000000..752f0e7e7d2c79733801ff89d20ee862b96eac09 --- /dev/null +++ b/shared/package-files/9b/9bc08fa72d90bb50d5465b89dcfecc62390de41354b9da6ce7c0df305efa5549/blob @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::cudnn_is_acceptable(Tensor self) -> bool +inline bool cudnn_is_acceptable(const at::Tensor & self) { + return at::_ops::cudnn_is_acceptable::call(self); +} + +} diff --git a/shared/package-files/9b/9bc31378f820b10b34361c372721d60b0e186eccbc271855521346f227a0da7f/blob b/shared/package-files/9b/9bc31378f820b10b34361c372721d60b0e186eccbc271855521346f227a0da7f/blob new file mode 100644 index 0000000000000000000000000000000000000000..235e90e6557f8016e59481989862b927767639bb --- /dev/null +++ b/shared/package-files/9b/9bc31378f820b10b34361c372721d60b0e186eccbc271855521346f227a0da7f/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API ::std::tuple linalg_ldl_factor_ex(const at::Tensor & self, bool hermitian=false, bool check_errors=false); +TORCH_API ::std::tuple linalg_ldl_factor_ex_out(at::Tensor & LD, at::Tensor & pivots, at::Tensor & info, const at::Tensor & self, bool hermitian=false, bool check_errors=false); +TORCH_API ::std::tuple linalg_ldl_factor_ex_outf(const at::Tensor & self, bool hermitian, bool check_errors, at::Tensor & LD, at::Tensor & pivots, at::Tensor & info); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/9b/9bc491ab61fc353ed312278791c4a1403bcf64f0a014092da43f003c2854f138/blob b/shared/package-files/9b/9bc491ab61fc353ed312278791c4a1403bcf64f0a014092da43f003c2854f138/blob new file mode 100644 index 0000000000000000000000000000000000000000..ad44936419bbd78700e153350c3a3b1731051d77 Binary files /dev/null and b/shared/package-files/9b/9bc491ab61fc353ed312278791c4a1403bcf64f0a014092da43f003c2854f138/blob differ diff --git a/shared/package-files/9b/9bc4a22901d4e94018aa274a429a6ed259aadde5e02f7d3ff7c4c9caefdf30a2/blob b/shared/package-files/9b/9bc4a22901d4e94018aa274a429a6ed259aadde5e02f7d3ff7c4c9caefdf30a2/blob new file mode 100644 index 0000000000000000000000000000000000000000..d8b0ec0b2966702975c0f3cc26e85e9d5b00710b --- /dev/null +++ b/shared/package-files/9b/9bc4a22901d4e94018aa274a429a6ed259aadde5e02f7d3ff7c4c9caefdf30a2/blob @@ -0,0 +1,277 @@ +import numpy as np +import scipy.special + +from .._serializable import Deserializer, Serializer +from ..utils import safe_isinstance +from ..utils.transformers import getattr_silent +from ._model import Model + + +class TopKLM(Model): + """Generates scores (log odds) for the top-k tokens for Causal/Masked LM.""" + + def __init__(self, model, tokenizer, k=10, generate_topk_token_ids=None, batch_size=128, device=None): + """Take Causal/Masked LM model and tokenizer and build a log odds output model for the top-k tokens. + + Parameters + ---------- + model: object or function + A object of any pretrained transformer model which is to be explained. + + tokenizer: object + A tokenizer object(PreTrainedTokenizer/PreTrainedTokenizerFast). + + generation_function_for_topk_token_ids: function + A function which is used to generate top-k token ids. Log odds will be generated for these custom token ids. + + batch_size: int + Batch size for model inferencing and computing logodds (default=128). + + device: str + By default, it infers if system has a gpu and accordingly sets device. Should be 'cpu' or 'cuda' or pytorch models. + + Returns + ------- + numpy.ndarray + The scores (log odds) of generating top-k token ids using the model. + + """ + super().__init__(model) + + self.tokenizer = tokenizer + # set pad token if not defined + if getattr_silent(self.tokenizer, "pad_token") is None: + self.tokenizer.pad_token = self.tokenizer.eos_token + self.k = k + self._custom_generate_topk_token_ids = generate_topk_token_ids + self.batch_size = batch_size + self.device = device + + self.X = None + self.topk_token_ids = None + self.output_names = None + + self.model_type = None + if safe_isinstance(self.inner_model, "transformers.PreTrainedModel"): + self.model_type = "pt" + import torch + + self.device = ( + torch.device("cuda" if torch.cuda.is_available() else "cpu") if self.device is None else self.device + ) + self.inner_model = self.inner_model.to(self.device) + elif safe_isinstance(self.inner_model, "transformers.TFPreTrainedModel"): + self.model_type = "tf" + + def __call__(self, masked_X, X): + """Computes log odds scores for a given batch of masked inputs for the top-k tokens for Causal/Masked LM. + + Parameters + ---------- + masked_X: numpy.ndarray + An array containing a list of masked inputs. + + X: numpy.ndarray + An array containing a list of original inputs + + Returns + ------- + numpy.ndarray + A numpy array of log odds scores for top-k tokens for every input pair (masked_X, X) + + """ + output_batch = None + self.update_cache_X(X[:1]) + start_batch_idx, end_batch_idx = 0, len(masked_X) + while start_batch_idx < end_batch_idx: + logits = self.get_lm_logits(masked_X[start_batch_idx : start_batch_idx + self.batch_size]) + logodds = self.get_logodds(logits) + if output_batch is None: + output_batch = logodds + else: + output_batch = np.concatenate((output_batch, logodds)) + start_batch_idx += self.batch_size + return output_batch + + def update_cache_X(self, X): + """The function updates original input(X) and top-k token ids for the Causal/Masked LM. + + It mimics the caching mechanism to update the original input and topk token ids + that are to be explained and which updates for every new row of explanation. + + Parameters + ---------- + X: np.ndarray + Input(Text) for an explanation row. + + """ + # check if the source sentence has been updated (occurs when explaining a new row) + if (self.X is None) or (not np.array_equal(self.X, X)): + self.X = X + self.output_names = self.get_output_names_and_update_topk_token_ids(self.X) + + def get_output_names_and_update_topk_token_ids(self, X): + """Gets the token names for top-k token ids for Causal/Masked LM. + + Parameters + ---------- + X: np.ndarray + Input(Text) for an explanation row. + + Returns + ------- + list + A list of output tokens. + + """ + # see if the user gave a custom token generator + if self._custom_generate_topk_token_ids is not None: + return self._custom_generate_topk_token_ids(X) + + # otherwise we pick the top k tokens from the model + self.topk_token_ids = self.generate_topk_token_ids(X) + output_names = [self.tokenizer.decode([x]) for x in self.topk_token_ids] + return output_names + + def get_logodds(self, logits): + """Calculates log odds from logits. + + This function passes the logits through softmax and then computes log odds for the top-k token ids. + + Parameters + ---------- + logits: numpy.ndarray + An array of logits generated from the model. + + Returns + ------- + numpy.ndarray + Computes log odds for corresponding top-k token ids. + + """ + assert self.topk_token_ids is not None + + # pass logits through softmax, get the token corresponding score and convert back to log odds (as one vs all) + def calc_logodds(arr): + probs = np.exp(arr) / np.exp(arr).sum(-1) + logodds = scipy.special.logit(probs) + return logodds + + # pass logits through softmax, get the token corresponding score and convert back to log odds (as one vs all) + logodds = np.apply_along_axis(calc_logodds, -1, logits) + logodds_for_topk_token_ids = np.take(logodds, self.topk_token_ids, axis=-1) + return logodds_for_topk_token_ids + + def get_inputs(self, X, padding_side="right"): + """The function tokenizes source sentence. + + Parameters + ---------- + X: numpy.ndarray + X is a batch of text. + + Returns + ------- + dict + Dictionary of padded source sentence ids and attention mask as tensors("pt" or "tf" based on similarity_model_type). + + """ + self.tokenizer.padding_side = padding_side + inputs = self.tokenizer(X.tolist(), return_tensors=self.model_type, padding=True) + # set tokenizer padding to default + self.tokenizer.padding_side = "right" + return inputs + + def generate_topk_token_ids(self, X) -> np.ndarray: + """Generates top-k token ids for Causal/Masked LM. + + Parameters + ---------- + X: numpy.ndarray + X is the original input sentence for an explanation row. + + Returns + ------- + np.ndarray + An array of top-k token ids. + + """ + logits = self.get_lm_logits(X) + topk_tokens_ids = (-logits).argsort()[0, : self.k] + return topk_tokens_ids + + def get_lm_logits(self, X): + """Evaluates a Causal/Masked LM model and returns logits corresponding to next word/masked word. + + Parameters + ---------- + X: numpy.ndarray + An array containing a list of masked inputs. + + Returns + ------- + numpy.ndarray + Logits corresponding to next word/masked word. + + """ + if self.model_type not in ["pt", "tf"]: + raise NotImplementedError("Only PyTorch and TensorFlow models are supported!") + + from transformers import MODEL_FOR_CAUSAL_LM_MAPPING + + if type(self.inner_model) in MODEL_FOR_CAUSAL_LM_MAPPING.values(): + inputs = self.get_inputs(X, padding_side="left") + if self.model_type == "pt": + import torch + + inputs["position_ids"] = inputs["attention_mask"].long().cumsum(-1) - 1 + inputs["position_ids"].masked_fill_(inputs["attention_mask"] == 0, 0) + inputs = inputs.to(self.device) + # generate outputs and logits + with torch.no_grad(): + outputs = self.inner_model(**inputs, return_dict=True) + # extract only logits corresponding to target sentence ids + logits = outputs.logits.detach().cpu().numpy().astype("float64")[:, -1, :] + else: + assert self.model_type == "tf" + import tensorflow as tf + + inputs["position_ids"] = tf.math.cumsum(inputs["attention_mask"], axis=-1) - 1 + inputs["position_ids"] = tf.where(inputs["attention_mask"] == 0, 0, inputs["position_ids"]) + if self.device is None: + outputs = self.inner_model(inputs, return_dict=True) + else: + try: + with tf.device(self.device): + outputs = self.inner_model(inputs, return_dict=True) + except RuntimeError as err: + print(err) + logits = outputs.logits.numpy().astype("float64")[:, -1, :] + else: + raise NotImplementedError(f"Model type '{type(self.inner_model)}' not supported!") + return logits + + def save(self, out_file): + super().save(out_file) + + # Increment the version number when the encoding changes! + with Serializer(out_file, "shap.models.TextGeneration", version=0) as s: + s.save("tokenizer", self.tokenizer) + s.save("k", self.k) + s.save("generate_topk_token_ids", self._custom_generate_topk_token_ids) + s.save("batch_size", self.batch_size) + s.save("device", self.device) + + @classmethod + def load(cls, in_file, instantiate=True): + if instantiate: + return cls._instantiated_load(in_file) + + kwargs = super().load(in_file, instantiate=False) + with Deserializer(in_file, "shap.models.TextGeneration", min_version=0, max_version=0) as s: + kwargs["tokenizer"] = s.load("tokenizer") + kwargs["k"] = s.load("k") + kwargs["generate_topk_token_ids"] = s.load("generate_topk_token_ids") + kwargs["batch_size"] = s.load("batch_size") + kwargs["device"] = s.load("device") + return kwargs diff --git a/shared/package-files/9b/9bc501c6e96e1747c46282d238c33bf55b70844ce4a888a8baeeafb1a6751b87/blob b/shared/package-files/9b/9bc501c6e96e1747c46282d238c33bf55b70844ce4a888a8baeeafb1a6751b87/blob new file mode 100644 index 0000000000000000000000000000000000000000..09d19bdf2319684bf6284e0589d3d5f2bb3adcb1 --- /dev/null +++ b/shared/package-files/9b/9bc501c6e96e1747c46282d238c33bf55b70844ce4a888a8baeeafb1a6751b87/blob @@ -0,0 +1,3123 @@ +from sympy import MatAdd, MatMul, Array +from sympy.algebras.quaternion import Quaternion +from sympy.calculus.accumulationbounds import AccumBounds +from sympy.combinatorics.permutations import Cycle, Permutation, AppliedPermutation +from sympy.concrete.products import Product +from sympy.concrete.summations import Sum +from sympy.core.containers import Tuple, Dict +from sympy.core.expr import UnevaluatedExpr +from sympy.core.function import (Derivative, Function, Lambda, Subs, diff) +from sympy.core.mod import Mod +from sympy.core.mul import Mul +from sympy.core.numbers import (AlgebraicNumber, Float, I, Integer, Rational, oo, pi) +from sympy.core.parameters import evaluate +from sympy.core.power import Pow +from sympy.core.relational import Eq, Ne +from sympy.core.singleton import S +from sympy.core.symbol import (Symbol, Wild, symbols) +from sympy.functions.combinatorial.factorials import (FallingFactorial, RisingFactorial, binomial, factorial, factorial2, subfactorial) +from sympy.functions.combinatorial.numbers import bernoulli, bell, catalan, euler, genocchi, lucas, fibonacci, tribonacci +from sympy.functions.elementary.complexes import (Abs, arg, conjugate, im, polar_lift, re) +from sympy.functions.elementary.exponential import (LambertW, exp, log) +from sympy.functions.elementary.hyperbolic import (asinh, coth) +from sympy.functions.elementary.integers import (ceiling, floor, frac) +from sympy.functions.elementary.miscellaneous import (Max, Min, root, sqrt) +from sympy.functions.elementary.piecewise import Piecewise +from sympy.functions.elementary.trigonometric import (acsc, asin, cos, cot, sin, tan) +from sympy.functions.special.beta_functions import beta +from sympy.functions.special.delta_functions import (DiracDelta, Heaviside) +from sympy.functions.special.elliptic_integrals import (elliptic_e, elliptic_f, elliptic_k, elliptic_pi) +from sympy.functions.special.error_functions import (Chi, Ci, Ei, Shi, Si, expint) +from sympy.functions.special.gamma_functions import (gamma, uppergamma) +from sympy.functions.special.hyper import (hyper, meijerg) +from sympy.functions.special.mathieu_functions import (mathieuc, mathieucprime, mathieus, mathieusprime) +from sympy.functions.special.polynomials import (assoc_laguerre, assoc_legendre, chebyshevt, chebyshevu, gegenbauer, hermite, jacobi, laguerre, legendre) +from sympy.functions.special.singularity_functions import SingularityFunction +from sympy.functions.special.spherical_harmonics import (Ynm, Znm) +from sympy.functions.special.tensor_functions import (KroneckerDelta, LeviCivita) +from sympy.functions.special.zeta_functions import (dirichlet_eta, lerchphi, polylog, stieltjes, zeta) +from sympy.integrals.integrals import Integral +from sympy.integrals.transforms import (CosineTransform, FourierTransform, InverseCosineTransform, InverseFourierTransform, InverseLaplaceTransform, InverseMellinTransform, InverseSineTransform, LaplaceTransform, MellinTransform, SineTransform) +from sympy.logic import Implies +from sympy.logic.boolalg import (And, Or, Xor, Equivalent, false, Not, true) +from sympy.matrices.dense import Matrix +from sympy.matrices.expressions.kronecker import KroneckerProduct +from sympy.matrices.expressions.matexpr import MatrixSymbol +from sympy.matrices.expressions.permutation import PermutationMatrix +from sympy.matrices.expressions.slice import MatrixSlice +from sympy.physics.control.lti import TransferFunction, Series, Parallel, Feedback, TransferFunctionMatrix, MIMOSeries, MIMOParallel, MIMOFeedback +from sympy.ntheory.factor_ import (divisor_sigma, primenu, primeomega, reduced_totient, totient, udivisor_sigma) +from sympy.physics.quantum import Commutator, Operator +from sympy.physics.quantum.trace import Tr +from sympy.physics.units import meter, gibibyte, gram, microgram, second, milli, micro +from sympy.polys.domains.integerring import ZZ +from sympy.polys.fields import field +from sympy.polys.polytools import Poly +from sympy.polys.rings import ring +from sympy.polys.rootoftools import (RootSum, rootof) +from sympy.series.formal import fps +from sympy.series.fourier import fourier_series +from sympy.series.limits import Limit +from sympy.series.order import Order +from sympy.series.sequences import (SeqAdd, SeqFormula, SeqMul, SeqPer) +from sympy.sets.conditionset import ConditionSet +from sympy.sets.contains import Contains +from sympy.sets.fancysets import (ComplexRegion, ImageSet, Range) +from sympy.sets.ordinals import Ordinal, OrdinalOmega, OmegaPower +from sympy.sets.powerset import PowerSet +from sympy.sets.sets import (FiniteSet, Interval, Union, Intersection, Complement, SymmetricDifference, ProductSet) +from sympy.sets.setexpr import SetExpr +from sympy.stats.crv_types import Normal +from sympy.stats.symbolic_probability import (Covariance, Expectation, + Probability, Variance) +from sympy.tensor.array import (ImmutableDenseNDimArray, + ImmutableSparseNDimArray, + MutableSparseNDimArray, + MutableDenseNDimArray, + tensorproduct) +from sympy.tensor.array.expressions.array_expressions import ArraySymbol, ArrayElement +from sympy.tensor.indexed import (Idx, Indexed, IndexedBase) +from sympy.tensor.toperators import PartialDerivative +from sympy.vector import CoordSys3D, Cross, Curl, Dot, Divergence, Gradient, Laplacian + + +from sympy.testing.pytest import (XFAIL, raises, _both_exp_pow, + warns_deprecated_sympy) +from sympy.printing.latex import (latex, translate, greek_letters_set, + tex_greek_dictionary, multiline_latex, + latex_escape, LatexPrinter) + +import sympy as sym + +from sympy.abc import mu, tau + + +class lowergamma(sym.lowergamma): + pass # testing notation inheritance by a subclass with same name + + +x, y, z, t, w, a, b, c, s, p = symbols('x y z t w a b c s p') +k, m, n = symbols('k m n', integer=True) + + +def test_printmethod(): + class R(Abs): + def _latex(self, printer): + return "foo(%s)" % printer._print(self.args[0]) + assert latex(R(x)) == r"foo(x)" + + class R(Abs): + def _latex(self, printer): + return "foo" + assert latex(R(x)) == r"foo" + + +def test_latex_basic(): + assert latex(1 + x) == r"x + 1" + assert latex(x**2) == r"x^{2}" + assert latex(x**(1 + x)) == r"x^{x + 1}" + assert latex(x**3 + x + 1 + x**2) == r"x^{3} + x^{2} + x + 1" + + assert latex(2*x*y) == r"2 x y" + assert latex(2*x*y, mul_symbol='dot') == r"2 \cdot x \cdot y" + assert latex(3*x**2*y, mul_symbol='\\,') == r"3\,x^{2}\,y" + assert latex(1.5*3**x, mul_symbol='\\,') == r"1.5 \cdot 3^{x}" + + assert latex(x**S.Half**5) == r"\sqrt[32]{x}" + assert latex(Mul(S.Half, x**2, -5, evaluate=False)) == r"\frac{1}{2} x^{2} \left(-5\right)" + assert latex(Mul(S.Half, x**2, 5, evaluate=False)) == r"\frac{1}{2} x^{2} \cdot 5" + assert latex(Mul(-5, -5, evaluate=False)) == r"\left(-5\right) \left(-5\right)" + assert latex(Mul(5, -5, evaluate=False)) == r"5 \left(-5\right)" + assert latex(Mul(S.Half, -5, S.Half, evaluate=False)) == r"\frac{1}{2} \left(-5\right) \frac{1}{2}" + assert latex(Mul(5, I, 5, evaluate=False)) == r"5 i 5" + assert latex(Mul(5, I, -5, evaluate=False)) == r"5 i \left(-5\right)" + + assert latex(Mul(0, 1, evaluate=False)) == r'0 \cdot 1' + assert latex(Mul(1, 0, evaluate=False)) == r'1 \cdot 0' + assert latex(Mul(1, 1, evaluate=False)) == r'1 \cdot 1' + assert latex(Mul(-1, 1, evaluate=False)) == r'\left(-1\right) 1' + assert latex(Mul(1, 1, 1, evaluate=False)) == r'1 \cdot 1 \cdot 1' + assert latex(Mul(1, 2, evaluate=False)) == r'1 \cdot 2' + assert latex(Mul(1, S.Half, evaluate=False)) == r'1 \cdot \frac{1}{2}' + assert latex(Mul(1, 1, S.Half, evaluate=False)) == \ + r'1 \cdot 1 \cdot \frac{1}{2}' + assert latex(Mul(1, 1, 2, 3, x, evaluate=False)) == \ + r'1 \cdot 1 \cdot 2 \cdot 3 x' + assert latex(Mul(1, -1, evaluate=False)) == r'1 \left(-1\right)' + assert latex(Mul(4, 3, 2, 1, 0, y, x, evaluate=False)) == \ + r'4 \cdot 3 \cdot 2 \cdot 1 \cdot 0 y x' + assert latex(Mul(4, 3, 2, 1+z, 0, y, x, evaluate=False)) == \ + r'4 \cdot 3 \cdot 2 \left(z + 1\right) 0 y x' + assert latex(Mul(Rational(2, 3), Rational(5, 7), evaluate=False)) == \ + r'\frac{2}{3} \cdot \frac{5}{7}' + + assert latex(1/x) == r"\frac{1}{x}" + assert latex(1/x, fold_short_frac=True) == r"1 / x" + assert latex(-S(3)/2) == r"- \frac{3}{2}" + assert latex(-S(3)/2, fold_short_frac=True) == r"- 3 / 2" + assert latex(1/x**2) == r"\frac{1}{x^{2}}" + assert latex(1/(x + y)/2) == r"\frac{1}{2 \left(x + y\right)}" + assert latex(x/2) == r"\frac{x}{2}" + assert latex(x/2, fold_short_frac=True) == r"x / 2" + assert latex((x + y)/(2*x)) == r"\frac{x + y}{2 x}" + assert latex((x + y)/(2*x), fold_short_frac=True) == \ + r"\left(x + y\right) / 2 x" + assert latex((x + y)/(2*x), long_frac_ratio=0) == \ + r"\frac{1}{2 x} \left(x + y\right)" + assert latex((x + y)/x) == r"\frac{x + y}{x}" + assert latex((x + y)/x, long_frac_ratio=3) == r"\frac{x + y}{x}" + assert latex((2*sqrt(2)*x)/3) == r"\frac{2 \sqrt{2} x}{3}" + assert latex((2*sqrt(2)*x)/3, long_frac_ratio=2) == \ + r"\frac{2 x}{3} \sqrt{2}" + assert latex(binomial(x, y)) == r"{\binom{x}{y}}" + + x_star = Symbol('x^*') + f = Function('f') + assert latex(x_star**2) == r"\left(x^{*}\right)^{2}" + assert latex(x_star**2, parenthesize_super=False) == r"{x^{*}}^{2}" + assert latex(Derivative(f(x_star), x_star,2)) == r"\frac{d^{2}}{d \left(x^{*}\right)^{2}} f{\left(x^{*} \right)}" + assert latex(Derivative(f(x_star), x_star,2), parenthesize_super=False) == r"\frac{d^{2}}{d {x^{*}}^{2}} f{\left(x^{*} \right)}" + + assert latex(2*Integral(x, x)/3) == r"\frac{2 \int x\, dx}{3}" + assert latex(2*Integral(x, x)/3, fold_short_frac=True) == \ + r"\left(2 \int x\, dx\right) / 3" + + assert latex(sqrt(x)) == r"\sqrt{x}" + assert latex(x**Rational(1, 3)) == r"\sqrt[3]{x}" + assert latex(x**Rational(1, 3), root_notation=False) == r"x^{\frac{1}{3}}" + assert latex(sqrt(x)**3) == r"x^{\frac{3}{2}}" + assert latex(sqrt(x), itex=True) == r"\sqrt{x}" + assert latex(x**Rational(1, 3), itex=True) == r"\root{3}{x}" + assert latex(sqrt(x)**3, itex=True) == r"x^{\frac{3}{2}}" + assert latex(x**Rational(3, 4)) == r"x^{\frac{3}{4}}" + assert latex(x**Rational(3, 4), fold_frac_powers=True) == r"x^{3/4}" + assert latex((x + 1)**Rational(3, 4)) == \ + r"\left(x + 1\right)^{\frac{3}{4}}" + assert latex((x + 1)**Rational(3, 4), fold_frac_powers=True) == \ + r"\left(x + 1\right)^{3/4}" + assert latex(AlgebraicNumber(sqrt(2))) == r"\sqrt{2}" + assert latex(AlgebraicNumber(sqrt(2), [3, -7])) == r"-7 + 3 \sqrt{2}" + assert latex(AlgebraicNumber(sqrt(2), alias='alpha')) == r"\alpha" + assert latex(AlgebraicNumber(sqrt(2), [3, -7], alias='alpha')) == \ + r"3 \alpha - 7" + assert latex(AlgebraicNumber(2**(S(1)/3), [1, 3, -7], alias='beta')) == \ + r"\beta^{2} + 3 \beta - 7" + + k = ZZ.cyclotomic_field(5) + assert latex(k.ext.field_element([1, 2, 3, 4])) == \ + r"\zeta^{3} + 2 \zeta^{2} + 3 \zeta + 4" + assert latex(k.ext.field_element([1, 2, 3, 4]), order='old') == \ + r"4 + 3 \zeta + 2 \zeta^{2} + \zeta^{3}" + assert latex(k.primes_above(19)[0]) == \ + r"\left(19, \zeta^{2} + 5 \zeta + 1\right)" + assert latex(k.primes_above(19)[0], order='old') == \ + r"\left(19, 1 + 5 \zeta + \zeta^{2}\right)" + assert latex(k.primes_above(7)[0]) == r"\left(7\right)" + + assert latex(1.5e20*x) == r"1.5 \cdot 10^{20} x" + assert latex(1.5e20*x, mul_symbol='dot') == r"1.5 \cdot 10^{20} \cdot x" + assert latex(1.5e20*x, mul_symbol='times') == \ + r"1.5 \times 10^{20} \times x" + + assert latex(1/sin(x)) == r"\frac{1}{\sin{\left(x \right)}}" + assert latex(sin(x)**-1) == r"\frac{1}{\sin{\left(x \right)}}" + assert latex(sin(x)**Rational(3, 2)) == \ + r"\sin^{\frac{3}{2}}{\left(x \right)}" + assert latex(sin(x)**Rational(3, 2), fold_frac_powers=True) == \ + r"\sin^{3/2}{\left(x \right)}" + + assert latex(~x) == r"\neg x" + assert latex(x & y) == r"x \wedge y" + assert latex(x & y & z) == r"x \wedge y \wedge z" + assert latex(x | y) == r"x \vee y" + assert latex(x | y | z) == r"x \vee y \vee z" + assert latex((x & y) | z) == r"z \vee \left(x \wedge y\right)" + assert latex(Implies(x, y)) == r"x \Rightarrow y" + assert latex(~(x >> ~y)) == r"x \not\Rightarrow \neg y" + assert latex(Implies(Or(x,y), z)) == r"\left(x \vee y\right) \Rightarrow z" + assert latex(Implies(z, Or(x,y))) == r"z \Rightarrow \left(x \vee y\right)" + assert latex(~(x & y)) == r"\neg \left(x \wedge y\right)" + + assert latex(~x, symbol_names={x: "x_i"}) == r"\neg x_i" + assert latex(x & y, symbol_names={x: "x_i", y: "y_i"}) == \ + r"x_i \wedge y_i" + assert latex(x & y & z, symbol_names={x: "x_i", y: "y_i", z: "z_i"}) == \ + r"x_i \wedge y_i \wedge z_i" + assert latex(x | y, symbol_names={x: "x_i", y: "y_i"}) == r"x_i \vee y_i" + assert latex(x | y | z, symbol_names={x: "x_i", y: "y_i", z: "z_i"}) == \ + r"x_i \vee y_i \vee z_i" + assert latex((x & y) | z, symbol_names={x: "x_i", y: "y_i", z: "z_i"}) == \ + r"z_i \vee \left(x_i \wedge y_i\right)" + assert latex(Implies(x, y), symbol_names={x: "x_i", y: "y_i"}) == \ + r"x_i \Rightarrow y_i" + assert latex(Pow(Rational(1, 3), -1, evaluate=False)) == r"\frac{1}{\frac{1}{3}}" + assert latex(Pow(Rational(1, 3), -2, evaluate=False)) == r"\frac{1}{(\frac{1}{3})^{2}}" + assert latex(Pow(Integer(1)/100, -1, evaluate=False)) == r"\frac{1}{\frac{1}{100}}" + + + p = Symbol('p', positive=True) + assert latex(exp(-p)*log(p)) == r"e^{- p} \log{\left(p \right)}" + + +def test_latex_builtins(): + assert latex(True) == r"\text{True}" + assert latex(False) == r"\text{False}" + assert latex(None) == r"\text{None}" + assert latex(true) == r"\text{True}" + assert latex(false) == r'\text{False}' + + +def test_latex_SingularityFunction(): + assert latex(SingularityFunction(x, 4, 5)) == \ + r"{\left\langle x - 4 \right\rangle}^{5}" + assert latex(SingularityFunction(x, -3, 4)) == \ + r"{\left\langle x + 3 \right\rangle}^{4}" + assert latex(SingularityFunction(x, 0, 4)) == \ + r"{\left\langle x \right\rangle}^{4}" + assert latex(SingularityFunction(x, a, n)) == \ + r"{\left\langle - a + x \right\rangle}^{n}" + assert latex(SingularityFunction(x, 4, -2)) == \ + r"{\left\langle x - 4 \right\rangle}^{-2}" + assert latex(SingularityFunction(x, 4, -1)) == \ + r"{\left\langle x - 4 \right\rangle}^{-1}" + + assert latex(SingularityFunction(x, 4, 5)**3) == \ + r"{\left({\langle x - 4 \rangle}^{5}\right)}^{3}" + assert latex(SingularityFunction(x, -3, 4)**3) == \ + r"{\left({\langle x + 3 \rangle}^{4}\right)}^{3}" + assert latex(SingularityFunction(x, 0, 4)**3) == \ + r"{\left({\langle x \rangle}^{4}\right)}^{3}" + assert latex(SingularityFunction(x, a, n)**3) == \ + r"{\left({\langle - a + x \rangle}^{n}\right)}^{3}" + assert latex(SingularityFunction(x, 4, -2)**3) == \ + r"{\left({\langle x - 4 \rangle}^{-2}\right)}^{3}" + assert latex((SingularityFunction(x, 4, -1)**3)**3) == \ + r"{\left({\langle x - 4 \rangle}^{-1}\right)}^{9}" + + +def test_latex_cycle(): + assert latex(Cycle(1, 2, 4)) == r"\left( 1\; 2\; 4\right)" + assert latex(Cycle(1, 2)(4, 5, 6)) == \ + r"\left( 1\; 2\right)\left( 4\; 5\; 6\right)" + assert latex(Cycle()) == r"\left( \right)" + + +def test_latex_permutation(): + assert latex(Permutation(1, 2, 4)) == r"\left( 1\; 2\; 4\right)" + assert latex(Permutation(1, 2)(4, 5, 6)) == \ + r"\left( 1\; 2\right)\left( 4\; 5\; 6\right)" + assert latex(Permutation()) == r"\left( \right)" + assert latex(Permutation(2, 4)*Permutation(5)) == \ + r"\left( 2\; 4\right)\left( 5\right)" + assert latex(Permutation(5)) == r"\left( 5\right)" + + assert latex(Permutation(0, 1), perm_cyclic=False) == \ + r"\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}" + assert latex(Permutation(0, 1)(2, 3), perm_cyclic=False) == \ + r"\begin{pmatrix} 0 & 1 & 2 & 3 \\ 1 & 0 & 3 & 2 \end{pmatrix}" + assert latex(Permutation(), perm_cyclic=False) == \ + r"\left( \right)" + + with warns_deprecated_sympy(): + old_print_cyclic = Permutation.print_cyclic + Permutation.print_cyclic = False + assert latex(Permutation(0, 1)(2, 3)) == \ + r"\begin{pmatrix} 0 & 1 & 2 & 3 \\ 1 & 0 & 3 & 2 \end{pmatrix}" + Permutation.print_cyclic = old_print_cyclic + +def test_latex_Float(): + assert latex(Float(1.0e100)) == r"1.0 \cdot 10^{100}" + assert latex(Float(1.0e-100)) == r"1.0 \cdot 10^{-100}" + assert latex(Float(1.0e-100), mul_symbol="times") == \ + r"1.0 \times 10^{-100}" + assert latex(Float('10000.0'), full_prec=False, min=-2, max=2) == \ + r"1.0 \cdot 10^{4}" + assert latex(Float('10000.0'), full_prec=False, min=-2, max=4) == \ + r"1.0 \cdot 10^{4}" + assert latex(Float('10000.0'), full_prec=False, min=-2, max=5) == \ + r"10000.0" + assert latex(Float('0.099999'), full_prec=True, min=-2, max=5) == \ + r"9.99990000000000 \cdot 10^{-2}" + + +def test_latex_vector_expressions(): + A = CoordSys3D('A') + + assert latex(Cross(A.i, A.j*A.x*3+A.k)) == \ + r"\mathbf{\hat{i}_{A}} \times \left(\left(3 \mathbf{{x}_{A}}\right)\mathbf{\hat{j}_{A}} + \mathbf{\hat{k}_{A}}\right)" + assert latex(Cross(A.i, A.j)) == \ + r"\mathbf{\hat{i}_{A}} \times \mathbf{\hat{j}_{A}}" + assert latex(x*Cross(A.i, A.j)) == \ + r"x \left(\mathbf{\hat{i}_{A}} \times \mathbf{\hat{j}_{A}}\right)" + assert latex(Cross(x*A.i, A.j)) == \ + r'- \mathbf{\hat{j}_{A}} \times \left(\left(x\right)\mathbf{\hat{i}_{A}}\right)' + + assert latex(Curl(3*A.x*A.j)) == \ + r"\nabla\times \left(\left(3 \mathbf{{x}_{A}}\right)\mathbf{\hat{j}_{A}}\right)" + assert latex(Curl(3*A.x*A.j+A.i)) == \ + r"\nabla\times \left(\mathbf{\hat{i}_{A}} + \left(3 \mathbf{{x}_{A}}\right)\mathbf{\hat{j}_{A}}\right)" + assert latex(Curl(3*x*A.x*A.j)) == \ + r"\nabla\times \left(\left(3 \mathbf{{x}_{A}} x\right)\mathbf{\hat{j}_{A}}\right)" + assert latex(x*Curl(3*A.x*A.j)) == \ + r"x \left(\nabla\times \left(\left(3 \mathbf{{x}_{A}}\right)\mathbf{\hat{j}_{A}}\right)\right)" + + assert latex(Divergence(3*A.x*A.j+A.i)) == \ + r"\nabla\cdot \left(\mathbf{\hat{i}_{A}} + \left(3 \mathbf{{x}_{A}}\right)\mathbf{\hat{j}_{A}}\right)" + assert latex(Divergence(3*A.x*A.j)) == \ + r"\nabla\cdot \left(\left(3 \mathbf{{x}_{A}}\right)\mathbf{\hat{j}_{A}}\right)" + assert latex(x*Divergence(3*A.x*A.j)) == \ + r"x \left(\nabla\cdot \left(\left(3 \mathbf{{x}_{A}}\right)\mathbf{\hat{j}_{A}}\right)\right)" + + assert latex(Dot(A.i, A.j*A.x*3+A.k)) == \ + r"\mathbf{\hat{i}_{A}} \cdot \left(\left(3 \mathbf{{x}_{A}}\right)\mathbf{\hat{j}_{A}} + \mathbf{\hat{k}_{A}}\right)" + assert latex(Dot(A.i, A.j)) == \ + r"\mathbf{\hat{i}_{A}} \cdot \mathbf{\hat{j}_{A}}" + assert latex(Dot(x*A.i, A.j)) == \ + r"\mathbf{\hat{j}_{A}} \cdot \left(\left(x\right)\mathbf{\hat{i}_{A}}\right)" + assert latex(x*Dot(A.i, A.j)) == \ + r"x \left(\mathbf{\hat{i}_{A}} \cdot \mathbf{\hat{j}_{A}}\right)" + + assert latex(Gradient(A.x)) == r"\nabla \mathbf{{x}_{A}}" + assert latex(Gradient(A.x + 3*A.y)) == \ + r"\nabla \left(\mathbf{{x}_{A}} + 3 \mathbf{{y}_{A}}\right)" + assert latex(x*Gradient(A.x)) == r"x \left(\nabla \mathbf{{x}_{A}}\right)" + assert latex(Gradient(x*A.x)) == r"\nabla \left(\mathbf{{x}_{A}} x\right)" + + assert latex(Laplacian(A.x)) == r"\Delta \mathbf{{x}_{A}}" + assert latex(Laplacian(A.x + 3*A.y)) == \ + r"\Delta \left(\mathbf{{x}_{A}} + 3 \mathbf{{y}_{A}}\right)" + assert latex(x*Laplacian(A.x)) == r"x \left(\Delta \mathbf{{x}_{A}}\right)" + assert latex(Laplacian(x*A.x)) == r"\Delta \left(\mathbf{{x}_{A}} x\right)" + +def test_latex_symbols(): + Gamma, lmbda, rho = symbols('Gamma, lambda, rho') + tau, Tau, TAU, taU = symbols('tau, Tau, TAU, taU') + assert latex(tau) == r"\tau" + assert latex(Tau) == r"\mathrm{T}" + assert latex(TAU) == r"\tau" + assert latex(taU) == r"\tau" + # Check that all capitalized greek letters are handled explicitly + capitalized_letters = {l.capitalize() for l in greek_letters_set} + assert len(capitalized_letters - set(tex_greek_dictionary.keys())) == 0 + assert latex(Gamma + lmbda) == r"\Gamma + \lambda" + assert latex(Gamma * lmbda) == r"\Gamma \lambda" + assert latex(Symbol('q1')) == r"q_{1}" + assert latex(Symbol('q21')) == r"q_{21}" + assert latex(Symbol('epsilon0')) == r"\epsilon_{0}" + assert latex(Symbol('omega1')) == r"\omega_{1}" + assert latex(Symbol('91')) == r"91" + assert latex(Symbol('alpha_new')) == r"\alpha_{new}" + assert latex(Symbol('C^orig')) == r"C^{orig}" + assert latex(Symbol('x^alpha')) == r"x^{\alpha}" + assert latex(Symbol('beta^alpha')) == r"\beta^{\alpha}" + assert latex(Symbol('e^Alpha')) == r"e^{\mathrm{A}}" + assert latex(Symbol('omega_alpha^beta')) == r"\omega^{\beta}_{\alpha}" + assert latex(Symbol('omega') ** Symbol('beta')) == r"\omega^{\beta}" + + +@XFAIL +def test_latex_symbols_failing(): + rho, mass, volume = symbols('rho, mass, volume') + assert latex( + volume * rho == mass) == r"\rho \mathrm{volume} = \mathrm{mass}" + assert latex(volume / mass * rho == 1) == \ + r"\rho \mathrm{volume} {\mathrm{mass}}^{(-1)} = 1" + assert latex(mass**3 * volume**3) == \ + r"{\mathrm{mass}}^{3} \cdot {\mathrm{volume}}^{3}" + + +@_both_exp_pow +def test_latex_functions(): + assert latex(exp(x)) == r"e^{x}" + assert latex(exp(1) + exp(2)) == r"e + e^{2}" + + f = Function('f') + assert latex(f(x)) == r'f{\left(x \right)}' + assert latex(f) == r'f' + + g = Function('g') + assert latex(g(x, y)) == r'g{\left(x,y \right)}' + assert latex(g) == r'g' + + h = Function('h') + assert latex(h(x, y, z)) == r'h{\left(x,y,z \right)}' + assert latex(h) == r'h' + + Li = Function('Li') + assert latex(Li) == r'\operatorname{Li}' + assert latex(Li(x)) == r'\operatorname{Li}{\left(x \right)}' + + mybeta = Function('beta') + # not to be confused with the beta function + assert latex(mybeta(x, y, z)) == r"\beta{\left(x,y,z \right)}" + assert latex(beta(x, y)) == r'\operatorname{B}\left(x, y\right)' + assert latex(beta(x, evaluate=False)) == r'\operatorname{B}\left(x, x\right)' + assert latex(beta(x, y)**2) == r'\operatorname{B}^{2}\left(x, y\right)' + assert latex(mybeta(x)) == r"\beta{\left(x \right)}" + assert latex(mybeta) == r"\beta" + + g = Function('gamma') + # not to be confused with the gamma function + assert latex(g(x, y, z)) == r"\gamma{\left(x,y,z \right)}" + assert latex(g(x)) == r"\gamma{\left(x \right)}" + assert latex(g) == r"\gamma" + + a_1 = Function('a_1') + assert latex(a_1) == r"a_{1}" + assert latex(a_1(x)) == r"a_{1}{\left(x \right)}" + assert latex(Function('a_1')) == r"a_{1}" + + # Issue #16925 + # multi letter function names + # > simple + assert latex(Function('ab')) == r"\operatorname{ab}" + assert latex(Function('ab1')) == r"\operatorname{ab}_{1}" + assert latex(Function('ab12')) == r"\operatorname{ab}_{12}" + assert latex(Function('ab_1')) == r"\operatorname{ab}_{1}" + assert latex(Function('ab_12')) == r"\operatorname{ab}_{12}" + assert latex(Function('ab_c')) == r"\operatorname{ab}_{c}" + assert latex(Function('ab_cd')) == r"\operatorname{ab}_{cd}" + # > with argument + assert latex(Function('ab')(Symbol('x'))) == r"\operatorname{ab}{\left(x \right)}" + assert latex(Function('ab1')(Symbol('x'))) == r"\operatorname{ab}_{1}{\left(x \right)}" + assert latex(Function('ab12')(Symbol('x'))) == r"\operatorname{ab}_{12}{\left(x \right)}" + assert latex(Function('ab_1')(Symbol('x'))) == r"\operatorname{ab}_{1}{\left(x \right)}" + assert latex(Function('ab_c')(Symbol('x'))) == r"\operatorname{ab}_{c}{\left(x \right)}" + assert latex(Function('ab_cd')(Symbol('x'))) == r"\operatorname{ab}_{cd}{\left(x \right)}" + + # > with power + # does not work on functions without brackets + + # > with argument and power combined + assert latex(Function('ab')()**2) == r"\operatorname{ab}^{2}{\left( \right)}" + assert latex(Function('ab1')()**2) == r"\operatorname{ab}_{1}^{2}{\left( \right)}" + assert latex(Function('ab12')()**2) == r"\operatorname{ab}_{12}^{2}{\left( \right)}" + assert latex(Function('ab_1')()**2) == r"\operatorname{ab}_{1}^{2}{\left( \right)}" + assert latex(Function('ab_12')()**2) == r"\operatorname{ab}_{12}^{2}{\left( \right)}" + assert latex(Function('ab')(Symbol('x'))**2) == r"\operatorname{ab}^{2}{\left(x \right)}" + assert latex(Function('ab1')(Symbol('x'))**2) == r"\operatorname{ab}_{1}^{2}{\left(x \right)}" + assert latex(Function('ab12')(Symbol('x'))**2) == r"\operatorname{ab}_{12}^{2}{\left(x \right)}" + assert latex(Function('ab_1')(Symbol('x'))**2) == r"\operatorname{ab}_{1}^{2}{\left(x \right)}" + assert latex(Function('ab_12')(Symbol('x'))**2) == \ + r"\operatorname{ab}_{12}^{2}{\left(x \right)}" + + # single letter function names + # > simple + assert latex(Function('a')) == r"a" + assert latex(Function('a1')) == r"a_{1}" + assert latex(Function('a12')) == r"a_{12}" + assert latex(Function('a_1')) == r"a_{1}" + assert latex(Function('a_12')) == r"a_{12}" + + # > with argument + assert latex(Function('a')()) == r"a{\left( \right)}" + assert latex(Function('a1')()) == r"a_{1}{\left( \right)}" + assert latex(Function('a12')()) == r"a_{12}{\left( \right)}" + assert latex(Function('a_1')()) == r"a_{1}{\left( \right)}" + assert latex(Function('a_12')()) == r"a_{12}{\left( \right)}" + + # > with power + # does not work on functions without brackets + + # > with argument and power combined + assert latex(Function('a')()**2) == r"a^{2}{\left( \right)}" + assert latex(Function('a1')()**2) == r"a_{1}^{2}{\left( \right)}" + assert latex(Function('a12')()**2) == r"a_{12}^{2}{\left( \right)}" + assert latex(Function('a_1')()**2) == r"a_{1}^{2}{\left( \right)}" + assert latex(Function('a_12')()**2) == r"a_{12}^{2}{\left( \right)}" + assert latex(Function('a')(Symbol('x'))**2) == r"a^{2}{\left(x \right)}" + assert latex(Function('a1')(Symbol('x'))**2) == r"a_{1}^{2}{\left(x \right)}" + assert latex(Function('a12')(Symbol('x'))**2) == r"a_{12}^{2}{\left(x \right)}" + assert latex(Function('a_1')(Symbol('x'))**2) == r"a_{1}^{2}{\left(x \right)}" + assert latex(Function('a_12')(Symbol('x'))**2) == r"a_{12}^{2}{\left(x \right)}" + + assert latex(Function('a')()**32) == r"a^{32}{\left( \right)}" + assert latex(Function('a1')()**32) == r"a_{1}^{32}{\left( \right)}" + assert latex(Function('a12')()**32) == r"a_{12}^{32}{\left( \right)}" + assert latex(Function('a_1')()**32) == r"a_{1}^{32}{\left( \right)}" + assert latex(Function('a_12')()**32) == r"a_{12}^{32}{\left( \right)}" + assert latex(Function('a')(Symbol('x'))**32) == r"a^{32}{\left(x \right)}" + assert latex(Function('a1')(Symbol('x'))**32) == r"a_{1}^{32}{\left(x \right)}" + assert latex(Function('a12')(Symbol('x'))**32) == r"a_{12}^{32}{\left(x \right)}" + assert latex(Function('a_1')(Symbol('x'))**32) == r"a_{1}^{32}{\left(x \right)}" + assert latex(Function('a_12')(Symbol('x'))**32) == r"a_{12}^{32}{\left(x \right)}" + + assert latex(Function('a')()**a) == r"a^{a}{\left( \right)}" + assert latex(Function('a1')()**a) == r"a_{1}^{a}{\left( \right)}" + assert latex(Function('a12')()**a) == r"a_{12}^{a}{\left( \right)}" + assert latex(Function('a_1')()**a) == r"a_{1}^{a}{\left( \right)}" + assert latex(Function('a_12')()**a) == r"a_{12}^{a}{\left( \right)}" + assert latex(Function('a')(Symbol('x'))**a) == r"a^{a}{\left(x \right)}" + assert latex(Function('a1')(Symbol('x'))**a) == r"a_{1}^{a}{\left(x \right)}" + assert latex(Function('a12')(Symbol('x'))**a) == r"a_{12}^{a}{\left(x \right)}" + assert latex(Function('a_1')(Symbol('x'))**a) == r"a_{1}^{a}{\left(x \right)}" + assert latex(Function('a_12')(Symbol('x'))**a) == r"a_{12}^{a}{\left(x \right)}" + + ab = Symbol('ab') + assert latex(Function('a')()**ab) == r"a^{ab}{\left( \right)}" + assert latex(Function('a1')()**ab) == r"a_{1}^{ab}{\left( \right)}" + assert latex(Function('a12')()**ab) == r"a_{12}^{ab}{\left( \right)}" + assert latex(Function('a_1')()**ab) == r"a_{1}^{ab}{\left( \right)}" + assert latex(Function('a_12')()**ab) == r"a_{12}^{ab}{\left( \right)}" + assert latex(Function('a')(Symbol('x'))**ab) == r"a^{ab}{\left(x \right)}" + assert latex(Function('a1')(Symbol('x'))**ab) == r"a_{1}^{ab}{\left(x \right)}" + assert latex(Function('a12')(Symbol('x'))**ab) == r"a_{12}^{ab}{\left(x \right)}" + assert latex(Function('a_1')(Symbol('x'))**ab) == r"a_{1}^{ab}{\left(x \right)}" + assert latex(Function('a_12')(Symbol('x'))**ab) == r"a_{12}^{ab}{\left(x \right)}" + + assert latex(Function('a^12')(x)) == R"a^{12}{\left(x \right)}" + assert latex(Function('a^12')(x) ** ab) == R"\left(a^{12}\right)^{ab}{\left(x \right)}" + assert latex(Function('a__12')(x)) == R"a^{12}{\left(x \right)}" + assert latex(Function('a__12')(x) ** ab) == R"\left(a^{12}\right)^{ab}{\left(x \right)}" + assert latex(Function('a_1__1_2')(x)) == R"a^{1}_{1 2}{\left(x \right)}" + + # issue 5868 + omega1 = Function('omega1') + assert latex(omega1) == r"\omega_{1}" + assert latex(omega1(x)) == r"\omega_{1}{\left(x \right)}" + + assert latex(sin(x)) == r"\sin{\left(x \right)}" + assert latex(sin(x), fold_func_brackets=True) == r"\sin {x}" + assert latex(sin(2*x**2), fold_func_brackets=True) == \ + r"\sin {2 x^{2}}" + assert latex(sin(x**2), fold_func_brackets=True) == \ + r"\sin {x^{2}}" + + assert latex(asin(x)**2) == r"\operatorname{asin}^{2}{\left(x \right)}" + assert latex(asin(x)**2, inv_trig_style="full") == \ + r"\arcsin^{2}{\left(x \right)}" + assert latex(asin(x)**2, inv_trig_style="power") == \ + r"\sin^{-1}{\left(x \right)}^{2}" + assert latex(asin(x**2), inv_trig_style="power", + fold_func_brackets=True) == \ + r"\sin^{-1} {x^{2}}" + assert latex(acsc(x), inv_trig_style="full") == \ + r"\operatorname{arccsc}{\left(x \right)}" + assert latex(asinh(x), inv_trig_style="full") == \ + r"\operatorname{arsinh}{\left(x \right)}" + + assert latex(factorial(k)) == r"k!" + assert latex(factorial(-k)) == r"\left(- k\right)!" + assert latex(factorial(k)**2) == r"k!^{2}" + + assert latex(subfactorial(k)) == r"!k" + assert latex(subfactorial(-k)) == r"!\left(- k\right)" + assert latex(subfactorial(k)**2) == r"\left(!k\right)^{2}" + + assert latex(factorial2(k)) == r"k!!" + assert latex(factorial2(-k)) == r"\left(- k\right)!!" + assert latex(factorial2(k)**2) == r"k!!^{2}" + + assert latex(binomial(2, k)) == r"{\binom{2}{k}}" + assert latex(binomial(2, k)**2) == r"{\binom{2}{k}}^{2}" + + assert latex(FallingFactorial(3, k)) == r"{\left(3\right)}_{k}" + assert latex(RisingFactorial(3, k)) == r"{3}^{\left(k\right)}" + + assert latex(floor(x)) == r"\left\lfloor{x}\right\rfloor" + assert latex(ceiling(x)) == r"\left\lceil{x}\right\rceil" + assert latex(frac(x)) == r"\operatorname{frac}{\left(x\right)}" + assert latex(floor(x)**2) == r"\left\lfloor{x}\right\rfloor^{2}" + assert latex(ceiling(x)**2) == r"\left\lceil{x}\right\rceil^{2}" + assert latex(frac(x)**2) == r"\operatorname{frac}{\left(x\right)}^{2}" + + assert latex(Min(x, 2, x**3)) == r"\min\left(2, x, x^{3}\right)" + assert latex(Min(x, y)**2) == r"\min\left(x, y\right)^{2}" + assert latex(Max(x, 2, x**3)) == r"\max\left(2, x, x^{3}\right)" + assert latex(Max(x, y)**2) == r"\max\left(x, y\right)^{2}" + assert latex(Abs(x)) == r"\left|{x}\right|" + assert latex(Abs(x)**2) == r"\left|{x}\right|^{2}" + assert latex(re(x)) == r"\operatorname{re}{\left(x\right)}" + assert latex(re(x + y)) == \ + r"\operatorname{re}{\left(x\right)} + \operatorname{re}{\left(y\right)}" + assert latex(im(x)) == r"\operatorname{im}{\left(x\right)}" + assert latex(conjugate(x)) == r"\overline{x}" + assert latex(conjugate(x)**2) == r"\overline{x}^{2}" + assert latex(conjugate(x**2)) == r"\overline{x}^{2}" + assert latex(gamma(x)) == r"\Gamma\left(x\right)" + w = Wild('w') + assert latex(gamma(w)) == r"\Gamma\left(w\right)" + assert latex(Order(x)) == r"O\left(x\right)" + assert latex(Order(x, x)) == r"O\left(x\right)" + assert latex(Order(x, (x, 0))) == r"O\left(x\right)" + assert latex(Order(x, (x, oo))) == r"O\left(x; x\rightarrow \infty\right)" + assert latex(Order(x - y, (x, y))) == \ + r"O\left(x - y; x\rightarrow y\right)" + assert latex(Order(x, x, y)) == \ + r"O\left(x; \left( x, \ y\right)\rightarrow \left( 0, \ 0\right)\right)" + assert latex(Order(x, x, y)) == \ + r"O\left(x; \left( x, \ y\right)\rightarrow \left( 0, \ 0\right)\right)" + assert latex(Order(x, (x, oo), (y, oo))) == \ + r"O\left(x; \left( x, \ y\right)\rightarrow \left( \infty, \ \infty\right)\right)" + assert latex(lowergamma(x, y)) == r'\gamma\left(x, y\right)' + assert latex(lowergamma(x, y)**2) == r'\gamma^{2}\left(x, y\right)' + assert latex(uppergamma(x, y)) == r'\Gamma\left(x, y\right)' + assert latex(uppergamma(x, y)**2) == r'\Gamma^{2}\left(x, y\right)' + + assert latex(cot(x)) == r'\cot{\left(x \right)}' + assert latex(coth(x)) == r'\coth{\left(x \right)}' + assert latex(re(x)) == r'\operatorname{re}{\left(x\right)}' + assert latex(im(x)) == r'\operatorname{im}{\left(x\right)}' + assert latex(root(x, y)) == r'x^{\frac{1}{y}}' + assert latex(arg(x)) == r'\arg{\left(x \right)}' + + assert latex(zeta(x)) == r"\zeta\left(x\right)" + assert latex(zeta(x)**2) == r"\zeta^{2}\left(x\right)" + assert latex(zeta(x, y)) == r"\zeta\left(x, y\right)" + assert latex(zeta(x, y)**2) == r"\zeta^{2}\left(x, y\right)" + assert latex(dirichlet_eta(x)) == r"\eta\left(x\right)" + assert latex(dirichlet_eta(x)**2) == r"\eta^{2}\left(x\right)" + assert latex(polylog(x, y)) == r"\operatorname{Li}_{x}\left(y\right)" + assert latex( + polylog(x, y)**2) == r"\operatorname{Li}_{x}^{2}\left(y\right)" + assert latex(lerchphi(x, y, n)) == r"\Phi\left(x, y, n\right)" + assert latex(lerchphi(x, y, n)**2) == r"\Phi^{2}\left(x, y, n\right)" + assert latex(stieltjes(x)) == r"\gamma_{x}" + assert latex(stieltjes(x)**2) == r"\gamma_{x}^{2}" + assert latex(stieltjes(x, y)) == r"\gamma_{x}\left(y\right)" + assert latex(stieltjes(x, y)**2) == r"\gamma_{x}\left(y\right)^{2}" + + assert latex(elliptic_k(z)) == r"K\left(z\right)" + assert latex(elliptic_k(z)**2) == r"K^{2}\left(z\right)" + assert latex(elliptic_f(x, y)) == r"F\left(x\middle| y\right)" + assert latex(elliptic_f(x, y)**2) == r"F^{2}\left(x\middle| y\right)" + assert latex(elliptic_e(x, y)) == r"E\left(x\middle| y\right)" + assert latex(elliptic_e(x, y)**2) == r"E^{2}\left(x\middle| y\right)" + assert latex(elliptic_e(z)) == r"E\left(z\right)" + assert latex(elliptic_e(z)**2) == r"E^{2}\left(z\right)" + assert latex(elliptic_pi(x, y, z)) == r"\Pi\left(x; y\middle| z\right)" + assert latex(elliptic_pi(x, y, z)**2) == \ + r"\Pi^{2}\left(x; y\middle| z\right)" + assert latex(elliptic_pi(x, y)) == r"\Pi\left(x\middle| y\right)" + assert latex(elliptic_pi(x, y)**2) == r"\Pi^{2}\left(x\middle| y\right)" + + assert latex(Ei(x)) == r'\operatorname{Ei}{\left(x \right)}' + assert latex(Ei(x)**2) == r'\operatorname{Ei}^{2}{\left(x \right)}' + assert latex(expint(x, y)) == r'\operatorname{E}_{x}\left(y\right)' + assert latex(expint(x, y)**2) == r'\operatorname{E}_{x}^{2}\left(y\right)' + assert latex(Shi(x)**2) == r'\operatorname{Shi}^{2}{\left(x \right)}' + assert latex(Si(x)**2) == r'\operatorname{Si}^{2}{\left(x \right)}' + assert latex(Ci(x)**2) == r'\operatorname{Ci}^{2}{\left(x \right)}' + assert latex(Chi(x)**2) == r'\operatorname{Chi}^{2}\left(x\right)' + assert latex(Chi(x)) == r'\operatorname{Chi}\left(x\right)' + assert latex(jacobi(n, a, b, x)) == \ + r'P_{n}^{\left(a,b\right)}\left(x\right)' + assert latex(jacobi(n, a, b, x)**2) == \ + r'\left(P_{n}^{\left(a,b\right)}\left(x\right)\right)^{2}' + assert latex(gegenbauer(n, a, x)) == \ + r'C_{n}^{\left(a\right)}\left(x\right)' + assert latex(gegenbauer(n, a, x)**2) == \ + r'\left(C_{n}^{\left(a\right)}\left(x\right)\right)^{2}' + assert latex(chebyshevt(n, x)) == r'T_{n}\left(x\right)' + assert latex(chebyshevt(n, x)**2) == \ + r'\left(T_{n}\left(x\right)\right)^{2}' + assert latex(chebyshevu(n, x)) == r'U_{n}\left(x\right)' + assert latex(chebyshevu(n, x)**2) == \ + r'\left(U_{n}\left(x\right)\right)^{2}' + assert latex(legendre(n, x)) == r'P_{n}\left(x\right)' + assert latex(legendre(n, x)**2) == r'\left(P_{n}\left(x\right)\right)^{2}' + assert latex(assoc_legendre(n, a, x)) == \ + r'P_{n}^{\left(a\right)}\left(x\right)' + assert latex(assoc_legendre(n, a, x)**2) == \ + r'\left(P_{n}^{\left(a\right)}\left(x\right)\right)^{2}' + assert latex(laguerre(n, x)) == r'L_{n}\left(x\right)' + assert latex(laguerre(n, x)**2) == r'\left(L_{n}\left(x\right)\right)^{2}' + assert latex(assoc_laguerre(n, a, x)) == \ + r'L_{n}^{\left(a\right)}\left(x\right)' + assert latex(assoc_laguerre(n, a, x)**2) == \ + r'\left(L_{n}^{\left(a\right)}\left(x\right)\right)^{2}' + assert latex(hermite(n, x)) == r'H_{n}\left(x\right)' + assert latex(hermite(n, x)**2) == r'\left(H_{n}\left(x\right)\right)^{2}' + + theta = Symbol("theta", real=True) + phi = Symbol("phi", real=True) + assert latex(Ynm(n, m, theta, phi)) == r'Y_{n}^{m}\left(\theta,\phi\right)' + assert latex(Ynm(n, m, theta, phi)**3) == \ + r'\left(Y_{n}^{m}\left(\theta,\phi\right)\right)^{3}' + assert latex(Znm(n, m, theta, phi)) == r'Z_{n}^{m}\left(\theta,\phi\right)' + assert latex(Znm(n, m, theta, phi)**3) == \ + r'\left(Z_{n}^{m}\left(\theta,\phi\right)\right)^{3}' + + # Test latex printing of function names with "_" + assert latex(polar_lift(0)) == \ + r"\operatorname{polar\_lift}{\left(0 \right)}" + assert latex(polar_lift(0)**3) == \ + r"\operatorname{polar\_lift}^{3}{\left(0 \right)}" + + assert latex(totient(n)) == r'\phi\left(n\right)' + assert latex(totient(n) ** 2) == r'\left(\phi\left(n\right)\right)^{2}' + + assert latex(reduced_totient(n)) == r'\lambda\left(n\right)' + assert latex(reduced_totient(n) ** 2) == \ + r'\left(\lambda\left(n\right)\right)^{2}' + + assert latex(divisor_sigma(x)) == r"\sigma\left(x\right)" + assert latex(divisor_sigma(x)**2) == r"\sigma^{2}\left(x\right)" + assert latex(divisor_sigma(x, y)) == r"\sigma_y\left(x\right)" + assert latex(divisor_sigma(x, y)**2) == r"\sigma^{2}_y\left(x\right)" + + assert latex(udivisor_sigma(x)) == r"\sigma^*\left(x\right)" + assert latex(udivisor_sigma(x)**2) == r"\sigma^*^{2}\left(x\right)" + assert latex(udivisor_sigma(x, y)) == r"\sigma^*_y\left(x\right)" + assert latex(udivisor_sigma(x, y)**2) == r"\sigma^*^{2}_y\left(x\right)" + + assert latex(primenu(n)) == r'\nu\left(n\right)' + assert latex(primenu(n) ** 2) == r'\left(\nu\left(n\right)\right)^{2}' + + assert latex(primeomega(n)) == r'\Omega\left(n\right)' + assert latex(primeomega(n) ** 2) == \ + r'\left(\Omega\left(n\right)\right)^{2}' + + assert latex(LambertW(n)) == r'W\left(n\right)' + assert latex(LambertW(n, -1)) == r'W_{-1}\left(n\right)' + assert latex(LambertW(n, k)) == r'W_{k}\left(n\right)' + assert latex(LambertW(n) * LambertW(n)) == r"W^{2}\left(n\right)" + assert latex(Pow(LambertW(n), 2)) == r"W^{2}\left(n\right)" + assert latex(LambertW(n)**k) == r"W^{k}\left(n\right)" + assert latex(LambertW(n, k)**p) == r"W^{p}_{k}\left(n\right)" + + assert latex(Mod(x, 7)) == r'x \bmod 7' + assert latex(Mod(x + 1, 7)) == r'\left(x + 1\right) \bmod 7' + assert latex(Mod(7, x + 1)) == r'7 \bmod \left(x + 1\right)' + assert latex(Mod(2 * x, 7)) == r'2 x \bmod 7' + assert latex(Mod(7, 2 * x)) == r'7 \bmod 2 x' + assert latex(Mod(x, 7) + 1) == r'\left(x \bmod 7\right) + 1' + assert latex(2 * Mod(x, 7)) == r'2 \left(x \bmod 7\right)' + assert latex(Mod(7, 2 * x)**n) == r'\left(7 \bmod 2 x\right)^{n}' + + # some unknown function name should get rendered with \operatorname + fjlkd = Function('fjlkd') + assert latex(fjlkd(x)) == r'\operatorname{fjlkd}{\left(x \right)}' + # even when it is referred to without an argument + assert latex(fjlkd) == r'\operatorname{fjlkd}' + + +# test that notation passes to subclasses of the same name only +def test_function_subclass_different_name(): + class mygamma(gamma): + pass + assert latex(mygamma) == r"\operatorname{mygamma}" + assert latex(mygamma(x)) == r"\operatorname{mygamma}{\left(x \right)}" + + +def test_hyper_printing(): + from sympy.abc import x, z + + assert latex(meijerg(Tuple(pi, pi, x), Tuple(1), + (0, 1), Tuple(1, 2, 3/pi), z)) == \ + r'{G_{4, 5}^{2, 3}\left(\begin{matrix} \pi, \pi, x & 1 \\0, 1 & 1, 2, '\ + r'\frac{3}{\pi} \end{matrix} \middle| {z} \right)}' + assert latex(meijerg(Tuple(), Tuple(1), (0,), Tuple(), z)) == \ + r'{G_{1, 1}^{1, 0}\left(\begin{matrix} & 1 \\0 & \end{matrix} \middle| {z} \right)}' + assert latex(hyper((x, 2), (3,), z)) == \ + r'{{}_{2}F_{1}\left(\begin{matrix} x, 2 ' \ + r'\\ 3 \end{matrix}\middle| {z} \right)}' + assert latex(hyper(Tuple(), Tuple(1), z)) == \ + r'{{}_{0}F_{1}\left(\begin{matrix} ' \ + r'\\ 1 \end{matrix}\middle| {z} \right)}' + + +def test_latex_bessel(): + from sympy.functions.special.bessel import (besselj, bessely, besseli, + besselk, hankel1, hankel2, + jn, yn, hn1, hn2) + from sympy.abc import z + assert latex(besselj(n, z**2)**k) == r'J^{k}_{n}\left(z^{2}\right)' + assert latex(bessely(n, z)) == r'Y_{n}\left(z\right)' + assert latex(besseli(n, z)) == r'I_{n}\left(z\right)' + assert latex(besselk(n, z)) == r'K_{n}\left(z\right)' + assert latex(hankel1(n, z**2)**2) == \ + r'\left(H^{(1)}_{n}\left(z^{2}\right)\right)^{2}' + assert latex(hankel2(n, z)) == r'H^{(2)}_{n}\left(z\right)' + assert latex(jn(n, z)) == r'j_{n}\left(z\right)' + assert latex(yn(n, z)) == r'y_{n}\left(z\right)' + assert latex(hn1(n, z)) == r'h^{(1)}_{n}\left(z\right)' + assert latex(hn2(n, z)) == r'h^{(2)}_{n}\left(z\right)' + + +def test_latex_fresnel(): + from sympy.functions.special.error_functions import (fresnels, fresnelc) + from sympy.abc import z + assert latex(fresnels(z)) == r'S\left(z\right)' + assert latex(fresnelc(z)) == r'C\left(z\right)' + assert latex(fresnels(z)**2) == r'S^{2}\left(z\right)' + assert latex(fresnelc(z)**2) == r'C^{2}\left(z\right)' + + +def test_latex_brackets(): + assert latex((-1)**x) == r"\left(-1\right)^{x}" + + +def test_latex_indexed(): + Psi_symbol = Symbol('Psi_0', complex=True, real=False) + Psi_indexed = IndexedBase(Symbol('Psi', complex=True, real=False)) + symbol_latex = latex(Psi_symbol * conjugate(Psi_symbol)) + indexed_latex = latex(Psi_indexed[0] * conjugate(Psi_indexed[0])) + # \\overline{{\\Psi}_{0}} {\\Psi}_{0} vs. \\Psi_{0} \\overline{\\Psi_{0}} + assert symbol_latex == r'\Psi_{0} \overline{\Psi_{0}}' + assert indexed_latex == r'\overline{{\Psi}_{0}} {\Psi}_{0}' + + # Symbol('gamma') gives r'\gamma' + interval = '\\mathrel{..}\\nobreak ' + assert latex(Indexed('x1', Symbol('i'))) == r'{x_{1}}_{i}' + assert latex(Indexed('x2', Idx('i'))) == r'{x_{2}}_{i}' + assert latex(Indexed('x3', Idx('i', Symbol('N')))) == r'{x_{3}}_{{i}_{0'+interval+'N - 1}}' + assert latex(Indexed('x3', Idx('i', Symbol('N')+1))) == r'{x_{3}}_{{i}_{0'+interval+'N}}' + assert latex(Indexed('x4', Idx('i', (Symbol('a'),Symbol('b'))))) == r'{x_{4}}_{{i}_{a'+interval+'b}}' + assert latex(IndexedBase('gamma')) == r'\gamma' + assert latex(IndexedBase('a b')) == r'a b' + assert latex(IndexedBase('a_b')) == r'a_{b}' + + +def test_latex_derivatives(): + # regular "d" for ordinary derivatives + assert latex(diff(x**3, x, evaluate=False)) == \ + r"\frac{d}{d x} x^{3}" + assert latex(diff(sin(x) + x**2, x, evaluate=False)) == \ + r"\frac{d}{d x} \left(x^{2} + \sin{\left(x \right)}\right)" + assert latex(diff(diff(sin(x) + x**2, x, evaluate=False), evaluate=False))\ + == \ + r"\frac{d^{2}}{d x^{2}} \left(x^{2} + \sin{\left(x \right)}\right)" + assert latex(diff(diff(diff(sin(x) + x**2, x, evaluate=False), evaluate=False), evaluate=False)) == \ + r"\frac{d^{3}}{d x^{3}} \left(x^{2} + \sin{\left(x \right)}\right)" + + # \partial for partial derivatives + assert latex(diff(sin(x * y), x, evaluate=False)) == \ + r"\frac{\partial}{\partial x} \sin{\left(x y \right)}" + assert latex(diff(sin(x * y) + x**2, x, evaluate=False)) == \ + r"\frac{\partial}{\partial x} \left(x^{2} + \sin{\left(x y \right)}\right)" + assert latex(diff(diff(sin(x*y) + x**2, x, evaluate=False), x, evaluate=False)) == \ + r"\frac{\partial^{2}}{\partial x^{2}} \left(x^{2} + \sin{\left(x y \right)}\right)" + assert latex(diff(diff(diff(sin(x*y) + x**2, x, evaluate=False), x, evaluate=False), x, evaluate=False)) == \ + r"\frac{\partial^{3}}{\partial x^{3}} \left(x^{2} + \sin{\left(x y \right)}\right)" + + # mixed partial derivatives + f = Function("f") + assert latex(diff(diff(f(x, y), x, evaluate=False), y, evaluate=False)) == \ + r"\frac{\partial^{2}}{\partial y\partial x} " + latex(f(x, y)) + + assert latex(diff(diff(diff(f(x, y), x, evaluate=False), x, evaluate=False), y, evaluate=False)) == \ + r"\frac{\partial^{3}}{\partial y\partial x^{2}} " + latex(f(x, y)) + + # for negative nested Derivative + assert latex(diff(-diff(y**2,x,evaluate=False),x,evaluate=False)) == r'\frac{d}{d x} \left(- \frac{d}{d x} y^{2}\right)' + assert latex(diff(diff(-diff(diff(y,x,evaluate=False),x,evaluate=False),x,evaluate=False),x,evaluate=False)) == \ + r'\frac{d^{2}}{d x^{2}} \left(- \frac{d^{2}}{d x^{2}} y\right)' + + # use ordinary d when one of the variables has been integrated out + assert latex(diff(Integral(exp(-x*y), (x, 0, oo)), y, evaluate=False)) == \ + r"\frac{d}{d y} \int\limits_{0}^{\infty} e^{- x y}\, dx" + + # Derivative wrapped in power: + assert latex(diff(x, x, evaluate=False)**2) == \ + r"\left(\frac{d}{d x} x\right)^{2}" + + assert latex(diff(f(x), x)**2) == \ + r"\left(\frac{d}{d x} f{\left(x \right)}\right)^{2}" + + assert latex(diff(f(x), (x, n))) == \ + r"\frac{d^{n}}{d x^{n}} f{\left(x \right)}" + + x1 = Symbol('x1') + x2 = Symbol('x2') + assert latex(diff(f(x1, x2), x1)) == r'\frac{\partial}{\partial x_{1}} f{\left(x_{1},x_{2} \right)}' + + n1 = Symbol('n1') + assert latex(diff(f(x), (x, n1))) == r'\frac{d^{n_{1}}}{d x^{n_{1}}} f{\left(x \right)}' + + n2 = Symbol('n2') + assert latex(diff(f(x), (x, Max(n1, n2)))) == \ + r'\frac{d^{\max\left(n_{1}, n_{2}\right)}}{d x^{\max\left(n_{1}, n_{2}\right)}} f{\left(x \right)}' + + # set diff operator + assert latex(diff(f(x), x), diff_operator="rd") == r'\frac{\mathrm{d}}{\mathrm{d} x} f{\left(x \right)}' + + +def test_latex_subs(): + assert latex(Subs(x*y, (x, y), (1, 2))) == r'\left. x y \right|_{\substack{ x=1\\ y=2 }}' + + +def test_latex_integrals(): + assert latex(Integral(log(x), x)) == r"\int \log{\left(x \right)}\, dx" + assert latex(Integral(x**2, (x, 0, 1))) == \ + r"\int\limits_{0}^{1} x^{2}\, dx" + assert latex(Integral(x**2, (x, 10, 20))) == \ + r"\int\limits_{10}^{20} x^{2}\, dx" + assert latex(Integral(y*x**2, (x, 0, 1), y)) == \ + r"\int\int\limits_{0}^{1} x^{2} y\, dx\, dy" + assert latex(Integral(y*x**2, (x, 0, 1), y), mode='equation*') == \ + r"\begin{equation*}\int\int\limits_{0}^{1} x^{2} y\, dx\, dy\end{equation*}" + assert latex(Integral(y*x**2, (x, 0, 1), y), mode='equation*', itex=True) \ + == r"$$\int\int_{0}^{1} x^{2} y\, dx\, dy$$" + assert latex(Integral(x, (x, 0))) == r"\int\limits^{0} x\, dx" + assert latex(Integral(x*y, x, y)) == r"\iint x y\, dx\, dy" + assert latex(Integral(x*y*z, x, y, z)) == r"\iiint x y z\, dx\, dy\, dz" + assert latex(Integral(x*y*z*t, x, y, z, t)) == \ + r"\iiiint t x y z\, dx\, dy\, dz\, dt" + assert latex(Integral(x, x, x, x, x, x, x)) == \ + r"\int\int\int\int\int\int x\, dx\, dx\, dx\, dx\, dx\, dx" + assert latex(Integral(x, x, y, (z, 0, 1))) == \ + r"\int\limits_{0}^{1}\int\int x\, dx\, dy\, dz" + + # for negative nested Integral + assert latex(Integral(-Integral(y**2,x),x)) == \ + r'\int \left(- \int y^{2}\, dx\right)\, dx' + assert latex(Integral(-Integral(-Integral(y,x),x),x)) == \ + r'\int \left(- \int \left(- \int y\, dx\right)\, dx\right)\, dx' + + # fix issue #10806 + assert latex(Integral(z, z)**2) == r"\left(\int z\, dz\right)^{2}" + assert latex(Integral(x + z, z)) == r"\int \left(x + z\right)\, dz" + assert latex(Integral(x+z/2, z)) == \ + r"\int \left(x + \frac{z}{2}\right)\, dz" + assert latex(Integral(x**y, z)) == r"\int x^{y}\, dz" + + # set diff operator + assert latex(Integral(x, x), diff_operator="rd") == r'\int x\, \mathrm{d}x' + assert latex(Integral(x, (x, 0, 1)), diff_operator="rd") == r'\int\limits_{0}^{1} x\, \mathrm{d}x' + + +def test_latex_sets(): + for s in (frozenset, set): + assert latex(s([x*y, x**2])) == r"\left\{x^{2}, x y\right\}" + assert latex(s(range(1, 6))) == r"\left\{1, 2, 3, 4, 5\right\}" + assert latex(s(range(1, 13))) == \ + r"\left\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12\right\}" + + s = FiniteSet + assert latex(s(*[x*y, x**2])) == r"\left\{x^{2}, x y\right\}" + assert latex(s(*range(1, 6))) == r"\left\{1, 2, 3, 4, 5\right\}" + assert latex(s(*range(1, 13))) == \ + r"\left\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12\right\}" + + +def test_latex_SetExpr(): + iv = Interval(1, 3) + se = SetExpr(iv) + assert latex(se) == r"SetExpr\left(\left[1, 3\right]\right)" + + +def test_latex_Range(): + assert latex(Range(1, 51)) == r'\left\{1, 2, \ldots, 50\right\}' + assert latex(Range(1, 4)) == r'\left\{1, 2, 3\right\}' + assert latex(Range(0, 3, 1)) == r'\left\{0, 1, 2\right\}' + assert latex(Range(0, 30, 1)) == r'\left\{0, 1, \ldots, 29\right\}' + assert latex(Range(30, 1, -1)) == r'\left\{30, 29, \ldots, 2\right\}' + assert latex(Range(0, oo, 2)) == r'\left\{0, 2, \ldots\right\}' + assert latex(Range(oo, -2, -2)) == r'\left\{\ldots, 2, 0\right\}' + assert latex(Range(-2, -oo, -1)) == r'\left\{-2, -3, \ldots\right\}' + assert latex(Range(-oo, oo)) == r'\left\{\ldots, -1, 0, 1, \ldots\right\}' + assert latex(Range(oo, -oo, -1)) == r'\left\{\ldots, 1, 0, -1, \ldots\right\}' + + a, b, c = symbols('a:c') + assert latex(Range(a, b, c)) == r'\text{Range}\left(a, b, c\right)' + assert latex(Range(a, 10, 1)) == r'\text{Range}\left(a, 10\right)' + assert latex(Range(0, b, 1)) == r'\text{Range}\left(b\right)' + assert latex(Range(0, 10, c)) == r'\text{Range}\left(0, 10, c\right)' + + i = Symbol('i', integer=True) + n = Symbol('n', negative=True, integer=True) + p = Symbol('p', positive=True, integer=True) + + assert latex(Range(i, i + 3)) == r'\left\{i, i + 1, i + 2\right\}' + assert latex(Range(-oo, n, 2)) == r'\left\{\ldots, n - 4, n - 2\right\}' + assert latex(Range(p, oo)) == r'\left\{p, p + 1, \ldots\right\}' + # The following will work if __iter__ is improved + # assert latex(Range(-3, p + 7)) == r'\left\{-3, -2, \ldots, p + 6\right\}' + # Must have integer assumptions + assert latex(Range(a, a + 3)) == r'\text{Range}\left(a, a + 3\right)' + + +def test_latex_sequences(): + s1 = SeqFormula(a**2, (0, oo)) + s2 = SeqPer((1, 2)) + + latex_str = r'\left[0, 1, 4, 9, \ldots\right]' + assert latex(s1) == latex_str + + latex_str = r'\left[1, 2, 1, 2, \ldots\right]' + assert latex(s2) == latex_str + + s3 = SeqFormula(a**2, (0, 2)) + s4 = SeqPer((1, 2), (0, 2)) + + latex_str = r'\left[0, 1, 4\right]' + assert latex(s3) == latex_str + + latex_str = r'\left[1, 2, 1\right]' + assert latex(s4) == latex_str + + s5 = SeqFormula(a**2, (-oo, 0)) + s6 = SeqPer((1, 2), (-oo, 0)) + + latex_str = r'\left[\ldots, 9, 4, 1, 0\right]' + assert latex(s5) == latex_str + + latex_str = r'\left[\ldots, 2, 1, 2, 1\right]' + assert latex(s6) == latex_str + + latex_str = r'\left[1, 3, 5, 11, \ldots\right]' + assert latex(SeqAdd(s1, s2)) == latex_str + + latex_str = r'\left[1, 3, 5\right]' + assert latex(SeqAdd(s3, s4)) == latex_str + + latex_str = r'\left[\ldots, 11, 5, 3, 1\right]' + assert latex(SeqAdd(s5, s6)) == latex_str + + latex_str = r'\left[0, 2, 4, 18, \ldots\right]' + assert latex(SeqMul(s1, s2)) == latex_str + + latex_str = r'\left[0, 2, 4\right]' + assert latex(SeqMul(s3, s4)) == latex_str + + latex_str = r'\left[\ldots, 18, 4, 2, 0\right]' + assert latex(SeqMul(s5, s6)) == latex_str + + # Sequences with symbolic limits, issue 12629 + s7 = SeqFormula(a**2, (a, 0, x)) + latex_str = r'\left\{a^{2}\right\}_{a=0}^{x}' + assert latex(s7) == latex_str + + b = Symbol('b') + s8 = SeqFormula(b*a**2, (a, 0, 2)) + latex_str = r'\left[0, b, 4 b\right]' + assert latex(s8) == latex_str + + +def test_latex_FourierSeries(): + latex_str = \ + r'2 \sin{\left(x \right)} - \sin{\left(2 x \right)} + \frac{2 \sin{\left(3 x \right)}}{3} + \ldots' + assert latex(fourier_series(x, (x, -pi, pi))) == latex_str + + +def test_latex_FormalPowerSeries(): + latex_str = r'\sum_{k=1}^{\infty} - \frac{\left(-1\right)^{- k} x^{k}}{k}' + assert latex(fps(log(1 + x))) == latex_str + + +def test_latex_intervals(): + a = Symbol('a', real=True) + assert latex(Interval(0, 0)) == r"\left\{0\right\}" + assert latex(Interval(0, a)) == r"\left[0, a\right]" + assert latex(Interval(0, a, False, False)) == r"\left[0, a\right]" + assert latex(Interval(0, a, True, False)) == r"\left(0, a\right]" + assert latex(Interval(0, a, False, True)) == r"\left[0, a\right)" + assert latex(Interval(0, a, True, True)) == r"\left(0, a\right)" + + +def test_latex_AccumuBounds(): + a = Symbol('a', real=True) + assert latex(AccumBounds(0, 1)) == r"\left\langle 0, 1\right\rangle" + assert latex(AccumBounds(0, a)) == r"\left\langle 0, a\right\rangle" + assert latex(AccumBounds(a + 1, a + 2)) == \ + r"\left\langle a + 1, a + 2\right\rangle" + + +def test_latex_emptyset(): + assert latex(S.EmptySet) == r"\emptyset" + + +def test_latex_universalset(): + assert latex(S.UniversalSet) == r"\mathbb{U}" + + +def test_latex_commutator(): + A = Operator('A') + B = Operator('B') + comm = Commutator(B, A) + assert latex(comm.doit()) == r"- (A B - B A)" + + +def test_latex_union(): + assert latex(Union(Interval(0, 1), Interval(2, 3))) == \ + r"\left[0, 1\right] \cup \left[2, 3\right]" + assert latex(Union(Interval(1, 1), Interval(2, 2), Interval(3, 4))) == \ + r"\left\{1, 2\right\} \cup \left[3, 4\right]" + + +def test_latex_intersection(): + assert latex(Intersection(Interval(0, 1), Interval(x, y))) == \ + r"\left[0, 1\right] \cap \left[x, y\right]" + + +def test_latex_symmetric_difference(): + assert latex(SymmetricDifference(Interval(2, 5), Interval(4, 7), + evaluate=False)) == \ + r'\left[2, 5\right] \triangle \left[4, 7\right]' + + +def test_latex_Complement(): + assert latex(Complement(S.Reals, S.Naturals)) == \ + r"\mathbb{R} \setminus \mathbb{N}" + + +def test_latex_productset(): + line = Interval(0, 1) + bigline = Interval(0, 10) + fset = FiniteSet(1, 2, 3) + assert latex(line**2) == r"%s^{2}" % latex(line) + assert latex(line**10) == r"%s^{10}" % latex(line) + assert latex((line * bigline * fset).flatten()) == r"%s \times %s \times %s" % ( + latex(line), latex(bigline), latex(fset)) + + +def test_latex_powerset(): + fset = FiniteSet(1, 2, 3) + assert latex(PowerSet(fset)) == r'\mathcal{P}\left(\left\{1, 2, 3\right\}\right)' + + +def test_latex_ordinals(): + w = OrdinalOmega() + assert latex(w) == r"\omega" + wp = OmegaPower(2, 3) + assert latex(wp) == r'3 \omega^{2}' + assert latex(Ordinal(wp, OmegaPower(1, 1))) == r'3 \omega^{2} + \omega' + assert latex(Ordinal(OmegaPower(2, 1), OmegaPower(1, 2))) == r'\omega^{2} + 2 \omega' + + +def test_set_operators_parenthesis(): + a, b, c, d = symbols('a:d') + A = FiniteSet(a) + B = FiniteSet(b) + C = FiniteSet(c) + D = FiniteSet(d) + + U1 = Union(A, B, evaluate=False) + U2 = Union(C, D, evaluate=False) + I1 = Intersection(A, B, evaluate=False) + I2 = Intersection(C, D, evaluate=False) + C1 = Complement(A, B, evaluate=False) + C2 = Complement(C, D, evaluate=False) + D1 = SymmetricDifference(A, B, evaluate=False) + D2 = SymmetricDifference(C, D, evaluate=False) + # XXX ProductSet does not support evaluate keyword + P1 = ProductSet(A, B) + P2 = ProductSet(C, D) + + assert latex(Intersection(A, U2, evaluate=False)) == \ + r'\left\{a\right\} \cap ' \ + r'\left(\left\{c\right\} \cup \left\{d\right\}\right)' + assert latex(Intersection(U1, U2, evaluate=False)) == \ + r'\left(\left\{a\right\} \cup \left\{b\right\}\right) ' \ + r'\cap \left(\left\{c\right\} \cup \left\{d\right\}\right)' + assert latex(Intersection(C1, C2, evaluate=False)) == \ + r'\left(\left\{a\right\} \setminus ' \ + r'\left\{b\right\}\right) \cap \left(\left\{c\right\} ' \ + r'\setminus \left\{d\right\}\right)' + assert latex(Intersection(D1, D2, evaluate=False)) == \ + r'\left(\left\{a\right\} \triangle ' \ + r'\left\{b\right\}\right) \cap \left(\left\{c\right\} ' \ + r'\triangle \left\{d\right\}\right)' + assert latex(Intersection(P1, P2, evaluate=False)) == \ + r'\left(\left\{a\right\} \times \left\{b\right\}\right) ' \ + r'\cap \left(\left\{c\right\} \times ' \ + r'\left\{d\right\}\right)' + + assert latex(Union(A, I2, evaluate=False)) == \ + r'\left\{a\right\} \cup ' \ + r'\left(\left\{c\right\} \cap \left\{d\right\}\right)' + assert latex(Union(I1, I2, evaluate=False)) == \ + r'\left(\left\{a\right\} \cap \left\{b\right\}\right) ' \ + r'\cup \left(\left\{c\right\} \cap \left\{d\right\}\right)' + assert latex(Union(C1, C2, evaluate=False)) == \ + r'\left(\left\{a\right\} \setminus ' \ + r'\left\{b\right\}\right) \cup \left(\left\{c\right\} ' \ + r'\setminus \left\{d\right\}\right)' + assert latex(Union(D1, D2, evaluate=False)) == \ + r'\left(\left\{a\right\} \triangle ' \ + r'\left\{b\right\}\right) \cup \left(\left\{c\right\} ' \ + r'\triangle \left\{d\right\}\right)' + assert latex(Union(P1, P2, evaluate=False)) == \ + r'\left(\left\{a\right\} \times \left\{b\right\}\right) ' \ + r'\cup \left(\left\{c\right\} \times ' \ + r'\left\{d\right\}\right)' + + assert latex(Complement(A, C2, evaluate=False)) == \ + r'\left\{a\right\} \setminus \left(\left\{c\right\} ' \ + r'\setminus \left\{d\right\}\right)' + assert latex(Complement(U1, U2, evaluate=False)) == \ + r'\left(\left\{a\right\} \cup \left\{b\right\}\right) ' \ + r'\setminus \left(\left\{c\right\} \cup ' \ + r'\left\{d\right\}\right)' + assert latex(Complement(I1, I2, evaluate=False)) == \ + r'\left(\left\{a\right\} \cap \left\{b\right\}\right) ' \ + r'\setminus \left(\left\{c\right\} \cap ' \ + r'\left\{d\right\}\right)' + assert latex(Complement(D1, D2, evaluate=False)) == \ + r'\left(\left\{a\right\} \triangle ' \ + r'\left\{b\right\}\right) \setminus ' \ + r'\left(\left\{c\right\} \triangle \left\{d\right\}\right)' + assert latex(Complement(P1, P2, evaluate=False)) == \ + r'\left(\left\{a\right\} \times \left\{b\right\}\right) '\ + r'\setminus \left(\left\{c\right\} \times '\ + r'\left\{d\right\}\right)' + + assert latex(SymmetricDifference(A, D2, evaluate=False)) == \ + r'\left\{a\right\} \triangle \left(\left\{c\right\} ' \ + r'\triangle \left\{d\right\}\right)' + assert latex(SymmetricDifference(U1, U2, evaluate=False)) == \ + r'\left(\left\{a\right\} \cup \left\{b\right\}\right) ' \ + r'\triangle \left(\left\{c\right\} \cup ' \ + r'\left\{d\right\}\right)' + assert latex(SymmetricDifference(I1, I2, evaluate=False)) == \ + r'\left(\left\{a\right\} \cap \left\{b\right\}\right) ' \ + r'\triangle \left(\left\{c\right\} \cap ' \ + r'\left\{d\right\}\right)' + assert latex(SymmetricDifference(C1, C2, evaluate=False)) == \ + r'\left(\left\{a\right\} \setminus ' \ + r'\left\{b\right\}\right) \triangle ' \ + r'\left(\left\{c\right\} \setminus \left\{d\right\}\right)' + assert latex(SymmetricDifference(P1, P2, evaluate=False)) == \ + r'\left(\left\{a\right\} \times \left\{b\right\}\right) ' \ + r'\triangle \left(\left\{c\right\} \times ' \ + r'\left\{d\right\}\right)' + + # XXX This can be incorrect since cartesian product is not associative + assert latex(ProductSet(A, P2).flatten()) == \ + r'\left\{a\right\} \times \left\{c\right\} \times ' \ + r'\left\{d\right\}' + assert latex(ProductSet(U1, U2)) == \ + r'\left(\left\{a\right\} \cup \left\{b\right\}\right) ' \ + r'\times \left(\left\{c\right\} \cup ' \ + r'\left\{d\right\}\right)' + assert latex(ProductSet(I1, I2)) == \ + r'\left(\left\{a\right\} \cap \left\{b\right\}\right) ' \ + r'\times \left(\left\{c\right\} \cap ' \ + r'\left\{d\right\}\right)' + assert latex(ProductSet(C1, C2)) == \ + r'\left(\left\{a\right\} \setminus ' \ + r'\left\{b\right\}\right) \times \left(\left\{c\right\} ' \ + r'\setminus \left\{d\right\}\right)' + assert latex(ProductSet(D1, D2)) == \ + r'\left(\left\{a\right\} \triangle ' \ + r'\left\{b\right\}\right) \times \left(\left\{c\right\} ' \ + r'\triangle \left\{d\right\}\right)' + + +def test_latex_Complexes(): + assert latex(S.Complexes) == r"\mathbb{C}" + + +def test_latex_Naturals(): + assert latex(S.Naturals) == r"\mathbb{N}" + + +def test_latex_Naturals0(): + assert latex(S.Naturals0) == r"\mathbb{N}_0" + + +def test_latex_Integers(): + assert latex(S.Integers) == r"\mathbb{Z}" + + +def test_latex_ImageSet(): + x = Symbol('x') + assert latex(ImageSet(Lambda(x, x**2), S.Naturals)) == \ + r"\left\{x^{2}\; \middle|\; x \in \mathbb{N}\right\}" + + y = Symbol('y') + imgset = ImageSet(Lambda((x, y), x + y), {1, 2, 3}, {3, 4}) + assert latex(imgset) == \ + r"\left\{x + y\; \middle|\; x \in \left\{1, 2, 3\right\}, y \in \left\{3, 4\right\}\right\}" + + imgset = ImageSet(Lambda(((x, y),), x + y), ProductSet({1, 2, 3}, {3, 4})) + assert latex(imgset) == \ + r"\left\{x + y\; \middle|\; \left( x, \ y\right) \in \left\{1, 2, 3\right\} \times \left\{3, 4\right\}\right\}" + + +def test_latex_ConditionSet(): + x = Symbol('x') + assert latex(ConditionSet(x, Eq(x**2, 1), S.Reals)) == \ + r"\left\{x\; \middle|\; x \in \mathbb{R} \wedge x^{2} = 1 \right\}" + assert latex(ConditionSet(x, Eq(x**2, 1), S.UniversalSet)) == \ + r"\left\{x\; \middle|\; x^{2} = 1 \right\}" + + +def test_latex_ComplexRegion(): + assert latex(ComplexRegion(Interval(3, 5)*Interval(4, 6))) == \ + r"\left\{x + y i\; \middle|\; x, y \in \left[3, 5\right] \times \left[4, 6\right] \right\}" + assert latex(ComplexRegion(Interval(0, 1)*Interval(0, 2*pi), polar=True)) == \ + r"\left\{r \left(i \sin{\left(\theta \right)} + \cos{\left(\theta "\ + r"\right)}\right)\; \middle|\; r, \theta \in \left[0, 1\right] \times \left[0, 2 \pi\right) \right\}" + + +def test_latex_Contains(): + x = Symbol('x') + assert latex(Contains(x, S.Naturals)) == r"x \in \mathbb{N}" + + +def test_latex_sum(): + assert latex(Sum(x*y**2, (x, -2, 2), (y, -5, 5))) == \ + r"\sum_{\substack{-2 \leq x \leq 2\\-5 \leq y \leq 5}} x y^{2}" + assert latex(Sum(x**2, (x, -2, 2))) == \ + r"\sum_{x=-2}^{2} x^{2}" + assert latex(Sum(x**2 + y, (x, -2, 2))) == \ + r"\sum_{x=-2}^{2} \left(x^{2} + y\right)" + assert latex(Sum(x**2 + y, (x, -2, 2))**2) == \ + r"\left(\sum_{x=-2}^{2} \left(x^{2} + y\right)\right)^{2}" + + +def test_latex_product(): + assert latex(Product(x*y**2, (x, -2, 2), (y, -5, 5))) == \ + r"\prod_{\substack{-2 \leq x \leq 2\\-5 \leq y \leq 5}} x y^{2}" + assert latex(Product(x**2, (x, -2, 2))) == \ + r"\prod_{x=-2}^{2} x^{2}" + assert latex(Product(x**2 + y, (x, -2, 2))) == \ + r"\prod_{x=-2}^{2} \left(x^{2} + y\right)" + + assert latex(Product(x, (x, -2, 2))**2) == \ + r"\left(\prod_{x=-2}^{2} x\right)^{2}" + + +def test_latex_limits(): + assert latex(Limit(x, x, oo)) == r"\lim_{x \to \infty} x" + + # issue 8175 + f = Function('f') + assert latex(Limit(f(x), x, 0)) == r"\lim_{x \to 0^+} f{\left(x \right)}" + assert latex(Limit(f(x), x, 0, "-")) == \ + r"\lim_{x \to 0^-} f{\left(x \right)}" + + # issue #10806 + assert latex(Limit(f(x), x, 0)**2) == \ + r"\left(\lim_{x \to 0^+} f{\left(x \right)}\right)^{2}" + # bi-directional limit + assert latex(Limit(f(x), x, 0, dir='+-')) == \ + r"\lim_{x \to 0} f{\left(x \right)}" + + +def test_latex_log(): + assert latex(log(x)) == r"\log{\left(x \right)}" + assert latex(log(x), ln_notation=True) == r"\ln{\left(x \right)}" + assert latex(log(x) + log(y)) == \ + r"\log{\left(x \right)} + \log{\left(y \right)}" + assert latex(log(x) + log(y), ln_notation=True) == \ + r"\ln{\left(x \right)} + \ln{\left(y \right)}" + assert latex(pow(log(x), x)) == r"\log{\left(x \right)}^{x}" + assert latex(pow(log(x), x), ln_notation=True) == \ + r"\ln{\left(x \right)}^{x}" + + +def test_issue_3568(): + beta = Symbol(r'\beta') + y = beta + x + assert latex(y) in [r'\beta + x', r'x + \beta'] + + beta = Symbol(r'beta') + y = beta + x + assert latex(y) in [r'\beta + x', r'x + \beta'] + + +def test_latex(): + assert latex((2*tau)**Rational(7, 2)) == r"8 \sqrt{2} \tau^{\frac{7}{2}}" + assert latex((2*mu)**Rational(7, 2), mode='equation*') == \ + r"\begin{equation*}8 \sqrt{2} \mu^{\frac{7}{2}}\end{equation*}" + assert latex((2*mu)**Rational(7, 2), mode='equation', itex=True) == \ + r"$$8 \sqrt{2} \mu^{\frac{7}{2}}$$" + assert latex([2/x, y]) == r"\left[ \frac{2}{x}, \ y\right]" + + +def test_latex_dict(): + d = {Rational(1): 1, x**2: 2, x: 3, x**3: 4} + assert latex(d) == \ + r'\left\{ 1 : 1, \ x : 3, \ x^{2} : 2, \ x^{3} : 4\right\}' + D = Dict(d) + assert latex(D) == \ + r'\left\{ 1 : 1, \ x : 3, \ x^{2} : 2, \ x^{3} : 4\right\}' + + +def test_latex_list(): + ll = [Symbol('omega1'), Symbol('a'), Symbol('alpha')] + assert latex(ll) == r'\left[ \omega_{1}, \ a, \ \alpha\right]' + + +def test_latex_NumberSymbols(): + assert latex(S.Catalan) == "G" + assert latex(S.EulerGamma) == r"\gamma" + assert latex(S.Exp1) == "e" + assert latex(S.GoldenRatio) == r"\phi" + assert latex(S.Pi) == r"\pi" + assert latex(S.TribonacciConstant) == r"\text{TribonacciConstant}" + + +def test_latex_rational(): + # tests issue 3973 + assert latex(-Rational(1, 2)) == r"- \frac{1}{2}" + assert latex(Rational(-1, 2)) == r"- \frac{1}{2}" + assert latex(Rational(1, -2)) == r"- \frac{1}{2}" + assert latex(-Rational(-1, 2)) == r"\frac{1}{2}" + assert latex(-Rational(1, 2)*x) == r"- \frac{x}{2}" + assert latex(-Rational(1, 2)*x + Rational(-2, 3)*y) == \ + r"- \frac{x}{2} - \frac{2 y}{3}" + + +def test_latex_inverse(): + # tests issue 4129 + assert latex(1/x) == r"\frac{1}{x}" + assert latex(1/(x + y)) == r"\frac{1}{x + y}" + + +def test_latex_DiracDelta(): + assert latex(DiracDelta(x)) == r"\delta\left(x\right)" + assert latex(DiracDelta(x)**2) == r"\left(\delta\left(x\right)\right)^{2}" + assert latex(DiracDelta(x, 0)) == r"\delta\left(x\right)" + assert latex(DiracDelta(x, 5)) == \ + r"\delta^{\left( 5 \right)}\left( x \right)" + assert latex(DiracDelta(x, 5)**2) == \ + r"\left(\delta^{\left( 5 \right)}\left( x \right)\right)^{2}" + + +def test_latex_Heaviside(): + assert latex(Heaviside(x)) == r"\theta\left(x\right)" + assert latex(Heaviside(x)**2) == r"\left(\theta\left(x\right)\right)^{2}" + + +def test_latex_KroneckerDelta(): + assert latex(KroneckerDelta(x, y)) == r"\delta_{x y}" + assert latex(KroneckerDelta(x, y + 1)) == r"\delta_{x, y + 1}" + # issue 6578 + assert latex(KroneckerDelta(x + 1, y)) == r"\delta_{y, x + 1}" + assert latex(Pow(KroneckerDelta(x, y), 2, evaluate=False)) == \ + r"\left(\delta_{x y}\right)^{2}" + + +def test_latex_LeviCivita(): + assert latex(LeviCivita(x, y, z)) == r"\varepsilon_{x y z}" + assert latex(LeviCivita(x, y, z)**2) == \ + r"\left(\varepsilon_{x y z}\right)^{2}" + assert latex(LeviCivita(x, y, z + 1)) == r"\varepsilon_{x, y, z + 1}" + assert latex(LeviCivita(x, y + 1, z)) == r"\varepsilon_{x, y + 1, z}" + assert latex(LeviCivita(x + 1, y, z)) == r"\varepsilon_{x + 1, y, z}" + + +def test_mode(): + expr = x + y + assert latex(expr) == r'x + y' + assert latex(expr, mode='plain') == r'x + y' + assert latex(expr, mode='inline') == r'$x + y$' + assert latex( + expr, mode='equation*') == r'\begin{equation*}x + y\end{equation*}' + assert latex( + expr, mode='equation') == r'\begin{equation}x + y\end{equation}' + raises(ValueError, lambda: latex(expr, mode='foo')) + + +def test_latex_mathieu(): + assert latex(mathieuc(x, y, z)) == r"C\left(x, y, z\right)" + assert latex(mathieus(x, y, z)) == r"S\left(x, y, z\right)" + assert latex(mathieuc(x, y, z)**2) == r"C\left(x, y, z\right)^{2}" + assert latex(mathieus(x, y, z)**2) == r"S\left(x, y, z\right)^{2}" + assert latex(mathieucprime(x, y, z)) == r"C^{\prime}\left(x, y, z\right)" + assert latex(mathieusprime(x, y, z)) == r"S^{\prime}\left(x, y, z\right)" + assert latex(mathieucprime(x, y, z)**2) == r"C^{\prime}\left(x, y, z\right)^{2}" + assert latex(mathieusprime(x, y, z)**2) == r"S^{\prime}\left(x, y, z\right)^{2}" + +def test_latex_Piecewise(): + p = Piecewise((x, x < 1), (x**2, True)) + assert latex(p) == r"\begin{cases} x & \text{for}\: x < 1 \\x^{2} &" \ + r" \text{otherwise} \end{cases}" + assert latex(p, itex=True) == \ + r"\begin{cases} x & \text{for}\: x \lt 1 \\x^{2} &" \ + r" \text{otherwise} \end{cases}" + p = Piecewise((x, x < 0), (0, x >= 0)) + assert latex(p) == r'\begin{cases} x & \text{for}\: x < 0 \\0 &' \ + r' \text{otherwise} \end{cases}' + A, B = symbols("A B", commutative=False) + p = Piecewise((A**2, Eq(A, B)), (A*B, True)) + s = r"\begin{cases} A^{2} & \text{for}\: A = B \\A B & \text{otherwise} \end{cases}" + assert latex(p) == s + assert latex(A*p) == r"A \left(%s\right)" % s + assert latex(p*A) == r"\left(%s\right) A" % s + assert latex(Piecewise((x, x < 1), (x**2, x < 2))) == \ + r'\begin{cases} x & ' \ + r'\text{for}\: x < 1 \\x^{2} & \text{for}\: x < 2 \end{cases}' + + +def test_latex_Matrix(): + M = Matrix([[1 + x, y], [y, x - 1]]) + assert latex(M) == \ + r'\left[\begin{matrix}x + 1 & y\\y & x - 1\end{matrix}\right]' + assert latex(M, mode='inline') == \ + r'$\left[\begin{smallmatrix}x + 1 & y\\' \ + r'y & x - 1\end{smallmatrix}\right]$' + assert latex(M, mat_str='array') == \ + r'\left[\begin{array}{cc}x + 1 & y\\y & x - 1\end{array}\right]' + assert latex(M, mat_str='bmatrix') == \ + r'\left[\begin{bmatrix}x + 1 & y\\y & x - 1\end{bmatrix}\right]' + assert latex(M, mat_delim=None, mat_str='bmatrix') == \ + r'\begin{bmatrix}x + 1 & y\\y & x - 1\end{bmatrix}' + + M2 = Matrix(1, 11, range(11)) + assert latex(M2) == \ + r'\left[\begin{array}{ccccccccccc}' \ + r'0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\end{array}\right]' + + +def test_latex_matrix_with_functions(): + t = symbols('t') + theta1 = symbols('theta1', cls=Function) + + M = Matrix([[sin(theta1(t)), cos(theta1(t))], + [cos(theta1(t).diff(t)), sin(theta1(t).diff(t))]]) + + expected = (r'\left[\begin{matrix}\sin{\left(' + r'\theta_{1}{\left(t \right)} \right)} & ' + r'\cos{\left(\theta_{1}{\left(t \right)} \right)' + r'}\\\cos{\left(\frac{d}{d t} \theta_{1}{\left(t ' + r'\right)} \right)} & \sin{\left(\frac{d}{d t} ' + r'\theta_{1}{\left(t \right)} \right' + r')}\end{matrix}\right]') + + assert latex(M) == expected + + +def test_latex_NDimArray(): + x, y, z, w = symbols("x y z w") + + for ArrayType in (ImmutableDenseNDimArray, ImmutableSparseNDimArray, + MutableDenseNDimArray, MutableSparseNDimArray): + # Basic: scalar array + M = ArrayType(x) + + assert latex(M) == r"x" + + M = ArrayType([[1 / x, y], [z, w]]) + M1 = ArrayType([1 / x, y, z]) + + M2 = tensorproduct(M1, M) + M3 = tensorproduct(M, M) + + assert latex(M) == \ + r'\left[\begin{matrix}\frac{1}{x} & y\\z & w\end{matrix}\right]' + assert latex(M1) == \ + r"\left[\begin{matrix}\frac{1}{x} & y & z\end{matrix}\right]" + assert latex(M2) == \ + r"\left[\begin{matrix}" \ + r"\left[\begin{matrix}\frac{1}{x^{2}} & \frac{y}{x}\\\frac{z}{x} & \frac{w}{x}\end{matrix}\right] & " \ + r"\left[\begin{matrix}\frac{y}{x} & y^{2}\\y z & w y\end{matrix}\right] & " \ + r"\left[\begin{matrix}\frac{z}{x} & y z\\z^{2} & w z\end{matrix}\right]" \ + r"\end{matrix}\right]" + assert latex(M3) == \ + r"""\left[\begin{matrix}"""\ + r"""\left[\begin{matrix}\frac{1}{x^{2}} & \frac{y}{x}\\\frac{z}{x} & \frac{w}{x}\end{matrix}\right] & """\ + r"""\left[\begin{matrix}\frac{y}{x} & y^{2}\\y z & w y\end{matrix}\right]\\"""\ + r"""\left[\begin{matrix}\frac{z}{x} & y z\\z^{2} & w z\end{matrix}\right] & """\ + r"""\left[\begin{matrix}\frac{w}{x} & w y\\w z & w^{2}\end{matrix}\right]"""\ + r"""\end{matrix}\right]""" + + Mrow = ArrayType([[x, y, 1/z]]) + Mcolumn = ArrayType([[x], [y], [1/z]]) + Mcol2 = ArrayType([Mcolumn.tolist()]) + + assert latex(Mrow) == \ + r"\left[\left[\begin{matrix}x & y & \frac{1}{z}\end{matrix}\right]\right]" + assert latex(Mcolumn) == \ + r"\left[\begin{matrix}x\\y\\\frac{1}{z}\end{matrix}\right]" + assert latex(Mcol2) == \ + r'\left[\begin{matrix}\left[\begin{matrix}x\\y\\\frac{1}{z}\end{matrix}\right]\end{matrix}\right]' + + +def test_latex_mul_symbol(): + assert latex(4*4**x, mul_symbol='times') == r"4 \times 4^{x}" + assert latex(4*4**x, mul_symbol='dot') == r"4 \cdot 4^{x}" + assert latex(4*4**x, mul_symbol='ldot') == r"4 \,.\, 4^{x}" + + assert latex(4*x, mul_symbol='times') == r"4 \times x" + assert latex(4*x, mul_symbol='dot') == r"4 \cdot x" + assert latex(4*x, mul_symbol='ldot') == r"4 \,.\, x" + + +def test_latex_issue_4381(): + y = 4*4**log(2) + assert latex(y) == r'4 \cdot 4^{\log{\left(2 \right)}}' + assert latex(1/y) == r'\frac{1}{4 \cdot 4^{\log{\left(2 \right)}}}' + + +def test_latex_issue_4576(): + assert latex(Symbol("beta_13_2")) == r"\beta_{13 2}" + assert latex(Symbol("beta_132_20")) == r"\beta_{132 20}" + assert latex(Symbol("beta_13")) == r"\beta_{13}" + assert latex(Symbol("x_a_b")) == r"x_{a b}" + assert latex(Symbol("x_1_2_3")) == r"x_{1 2 3}" + assert latex(Symbol("x_a_b1")) == r"x_{a b1}" + assert latex(Symbol("x_a_1")) == r"x_{a 1}" + assert latex(Symbol("x_1_a")) == r"x_{1 a}" + assert latex(Symbol("x_1^aa")) == r"x^{aa}_{1}" + assert latex(Symbol("x_1__aa")) == r"x^{aa}_{1}" + assert latex(Symbol("x_11^a")) == r"x^{a}_{11}" + assert latex(Symbol("x_11__a")) == r"x^{a}_{11}" + assert latex(Symbol("x_a_a_a_a")) == r"x_{a a a a}" + assert latex(Symbol("x_a_a^a^a")) == r"x^{a a}_{a a}" + assert latex(Symbol("x_a_a__a__a")) == r"x^{a a}_{a a}" + assert latex(Symbol("alpha_11")) == r"\alpha_{11}" + assert latex(Symbol("alpha_11_11")) == r"\alpha_{11 11}" + assert latex(Symbol("alpha_alpha")) == r"\alpha_{\alpha}" + assert latex(Symbol("alpha^aleph")) == r"\alpha^{\aleph}" + assert latex(Symbol("alpha__aleph")) == r"\alpha^{\aleph}" + + +def test_latex_pow_fraction(): + x = Symbol('x') + # Testing exp + assert r'e^{-x}' in latex(exp(-x)/2).replace(' ', '') # Remove Whitespace + + # Testing e^{-x} in case future changes alter behavior of muls or fracs + # In particular current output is \frac{1}{2}e^{- x} but perhaps this will + # change to \frac{e^{-x}}{2} + + # Testing general, non-exp, power + assert r'3^{-x}' in latex(3**-x/2).replace(' ', '') + + +def test_noncommutative(): + A, B, C = symbols('A,B,C', commutative=False) + + assert latex(A*B*C**-1) == r"A B C^{-1}" + assert latex(C**-1*A*B) == r"C^{-1} A B" + assert latex(A*C**-1*B) == r"A C^{-1} B" + + +def test_latex_order(): + expr = x**3 + x**2*y + y**4 + 3*x*y**3 + + assert latex(expr, order='lex') == r"x^{3} + x^{2} y + 3 x y^{3} + y^{4}" + assert latex( + expr, order='rev-lex') == r"y^{4} + 3 x y^{3} + x^{2} y + x^{3}" + assert latex(expr, order='none') == r"x^{3} + y^{4} + y x^{2} + 3 x y^{3}" + + +def test_latex_Lambda(): + assert latex(Lambda(x, x + 1)) == r"\left( x \mapsto x + 1 \right)" + assert latex(Lambda((x, y), x + 1)) == r"\left( \left( x, \ y\right) \mapsto x + 1 \right)" + assert latex(Lambda(x, x)) == r"\left( x \mapsto x \right)" + +def test_latex_PolyElement(): + Ruv, u, v = ring("u,v", ZZ) + Rxyz, x, y, z = ring("x,y,z", Ruv) + + assert latex(x - x) == r"0" + assert latex(x - 1) == r"x - 1" + assert latex(x + 1) == r"x + 1" + + assert latex((u**2 + 3*u*v + 1)*x**2*y + u + 1) == \ + r"\left({u}^{2} + 3 u v + 1\right) {x}^{2} y + u + 1" + assert latex((u**2 + 3*u*v + 1)*x**2*y + (u + 1)*x) == \ + r"\left({u}^{2} + 3 u v + 1\right) {x}^{2} y + \left(u + 1\right) x" + assert latex((u**2 + 3*u*v + 1)*x**2*y + (u + 1)*x + 1) == \ + r"\left({u}^{2} + 3 u v + 1\right) {x}^{2} y + \left(u + 1\right) x + 1" + assert latex((-u**2 + 3*u*v - 1)*x**2*y - (u + 1)*x - 1) == \ + r"-\left({u}^{2} - 3 u v + 1\right) {x}^{2} y - \left(u + 1\right) x - 1" + + assert latex(-(v**2 + v + 1)*x + 3*u*v + 1) == \ + r"-\left({v}^{2} + v + 1\right) x + 3 u v + 1" + assert latex(-(v**2 + v + 1)*x - 3*u*v + 1) == \ + r"-\left({v}^{2} + v + 1\right) x - 3 u v + 1" + + +def test_latex_FracElement(): + Fuv, u, v = field("u,v", ZZ) + Fxyzt, x, y, z, t = field("x,y,z,t", Fuv) + + assert latex(x - x) == r"0" + assert latex(x - 1) == r"x - 1" + assert latex(x + 1) == r"x + 1" + + assert latex(x/3) == r"\frac{x}{3}" + assert latex(x/z) == r"\frac{x}{z}" + assert latex(x*y/z) == r"\frac{x y}{z}" + assert latex(x/(z*t)) == r"\frac{x}{z t}" + assert latex(x*y/(z*t)) == r"\frac{x y}{z t}" + + assert latex((x - 1)/y) == r"\frac{x - 1}{y}" + assert latex((x + 1)/y) == r"\frac{x + 1}{y}" + assert latex((-x - 1)/y) == r"\frac{-x - 1}{y}" + assert latex((x + 1)/(y*z)) == r"\frac{x + 1}{y z}" + assert latex(-y/(x + 1)) == r"\frac{-y}{x + 1}" + assert latex(y*z/(x + 1)) == r"\frac{y z}{x + 1}" + + assert latex(((u + 1)*x*y + 1)/((v - 1)*z - 1)) == \ + r"\frac{\left(u + 1\right) x y + 1}{\left(v - 1\right) z - 1}" + assert latex(((u + 1)*x*y + 1)/((v - 1)*z - t*u*v - 1)) == \ + r"\frac{\left(u + 1\right) x y + 1}{\left(v - 1\right) z - u v t - 1}" + + +def test_latex_Poly(): + assert latex(Poly(x**2 + 2 * x, x)) == \ + r"\operatorname{Poly}{\left( x^{2} + 2 x, x, domain=\mathbb{Z} \right)}" + assert latex(Poly(x/y, x)) == \ + r"\operatorname{Poly}{\left( \frac{1}{y} x, x, domain=\mathbb{Z}\left(y\right) \right)}" + assert latex(Poly(2.0*x + y)) == \ + r"\operatorname{Poly}{\left( 2.0 x + 1.0 y, x, y, domain=\mathbb{R} \right)}" + + +def test_latex_Poly_order(): + assert latex(Poly([a, 1, b, 2, c, 3], x)) == \ + r'\operatorname{Poly}{\left( a x^{5} + x^{4} + b x^{3} + 2 x^{2} + c'\ + r' x + 3, x, domain=\mathbb{Z}\left[a, b, c\right] \right)}' + assert latex(Poly([a, 1, b+c, 2, 3], x)) == \ + r'\operatorname{Poly}{\left( a x^{4} + x^{3} + \left(b + c\right) '\ + r'x^{2} + 2 x + 3, x, domain=\mathbb{Z}\left[a, b, c\right] \right)}' + assert latex(Poly(a*x**3 + x**2*y - x*y - c*y**3 - b*x*y**2 + y - a*x + b, + (x, y))) == \ + r'\operatorname{Poly}{\left( a x^{3} + x^{2}y - b xy^{2} - xy - '\ + r'a x - c y^{3} + y + b, x, y, domain=\mathbb{Z}\left[a, b, c\right] \right)}' + + +def test_latex_ComplexRootOf(): + assert latex(rootof(x**5 + x + 3, 0)) == \ + r"\operatorname{CRootOf} {\left(x^{5} + x + 3, 0\right)}" + + +def test_latex_RootSum(): + assert latex(RootSum(x**5 + x + 3, sin)) == \ + r"\operatorname{RootSum} {\left(x^{5} + x + 3, \left( x \mapsto \sin{\left(x \right)} \right)\right)}" + + +def test_settings(): + raises(TypeError, lambda: latex(x*y, method="garbage")) + + +def test_latex_numbers(): + assert latex(catalan(n)) == r"C_{n}" + assert latex(catalan(n)**2) == r"C_{n}^{2}" + assert latex(bernoulli(n)) == r"B_{n}" + assert latex(bernoulli(n, x)) == r"B_{n}\left(x\right)" + assert latex(bernoulli(n)**2) == r"B_{n}^{2}" + assert latex(bernoulli(n, x)**2) == r"B_{n}^{2}\left(x\right)" + assert latex(genocchi(n)) == r"G_{n}" + assert latex(genocchi(n, x)) == r"G_{n}\left(x\right)" + assert latex(genocchi(n)**2) == r"G_{n}^{2}" + assert latex(genocchi(n, x)**2) == r"G_{n}^{2}\left(x\right)" + assert latex(bell(n)) == r"B_{n}" + assert latex(bell(n, x)) == r"B_{n}\left(x\right)" + assert latex(bell(n, m, (x, y))) == r"B_{n, m}\left(x, y\right)" + assert latex(bell(n)**2) == r"B_{n}^{2}" + assert latex(bell(n, x)**2) == r"B_{n}^{2}\left(x\right)" + assert latex(bell(n, m, (x, y))**2) == r"B_{n, m}^{2}\left(x, y\right)" + assert latex(fibonacci(n)) == r"F_{n}" + assert latex(fibonacci(n, x)) == r"F_{n}\left(x\right)" + assert latex(fibonacci(n)**2) == r"F_{n}^{2}" + assert latex(fibonacci(n, x)**2) == r"F_{n}^{2}\left(x\right)" + assert latex(lucas(n)) == r"L_{n}" + assert latex(lucas(n)**2) == r"L_{n}^{2}" + assert latex(tribonacci(n)) == r"T_{n}" + assert latex(tribonacci(n, x)) == r"T_{n}\left(x\right)" + assert latex(tribonacci(n)**2) == r"T_{n}^{2}" + assert latex(tribonacci(n, x)**2) == r"T_{n}^{2}\left(x\right)" + + +def test_latex_euler(): + assert latex(euler(n)) == r"E_{n}" + assert latex(euler(n, x)) == r"E_{n}\left(x\right)" + assert latex(euler(n, x)**2) == r"E_{n}^{2}\left(x\right)" + + +def test_lamda(): + assert latex(Symbol('lamda')) == r"\lambda" + assert latex(Symbol('Lamda')) == r"\Lambda" + + +def test_custom_symbol_names(): + x = Symbol('x') + y = Symbol('y') + assert latex(x) == r"x" + assert latex(x, symbol_names={x: "x_i"}) == r"x_i" + assert latex(x + y, symbol_names={x: "x_i"}) == r"x_i + y" + assert latex(x**2, symbol_names={x: "x_i"}) == r"x_i^{2}" + assert latex(x + y, symbol_names={x: "x_i", y: "y_j"}) == r"x_i + y_j" + + +def test_matAdd(): + C = MatrixSymbol('C', 5, 5) + B = MatrixSymbol('B', 5, 5) + + n = symbols("n") + h = MatrixSymbol("h", 1, 1) + + assert latex(C - 2*B) in [r'- 2 B + C', r'C -2 B'] + assert latex(C + 2*B) in [r'2 B + C', r'C + 2 B'] + assert latex(B - 2*C) in [r'B - 2 C', r'- 2 C + B'] + assert latex(B + 2*C) in [r'B + 2 C', r'2 C + B'] + + assert latex(n * h - (-h + h.T) * (h + h.T)) == 'n h - \\left(- h + h^{T}\\right) \\left(h + h^{T}\\right)' + assert latex(MatAdd(MatAdd(h, h), MatAdd(h, h))) == '\\left(h + h\\right) + \\left(h + h\\right)' + assert latex(MatMul(MatMul(h, h), MatMul(h, h))) == '\\left(h h\\right) \\left(h h\\right)' + + +def test_matMul(): + A = MatrixSymbol('A', 5, 5) + B = MatrixSymbol('B', 5, 5) + x = Symbol('x') + assert latex(2*A) == r'2 A' + assert latex(2*x*A) == r'2 x A' + assert latex(-2*A) == r'- 2 A' + assert latex(1.5*A) == r'1.5 A' + assert latex(sqrt(2)*A) == r'\sqrt{2} A' + assert latex(-sqrt(2)*A) == r'- \sqrt{2} A' + assert latex(2*sqrt(2)*x*A) == r'2 \sqrt{2} x A' + assert latex(-2*A*(A + 2*B)) in [r'- 2 A \left(A + 2 B\right)', + r'- 2 A \left(2 B + A\right)'] + + +def test_latex_MatrixSlice(): + n = Symbol('n', integer=True) + x, y, z, w, t, = symbols('x y z w t') + X = MatrixSymbol('X', n, n) + Y = MatrixSymbol('Y', 10, 10) + Z = MatrixSymbol('Z', 10, 10) + + assert latex(MatrixSlice(X, (None, None, None), (None, None, None))) == r'X\left[:, :\right]' + assert latex(X[x:x + 1, y:y + 1]) == r'X\left[x:x + 1, y:y + 1\right]' + assert latex(X[x:x + 1:2, y:y + 1:2]) == r'X\left[x:x + 1:2, y:y + 1:2\right]' + assert latex(X[:x, y:]) == r'X\left[:x, y:\right]' + assert latex(X[:x, y:]) == r'X\left[:x, y:\right]' + assert latex(X[x:, :y]) == r'X\left[x:, :y\right]' + assert latex(X[x:y, z:w]) == r'X\left[x:y, z:w\right]' + assert latex(X[x:y:t, w:t:x]) == r'X\left[x:y:t, w:t:x\right]' + assert latex(X[x::y, t::w]) == r'X\left[x::y, t::w\right]' + assert latex(X[:x:y, :t:w]) == r'X\left[:x:y, :t:w\right]' + assert latex(X[::x, ::y]) == r'X\left[::x, ::y\right]' + assert latex(MatrixSlice(X, (0, None, None), (0, None, None))) == r'X\left[:, :\right]' + assert latex(MatrixSlice(X, (None, n, None), (None, n, None))) == r'X\left[:, :\right]' + assert latex(MatrixSlice(X, (0, n, None), (0, n, None))) == r'X\left[:, :\right]' + assert latex(MatrixSlice(X, (0, n, 2), (0, n, 2))) == r'X\left[::2, ::2\right]' + assert latex(X[1:2:3, 4:5:6]) == r'X\left[1:2:3, 4:5:6\right]' + assert latex(X[1:3:5, 4:6:8]) == r'X\left[1:3:5, 4:6:8\right]' + assert latex(X[1:10:2]) == r'X\left[1:10:2, :\right]' + assert latex(Y[:5, 1:9:2]) == r'Y\left[:5, 1:9:2\right]' + assert latex(Y[:5, 1:10:2]) == r'Y\left[:5, 1::2\right]' + assert latex(Y[5, :5:2]) == r'Y\left[5:6, :5:2\right]' + assert latex(X[0:1, 0:1]) == r'X\left[:1, :1\right]' + assert latex(X[0:1:2, 0:1:2]) == r'X\left[:1:2, :1:2\right]' + assert latex((Y + Z)[2:, 2:]) == r'\left(Y + Z\right)\left[2:, 2:\right]' + + +def test_latex_RandomDomain(): + from sympy.stats import Normal, Die, Exponential, pspace, where + from sympy.stats.rv import RandomDomain + + X = Normal('x1', 0, 1) + assert latex(where(X > 0)) == r"\text{Domain: }0 < x_{1} \wedge x_{1} < \infty" + + D = Die('d1', 6) + assert latex(where(D > 4)) == r"\text{Domain: }d_{1} = 5 \vee d_{1} = 6" + + A = Exponential('a', 1) + B = Exponential('b', 1) + assert latex( + pspace(Tuple(A, B)).domain) == \ + r"\text{Domain: }0 \leq a \wedge 0 \leq b \wedge a < \infty \wedge b < \infty" + + assert latex(RandomDomain(FiniteSet(x), FiniteSet(1, 2))) == \ + r'\text{Domain: }\left\{x\right\} \in \left\{1, 2\right\}' + +def test_PrettyPoly(): + from sympy.polys.domains import QQ + F = QQ.frac_field(x, y) + R = QQ[x, y] + + assert latex(F.convert(x/(x + y))) == latex(x/(x + y)) + assert latex(R.convert(x + y)) == latex(x + y) + + +def test_integral_transforms(): + x = Symbol("x") + k = Symbol("k") + f = Function("f") + a = Symbol("a") + b = Symbol("b") + + assert latex(MellinTransform(f(x), x, k)) == \ + r"\mathcal{M}_{x}\left[f{\left(x \right)}\right]\left(k\right)" + assert latex(InverseMellinTransform(f(k), k, x, a, b)) == \ + r"\mathcal{M}^{-1}_{k}\left[f{\left(k \right)}\right]\left(x\right)" + + assert latex(LaplaceTransform(f(x), x, k)) == \ + r"\mathcal{L}_{x}\left[f{\left(x \right)}\right]\left(k\right)" + assert latex(InverseLaplaceTransform(f(k), k, x, (a, b))) == \ + r"\mathcal{L}^{-1}_{k}\left[f{\left(k \right)}\right]\left(x\right)" + + assert latex(FourierTransform(f(x), x, k)) == \ + r"\mathcal{F}_{x}\left[f{\left(x \right)}\right]\left(k\right)" + assert latex(InverseFourierTransform(f(k), k, x)) == \ + r"\mathcal{F}^{-1}_{k}\left[f{\left(k \right)}\right]\left(x\right)" + + assert latex(CosineTransform(f(x), x, k)) == \ + r"\mathcal{COS}_{x}\left[f{\left(x \right)}\right]\left(k\right)" + assert latex(InverseCosineTransform(f(k), k, x)) == \ + r"\mathcal{COS}^{-1}_{k}\left[f{\left(k \right)}\right]\left(x\right)" + + assert latex(SineTransform(f(x), x, k)) == \ + r"\mathcal{SIN}_{x}\left[f{\left(x \right)}\right]\left(k\right)" + assert latex(InverseSineTransform(f(k), k, x)) == \ + r"\mathcal{SIN}^{-1}_{k}\left[f{\left(k \right)}\right]\left(x\right)" + + +def test_PolynomialRingBase(): + from sympy.polys.domains import QQ + assert latex(QQ.old_poly_ring(x, y)) == r"\mathbb{Q}\left[x, y\right]" + assert latex(QQ.old_poly_ring(x, y, order="ilex")) == \ + r"S_<^{-1}\mathbb{Q}\left[x, y\right]" + + +def test_categories(): + from sympy.categories import (Object, IdentityMorphism, + NamedMorphism, Category, Diagram, + DiagramGrid) + + A1 = Object("A1") + A2 = Object("A2") + A3 = Object("A3") + + f1 = NamedMorphism(A1, A2, "f1") + f2 = NamedMorphism(A2, A3, "f2") + id_A1 = IdentityMorphism(A1) + + K1 = Category("K1") + + assert latex(A1) == r"A_{1}" + assert latex(f1) == r"f_{1}:A_{1}\rightarrow A_{2}" + assert latex(id_A1) == r"id:A_{1}\rightarrow A_{1}" + assert latex(f2*f1) == r"f_{2}\circ f_{1}:A_{1}\rightarrow A_{3}" + + assert latex(K1) == r"\mathbf{K_{1}}" + + d = Diagram() + assert latex(d) == r"\emptyset" + + d = Diagram({f1: "unique", f2: S.EmptySet}) + assert latex(d) == r"\left\{ f_{2}\circ f_{1}:A_{1}" \ + r"\rightarrow A_{3} : \emptyset, \ id:A_{1}\rightarrow " \ + r"A_{1} : \emptyset, \ id:A_{2}\rightarrow A_{2} : " \ + r"\emptyset, \ id:A_{3}\rightarrow A_{3} : \emptyset, " \ + r"\ f_{1}:A_{1}\rightarrow A_{2} : \left\{unique\right\}, " \ + r"\ f_{2}:A_{2}\rightarrow A_{3} : \emptyset\right\}" + + d = Diagram({f1: "unique", f2: S.EmptySet}, {f2 * f1: "unique"}) + assert latex(d) == r"\left\{ f_{2}\circ f_{1}:A_{1}" \ + r"\rightarrow A_{3} : \emptyset, \ id:A_{1}\rightarrow " \ + r"A_{1} : \emptyset, \ id:A_{2}\rightarrow A_{2} : " \ + r"\emptyset, \ id:A_{3}\rightarrow A_{3} : \emptyset, " \ + r"\ f_{1}:A_{1}\rightarrow A_{2} : \left\{unique\right\}," \ + r" \ f_{2}:A_{2}\rightarrow A_{3} : \emptyset\right\}" \ + r"\Longrightarrow \left\{ f_{2}\circ f_{1}:A_{1}" \ + r"\rightarrow A_{3} : \left\{unique\right\}\right\}" + + # A linear diagram. + A = Object("A") + B = Object("B") + C = Object("C") + f = NamedMorphism(A, B, "f") + g = NamedMorphism(B, C, "g") + d = Diagram([f, g]) + grid = DiagramGrid(d) + + assert latex(grid) == r"\begin{array}{cc}" + "\n" \ + r"A & B \\" + "\n" \ + r" & C " + "\n" \ + r"\end{array}" + "\n" + + +def test_Modules(): + from sympy.polys.domains import QQ + from sympy.polys.agca import homomorphism + + R = QQ.old_poly_ring(x, y) + F = R.free_module(2) + M = F.submodule([x, y], [1, x**2]) + + assert latex(F) == r"{\mathbb{Q}\left[x, y\right]}^{2}" + assert latex(M) == \ + r"\left\langle {\left[ {x},{y} \right]},{\left[ {1},{x^{2}} \right]} \right\rangle" + + I = R.ideal(x**2, y) + assert latex(I) == r"\left\langle {x^{2}},{y} \right\rangle" + + Q = F / M + assert latex(Q) == \ + r"\frac{{\mathbb{Q}\left[x, y\right]}^{2}}{\left\langle {\left[ {x},"\ + r"{y} \right]},{\left[ {1},{x^{2}} \right]} \right\rangle}" + assert latex(Q.submodule([1, x**3/2], [2, y])) == \ + r"\left\langle {{\left[ {1},{\frac{x^{3}}{2}} \right]} + {\left"\ + r"\langle {\left[ {x},{y} \right]},{\left[ {1},{x^{2}} \right]} "\ + r"\right\rangle}},{{\left[ {2},{y} \right]} + {\left\langle {\left[ "\ + r"{x},{y} \right]},{\left[ {1},{x^{2}} \right]} \right\rangle}} \right\rangle" + + h = homomorphism(QQ.old_poly_ring(x).free_module(2), + QQ.old_poly_ring(x).free_module(2), [0, 0]) + + assert latex(h) == \ + r"{\left[\begin{matrix}0 & 0\\0 & 0\end{matrix}\right]} : "\ + r"{{\mathbb{Q}\left[x\right]}^{2}} \to {{\mathbb{Q}\left[x\right]}^{2}}" + + +def test_QuotientRing(): + from sympy.polys.domains import QQ + R = QQ.old_poly_ring(x)/[x**2 + 1] + + assert latex(R) == \ + r"\frac{\mathbb{Q}\left[x\right]}{\left\langle {x^{2} + 1} \right\rangle}" + assert latex(R.one) == r"{1} + {\left\langle {x^{2} + 1} \right\rangle}" + + +def test_Tr(): + #TODO: Handle indices + A, B = symbols('A B', commutative=False) + t = Tr(A*B) + assert latex(t) == r'\operatorname{tr}\left(A B\right)' + + +def test_Determinant(): + from sympy.matrices import Determinant, Inverse, BlockMatrix, OneMatrix, ZeroMatrix + m = Matrix(((1, 2), (3, 4))) + assert latex(Determinant(m)) == '\\left|{\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}}\\right|' + assert latex(Determinant(Inverse(m))) == \ + '\\left|{\\left[\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}\\right]^{-1}}\\right|' + X = MatrixSymbol('X', 2, 2) + assert latex(Determinant(X)) == '\\left|{X}\\right|' + assert latex(Determinant(X + m)) == \ + '\\left|{\\left[\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}\\right] + X}\\right|' + assert latex(Determinant(BlockMatrix(((OneMatrix(2, 2), X), + (m, ZeroMatrix(2, 2)))))) == \ + '\\left|{\\begin{matrix}1 & X\\\\\\left[\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}\\right] & 0\\end{matrix}}\\right|' + + +def test_Adjoint(): + from sympy.matrices import Adjoint, Inverse, Transpose + X = MatrixSymbol('X', 2, 2) + Y = MatrixSymbol('Y', 2, 2) + assert latex(Adjoint(X)) == r'X^{\dagger}' + assert latex(Adjoint(X + Y)) == r'\left(X + Y\right)^{\dagger}' + assert latex(Adjoint(X) + Adjoint(Y)) == r'X^{\dagger} + Y^{\dagger}' + assert latex(Adjoint(X*Y)) == r'\left(X Y\right)^{\dagger}' + assert latex(Adjoint(Y)*Adjoint(X)) == r'Y^{\dagger} X^{\dagger}' + assert latex(Adjoint(X**2)) == r'\left(X^{2}\right)^{\dagger}' + assert latex(Adjoint(X)**2) == r'\left(X^{\dagger}\right)^{2}' + assert latex(Adjoint(Inverse(X))) == r'\left(X^{-1}\right)^{\dagger}' + assert latex(Inverse(Adjoint(X))) == r'\left(X^{\dagger}\right)^{-1}' + assert latex(Adjoint(Transpose(X))) == r'\left(X^{T}\right)^{\dagger}' + assert latex(Transpose(Adjoint(X))) == r'\left(X^{\dagger}\right)^{T}' + assert latex(Transpose(Adjoint(X) + Y)) == r'\left(X^{\dagger} + Y\right)^{T}' + m = Matrix(((1, 2), (3, 4))) + assert latex(Adjoint(m)) == '\\left[\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}\\right]^{\\dagger}' + assert latex(Adjoint(m+X)) == \ + '\\left(\\left[\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}\\right] + X\\right)^{\\dagger}' + from sympy.matrices import BlockMatrix, OneMatrix, ZeroMatrix + assert latex(Adjoint(BlockMatrix(((OneMatrix(2, 2), X), + (m, ZeroMatrix(2, 2)))))) == \ + '\\left[\\begin{matrix}1 & X\\\\\\left[\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}\\right] & 0\\end{matrix}\\right]^{\\dagger}' + # Issue 20959 + Mx = MatrixSymbol('M^x', 2, 2) + assert latex(Adjoint(Mx)) == r'\left(M^{x}\right)^{\dagger}' + + +def test_Transpose(): + from sympy.matrices import Transpose, MatPow, HadamardPower + X = MatrixSymbol('X', 2, 2) + Y = MatrixSymbol('Y', 2, 2) + assert latex(Transpose(X)) == r'X^{T}' + assert latex(Transpose(X + Y)) == r'\left(X + Y\right)^{T}' + + assert latex(Transpose(HadamardPower(X, 2))) == r'\left(X^{\circ {2}}\right)^{T}' + assert latex(HadamardPower(Transpose(X), 2)) == r'\left(X^{T}\right)^{\circ {2}}' + assert latex(Transpose(MatPow(X, 2))) == r'\left(X^{2}\right)^{T}' + assert latex(MatPow(Transpose(X), 2)) == r'\left(X^{T}\right)^{2}' + m = Matrix(((1, 2), (3, 4))) + assert latex(Transpose(m)) == '\\left[\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}\\right]^{T}' + assert latex(Transpose(m+X)) == \ + '\\left(\\left[\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}\\right] + X\\right)^{T}' + from sympy.matrices import BlockMatrix, OneMatrix, ZeroMatrix + assert latex(Transpose(BlockMatrix(((OneMatrix(2, 2), X), + (m, ZeroMatrix(2, 2)))))) == \ + '\\left[\\begin{matrix}1 & X\\\\\\left[\\begin{matrix}1 & 2\\\\3 & 4\\end{matrix}\\right] & 0\\end{matrix}\\right]^{T}' + # Issue 20959 + Mx = MatrixSymbol('M^x', 2, 2) + assert latex(Transpose(Mx)) == r'\left(M^{x}\right)^{T}' + + +def test_Hadamard(): + from sympy.matrices import HadamardProduct, HadamardPower + from sympy.matrices.expressions import MatAdd, MatMul, MatPow + X = MatrixSymbol('X', 2, 2) + Y = MatrixSymbol('Y', 2, 2) + assert latex(HadamardProduct(X, Y*Y)) == r'X \circ Y^{2}' + assert latex(HadamardProduct(X, Y)*Y) == r'\left(X \circ Y\right) Y' + + assert latex(HadamardPower(X, 2)) == r'X^{\circ {2}}' + assert latex(HadamardPower(X, -1)) == r'X^{\circ \left({-1}\right)}' + assert latex(HadamardPower(MatAdd(X, Y), 2)) == \ + r'\left(X + Y\right)^{\circ {2}}' + assert latex(HadamardPower(MatMul(X, Y), 2)) == \ + r'\left(X Y\right)^{\circ {2}}' + + assert latex(HadamardPower(MatPow(X, -1), -1)) == \ + r'\left(X^{-1}\right)^{\circ \left({-1}\right)}' + assert latex(MatPow(HadamardPower(X, -1), -1)) == \ + r'\left(X^{\circ \left({-1}\right)}\right)^{-1}' + + assert latex(HadamardPower(X, n+1)) == \ + r'X^{\circ \left({n + 1}\right)}' + + +def test_MatPow(): + from sympy.matrices.expressions import MatPow + X = MatrixSymbol('X', 2, 2) + Y = MatrixSymbol('Y', 2, 2) + assert latex(MatPow(X, 2)) == 'X^{2}' + assert latex(MatPow(X*X, 2)) == '\\left(X^{2}\\right)^{2}' + assert latex(MatPow(X*Y, 2)) == '\\left(X Y\\right)^{2}' + assert latex(MatPow(X + Y, 2)) == '\\left(X + Y\\right)^{2}' + assert latex(MatPow(X + X, 2)) == '\\left(2 X\\right)^{2}' + # Issue 20959 + Mx = MatrixSymbol('M^x', 2, 2) + assert latex(MatPow(Mx, 2)) == r'\left(M^{x}\right)^{2}' + + +def test_ElementwiseApplyFunction(): + X = MatrixSymbol('X', 2, 2) + expr = (X.T*X).applyfunc(sin) + assert latex(expr) == r"{\left( d \mapsto \sin{\left(d \right)} \right)}_{\circ}\left({X^{T} X}\right)" + expr = X.applyfunc(Lambda(x, 1/x)) + assert latex(expr) == r'{\left( x \mapsto \frac{1}{x} \right)}_{\circ}\left({X}\right)' + + +def test_ZeroMatrix(): + from sympy.matrices.expressions.special import ZeroMatrix + assert latex(ZeroMatrix(1, 1), mat_symbol_style='plain') == r"0" + assert latex(ZeroMatrix(1, 1), mat_symbol_style='bold') == r"\mathbf{0}" + + +def test_OneMatrix(): + from sympy.matrices.expressions.special import OneMatrix + assert latex(OneMatrix(3, 4), mat_symbol_style='plain') == r"1" + assert latex(OneMatrix(3, 4), mat_symbol_style='bold') == r"\mathbf{1}" + + +def test_Identity(): + from sympy.matrices.expressions.special import Identity + assert latex(Identity(1), mat_symbol_style='plain') == r"\mathbb{I}" + assert latex(Identity(1), mat_symbol_style='bold') == r"\mathbf{I}" + + +def test_latex_DFT_IDFT(): + from sympy.matrices.expressions.fourier import DFT, IDFT + assert latex(DFT(13)) == r"\text{DFT}_{13}" + assert latex(IDFT(x)) == r"\text{IDFT}_{x}" + + +def test_boolean_args_order(): + syms = symbols('a:f') + + expr = And(*syms) + assert latex(expr) == r'a \wedge b \wedge c \wedge d \wedge e \wedge f' + + expr = Or(*syms) + assert latex(expr) == r'a \vee b \vee c \vee d \vee e \vee f' + + expr = Equivalent(*syms) + assert latex(expr) == \ + r'a \Leftrightarrow b \Leftrightarrow c \Leftrightarrow d \Leftrightarrow e \Leftrightarrow f' + + expr = Xor(*syms) + assert latex(expr) == \ + r'a \veebar b \veebar c \veebar d \veebar e \veebar f' + + +def test_imaginary(): + i = sqrt(-1) + assert latex(i) == r'i' + + +def test_builtins_without_args(): + assert latex(sin) == r'\sin' + assert latex(cos) == r'\cos' + assert latex(tan) == r'\tan' + assert latex(log) == r'\log' + assert latex(Ei) == r'\operatorname{Ei}' + assert latex(zeta) == r'\zeta' + + +def test_latex_greek_functions(): + # bug because capital greeks that have roman equivalents should not use + # \Alpha, \Beta, \Eta, etc. + s = Function('Alpha') + assert latex(s) == r'\mathrm{A}' + assert latex(s(x)) == r'\mathrm{A}{\left(x \right)}' + s = Function('Beta') + assert latex(s) == r'\mathrm{B}' + s = Function('Eta') + assert latex(s) == r'\mathrm{H}' + assert latex(s(x)) == r'\mathrm{H}{\left(x \right)}' + + # bug because sympy.core.numbers.Pi is special + p = Function('Pi') + # assert latex(p(x)) == r'\Pi{\left(x \right)}' + assert latex(p) == r'\Pi' + + # bug because not all greeks are included + c = Function('chi') + assert latex(c(x)) == r'\chi{\left(x \right)}' + assert latex(c) == r'\chi' + + +def test_translate(): + s = 'Alpha' + assert translate(s) == r'\mathrm{A}' + s = 'Beta' + assert translate(s) == r'\mathrm{B}' + s = 'Eta' + assert translate(s) == r'\mathrm{H}' + s = 'omicron' + assert translate(s) == r'o' + s = 'Pi' + assert translate(s) == r'\Pi' + s = 'pi' + assert translate(s) == r'\pi' + s = 'LamdaHatDOT' + assert translate(s) == r'\dot{\hat{\Lambda}}' + + +def test_other_symbols(): + from sympy.printing.latex import other_symbols + for s in other_symbols: + assert latex(symbols(s)) == r"" "\\" + s + + +def test_modifiers(): + # Test each modifier individually in the simplest case + # (with funny capitalizations) + assert latex(symbols("xMathring")) == r"\mathring{x}" + assert latex(symbols("xCheck")) == r"\check{x}" + assert latex(symbols("xBreve")) == r"\breve{x}" + assert latex(symbols("xAcute")) == r"\acute{x}" + assert latex(symbols("xGrave")) == r"\grave{x}" + assert latex(symbols("xTilde")) == r"\tilde{x}" + assert latex(symbols("xPrime")) == r"{x}'" + assert latex(symbols("xddDDot")) == r"\ddddot{x}" + assert latex(symbols("xDdDot")) == r"\dddot{x}" + assert latex(symbols("xDDot")) == r"\ddot{x}" + assert latex(symbols("xBold")) == r"\boldsymbol{x}" + assert latex(symbols("xnOrM")) == r"\left\|{x}\right\|" + assert latex(symbols("xAVG")) == r"\left\langle{x}\right\rangle" + assert latex(symbols("xHat")) == r"\hat{x}" + assert latex(symbols("xDot")) == r"\dot{x}" + assert latex(symbols("xBar")) == r"\bar{x}" + assert latex(symbols("xVec")) == r"\vec{x}" + assert latex(symbols("xAbs")) == r"\left|{x}\right|" + assert latex(symbols("xMag")) == r"\left|{x}\right|" + assert latex(symbols("xPrM")) == r"{x}'" + assert latex(symbols("xBM")) == r"\boldsymbol{x}" + # Test strings that are *only* the names of modifiers + assert latex(symbols("Mathring")) == r"Mathring" + assert latex(symbols("Check")) == r"Check" + assert latex(symbols("Breve")) == r"Breve" + assert latex(symbols("Acute")) == r"Acute" + assert latex(symbols("Grave")) == r"Grave" + assert latex(symbols("Tilde")) == r"Tilde" + assert latex(symbols("Prime")) == r"Prime" + assert latex(symbols("DDot")) == r"\dot{D}" + assert latex(symbols("Bold")) == r"Bold" + assert latex(symbols("NORm")) == r"NORm" + assert latex(symbols("AVG")) == r"AVG" + assert latex(symbols("Hat")) == r"Hat" + assert latex(symbols("Dot")) == r"Dot" + assert latex(symbols("Bar")) == r"Bar" + assert latex(symbols("Vec")) == r"Vec" + assert latex(symbols("Abs")) == r"Abs" + assert latex(symbols("Mag")) == r"Mag" + assert latex(symbols("PrM")) == r"PrM" + assert latex(symbols("BM")) == r"BM" + assert latex(symbols("hbar")) == r"\hbar" + # Check a few combinations + assert latex(symbols("xvecdot")) == r"\dot{\vec{x}}" + assert latex(symbols("xDotVec")) == r"\vec{\dot{x}}" + assert latex(symbols("xHATNorm")) == r"\left\|{\hat{x}}\right\|" + # Check a couple big, ugly combinations + assert latex(symbols('xMathringBm_yCheckPRM__zbreveAbs')) == \ + r"\boldsymbol{\mathring{x}}^{\left|{\breve{z}}\right|}_{{\check{y}}'}" + assert latex(symbols('alphadothat_nVECDOT__tTildePrime')) == \ + r"\hat{\dot{\alpha}}^{{\tilde{t}}'}_{\dot{\vec{n}}}" + + +def test_greek_symbols(): + assert latex(Symbol('alpha')) == r'\alpha' + assert latex(Symbol('beta')) == r'\beta' + assert latex(Symbol('gamma')) == r'\gamma' + assert latex(Symbol('delta')) == r'\delta' + assert latex(Symbol('epsilon')) == r'\epsilon' + assert latex(Symbol('zeta')) == r'\zeta' + assert latex(Symbol('eta')) == r'\eta' + assert latex(Symbol('theta')) == r'\theta' + assert latex(Symbol('iota')) == r'\iota' + assert latex(Symbol('kappa')) == r'\kappa' + assert latex(Symbol('lambda')) == r'\lambda' + assert latex(Symbol('mu')) == r'\mu' + assert latex(Symbol('nu')) == r'\nu' + assert latex(Symbol('xi')) == r'\xi' + assert latex(Symbol('omicron')) == r'o' + assert latex(Symbol('pi')) == r'\pi' + assert latex(Symbol('rho')) == r'\rho' + assert latex(Symbol('sigma')) == r'\sigma' + assert latex(Symbol('tau')) == r'\tau' + assert latex(Symbol('upsilon')) == r'\upsilon' + assert latex(Symbol('phi')) == r'\phi' + assert latex(Symbol('chi')) == r'\chi' + assert latex(Symbol('psi')) == r'\psi' + assert latex(Symbol('omega')) == r'\omega' + + assert latex(Symbol('Alpha')) == r'\mathrm{A}' + assert latex(Symbol('Beta')) == r'\mathrm{B}' + assert latex(Symbol('Gamma')) == r'\Gamma' + assert latex(Symbol('Delta')) == r'\Delta' + assert latex(Symbol('Epsilon')) == r'\mathrm{E}' + assert latex(Symbol('Zeta')) == r'\mathrm{Z}' + assert latex(Symbol('Eta')) == r'\mathrm{H}' + assert latex(Symbol('Theta')) == r'\Theta' + assert latex(Symbol('Iota')) == r'\mathrm{I}' + assert latex(Symbol('Kappa')) == r'\mathrm{K}' + assert latex(Symbol('Lambda')) == r'\Lambda' + assert latex(Symbol('Mu')) == r'\mathrm{M}' + assert latex(Symbol('Nu')) == r'\mathrm{N}' + assert latex(Symbol('Xi')) == r'\Xi' + assert latex(Symbol('Omicron')) == r'\mathrm{O}' + assert latex(Symbol('Pi')) == r'\Pi' + assert latex(Symbol('Rho')) == r'\mathrm{P}' + assert latex(Symbol('Sigma')) == r'\Sigma' + assert latex(Symbol('Tau')) == r'\mathrm{T}' + assert latex(Symbol('Upsilon')) == r'\Upsilon' + assert latex(Symbol('Phi')) == r'\Phi' + assert latex(Symbol('Chi')) == r'\mathrm{X}' + assert latex(Symbol('Psi')) == r'\Psi' + assert latex(Symbol('Omega')) == r'\Omega' + + assert latex(Symbol('varepsilon')) == r'\varepsilon' + assert latex(Symbol('varkappa')) == r'\varkappa' + assert latex(Symbol('varphi')) == r'\varphi' + assert latex(Symbol('varpi')) == r'\varpi' + assert latex(Symbol('varrho')) == r'\varrho' + assert latex(Symbol('varsigma')) == r'\varsigma' + assert latex(Symbol('vartheta')) == r'\vartheta' + + +def test_fancyset_symbols(): + assert latex(S.Rationals) == r'\mathbb{Q}' + assert latex(S.Naturals) == r'\mathbb{N}' + assert latex(S.Naturals0) == r'\mathbb{N}_0' + assert latex(S.Integers) == r'\mathbb{Z}' + assert latex(S.Reals) == r'\mathbb{R}' + assert latex(S.Complexes) == r'\mathbb{C}' + + +@XFAIL +def test_builtin_without_args_mismatched_names(): + assert latex(CosineTransform) == r'\mathcal{COS}' + + +def test_builtin_no_args(): + assert latex(Chi) == r'\operatorname{Chi}' + assert latex(beta) == r'\operatorname{B}' + assert latex(gamma) == r'\Gamma' + assert latex(KroneckerDelta) == r'\delta' + assert latex(DiracDelta) == r'\delta' + assert latex(lowergamma) == r'\gamma' + + +def test_issue_6853(): + p = Function('Pi') + assert latex(p(x)) == r"\Pi{\left(x \right)}" + + +def test_Mul(): + e = Mul(-2, x + 1, evaluate=False) + assert latex(e) == r'- 2 \left(x + 1\right)' + e = Mul(2, x + 1, evaluate=False) + assert latex(e) == r'2 \left(x + 1\right)' + e = Mul(S.Half, x + 1, evaluate=False) + assert latex(e) == r'\frac{x + 1}{2}' + e = Mul(y, x + 1, evaluate=False) + assert latex(e) == r'y \left(x + 1\right)' + e = Mul(-y, x + 1, evaluate=False) + assert latex(e) == r'- y \left(x + 1\right)' + e = Mul(-2, x + 1) + assert latex(e) == r'- 2 x - 2' + e = Mul(2, x + 1) + assert latex(e) == r'2 x + 2' + + +def test_Pow(): + e = Pow(2, 2, evaluate=False) + assert latex(e) == r'2^{2}' + assert latex(x**(Rational(-1, 3))) == r'\frac{1}{\sqrt[3]{x}}' + x2 = Symbol(r'x^2') + assert latex(x2**2) == r'\left(x^{2}\right)^{2}' + + +def test_issue_7180(): + assert latex(Equivalent(x, y)) == r"x \Leftrightarrow y" + assert latex(Not(Equivalent(x, y))) == r"x \not\Leftrightarrow y" + + +def test_issue_8409(): + assert latex(S.Half**n) == r"\left(\frac{1}{2}\right)^{n}" + + +def test_issue_8470(): + from sympy.parsing.sympy_parser import parse_expr + e = parse_expr("-B*A", evaluate=False) + assert latex(e) == r"A \left(- B\right)" + + +def test_issue_15439(): + x = MatrixSymbol('x', 2, 2) + y = MatrixSymbol('y', 2, 2) + assert latex((x * y).subs(y, -y)) == r"x \left(- y\right)" + assert latex((x * y).subs(y, -2*y)) == r"x \left(- 2 y\right)" + assert latex((x * y).subs(x, -x)) == r"\left(- x\right) y" + + +def test_issue_2934(): + assert latex(Symbol(r'\frac{a_1}{b_1}')) == r'\frac{a_1}{b_1}' + + +def test_issue_10489(): + latexSymbolWithBrace = r'C_{x_{0}}' + s = Symbol(latexSymbolWithBrace) + assert latex(s) == latexSymbolWithBrace + assert latex(cos(s)) == r'\cos{\left(C_{x_{0}} \right)}' + + +def test_issue_12886(): + m__1, l__1 = symbols('m__1, l__1') + assert latex(m__1**2 + l__1**2) == \ + r'\left(l^{1}\right)^{2} + \left(m^{1}\right)^{2}' + + +def test_issue_13559(): + from sympy.parsing.sympy_parser import parse_expr + expr = parse_expr('5/1', evaluate=False) + assert latex(expr) == r"\frac{5}{1}" + + +def test_issue_13651(): + expr = c + Mul(-1, a + b, evaluate=False) + assert latex(expr) == r"c - \left(a + b\right)" + + +def test_latex_UnevaluatedExpr(): + x = symbols("x") + he = UnevaluatedExpr(1/x) + assert latex(he) == latex(1/x) == r"\frac{1}{x}" + assert latex(he**2) == r"\left(\frac{1}{x}\right)^{2}" + assert latex(he + 1) == r"1 + \frac{1}{x}" + assert latex(x*he) == r"x \frac{1}{x}" + + +def test_MatrixElement_printing(): + # test cases for issue #11821 + A = MatrixSymbol("A", 1, 3) + B = MatrixSymbol("B", 1, 3) + C = MatrixSymbol("C", 1, 3) + + assert latex(A[0, 0]) == r"A_{0, 0}" + assert latex(3 * A[0, 0]) == r"3 A_{0, 0}" + + F = C[0, 0].subs(C, A - B) + assert latex(F) == r"\left(A - B\right)_{0, 0}" + + i, j, k = symbols("i j k") + M = MatrixSymbol("M", k, k) + N = MatrixSymbol("N", k, k) + assert latex((M*N)[i, j]) == \ + r'\sum_{i_{1}=0}^{k - 1} M_{i, i_{1}} N_{i_{1}, j}' + + +def test_MatrixSymbol_printing(): + # test cases for issue #14237 + A = MatrixSymbol("A", 3, 3) + B = MatrixSymbol("B", 3, 3) + C = MatrixSymbol("C", 3, 3) + + assert latex(-A) == r"- A" + assert latex(A - A*B - B) == r"A - A B - B" + assert latex(-A*B - A*B*C - B) == r"- A B - A B C - B" + + +def test_KroneckerProduct_printing(): + A = MatrixSymbol('A', 3, 3) + B = MatrixSymbol('B', 2, 2) + assert latex(KroneckerProduct(A, B)) == r'A \otimes B' + + +def test_Series_printing(): + tf1 = TransferFunction(x*y**2 - z, y**3 - t**3, y) + tf2 = TransferFunction(x - y, x + y, y) + tf3 = TransferFunction(t*x**2 - t**w*x + w, t - y, y) + assert latex(Series(tf1, tf2)) == \ + r'\left(\frac{x y^{2} - z}{- t^{3} + y^{3}}\right) \left(\frac{x - y}{x + y}\right)' + assert latex(Series(tf1, tf2, tf3)) == \ + r'\left(\frac{x y^{2} - z}{- t^{3} + y^{3}}\right) \left(\frac{x - y}{x + y}\right) \left(\frac{t x^{2} - t^{w} x + w}{t - y}\right)' + assert latex(Series(-tf2, tf1)) == \ + r'\left(\frac{- x + y}{x + y}\right) \left(\frac{x y^{2} - z}{- t^{3} + y^{3}}\right)' + + M_1 = Matrix([[5/s], [5/(2*s)]]) + T_1 = TransferFunctionMatrix.from_Matrix(M_1, s) + M_2 = Matrix([[5, 6*s**3]]) + T_2 = TransferFunctionMatrix.from_Matrix(M_2, s) + # Brackets + assert latex(T_1*(T_2 + T_2)) == \ + r'\left[\begin{matrix}\frac{5}{s}\\\frac{5}{2 s}\end{matrix}\right]_\tau\cdot\left(\left[\begin{matrix}\frac{5}{1} &' \ + r' \frac{6 s^{3}}{1}\end{matrix}\right]_\tau + \left[\begin{matrix}\frac{5}{1} & \frac{6 s^{3}}{1}\end{matrix}\right]_\tau\right)' \ + == latex(MIMOSeries(MIMOParallel(T_2, T_2), T_1)) + # No Brackets + M_3 = Matrix([[5, 6], [6, 5/s]]) + T_3 = TransferFunctionMatrix.from_Matrix(M_3, s) + assert latex(T_1*T_2 + T_3) == r'\left[\begin{matrix}\frac{5}{s}\\\frac{5}{2 s}\end{matrix}\right]_\tau\cdot\left[\begin{matrix}' \ + r'\frac{5}{1} & \frac{6 s^{3}}{1}\end{matrix}\right]_\tau + \left[\begin{matrix}\frac{5}{1} & \frac{6}{1}\\\frac{6}{1} & ' \ + r'\frac{5}{s}\end{matrix}\right]_\tau' == latex(MIMOParallel(MIMOSeries(T_2, T_1), T_3)) + + +def test_TransferFunction_printing(): + tf1 = TransferFunction(x - 1, x + 1, x) + assert latex(tf1) == r"\frac{x - 1}{x + 1}" + tf2 = TransferFunction(x + 1, 2 - y, x) + assert latex(tf2) == r"\frac{x + 1}{2 - y}" + tf3 = TransferFunction(y, y**2 + 2*y + 3, y) + assert latex(tf3) == r"\frac{y}{y^{2} + 2 y + 3}" + + +def test_Parallel_printing(): + tf1 = TransferFunction(x*y**2 - z, y**3 - t**3, y) + tf2 = TransferFunction(x - y, x + y, y) + assert latex(Parallel(tf1, tf2)) == \ + r'\frac{x y^{2} - z}{- t^{3} + y^{3}} + \frac{x - y}{x + y}' + assert latex(Parallel(-tf2, tf1)) == \ + r'\frac{- x + y}{x + y} + \frac{x y^{2} - z}{- t^{3} + y^{3}}' + + M_1 = Matrix([[5, 6], [6, 5/s]]) + T_1 = TransferFunctionMatrix.from_Matrix(M_1, s) + M_2 = Matrix([[5/s, 6], [6, 5/(s - 1)]]) + T_2 = TransferFunctionMatrix.from_Matrix(M_2, s) + M_3 = Matrix([[6, 5/(s*(s - 1))], [5, 6]]) + T_3 = TransferFunctionMatrix.from_Matrix(M_3, s) + assert latex(T_1 + T_2 + T_3) == r'\left[\begin{matrix}\frac{5}{1} & \frac{6}{1}\\\frac{6}{1} & \frac{5}{s}\end{matrix}\right]' \ + r'_\tau + \left[\begin{matrix}\frac{5}{s} & \frac{6}{1}\\\frac{6}{1} & \frac{5}{s - 1}\end{matrix}\right]_\tau + \left[\begin{matrix}' \ + r'\frac{6}{1} & \frac{5}{s \left(s - 1\right)}\\\frac{5}{1} & \frac{6}{1}\end{matrix}\right]_\tau' \ + == latex(MIMOParallel(T_1, T_2, T_3)) == latex(MIMOParallel(T_1, MIMOParallel(T_2, T_3))) == latex(MIMOParallel(MIMOParallel(T_1, T_2), T_3)) + + +def test_TransferFunctionMatrix_printing(): + tf1 = TransferFunction(p, p + x, p) + tf2 = TransferFunction(-s + p, p + s, p) + tf3 = TransferFunction(p, y**2 + 2*y + 3, p) + assert latex(TransferFunctionMatrix([[tf1], [tf2]])) == \ + r'\left[\begin{matrix}\frac{p}{p + x}\\\frac{p - s}{p + s}\end{matrix}\right]_\tau' + assert latex(TransferFunctionMatrix([[tf1, tf2], [tf3, -tf1]])) == \ + r'\left[\begin{matrix}\frac{p}{p + x} & \frac{p - s}{p + s}\\\frac{p}{y^{2} + 2 y + 3} & \frac{\left(-1\right) p}{p + x}\end{matrix}\right]_\tau' + + +def test_Feedback_printing(): + tf1 = TransferFunction(p, p + x, p) + tf2 = TransferFunction(-s + p, p + s, p) + # Negative Feedback (Default) + assert latex(Feedback(tf1, tf2)) == \ + r'\frac{\frac{p}{p + x}}{\frac{1}{1} + \left(\frac{p}{p + x}\right) \left(\frac{p - s}{p + s}\right)}' + assert latex(Feedback(tf1*tf2, TransferFunction(1, 1, p))) == \ + r'\frac{\left(\frac{p}{p + x}\right) \left(\frac{p - s}{p + s}\right)}{\frac{1}{1} + \left(\frac{p}{p + x}\right) \left(\frac{p - s}{p + s}\right)}' + # Positive Feedback + assert latex(Feedback(tf1, tf2, 1)) == \ + r'\frac{\frac{p}{p + x}}{\frac{1}{1} - \left(\frac{p}{p + x}\right) \left(\frac{p - s}{p + s}\right)}' + assert latex(Feedback(tf1*tf2, sign=1)) == \ + r'\frac{\left(\frac{p}{p + x}\right) \left(\frac{p - s}{p + s}\right)}{\frac{1}{1} - \left(\frac{p}{p + x}\right) \left(\frac{p - s}{p + s}\right)}' + + +def test_MIMOFeedback_printing(): + tf1 = TransferFunction(1, s, s) + tf2 = TransferFunction(s, s**2 - 1, s) + tf3 = TransferFunction(s, s - 1, s) + tf4 = TransferFunction(s**2, s**2 - 1, s) + + tfm_1 = TransferFunctionMatrix([[tf1, tf2], [tf3, tf4]]) + tfm_2 = TransferFunctionMatrix([[tf4, tf3], [tf2, tf1]]) + + # Negative Feedback (Default) + assert latex(MIMOFeedback(tfm_1, tfm_2)) == \ + r'\left(I_{\tau} + \left[\begin{matrix}\frac{1}{s} & \frac{s}{s^{2} - 1}\\\frac{s}{s - 1} & \frac{s^{2}}{s^{2} - 1}\end{matrix}\right]_\tau\cdot\left[' \ + r'\begin{matrix}\frac{s^{2}}{s^{2} - 1} & \frac{s}{s - 1}\\\frac{s}{s^{2} - 1} & \frac{1}{s}\end{matrix}\right]_\tau\right)^{-1} \cdot \left[\begin{matrix}' \ + r'\frac{1}{s} & \frac{s}{s^{2} - 1}\\\frac{s}{s - 1} & \frac{s^{2}}{s^{2} - 1}\end{matrix}\right]_\tau' + + # Positive Feedback + assert latex(MIMOFeedback(tfm_1*tfm_2, tfm_1, 1)) == \ + r'\left(I_{\tau} - \left[\begin{matrix}\frac{1}{s} & \frac{s}{s^{2} - 1}\\\frac{s}{s - 1} & \frac{s^{2}}{s^{2} - 1}\end{matrix}\right]_\tau\cdot\left' \ + r'[\begin{matrix}\frac{s^{2}}{s^{2} - 1} & \frac{s}{s - 1}\\\frac{s}{s^{2} - 1} & \frac{1}{s}\end{matrix}\right]_\tau\cdot\left[\begin{matrix}\frac{1}{s} & \frac{s}{s^{2} - 1}' \ + r'\\\frac{s}{s - 1} & \frac{s^{2}}{s^{2} - 1}\end{matrix}\right]_\tau\right)^{-1} \cdot \left[\begin{matrix}\frac{1}{s} & \frac{s}{s^{2} - 1}' \ + r'\\\frac{s}{s - 1} & \frac{s^{2}}{s^{2} - 1}\end{matrix}\right]_\tau\cdot\left[\begin{matrix}\frac{s^{2}}{s^{2} - 1} & \frac{s}{s - 1}\\\frac{s}{s^{2} - 1}' \ + r' & \frac{1}{s}\end{matrix}\right]_\tau' + + +def test_Quaternion_latex_printing(): + q = Quaternion(x, y, z, t) + assert latex(q) == r"x + y i + z j + t k" + q = Quaternion(x, y, z, x*t) + assert latex(q) == r"x + y i + z j + t x k" + q = Quaternion(x, y, z, x + t) + assert latex(q) == r"x + y i + z j + \left(t + x\right) k" + + +def test_TensorProduct_printing(): + from sympy.tensor.functions import TensorProduct + A = MatrixSymbol("A", 3, 3) + B = MatrixSymbol("B", 3, 3) + assert latex(TensorProduct(A, B)) == r"A \otimes B" + + +def test_WedgeProduct_printing(): + from sympy.diffgeom.rn import R2 + from sympy.diffgeom import WedgeProduct + wp = WedgeProduct(R2.dx, R2.dy) + assert latex(wp) == r"\operatorname{d}x \wedge \operatorname{d}y" + + +def test_issue_9216(): + expr_1 = Pow(1, -1, evaluate=False) + assert latex(expr_1) == r"1^{-1}" + + expr_2 = Pow(1, Pow(1, -1, evaluate=False), evaluate=False) + assert latex(expr_2) == r"1^{1^{-1}}" + + expr_3 = Pow(3, -2, evaluate=False) + assert latex(expr_3) == r"\frac{1}{9}" + + expr_4 = Pow(1, -2, evaluate=False) + assert latex(expr_4) == r"1^{-2}" + + +def test_latex_printer_tensor(): + from sympy.tensor.tensor import TensorIndexType, tensor_indices, TensorHead, tensor_heads + L = TensorIndexType("L") + i, j, k, l = tensor_indices("i j k l", L) + i0 = tensor_indices("i_0", L) + A, B, C, D = tensor_heads("A B C D", [L]) + H = TensorHead("H", [L, L]) + K = TensorHead("K", [L, L, L, L]) + + assert latex(i) == r"{}^{i}" + assert latex(-i) == r"{}_{i}" + + expr = A(i) + assert latex(expr) == r"A{}^{i}" + + expr = A(i0) + assert latex(expr) == r"A{}^{i_{0}}" + + expr = A(-i) + assert latex(expr) == r"A{}_{i}" + + expr = -3*A(i) + assert latex(expr) == r"-3A{}^{i}" + + expr = K(i, j, -k, -i0) + assert latex(expr) == r"K{}^{ij}{}_{ki_{0}}" + + expr = K(i, -j, -k, i0) + assert latex(expr) == r"K{}^{i}{}_{jk}{}^{i_{0}}" + + expr = K(i, -j, k, -i0) + assert latex(expr) == r"K{}^{i}{}_{j}{}^{k}{}_{i_{0}}" + + expr = H(i, -j) + assert latex(expr) == r"H{}^{i}{}_{j}" + + expr = H(i, j) + assert latex(expr) == r"H{}^{ij}" + + expr = H(-i, -j) + assert latex(expr) == r"H{}_{ij}" + + expr = (1+x)*A(i) + assert latex(expr) == r"\left(x + 1\right)A{}^{i}" + + expr = H(i, -i) + assert latex(expr) == r"H{}^{L_{0}}{}_{L_{0}}" + + expr = H(i, -j)*A(j)*B(k) + assert latex(expr) == r"H{}^{i}{}_{L_{0}}A{}^{L_{0}}B{}^{k}" + + expr = A(i) + 3*B(i) + assert latex(expr) == r"3B{}^{i} + A{}^{i}" + + # Test ``TensorElement``: + from sympy.tensor.tensor import TensorElement + + expr = TensorElement(K(i, j, k, l), {i: 3, k: 2}) + assert latex(expr) == r'K{}^{i=3,j,k=2,l}' + + expr = TensorElement(K(i, j, k, l), {i: 3}) + assert latex(expr) == r'K{}^{i=3,jkl}' + + expr = TensorElement(K(i, -j, k, l), {i: 3, k: 2}) + assert latex(expr) == r'K{}^{i=3}{}_{j}{}^{k=2,l}' + + expr = TensorElement(K(i, -j, k, -l), {i: 3, k: 2}) + assert latex(expr) == r'K{}^{i=3}{}_{j}{}^{k=2}{}_{l}' + + expr = TensorElement(K(i, j, -k, -l), {i: 3, -k: 2}) + assert latex(expr) == r'K{}^{i=3,j}{}_{k=2,l}' + + expr = TensorElement(K(i, j, -k, -l), {i: 3}) + assert latex(expr) == r'K{}^{i=3,j}{}_{kl}' + + expr = PartialDerivative(A(i), A(i)) + assert latex(expr) == r"\frac{\partial}{\partial {A{}^{L_{0}}}}{A{}^{L_{0}}}" + + expr = PartialDerivative(A(-i), A(-j)) + assert latex(expr) == r"\frac{\partial}{\partial {A{}_{j}}}{A{}_{i}}" + + expr = PartialDerivative(K(i, j, -k, -l), A(m), A(-n)) + assert latex(expr) == r"\frac{\partial^{2}}{\partial {A{}^{m}} \partial {A{}_{n}}}{K{}^{ij}{}_{kl}}" + + expr = PartialDerivative(B(-i) + A(-i), A(-j), A(-n)) + assert latex(expr) == r"\frac{\partial^{2}}{\partial {A{}_{j}} \partial {A{}_{n}}}{\left(A{}_{i} + B{}_{i}\right)}" + + expr = PartialDerivative(3*A(-i), A(-j), A(-n)) + assert latex(expr) == r"\frac{\partial^{2}}{\partial {A{}_{j}} \partial {A{}_{n}}}{\left(3A{}_{i}\right)}" + + +def test_multiline_latex(): + a, b, c, d, e, f = symbols('a b c d e f') + expr = -a + 2*b -3*c +4*d -5*e + expected = r"\begin{eqnarray}" + "\n"\ + r"f & = &- a \nonumber\\" + "\n"\ + r"& & + 2 b \nonumber\\" + "\n"\ + r"& & - 3 c \nonumber\\" + "\n"\ + r"& & + 4 d \nonumber\\" + "\n"\ + r"& & - 5 e " + "\n"\ + r"\end{eqnarray}" + assert multiline_latex(f, expr, environment="eqnarray") == expected + + expected2 = r'\begin{eqnarray}' + '\n'\ + r'f & = &- a + 2 b \nonumber\\' + '\n'\ + r'& & - 3 c + 4 d \nonumber\\' + '\n'\ + r'& & - 5 e ' + '\n'\ + r'\end{eqnarray}' + + assert multiline_latex(f, expr, 2, environment="eqnarray") == expected2 + + expected3 = r'\begin{eqnarray}' + '\n'\ + r'f & = &- a + 2 b - 3 c \nonumber\\'+ '\n'\ + r'& & + 4 d - 5 e ' + '\n'\ + r'\end{eqnarray}' + + assert multiline_latex(f, expr, 3, environment="eqnarray") == expected3 + + expected3dots = r'\begin{eqnarray}' + '\n'\ + r'f & = &- a + 2 b - 3 c \dots\nonumber\\'+ '\n'\ + r'& & + 4 d - 5 e ' + '\n'\ + r'\end{eqnarray}' + + assert multiline_latex(f, expr, 3, environment="eqnarray", use_dots=True) == expected3dots + + expected3align = r'\begin{align*}' + '\n'\ + r'f = &- a + 2 b - 3 c \\'+ '\n'\ + r'& + 4 d - 5 e ' + '\n'\ + r'\end{align*}' + + assert multiline_latex(f, expr, 3) == expected3align + assert multiline_latex(f, expr, 3, environment='align*') == expected3align + + expected2ieee = r'\begin{IEEEeqnarray}{rCl}' + '\n'\ + r'f & = &- a + 2 b \nonumber\\' + '\n'\ + r'& & - 3 c + 4 d \nonumber\\' + '\n'\ + r'& & - 5 e ' + '\n'\ + r'\end{IEEEeqnarray}' + + assert multiline_latex(f, expr, 2, environment="IEEEeqnarray") == expected2ieee + + raises(ValueError, lambda: multiline_latex(f, expr, environment="foo")) + +def test_issue_15353(): + a, x = symbols('a x') + # Obtained from nonlinsolve([(sin(a*x)),cos(a*x)],[x,a]) + sol = ConditionSet( + Tuple(x, a), Eq(sin(a*x), 0) & Eq(cos(a*x), 0), S.Complexes**2) + assert latex(sol) == \ + r'\left\{\left( x, \ a\right)\; \middle|\; \left( x, \ a\right) \in ' \ + r'\mathbb{C}^{2} \wedge \sin{\left(a x \right)} = 0 \wedge ' \ + r'\cos{\left(a x \right)} = 0 \right\}' + + +def test_latex_symbolic_probability(): + mu = symbols("mu") + sigma = symbols("sigma", positive=True) + X = Normal("X", mu, sigma) + assert latex(Expectation(X)) == r'\operatorname{E}\left[X\right]' + assert latex(Variance(X)) == r'\operatorname{Var}\left(X\right)' + assert latex(Probability(X > 0)) == r'\operatorname{P}\left(X > 0\right)' + Y = Normal("Y", mu, sigma) + assert latex(Covariance(X, Y)) == r'\operatorname{Cov}\left(X, Y\right)' + + +def test_trace(): + # Issue 15303 + from sympy.matrices.expressions.trace import trace + A = MatrixSymbol("A", 2, 2) + assert latex(trace(A)) == r"\operatorname{tr}\left(A \right)" + assert latex(trace(A**2)) == r"\operatorname{tr}\left(A^{2} \right)" + + +def test_print_basic(): + # Issue 15303 + from sympy.core.basic import Basic + from sympy.core.expr import Expr + + # dummy class for testing printing where the function is not + # implemented in latex.py + class UnimplementedExpr(Expr): + def __new__(cls, e): + return Basic.__new__(cls, e) + + # dummy function for testing + def unimplemented_expr(expr): + return UnimplementedExpr(expr).doit() + + # override class name to use superscript / subscript + def unimplemented_expr_sup_sub(expr): + result = UnimplementedExpr(expr) + result.__class__.__name__ = 'UnimplementedExpr_x^1' + return result + + assert latex(unimplemented_expr(x)) == r'\operatorname{UnimplementedExpr}\left(x\right)' + assert latex(unimplemented_expr(x**2)) == \ + r'\operatorname{UnimplementedExpr}\left(x^{2}\right)' + assert latex(unimplemented_expr_sup_sub(x)) == \ + r'\operatorname{UnimplementedExpr^{1}_{x}}\left(x\right)' + + +def test_MatrixSymbol_bold(): + # Issue #15871 + from sympy.matrices.expressions.trace import trace + A = MatrixSymbol("A", 2, 2) + assert latex(trace(A), mat_symbol_style='bold') == \ + r"\operatorname{tr}\left(\mathbf{A} \right)" + assert latex(trace(A), mat_symbol_style='plain') == \ + r"\operatorname{tr}\left(A \right)" + + A = MatrixSymbol("A", 3, 3) + B = MatrixSymbol("B", 3, 3) + C = MatrixSymbol("C", 3, 3) + + assert latex(-A, mat_symbol_style='bold') == r"- \mathbf{A}" + assert latex(A - A*B - B, mat_symbol_style='bold') == \ + r"\mathbf{A} - \mathbf{A} \mathbf{B} - \mathbf{B}" + assert latex(-A*B - A*B*C - B, mat_symbol_style='bold') == \ + r"- \mathbf{A} \mathbf{B} - \mathbf{A} \mathbf{B} \mathbf{C} - \mathbf{B}" + + A_k = MatrixSymbol("A_k", 3, 3) + assert latex(A_k, mat_symbol_style='bold') == r"\mathbf{A}_{k}" + + A = MatrixSymbol(r"\nabla_k", 3, 3) + assert latex(A, mat_symbol_style='bold') == r"\mathbf{\nabla}_{k}" + +def test_AppliedPermutation(): + p = Permutation(0, 1, 2) + x = Symbol('x') + assert latex(AppliedPermutation(p, x)) == \ + r'\sigma_{\left( 0\; 1\; 2\right)}(x)' + + +def test_PermutationMatrix(): + p = Permutation(0, 1, 2) + assert latex(PermutationMatrix(p)) == r'P_{\left( 0\; 1\; 2\right)}' + p = Permutation(0, 3)(1, 2) + assert latex(PermutationMatrix(p)) == \ + r'P_{\left( 0\; 3\right)\left( 1\; 2\right)}' + + +def test_issue_21758(): + from sympy.functions.elementary.piecewise import piecewise_fold + from sympy.series.fourier import FourierSeries + x = Symbol('x') + k, n = symbols('k n') + fo = FourierSeries(x, (x, -pi, pi), (0, SeqFormula(0, (k, 1, oo)), SeqFormula( + Piecewise((-2*pi*cos(n*pi)/n + 2*sin(n*pi)/n**2, (n > -oo) & (n < oo) & Ne(n, 0)), + (0, True))*sin(n*x)/pi, (n, 1, oo)))) + assert latex(piecewise_fold(fo)) == '\\begin{cases} 2 \\sin{\\left(x \\right)}' \ + ' - \\sin{\\left(2 x \\right)} + \\frac{2 \\sin{\\left(3 x \\right)}}{3} +' \ + ' \\ldots & \\text{for}\\: n > -\\infty \\wedge n < \\infty \\wedge ' \ + 'n \\neq 0 \\\\0 & \\text{otherwise} \\end{cases}' + assert latex(FourierSeries(x, (x, -pi, pi), (0, SeqFormula(0, (k, 1, oo)), + SeqFormula(0, (n, 1, oo))))) == '0' + + +def test_imaginary_unit(): + assert latex(1 + I) == r'1 + i' + assert latex(1 + I, imaginary_unit='i') == r'1 + i' + assert latex(1 + I, imaginary_unit='j') == r'1 + j' + assert latex(1 + I, imaginary_unit='foo') == r'1 + foo' + assert latex(I, imaginary_unit="ti") == r'\text{i}' + assert latex(I, imaginary_unit="tj") == r'\text{j}' + + +def test_text_re_im(): + assert latex(im(x), gothic_re_im=True) == r'\Im{\left(x\right)}' + assert latex(im(x), gothic_re_im=False) == r'\operatorname{im}{\left(x\right)}' + assert latex(re(x), gothic_re_im=True) == r'\Re{\left(x\right)}' + assert latex(re(x), gothic_re_im=False) == r'\operatorname{re}{\left(x\right)}' + + +def test_latex_diffgeom(): + from sympy.diffgeom import Manifold, Patch, CoordSystem, BaseScalarField, Differential + from sympy.diffgeom.rn import R2 + x,y = symbols('x y', real=True) + m = Manifold('M', 2) + assert latex(m) == r'\text{M}' + p = Patch('P', m) + assert latex(p) == r'\text{P}_{\text{M}}' + rect = CoordSystem('rect', p, [x, y]) + assert latex(rect) == r'\text{rect}^{\text{P}}_{\text{M}}' + b = BaseScalarField(rect, 0) + assert latex(b) == r'\mathbf{x}' + + g = Function('g') + s_field = g(R2.x, R2.y) + assert latex(Differential(s_field)) == \ + r'\operatorname{d}\left(g{\left(\mathbf{x},\mathbf{y} \right)}\right)' + + +def test_unit_printing(): + assert latex(5*meter) == r'5 \text{m}' + assert latex(3*gibibyte) == r'3 \text{gibibyte}' + assert latex(4*microgram/second) == r'\frac{4 \mu\text{g}}{\text{s}}' + assert latex(4*micro*gram/second) == r'\frac{4 \mu \text{g}}{\text{s}}' + assert latex(5*milli*meter) == r'5 \text{m} \text{m}' + assert latex(milli) == r'\text{m}' + + +def test_issue_17092(): + x_star = Symbol('x^*') + assert latex(Derivative(x_star, x_star,2)) == r'\frac{d^{2}}{d \left(x^{*}\right)^{2}} x^{*}' + + +def test_latex_decimal_separator(): + + x, y, z, t = symbols('x y z t') + k, m, n = symbols('k m n', integer=True) + f, g, h = symbols('f g h', cls=Function) + + # comma decimal_separator + assert(latex([1, 2.3, 4.5], decimal_separator='comma') == r'\left[ 1; \ 2{,}3; \ 4{,}5\right]') + assert(latex(FiniteSet(1, 2.3, 4.5), decimal_separator='comma') == r'\left\{1; 2{,}3; 4{,}5\right\}') + assert(latex((1, 2.3, 4.6), decimal_separator = 'comma') == r'\left( 1; \ 2{,}3; \ 4{,}6\right)') + assert(latex((1,), decimal_separator='comma') == r'\left( 1;\right)') + + # period decimal_separator + assert(latex([1, 2.3, 4.5], decimal_separator='period') == r'\left[ 1, \ 2.3, \ 4.5\right]' ) + assert(latex(FiniteSet(1, 2.3, 4.5), decimal_separator='period') == r'\left\{1, 2.3, 4.5\right\}') + assert(latex((1, 2.3, 4.6), decimal_separator = 'period') == r'\left( 1, \ 2.3, \ 4.6\right)') + assert(latex((1,), decimal_separator='period') == r'\left( 1,\right)') + + # default decimal_separator + assert(latex([1, 2.3, 4.5]) == r'\left[ 1, \ 2.3, \ 4.5\right]') + assert(latex(FiniteSet(1, 2.3, 4.5)) == r'\left\{1, 2.3, 4.5\right\}') + assert(latex((1, 2.3, 4.6)) == r'\left( 1, \ 2.3, \ 4.6\right)') + assert(latex((1,)) == r'\left( 1,\right)') + + assert(latex(Mul(3.4,5.3), decimal_separator = 'comma') == r'18{,}02') + assert(latex(3.4*5.3, decimal_separator = 'comma') == r'18{,}02') + x = symbols('x') + y = symbols('y') + z = symbols('z') + assert(latex(x*5.3 + 2**y**3.4 + 4.5 + z, decimal_separator = 'comma') == r'2^{y^{3{,}4}} + 5{,}3 x + z + 4{,}5') + + assert(latex(0.987, decimal_separator='comma') == r'0{,}987') + assert(latex(S(0.987), decimal_separator='comma') == r'0{,}987') + assert(latex(.3, decimal_separator='comma') == r'0{,}3') + assert(latex(S(.3), decimal_separator='comma') == r'0{,}3') + + + assert(latex(5.8*10**(-7), decimal_separator='comma') == r'5{,}8 \cdot 10^{-7}') + assert(latex(S(5.7)*10**(-7), decimal_separator='comma') == r'5{,}7 \cdot 10^{-7}') + assert(latex(S(5.7*10**(-7)), decimal_separator='comma') == r'5{,}7 \cdot 10^{-7}') + + x = symbols('x') + assert(latex(1.2*x+3.4, decimal_separator='comma') == r'1{,}2 x + 3{,}4') + assert(latex(FiniteSet(1, 2.3, 4.5), decimal_separator='period') == r'\left\{1, 2.3, 4.5\right\}') + + # Error Handling tests + raises(ValueError, lambda: latex([1,2.3,4.5], decimal_separator='non_existing_decimal_separator_in_list')) + raises(ValueError, lambda: latex(FiniteSet(1,2.3,4.5), decimal_separator='non_existing_decimal_separator_in_set')) + raises(ValueError, lambda: latex((1,2.3,4.5), decimal_separator='non_existing_decimal_separator_in_tuple')) + +def test_Str(): + from sympy.core.symbol import Str + assert str(Str('x')) == r'x' + +def test_latex_escape(): + assert latex_escape(r"~^\&%$#_{}") == "".join([ + r'\textasciitilde', + r'\textasciicircum', + r'\textbackslash', + r'\&', + r'\%', + r'\$', + r'\#', + r'\_', + r'\{', + r'\}', + ]) + +def test_emptyPrinter(): + class MyObject: + def __repr__(self): + return "" + + # unknown objects are monospaced + assert latex(MyObject()) == r"\mathtt{\text{}}" + + # even if they are nested within other objects + assert latex((MyObject(),)) == r"\left( \mathtt{\text{}},\right)" + +def test_global_settings(): + import inspect + + # settings should be visible in the signature of `latex` + assert inspect.signature(latex).parameters['imaginary_unit'].default == r'i' + assert latex(I) == r'i' + try: + # but changing the defaults... + LatexPrinter.set_global_settings(imaginary_unit='j') + # ... should change the signature + assert inspect.signature(latex).parameters['imaginary_unit'].default == r'j' + assert latex(I) == r'j' + finally: + # there's no public API to undo this, but we need to make sure we do + # so as not to impact other tests + del LatexPrinter._global_settings['imaginary_unit'] + + # check we really did undo it + assert inspect.signature(latex).parameters['imaginary_unit'].default == r'i' + assert latex(I) == r'i' + +def test_pickleable(): + # this tests that the _PrintFunction instance is pickleable + import pickle + assert pickle.loads(pickle.dumps(latex)) is latex + +def test_printing_latex_array_expressions(): + assert latex(ArraySymbol("A", (2, 3, 4))) == "A" + assert latex(ArrayElement("A", (2, 1/(1-x), 0))) == "{{A}_{2, \\frac{1}{1 - x}, 0}}" + M = MatrixSymbol("M", 3, 3) + N = MatrixSymbol("N", 3, 3) + assert latex(ArrayElement(M*N, [x, 0])) == "{{\\left(M N\\right)}_{x, 0}}" + +def test_Array(): + arr = Array(range(10)) + assert latex(arr) == r'\left[\begin{matrix}0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\end{matrix}\right]' + + arr = Array(range(11)) + # added empty arguments {} + assert latex(arr) == r'\left[\begin{array}{}0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\end{array}\right]' + +def test_latex_with_unevaluated(): + with evaluate(False): + assert latex(a * a) == r"a a" diff --git a/shared/package-files/9b/9bc5bd1aabdf95f02c8b39218007d3d252dcc6e7a06485822cdb87557ebd25a7/blob b/shared/package-files/9b/9bc5bd1aabdf95f02c8b39218007d3d252dcc6e7a06485822cdb87557ebd25a7/blob new file mode 100644 index 0000000000000000000000000000000000000000..5ba4810ac67756c17b0ef3163a496e913c0b5e57 Binary files /dev/null and b/shared/package-files/9b/9bc5bd1aabdf95f02c8b39218007d3d252dcc6e7a06485822cdb87557ebd25a7/blob differ diff --git a/shared/package-files/9b/9bc5eab41ed62df7643ec9c7b9a5642e53661f34714b8328d27f6475058a74be/infer.sh b/shared/package-files/9b/9bc5eab41ed62df7643ec9c7b9a5642e53661f34714b8328d27f6475058a74be/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..cbf1ae17902620fa87d732540b20d8a42da2d66e --- /dev/null +++ b/shared/package-files/9b/9bc5eab41ed62df7643ec9c7b9a5642e53661f34714b8328d27f6475058a74be/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +export PYTHONDONTWRITEBYTECODE=1 OMP_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 +exec /opt/glacier/bin/python "$root/predict.py" "$@" diff --git a/shared/package-files/9b/9bc71a341c0f8481bb6139c3f62abd8e373aff224e794f451ee6aed824ae95db/blob b/shared/package-files/9b/9bc71a341c0f8481bb6139c3f62abd8e373aff224e794f451ee6aed824ae95db/blob new file mode 100644 index 0000000000000000000000000000000000000000..3347f56d6fe95ebe5388de8d740ef4ddf8db317d --- /dev/null +++ b/shared/package-files/9b/9bc71a341c0f8481bb6139c3f62abd8e373aff224e794f451ee6aed824ae95db/blob @@ -0,0 +1,111 @@ +# Colored log +import sys +from distutils.log import * # noqa: F403 +from distutils.log import Log as old_Log +from distutils.log import _global_log + +from numpy.distutils.misc_util import (red_text, default_text, cyan_text, + green_text, is_sequence, is_string) + + +def _fix_args(args,flag=1): + if is_string(args): + return args.replace('%', '%%') + if flag and is_sequence(args): + return tuple([_fix_args(a, flag=0) for a in args]) + return args + + +class Log(old_Log): + def _log(self, level, msg, args): + if level >= self.threshold: + if args: + msg = msg % _fix_args(args) + if 0: + if msg.startswith('copying ') and msg.find(' -> ') != -1: + return + if msg.startswith('byte-compiling '): + return + print(_global_color_map[level](msg)) + sys.stdout.flush() + + def good(self, msg, *args): + """ + If we log WARN messages, log this message as a 'nice' anti-warn + message. + + """ + if WARN >= self.threshold: + if args: + print(green_text(msg % _fix_args(args))) + else: + print(green_text(msg)) + sys.stdout.flush() + + +_global_log.__class__ = Log + +good = _global_log.good + +def set_threshold(level, force=False): + prev_level = _global_log.threshold + if prev_level > DEBUG or force: + # If we're running at DEBUG, don't change the threshold, as there's + # likely a good reason why we're running at this level. + _global_log.threshold = level + if level <= DEBUG: + info('set_threshold: setting threshold to DEBUG level,' + ' it can be changed only with force argument') + else: + info('set_threshold: not changing threshold from DEBUG level' + ' %s to %s' % (prev_level, level)) + return prev_level + +def get_threshold(): + return _global_log.threshold + +def set_verbosity(v, force=False): + prev_level = _global_log.threshold + if v < 0: + set_threshold(ERROR, force) + elif v == 0: + set_threshold(WARN, force) + elif v == 1: + set_threshold(INFO, force) + elif v >= 2: + set_threshold(DEBUG, force) + return {FATAL:-2,ERROR:-1,WARN:0,INFO:1,DEBUG:2}.get(prev_level, 1) + + +_global_color_map = { + DEBUG:cyan_text, + INFO:default_text, + WARN:red_text, + ERROR:red_text, + FATAL:red_text +} + +# don't use INFO,.. flags in set_verbosity, these flags are for set_threshold. +set_verbosity(0, force=True) + + +_error = error +_warn = warn +_info = info +_debug = debug + + +def error(msg, *a, **kw): + _error(f"ERROR: {msg}", *a, **kw) + + +def warn(msg, *a, **kw): + _warn(f"WARN: {msg}", *a, **kw) + + +def info(msg, *a, **kw): + _info(f"INFO: {msg}", *a, **kw) + + +def debug(msg, *a, **kw): + _debug(f"DEBUG: {msg}", *a, **kw) diff --git a/shared/package-files/9b/9bcb1cdd87e0401992a6f7c357df2757cf1acd5e0aeb0f55b087e6288ef6ce2c/blob b/shared/package-files/9b/9bcb1cdd87e0401992a6f7c357df2757cf1acd5e0aeb0f55b087e6288ef6ce2c/blob new file mode 100644 index 0000000000000000000000000000000000000000..a9d4232ebc373b7802bb6c25c7a62f3e6d7e99a2 --- /dev/null +++ b/shared/package-files/9b/9bcb1cdd87e0401992a6f7c357df2757cf1acd5e0aeb0f55b087e6288ef6ce2c/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::logical_not(Tensor self) -> Tensor +inline at::Tensor logical_not(const at::Tensor & self) { + return at::_ops::logical_not::call(self); +} + +// aten::logical_not.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & logical_not_out(at::Tensor & out, const at::Tensor & self) { + return at::_ops::logical_not_out::call(self, out); +} +// aten::logical_not.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & logical_not_outf(const at::Tensor & self, at::Tensor & out) { + return at::_ops::logical_not_out::call(self, out); +} + +} diff --git a/shared/package-files/9b/9bd15ee3db9e2833e6bd35c624b34a1648d58cf686d9d7ab0299a6ee6e21aa7c/blob b/shared/package-files/9b/9bd15ee3db9e2833e6bd35c624b34a1648d58cf686d9d7ab0299a6ee6e21aa7c/blob new file mode 100644 index 0000000000000000000000000000000000000000..2ce6be9504e52a2b5d280409943f8143c05546e4 --- /dev/null +++ b/shared/package-files/9b/9bd15ee3db9e2833e6bd35c624b34a1648d58cf686d9d7ab0299a6ee6e21aa7c/blob @@ -0,0 +1,88 @@ +"""Danish Money Demand Data""" +import pandas as pd + +from statsmodels.datasets import utils as du + +__docformat__ = "restructuredtext" + +COPYRIGHT = """This is public domain.""" +TITLE = __doc__ +SOURCE = """ +Danish data used in S. Johansen and K. Juselius for estimating +a money demand function:: + + [1] Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation + and Inference on Cointegration - with Applications to the Demand + for Money, Oxford Bulletin of Economics and Statistics, 52, 2, + 169-210. +""" + +DESCRSHORT = """Danish Money Demand Data""" + +DESCRLONG = DESCRSHORT + +NOTE = """:: + Number of Observations - 55 + + Number of Variables - 5 + + Variable name definitions:: + + lrm - Log real money + lry - Log real income + lpy - Log prices + ibo - Bond rate + ide - Deposit rate +""" + + +def load_pandas(): + """ + Load the Danish money demand data and return a Dataset class. + + Returns + ------- + Dataset + A `Dataset` instance with ``data`` and ``names`` attributes. + + Notes + ----- + The Dataset instance does not contain endog and exog attributes. + """ + data = _get_data() + data.index.freq = "QS-JAN" + return du.Dataset(data=data, names=list(data.columns)) + + +def load(): + """ + Load the Danish money demand data and return a Dataset class. + + Returns + ------- + Dataset + A `Dataset` instance with ``data`` and ``names`` attributes. + + Notes + ----- + The Dataset instance does not contain endog and exog attributes. + """ + return load_pandas() + + +def _get_data(): + data = du.load_csv(__file__, "data.csv") + for i, val in enumerate(data.period): + parts = val.split("Q") + month = (int(parts[1]) - 1) * 3 + 1 + + data.loc[data.index[i], "period"] = f"{parts[0]}-{month:02d}-01" + data["period"] = pd.to_datetime(data.period) + return data.set_index("period").astype(float) + + +variable_names = ["lrm", "lry", "lpy", "ibo", "ide"] + + +def __str__(): + return "danish_data" diff --git a/shared/package-files/9b/9bd1a56d0debccb3914d26ba34f1450a638d982e734f0da563fd1f2ce90b6029/blob b/shared/package-files/9b/9bd1a56d0debccb3914d26ba34f1450a638d982e734f0da563fd1f2ce90b6029/blob new file mode 100644 index 0000000000000000000000000000000000000000..861aa4f2286e5a17bf87635a27e7d336f20ef508 --- /dev/null +++ b/shared/package-files/9b/9bd1a56d0debccb3914d26ba34f1450a638d982e734f0da563fd1f2ce90b6029/blob @@ -0,0 +1,650 @@ +import functools +import os +import sys +import sysconfig +from importlib.util import cache_from_source +from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Set, Tuple + +from pip._internal.exceptions import UninstallationError +from pip._internal.locations import get_bin_prefix, get_bin_user +from pip._internal.metadata import BaseDistribution +from pip._internal.utils.compat import WINDOWS +from pip._internal.utils.egg_link import egg_link_path_from_location +from pip._internal.utils.logging import getLogger, indent_log +from pip._internal.utils.misc import ask, normalize_path, renames, rmtree +from pip._internal.utils.temp_dir import AdjacentTempDirectory, TempDirectory +from pip._internal.utils.virtualenv import running_under_virtualenv + +logger = getLogger(__name__) + + +def _script_names( + bin_dir: str, script_name: str, is_gui: bool +) -> Generator[str, None, None]: + """Create the fully qualified name of the files created by + {console,gui}_scripts for the given ``dist``. + Returns the list of file names + """ + exe_name = os.path.join(bin_dir, script_name) + yield exe_name + if not WINDOWS: + return + yield f"{exe_name}.exe" + yield f"{exe_name}.exe.manifest" + if is_gui: + yield f"{exe_name}-script.pyw" + else: + yield f"{exe_name}-script.py" + + +def _unique( + fn: Callable[..., Generator[Any, None, None]] +) -> Callable[..., Generator[Any, None, None]]: + @functools.wraps(fn) + def unique(*args: Any, **kw: Any) -> Generator[Any, None, None]: + seen: Set[Any] = set() + for item in fn(*args, **kw): + if item not in seen: + seen.add(item) + yield item + + return unique + + +@_unique +def uninstallation_paths(dist: BaseDistribution) -> Generator[str, None, None]: + """ + Yield all the uninstallation paths for dist based on RECORD-without-.py[co] + + Yield paths to all the files in RECORD. For each .py file in RECORD, add + the .pyc and .pyo in the same directory. + + UninstallPathSet.add() takes care of the __pycache__ .py[co]. + + If RECORD is not found, raises UninstallationError, + with possible information from the INSTALLER file. + + https://packaging.python.org/specifications/recording-installed-packages/ + """ + location = dist.location + assert location is not None, "not installed" + + entries = dist.iter_declared_entries() + if entries is None: + msg = "Cannot uninstall {dist}, RECORD file not found.".format(dist=dist) + installer = dist.installer + if not installer or installer == "pip": + dep = "{}=={}".format(dist.raw_name, dist.version) + msg += ( + " You might be able to recover from this via: " + "'pip install --force-reinstall --no-deps {}'.".format(dep) + ) + else: + msg += " Hint: The package was installed by {}.".format(installer) + raise UninstallationError(msg) + + for entry in entries: + path = os.path.join(location, entry) + yield path + if path.endswith(".py"): + dn, fn = os.path.split(path) + base = fn[:-3] + path = os.path.join(dn, base + ".pyc") + yield path + path = os.path.join(dn, base + ".pyo") + yield path + + +def compact(paths: Iterable[str]) -> Set[str]: + """Compact a path set to contain the minimal number of paths + necessary to contain all paths in the set. If /a/path/ and + /a/path/to/a/file.txt are both in the set, leave only the + shorter path.""" + + sep = os.path.sep + short_paths: Set[str] = set() + for path in sorted(paths, key=len): + should_skip = any( + path.startswith(shortpath.rstrip("*")) + and path[len(shortpath.rstrip("*").rstrip(sep))] == sep + for shortpath in short_paths + ) + if not should_skip: + short_paths.add(path) + return short_paths + + +def compress_for_rename(paths: Iterable[str]) -> Set[str]: + """Returns a set containing the paths that need to be renamed. + + This set may include directories when the original sequence of paths + included every file on disk. + """ + case_map = {os.path.normcase(p): p for p in paths} + remaining = set(case_map) + unchecked = sorted({os.path.split(p)[0] for p in case_map.values()}, key=len) + wildcards: Set[str] = set() + + def norm_join(*a: str) -> str: + return os.path.normcase(os.path.join(*a)) + + for root in unchecked: + if any(os.path.normcase(root).startswith(w) for w in wildcards): + # This directory has already been handled. + continue + + all_files: Set[str] = set() + all_subdirs: Set[str] = set() + for dirname, subdirs, files in os.walk(root): + all_subdirs.update(norm_join(root, dirname, d) for d in subdirs) + all_files.update(norm_join(root, dirname, f) for f in files) + # If all the files we found are in our remaining set of files to + # remove, then remove them from the latter set and add a wildcard + # for the directory. + if not (all_files - remaining): + remaining.difference_update(all_files) + wildcards.add(root + os.sep) + + return set(map(case_map.__getitem__, remaining)) | wildcards + + +def compress_for_output_listing(paths: Iterable[str]) -> Tuple[Set[str], Set[str]]: + """Returns a tuple of 2 sets of which paths to display to user + + The first set contains paths that would be deleted. Files of a package + are not added and the top-level directory of the package has a '*' added + at the end - to signify that all it's contents are removed. + + The second set contains files that would have been skipped in the above + folders. + """ + + will_remove = set(paths) + will_skip = set() + + # Determine folders and files + folders = set() + files = set() + for path in will_remove: + if path.endswith(".pyc"): + continue + if path.endswith("__init__.py") or ".dist-info" in path: + folders.add(os.path.dirname(path)) + files.add(path) + + # probably this one https://github.com/python/mypy/issues/390 + _normcased_files = set(map(os.path.normcase, files)) # type: ignore + + folders = compact(folders) + + # This walks the tree using os.walk to not miss extra folders + # that might get added. + for folder in folders: + for dirpath, _, dirfiles in os.walk(folder): + for fname in dirfiles: + if fname.endswith(".pyc"): + continue + + file_ = os.path.join(dirpath, fname) + if ( + os.path.isfile(file_) + and os.path.normcase(file_) not in _normcased_files + ): + # We are skipping this file. Add it to the set. + will_skip.add(file_) + + will_remove = files | {os.path.join(folder, "*") for folder in folders} + + return will_remove, will_skip + + +class StashedUninstallPathSet: + """A set of file rename operations to stash files while + tentatively uninstalling them.""" + + def __init__(self) -> None: + # Mapping from source file root to [Adjacent]TempDirectory + # for files under that directory. + self._save_dirs: Dict[str, TempDirectory] = {} + # (old path, new path) tuples for each move that may need + # to be undone. + self._moves: List[Tuple[str, str]] = [] + + def _get_directory_stash(self, path: str) -> str: + """Stashes a directory. + + Directories are stashed adjacent to their original location if + possible, or else moved/copied into the user's temp dir.""" + + try: + save_dir: TempDirectory = AdjacentTempDirectory(path) + except OSError: + save_dir = TempDirectory(kind="uninstall") + self._save_dirs[os.path.normcase(path)] = save_dir + + return save_dir.path + + def _get_file_stash(self, path: str) -> str: + """Stashes a file. + + If no root has been provided, one will be created for the directory + in the user's temp directory.""" + path = os.path.normcase(path) + head, old_head = os.path.dirname(path), None + save_dir = None + + while head != old_head: + try: + save_dir = self._save_dirs[head] + break + except KeyError: + pass + head, old_head = os.path.dirname(head), head + else: + # Did not find any suitable root + head = os.path.dirname(path) + save_dir = TempDirectory(kind="uninstall") + self._save_dirs[head] = save_dir + + relpath = os.path.relpath(path, head) + if relpath and relpath != os.path.curdir: + return os.path.join(save_dir.path, relpath) + return save_dir.path + + def stash(self, path: str) -> str: + """Stashes the directory or file and returns its new location. + Handle symlinks as files to avoid modifying the symlink targets. + """ + path_is_dir = os.path.isdir(path) and not os.path.islink(path) + if path_is_dir: + new_path = self._get_directory_stash(path) + else: + new_path = self._get_file_stash(path) + + self._moves.append((path, new_path)) + if path_is_dir and os.path.isdir(new_path): + # If we're moving a directory, we need to + # remove the destination first or else it will be + # moved to inside the existing directory. + # We just created new_path ourselves, so it will + # be removable. + os.rmdir(new_path) + renames(path, new_path) + return new_path + + def commit(self) -> None: + """Commits the uninstall by removing stashed files.""" + for save_dir in self._save_dirs.values(): + save_dir.cleanup() + self._moves = [] + self._save_dirs = {} + + def rollback(self) -> None: + """Undoes the uninstall by moving stashed files back.""" + for p in self._moves: + logger.info("Moving to %s\n from %s", *p) + + for new_path, path in self._moves: + try: + logger.debug("Replacing %s from %s", new_path, path) + if os.path.isfile(new_path) or os.path.islink(new_path): + os.unlink(new_path) + elif os.path.isdir(new_path): + rmtree(new_path) + renames(path, new_path) + except OSError as ex: + logger.error("Failed to restore %s", new_path) + logger.debug("Exception: %s", ex) + + self.commit() + + @property + def can_rollback(self) -> bool: + return bool(self._moves) + + +class UninstallPathSet: + """A set of file paths to be removed in the uninstallation of a + requirement.""" + + def __init__(self, dist: BaseDistribution) -> None: + self._paths: Set[str] = set() + self._refuse: Set[str] = set() + self._pth: Dict[str, UninstallPthEntries] = {} + self._dist = dist + self._moved_paths = StashedUninstallPathSet() + # Create local cache of normalize_path results. Creating an UninstallPathSet + # can result in hundreds/thousands of redundant calls to normalize_path with + # the same args, which hurts performance. + self._normalize_path_cached = functools.lru_cache()(normalize_path) + + def _permitted(self, path: str) -> bool: + """ + Return True if the given path is one we are permitted to + remove/modify, False otherwise. + + """ + # aka is_local, but caching normalized sys.prefix + if not running_under_virtualenv(): + return True + return path.startswith(self._normalize_path_cached(sys.prefix)) + + def add(self, path: str) -> None: + head, tail = os.path.split(path) + + # we normalize the head to resolve parent directory symlinks, but not + # the tail, since we only want to uninstall symlinks, not their targets + path = os.path.join(self._normalize_path_cached(head), os.path.normcase(tail)) + + if not os.path.exists(path): + return + if self._permitted(path): + self._paths.add(path) + else: + self._refuse.add(path) + + # __pycache__ files can show up after 'installed-files.txt' is created, + # due to imports + if os.path.splitext(path)[1] == ".py": + self.add(cache_from_source(path)) + + def add_pth(self, pth_file: str, entry: str) -> None: + pth_file = self._normalize_path_cached(pth_file) + if self._permitted(pth_file): + if pth_file not in self._pth: + self._pth[pth_file] = UninstallPthEntries(pth_file) + self._pth[pth_file].add(entry) + else: + self._refuse.add(pth_file) + + def remove(self, auto_confirm: bool = False, verbose: bool = False) -> None: + """Remove paths in ``self._paths`` with confirmation (unless + ``auto_confirm`` is True).""" + + if not self._paths: + logger.info( + "Can't uninstall '%s'. No files were found to uninstall.", + self._dist.raw_name, + ) + return + + dist_name_version = f"{self._dist.raw_name}-{self._dist.version}" + logger.info("Uninstalling %s:", dist_name_version) + + with indent_log(): + if auto_confirm or self._allowed_to_proceed(verbose): + moved = self._moved_paths + + for_rename = compress_for_rename(self._paths) + + for path in sorted(compact(for_rename)): + moved.stash(path) + logger.verbose("Removing file or directory %s", path) + + for pth in self._pth.values(): + pth.remove() + + logger.info("Successfully uninstalled %s", dist_name_version) + + def _allowed_to_proceed(self, verbose: bool) -> bool: + """Display which files would be deleted and prompt for confirmation""" + + def _display(msg: str, paths: Iterable[str]) -> None: + if not paths: + return + + logger.info(msg) + with indent_log(): + for path in sorted(compact(paths)): + logger.info(path) + + if not verbose: + will_remove, will_skip = compress_for_output_listing(self._paths) + else: + # In verbose mode, display all the files that are going to be + # deleted. + will_remove = set(self._paths) + will_skip = set() + + _display("Would remove:", will_remove) + _display("Would not remove (might be manually added):", will_skip) + _display("Would not remove (outside of prefix):", self._refuse) + if verbose: + _display("Will actually move:", compress_for_rename(self._paths)) + + return ask("Proceed (Y/n)? ", ("y", "n", "")) != "n" + + def rollback(self) -> None: + """Rollback the changes previously made by remove().""" + if not self._moved_paths.can_rollback: + logger.error( + "Can't roll back %s; was not uninstalled", + self._dist.raw_name, + ) + return + logger.info("Rolling back uninstall of %s", self._dist.raw_name) + self._moved_paths.rollback() + for pth in self._pth.values(): + pth.rollback() + + def commit(self) -> None: + """Remove temporary save dir: rollback will no longer be possible.""" + self._moved_paths.commit() + + @classmethod + def from_dist(cls, dist: BaseDistribution) -> "UninstallPathSet": + dist_location = dist.location + info_location = dist.info_location + if dist_location is None: + logger.info( + "Not uninstalling %s since it is not installed", + dist.canonical_name, + ) + return cls(dist) + + normalized_dist_location = normalize_path(dist_location) + if not dist.local: + logger.info( + "Not uninstalling %s at %s, outside environment %s", + dist.canonical_name, + normalized_dist_location, + sys.prefix, + ) + return cls(dist) + + if normalized_dist_location in { + p + for p in {sysconfig.get_path("stdlib"), sysconfig.get_path("platstdlib")} + if p + }: + logger.info( + "Not uninstalling %s at %s, as it is in the standard library.", + dist.canonical_name, + normalized_dist_location, + ) + return cls(dist) + + paths_to_remove = cls(dist) + develop_egg_link = egg_link_path_from_location(dist.raw_name) + + # Distribution is installed with metadata in a "flat" .egg-info + # directory. This means it is not a modern .dist-info installation, an + # egg, or legacy editable. + setuptools_flat_installation = ( + dist.installed_with_setuptools_egg_info + and info_location is not None + and os.path.exists(info_location) + # If dist is editable and the location points to a ``.egg-info``, + # we are in fact in the legacy editable case. + and not info_location.endswith(f"{dist.setuptools_filename}.egg-info") + ) + + # Uninstall cases order do matter as in the case of 2 installs of the + # same package, pip needs to uninstall the currently detected version + if setuptools_flat_installation: + if info_location is not None: + paths_to_remove.add(info_location) + installed_files = dist.iter_declared_entries() + if installed_files is not None: + for installed_file in installed_files: + paths_to_remove.add(os.path.join(dist_location, installed_file)) + # FIXME: need a test for this elif block + # occurs with --single-version-externally-managed/--record outside + # of pip + elif dist.is_file("top_level.txt"): + try: + namespace_packages = dist.read_text("namespace_packages.txt") + except FileNotFoundError: + namespaces = [] + else: + namespaces = namespace_packages.splitlines(keepends=False) + for top_level_pkg in [ + p + for p in dist.read_text("top_level.txt").splitlines() + if p and p not in namespaces + ]: + path = os.path.join(dist_location, top_level_pkg) + paths_to_remove.add(path) + paths_to_remove.add(f"{path}.py") + paths_to_remove.add(f"{path}.pyc") + paths_to_remove.add(f"{path}.pyo") + + elif dist.installed_by_distutils: + raise UninstallationError( + "Cannot uninstall {!r}. It is a distutils installed project " + "and thus we cannot accurately determine which files belong " + "to it which would lead to only a partial uninstall.".format( + dist.raw_name, + ) + ) + + elif dist.installed_as_egg: + # package installed by easy_install + # We cannot match on dist.egg_name because it can slightly vary + # i.e. setuptools-0.6c11-py2.6.egg vs setuptools-0.6rc11-py2.6.egg + paths_to_remove.add(dist_location) + easy_install_egg = os.path.split(dist_location)[1] + easy_install_pth = os.path.join( + os.path.dirname(dist_location), + "easy-install.pth", + ) + paths_to_remove.add_pth(easy_install_pth, "./" + easy_install_egg) + + elif dist.installed_with_dist_info: + for path in uninstallation_paths(dist): + paths_to_remove.add(path) + + elif develop_egg_link: + # PEP 660 modern editable is handled in the ``.dist-info`` case + # above, so this only covers the setuptools-style editable. + with open(develop_egg_link) as fh: + link_pointer = os.path.normcase(fh.readline().strip()) + normalized_link_pointer = paths_to_remove._normalize_path_cached( + link_pointer + ) + assert os.path.samefile( + normalized_link_pointer, normalized_dist_location + ), ( + f"Egg-link {develop_egg_link} (to {link_pointer}) does not match " + f"installed location of {dist.raw_name} (at {dist_location})" + ) + paths_to_remove.add(develop_egg_link) + easy_install_pth = os.path.join( + os.path.dirname(develop_egg_link), "easy-install.pth" + ) + paths_to_remove.add_pth(easy_install_pth, dist_location) + + else: + logger.debug( + "Not sure how to uninstall: %s - Check: %s", + dist, + dist_location, + ) + + if dist.in_usersite: + bin_dir = get_bin_user() + else: + bin_dir = get_bin_prefix() + + # find distutils scripts= scripts + try: + for script in dist.iter_distutils_script_names(): + paths_to_remove.add(os.path.join(bin_dir, script)) + if WINDOWS: + paths_to_remove.add(os.path.join(bin_dir, f"{script}.bat")) + except (FileNotFoundError, NotADirectoryError): + pass + + # find console_scripts and gui_scripts + def iter_scripts_to_remove( + dist: BaseDistribution, + bin_dir: str, + ) -> Generator[str, None, None]: + for entry_point in dist.iter_entry_points(): + if entry_point.group == "console_scripts": + yield from _script_names(bin_dir, entry_point.name, False) + elif entry_point.group == "gui_scripts": + yield from _script_names(bin_dir, entry_point.name, True) + + for s in iter_scripts_to_remove(dist, bin_dir): + paths_to_remove.add(s) + + return paths_to_remove + + +class UninstallPthEntries: + def __init__(self, pth_file: str) -> None: + self.file = pth_file + self.entries: Set[str] = set() + self._saved_lines: Optional[List[bytes]] = None + + def add(self, entry: str) -> None: + entry = os.path.normcase(entry) + # On Windows, os.path.normcase converts the entry to use + # backslashes. This is correct for entries that describe absolute + # paths outside of site-packages, but all the others use forward + # slashes. + # os.path.splitdrive is used instead of os.path.isabs because isabs + # treats non-absolute paths with drive letter markings like c:foo\bar + # as absolute paths. It also does not recognize UNC paths if they don't + # have more than "\\sever\share". Valid examples: "\\server\share\" or + # "\\server\share\folder". + if WINDOWS and not os.path.splitdrive(entry)[0]: + entry = entry.replace("\\", "/") + self.entries.add(entry) + + def remove(self) -> None: + logger.verbose("Removing pth entries from %s:", self.file) + + # If the file doesn't exist, log a warning and return + if not os.path.isfile(self.file): + logger.warning("Cannot remove entries from nonexistent file %s", self.file) + return + with open(self.file, "rb") as fh: + # windows uses '\r\n' with py3k, but uses '\n' with py2.x + lines = fh.readlines() + self._saved_lines = lines + if any(b"\r\n" in line for line in lines): + endline = "\r\n" + else: + endline = "\n" + # handle missing trailing newline + if lines and not lines[-1].endswith(endline.encode("utf-8")): + lines[-1] = lines[-1] + endline.encode("utf-8") + for entry in self.entries: + try: + logger.verbose("Removing entry: %s", entry) + lines.remove((entry + endline).encode("utf-8")) + except ValueError: + pass + with open(self.file, "wb") as fh: + fh.writelines(lines) + + def rollback(self) -> bool: + if self._saved_lines is None: + logger.error("Cannot roll back changes to %s, none were made", self.file) + return False + logger.debug("Rolling %s back to previous state", self.file) + with open(self.file, "wb") as fh: + fh.writelines(self._saved_lines) + return True diff --git a/shared/package-files/9b/9bd625e31424e987575be66c6ac4eece953ebe1096088cb36258d597b2a350ff/blob b/shared/package-files/9b/9bd625e31424e987575be66c6ac4eece953ebe1096088cb36258d597b2a350ff/blob new file mode 100644 index 0000000000000000000000000000000000000000..100d4aaebca8ccc1a413c65c08cbd9f90cdfce1f --- /dev/null +++ b/shared/package-files/9b/9bd625e31424e987575be66c6ac4eece953ebe1096088cb36258d597b2a350ff/blob @@ -0,0 +1,2743 @@ +""" +Container for the layout. +(Containers can contain other containers or user interface controls.) +""" +from __future__ import annotations + +from abc import ABCMeta, abstractmethod +from enum import Enum +from functools import partial +from typing import TYPE_CHECKING, Callable, Sequence, Union, cast + +from prompt_toolkit.application.current import get_app +from prompt_toolkit.cache import SimpleCache +from prompt_toolkit.data_structures import Point +from prompt_toolkit.filters import ( + FilterOrBool, + emacs_insert_mode, + to_filter, + vi_insert_mode, +) +from prompt_toolkit.formatted_text import ( + AnyFormattedText, + StyleAndTextTuples, + to_formatted_text, +) +from prompt_toolkit.formatted_text.utils import ( + fragment_list_to_text, + fragment_list_width, +) +from prompt_toolkit.key_binding import KeyBindingsBase +from prompt_toolkit.mouse_events import MouseEvent, MouseEventType +from prompt_toolkit.utils import get_cwidth, take_using_weights, to_int, to_str + +from .controls import ( + DummyControl, + FormattedTextControl, + GetLinePrefixCallable, + UIContent, + UIControl, +) +from .dimension import ( + AnyDimension, + Dimension, + max_layout_dimensions, + sum_layout_dimensions, + to_dimension, +) +from .margins import Margin +from .mouse_handlers import MouseHandlers +from .screen import _CHAR_CACHE, Screen, WritePosition +from .utils import explode_text_fragments + +if TYPE_CHECKING: + from typing_extensions import Protocol, TypeGuard + + from prompt_toolkit.key_binding.key_bindings import NotImplementedOrNone + + +__all__ = [ + "AnyContainer", + "Container", + "HorizontalAlign", + "VerticalAlign", + "HSplit", + "VSplit", + "FloatContainer", + "Float", + "WindowAlign", + "Window", + "WindowRenderInfo", + "ConditionalContainer", + "ScrollOffsets", + "ColorColumn", + "to_container", + "to_window", + "is_container", + "DynamicContainer", +] + + +class Container(metaclass=ABCMeta): + """ + Base class for user interface layout. + """ + + @abstractmethod + def reset(self) -> None: + """ + Reset the state of this container and all the children. + (E.g. reset scroll offsets, etc...) + """ + + @abstractmethod + def preferred_width(self, max_available_width: int) -> Dimension: + """ + Return a :class:`~prompt_toolkit.layout.Dimension` that represents the + desired width for this container. + """ + + @abstractmethod + def preferred_height(self, width: int, max_available_height: int) -> Dimension: + """ + Return a :class:`~prompt_toolkit.layout.Dimension` that represents the + desired height for this container. + """ + + @abstractmethod + def write_to_screen( + self, + screen: Screen, + mouse_handlers: MouseHandlers, + write_position: WritePosition, + parent_style: str, + erase_bg: bool, + z_index: int | None, + ) -> None: + """ + Write the actual content to the screen. + + :param screen: :class:`~prompt_toolkit.layout.screen.Screen` + :param mouse_handlers: :class:`~prompt_toolkit.layout.mouse_handlers.MouseHandlers`. + :param parent_style: Style string to pass to the :class:`.Window` + object. This will be applied to all content of the windows. + :class:`.VSplit` and :class:`.HSplit` can use it to pass their + style down to the windows that they contain. + :param z_index: Used for propagating z_index from parent to child. + """ + + def is_modal(self) -> bool: + """ + When this container is modal, key bindings from parent containers are + not taken into account if a user control in this container is focused. + """ + return False + + def get_key_bindings(self) -> KeyBindingsBase | None: + """ + Returns a :class:`.KeyBindings` object. These bindings become active when any + user control in this container has the focus, except if any containers + between this container and the focused user control is modal. + """ + return None + + @abstractmethod + def get_children(self) -> list[Container]: + """ + Return the list of child :class:`.Container` objects. + """ + return [] + + +if TYPE_CHECKING: + + class MagicContainer(Protocol): + """ + Any object that implements ``__pt_container__`` represents a container. + """ + + def __pt_container__(self) -> AnyContainer: + ... + + +AnyContainer = Union[Container, "MagicContainer"] + + +def _window_too_small() -> Window: + "Create a `Window` that displays the 'Window too small' text." + return Window( + FormattedTextControl(text=[("class:window-too-small", " Window too small... ")]) + ) + + +class VerticalAlign(Enum): + "Alignment for `HSplit`." + + TOP = "TOP" + CENTER = "CENTER" + BOTTOM = "BOTTOM" + JUSTIFY = "JUSTIFY" + + +class HorizontalAlign(Enum): + "Alignment for `VSplit`." + + LEFT = "LEFT" + CENTER = "CENTER" + RIGHT = "RIGHT" + JUSTIFY = "JUSTIFY" + + +class _Split(Container): + """ + The common parts of `VSplit` and `HSplit`. + """ + + def __init__( + self, + children: Sequence[AnyContainer], + window_too_small: Container | None = None, + padding: AnyDimension = Dimension.exact(0), + padding_char: str | None = None, + padding_style: str = "", + width: AnyDimension = None, + height: AnyDimension = None, + z_index: int | None = None, + modal: bool = False, + key_bindings: KeyBindingsBase | None = None, + style: str | Callable[[], str] = "", + ) -> None: + self.children = [to_container(c) for c in children] + self.window_too_small = window_too_small or _window_too_small() + self.padding = padding + self.padding_char = padding_char + self.padding_style = padding_style + + self.width = width + self.height = height + self.z_index = z_index + + self.modal = modal + self.key_bindings = key_bindings + self.style = style + + def is_modal(self) -> bool: + return self.modal + + def get_key_bindings(self) -> KeyBindingsBase | None: + return self.key_bindings + + def get_children(self) -> list[Container]: + return self.children + + +class HSplit(_Split): + """ + Several layouts, one stacked above/under the other. :: + + +--------------------+ + | | + +--------------------+ + | | + +--------------------+ + + By default, this doesn't display a horizontal line between the children, + but if this is something you need, then create a HSplit as follows:: + + HSplit(children=[ ... ], padding_char='-', + padding=1, padding_style='#ffff00') + + :param children: List of child :class:`.Container` objects. + :param window_too_small: A :class:`.Container` object that is displayed if + there is not enough space for all the children. By default, this is a + "Window too small" message. + :param align: `VerticalAlign` value. + :param width: When given, use this width instead of looking at the children. + :param height: When given, use this height instead of looking at the children. + :param z_index: (int or None) When specified, this can be used to bring + element in front of floating elements. `None` means: inherit from parent. + :param style: A style string. + :param modal: ``True`` or ``False``. + :param key_bindings: ``None`` or a :class:`.KeyBindings` object. + + :param padding: (`Dimension` or int), size to be used for the padding. + :param padding_char: Character to be used for filling in the padding. + :param padding_style: Style to applied to the padding. + """ + + def __init__( + self, + children: Sequence[AnyContainer], + window_too_small: Container | None = None, + align: VerticalAlign = VerticalAlign.JUSTIFY, + padding: AnyDimension = 0, + padding_char: str | None = None, + padding_style: str = "", + width: AnyDimension = None, + height: AnyDimension = None, + z_index: int | None = None, + modal: bool = False, + key_bindings: KeyBindingsBase | None = None, + style: str | Callable[[], str] = "", + ) -> None: + super().__init__( + children=children, + window_too_small=window_too_small, + padding=padding, + padding_char=padding_char, + padding_style=padding_style, + width=width, + height=height, + z_index=z_index, + modal=modal, + key_bindings=key_bindings, + style=style, + ) + + self.align = align + + self._children_cache: SimpleCache[ + tuple[Container, ...], list[Container] + ] = SimpleCache(maxsize=1) + self._remaining_space_window = Window() # Dummy window. + + def preferred_width(self, max_available_width: int) -> Dimension: + if self.width is not None: + return to_dimension(self.width) + + if self.children: + dimensions = [c.preferred_width(max_available_width) for c in self.children] + return max_layout_dimensions(dimensions) + else: + return Dimension() + + def preferred_height(self, width: int, max_available_height: int) -> Dimension: + if self.height is not None: + return to_dimension(self.height) + + dimensions = [ + c.preferred_height(width, max_available_height) for c in self._all_children + ] + return sum_layout_dimensions(dimensions) + + def reset(self) -> None: + for c in self.children: + c.reset() + + @property + def _all_children(self) -> list[Container]: + """ + List of child objects, including padding. + """ + + def get() -> list[Container]: + result: list[Container] = [] + + # Padding Top. + if self.align in (VerticalAlign.CENTER, VerticalAlign.BOTTOM): + result.append(Window(width=Dimension(preferred=0))) + + # The children with padding. + for child in self.children: + result.append(child) + result.append( + Window( + height=self.padding, + char=self.padding_char, + style=self.padding_style, + ) + ) + if result: + result.pop() + + # Padding right. + if self.align in (VerticalAlign.CENTER, VerticalAlign.TOP): + result.append(Window(width=Dimension(preferred=0))) + + return result + + return self._children_cache.get(tuple(self.children), get) + + def write_to_screen( + self, + screen: Screen, + mouse_handlers: MouseHandlers, + write_position: WritePosition, + parent_style: str, + erase_bg: bool, + z_index: int | None, + ) -> None: + """ + Render the prompt to a `Screen` instance. + + :param screen: The :class:`~prompt_toolkit.layout.screen.Screen` class + to which the output has to be written. + """ + sizes = self._divide_heights(write_position) + style = parent_style + " " + to_str(self.style) + z_index = z_index if self.z_index is None else self.z_index + + if sizes is None: + self.window_too_small.write_to_screen( + screen, mouse_handlers, write_position, style, erase_bg, z_index + ) + else: + # + ypos = write_position.ypos + xpos = write_position.xpos + width = write_position.width + + # Draw child panes. + for s, c in zip(sizes, self._all_children): + c.write_to_screen( + screen, + mouse_handlers, + WritePosition(xpos, ypos, width, s), + style, + erase_bg, + z_index, + ) + ypos += s + + # Fill in the remaining space. This happens when a child control + # refuses to take more space and we don't have any padding. Adding a + # dummy child control for this (in `self._all_children`) is not + # desired, because in some situations, it would take more space, even + # when it's not required. This is required to apply the styling. + remaining_height = write_position.ypos + write_position.height - ypos + if remaining_height > 0: + self._remaining_space_window.write_to_screen( + screen, + mouse_handlers, + WritePosition(xpos, ypos, width, remaining_height), + style, + erase_bg, + z_index, + ) + + def _divide_heights(self, write_position: WritePosition) -> list[int] | None: + """ + Return the heights for all rows. + Or None when there is not enough space. + """ + if not self.children: + return [] + + width = write_position.width + height = write_position.height + + # Calculate heights. + dimensions = [c.preferred_height(width, height) for c in self._all_children] + + # Sum dimensions + sum_dimensions = sum_layout_dimensions(dimensions) + + # If there is not enough space for both. + # Don't do anything. + if sum_dimensions.min > height: + return None + + # Find optimal sizes. (Start with minimal size, increase until we cover + # the whole height.) + sizes = [d.min for d in dimensions] + + child_generator = take_using_weights( + items=list(range(len(dimensions))), weights=[d.weight for d in dimensions] + ) + + i = next(child_generator) + + # Increase until we meet at least the 'preferred' size. + preferred_stop = min(height, sum_dimensions.preferred) + preferred_dimensions = [d.preferred for d in dimensions] + + while sum(sizes) < preferred_stop: + if sizes[i] < preferred_dimensions[i]: + sizes[i] += 1 + i = next(child_generator) + + # Increase until we use all the available space. (or until "max") + if not get_app().is_done: + max_stop = min(height, sum_dimensions.max) + max_dimensions = [d.max for d in dimensions] + + while sum(sizes) < max_stop: + if sizes[i] < max_dimensions[i]: + sizes[i] += 1 + i = next(child_generator) + + return sizes + + +class VSplit(_Split): + """ + Several layouts, one stacked left/right of the other. :: + + +---------+----------+ + | | | + | | | + +---------+----------+ + + By default, this doesn't display a vertical line between the children, but + if this is something you need, then create a HSplit as follows:: + + VSplit(children=[ ... ], padding_char='|', + padding=1, padding_style='#ffff00') + + :param children: List of child :class:`.Container` objects. + :param window_too_small: A :class:`.Container` object that is displayed if + there is not enough space for all the children. By default, this is a + "Window too small" message. + :param align: `HorizontalAlign` value. + :param width: When given, use this width instead of looking at the children. + :param height: When given, use this height instead of looking at the children. + :param z_index: (int or None) When specified, this can be used to bring + element in front of floating elements. `None` means: inherit from parent. + :param style: A style string. + :param modal: ``True`` or ``False``. + :param key_bindings: ``None`` or a :class:`.KeyBindings` object. + + :param padding: (`Dimension` or int), size to be used for the padding. + :param padding_char: Character to be used for filling in the padding. + :param padding_style: Style to applied to the padding. + """ + + def __init__( + self, + children: Sequence[AnyContainer], + window_too_small: Container | None = None, + align: HorizontalAlign = HorizontalAlign.JUSTIFY, + padding: AnyDimension = 0, + padding_char: str | None = None, + padding_style: str = "", + width: AnyDimension = None, + height: AnyDimension = None, + z_index: int | None = None, + modal: bool = False, + key_bindings: KeyBindingsBase | None = None, + style: str | Callable[[], str] = "", + ) -> None: + super().__init__( + children=children, + window_too_small=window_too_small, + padding=padding, + padding_char=padding_char, + padding_style=padding_style, + width=width, + height=height, + z_index=z_index, + modal=modal, + key_bindings=key_bindings, + style=style, + ) + + self.align = align + + self._children_cache: SimpleCache[ + tuple[Container, ...], list[Container] + ] = SimpleCache(maxsize=1) + self._remaining_space_window = Window() # Dummy window. + + def preferred_width(self, max_available_width: int) -> Dimension: + if self.width is not None: + return to_dimension(self.width) + + dimensions = [ + c.preferred_width(max_available_width) for c in self._all_children + ] + + return sum_layout_dimensions(dimensions) + + def preferred_height(self, width: int, max_available_height: int) -> Dimension: + if self.height is not None: + return to_dimension(self.height) + + # At the point where we want to calculate the heights, the widths have + # already been decided. So we can trust `width` to be the actual + # `width` that's going to be used for the rendering. So, + # `divide_widths` is supposed to use all of the available width. + # Using only the `preferred` width caused a bug where the reported + # height was more than required. (we had a `BufferControl` which did + # wrap lines because of the smaller width returned by `_divide_widths`. + + sizes = self._divide_widths(width) + children = self._all_children + + if sizes is None: + return Dimension() + else: + dimensions = [ + c.preferred_height(s, max_available_height) + for s, c in zip(sizes, children) + ] + return max_layout_dimensions(dimensions) + + def reset(self) -> None: + for c in self.children: + c.reset() + + @property + def _all_children(self) -> list[Container]: + """ + List of child objects, including padding. + """ + + def get() -> list[Container]: + result: list[Container] = [] + + # Padding left. + if self.align in (HorizontalAlign.CENTER, HorizontalAlign.RIGHT): + result.append(Window(width=Dimension(preferred=0))) + + # The children with padding. + for child in self.children: + result.append(child) + result.append( + Window( + width=self.padding, + char=self.padding_char, + style=self.padding_style, + ) + ) + if result: + result.pop() + + # Padding right. + if self.align in (HorizontalAlign.CENTER, HorizontalAlign.LEFT): + result.append(Window(width=Dimension(preferred=0))) + + return result + + return self._children_cache.get(tuple(self.children), get) + + def _divide_widths(self, width: int) -> list[int] | None: + """ + Return the widths for all columns. + Or None when there is not enough space. + """ + children = self._all_children + + if not children: + return [] + + # Calculate widths. + dimensions = [c.preferred_width(width) for c in children] + preferred_dimensions = [d.preferred for d in dimensions] + + # Sum dimensions + sum_dimensions = sum_layout_dimensions(dimensions) + + # If there is not enough space for both. + # Don't do anything. + if sum_dimensions.min > width: + return None + + # Find optimal sizes. (Start with minimal size, increase until we cover + # the whole width.) + sizes = [d.min for d in dimensions] + + child_generator = take_using_weights( + items=list(range(len(dimensions))), weights=[d.weight for d in dimensions] + ) + + i = next(child_generator) + + # Increase until we meet at least the 'preferred' size. + preferred_stop = min(width, sum_dimensions.preferred) + + while sum(sizes) < preferred_stop: + if sizes[i] < preferred_dimensions[i]: + sizes[i] += 1 + i = next(child_generator) + + # Increase until we use all the available space. + max_dimensions = [d.max for d in dimensions] + max_stop = min(width, sum_dimensions.max) + + while sum(sizes) < max_stop: + if sizes[i] < max_dimensions[i]: + sizes[i] += 1 + i = next(child_generator) + + return sizes + + def write_to_screen( + self, + screen: Screen, + mouse_handlers: MouseHandlers, + write_position: WritePosition, + parent_style: str, + erase_bg: bool, + z_index: int | None, + ) -> None: + """ + Render the prompt to a `Screen` instance. + + :param screen: The :class:`~prompt_toolkit.layout.screen.Screen` class + to which the output has to be written. + """ + if not self.children: + return + + children = self._all_children + sizes = self._divide_widths(write_position.width) + style = parent_style + " " + to_str(self.style) + z_index = z_index if self.z_index is None else self.z_index + + # If there is not enough space. + if sizes is None: + self.window_too_small.write_to_screen( + screen, mouse_handlers, write_position, style, erase_bg, z_index + ) + return + + # Calculate heights, take the largest possible, but not larger than + # write_position.height. + heights = [ + child.preferred_height(width, write_position.height).preferred + for width, child in zip(sizes, children) + ] + height = max(write_position.height, min(write_position.height, max(heights))) + + # + ypos = write_position.ypos + xpos = write_position.xpos + + # Draw all child panes. + for s, c in zip(sizes, children): + c.write_to_screen( + screen, + mouse_handlers, + WritePosition(xpos, ypos, s, height), + style, + erase_bg, + z_index, + ) + xpos += s + + # Fill in the remaining space. This happens when a child control + # refuses to take more space and we don't have any padding. Adding a + # dummy child control for this (in `self._all_children`) is not + # desired, because in some situations, it would take more space, even + # when it's not required. This is required to apply the styling. + remaining_width = write_position.xpos + write_position.width - xpos + if remaining_width > 0: + self._remaining_space_window.write_to_screen( + screen, + mouse_handlers, + WritePosition(xpos, ypos, remaining_width, height), + style, + erase_bg, + z_index, + ) + + +class FloatContainer(Container): + """ + Container which can contain another container for the background, as well + as a list of floating containers on top of it. + + Example Usage:: + + FloatContainer(content=Window(...), + floats=[ + Float(xcursor=True, + ycursor=True, + content=CompletionsMenu(...)) + ]) + + :param z_index: (int or None) When specified, this can be used to bring + element in front of floating elements. `None` means: inherit from parent. + This is the z_index for the whole `Float` container as a whole. + """ + + def __init__( + self, + content: AnyContainer, + floats: list[Float], + modal: bool = False, + key_bindings: KeyBindingsBase | None = None, + style: str | Callable[[], str] = "", + z_index: int | None = None, + ) -> None: + self.content = to_container(content) + self.floats = floats + + self.modal = modal + self.key_bindings = key_bindings + self.style = style + self.z_index = z_index + + def reset(self) -> None: + self.content.reset() + + for f in self.floats: + f.content.reset() + + def preferred_width(self, max_available_width: int) -> Dimension: + return self.content.preferred_width(max_available_width) + + def preferred_height(self, width: int, max_available_height: int) -> Dimension: + """ + Return the preferred height of the float container. + (We don't care about the height of the floats, they should always fit + into the dimensions provided by the container.) + """ + return self.content.preferred_height(width, max_available_height) + + def write_to_screen( + self, + screen: Screen, + mouse_handlers: MouseHandlers, + write_position: WritePosition, + parent_style: str, + erase_bg: bool, + z_index: int | None, + ) -> None: + style = parent_style + " " + to_str(self.style) + z_index = z_index if self.z_index is None else self.z_index + + self.content.write_to_screen( + screen, mouse_handlers, write_position, style, erase_bg, z_index + ) + + for number, fl in enumerate(self.floats): + # z_index of a Float is computed by summing the z_index of the + # container and the `Float`. + new_z_index = (z_index or 0) + fl.z_index + style = parent_style + " " + to_str(self.style) + + # If the float that we have here, is positioned relative to the + # cursor position, but the Window that specifies the cursor + # position is not drawn yet, because it's a Float itself, we have + # to postpone this calculation. (This is a work-around, but good + # enough for now.) + postpone = fl.xcursor is not None or fl.ycursor is not None + + if postpone: + new_z_index = ( + number + 10**8 + ) # Draw as late as possible, but keep the order. + screen.draw_with_z_index( + z_index=new_z_index, + draw_func=partial( + self._draw_float, + fl, + screen, + mouse_handlers, + write_position, + style, + erase_bg, + new_z_index, + ), + ) + else: + self._draw_float( + fl, + screen, + mouse_handlers, + write_position, + style, + erase_bg, + new_z_index, + ) + + def _draw_float( + self, + fl: Float, + screen: Screen, + mouse_handlers: MouseHandlers, + write_position: WritePosition, + style: str, + erase_bg: bool, + z_index: int | None, + ) -> None: + "Draw a single Float." + # When a menu_position was given, use this instead of the cursor + # position. (These cursor positions are absolute, translate again + # relative to the write_position.) + # Note: This should be inside the for-loop, because one float could + # set the cursor position to be used for the next one. + cpos = screen.get_menu_position( + fl.attach_to_window or get_app().layout.current_window + ) + cursor_position = Point( + x=cpos.x - write_position.xpos, y=cpos.y - write_position.ypos + ) + + fl_width = fl.get_width() + fl_height = fl.get_height() + width: int + height: int + xpos: int + ypos: int + + # Left & width given. + if fl.left is not None and fl_width is not None: + xpos = fl.left + width = fl_width + # Left & right given -> calculate width. + elif fl.left is not None and fl.right is not None: + xpos = fl.left + width = write_position.width - fl.left - fl.right + # Width & right given -> calculate left. + elif fl_width is not None and fl.right is not None: + xpos = write_position.width - fl.right - fl_width + width = fl_width + # Near x position of cursor. + elif fl.xcursor: + if fl_width is None: + width = fl.content.preferred_width(write_position.width).preferred + width = min(write_position.width, width) + else: + width = fl_width + + xpos = cursor_position.x + if xpos + width > write_position.width: + xpos = max(0, write_position.width - width) + # Only width given -> center horizontally. + elif fl_width: + xpos = int((write_position.width - fl_width) / 2) + width = fl_width + # Otherwise, take preferred width from float content. + else: + width = fl.content.preferred_width(write_position.width).preferred + + if fl.left is not None: + xpos = fl.left + elif fl.right is not None: + xpos = max(0, write_position.width - width - fl.right) + else: # Center horizontally. + xpos = max(0, int((write_position.width - width) / 2)) + + # Trim. + width = min(width, write_position.width - xpos) + + # Top & height given. + if fl.top is not None and fl_height is not None: + ypos = fl.top + height = fl_height + # Top & bottom given -> calculate height. + elif fl.top is not None and fl.bottom is not None: + ypos = fl.top + height = write_position.height - fl.top - fl.bottom + # Height & bottom given -> calculate top. + elif fl_height is not None and fl.bottom is not None: + ypos = write_position.height - fl_height - fl.bottom + height = fl_height + # Near cursor. + elif fl.ycursor: + ypos = cursor_position.y + (0 if fl.allow_cover_cursor else 1) + + if fl_height is None: + height = fl.content.preferred_height( + width, write_position.height + ).preferred + else: + height = fl_height + + # Reduce height if not enough space. (We can use the height + # when the content requires it.) + if height > write_position.height - ypos: + if write_position.height - ypos + 1 >= ypos: + # When the space below the cursor is more than + # the space above, just reduce the height. + height = write_position.height - ypos + else: + # Otherwise, fit the float above the cursor. + height = min(height, cursor_position.y) + ypos = cursor_position.y - height + + # Only height given -> center vertically. + elif fl_height: + ypos = int((write_position.height - fl_height) / 2) + height = fl_height + # Otherwise, take preferred height from content. + else: + height = fl.content.preferred_height(width, write_position.height).preferred + + if fl.top is not None: + ypos = fl.top + elif fl.bottom is not None: + ypos = max(0, write_position.height - height - fl.bottom) + else: # Center vertically. + ypos = max(0, int((write_position.height - height) / 2)) + + # Trim. + height = min(height, write_position.height - ypos) + + # Write float. + # (xpos and ypos can be negative: a float can be partially visible.) + if height > 0 and width > 0: + wp = WritePosition( + xpos=xpos + write_position.xpos, + ypos=ypos + write_position.ypos, + width=width, + height=height, + ) + + if not fl.hide_when_covering_content or self._area_is_empty(screen, wp): + fl.content.write_to_screen( + screen, + mouse_handlers, + wp, + style, + erase_bg=not fl.transparent(), + z_index=z_index, + ) + + def _area_is_empty(self, screen: Screen, write_position: WritePosition) -> bool: + """ + Return True when the area below the write position is still empty. + (For floats that should not hide content underneath.) + """ + wp = write_position + + for y in range(wp.ypos, wp.ypos + wp.height): + if y in screen.data_buffer: + row = screen.data_buffer[y] + + for x in range(wp.xpos, wp.xpos + wp.width): + c = row[x] + if c.char != " ": + return False + + return True + + def is_modal(self) -> bool: + return self.modal + + def get_key_bindings(self) -> KeyBindingsBase | None: + return self.key_bindings + + def get_children(self) -> list[Container]: + children = [self.content] + children.extend(f.content for f in self.floats) + return children + + +class Float: + """ + Float for use in a :class:`.FloatContainer`. + Except for the `content` parameter, all other options are optional. + + :param content: :class:`.Container` instance. + + :param width: :class:`.Dimension` or callable which returns a :class:`.Dimension`. + :param height: :class:`.Dimension` or callable which returns a :class:`.Dimension`. + + :param left: Distance to the left edge of the :class:`.FloatContainer`. + :param right: Distance to the right edge of the :class:`.FloatContainer`. + :param top: Distance to the top of the :class:`.FloatContainer`. + :param bottom: Distance to the bottom of the :class:`.FloatContainer`. + + :param attach_to_window: Attach to the cursor from this window, instead of + the current window. + :param hide_when_covering_content: Hide the float when it covers content underneath. + :param allow_cover_cursor: When `False`, make sure to display the float + below the cursor. Not on top of the indicated position. + :param z_index: Z-index position. For a Float, this needs to be at least + one. It is relative to the z_index of the parent container. + :param transparent: :class:`.Filter` indicating whether this float needs to be + drawn transparently. + """ + + def __init__( + self, + content: AnyContainer, + top: int | None = None, + right: int | None = None, + bottom: int | None = None, + left: int | None = None, + width: int | Callable[[], int] | None = None, + height: int | Callable[[], int] | None = None, + xcursor: bool = False, + ycursor: bool = False, + attach_to_window: AnyContainer | None = None, + hide_when_covering_content: bool = False, + allow_cover_cursor: bool = False, + z_index: int = 1, + transparent: bool = False, + ) -> None: + assert z_index >= 1 + + self.left = left + self.right = right + self.top = top + self.bottom = bottom + + self.width = width + self.height = height + + self.xcursor = xcursor + self.ycursor = ycursor + + self.attach_to_window = ( + to_window(attach_to_window) if attach_to_window else None + ) + + self.content = to_container(content) + self.hide_when_covering_content = hide_when_covering_content + self.allow_cover_cursor = allow_cover_cursor + self.z_index = z_index + self.transparent = to_filter(transparent) + + def get_width(self) -> int | None: + if callable(self.width): + return self.width() + return self.width + + def get_height(self) -> int | None: + if callable(self.height): + return self.height() + return self.height + + def __repr__(self) -> str: + return "Float(content=%r)" % self.content + + +class WindowRenderInfo: + """ + Render information for the last render time of this control. + It stores mapping information between the input buffers (in case of a + :class:`~prompt_toolkit.layout.controls.BufferControl`) and the actual + render position on the output screen. + + (Could be used for implementation of the Vi 'H' and 'L' key bindings as + well as implementing mouse support.) + + :param ui_content: The original :class:`.UIContent` instance that contains + the whole input, without clipping. (ui_content) + :param horizontal_scroll: The horizontal scroll of the :class:`.Window` instance. + :param vertical_scroll: The vertical scroll of the :class:`.Window` instance. + :param window_width: The width of the window that displays the content, + without the margins. + :param window_height: The height of the window that displays the content. + :param configured_scroll_offsets: The scroll offsets as configured for the + :class:`Window` instance. + :param visible_line_to_row_col: Mapping that maps the row numbers on the + displayed screen (starting from zero for the first visible line) to + (row, col) tuples pointing to the row and column of the :class:`.UIContent`. + :param rowcol_to_yx: Mapping that maps (row, column) tuples representing + coordinates of the :class:`UIContent` to (y, x) absolute coordinates at + the rendered screen. + """ + + def __init__( + self, + window: Window, + ui_content: UIContent, + horizontal_scroll: int, + vertical_scroll: int, + window_width: int, + window_height: int, + configured_scroll_offsets: ScrollOffsets, + visible_line_to_row_col: dict[int, tuple[int, int]], + rowcol_to_yx: dict[tuple[int, int], tuple[int, int]], + x_offset: int, + y_offset: int, + wrap_lines: bool, + ) -> None: + self.window = window + self.ui_content = ui_content + self.vertical_scroll = vertical_scroll + self.window_width = window_width # Width without margins. + self.window_height = window_height + + self.configured_scroll_offsets = configured_scroll_offsets + self.visible_line_to_row_col = visible_line_to_row_col + self.wrap_lines = wrap_lines + + self._rowcol_to_yx = rowcol_to_yx # row/col from input to absolute y/x + # screen coordinates. + self._x_offset = x_offset + self._y_offset = y_offset + + @property + def visible_line_to_input_line(self) -> dict[int, int]: + return { + visible_line: rowcol[0] + for visible_line, rowcol in self.visible_line_to_row_col.items() + } + + @property + def cursor_position(self) -> Point: + """ + Return the cursor position coordinates, relative to the left/top corner + of the rendered screen. + """ + cpos = self.ui_content.cursor_position + try: + y, x = self._rowcol_to_yx[cpos.y, cpos.x] + except KeyError: + # For `DummyControl` for instance, the content can be empty, and so + # will `_rowcol_to_yx` be. Return 0/0 by default. + return Point(x=0, y=0) + else: + return Point(x=x - self._x_offset, y=y - self._y_offset) + + @property + def applied_scroll_offsets(self) -> ScrollOffsets: + """ + Return a :class:`.ScrollOffsets` instance that indicates the actual + offset. This can be less than or equal to what's configured. E.g, when + the cursor is completely at the top, the top offset will be zero rather + than what's configured. + """ + if self.displayed_lines[0] == 0: + top = 0 + else: + # Get row where the cursor is displayed. + y = self.input_line_to_visible_line[self.ui_content.cursor_position.y] + top = min(y, self.configured_scroll_offsets.top) + + return ScrollOffsets( + top=top, + bottom=min( + self.ui_content.line_count - self.displayed_lines[-1] - 1, + self.configured_scroll_offsets.bottom, + ), + # For left/right, it probably doesn't make sense to return something. + # (We would have to calculate the widths of all the lines and keep + # double width characters in mind.) + left=0, + right=0, + ) + + @property + def displayed_lines(self) -> list[int]: + """ + List of all the visible rows. (Line numbers of the input buffer.) + The last line may not be entirely visible. + """ + return sorted(row for row, col in self.visible_line_to_row_col.values()) + + @property + def input_line_to_visible_line(self) -> dict[int, int]: + """ + Return the dictionary mapping the line numbers of the input buffer to + the lines of the screen. When a line spans several rows at the screen, + the first row appears in the dictionary. + """ + result: dict[int, int] = {} + for k, v in self.visible_line_to_input_line.items(): + if v in result: + result[v] = min(result[v], k) + else: + result[v] = k + return result + + def first_visible_line(self, after_scroll_offset: bool = False) -> int: + """ + Return the line number (0 based) of the input document that corresponds + with the first visible line. + """ + if after_scroll_offset: + return self.displayed_lines[self.applied_scroll_offsets.top] + else: + return self.displayed_lines[0] + + def last_visible_line(self, before_scroll_offset: bool = False) -> int: + """ + Like `first_visible_line`, but for the last visible line. + """ + if before_scroll_offset: + return self.displayed_lines[-1 - self.applied_scroll_offsets.bottom] + else: + return self.displayed_lines[-1] + + def center_visible_line( + self, before_scroll_offset: bool = False, after_scroll_offset: bool = False + ) -> int: + """ + Like `first_visible_line`, but for the center visible line. + """ + return ( + self.first_visible_line(after_scroll_offset) + + ( + self.last_visible_line(before_scroll_offset) + - self.first_visible_line(after_scroll_offset) + ) + // 2 + ) + + @property + def content_height(self) -> int: + """ + The full height of the user control. + """ + return self.ui_content.line_count + + @property + def full_height_visible(self) -> bool: + """ + True when the full height is visible (There is no vertical scroll.) + """ + return ( + self.vertical_scroll == 0 + and self.last_visible_line() == self.content_height + ) + + @property + def top_visible(self) -> bool: + """ + True when the top of the buffer is visible. + """ + return self.vertical_scroll == 0 + + @property + def bottom_visible(self) -> bool: + """ + True when the bottom of the buffer is visible. + """ + return self.last_visible_line() == self.content_height - 1 + + @property + def vertical_scroll_percentage(self) -> int: + """ + Vertical scroll as a percentage. (0 means: the top is visible, + 100 means: the bottom is visible.) + """ + if self.bottom_visible: + return 100 + else: + return 100 * self.vertical_scroll // self.content_height + + def get_height_for_line(self, lineno: int) -> int: + """ + Return the height of the given line. + (The height that it would take, if this line became visible.) + """ + if self.wrap_lines: + return self.ui_content.get_height_for_line( + lineno, self.window_width, self.window.get_line_prefix + ) + else: + return 1 + + +class ScrollOffsets: + """ + Scroll offsets for the :class:`.Window` class. + + Note that left/right offsets only make sense if line wrapping is disabled. + """ + + def __init__( + self, + top: int | Callable[[], int] = 0, + bottom: int | Callable[[], int] = 0, + left: int | Callable[[], int] = 0, + right: int | Callable[[], int] = 0, + ) -> None: + self._top = top + self._bottom = bottom + self._left = left + self._right = right + + @property + def top(self) -> int: + return to_int(self._top) + + @property + def bottom(self) -> int: + return to_int(self._bottom) + + @property + def left(self) -> int: + return to_int(self._left) + + @property + def right(self) -> int: + return to_int(self._right) + + def __repr__(self) -> str: + return "ScrollOffsets(top={!r}, bottom={!r}, left={!r}, right={!r})".format( + self._top, + self._bottom, + self._left, + self._right, + ) + + +class ColorColumn: + """ + Column for a :class:`.Window` to be colored. + """ + + def __init__(self, position: int, style: str = "class:color-column") -> None: + self.position = position + self.style = style + + +_in_insert_mode = vi_insert_mode | emacs_insert_mode + + +class WindowAlign(Enum): + """ + Alignment of the Window content. + + Note that this is different from `HorizontalAlign` and `VerticalAlign`, + which are used for the alignment of the child containers in respectively + `VSplit` and `HSplit`. + """ + + LEFT = "LEFT" + RIGHT = "RIGHT" + CENTER = "CENTER" + + +class Window(Container): + """ + Container that holds a control. + + :param content: :class:`.UIControl` instance. + :param width: :class:`.Dimension` instance or callable. + :param height: :class:`.Dimension` instance or callable. + :param z_index: When specified, this can be used to bring element in front + of floating elements. + :param dont_extend_width: When `True`, don't take up more width then the + preferred width reported by the control. + :param dont_extend_height: When `True`, don't take up more width then the + preferred height reported by the control. + :param ignore_content_width: A `bool` or :class:`.Filter` instance. Ignore + the :class:`.UIContent` width when calculating the dimensions. + :param ignore_content_height: A `bool` or :class:`.Filter` instance. Ignore + the :class:`.UIContent` height when calculating the dimensions. + :param left_margins: A list of :class:`.Margin` instance to be displayed on + the left. For instance: :class:`~prompt_toolkit.layout.NumberedMargin` + can be one of them in order to show line numbers. + :param right_margins: Like `left_margins`, but on the other side. + :param scroll_offsets: :class:`.ScrollOffsets` instance, representing the + preferred amount of lines/columns to be always visible before/after the + cursor. When both top and bottom are a very high number, the cursor + will be centered vertically most of the time. + :param allow_scroll_beyond_bottom: A `bool` or + :class:`.Filter` instance. When True, allow scrolling so far, that the + top part of the content is not visible anymore, while there is still + empty space available at the bottom of the window. In the Vi editor for + instance, this is possible. You will see tildes while the top part of + the body is hidden. + :param wrap_lines: A `bool` or :class:`.Filter` instance. When True, don't + scroll horizontally, but wrap lines instead. + :param get_vertical_scroll: Callable that takes this window + instance as input and returns a preferred vertical scroll. + (When this is `None`, the scroll is only determined by the last and + current cursor position.) + :param get_horizontal_scroll: Callable that takes this window + instance as input and returns a preferred vertical scroll. + :param always_hide_cursor: A `bool` or + :class:`.Filter` instance. When True, never display the cursor, even + when the user control specifies a cursor position. + :param cursorline: A `bool` or :class:`.Filter` instance. When True, + display a cursorline. + :param cursorcolumn: A `bool` or :class:`.Filter` instance. When True, + display a cursorcolumn. + :param colorcolumns: A list of :class:`.ColorColumn` instances that + describe the columns to be highlighted, or a callable that returns such + a list. + :param align: :class:`.WindowAlign` value or callable that returns an + :class:`.WindowAlign` value. alignment of content. + :param style: A style string. Style to be applied to all the cells in this + window. (This can be a callable that returns a string.) + :param char: (string) Character to be used for filling the background. This + can also be a callable that returns a character. + :param get_line_prefix: None or a callable that returns formatted text to + be inserted before a line. It takes a line number (int) and a + wrap_count and returns formatted text. This can be used for + implementation of line continuations, things like Vim "breakindent" and + so on. + """ + + def __init__( + self, + content: UIControl | None = None, + width: AnyDimension = None, + height: AnyDimension = None, + z_index: int | None = None, + dont_extend_width: FilterOrBool = False, + dont_extend_height: FilterOrBool = False, + ignore_content_width: FilterOrBool = False, + ignore_content_height: FilterOrBool = False, + left_margins: Sequence[Margin] | None = None, + right_margins: Sequence[Margin] | None = None, + scroll_offsets: ScrollOffsets | None = None, + allow_scroll_beyond_bottom: FilterOrBool = False, + wrap_lines: FilterOrBool = False, + get_vertical_scroll: Callable[[Window], int] | None = None, + get_horizontal_scroll: Callable[[Window], int] | None = None, + always_hide_cursor: FilterOrBool = False, + cursorline: FilterOrBool = False, + cursorcolumn: FilterOrBool = False, + colorcolumns: ( + None | list[ColorColumn] | Callable[[], list[ColorColumn]] + ) = None, + align: WindowAlign | Callable[[], WindowAlign] = WindowAlign.LEFT, + style: str | Callable[[], str] = "", + char: None | str | Callable[[], str] = None, + get_line_prefix: GetLinePrefixCallable | None = None, + ) -> None: + self.allow_scroll_beyond_bottom = to_filter(allow_scroll_beyond_bottom) + self.always_hide_cursor = to_filter(always_hide_cursor) + self.wrap_lines = to_filter(wrap_lines) + self.cursorline = to_filter(cursorline) + self.cursorcolumn = to_filter(cursorcolumn) + + self.content = content or DummyControl() + self.dont_extend_width = to_filter(dont_extend_width) + self.dont_extend_height = to_filter(dont_extend_height) + self.ignore_content_width = to_filter(ignore_content_width) + self.ignore_content_height = to_filter(ignore_content_height) + self.left_margins = left_margins or [] + self.right_margins = right_margins or [] + self.scroll_offsets = scroll_offsets or ScrollOffsets() + self.get_vertical_scroll = get_vertical_scroll + self.get_horizontal_scroll = get_horizontal_scroll + self.colorcolumns = colorcolumns or [] + self.align = align + self.style = style + self.char = char + self.get_line_prefix = get_line_prefix + + self.width = width + self.height = height + self.z_index = z_index + + # Cache for the screens generated by the margin. + self._ui_content_cache: SimpleCache[ + tuple[int, int, int], UIContent + ] = SimpleCache(maxsize=8) + self._margin_width_cache: SimpleCache[tuple[Margin, int], int] = SimpleCache( + maxsize=1 + ) + + self.reset() + + def __repr__(self) -> str: + return "Window(content=%r)" % self.content + + def reset(self) -> None: + self.content.reset() + + #: Scrolling position of the main content. + self.vertical_scroll = 0 + self.horizontal_scroll = 0 + + # Vertical scroll 2: this is the vertical offset that a line is + # scrolled if a single line (the one that contains the cursor) consumes + # all of the vertical space. + self.vertical_scroll_2 = 0 + + #: Keep render information (mappings between buffer input and render + #: output.) + self.render_info: WindowRenderInfo | None = None + + def _get_margin_width(self, margin: Margin) -> int: + """ + Return the width for this margin. + (Calculate only once per render time.) + """ + + # Margin.get_width, needs to have a UIContent instance. + def get_ui_content() -> UIContent: + return self._get_ui_content(width=0, height=0) + + def get_width() -> int: + return margin.get_width(get_ui_content) + + key = (margin, get_app().render_counter) + return self._margin_width_cache.get(key, get_width) + + def _get_total_margin_width(self) -> int: + """ + Calculate and return the width of the margin (left + right). + """ + return sum(self._get_margin_width(m) for m in self.left_margins) + sum( + self._get_margin_width(m) for m in self.right_margins + ) + + def preferred_width(self, max_available_width: int) -> Dimension: + """ + Calculate the preferred width for this window. + """ + + def preferred_content_width() -> int | None: + """Content width: is only calculated if no exact width for the + window was given.""" + if self.ignore_content_width(): + return None + + # Calculate the width of the margin. + total_margin_width = self._get_total_margin_width() + + # Window of the content. (Can be `None`.) + preferred_width = self.content.preferred_width( + max_available_width - total_margin_width + ) + + if preferred_width is not None: + # Include width of the margins. + preferred_width += total_margin_width + return preferred_width + + # Merge. + return self._merge_dimensions( + dimension=to_dimension(self.width), + get_preferred=preferred_content_width, + dont_extend=self.dont_extend_width(), + ) + + def preferred_height(self, width: int, max_available_height: int) -> Dimension: + """ + Calculate the preferred height for this window. + """ + + def preferred_content_height() -> int | None: + """Content height: is only calculated if no exact height for the + window was given.""" + if self.ignore_content_height(): + return None + + total_margin_width = self._get_total_margin_width() + wrap_lines = self.wrap_lines() + + return self.content.preferred_height( + width - total_margin_width, + max_available_height, + wrap_lines, + self.get_line_prefix, + ) + + return self._merge_dimensions( + dimension=to_dimension(self.height), + get_preferred=preferred_content_height, + dont_extend=self.dont_extend_height(), + ) + + @staticmethod + def _merge_dimensions( + dimension: Dimension | None, + get_preferred: Callable[[], int | None], + dont_extend: bool = False, + ) -> Dimension: + """ + Take the Dimension from this `Window` class and the received preferred + size from the `UIControl` and return a `Dimension` to report to the + parent container. + """ + dimension = dimension or Dimension() + + # When a preferred dimension was explicitly given to the Window, + # ignore the UIControl. + preferred: int | None + + if dimension.preferred_specified: + preferred = dimension.preferred + else: + # Otherwise, calculate the preferred dimension from the UI control + # content. + preferred = get_preferred() + + # When a 'preferred' dimension is given by the UIControl, make sure + # that it stays within the bounds of the Window. + if preferred is not None: + if dimension.max_specified: + preferred = min(preferred, dimension.max) + + if dimension.min_specified: + preferred = max(preferred, dimension.min) + + # When a `dont_extend` flag has been given, use the preferred dimension + # also as the max dimension. + max_: int | None + min_: int | None + + if dont_extend and preferred is not None: + max_ = min(dimension.max, preferred) + else: + max_ = dimension.max if dimension.max_specified else None + + min_ = dimension.min if dimension.min_specified else None + + return Dimension( + min=min_, max=max_, preferred=preferred, weight=dimension.weight + ) + + def _get_ui_content(self, width: int, height: int) -> UIContent: + """ + Create a `UIContent` instance. + """ + + def get_content() -> UIContent: + return self.content.create_content(width=width, height=height) + + key = (get_app().render_counter, width, height) + return self._ui_content_cache.get(key, get_content) + + def _get_digraph_char(self) -> str | None: + "Return `False`, or the Digraph symbol to be used." + app = get_app() + if app.quoted_insert: + return "^" + if app.vi_state.waiting_for_digraph: + if app.vi_state.digraph_symbol1: + return app.vi_state.digraph_symbol1 + return "?" + return None + + def write_to_screen( + self, + screen: Screen, + mouse_handlers: MouseHandlers, + write_position: WritePosition, + parent_style: str, + erase_bg: bool, + z_index: int | None, + ) -> None: + """ + Write window to screen. This renders the user control, the margins and + copies everything over to the absolute position at the given screen. + """ + # If dont_extend_width/height was given. Then reduce width/height in + # WritePosition if the parent wanted us to paint in a bigger area. + # (This happens if this window is bundled with another window in a + # HSplit/VSplit, but with different size requirements.) + write_position = WritePosition( + xpos=write_position.xpos, + ypos=write_position.ypos, + width=write_position.width, + height=write_position.height, + ) + + if self.dont_extend_width(): + write_position.width = min( + write_position.width, + self.preferred_width(write_position.width).preferred, + ) + + if self.dont_extend_height(): + write_position.height = min( + write_position.height, + self.preferred_height( + write_position.width, write_position.height + ).preferred, + ) + + # Draw + z_index = z_index if self.z_index is None else self.z_index + + draw_func = partial( + self._write_to_screen_at_index, + screen, + mouse_handlers, + write_position, + parent_style, + erase_bg, + ) + + if z_index is None or z_index <= 0: + # When no z_index is given, draw right away. + draw_func() + else: + # Otherwise, postpone. + screen.draw_with_z_index(z_index=z_index, draw_func=draw_func) + + def _write_to_screen_at_index( + self, + screen: Screen, + mouse_handlers: MouseHandlers, + write_position: WritePosition, + parent_style: str, + erase_bg: bool, + ) -> None: + # Don't bother writing invisible windows. + # (We save some time, but also avoid applying last-line styling.) + if write_position.height <= 0 or write_position.width <= 0: + return + + # Calculate margin sizes. + left_margin_widths = [self._get_margin_width(m) for m in self.left_margins] + right_margin_widths = [self._get_margin_width(m) for m in self.right_margins] + total_margin_width = sum(left_margin_widths + right_margin_widths) + + # Render UserControl. + ui_content = self.content.create_content( + write_position.width - total_margin_width, write_position.height + ) + assert isinstance(ui_content, UIContent) + + # Scroll content. + wrap_lines = self.wrap_lines() + self._scroll( + ui_content, write_position.width - total_margin_width, write_position.height + ) + + # Erase background and fill with `char`. + self._fill_bg(screen, write_position, erase_bg) + + # Resolve `align` attribute. + align = self.align() if callable(self.align) else self.align + + # Write body + visible_line_to_row_col, rowcol_to_yx = self._copy_body( + ui_content, + screen, + write_position, + sum(left_margin_widths), + write_position.width - total_margin_width, + self.vertical_scroll, + self.horizontal_scroll, + wrap_lines=wrap_lines, + highlight_lines=True, + vertical_scroll_2=self.vertical_scroll_2, + always_hide_cursor=self.always_hide_cursor(), + has_focus=get_app().layout.current_control == self.content, + align=align, + get_line_prefix=self.get_line_prefix, + ) + + # Remember render info. (Set before generating the margins. They need this.) + x_offset = write_position.xpos + sum(left_margin_widths) + y_offset = write_position.ypos + + render_info = WindowRenderInfo( + window=self, + ui_content=ui_content, + horizontal_scroll=self.horizontal_scroll, + vertical_scroll=self.vertical_scroll, + window_width=write_position.width - total_margin_width, + window_height=write_position.height, + configured_scroll_offsets=self.scroll_offsets, + visible_line_to_row_col=visible_line_to_row_col, + rowcol_to_yx=rowcol_to_yx, + x_offset=x_offset, + y_offset=y_offset, + wrap_lines=wrap_lines, + ) + self.render_info = render_info + + # Set mouse handlers. + def mouse_handler(mouse_event: MouseEvent) -> NotImplementedOrNone: + """ + Wrapper around the mouse_handler of the `UIControl` that turns + screen coordinates into line coordinates. + Returns `NotImplemented` if no UI invalidation should be done. + """ + # Don't handle mouse events outside of the current modal part of + # the UI. + if self not in get_app().layout.walk_through_modal_area(): + return NotImplemented + + # Find row/col position first. + yx_to_rowcol = {v: k for k, v in rowcol_to_yx.items()} + y = mouse_event.position.y + x = mouse_event.position.x + + # If clicked below the content area, look for a position in the + # last line instead. + max_y = write_position.ypos + len(visible_line_to_row_col) - 1 + y = min(max_y, y) + result: NotImplementedOrNone + + while x >= 0: + try: + row, col = yx_to_rowcol[y, x] + except KeyError: + # Try again. (When clicking on the right side of double + # width characters, or on the right side of the input.) + x -= 1 + else: + # Found position, call handler of UIControl. + result = self.content.mouse_handler( + MouseEvent( + position=Point(x=col, y=row), + event_type=mouse_event.event_type, + button=mouse_event.button, + modifiers=mouse_event.modifiers, + ) + ) + break + else: + # nobreak. + # (No x/y coordinate found for the content. This happens in + # case of a DummyControl, that does not have any content. + # Report (0,0) instead.) + result = self.content.mouse_handler( + MouseEvent( + position=Point(x=0, y=0), + event_type=mouse_event.event_type, + button=mouse_event.button, + modifiers=mouse_event.modifiers, + ) + ) + + # If it returns NotImplemented, handle it here. + if result == NotImplemented: + result = self._mouse_handler(mouse_event) + + return result + + mouse_handlers.set_mouse_handler_for_range( + x_min=write_position.xpos + sum(left_margin_widths), + x_max=write_position.xpos + write_position.width - total_margin_width, + y_min=write_position.ypos, + y_max=write_position.ypos + write_position.height, + handler=mouse_handler, + ) + + # Render and copy margins. + move_x = 0 + + def render_margin(m: Margin, width: int) -> UIContent: + "Render margin. Return `Screen`." + # Retrieve margin fragments. + fragments = m.create_margin(render_info, width, write_position.height) + + # Turn it into a UIContent object. + # already rendered those fragments using this size.) + return FormattedTextControl(fragments).create_content( + width + 1, write_position.height + ) + + for m, width in zip(self.left_margins, left_margin_widths): + if width > 0: # (ConditionalMargin returns a zero width. -- Don't render.) + # Create screen for margin. + margin_content = render_margin(m, width) + + # Copy and shift X. + self._copy_margin(margin_content, screen, write_position, move_x, width) + move_x += width + + move_x = write_position.width - sum(right_margin_widths) + + for m, width in zip(self.right_margins, right_margin_widths): + # Create screen for margin. + margin_content = render_margin(m, width) + + # Copy and shift X. + self._copy_margin(margin_content, screen, write_position, move_x, width) + move_x += width + + # Apply 'self.style' + self._apply_style(screen, write_position, parent_style) + + # Tell the screen that this user control has been painted at this + # position. + screen.visible_windows_to_write_positions[self] = write_position + + def _copy_body( + self, + ui_content: UIContent, + new_screen: Screen, + write_position: WritePosition, + move_x: int, + width: int, + vertical_scroll: int = 0, + horizontal_scroll: int = 0, + wrap_lines: bool = False, + highlight_lines: bool = False, + vertical_scroll_2: int = 0, + always_hide_cursor: bool = False, + has_focus: bool = False, + align: WindowAlign = WindowAlign.LEFT, + get_line_prefix: Callable[[int, int], AnyFormattedText] | None = None, + ) -> tuple[dict[int, tuple[int, int]], dict[tuple[int, int], tuple[int, int]]]: + """ + Copy the UIContent into the output screen. + Return (visible_line_to_row_col, rowcol_to_yx) tuple. + + :param get_line_prefix: None or a callable that takes a line number + (int) and a wrap_count (int) and returns formatted text. + """ + xpos = write_position.xpos + move_x + ypos = write_position.ypos + line_count = ui_content.line_count + new_buffer = new_screen.data_buffer + empty_char = _CHAR_CACHE["", ""] + + # Map visible line number to (row, col) of input. + # 'col' will always be zero if line wrapping is off. + visible_line_to_row_col: dict[int, tuple[int, int]] = {} + + # Maps (row, col) from the input to (y, x) screen coordinates. + rowcol_to_yx: dict[tuple[int, int], tuple[int, int]] = {} + + def copy_line( + line: StyleAndTextTuples, + lineno: int, + x: int, + y: int, + is_input: bool = False, + ) -> tuple[int, int]: + """ + Copy over a single line to the output screen. This can wrap over + multiple lines in the output. It will call the prefix (prompt) + function before every line. + """ + if is_input: + current_rowcol_to_yx = rowcol_to_yx + else: + current_rowcol_to_yx = {} # Throwaway dictionary. + + # Draw line prefix. + if is_input and get_line_prefix: + prompt = to_formatted_text(get_line_prefix(lineno, 0)) + x, y = copy_line(prompt, lineno, x, y, is_input=False) + + # Scroll horizontally. + skipped = 0 # Characters skipped because of horizontal scrolling. + if horizontal_scroll and is_input: + h_scroll = horizontal_scroll + line = explode_text_fragments(line) + while h_scroll > 0 and line: + h_scroll -= get_cwidth(line[0][1]) + skipped += 1 + del line[:1] # Remove first character. + + x -= h_scroll # When scrolling over double width character, + # this can end up being negative. + + # Align this line. (Note that this doesn't work well when we use + # get_line_prefix and that function returns variable width prefixes.) + if align == WindowAlign.CENTER: + line_width = fragment_list_width(line) + if line_width < width: + x += (width - line_width) // 2 + elif align == WindowAlign.RIGHT: + line_width = fragment_list_width(line) + if line_width < width: + x += width - line_width + + col = 0 + wrap_count = 0 + for style, text, *_ in line: + new_buffer_row = new_buffer[y + ypos] + + # Remember raw VT escape sequences. (E.g. FinalTerm's + # escape sequences.) + if "[ZeroWidthEscape]" in style: + new_screen.zero_width_escapes[y + ypos][x + xpos] += text + continue + + for c in text: + char = _CHAR_CACHE[c, style] + char_width = char.width + + # Wrap when the line width is exceeded. + if wrap_lines and x + char_width > width: + visible_line_to_row_col[y + 1] = ( + lineno, + visible_line_to_row_col[y][1] + x, + ) + y += 1 + wrap_count += 1 + x = 0 + + # Insert line prefix (continuation prompt). + if is_input and get_line_prefix: + prompt = to_formatted_text( + get_line_prefix(lineno, wrap_count) + ) + x, y = copy_line(prompt, lineno, x, y, is_input=False) + + new_buffer_row = new_buffer[y + ypos] + + if y >= write_position.height: + return x, y # Break out of all for loops. + + # Set character in screen and shift 'x'. + if x >= 0 and y >= 0 and x < width: + new_buffer_row[x + xpos] = char + + # When we print a multi width character, make sure + # to erase the neighbors positions in the screen. + # (The empty string if different from everything, + # so next redraw this cell will repaint anyway.) + if char_width > 1: + for i in range(1, char_width): + new_buffer_row[x + xpos + i] = empty_char + + # If this is a zero width characters, then it's + # probably part of a decomposed unicode character. + # See: https://en.wikipedia.org/wiki/Unicode_equivalence + # Merge it in the previous cell. + elif char_width == 0: + # Handle all character widths. If the previous + # character is a multiwidth character, then + # merge it two positions back. + for pw in [2, 1]: # Previous character width. + if ( + x - pw >= 0 + and new_buffer_row[x + xpos - pw].width == pw + ): + prev_char = new_buffer_row[x + xpos - pw] + char2 = _CHAR_CACHE[ + prev_char.char + c, prev_char.style + ] + new_buffer_row[x + xpos - pw] = char2 + + # Keep track of write position for each character. + current_rowcol_to_yx[lineno, col + skipped] = ( + y + ypos, + x + xpos, + ) + + col += 1 + x += char_width + return x, y + + # Copy content. + def copy() -> int: + y = -vertical_scroll_2 + lineno = vertical_scroll + + while y < write_position.height and lineno < line_count: + # Take the next line and copy it in the real screen. + line = ui_content.get_line(lineno) + + visible_line_to_row_col[y] = (lineno, horizontal_scroll) + + # Copy margin and actual line. + x = 0 + x, y = copy_line(line, lineno, x, y, is_input=True) + + lineno += 1 + y += 1 + return y + + copy() + + def cursor_pos_to_screen_pos(row: int, col: int) -> Point: + "Translate row/col from UIContent to real Screen coordinates." + try: + y, x = rowcol_to_yx[row, col] + except KeyError: + # Normally this should never happen. (It is a bug, if it happens.) + # But to be sure, return (0, 0) + return Point(x=0, y=0) + + # raise ValueError( + # 'Invalid position. row=%r col=%r, vertical_scroll=%r, ' + # 'horizontal_scroll=%r, height=%r' % + # (row, col, vertical_scroll, horizontal_scroll, write_position.height)) + else: + return Point(x=x, y=y) + + # Set cursor and menu positions. + if ui_content.cursor_position: + screen_cursor_position = cursor_pos_to_screen_pos( + ui_content.cursor_position.y, ui_content.cursor_position.x + ) + + if has_focus: + new_screen.set_cursor_position(self, screen_cursor_position) + + if always_hide_cursor: + new_screen.show_cursor = False + else: + new_screen.show_cursor = ui_content.show_cursor + + self._highlight_digraph(new_screen) + + if highlight_lines: + self._highlight_cursorlines( + new_screen, + screen_cursor_position, + xpos, + ypos, + width, + write_position.height, + ) + + # Draw input characters from the input processor queue. + if has_focus and ui_content.cursor_position: + self._show_key_processor_key_buffer(new_screen) + + # Set menu position. + if ui_content.menu_position: + new_screen.set_menu_position( + self, + cursor_pos_to_screen_pos( + ui_content.menu_position.y, ui_content.menu_position.x + ), + ) + + # Update output screen height. + new_screen.height = max(new_screen.height, ypos + write_position.height) + + return visible_line_to_row_col, rowcol_to_yx + + def _fill_bg( + self, screen: Screen, write_position: WritePosition, erase_bg: bool + ) -> None: + """ + Erase/fill the background. + (Useful for floats and when a `char` has been given.) + """ + char: str | None + if callable(self.char): + char = self.char() + else: + char = self.char + + if erase_bg or char: + wp = write_position + char_obj = _CHAR_CACHE[char or " ", ""] + + for y in range(wp.ypos, wp.ypos + wp.height): + row = screen.data_buffer[y] + for x in range(wp.xpos, wp.xpos + wp.width): + row[x] = char_obj + + def _apply_style( + self, new_screen: Screen, write_position: WritePosition, parent_style: str + ) -> None: + # Apply `self.style`. + style = parent_style + " " + to_str(self.style) + + new_screen.fill_area(write_position, style=style, after=False) + + # Apply the 'last-line' class to the last line of each Window. This can + # be used to apply an 'underline' to the user control. + wp = WritePosition( + write_position.xpos, + write_position.ypos + write_position.height - 1, + write_position.width, + 1, + ) + new_screen.fill_area(wp, "class:last-line", after=True) + + def _highlight_digraph(self, new_screen: Screen) -> None: + """ + When we are in Vi digraph mode, put a question mark underneath the + cursor. + """ + digraph_char = self._get_digraph_char() + if digraph_char: + cpos = new_screen.get_cursor_position(self) + new_screen.data_buffer[cpos.y][cpos.x] = _CHAR_CACHE[ + digraph_char, "class:digraph" + ] + + def _show_key_processor_key_buffer(self, new_screen: Screen) -> None: + """ + When the user is typing a key binding that consists of several keys, + display the last pressed key if the user is in insert mode and the key + is meaningful to be displayed. + E.g. Some people want to bind 'jj' to escape in Vi insert mode. But the + first 'j' needs to be displayed in order to get some feedback. + """ + app = get_app() + key_buffer = app.key_processor.key_buffer + + if key_buffer and _in_insert_mode() and not app.is_done: + # The textual data for the given key. (Can be a VT100 escape + # sequence.) + data = key_buffer[-1].data + + # Display only if this is a 1 cell width character. + if get_cwidth(data) == 1: + cpos = new_screen.get_cursor_position(self) + new_screen.data_buffer[cpos.y][cpos.x] = _CHAR_CACHE[ + data, "class:partial-key-binding" + ] + + def _highlight_cursorlines( + self, new_screen: Screen, cpos: Point, x: int, y: int, width: int, height: int + ) -> None: + """ + Highlight cursor row/column. + """ + cursor_line_style = " class:cursor-line " + cursor_column_style = " class:cursor-column " + + data_buffer = new_screen.data_buffer + + # Highlight cursor line. + if self.cursorline(): + row = data_buffer[cpos.y] + for x in range(x, x + width): + original_char = row[x] + row[x] = _CHAR_CACHE[ + original_char.char, original_char.style + cursor_line_style + ] + + # Highlight cursor column. + if self.cursorcolumn(): + for y2 in range(y, y + height): + row = data_buffer[y2] + original_char = row[cpos.x] + row[cpos.x] = _CHAR_CACHE[ + original_char.char, original_char.style + cursor_column_style + ] + + # Highlight color columns + colorcolumns = self.colorcolumns + if callable(colorcolumns): + colorcolumns = colorcolumns() + + for cc in colorcolumns: + assert isinstance(cc, ColorColumn) + column = cc.position + + if column < x + width: # Only draw when visible. + color_column_style = " " + cc.style + + for y2 in range(y, y + height): + row = data_buffer[y2] + original_char = row[column + x] + row[column + x] = _CHAR_CACHE[ + original_char.char, original_char.style + color_column_style + ] + + def _copy_margin( + self, + margin_content: UIContent, + new_screen: Screen, + write_position: WritePosition, + move_x: int, + width: int, + ) -> None: + """ + Copy characters from the margin screen to the real screen. + """ + xpos = write_position.xpos + move_x + ypos = write_position.ypos + + margin_write_position = WritePosition(xpos, ypos, width, write_position.height) + self._copy_body(margin_content, new_screen, margin_write_position, 0, width) + + def _scroll(self, ui_content: UIContent, width: int, height: int) -> None: + """ + Scroll body. Ensure that the cursor is visible. + """ + if self.wrap_lines(): + func = self._scroll_when_linewrapping + else: + func = self._scroll_without_linewrapping + + func(ui_content, width, height) + + def _scroll_when_linewrapping( + self, ui_content: UIContent, width: int, height: int + ) -> None: + """ + Scroll to make sure the cursor position is visible and that we maintain + the requested scroll offset. + + Set `self.horizontal_scroll/vertical_scroll`. + """ + scroll_offsets_bottom = self.scroll_offsets.bottom + scroll_offsets_top = self.scroll_offsets.top + + # We don't have horizontal scrolling. + self.horizontal_scroll = 0 + + def get_line_height(lineno: int) -> int: + return ui_content.get_height_for_line(lineno, width, self.get_line_prefix) + + # When there is no space, reset `vertical_scroll_2` to zero and abort. + # This can happen if the margin is bigger than the window width. + # Otherwise the text height will become "infinite" (a big number) and + # the copy_line will spend a huge amount of iterations trying to render + # nothing. + if width <= 0: + self.vertical_scroll = ui_content.cursor_position.y + self.vertical_scroll_2 = 0 + return + + # If the current line consumes more than the whole window height, + # then we have to scroll vertically inside this line. (We don't take + # the scroll offsets into account for this.) + # Also, ignore the scroll offsets in this case. Just set the vertical + # scroll to this line. + line_height = get_line_height(ui_content.cursor_position.y) + if line_height > height - scroll_offsets_top: + # Calculate the height of the text before the cursor (including + # line prefixes). + text_before_height = ui_content.get_height_for_line( + ui_content.cursor_position.y, + width, + self.get_line_prefix, + slice_stop=ui_content.cursor_position.x, + ) + + # Adjust scroll offset. + self.vertical_scroll = ui_content.cursor_position.y + self.vertical_scroll_2 = min( + text_before_height - 1, # Keep the cursor visible. + line_height + - height, # Avoid blank lines at the bottom when scrolling up again. + self.vertical_scroll_2, + ) + self.vertical_scroll_2 = max( + 0, text_before_height - height, self.vertical_scroll_2 + ) + return + else: + self.vertical_scroll_2 = 0 + + # Current line doesn't consume the whole height. Take scroll offsets into account. + def get_min_vertical_scroll() -> int: + # Make sure that the cursor line is not below the bottom. + # (Calculate how many lines can be shown between the cursor and the .) + used_height = 0 + prev_lineno = ui_content.cursor_position.y + + for lineno in range(ui_content.cursor_position.y, -1, -1): + used_height += get_line_height(lineno) + + if used_height > height - scroll_offsets_bottom: + return prev_lineno + else: + prev_lineno = lineno + return 0 + + def get_max_vertical_scroll() -> int: + # Make sure that the cursor line is not above the top. + prev_lineno = ui_content.cursor_position.y + used_height = 0 + + for lineno in range(ui_content.cursor_position.y - 1, -1, -1): + used_height += get_line_height(lineno) + + if used_height > scroll_offsets_top: + return prev_lineno + else: + prev_lineno = lineno + return prev_lineno + + def get_topmost_visible() -> int: + """ + Calculate the upper most line that can be visible, while the bottom + is still visible. We should not allow scroll more than this if + `allow_scroll_beyond_bottom` is false. + """ + prev_lineno = ui_content.line_count - 1 + used_height = 0 + for lineno in range(ui_content.line_count - 1, -1, -1): + used_height += get_line_height(lineno) + if used_height > height: + return prev_lineno + else: + prev_lineno = lineno + return prev_lineno + + # Scroll vertically. (Make sure that the whole line which contains the + # cursor is visible. + topmost_visible = get_topmost_visible() + + # Note: the `min(topmost_visible, ...)` is to make sure that we + # don't require scrolling up because of the bottom scroll offset, + # when we are at the end of the document. + self.vertical_scroll = max( + self.vertical_scroll, min(topmost_visible, get_min_vertical_scroll()) + ) + self.vertical_scroll = min(self.vertical_scroll, get_max_vertical_scroll()) + + # Disallow scrolling beyond bottom? + if not self.allow_scroll_beyond_bottom(): + self.vertical_scroll = min(self.vertical_scroll, topmost_visible) + + def _scroll_without_linewrapping( + self, ui_content: UIContent, width: int, height: int + ) -> None: + """ + Scroll to make sure the cursor position is visible and that we maintain + the requested scroll offset. + + Set `self.horizontal_scroll/vertical_scroll`. + """ + cursor_position = ui_content.cursor_position or Point(x=0, y=0) + + # Without line wrapping, we will never have to scroll vertically inside + # a single line. + self.vertical_scroll_2 = 0 + + if ui_content.line_count == 0: + self.vertical_scroll = 0 + self.horizontal_scroll = 0 + return + else: + current_line_text = fragment_list_to_text( + ui_content.get_line(cursor_position.y) + ) + + def do_scroll( + current_scroll: int, + scroll_offset_start: int, + scroll_offset_end: int, + cursor_pos: int, + window_size: int, + content_size: int, + ) -> int: + "Scrolling algorithm. Used for both horizontal and vertical scrolling." + # Calculate the scroll offset to apply. + # This can obviously never be more than have the screen size. Also, when the + # cursor appears at the top or bottom, we don't apply the offset. + scroll_offset_start = int( + min(scroll_offset_start, window_size / 2, cursor_pos) + ) + scroll_offset_end = int( + min(scroll_offset_end, window_size / 2, content_size - 1 - cursor_pos) + ) + + # Prevent negative scroll offsets. + if current_scroll < 0: + current_scroll = 0 + + # Scroll back if we scrolled to much and there's still space to show more of the document. + if ( + not self.allow_scroll_beyond_bottom() + and current_scroll > content_size - window_size + ): + current_scroll = max(0, content_size - window_size) + + # Scroll up if cursor is before visible part. + if current_scroll > cursor_pos - scroll_offset_start: + current_scroll = max(0, cursor_pos - scroll_offset_start) + + # Scroll down if cursor is after visible part. + if current_scroll < (cursor_pos + 1) - window_size + scroll_offset_end: + current_scroll = (cursor_pos + 1) - window_size + scroll_offset_end + + return current_scroll + + # When a preferred scroll is given, take that first into account. + if self.get_vertical_scroll: + self.vertical_scroll = self.get_vertical_scroll(self) + assert isinstance(self.vertical_scroll, int) + if self.get_horizontal_scroll: + self.horizontal_scroll = self.get_horizontal_scroll(self) + assert isinstance(self.horizontal_scroll, int) + + # Update horizontal/vertical scroll to make sure that the cursor + # remains visible. + offsets = self.scroll_offsets + + self.vertical_scroll = do_scroll( + current_scroll=self.vertical_scroll, + scroll_offset_start=offsets.top, + scroll_offset_end=offsets.bottom, + cursor_pos=ui_content.cursor_position.y, + window_size=height, + content_size=ui_content.line_count, + ) + + if self.get_line_prefix: + current_line_prefix_width = fragment_list_width( + to_formatted_text(self.get_line_prefix(ui_content.cursor_position.y, 0)) + ) + else: + current_line_prefix_width = 0 + + self.horizontal_scroll = do_scroll( + current_scroll=self.horizontal_scroll, + scroll_offset_start=offsets.left, + scroll_offset_end=offsets.right, + cursor_pos=get_cwidth(current_line_text[: ui_content.cursor_position.x]), + window_size=width - current_line_prefix_width, + # We can only analyze the current line. Calculating the width off + # all the lines is too expensive. + content_size=max( + get_cwidth(current_line_text), self.horizontal_scroll + width + ), + ) + + def _mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrNone: + """ + Mouse handler. Called when the UI control doesn't handle this + particular event. + + Return `NotImplemented` if nothing was done as a consequence of this + key binding (no UI invalidate required in that case). + """ + if mouse_event.event_type == MouseEventType.SCROLL_DOWN: + self._scroll_down() + return None + elif mouse_event.event_type == MouseEventType.SCROLL_UP: + self._scroll_up() + return None + + return NotImplemented + + def _scroll_down(self) -> None: + "Scroll window down." + info = self.render_info + + if info is None: + return + + if self.vertical_scroll < info.content_height - info.window_height: + if info.cursor_position.y <= info.configured_scroll_offsets.top: + self.content.move_cursor_down() + + self.vertical_scroll += 1 + + def _scroll_up(self) -> None: + "Scroll window up." + info = self.render_info + + if info is None: + return + + if info.vertical_scroll > 0: + # TODO: not entirely correct yet in case of line wrapping and long lines. + if ( + info.cursor_position.y + >= info.window_height - 1 - info.configured_scroll_offsets.bottom + ): + self.content.move_cursor_up() + + self.vertical_scroll -= 1 + + def get_key_bindings(self) -> KeyBindingsBase | None: + return self.content.get_key_bindings() + + def get_children(self) -> list[Container]: + return [] + + +class ConditionalContainer(Container): + """ + Wrapper around any other container that can change the visibility. The + received `filter` determines whether the given container should be + displayed or not. + + :param content: :class:`.Container` instance. + :param filter: :class:`.Filter` instance. + """ + + def __init__(self, content: AnyContainer, filter: FilterOrBool) -> None: + self.content = to_container(content) + self.filter = to_filter(filter) + + def __repr__(self) -> str: + return f"ConditionalContainer({self.content!r}, filter={self.filter!r})" + + def reset(self) -> None: + self.content.reset() + + def preferred_width(self, max_available_width: int) -> Dimension: + if self.filter(): + return self.content.preferred_width(max_available_width) + else: + return Dimension.zero() + + def preferred_height(self, width: int, max_available_height: int) -> Dimension: + if self.filter(): + return self.content.preferred_height(width, max_available_height) + else: + return Dimension.zero() + + def write_to_screen( + self, + screen: Screen, + mouse_handlers: MouseHandlers, + write_position: WritePosition, + parent_style: str, + erase_bg: bool, + z_index: int | None, + ) -> None: + if self.filter(): + return self.content.write_to_screen( + screen, mouse_handlers, write_position, parent_style, erase_bg, z_index + ) + + def get_children(self) -> list[Container]: + return [self.content] + + +class DynamicContainer(Container): + """ + Container class that dynamically returns any Container. + + :param get_container: Callable that returns a :class:`.Container` instance + or any widget with a ``__pt_container__`` method. + """ + + def __init__(self, get_container: Callable[[], AnyContainer]) -> None: + self.get_container = get_container + + def _get_container(self) -> Container: + """ + Return the current container object. + + We call `to_container`, because `get_container` can also return a + widget with a ``__pt_container__`` method. + """ + obj = self.get_container() + return to_container(obj) + + def reset(self) -> None: + self._get_container().reset() + + def preferred_width(self, max_available_width: int) -> Dimension: + return self._get_container().preferred_width(max_available_width) + + def preferred_height(self, width: int, max_available_height: int) -> Dimension: + return self._get_container().preferred_height(width, max_available_height) + + def write_to_screen( + self, + screen: Screen, + mouse_handlers: MouseHandlers, + write_position: WritePosition, + parent_style: str, + erase_bg: bool, + z_index: int | None, + ) -> None: + self._get_container().write_to_screen( + screen, mouse_handlers, write_position, parent_style, erase_bg, z_index + ) + + def is_modal(self) -> bool: + return False + + def get_key_bindings(self) -> KeyBindingsBase | None: + # Key bindings will be collected when `layout.walk()` finds the child + # container. + return None + + def get_children(self) -> list[Container]: + # Here we have to return the current active container itself, not its + # children. Otherwise, we run into issues where `layout.walk()` will + # never see an object of type `Window` if this contains a window. We + # can't/shouldn't proxy the "isinstance" check. + return [self._get_container()] + + +def to_container(container: AnyContainer) -> Container: + """ + Make sure that the given object is a :class:`.Container`. + """ + if isinstance(container, Container): + return container + elif hasattr(container, "__pt_container__"): + return to_container(container.__pt_container__()) + else: + raise ValueError(f"Not a container object: {container!r}") + + +def to_window(container: AnyContainer) -> Window: + """ + Make sure that the given argument is a :class:`.Window`. + """ + if isinstance(container, Window): + return container + elif hasattr(container, "__pt_container__"): + return to_window(cast("MagicContainer", container).__pt_container__()) + else: + raise ValueError(f"Not a Window object: {container!r}.") + + +def is_container(value: object) -> TypeGuard[AnyContainer]: + """ + Checks whether the given value is a container object + (for use in assert statements). + """ + if isinstance(value, Container): + return True + if hasattr(value, "__pt_container__"): + return is_container(cast("MagicContainer", value).__pt_container__()) + return False diff --git a/shared/package-files/9b/9bd651190e7e7bdb5e7769fbe6e1b223ca50ca3dabf18be7859269a5f8ac4902/blob b/shared/package-files/9b/9bd651190e7e7bdb5e7769fbe6e1b223ca50ca3dabf18be7859269a5f8ac4902/blob new file mode 100644 index 0000000000000000000000000000000000000000..3033e1c889e3187594fc085bc31f2de0f7eed04c --- /dev/null +++ b/shared/package-files/9b/9bd651190e7e7bdb5e7769fbe6e1b223ca50ca3dabf18be7859269a5f8ac4902/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor scatter_add(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src); +TORCH_API at::Tensor & scatter_add_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9b/9bd728c323621e89ceb5cc9dbcbd1f51fc8143360942133d863559b4adb00c90/blob b/shared/package-files/9b/9bd728c323621e89ceb5cc9dbcbd1f51fc8143360942133d863559b4adb00c90/blob new file mode 100644 index 0000000000000000000000000000000000000000..cda4c0a33553fa095969db6e3f5aaaaa2ef36382 --- /dev/null +++ b/shared/package-files/9b/9bd728c323621e89ceb5cc9dbcbd1f51fc8143360942133d863559b4adb00c90/blob @@ -0,0 +1,221 @@ +import unittest +import linecache +import inspect +import textwrap + +from numba import njit +from numba.tests.support import TestCase +from numba.misc.firstlinefinder import get_func_body_first_lineno + + +class TestFirstLineFinder(TestCase): + """ + The following methods contains tests that are sensitive to the source + locations w.r.t. the beginning of each method. + """ + + def _get_grandparent_caller_code(self): + frame = inspect.currentframe() + caller_frame = inspect.getouterframes(frame) + return caller_frame[2].frame.f_code + + def assert_line_location(self, expected, offset_from_caller): + grandparent_co = self._get_grandparent_caller_code() + lno = grandparent_co.co_firstlineno + self.assertEqual(expected, lno + offset_from_caller) + + def test_decorated_odd_comment_indent(self): + @njit + def foo(): +# NOTE: THIS COMMENT MUST START AT COLUMN 0 FOR THIS SAMPLE CODE TO BE VALID # noqa: E115, E501 + return 1 + + first_def_line = get_func_body_first_lineno(foo) + self.assert_line_location(first_def_line, 4) + + def test_undecorated_odd_comment_indent(self): + def foo(): +# NOTE: THIS COMMENT MUST START AT COLUMN 0 FOR THIS SAMPLE CODE TO BE VALID # noqa: E115, E501 + return 1 + + first_def_line = get_func_body_first_lineno(njit(foo)) + self.assert_line_location(first_def_line, 3) + + def test_unnamed_lambda(self): + foo = lambda: 1 + first_def_line = get_func_body_first_lineno(njit(foo)) + # Cannot determine first line of lambda function + self.assertIsNone(first_def_line) + + def test_nested_function(self): + def foo(): + @njit + def foo(): + # This function is intentionally named the same as the parent + return 1 + + return foo + + inner = foo() + first_def_line = get_func_body_first_lineno(inner) + self.assert_line_location(first_def_line, 5) + + def test_pass_statement(self): + @njit + def foo(): + pass + + first_def_line = get_func_body_first_lineno(foo) + self.assert_line_location(first_def_line, 3) + + def test_string_eval(self): + source = """def foo(): + pass + """ + + globalns = {} + exec(source, globalns) + foo = globalns['foo'] + + first_def_line = get_func_body_first_lineno(foo) + # Cannot determine first line of string evaled functions + self.assertIsNone(first_def_line) + + def _test_with_patched_linecache(self, filename, source, + function_name, expected_first_line): + # Modify the line cache in a similar manner to Jupyter, so that + # get_func_body_first_lineno can find the code using the fallback to + # inspect.getsourcelines() + timestamp = None + entry = (len(source), timestamp, source.splitlines(True), filename) + linecache.cache[filename] = entry + + # We need to compile the code so we can give it the fake filename used + # in the linecache + code = compile(source, filename, "exec") + + globalns = {} + exec(code, globalns) + function = globalns[function_name] + + # We should be able to determine the first line number even though the + # source does not exist on disk + first_def_line = get_func_body_first_lineno(function) + self.assertEqual(first_def_line, expected_first_line) + + def test_string_eval_linecache_basic(self): + source = """def foo(): + pass + """ + + filename = "" + function_name = "foo" + expected_first_line = 2 + self._test_with_patched_linecache(filename, source, function_name, + expected_first_line) + + def test_string_eval_linecache_indent(self): + source = """if True: + # indent designed to test against potential indent error in ast.parse + + def foo(): + pass + """ + + filename = "" + function_name = "foo" + expected_first_line = 5 + self._test_with_patched_linecache(filename, source, function_name, + expected_first_line) + + def test_string_eval_linecache_closure(self): + source = textwrap.dedent(""" + def foo_gen(): + def foo(): + pass + return foo + + generated_foo = foo_gen() + """) + + filename = "" + function_name = "generated_foo" + expected_first_line = 4 + self._test_with_patched_linecache(filename, source, function_name, + expected_first_line) + + def test_string_eval_linecache_stacked_decorators(self): + source = textwrap.dedent(""" + def decorator(function): + return function + + @decorator + @decorator + @decorator + def decorated(): + pass + """) + + filename = "" + function_name = "decorated" + expected_first_line = 9 + self._test_with_patched_linecache(filename, source, function_name, + expected_first_line) + + def test_string_eval_linecache_all(self): + # A test combining indented code, a closure, and stacked decorators + source = """if 1: + def decorator(function): + return function + + def gen_decorated_foo(): + @decorator + @decorator + @decorator + def _foo(): + pass + + return _foo + + foo_all = gen_decorated_foo() + """ + + filename = "" + function_name = "foo_all" + expected_first_line = 10 + self._test_with_patched_linecache(filename, source, function_name, + expected_first_line) + + def test_single_line_function(self): + @njit + def foo(): pass # noqa: E704 + + first_def_line = get_func_body_first_lineno(foo) + self.assert_line_location(first_def_line, 2) + + def test_docstring(self): + @njit + def foo(): + """Docstring + """ + pass + + first_def_line = get_func_body_first_lineno(foo) + self.assert_line_location(first_def_line, 5) + + def test_docstring_2(self): + @njit + def foo(): + """Docstring + """ + """Not Docstring, but a bare string literal + """ + pass + # Variation on test_docstring but with a "fake" docstring following + # the true docstring. + first_def_line = get_func_body_first_lineno(foo) + self.assert_line_location(first_def_line, 5) + + +if __name__ == "__main__": + unittest.main() diff --git a/shared/package-files/9b/9bd84381f8a954dd1c4cf6b2ca40bb6ee13c9663b216157a88f4f9a7ccc166d0/blob b/shared/package-files/9b/9bd84381f8a954dd1c4cf6b2ca40bb6ee13c9663b216157a88f4f9a7ccc166d0/blob new file mode 100644 index 0000000000000000000000000000000000000000..6eca2212c08eda493eaca0b330cac15c9c8d52f2 --- /dev/null +++ b/shared/package-files/9b/9bd84381f8a954dd1c4cf6b2ca40bb6ee13c9663b216157a88f4f9a7ccc166d0/blob @@ -0,0 +1,62 @@ +#pragma once + +#include +#include +#include + +#include + +namespace torch { +namespace lazy { + +// Tensor implementation class used to be fed to the at::Tensor. +// Its scope is just to handle an LazyTensor. +class TORCH_API LTCTensorImpl final : public c10::TensorImpl { + public: + explicit LTCTensorImpl(const LazyTensorPtr& tensor); + explicit LTCTensorImpl(const LazyTensor& tensor); + explicit LTCTensorImpl(LazyTensor&& tensor); + + LazyTensorPtr tensor() { + return tensor_; + } + + void set_tensor(const LazyTensorPtr& lazy_tensor); + + void force_refresh_sizes() { + generation_ = 0; + } + + c10::intrusive_ptr shallow_copy_and_detach( + const c10::VariableVersion& version_counter, + bool allow_tensor_metadata_change) const override; + + c10::intrusive_ptr shallow_copy_and_detach( + c10::VariableVersion&& version_counter, + bool allow_tensor_metadata_change) const override; + + void shallow_copy_from(const c10::intrusive_ptr& impl) override; + + at::IntArrayRef sizes_custom() const override; + at::IntArrayRef strides_custom() const override; + int64_t numel_custom() const override; + int64_t storage_offset_custom() const override; + int64_t dim_custom() const override; + bool is_contiguous_custom(at::MemoryFormat memory_format) const override; + bool is_strides_like_custom(at::MemoryFormat memory_format) const override; + bool is_non_overlapping_and_dense_custom() const override; + + c10::SymIntArrayRef sym_sizes_custom() const override; + c10::SymIntArrayRef sym_strides_custom() const override; + c10::SymInt sym_numel_custom() const override; + + private: + void setup_size_properties(); + + LazyTensorPtr tensor_; + mutable c10::optional> sym_sizes_; + size_t generation_{0}; +}; + +} // namespace lazy +} // namespace torch diff --git a/shared/package-files/9b/9bd8f824225e2c5e06ce75d046b7f9069bfc40346c426c265201a2418905e26e/blob b/shared/package-files/9b/9bd8f824225e2c5e06ce75d046b7f9069bfc40346c426c265201a2418905e26e/blob new file mode 100644 index 0000000000000000000000000000000000000000..ce988864720a19758fc4dc5875d7402d36076d79 --- /dev/null +++ b/shared/package-files/9b/9bd8f824225e2c5e06ce75d046b7f9069bfc40346c426c265201a2418905e26e/blob @@ -0,0 +1,52 @@ +#pragma once + +#include +#include +#include + +#include +#include + +namespace c10 { + +// A RefcountedDeleterContext object is used as the `ctx` argument for DataPtr +// to implement a shared DataPtr. Normally, a DataPtr is unique, but we use +// this custom context and the `refcounted_deleter` function below to make the +// DataPtr act like a non-unique DataPtr. This context object holds onto an +// inner context and deleter function which handle the actual deletion of the +// data when the refcount reaches 0. +// +// This shared DataPtr feature is only used when storages are shared between +// multiple Python interpreters in MultiPy. Before storages had PyObject +// preservation, interpreters could just share the same StorageImpl instance. +// But now a StorageImpl can only be associated with one interpreter in order +// to properly manage a zombie PyObject. So we share storages across Python +// interpreters by creating a different StorageImpl instance for each one, but +// they all point to the same data. +struct C10_API RefcountedDeleterContext { + RefcountedDeleterContext(void* other_ctx, c10::DeleterFnPtr other_deleter) + : other_ctx(other_ctx, other_deleter), refcount(1) {} + + std::unique_ptr other_ctx; + std::atomic_int refcount; +}; + +// `refcounted_deleter` is used as the `ctx_deleter` for DataPtr to implement +// a shared DataPtr. +// +// Warning: This should only be called on a pointer to +// a RefcountedDeleterContext that was allocated on the heap with `new`, +// because when the refcount reaches 0, the context is deleted with `delete` +C10_API void refcounted_deleter(void* ctx_); + +// If the storage's DataPtr does not use `refcounted_deleter`, replace it with +// a DataPtr that does, so it can be shared between multiple StorageImpls +C10_API void maybeApplyRefcountedDeleter(const c10::Storage& storage); + +// Create a new StorageImpl that points to the same data. If the original +// StorageImpl's DataPtr does not use `refcounted_deleter`, it will be replaced +// with one that does +C10_API c10::Storage newStorageImplFromRefcountedDataPtr( + const c10::Storage& storage); + +} // namespace c10 diff --git a/shared/package-files/9b/9bdb52eeddd37f093daa0d2b827f7841b5198da4eabc412cfbb6afc6ca9d816f/blob b/shared/package-files/9b/9bdb52eeddd37f093daa0d2b827f7841b5198da4eabc412cfbb6afc6ca9d816f/blob new file mode 100644 index 0000000000000000000000000000000000000000..7898c8bb1a0ddeafcf0fd0adbfc76e0ccb126016 --- /dev/null +++ b/shared/package-files/9b/9bdb52eeddd37f093daa0d2b827f7841b5198da4eabc412cfbb6afc6ca9d816f/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::special_bessel_j1(Tensor self) -> Tensor +inline at::Tensor special_bessel_j1(const at::Tensor & self) { + return at::_ops::special_bessel_j1::call(self); +} + +// aten::special_bessel_j1.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & special_bessel_j1_out(at::Tensor & out, const at::Tensor & self) { + return at::_ops::special_bessel_j1_out::call(self, out); +} +// aten::special_bessel_j1.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & special_bessel_j1_outf(const at::Tensor & self, at::Tensor & out) { + return at::_ops::special_bessel_j1_out::call(self, out); +} + +} diff --git a/shared/package-files/9b/9bdf0d98114aa1fe737f1a5a96ce88ce5f4a3e2e5c6f5cde553efcc0850205a4/blob b/shared/package-files/9b/9bdf0d98114aa1fe737f1a5a96ce88ce5f4a3e2e5c6f5cde553efcc0850205a4/blob new file mode 100644 index 0000000000000000000000000000000000000000..4001b51dcc361c4ea19db571dd8fb17fae203d37 Binary files /dev/null and b/shared/package-files/9b/9bdf0d98114aa1fe737f1a5a96ce88ce5f4a3e2e5c6f5cde553efcc0850205a4/blob differ diff --git a/shared/package-files/9b/9be253dc4c741aa5d213a964e34f16e35b99b2c061560bbb1c319dabd60e9390/blob b/shared/package-files/9b/9be253dc4c741aa5d213a964e34f16e35b99b2c061560bbb1c319dabd60e9390/blob new file mode 100644 index 0000000000000000000000000000000000000000..cf04380f01c97f2443bb35ef8023000c67487755 --- /dev/null +++ b/shared/package-files/9b/9be253dc4c741aa5d213a964e34f16e35b99b2c061560bbb1c319dabd60e9390/blob @@ -0,0 +1,376 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, cast, overload + +import polars as pl + +from narwhals._polars.expr import PolarsExpr +from narwhals._polars.series import PolarsSeries +from narwhals._polars.utils import ( + BACKEND_VERSION, + extract_args_kwargs, + narwhals_to_native_dtype, +) +from narwhals._utils import ( + Implementation, + Version, + is_file_like, + isinstance_or_issubclass, + requires, +) +from narwhals.dependencies import is_numpy_array_2d +from narwhals.dtypes import DType + +if TYPE_CHECKING: + from collections.abc import Iterable, Mapping, Sequence + from datetime import timezone + + from typing_extensions import TypeIs + + from narwhals._compliant import CompliantSelectorNamespace + from narwhals._polars.dataframe import Method, PolarsDataFrame, PolarsLazyFrame + from narwhals._polars.typing import FrameT + from narwhals._utils import _LimitedContext + from narwhals.typing import ( + Into1DArray, + IntoDType, + NormalizedSource, + TimeUnit, + _2DArray, + ) + + +class PolarsNamespace: + all: Method[PolarsExpr] + coalesce: Method[PolarsExpr] + col: Method[PolarsExpr] + exclude: Method[PolarsExpr] + sum_horizontal: Method[PolarsExpr] + min_horizontal: Method[PolarsExpr] + max_horizontal: Method[PolarsExpr] + corr: Method[PolarsExpr] + + _implementation: Implementation = Implementation.POLARS + _version: Version + + @property + def _backend_version(self) -> tuple[int, ...]: + return self._implementation._backend_version() + + def __init__(self, *, version: Version) -> None: + self._version = version + + def __getattr__(self, attr: str) -> Any: + def func(*args: Any, **kwargs: Any) -> Any: + pos, kwds = extract_args_kwargs(args, kwargs) + return self._expr(getattr(pl, attr)(*pos, **kwds), version=self._version) + + return func + + @property + def _dataframe(self) -> type[PolarsDataFrame]: + from narwhals._polars.dataframe import PolarsDataFrame + + return PolarsDataFrame + + @property + def _lazyframe(self) -> type[PolarsLazyFrame]: + from narwhals._polars.dataframe import PolarsLazyFrame + + return PolarsLazyFrame + + @property + def _expr(self) -> type[PolarsExpr]: + return PolarsExpr + + @property + def _series(self) -> type[PolarsSeries]: + return PolarsSeries + + def is_native(self, obj: Any) -> TypeIs[pl.DataFrame | pl.LazyFrame | pl.Series]: + return isinstance(obj, (pl.DataFrame, pl.LazyFrame, pl.Series)) + + @overload + def from_native(self, data: pl.DataFrame, /) -> PolarsDataFrame: ... + @overload + def from_native(self, data: pl.LazyFrame, /) -> PolarsLazyFrame: ... + @overload + def from_native(self, data: pl.Series, /) -> PolarsSeries: ... + def from_native( + self, data: pl.DataFrame | pl.LazyFrame | pl.Series | Any, / + ) -> PolarsDataFrame | PolarsLazyFrame | PolarsSeries: + if self._dataframe._is_native(data): + return self._dataframe.from_native(data, context=self) + if self._series._is_native(data): + return self._series.from_native(data, context=self) + if self._lazyframe._is_native(data): + return self._lazyframe.from_native(data, context=self) + msg = f"Unsupported type: {type(data).__name__!r}" # pragma: no cover + raise TypeError(msg) # pragma: no cover + + @overload + def from_numpy(self, data: Into1DArray, /, schema: None = ...) -> PolarsSeries: ... + + @overload + def from_numpy( + self, data: _2DArray, /, schema: Mapping[str, IntoDType] | Sequence[str] | None + ) -> PolarsDataFrame: ... + + def from_numpy( + self, + data: Into1DArray | _2DArray, + /, + schema: Mapping[str, IntoDType] | Sequence[str] | None = None, + ) -> PolarsDataFrame | PolarsSeries: + if is_numpy_array_2d(data): + return self._dataframe.from_numpy(data, schema=schema, context=self) + return self._series.from_numpy(data, context=self) # pragma: no cover + + def _read_eagerly(self, source: NormalizedSource, /) -> bool: + """`pl.scan_*` only accepts a file-like object from `1.7.0` onwards.""" + return is_file_like(source) and self._backend_version < (1, 7) + + def read_csv( + self, source: NormalizedSource, *, separator: str = ",", **kwds: Any + ) -> PolarsDataFrame: + native = pl.read_csv(source, separator=separator, **kwds) + return self._dataframe.from_native(native, context=self) + + def scan_csv( + self, source: NormalizedSource, *, separator: str = ",", **kwds: Any + ) -> PolarsLazyFrame: + native = ( + pl.read_csv(source, separator=separator, **kwds).lazy() + if self._read_eagerly(source) + else pl.scan_csv(source, separator=separator, **kwds) + ) + return self._lazyframe.from_native(native, context=self) + + def read_parquet(self, source: NormalizedSource, **kwds: Any) -> PolarsDataFrame: + native = pl.read_parquet(cast("Any", source), **kwds) + return self._dataframe.from_native(native, context=self) + + def scan_parquet(self, source: NormalizedSource, **kwds: Any) -> PolarsLazyFrame: + native = ( + pl.read_parquet(cast("Any", source), **kwds).lazy() + if self._read_eagerly(source) + else pl.scan_parquet(cast("Any", source), **kwds) + ) + return self._lazyframe.from_native(native, context=self) + + @requires.backend_version( + (1, 0, 0), "Please use `col` for columns selection instead." + ) + def nth(self, indices: Sequence[int]) -> PolarsExpr: + return self._expr(pl.nth(*indices), version=self._version) + + def len(self) -> PolarsExpr: + if self._backend_version < (0, 20, 5): + return self._expr(pl.count().alias("len"), self._version) + return self._expr(pl.len(), self._version) + + def cov(self, a: PolarsExpr, b: PolarsExpr, *, ddof: int) -> PolarsExpr: + native = pl.cov(a.native, b.native, ddof=ddof) + n_samples = (a.native.is_not_null() & b.native.is_not_null()).sum() + result = pl.when(n_samples > pl.lit(ddof)).then(native) + return self._expr(result, self._version) + + def all_horizontal(self, *exprs: PolarsExpr, ignore_nulls: bool) -> PolarsExpr: + it = (expr.fill_null(True) for expr in exprs) if ignore_nulls else iter(exprs) + return self._expr(pl.all_horizontal(*(expr.native for expr in it)), self._version) + + def any_horizontal(self, *exprs: PolarsExpr, ignore_nulls: bool) -> PolarsExpr: + it = (expr.fill_null(False) for expr in exprs) if ignore_nulls else iter(exprs) + return self._expr(pl.any_horizontal(*(expr.native for expr in it)), self._version) + + def concat( + self, + items: Iterable[FrameT], + *, + how: Literal["vertical", "horizontal", "diagonal"], + ) -> PolarsDataFrame | PolarsLazyFrame: + _how = ( + "horizontal_extend" + if how == "horizontal" and self._backend_version >= (1, 42, 1) + else how + ) + result = pl.concat((item.native for item in items), how=_how) + if isinstance(result, pl.DataFrame): + return self._dataframe(result, version=self._version) + return self._lazyframe.from_native(result, context=self) + + def lit(self, value: Any, dtype: IntoDType | None) -> PolarsExpr: + if dtype is not None: + return self._expr( + pl.lit(value, dtype=narwhals_to_native_dtype(dtype, self._version)), + version=self._version, + ) + return self._expr(pl.lit(value), version=self._version) + + def mean_horizontal(self, *exprs: PolarsExpr) -> PolarsExpr: + if self._backend_version < (0, 20, 8): + return self._expr( + pl.sum_horizontal(e._native_expr for e in exprs) + / pl.sum_horizontal(1 - e.is_null()._native_expr for e in exprs), + version=self._version, + ) + + return self._expr( + pl.mean_horizontal(e._native_expr for e in exprs), version=self._version + ) + + def concat_str( + self, *exprs: PolarsExpr, separator: str, ignore_nulls: bool + ) -> PolarsExpr: + pl_exprs: list[pl.Expr] = [expr._native_expr for expr in exprs] + + if self._backend_version < (0, 20, 6): + null_mask = [expr.is_null() for expr in pl_exprs] + sep = pl.lit(separator) + + if not ignore_nulls: + null_mask_result = pl.any_horizontal(*null_mask) + output_expr = pl.reduce( + lambda x, y: x.cast(pl.String()) + sep + y.cast(pl.String()), # type: ignore[arg-type,return-value] + pl_exprs, + ) + result = pl.when(~null_mask_result).then(output_expr) + else: + # NOTE: Cast after `when` so a boolean literal is broadcast first: + # casting a scalar boolean literal renders `"1"` on old Polars. + init_value, *values = [ + pl.when(~nm).then(expr).cast(pl.String()).fill_null(pl.lit("")) + for expr, nm in zip(pl_exprs, null_mask, strict=True) + ] + result, seen = init_value, ~null_mask[0] + for nm, value in zip(null_mask[1:], values, strict=True): + not_null = ~nm + sep_or_empty = ( + pl.when(seen & not_null).then(sep).otherwise(pl.lit("")) + ) + result = result + sep_or_empty + value + seen = seen | not_null + + return self._expr(result, version=self._version) + + return self._expr( + pl.concat_str(pl_exprs, separator=separator, ignore_nulls=ignore_nulls), + version=self._version, + ) + + def struct(self, *exprs: PolarsExpr) -> PolarsExpr: + pl_exprs: list[pl.Expr] = [expr._native_expr for expr in exprs] + return self._expr(pl.struct(pl_exprs), version=self._version) + + def list(self, *exprs: PolarsExpr) -> PolarsExpr: + pl_exprs: list[pl.Expr] = [expr._native_expr for expr in exprs] + + if self._backend_version < (1, 43): # pragma: no cover + length = pl.count() if self._backend_version < (0, 20, 5) else pl.len() + to_concat = [e.implode().over(pl.int_range(length)) for e in pl_exprs] + expr = pl.concat_list(to_concat) + else: + expr = pl.list(pl_exprs) + + return self._expr(expr, version=self._version) + + def when_then( + self, when: PolarsExpr, then: PolarsExpr, otherwise: PolarsExpr | None = None + ) -> PolarsExpr: + if otherwise is None: + (when_native, then_native), _ = extract_args_kwargs((when, then), {}) + return self._expr( + pl.when(when_native).then(then_native), version=self._version + ) + (when_native, then_native, otherwise_native), _ = extract_args_kwargs( + (when, then, otherwise), {} + ) + return self._expr( + pl.when(when_native).then(then_native).otherwise(otherwise_native), + version=self._version, + ) + + # NOTE: Implementation is too different to annotate correctly (vs other `*SelectorNamespace`) + # 1. Others have lots of private stuff for code reuse + # i. None of that is useful here + # 2. We don't have a `PolarsSelector` abstraction, and just use `PolarsExpr` + @property + def selectors(self) -> CompliantSelectorNamespace[PolarsDataFrame, PolarsSeries]: + return cast( + "CompliantSelectorNamespace[PolarsDataFrame, PolarsSeries]", + PolarsSelectorNamespace(self), + ) + + +# NOTE: Polars accepts the bare `pl.Enum` class (as opposed to an instantiated `pl.Enum([...])`) +# in `by_dtype` from 0.20.6 onwards, so selecting "any enum" is not expressible on older versions. +_ENUM_SELECTOR_UNSUPPORTED = ( + "Selecting `Enum` columns is only supported for 'polars>=0.20.6', " + f"found version {BACKEND_VERSION}." +) + + +class PolarsSelectorNamespace: + _implementation = Implementation.POLARS + + def __init__(self, context: _LimitedContext, /) -> None: + self._version = context._version + + def by_dtype(self, dtypes: Iterable[IntoDType]) -> PolarsExpr: + native_dtypes = [self._to_native_dtype(dtype) for dtype in dtypes] + return PolarsExpr(pl.selectors.by_dtype(native_dtypes), version=self._version) + + def _to_native_dtype(self, dtype: IntoDType) -> pl.DataType | type[pl.DataType]: + # `Enum` can only be turned into a concrete `pl.Enum` instance when its + # categories are known. They aren't when the bare `Enum` class is passed, + # nor in `stable.v1` (where categories are never tracked). In those cases + # we match on the `pl.Enum` class, which selects any enum column. + version = self._version + dtypes = version.dtypes + if isinstance_or_issubclass(dtype, dtypes.Enum): + if version is not Version.V1 and isinstance(dtype, dtypes.Enum): + return narwhals_to_native_dtype(dtype, version) + if BACKEND_VERSION < (0, 20, 6): + raise NotImplementedError(_ENUM_SELECTOR_UNSUPPORTED) + return pl.Enum + if isinstance(dtype, type) and issubclass(dtype, DType): + return narwhals_to_native_dtype(dtype, version).__class__ + return narwhals_to_native_dtype(dtype, version) + + def matches(self, pattern: str) -> PolarsExpr: + return PolarsExpr(pl.selectors.matches(pattern=pattern), version=self._version) + + def numeric(self) -> PolarsExpr: + return PolarsExpr(pl.selectors.numeric(), version=self._version) + + def boolean(self) -> PolarsExpr: + return PolarsExpr(pl.selectors.boolean(), version=self._version) + + def string(self) -> PolarsExpr: + return PolarsExpr(pl.selectors.string(), version=self._version) + + def categorical(self) -> PolarsExpr: + return PolarsExpr(pl.selectors.categorical(), version=self._version) + + def enum(self) -> PolarsExpr: + if BACKEND_VERSION < (0, 20, 6): + raise NotImplementedError(_ENUM_SELECTOR_UNSUPPORTED) + expr = ( + pl.selectors.by_dtype(pl.Enum) + if BACKEND_VERSION < (1, 32) + else pl.selectors.enum() # Added in v1.32.0 (pola-rs/polars#23351) + ) + return PolarsExpr(expr, version=self._version) + + def all(self) -> PolarsExpr: + return PolarsExpr(pl.selectors.all(), version=self._version) + + def datetime( + self, + time_unit: TimeUnit | Iterable[TimeUnit] | None, + time_zone: str | timezone | Iterable[str | timezone | None] | None, + ) -> PolarsExpr: + return PolarsExpr( + pl.selectors.datetime(time_unit=time_unit, time_zone=time_zone), # type: ignore[arg-type] + version=self._version, + ) diff --git a/shared/package-files/9b/9be2dea9c5dbac221dd30e1c7167fa0a98b2f03a37d52b8daf528827affeb51d/blob b/shared/package-files/9b/9be2dea9c5dbac221dd30e1c7167fa0a98b2f03a37d52b8daf528827affeb51d/blob new file mode 100644 index 0000000000000000000000000000000000000000..627aba6e5da11928a6622157d73b39a0594eec75 --- /dev/null +++ b/shared/package-files/9b/9be2dea9c5dbac221dd30e1c7167fa0a98b2f03a37d52b8daf528827affeb51d/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_mean_dim : public at::impl::MetaBase { + + + void meta(const at::Tensor & self, at::OptionalIntArrayRef dim, bool keepdim, c10::optional dtype); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/9b/9be60cc6a295279da42ddeb5080f55d8c882fc3b70c1af9aa6f53c62d1fc4d85/blob b/shared/package-files/9b/9be60cc6a295279da42ddeb5080f55d8c882fc3b70c1af9aa6f53c62d1fc4d85/blob new file mode 100644 index 0000000000000000000000000000000000000000..ae341bbc29823489d9d15e354fae0ce2e10a046d --- /dev/null +++ b/shared/package-files/9b/9be60cc6a295279da42ddeb5080f55d8c882fc3b70c1af9aa6f53c62d1fc4d85/blob @@ -0,0 +1,5 @@ +{% if environment == "longtable" %} +{% include "latex_longtable.tpl" %} +{% else %} +{% include "latex_table.tpl" %} +{% endif %} diff --git a/shared/package-files/9b/9be7f0dbc4e1224d00702cf6ff41ca814348c1ef66dd81a775c6f86c9dbc2dea/blob b/shared/package-files/9b/9be7f0dbc4e1224d00702cf6ff41ca814348c1ef66dd81a775c6f86c9dbc2dea/blob new file mode 100644 index 0000000000000000000000000000000000000000..ed1fe27389a7de55ce4da4225ea3842153208996 --- /dev/null +++ b/shared/package-files/9b/9be7f0dbc4e1224d00702cf6ff41ca814348c1ef66dd81a775c6f86c9dbc2dea/blob @@ -0,0 +1,1175 @@ +from sympy import MatAdd +from sympy.algebras.quaternion import Quaternion +from sympy.assumptions.ask import Q +from sympy.calculus.accumulationbounds import AccumBounds +from sympy.combinatorics.partitions import Partition +from sympy.concrete.summations import (Sum, summation) +from sympy.core.add import Add +from sympy.core.containers import (Dict, Tuple) +from sympy.core.expr import UnevaluatedExpr, Expr +from sympy.core.function import (Derivative, Function, Lambda, Subs, WildFunction) +from sympy.core.mul import Mul +from sympy.core import (Catalan, EulerGamma, GoldenRatio, TribonacciConstant) +from sympy.core.numbers import (E, Float, I, Integer, Rational, nan, oo, pi, zoo) +from sympy.core.parameters import _exp_is_pow +from sympy.core.power import Pow +from sympy.core.relational import (Eq, Rel, Ne) +from sympy.core.singleton import S +from sympy.core.symbol import (Dummy, Symbol, Wild, symbols) +from sympy.functions.combinatorial.factorials import (factorial, factorial2, subfactorial) +from sympy.functions.elementary.complexes import Abs +from sympy.functions.elementary.exponential import exp +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.functions.elementary.trigonometric import (cos, sin) +from sympy.functions.special.delta_functions import Heaviside +from sympy.functions.special.zeta_functions import zeta +from sympy.integrals.integrals import Integral +from sympy.logic.boolalg import (Equivalent, false, true, Xor) +from sympy.matrices.dense import Matrix +from sympy.matrices.expressions.matexpr import MatrixSymbol +from sympy.matrices.expressions.slice import MatrixSlice +from sympy.matrices import SparseMatrix +from sympy.polys.polytools import factor +from sympy.series.limits import Limit +from sympy.series.order import O +from sympy.sets.sets import (Complement, FiniteSet, Interval, SymmetricDifference) +from sympy.external import import_module +from sympy.physics.control.lti import TransferFunction, Series, Parallel, \ + Feedback, TransferFunctionMatrix, MIMOSeries, MIMOParallel, MIMOFeedback +from sympy.physics.units import second, joule +from sympy.polys import (Poly, rootof, RootSum, groebner, ring, field, ZZ, QQ, + ZZ_I, QQ_I, lex, grlex) +from sympy.geometry import Point, Circle, Polygon, Ellipse, Triangle +from sympy.tensor import NDimArray +from sympy.tensor.array.expressions.array_expressions import ArraySymbol, ArrayElement + +from sympy.testing.pytest import raises, warns_deprecated_sympy + +from sympy.printing import sstr, sstrrepr, StrPrinter +from sympy.physics.quantum.trace import Tr + +x, y, z, w, t = symbols('x,y,z,w,t') +d = Dummy('d') + + +def test_printmethod(): + class R(Abs): + def _sympystr(self, printer): + return "foo(%s)" % printer._print(self.args[0]) + assert sstr(R(x)) == "foo(x)" + + class R(Abs): + def _sympystr(self, printer): + return "foo" + assert sstr(R(x)) == "foo" + + +def test_Abs(): + assert str(Abs(x)) == "Abs(x)" + assert str(Abs(Rational(1, 6))) == "1/6" + assert str(Abs(Rational(-1, 6))) == "1/6" + + +def test_Add(): + assert str(x + y) == "x + y" + assert str(x + 1) == "x + 1" + assert str(x + x**2) == "x**2 + x" + assert str(Add(0, 1, evaluate=False)) == "0 + 1" + assert str(Add(0, 0, 1, evaluate=False)) == "0 + 0 + 1" + assert str(1.0*x) == "1.0*x" + assert str(5 + x + y + x*y + x**2 + y**2) == "x**2 + x*y + x + y**2 + y + 5" + assert str(1 + x + x**2/2 + x**3/3) == "x**3/3 + x**2/2 + x + 1" + assert str(2*x - 7*x**2 + 2 + 3*y) == "-7*x**2 + 2*x + 3*y + 2" + assert str(x - y) == "x - y" + assert str(2 - x) == "2 - x" + assert str(x - 2) == "x - 2" + assert str(x - y - z - w) == "-w + x - y - z" + assert str(x - z*y**2*z*w) == "-w*y**2*z**2 + x" + assert str(x - 1*y*x*y) == "-x*y**2 + x" + assert str(sin(x).series(x, 0, 15)) == "x - x**3/6 + x**5/120 - x**7/5040 + x**9/362880 - x**11/39916800 + x**13/6227020800 + O(x**15)" + assert str(Add(Add(-w, x, evaluate=False), Add(-y, z, evaluate=False), evaluate=False)) == "(-w + x) + (-y + z)" + assert str(Add(Add(-x, -y, evaluate=False), -z, evaluate=False)) == "-z + (-x - y)" + assert str(Add(Add(Add(-x, -y, evaluate=False), -z, evaluate=False), -t, evaluate=False)) == "-t + (-z + (-x - y))" + + +def test_Catalan(): + assert str(Catalan) == "Catalan" + + +def test_ComplexInfinity(): + assert str(zoo) == "zoo" + + +def test_Derivative(): + assert str(Derivative(x, y)) == "Derivative(x, y)" + assert str(Derivative(x**2, x, evaluate=False)) == "Derivative(x**2, x)" + assert str(Derivative( + x**2/y, x, y, evaluate=False)) == "Derivative(x**2/y, x, y)" + + +def test_dict(): + assert str({1: 1 + x}) == sstr({1: 1 + x}) == "{1: x + 1}" + assert str({1: x**2, 2: y*x}) in ("{1: x**2, 2: x*y}", "{2: x*y, 1: x**2}") + assert sstr({1: x**2, 2: y*x}) == "{1: x**2, 2: x*y}" + + +def test_Dict(): + assert str(Dict({1: 1 + x})) == sstr({1: 1 + x}) == "{1: x + 1}" + assert str(Dict({1: x**2, 2: y*x})) in ( + "{1: x**2, 2: x*y}", "{2: x*y, 1: x**2}") + assert sstr(Dict({1: x**2, 2: y*x})) == "{1: x**2, 2: x*y}" + + +def test_Dummy(): + assert str(d) == "_d" + assert str(d + x) == "_d + x" + + +def test_EulerGamma(): + assert str(EulerGamma) == "EulerGamma" + + +def test_Exp(): + assert str(E) == "E" + with _exp_is_pow(True): + assert str(exp(x)) == "E**x" + + +def test_factorial(): + n = Symbol('n', integer=True) + assert str(factorial(-2)) == "zoo" + assert str(factorial(0)) == "1" + assert str(factorial(7)) == "5040" + assert str(factorial(n)) == "factorial(n)" + assert str(factorial(2*n)) == "factorial(2*n)" + assert str(factorial(factorial(n))) == 'factorial(factorial(n))' + assert str(factorial(factorial2(n))) == 'factorial(factorial2(n))' + assert str(factorial2(factorial(n))) == 'factorial2(factorial(n))' + assert str(factorial2(factorial2(n))) == 'factorial2(factorial2(n))' + assert str(subfactorial(3)) == "2" + assert str(subfactorial(n)) == "subfactorial(n)" + assert str(subfactorial(2*n)) == "subfactorial(2*n)" + + +def test_Function(): + f = Function('f') + fx = f(x) + w = WildFunction('w') + assert str(f) == "f" + assert str(fx) == "f(x)" + assert str(w) == "w_" + + +def test_Geometry(): + assert sstr(Point(0, 0)) == 'Point2D(0, 0)' + assert sstr(Circle(Point(0, 0), 3)) == 'Circle(Point2D(0, 0), 3)' + assert sstr(Ellipse(Point(1, 2), 3, 4)) == 'Ellipse(Point2D(1, 2), 3, 4)' + assert sstr(Triangle(Point(1, 1), Point(7, 8), Point(0, -1))) == \ + 'Triangle(Point2D(1, 1), Point2D(7, 8), Point2D(0, -1))' + assert sstr(Polygon(Point(5, 6), Point(-2, -3), Point(0, 0), Point(4, 7))) == \ + 'Polygon(Point2D(5, 6), Point2D(-2, -3), Point2D(0, 0), Point2D(4, 7))' + assert sstr(Triangle(Point(0, 0), Point(1, 0), Point(0, 1)), sympy_integers=True) == \ + 'Triangle(Point2D(S(0), S(0)), Point2D(S(1), S(0)), Point2D(S(0), S(1)))' + assert sstr(Ellipse(Point(1, 2), 3, 4), sympy_integers=True) == \ + 'Ellipse(Point2D(S(1), S(2)), S(3), S(4))' + + +def test_GoldenRatio(): + assert str(GoldenRatio) == "GoldenRatio" + + +def test_Heaviside(): + assert str(Heaviside(x)) == str(Heaviside(x, S.Half)) == "Heaviside(x)" + assert str(Heaviside(x, 1)) == "Heaviside(x, 1)" + + +def test_TribonacciConstant(): + assert str(TribonacciConstant) == "TribonacciConstant" + + +def test_ImaginaryUnit(): + assert str(I) == "I" + + +def test_Infinity(): + assert str(oo) == "oo" + assert str(oo*I) == "oo*I" + + +def test_Integer(): + assert str(Integer(-1)) == "-1" + assert str(Integer(1)) == "1" + assert str(Integer(-3)) == "-3" + assert str(Integer(0)) == "0" + assert str(Integer(25)) == "25" + + +def test_Integral(): + assert str(Integral(sin(x), y)) == "Integral(sin(x), y)" + assert str(Integral(sin(x), (y, 0, 1))) == "Integral(sin(x), (y, 0, 1))" + + +def test_Interval(): + n = (S.NegativeInfinity, 1, 2, S.Infinity) + for i in range(len(n)): + for j in range(i + 1, len(n)): + for l in (True, False): + for r in (True, False): + ival = Interval(n[i], n[j], l, r) + assert S(str(ival)) == ival + + +def test_AccumBounds(): + a = Symbol('a', real=True) + assert str(AccumBounds(0, a)) == "AccumBounds(0, a)" + assert str(AccumBounds(0, 1)) == "AccumBounds(0, 1)" + + +def test_Lambda(): + assert str(Lambda(d, d**2)) == "Lambda(_d, _d**2)" + # issue 2908 + assert str(Lambda((), 1)) == "Lambda((), 1)" + assert str(Lambda((), x)) == "Lambda((), x)" + assert str(Lambda((x, y), x+y)) == "Lambda((x, y), x + y)" + assert str(Lambda(((x, y),), x+y)) == "Lambda(((x, y),), x + y)" + + +def test_Limit(): + assert str(Limit(sin(x)/x, x, y)) == "Limit(sin(x)/x, x, y, dir='+')" + assert str(Limit(1/x, x, 0)) == "Limit(1/x, x, 0, dir='+')" + assert str( + Limit(sin(x)/x, x, y, dir="-")) == "Limit(sin(x)/x, x, y, dir='-')" + + +def test_list(): + assert str([x]) == sstr([x]) == "[x]" + assert str([x**2, x*y + 1]) == sstr([x**2, x*y + 1]) == "[x**2, x*y + 1]" + assert str([x**2, [y + x]]) == sstr([x**2, [y + x]]) == "[x**2, [x + y]]" + + +def test_Matrix_str(): + M = Matrix([[x**+1, 1], [y, x + y]]) + assert str(M) == "Matrix([[x, 1], [y, x + y]])" + assert sstr(M) == "Matrix([\n[x, 1],\n[y, x + y]])" + M = Matrix([[1]]) + assert str(M) == sstr(M) == "Matrix([[1]])" + M = Matrix([[1, 2]]) + assert str(M) == sstr(M) == "Matrix([[1, 2]])" + M = Matrix() + assert str(M) == sstr(M) == "Matrix(0, 0, [])" + M = Matrix(0, 1, lambda i, j: 0) + assert str(M) == sstr(M) == "Matrix(0, 1, [])" + + +def test_Mul(): + assert str(x/y) == "x/y" + assert str(y/x) == "y/x" + assert str(x/y/z) == "x/(y*z)" + assert str((x + 1)/(y + 2)) == "(x + 1)/(y + 2)" + assert str(2*x/3) == '2*x/3' + assert str(-2*x/3) == '-2*x/3' + assert str(-1.0*x) == '-1.0*x' + assert str(1.0*x) == '1.0*x' + assert str(Mul(0, 1, evaluate=False)) == '0*1' + assert str(Mul(1, 0, evaluate=False)) == '1*0' + assert str(Mul(1, 1, evaluate=False)) == '1*1' + assert str(Mul(1, 1, 1, evaluate=False)) == '1*1*1' + assert str(Mul(1, 2, evaluate=False)) == '1*2' + assert str(Mul(1, S.Half, evaluate=False)) == '1*(1/2)' + assert str(Mul(1, 1, S.Half, evaluate=False)) == '1*1*(1/2)' + assert str(Mul(1, 1, 2, 3, x, evaluate=False)) == '1*1*2*3*x' + assert str(Mul(1, -1, evaluate=False)) == '1*(-1)' + assert str(Mul(-1, 1, evaluate=False)) == '-1*1' + assert str(Mul(4, 3, 2, 1, 0, y, x, evaluate=False)) == '4*3*2*1*0*y*x' + assert str(Mul(4, 3, 2, 1+z, 0, y, x, evaluate=False)) == '4*3*2*(z + 1)*0*y*x' + assert str(Mul(Rational(2, 3), Rational(5, 7), evaluate=False)) == '(2/3)*(5/7)' + # For issue 14160 + assert str(Mul(-2, x, Pow(Mul(y,y,evaluate=False), -1, evaluate=False), + evaluate=False)) == '-2*x/(y*y)' + # issue 21537 + assert str(Mul(x, Pow(1/y, -1, evaluate=False), evaluate=False)) == 'x/(1/y)' + + # Issue 24108 + from sympy.core.parameters import evaluate + with evaluate(False): + assert str(Mul(Pow(Integer(2), Integer(-1)), Add(Integer(-1), Mul(Integer(-1), Integer(1))))) == "(-1 - 1*1)/2" + + class CustomClass1(Expr): + is_commutative = True + + class CustomClass2(Expr): + is_commutative = True + cc1 = CustomClass1() + cc2 = CustomClass2() + assert str(Rational(2)*cc1) == '2*CustomClass1()' + assert str(cc1*Rational(2)) == '2*CustomClass1()' + assert str(cc1*Float("1.5")) == '1.5*CustomClass1()' + assert str(cc2*Rational(2)) == '2*CustomClass2()' + assert str(cc2*Rational(2)*cc1) == '2*CustomClass1()*CustomClass2()' + assert str(cc1*Rational(2)*cc2) == '2*CustomClass1()*CustomClass2()' + + +def test_NaN(): + assert str(nan) == "nan" + + +def test_NegativeInfinity(): + assert str(-oo) == "-oo" + +def test_Order(): + assert str(O(x)) == "O(x)" + assert str(O(x**2)) == "O(x**2)" + assert str(O(x*y)) == "O(x*y, x, y)" + assert str(O(x, x)) == "O(x)" + assert str(O(x, (x, 0))) == "O(x)" + assert str(O(x, (x, oo))) == "O(x, (x, oo))" + assert str(O(x, x, y)) == "O(x, x, y)" + assert str(O(x, x, y)) == "O(x, x, y)" + assert str(O(x, (x, oo), (y, oo))) == "O(x, (x, oo), (y, oo))" + + +def test_Permutation_Cycle(): + from sympy.combinatorics import Permutation, Cycle + + # general principle: economically, canonically show all moved elements + # and the size of the permutation. + + for p, s in [ + (Cycle(), + '()'), + (Cycle(2), + '(2)'), + (Cycle(2, 1), + '(1 2)'), + (Cycle(1, 2)(5)(6, 7)(10), + '(1 2)(6 7)(10)'), + (Cycle(3, 4)(1, 2)(3, 4), + '(1 2)(4)'), + ]: + assert sstr(p) == s + + for p, s in [ + (Permutation([]), + 'Permutation([])'), + (Permutation([], size=1), + 'Permutation([0])'), + (Permutation([], size=2), + 'Permutation([0, 1])'), + (Permutation([], size=10), + 'Permutation([], size=10)'), + (Permutation([1, 0, 2]), + 'Permutation([1, 0, 2])'), + (Permutation([1, 0, 2, 3, 4, 5]), + 'Permutation([1, 0], size=6)'), + (Permutation([1, 0, 2, 3, 4, 5], size=10), + 'Permutation([1, 0], size=10)'), + ]: + assert sstr(p, perm_cyclic=False) == s + + for p, s in [ + (Permutation([]), + '()'), + (Permutation([], size=1), + '(0)'), + (Permutation([], size=2), + '(1)'), + (Permutation([], size=10), + '(9)'), + (Permutation([1, 0, 2]), + '(2)(0 1)'), + (Permutation([1, 0, 2, 3, 4, 5]), + '(5)(0 1)'), + (Permutation([1, 0, 2, 3, 4, 5], size=10), + '(9)(0 1)'), + (Permutation([0, 1, 3, 2, 4, 5], size=10), + '(9)(2 3)'), + ]: + assert sstr(p) == s + + + with warns_deprecated_sympy(): + old_print_cyclic = Permutation.print_cyclic + Permutation.print_cyclic = False + assert sstr(Permutation([1, 0, 2])) == 'Permutation([1, 0, 2])' + Permutation.print_cyclic = old_print_cyclic + +def test_Pi(): + assert str(pi) == "pi" + + +def test_Poly(): + assert str(Poly(0, x)) == "Poly(0, x, domain='ZZ')" + assert str(Poly(1, x)) == "Poly(1, x, domain='ZZ')" + assert str(Poly(x, x)) == "Poly(x, x, domain='ZZ')" + + assert str(Poly(2*x + 1, x)) == "Poly(2*x + 1, x, domain='ZZ')" + assert str(Poly(2*x - 1, x)) == "Poly(2*x - 1, x, domain='ZZ')" + + assert str(Poly(-1, x)) == "Poly(-1, x, domain='ZZ')" + assert str(Poly(-x, x)) == "Poly(-x, x, domain='ZZ')" + + assert str(Poly(-2*x + 1, x)) == "Poly(-2*x + 1, x, domain='ZZ')" + assert str(Poly(-2*x - 1, x)) == "Poly(-2*x - 1, x, domain='ZZ')" + + assert str(Poly(x - 1, x)) == "Poly(x - 1, x, domain='ZZ')" + assert str(Poly(2*x + x**5, x)) == "Poly(x**5 + 2*x, x, domain='ZZ')" + + assert str(Poly(3**(2*x), 3**x)) == "Poly((3**x)**2, 3**x, domain='ZZ')" + assert str(Poly((x**2)**x)) == "Poly(((x**2)**x), (x**2)**x, domain='ZZ')" + + assert str(Poly((x + y)**3, (x + y), expand=False) + ) == "Poly((x + y)**3, x + y, domain='ZZ')" + assert str(Poly((x - 1)**2, (x - 1), expand=False) + ) == "Poly((x - 1)**2, x - 1, domain='ZZ')" + + assert str( + Poly(x**2 + 1 + y, x)) == "Poly(x**2 + y + 1, x, domain='ZZ[y]')" + assert str( + Poly(x**2 - 1 + y, x)) == "Poly(x**2 + y - 1, x, domain='ZZ[y]')" + + assert str(Poly(x**2 + I*x, x)) == "Poly(x**2 + I*x, x, domain='ZZ_I')" + assert str(Poly(x**2 - I*x, x)) == "Poly(x**2 - I*x, x, domain='ZZ_I')" + + assert str(Poly(-x*y*z + x*y - 1, x, y, z) + ) == "Poly(-x*y*z + x*y - 1, x, y, z, domain='ZZ')" + assert str(Poly(-w*x**21*y**7*z + (1 + w)*z**3 - 2*x*z + 1, x, y, z)) == \ + "Poly(-w*x**21*y**7*z - 2*x*z + (w + 1)*z**3 + 1, x, y, z, domain='ZZ[w]')" + + assert str(Poly(x**2 + 1, x, modulus=2)) == "Poly(x**2 + 1, x, modulus=2)" + assert str(Poly(2*x**2 + 3*x + 4, x, modulus=17)) == "Poly(2*x**2 + 3*x + 4, x, modulus=17)" + + +def test_PolyRing(): + assert str(ring("x", ZZ, lex)[0]) == "Polynomial ring in x over ZZ with lex order" + assert str(ring("x,y", QQ, grlex)[0]) == "Polynomial ring in x, y over QQ with grlex order" + assert str(ring("x,y,z", ZZ["t"], lex)[0]) == "Polynomial ring in x, y, z over ZZ[t] with lex order" + + +def test_FracField(): + assert str(field("x", ZZ, lex)[0]) == "Rational function field in x over ZZ with lex order" + assert str(field("x,y", QQ, grlex)[0]) == "Rational function field in x, y over QQ with grlex order" + assert str(field("x,y,z", ZZ["t"], lex)[0]) == "Rational function field in x, y, z over ZZ[t] with lex order" + + +def test_PolyElement(): + Ruv, u,v = ring("u,v", ZZ) + Rxyz, x,y,z = ring("x,y,z", Ruv) + Rx_zzi, xz = ring("x", ZZ_I) + + assert str(x - x) == "0" + assert str(x - 1) == "x - 1" + assert str(x + 1) == "x + 1" + assert str(x**2) == "x**2" + assert str(x**(-2)) == "x**(-2)" + assert str(x**QQ(1, 2)) == "x**(1/2)" + + assert str((u**2 + 3*u*v + 1)*x**2*y + u + 1) == "(u**2 + 3*u*v + 1)*x**2*y + u + 1" + assert str((u**2 + 3*u*v + 1)*x**2*y + (u + 1)*x) == "(u**2 + 3*u*v + 1)*x**2*y + (u + 1)*x" + assert str((u**2 + 3*u*v + 1)*x**2*y + (u + 1)*x + 1) == "(u**2 + 3*u*v + 1)*x**2*y + (u + 1)*x + 1" + assert str((-u**2 + 3*u*v - 1)*x**2*y - (u + 1)*x - 1) == "-(u**2 - 3*u*v + 1)*x**2*y - (u + 1)*x - 1" + + assert str(-(v**2 + v + 1)*x + 3*u*v + 1) == "-(v**2 + v + 1)*x + 3*u*v + 1" + assert str(-(v**2 + v + 1)*x - 3*u*v + 1) == "-(v**2 + v + 1)*x - 3*u*v + 1" + + assert str((1+I)*xz + 2) == "(1 + 1*I)*x + (2 + 0*I)" + + +def test_FracElement(): + Fuv, u,v = field("u,v", ZZ) + Fxyzt, x,y,z,t = field("x,y,z,t", Fuv) + Rx_zzi, xz = field("x", QQ_I) + i = QQ_I(0, 1) + + assert str(x - x) == "0" + assert str(x - 1) == "x - 1" + assert str(x + 1) == "x + 1" + + assert str(x/3) == "x/3" + assert str(x/z) == "x/z" + assert str(x*y/z) == "x*y/z" + assert str(x/(z*t)) == "x/(z*t)" + assert str(x*y/(z*t)) == "x*y/(z*t)" + + assert str((x - 1)/y) == "(x - 1)/y" + assert str((x + 1)/y) == "(x + 1)/y" + assert str((-x - 1)/y) == "(-x - 1)/y" + assert str((x + 1)/(y*z)) == "(x + 1)/(y*z)" + assert str(-y/(x + 1)) == "-y/(x + 1)" + assert str(y*z/(x + 1)) == "y*z/(x + 1)" + + assert str(((u + 1)*x*y + 1)/((v - 1)*z - 1)) == "((u + 1)*x*y + 1)/((v - 1)*z - 1)" + assert str(((u + 1)*x*y + 1)/((v - 1)*z - t*u*v - 1)) == "((u + 1)*x*y + 1)/((v - 1)*z - u*v*t - 1)" + + assert str((1+i)/xz) == "(1 + 1*I)/x" + assert str(((1+i)*xz - i)/xz) == "((1 + 1*I)*x + (0 + -1*I))/x" + + +def test_GaussianInteger(): + assert str(ZZ_I(1, 0)) == "1" + assert str(ZZ_I(-1, 0)) == "-1" + assert str(ZZ_I(0, 1)) == "I" + assert str(ZZ_I(0, -1)) == "-I" + assert str(ZZ_I(0, 2)) == "2*I" + assert str(ZZ_I(0, -2)) == "-2*I" + assert str(ZZ_I(1, 1)) == "1 + I" + assert str(ZZ_I(-1, -1)) == "-1 - I" + assert str(ZZ_I(-1, -2)) == "-1 - 2*I" + + +def test_GaussianRational(): + assert str(QQ_I(1, 0)) == "1" + assert str(QQ_I(QQ(2, 3), 0)) == "2/3" + assert str(QQ_I(0, QQ(2, 3))) == "2*I/3" + assert str(QQ_I(QQ(1, 2), QQ(-2, 3))) == "1/2 - 2*I/3" + + +def test_Pow(): + assert str(x**-1) == "1/x" + assert str(x**-2) == "x**(-2)" + assert str(x**2) == "x**2" + assert str((x + y)**-1) == "1/(x + y)" + assert str((x + y)**-2) == "(x + y)**(-2)" + assert str((x + y)**2) == "(x + y)**2" + assert str((x + y)**(1 + x)) == "(x + y)**(x + 1)" + assert str(x**Rational(1, 3)) == "x**(1/3)" + assert str(1/x**Rational(1, 3)) == "x**(-1/3)" + assert str(sqrt(sqrt(x))) == "x**(1/4)" + # not the same as x**-1 + assert str(x**-1.0) == 'x**(-1.0)' + # see issue #2860 + assert str(Pow(S(2), -1.0, evaluate=False)) == '2**(-1.0)' + + +def test_sqrt(): + assert str(sqrt(x)) == "sqrt(x)" + assert str(sqrt(x**2)) == "sqrt(x**2)" + assert str(1/sqrt(x)) == "1/sqrt(x)" + assert str(1/sqrt(x**2)) == "1/sqrt(x**2)" + assert str(y/sqrt(x)) == "y/sqrt(x)" + assert str(x**0.5) == "x**0.5" + assert str(1/x**0.5) == "x**(-0.5)" + + +def test_Rational(): + n1 = Rational(1, 4) + n2 = Rational(1, 3) + n3 = Rational(2, 4) + n4 = Rational(2, -4) + n5 = Rational(0) + n7 = Rational(3) + n8 = Rational(-3) + assert str(n1*n2) == "1/12" + assert str(n1*n2) == "1/12" + assert str(n3) == "1/2" + assert str(n1*n3) == "1/8" + assert str(n1 + n3) == "3/4" + assert str(n1 + n2) == "7/12" + assert str(n1 + n4) == "-1/4" + assert str(n4*n4) == "1/4" + assert str(n4 + n2) == "-1/6" + assert str(n4 + n5) == "-1/2" + assert str(n4*n5) == "0" + assert str(n3 + n4) == "0" + assert str(n1**n7) == "1/64" + assert str(n2**n7) == "1/27" + assert str(n2**n8) == "27" + assert str(n7**n8) == "1/27" + assert str(Rational("-25")) == "-25" + assert str(Rational("1.25")) == "5/4" + assert str(Rational("-2.6e-2")) == "-13/500" + assert str(S("25/7")) == "25/7" + assert str(S("-123/569")) == "-123/569" + assert str(S("0.1[23]", rational=1)) == "61/495" + assert str(S("5.1[666]", rational=1)) == "31/6" + assert str(S("-5.1[666]", rational=1)) == "-31/6" + assert str(S("0.[9]", rational=1)) == "1" + assert str(S("-0.[9]", rational=1)) == "-1" + + assert str(sqrt(Rational(1, 4))) == "1/2" + assert str(sqrt(Rational(1, 36))) == "1/6" + + assert str((123**25) ** Rational(1, 25)) == "123" + assert str((123**25 + 1)**Rational(1, 25)) != "123" + assert str((123**25 - 1)**Rational(1, 25)) != "123" + assert str((123**25 - 1)**Rational(1, 25)) != "122" + + assert str(sqrt(Rational(81, 36))**3) == "27/8" + assert str(1/sqrt(Rational(81, 36))**3) == "8/27" + + assert str(sqrt(-4)) == str(2*I) + assert str(2**Rational(1, 10**10)) == "2**(1/10000000000)" + + assert sstr(Rational(2, 3), sympy_integers=True) == "S(2)/3" + x = Symbol("x") + assert sstr(x**Rational(2, 3), sympy_integers=True) == "x**(S(2)/3)" + assert sstr(Eq(x, Rational(2, 3)), sympy_integers=True) == "Eq(x, S(2)/3)" + assert sstr(Limit(x, x, Rational(7, 2)), sympy_integers=True) == \ + "Limit(x, x, S(7)/2, dir='+')" + + +def test_Float(): + # NOTE dps is the whole number of decimal digits + assert str(Float('1.23', dps=1 + 2)) == '1.23' + assert str(Float('1.23456789', dps=1 + 8)) == '1.23456789' + assert str( + Float('1.234567890123456789', dps=1 + 18)) == '1.234567890123456789' + assert str(pi.evalf(1 + 2)) == '3.14' + assert str(pi.evalf(1 + 14)) == '3.14159265358979' + assert str(pi.evalf(1 + 64)) == ('3.141592653589793238462643383279' + '5028841971693993751058209749445923') + assert str(pi.round(-1)) == '0.0' + assert str((pi**400 - (pi**400).round(1)).n(2)) == '-0.e+88' + assert sstr(Float("100"), full_prec=False, min=-2, max=2) == '1.0e+2' + assert sstr(Float("100"), full_prec=False, min=-2, max=3) == '100.0' + assert sstr(Float("0.1"), full_prec=False, min=-2, max=3) == '0.1' + assert sstr(Float("0.099"), min=-2, max=3) == '9.90000000000000e-2' + + +def test_Relational(): + assert str(Rel(x, y, "<")) == "x < y" + assert str(Rel(x + y, y, "==")) == "Eq(x + y, y)" + assert str(Rel(x, y, "!=")) == "Ne(x, y)" + assert str(Eq(x, 1) | Eq(x, 2)) == "Eq(x, 1) | Eq(x, 2)" + assert str(Ne(x, 1) & Ne(x, 2)) == "Ne(x, 1) & Ne(x, 2)" + + +def test_AppliedBinaryRelation(): + assert str(Q.eq(x, y)) == "Q.eq(x, y)" + assert str(Q.ne(x, y)) == "Q.ne(x, y)" + + +def test_CRootOf(): + assert str(rootof(x**5 + 2*x - 1, 0)) == "CRootOf(x**5 + 2*x - 1, 0)" + + +def test_RootSum(): + f = x**5 + 2*x - 1 + + assert str( + RootSum(f, Lambda(z, z), auto=False)) == "RootSum(x**5 + 2*x - 1)" + assert str(RootSum(f, Lambda( + z, z**2), auto=False)) == "RootSum(x**5 + 2*x - 1, Lambda(z, z**2))" + + +def test_GroebnerBasis(): + assert str(groebner( + [], x, y)) == "GroebnerBasis([], x, y, domain='ZZ', order='lex')" + + F = [x**2 - 3*y - x + 1, y**2 - 2*x + y - 1] + + assert str(groebner(F, order='grlex')) == \ + "GroebnerBasis([x**2 - x - 3*y + 1, y**2 - 2*x + y - 1], x, y, domain='ZZ', order='grlex')" + assert str(groebner(F, order='lex')) == \ + "GroebnerBasis([2*x - y**2 - y + 1, y**4 + 2*y**3 - 3*y**2 - 16*y + 7], x, y, domain='ZZ', order='lex')" + +def test_set(): + assert sstr(set()) == 'set()' + assert sstr(frozenset()) == 'frozenset()' + + assert sstr({1}) == '{1}' + assert sstr(frozenset([1])) == 'frozenset({1})' + assert sstr({1, 2, 3}) == '{1, 2, 3}' + assert sstr(frozenset([1, 2, 3])) == 'frozenset({1, 2, 3})' + + assert sstr( + {1, x, x**2, x**3, x**4}) == '{1, x, x**2, x**3, x**4}' + assert sstr( + frozenset([1, x, x**2, x**3, x**4])) == 'frozenset({1, x, x**2, x**3, x**4})' + + +def test_SparseMatrix(): + M = SparseMatrix([[x**+1, 1], [y, x + y]]) + assert str(M) == "Matrix([[x, 1], [y, x + y]])" + assert sstr(M) == "Matrix([\n[x, 1],\n[y, x + y]])" + + +def test_Sum(): + assert str(summation(cos(3*z), (z, x, y))) == "Sum(cos(3*z), (z, x, y))" + assert str(Sum(x*y**2, (x, -2, 2), (y, -5, 5))) == \ + "Sum(x*y**2, (x, -2, 2), (y, -5, 5))" + + +def test_Symbol(): + assert str(y) == "y" + assert str(x) == "x" + e = x + assert str(e) == "x" + + +def test_tuple(): + assert str((x,)) == sstr((x,)) == "(x,)" + assert str((x + y, 1 + x)) == sstr((x + y, 1 + x)) == "(x + y, x + 1)" + assert str((x + y, ( + 1 + x, x**2))) == sstr((x + y, (1 + x, x**2))) == "(x + y, (x + 1, x**2))" + + +def test_Series_str(): + tf1 = TransferFunction(x*y**2 - z, y**3 - t**3, y) + tf2 = TransferFunction(x - y, x + y, y) + tf3 = TransferFunction(t*x**2 - t**w*x + w, t - y, y) + assert str(Series(tf1, tf2)) == \ + "Series(TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y))" + assert str(Series(tf1, tf2, tf3)) == \ + "Series(TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y), TransferFunction(t*x**2 - t**w*x + w, t - y, y))" + assert str(Series(-tf2, tf1)) == \ + "Series(TransferFunction(-x + y, x + y, y), TransferFunction(x*y**2 - z, -t**3 + y**3, y))" + + +def test_MIMOSeries_str(): + tf1 = TransferFunction(x*y**2 - z, y**3 - t**3, y) + tf2 = TransferFunction(x - y, x + y, y) + tfm_1 = TransferFunctionMatrix([[tf1, tf2], [tf2, tf1]]) + tfm_2 = TransferFunctionMatrix([[tf2, tf1], [tf1, tf2]]) + assert str(MIMOSeries(tfm_1, tfm_2)) == \ + "MIMOSeries(TransferFunctionMatrix(((TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y)), "\ + "(TransferFunction(x - y, x + y, y), TransferFunction(x*y**2 - z, -t**3 + y**3, y)))), "\ + "TransferFunctionMatrix(((TransferFunction(x - y, x + y, y), TransferFunction(x*y**2 - z, -t**3 + y**3, y)), "\ + "(TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y)))))" + + +def test_TransferFunction_str(): + tf1 = TransferFunction(x - 1, x + 1, x) + assert str(tf1) == "TransferFunction(x - 1, x + 1, x)" + tf2 = TransferFunction(x + 1, 2 - y, x) + assert str(tf2) == "TransferFunction(x + 1, 2 - y, x)" + tf3 = TransferFunction(y, y**2 + 2*y + 3, y) + assert str(tf3) == "TransferFunction(y, y**2 + 2*y + 3, y)" + + +def test_Parallel_str(): + tf1 = TransferFunction(x*y**2 - z, y**3 - t**3, y) + tf2 = TransferFunction(x - y, x + y, y) + tf3 = TransferFunction(t*x**2 - t**w*x + w, t - y, y) + assert str(Parallel(tf1, tf2)) == \ + "Parallel(TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y))" + assert str(Parallel(tf1, tf2, tf3)) == \ + "Parallel(TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y), TransferFunction(t*x**2 - t**w*x + w, t - y, y))" + assert str(Parallel(-tf2, tf1)) == \ + "Parallel(TransferFunction(-x + y, x + y, y), TransferFunction(x*y**2 - z, -t**3 + y**3, y))" + + +def test_MIMOParallel_str(): + tf1 = TransferFunction(x*y**2 - z, y**3 - t**3, y) + tf2 = TransferFunction(x - y, x + y, y) + tfm_1 = TransferFunctionMatrix([[tf1, tf2], [tf2, tf1]]) + tfm_2 = TransferFunctionMatrix([[tf2, tf1], [tf1, tf2]]) + assert str(MIMOParallel(tfm_1, tfm_2)) == \ + "MIMOParallel(TransferFunctionMatrix(((TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y)), "\ + "(TransferFunction(x - y, x + y, y), TransferFunction(x*y**2 - z, -t**3 + y**3, y)))), "\ + "TransferFunctionMatrix(((TransferFunction(x - y, x + y, y), TransferFunction(x*y**2 - z, -t**3 + y**3, y)), "\ + "(TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y)))))" + + +def test_Feedback_str(): + tf1 = TransferFunction(x*y**2 - z, y**3 - t**3, y) + tf2 = TransferFunction(x - y, x + y, y) + tf3 = TransferFunction(t*x**2 - t**w*x + w, t - y, y) + assert str(Feedback(tf1*tf2, tf3)) == \ + "Feedback(Series(TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y)), " \ + "TransferFunction(t*x**2 - t**w*x + w, t - y, y), -1)" + assert str(Feedback(tf1, TransferFunction(1, 1, y), 1)) == \ + "Feedback(TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(1, 1, y), 1)" + + +def test_MIMOFeedback_str(): + tf1 = TransferFunction(x**2 - y**3, y - z, x) + tf2 = TransferFunction(y - x, z + y, x) + tfm_1 = TransferFunctionMatrix([[tf2, tf1], [tf1, tf2]]) + tfm_2 = TransferFunctionMatrix([[tf1, tf2], [tf2, tf1]]) + assert (str(MIMOFeedback(tfm_1, tfm_2)) \ + == "MIMOFeedback(TransferFunctionMatrix(((TransferFunction(-x + y, y + z, x), TransferFunction(x**2 - y**3, y - z, x))," \ + " (TransferFunction(x**2 - y**3, y - z, x), TransferFunction(-x + y, y + z, x)))), " \ + "TransferFunctionMatrix(((TransferFunction(x**2 - y**3, y - z, x), " \ + "TransferFunction(-x + y, y + z, x)), (TransferFunction(-x + y, y + z, x), TransferFunction(x**2 - y**3, y - z, x)))), -1)") + assert (str(MIMOFeedback(tfm_1, tfm_2, 1)) \ + == "MIMOFeedback(TransferFunctionMatrix(((TransferFunction(-x + y, y + z, x), TransferFunction(x**2 - y**3, y - z, x)), " \ + "(TransferFunction(x**2 - y**3, y - z, x), TransferFunction(-x + y, y + z, x)))), " \ + "TransferFunctionMatrix(((TransferFunction(x**2 - y**3, y - z, x), TransferFunction(-x + y, y + z, x)), "\ + "(TransferFunction(-x + y, y + z, x), TransferFunction(x**2 - y**3, y - z, x)))), 1)") + + +def test_TransferFunctionMatrix_str(): + tf1 = TransferFunction(x*y**2 - z, y**3 - t**3, y) + tf2 = TransferFunction(x - y, x + y, y) + tf3 = TransferFunction(t*x**2 - t**w*x + w, t - y, y) + assert str(TransferFunctionMatrix([[tf1], [tf2]])) == \ + "TransferFunctionMatrix(((TransferFunction(x*y**2 - z, -t**3 + y**3, y),), (TransferFunction(x - y, x + y, y),)))" + assert str(TransferFunctionMatrix([[tf1, tf2], [tf3, tf2]])) == \ + "TransferFunctionMatrix(((TransferFunction(x*y**2 - z, -t**3 + y**3, y), TransferFunction(x - y, x + y, y)), (TransferFunction(t*x**2 - t**w*x + w, t - y, y), TransferFunction(x - y, x + y, y))))" + + +def test_Quaternion_str_printer(): + q = Quaternion(x, y, z, t) + assert str(q) == "x + y*i + z*j + t*k" + q = Quaternion(x,y,z,x*t) + assert str(q) == "x + y*i + z*j + t*x*k" + q = Quaternion(x,y,z,x+t) + assert str(q) == "x + y*i + z*j + (t + x)*k" + + +def test_Quantity_str(): + assert sstr(second, abbrev=True) == "s" + assert sstr(joule, abbrev=True) == "J" + assert str(second) == "second" + assert str(joule) == "joule" + + +def test_wild_str(): + # Check expressions containing Wild not causing infinite recursion + w = Wild('x') + assert str(w + 1) == 'x_ + 1' + assert str(exp(2**w) + 5) == 'exp(2**x_) + 5' + assert str(3*w + 1) == '3*x_ + 1' + assert str(1/w + 1) == '1 + 1/x_' + assert str(w**2 + 1) == 'x_**2 + 1' + assert str(1/(1 - w)) == '1/(1 - x_)' + + +def test_wild_matchpy(): + from sympy.utilities.matchpy_connector import WildDot, WildPlus, WildStar + + matchpy = import_module("matchpy") + + if matchpy is None: + return + + wd = WildDot('w_') + wp = WildPlus('w__') + ws = WildStar('w___') + + assert str(wd) == 'w_' + assert str(wp) == 'w__' + assert str(ws) == 'w___' + + assert str(wp/ws + 2**wd) == '2**w_ + w__/w___' + assert str(sin(wd)*cos(wp)*sqrt(ws)) == 'sqrt(w___)*sin(w_)*cos(w__)' + + +def test_zeta(): + assert str(zeta(3)) == "zeta(3)" + + +def test_issue_3101(): + e = x - y + a = str(e) + b = str(e) + assert a == b + + +def test_issue_3103(): + e = -2*sqrt(x) - y/sqrt(x)/2 + assert str(e) not in ["(-2)*x**1/2(-1/2)*x**(-1/2)*y", + "-2*x**1/2(-1/2)*x**(-1/2)*y", "-2*x**1/2-1/2*x**-1/2*w"] + assert str(e) == "-2*sqrt(x) - y/(2*sqrt(x))" + + +def test_issue_4021(): + e = Integral(x, x) + 1 + assert str(e) == 'Integral(x, x) + 1' + + +def test_sstrrepr(): + assert sstr('abc') == 'abc' + assert sstrrepr('abc') == "'abc'" + + e = ['a', 'b', 'c', x] + assert sstr(e) == "[a, b, c, x]" + assert sstrrepr(e) == "['a', 'b', 'c', x]" + + +def test_infinity(): + assert sstr(oo*I) == "oo*I" + + +def test_full_prec(): + assert sstr(S("0.3"), full_prec=True) == "0.300000000000000" + assert sstr(S("0.3"), full_prec="auto") == "0.300000000000000" + assert sstr(S("0.3"), full_prec=False) == "0.3" + assert sstr(S("0.3")*x, full_prec=True) in [ + "0.300000000000000*x", + "x*0.300000000000000" + ] + assert sstr(S("0.3")*x, full_prec="auto") in [ + "0.3*x", + "x*0.3" + ] + assert sstr(S("0.3")*x, full_prec=False) in [ + "0.3*x", + "x*0.3" + ] + + +def test_noncommutative(): + A, B, C = symbols('A,B,C', commutative=False) + + assert sstr(A*B*C**-1) == "A*B*C**(-1)" + assert sstr(C**-1*A*B) == "C**(-1)*A*B" + assert sstr(A*C**-1*B) == "A*C**(-1)*B" + assert sstr(sqrt(A)) == "sqrt(A)" + assert sstr(1/sqrt(A)) == "A**(-1/2)" + + +def test_empty_printer(): + str_printer = StrPrinter() + assert str_printer.emptyPrinter("foo") == "foo" + assert str_printer.emptyPrinter(x*y) == "x*y" + assert str_printer.emptyPrinter(32) == "32" + + +def test_settings(): + raises(TypeError, lambda: sstr(S(4), method="garbage")) + + +def test_RandomDomain(): + from sympy.stats import Normal, Die, Exponential, pspace, where + X = Normal('x1', 0, 1) + assert str(where(X > 0)) == "Domain: (0 < x1) & (x1 < oo)" + + D = Die('d1', 6) + assert str(where(D > 4)) == "Domain: Eq(d1, 5) | Eq(d1, 6)" + + A = Exponential('a', 1) + B = Exponential('b', 1) + assert str(pspace(Tuple(A, B)).domain) == "Domain: (0 <= a) & (0 <= b) & (a < oo) & (b < oo)" + + +def test_FiniteSet(): + assert str(FiniteSet(*range(1, 51))) == ( + '{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,' + ' 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,' + ' 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50}' + ) + assert str(FiniteSet(*range(1, 6))) == '{1, 2, 3, 4, 5}' + assert str(FiniteSet(*[x*y, x**2])) == '{x**2, x*y}' + assert str(FiniteSet(FiniteSet(FiniteSet(x, y), 5), FiniteSet(x,y), 5) + ) == 'FiniteSet(5, FiniteSet(5, {x, y}), {x, y})' + + +def test_Partition(): + assert str(Partition(FiniteSet(x, y), {z})) == 'Partition({z}, {x, y})' + +def test_UniversalSet(): + assert str(S.UniversalSet) == 'UniversalSet' + + +def test_PrettyPoly(): + F = QQ.frac_field(x, y) + R = QQ[x, y] + assert sstr(F.convert(x/(x + y))) == sstr(x/(x + y)) + assert sstr(R.convert(x + y)) == sstr(x + y) + + +def test_categories(): + from sympy.categories import (Object, NamedMorphism, + IdentityMorphism, Category) + + A = Object("A") + B = Object("B") + + f = NamedMorphism(A, B, "f") + id_A = IdentityMorphism(A) + + K = Category("K") + + assert str(A) == 'Object("A")' + assert str(f) == 'NamedMorphism(Object("A"), Object("B"), "f")' + assert str(id_A) == 'IdentityMorphism(Object("A"))' + + assert str(K) == 'Category("K")' + + +def test_Tr(): + A, B = symbols('A B', commutative=False) + t = Tr(A*B) + assert str(t) == 'Tr(A*B)' + + +def test_issue_6387(): + assert str(factor(-3.0*z + 3)) == '-3.0*(1.0*z - 1.0)' + + +def test_MatMul_MatAdd(): + X, Y = MatrixSymbol("X", 2, 2), MatrixSymbol("Y", 2, 2) + assert str(2*(X + Y)) == "2*X + 2*Y" + + assert str(I*X) == "I*X" + assert str(-I*X) == "-I*X" + assert str((1 + I)*X) == '(1 + I)*X' + assert str(-(1 + I)*X) == '(-1 - I)*X' + assert str(MatAdd(MatAdd(X, Y), MatAdd(X, Y))) == '(X + Y) + (X + Y)' + + +def test_MatrixSlice(): + n = Symbol('n', integer=True) + X = MatrixSymbol('X', n, n) + Y = MatrixSymbol('Y', 10, 10) + Z = MatrixSymbol('Z', 10, 10) + + assert str(MatrixSlice(X, (None, None, None), (None, None, None))) == 'X[:, :]' + assert str(X[x:x + 1, y:y + 1]) == 'X[x:x + 1, y:y + 1]' + assert str(X[x:x + 1:2, y:y + 1:2]) == 'X[x:x + 1:2, y:y + 1:2]' + assert str(X[:x, y:]) == 'X[:x, y:]' + assert str(X[:x, y:]) == 'X[:x, y:]' + assert str(X[x:, :y]) == 'X[x:, :y]' + assert str(X[x:y, z:w]) == 'X[x:y, z:w]' + assert str(X[x:y:t, w:t:x]) == 'X[x:y:t, w:t:x]' + assert str(X[x::y, t::w]) == 'X[x::y, t::w]' + assert str(X[:x:y, :t:w]) == 'X[:x:y, :t:w]' + assert str(X[::x, ::y]) == 'X[::x, ::y]' + assert str(MatrixSlice(X, (0, None, None), (0, None, None))) == 'X[:, :]' + assert str(MatrixSlice(X, (None, n, None), (None, n, None))) == 'X[:, :]' + assert str(MatrixSlice(X, (0, n, None), (0, n, None))) == 'X[:, :]' + assert str(MatrixSlice(X, (0, n, 2), (0, n, 2))) == 'X[::2, ::2]' + assert str(X[1:2:3, 4:5:6]) == 'X[1:2:3, 4:5:6]' + assert str(X[1:3:5, 4:6:8]) == 'X[1:3:5, 4:6:8]' + assert str(X[1:10:2]) == 'X[1:10:2, :]' + assert str(Y[:5, 1:9:2]) == 'Y[:5, 1:9:2]' + assert str(Y[:5, 1:10:2]) == 'Y[:5, 1::2]' + assert str(Y[5, :5:2]) == 'Y[5:6, :5:2]' + assert str(X[0:1, 0:1]) == 'X[:1, :1]' + assert str(X[0:1:2, 0:1:2]) == 'X[:1:2, :1:2]' + assert str((Y + Z)[2:, 2:]) == '(Y + Z)[2:, 2:]' + +def test_true_false(): + assert str(true) == repr(true) == sstr(true) == "True" + assert str(false) == repr(false) == sstr(false) == "False" + +def test_Equivalent(): + assert str(Equivalent(y, x)) == "Equivalent(x, y)" + +def test_Xor(): + assert str(Xor(y, x, evaluate=False)) == "x ^ y" + +def test_Complement(): + assert str(Complement(S.Reals, S.Naturals)) == 'Complement(Reals, Naturals)' + +def test_SymmetricDifference(): + assert str(SymmetricDifference(Interval(2, 3), Interval(3, 4),evaluate=False)) == \ + 'SymmetricDifference(Interval(2, 3), Interval(3, 4))' + + +def test_UnevaluatedExpr(): + a, b = symbols("a b") + expr1 = 2*UnevaluatedExpr(a+b) + assert str(expr1) == "2*(a + b)" + + +def test_MatrixElement_printing(): + # test cases for issue #11821 + A = MatrixSymbol("A", 1, 3) + B = MatrixSymbol("B", 1, 3) + C = MatrixSymbol("C", 1, 3) + + assert(str(A[0, 0]) == "A[0, 0]") + assert(str(3 * A[0, 0]) == "3*A[0, 0]") + + F = C[0, 0].subs(C, A - B) + assert str(F) == "(A - B)[0, 0]" + + +def test_MatrixSymbol_printing(): + A = MatrixSymbol("A", 3, 3) + B = MatrixSymbol("B", 3, 3) + + assert str(A - A*B - B) == "A - A*B - B" + assert str(A*B - (A+B)) == "-A + A*B - B" + assert str(A**(-1)) == "A**(-1)" + assert str(A**3) == "A**3" + + +def test_MatrixExpressions(): + n = Symbol('n', integer=True) + X = MatrixSymbol('X', n, n) + + assert str(X) == "X" + + # Apply function elementwise (`ElementwiseApplyFunc`): + + expr = (X.T*X).applyfunc(sin) + assert str(expr) == 'Lambda(_d, sin(_d)).(X.T*X)' + + lamda = Lambda(x, 1/x) + expr = (n*X).applyfunc(lamda) + assert str(expr) == 'Lambda(x, 1/x).(n*X)' + + +def test_Subs_printing(): + assert str(Subs(x, (x,), (1,))) == 'Subs(x, x, 1)' + assert str(Subs(x + y, (x, y), (1, 2))) == 'Subs(x + y, (x, y), (1, 2))' + + +def test_issue_15716(): + e = Integral(factorial(x), (x, -oo, oo)) + assert e.as_terms() == ([(e, ((1.0, 0.0), (1,), ()))], [e]) + + +def test_str_special_matrices(): + from sympy.matrices import Identity, ZeroMatrix, OneMatrix + assert str(Identity(4)) == 'I' + assert str(ZeroMatrix(2, 2)) == '0' + assert str(OneMatrix(2, 2)) == '1' + + +def test_issue_14567(): + assert factorial(Sum(-1, (x, 0, 0))) + y # doesn't raise an error + + +def test_issue_21823(): + assert str(Partition([1, 2])) == 'Partition({1, 2})' + assert str(Partition({1, 2})) == 'Partition({1, 2})' + + +def test_issue_22689(): + assert str(Mul(Pow(x,-2, evaluate=False), Pow(3,-1,evaluate=False), evaluate=False)) == "1/(x**2*3)" + + +def test_issue_21119_21460(): + ss = lambda x: str(S(x, evaluate=False)) + assert ss('4/2') == '4/2' + assert ss('4/-2') == '4/(-2)' + assert ss('-4/2') == '-4/2' + assert ss('-4/-2') == '-4/(-2)' + assert ss('-2*3/-1') == '-2*3/(-1)' + assert ss('-2*3/-1/2') == '-2*3/(-1*2)' + assert ss('4/2/1') == '4/(2*1)' + assert ss('-2/-1/2') == '-2/(-1*2)' + assert ss('2*3*4**(-2*3)') == '2*3/4**(2*3)' + assert ss('2*3*1*4**(-2*3)') == '2*3*1/4**(2*3)' + + +def test_Str(): + from sympy.core.symbol import Str + assert str(Str('x')) == 'x' + assert sstrrepr(Str('x')) == "Str('x')" + + +def test_diffgeom(): + from sympy.diffgeom import Manifold, Patch, CoordSystem, BaseScalarField + x,y = symbols('x y', real=True) + m = Manifold('M', 2) + assert str(m) == "M" + p = Patch('P', m) + assert str(p) == "P" + rect = CoordSystem('rect', p, [x, y]) + assert str(rect) == "rect" + b = BaseScalarField(rect, 0) + assert str(b) == "x" + +def test_NDimArray(): + assert sstr(NDimArray(1.0), full_prec=True) == '1.00000000000000' + assert sstr(NDimArray(1.0), full_prec=False) == '1.0' + assert sstr(NDimArray([1.0, 2.0]), full_prec=True) == '[1.00000000000000, 2.00000000000000]' + assert sstr(NDimArray([1.0, 2.0]), full_prec=False) == '[1.0, 2.0]' + +def test_Predicate(): + assert sstr(Q.even) == 'Q.even' + +def test_AppliedPredicate(): + assert sstr(Q.even(x)) == 'Q.even(x)' + +def test_printing_str_array_expressions(): + assert sstr(ArraySymbol("A", (2, 3, 4))) == "A" + assert sstr(ArrayElement("A", (2, 1/(1-x), 0))) == "A[2, 1/(1 - x), 0]" + M = MatrixSymbol("M", 3, 3) + N = MatrixSymbol("N", 3, 3) + assert sstr(ArrayElement(M*N, [x, 0])) == "(M*N)[x, 0]" diff --git a/shared/package-files/9b/9bea6c0c58d52f7fc1cdc6676248914fc008621161098e4446b87f2cfe2c107e/blob b/shared/package-files/9b/9bea6c0c58d52f7fc1cdc6676248914fc008621161098e4446b87f2cfe2c107e/blob new file mode 100644 index 0000000000000000000000000000000000000000..06f25a13d8021ff4f43de442bbf0279f24735d6c --- /dev/null +++ b/shared/package-files/9b/9bea6c0c58d52f7fc1cdc6676248914fc008621161098e4446b87f2cfe2c107e/blob @@ -0,0 +1,2 @@ +// HTM, Apache License +var n=function(t,s,r,e){var u;s[0]=0;for(var h=1;h=5&&((e||!n&&5===r)&&(h.push(r,0,e,s),r=6),n&&(h.push(r,n,0,s),r=6)),e=""},a=0;a"===t?(r=1,e=""):e=t+e[0]:u?t===u?u="":e+=t:'"'===t||"'"===t?u=t:">"===t?(p(),r=1):r&&("="===t?(r=5,s=e,e=""):"/"===t&&(r<5||">"===n[a][l+1])?(p(),3===r&&(h=h[0]),r=h,(h=h[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(p(),r=2):e+=t),3===r&&"!--"===e&&(r=4,h=h[0])}return p(),h}(s)),r),arguments,[])).length>1?r:r[0]} diff --git a/shared/package-files/9b/9beb72fd68896781957d5e7efa427730525a2d77acb73e44a3ee07d053ec70ae/blob b/shared/package-files/9b/9beb72fd68896781957d5e7efa427730525a2d77acb73e44a3ee07d053ec70ae/blob new file mode 100644 index 0000000000000000000000000000000000000000..e583250f7060aaa909d43b28dcb7c0021d0175d4 --- /dev/null +++ b/shared/package-files/9b/9beb72fd68896781957d5e7efa427730525a2d77acb73e44a3ee07d053ec70ae/blob @@ -0,0 +1,194 @@ +#!/usr/bin/env python3 +"""Fortran to Python Interface Generator. + +Copyright 1999 -- 2011 Pearu Peterson all rights reserved. +Copyright 2011 -- present NumPy Developers. +Permission to use, modify, and distribute this software is given under the terms +of the NumPy License. + +NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. +""" +__all__ = ['run_main', 'compile', 'get_include'] + +import sys +import subprocess +import os +import warnings + +from numpy.exceptions import VisibleDeprecationWarning +from . import f2py2e +from . import diagnose + +run_main = f2py2e.run_main +main = f2py2e.main + + +def compile(source, + modulename='untitled', + extra_args='', + verbose=True, + source_fn=None, + extension='.f', + full_output=False + ): + """ + Build extension module from a Fortran 77 source string with f2py. + + Parameters + ---------- + source : str or bytes + Fortran source of module / subroutine to compile + + .. versionchanged:: 1.16.0 + Accept str as well as bytes + + modulename : str, optional + The name of the compiled python module + extra_args : str or list, optional + Additional parameters passed to f2py + + .. versionchanged:: 1.16.0 + A list of args may also be provided. + + verbose : bool, optional + Print f2py output to screen + source_fn : str, optional + Name of the file where the fortran source is written. + The default is to use a temporary file with the extension + provided by the ``extension`` parameter + extension : ``{'.f', '.f90'}``, optional + Filename extension if `source_fn` is not provided. + The extension tells which fortran standard is used. + The default is ``.f``, which implies F77 standard. + + .. versionadded:: 1.11.0 + + full_output : bool, optional + If True, return a `subprocess.CompletedProcess` containing + the stdout and stderr of the compile process, instead of just + the status code. + + .. versionadded:: 1.20.0 + + + Returns + ------- + result : int or `subprocess.CompletedProcess` + 0 on success, or a `subprocess.CompletedProcess` if + ``full_output=True`` + + Examples + -------- + .. literalinclude:: ../../source/f2py/code/results/compile_session.dat + :language: python + + """ + import tempfile + import shlex + + if source_fn is None: + f, fname = tempfile.mkstemp(suffix=extension) + # f is a file descriptor so need to close it + # carefully -- not with .close() directly + os.close(f) + else: + fname = source_fn + + if not isinstance(source, str): + source = str(source, 'utf-8') + try: + with open(fname, 'w') as f: + f.write(source) + + args = ['-c', '-m', modulename, f.name] + + if isinstance(extra_args, str): + is_posix = (os.name == 'posix') + extra_args = shlex.split(extra_args, posix=is_posix) + + args.extend(extra_args) + + c = [sys.executable, + '-c', + 'import numpy.f2py as f2py2e;f2py2e.main()'] + args + try: + cp = subprocess.run(c, capture_output=True) + except OSError: + # preserve historic status code used by exec_command() + cp = subprocess.CompletedProcess(c, 127, stdout=b'', stderr=b'') + else: + if verbose: + print(cp.stdout.decode()) + finally: + if source_fn is None: + os.remove(fname) + + if full_output: + return cp + else: + return cp.returncode + + +def get_include(): + """ + Return the directory that contains the ``fortranobject.c`` and ``.h`` files. + + .. note:: + + This function is not needed when building an extension with + `numpy.distutils` directly from ``.f`` and/or ``.pyf`` files + in one go. + + Python extension modules built with f2py-generated code need to use + ``fortranobject.c`` as a source file, and include the ``fortranobject.h`` + header. This function can be used to obtain the directory containing + both of these files. + + Returns + ------- + include_path : str + Absolute path to the directory containing ``fortranobject.c`` and + ``fortranobject.h``. + + Notes + ----- + .. versionadded:: 1.21.1 + + Unless the build system you are using has specific support for f2py, + building a Python extension using a ``.pyf`` signature file is a two-step + process. For a module ``mymod``: + + * Step 1: run ``python -m numpy.f2py mymod.pyf --quiet``. This + generates ``_mymodmodule.c`` and (if needed) + ``_fblas-f2pywrappers.f`` files next to ``mymod.pyf``. + * Step 2: build your Python extension module. This requires the + following source files: + + * ``_mymodmodule.c`` + * ``_mymod-f2pywrappers.f`` (if it was generated in Step 1) + * ``fortranobject.c`` + + See Also + -------- + numpy.get_include : function that returns the numpy include directory + + """ + return os.path.join(os.path.dirname(__file__), 'src') + + +def __getattr__(attr): + + # Avoid importing things that aren't needed for building + # which might import the main numpy module + if attr == "test": + from numpy._pytesttester import PytestTester + test = PytestTester(__name__) + return test + + else: + raise AttributeError("module {!r} has no attribute " + "{!r}".format(__name__, attr)) + + +def __dir__(): + return list(globals().keys() | {"test"}) diff --git a/shared/package-files/9b/9bf036748ad06b5f4a169776a7b53ba557e2af66968c7a264aa7d99d7bd94179/blob b/shared/package-files/9b/9bf036748ad06b5f4a169776a7b53ba557e2af66968c7a264aa7d99d7bd94179/blob new file mode 100644 index 0000000000000000000000000000000000000000..77feeb7ead6d9a74bf60c197f6d1383a54fb87f7 --- /dev/null +++ b/shared/package-files/9b/9bf036748ad06b5f4a169776a7b53ba557e2af66968c7a264aa7d99d7bd94179/blob @@ -0,0 +1,20 @@ +_arma_innovations_gen = generator(cython, + arguments : cython_args, + output : '@BASENAME@.c', + depends : [_math_pxd, _cython_tree, _special_tree] +) + +_arma_innovations_pyx = custom_target( + '_arma_innovations_pyx', + input: '_arma_innovations.pyx.in', + output: '_arma_innovations.pyx', + command: [tempita, '@INPUT@', '--outfile', '@OUTPUT@'], +) + +py.extension_module('_arma_innovations', + _arma_innovations_gen.process(_arma_innovations_pyx), + c_args: cython_c_args, + include_directories: [inc_np, inc_sm], + install: true, + subdir: 'statsmodels/tsa/innovations', +) diff --git a/shared/package-files/9b/9bf2470c0d2bfda64670e4f9074ff71fd56935f37d5a7100bdbd73be022cb1af/blob b/shared/package-files/9b/9bf2470c0d2bfda64670e4f9074ff71fd56935f37d5a7100bdbd73be022cb1af/blob new file mode 100644 index 0000000000000000000000000000000000000000..16997ab51f84655049cc0dcb7269348ddd6f9630 --- /dev/null +++ b/shared/package-files/9b/9bf2470c0d2bfda64670e4f9074ff71fd56935f37d5a7100bdbd73be022cb1af/blob @@ -0,0 +1,22 @@ +from typing import Optional + +from cryptography.hazmat.backends.interfaces import HMACBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.kdf import KeyDerivationFunction + +class HKDF(KeyDerivationFunction): + def __init__( + self, + algorithm: HashAlgorithm, + length: int, + salt: Optional[bytes], + info: Optional[bytes], + backend: Optional[HMACBackend] = ..., + ): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... + +class HKDFExpand(KeyDerivationFunction): + def __init__(self, algorithm: HashAlgorithm, length: int, info: Optional[bytes], backend: Optional[HMACBackend] = ...): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/shared/package-files/9b/9bf544fe17d63ca97e2a0519cbd69541d3e0d71b68683681824bab217eda1a28/blob b/shared/package-files/9b/9bf544fe17d63ca97e2a0519cbd69541d3e0d71b68683681824bab217eda1a28/blob new file mode 100644 index 0000000000000000000000000000000000000000..b99ee8bef422a6dc65d27e364eded545615e9ccc --- /dev/null +++ b/shared/package-files/9b/9bf544fe17d63ca97e2a0519cbd69541d3e0d71b68683681824bab217eda1a28/blob @@ -0,0 +1,208 @@ +/* + pybind11/buffer_info.h: Python buffer object interface + + Copyright (c) 2016 Wenzel Jakob + + All rights reserved. Use of this source code is governed by a + BSD-style license that can be found in the LICENSE file. +*/ + +#pragma once + +#include "detail/common.h" + +PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) + +PYBIND11_NAMESPACE_BEGIN(detail) + +// Default, C-style strides +inline std::vector c_strides(const std::vector &shape, ssize_t itemsize) { + auto ndim = shape.size(); + std::vector strides(ndim, itemsize); + if (ndim > 0) { + for (size_t i = ndim - 1; i > 0; --i) { + strides[i - 1] = strides[i] * shape[i]; + } + } + return strides; +} + +// F-style strides; default when constructing an array_t with `ExtraFlags & f_style` +inline std::vector f_strides(const std::vector &shape, ssize_t itemsize) { + auto ndim = shape.size(); + std::vector strides(ndim, itemsize); + for (size_t i = 1; i < ndim; ++i) { + strides[i] = strides[i - 1] * shape[i - 1]; + } + return strides; +} + +template +struct compare_buffer_info; + +PYBIND11_NAMESPACE_END(detail) + +/// Information record describing a Python buffer object +struct buffer_info { + void *ptr = nullptr; // Pointer to the underlying storage + ssize_t itemsize = 0; // Size of individual items in bytes + ssize_t size = 0; // Total number of entries + std::string format; // For homogeneous buffers, this should be set to + // format_descriptor::format() + ssize_t ndim = 0; // Number of dimensions + std::vector shape; // Shape of the tensor (1 entry per dimension) + std::vector strides; // Number of bytes between adjacent entries + // (for each per dimension) + bool readonly = false; // flag to indicate if the underlying storage may be written to + + buffer_info() = default; + + buffer_info(void *ptr, + ssize_t itemsize, + const std::string &format, + ssize_t ndim, + detail::any_container shape_in, + detail::any_container strides_in, + bool readonly = false) + : ptr(ptr), itemsize(itemsize), size(1), format(format), ndim(ndim), + shape(std::move(shape_in)), strides(std::move(strides_in)), readonly(readonly) { + if (ndim != (ssize_t) shape.size() || ndim != (ssize_t) strides.size()) { + pybind11_fail("buffer_info: ndim doesn't match shape and/or strides length"); + } + for (size_t i = 0; i < (size_t) ndim; ++i) { + size *= shape[i]; + } + } + + template + buffer_info(T *ptr, + detail::any_container shape_in, + detail::any_container strides_in, + bool readonly = false) + : buffer_info(private_ctr_tag(), + ptr, + sizeof(T), + format_descriptor::format(), + static_cast(shape_in->size()), + std::move(shape_in), + std::move(strides_in), + readonly) {} + + buffer_info(void *ptr, + ssize_t itemsize, + const std::string &format, + ssize_t size, + bool readonly = false) + : buffer_info(ptr, itemsize, format, 1, {size}, {itemsize}, readonly) {} + + template + buffer_info(T *ptr, ssize_t size, bool readonly = false) + : buffer_info(ptr, sizeof(T), format_descriptor::format(), size, readonly) {} + + template + buffer_info(const T *ptr, ssize_t size, bool readonly = true) + : buffer_info( + const_cast(ptr), sizeof(T), format_descriptor::format(), size, readonly) {} + + explicit buffer_info(Py_buffer *view, bool ownview = true) + : buffer_info( + view->buf, + view->itemsize, + view->format, + view->ndim, + {view->shape, view->shape + view->ndim}, + /* Though buffer::request() requests PyBUF_STRIDES, ctypes objects + * ignore this flag and return a view with NULL strides. + * When strides are NULL, build them manually. */ + view->strides + ? std::vector(view->strides, view->strides + view->ndim) + : detail::c_strides({view->shape, view->shape + view->ndim}, view->itemsize), + (view->readonly != 0)) { + // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer) + this->m_view = view; + // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer) + this->ownview = ownview; + } + + buffer_info(const buffer_info &) = delete; + buffer_info &operator=(const buffer_info &) = delete; + + buffer_info(buffer_info &&other) noexcept { (*this) = std::move(other); } + + buffer_info &operator=(buffer_info &&rhs) noexcept { + ptr = rhs.ptr; + itemsize = rhs.itemsize; + size = rhs.size; + format = std::move(rhs.format); + ndim = rhs.ndim; + shape = std::move(rhs.shape); + strides = std::move(rhs.strides); + std::swap(m_view, rhs.m_view); + std::swap(ownview, rhs.ownview); + readonly = rhs.readonly; + return *this; + } + + ~buffer_info() { + if (m_view && ownview) { + PyBuffer_Release(m_view); + delete m_view; + } + } + + Py_buffer *view() const { return m_view; } + Py_buffer *&view() { return m_view; } + + /* True if the buffer item type is equivalent to `T`. */ + // To define "equivalent" by example: + // `buffer_info::item_type_is_equivalent_to(b)` and + // `buffer_info::item_type_is_equivalent_to(b)` may both be true + // on some platforms, but `int` and `unsigned` will never be equivalent. + // For the ground truth, please inspect `detail::compare_buffer_info<>`. + template + bool item_type_is_equivalent_to() const { + return detail::compare_buffer_info::compare(*this); + } + +private: + struct private_ctr_tag {}; + + buffer_info(private_ctr_tag, + void *ptr, + ssize_t itemsize, + const std::string &format, + ssize_t ndim, + detail::any_container &&shape_in, + detail::any_container &&strides_in, + bool readonly) + : buffer_info( + ptr, itemsize, format, ndim, std::move(shape_in), std::move(strides_in), readonly) {} + + Py_buffer *m_view = nullptr; + bool ownview = false; +}; + +PYBIND11_NAMESPACE_BEGIN(detail) + +template +struct compare_buffer_info { + static bool compare(const buffer_info &b) { + // NOLINTNEXTLINE(bugprone-sizeof-expression) Needed for `PyObject *` + return b.format == format_descriptor::format() && b.itemsize == (ssize_t) sizeof(T); + } +}; + +template +struct compare_buffer_info::value>> { + static bool compare(const buffer_info &b) { + return (size_t) b.itemsize == sizeof(T) + && (b.format == format_descriptor::value + || ((sizeof(T) == sizeof(long)) + && b.format == (std::is_unsigned::value ? "L" : "l")) + || ((sizeof(T) == sizeof(size_t)) + && b.format == (std::is_unsigned::value ? "N" : "n"))); + } +}; + +PYBIND11_NAMESPACE_END(detail) +PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) diff --git a/shared/package-files/9b/9bf5f92d3c2d99a8bd80cbe8a489738fe377d98902575693a2485536051ff0b5/blob b/shared/package-files/9b/9bf5f92d3c2d99a8bd80cbe8a489738fe377d98902575693a2485536051ff0b5/blob new file mode 100644 index 0000000000000000000000000000000000000000..0f6f9ccfa27ee04f0138daa65df48470fe24d770 --- /dev/null +++ b/shared/package-files/9b/9bf5f92d3c2d99a8bd80cbe8a489738fe377d98902575693a2485536051ff0b5/blob @@ -0,0 +1,4 @@ +from .checkpoint_activation import checkpoint +from .contract import _get_registry, contract +from .fully_shard import fully_shard +from .replicate import replicate diff --git a/shared/package-files/9b/9bf79e00d4f1bf766a2232c1cbc2f989b7f381430336d11bb2a75e27cce54cdd/blob b/shared/package-files/9b/9bf79e00d4f1bf766a2232c1cbc2f989b7f381430336d11bb2a75e27cce54cdd/blob new file mode 100644 index 0000000000000000000000000000000000000000..0f31055d9b7f959c36888efbd4adae01f0a06822 --- /dev/null +++ b/shared/package-files/9b/9bf79e00d4f1bf766a2232c1cbc2f989b7f381430336d11bb2a75e27cce54cdd/blob @@ -0,0 +1,2102 @@ +"""Test the split module""" + +import re +import warnings +from itertools import combinations, combinations_with_replacement, permutations + +import numpy as np +import pytest +from scipy import stats +from scipy.sparse import issparse +from scipy.special import comb + +from sklearn import config_context +from sklearn.datasets import load_digits, make_classification +from sklearn.dummy import DummyClassifier +from sklearn.model_selection import ( + GridSearchCV, + GroupKFold, + GroupShuffleSplit, + KFold, + LeaveOneGroupOut, + LeaveOneOut, + LeavePGroupsOut, + LeavePOut, + PredefinedSplit, + RepeatedKFold, + RepeatedStratifiedKFold, + ShuffleSplit, + StratifiedGroupKFold, + StratifiedKFold, + StratifiedShuffleSplit, + TimeSeriesSplit, + check_cv, + cross_val_score, + train_test_split, +) +from sklearn.model_selection._split import ( + _build_repr, + _validate_shuffle_split, + _yields_constant_splits, +) +from sklearn.svm import SVC +from sklearn.tests.metadata_routing_common import assert_request_is_empty +from sklearn.utils._array_api import ( + _convert_to_numpy, + _get_namespace_device_dtype_ids, + get_namespace, + yield_namespace_device_dtype_combinations, +) +from sklearn.utils._array_api import ( + device as array_api_device, +) +from sklearn.utils._mocking import MockDataFrame +from sklearn.utils._testing import ( + assert_allclose, + assert_array_almost_equal, + assert_array_equal, + ignore_warnings, +) +from sklearn.utils.estimator_checks import ( + _array_api_for_tests, +) +from sklearn.utils.fixes import COO_CONTAINERS, CSC_CONTAINERS, CSR_CONTAINERS +from sklearn.utils.validation import _num_samples + +NO_GROUP_SPLITTERS = [ + KFold(), + StratifiedKFold(), + TimeSeriesSplit(), + LeaveOneOut(), + LeavePOut(p=2), + ShuffleSplit(), + StratifiedShuffleSplit(test_size=0.5), + PredefinedSplit([1, 1, 2, 2]), + RepeatedKFold(), + RepeatedStratifiedKFold(), +] + +GROUP_SPLITTERS = [ + GroupKFold(), + LeavePGroupsOut(n_groups=1), + StratifiedGroupKFold(), + LeaveOneGroupOut(), + GroupShuffleSplit(), +] +GROUP_SPLITTER_NAMES = set(splitter.__class__.__name__ for splitter in GROUP_SPLITTERS) + +ALL_SPLITTERS = NO_GROUP_SPLITTERS + GROUP_SPLITTERS # type: ignore[list-item] + +SPLITTERS_REQUIRING_TARGET = [ + StratifiedKFold(), + StratifiedShuffleSplit(), + RepeatedStratifiedKFold(), +] + +X = np.ones(10) +y = np.arange(10) // 2 +test_groups = ( + np.array([1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3]), + np.array([0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3]), + np.array([0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2]), + np.array([1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4]), + [1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3], + ["1", "1", "1", "1", "2", "2", "2", "3", "3", "3", "3", "3"], +) +digits = load_digits() + +pytestmark = pytest.mark.filterwarnings( + "error:The groups parameter:UserWarning:sklearn.*" +) + + +def _split(splitter, X, y, groups): + if splitter.__class__.__name__ in GROUP_SPLITTER_NAMES: + return splitter.split(X, y, groups=groups) + else: + return splitter.split(X, y) + + +def test_cross_validator_with_default_params(): + n_samples = 4 + n_unique_groups = 4 + n_splits = 2 + p = 2 + n_shuffle_splits = 10 # (the default value) + + X = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) + X_1d = np.array([1, 2, 3, 4]) + y = np.array([1, 1, 2, 2]) + groups = np.array([1, 2, 3, 4]) + loo = LeaveOneOut() + lpo = LeavePOut(p) + kf = KFold(n_splits) + skf = StratifiedKFold(n_splits) + lolo = LeaveOneGroupOut() + lopo = LeavePGroupsOut(p) + ss = ShuffleSplit(random_state=0) + ps = PredefinedSplit([1, 1, 2, 2]) # n_splits = np of unique folds = 2 + sgkf = StratifiedGroupKFold(n_splits) + + loo_repr = "LeaveOneOut()" + lpo_repr = "LeavePOut(p=2)" + kf_repr = "KFold(n_splits=2, random_state=None, shuffle=False)" + skf_repr = "StratifiedKFold(n_splits=2, random_state=None, shuffle=False)" + lolo_repr = "LeaveOneGroupOut()" + lopo_repr = "LeavePGroupsOut(n_groups=2)" + ss_repr = ( + "ShuffleSplit(n_splits=10, random_state=0, test_size=None, train_size=None)" + ) + ps_repr = "PredefinedSplit(test_fold=array([1, 1, 2, 2]))" + sgkf_repr = "StratifiedGroupKFold(n_splits=2, random_state=None, shuffle=False)" + + n_splits_expected = [ + n_samples, + comb(n_samples, p), + n_splits, + n_splits, + n_unique_groups, + comb(n_unique_groups, p), + n_shuffle_splits, + 2, + n_splits, + ] + + for i, (cv, cv_repr) in enumerate( + zip( + [loo, lpo, kf, skf, lolo, lopo, ss, ps, sgkf], + [ + loo_repr, + lpo_repr, + kf_repr, + skf_repr, + lolo_repr, + lopo_repr, + ss_repr, + ps_repr, + sgkf_repr, + ], + ) + ): + # Test if get_n_splits works correctly + assert n_splits_expected[i] == cv.get_n_splits(X, y, groups) + + # Test if the cross-validator works as expected even if + # the data is 1d + np.testing.assert_equal( + list(_split(cv, X, y, groups)), list(_split(cv, X_1d, y, groups)) + ) + # Test that train, test indices returned are integers + for train, test in _split(cv, X, y, groups): + assert np.asarray(train).dtype.kind == "i" + assert np.asarray(test).dtype.kind == "i" + + # Test if the repr works without any errors + assert cv_repr == repr(cv) + + # ValueError for get_n_splits methods + msg = "The 'X' parameter should not be None." + with pytest.raises(ValueError, match=msg): + loo.get_n_splits(None, y, groups) + with pytest.raises(ValueError, match=msg): + lpo.get_n_splits(None, y, groups) + + +def test_2d_y(): + # smoke test for 2d y and multi-label + n_samples = 30 + rng = np.random.RandomState(1) + X = rng.randint(0, 3, size=(n_samples, 2)) + y = rng.randint(0, 3, size=(n_samples,)) + y_2d = y.reshape(-1, 1) + y_multilabel = rng.randint(0, 2, size=(n_samples, 3)) + groups = rng.randint(0, 3, size=(n_samples,)) + splitters = [ + LeaveOneOut(), + LeavePOut(p=2), + KFold(), + StratifiedKFold(), + RepeatedKFold(), + RepeatedStratifiedKFold(), + StratifiedGroupKFold(), + ShuffleSplit(), + StratifiedShuffleSplit(test_size=0.5), + GroupShuffleSplit(), + LeaveOneGroupOut(), + LeavePGroupsOut(n_groups=2), + GroupKFold(n_splits=3), + TimeSeriesSplit(), + PredefinedSplit(test_fold=groups), + ] + for splitter in splitters: + list(_split(splitter, X, y, groups=groups)) + list(_split(splitter, X, y_2d, groups=groups)) + try: + list(_split(splitter, X, y_multilabel, groups=groups)) + except ValueError as e: + allowed_target_types = ("binary", "multiclass") + msg = "Supported target types are: {}. Got 'multilabel".format( + allowed_target_types + ) + assert msg in str(e) + + +def check_valid_split(train, test, n_samples=None): + # Use python sets to get more informative assertion failure messages + train, test = set(train), set(test) + + # Train and test split should not overlap + assert train.intersection(test) == set() + + if n_samples is not None: + # Check that the union of train an test split cover all the indices + assert train.union(test) == set(range(n_samples)) + + +def check_cv_coverage(cv, X, y, groups, expected_n_splits): + n_samples = _num_samples(X) + # Check that a all the samples appear at least once in a test fold + assert cv.get_n_splits(X, y, groups) == expected_n_splits + + collected_test_samples = set() + iterations = 0 + for train, test in cv.split(X, y, groups): + check_valid_split(train, test, n_samples=n_samples) + iterations += 1 + collected_test_samples.update(test) + + # Check that the accumulated test samples cover the whole dataset + assert iterations == expected_n_splits + if n_samples is not None: + assert collected_test_samples == set(range(n_samples)) + + +def test_kfold_valueerrors(): + X1 = np.array([[1, 2], [3, 4], [5, 6]]) + X2 = np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]) + # Check that errors are raised if there is not enough samples + (ValueError, next, KFold(4).split(X1)) + + # Check that a warning is raised if the least populated class has too few + # members. + y = np.array([3, 3, -1, -1, 3]) + + skf_3 = StratifiedKFold(3) + with pytest.warns(Warning, match="The least populated class"): + next(skf_3.split(X2, y)) + + sgkf_3 = StratifiedGroupKFold(3) + naive_groups = np.arange(len(y)) + with pytest.warns(Warning, match="The least populated class"): + next(sgkf_3.split(X2, y, naive_groups)) + + # Check that despite the warning the folds are still computed even + # though all the classes are not necessarily represented at on each + # side of the split at each split + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + check_cv_coverage(skf_3, X2, y, groups=None, expected_n_splits=3) + + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + check_cv_coverage(sgkf_3, X2, y, groups=naive_groups, expected_n_splits=3) + + # Check that errors are raised if all n_groups for individual + # classes are less than n_splits. + y = np.array([3, 3, -1, -1, 2]) + + with pytest.raises(ValueError): + next(skf_3.split(X2, y)) + with pytest.raises(ValueError): + next(sgkf_3.split(X2, y)) + + # Error when number of folds is <= 1 + with pytest.raises(ValueError): + KFold(0) + with pytest.raises(ValueError): + KFold(1) + error_string = "k-fold cross-validation requires at least one train/test split" + with pytest.raises(ValueError, match=error_string): + StratifiedKFold(0) + with pytest.raises(ValueError, match=error_string): + StratifiedKFold(1) + with pytest.raises(ValueError, match=error_string): + StratifiedGroupKFold(0) + with pytest.raises(ValueError, match=error_string): + StratifiedGroupKFold(1) + + # When n_splits is not integer: + with pytest.raises(ValueError): + KFold(1.5) + with pytest.raises(ValueError): + KFold(2.0) + with pytest.raises(ValueError): + StratifiedKFold(1.5) + with pytest.raises(ValueError): + StratifiedKFold(2.0) + with pytest.raises(ValueError): + StratifiedGroupKFold(1.5) + with pytest.raises(ValueError): + StratifiedGroupKFold(2.0) + + # When shuffle is not a bool: + with pytest.raises(TypeError): + KFold(n_splits=4, shuffle=None) + + +def test_kfold_indices(): + # Check all indices are returned in the test folds + X1 = np.ones(18) + kf = KFold(3) + check_cv_coverage(kf, X1, y=None, groups=None, expected_n_splits=3) + + # Check all indices are returned in the test folds even when equal-sized + # folds are not possible + X2 = np.ones(17) + kf = KFold(3) + check_cv_coverage(kf, X2, y=None, groups=None, expected_n_splits=3) + + # Check if get_n_splits returns the number of folds + assert 5 == KFold(5).get_n_splits(X2) + + +def test_kfold_no_shuffle(): + # Manually check that KFold preserves the data ordering on toy datasets + X2 = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] + + splits = KFold(2).split(X2[:-1]) + train, test = next(splits) + assert_array_equal(test, [0, 1]) + assert_array_equal(train, [2, 3]) + + train, test = next(splits) + assert_array_equal(test, [2, 3]) + assert_array_equal(train, [0, 1]) + + splits = KFold(2).split(X2) + train, test = next(splits) + assert_array_equal(test, [0, 1, 2]) + assert_array_equal(train, [3, 4]) + + train, test = next(splits) + assert_array_equal(test, [3, 4]) + assert_array_equal(train, [0, 1, 2]) + + +def test_stratified_kfold_no_shuffle(): + # Manually check that StratifiedKFold preserves the data ordering as much + # as possible on toy datasets in order to avoid hiding sample dependencies + # when possible + X, y = np.ones(4), [1, 1, 0, 0] + splits = StratifiedKFold(2).split(X, y) + train, test = next(splits) + assert_array_equal(test, [0, 2]) + assert_array_equal(train, [1, 3]) + + train, test = next(splits) + assert_array_equal(test, [1, 3]) + assert_array_equal(train, [0, 2]) + + X, y = np.ones(7), [1, 1, 1, 0, 0, 0, 0] + splits = StratifiedKFold(2).split(X, y) + train, test = next(splits) + assert_array_equal(test, [0, 1, 3, 4]) + assert_array_equal(train, [2, 5, 6]) + + train, test = next(splits) + assert_array_equal(test, [2, 5, 6]) + assert_array_equal(train, [0, 1, 3, 4]) + + # Check if get_n_splits returns the number of folds + assert 5 == StratifiedKFold(5).get_n_splits(X, y) + + # Make sure string labels are also supported + X = np.ones(7) + y1 = ["1", "1", "1", "0", "0", "0", "0"] + y2 = [1, 1, 1, 0, 0, 0, 0] + np.testing.assert_equal( + list(StratifiedKFold(2).split(X, y1)), list(StratifiedKFold(2).split(X, y2)) + ) + + # Check equivalence to KFold + y = [0, 1, 0, 1, 0, 1, 0, 1] + X = np.ones_like(y) + np.testing.assert_equal( + list(StratifiedKFold(3).split(X, y)), list(KFold(3).split(X, y)) + ) + + +@pytest.mark.parametrize("shuffle", [False, True]) +@pytest.mark.parametrize("k", [4, 5, 6, 7, 8, 9, 10]) +@pytest.mark.parametrize("kfold", [StratifiedKFold, StratifiedGroupKFold]) +def test_stratified_kfold_ratios(k, shuffle, kfold): + # Check that stratified kfold preserves class ratios in individual splits + # Repeat with shuffling turned off and on + n_samples = 1000 + X = np.ones(n_samples) + y = np.array( + [4] * int(0.10 * n_samples) + + [0] * int(0.89 * n_samples) + + [1] * int(0.01 * n_samples) + ) + # ensure perfect stratification with StratifiedGroupKFold + groups = np.arange(len(y)) + distr = np.bincount(y) / len(y) + + test_sizes = [] + random_state = None if not shuffle else 0 + skf = kfold(k, random_state=random_state, shuffle=shuffle) + for train, test in _split(skf, X, y, groups=groups): + assert_allclose(np.bincount(y[train]) / len(train), distr, atol=0.02) + assert_allclose(np.bincount(y[test]) / len(test), distr, atol=0.02) + test_sizes.append(len(test)) + assert np.ptp(test_sizes) <= 1 + + +@pytest.mark.parametrize("shuffle", [False, True]) +@pytest.mark.parametrize("k", [4, 6, 7]) +@pytest.mark.parametrize("kfold", [StratifiedKFold, StratifiedGroupKFold]) +def test_stratified_kfold_label_invariance(k, shuffle, kfold): + # Check that stratified kfold gives the same indices regardless of labels + n_samples = 100 + y = np.array( + [2] * int(0.10 * n_samples) + + [0] * int(0.89 * n_samples) + + [1] * int(0.01 * n_samples) + ) + X = np.ones(len(y)) + # ensure perfect stratification with StratifiedGroupKFold + groups = np.arange(len(y)) + + def get_splits(y): + random_state = None if not shuffle else 0 + return [ + (list(train), list(test)) + for train, test in _split( + kfold(k, random_state=random_state, shuffle=shuffle), + X, + y, + groups=groups, + ) + ] + + splits_base = get_splits(y) + for perm in permutations([0, 1, 2]): + y_perm = np.take(perm, y) + splits_perm = get_splits(y_perm) + assert splits_perm == splits_base + + +def test_kfold_balance(): + # Check that KFold returns folds with balanced sizes + for i in range(11, 17): + kf = KFold(5).split(X=np.ones(i)) + sizes = [len(test) for _, test in kf] + + assert (np.max(sizes) - np.min(sizes)) <= 1 + assert np.sum(sizes) == i + + +@pytest.mark.parametrize("kfold", [StratifiedKFold, StratifiedGroupKFold]) +def test_stratifiedkfold_balance(kfold): + # Check that KFold returns folds with balanced sizes (only when + # stratification is possible) + # Repeat with shuffling turned off and on + X = np.ones(17) + y = [0] * 3 + [1] * 14 + # ensure perfect stratification with StratifiedGroupKFold + groups = np.arange(len(y)) + + for shuffle in (True, False): + cv = kfold(3, shuffle=shuffle) + for i in range(11, 17): + skf = _split(cv, X[:i], y[:i], groups[:i]) + sizes = [len(test) for _, test in skf] + + assert (np.max(sizes) - np.min(sizes)) <= 1 + assert np.sum(sizes) == i + + +def test_shuffle_kfold(): + # Check the indices are shuffled properly + kf = KFold(3) + kf2 = KFold(3, shuffle=True, random_state=0) + kf3 = KFold(3, shuffle=True, random_state=1) + + X = np.ones(300) + + all_folds = np.zeros(300) + for (tr1, te1), (tr2, te2), (tr3, te3) in zip( + kf.split(X), kf2.split(X), kf3.split(X) + ): + for tr_a, tr_b in combinations((tr1, tr2, tr3), 2): + # Assert that there is no complete overlap + assert len(np.intersect1d(tr_a, tr_b)) != len(tr1) + + # Set all test indices in successive iterations of kf2 to 1 + all_folds[te2] = 1 + + # Check that all indices are returned in the different test folds + assert sum(all_folds) == 300 + + +@pytest.mark.parametrize("kfold", [KFold, StratifiedKFold, StratifiedGroupKFold]) +def test_shuffle_kfold_stratifiedkfold_reproducibility(kfold): + X = np.ones(15) # Divisible by 3 + y = [0] * 7 + [1] * 8 + groups_1 = np.arange(len(y)) + X2 = np.ones(16) # Not divisible by 3 + y2 = [0] * 8 + [1] * 8 + groups_2 = np.arange(len(y2)) + + # Check that when the shuffle is True, multiple split calls produce the + # same split when random_state is int + kf = kfold(3, shuffle=True, random_state=0) + + np.testing.assert_equal( + list(_split(kf, X, y, groups_1)), list(_split(kf, X, y, groups_1)) + ) + + # Check that when the shuffle is True, multiple split calls often + # (not always) produce different splits when random_state is + # RandomState instance or None + kf = kfold(3, shuffle=True, random_state=np.random.RandomState(0)) + for data in zip((X, X2), (y, y2), (groups_1, groups_2)): + # Test if the two splits are different cv + for (_, test_a), (_, test_b) in zip(_split(kf, *data), _split(kf, *data)): + # cv.split(...) returns an array of tuples, each tuple + # consisting of an array with train indices and test indices + # Ensure that the splits for data are not same + # when random state is not set + with pytest.raises(AssertionError): + np.testing.assert_array_equal(test_a, test_b) + + +def test_shuffle_stratifiedkfold(): + # Check that shuffling is happening when requested, and for proper + # sample coverage + X_40 = np.ones(40) + y = [0] * 20 + [1] * 20 + kf0 = StratifiedKFold(5, shuffle=True, random_state=0) + kf1 = StratifiedKFold(5, shuffle=True, random_state=1) + for (_, test0), (_, test1) in zip(kf0.split(X_40, y), kf1.split(X_40, y)): + assert set(test0) != set(test1) + check_cv_coverage(kf0, X_40, y, groups=None, expected_n_splits=5) + + # Ensure that we shuffle each class's samples with different + # random_state in StratifiedKFold + # See https://github.com/scikit-learn/scikit-learn/pull/13124 + X = np.arange(10) + y = [0] * 5 + [1] * 5 + kf1 = StratifiedKFold(5, shuffle=True, random_state=0) + kf2 = StratifiedKFold(5, shuffle=True, random_state=1) + test_set1 = sorted([tuple(s[1]) for s in kf1.split(X, y)]) + test_set2 = sorted([tuple(s[1]) for s in kf2.split(X, y)]) + assert test_set1 != test_set2 + + +def test_shuffle_groupkfold(): + # Check that shuffling is happening when requested, and for proper + # sample coverage + X = np.ones(40) + y = [0] * 20 + [1] * 20 + groups = np.arange(40) // 3 + gkf0 = GroupKFold(4, shuffle=True, random_state=0) + gkf1 = GroupKFold(4, shuffle=True, random_state=1) + + # Check that the groups are shuffled differently + test_groups0 = [ + set(groups[test_idx]) for _, test_idx in gkf0.split(X, None, groups) + ] + test_groups1 = [ + set(groups[test_idx]) for _, test_idx in gkf1.split(X, None, groups) + ] + for g0, g1 in zip(test_groups0, test_groups1): + assert g0 != g1, "Test groups should differ with different random states" + + # Check coverage and splits + check_cv_coverage(gkf0, X, y, groups, expected_n_splits=4) + check_cv_coverage(gkf1, X, y, groups, expected_n_splits=4) + + +def test_kfold_can_detect_dependent_samples_on_digits(): # see #2372 + # The digits samples are dependent: they are apparently grouped by authors + # although we don't have any information on the groups segment locations + # for this data. We can highlight this fact by computing k-fold cross- + # validation with and without shuffling: we observe that the shuffling case + # wrongly makes the IID assumption and is therefore too optimistic: it + # estimates a much higher accuracy (around 0.93) than that the non + # shuffling variant (around 0.81). + + X, y = digits.data[:600], digits.target[:600] + model = SVC(C=10, gamma=0.005) + + n_splits = 3 + + cv = KFold(n_splits=n_splits, shuffle=False) + mean_score = cross_val_score(model, X, y, cv=cv).mean() + assert 0.92 > mean_score + assert mean_score > 0.80 + + # Shuffling the data artificially breaks the dependency and hides the + # overfitting of the model with regards to the writing style of the authors + # by yielding a seriously overestimated score: + + cv = KFold(n_splits, shuffle=True, random_state=0) + mean_score = cross_val_score(model, X, y, cv=cv).mean() + assert mean_score > 0.92 + + cv = KFold(n_splits, shuffle=True, random_state=1) + mean_score = cross_val_score(model, X, y, cv=cv).mean() + assert mean_score > 0.92 + + # Similarly, StratifiedKFold should try to shuffle the data as little + # as possible (while respecting the balanced class constraints) + # and thus be able to detect the dependency by not overestimating + # the CV score either. As the digits dataset is approximately balanced + # the estimated mean score is close to the score measured with + # non-shuffled KFold + + cv = StratifiedKFold(n_splits) + mean_score = cross_val_score(model, X, y, cv=cv).mean() + assert 0.94 > mean_score + assert mean_score > 0.80 + + +def test_stratified_group_kfold_trivial(): + sgkf = StratifiedGroupKFold(n_splits=3) + # Trivial example - groups with the same distribution + y = np.array([1] * 6 + [0] * 12) + X = np.ones_like(y).reshape(-1, 1) + groups = np.asarray((1, 2, 3, 4, 5, 6, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6)) + distr = np.bincount(y) / len(y) + test_sizes = [] + for train, test in sgkf.split(X, y, groups): + # check group constraint + assert np.intersect1d(groups[train], groups[test]).size == 0 + # check y distribution + assert_allclose(np.bincount(y[train]) / len(train), distr, atol=0.02) + assert_allclose(np.bincount(y[test]) / len(test), distr, atol=0.02) + test_sizes.append(len(test)) + assert np.ptp(test_sizes) <= 1 + + +def test_stratified_group_kfold_approximate(): + # Not perfect stratification (even though it is possible) because of + # iteration over groups + sgkf = StratifiedGroupKFold(n_splits=3) + y = np.array([1] * 6 + [0] * 12) + X = np.ones_like(y).reshape(-1, 1) + groups = np.array([1, 2, 3, 3, 4, 4, 1, 1, 2, 2, 3, 4, 5, 5, 5, 6, 6, 6]) + expected = np.asarray([[0.833, 0.166], [0.666, 0.333], [0.5, 0.5]]) + test_sizes = [] + for (train, test), expect_dist in zip(sgkf.split(X, y, groups), expected): + # check group constraint + assert np.intersect1d(groups[train], groups[test]).size == 0 + split_dist = np.bincount(y[test]) / len(test) + assert_allclose(split_dist, expect_dist, atol=0.001) + test_sizes.append(len(test)) + assert np.ptp(test_sizes) <= 1 + + +@pytest.mark.parametrize( + "y, groups, expected", + [ + ( + np.array([0] * 6 + [1] * 6), + np.array([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6]), + np.asarray([[0.5, 0.5], [0.5, 0.5], [0.5, 0.5]]), + ), + ( + np.array([0] * 9 + [1] * 3), + np.array([1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 6]), + np.asarray([[0.75, 0.25], [0.75, 0.25], [0.75, 0.25]]), + ), + ], +) +def test_stratified_group_kfold_homogeneous_groups(y, groups, expected): + sgkf = StratifiedGroupKFold(n_splits=3) + X = np.ones_like(y).reshape(-1, 1) + for (train, test), expect_dist in zip(sgkf.split(X, y, groups), expected): + # check group constraint + assert np.intersect1d(groups[train], groups[test]).size == 0 + split_dist = np.bincount(y[test]) / len(test) + assert_allclose(split_dist, expect_dist, atol=0.001) + + +@pytest.mark.parametrize("cls_distr", [(0.4, 0.6), (0.3, 0.7), (0.2, 0.8), (0.8, 0.2)]) +@pytest.mark.parametrize("n_groups", [5, 30, 70]) +def test_stratified_group_kfold_against_group_kfold(cls_distr, n_groups): + # Check that given sufficient amount of samples StratifiedGroupKFold + # produces better stratified folds than regular GroupKFold + n_splits = 5 + sgkf = StratifiedGroupKFold(n_splits=n_splits) + gkf = GroupKFold(n_splits=n_splits) + rng = np.random.RandomState(0) + n_points = 1000 + y = rng.choice(2, size=n_points, p=cls_distr) + X = np.ones_like(y).reshape(-1, 1) + g = rng.choice(n_groups, n_points) + sgkf_folds = sgkf.split(X, y, groups=g) + gkf_folds = gkf.split(X, y, groups=g) + sgkf_entr = 0 + gkf_entr = 0 + for (sgkf_train, sgkf_test), (_, gkf_test) in zip(sgkf_folds, gkf_folds): + # check group constraint + assert np.intersect1d(g[sgkf_train], g[sgkf_test]).size == 0 + sgkf_distr = np.bincount(y[sgkf_test]) / len(sgkf_test) + gkf_distr = np.bincount(y[gkf_test]) / len(gkf_test) + sgkf_entr += stats.entropy(sgkf_distr, qk=cls_distr) + gkf_entr += stats.entropy(gkf_distr, qk=cls_distr) + sgkf_entr /= n_splits + gkf_entr /= n_splits + assert sgkf_entr <= gkf_entr + + +def test_shuffle_split(): + ss1 = ShuffleSplit(test_size=0.2, random_state=0).split(X) + ss2 = ShuffleSplit(test_size=2, random_state=0).split(X) + ss3 = ShuffleSplit(test_size=np.int32(2), random_state=0).split(X) + ss4 = ShuffleSplit(test_size=2, random_state=0).split(X) + for t1, t2, t3, t4 in zip(ss1, ss2, ss3, ss4): + assert_array_equal(t1[0], t2[0]) + assert_array_equal(t2[0], t3[0]) + assert_array_equal(t3[0], t4[0]) + assert_array_equal(t1[1], t2[1]) + assert_array_equal(t2[1], t3[1]) + assert_array_equal(t3[1], t4[1]) + + +@pytest.mark.parametrize("split_class", [ShuffleSplit, StratifiedShuffleSplit]) +@pytest.mark.parametrize( + "train_size, exp_train, exp_test", [(None, 9, 1), (8, 8, 2), (0.8, 8, 2)] +) +def test_shuffle_split_default_test_size(split_class, train_size, exp_train, exp_test): + # Check that the default value has the expected behavior, i.e. 0.1 if both + # unspecified or complement train_size unless both are specified. + X = np.ones(10) + y = np.ones(10) + + X_train, X_test = next(split_class(train_size=train_size).split(X, y)) + + assert len(X_train) == exp_train + assert len(X_test) == exp_test + + +@pytest.mark.parametrize( + "train_size, exp_train, exp_test", [(None, 8, 2), (7, 7, 3), (0.7, 7, 3)] +) +def test_group_shuffle_split_default_test_size(train_size, exp_train, exp_test): + # Check that the default value has the expected behavior, i.e. 0.2 if both + # unspecified or complement train_size unless both are specified. + X = np.ones(10) + y = np.ones(10) + groups = range(10) + + X_train, X_test = next(GroupShuffleSplit(train_size=train_size).split(X, y, groups)) + + assert len(X_train) == exp_train + assert len(X_test) == exp_test + + +def test_stratified_shuffle_split_init(): + X = np.arange(7) + y = np.asarray([0, 1, 1, 1, 2, 2, 2]) + # Check that error is raised if there is a class with only one sample + with pytest.raises(ValueError): + next(StratifiedShuffleSplit(3, test_size=0.2).split(X, y)) + + # Check that error is raised if the test set size is smaller than n_classes + with pytest.raises(ValueError): + next(StratifiedShuffleSplit(3, test_size=2).split(X, y)) + # Check that error is raised if the train set size is smaller than + # n_classes + with pytest.raises(ValueError): + next(StratifiedShuffleSplit(3, test_size=3, train_size=2).split(X, y)) + + X = np.arange(9) + y = np.asarray([0, 0, 0, 1, 1, 1, 2, 2, 2]) + + # Train size or test size too small + with pytest.raises(ValueError): + next(StratifiedShuffleSplit(train_size=2).split(X, y)) + with pytest.raises(ValueError): + next(StratifiedShuffleSplit(test_size=2).split(X, y)) + + +def test_stratified_shuffle_split_respects_test_size(): + y = np.array([0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2]) + test_size = 5 + train_size = 10 + sss = StratifiedShuffleSplit( + 6, test_size=test_size, train_size=train_size, random_state=0 + ).split(np.ones(len(y)), y) + for train, test in sss: + assert len(train) == train_size + assert len(test) == test_size + + +def test_stratified_shuffle_split_iter(): + ys = [ + np.array([1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3]), + np.array([0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3]), + np.array([0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2] * 2), + np.array([1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4]), + np.array([-1] * 800 + [1] * 50), + np.concatenate([[i] * (100 + i) for i in range(11)]), + [1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3], + ["1", "1", "1", "1", "2", "2", "2", "3", "3", "3", "3", "3"], + ] + + for y in ys: + sss = StratifiedShuffleSplit(6, test_size=0.33, random_state=0).split( + np.ones(len(y)), y + ) + y = np.asanyarray(y) # To make it indexable for y[train] + # this is how test-size is computed internally + # in _validate_shuffle_split + test_size = np.ceil(0.33 * len(y)) + train_size = len(y) - test_size + for train, test in sss: + assert_array_equal(np.unique(y[train]), np.unique(y[test])) + # Checks if folds keep classes proportions + p_train = np.bincount(np.unique(y[train], return_inverse=True)[1]) / float( + len(y[train]) + ) + p_test = np.bincount(np.unique(y[test], return_inverse=True)[1]) / float( + len(y[test]) + ) + assert_array_almost_equal(p_train, p_test, 1) + assert len(train) + len(test) == y.size + assert len(train) == train_size + assert len(test) == test_size + assert_array_equal(np.intersect1d(train, test), []) + + +def test_stratified_shuffle_split_even(): + # Test the StratifiedShuffleSplit, indices are drawn with a + # equal chance + n_folds = 5 + n_splits = 1000 + + def assert_counts_are_ok(idx_counts, p): + # Here we test that the distribution of the counts + # per index is close enough to a binomial + threshold = 0.05 / n_splits + bf = stats.binom(n_splits, p) + for count in idx_counts: + prob = bf.pmf(count) + assert prob > threshold, ( + "An index is not drawn with chance corresponding to even draws" + ) + + for n_samples in (6, 22): + groups = np.array((n_samples // 2) * [0, 1]) + splits = StratifiedShuffleSplit( + n_splits=n_splits, test_size=1.0 / n_folds, random_state=0 + ) + + train_counts = [0] * n_samples + test_counts = [0] * n_samples + n_splits_actual = 0 + for train, test in splits.split(X=np.ones(n_samples), y=groups): + n_splits_actual += 1 + for counter, ids in [(train_counts, train), (test_counts, test)]: + for id in ids: + counter[id] += 1 + assert n_splits_actual == n_splits + + n_train, n_test = _validate_shuffle_split( + n_samples, test_size=1.0 / n_folds, train_size=1.0 - (1.0 / n_folds) + ) + + assert len(train) == n_train + assert len(test) == n_test + assert len(set(train).intersection(test)) == 0 + + group_counts = np.unique(groups) + assert splits.test_size == 1.0 / n_folds + assert n_train + n_test == len(groups) + assert len(group_counts) == 2 + ex_test_p = float(n_test) / n_samples + ex_train_p = float(n_train) / n_samples + + assert_counts_are_ok(train_counts, ex_train_p) + assert_counts_are_ok(test_counts, ex_test_p) + + +def test_stratified_shuffle_split_overlap_train_test_bug(): + # See https://github.com/scikit-learn/scikit-learn/issues/6121 for + # the original bug report + y = [0, 1, 2, 3] * 3 + [4, 5] * 5 + X = np.ones_like(y) + + sss = StratifiedShuffleSplit(n_splits=1, test_size=0.5, random_state=0) + + train, test = next(sss.split(X=X, y=y)) + + # no overlap + assert_array_equal(np.intersect1d(train, test), []) + + # complete partition + assert_array_equal(np.union1d(train, test), np.arange(len(y))) + + +def test_stratified_shuffle_split_multilabel(): + # fix for issue 9037 + for y in [ + np.array([[0, 1], [1, 0], [1, 0], [0, 1]]), + np.array([[0, 1], [1, 1], [1, 1], [0, 1]]), + ]: + X = np.ones_like(y) + sss = StratifiedShuffleSplit(n_splits=1, test_size=0.5, random_state=0) + train, test = next(sss.split(X=X, y=y)) + y_train = y[train] + y_test = y[test] + + # no overlap + assert_array_equal(np.intersect1d(train, test), []) + + # complete partition + assert_array_equal(np.union1d(train, test), np.arange(len(y))) + + # correct stratification of entire rows + # (by design, here y[:, 0] uniquely determines the entire row of y) + expected_ratio = np.mean(y[:, 0]) + assert expected_ratio == np.mean(y_train[:, 0]) + assert expected_ratio == np.mean(y_test[:, 0]) + + +def test_stratified_shuffle_split_multilabel_many_labels(): + # fix in PR #9922: for multilabel data with > 1000 labels, str(row) + # truncates with an ellipsis for elements in positions 4 through + # len(row) - 4, so labels were not being correctly split using the powerset + # method for transforming a multilabel problem to a multiclass one; this + # test checks that this problem is fixed. + row_with_many_zeros = [1, 0, 1] + [0] * 1000 + [1, 0, 1] + row_with_many_ones = [1, 0, 1] + [1] * 1000 + [1, 0, 1] + y = np.array([row_with_many_zeros] * 10 + [row_with_many_ones] * 100) + X = np.ones_like(y) + + sss = StratifiedShuffleSplit(n_splits=1, test_size=0.5, random_state=0) + train, test = next(sss.split(X=X, y=y)) + y_train = y[train] + y_test = y[test] + + # correct stratification of entire rows + # (by design, here y[:, 4] uniquely determines the entire row of y) + expected_ratio = np.mean(y[:, 4]) + assert expected_ratio == np.mean(y_train[:, 4]) + assert expected_ratio == np.mean(y_test[:, 4]) + + +def test_predefinedsplit_with_kfold_split(): + # Check that PredefinedSplit can reproduce a split generated by Kfold. + folds = np.full(10, -1.0) + kf_train = [] + kf_test = [] + for i, (train_ind, test_ind) in enumerate(KFold(5, shuffle=True).split(X)): + kf_train.append(train_ind) + kf_test.append(test_ind) + folds[test_ind] = i + ps = PredefinedSplit(folds) + # n_splits is simply the no of unique folds + assert len(np.unique(folds)) == ps.get_n_splits() + ps_train, ps_test = zip(*ps.split()) + assert_array_equal(ps_train, kf_train) + assert_array_equal(ps_test, kf_test) + + +def test_group_shuffle_split(): + for groups_i in test_groups: + X = y = np.ones(len(groups_i)) + n_splits = 6 + test_size = 1.0 / 3 + slo = GroupShuffleSplit(n_splits, test_size=test_size, random_state=0) + + # Make sure the repr works + repr(slo) + + # Test that the length is correct + assert slo.get_n_splits(X, y, groups=groups_i) == n_splits + + l_unique = np.unique(groups_i) + l = np.asarray(groups_i) + + for train, test in slo.split(X, y, groups=groups_i): + # First test: no train group is in the test set and vice versa + l_train_unique = np.unique(l[train]) + l_test_unique = np.unique(l[test]) + assert not np.any(np.isin(l[train], l_test_unique)) + assert not np.any(np.isin(l[test], l_train_unique)) + + # Second test: train and test add up to all the data + assert l[train].size + l[test].size == l.size + + # Third test: train and test are disjoint + assert_array_equal(np.intersect1d(train, test), []) + + # Fourth test: + # unique train and test groups are correct, +- 1 for rounding error + assert abs(len(l_test_unique) - round(test_size * len(l_unique))) <= 1 + assert ( + abs(len(l_train_unique) - round((1.0 - test_size) * len(l_unique))) <= 1 + ) + + +def test_leave_one_p_group_out(): + logo = LeaveOneGroupOut() + lpgo_1 = LeavePGroupsOut(n_groups=1) + lpgo_2 = LeavePGroupsOut(n_groups=2) + + # Make sure the repr works + assert repr(logo) == "LeaveOneGroupOut()" + assert repr(lpgo_1) == "LeavePGroupsOut(n_groups=1)" + assert repr(lpgo_2) == "LeavePGroupsOut(n_groups=2)" + assert repr(LeavePGroupsOut(n_groups=3)) == "LeavePGroupsOut(n_groups=3)" + + for j, (cv, p_groups_out) in enumerate(((logo, 1), (lpgo_1, 1), (lpgo_2, 2))): + for i, groups_i in enumerate(test_groups): + n_groups = len(np.unique(groups_i)) + n_splits = n_groups if p_groups_out == 1 else n_groups * (n_groups - 1) / 2 + X = y = np.ones(len(groups_i)) + + # Test that the length is correct + assert cv.get_n_splits(X, y, groups=groups_i) == n_splits + + groups_arr = np.asarray(groups_i) + + # Split using the original list / array / list of string groups_i + for train, test in cv.split(X, y, groups=groups_i): + # First test: no train group is in the test set and vice versa + assert_array_equal( + np.intersect1d(groups_arr[train], groups_arr[test]).tolist(), [] + ) + + # Second test: train and test add up to all the data + assert len(train) + len(test) == len(groups_i) + + # Third test: + # The number of groups in test must be equal to p_groups_out + assert np.unique(groups_arr[test]).shape[0], p_groups_out + + # check get_n_splits() with dummy parameters + assert logo.get_n_splits(None, None, ["a", "b", "c", "b", "c"]) == 3 + assert logo.get_n_splits(groups=[1.0, 1.1, 1.0, 1.2]) == 3 + assert lpgo_2.get_n_splits(None, None, np.arange(4)) == 6 + assert lpgo_1.get_n_splits(groups=np.arange(4)) == 4 + + # raise ValueError if a `groups` parameter is illegal + with pytest.raises(ValueError): + logo.get_n_splits(None, None, [0.0, np.nan, 0.0]) + with pytest.raises(ValueError): + lpgo_2.get_n_splits(None, None, [0.0, np.inf, 0.0]) + + msg = "The 'groups' parameter should not be None." + with pytest.raises(ValueError, match=msg): + logo.get_n_splits(None, None, None) + with pytest.raises(ValueError, match=msg): + lpgo_1.get_n_splits(None, None, None) + + +def test_leave_group_out_changing_groups(): + # Check that LeaveOneGroupOut and LeavePGroupsOut work normally if + # the groups variable is changed before calling split + groups = np.array([0, 1, 2, 1, 1, 2, 0, 0]) + X = np.ones(len(groups)) + groups_changing = np.array(groups, copy=True) + lolo = LeaveOneGroupOut().split(X, groups=groups) + lolo_changing = LeaveOneGroupOut().split(X, groups=groups) + lplo = LeavePGroupsOut(n_groups=2).split(X, groups=groups) + lplo_changing = LeavePGroupsOut(n_groups=2).split(X, groups=groups) + groups_changing[:] = 0 + for llo, llo_changing in [(lolo, lolo_changing), (lplo, lplo_changing)]: + for (train, test), (train_chan, test_chan) in zip(llo, llo_changing): + assert_array_equal(train, train_chan) + assert_array_equal(test, test_chan) + + # n_splits = no of 2 (p) group combinations of the unique groups = 3C2 = 3 + assert 3 == LeavePGroupsOut(n_groups=2).get_n_splits(X, y=X, groups=groups) + # n_splits = no of unique groups (C(uniq_lbls, 1) = n_unique_groups) + assert 3 == LeaveOneGroupOut().get_n_splits(X, y=X, groups=groups) + + +def test_leave_group_out_order_dependence(): + # Check that LeaveOneGroupOut orders the splits according to the index + # of the group left out. + groups = np.array([2, 2, 0, 0, 1, 1]) + X = np.ones(len(groups)) + + splits = iter(LeaveOneGroupOut().split(X, groups=groups)) + + expected_indices = [ + ([0, 1, 4, 5], [2, 3]), + ([0, 1, 2, 3], [4, 5]), + ([2, 3, 4, 5], [0, 1]), + ] + + for expected_train, expected_test in expected_indices: + train, test = next(splits) + assert_array_equal(train, expected_train) + assert_array_equal(test, expected_test) + + +def test_leave_one_p_group_out_error_on_fewer_number_of_groups(): + X = y = groups = np.ones(0) + msg = re.escape("Found array with 0 sample(s)") + with pytest.raises(ValueError, match=msg): + next(LeaveOneGroupOut().split(X, y, groups)) + + X = y = groups = np.ones(1) + msg = re.escape( + f"The groups parameter contains fewer than 2 unique groups ({groups})." + " LeaveOneGroupOut expects at least 2." + ) + with pytest.raises(ValueError, match=msg): + next(LeaveOneGroupOut().split(X, y, groups)) + + X = y = groups = np.ones(1) + msg = re.escape( + "The groups parameter contains fewer than (or equal to) n_groups " + f"(3) numbers of unique groups ({groups}). LeavePGroupsOut expects " + "that at least n_groups + 1 (4) unique groups " + "be present" + ) + with pytest.raises(ValueError, match=msg): + next(LeavePGroupsOut(n_groups=3).split(X, y, groups)) + + X = y = groups = np.arange(3) + msg = re.escape( + "The groups parameter contains fewer than (or equal to) n_groups " + f"(3) numbers of unique groups ({groups}). LeavePGroupsOut expects " + "that at least n_groups + 1 (4) unique groups " + "be present" + ) + with pytest.raises(ValueError, match=msg): + next(LeavePGroupsOut(n_groups=3).split(X, y, groups)) + + +def test_repeated_cv_value_errors(): + # n_repeats is not integer or <= 0 + for cv in (RepeatedKFold, RepeatedStratifiedKFold): + with pytest.raises(ValueError): + cv(n_repeats=0) + with pytest.raises(ValueError): + cv(n_repeats=1.5) + + +@pytest.mark.parametrize("RepeatedCV", [RepeatedKFold, RepeatedStratifiedKFold]) +def test_repeated_cv_repr(RepeatedCV): + n_splits, n_repeats = 2, 6 + repeated_cv = RepeatedCV(n_splits=n_splits, n_repeats=n_repeats) + repeated_cv_repr = "{}(n_repeats=6, n_splits=2, random_state=None)".format( + repeated_cv.__class__.__name__ + ) + assert repeated_cv_repr == repr(repeated_cv) + + +def test_repeated_kfold_determinstic_split(): + X = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] + random_state = 258173307 + rkf = RepeatedKFold(n_splits=2, n_repeats=2, random_state=random_state) + + # split should produce same and deterministic splits on + # each call + for _ in range(3): + splits = rkf.split(X) + train, test = next(splits) + assert_array_equal(train, [2, 4]) + assert_array_equal(test, [0, 1, 3]) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 3]) + assert_array_equal(test, [2, 4]) + + train, test = next(splits) + assert_array_equal(train, [0, 1]) + assert_array_equal(test, [2, 3, 4]) + + train, test = next(splits) + assert_array_equal(train, [2, 3, 4]) + assert_array_equal(test, [0, 1]) + + with pytest.raises(StopIteration): + next(splits) + + +def test_get_n_splits_for_repeated_kfold(): + n_splits = 3 + n_repeats = 4 + rkf = RepeatedKFold(n_splits=n_splits, n_repeats=n_repeats) + expected_n_splits = n_splits * n_repeats + assert expected_n_splits == rkf.get_n_splits() + + +def test_get_n_splits_for_repeated_stratified_kfold(): + n_splits = 3 + n_repeats = 4 + rskf = RepeatedStratifiedKFold(n_splits=n_splits, n_repeats=n_repeats) + expected_n_splits = n_splits * n_repeats + assert expected_n_splits == rskf.get_n_splits() + + +def test_repeated_stratified_kfold_determinstic_split(): + X = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] + y = [1, 1, 1, 0, 0] + random_state = 1944695409 + rskf = RepeatedStratifiedKFold(n_splits=2, n_repeats=2, random_state=random_state) + + # split should produce same and deterministic splits on + # each call + for _ in range(3): + splits = rskf.split(X, y) + train, test = next(splits) + assert_array_equal(train, [1, 4]) + assert_array_equal(test, [0, 2, 3]) + + train, test = next(splits) + assert_array_equal(train, [0, 2, 3]) + assert_array_equal(test, [1, 4]) + + train, test = next(splits) + assert_array_equal(train, [2, 3]) + assert_array_equal(test, [0, 1, 4]) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 4]) + assert_array_equal(test, [2, 3]) + + with pytest.raises(StopIteration): + next(splits) + + +def test_train_test_split_errors(): + pytest.raises(ValueError, train_test_split) + + pytest.raises(ValueError, train_test_split, range(3), train_size=1.1) + + pytest.raises(ValueError, train_test_split, range(3), test_size=0.6, train_size=0.6) + pytest.raises( + ValueError, + train_test_split, + range(3), + test_size=np.float32(0.6), + train_size=np.float32(0.6), + ) + pytest.raises(ValueError, train_test_split, range(3), test_size="wrong_type") + pytest.raises(ValueError, train_test_split, range(3), test_size=2, train_size=4) + pytest.raises(TypeError, train_test_split, range(3), some_argument=1.1) + pytest.raises(ValueError, train_test_split, range(3), range(42)) + pytest.raises(ValueError, train_test_split, range(10), shuffle=False, stratify=True) + + with pytest.raises( + ValueError, + match=r"train_size=11 should be either positive and " + r"smaller than the number of samples 10 or a " + r"float in the \(0, 1\) range", + ): + train_test_split(range(10), train_size=11, test_size=1) + + +@pytest.mark.parametrize( + "train_size, exp_train, exp_test", [(None, 7, 3), (8, 8, 2), (0.8, 8, 2)] +) +def test_train_test_split_default_test_size(train_size, exp_train, exp_test): + # Check that the default value has the expected behavior, i.e. complement + # train_size unless both are specified. + X_train, X_test = train_test_split(X, train_size=train_size) + + assert len(X_train) == exp_train + assert len(X_test) == exp_test + + +@pytest.mark.parametrize( + "array_namespace, device, dtype_name", + yield_namespace_device_dtype_combinations(), + ids=_get_namespace_device_dtype_ids, +) +@pytest.mark.parametrize( + "shuffle,stratify", + ( + (True, None), + (True, np.hstack((np.ones(6), np.zeros(4)))), + # stratification only works with shuffling + (False, None), + ), +) +def test_array_api_train_test_split( + shuffle, stratify, array_namespace, device, dtype_name +): + xp = _array_api_for_tests(array_namespace, device) + + X = np.arange(100).reshape((10, 10)) + y = np.arange(10) + + X_np = X.astype(dtype_name) + X_xp = xp.asarray(X_np, device=device) + + y_np = y.astype(dtype_name) + y_xp = xp.asarray(y_np, device=device) + + X_train_np, X_test_np, y_train_np, y_test_np = train_test_split( + X_np, y, random_state=0, shuffle=shuffle, stratify=stratify + ) + with config_context(array_api_dispatch=True): + if stratify is not None: + stratify_xp = xp.asarray(stratify) + else: + stratify_xp = stratify + X_train_xp, X_test_xp, y_train_xp, y_test_xp = train_test_split( + X_xp, y_xp, shuffle=shuffle, stratify=stratify_xp, random_state=0 + ) + + # Check that namespace is preserved, has to happen with + # array_api_dispatch enabled. + assert get_namespace(X_train_xp)[0] == get_namespace(X_xp)[0] + assert get_namespace(X_test_xp)[0] == get_namespace(X_xp)[0] + assert get_namespace(y_train_xp)[0] == get_namespace(y_xp)[0] + assert get_namespace(y_test_xp)[0] == get_namespace(y_xp)[0] + + # Check device and dtype is preserved on output + assert array_api_device(X_train_xp) == array_api_device(X_xp) + assert array_api_device(y_train_xp) == array_api_device(y_xp) + assert array_api_device(X_test_xp) == array_api_device(X_xp) + assert array_api_device(y_test_xp) == array_api_device(y_xp) + + assert X_train_xp.dtype == X_xp.dtype + assert y_train_xp.dtype == y_xp.dtype + assert X_test_xp.dtype == X_xp.dtype + assert y_test_xp.dtype == y_xp.dtype + + assert_allclose( + _convert_to_numpy(X_train_xp, xp=xp), + X_train_np, + ) + assert_allclose( + _convert_to_numpy(X_test_xp, xp=xp), + X_test_np, + ) + + +@pytest.mark.parametrize("coo_container", COO_CONTAINERS) +def test_train_test_split(coo_container): + X = np.arange(100).reshape((10, 10)) + X_s = coo_container(X) + y = np.arange(10) + + # simple test + split = train_test_split(X, y, test_size=None, train_size=0.5) + X_train, X_test, y_train, y_test = split + assert len(y_test) == len(y_train) + # test correspondence of X and y + assert_array_equal(X_train[:, 0], y_train * 10) + assert_array_equal(X_test[:, 0], y_test * 10) + + # don't convert lists to anything else by default + split = train_test_split(X, X_s, y.tolist()) + X_train, X_test, X_s_train, X_s_test, y_train, y_test = split + assert isinstance(y_train, list) + assert isinstance(y_test, list) + + # allow nd-arrays + X_4d = np.arange(10 * 5 * 3 * 2).reshape(10, 5, 3, 2) + y_3d = np.arange(10 * 7 * 11).reshape(10, 7, 11) + split = train_test_split(X_4d, y_3d) + assert split[0].shape == (7, 5, 3, 2) + assert split[1].shape == (3, 5, 3, 2) + assert split[2].shape == (7, 7, 11) + assert split[3].shape == (3, 7, 11) + + # test stratification option + y = np.array([1, 1, 1, 1, 2, 2, 2, 2]) + for test_size, exp_test_size in zip([2, 4, 0.25, 0.5, 0.75], [2, 4, 2, 4, 6]): + train, test = train_test_split( + y, test_size=test_size, stratify=y, random_state=0 + ) + assert len(test) == exp_test_size + assert len(test) + len(train) == len(y) + # check the 1:1 ratio of ones and twos in the data is preserved + assert np.sum(train == 1) == np.sum(train == 2) + + # test unshuffled split + y = np.arange(10) + for test_size in [2, 0.2]: + train, test = train_test_split(y, shuffle=False, test_size=test_size) + assert_array_equal(test, [8, 9]) + assert_array_equal(train, [0, 1, 2, 3, 4, 5, 6, 7]) + + +def test_train_test_split_32bit_overflow(): + """Check for integer overflow on 32-bit platforms. + + Non-regression test for: + https://github.com/scikit-learn/scikit-learn/issues/20774 + """ + + # A number 'n' big enough for expression 'n * n * train_size' to cause + # an overflow for signed 32-bit integer + big_number = 100000 + + # Definition of 'y' is a part of reproduction - population for at least + # one class should be in the same order of magnitude as size of X + X = np.arange(big_number) + y = X > (0.99 * big_number) + + split = train_test_split(X, y, stratify=y, train_size=0.25) + X_train, X_test, y_train, y_test = split + + assert X_train.size + X_test.size == big_number + assert y_train.size + y_test.size == big_number + + +def test_train_test_split_pandas(): + # check train_test_split doesn't destroy pandas dataframe + types = [MockDataFrame] + try: + from pandas import DataFrame + + types.append(DataFrame) + except ImportError: + pass + for InputFeatureType in types: + # X dataframe + X_df = InputFeatureType(X) + X_train, X_test = train_test_split(X_df) + assert isinstance(X_train, InputFeatureType) + assert isinstance(X_test, InputFeatureType) + + +@pytest.mark.parametrize( + "sparse_container", COO_CONTAINERS + CSC_CONTAINERS + CSR_CONTAINERS +) +def test_train_test_split_sparse(sparse_container): + # check that train_test_split converts scipy sparse matrices + # to csr, as stated in the documentation + X = np.arange(100).reshape((10, 10)) + X_s = sparse_container(X) + X_train, X_test = train_test_split(X_s) + assert issparse(X_train) and X_train.format == "csr" + assert issparse(X_test) and X_test.format == "csr" + + +def test_train_test_split_mock_pandas(): + # X mock dataframe + X_df = MockDataFrame(X) + X_train, X_test = train_test_split(X_df) + assert isinstance(X_train, MockDataFrame) + assert isinstance(X_test, MockDataFrame) + X_train_arr, X_test_arr = train_test_split(X_df) + + +def test_train_test_split_list_input(): + # Check that when y is a list / list of string labels, it works. + X = np.ones(7) + y1 = ["1"] * 4 + ["0"] * 3 + y2 = np.hstack((np.ones(4), np.zeros(3))) + y3 = y2.tolist() + + for stratify in (True, False): + X_train1, X_test1, y_train1, y_test1 = train_test_split( + X, y1, stratify=y1 if stratify else None, random_state=0 + ) + X_train2, X_test2, y_train2, y_test2 = train_test_split( + X, y2, stratify=y2 if stratify else None, random_state=0 + ) + X_train3, X_test3, y_train3, y_test3 = train_test_split( + X, y3, stratify=y3 if stratify else None, random_state=0 + ) + + np.testing.assert_equal(X_train1, X_train2) + np.testing.assert_equal(y_train2, y_train3) + np.testing.assert_equal(X_test1, X_test3) + np.testing.assert_equal(y_test3, y_test2) + + +@pytest.mark.parametrize( + "test_size, train_size", + [(2.0, None), (1.0, None), (0.1, 0.95), (None, 1j), (11, None), (10, None), (8, 3)], +) +def test_shufflesplit_errors(test_size, train_size): + with pytest.raises(ValueError): + next(ShuffleSplit(test_size=test_size, train_size=train_size).split(X)) + + +def test_shufflesplit_reproducible(): + # Check that iterating twice on the ShuffleSplit gives the same + # sequence of train-test when the random_state is given + ss = ShuffleSplit(random_state=21) + assert_array_equal([a for a, b in ss.split(X)], [a for a, b in ss.split(X)]) + + +def test_stratifiedshufflesplit_list_input(): + # Check that when y is a list / list of string labels, it works. + sss = StratifiedShuffleSplit(test_size=2, random_state=42) + X = np.ones(7) + y1 = ["1"] * 4 + ["0"] * 3 + y2 = np.hstack((np.ones(4), np.zeros(3))) + y3 = y2.tolist() + + np.testing.assert_equal(list(sss.split(X, y1)), list(sss.split(X, y2))) + np.testing.assert_equal(list(sss.split(X, y3)), list(sss.split(X, y2))) + + +def test_train_test_split_allow_nans(): + # Check that train_test_split allows input data with NaNs + X = np.arange(200, dtype=np.float64).reshape(10, -1) + X[2, :] = np.nan + y = np.repeat([0, 1], X.shape[0] / 2) + train_test_split(X, y, test_size=0.2, random_state=42) + + +def test_check_cv(): + X = np.ones(9) + cv = check_cv(3, classifier=False) + # Use numpy.testing.assert_equal which recursively compares + # lists of lists + np.testing.assert_equal(list(KFold(3).split(X)), list(cv.split(X))) + + y_binary = np.array([0, 1, 0, 1, 0, 0, 1, 1, 1]) + cv = check_cv(3, y_binary, classifier=True) + np.testing.assert_equal( + list(StratifiedKFold(3).split(X, y_binary)), list(cv.split(X, y_binary)) + ) + + y_multiclass = np.array([0, 1, 0, 1, 2, 1, 2, 0, 2]) + cv = check_cv(3, y_multiclass, classifier=True) + np.testing.assert_equal( + list(StratifiedKFold(3).split(X, y_multiclass)), list(cv.split(X, y_multiclass)) + ) + # also works with 2d multiclass + y_multiclass_2d = y_multiclass.reshape(-1, 1) + cv = check_cv(3, y_multiclass_2d, classifier=True) + np.testing.assert_equal( + list(StratifiedKFold(3).split(X, y_multiclass_2d)), + list(cv.split(X, y_multiclass_2d)), + ) + + assert not np.all( + next(StratifiedKFold(3).split(X, y_multiclass_2d))[0] + == next(KFold(3).split(X, y_multiclass_2d))[0] + ) + + X = np.ones(5) + y_multilabel = np.array( + [[0, 0, 0, 0], [0, 1, 1, 0], [0, 0, 0, 1], [1, 1, 0, 1], [0, 0, 1, 0]] + ) + cv = check_cv(3, y_multilabel, classifier=True) + np.testing.assert_equal(list(KFold(3).split(X)), list(cv.split(X))) + + y_multioutput = np.array([[1, 2], [0, 3], [0, 0], [3, 1], [2, 0]]) + cv = check_cv(3, y_multioutput, classifier=True) + np.testing.assert_equal(list(KFold(3).split(X)), list(cv.split(X))) + + with pytest.raises(ValueError): + check_cv(cv="lolo") + + +def test_cv_iterable_wrapper(): + kf_iter = KFold().split(X, y) + kf_iter_wrapped = check_cv(kf_iter) + # Since the wrapped iterable is enlisted and stored, + # split can be called any number of times to produce + # consistent results. + np.testing.assert_equal( + list(kf_iter_wrapped.split(X, y)), list(kf_iter_wrapped.split(X, y)) + ) + # If the splits are randomized, successive calls to split yields different + # results + kf_randomized_iter = KFold(shuffle=True, random_state=0).split(X, y) + kf_randomized_iter_wrapped = check_cv(kf_randomized_iter) + # numpy's assert_array_equal properly compares nested lists + np.testing.assert_equal( + list(kf_randomized_iter_wrapped.split(X, y)), + list(kf_randomized_iter_wrapped.split(X, y)), + ) + + try: + splits_are_equal = True + np.testing.assert_equal( + list(kf_iter_wrapped.split(X, y)), + list(kf_randomized_iter_wrapped.split(X, y)), + ) + except AssertionError: + splits_are_equal = False + assert not splits_are_equal, ( + "If the splits are randomized, " + "successive calls to split should yield different results" + ) + + +@pytest.mark.parametrize("kfold", [GroupKFold, StratifiedGroupKFold]) +@pytest.mark.parametrize("shuffle", [True, False]) +def test_group_kfold(kfold, shuffle, global_random_seed): + rng = np.random.RandomState(global_random_seed) + + # Parameters of the test + n_groups = 15 + n_samples = 1000 + n_splits = 5 + + X = y = np.ones(n_samples) + + # Construct the test data + tolerance = 0.05 * n_samples # 5 percent error allowed + groups = rng.randint(0, n_groups, n_samples) + + ideal_n_groups_per_fold = n_samples // n_splits + + len(np.unique(groups)) + # Get the test fold indices from the test set indices of each fold + folds = np.zeros(n_samples) + random_state = None if not shuffle else global_random_seed + lkf = kfold(n_splits=n_splits, shuffle=shuffle, random_state=random_state) + for i, (_, test) in enumerate(lkf.split(X, y, groups)): + folds[test] = i + + # Check that folds have approximately the same size + assert len(folds) == len(groups) + for i in np.unique(folds): + assert tolerance >= abs(sum(folds == i) - ideal_n_groups_per_fold) + + # Check that each group appears only in 1 fold + for group in np.unique(groups): + assert len(np.unique(folds[groups == group])) == 1 + + # Check that no group is on both sides of the split + groups = np.asarray(groups, dtype=object) + for train, test in lkf.split(X, y, groups): + assert len(np.intersect1d(groups[train], groups[test])) == 0 + + # Construct the test data + groups = np.array( + [ + "Albert", + "Jean", + "Bertrand", + "Michel", + "Jean", + "Francis", + "Robert", + "Michel", + "Rachel", + "Lois", + "Michelle", + "Bernard", + "Marion", + "Laura", + "Jean", + "Rachel", + "Franck", + "John", + "Gael", + "Anna", + "Alix", + "Robert", + "Marion", + "David", + "Tony", + "Abel", + "Becky", + "Madmood", + "Cary", + "Mary", + "Alexandre", + "David", + "Francis", + "Barack", + "Abdoul", + "Rasha", + "Xi", + "Silvia", + ] + ) + + n_groups = len(np.unique(groups)) + n_samples = len(groups) + n_splits = 5 + tolerance = 0.05 * n_samples # 5 percent error allowed + ideal_n_groups_per_fold = n_samples // n_splits + + X = y = np.ones(n_samples) + + # Get the test fold indices from the test set indices of each fold + folds = np.zeros(n_samples) + for i, (_, test) in enumerate(lkf.split(X, y, groups)): + folds[test] = i + + # Check that folds have approximately the same size + assert len(folds) == len(groups) + if not shuffle: + for i in np.unique(folds): + assert tolerance >= abs(sum(folds == i) - ideal_n_groups_per_fold) + + # Check that each group appears only in 1 fold + with warnings.catch_warnings(): + warnings.simplefilter("ignore", FutureWarning) + for group in np.unique(groups): + assert len(np.unique(folds[groups == group])) == 1 + + # Check that no group is on both sides of the split + groups = np.asarray(groups, dtype=object) + for train, test in lkf.split(X, y, groups): + assert len(np.intersect1d(groups[train], groups[test])) == 0 + + # groups can also be a list + # use a new instance for reproducibility when shuffle=True + lkf_copy = kfold(n_splits=n_splits, shuffle=shuffle, random_state=random_state) + cv_iter = list(lkf.split(X, y, groups.tolist())) + for (train1, test1), (train2, test2) in zip(lkf_copy.split(X, y, groups), cv_iter): + assert_array_equal(train1, train2) + assert_array_equal(test1, test2) + + # Should fail if there are more folds than groups + groups = np.array([1, 1, 1, 2, 2]) + X = y = np.ones(len(groups)) + with pytest.raises(ValueError, match="Cannot have number of splits.*greater"): + next(GroupKFold(n_splits=3).split(X, y, groups)) + + +def test_time_series_cv(): + X = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14]] + + # Should fail if there are more folds than samples + with pytest.raises(ValueError, match="Cannot have number of folds.*greater"): + next(TimeSeriesSplit(n_splits=7).split(X)) + + tscv = TimeSeriesSplit(2) + + # Manually check that Time Series CV preserves the data + # ordering on toy datasets + splits = tscv.split(X[:-1]) + train, test = next(splits) + assert_array_equal(train, [0, 1]) + assert_array_equal(test, [2, 3]) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 2, 3]) + assert_array_equal(test, [4, 5]) + + splits = TimeSeriesSplit(2).split(X) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 2]) + assert_array_equal(test, [3, 4]) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 2, 3, 4]) + assert_array_equal(test, [5, 6]) + + # Check get_n_splits returns the correct number of splits + splits = TimeSeriesSplit(2).split(X) + n_splits_actual = len(list(splits)) + assert n_splits_actual == tscv.get_n_splits() + assert n_splits_actual == 2 + + +def _check_time_series_max_train_size(splits, check_splits, max_train_size): + for (train, test), (check_train, check_test) in zip(splits, check_splits): + assert_array_equal(test, check_test) + assert len(check_train) <= max_train_size + suffix_start = max(len(train) - max_train_size, 0) + assert_array_equal(check_train, train[suffix_start:]) + + +def test_time_series_max_train_size(): + X = np.zeros((6, 1)) + splits = TimeSeriesSplit(n_splits=3).split(X) + check_splits = TimeSeriesSplit(n_splits=3, max_train_size=3).split(X) + _check_time_series_max_train_size(splits, check_splits, max_train_size=3) + + # Test for the case where the size of a fold is greater than max_train_size + check_splits = TimeSeriesSplit(n_splits=3, max_train_size=2).split(X) + _check_time_series_max_train_size(splits, check_splits, max_train_size=2) + + # Test for the case where the size of each fold is less than max_train_size + check_splits = TimeSeriesSplit(n_splits=3, max_train_size=5).split(X) + _check_time_series_max_train_size(splits, check_splits, max_train_size=2) + + +def test_time_series_test_size(): + X = np.zeros((10, 1)) + + # Test alone + splits = TimeSeriesSplit(n_splits=3, test_size=3).split(X) + + train, test = next(splits) + assert_array_equal(train, [0]) + assert_array_equal(test, [1, 2, 3]) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 2, 3]) + assert_array_equal(test, [4, 5, 6]) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 2, 3, 4, 5, 6]) + assert_array_equal(test, [7, 8, 9]) + + # Test with max_train_size + splits = TimeSeriesSplit(n_splits=2, test_size=2, max_train_size=4).split(X) + + train, test = next(splits) + assert_array_equal(train, [2, 3, 4, 5]) + assert_array_equal(test, [6, 7]) + + train, test = next(splits) + assert_array_equal(train, [4, 5, 6, 7]) + assert_array_equal(test, [8, 9]) + + # Should fail with not enough data points for configuration + with pytest.raises(ValueError, match="Too many splits.*with test_size"): + splits = TimeSeriesSplit(n_splits=5, test_size=2).split(X) + next(splits) + + +def test_time_series_gap(): + X = np.zeros((10, 1)) + + # Test alone + splits = TimeSeriesSplit(n_splits=2, gap=2).split(X) + + train, test = next(splits) + assert_array_equal(train, [0, 1]) + assert_array_equal(test, [4, 5, 6]) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 2, 3, 4]) + assert_array_equal(test, [7, 8, 9]) + + # Test with max_train_size + splits = TimeSeriesSplit(n_splits=3, gap=2, max_train_size=2).split(X) + + train, test = next(splits) + assert_array_equal(train, [0, 1]) + assert_array_equal(test, [4, 5]) + + train, test = next(splits) + assert_array_equal(train, [2, 3]) + assert_array_equal(test, [6, 7]) + + train, test = next(splits) + assert_array_equal(train, [4, 5]) + assert_array_equal(test, [8, 9]) + + # Test with test_size + splits = TimeSeriesSplit(n_splits=2, gap=2, max_train_size=4, test_size=2).split(X) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 2, 3]) + assert_array_equal(test, [6, 7]) + + train, test = next(splits) + assert_array_equal(train, [2, 3, 4, 5]) + assert_array_equal(test, [8, 9]) + + # Test with additional test_size + splits = TimeSeriesSplit(n_splits=2, gap=2, test_size=3).split(X) + + train, test = next(splits) + assert_array_equal(train, [0, 1]) + assert_array_equal(test, [4, 5, 6]) + + train, test = next(splits) + assert_array_equal(train, [0, 1, 2, 3, 4]) + assert_array_equal(test, [7, 8, 9]) + + # Verify proper error is thrown + with pytest.raises(ValueError, match="Too many splits.*and gap"): + splits = TimeSeriesSplit(n_splits=4, gap=2).split(X) + next(splits) + + +@ignore_warnings +def test_nested_cv(): + # Test if nested cross validation works with different combinations of cv + rng = np.random.RandomState(0) + + X, y = make_classification(n_samples=15, n_classes=2, random_state=0) + groups = rng.randint(0, 5, 15) + + cvs = [ + LeaveOneGroupOut(), + StratifiedKFold(n_splits=2), + LeaveOneOut(), + GroupKFold(n_splits=3), + StratifiedKFold(), + StratifiedGroupKFold(), + StratifiedShuffleSplit(n_splits=3, random_state=0), + ] + + for inner_cv, outer_cv in combinations_with_replacement(cvs, 2): + gs = GridSearchCV( + DummyClassifier(), + param_grid={"strategy": ["stratified", "most_frequent"]}, + cv=inner_cv, + error_score="raise", + ) + cross_val_score( + gs, X=X, y=y, groups=groups, cv=outer_cv, params={"groups": groups} + ) + + +def test_build_repr(): + class MockSplitter: + def __init__(self, a, b=0, c=None): + self.a = a + self.b = b + self.c = c + + def __repr__(self): + return _build_repr(self) + + assert repr(MockSplitter(5, 6)) == "MockSplitter(a=5, b=6, c=None)" + + +@pytest.mark.parametrize( + "CVSplitter", (ShuffleSplit, GroupShuffleSplit, StratifiedShuffleSplit) +) +def test_shuffle_split_empty_trainset(CVSplitter): + cv = CVSplitter(test_size=0.99) + X, y = [[1]], [0] # 1 sample + with pytest.raises( + ValueError, + match=( + "With n_samples=1, test_size=0.99 and train_size=None, " + "the resulting train set will be empty" + ), + ): + next(_split(cv, X, y, groups=[1])) + + +def test_train_test_split_empty_trainset(): + (X,) = [[1]] # 1 sample + with pytest.raises( + ValueError, + match=( + "With n_samples=1, test_size=0.99 and train_size=None, " + "the resulting train set will be empty" + ), + ): + train_test_split(X, test_size=0.99) + + X = [[1], [1], [1]] # 3 samples, ask for more than 2 thirds + with pytest.raises( + ValueError, + match=( + "With n_samples=3, test_size=0.67 and train_size=None, " + "the resulting train set will be empty" + ), + ): + train_test_split(X, test_size=0.67) + + +def test_leave_one_out_empty_trainset(): + # LeaveOneGroup out expect at least 2 groups so no need to check + cv = LeaveOneOut() + X, y = [[1]], [0] # 1 sample + with pytest.raises(ValueError, match="Cannot perform LeaveOneOut with n_samples=1"): + next(cv.split(X, y)) + + +def test_leave_p_out_empty_trainset(): + # No need to check LeavePGroupsOut + cv = LeavePOut(p=2) + X, y = [[1], [2]], [0, 3] # 2 samples + with pytest.raises( + ValueError, match="p=2 must be strictly less than the number of samples=2" + ): + next(cv.split(X, y)) + + +@pytest.mark.parametrize( + "Klass", (KFold, StratifiedKFold, StratifiedGroupKFold, GroupKFold) +) +def test_random_state_shuffle_false(Klass): + # passing a non-default random_state when shuffle=False makes no sense + with pytest.raises(ValueError, match="has no effect since shuffle is False"): + Klass(3, shuffle=False, random_state=0) + + +@pytest.mark.parametrize( + "cv, expected", + [ + (KFold(), True), + (KFold(shuffle=True, random_state=123), True), + (StratifiedKFold(), True), + (StratifiedKFold(shuffle=True, random_state=123), True), + (StratifiedGroupKFold(shuffle=True, random_state=123), True), + (StratifiedGroupKFold(), True), + (RepeatedKFold(random_state=123), True), + (RepeatedStratifiedKFold(random_state=123), True), + (ShuffleSplit(random_state=123), True), + (GroupShuffleSplit(random_state=123), True), + (StratifiedShuffleSplit(random_state=123), True), + (GroupKFold(), True), + (GroupKFold(shuffle=True, random_state=123), True), + (TimeSeriesSplit(), True), + (LeaveOneOut(), True), + (LeaveOneGroupOut(), True), + (LeavePGroupsOut(n_groups=2), True), + (LeavePOut(p=2), True), + (KFold(shuffle=True, random_state=None), False), + (KFold(shuffle=True, random_state=None), False), + (StratifiedKFold(shuffle=True, random_state=np.random.RandomState(0)), False), + (StratifiedKFold(shuffle=True, random_state=np.random.RandomState(0)), False), + (RepeatedKFold(random_state=None), False), + (RepeatedKFold(random_state=np.random.RandomState(0)), False), + (RepeatedStratifiedKFold(random_state=None), False), + (RepeatedStratifiedKFold(random_state=np.random.RandomState(0)), False), + (ShuffleSplit(random_state=None), False), + (ShuffleSplit(random_state=np.random.RandomState(0)), False), + (GroupShuffleSplit(random_state=None), False), + (GroupShuffleSplit(random_state=np.random.RandomState(0)), False), + (StratifiedShuffleSplit(random_state=None), False), + (StratifiedShuffleSplit(random_state=np.random.RandomState(0)), False), + ], +) +def test_yields_constant_splits(cv, expected): + assert _yields_constant_splits(cv) == expected + + +@pytest.mark.parametrize("cv", ALL_SPLITTERS, ids=[str(cv) for cv in ALL_SPLITTERS]) +def test_splitter_get_metadata_routing(cv): + """Check get_metadata_routing returns the correct MetadataRouter.""" + assert hasattr(cv, "get_metadata_routing") + metadata = cv.get_metadata_routing() + if cv in GROUP_SPLITTERS: + assert metadata.split.requests["groups"] is True + elif cv in NO_GROUP_SPLITTERS: + assert not metadata.split.requests + + assert_request_is_empty(metadata, exclude=["split"]) + + +@pytest.mark.parametrize("cv", ALL_SPLITTERS, ids=[str(cv) for cv in ALL_SPLITTERS]) +def test_splitter_set_split_request(cv): + """Check set_split_request is defined for group splitters and not for others.""" + if cv in GROUP_SPLITTERS: + assert hasattr(cv, "set_split_request") + elif cv in NO_GROUP_SPLITTERS: + assert not hasattr(cv, "set_split_request") + + +@pytest.mark.parametrize("cv", NO_GROUP_SPLITTERS, ids=str) +def test_no_group_splitters_warns_with_groups(cv): + msg = f"The groups parameter is ignored by {cv.__class__.__name__}" + + n_samples = 30 + rng = np.random.RandomState(1) + X = rng.randint(0, 3, size=(n_samples, 2)) + y = rng.randint(0, 3, size=(n_samples,)) + groups = rng.randint(0, 3, size=(n_samples,)) + + with pytest.warns(UserWarning, match=msg): + cv.split(X, y, groups=groups) + + +@pytest.mark.parametrize( + "cv", SPLITTERS_REQUIRING_TARGET, ids=[str(cv) for cv in SPLITTERS_REQUIRING_TARGET] +) +def test_stratified_splitter_without_y(cv): + msg = "missing 1 required positional argument: 'y'" + with pytest.raises(TypeError, match=msg): + cv.split(X) diff --git a/shared/package-files/9b/9bf7b880cd6c128f5bb4737fa498bd6ed3b7fbbd20f1f53f365e6ba971e8a6d9/blob b/shared/package-files/9b/9bf7b880cd6c128f5bb4737fa498bd6ed3b7fbbd20f1f53f365e6ba971e8a6d9/blob new file mode 100644 index 0000000000000000000000000000000000000000..94b98dd3111742e86a643497f3195e4021afa6fb --- /dev/null +++ b/shared/package-files/9b/9bf7b880cd6c128f5bb4737fa498bd6ed3b7fbbd20f1f53f365e6ba971e8a6d9/blob @@ -0,0 +1,234 @@ + +Scottish Economic Bulletin: Economic Review + + +
+ +
+ + + + + +
+
Scottish Economic Bulletin 

+ + + + + +

 
+

The Scottish Economy

+Gross Domestic Product +

+Provisional estimates of GDP (income measure) for each UK Government Office Region/country are now available for 1996 with the publication of the Regional Accounts.7 Estimates for 1995 were also made available at county/former Scottish region level. +

+Scottish GDP in 1996 was �54.43 billion, 8.6 per cent of UK GDP. GDP per head was �10,614, 99.1 per cent of the UK average. This was the fourth highest of the 12 UK Government Office Regions/countries - below only London, South East and Eastern - for the fifth successive year. +

+GDP per head in Scotland relative to the UK increased strongly between 1989 and 1992, reflecting the stronger performance of the Scottish economy in the 1990-1992 UK recession. Since 1992, GDP per head has fluctuated around 99 per cent of UK GDP per head, reaching a peak of 100.2 per cent in 1995. +

+Table 2 shows GDP per head in the former Scottish regions in 1995.8 It is instructive to look at trends and, accordingly, Table 2 also provides data for 1989. GDP per head was well above the UK average in both Grampian (133 per cent) and Lothian (124 per cent) in 1995. Although Grampian showed the smallest increase in GDP per head over the 1993-1995 period (and fell slightly relative to the UK), the level of GDP per head was third only to London and Berkshire across the UK, followed by Lothian. All other Scottish regions were below the UK average and GDP per head in the Highlands and Islands and in Fife was amongst the lowest in the UK. +

+Table 2: GDP in the Scottish Regions, 1989 and 1995 +

+ + + + + + + + + + + + + + + + +
 GDP per head 1995 (�)GDP per head, 1990=100
19891995
Borders9,00380.188.3
Central9,26589.190.8
Dumfries and Galloway9,55586.493.7
Fife8,31484.081.5
Grampian13,566119.4133.0
Highlands and Islands8,29880.481.4
Lothian12,656111.4124.1
Strathclyde9,48387.993.0
Tayside9,61188.894.2
Scotland10,24493.8100.2
UK10,199100.0100.0
+
+Source: Office for National Statistics +

+The improvement in Scottish GDP per head, relative to the UK, from 1989 has been evident across most Scottish regions. Lothian, Borders and Grampian have seen particularly marked improvements and only Fife had a lower relative level of GDP per head in 1995 than in 1989. Relative GDP per head in the Highlands and Islands has increased slightly but levels have fallen since the peak (of 88.8 per cent ) in 1991. +

+

Index of Production and Construction

+The Scottish Office Education and Industry Department's quarterly Index of Production and Construction rose by 0.4 per cent in 1997 Q3. Excluding oil and gas, the Index rose by 0.5 per cent. At a broad sectoral level, output rose in manufacturing (0.9 per cent) and in electricity, gas and water supply (5.7 per cent), offset by falling output in construction (2.5 per cent) and mining and quarrying (1.8 per cent). The UK index (less oil and gas) rose by 0.7 per cent in 1997 Q3. +

+An indication of the underlying trend in industrial output is obtained by comparing the last 4 quarters for which data are available (to 1997 Q3) with the previous 4 quarters (to 1996 Q3). Excluding oil and gas, the Index rose by 6.0 per cent over this period, as increases were recorded in manufacturing (7.4 per cent), construction (1.8 per cent), electricity, gas and water supply (5.7 per cent) and mining and quarrying (3.3 per cent). By comparison, the UK Index (less oil and gas) rose by 2.0 per cent over the same period. +

+Since 1990, manufacturing output has increased by 25.6 per cent. Growth in UK manufacturing has been much more sluggish than in Scotland, growing by only 5.1 per cent over the same period. The influence of the electrical and instrument engineering sector (EIE) on Scottish manufacturing has been discussed in past editions of the Scottish Economic Bulletin and by outside commentators. Excluding EIE, manufacturing output in Scotland has declined by 7.7 per cent since 1990. UK manufacturing excluding EIE has increased by 1.8 per cent. +

+In the year to 1997 Q3, the EIE sector continued to grow strongly - by 18.4 per cent. However, growth was also evident in 6 of the other 10 manufacturing sectors over the period. This is the continuation of a trend over the last year in which growth in the manufacturing sector has become more broadly based. Indeed as Chart 3 shows, manufacturing output excluding EIE has been increasing year-on-year in each quarter since 1996 Q4, a trend not seen since 1990 Q3. In the year to 1997 Q3, manufacturing output excluding EIE grew by 1.4 per cent, only slightly below the 1.5 per cent growth in the UK as a whole. +

+ +CHART 3 HERE +

+Exports +

+The manufacturing sector accounts for most of Scotland's external trade with the rest of the world. Estimates from the 1994 Input-Output Tables99 indicate that around three quarters of trade is in manufacturing. The Scottish Council Development and Industry (SCDI) annual survey of Scottish Manufactured Exports for 1996 was published in December 1997. In current prices, the value of Scottish manufactured exports10 was estimated to have risen by 6.4 per cent in 1996 to �18.42 billion. This represents a slower rate of growth than in recent years (20.3 per cent in 1995 and 24.8 per cent in 1994) and can be compared with growth of 8.9 per cent in UK manufactured exports (to �155.18 billion) in 1996. For the first time since 1988, UK manufactured exports growth outpaced that of Scotland and Scotland's share of UK exports fell marginally from 12.1 per cent in 1995 to 11.9 per cent in 1996. +

+As shown in Table 3, four sectors - Office Machinery, Radio/TV/Communication Equipment, Whisky and Chemicals - continued to dominate Scottish manufactured exports in 1996, accounting for 75 per cent of the total. The electronics sector11 had a more mixed export performance in 1996 than in recent years. Exports grew by 6.9 per cent to �10.21 billion (55.5 per cent of total manufactured exports). This compares with growth of over 42 per cent in 1995. Exports from the Office Machinery sector - the largest exporting sector - rose by 14.3 per cent in 1996 to �6.83 billion (37.1 per cent of total manufactured exports). While this rate of growth was considerably lower than in 1995, the sector still contributed over 77 per cent to the total growth in manufactured exports in 1996. Exports from the other major element of Scotland's electronics industry - the Radio/TV/Communication Equipment sector - declined by 7.3 per cent to �3.00 billion. +

+Table 3: Top Exporting Sectors in Scotland, 1996 +

+ + + + + + + + + + + + + + + + +
Sector (SIC92)Value at current prices (£ million)Per cent of TotalNominal increase in value 1995-96: per centContribution to total export growth: per cent
Office Machinery6,825.037.114.377.5
Radio, Television & Communication3,003.816.3-7.3-21.6
Equipment and Apparatus Whisky2,278.112.40.10.1
Chemicals and Chemical Products1,706.49.39.213.1
Machinery and Equipment nec802.24.418.411.4
Other Food Products & Beverages446.02.4-10.7-4.8
Fabricated Metal Products except Machinery and Equipment411.12.237.310.2
Pulp, Paper and Paper Products387.02.1-2.0-0.7
Coke, Refined Petroleum Products and Nuclear Fuel332.01.869.612.4
Other Transport Equipment326.81.8-22.4-8.6
Other sectors1,896.210.36.811.1
All Manufacturing Industries18,414.6100.06.3100.0
+
+Source: Scottish Council Development and Industry +

+Note: 1. Under SIC 92 Whisky is normally incorporated in the Food Products & Beverages sector. +

+Exports from the whisky sector increased only marginally in 1996, up by 0.1 per cent to �2.28 billion (12.4 per cent of total manufactured exports). The Chemicals and Chemical Products sector experienced a further rise in exports in 1996, of 9.2 per cent to �1.71 billion (9.3 per cent of total manufactured exports). This follows growth of 9.0 per cent in 1995. An additional 19 industry sectors together represented 25 per cent of total manufactured exports in 1996. Export growth was recorded in 14 sectors. +

+Overall the latest figures record a positive - and better than expected - performance by Scottish manufacturing in export markets during 1996. The SCDI quarterly index based on a selected panel survey of large exporters had provisionally estimated a fall of 6.8 per cent in manufactured exports. The rapid growth rates of recent years have slowed but export levels in most sectors continue to rise. Initial estimates from the SCDI quarterly index for 1997 suggest further growth of 12.0 per cent to �20.61 billion. +

+Exports by Destination +

+As shown in Table 4, the EU remained Scotland's main trading area in 1996 with a 58 per cent share of Scotland's exports. However, exports grew more modestly - by 2.9 per cent - in 1996. Six of the top ten individual country markets were in the EU, the others being the USA, Japan, Switzerland and Norway. The latest survey results confirm France as Scotland's largest export market for the fourth successive year, despite a drop in the actual value of exports of 5.4 per cent to �2.80 billion. (15.2 per cent of total Scottish manufactured exports). +

+Table 4: Destination of Scottish Exports in 1996 +

+ + + + + + + + + + + + +
 Value (� million, current prices)Per cent of totalNominal percentage growth in 1996Contribution to overall growth: per cent
European Union10,75658.42.927.5
North America2,31812.636.856.8
Other Asia Pacific1,5568.4-14.2-23.5
EFTA1,0725.816.413.7
Japan8124.46.34.4
Middle East5132.823.38.8
Latin America5102.84.52.0
Eastern Europe3962.253.512.6
Africa3111.7-0.6-0.2
Australasia1710.9-11.9-2.1
+
+Source: Scottish Council Development and Industry +

+Exports to the USA rose by 38.3 per cent in 1996 to �2.22 billion. The USA was responsible for nearly 50 per cent of the increase in total Scottish exports and overtook Germany as the second largest market. There was a strong upturn in sales across the Office Machinery, Radio/TV/Communication Equipment, Coke/Petroleum and Chemicals sectors; the strength of the US economy a causal factor. North America displaced Other Asia Pacific as Scotland's second largest trading area. +

+Exports to Japan continued to increase and remained the 7th largest country market for Scottish goods. Total exports to the Other Asia Pacific countries fell by 14.2 per cent in 1996, compared with strong growth of 30.9 per cent in 1995. However, this was almost entirely due to a large drop in exports to Malaysia; there were significant rises in exports to Hong Kong, Singapore and Taiwan. Elsewhere, exports to most other regions showed significant growth with sales to Eastern Europe up 53.5 per cent and exports to the Middle East up 23.3 per cent. Growth in sales were also recorded to the EFTA countries, while exports to Latin America continued to grow modestly. There was a marginal decline in sales to Africa following last year's significant increase, while exports to Australasia continued to decline. +

+The Sterling Exchange Rate and Exports +

+Inevitably, the strength of sterling has put pressure on Scottish exports. As one would expect, the exposure to exchange rate movements varies by sector in Scotland. This is illustrated in Table 5 which shows, at the broad sectoral level, the proportion of total domestic (i.e., Scottish) output dependent on exports outwith the UK (i.e., to the rest of the world, ROW) and the import content of that output from the same source. The table also shows the corresponding proportions for Scotland's trade with the rest of the UK (RUK). +

+Table 5: The External Orientation of Scottish Industry, 1994 +

+ + + + + + + + + + + + + + +
IndustryProportion of domestic output dependent on :Components of gross domestic output
Exports to RUKExports to ROWImports from RUKImports from ROW
Agriculture, Forestry and Fishing19.712.97.41.4
Mining and Quarrying41.029.118.96.8
Energy and Water Supply6.41.07.87.7
Manufacturing26.741.818.818.2
Construction6.00.017.73.9
Transport and Communication20.08.48.92.5
Distribution and Catering14.10.05.71.0
Financial and Business Services12.35.810.81.9
Other Services4.12.74.11.2
Whole Economy16.516.312.07.3
+
+Source: The Scottish Office +

+The manufacturing sector is clearly the most sensitive to the effects of exchange rate changes: over 40 per cent of output is exported to ROW and almost 20 per cent of inputs are imported from ROW. Within the sector (though not shown in the table), 2 industries - drink and electrical and instrument engineering - export more than two thirds of their output to ROW, while chemicals and electrical and instrument engineering also import more than a third of inputs. By contrast, the output of the service sector is much more dependent on the home market, relying less on exports to generate value added. The gross output of the service sector also embodies a lower import content. +

+For manufacturing, available evidence from the SCDI for 1997 suggests that the strength of sterling is causing difficulties in terms of reduced margins and some job losses. However, as described above, it appears that it has not yet impacted upon the level of export sales, only profitability. +

+Business survey evidence in Scotland does point to an adverse impact on exports resulting from sterling's strength but results are far from conclusive. The Scottish Chambers' Business Survey reported a decline in export orders and sales in 1997 Q4, as in Q3 and results from Scottish Engineering also revealed that export orders declined for the third successive quarter, falling in all sectors of the industry. By contrast, the CBI Industrial Trends Survey reported a return to growth in export orders and deliveries also increased significantly in the fourth quarter. However, optimism regarding export prospects fell markedly and, as one might expect, respondents continued to believe that prices would be the most important constraint on export orders over the coming months. +

+One particular area in which the exchange rate may have been expected to affect activity levels is travel and tourism both to and from overseas. International Passenger Survey (IPS) evidence for the 12 months to November 1997 shows that the number of visitors to the UK rose by 3 per cent, compared with the year to November 1996. The number of visits from North America increased by 14 per cent, while the number of visits from Western Europe was broadly static. Visits from Other Areas rose by 4 per cent. The total number of UK residents' visits abroad during the 12 months ending November 1997 rose by 11 per cent compared with a year earlier. Visits to Western Europe increased by 12 per cent, while visits to North America and Other Areas increased by 2 per cent and 10 per cent respectively. Overseas earnings rose by 2 per cent in current prices in the year to November and expenditure by UK residents rose by 6 per cent. This resulted in an increase in the deficit on the travel account of the balance of payments from �3.8 billion to �4.6 billion over the period. +

+The change in the composition of the tourism market appears to be consistent with the larger rise in sterling against the main European currencies over the last 18 months and has implications for Scotland. North America, Germany and France all account for higher proportions of overseas visits to Scotland than to the UK as a whole. However, a complicating factor is that US and French visitors tend to have a high propensity for travelling as part of a package holiday, paid for in advance with prices based on an exchange rate determined possibly months before the holiday is taken. Consequently, the impact of changes in exchange rates on visits from US and French residents may be delayed. By contrast, the principal types of Dutch and German holidaymakers to Scotland tend to travel independently and to holiday on an ad hoc basis at relatively short notice. The impact of the strength of sterling on these groups is likely to have been demonstrated relatively quickly. +

+Some IPS data for Scotland are available to the third quarter of 1997. The total number of overnight visits from overseas tourists was broadly unchanged in the first 3 quarters of the year, compared with the same period in 1996. However, the total from Western Europe fell by 6 per cent and overnight visits from North America were broadly unchanged. By contrast, visits from Other Areas rose by 12 per cent. Evidence for Scotland from the United Kingdom Tourism Survey, covering the first 3 quarters of 1997, reported a 3 per cent fall in the number of tourist trips to Scotland by UK residents compared with the same period in 1996. This compares with growth rates of around 15 per cent in each of the previous 2 years. The value of these trips increased by 7 per cent in current prices, broadly equal to growth in the UK over the same period but lower than growth in 1995 and 1996. +

+Labour Market +

+Unemployment +

+There are 2 main sources of unemployment data. An estimate of unemployment under the International Labour Office definition - ILO unemployment - is provided by the Labour Force Survey (LFS), a quarterly sample survey of households. The second measure of unemployment - the claimant count - is based on records of those claiming Jobseeker's Allowance and National Insurance Credits at Employment Service Offices. The Office for National Statistics announced on 3 February that (from April) its assessment of the labour market would give more weight than previously to the LFS, which is conducted according to internationally agreed definitions drawn up by the ILO. +

+ILO unemployment (not seasonally adjusted) in Scotland fell by 32,000 in the year to Autumn (September to November) 1997 to 185,000. The rate of unemployment fell by 1.4 percentage points to 7.4 per cent of the workforce. ILO unemployment in the UK fell by 379,000 in the year to Autumn 1997 to 1,919,000 or 6.6 per cent, 0.8 percentage points below the Scottish rate. Unemployment fell in every Government Office Region (GOR) of the UK. Four GORs - Merseyside, North East, London and Northern Ireland - have higher ILO unemployment rates than Scotland. +

+Claimant count unemployment (seasonally adjusted) in Scotland fell throughout 1997 but rose by 1,200 in January 1998 to 141,100, the first rise since April 1996. The rate of unemployment rose by 0.1 percentage point to 5.8 per cent of the workforce, 0.8 percentage points above the UK rate. Of the UK GORs, Merseyside, North East, and Northern Ireland have higher unemployment rates than Scotland, while London has the same rate. +

+The claimant count measure of unemployment in Scotland remains significantly lower than the ILO measure. The difference between the ILO measure and the claimant count measure12 in Autumn 1997 was 42,000, a rise of 7,000 on Autumn 1996. +

+In the July 1997 Budget, the Government set out a New Deal to help young people, the long term unemployed, lone parents and the disabled move from Welfare to Work. The New Deal for young claimants (aged 18-24) who have been unemployed for 6 months or more was launched in 12 "pathfinder" areas of the UK (including Tayside) in January and the programme will be launched nationally from April. The New Deal for long term unemployed adults (those aged 25 and over who have been unemployed for more than 2 years) will be launched in June.13 +

+Table 6 summarises the eligibility for the New Deal for these two groups in January 1998. It can be seen that, in Scotland there were 11,300 youth unemployed of over 6 months duration and 17,100 aged 25 and over who had been unemployed for 2 years or more in January 1998 (7.4 per cent and 11.3 per cent of total claimant unemployed, respectively). The total number in these 2 groups has fallen significantly over the last year - by 17,800 (38.5 per cent). +

+Table 6: Claiment Count Unemployment for New Deal Target Groups +

+ + + + + + + +
 Youth (18-24) Unemployment, over 6 months durationAdult (25+) Unemployment, over 2 years duration
January 1997January 1998Percentage changeJanuary 1997January 1998Percentage change
Scotland18,10011,300-37.728,10017,100-39.1
Per cent of claimant count9.87.4..15.211.3..
UK198,300118,400-40.3357,000216,300-39.4
Scotland as a percentage of the UK9.19.5..7.97.9..
+
+Source: Office for National Statistics

+Note: 1. Percentages calculated with reference to unrounded figures. +

+Employment +

+There are two main official sources of quarterly employment data: the Workforce in Employment series, which is a survey of employers, and the Labour Force Survey. +

+An increase of 43,000 in total employment (not seasonally adjusted) in Scotland was recorded by the LFS over the year to Autumn 1997 to reach a new (Autumn) peak of 2,305,000. This was due to increases of 24,000 in the number of employees, 14,000 in the number of self-employed and 5,000 in the number of people either on government supported training and employment programmes or who were unpaid family workers. Given the fall of 32,000 in the level of ILO unemployment, the number of people classed as economically active increased by 10,000 in the year to Autumn 1997. Increases in total employment were evident in most UK GORs, falling only in the North East, Merseyside and Wales. In the UK as a whole, total employment increased by 456,000. +

+An increase of 23,000 in the civilian workforce (not seasonally adjusted) was recorded by the Workforce in Employment series over the year to September 1997 to reach a new peak of 2,277,000, (7,000 higher than the 1991 peak and 202,000 above the trough in 1983). This comprised increases of 19,000 in the number of self-employed and 6,000 in the number of employees (comprising increases across the service sector (14,000) and decreases in manufacturing (5,000) and other sectors (3,000)) over the year, partly offset by a fall of 2,000 in the number on work-related government training programmes. Increases in the civilian workforce were evident in all GB regions, except East Anglia and Yorkshire and Humberside. In Great Britain as a whole, the civilian workforce increased by 349,000. +

+The growth in the number of employees has been due to the increase in part-time employment.14 In the year to September 1997, part-time employment rose by 32,000 (17,000 males and 15,000 females), offset by a fall of 26,000 in full-time employment (24,000 males and 2,000 females). This is a continuation of a trend over the past few years in which part-time employment has increased - in each year since 1992 (data are available from 1991) - to a level 104,000 higher (46,000 males and 58,000 females) in 1997 than 5 years earlier. By contrast, full-time employment has fallen consistently and in September 1997 was 90,000 lower than 1992 levels (86,000 males and 4,000 females). +

+ + +
  +


+7Published in Economic Trends, February 1998.
+8GDP estimates of the Scottish regions measure the value of goods and services produced in an area; they do not measure the income of the residents in an area, as is the case for Government Office Regions/countries of the UK. There is a wide variation between areas in terms of size and population; in order to compare the economic performance of areas it is necessary to use an indicator such as GDP per head of population. Resident population is used as the denominator. The implication of using this in conjunction with the workplace-based GDP figures is that the productivity of urban areas into which workers commute will tend to be overstated by this indicator, while that of surrounding areas in which they live will be understated.
+9Input -Output Tables and Multipliers for Scotland, 1994, The Stationery Office.
+10It should be noted that the data presented by the SCDI for Scottish manufactured exports refer to gross output. They do not measure the level of (or changes in) the value-added component of Scottish manufactured exports (that is, the wages and profits accruing to domestic suppliers of labour and capital).
+11Electronics is classified by the SCDI as consisting of 4 industry groupings: Office Machinery, Electrical Machinery and Apparatus nec, Radio/TV/Communication Equipment and Apparatus and Medical, Precision and Optical Instruments, Watches and Clocks.
+12Average of September to November levels (not seasonally adjusted).
+13The New Deal for young people provides a period of advice and guidance -'the Gateway' - to find unsubsidised jobs. Thereafter, four options will be available: a subsidised job with an employer; a place on an Environment Task Force; a job in the voluntary sector; or full-time education or training. The first 3 options involve at least one day a week training and options 2 and 3 include top-ups to existing benefits. Long term unemployed adults under the New Deal will be able to benefit from two options: a subsidised job with an employer; or opportunities to study for up to 12 months in full-time employment-related courses designed to reach an accredited qualification.
+14Part-time employment is defined here as working less than 30 hours per week. +
+
+Back to previous section +Back to contents +On to next section + +
+ +
We welcome your comments on this site. +
Prepared 13 March 1998
+ +
+ +
+ +
+ + + diff --git a/shared/package-files/9b/9bf8d96016039d7fdb2ffc506743724636a70ed5925199aab64ca20820963bde/blob b/shared/package-files/9b/9bf8d96016039d7fdb2ffc506743724636a70ed5925199aab64ca20820963bde/blob new file mode 100644 index 0000000000000000000000000000000000000000..c25b667b5a64046cc77467dac3972b2d70abc236 Binary files /dev/null and b/shared/package-files/9b/9bf8d96016039d7fdb2ffc506743724636a70ed5925199aab64ca20820963bde/blob differ diff --git a/shared/package-files/9b/9bfacbbb64e239a75591a7260b3ed86748eeb4366e6c40f3542753e79bace9a7/blob b/shared/package-files/9b/9bfacbbb64e239a75591a7260b3ed86748eeb4366e6c40f3542753e79bace9a7/blob new file mode 100644 index 0000000000000000000000000000000000000000..640e0bfd246ca5f9b61fd7ca79ad7b3e560a2a2d --- /dev/null +++ b/shared/package-files/9b/9bfacbbb64e239a75591a7260b3ed86748eeb4366e6c40f3542753e79bace9a7/blob @@ -0,0 +1,27 @@ +# This is the Python mapping for interface NodeFilter from +# DOM2-Traversal-Range. It contains only constants. + +class NodeFilter: + """ + This is the DOM2 NodeFilter interface. It contains only constants. + """ + FILTER_ACCEPT = 1 + FILTER_REJECT = 2 + FILTER_SKIP = 3 + + SHOW_ALL = 0xFFFFFFFF + SHOW_ELEMENT = 0x00000001 + SHOW_ATTRIBUTE = 0x00000002 + SHOW_TEXT = 0x00000004 + SHOW_CDATA_SECTION = 0x00000008 + SHOW_ENTITY_REFERENCE = 0x00000010 + SHOW_ENTITY = 0x00000020 + SHOW_PROCESSING_INSTRUCTION = 0x00000040 + SHOW_COMMENT = 0x00000080 + SHOW_DOCUMENT = 0x00000100 + SHOW_DOCUMENT_TYPE = 0x00000200 + SHOW_DOCUMENT_FRAGMENT = 0x00000400 + SHOW_NOTATION = 0x00000800 + + def acceptNode(self, node): + raise NotImplementedError diff --git a/shared/package-files/9b/9bfb8f92d5c9cf1a75d93a4ea9a158014bbe98e5eddf862f0e1a536070ddff88/blob b/shared/package-files/9b/9bfb8f92d5c9cf1a75d93a4ea9a158014bbe98e5eddf862f0e1a536070ddff88/blob new file mode 100644 index 0000000000000000000000000000000000000000..999c528ac9f71a00346f0f95f9fbe3b6f9a60509 --- /dev/null +++ b/shared/package-files/9b/9bfb8f92d5c9cf1a75d93a4ea9a158014bbe98e5eddf862f0e1a536070ddff88/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor special_shifted_chebyshev_polynomial_t(const at::Tensor & x, const at::Tensor & n); +TORCH_API at::Tensor & special_shifted_chebyshev_polynomial_t_out(at::Tensor & out, const at::Tensor & x, const at::Tensor & n); +TORCH_API at::Tensor & special_shifted_chebyshev_polynomial_t_outf(const at::Tensor & x, const at::Tensor & n, at::Tensor & out); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/9b/9bff966d5e561016649127f3ebaff146c3a097be4abdf1496280673a05e2b549/blob b/shared/package-files/9b/9bff966d5e561016649127f3ebaff146c3a097be4abdf1496280673a05e2b549/blob new file mode 100644 index 0000000000000000000000000000000000000000..b9f6a41e95d7df479da9eaf13fec45bb1017604b --- /dev/null +++ b/shared/package-files/9b/9bff966d5e561016649127f3ebaff146c3a097be4abdf1496280673a05e2b549/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & from_file_out(at::Tensor & out, c10::string_view filename, c10::optional shared=c10::nullopt, c10::optional size=0); +TORCH_API at::Tensor & from_file_outf(c10::string_view filename, c10::optional shared, c10::optional size, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9c/9c0065b1f69eebb2303ceb71c551172cd0e464802ad5eddf79b1014adbb83d88/blob b/shared/package-files/9c/9c0065b1f69eebb2303ceb71c551172cd0e464802ad5eddf79b1014adbb83d88/blob new file mode 100644 index 0000000000000000000000000000000000000000..5cc74b4fb2624677af12e4748d941eeed5d38af4 --- /dev/null +++ b/shared/package-files/9c/9c0065b1f69eebb2303ceb71c551172cd0e464802ad5eddf79b1014adbb83d88/blob @@ -0,0 +1,2224 @@ +# pylint: disable=function-redefined +from __future__ import annotations + +import codecs +import string +from enum import Enum +from itertools import accumulate +from typing import Callable, Iterable, Tuple, TypeVar + +from prompt_toolkit.application.current import get_app +from prompt_toolkit.buffer import Buffer, indent, reshape_text, unindent +from prompt_toolkit.clipboard import ClipboardData +from prompt_toolkit.document import Document +from prompt_toolkit.filters import ( + Always, + Condition, + Filter, + has_arg, + is_read_only, + is_searching, +) +from prompt_toolkit.filters.app import ( + in_paste_mode, + is_multiline, + vi_digraph_mode, + vi_insert_mode, + vi_insert_multiple_mode, + vi_mode, + vi_navigation_mode, + vi_recording_macro, + vi_replace_mode, + vi_replace_single_mode, + vi_search_direction_reversed, + vi_selection_mode, + vi_waiting_for_text_object_mode, +) +from prompt_toolkit.input.vt100_parser import Vt100Parser +from prompt_toolkit.key_binding.digraphs import DIGRAPHS +from prompt_toolkit.key_binding.key_processor import KeyPress, KeyPressEvent +from prompt_toolkit.key_binding.vi_state import CharacterFind, InputMode +from prompt_toolkit.keys import Keys +from prompt_toolkit.search import SearchDirection +from prompt_toolkit.selection import PasteMode, SelectionState, SelectionType + +from ..key_bindings import ConditionalKeyBindings, KeyBindings, KeyBindingsBase +from .named_commands import get_by_name + +__all__ = [ + "load_vi_bindings", + "load_vi_search_bindings", +] + +E = KeyPressEvent + +ascii_lowercase = string.ascii_lowercase + +vi_register_names = ascii_lowercase + "0123456789" + + +class TextObjectType(Enum): + EXCLUSIVE = "EXCLUSIVE" + INCLUSIVE = "INCLUSIVE" + LINEWISE = "LINEWISE" + BLOCK = "BLOCK" + + +class TextObject: + """ + Return struct for functions wrapped in ``text_object``. + Both `start` and `end` are relative to the current cursor position. + """ + + def __init__( + self, start: int, end: int = 0, type: TextObjectType = TextObjectType.EXCLUSIVE + ): + self.start = start + self.end = end + self.type = type + + @property + def selection_type(self) -> SelectionType: + if self.type == TextObjectType.LINEWISE: + return SelectionType.LINES + if self.type == TextObjectType.BLOCK: + return SelectionType.BLOCK + else: + return SelectionType.CHARACTERS + + def sorted(self) -> tuple[int, int]: + """ + Return a (start, end) tuple where start <= end. + """ + if self.start < self.end: + return self.start, self.end + else: + return self.end, self.start + + def operator_range(self, document: Document) -> tuple[int, int]: + """ + Return a (start, end) tuple with start <= end that indicates the range + operators should operate on. + `buffer` is used to get start and end of line positions. + + This should return something that can be used in a slice, so the `end` + position is *not* included. + """ + start, end = self.sorted() + doc = document + + if ( + self.type == TextObjectType.EXCLUSIVE + and doc.translate_index_to_position(end + doc.cursor_position)[1] == 0 + ): + # If the motion is exclusive and the end of motion is on the first + # column, the end position becomes end of previous line. + end -= 1 + if self.type == TextObjectType.INCLUSIVE: + end += 1 + if self.type == TextObjectType.LINEWISE: + # Select whole lines + row, col = doc.translate_index_to_position(start + doc.cursor_position) + start = doc.translate_row_col_to_index(row, 0) - doc.cursor_position + row, col = doc.translate_index_to_position(end + doc.cursor_position) + end = ( + doc.translate_row_col_to_index(row, len(doc.lines[row])) + - doc.cursor_position + ) + return start, end + + def get_line_numbers(self, buffer: Buffer) -> tuple[int, int]: + """ + Return a (start_line, end_line) pair. + """ + # Get absolute cursor positions from the text object. + from_, to = self.operator_range(buffer.document) + from_ += buffer.cursor_position + to += buffer.cursor_position + + # Take the start of the lines. + from_, _ = buffer.document.translate_index_to_position(from_) + to, _ = buffer.document.translate_index_to_position(to) + + return from_, to + + def cut(self, buffer: Buffer) -> tuple[Document, ClipboardData]: + """ + Turn text object into `ClipboardData` instance. + """ + from_, to = self.operator_range(buffer.document) + + from_ += buffer.cursor_position + to += buffer.cursor_position + + # For Vi mode, the SelectionState does include the upper position, + # while `self.operator_range` does not. So, go one to the left, unless + # we're in the line mode, then we don't want to risk going to the + # previous line, and missing one line in the selection. + if self.type != TextObjectType.LINEWISE: + to -= 1 + + document = Document( + buffer.text, + to, + SelectionState(original_cursor_position=from_, type=self.selection_type), + ) + + new_document, clipboard_data = document.cut_selection() + return new_document, clipboard_data + + +# Typevar for any text object function: +TextObjectFunction = Callable[[E], TextObject] +_TOF = TypeVar("_TOF", bound=TextObjectFunction) + + +def create_text_object_decorator( + key_bindings: KeyBindings, +) -> Callable[..., Callable[[_TOF], _TOF]]: + """ + Create a decorator that can be used to register Vi text object implementations. + """ + + def text_object_decorator( + *keys: Keys | str, + filter: Filter = Always(), + no_move_handler: bool = False, + no_selection_handler: bool = False, + eager: bool = False, + ) -> Callable[[_TOF], _TOF]: + """ + Register a text object function. + + Usage:: + + @text_object('w', filter=..., no_move_handler=False) + def handler(event): + # Return a text object for this key. + return TextObject(...) + + :param no_move_handler: Disable the move handler in navigation mode. + (It's still active in selection mode.) + """ + + def decorator(text_object_func: _TOF) -> _TOF: + @key_bindings.add( + *keys, filter=vi_waiting_for_text_object_mode & filter, eager=eager + ) + def _apply_operator_to_text_object(event: E) -> None: + # Arguments are multiplied. + vi_state = event.app.vi_state + event._arg = str((vi_state.operator_arg or 1) * (event.arg or 1)) + + # Call the text object handler. + text_obj = text_object_func(event) + + # Get the operator function. + # (Should never be None here, given the + # `vi_waiting_for_text_object_mode` filter state.) + operator_func = vi_state.operator_func + + if text_obj is not None and operator_func is not None: + # Call the operator function with the text object. + operator_func(event, text_obj) + + # Clear operator. + event.app.vi_state.operator_func = None + event.app.vi_state.operator_arg = None + + # Register a move operation. (Doesn't need an operator.) + if not no_move_handler: + + @key_bindings.add( + *keys, + filter=~vi_waiting_for_text_object_mode + & filter + & vi_navigation_mode, + eager=eager, + ) + def _move_in_navigation_mode(event: E) -> None: + """ + Move handler for navigation mode. + """ + text_object = text_object_func(event) + event.current_buffer.cursor_position += text_object.start + + # Register a move selection operation. + if not no_selection_handler: + + @key_bindings.add( + *keys, + filter=~vi_waiting_for_text_object_mode + & filter + & vi_selection_mode, + eager=eager, + ) + def _move_in_selection_mode(event: E) -> None: + """ + Move handler for selection mode. + """ + text_object = text_object_func(event) + buff = event.current_buffer + selection_state = buff.selection_state + + if selection_state is None: + return # Should not happen, because of the `vi_selection_mode` filter. + + # When the text object has both a start and end position, like 'i(' or 'iw', + # Turn this into a selection, otherwise the cursor. + if text_object.end: + # Take selection positions from text object. + start, end = text_object.operator_range(buff.document) + start += buff.cursor_position + end += buff.cursor_position + + selection_state.original_cursor_position = start + buff.cursor_position = end + + # Take selection type from text object. + if text_object.type == TextObjectType.LINEWISE: + selection_state.type = SelectionType.LINES + else: + selection_state.type = SelectionType.CHARACTERS + else: + event.current_buffer.cursor_position += text_object.start + + # Make it possible to chain @text_object decorators. + return text_object_func + + return decorator + + return text_object_decorator + + +# Typevar for any operator function: +OperatorFunction = Callable[[E, TextObject], None] +_OF = TypeVar("_OF", bound=OperatorFunction) + + +def create_operator_decorator( + key_bindings: KeyBindings, +) -> Callable[..., Callable[[_OF], _OF]]: + """ + Create a decorator that can be used for registering Vi operators. + """ + + def operator_decorator( + *keys: Keys | str, filter: Filter = Always(), eager: bool = False + ) -> Callable[[_OF], _OF]: + """ + Register a Vi operator. + + Usage:: + + @operator('d', filter=...) + def handler(event, text_object): + # Do something with the text object here. + """ + + def decorator(operator_func: _OF) -> _OF: + @key_bindings.add( + *keys, + filter=~vi_waiting_for_text_object_mode & filter & vi_navigation_mode, + eager=eager, + ) + def _operator_in_navigation(event: E) -> None: + """ + Handle operator in navigation mode. + """ + # When this key binding is matched, only set the operator + # function in the ViState. We should execute it after a text + # object has been received. + event.app.vi_state.operator_func = operator_func + event.app.vi_state.operator_arg = event.arg + + @key_bindings.add( + *keys, + filter=~vi_waiting_for_text_object_mode & filter & vi_selection_mode, + eager=eager, + ) + def _operator_in_selection(event: E) -> None: + """ + Handle operator in selection mode. + """ + buff = event.current_buffer + selection_state = buff.selection_state + + if selection_state is not None: + # Create text object from selection. + if selection_state.type == SelectionType.LINES: + text_obj_type = TextObjectType.LINEWISE + elif selection_state.type == SelectionType.BLOCK: + text_obj_type = TextObjectType.BLOCK + else: + text_obj_type = TextObjectType.INCLUSIVE + + text_object = TextObject( + selection_state.original_cursor_position - buff.cursor_position, + type=text_obj_type, + ) + + # Execute operator. + operator_func(event, text_object) + + # Quit selection mode. + buff.selection_state = None + + return operator_func + + return decorator + + return operator_decorator + + +def load_vi_bindings() -> KeyBindingsBase: + """ + Vi extensions. + + # Overview of Readline Vi commands: + # http://www.catonmat.net/download/bash-vi-editing-mode-cheat-sheet.pdf + """ + # Note: Some key bindings have the "~IsReadOnly()" filter added. This + # prevents the handler to be executed when the focus is on a + # read-only buffer. + # This is however only required for those that change the ViState to + # INSERT mode. The `Buffer` class itself throws the + # `EditReadOnlyBuffer` exception for any text operations which is + # handled correctly. There is no need to add "~IsReadOnly" to all key + # bindings that do text manipulation. + + key_bindings = KeyBindings() + handle = key_bindings.add + + # (Note: Always take the navigation bindings in read-only mode, even when + # ViState says different.) + + TransformFunction = Tuple[Tuple[str, ...], Filter, Callable[[str], str]] + + vi_transform_functions: list[TransformFunction] = [ + # Rot 13 transformation + ( + ("g", "?"), + Always(), + lambda string: codecs.encode(string, "rot_13"), + ), + # To lowercase + (("g", "u"), Always(), lambda string: string.lower()), + # To uppercase. + (("g", "U"), Always(), lambda string: string.upper()), + # Swap case. + (("g", "~"), Always(), lambda string: string.swapcase()), + ( + ("~",), + Condition(lambda: get_app().vi_state.tilde_operator), + lambda string: string.swapcase(), + ), + ] + + # Insert a character literally (quoted insert). + handle("c-v", filter=vi_insert_mode)(get_by_name("quoted-insert")) + + @handle("escape") + def _back_to_navigation(event: E) -> None: + """ + Escape goes to vi navigation mode. + """ + buffer = event.current_buffer + vi_state = event.app.vi_state + + if vi_state.input_mode in (InputMode.INSERT, InputMode.REPLACE): + buffer.cursor_position += buffer.document.get_cursor_left_position() + + vi_state.input_mode = InputMode.NAVIGATION + + if bool(buffer.selection_state): + buffer.exit_selection() + + @handle("k", filter=vi_selection_mode) + def _up_in_selection(event: E) -> None: + """ + Arrow up in selection mode. + """ + event.current_buffer.cursor_up(count=event.arg) + + @handle("j", filter=vi_selection_mode) + def _down_in_selection(event: E) -> None: + """ + Arrow down in selection mode. + """ + event.current_buffer.cursor_down(count=event.arg) + + @handle("up", filter=vi_navigation_mode) + @handle("c-p", filter=vi_navigation_mode) + def _up_in_navigation(event: E) -> None: + """ + Arrow up and ControlP in navigation mode go up. + """ + event.current_buffer.auto_up(count=event.arg) + + @handle("k", filter=vi_navigation_mode) + def _go_up(event: E) -> None: + """ + Go up, but if we enter a new history entry, move to the start of the + line. + """ + event.current_buffer.auto_up( + count=event.arg, go_to_start_of_line_if_history_changes=True + ) + + @handle("down", filter=vi_navigation_mode) + @handle("c-n", filter=vi_navigation_mode) + def _go_down(event: E) -> None: + """ + Arrow down and Control-N in navigation mode. + """ + event.current_buffer.auto_down(count=event.arg) + + @handle("j", filter=vi_navigation_mode) + def _go_down2(event: E) -> None: + """ + Go down, but if we enter a new history entry, go to the start of the line. + """ + event.current_buffer.auto_down( + count=event.arg, go_to_start_of_line_if_history_changes=True + ) + + @handle("backspace", filter=vi_navigation_mode) + def _go_left(event: E) -> None: + """ + In navigation-mode, move cursor. + """ + event.current_buffer.cursor_position += ( + event.current_buffer.document.get_cursor_left_position(count=event.arg) + ) + + @handle("c-n", filter=vi_insert_mode) + def _complete_next(event: E) -> None: + b = event.current_buffer + + if b.complete_state: + b.complete_next() + else: + b.start_completion(select_first=True) + + @handle("c-p", filter=vi_insert_mode) + def _complete_prev(event: E) -> None: + """ + Control-P: To previous completion. + """ + b = event.current_buffer + + if b.complete_state: + b.complete_previous() + else: + b.start_completion(select_last=True) + + @handle("c-g", filter=vi_insert_mode) + @handle("c-y", filter=vi_insert_mode) + def _accept_completion(event: E) -> None: + """ + Accept current completion. + """ + event.current_buffer.complete_state = None + + @handle("c-e", filter=vi_insert_mode) + def _cancel_completion(event: E) -> None: + """ + Cancel completion. Go back to originally typed text. + """ + event.current_buffer.cancel_completion() + + @Condition + def is_returnable() -> bool: + return get_app().current_buffer.is_returnable + + # In navigation mode, pressing enter will always return the input. + handle("enter", filter=vi_navigation_mode & is_returnable)( + get_by_name("accept-line") + ) + + # In insert mode, also accept input when enter is pressed, and the buffer + # has been marked as single line. + handle("enter", filter=is_returnable & ~is_multiline)(get_by_name("accept-line")) + + @handle("enter", filter=~is_returnable & vi_navigation_mode) + def _start_of_next_line(event: E) -> None: + """ + Go to the beginning of next line. + """ + b = event.current_buffer + b.cursor_down(count=event.arg) + b.cursor_position += b.document.get_start_of_line_position( + after_whitespace=True + ) + + # ** In navigation mode ** + + # List of navigation commands: http://hea-www.harvard.edu/~fine/Tech/vi.html + + @handle("insert", filter=vi_navigation_mode) + def _insert_mode(event: E) -> None: + """ + Pressing the Insert key. + """ + event.app.vi_state.input_mode = InputMode.INSERT + + @handle("insert", filter=vi_insert_mode) + def _navigation_mode(event: E) -> None: + """ + Pressing the Insert key. + """ + event.app.vi_state.input_mode = InputMode.NAVIGATION + + @handle("a", filter=vi_navigation_mode & ~is_read_only) + # ~IsReadOnly, because we want to stay in navigation mode for + # read-only buffers. + def _a(event: E) -> None: + event.current_buffer.cursor_position += ( + event.current_buffer.document.get_cursor_right_position() + ) + event.app.vi_state.input_mode = InputMode.INSERT + + @handle("A", filter=vi_navigation_mode & ~is_read_only) + def _A(event: E) -> None: + event.current_buffer.cursor_position += ( + event.current_buffer.document.get_end_of_line_position() + ) + event.app.vi_state.input_mode = InputMode.INSERT + + @handle("C", filter=vi_navigation_mode & ~is_read_only) + def _change_until_end_of_line(event: E) -> None: + """ + Change to end of line. + Same as 'c$' (which is implemented elsewhere.) + """ + buffer = event.current_buffer + + deleted = buffer.delete(count=buffer.document.get_end_of_line_position()) + event.app.clipboard.set_text(deleted) + event.app.vi_state.input_mode = InputMode.INSERT + + @handle("c", "c", filter=vi_navigation_mode & ~is_read_only) + @handle("S", filter=vi_navigation_mode & ~is_read_only) + def _change_current_line(event: E) -> None: # TODO: implement 'arg' + """ + Change current line + """ + buffer = event.current_buffer + + # We copy the whole line. + data = ClipboardData(buffer.document.current_line, SelectionType.LINES) + event.app.clipboard.set_data(data) + + # But we delete after the whitespace + buffer.cursor_position += buffer.document.get_start_of_line_position( + after_whitespace=True + ) + buffer.delete(count=buffer.document.get_end_of_line_position()) + event.app.vi_state.input_mode = InputMode.INSERT + + @handle("D", filter=vi_navigation_mode) + def _delete_until_end_of_line(event: E) -> None: + """ + Delete from cursor position until the end of the line. + """ + buffer = event.current_buffer + deleted = buffer.delete(count=buffer.document.get_end_of_line_position()) + event.app.clipboard.set_text(deleted) + + @handle("d", "d", filter=vi_navigation_mode) + def _delete_line(event: E) -> None: + """ + Delete line. (Or the following 'n' lines.) + """ + buffer = event.current_buffer + + # Split string in before/deleted/after text. + lines = buffer.document.lines + + before = "\n".join(lines[: buffer.document.cursor_position_row]) + deleted = "\n".join( + lines[ + buffer.document.cursor_position_row : buffer.document.cursor_position_row + + event.arg + ] + ) + after = "\n".join(lines[buffer.document.cursor_position_row + event.arg :]) + + # Set new text. + if before and after: + before = before + "\n" + + # Set text and cursor position. + buffer.document = Document( + text=before + after, + # Cursor At the start of the first 'after' line, after the leading whitespace. + cursor_position=len(before) + len(after) - len(after.lstrip(" ")), + ) + + # Set clipboard data + event.app.clipboard.set_data(ClipboardData(deleted, SelectionType.LINES)) + + @handle("x", filter=vi_selection_mode) + def _cut(event: E) -> None: + """ + Cut selection. + ('x' is not an operator.) + """ + clipboard_data = event.current_buffer.cut_selection() + event.app.clipboard.set_data(clipboard_data) + + @handle("i", filter=vi_navigation_mode & ~is_read_only) + def _i(event: E) -> None: + event.app.vi_state.input_mode = InputMode.INSERT + + @handle("I", filter=vi_navigation_mode & ~is_read_only) + def _I(event: E) -> None: + event.app.vi_state.input_mode = InputMode.INSERT + event.current_buffer.cursor_position += ( + event.current_buffer.document.get_start_of_line_position( + after_whitespace=True + ) + ) + + @Condition + def in_block_selection() -> bool: + buff = get_app().current_buffer + return bool( + buff.selection_state and buff.selection_state.type == SelectionType.BLOCK + ) + + @handle("I", filter=in_block_selection & ~is_read_only) + def insert_in_block_selection(event: E, after: bool = False) -> None: + """ + Insert in block selection mode. + """ + buff = event.current_buffer + + # Store all cursor positions. + positions = [] + + if after: + + def get_pos(from_to: tuple[int, int]) -> int: + return from_to[1] + + else: + + def get_pos(from_to: tuple[int, int]) -> int: + return from_to[0] + + for i, from_to in enumerate(buff.document.selection_ranges()): + positions.append(get_pos(from_to)) + if i == 0: + buff.cursor_position = get_pos(from_to) + + buff.multiple_cursor_positions = positions + + # Go to 'INSERT_MULTIPLE' mode. + event.app.vi_state.input_mode = InputMode.INSERT_MULTIPLE + buff.exit_selection() + + @handle("A", filter=in_block_selection & ~is_read_only) + def _append_after_block(event: E) -> None: + insert_in_block_selection(event, after=True) + + @handle("J", filter=vi_navigation_mode & ~is_read_only) + def _join(event: E) -> None: + """ + Join lines. + """ + for i in range(event.arg): + event.current_buffer.join_next_line() + + @handle("g", "J", filter=vi_navigation_mode & ~is_read_only) + def _join_nospace(event: E) -> None: + """ + Join lines without space. + """ + for i in range(event.arg): + event.current_buffer.join_next_line(separator="") + + @handle("J", filter=vi_selection_mode & ~is_read_only) + def _join_selection(event: E) -> None: + """ + Join selected lines. + """ + event.current_buffer.join_selected_lines() + + @handle("g", "J", filter=vi_selection_mode & ~is_read_only) + def _join_selection_nospace(event: E) -> None: + """ + Join selected lines without space. + """ + event.current_buffer.join_selected_lines(separator="") + + @handle("p", filter=vi_navigation_mode) + def _paste(event: E) -> None: + """ + Paste after + """ + event.current_buffer.paste_clipboard_data( + event.app.clipboard.get_data(), + count=event.arg, + paste_mode=PasteMode.VI_AFTER, + ) + + @handle("P", filter=vi_navigation_mode) + def _paste_before(event: E) -> None: + """ + Paste before + """ + event.current_buffer.paste_clipboard_data( + event.app.clipboard.get_data(), + count=event.arg, + paste_mode=PasteMode.VI_BEFORE, + ) + + @handle('"', Keys.Any, "p", filter=vi_navigation_mode) + def _paste_register(event: E) -> None: + """ + Paste from named register. + """ + c = event.key_sequence[1].data + if c in vi_register_names: + data = event.app.vi_state.named_registers.get(c) + if data: + event.current_buffer.paste_clipboard_data( + data, count=event.arg, paste_mode=PasteMode.VI_AFTER + ) + + @handle('"', Keys.Any, "P", filter=vi_navigation_mode) + def _paste_register_before(event: E) -> None: + """ + Paste (before) from named register. + """ + c = event.key_sequence[1].data + if c in vi_register_names: + data = event.app.vi_state.named_registers.get(c) + if data: + event.current_buffer.paste_clipboard_data( + data, count=event.arg, paste_mode=PasteMode.VI_BEFORE + ) + + @handle("r", filter=vi_navigation_mode) + def _replace(event: E) -> None: + """ + Go to 'replace-single'-mode. + """ + event.app.vi_state.input_mode = InputMode.REPLACE_SINGLE + + @handle("R", filter=vi_navigation_mode) + def _replace_mode(event: E) -> None: + """ + Go to 'replace'-mode. + """ + event.app.vi_state.input_mode = InputMode.REPLACE + + @handle("s", filter=vi_navigation_mode & ~is_read_only) + def _substitute(event: E) -> None: + """ + Substitute with new text + (Delete character(s) and go to insert mode.) + """ + text = event.current_buffer.delete(count=event.arg) + event.app.clipboard.set_text(text) + event.app.vi_state.input_mode = InputMode.INSERT + + @handle("u", filter=vi_navigation_mode, save_before=(lambda e: False)) + def _undo(event: E) -> None: + for i in range(event.arg): + event.current_buffer.undo() + + @handle("V", filter=vi_navigation_mode) + def _visual_line(event: E) -> None: + """ + Start lines selection. + """ + event.current_buffer.start_selection(selection_type=SelectionType.LINES) + + @handle("c-v", filter=vi_navigation_mode) + def _visual_block(event: E) -> None: + """ + Enter block selection mode. + """ + event.current_buffer.start_selection(selection_type=SelectionType.BLOCK) + + @handle("V", filter=vi_selection_mode) + def _visual_line2(event: E) -> None: + """ + Exit line selection mode, or go from non line selection mode to line + selection mode. + """ + selection_state = event.current_buffer.selection_state + + if selection_state is not None: + if selection_state.type != SelectionType.LINES: + selection_state.type = SelectionType.LINES + else: + event.current_buffer.exit_selection() + + @handle("v", filter=vi_navigation_mode) + def _visual(event: E) -> None: + """ + Enter character selection mode. + """ + event.current_buffer.start_selection(selection_type=SelectionType.CHARACTERS) + + @handle("v", filter=vi_selection_mode) + def _visual2(event: E) -> None: + """ + Exit character selection mode, or go from non-character-selection mode + to character selection mode. + """ + selection_state = event.current_buffer.selection_state + + if selection_state is not None: + if selection_state.type != SelectionType.CHARACTERS: + selection_state.type = SelectionType.CHARACTERS + else: + event.current_buffer.exit_selection() + + @handle("c-v", filter=vi_selection_mode) + def _visual_block2(event: E) -> None: + """ + Exit block selection mode, or go from non block selection mode to block + selection mode. + """ + selection_state = event.current_buffer.selection_state + + if selection_state is not None: + if selection_state.type != SelectionType.BLOCK: + selection_state.type = SelectionType.BLOCK + else: + event.current_buffer.exit_selection() + + @handle("a", "w", filter=vi_selection_mode) + @handle("a", "W", filter=vi_selection_mode) + def _visual_auto_word(event: E) -> None: + """ + Switch from visual linewise mode to visual characterwise mode. + """ + buffer = event.current_buffer + + if ( + buffer.selection_state + and buffer.selection_state.type == SelectionType.LINES + ): + buffer.selection_state.type = SelectionType.CHARACTERS + + @handle("x", filter=vi_navigation_mode) + def _delete(event: E) -> None: + """ + Delete character. + """ + buff = event.current_buffer + count = min(event.arg, len(buff.document.current_line_after_cursor)) + if count: + text = event.current_buffer.delete(count=count) + event.app.clipboard.set_text(text) + + @handle("X", filter=vi_navigation_mode) + def _delete_before_cursor(event: E) -> None: + buff = event.current_buffer + count = min(event.arg, len(buff.document.current_line_before_cursor)) + if count: + text = event.current_buffer.delete_before_cursor(count=count) + event.app.clipboard.set_text(text) + + @handle("y", "y", filter=vi_navigation_mode) + @handle("Y", filter=vi_navigation_mode) + def _yank_line(event: E) -> None: + """ + Yank the whole line. + """ + text = "\n".join(event.current_buffer.document.lines_from_current[: event.arg]) + event.app.clipboard.set_data(ClipboardData(text, SelectionType.LINES)) + + @handle("+", filter=vi_navigation_mode) + def _next_line(event: E) -> None: + """ + Move to first non whitespace of next line + """ + buffer = event.current_buffer + buffer.cursor_position += buffer.document.get_cursor_down_position( + count=event.arg + ) + buffer.cursor_position += buffer.document.get_start_of_line_position( + after_whitespace=True + ) + + @handle("-", filter=vi_navigation_mode) + def _prev_line(event: E) -> None: + """ + Move to first non whitespace of previous line + """ + buffer = event.current_buffer + buffer.cursor_position += buffer.document.get_cursor_up_position( + count=event.arg + ) + buffer.cursor_position += buffer.document.get_start_of_line_position( + after_whitespace=True + ) + + @handle(">", ">", filter=vi_navigation_mode) + @handle("c-t", filter=vi_insert_mode) + def _indent(event: E) -> None: + """ + Indent lines. + """ + buffer = event.current_buffer + current_row = buffer.document.cursor_position_row + indent(buffer, current_row, current_row + event.arg) + + @handle("<", "<", filter=vi_navigation_mode) + @handle("c-d", filter=vi_insert_mode) + def _unindent(event: E) -> None: + """ + Unindent lines. + """ + current_row = event.current_buffer.document.cursor_position_row + unindent(event.current_buffer, current_row, current_row + event.arg) + + @handle("O", filter=vi_navigation_mode & ~is_read_only) + def _open_above(event: E) -> None: + """ + Open line above and enter insertion mode + """ + event.current_buffer.insert_line_above(copy_margin=not in_paste_mode()) + event.app.vi_state.input_mode = InputMode.INSERT + + @handle("o", filter=vi_navigation_mode & ~is_read_only) + def _open_below(event: E) -> None: + """ + Open line below and enter insertion mode + """ + event.current_buffer.insert_line_below(copy_margin=not in_paste_mode()) + event.app.vi_state.input_mode = InputMode.INSERT + + @handle("~", filter=vi_navigation_mode) + def _reverse_case(event: E) -> None: + """ + Reverse case of current character and move cursor forward. + """ + buffer = event.current_buffer + c = buffer.document.current_char + + if c is not None and c != "\n": + buffer.insert_text(c.swapcase(), overwrite=True) + + @handle("g", "u", "u", filter=vi_navigation_mode & ~is_read_only) + def _lowercase_line(event: E) -> None: + """ + Lowercase current line. + """ + buff = event.current_buffer + buff.transform_current_line(lambda s: s.lower()) + + @handle("g", "U", "U", filter=vi_navigation_mode & ~is_read_only) + def _uppercase_line(event: E) -> None: + """ + Uppercase current line. + """ + buff = event.current_buffer + buff.transform_current_line(lambda s: s.upper()) + + @handle("g", "~", "~", filter=vi_navigation_mode & ~is_read_only) + def _swapcase_line(event: E) -> None: + """ + Swap case of the current line. + """ + buff = event.current_buffer + buff.transform_current_line(lambda s: s.swapcase()) + + @handle("#", filter=vi_navigation_mode) + def _prev_occurrence(event: E) -> None: + """ + Go to previous occurrence of this word. + """ + b = event.current_buffer + search_state = event.app.current_search_state + + search_state.text = b.document.get_word_under_cursor() + search_state.direction = SearchDirection.BACKWARD + + b.apply_search(search_state, count=event.arg, include_current_position=False) + + @handle("*", filter=vi_navigation_mode) + def _next_occurrence(event: E) -> None: + """ + Go to next occurrence of this word. + """ + b = event.current_buffer + search_state = event.app.current_search_state + + search_state.text = b.document.get_word_under_cursor() + search_state.direction = SearchDirection.FORWARD + + b.apply_search(search_state, count=event.arg, include_current_position=False) + + @handle("(", filter=vi_navigation_mode) + def _begin_of_sentence(event: E) -> None: + # TODO: go to begin of sentence. + # XXX: should become text_object. + pass + + @handle(")", filter=vi_navigation_mode) + def _end_of_sentence(event: E) -> None: + # TODO: go to end of sentence. + # XXX: should become text_object. + pass + + operator = create_operator_decorator(key_bindings) + text_object = create_text_object_decorator(key_bindings) + + @handle(Keys.Any, filter=vi_waiting_for_text_object_mode) + def _unknown_text_object(event: E) -> None: + """ + Unknown key binding while waiting for a text object. + """ + event.app.output.bell() + + # + # *** Operators *** + # + + def create_delete_and_change_operators( + delete_only: bool, with_register: bool = False + ) -> None: + """ + Delete and change operators. + + :param delete_only: Create an operator that deletes, but doesn't go to insert mode. + :param with_register: Copy the deleted text to this named register instead of the clipboard. + """ + handler_keys: Iterable[str] + if with_register: + handler_keys = ('"', Keys.Any, "cd"[delete_only]) + else: + handler_keys = "cd"[delete_only] + + @operator(*handler_keys, filter=~is_read_only) + def delete_or_change_operator(event: E, text_object: TextObject) -> None: + clipboard_data = None + buff = event.current_buffer + + if text_object: + new_document, clipboard_data = text_object.cut(buff) + buff.document = new_document + + # Set deleted/changed text to clipboard or named register. + if clipboard_data and clipboard_data.text: + if with_register: + reg_name = event.key_sequence[1].data + if reg_name in vi_register_names: + event.app.vi_state.named_registers[reg_name] = clipboard_data + else: + event.app.clipboard.set_data(clipboard_data) + + # Only go back to insert mode in case of 'change'. + if not delete_only: + event.app.vi_state.input_mode = InputMode.INSERT + + create_delete_and_change_operators(False, False) + create_delete_and_change_operators(False, True) + create_delete_and_change_operators(True, False) + create_delete_and_change_operators(True, True) + + def create_transform_handler( + filter: Filter, transform_func: Callable[[str], str], *a: str + ) -> None: + @operator(*a, filter=filter & ~is_read_only) + def _(event: E, text_object: TextObject) -> None: + """ + Apply transformation (uppercase, lowercase, rot13, swap case). + """ + buff = event.current_buffer + start, end = text_object.operator_range(buff.document) + + if start < end: + # Transform. + buff.transform_region( + buff.cursor_position + start, + buff.cursor_position + end, + transform_func, + ) + + # Move cursor + buff.cursor_position += text_object.end or text_object.start + + for k, f, func in vi_transform_functions: + create_transform_handler(f, func, *k) + + @operator("y") + def _yank(event: E, text_object: TextObject) -> None: + """ + Yank operator. (Copy text.) + """ + _, clipboard_data = text_object.cut(event.current_buffer) + if clipboard_data.text: + event.app.clipboard.set_data(clipboard_data) + + @operator('"', Keys.Any, "y") + def _yank_to_register(event: E, text_object: TextObject) -> None: + """ + Yank selection to named register. + """ + c = event.key_sequence[1].data + if c in vi_register_names: + _, clipboard_data = text_object.cut(event.current_buffer) + event.app.vi_state.named_registers[c] = clipboard_data + + @operator(">") + def _indent_text_object(event: E, text_object: TextObject) -> None: + """ + Indent. + """ + buff = event.current_buffer + from_, to = text_object.get_line_numbers(buff) + indent(buff, from_, to + 1, count=event.arg) + + @operator("<") + def _unindent_text_object(event: E, text_object: TextObject) -> None: + """ + Unindent. + """ + buff = event.current_buffer + from_, to = text_object.get_line_numbers(buff) + unindent(buff, from_, to + 1, count=event.arg) + + @operator("g", "q") + def _reshape(event: E, text_object: TextObject) -> None: + """ + Reshape text. + """ + buff = event.current_buffer + from_, to = text_object.get_line_numbers(buff) + reshape_text(buff, from_, to) + + # + # *** Text objects *** + # + + @text_object("b") + def _b(event: E) -> TextObject: + """ + Move one word or token left. + """ + return TextObject( + event.current_buffer.document.find_start_of_previous_word(count=event.arg) + or 0 + ) + + @text_object("B") + def _B(event: E) -> TextObject: + """ + Move one non-blank word left + """ + return TextObject( + event.current_buffer.document.find_start_of_previous_word( + count=event.arg, WORD=True + ) + or 0 + ) + + @text_object("$") + def _dollar(event: E) -> TextObject: + """ + 'c$', 'd$' and '$': Delete/change/move until end of line. + """ + return TextObject(event.current_buffer.document.get_end_of_line_position()) + + @text_object("w") + def _word_forward(event: E) -> TextObject: + """ + 'word' forward. 'cw', 'dw', 'w': Delete/change/move one word. + """ + return TextObject( + event.current_buffer.document.find_next_word_beginning(count=event.arg) + or event.current_buffer.document.get_end_of_document_position() + ) + + @text_object("W") + def _WORD_forward(event: E) -> TextObject: + """ + 'WORD' forward. 'cW', 'dW', 'W': Delete/change/move one WORD. + """ + return TextObject( + event.current_buffer.document.find_next_word_beginning( + count=event.arg, WORD=True + ) + or event.current_buffer.document.get_end_of_document_position() + ) + + @text_object("e") + def _end_of_word(event: E) -> TextObject: + """ + End of 'word': 'ce', 'de', 'e' + """ + end = event.current_buffer.document.find_next_word_ending(count=event.arg) + return TextObject(end - 1 if end else 0, type=TextObjectType.INCLUSIVE) + + @text_object("E") + def _end_of_WORD(event: E) -> TextObject: + """ + End of 'WORD': 'cE', 'dE', 'E' + """ + end = event.current_buffer.document.find_next_word_ending( + count=event.arg, WORD=True + ) + return TextObject(end - 1 if end else 0, type=TextObjectType.INCLUSIVE) + + @text_object("i", "w", no_move_handler=True) + def _inner_word(event: E) -> TextObject: + """ + Inner 'word': ciw and diw + """ + start, end = event.current_buffer.document.find_boundaries_of_current_word() + return TextObject(start, end) + + @text_object("a", "w", no_move_handler=True) + def _a_word(event: E) -> TextObject: + """ + A 'word': caw and daw + """ + start, end = event.current_buffer.document.find_boundaries_of_current_word( + include_trailing_whitespace=True + ) + return TextObject(start, end) + + @text_object("i", "W", no_move_handler=True) + def _inner_WORD(event: E) -> TextObject: + """ + Inner 'WORD': ciW and diW + """ + start, end = event.current_buffer.document.find_boundaries_of_current_word( + WORD=True + ) + return TextObject(start, end) + + @text_object("a", "W", no_move_handler=True) + def _a_WORD(event: E) -> TextObject: + """ + A 'WORD': caw and daw + """ + start, end = event.current_buffer.document.find_boundaries_of_current_word( + WORD=True, include_trailing_whitespace=True + ) + return TextObject(start, end) + + @text_object("a", "p", no_move_handler=True) + def _paragraph(event: E) -> TextObject: + """ + Auto paragraph. + """ + start = event.current_buffer.document.start_of_paragraph() + end = event.current_buffer.document.end_of_paragraph(count=event.arg) + return TextObject(start, end) + + @text_object("^") + def _start_of_line(event: E) -> TextObject: + """'c^', 'd^' and '^': Soft start of line, after whitespace.""" + return TextObject( + event.current_buffer.document.get_start_of_line_position( + after_whitespace=True + ) + ) + + @text_object("0") + def _hard_start_of_line(event: E) -> TextObject: + """ + 'c0', 'd0': Hard start of line, before whitespace. + (The move '0' key is implemented elsewhere, because a '0' could also change the `arg`.) + """ + return TextObject( + event.current_buffer.document.get_start_of_line_position( + after_whitespace=False + ) + ) + + def create_ci_ca_handles( + ci_start: str, ci_end: str, inner: bool, key: str | None = None + ) -> None: + # TODO: 'dat', 'dit', (tags (like xml) + """ + Delete/Change string between this start and stop character. But keep these characters. + This implements all the ci", ci<, ci{, ci(, di", di<, ca", ca<, ... combinations. + """ + + def handler(event: E) -> TextObject: + if ci_start == ci_end: + # Quotes + start = event.current_buffer.document.find_backwards( + ci_start, in_current_line=False + ) + end = event.current_buffer.document.find(ci_end, in_current_line=False) + else: + # Brackets + start = event.current_buffer.document.find_enclosing_bracket_left( + ci_start, ci_end + ) + end = event.current_buffer.document.find_enclosing_bracket_right( + ci_start, ci_end + ) + + if start is not None and end is not None: + offset = 0 if inner else 1 + return TextObject(start + 1 - offset, end + offset) + else: + # Nothing found. + return TextObject(0) + + if key is None: + text_object("ai"[inner], ci_start, no_move_handler=True)(handler) + text_object("ai"[inner], ci_end, no_move_handler=True)(handler) + else: + text_object("ai"[inner], key, no_move_handler=True)(handler) + + for inner in (False, True): + for ci_start, ci_end in [ + ('"', '"'), + ("'", "'"), + ("`", "`"), + ("[", "]"), + ("<", ">"), + ("{", "}"), + ("(", ")"), + ]: + create_ci_ca_handles(ci_start, ci_end, inner) + + create_ci_ca_handles("(", ")", inner, "b") # 'dab', 'dib' + create_ci_ca_handles("{", "}", inner, "B") # 'daB', 'diB' + + @text_object("{") + def _previous_section(event: E) -> TextObject: + """ + Move to previous blank-line separated section. + Implements '{', 'c{', 'd{', 'y{' + """ + index = event.current_buffer.document.start_of_paragraph( + count=event.arg, before=True + ) + return TextObject(index) + + @text_object("}") + def _next_section(event: E) -> TextObject: + """ + Move to next blank-line separated section. + Implements '}', 'c}', 'd}', 'y}' + """ + index = event.current_buffer.document.end_of_paragraph( + count=event.arg, after=True + ) + return TextObject(index) + + @text_object("f", Keys.Any) + def _find_next_occurrence(event: E) -> TextObject: + """ + Go to next occurrence of character. Typing 'fx' will move the + cursor to the next occurrence of character. 'x'. + """ + event.app.vi_state.last_character_find = CharacterFind(event.data, False) + match = event.current_buffer.document.find( + event.data, in_current_line=True, count=event.arg + ) + if match: + return TextObject(match, type=TextObjectType.INCLUSIVE) + else: + return TextObject(0) + + @text_object("F", Keys.Any) + def _find_previous_occurrence(event: E) -> TextObject: + """ + Go to previous occurrence of character. Typing 'Fx' will move the + cursor to the previous occurrence of character. 'x'. + """ + event.app.vi_state.last_character_find = CharacterFind(event.data, True) + return TextObject( + event.current_buffer.document.find_backwards( + event.data, in_current_line=True, count=event.arg + ) + or 0 + ) + + @text_object("t", Keys.Any) + def _t(event: E) -> TextObject: + """ + Move right to the next occurrence of c, then one char backward. + """ + event.app.vi_state.last_character_find = CharacterFind(event.data, False) + match = event.current_buffer.document.find( + event.data, in_current_line=True, count=event.arg + ) + if match: + return TextObject(match - 1, type=TextObjectType.INCLUSIVE) + else: + return TextObject(0) + + @text_object("T", Keys.Any) + def _T(event: E) -> TextObject: + """ + Move left to the previous occurrence of c, then one char forward. + """ + event.app.vi_state.last_character_find = CharacterFind(event.data, True) + match = event.current_buffer.document.find_backwards( + event.data, in_current_line=True, count=event.arg + ) + return TextObject(match + 1 if match else 0) + + def repeat(reverse: bool) -> None: + """ + Create ',' and ';' commands. + """ + + @text_object("," if reverse else ";") + def _(event: E) -> TextObject: + """ + Repeat the last 'f'/'F'/'t'/'T' command. + """ + pos: int | None = 0 + vi_state = event.app.vi_state + + type = TextObjectType.EXCLUSIVE + + if vi_state.last_character_find: + char = vi_state.last_character_find.character + backwards = vi_state.last_character_find.backwards + + if reverse: + backwards = not backwards + + if backwards: + pos = event.current_buffer.document.find_backwards( + char, in_current_line=True, count=event.arg + ) + else: + pos = event.current_buffer.document.find( + char, in_current_line=True, count=event.arg + ) + type = TextObjectType.INCLUSIVE + if pos: + return TextObject(pos, type=type) + else: + return TextObject(0) + + repeat(True) + repeat(False) + + @text_object("h") + @text_object("left") + def _left(event: E) -> TextObject: + """ + Implements 'ch', 'dh', 'h': Cursor left. + """ + return TextObject( + event.current_buffer.document.get_cursor_left_position(count=event.arg) + ) + + @text_object("j", no_move_handler=True, no_selection_handler=True) + # Note: We also need `no_selection_handler`, because we in + # selection mode, we prefer the other 'j' binding that keeps + # `buffer.preferred_column`. + def _down(event: E) -> TextObject: + """ + Implements 'cj', 'dj', 'j', ... Cursor up. + """ + return TextObject( + event.current_buffer.document.get_cursor_down_position(count=event.arg), + type=TextObjectType.LINEWISE, + ) + + @text_object("k", no_move_handler=True, no_selection_handler=True) + def _up(event: E) -> TextObject: + """ + Implements 'ck', 'dk', 'k', ... Cursor up. + """ + return TextObject( + event.current_buffer.document.get_cursor_up_position(count=event.arg), + type=TextObjectType.LINEWISE, + ) + + @text_object("l") + @text_object(" ") + @text_object("right") + def _right(event: E) -> TextObject: + """ + Implements 'cl', 'dl', 'l', 'c ', 'd ', ' '. Cursor right. + """ + return TextObject( + event.current_buffer.document.get_cursor_right_position(count=event.arg) + ) + + @text_object("H") + def _top_of_screen(event: E) -> TextObject: + """ + Moves to the start of the visible region. (Below the scroll offset.) + Implements 'cH', 'dH', 'H'. + """ + w = event.app.layout.current_window + b = event.current_buffer + + if w and w.render_info: + # When we find a Window that has BufferControl showing this window, + # move to the start of the visible area. + pos = ( + b.document.translate_row_col_to_index( + w.render_info.first_visible_line(after_scroll_offset=True), 0 + ) + - b.cursor_position + ) + + else: + # Otherwise, move to the start of the input. + pos = -len(b.document.text_before_cursor) + return TextObject(pos, type=TextObjectType.LINEWISE) + + @text_object("M") + def _middle_of_screen(event: E) -> TextObject: + """ + Moves cursor to the vertical center of the visible region. + Implements 'cM', 'dM', 'M'. + """ + w = event.app.layout.current_window + b = event.current_buffer + + if w and w.render_info: + # When we find a Window that has BufferControl showing this window, + # move to the center of the visible area. + pos = ( + b.document.translate_row_col_to_index( + w.render_info.center_visible_line(), 0 + ) + - b.cursor_position + ) + + else: + # Otherwise, move to the start of the input. + pos = -len(b.document.text_before_cursor) + return TextObject(pos, type=TextObjectType.LINEWISE) + + @text_object("L") + def _end_of_screen(event: E) -> TextObject: + """ + Moves to the end of the visible region. (Above the scroll offset.) + """ + w = event.app.layout.current_window + b = event.current_buffer + + if w and w.render_info: + # When we find a Window that has BufferControl showing this window, + # move to the end of the visible area. + pos = ( + b.document.translate_row_col_to_index( + w.render_info.last_visible_line(before_scroll_offset=True), 0 + ) + - b.cursor_position + ) + + else: + # Otherwise, move to the end of the input. + pos = len(b.document.text_after_cursor) + return TextObject(pos, type=TextObjectType.LINEWISE) + + @text_object("n", no_move_handler=True) + def _search_next(event: E) -> TextObject: + """ + Search next. + """ + buff = event.current_buffer + search_state = event.app.current_search_state + + cursor_position = buff.get_search_position( + search_state, include_current_position=False, count=event.arg + ) + return TextObject(cursor_position - buff.cursor_position) + + @handle("n", filter=vi_navigation_mode) + def _search_next2(event: E) -> None: + """ + Search next in navigation mode. (This goes through the history.) + """ + search_state = event.app.current_search_state + + event.current_buffer.apply_search( + search_state, include_current_position=False, count=event.arg + ) + + @text_object("N", no_move_handler=True) + def _search_previous(event: E) -> TextObject: + """ + Search previous. + """ + buff = event.current_buffer + search_state = event.app.current_search_state + + cursor_position = buff.get_search_position( + ~search_state, include_current_position=False, count=event.arg + ) + return TextObject(cursor_position - buff.cursor_position) + + @handle("N", filter=vi_navigation_mode) + def _search_previous2(event: E) -> None: + """ + Search previous in navigation mode. (This goes through the history.) + """ + search_state = event.app.current_search_state + + event.current_buffer.apply_search( + ~search_state, include_current_position=False, count=event.arg + ) + + @handle("z", "+", filter=vi_navigation_mode | vi_selection_mode) + @handle("z", "t", filter=vi_navigation_mode | vi_selection_mode) + @handle("z", "enter", filter=vi_navigation_mode | vi_selection_mode) + def _scroll_top(event: E) -> None: + """ + Scrolls the window to makes the current line the first line in the visible region. + """ + b = event.current_buffer + event.app.layout.current_window.vertical_scroll = b.document.cursor_position_row + + @handle("z", "-", filter=vi_navigation_mode | vi_selection_mode) + @handle("z", "b", filter=vi_navigation_mode | vi_selection_mode) + def _scroll_bottom(event: E) -> None: + """ + Scrolls the window to makes the current line the last line in the visible region. + """ + # We can safely set the scroll offset to zero; the Window will make + # sure that it scrolls at least enough to make the cursor visible + # again. + event.app.layout.current_window.vertical_scroll = 0 + + @handle("z", "z", filter=vi_navigation_mode | vi_selection_mode) + def _scroll_center(event: E) -> None: + """ + Center Window vertically around cursor. + """ + w = event.app.layout.current_window + b = event.current_buffer + + if w and w.render_info: + info = w.render_info + + # Calculate the offset that we need in order to position the row + # containing the cursor in the center. + scroll_height = info.window_height // 2 + + y = max(0, b.document.cursor_position_row - 1) + height = 0 + while y > 0: + line_height = info.get_height_for_line(y) + + if height + line_height < scroll_height: + height += line_height + y -= 1 + else: + break + + w.vertical_scroll = y + + @text_object("%") + def _goto_corresponding_bracket(event: E) -> TextObject: + """ + Implements 'c%', 'd%', '%, 'y%' (Move to corresponding bracket.) + If an 'arg' has been given, go this this % position in the file. + """ + buffer = event.current_buffer + + if event._arg: + # If 'arg' has been given, the meaning of % is to go to the 'x%' + # row in the file. + if 0 < event.arg <= 100: + absolute_index = buffer.document.translate_row_col_to_index( + int((event.arg * buffer.document.line_count - 1) / 100), 0 + ) + return TextObject( + absolute_index - buffer.document.cursor_position, + type=TextObjectType.LINEWISE, + ) + else: + return TextObject(0) # Do nothing. + + else: + # Move to the corresponding opening/closing bracket (()'s, []'s and {}'s). + match = buffer.document.find_matching_bracket_position() + if match: + return TextObject(match, type=TextObjectType.INCLUSIVE) + else: + return TextObject(0) + + @text_object("|") + def _to_column(event: E) -> TextObject: + """ + Move to the n-th column (you may specify the argument n by typing it on + number keys, for example, 20|). + """ + return TextObject( + event.current_buffer.document.get_column_cursor_position(event.arg - 1) + ) + + @text_object("g", "g") + def _goto_first_line(event: E) -> TextObject: + """ + Go to the start of the very first line. + Implements 'gg', 'cgg', 'ygg' + """ + d = event.current_buffer.document + + if event._arg: + # Move to the given line. + return TextObject( + d.translate_row_col_to_index(event.arg - 1, 0) - d.cursor_position, + type=TextObjectType.LINEWISE, + ) + else: + # Move to the top of the input. + return TextObject( + d.get_start_of_document_position(), type=TextObjectType.LINEWISE + ) + + @text_object("g", "_") + def _goto_last_line(event: E) -> TextObject: + """ + Go to last non-blank of line. + 'g_', 'cg_', 'yg_', etc.. + """ + return TextObject( + event.current_buffer.document.last_non_blank_of_current_line_position(), + type=TextObjectType.INCLUSIVE, + ) + + @text_object("g", "e") + def _ge(event: E) -> TextObject: + """ + Go to last character of previous word. + 'ge', 'cge', 'yge', etc.. + """ + prev_end = event.current_buffer.document.find_previous_word_ending( + count=event.arg + ) + return TextObject( + prev_end - 1 if prev_end is not None else 0, type=TextObjectType.INCLUSIVE + ) + + @text_object("g", "E") + def _gE(event: E) -> TextObject: + """ + Go to last character of previous WORD. + 'gE', 'cgE', 'ygE', etc.. + """ + prev_end = event.current_buffer.document.find_previous_word_ending( + count=event.arg, WORD=True + ) + return TextObject( + prev_end - 1 if prev_end is not None else 0, type=TextObjectType.INCLUSIVE + ) + + @text_object("g", "m") + def _gm(event: E) -> TextObject: + """ + Like g0, but half a screenwidth to the right. (Or as much as possible.) + """ + w = event.app.layout.current_window + buff = event.current_buffer + + if w and w.render_info: + width = w.render_info.window_width + start = buff.document.get_start_of_line_position(after_whitespace=False) + start += int(min(width / 2, len(buff.document.current_line))) + + return TextObject(start, type=TextObjectType.INCLUSIVE) + return TextObject(0) + + @text_object("G") + def _last_line(event: E) -> TextObject: + """ + Go to the end of the document. (If no arg has been given.) + """ + buf = event.current_buffer + return TextObject( + buf.document.translate_row_col_to_index(buf.document.line_count - 1, 0) + - buf.cursor_position, + type=TextObjectType.LINEWISE, + ) + + # + # *** Other *** + # + + @handle("G", filter=has_arg) + def _to_nth_history_line(event: E) -> None: + """ + If an argument is given, move to this line in the history. (for + example, 15G) + """ + event.current_buffer.go_to_history(event.arg - 1) + + for n in "123456789": + + @handle( + n, + filter=vi_navigation_mode + | vi_selection_mode + | vi_waiting_for_text_object_mode, + ) + def _arg(event: E) -> None: + """ + Always handle numerics in navigation mode as arg. + """ + event.append_to_arg_count(event.data) + + @handle( + "0", + filter=( + vi_navigation_mode | vi_selection_mode | vi_waiting_for_text_object_mode + ) + & has_arg, + ) + def _0_arg(event: E) -> None: + """ + Zero when an argument was already give. + """ + event.append_to_arg_count(event.data) + + @handle(Keys.Any, filter=vi_replace_mode) + def _insert_text(event: E) -> None: + """ + Insert data at cursor position. + """ + event.current_buffer.insert_text(event.data, overwrite=True) + + @handle(Keys.Any, filter=vi_replace_single_mode) + def _replace_single(event: E) -> None: + """ + Replace single character at cursor position. + """ + event.current_buffer.insert_text(event.data, overwrite=True) + event.current_buffer.cursor_position -= 1 + event.app.vi_state.input_mode = InputMode.NAVIGATION + + @handle( + Keys.Any, + filter=vi_insert_multiple_mode, + save_before=(lambda e: not e.is_repeat), + ) + def _insert_text_multiple_cursors(event: E) -> None: + """ + Insert data at multiple cursor positions at once. + (Usually a result of pressing 'I' or 'A' in block-selection mode.) + """ + buff = event.current_buffer + original_text = buff.text + + # Construct new text. + text = [] + p = 0 + + for p2 in buff.multiple_cursor_positions: + text.append(original_text[p:p2]) + text.append(event.data) + p = p2 + + text.append(original_text[p:]) + + # Shift all cursor positions. + new_cursor_positions = [ + pos + i + 1 for i, pos in enumerate(buff.multiple_cursor_positions) + ] + + # Set result. + buff.text = "".join(text) + buff.multiple_cursor_positions = new_cursor_positions + buff.cursor_position += 1 + + @handle("backspace", filter=vi_insert_multiple_mode) + def _delete_before_multiple_cursors(event: E) -> None: + """ + Backspace, using multiple cursors. + """ + buff = event.current_buffer + original_text = buff.text + + # Construct new text. + deleted_something = False + text = [] + p = 0 + + for p2 in buff.multiple_cursor_positions: + if p2 > 0 and original_text[p2 - 1] != "\n": # Don't delete across lines. + text.append(original_text[p : p2 - 1]) + deleted_something = True + else: + text.append(original_text[p:p2]) + p = p2 + + text.append(original_text[p:]) + + if deleted_something: + # Shift all cursor positions. + lengths = [len(part) for part in text[:-1]] + new_cursor_positions = list(accumulate(lengths)) + + # Set result. + buff.text = "".join(text) + buff.multiple_cursor_positions = new_cursor_positions + buff.cursor_position -= 1 + else: + event.app.output.bell() + + @handle("delete", filter=vi_insert_multiple_mode) + def _delete_after_multiple_cursors(event: E) -> None: + """ + Delete, using multiple cursors. + """ + buff = event.current_buffer + original_text = buff.text + + # Construct new text. + deleted_something = False + text = [] + new_cursor_positions = [] + p = 0 + + for p2 in buff.multiple_cursor_positions: + text.append(original_text[p:p2]) + if p2 >= len(original_text) or original_text[p2] == "\n": + # Don't delete across lines. + p = p2 + else: + p = p2 + 1 + deleted_something = True + + text.append(original_text[p:]) + + if deleted_something: + # Shift all cursor positions. + lengths = [len(part) for part in text[:-1]] + new_cursor_positions = list(accumulate(lengths)) + + # Set result. + buff.text = "".join(text) + buff.multiple_cursor_positions = new_cursor_positions + else: + event.app.output.bell() + + @handle("left", filter=vi_insert_multiple_mode) + def _left_multiple(event: E) -> None: + """ + Move all cursors to the left. + (But keep all cursors on the same line.) + """ + buff = event.current_buffer + new_positions = [] + + for p in buff.multiple_cursor_positions: + if buff.document.translate_index_to_position(p)[1] > 0: + p -= 1 + new_positions.append(p) + + buff.multiple_cursor_positions = new_positions + + if buff.document.cursor_position_col > 0: + buff.cursor_position -= 1 + + @handle("right", filter=vi_insert_multiple_mode) + def _right_multiple(event: E) -> None: + """ + Move all cursors to the right. + (But keep all cursors on the same line.) + """ + buff = event.current_buffer + new_positions = [] + + for p in buff.multiple_cursor_positions: + row, column = buff.document.translate_index_to_position(p) + if column < len(buff.document.lines[row]): + p += 1 + new_positions.append(p) + + buff.multiple_cursor_positions = new_positions + + if not buff.document.is_cursor_at_the_end_of_line: + buff.cursor_position += 1 + + @handle("up", filter=vi_insert_multiple_mode) + @handle("down", filter=vi_insert_multiple_mode) + def _updown_multiple(event: E) -> None: + """ + Ignore all up/down key presses when in multiple cursor mode. + """ + + @handle("c-x", "c-l", filter=vi_insert_mode) + def _complete_line(event: E) -> None: + """ + Pressing the ControlX - ControlL sequence in Vi mode does line + completion based on the other lines in the document and the history. + """ + event.current_buffer.start_history_lines_completion() + + @handle("c-x", "c-f", filter=vi_insert_mode) + def _complete_filename(event: E) -> None: + """ + Complete file names. + """ + # TODO + pass + + @handle("c-k", filter=vi_insert_mode | vi_replace_mode) + def _digraph(event: E) -> None: + """ + Go into digraph mode. + """ + event.app.vi_state.waiting_for_digraph = True + + @Condition + def digraph_symbol_1_given() -> bool: + return get_app().vi_state.digraph_symbol1 is not None + + @handle(Keys.Any, filter=vi_digraph_mode & ~digraph_symbol_1_given) + def _digraph1(event: E) -> None: + """ + First digraph symbol. + """ + event.app.vi_state.digraph_symbol1 = event.data + + @handle(Keys.Any, filter=vi_digraph_mode & digraph_symbol_1_given) + def _create_digraph(event: E) -> None: + """ + Insert digraph. + """ + try: + # Lookup. + code: tuple[str, str] = ( + event.app.vi_state.digraph_symbol1 or "", + event.data, + ) + if code not in DIGRAPHS: + code = code[::-1] # Try reversing. + symbol = DIGRAPHS[code] + except KeyError: + # Unknown digraph. + event.app.output.bell() + else: + # Insert digraph. + overwrite = event.app.vi_state.input_mode == InputMode.REPLACE + event.current_buffer.insert_text(chr(symbol), overwrite=overwrite) + event.app.vi_state.waiting_for_digraph = False + finally: + event.app.vi_state.waiting_for_digraph = False + event.app.vi_state.digraph_symbol1 = None + + @handle("c-o", filter=vi_insert_mode | vi_replace_mode) + def _quick_normal_mode(event: E) -> None: + """ + Go into normal mode for one single action. + """ + event.app.vi_state.temporary_navigation_mode = True + + @handle("q", Keys.Any, filter=vi_navigation_mode & ~vi_recording_macro) + def _start_macro(event: E) -> None: + """ + Start recording macro. + """ + c = event.key_sequence[1].data + if c in vi_register_names: + vi_state = event.app.vi_state + + vi_state.recording_register = c + vi_state.current_recording = "" + + @handle("q", filter=vi_navigation_mode & vi_recording_macro) + def _stop_macro(event: E) -> None: + """ + Stop recording macro. + """ + vi_state = event.app.vi_state + + # Store and stop recording. + if vi_state.recording_register: + vi_state.named_registers[vi_state.recording_register] = ClipboardData( + vi_state.current_recording + ) + vi_state.recording_register = None + vi_state.current_recording = "" + + @handle("@", Keys.Any, filter=vi_navigation_mode, record_in_macro=False) + def _execute_macro(event: E) -> None: + """ + Execute macro. + + Notice that we pass `record_in_macro=False`. This ensures that the `@x` + keys don't appear in the recording itself. This function inserts the + body of the called macro back into the KeyProcessor, so these keys will + be added later on to the macro of their handlers have + `record_in_macro=True`. + """ + # Retrieve macro. + c = event.key_sequence[1].data + try: + macro = event.app.vi_state.named_registers[c] + except KeyError: + return + + # Expand macro (which is a string in the register), in individual keys. + # Use vt100 parser for this. + keys: list[KeyPress] = [] + + parser = Vt100Parser(keys.append) + parser.feed(macro.text) + parser.flush() + + # Now feed keys back to the input processor. + for _ in range(event.arg): + event.app.key_processor.feed_multiple(keys, first=True) + + return ConditionalKeyBindings(key_bindings, vi_mode) + + +def load_vi_search_bindings() -> KeyBindingsBase: + key_bindings = KeyBindings() + handle = key_bindings.add + from . import search + + @Condition + def search_buffer_is_empty() -> bool: + "Returns True when the search buffer is empty." + return get_app().current_buffer.text == "" + + # Vi-style forward search. + handle( + "/", + filter=(vi_navigation_mode | vi_selection_mode) & ~vi_search_direction_reversed, + )(search.start_forward_incremental_search) + handle( + "?", + filter=(vi_navigation_mode | vi_selection_mode) & vi_search_direction_reversed, + )(search.start_forward_incremental_search) + handle("c-s")(search.start_forward_incremental_search) + + # Vi-style backward search. + handle( + "?", + filter=(vi_navigation_mode | vi_selection_mode) & ~vi_search_direction_reversed, + )(search.start_reverse_incremental_search) + handle( + "/", + filter=(vi_navigation_mode | vi_selection_mode) & vi_search_direction_reversed, + )(search.start_reverse_incremental_search) + handle("c-r")(search.start_reverse_incremental_search) + + # Apply the search. (At the / or ? prompt.) + handle("enter", filter=is_searching)(search.accept_search) + + handle("c-r", filter=is_searching)(search.reverse_incremental_search) + handle("c-s", filter=is_searching)(search.forward_incremental_search) + + handle("c-c")(search.abort_search) + handle("c-g")(search.abort_search) + handle("backspace", filter=search_buffer_is_empty)(search.abort_search) + + # Handle escape. This should accept the search, just like readline. + # `abort_search` would be a meaningful alternative. + handle("escape")(search.accept_search) + + return ConditionalKeyBindings(key_bindings, vi_mode) diff --git a/shared/package-files/9c/9c014369c3b1d833448de1da12d038e101d9497e56e0c97017561c260bd6b7e7/blob b/shared/package-files/9c/9c014369c3b1d833448de1da12d038e101d9497e56e0c97017561c260bd6b7e7/blob new file mode 100644 index 0000000000000000000000000000000000000000..99b0f6716cedbd169834f261cafd4382d460d38b --- /dev/null +++ b/shared/package-files/9c/9c014369c3b1d833448de1da12d038e101d9497e56e0c97017561c260bd6b7e7/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor le(const at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor & le_(at::Tensor & self, const at::Scalar & other); +TORCH_API at::Tensor le(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & le_(at::Tensor & self, const at::Tensor & other); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9c/9c019039547d64401bef4dee84e55066a7fecf488233810385b1cae3f87f4dd7/blob b/shared/package-files/9c/9c019039547d64401bef4dee84e55066a7fecf488233810385b1cae3f87f4dd7/blob new file mode 100644 index 0000000000000000000000000000000000000000..e85acca3ac49d1cb84792bdf369cffe69a5d8ad8 --- /dev/null +++ b/shared/package-files/9c/9c019039547d64401bef4dee84e55066a7fecf488233810385b1cae3f87f4dd7/blob @@ -0,0 +1,6 @@ +import warnings +warnings.warn( + "scipy.misc.common is deprecated and will be removed in 2.0.0", + DeprecationWarning, + stacklevel=2 +) diff --git a/shared/package-files/9c/9c031b0bf1b133c6fcf9d47d025010f56fffbf26e0a3edfe5fa6d2062d2e9f8f/blob b/shared/package-files/9c/9c031b0bf1b133c6fcf9d47d025010f56fffbf26e0a3edfe5fa6d2062d2e9f8f/blob new file mode 100644 index 0000000000000000000000000000000000000000..6ad3e200c881969a46e669ba8cabe1973232bb2b --- /dev/null +++ b/shared/package-files/9c/9c031b0bf1b133c6fcf9d47d025010f56fffbf26e0a3edfe5fa6d2062d2e9f8f/blob @@ -0,0 +1,20 @@ +from .array import ArrayField as ArrayField +from .jsonb import JSONField as JSONField, JsonAdapter as JsonAdapter +from .ranges import ( + RangeField as RangeField, + IntegerRangeField as IntegerRangeField, + BigIntegerRangeField as BigIntegerRangeField, + DecimalRangeField as DecimalRangeField, + FloatRangeField as FloatRangeField, + DateRangeField as DateRangeField, + DateTimeRangeField as DateTimeRangeField, + RangeOperators as RangeOperators, + RangeBoundary as RangeBoundary, +) +from .hstore import HStoreField as HStoreField +from .citext import ( + CICharField as CICharField, + CIEmailField as CIEmailField, + CIText as CIText, + CITextField as CITextField, +) diff --git a/shared/package-files/9c/9c09f590ec3a68969f94f4000c4cd41221ed4d133180a75b2c2b3abf1c2c5f6f/blob b/shared/package-files/9c/9c09f590ec3a68969f94f4000c4cd41221ed4d133180a75b2c2b3abf1c2c5f6f/blob new file mode 100644 index 0000000000000000000000000000000000000000..a30dda6cc94c7e9aa95d7d83934cf4fb327d8a5f --- /dev/null +++ b/shared/package-files/9c/9c09f590ec3a68969f94f4000c4cd41221ed4d133180a75b2c2b3abf1c2c5f6f/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor & sspaddmm_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta=1, const at::Scalar & alpha=1); +TORCH_API at::Tensor & sspaddmm_outf(const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/9c/9c0a9ae323e2fe9e335e1559dc1c9a28d7886e4f0116306b9405f63d61649dc7/blob b/shared/package-files/9c/9c0a9ae323e2fe9e335e1559dc1c9a28d7886e4f0116306b9405f63d61649dc7/blob new file mode 100644 index 0000000000000000000000000000000000000000..be4eaa9fa94cf1156578c2f32a720dc73c654b71 --- /dev/null +++ b/shared/package-files/9c/9c0a9ae323e2fe9e335e1559dc1c9a28d7886e4f0116306b9405f63d61649dc7/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API unfold_backward { + using schema = at::Tensor (const at::Tensor &, c10::SymIntArrayRef, int64_t, int64_t, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::unfold_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "unfold_backward(Tensor grad_in, SymInt[] input_sizes, int dim, int size, int step) -> Tensor") + static at::Tensor call(const at::Tensor & grad_in, c10::SymIntArrayRef input_sizes, int64_t dim, int64_t size, int64_t step); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_in, c10::SymIntArrayRef input_sizes, int64_t dim, int64_t size, int64_t step); +}; + +struct TORCH_API unfold_backward_out { + using schema = at::Tensor & (const at::Tensor &, c10::SymIntArrayRef, int64_t, int64_t, int64_t, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::unfold_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "unfold_backward.out(Tensor grad_in, SymInt[] input_sizes, int dim, int size, int step, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & grad_in, c10::SymIntArrayRef input_sizes, int64_t dim, int64_t size, int64_t step, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_in, c10::SymIntArrayRef input_sizes, int64_t dim, int64_t size, int64_t step, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9c/9c0bc66d5916e5eba8e7e5dcfdec76fe5068f77c1c1ebb64c095f44ffe4c1d5e/blob b/shared/package-files/9c/9c0bc66d5916e5eba8e7e5dcfdec76fe5068f77c1c1ebb64c095f44ffe4c1d5e/blob new file mode 100644 index 0000000000000000000000000000000000000000..cdebf8ca37605547063d89040465fec07d77ad5a --- /dev/null +++ b/shared/package-files/9c/9c0bc66d5916e5eba8e7e5dcfdec76fe5068f77c1c1ebb64c095f44ffe4c1d5e/blob @@ -0,0 +1,136 @@ +Metadata-Version: 2.1 +Name: networkx +Version: 3.1 +Summary: Python package for creating and manipulating graphs and networks +Home-page: https://networkx.org/ +Author: Aric Hagberg +Author-email: hagberg@lanl.gov +Maintainer: NetworkX Developers +Maintainer-email: networkx-discuss@googlegroups.com +Project-URL: Bug Tracker, https://github.com/networkx/networkx/issues +Project-URL: Documentation, https://networkx.org/documentation/stable/ +Project-URL: Source Code, https://github.com/networkx/networkx +Keywords: Networks,Graph Theory,Mathematics,network,graph,discrete mathematics,math +Platform: Linux +Platform: Mac OSX +Platform: Windows +Platform: Unix +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Science/Research +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Scientific/Engineering :: Bio-Informatics +Classifier: Topic :: Scientific/Engineering :: Information Analysis +Classifier: Topic :: Scientific/Engineering :: Mathematics +Classifier: Topic :: Scientific/Engineering :: Physics +Requires-Python: >=3.8 +License-File: LICENSE.txt +Provides-Extra: default +Requires-Dist: numpy (>=1.20) ; extra == 'default' +Requires-Dist: scipy (>=1.8) ; extra == 'default' +Requires-Dist: matplotlib (>=3.4) ; extra == 'default' +Requires-Dist: pandas (>=1.3) ; extra == 'default' +Provides-Extra: developer +Requires-Dist: pre-commit (>=3.2) ; extra == 'developer' +Requires-Dist: mypy (>=1.1) ; extra == 'developer' +Provides-Extra: doc +Requires-Dist: sphinx (>=6.1) ; extra == 'doc' +Requires-Dist: pydata-sphinx-theme (>=0.13) ; extra == 'doc' +Requires-Dist: sphinx-gallery (>=0.12) ; extra == 'doc' +Requires-Dist: numpydoc (>=1.5) ; extra == 'doc' +Requires-Dist: pillow (>=9.4) ; extra == 'doc' +Requires-Dist: nb2plots (>=0.6) ; extra == 'doc' +Requires-Dist: texext (>=0.6.7) ; extra == 'doc' +Provides-Extra: extra +Requires-Dist: lxml (>=4.6) ; extra == 'extra' +Requires-Dist: pygraphviz (>=1.10) ; extra == 'extra' +Requires-Dist: pydot (>=1.4.2) ; extra == 'extra' +Requires-Dist: sympy (>=1.10) ; extra == 'extra' +Provides-Extra: test +Requires-Dist: pytest (>=7.2) ; extra == 'test' +Requires-Dist: pytest-cov (>=4.0) ; extra == 'test' +Requires-Dist: codecov (>=2.1) ; extra == 'test' + +NetworkX +======== + +`NetworkX Survey 2023!! `_ 🎉 Fill out the survey to tell us about your ideas, complaints, praises of NetworkX! + + +.. image:: https://github.com/networkx/networkx/workflows/test/badge.svg?tag=networkx-3.1 + :target: https://github.com/networkx/networkx/actions?query=branch%3Anetworkx-3.1 + +.. image:: https://codecov.io/gh/networkx/networkx/branch/main/graph/badge.svg + :target: https://app.codecov.io/gh/networkx/networkx/branch/main + +.. image:: https://img.shields.io/github/labels/networkx/networkx/Good%20First%20Issue?color=green&label=Contribute%20&style=flat-square + :target: https://github.com/networkx/networkx/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22 + + +NetworkX is a Python package for the creation, manipulation, +and study of the structure, dynamics, and functions +of complex networks. + +- **Website (including documentation):** https://networkx.org +- **Mailing list:** https://groups.google.com/forum/#!forum/networkx-discuss +- **Source:** https://github.com/networkx/networkx +- **Bug reports:** https://github.com/networkx/networkx/issues +- **Report a security vulnerability:** https://tidelift.com/security +- **Tutorial:** https://networkx.org/documentation/latest/tutorial.html +- **GitHub Discussions:** https://github.com/networkx/networkx/discussions + +Simple example +-------------- + +Find the shortest path between two nodes in an undirected graph: + +.. code:: pycon + + >>> import networkx as nx + >>> G = nx.Graph() + >>> G.add_edge("A", "B", weight=4) + >>> G.add_edge("B", "D", weight=2) + >>> G.add_edge("A", "C", weight=3) + >>> G.add_edge("C", "D", weight=4) + >>> nx.shortest_path(G, "A", "D", weight="weight") + ['A', 'B', 'D'] + +Install +------- + +Install the latest version of NetworkX:: + + $ pip install networkx + +Install with all optional dependencies:: + + $ pip install networkx[all] + +For additional details, please see `INSTALL.rst`. + +Bugs +---- + +Please report any bugs that you find `here `_. +Or, even better, fork the repository on `GitHub `_ +and create a pull request (PR). We welcome all changes, big or small, and we +will help you make the PR if you are new to `git` (just ask on the issue and/or +see `CONTRIBUTING.rst`). + +License +------- + +Released under the 3-Clause BSD license (see `LICENSE.txt`):: + + Copyright (C) 2004-2023 NetworkX Developers + Aric Hagberg + Dan Schult + Pieter Swart diff --git a/shared/package-files/9c/9c123d1165300dc1b02eafc751eb1ce38ec2ec4ef0442da1e4abcee11f3a4b8b/blob b/shared/package-files/9c/9c123d1165300dc1b02eafc751eb1ce38ec2ec4ef0442da1e4abcee11f3a4b8b/blob new file mode 100644 index 0000000000000000000000000000000000000000..09f23e1b078f7b0f36b456124f1fb79289b2cb85 --- /dev/null +++ b/shared/package-files/9c/9c123d1165300dc1b02eafc751eb1ce38ec2ec4ef0442da1e4abcee11f3a4b8b/blob @@ -0,0 +1,562 @@ +""" +Text-based visual representations of graphs +""" +import sys +import warnings +from collections import defaultdict + +import networkx as nx +from networkx.utils import open_file + +__all__ = ["forest_str", "generate_network_text", "write_network_text"] + + +class _AsciiBaseGlyphs: + empty = "+" + newtree_last = "+-- " + newtree_mid = "+-- " + endof_forest = " " + within_forest = ": " + within_tree = "| " + + +class AsciiDirectedGlyphs(_AsciiBaseGlyphs): + last = "L-> " + mid = "|-> " + backedge = "<-" + + +class AsciiUndirectedGlyphs(_AsciiBaseGlyphs): + last = "L-- " + mid = "|-- " + backedge = "-" + + +class _UtfBaseGlyphs: + # Notes on available box and arrow characters + # https://en.wikipedia.org/wiki/Box-drawing_character + # https://stackoverflow.com/questions/2701192/triangle-arrow + empty = "╙" + newtree_last = "╙── " + newtree_mid = "╟── " + endof_forest = " " + within_forest = "╎ " + within_tree = "│ " + + +class UtfDirectedGlyphs(_UtfBaseGlyphs): + last = "└─╼ " + mid = "├─╼ " + backedge = "╾" + + +class UtfUndirectedGlyphs(_UtfBaseGlyphs): + last = "└── " + mid = "├── " + backedge = "─" + + +def generate_network_text( + graph, with_labels=True, sources=None, max_depth=None, ascii_only=False +): + """Generate lines in the "network text" format + + This works via a depth-first traversal of the graph and writing a line for + each unique node encountered. Non-tree edges are written to the right of + each node, and connection to a non-tree edge is indicated with an ellipsis. + This representation works best when the input graph is a forest, but any + graph can be represented. + + This notation is original to networkx, although it is simple enough that it + may be known in existing literature. See #5602 for details. The procedure + is summarized as follows: + + 1. Given a set of source nodes (which can be specified, or automatically + discovered via finding the (strongly) connected components and choosing one + node with minimum degree from each), we traverse the graph in depth first + order. + + 2. Each reachable node will be printed exactly once on it's own line. + + 3. Edges are indicated in one of three ways: + + a. a parent "L-style" connection on the upper left. This corresponds to + a traversal in the directed DFS tree. + + b. a backref "<-style" connection shown directly on the right. For + directed graphs, these are drawn for any incoming edges to a node that + is not a parent edge. For undirected graphs, these are drawn for only + the non-parent edges that have already been represented (The edges that + have not been represented will be handled in the recursive case). + + c. a child "L-style" connection on the lower right. Drawing of the + children are handled recursively. + + 4. The children of each node (wrt the directed DFS tree) are drawn + underneath and to the right of it. In the case that a child node has already + been drawn the connection is replaced with an ellipsis ("...") to indicate + that there is one or more connections represented elsewhere. + + 5. If a maximum depth is specified, an edge to nodes past this maximum + depth will be represented by an ellipsis. + + Parameters + ---------- + graph : nx.DiGraph | nx.Graph + Graph to represent + + with_labels : bool | str + If True will use the "label" attribute of a node to display if it + exists otherwise it will use the node value itself. If given as a + string, then that attribute name will be used instead of "label". + Defaults to True. + + sources : List + Specifies which nodes to start traversal from. Note: nodes that are not + reachable from one of these sources may not be shown. If unspecified, + the minimal set of nodes needed to reach all others will be used. + + max_depth : int | None + The maximum depth to traverse before stopping. Defaults to None. + + ascii_only : Boolean + If True only ASCII characters are used to construct the visualization + + Yields + ------ + str : a line of generated text + """ + is_directed = graph.is_directed() + + if is_directed: + glyphs = AsciiDirectedGlyphs if ascii_only else UtfDirectedGlyphs + succ = graph.succ + pred = graph.pred + else: + glyphs = AsciiUndirectedGlyphs if ascii_only else UtfUndirectedGlyphs + succ = graph.adj + pred = graph.adj + + if isinstance(with_labels, str): + label_attr = with_labels + elif with_labels: + label_attr = "label" + else: + label_attr = None + + if max_depth == 0: + yield glyphs.empty + " ..." + elif len(graph.nodes) == 0: + yield glyphs.empty + else: + # If the nodes to traverse are unspecified, find the minimal set of + # nodes that will reach the entire graph + if sources is None: + sources = _find_sources(graph) + + # Populate the stack with each: + # 1. parent node in the DFS tree (or None for root nodes), + # 2. the current node in the DFS tree + # 2. a list of indentations indicating depth + # 3. a flag indicating if the node is the final one to be written. + # Reverse the stack so sources are popped in the correct order. + last_idx = len(sources) - 1 + stack = [ + (None, node, [], (idx == last_idx)) for idx, node in enumerate(sources) + ][::-1] + + num_skipped_children = defaultdict(lambda: 0) + seen_nodes = set() + while stack: + parent, node, indents, this_islast = stack.pop() + + if node is not Ellipsis: + skip = node in seen_nodes + if skip: + # Mark that we skipped a parent's child + num_skipped_children[parent] += 1 + + if this_islast: + # If we reached the last child of a parent, and we skipped + # any of that parents children, then we should emit an + # ellipsis at the end after this. + if num_skipped_children[parent] and parent is not None: + # Append the ellipsis to be emitted last + next_islast = True + try_frame = (node, Ellipsis, indents, next_islast) + stack.append(try_frame) + + # Redo this frame, but not as a last object + next_islast = False + try_frame = (parent, node, indents, next_islast) + stack.append(try_frame) + continue + + if skip: + continue + seen_nodes.add(node) + + if not indents: + # Top level items (i.e. trees in the forest) get different + # glyphs to indicate they are not actually connected + if this_islast: + this_prefix = indents + [glyphs.newtree_last] + next_prefix = indents + [glyphs.endof_forest] + else: + this_prefix = indents + [glyphs.newtree_mid] + next_prefix = indents + [glyphs.within_forest] + + else: + # For individual tree edges distinguish between directed and + # undirected cases + if this_islast: + this_prefix = indents + [glyphs.last] + next_prefix = indents + [glyphs.endof_forest] + else: + this_prefix = indents + [glyphs.mid] + next_prefix = indents + [glyphs.within_tree] + + if node is Ellipsis: + label = " ..." + suffix = "" + children = [] + else: + if label_attr is not None: + label = str(graph.nodes[node].get(label_attr, node)) + else: + label = str(node) + + # Determine: + # (1) children to traverse into after showing this node. + # (2) parents to immediately show to the right of this node. + if is_directed: + # In the directed case we must show every successor node + # note: it may be skipped later, but we don't have that + # information here. + children = list(succ[node]) + # In the directed case we must show every predecessor + # except for parent we directly traversed from. + handled_parents = {parent} + else: + # Showing only the unseen children results in a more + # concise representation for the undirected case. + children = [ + child for child in succ[node] if child not in seen_nodes + ] + + # In the undirected case, parents are also children, so we + # only need to immediately show the ones we can no longer + # traverse + handled_parents = {*children, parent} + + if max_depth is not None and len(indents) == max_depth - 1: + # Use ellipsis to indicate we have reached maximum depth + if children: + children = [Ellipsis] + handled_parents = {parent} + + # The other parents are other predecessors of this node that + # are not handled elsewhere. + other_parents = [p for p in pred[node] if p not in handled_parents] + if other_parents: + if label_attr is not None: + other_parents_labels = ", ".join( + [ + str(graph.nodes[p].get(label_attr, p)) + for p in other_parents + ] + ) + else: + other_parents_labels = ", ".join( + [str(p) for p in other_parents] + ) + suffix = " ".join(["", glyphs.backedge, other_parents_labels]) + else: + suffix = "" + + # Emit the line for this node, this will be called for each node + # exactly once. + yield "".join(this_prefix + [label, suffix]) + + # Push children on the stack in reverse order so they are popped in + # the original order. + for idx, child in enumerate(children[::-1]): + next_islast = idx == 0 + try_frame = (node, child, next_prefix, next_islast) + stack.append(try_frame) + + +@open_file(1, "w") +def write_network_text( + graph, + path=None, + with_labels=True, + sources=None, + max_depth=None, + ascii_only=False, + end="\n", +): + """Creates a nice text representation of a graph + + This works via a depth-first traversal of the graph and writing a line for + each unique node encountered. Non-tree edges are written to the right of + each node, and connection to a non-tree edge is indicated with an ellipsis. + This representation works best when the input graph is a forest, but any + graph can be represented. + + Parameters + ---------- + graph : nx.DiGraph | nx.Graph + Graph to represent + + path : string or file or callable or None + Filename or file handle for data output. + if a function, then it will be called for each generated line. + if None, this will default to "sys.stdout.write" + + with_labels : bool | str + If True will use the "label" attribute of a node to display if it + exists otherwise it will use the node value itself. If given as a + string, then that attribute name will be used instead of "label". + Defaults to True. + + sources : List + Specifies which nodes to start traversal from. Note: nodes that are not + reachable from one of these sources may not be shown. If unspecified, + the minimal set of nodes needed to reach all others will be used. + + max_depth : int | None + The maximum depth to traverse before stopping. Defaults to None. + + ascii_only : Boolean + If True only ASCII characters are used to construct the visualization + + end : string + The line ending character + + Examples + -------- + >>> graph = nx.balanced_tree(r=2, h=2, create_using=nx.DiGraph) + >>> nx.write_network_text(graph) + ╙── 0 + ├─╼ 1 + │ ├─╼ 3 + │ └─╼ 4 + └─╼ 2 + ├─╼ 5 + └─╼ 6 + + >>> # A near tree with one non-tree edge + >>> graph.add_edge(5, 1) + >>> nx.write_network_text(graph) + ╙── 0 + ├─╼ 1 ╾ 5 + │ ├─╼ 3 + │ └─╼ 4 + └─╼ 2 + ├─╼ 5 + │ └─╼ ... + └─╼ 6 + + >>> graph = nx.cycle_graph(5) + >>> nx.write_network_text(graph) + ╙── 0 + ├── 1 + │ └── 2 + │ └── 3 + │ └── 4 ─ 0 + └── ... + + >>> graph = nx.generators.barbell_graph(4, 2) + >>> nx.write_network_text(graph) + ╙── 4 + ├── 5 + │ └── 6 + │ ├── 7 + │ │ ├── 8 ─ 6 + │ │ │ └── 9 ─ 6, 7 + │ │ └── ... + │ └── ... + └── 3 + ├── 0 + │ ├── 1 ─ 3 + │ │ └── 2 ─ 0, 3 + │ └── ... + └── ... + + >>> graph = nx.complete_graph(5, create_using=nx.Graph) + >>> nx.write_network_text(graph) + ╙── 0 + ├── 1 + │ ├── 2 ─ 0 + │ │ ├── 3 ─ 0, 1 + │ │ │ └── 4 ─ 0, 1, 2 + │ │ └── ... + │ └── ... + └── ... + + >>> graph = nx.complete_graph(3, create_using=nx.DiGraph) + >>> nx.write_network_text(graph) + ╙── 0 ╾ 1, 2 + ├─╼ 1 ╾ 2 + │ ├─╼ 2 ╾ 0 + │ │ └─╼ ... + │ └─╼ ... + └─╼ ... + """ + if path is None: + # The path is unspecified, write to stdout + _write = sys.stdout.write + elif hasattr(path, "write"): + # The path is already an open file + _write = path.write + elif callable(path): + # The path is a custom callable + _write = path + else: + raise TypeError(type(path)) + + for line in generate_network_text( + graph, + with_labels=with_labels, + sources=sources, + max_depth=max_depth, + ascii_only=ascii_only, + ): + _write(line + end) + + +def _find_sources(graph): + """ + Determine a minimal set of nodes such that the entire graph is reachable + """ + # For each connected part of the graph, choose at least + # one node as a starting point, preferably without a parent + if graph.is_directed(): + # Choose one node from each SCC with minimum in_degree + sccs = list(nx.strongly_connected_components(graph)) + # condensing the SCCs forms a dag, the nodes in this graph with + # 0 in-degree correspond to the SCCs from which the minimum set + # of nodes from which all other nodes can be reached. + scc_graph = nx.condensation(graph, sccs) + supernode_to_nodes = {sn: [] for sn in scc_graph.nodes()} + # Note: the order of mapping differs between pypy and cpython + # so we have to loop over graph nodes for consistency + mapping = scc_graph.graph["mapping"] + for n in graph.nodes: + sn = mapping[n] + supernode_to_nodes[sn].append(n) + sources = [] + for sn in scc_graph.nodes(): + if scc_graph.in_degree[sn] == 0: + scc = supernode_to_nodes[sn] + node = min(scc, key=lambda n: graph.in_degree[n]) + sources.append(node) + else: + # For undirected graph, the entire graph will be reachable as + # long as we consider one node from every connected component + sources = [ + min(cc, key=lambda n: graph.degree[n]) + for cc in nx.connected_components(graph) + ] + sources = sorted(sources, key=lambda n: graph.degree[n]) + return sources + + +def forest_str(graph, with_labels=True, sources=None, write=None, ascii_only=False): + """Creates a nice utf8 representation of a forest + + This function has been superseded by + :func:`nx.readwrite.text.generate_network_text`, which should be used + instead. + + Parameters + ---------- + graph : nx.DiGraph | nx.Graph + Graph to represent (must be a tree, forest, or the empty graph) + + with_labels : bool + If True will use the "label" attribute of a node to display if it + exists otherwise it will use the node value itself. Defaults to True. + + sources : List + Mainly relevant for undirected forests, specifies which nodes to list + first. If unspecified the root nodes of each tree will be used for + directed forests; for undirected forests this defaults to the nodes + with the smallest degree. + + write : callable + Function to use to write to, if None new lines are appended to + a list and returned. If set to the `print` function, lines will + be written to stdout as they are generated. If specified, + this function will return None. Defaults to None. + + ascii_only : Boolean + If True only ASCII characters are used to construct the visualization + + Returns + ------- + str | None : + utf8 representation of the tree / forest + + Examples + -------- + >>> graph = nx.balanced_tree(r=2, h=3, create_using=nx.DiGraph) + >>> print(nx.forest_str(graph)) + ╙── 0 + ├─╼ 1 + │ ├─╼ 3 + │ │ ├─╼ 7 + │ │ └─╼ 8 + │ └─╼ 4 + │ ├─╼ 9 + │ └─╼ 10 + └─╼ 2 + ├─╼ 5 + │ ├─╼ 11 + │ └─╼ 12 + └─╼ 6 + ├─╼ 13 + └─╼ 14 + + + >>> graph = nx.balanced_tree(r=1, h=2, create_using=nx.Graph) + >>> print(nx.forest_str(graph)) + ╙── 0 + └── 1 + └── 2 + + >>> print(nx.forest_str(graph, ascii_only=True)) + +-- 0 + L-- 1 + L-- 2 + """ + msg = ( + "\nforest_str is deprecated as of version 3.1 and will be removed " + "in version 3.3. Use generate_network_text or write_network_text " + "instead.\n" + ) + warnings.warn(msg, DeprecationWarning) + + if len(graph.nodes) > 0: + if not nx.is_forest(graph): + raise nx.NetworkXNotImplemented("input must be a forest or the empty graph") + + printbuf = [] + if write is None: + _write = printbuf.append + else: + _write = write + + write_network_text( + graph, + _write, + with_labels=with_labels, + sources=sources, + ascii_only=ascii_only, + end="", + ) + + if write is None: + # Only return a string if the custom write function was not specified + return "\n".join(printbuf) diff --git a/shared/package-files/9c/9c1776fb4c1b31b94c836c27f4fdf790dff798d70dd58852e6ca2d4db5b3d012/blob b/shared/package-files/9c/9c1776fb4c1b31b94c836c27f4fdf790dff798d70dd58852e6ca2d4db5b3d012/blob new file mode 100644 index 0000000000000000000000000000000000000000..2123bf2ce51d1d705b9b985b7906bc6857ba39a2 --- /dev/null +++ b/shared/package-files/9c/9c1776fb4c1b31b94c836c27f4fdf790dff798d70dd58852e6ca2d4db5b3d012/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor _sparse_addmm(const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta=1, const at::Scalar & alpha=1); +TORCH_API at::Tensor & _sparse_addmm_out(const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/9c/9c1902ef079ac93f34c5cf48fe4ef469b69873a65c7dc7262ab1b1ef218a2f3b/blob b/shared/package-files/9c/9c1902ef079ac93f34c5cf48fe4ef469b69873a65c7dc7262ab1b1ef218a2f3b/blob new file mode 100644 index 0000000000000000000000000000000000000000..a627e552ac0064f5d35f15c16b834f2c16ab9a1b --- /dev/null +++ b/shared/package-files/9c/9c1902ef079ac93f34c5cf48fe4ef469b69873a65c7dc7262ab1b1ef218a2f3b/blob @@ -0,0 +1,54 @@ +mod,llf,parameters +"arima wpi, arima(3,0,0) noconstant vce(oim)",-145.917,"1.600047,-.3624836,-.2377553,.7515501" +"arima wpi c, arima(3,0,0) noconstant vce(oim)",-145.1327,"78.60683,1.599097,-.3606729,-.2392393,.7511453" +"arima wpi c t, arima(3,0,0) noconstant vce(oim)",-139.5423,"19.46176,.768438,1.528349,-.3448674,-.1935674,.7281097" +"arima wpi c t3, arima(3,0,0) noconstant vce(oim)",-138.9533,"38.71439,.0000445,1.530887,-.3313616,-.2082853,.7239346" +"arima wpi, arima(3,2,0) noconstant vce(oim)",-135.9354,"-.4536069,-.3408174,-.0977653,.7363397" +"arima wpi, arima(3,0,0) sarima(0,2,0,4) noconstant vce(oim)",-194.9269,"1.179762,-.3453264,-.0898734,1.289575" +"arima wpi, arima(3,0,0) noconstant vce(oim) diffuse",-159.3091,"1.641477,-.6359852,-.0014474,.7450104" +"arima wpi x, arima(3,0,0) noconstant vce(oim)",-145.7514,".0806147,1.610143,-.382758,-.2275756,.7505294" +"arima wpi, arima(0,0,3) noconstant vce(oim)",-540.8154,"-505.7114,-970.6211,-507.9258,.0357879" +"arima wpi c, arima(0,0,3) noconstant vce(oim)",-379.8598,"62.99608,2.451664,2.39358,.8955524,4.920951" +"arima wpi c t, arima(0,0,3) noconstant vce(oim)",-254.3036,"13.00193,.7996427,2.084224,2.038812,.8249226,1.800869" +"arima wpi c t3, arima(0,0,3) noconstant vce(oim)",-278.1551,"38.14465,.0000501,2.115914,2.078889,.8569969,2.181463" +"arima wpi, arima(0,2,3) noconstant vce(oim)",-136.14,"-.4584812,-.1298735,.0632101,.7375874" +"arima wpi, arima(0,0,3) sarima(0,2,0,4) noconstant vce(oim)",-171.4663,"1.094744,1.094739,1.000001,-1.008989" +"arima wpi, arima(0,0,3) noconstant vce(oim) diffuse",-587.4832,"-27.57705,-55.33257,-29.37171,.6453013" +"arima wpi x, arima(0,0,3) noconstant vce(oim)",-476.4098,".9280385,2.378931,2.378931,.9999992,10.62952" +"arima wpi, arima(3,0,3) noconstant vce(oim)",-142.1485,".9500802,.9998841,-.9501915,.6116305,-.5273701,-.1392938,.7241816" +"arima wpi c, arima(3,0,2) noconstant vce(oim)",-141.6737,"80.5513,1.678086,-.4215884,-.2572052,-.1579189,-.2332231,.7297933" +"arima wpi c t, arima(3,0,2) noconstant vce(oim)",-136.6645,"16.39083,.7941504,1.635404,-.3962173,-.2480547,-.1668943,-.2374508,.7109324" +"arima wpi c t3, arima(3,0,2) noconstant vce(oim)",-135.8174,"37.6362,.0000484,1.6636,-.4328509,-.2383885,-.1989134,-.2353735,.7052346" +"arima wpi, arima(3,2,2) noconstant vce(oim)",-134.3081,".6015591,.0150202,.2054096,-1.094043,.1107661,.7241633" +"arima wpi, arima(3,0,2) sarima(0,2,0,4) noconstant vce(oim)",-179.129,"1.211058,-.7514844,.1956546,-.1231004,1,1.088146" +"arima wpi, arima(3,2,2) sarima(0,2,0,4) noconstant vce(oim)",-190.8858,"-.3645584,.1081667,.1720293,9.66e-08,-1.000001,1.247552" +"arima wpi, arima(3,0,2) noconstant vce(oim) diffuse",-155.478,"2.261425,-1.605342,.3449455,-.7905483,.1561876,.7256975" +"arima wpi x, arima(3,0,2) noconstant vce(oim)",-142.1656,".1367752,1.632881,-.3357823,-.2972526,-.0898929,-.2674371,.7281773" +"arima wpi, sarima(3,0,0,4) noconstant vce(oim)",-302.9966,"1.950329,-1.151533,.199516,2.442114" +"arima wpi c, sarima(3,0,0,4) noconstant vce(oim)",-299.2088,"71.28411,1.937048,-1.128636,.182796,2.42974" +"arima wpi c t, sarima(3,0,0,4) noconstant vce(oim)",-279.8638,"19.09781,.7348265,1.728363,-1.005377,.1971021,2.181769" +"arima wpi c t3, sarima(3,0,0,4) noconstant vce(oim)",-284.7776,"40.37701,.0000402,1.771423,-.9909791,.1655766,2.250117" +"arima wpi, arima(0,2,0) sarima(3,0,0,4) noconstant vce(oim)",-146.5967,".1093829,-.0753548,-.0933771,.8039928" +"arima wpi, sarima(3,2,0,4) noconstant vce(oim)",-268.6161,".0712682,-.3369143,-.1180569,2.438388" +"arima wpi, sarima(3,0,0,4) noconstant vce(oim) diffuse",-355.6312,"1.625832,-.61329,.0032626,2.456462" +"arima wpi x, sarima(3,0,0,4) noconstant vce(oim)",-302.6354,"-.3005221,1.955475,-1.161604,.2044588,2.434233" +"arima wpi, sarima(0,0,3,4) noconstant vce(oim)",-493.3605,"2.612943,2.61295,1.000004,10.63571" +"arima wpi c, sarima(0,0,3,4) noconstant vce(oim)",-407.9579,"63.18759,2.716964,2.792693,1.128853,4.888196" +"arima wpi c t, sarima(0,0,3,4) noconstant vce(oim)",-302.5591,"15.22961,.7746883,1.741946,1.4764,.6085909,2.620034" +"arima wpi c t3, sarima(0,0,3,4) noconstant vce(oim)",-320.6151,"38.83094,.0000473,1.806445,1.633288,.7156993,2.992223" +"arima wpi, arima(0,2,0) sarima(0,0,3,4) noconstant vce(oim)",-146.6127,".1181947,-.0550111,-.0974394,.8041813" +"arima wpi, sarima(0,2,3,4) noconstant vce(oim)",-265.4803,"-.0022288,-.4547194,-.265093,2.352103" +"arima wpi, sarima(0,0,3,4) noconstant vce(oim) diffuse",-594.3781,"2.523607,2.442817,.9009514,11.65001" +"arima wpi x, sarima(0,0,3,4) noconstant vce(oim)",-493.3495,"-.07391,2.613046,2.613045,.9999989,10.63459" +"arima wpi, sarima(3,0,2,4) noconstant vce(oim)",-298.2331,"2.290215,-1.620824,.3299609,1.239569,-1.690899,1.134022" +"arima wpi c, sarima(3,0,2,4) noconstant vce(oim)",-297.3261,"71.09661,.8739118,.628973,-.5235254,3.822714,3.279209,.7281108" +"arima wpi c t, sarima(3,0,2,4) noconstant vce(oim)",-277.6305,"18.52915,.7413986,.0106101,1.414883,-.6965621,1.775,.5448672,2.144826" +"arima wpi c t3, sarima(3,0,2,4) noconstant vce(oim)",-274.1764,"39.50053,.000046,2.077418,-1.276982,.161876,-.487932,-.5120805,1.979523" +"arima wpi, arima(0,2,0) sarima(3,0,2,4) noconstant vce(oim)",-144.272,"-1.510547,-.6593249,-.0585331,1.688265,.8242572,.780077" +"arima wpi, sarima(3,2,2,4) noconstant vce(oim)",-265.2458,".963946,-.4554486,.1971574,-1.021818,.0216137,2.297261" +"arima wpi, arima(0,2,0) sarima(3,2,2,4) noconstant vce(oim)",-166.3303,"-1.501011,-.7561807,-.2807991,.0000117,-.9999927,.9676953" +"arima wpi, sarima(3,0,2,4) noconstant vce(oim) diffuse",-332.4084,"1.138662,-.1033737,-3.58e-08,.5722654,-.0668218,2.400033" +"arima wpi x, sarima(3,0,2,4) noconstant vce(oim)",-300.3242,"-.3366271,1.468002,-.3188579,-.1517738,20.52264,36.0693,.0660329" +"arima wpi x, arima(3,2,2) sarima(3,2,2,4) noconstant vce(oim)",-153.2699,".0895384,.2855166,.1133933,.1913281,-.7379875,-.2619959,-1.222196,-.6400887,-.3323564,-.2370796,-.7629162,.8210427" +"arima wpi x, arima(3,2,2) sarima(3,2,2,4) noconstant vce(oim) diffuse",-225.3551,".0277889,-.7673,-.0694887,.2007625,.6439733,-.4002686,-.3540113,-.0270317,-2.49e-07,.3540135,.0270364,1.231185" +"arima D.wpi2 t32 x, arima(3,0,2) noconstant vce(oim)",-126.8014,"8.88e-07,.2010488,.1937695,-.447184,.6869978,.4204914,.7453312,.742711" diff --git a/shared/package-files/9c/9c1ac437652c9dd25ab4eb429c51ca2282a9c8e91569e5ca52e23a256f716ccf/blob b/shared/package-files/9c/9c1ac437652c9dd25ab4eb429c51ca2282a9c8e91569e5ca52e23a256f716ccf/blob new file mode 100644 index 0000000000000000000000000000000000000000..99dc3ff797f5faf21ec4f53bf0c6cd036e38c9c9 --- /dev/null +++ b/shared/package-files/9c/9c1ac437652c9dd25ab4eb429c51ca2282a9c8e91569e5ca52e23a256f716ccf/blob @@ -0,0 +1,715 @@ +"""Extract reference documentation from the NumPy source tree. + +Copyright (C) 2008 Stefan van der Walt , Pauli Virtanen + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +""" +import inspect +import textwrap +import re +import pydoc +from warnings import warn +from collections import namedtuple +from collections.abc import Callable, Mapping +import copy +import sys + + +def strip_blank_lines(l): + "Remove leading and trailing blank lines from a list of lines" + while l and not l[0].strip(): + del l[0] + while l and not l[-1].strip(): + del l[-1] + return l + + +class Reader: + """A line-based string reader. + + """ + def __init__(self, data): + """ + Parameters + ---------- + data : str + String with lines separated by '\n'. + + """ + if isinstance(data, list): + self._str = data + else: + self._str = data.split('\n') # store string as list of lines + + self.reset() + + def __getitem__(self, n): + return self._str[n] + + def reset(self): + self._l = 0 # current line nr + + def read(self): + if not self.eof(): + out = self[self._l] + self._l += 1 + return out + else: + return '' + + def seek_next_non_empty_line(self): + for l in self[self._l:]: + if l.strip(): + break + else: + self._l += 1 + + def eof(self): + return self._l >= len(self._str) + + def read_to_condition(self, condition_func): + start = self._l + for line in self[start:]: + if condition_func(line): + return self[start:self._l] + self._l += 1 + if self.eof(): + return self[start:self._l+1] + return [] + + def read_to_next_empty_line(self): + self.seek_next_non_empty_line() + + def is_empty(line): + return not line.strip() + + return self.read_to_condition(is_empty) + + def read_to_next_unindented_line(self): + def is_unindented(line): + return (line.strip() and (len(line.lstrip()) == len(line))) + return self.read_to_condition(is_unindented) + + def peek(self, n=0): + if self._l + n < len(self._str): + return self[self._l + n] + else: + return '' + + def is_empty(self): + return not ''.join(self._str).strip() + + +class ParseError(Exception): + def __str__(self): + message = self.args[0] + if hasattr(self, 'docstring'): + message = f"{message} in {self.docstring!r}" + return message + + +Parameter = namedtuple('Parameter', ['name', 'type', 'desc']) + + +class NumpyDocString(Mapping): + """Parses a numpydoc string to an abstract representation + + Instances define a mapping from section title to structured data. + + """ + + sections = { + 'Signature': '', + 'Summary': [''], + 'Extended Summary': [], + 'Parameters': [], + 'Returns': [], + 'Yields': [], + 'Receives': [], + 'Raises': [], + 'Warns': [], + 'Other Parameters': [], + 'Attributes': [], + 'Methods': [], + 'See Also': [], + 'Notes': [], + 'Warnings': [], + 'References': '', + 'Examples': '', + 'index': {} + } + + def __init__(self, docstring, config={}): + orig_docstring = docstring + docstring = textwrap.dedent(docstring).split('\n') + + self._doc = Reader(docstring) + self._parsed_data = copy.deepcopy(self.sections) + + try: + self._parse() + except ParseError as e: + e.docstring = orig_docstring + raise + + def __getitem__(self, key): + return self._parsed_data[key] + + def __setitem__(self, key, val): + if key not in self._parsed_data: + self._error_location(f"Unknown section {key}", error=False) + else: + self._parsed_data[key] = val + + def __iter__(self): + return iter(self._parsed_data) + + def __len__(self): + return len(self._parsed_data) + + def _is_at_section(self): + self._doc.seek_next_non_empty_line() + + if self._doc.eof(): + return False + + l1 = self._doc.peek().strip() # e.g. Parameters + + if l1.startswith('.. index::'): + return True + + l2 = self._doc.peek(1).strip() # ---------- or ========== + return l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1)) + + def _strip(self, doc): + i = 0 + j = 0 + for i, line in enumerate(doc): + if line.strip(): + break + + for j, line in enumerate(doc[::-1]): + if line.strip(): + break + + return doc[i:len(doc)-j] + + def _read_to_next_section(self): + section = self._doc.read_to_next_empty_line() + + while not self._is_at_section() and not self._doc.eof(): + if not self._doc.peek(-1).strip(): # previous line was empty + section += [''] + + section += self._doc.read_to_next_empty_line() + + return section + + def _read_sections(self): + while not self._doc.eof(): + data = self._read_to_next_section() + name = data[0].strip() + + if name.startswith('..'): # index section + yield name, data[1:] + elif len(data) < 2: + yield StopIteration + else: + yield name, self._strip(data[2:]) + + def _parse_param_list(self, content, single_element_is_type=False): + r = Reader(content) + params = [] + while not r.eof(): + header = r.read().strip() + if ' : ' in header: + arg_name, arg_type = header.split(' : ')[:2] + else: + if single_element_is_type: + arg_name, arg_type = '', header + else: + arg_name, arg_type = header, '' + + desc = r.read_to_next_unindented_line() + desc = dedent_lines(desc) + desc = strip_blank_lines(desc) + + params.append(Parameter(arg_name, arg_type, desc)) + + return params + + # See also supports the following formats. + # + # + # SPACE* COLON SPACE+ SPACE* + # ( COMMA SPACE+ )+ (COMMA | PERIOD)? SPACE* + # ( COMMA SPACE+ )* SPACE* COLON SPACE+ SPACE* + + # is one of + # + # COLON COLON BACKTICK BACKTICK + # where + # is a legal function name, and + # is any nonempty sequence of word characters. + # Examples: func_f1 :meth:`func_h1` :obj:`~baz.obj_r` :class:`class_j` + # is a string describing the function. + + _role = r":(?P\w+):" + _funcbacktick = r"`(?P(?:~\w+\.)?[a-zA-Z0-9_\.-]+)`" + _funcplain = r"(?P[a-zA-Z0-9_\.-]+)" + _funcname = r"(" + _role + _funcbacktick + r"|" + _funcplain + r")" + _funcnamenext = _funcname.replace('role', 'rolenext') + _funcnamenext = _funcnamenext.replace('name', 'namenext') + _description = r"(?P\s*:(\s+(?P\S+.*))?)?\s*$" + _func_rgx = re.compile(r"^\s*" + _funcname + r"\s*") + _line_rgx = re.compile( + r"^\s*" + + r"(?P" + # group for all function names + _funcname + + r"(?P([,]\s+" + _funcnamenext + r")*)" + + r")" + # end of "allfuncs" + r"(?P[,\.])?" + # Some function lists have a trailing comma (or period) '\s*' + _description) + + # Empty elements are replaced with '..' + empty_description = '..' + + def _parse_see_also(self, content): + """ + func_name : Descriptive text + continued text + another_func_name : Descriptive text + func_name1, func_name2, :meth:`func_name`, func_name3 + + """ + + items = [] + + def parse_item_name(text): + """Match ':role:`name`' or 'name'.""" + m = self._func_rgx.match(text) + if not m: + raise ParseError(f"{text} is not a item name") + role = m.group('role') + name = m.group('name') if role else m.group('name2') + return name, role, m.end() + + rest = [] + for line in content: + if not line.strip(): + continue + + line_match = self._line_rgx.match(line) + description = None + if line_match: + description = line_match.group('desc') + if line_match.group('trailing') and description: + self._error_location( + 'Unexpected comma or period after function list at index %d of ' + 'line "%s"' % (line_match.end('trailing'), line), + error=False) + if not description and line.startswith(' '): + rest.append(line.strip()) + elif line_match: + funcs = [] + text = line_match.group('allfuncs') + while True: + if not text.strip(): + break + name, role, match_end = parse_item_name(text) + funcs.append((name, role)) + text = text[match_end:].strip() + if text and text[0] == ',': + text = text[1:].strip() + rest = list(filter(None, [description])) + items.append((funcs, rest)) + else: + raise ParseError(f"{line} is not a item name") + return items + + def _parse_index(self, section, content): + """ + .. index: default + :refguide: something, else, and more + + """ + def strip_each_in(lst): + return [s.strip() for s in lst] + + out = {} + section = section.split('::') + if len(section) > 1: + out['default'] = strip_each_in(section[1].split(','))[0] + for line in content: + line = line.split(':') + if len(line) > 2: + out[line[1]] = strip_each_in(line[2].split(',')) + return out + + def _parse_summary(self): + """Grab signature (if given) and summary""" + if self._is_at_section(): + return + + # If several signatures present, take the last one + while True: + summary = self._doc.read_to_next_empty_line() + summary_str = " ".join([s.strip() for s in summary]).strip() + compiled = re.compile(r'^([\w., ]+=)?\s*[\w\.]+\(.*\)$') + if compiled.match(summary_str): + self['Signature'] = summary_str + if not self._is_at_section(): + continue + break + + if summary is not None: + self['Summary'] = summary + + if not self._is_at_section(): + self['Extended Summary'] = self._read_to_next_section() + + def _parse(self): + self._doc.reset() + self._parse_summary() + + sections = list(self._read_sections()) + section_names = {section for section, content in sections} + + has_returns = 'Returns' in section_names + has_yields = 'Yields' in section_names + # We could do more tests, but we are not. Arbitrarily. + if has_returns and has_yields: + msg = 'Docstring contains both a Returns and Yields section.' + raise ValueError(msg) + if not has_yields and 'Receives' in section_names: + msg = 'Docstring contains a Receives section but not Yields.' + raise ValueError(msg) + + for (section, content) in sections: + if not section.startswith('..'): + section = (s.capitalize() for s in section.split(' ')) + section = ' '.join(section) + if self.get(section): + self._error_location(f"The section {section} appears twice") + + if section in ('Parameters', 'Other Parameters', 'Attributes', + 'Methods'): + self[section] = self._parse_param_list(content) + elif section in ('Returns', 'Yields', 'Raises', 'Warns', 'Receives'): + self[section] = self._parse_param_list( + content, single_element_is_type=True) + elif section.startswith('.. index::'): + self['index'] = self._parse_index(section, content) + elif section == 'See Also': + self['See Also'] = self._parse_see_also(content) + else: + self[section] = content + + def _error_location(self, msg, error=True): + if hasattr(self, '_obj'): + # we know where the docs came from: + try: + filename = inspect.getsourcefile(self._obj) + except TypeError: + filename = None + msg = msg + f" in the docstring of {self._obj} in {filename}." + if error: + raise ValueError(msg) + else: + warn(msg) + + # string conversion routines + + def _str_header(self, name, symbol='-'): + return [name, len(name)*symbol] + + def _str_indent(self, doc, indent=4): + out = [] + for line in doc: + out += [' '*indent + line] + return out + + def _str_signature(self): + if self['Signature']: + return [self['Signature'].replace('*', r'\*')] + [''] + else: + return [''] + + def _str_summary(self): + if self['Summary']: + return self['Summary'] + [''] + else: + return [] + + def _str_extended_summary(self): + if self['Extended Summary']: + return self['Extended Summary'] + [''] + else: + return [] + + def _str_param_list(self, name): + out = [] + if self[name]: + out += self._str_header(name) + for param in self[name]: + parts = [] + if param.name: + parts.append(param.name) + if param.type: + parts.append(param.type) + out += [' : '.join(parts)] + if param.desc and ''.join(param.desc).strip(): + out += self._str_indent(param.desc) + out += [''] + return out + + def _str_section(self, name): + out = [] + if self[name]: + out += self._str_header(name) + out += self[name] + out += [''] + return out + + def _str_see_also(self, func_role): + if not self['See Also']: + return [] + out = [] + out += self._str_header("See Also") + out += [''] + last_had_desc = True + for funcs, desc in self['See Also']: + assert isinstance(funcs, list) + links = [] + for func, role in funcs: + if role: + link = f':{role}:`{func}`' + elif func_role: + link = f':{func_role}:`{func}`' + else: + link = f"`{func}`_" + links.append(link) + link = ', '.join(links) + out += [link] + if desc: + out += self._str_indent([' '.join(desc)]) + last_had_desc = True + else: + last_had_desc = False + out += self._str_indent([self.empty_description]) + + if last_had_desc: + out += [''] + out += [''] + return out + + def _str_index(self): + idx = self['index'] + out = [] + output_index = False + default_index = idx.get('default', '') + if default_index: + output_index = True + out += [f'.. index:: {default_index}'] + for section, references in idx.items(): + if section == 'default': + continue + output_index = True + out += [f" :{section}: {', '.join(references)}"] + if output_index: + return out + else: + return '' + + def __str__(self, func_role=''): + out = [] + out += self._str_signature() + out += self._str_summary() + out += self._str_extended_summary() + for param_list in ('Parameters', 'Returns', 'Yields', 'Receives', + 'Other Parameters', 'Raises', 'Warns'): + out += self._str_param_list(param_list) + out += self._str_section('Warnings') + out += self._str_see_also(func_role) + for s in ('Notes', 'References', 'Examples'): + out += self._str_section(s) + for param_list in ('Attributes', 'Methods'): + out += self._str_param_list(param_list) + out += self._str_index() + return '\n'.join(out) + + +def indent(str, indent=4): + indent_str = ' '*indent + if str is None: + return indent_str + lines = str.split('\n') + return '\n'.join(indent_str + l for l in lines) + + +def dedent_lines(lines): + """Deindent a list of lines maximally""" + return textwrap.dedent("\n".join(lines)).split("\n") + + +def header(text, style='-'): + return text + '\n' + style*len(text) + '\n' + + +class FunctionDoc(NumpyDocString): + def __init__(self, func, role='func', doc=None, config={}): + self._f = func + self._role = role # e.g. "func" or "meth" + + if doc is None: + if func is None: + raise ValueError("No function or docstring given") + doc = inspect.getdoc(func) or '' + NumpyDocString.__init__(self, doc, config) + + if not self['Signature'] and func is not None: + func, func_name = self.get_func() + try: + try: + signature = str(inspect.signature(func)) + except (AttributeError, ValueError): + # try to read signature, backward compat for older Python + if sys.version_info[0] >= 3: + argspec = inspect.getfullargspec(func) + else: + argspec = inspect.getargspec(func) + signature = inspect.formatargspec(*argspec) + signature = f'{func_name}{signature}' + except TypeError: + signature = f'{func_name}()' + self['Signature'] = signature + + def get_func(self): + func_name = getattr(self._f, '__name__', self.__class__.__name__) + if inspect.isclass(self._f): + func = getattr(self._f, '__call__', self._f.__init__) + else: + func = self._f + return func, func_name + + def __str__(self): + out = '' + + func, func_name = self.get_func() + + roles = {'func': 'function', + 'meth': 'method'} + + if self._role: + if self._role not in roles: + print(f"Warning: invalid role {self._role}") + out += f".. {roles.get(self._role, '')}:: {func_name}\n \n\n" + + out += super().__str__(func_role=self._role) + return out + + +class ClassDoc(NumpyDocString): + + extra_public_methods = ['__call__'] + + def __init__(self, cls, doc=None, modulename='', func_doc=FunctionDoc, + config={}): + if not inspect.isclass(cls) and cls is not None: + raise ValueError(f"Expected a class or None, but got {cls!r}") + self._cls = cls + + if 'sphinx' in sys.modules: + from sphinx.ext.autodoc import ALL + else: + ALL = object() + + self.show_inherited_members = config.get( + 'show_inherited_class_members', True) + + if modulename and not modulename.endswith('.'): + modulename += '.' + self._mod = modulename + + if doc is None: + if cls is None: + raise ValueError("No class or documentation string given") + doc = pydoc.getdoc(cls) + + NumpyDocString.__init__(self, doc) + + _members = config.get('members', []) + if _members is ALL: + _members = None + _exclude = config.get('exclude-members', []) + + if config.get('show_class_members', True) and _exclude is not ALL: + def splitlines_x(s): + if not s: + return [] + else: + return s.splitlines() + for field, items in [('Methods', self.methods), + ('Attributes', self.properties)]: + if not self[field]: + doc_list = [] + for name in sorted(items): + if (name in _exclude or + (_members and name not in _members)): + continue + try: + doc_item = pydoc.getdoc(getattr(self._cls, name)) + doc_list.append( + Parameter(name, '', splitlines_x(doc_item))) + except AttributeError: + pass # method doesn't exist + self[field] = doc_list + + @property + def methods(self): + if self._cls is None: + return [] + return [name for name, func in inspect.getmembers(self._cls) + if ((not name.startswith('_') + or name in self.extra_public_methods) + and isinstance(func, Callable) + and self._is_show_member(name))] + + @property + def properties(self): + if self._cls is None: + return [] + return [name for name, func in inspect.getmembers(self._cls) + if (not name.startswith('_') and + (func is None or isinstance(func, property) or + inspect.isdatadescriptor(func)) + and self._is_show_member(name))] + + def _is_show_member(self, name): + if self.show_inherited_members: + return True # show all class members + if name not in self._cls.__dict__: + return False # class member is inherited, we do not show it + return True diff --git a/shared/package-files/9c/9c1bfd52f351b0112c082f2472e68e697539cd93c1eac1d44f2af467bf73dc03/blob b/shared/package-files/9c/9c1bfd52f351b0112c082f2472e68e697539cd93c1eac1d44f2af467bf73dc03/blob new file mode 100644 index 0000000000000000000000000000000000000000..66126eba32e3bf279746a78667ed29f056abfa55 Binary files /dev/null and b/shared/package-files/9c/9c1bfd52f351b0112c082f2472e68e697539cd93c1eac1d44f2af467bf73dc03/blob differ diff --git a/shared/package-files/9c/9c1dfa1c15994dd8774e53f40cb14dcf529143468721f1dba7b2c2e14ae9f5f0/blob b/shared/package-files/9c/9c1dfa1c15994dd8774e53f40cb14dcf529143468721f1dba7b2c2e14ae9f5f0/blob new file mode 100644 index 0000000000000000000000000000000000000000..7be2474dd91c8a7da181fcda09d838254b890d75 Binary files /dev/null and b/shared/package-files/9c/9c1dfa1c15994dd8774e53f40cb14dcf529143468721f1dba7b2c2e14ae9f5f0/blob differ diff --git a/shared/package-files/9c/9c231f9497caf513a22dee8f790b07f969b0e45854a0bdd6dd84b492e08c2856/blob b/shared/package-files/9c/9c231f9497caf513a22dee8f790b07f969b0e45854a0bdd6dd84b492e08c2856/blob new file mode 100644 index 0000000000000000000000000000000000000000..d6bba58863649898a3f075cdda51cade9dc07f06 --- /dev/null +++ b/shared/package-files/9c/9c231f9497caf513a22dee8f790b07f969b0e45854a0bdd6dd84b492e08c2856/blob @@ -0,0 +1,15 @@ +__all__ = [ + # Functions + 'calcsize', 'pack', 'pack_into', 'unpack', 'unpack_from', + 'iter_unpack', + + # Classes + 'Struct', + + # Exceptions + 'error' + ] + +from _struct import * +from _struct import _clearcache +from _struct import __doc__ diff --git a/shared/package-files/9c/9c23f2c51935740a123d6882ee41b874b697b3618bdfe2915d1b76370817a080/blob b/shared/package-files/9c/9c23f2c51935740a123d6882ee41b874b697b3618bdfe2915d1b76370817a080/blob new file mode 100644 index 0000000000000000000000000000000000000000..ee76633a660a48225064bbb86a25f6a2f36c6d9a --- /dev/null +++ b/shared/package-files/9c/9c23f2c51935740a123d6882ee41b874b697b3618bdfe2915d1b76370817a080/blob @@ -0,0 +1,1869 @@ +NIST/ITL StRD +Dataset Name: SmLs02 (SmLs02.dat) + + +File Format: ASCII + Certified Values (lines 41 to 47) + Data (lines 61 to 1869) + + +Procedure: Analysis of Variance + + +Reference: Simon, Stephen D. and Lesage, James P. (1989). + "Assessing the Accuracy of ANOVA Calculations in + Statistical Software". + Computational Statistics & Data Analysis, 8, pp. 325-332. + + +Data: 1 Factor + 9 Treatments + 201 Replicates/Cell + 1809 Observations + 1 Constant Leading Digit + Lower Level of Difficulty + Generated Data + + +Model: 10 Parameters (mu,tau_1, ... , tau_9) + y_{ij} = mu + tau_i + epsilon_{ij} + + + + + + +Certified Values: + +Source of Sums of Mean +Variation df Squares Squares F Statistic + +Between Treatment 8 1.60800000000000E+01 2.01000000000000E+00 2.01000000000000E+02 +Within Treatment 1800 1.80000000000000E+01 1.00000000000000E-02 + + Certified R-Squared 4.71830985915493E-01 + + Certified Residual + Standard Deviation 1.00000000000000E-01 + + + + + + + + + + + + +Data: Treatment Response + 1 1.4 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 1 1.3 + 1 1.5 + 2 1.3 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 2 1.2 + 2 1.4 + 3 1.5 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 3 1.4 + 3 1.6 + 4 1.3 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 4 1.2 + 4 1.4 + 5 1.5 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 5 1.4 + 5 1.6 + 6 1.3 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 6 1.2 + 6 1.4 + 7 1.5 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 7 1.4 + 7 1.6 + 8 1.3 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 8 1.2 + 8 1.4 + 9 1.5 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 + 9 1.4 + 9 1.6 diff --git a/shared/package-files/9c/9c24f9d6630307f253d57de8b3fe101c435d347f8b1c756e6a1f4aa22f6a8cb7/blob b/shared/package-files/9c/9c24f9d6630307f253d57de8b3fe101c435d347f8b1c756e6a1f4aa22f6a8cb7/blob new file mode 100644 index 0000000000000000000000000000000000000000..d069aeea25e4ae5adf608e7a289c1a50fdaad61c --- /dev/null +++ b/shared/package-files/9c/9c24f9d6630307f253d57de8b3fe101c435d347f8b1c756e6a1f4aa22f6a8cb7/blob @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_upsample_nearest_exact3d_backward.grad_input(Tensor grad_output, SymInt[3] output_size, SymInt[5] input_size, float? scales_d=None, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & _upsample_nearest_exact3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::_upsample_nearest_exact3d_backward_grad_input::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), scales_d, scales_h, scales_w, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & _upsample_nearest_exact3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::_upsample_nearest_exact3d_backward_grad_input::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), scales_d, scales_h, scales_w, grad_input); + } +} + +// aten::_upsample_nearest_exact3d_backward.grad_input(Tensor grad_output, SymInt[3] output_size, SymInt[5] input_size, float? scales_d=None, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & _upsample_nearest_exact3d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional scales_d, c10::optional scales_h, c10::optional scales_w, at::Tensor & grad_input) { + return at::_ops::_upsample_nearest_exact3d_backward_grad_input::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), scales_d, scales_h, scales_w, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & _upsample_nearest_exact3d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional scales_d, c10::optional scales_h, c10::optional scales_w, at::Tensor & grad_input) { + return at::_ops::_upsample_nearest_exact3d_backward_grad_input::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), scales_d, scales_h, scales_w, grad_input); + } +} + +// aten::_upsample_nearest_exact3d_backward.grad_input(Tensor grad_output, SymInt[3] output_size, SymInt[5] input_size, float? scales_d=None, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & _upsample_nearest_exact3d_backward_symint_out(at::Tensor & grad_input, const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::_upsample_nearest_exact3d_backward_grad_input::call(grad_output, output_size, input_size, scales_d, scales_h, scales_w, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & _upsample_nearest_exact3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::_upsample_nearest_exact3d_backward_grad_input::call(grad_output, output_size, input_size, scales_d, scales_h, scales_w, grad_input); + } +} + +// aten::_upsample_nearest_exact3d_backward.grad_input(Tensor grad_output, SymInt[3] output_size, SymInt[5] input_size, float? scales_d=None, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & _upsample_nearest_exact3d_backward_symint_outf(const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, c10::optional scales_d, c10::optional scales_h, c10::optional scales_w, at::Tensor & grad_input) { + return at::_ops::_upsample_nearest_exact3d_backward_grad_input::call(grad_output, output_size, input_size, scales_d, scales_h, scales_w, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & _upsample_nearest_exact3d_backward_outf(const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, c10::optional scales_d, c10::optional scales_h, c10::optional scales_w, at::Tensor & grad_input) { + return at::_ops::_upsample_nearest_exact3d_backward_grad_input::call(grad_output, output_size, input_size, scales_d, scales_h, scales_w, grad_input); + } +} + +// aten::_upsample_nearest_exact3d_backward(Tensor grad_output, SymInt[3] output_size, SymInt[5] input_size, float? scales_d=None, float? scales_h=None, float? scales_w=None) -> Tensor +inline at::Tensor _upsample_nearest_exact3d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::_upsample_nearest_exact3d_backward::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), scales_d, scales_h, scales_w); +} +namespace symint { + template ::value>> + at::Tensor _upsample_nearest_exact3d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::_upsample_nearest_exact3d_backward::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), scales_d, scales_h, scales_w); + } +} + +// aten::_upsample_nearest_exact3d_backward(Tensor grad_output, SymInt[3] output_size, SymInt[5] input_size, float? scales_d=None, float? scales_h=None, float? scales_w=None) -> Tensor +inline at::Tensor _upsample_nearest_exact3d_backward_symint(const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::_upsample_nearest_exact3d_backward::call(grad_output, output_size, input_size, scales_d, scales_h, scales_w); +} +namespace symint { + template ::value>> + at::Tensor _upsample_nearest_exact3d_backward(const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::_upsample_nearest_exact3d_backward::call(grad_output, output_size, input_size, scales_d, scales_h, scales_w); + } +} + +} diff --git a/shared/package-files/9c/9c26ea4fedfbc6100c3e99a16475d082313733faf377047d08090814da2eff96/blob b/shared/package-files/9c/9c26ea4fedfbc6100c3e99a16475d082313733faf377047d08090814da2eff96/blob new file mode 100644 index 0000000000000000000000000000000000000000..fca6dc753fb0760f15595058cb22aa32cce9747c --- /dev/null +++ b/shared/package-files/9c/9c26ea4fedfbc6100c3e99a16475d082313733faf377047d08090814da2eff96/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor upsample_nearest3d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt); +TORCH_API at::Tensor upsample_nearest3d_backward_symint(const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, c10::optional scales_d=c10::nullopt, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9c/9c282a935af67941335a8e4a90871a74c00035c1e2e37241f75d4c9563a3da1e/blob b/shared/package-files/9c/9c282a935af67941335a8e4a90871a74c00035c1e2e37241f75d4c9563a3da1e/blob new file mode 100644 index 0000000000000000000000000000000000000000..e78f131e58fec111068aa42095c6bbcc219d2370 --- /dev/null +++ b/shared/package-files/9c/9c282a935af67941335a8e4a90871a74c00035c1e2e37241f75d4c9563a3da1e/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_trunc : public TensorIteratorBase { + + + void meta(const at::Tensor & self); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/9c/9c2d1f8e9f70ae14a724c23c376403ee8bd6a75096f9d2562f2695e0afd0979e/blob b/shared/package-files/9c/9c2d1f8e9f70ae14a724c23c376403ee8bd6a75096f9d2562f2695e0afd0979e/blob new file mode 100644 index 0000000000000000000000000000000000000000..97cfe7717d33216ed9dd156d6aa561d88e8de087 --- /dev/null +++ b/shared/package-files/9c/9c2d1f8e9f70ae14a724c23c376403ee8bd6a75096f9d2562f2695e0afd0979e/blob @@ -0,0 +1 @@ +from SimpleHTTPServer import * diff --git a/shared/package-files/9c/9c31331fa086f7ea0f90af738c9795305ec4948ba105fb1f957f8ffab3f5f23e/blob b/shared/package-files/9c/9c31331fa086f7ea0f90af738c9795305ec4948ba105fb1f957f8ffab3f5f23e/blob new file mode 100644 index 0000000000000000000000000000000000000000..43cde1e04043afdd843b21a4113b358afb6db691 --- /dev/null +++ b/shared/package-files/9c/9c31331fa086f7ea0f90af738c9795305ec4948ba105fb1f957f8ffab3f5f23e/blob @@ -0,0 +1,707 @@ +import itertools +from abc import ABC +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Tuple, Union + +import torchgen.api.dispatcher as dispatcher +from torchgen.api.lazy import ( + getValueT, + isValueType, + LazyArgument, + LazyIrProperties, + LazyIrSchema, + tensorListValueT, +) +from torchgen.api.translate import translate +from torchgen.api.types import ( + BaseCType, + Binding, + deviceT, + DispatcherSignature, + kernel_signature, + NativeSignature, + OptionalCType, + VectorCType, +) +from torchgen.context import method_with_native_function +from torchgen.dest.lazy_ts_lowering import ts_lowering_body +from torchgen.model import ( + Argument, + BackendIndex, + BackendMetadata, + BaseTy, + BaseType, + FunctionSchema, + ListType, + NativeFunction, + NativeFunctionsGroup, +) + + +def node_ctor_arg_rvalue_string(arg: LazyArgument) -> str: + """ + Given a LazyArgument, + generate a c++ string for materializing an rvalue of that arg for passing into + a lazy Node constructor. + """ + + # TODO: Matching on CType seems wrong; should be matching on Type + if isValueType(arg.lazy_type): + if isinstance(arg.lazy_type, BaseCType): + if arg.is_wrapped_scalar: + return f"node_{arg.name}" + elif arg.lazy_type.type is tensorListValueT: + return f"lazy_{arg.name}_tensorlist" + elif arg.is_symint_or_list: + return f"GetSymIntValue({arg.name})" + return f"lazy_{arg.name}->GetIrValue()" + elif isinstance(arg.lazy_type, OptionalCType): + if arg.is_symint_or_list: + # TODO: I don't understand when you should put lazy_ in the name + # or not + return f"{arg.name} ? c10::make_optional(GetSymIntValue(*{arg.name})) : c10::nullopt" + elif arg.is_wrapped_scalar: + return f"node_{arg.name}" + return ( + f"lazy_{arg.name} ? " + f"c10::make_optional(lazy_{arg.name}->GetIrValue()) : " + "c10::nullopt" + ) + else: + raise AssertionError( + f"TODO not sure if there are other valid types to handle here ({arg.lazy_type})" + ) + else: + # NB: this is here because right now we aren't treating SymInt[] as a + # value type; when we do this needs to move above + # NB: we cannot test arg.lazy_type as we've already specified it is an + # int64_t and so we cannot distinguish between SymInt and int64_t + if isinstance(arg.orig_type, ListType) and arg.orig_type.elem == BaseType( + BaseTy.SymInt + ): + if arg.symint: + return f"GetSymIntArrayRefValue({arg.name})" + else: + return f"std::vector({arg.name}.begin(), {arg.name}.end())" + elif isinstance(arg.lazy_type, VectorCType) and isinstance( + arg.lazy_type.elem, BaseCType + ): + return f"std::vector<{arg.lazy_type.elem.type}>({arg.name}.begin(), {arg.name}.end())" + elif ( + isinstance(arg.lazy_type, OptionalCType) + and isinstance(arg.lazy_type.elem, VectorCType) + and isinstance(arg.lazy_type.elem.elem, BaseCType) + ): + return f"torch::lazy::ToOptionalVector<{arg.lazy_type.elem.elem.type}>({arg.name})" + else: + return f"{arg.name}" + + +def node_ctor_inputs(schema: LazyIrSchema) -> str: + """ + Produce a formatted string with the arguments as passed into the constructor of a node class. + """ + node_ctor_values = [ + node_ctor_arg_rvalue_string(arg) for arg in schema.filtered_args() + ] + return ", ".join(node_ctor_values) + + +def gen_fallback_code( + schema: LazyIrSchema, + sig: Union[DispatcherSignature, NativeSignature], + overload_name: str, +) -> str: + """ + Generate code that falls back to eager conditioned on a predicate + """ + dispatcher_sig = DispatcherSignature.from_schema(schema.func) + exprs = translate(sig.arguments(), dispatcher_sig.arguments()) + fallback_args = ",\n ".join([a.expr for a in exprs]) + if len(overload_name): + aten_op_str = f"ATEN_OP2({schema.aten_name}, {overload_name})" + else: + aten_op_str = f"ATEN_OP({schema.aten_name})" + return f""" + if (force_eager_fallback({aten_symbol(schema)})) {{ + return at::native::call_fallback_fn_symint<<c_eager_fallback, {aten_op_str}>::call( + {fallback_args} + ); + }} +""" + + +def aten_symbol(schema: LazyIrSchema) -> str: + missing_interned_strings = { + "sigmoid_backward", + } + if schema.aten_name in missing_interned_strings: + return f'c10::Symbol::fromQualString("aten::{schema.aten_name}")' + + if not schema.aten_name.startswith("at::"): + return f"at::aten::{schema.aten_name}" + else: + return schema.aten_name + + +# converts all tensor-like arguments to meta tensors. Returns: +# (1) a string containing all of the logic that does the conversions. +# (2) a context, to be used by translate(), with all of the relevant bindings. +def convert_to_meta_tensors(sig: DispatcherSignature) -> Tuple[str, List[Binding]]: + context: List[Binding] = [] + unwrapped_tensor_args: List[str] = [] + for arg in sig.arguments(): + if isinstance(arg.argument, Argument) and arg.argument.type.is_tensor_like(): + unwrapped_name = f"{arg.name}_meta" + unwrapped_tensor_args.append( + f"auto {unwrapped_name} = to_meta({arg.name});" + ) + context.append(arg.with_name(unwrapped_name)) + else: + context.append(arg) + unwrap_tensor_args_str = "\n ".join(unwrapped_tensor_args) + return unwrap_tensor_args_str, context + + +@dataclass(frozen=True) +class GenLazyIR(ABC): + backend_index: BackendIndex + backend_name: str + node_base: str + use_lazy_shape: bool + + @method_with_native_function + def __call__(self, f: Union[NativeFunctionsGroup, NativeFunction]) -> List[str]: + func = f.functional.func if isinstance(f, NativeFunctionsGroup) else f.func + metadata = self.backend_index.get_kernel( + f.functional if isinstance(f, NativeFunctionsGroup) else f + ) + schema = LazyIrSchema( + func, symint=metadata is not None and metadata.supports_symint() + ) + return self.gen(schema) + + # there is no lowering functionality generated unless this IR base class is subclassed and + # implemented as a backend-specific node + def lowering_function(self, schema: LazyIrSchema) -> str: + return "" + + def create_function(self, schema: LazyIrSchema, node_ctor_args: str) -> str: + return "" + + def can_be_reused_function(self, schema: LazyIrSchema, node_ctor_args: str) -> str: + return f"""bool CanBeReused({node_ctor_args}) const {{ + return false; + }}""" + + def node_base_ctor_call(self, schema: LazyIrSchema) -> str: + value_args = schema.filtered_args(values=True, scalars=False) + # backends can customize the way the node base class constructor is called, + # as long as all of its arguments can be generated from information available from the schema + base_ctor_value_args_list = [] + for arg in value_args: + if isinstance(arg.lazy_type, (BaseCType, VectorCType)): + base_ctor_value_args_list.append(f"{arg.name}") + elif isinstance(arg.lazy_type, OptionalCType): + base_ctor_value_args_list.append(f"{arg.name}.value_or(kNullValue)") + else: + raise AssertionError( + f"Unsupported type ({arg.lazy_type}) - add support if necessary" + ) + base_ctor_value_args = ", ".join(base_ctor_value_args_list) + + scalar_args = schema.filtered_args(values=False, scalars=True) + + # Shape construction. + # Conditionally build shape depending on specified shape property + if schema.properties.ShapePrecompute: + shape_ctor_arg = "std::move(shapes)," + elif schema.properties.ShapeCompute: + shape_args = [a.name for a in value_args] + shape_args.extend(a.name for a in scalar_args) + shape_ctor_arg = f"compute_shape_{schema.name}({', '.join(shape_args)})," + elif schema.properties.ShapeCache: + shape_args = [f"operand({i})" for i in range(len(value_args))] + shape_args.extend(a.name for a in scalar_args) + shape_ctor_arg = f"[&](){{ return compute_shape_{schema.name}({', '.join(shape_args)})[0]; }}," + else: + shape_ctor_arg = "" + + scalar_hashes = ", ".join(f"{a.name}" for a in scalar_args) + + return f"""{self.node_base}( + {schema.node_name}::ClassOpKind(), + OpList{{{base_ctor_value_args}}}, + {shape_ctor_arg} + /* num_outputs */ {len(schema.returns)}, + torch::lazy::MHash({scalar_hashes}))""" + + def gen(self, schema: LazyIrSchema) -> List[str]: + opkind = schema.opkind or aten_symbol(schema) + + # for now, we just want one IR class decl and soon after also the method defs + # and we use the functional version not out/inplace. + all_args = schema.filtered_args() + value_args = schema.filtered_args(values=True, scalars=False) + scalar_args = schema.filtered_args(values=False, scalars=True) + + ctor_args = [f"const {i.lazy_type.cpp_type()}& {i.name}" for i in all_args] + reuse_ctor_args = ", ".join(ctor_args) + if self.use_lazy_shape and schema.properties.ShapePrecompute: + ctor_args.append("std::vector&& shapes") + node_ctor_args = ", ".join(ctor_args) + + scalar_initializers = ",\n ".join( + [ + # This code is just special casing the mapping from string_view -> strings + f"{a.name}({a.name}.has_value() ? c10::make_optional(std::string(*{a.name})) : c10::nullopt)" + if a.lazy_type.cpp_type() == "c10::optional" + else f"{a.name}({a.name})" + for a in scalar_args + ] + ) + if len(scalar_initializers): + scalar_initializers = f",\n {scalar_initializers}" + scalar_decls = "\n ".join( + [ + f"std::string {a.name};" + if a.lazy_type.cpp_type() == "c10::string_view" + else f"c10::optional {a.name};" + if a.lazy_type.cpp_type() == "c10::optional" + else f"{a.lazy_type.cpp_type()} {a.name};" + for a in scalar_args + ] + ) + optional_values = [ + arg.name + for arg in schema.filtered_args(values=True, scalars=False) + if isinstance(arg.lazy_type, OptionalCType) + ] + has_optional_decls = "\n ".join( + [f"bool has_{value}: 1;" for value in optional_values] + ) + has_optional_defs = "\n ".join( + [f"has_{value} = !!{value};" for value in optional_values] + ) + members_to_string = [] + for arg in scalar_args: + if isinstance(arg.lazy_type, OptionalCType): + value = f"{arg.name}.value()" + if arg.is_generator: + value = '"torch.Generator()"' + members_to_string.append( + f"""if ({arg.name}.has_value()) {{ + ss << ", {arg.name}=" << {value}; + }} else {{ + ss << ", {arg.name}=null"; + }}""" + ) + else: + members_to_string.append(f'ss << ", {arg.name}=" << {arg.name};') + members_to_string_str = "\n ".join(members_to_string) + + return [ + f"""\ +class {schema.node_name} : public {self.node_base} {{ + public: + static torch::lazy::OpKind ClassOpKind() {{ + return torch::lazy::OpKind({opkind}); + }} + + {schema.node_name}({node_ctor_args}) + : {self.node_base_ctor_call(schema)}{scalar_initializers} + {{ + {has_optional_defs} + }} + + std::string ToString() const override {{ + std::stringstream ss; + ss << {self.node_base}::ToString(); + {members_to_string_str} + return ss.str(); + }} + + {self.create_function(schema, reuse_ctor_args)} + + {self.can_be_reused_function(schema, reuse_ctor_args)} + + {self.lowering_function(schema)} + + {scalar_decls} + {has_optional_decls} + +}}; + +""", + ] + + +@dataclass(frozen=True) +class GenTSLazyIR(GenLazyIR): + def lowering_function(self, schema: LazyIrSchema) -> str: + signature = """ + torch::lazy::TSOpVector Lower( + std::shared_ptr function, + torch::lazy::TSLoweringContext* loctx) const override""" + + if schema.properties.LowerDeclOnly: + return f"{signature};" + elif schema.properties.Lower: + return f"""{signature} {{ + {ts_lowering_body(schema)} + }} + """ + else: + return "" + + def create_function(self, schema: LazyIrSchema, node_ctor_args: str) -> str: + signature = f"static NodePtr Create({node_ctor_args})" + if schema.properties.CreateFnDeclOnly: + return f"{signature};" + elif not schema.properties.CreateFn: + return "" + return f"""{signature} {{ + return ReuseOrMakeNode<{schema.node_name}>(data); + }}""" + + def can_be_reused_function(self, schema: LazyIrSchema, node_ctor_args: str) -> str: + signature = f"bool CanBeReused({node_ctor_args}) const" + if schema.properties.CanBeReusedDeclOnly: + return f"{signature};" + elif not schema.properties.CanBeReused: + return "" + value_comparison = [] + for arg in itertools.chain(schema.positional_values, schema.keyword_values): + if isinstance(arg.lazy_type, OptionalCType): + value_comparison.append( + f"nullable_operand(i++) == {arg.name}.value_or(kNullValue)" + ) + else: + value_comparison.append(f"operand(i++) == {arg.name}") + for arg in itertools.chain(schema.positional_scalars, schema.keyword_scalars): + if isinstance(arg.lazy_type, OptionalCType): + value_comparison.append( + f"((!this->{arg.name}&&!{arg.name}) || (this->{arg.name}&&{arg.name} && *(this->{arg.name}) == *{arg.name}))" + ) + else: + value_comparison.append(f"this->{arg.name} == {arg.name}") + value_comparison_str = " &&\n ".join(value_comparison) + + return f"""{signature} {{ + size_t i = 0; + return ({value_comparison_str}); + }}""" + + +@dataclass(frozen=True) +class GenLazyNativeFuncDefinition: + class_method_name: str + backend_index: BackendIndex + tensor_class: str + gen_forced_fallback_code: bool + backend_namespace: str + get_tensorlist: str + get_tensor_or_wrap_number: str + try_get_tensor: str + metrics_counter: str + create_tensor: str + create_from_first_tensor: bool + create_aten_from_ltc_tensor: str + tuple_aten_from_ltc_tensors: str + lazy_tensor_ptr: str + get_device_fn: str + + def lazy_tensor_decls(self, func: NativeFunction, schema: LazyIrSchema) -> str: + value_args = schema.filtered_args(values=True, scalars=False) + # Generates lazy_{name} variables for LazyTensors wrapping input tensors + lazy_tensor_decls: List[str] = [] + for arg in value_args: + if arg.is_wrapped_scalar: + if isinstance(arg.lazy_type, OptionalCType): + lazy_tensor_decls.append( + f"""auto node_{arg.name} = {arg.name} ? + c10::make_optional(torch::lazy::LazyGraphExecutor::Get()-> + GetIrValueForScalarFromCodegen(*{arg.name}, *common_device)): + c10::nullopt;""" + ) + else: + lazy_tensor_decls.append( + f"""auto node_{arg.name} = torch::lazy::LazyGraphExecutor::Get()-> + GetIrValueForScalarFromCodegen({arg.name}, *common_device);""" + ) + elif arg.is_symint_or_list: + continue # values are extracted in isValueType + elif isinstance(arg.lazy_type, BaseCType): + if arg.lazy_type.type is tensorListValueT: + lazy_tensor_decls.append( + f"auto lazy_{arg.name}_tensorlist = " + f"{self.backend_namespace}::{self.get_tensorlist}({arg.name});" + ) + else: + lazy_tensor_decls.append( + f"{self.lazy_tensor_ptr} lazy_{arg.name} = " + f"{self.backend_namespace}::{self.get_tensor_or_wrap_number}({arg.name}, *common_device);" + ) + elif isinstance(arg.lazy_type, OptionalCType): + assert arg.lazy_type.elem == BaseCType(getValueT()), arg.lazy_type.elem + # TODO(alanwaketan): Maybe we want to apply GetLtcTensorOrCreateForWrappedNumber here, but hold it + # until we encounter a real world example. + lazy_tensor_decls.append( + f"{self.lazy_tensor_ptr} lazy_{arg.name} = " + f"{self.backend_namespace}::{self.try_get_tensor}({arg.name}.value_or(at::Tensor()));" + ) + else: + raise AssertionError( + f"TODO not sure if there are other valid types to handle here ({arg.lazy_type})" + ) + return ("\n ").join(lazy_tensor_decls) + + def force_eager_fallback( + self, + func: NativeFunction, + schema: LazyIrSchema, + metadata: BackendMetadata, + sig: Union[DispatcherSignature, NativeSignature], + ) -> str: + if self.gen_forced_fallback_code: + return gen_fallback_code( + schema, sig, overload_name=func.func.name.overload_name + ) + return "" + + def metrics(self, func: NativeFunction, schema: LazyIrSchema) -> str: + return f"{self.metrics_counter};" + + def get_device(self, func: NativeFunction, schema: LazyIrSchema) -> str: + value_args = schema.filtered_args(values=True, scalars=False) + scalar_args = schema.filtered_args(values=False, scalars=True) + value_types_names = [f"{a.name}" for a in value_args if not a.is_wrapped_scalar] + optional_device = OptionalCType(BaseCType(deviceT)) + optional_devices = [ + a.name for a in scalar_args if a.lazy_type == optional_device + ] + assert ( + len(value_types_names) > 0 or len(optional_devices) > 0 + ), "Expected at least one Value or Device type" + get_device_str = ( + f"{self.get_device_fn}({', '.join(value_types_names + optional_devices)})" + ) + return f"""auto common_device = {get_device_str}; + TORCH_INTERNAL_ASSERT(common_device); + """ + + def shape_inference(self, func: NativeFunction, schema: LazyIrSchema) -> str: + metadata = self.backend_index.get_kernel(func) + assert metadata is not None + all_args = schema.filtered_args() + returns_length = len(schema.returns) + # call the meta kernel if it exists, to compute output shape/dtype for our IR + # Note [Generated LTC Shape Functions] + # LTC uses meta tensors from core to do shape inference when possible, and otherwise + # we generate a shape function declaration that needs to be manually implemented. + # How do we detect which ops are eligible to use meta tensors? + # In general we should be able to use meta tensors not just on structured operators, + # but also on composite operators that are implemented in terms of structured kernels. + # We don't currently have a way of knowing at codegen time which ops are implemented that way. + # This is the case for all view and view_copy operators however, so we're going to + # use them specifically for all of the view_copy ops (instead of manually writing shape rules for all of them). + is_view_copy_op = "view_copy" in func.tags + is_structured = func.structured or func.structured_delegate is not None + if is_structured or is_view_copy_op: + meta_out = """ +std::vector shapes{torch::lazy::Shape(out_meta.scalar_type(), out_meta.sizes().vec())};""" + if returns_length > 1: + + def this_shape(i: int) -> str: + return f"torch::lazy::Shape(std::get<{i}>(out_meta).scalar_type(), std::get<{i}>(out_meta).sizes().vec())" + + shapes_str = ",".join([this_shape(i) for i in range(returns_length)]) + meta_out = "std::vector shapes{" + shapes_str + "};" + + # Convert tensor args to the meta device and call it. + # (We can't pass in the input tensors directly, because they are "functional wrappers". + # If any of the meta kernels call a tensor op and redispatch, we don't want to hit the functionalize kernels.) + # Even at::meta:: functions might redispatch, e.g. if they call into view ops. + dispatcher_sig = DispatcherSignature.from_schema(func.func) + meta_conversion_str, meta_call_ctx = convert_to_meta_tensors(dispatcher_sig) + meta_call_args = [ + e.expr + for e in translate( + meta_call_ctx, dispatcher_sig.arguments(), method=False + ) + ] + if is_view_copy_op: + # view_copy ops always have a CompositeExplicitAutogradNonFunctional kernel + assert func.has_composite_explicit_autograd_non_functional_kernel + dispatch_ns = "compositeexplicitautogradnonfunctional" + else: + dispatch_ns = "meta" + aten_name = schema.aten_name + # TODO: this is trolling + if func.func.has_symint() and metadata.supports_symint(): + aten_name += "_symint" + shape_str = f"""\ + {meta_conversion_str} + auto out_meta = at::{dispatch_ns}::{aten_name}({', '.join(meta_call_args)}); + {meta_out}""" + else: + shape_sig = ComputeShapeSignature( + metadata.kernel, func, symint=metadata.supports_symint() + ) + shape_str = f""" + auto shapes = {shape_sig.shape_call};""" + + shape_str += f""" + TORCH_INTERNAL_ASSERT(shapes.size() == {returns_length});""" + + # Calculating which dimensions are symbolic + func_schema_str = "aten::" + str(func.func) + shape_str += f""" + if(torch::lazy::symbolicShapeEnabled()){{ + std::vector inputs = {{ {', '.join(str(a.name) for a in all_args)} }}; + const char* schema_str = "{func_schema_str}"; + applySymbolicShapesOnLT(schema_str, inputs, shapes); + }} + """ + return shape_str + + def build_ir_node(self, func: NativeFunction, schema: LazyIrSchema) -> str: + node_ctor_input_str = node_ctor_inputs(schema) + return f"""torch::lazy::NodePtr node = torch::lazy::ReuseNode<{schema.node_name}>({node_ctor_input_str}); + if (!node) {{ + {self.shape_inference(func, schema)} + node = torch::lazy::MakeNode<{schema.node_name}>({node_ctor_input_str}, std::move(shapes)); + CacheNode(node); + }} + """ + + def create_lazy_tensor(self, first_tensor_name: Optional[str] = None) -> str: + # xla uses an instance method for tensor creation, for the time being + if self.create_from_first_tensor: + # TODO(whc) remove this if XLA switches to using static method for creation + assert ( + first_tensor_name is not None + ), "Requires first tensor to create lazy tensor" + return f"{first_tensor_name}.{self.create_tensor}" + return f"{self.backend_namespace}::{self.create_tensor}" + + def return_aten_tensor(self, func: NativeFunction, schema: LazyIrSchema) -> str: + returns_length = len(schema.returns) + value_args = schema.filtered_args(values=True, scalars=False) + value_types_names = [f"{a.name}" for a in value_args if not a.is_wrapped_scalar] + first_tensor_name = value_types_names[0] if len(value_types_names) > 0 else None + bridge_str = f"""auto result = {self.create_aten_from_ltc_tensor}( + {self.create_lazy_tensor(first_tensor_name)}(std::move(node), *common_device));""" + + if returns_length > 1: + assert ( + len(value_types_names) > 0 + ), "Code below assumes there is at least one tensor arg" + bridge_str = f"""std::vector<{self.lazy_tensor_ptr}> lazy_tensors; + for (int i = 0; i < {returns_length}; i++) {{ + lazy_tensors.push_back({self.create_lazy_tensor(first_tensor_name)}({getValueT()}(node, i), *common_device)); + }} + auto result = {self.tuple_aten_from_ltc_tensors}<{returns_length}>(lazy_tensors);""" + + if schema.name.name.inplace or func.func.is_out_fn(): + assert returns_length == 1, ( + "We assumed there was no such case where an op is an in-place variant " + f"and has tuple outputs, but got tuple of len {returns_length}." + ) + bridge_str = f"""lazy_{first_tensor_name}->SetInPlaceIrValue(node); + auto& result = {first_tensor_name};""" + + bridge_str += """ + return result;""" + return bridge_str + + @method_with_native_function + def __call__(self, func: NativeFunction) -> List[str]: + sig = kernel_signature(func, self.backend_index) + metadata = self.backend_index.get_kernel(func) + assert metadata is not None + schema = LazyIrSchema(func.func, symint=metadata.supports_symint()) + return [ + f"""\ + {sig.decl(name=f"{self.class_method_name}::{metadata.kernel}")} {{ + {self.force_eager_fallback(func, schema, metadata, sig)} + {self.metrics(func, schema)} + {self.get_device(func, schema)} + {self.lazy_tensor_decls(func, schema)} + {self.build_ir_node(func, schema)} + {self.return_aten_tensor(func, schema)} + }}\n + """ + ] + + +class ComputeShapeSignature: + """ + Here we use the base name as the suffix of the signature to avoid generating for in-place variants. + """ + + def __init__(self, kernel_name: str, f: NativeFunction, *, symint: bool): + self.__schema = LazyIrSchema(f.func, symint=symint) + self.__dispatch_args = ", ".join( + [a.decl() for a in dispatcher.arguments(f.func, symint=symint)] + ) + self.__call_args = ", ".join( + [f"{arg.name}" for arg in self.__schema.filtered_args(generator=True)] + ) + self.__kernel_name = kernel_name + + def __decl_suffix(self) -> str: + return f"{self.__kernel_name}({self.__dispatch_args})" + + def __call_suffix(self) -> str: + return f"{self.__kernel_name}({self.__call_args})" + + @property + def shape_decl(self) -> str: + return f"TORCH_API std::vector compute_shape_{self.__decl_suffix()}" + + @property + def shape_call(self) -> str: + return f"torch::lazy::compute_shape_{self.__call_suffix()}" + + +@dataclass(frozen=True) +class GenLazyShapeInferenceDefinition: + backend_index: BackendIndex + tensor_class: str + + @method_with_native_function + def __call__(self, f: NativeFunction) -> List[str]: + sig = kernel_signature(f, self.backend_index) + metadata = self.backend_index.get_kernel(f) + assert metadata is not None + + # See Note [Generated LTC Shape Functions] + is_view_copy_op = "view_copy" in f.tags + is_structured = f.structured or f.structured_delegate is not None + if is_structured or is_view_copy_op: + return [] + else: + shape_sig = ComputeShapeSignature( + metadata.kernel, f, symint=metadata.supports_symint() + ) + return ["\n".join([f"{shape_sig.shape_decl};"])] + + +def generate_non_native_lazy_ir_nodes( + non_native: List[Dict[str, Any]], gen_lazy_ir: GenLazyIR +) -> List[str]: + """Generate the non-native lazy IR node classes""" + nodes = [] + for op in non_native: + # Set default properties for Non-Native IRs + properties = LazyIrProperties("ShapeCache", "CanBeReused", "LowerDeclOnly") + for p in op.get("properties", []): + setattr(properties, p, True) + + # non-native is assumed to want symint bindings if you wrote symint + schema = LazyIrSchema(FunctionSchema.parse(op["func"]), properties, symint=True) + schema.opkind = op.get("opkind") + nodes.append(gen_lazy_ir.gen(schema)[0]) + + return nodes diff --git a/shared/package-files/9c/9c3379450d7072ee24b5748f5822e03d1100c835879e1af510e32a70a4950d9b/blob b/shared/package-files/9c/9c3379450d7072ee24b5748f5822e03d1100c835879e1af510e32a70a4950d9b/blob new file mode 100644 index 0000000000000000000000000000000000000000..b5716bdafced78fc8e6eb9aa07c3799b6893cfe1 --- /dev/null +++ b/shared/package-files/9c/9c3379450d7072ee24b5748f5822e03d1100c835879e1af510e32a70a4950d9b/blob @@ -0,0 +1,8 @@ +from .patcher import ONNXTorchPatcher +from .serialization import save_model_with_external_data + + +__all__ = [ + "save_model_with_external_data", + "ONNXTorchPatcher", +] diff --git a/shared/package-files/9c/9c365f963ea9db32a48c108d068babae14bcd7361f672d7f750bdb724add5bca/blob b/shared/package-files/9c/9c365f963ea9db32a48c108d068babae14bcd7361f672d7f750bdb724add5bca/blob new file mode 100644 index 0000000000000000000000000000000000000000..206c4409d5269594bdbab3a092ef6e09e7c01947 --- /dev/null +++ b/shared/package-files/9c/9c365f963ea9db32a48c108d068babae14bcd7361f672d7f750bdb724add5bca/blob @@ -0,0 +1,40 @@ +""" +Enables multiple commonly used features. + +Method resolution order: + +- `tqdm.autonotebook` without import warnings +- `tqdm.asyncio` +- `tqdm.std` base class + +Usage: +>>> from tqdm.auto import trange, tqdm +>>> for i in trange(10): +... ... +""" +import warnings + +from .std import TqdmExperimentalWarning + +with warnings.catch_warnings(): + warnings.simplefilter("ignore", category=TqdmExperimentalWarning) + from .autonotebook import tqdm as notebook_tqdm + +from .asyncio import tqdm as asyncio_tqdm +from .std import tqdm as std_tqdm + +if notebook_tqdm != std_tqdm: + class tqdm(notebook_tqdm, asyncio_tqdm): # pylint: disable=inconsistent-mro + pass +else: + tqdm = asyncio_tqdm + + +def trange(*args, **kwargs): + """ + A shortcut for `tqdm.auto.tqdm(range(*args), **kwargs)`. + """ + return tqdm(range(*args), **kwargs) + + +__all__ = ["tqdm", "trange"] diff --git a/shared/package-files/9c/9c376f545e9e02df384b8ad27cf19de590196f6c6b001d2e454172903478e3df/blob b/shared/package-files/9c/9c376f545e9e02df384b8ad27cf19de590196f6c6b001d2e454172903478e3df/blob new file mode 100644 index 0000000000000000000000000000000000000000..39b49192f252f912997c47dcb6d60f2152365a1e --- /dev/null +++ b/shared/package-files/9c/9c376f545e9e02df384b8ad27cf19de590196f6c6b001d2e454172903478e3df/blob @@ -0,0 +1,4457 @@ +# Copyright (c) 2016-present, Gregory Szorc +# All rights reserved. +# +# This software may be modified and distributed under the terms +# of the BSD license. See the LICENSE file for details. + +"""Python interface to the Zstandard (zstd) compression library.""" + +from __future__ import absolute_import, unicode_literals + +# This should match what the C extension exports. +__all__ = [ + "BufferSegment", + "BufferSegments", + "BufferWithSegments", + "BufferWithSegmentsCollection", + "ZstdCompressionChunker", + "ZstdCompressionDict", + "ZstdCompressionObj", + "ZstdCompressionParameters", + "ZstdCompressionReader", + "ZstdCompressionWriter", + "ZstdCompressor", + "ZstdDecompressionObj", + "ZstdDecompressionReader", + "ZstdDecompressionWriter", + "ZstdDecompressor", + "ZstdError", + "FrameParameters", + "backend_features", + "estimate_decompression_context_size", + "frame_content_size", + "frame_header_size", + "get_frame_parameters", + "train_dictionary", + # Constants. + "FLUSH_BLOCK", + "FLUSH_FRAME", + "COMPRESSOBJ_FLUSH_FINISH", + "COMPRESSOBJ_FLUSH_BLOCK", + "ZSTD_VERSION", + "FRAME_HEADER", + "CONTENTSIZE_UNKNOWN", + "CONTENTSIZE_ERROR", + "MAX_COMPRESSION_LEVEL", + "COMPRESSION_RECOMMENDED_INPUT_SIZE", + "COMPRESSION_RECOMMENDED_OUTPUT_SIZE", + "DECOMPRESSION_RECOMMENDED_INPUT_SIZE", + "DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE", + "MAGIC_NUMBER", + "BLOCKSIZELOG_MAX", + "BLOCKSIZE_MAX", + "WINDOWLOG_MIN", + "WINDOWLOG_MAX", + "CHAINLOG_MIN", + "CHAINLOG_MAX", + "HASHLOG_MIN", + "HASHLOG_MAX", + "MINMATCH_MIN", + "MINMATCH_MAX", + "SEARCHLOG_MIN", + "SEARCHLOG_MAX", + "SEARCHLENGTH_MIN", + "SEARCHLENGTH_MAX", + "TARGETLENGTH_MIN", + "TARGETLENGTH_MAX", + "LDM_MINMATCH_MIN", + "LDM_MINMATCH_MAX", + "LDM_BUCKETSIZELOG_MAX", + "STRATEGY_FAST", + "STRATEGY_DFAST", + "STRATEGY_GREEDY", + "STRATEGY_LAZY", + "STRATEGY_LAZY2", + "STRATEGY_BTLAZY2", + "STRATEGY_BTOPT", + "STRATEGY_BTULTRA", + "STRATEGY_BTULTRA2", + "DICT_TYPE_AUTO", + "DICT_TYPE_RAWCONTENT", + "DICT_TYPE_FULLDICT", + "FORMAT_ZSTD1", + "FORMAT_ZSTD1_MAGICLESS", +] + +import io +import os + +from ._cffi import ( # type: ignore + ffi, + lib, +) + + +backend_features = set() # type: ignore + +COMPRESSION_RECOMMENDED_INPUT_SIZE = lib.ZSTD_CStreamInSize() +COMPRESSION_RECOMMENDED_OUTPUT_SIZE = lib.ZSTD_CStreamOutSize() +DECOMPRESSION_RECOMMENDED_INPUT_SIZE = lib.ZSTD_DStreamInSize() +DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE = lib.ZSTD_DStreamOutSize() + +new_nonzero = ffi.new_allocator(should_clear_after_alloc=False) + + +MAX_COMPRESSION_LEVEL = lib.ZSTD_maxCLevel() +MAGIC_NUMBER = lib.ZSTD_MAGICNUMBER +FRAME_HEADER = b"\x28\xb5\x2f\xfd" +CONTENTSIZE_UNKNOWN = lib.ZSTD_CONTENTSIZE_UNKNOWN +CONTENTSIZE_ERROR = lib.ZSTD_CONTENTSIZE_ERROR +ZSTD_VERSION = ( + lib.ZSTD_VERSION_MAJOR, + lib.ZSTD_VERSION_MINOR, + lib.ZSTD_VERSION_RELEASE, +) + +BLOCKSIZELOG_MAX = lib.ZSTD_BLOCKSIZELOG_MAX +BLOCKSIZE_MAX = lib.ZSTD_BLOCKSIZE_MAX +WINDOWLOG_MIN = lib.ZSTD_WINDOWLOG_MIN +WINDOWLOG_MAX = lib.ZSTD_WINDOWLOG_MAX +CHAINLOG_MIN = lib.ZSTD_CHAINLOG_MIN +CHAINLOG_MAX = lib.ZSTD_CHAINLOG_MAX +HASHLOG_MIN = lib.ZSTD_HASHLOG_MIN +HASHLOG_MAX = lib.ZSTD_HASHLOG_MAX +MINMATCH_MIN = lib.ZSTD_MINMATCH_MIN +MINMATCH_MAX = lib.ZSTD_MINMATCH_MAX +SEARCHLOG_MIN = lib.ZSTD_SEARCHLOG_MIN +SEARCHLOG_MAX = lib.ZSTD_SEARCHLOG_MAX +SEARCHLENGTH_MIN = lib.ZSTD_MINMATCH_MIN +SEARCHLENGTH_MAX = lib.ZSTD_MINMATCH_MAX +TARGETLENGTH_MIN = lib.ZSTD_TARGETLENGTH_MIN +TARGETLENGTH_MAX = lib.ZSTD_TARGETLENGTH_MAX +LDM_MINMATCH_MIN = lib.ZSTD_LDM_MINMATCH_MIN +LDM_MINMATCH_MAX = lib.ZSTD_LDM_MINMATCH_MAX +LDM_BUCKETSIZELOG_MAX = lib.ZSTD_LDM_BUCKETSIZELOG_MAX + +STRATEGY_FAST = lib.ZSTD_fast +STRATEGY_DFAST = lib.ZSTD_dfast +STRATEGY_GREEDY = lib.ZSTD_greedy +STRATEGY_LAZY = lib.ZSTD_lazy +STRATEGY_LAZY2 = lib.ZSTD_lazy2 +STRATEGY_BTLAZY2 = lib.ZSTD_btlazy2 +STRATEGY_BTOPT = lib.ZSTD_btopt +STRATEGY_BTULTRA = lib.ZSTD_btultra +STRATEGY_BTULTRA2 = lib.ZSTD_btultra2 + +DICT_TYPE_AUTO = lib.ZSTD_dct_auto +DICT_TYPE_RAWCONTENT = lib.ZSTD_dct_rawContent +DICT_TYPE_FULLDICT = lib.ZSTD_dct_fullDict + +FORMAT_ZSTD1 = lib.ZSTD_f_zstd1 +FORMAT_ZSTD1_MAGICLESS = lib.ZSTD_f_zstd1_magicless + +FLUSH_BLOCK = 0 +FLUSH_FRAME = 1 + +COMPRESSOBJ_FLUSH_FINISH = 0 +COMPRESSOBJ_FLUSH_BLOCK = 1 + + +def _cpu_count(): + # os.cpu_count() was introducd in Python 3.4. + try: + return os.cpu_count() or 0 + except AttributeError: + pass + + # Linux. + try: + return os.sysconf("SC_NPROCESSORS_ONLN") + except (AttributeError, ValueError): + pass + + # TODO implement on other platforms. + return 0 + + +class BufferSegment: + """Represents a segment within a ``BufferWithSegments``. + + This type is essentially a reference to N bytes within a + ``BufferWithSegments``. + + The object conforms to the buffer protocol. + """ + + @property + def offset(self): + """The byte offset of this segment within its parent buffer.""" + raise NotImplementedError() + + def __len__(self): + """Obtain the length of the segment, in bytes.""" + raise NotImplementedError() + + def tobytes(self): + """Obtain bytes copy of this segment.""" + raise NotImplementedError() + + +class BufferSegments: + """Represents an array of ``(offset, length)`` integers. + + This type is effectively an index used by :py:class:`BufferWithSegments`. + + The array members are 64-bit unsigned integers using host/native bit order. + + Instances conform to the buffer protocol. + """ + + +class BufferWithSegments: + """A memory buffer containing N discrete items of known lengths. + + This type is essentially a fixed size memory address and an array + of 2-tuples of ``(offset, length)`` 64-bit unsigned native-endian + integers defining the byte offset and length of each segment within + the buffer. + + Instances behave like containers. + + Instances also conform to the buffer protocol. So a reference to the + backing bytes can be obtained via ``memoryview(o)``. A *copy* of the + backing bytes can be obtained via ``.tobytes()``. + + This type exists to facilitate operations against N>1 items without + the overhead of Python object creation and management. Used with + APIs like :py:meth:`ZstdDecompressor.multi_decompress_to_buffer`, it + is possible to decompress many objects in parallel without the GIL + held, leading to even better performance. + """ + + @property + def size(self): + """Total sizein bytes of the backing buffer.""" + raise NotImplementedError() + + def __len__(self): + raise NotImplementedError() + + def __getitem__(self, i): + """Obtains a segment within the buffer. + + The returned object references memory within this buffer. + + :param i: + Integer index of segment to retrieve. + :return: + :py:class:`BufferSegment` + """ + raise NotImplementedError() + + def segments(self): + """Obtain the array of ``(offset, length)`` segments in the buffer. + + :return: + :py:class:`BufferSegments` + """ + raise NotImplementedError() + + def tobytes(self): + """Obtain bytes copy of this instance.""" + raise NotImplementedError() + + +class BufferWithSegmentsCollection: + """A virtual spanning view over multiple BufferWithSegments. + + Instances are constructed from 1 or more :py:class:`BufferWithSegments` + instances. The resulting object behaves like an ordered sequence whose + members are the segments within each ``BufferWithSegments``. + + If the object is composed of 2 ``BufferWithSegments`` instances with the + first having 2 segments and the second have 3 segments, then ``b[0]`` + and ``b[1]`` access segments in the first object and ``b[2]``, ``b[3]``, + and ``b[4]`` access segments from the second. + """ + + def __len__(self): + """The number of segments within all ``BufferWithSegments``.""" + raise NotImplementedError() + + def __getitem__(self, i): + """Obtain the ``BufferSegment`` at an offset.""" + raise NotImplementedError() + + +class ZstdError(Exception): + pass + + +def _zstd_error(zresult): + # Resolves to bytes on Python 2 and 3. We use the string for formatting + # into error messages, which will be literal unicode. So convert it to + # unicode. + return ffi.string(lib.ZSTD_getErrorName(zresult)).decode("utf-8") + + +def _make_cctx_params(params): + res = lib.ZSTD_createCCtxParams() + if res == ffi.NULL: + raise MemoryError() + + res = ffi.gc(res, lib.ZSTD_freeCCtxParams) + + attrs = [ + (lib.ZSTD_c_format, params.format), + (lib.ZSTD_c_compressionLevel, params.compression_level), + (lib.ZSTD_c_windowLog, params.window_log), + (lib.ZSTD_c_hashLog, params.hash_log), + (lib.ZSTD_c_chainLog, params.chain_log), + (lib.ZSTD_c_searchLog, params.search_log), + (lib.ZSTD_c_minMatch, params.min_match), + (lib.ZSTD_c_targetLength, params.target_length), + (lib.ZSTD_c_strategy, params.strategy), + (lib.ZSTD_c_contentSizeFlag, params.write_content_size), + (lib.ZSTD_c_checksumFlag, params.write_checksum), + (lib.ZSTD_c_dictIDFlag, params.write_dict_id), + (lib.ZSTD_c_nbWorkers, params.threads), + (lib.ZSTD_c_jobSize, params.job_size), + (lib.ZSTD_c_overlapLog, params.overlap_log), + (lib.ZSTD_c_forceMaxWindow, params.force_max_window), + (lib.ZSTD_c_enableLongDistanceMatching, params.enable_ldm), + (lib.ZSTD_c_ldmHashLog, params.ldm_hash_log), + (lib.ZSTD_c_ldmMinMatch, params.ldm_min_match), + (lib.ZSTD_c_ldmBucketSizeLog, params.ldm_bucket_size_log), + (lib.ZSTD_c_ldmHashRateLog, params.ldm_hash_rate_log), + ] + + for param, value in attrs: + _set_compression_parameter(res, param, value) + + return res + + +class ZstdCompressionParameters(object): + """Low-level zstd compression parameters. + + This type represents a collection of parameters to control how zstd + compression is performed. + + Instances can be constructed from raw parameters or derived from a + base set of defaults specified from a compression level (recommended) + via :py:meth:`ZstdCompressionParameters.from_level`. + + >>> # Derive compression settings for compression level 7. + >>> params = zstandard.ZstdCompressionParameters.from_level(7) + + >>> # With an input size of 1MB + >>> params = zstandard.ZstdCompressionParameters.from_level(7, source_size=1048576) + + Using ``from_level()``, it is also possible to override individual compression + parameters or to define additional settings that aren't automatically derived. + e.g.: + + >>> params = zstandard.ZstdCompressionParameters.from_level(4, window_log=10) + >>> params = zstandard.ZstdCompressionParameters.from_level(5, threads=4) + + Or you can define low-level compression settings directly: + + >>> params = zstandard.ZstdCompressionParameters(window_log=12, enable_ldm=True) + + Once a ``ZstdCompressionParameters`` instance is obtained, it can be used to + configure a compressor: + + >>> cctx = zstandard.ZstdCompressor(compression_params=params) + + Some of these are very low-level settings. It may help to consult the official + zstandard documentation for their behavior. Look for the ``ZSTD_p_*`` constants + in ``zstd.h`` (https://github.com/facebook/zstd/blob/dev/lib/zstd.h). + """ + + @staticmethod + def from_level(level, source_size=0, dict_size=0, **kwargs): + """Create compression parameters from a compression level. + + :param level: + Integer compression level. + :param source_size: + Integer size in bytes of source to be compressed. + :param dict_size: + Integer size in bytes of compression dictionary to use. + :return: + :py:class:`ZstdCompressionParameters` + """ + params = lib.ZSTD_getCParams(level, source_size, dict_size) + + args = { + "window_log": "windowLog", + "chain_log": "chainLog", + "hash_log": "hashLog", + "search_log": "searchLog", + "min_match": "minMatch", + "target_length": "targetLength", + "strategy": "strategy", + } + + for arg, attr in args.items(): + if arg not in kwargs: + kwargs[arg] = getattr(params, attr) + + return ZstdCompressionParameters(**kwargs) + + def __init__( + self, + format=0, + compression_level=0, + window_log=0, + hash_log=0, + chain_log=0, + search_log=0, + min_match=0, + target_length=0, + strategy=-1, + write_content_size=1, + write_checksum=0, + write_dict_id=0, + job_size=0, + overlap_log=-1, + force_max_window=0, + enable_ldm=0, + ldm_hash_log=0, + ldm_min_match=0, + ldm_bucket_size_log=0, + ldm_hash_rate_log=-1, + threads=0, + ): + + params = lib.ZSTD_createCCtxParams() + if params == ffi.NULL: + raise MemoryError() + + params = ffi.gc(params, lib.ZSTD_freeCCtxParams) + + self._params = params + + if threads < 0: + threads = _cpu_count() + + # We need to set ZSTD_c_nbWorkers before ZSTD_c_jobSize and ZSTD_c_overlapLog + # because setting ZSTD_c_nbWorkers resets the other parameters. + _set_compression_parameter(params, lib.ZSTD_c_nbWorkers, threads) + + _set_compression_parameter(params, lib.ZSTD_c_format, format) + _set_compression_parameter( + params, lib.ZSTD_c_compressionLevel, compression_level + ) + _set_compression_parameter(params, lib.ZSTD_c_windowLog, window_log) + _set_compression_parameter(params, lib.ZSTD_c_hashLog, hash_log) + _set_compression_parameter(params, lib.ZSTD_c_chainLog, chain_log) + _set_compression_parameter(params, lib.ZSTD_c_searchLog, search_log) + _set_compression_parameter(params, lib.ZSTD_c_minMatch, min_match) + _set_compression_parameter( + params, lib.ZSTD_c_targetLength, target_length + ) + + if strategy == -1: + strategy = 0 + + _set_compression_parameter(params, lib.ZSTD_c_strategy, strategy) + _set_compression_parameter( + params, lib.ZSTD_c_contentSizeFlag, write_content_size + ) + _set_compression_parameter( + params, lib.ZSTD_c_checksumFlag, write_checksum + ) + _set_compression_parameter(params, lib.ZSTD_c_dictIDFlag, write_dict_id) + _set_compression_parameter(params, lib.ZSTD_c_jobSize, job_size) + + if overlap_log == -1: + overlap_log = 0 + + _set_compression_parameter(params, lib.ZSTD_c_overlapLog, overlap_log) + _set_compression_parameter( + params, lib.ZSTD_c_forceMaxWindow, force_max_window + ) + _set_compression_parameter( + params, lib.ZSTD_c_enableLongDistanceMatching, enable_ldm + ) + _set_compression_parameter(params, lib.ZSTD_c_ldmHashLog, ldm_hash_log) + _set_compression_parameter( + params, lib.ZSTD_c_ldmMinMatch, ldm_min_match + ) + _set_compression_parameter( + params, lib.ZSTD_c_ldmBucketSizeLog, ldm_bucket_size_log + ) + + if ldm_hash_rate_log == -1: + ldm_hash_rate_log = 0 + + _set_compression_parameter( + params, lib.ZSTD_c_ldmHashRateLog, ldm_hash_rate_log + ) + + @property + def format(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_format) + + @property + def compression_level(self): + return _get_compression_parameter( + self._params, lib.ZSTD_c_compressionLevel + ) + + @property + def window_log(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_windowLog) + + @property + def hash_log(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_hashLog) + + @property + def chain_log(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_chainLog) + + @property + def search_log(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_searchLog) + + @property + def min_match(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_minMatch) + + @property + def target_length(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_targetLength) + + @property + def strategy(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_strategy) + + @property + def write_content_size(self): + return _get_compression_parameter( + self._params, lib.ZSTD_c_contentSizeFlag + ) + + @property + def write_checksum(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_checksumFlag) + + @property + def write_dict_id(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_dictIDFlag) + + @property + def job_size(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_jobSize) + + @property + def overlap_log(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_overlapLog) + + @property + def force_max_window(self): + return _get_compression_parameter( + self._params, lib.ZSTD_c_forceMaxWindow + ) + + @property + def enable_ldm(self): + return _get_compression_parameter( + self._params, lib.ZSTD_c_enableLongDistanceMatching + ) + + @property + def ldm_hash_log(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_ldmHashLog) + + @property + def ldm_min_match(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_ldmMinMatch) + + @property + def ldm_bucket_size_log(self): + return _get_compression_parameter( + self._params, lib.ZSTD_c_ldmBucketSizeLog + ) + + @property + def ldm_hash_rate_log(self): + return _get_compression_parameter( + self._params, lib.ZSTD_c_ldmHashRateLog + ) + + @property + def threads(self): + return _get_compression_parameter(self._params, lib.ZSTD_c_nbWorkers) + + def estimated_compression_context_size(self): + """Estimated size in bytes needed to compress with these parameters.""" + return lib.ZSTD_estimateCCtxSize_usingCCtxParams(self._params) + + +def estimate_decompression_context_size(): + """Estimate the memory size requirements for a decompressor instance. + + :return: + Integer number of bytes. + """ + return lib.ZSTD_estimateDCtxSize() + + +def _set_compression_parameter(params, param, value): + zresult = lib.ZSTD_CCtxParams_setParameter(params, param, value) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "unable to set compression context parameter: %s" + % _zstd_error(zresult) + ) + + +def _get_compression_parameter(params, param): + result = ffi.new("int *") + + zresult = lib.ZSTD_CCtxParams_getParameter(params, param, result) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "unable to get compression context parameter: %s" + % _zstd_error(zresult) + ) + + return result[0] + + +class ZstdCompressionWriter(object): + """Writable compressing stream wrapper. + + ``ZstdCompressionWriter`` is a write-only stream interface for writing + compressed data to another stream. + + This type conforms to the ``io.RawIOBase`` interface and should be usable + by any type that operates against a *file-object* (``typing.BinaryIO`` + in Python type hinting speak). Only methods that involve writing will do + useful things. + + As data is written to this stream (e.g. via ``write()``), that data + is sent to the compressor. As compressed data becomes available from + the compressor, it is sent to the underlying stream by calling its + ``write()`` method. + + Both ``write()`` and ``flush()`` return the number of bytes written to the + object's ``write()``. In many cases, small inputs do not accumulate enough + data to cause a write and ``write()`` will return ``0``. + + Calling ``close()`` will mark the stream as closed and subsequent I/O + operations will raise ``ValueError`` (per the documented behavior of + ``io.RawIOBase``). ``close()`` will also call ``close()`` on the underlying + stream if such a method exists and the instance was constructed with + ``closefd=True`` + + Instances are obtained by calling :py:meth:`ZstdCompressor.stream_writer`. + + Typically usage is as follows: + + >>> cctx = zstandard.ZstdCompressor(level=10) + >>> compressor = cctx.stream_writer(fh) + >>> compressor.write(b"chunk 0\\n") + >>> compressor.write(b"chunk 1\\n") + >>> compressor.flush() + >>> # Receiver will be able to decode ``chunk 0\\nchunk 1\\n`` at this point. + >>> # Receiver is also expecting more data in the zstd *frame*. + >>> + >>> compressor.write(b"chunk 2\\n") + >>> compressor.flush(zstandard.FLUSH_FRAME) + >>> # Receiver will be able to decode ``chunk 0\\nchunk 1\\nchunk 2``. + >>> # Receiver is expecting no more data, as the zstd frame is closed. + >>> # Any future calls to ``write()`` at this point will construct a new + >>> # zstd frame. + + Instances can be used as context managers. Exiting the context manager is + the equivalent of calling ``close()``, which is equivalent to calling + ``flush(zstandard.FLUSH_FRAME)``: + + >>> cctx = zstandard.ZstdCompressor(level=10) + >>> with cctx.stream_writer(fh) as compressor: + ... compressor.write(b'chunk 0') + ... compressor.write(b'chunk 1') + ... ... + + .. important:: + + If ``flush(FLUSH_FRAME)`` is not called, emitted data doesn't + constitute a full zstd *frame* and consumers of this data may complain + about malformed input. It is recommended to use instances as a context + manager to ensure *frames* are properly finished. + + If the size of the data being fed to this streaming compressor is known, + you can declare it before compression begins: + + >>> cctx = zstandard.ZstdCompressor() + >>> with cctx.stream_writer(fh, size=data_len) as compressor: + ... compressor.write(chunk0) + ... compressor.write(chunk1) + ... ... + + Declaring the size of the source data allows compression parameters to + be tuned. And if ``write_content_size`` is used, it also results in the + content size being written into the frame header of the output data. + + The size of chunks being ``write()`` to the destination can be specified: + + >>> cctx = zstandard.ZstdCompressor() + >>> with cctx.stream_writer(fh, write_size=32768) as compressor: + ... ... + + To see how much memory is being used by the streaming compressor: + + >>> cctx = zstandard.ZstdCompressor() + >>> with cctx.stream_writer(fh) as compressor: + ... ... + ... byte_size = compressor.memory_size() + + Thte total number of bytes written so far are exposed via ``tell()``: + + >>> cctx = zstandard.ZstdCompressor() + >>> with cctx.stream_writer(fh) as compressor: + ... ... + ... total_written = compressor.tell() + + ``stream_writer()`` accepts a ``write_return_read`` boolean argument to + control the return value of ``write()``. When ``False`` (the default), + ``write()`` returns the number of bytes that were ``write()``'en to the + underlying object. When ``True``, ``write()`` returns the number of bytes + read from the input that were subsequently written to the compressor. + ``True`` is the *proper* behavior for ``write()`` as specified by the + ``io.RawIOBase`` interface and will become the default value in a future + release. + """ + + def __init__( + self, + compressor, + writer, + source_size, + write_size, + write_return_read, + closefd=True, + ): + self._compressor = compressor + self._writer = writer + self._write_size = write_size + self._write_return_read = bool(write_return_read) + self._closefd = bool(closefd) + self._entered = False + self._closing = False + self._closed = False + self._bytes_compressed = 0 + + self._dst_buffer = ffi.new("char[]", write_size) + self._out_buffer = ffi.new("ZSTD_outBuffer *") + self._out_buffer.dst = self._dst_buffer + self._out_buffer.size = len(self._dst_buffer) + self._out_buffer.pos = 0 + + zresult = lib.ZSTD_CCtx_setPledgedSrcSize(compressor._cctx, source_size) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error setting source size: %s" % _zstd_error(zresult) + ) + + def __enter__(self): + if self._closed: + raise ValueError("stream is closed") + + if self._entered: + raise ZstdError("cannot __enter__ multiple times") + + self._entered = True + return self + + def __exit__(self, exc_type, exc_value, exc_tb): + self._entered = False + self.close() + self._compressor = None + + return False + + def __iter__(self): + raise io.UnsupportedOperation() + + def __next__(self): + raise io.UnsupportedOperation() + + def memory_size(self): + return lib.ZSTD_sizeof_CCtx(self._compressor._cctx) + + def fileno(self): + f = getattr(self._writer, "fileno", None) + if f: + return f() + else: + raise OSError("fileno not available on underlying writer") + + def close(self): + if self._closed: + return + + try: + self._closing = True + self.flush(FLUSH_FRAME) + finally: + self._closing = False + self._closed = True + + # Call close() on underlying stream as well. + f = getattr(self._writer, "close", None) + if self._closefd and f: + f() + + @property + def closed(self): + return self._closed + + def isatty(self): + return False + + def readable(self): + return False + + def readline(self, size=-1): + raise io.UnsupportedOperation() + + def readlines(self, hint=-1): + raise io.UnsupportedOperation() + + def seek(self, offset, whence=None): + raise io.UnsupportedOperation() + + def seekable(self): + return False + + def truncate(self, size=None): + raise io.UnsupportedOperation() + + def writable(self): + return True + + def writelines(self, lines): + raise NotImplementedError("writelines() is not yet implemented") + + def read(self, size=-1): + raise io.UnsupportedOperation() + + def readall(self): + raise io.UnsupportedOperation() + + def readinto(self, b): + raise io.UnsupportedOperation() + + def write(self, data): + """Send data to the compressor and possibly to the inner stream.""" + if self._closed: + raise ValueError("stream is closed") + + total_write = 0 + + data_buffer = ffi.from_buffer(data) + + in_buffer = ffi.new("ZSTD_inBuffer *") + in_buffer.src = data_buffer + in_buffer.size = len(data_buffer) + in_buffer.pos = 0 + + out_buffer = self._out_buffer + out_buffer.pos = 0 + + while in_buffer.pos < in_buffer.size: + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, + out_buffer, + in_buffer, + lib.ZSTD_e_continue, + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd compress error: %s" % _zstd_error(zresult) + ) + + if out_buffer.pos: + self._writer.write( + ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + ) + total_write += out_buffer.pos + self._bytes_compressed += out_buffer.pos + out_buffer.pos = 0 + + if self._write_return_read: + return in_buffer.pos + else: + return total_write + + def flush(self, flush_mode=FLUSH_BLOCK): + """Evict data from compressor's internal state and write it to inner stream. + + Calling this method may result in 0 or more ``write()`` calls to the + inner stream. + + This method will also call ``flush()`` on the inner stream, if such a + method exists. + + :param flush_mode: + How to flush the zstd compressor. + + ``zstandard.FLUSH_BLOCK`` will flush data already sent to the + compressor but not emitted to the inner stream. The stream is still + writable after calling this. This is the default behavior. + + See documentation for other ``zstandard.FLUSH_*`` constants for more + flushing options. + :return: + Integer number of bytes written to the inner stream. + """ + + if flush_mode == FLUSH_BLOCK: + flush = lib.ZSTD_e_flush + elif flush_mode == FLUSH_FRAME: + flush = lib.ZSTD_e_end + else: + raise ValueError("unknown flush_mode: %r" % flush_mode) + + if self._closed: + raise ValueError("stream is closed") + + total_write = 0 + + out_buffer = self._out_buffer + out_buffer.pos = 0 + + in_buffer = ffi.new("ZSTD_inBuffer *") + in_buffer.src = ffi.NULL + in_buffer.size = 0 + in_buffer.pos = 0 + + while True: + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, out_buffer, in_buffer, flush + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd compress error: %s" % _zstd_error(zresult) + ) + + if out_buffer.pos: + self._writer.write( + ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + ) + total_write += out_buffer.pos + self._bytes_compressed += out_buffer.pos + out_buffer.pos = 0 + + if not zresult: + break + + f = getattr(self._writer, "flush", None) + if f and not self._closing: + f() + + return total_write + + def tell(self): + return self._bytes_compressed + + +class ZstdCompressionObj(object): + """A compressor conforming to the API in Python's standard library. + + This type implements an API similar to compression types in Python's + standard library such as ``zlib.compressobj`` and ``bz2.BZ2Compressor``. + This enables existing code targeting the standard library API to swap + in this type to achieve zstd compression. + + .. important:: + + The design of this API is not ideal for optimal performance. + + The reason performance is not optimal is because the API is limited to + returning a single buffer holding compressed data. When compressing + data, we don't know how much data will be emitted. So in order to + capture all this data in a single buffer, we need to perform buffer + reallocations and/or extra memory copies. This can add significant + overhead depending on the size or nature of the compressed data how + much your application calls this type. + + If performance is critical, consider an API like + :py:meth:`ZstdCompressor.stream_reader`, + :py:meth:`ZstdCompressor.stream_writer`, + :py:meth:`ZstdCompressor.chunker`, or + :py:meth:`ZstdCompressor.read_to_iter`, which result in less overhead + managing buffers. + + Instances are obtained by calling :py:meth:`ZstdCompressor.compressobj`. + + Here is how this API should be used: + + >>> cctx = zstandard.ZstdCompressor() + >>> cobj = cctx.compressobj() + >>> data = cobj.compress(b"raw input 0") + >>> data = cobj.compress(b"raw input 1") + >>> data = cobj.flush() + + Or to flush blocks: + + >>> cctx.zstandard.ZstdCompressor() + >>> cobj = cctx.compressobj() + >>> data = cobj.compress(b"chunk in first block") + >>> data = cobj.flush(zstandard.COMPRESSOBJ_FLUSH_BLOCK) + >>> data = cobj.compress(b"chunk in second block") + >>> data = cobj.flush() + + For best performance results, keep input chunks under 256KB. This avoids + extra allocations for a large output object. + + It is possible to declare the input size of the data that will be fed + into the compressor: + + >>> cctx = zstandard.ZstdCompressor() + >>> cobj = cctx.compressobj(size=6) + >>> data = cobj.compress(b"foobar") + >>> data = cobj.flush() + """ + + def compress(self, data): + """Send data to the compressor. + + This method receives bytes to feed to the compressor and returns + bytes constituting zstd compressed data. + + The zstd compressor accumulates bytes and the returned bytes may be + substantially smaller or larger than the size of the input data on + any given call. The returned value may be the empty byte string + (``b""``). + + :param data: + Data to write to the compressor. + :return: + Compressed data. + """ + if self._finished: + raise ZstdError("cannot call compress() after compressor finished") + + data_buffer = ffi.from_buffer(data) + source = ffi.new("ZSTD_inBuffer *") + source.src = data_buffer + source.size = len(data_buffer) + source.pos = 0 + + chunks = [] + + while source.pos < len(data): + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, self._out, source, lib.ZSTD_e_continue + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd compress error: %s" % _zstd_error(zresult) + ) + + if self._out.pos: + chunks.append(ffi.buffer(self._out.dst, self._out.pos)[:]) + self._out.pos = 0 + + return b"".join(chunks) + + def flush(self, flush_mode=COMPRESSOBJ_FLUSH_FINISH): + """Emit data accumulated in the compressor that hasn't been outputted yet. + + The ``flush_mode`` argument controls how to end the stream. + + ``zstandard.COMPRESSOBJ_FLUSH_FINISH`` (the default) ends the + compression stream and finishes a zstd frame. Once this type of flush + is performed, ``compress()`` and ``flush()`` can no longer be called. + This type of flush **must** be called to end the compression context. If + not called, the emitted data may be incomplete and may not be readable + by a decompressor. + + ``zstandard.COMPRESSOBJ_FLUSH_BLOCK`` will flush a zstd block. This + ensures that all data fed to this instance will have been omitted and + can be decoded by a decompressor. Flushes of this type can be performed + multiple times. The next call to ``compress()`` will begin a new zstd + block. + + :param flush_mode: + How to flush the zstd compressor. + :return: + Compressed data. + """ + if flush_mode not in ( + COMPRESSOBJ_FLUSH_FINISH, + COMPRESSOBJ_FLUSH_BLOCK, + ): + raise ValueError("flush mode not recognized") + + if self._finished: + raise ZstdError("compressor object already finished") + + if flush_mode == COMPRESSOBJ_FLUSH_BLOCK: + z_flush_mode = lib.ZSTD_e_flush + elif flush_mode == COMPRESSOBJ_FLUSH_FINISH: + z_flush_mode = lib.ZSTD_e_end + self._finished = True + else: + raise ZstdError("unhandled flush mode") + + assert self._out.pos == 0 + + in_buffer = ffi.new("ZSTD_inBuffer *") + in_buffer.src = ffi.NULL + in_buffer.size = 0 + in_buffer.pos = 0 + + chunks = [] + + while True: + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, self._out, in_buffer, z_flush_mode + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error ending compression stream: %s" % _zstd_error(zresult) + ) + + if self._out.pos: + chunks.append(ffi.buffer(self._out.dst, self._out.pos)[:]) + self._out.pos = 0 + + if not zresult: + break + + return b"".join(chunks) + + +class ZstdCompressionChunker(object): + """Compress data to uniformly sized chunks. + + This type allows you to iteratively feed chunks of data into a compressor + and produce output chunks of uniform size. + + ``compress()``, ``flush()``, and ``finish()`` all return an iterator of + ``bytes`` instances holding compressed data. The iterator may be empty. + Callers MUST iterate through all elements of the returned iterator before + performing another operation on the object or else the compressor's + internal state may become confused. This can result in an exception being + raised or malformed data being emitted. + + All chunks emitted by ``compress()`` will have a length of the configured + chunk size. + + ``flush()`` and ``finish()`` may return a final chunk smaller than + the configured chunk size. + + Instances are obtained by calling :py:meth:`ZstdCompressor.chunker`. + + Here is how the API should be used: + + >>> cctx = zstandard.ZstdCompressor() + >>> chunker = cctx.chunker(chunk_size=32768) + >>> + >>> with open(path, 'rb') as fh: + ... while True: + ... in_chunk = fh.read(32768) + ... if not in_chunk: + ... break + ... + ... for out_chunk in chunker.compress(in_chunk): + ... # Do something with output chunk of size 32768. + ... + ... for out_chunk in chunker.finish(): + ... # Do something with output chunks that finalize the zstd frame. + + This compressor type is often a better alternative to + :py:class:`ZstdCompressor.compressobj` because it has better performance + properties. + + ``compressobj()`` will emit output data as it is available. This results + in a *stream* of output chunks of varying sizes. The consistency of the + output chunk size with ``chunker()`` is more appropriate for many usages, + such as sending compressed data to a socket. + + ``compressobj()`` may also perform extra memory reallocations in order + to dynamically adjust the sizes of the output chunks. Since ``chunker()`` + output chunks are all the same size (except for flushed or final chunks), + there is less memory allocation/copying overhead. + """ + + def __init__(self, compressor, chunk_size): + self._compressor = compressor + self._out = ffi.new("ZSTD_outBuffer *") + self._dst_buffer = ffi.new("char[]", chunk_size) + self._out.dst = self._dst_buffer + self._out.size = chunk_size + self._out.pos = 0 + + self._in = ffi.new("ZSTD_inBuffer *") + self._in.src = ffi.NULL + self._in.size = 0 + self._in.pos = 0 + self._finished = False + + def compress(self, data): + """Feed new input data into the compressor. + + :param data: + Data to feed to compressor. + :return: + Iterator of ``bytes`` representing chunks of compressed data. + """ + if self._finished: + raise ZstdError("cannot call compress() after compression finished") + + if self._in.src != ffi.NULL: + raise ZstdError( + "cannot perform operation before consuming output " + "from previous operation" + ) + + data_buffer = ffi.from_buffer(data) + + if not len(data_buffer): + return + + self._in.src = data_buffer + self._in.size = len(data_buffer) + self._in.pos = 0 + + while self._in.pos < self._in.size: + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, self._out, self._in, lib.ZSTD_e_continue + ) + + if self._in.pos == self._in.size: + self._in.src = ffi.NULL + self._in.size = 0 + self._in.pos = 0 + + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd compress error: %s" % _zstd_error(zresult) + ) + + if self._out.pos == self._out.size: + yield ffi.buffer(self._out.dst, self._out.pos)[:] + self._out.pos = 0 + + def flush(self): + """Flushes all data currently in the compressor. + + :return: + Iterator of ``bytes`` of compressed data. + """ + if self._finished: + raise ZstdError("cannot call flush() after compression finished") + + if self._in.src != ffi.NULL: + raise ZstdError( + "cannot call flush() before consuming output from " + "previous operation" + ) + + while True: + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, self._out, self._in, lib.ZSTD_e_flush + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd compress error: %s" % _zstd_error(zresult) + ) + + if self._out.pos: + yield ffi.buffer(self._out.dst, self._out.pos)[:] + self._out.pos = 0 + + if not zresult: + return + + def finish(self): + """Signals the end of input data. + + No new data can be compressed after this method is called. + + This method will flush buffered data and finish the zstd frame. + + :return: + Iterator of ``bytes`` of compressed data. + """ + if self._finished: + raise ZstdError("cannot call finish() after compression finished") + + if self._in.src != ffi.NULL: + raise ZstdError( + "cannot call finish() before consuming output from " + "previous operation" + ) + + while True: + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, self._out, self._in, lib.ZSTD_e_end + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd compress error: %s" % _zstd_error(zresult) + ) + + if self._out.pos: + yield ffi.buffer(self._out.dst, self._out.pos)[:] + self._out.pos = 0 + + if not zresult: + self._finished = True + return + + +class ZstdCompressionReader(object): + """Readable compressing stream wrapper. + + ``ZstdCompressionReader`` is a read-only stream interface for obtaining + compressed data from a source. + + This type conforms to the ``io.RawIOBase`` interface and should be usable + by any type that operates against a *file-object* (``typing.BinaryIO`` + in Python type hinting speak). + + Instances are neither writable nor seekable (even if the underlying + source is seekable). ``readline()`` and ``readlines()`` are not implemented + because they don't make sense for compressed data. ``tell()`` returns the + number of compressed bytes emitted so far. + + Instances are obtained by calling :py:meth:`ZstdCompressor.stream_reader`. + + In this example, we open a file for reading and then wrap that file + handle with a stream from which compressed data can be ``read()``. + + >>> with open(path, 'rb') as fh: + ... cctx = zstandard.ZstdCompressor() + ... reader = cctx.stream_reader(fh) + ... while True: + ... chunk = reader.read(16384) + ... if not chunk: + ... break + ... + ... # Do something with compressed chunk. + + Instances can also be used as context managers: + + >>> with open(path, 'rb') as fh: + ... cctx = zstandard.ZstdCompressor() + ... with cctx.stream_reader(fh) as reader: + ... while True: + ... chunk = reader.read(16384) + ... if not chunk: + ... break + ... + ... # Do something with compressed chunk. + + When the context manager exits or ``close()`` is called, the stream is + closed, underlying resources are released, and future operations against + the compression stream will fail. + + ``stream_reader()`` accepts a ``size`` argument specifying how large the + input stream is. This is used to adjust compression parameters so they are + tailored to the source size. e.g. + + >>> with open(path, 'rb') as fh: + ... cctx = zstandard.ZstdCompressor() + ... with cctx.stream_reader(fh, size=os.stat(path).st_size) as reader: + ... ... + + If the ``source`` is a stream, you can specify how large ``read()`` + requests to that stream should be via the ``read_size`` argument. + It defaults to ``zstandard.COMPRESSION_RECOMMENDED_INPUT_SIZE``. e.g. + + >>> with open(path, 'rb') as fh: + ... cctx = zstandard.ZstdCompressor() + ... # Will perform fh.read(8192) when obtaining data to feed into the + ... # compressor. + ... with cctx.stream_reader(fh, read_size=8192) as reader: + ... ... + """ + + def __init__(self, compressor, source, read_size, closefd=True): + self._compressor = compressor + self._source = source + self._read_size = read_size + self._closefd = closefd + self._entered = False + self._closed = False + self._bytes_compressed = 0 + self._finished_input = False + self._finished_output = False + + self._in_buffer = ffi.new("ZSTD_inBuffer *") + # Holds a ref so backing bytes in self._in_buffer stay alive. + self._source_buffer = None + + def __enter__(self): + if self._entered: + raise ValueError("cannot __enter__ multiple times") + + if self._closed: + raise ValueError("stream is closed") + + self._entered = True + return self + + def __exit__(self, exc_type, exc_value, exc_tb): + self._entered = False + self._compressor = None + self.close() + self._source = None + + return False + + def readable(self): + return True + + def writable(self): + return False + + def seekable(self): + return False + + def readline(self): + raise io.UnsupportedOperation() + + def readlines(self): + raise io.UnsupportedOperation() + + def write(self, data): + raise OSError("stream is not writable") + + def writelines(self, ignored): + raise OSError("stream is not writable") + + def isatty(self): + return False + + def flush(self): + return None + + def close(self): + if self._closed: + return + + self._closed = True + + f = getattr(self._source, "close", None) + if self._closefd and f: + f() + + @property + def closed(self): + return self._closed + + def tell(self): + return self._bytes_compressed + + def readall(self): + chunks = [] + + while True: + chunk = self.read(1048576) + if not chunk: + break + + chunks.append(chunk) + + return b"".join(chunks) + + def __iter__(self): + raise io.UnsupportedOperation() + + def __next__(self): + raise io.UnsupportedOperation() + + next = __next__ + + def _read_input(self): + if self._finished_input: + return + + if hasattr(self._source, "read"): + data = self._source.read(self._read_size) + + if not data: + self._finished_input = True + return + + self._source_buffer = ffi.from_buffer(data) + self._in_buffer.src = self._source_buffer + self._in_buffer.size = len(self._source_buffer) + self._in_buffer.pos = 0 + else: + self._source_buffer = ffi.from_buffer(self._source) + self._in_buffer.src = self._source_buffer + self._in_buffer.size = len(self._source_buffer) + self._in_buffer.pos = 0 + + def _compress_into_buffer(self, out_buffer): + if self._in_buffer.pos >= self._in_buffer.size: + return + + old_pos = out_buffer.pos + + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, + out_buffer, + self._in_buffer, + lib.ZSTD_e_continue, + ) + + self._bytes_compressed += out_buffer.pos - old_pos + + if self._in_buffer.pos == self._in_buffer.size: + self._in_buffer.src = ffi.NULL + self._in_buffer.pos = 0 + self._in_buffer.size = 0 + self._source_buffer = None + + if not hasattr(self._source, "read"): + self._finished_input = True + + if lib.ZSTD_isError(zresult): + raise ZstdError("zstd compress error: %s", _zstd_error(zresult)) + + return out_buffer.pos and out_buffer.pos == out_buffer.size + + def read(self, size=-1): + if self._closed: + raise ValueError("stream is closed") + + if size < -1: + raise ValueError("cannot read negative amounts less than -1") + + if size == -1: + return self.readall() + + if self._finished_output or size == 0: + return b"" + + # Need a dedicated ref to dest buffer otherwise it gets collected. + dst_buffer = ffi.new("char[]", size) + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = dst_buffer + out_buffer.size = size + out_buffer.pos = 0 + + if self._compress_into_buffer(out_buffer): + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + while not self._finished_input: + self._read_input() + + if self._compress_into_buffer(out_buffer): + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + # EOF + old_pos = out_buffer.pos + + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, out_buffer, self._in_buffer, lib.ZSTD_e_end + ) + + self._bytes_compressed += out_buffer.pos - old_pos + + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error ending compression stream: %s", _zstd_error(zresult) + ) + + if zresult == 0: + self._finished_output = True + + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + def read1(self, size=-1): + if self._closed: + raise ValueError("stream is closed") + + if size < -1: + raise ValueError("cannot read negative amounts less than -1") + + if self._finished_output or size == 0: + return b"" + + # -1 returns arbitrary number of bytes. + if size == -1: + size = COMPRESSION_RECOMMENDED_OUTPUT_SIZE + + dst_buffer = ffi.new("char[]", size) + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = dst_buffer + out_buffer.size = size + out_buffer.pos = 0 + + # read1() dictates that we can perform at most 1 call to the + # underlying stream to get input. However, we can't satisfy this + # restriction with compression because not all input generates output. + # It is possible to perform a block flush in order to ensure output. + # But this may not be desirable behavior. So we allow multiple read() + # to the underlying stream. But unlike read(), we stop once we have + # any output. + + self._compress_into_buffer(out_buffer) + if out_buffer.pos: + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + while not self._finished_input: + self._read_input() + + # If we've filled the output buffer, return immediately. + if self._compress_into_buffer(out_buffer): + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + # If we've populated the output buffer and we're not at EOF, + # also return, as we've satisfied the read1() limits. + if out_buffer.pos and not self._finished_input: + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + # Else if we're at EOS and we have room left in the buffer, + # fall through to below and try to add more data to the output. + + # EOF. + old_pos = out_buffer.pos + + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, out_buffer, self._in_buffer, lib.ZSTD_e_end + ) + + self._bytes_compressed += out_buffer.pos - old_pos + + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error ending compression stream: %s" % _zstd_error(zresult) + ) + + if zresult == 0: + self._finished_output = True + + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + def readinto(self, b): + if self._closed: + raise ValueError("stream is closed") + + if self._finished_output: + return 0 + + # TODO use writable=True once we require CFFI >= 1.12. + dest_buffer = ffi.from_buffer(b) + ffi.memmove(b, b"", 0) + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = dest_buffer + out_buffer.size = len(dest_buffer) + out_buffer.pos = 0 + + if self._compress_into_buffer(out_buffer): + return out_buffer.pos + + while not self._finished_input: + self._read_input() + if self._compress_into_buffer(out_buffer): + return out_buffer.pos + + # EOF. + old_pos = out_buffer.pos + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, out_buffer, self._in_buffer, lib.ZSTD_e_end + ) + + self._bytes_compressed += out_buffer.pos - old_pos + + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error ending compression stream: %s", _zstd_error(zresult) + ) + + if zresult == 0: + self._finished_output = True + + return out_buffer.pos + + def readinto1(self, b): + if self._closed: + raise ValueError("stream is closed") + + if self._finished_output: + return 0 + + # TODO use writable=True once we require CFFI >= 1.12. + dest_buffer = ffi.from_buffer(b) + ffi.memmove(b, b"", 0) + + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = dest_buffer + out_buffer.size = len(dest_buffer) + out_buffer.pos = 0 + + self._compress_into_buffer(out_buffer) + if out_buffer.pos: + return out_buffer.pos + + while not self._finished_input: + self._read_input() + + if self._compress_into_buffer(out_buffer): + return out_buffer.pos + + if out_buffer.pos and not self._finished_input: + return out_buffer.pos + + # EOF. + old_pos = out_buffer.pos + + zresult = lib.ZSTD_compressStream2( + self._compressor._cctx, out_buffer, self._in_buffer, lib.ZSTD_e_end + ) + + self._bytes_compressed += out_buffer.pos - old_pos + + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error ending compression stream: %s" % _zstd_error(zresult) + ) + + if zresult == 0: + self._finished_output = True + + return out_buffer.pos + + +class ZstdCompressor(object): + """ + Create an object used to perform Zstandard compression. + + Each instance is essentially a wrapper around a ``ZSTD_CCtx`` from + zstd's C API. + + An instance can compress data various ways. Instances can be used + multiple times. Each compression operation will use the compression + parameters defined at construction time. + + .. note: + + When using a compression dictionary and multiple compression + operations are performed, the ``ZstdCompressionParameters`` derived + from an integer compression ``level`` and the first compressed data's + size will be reused for all subsequent operations. This may not be + desirable if source data sizes vary significantly. + + ``compression_params`` is mutually exclusive with ``level``, + ``write_checksum``, ``write_content_size``, ``write_dict_id``, and + ``threads``. + + Assume that each ``ZstdCompressor`` instance can only handle a single + logical compression operation at the same time. i.e. if you call a method + like ``stream_reader()`` to obtain multiple objects derived from the same + ``ZstdCompressor`` instance and attempt to use them simultaneously, errors + will likely occur. + + If you need to perform multiple logical compression operations and you + can't guarantee those operations are temporally non-overlapping, you need + to obtain multiple ``ZstdCompressor`` instances. + + Unless specified otherwise, assume that no two methods of + ``ZstdCompressor`` instances can be called from multiple Python + threads simultaneously. In other words, assume instances are not thread safe + unless stated otherwise. + + :param level: + Integer compression level. Valid values are all negative integers + through 22. Lower values generally yield faster operations with lower + compression ratios. Higher values are generally slower but compress + better. The default is 3, which is what the ``zstd`` CLI uses. Negative + levels effectively engage ``--fast`` mode from the ``zstd`` CLI. + :param dict_data: + A ``ZstdCompressionDict`` to be used to compress with dictionary + data. + :param compression_params: + A ``ZstdCompressionParameters`` instance defining low-level compression + parameters. If defined, this will overwrite the ``level`` argument. + :param write_checksum: + If True, a 4 byte content checksum will be written with the compressed + data, allowing the decompressor to perform content verification. + :param write_content_size: + If True (the default), the decompressed content size will be included + in the header of the compressed data. This data will only be written if + the compressor knows the size of the input data. + :param write_dict_id: + Determines whether the dictionary ID will be written into the compressed + data. Defaults to True. Only adds content to the compressed data if + a dictionary is being used. + :param threads: + Number of threads to use to compress data concurrently. When set, + compression operations are performed on multiple threads. The default + value (0) disables multi-threaded compression. A value of ``-1`` means + to set the number of threads to the number of detected logical CPUs. + """ + + def __init__( + self, + level=3, + dict_data=None, + compression_params=None, + write_checksum=None, + write_content_size=None, + write_dict_id=None, + threads=0, + ): + if level > lib.ZSTD_maxCLevel(): + raise ValueError( + "level must be less than %d" % lib.ZSTD_maxCLevel() + ) + + if threads < 0: + threads = _cpu_count() + + if compression_params and write_checksum is not None: + raise ValueError( + "cannot define compression_params and " "write_checksum" + ) + + if compression_params and write_content_size is not None: + raise ValueError( + "cannot define compression_params and " "write_content_size" + ) + + if compression_params and write_dict_id is not None: + raise ValueError( + "cannot define compression_params and " "write_dict_id" + ) + + if compression_params and threads: + raise ValueError("cannot define compression_params and threads") + + if compression_params: + self._params = _make_cctx_params(compression_params) + else: + if write_dict_id is None: + write_dict_id = True + + params = lib.ZSTD_createCCtxParams() + if params == ffi.NULL: + raise MemoryError() + + self._params = ffi.gc(params, lib.ZSTD_freeCCtxParams) + + _set_compression_parameter( + self._params, lib.ZSTD_c_compressionLevel, level + ) + + _set_compression_parameter( + self._params, + lib.ZSTD_c_contentSizeFlag, + write_content_size if write_content_size is not None else 1, + ) + + _set_compression_parameter( + self._params, + lib.ZSTD_c_checksumFlag, + 1 if write_checksum else 0, + ) + + _set_compression_parameter( + self._params, lib.ZSTD_c_dictIDFlag, 1 if write_dict_id else 0 + ) + + if threads: + _set_compression_parameter( + self._params, lib.ZSTD_c_nbWorkers, threads + ) + + cctx = lib.ZSTD_createCCtx() + if cctx == ffi.NULL: + raise MemoryError() + + self._cctx = cctx + self._dict_data = dict_data + + # We defer setting up garbage collection until after calling + # _setup_cctx() to ensure the memory size estimate is more accurate. + try: + self._setup_cctx() + finally: + self._cctx = ffi.gc( + cctx, lib.ZSTD_freeCCtx, size=lib.ZSTD_sizeof_CCtx(cctx) + ) + + def _setup_cctx(self): + zresult = lib.ZSTD_CCtx_setParametersUsingCCtxParams( + self._cctx, self._params + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "could not set compression parameters: %s" + % _zstd_error(zresult) + ) + + dict_data = self._dict_data + + if dict_data: + if dict_data._cdict: + zresult = lib.ZSTD_CCtx_refCDict(self._cctx, dict_data._cdict) + else: + zresult = lib.ZSTD_CCtx_loadDictionary_advanced( + self._cctx, + dict_data.as_bytes(), + len(dict_data), + lib.ZSTD_dlm_byRef, + dict_data._dict_type, + ) + + if lib.ZSTD_isError(zresult): + raise ZstdError( + "could not load compression dictionary: %s" + % _zstd_error(zresult) + ) + + def memory_size(self): + """Obtain the memory usage of this compressor, in bytes. + + >>> cctx = zstandard.ZstdCompressor() + >>> memory = cctx.memory_size() + """ + return lib.ZSTD_sizeof_CCtx(self._cctx) + + def compress(self, data): + """ + Compress data in a single operation. + + This is the simplest mechanism to perform compression: simply pass in a + value and get a compressed value back. It is almost the most prone to + abuse. + + The input and output values must fit in memory, so passing in very large + values can result in excessive memory usage. For this reason, one of the + streaming based APIs is preferred for larger values. + + :param data: + Source data to compress + :return: + Compressed data + + >>> cctx = zstandard.ZstdCompressor() + >>> compressed = cctx.compress(b"data to compress") + """ + lib.ZSTD_CCtx_reset(self._cctx, lib.ZSTD_reset_session_only) + + data_buffer = ffi.from_buffer(data) + + dest_size = lib.ZSTD_compressBound(len(data_buffer)) + out = new_nonzero("char[]", dest_size) + + zresult = lib.ZSTD_CCtx_setPledgedSrcSize(self._cctx, len(data_buffer)) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error setting source size: %s" % _zstd_error(zresult) + ) + + out_buffer = ffi.new("ZSTD_outBuffer *") + in_buffer = ffi.new("ZSTD_inBuffer *") + + out_buffer.dst = out + out_buffer.size = dest_size + out_buffer.pos = 0 + + in_buffer.src = data_buffer + in_buffer.size = len(data_buffer) + in_buffer.pos = 0 + + zresult = lib.ZSTD_compressStream2( + self._cctx, out_buffer, in_buffer, lib.ZSTD_e_end + ) + + if lib.ZSTD_isError(zresult): + raise ZstdError("cannot compress: %s" % _zstd_error(zresult)) + elif zresult: + raise ZstdError("unexpected partial frame flush") + + return ffi.buffer(out, out_buffer.pos)[:] + + def compressobj(self, size=-1): + """ + Obtain a compressor exposing the Python standard library compression API. + + See :py:class:`ZstdCompressionObj` for the full documentation. + + :param size: + Size in bytes of data that will be compressed. + :return: + :py:class:`ZstdCompressionObj` + """ + lib.ZSTD_CCtx_reset(self._cctx, lib.ZSTD_reset_session_only) + + if size < 0: + size = lib.ZSTD_CONTENTSIZE_UNKNOWN + + zresult = lib.ZSTD_CCtx_setPledgedSrcSize(self._cctx, size) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error setting source size: %s" % _zstd_error(zresult) + ) + + cobj = ZstdCompressionObj() + cobj._out = ffi.new("ZSTD_outBuffer *") + cobj._dst_buffer = ffi.new( + "char[]", COMPRESSION_RECOMMENDED_OUTPUT_SIZE + ) + cobj._out.dst = cobj._dst_buffer + cobj._out.size = COMPRESSION_RECOMMENDED_OUTPUT_SIZE + cobj._out.pos = 0 + cobj._compressor = self + cobj._finished = False + + return cobj + + def chunker(self, size=-1, chunk_size=COMPRESSION_RECOMMENDED_OUTPUT_SIZE): + """ + Create an object for iterative compressing to same-sized chunks. + + This API is similar to :py:meth:`ZstdCompressor.compressobj` but has + better performance properties. + + :param size: + Size in bytes of data that will be compressed. + :param chunk_size: + Size of compressed chunks. + :return: + :py:class:`ZstdCompressionChunker` + """ + lib.ZSTD_CCtx_reset(self._cctx, lib.ZSTD_reset_session_only) + + if size < 0: + size = lib.ZSTD_CONTENTSIZE_UNKNOWN + + zresult = lib.ZSTD_CCtx_setPledgedSrcSize(self._cctx, size) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error setting source size: %s" % _zstd_error(zresult) + ) + + return ZstdCompressionChunker(self, chunk_size=chunk_size) + + def copy_stream( + self, + ifh, + ofh, + size=-1, + read_size=COMPRESSION_RECOMMENDED_INPUT_SIZE, + write_size=COMPRESSION_RECOMMENDED_OUTPUT_SIZE, + ): + """ + Copy data between 2 streams while compressing it. + + Data will be read from ``ifh``, compressed, and written to ``ofh``. + ``ifh`` must have a ``read(size)`` method. ``ofh`` must have a + ``write(data)`` + method. + + >>> cctx = zstandard.ZstdCompressor() + >>> with open(input_path, "rb") as ifh, open(output_path, "wb") as ofh: + ... cctx.copy_stream(ifh, ofh) + + It is also possible to declare the size of the source stream: + + >>> cctx = zstandard.ZstdCompressor() + >>> cctx.copy_stream(ifh, ofh, size=len_of_input) + + You can also specify how large the chunks that are ``read()`` + and ``write()`` from and to the streams: + + >>> cctx = zstandard.ZstdCompressor() + >>> cctx.copy_stream(ifh, ofh, read_size=32768, write_size=16384) + + The stream copier returns a 2-tuple of bytes read and written: + + >>> cctx = zstandard.ZstdCompressor() + >>> read_count, write_count = cctx.copy_stream(ifh, ofh) + + :param ifh: + Source stream to read from + :param ofh: + Destination stream to write to + :param size: + Size in bytes of the source stream. If defined, compression + parameters will be tuned for this size. + :param read_size: + Chunk sizes that source stream should be ``read()`` from. + :param write_size: + Chunk sizes that destination stream should be ``write()`` to. + :return: + 2-tuple of ints of bytes read and written, respectively. + """ + + if not hasattr(ifh, "read"): + raise ValueError("first argument must have a read() method") + if not hasattr(ofh, "write"): + raise ValueError("second argument must have a write() method") + + lib.ZSTD_CCtx_reset(self._cctx, lib.ZSTD_reset_session_only) + + if size < 0: + size = lib.ZSTD_CONTENTSIZE_UNKNOWN + + zresult = lib.ZSTD_CCtx_setPledgedSrcSize(self._cctx, size) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error setting source size: %s" % _zstd_error(zresult) + ) + + in_buffer = ffi.new("ZSTD_inBuffer *") + out_buffer = ffi.new("ZSTD_outBuffer *") + + dst_buffer = ffi.new("char[]", write_size) + out_buffer.dst = dst_buffer + out_buffer.size = write_size + out_buffer.pos = 0 + + total_read, total_write = 0, 0 + + while True: + data = ifh.read(read_size) + if not data: + break + + data_buffer = ffi.from_buffer(data) + total_read += len(data_buffer) + in_buffer.src = data_buffer + in_buffer.size = len(data_buffer) + in_buffer.pos = 0 + + while in_buffer.pos < in_buffer.size: + zresult = lib.ZSTD_compressStream2( + self._cctx, out_buffer, in_buffer, lib.ZSTD_e_continue + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd compress error: %s" % _zstd_error(zresult) + ) + + if out_buffer.pos: + ofh.write(ffi.buffer(out_buffer.dst, out_buffer.pos)) + total_write += out_buffer.pos + out_buffer.pos = 0 + + # We've finished reading. Flush the compressor. + while True: + zresult = lib.ZSTD_compressStream2( + self._cctx, out_buffer, in_buffer, lib.ZSTD_e_end + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error ending compression stream: %s" % _zstd_error(zresult) + ) + + if out_buffer.pos: + ofh.write(ffi.buffer(out_buffer.dst, out_buffer.pos)) + total_write += out_buffer.pos + out_buffer.pos = 0 + + if zresult == 0: + break + + return total_read, total_write + + def stream_reader( + self, + source, + size=-1, + read_size=COMPRESSION_RECOMMENDED_INPUT_SIZE, + closefd=True, + ): + """ + Wrap a readable source with a stream that can read compressed data. + + This will produce an object conforming to the ``io.RawIOBase`` + interface which can be ``read()`` from to retrieve compressed data + from a source. + + The source object can be any object with a ``read(size)`` method + or an object that conforms to the buffer protocol. + + See :py:class:`ZstdCompressionReader` for type documentation and usage + examples. + + :param source: + Object to read source data from + :param size: + Size in bytes of source object. + :param read_size: + How many bytes to request when ``read()``'ing from the source. + :param closefd: + Whether to close the source stream when the returned stream is + closed. + :return: + :py:class:`ZstdCompressionReader` + """ + lib.ZSTD_CCtx_reset(self._cctx, lib.ZSTD_reset_session_only) + + try: + size = len(source) + except Exception: + pass + + if size < 0: + size = lib.ZSTD_CONTENTSIZE_UNKNOWN + + zresult = lib.ZSTD_CCtx_setPledgedSrcSize(self._cctx, size) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error setting source size: %s" % _zstd_error(zresult) + ) + + return ZstdCompressionReader(self, source, read_size, closefd=closefd) + + def stream_writer( + self, + writer, + size=-1, + write_size=COMPRESSION_RECOMMENDED_OUTPUT_SIZE, + write_return_read=True, + closefd=True, + ): + """ + Create a stream that will write compressed data into another stream. + + The argument to ``stream_writer()`` must have a ``write(data)`` method. + As compressed data is available, ``write()`` will be called with the + compressed data as its argument. Many common Python types implement + ``write()``, including open file handles and ``io.BytesIO``. + + See :py:class:`ZstdCompressionWriter` for more documentation, including + usage examples. + + :param writer: + Stream to write compressed data to. + :param size: + Size in bytes of data to be compressed. If set, it will be used + to influence compression parameter tuning and could result in the + size being written into the header of the compressed data. + :param write_size: + How much data to ``write()`` to ``writer`` at a time. + :param write_return_read: + Whether ``write()`` should return the number of bytes that were + consumed from the input. + :param closefd: + Whether to ``close`` the ``writer`` when this stream is closed. + :return: + :py:class:`ZstdCompressionWriter` + """ + if not hasattr(writer, "write"): + raise ValueError("must pass an object with a write() method") + + lib.ZSTD_CCtx_reset(self._cctx, lib.ZSTD_reset_session_only) + + if size < 0: + size = lib.ZSTD_CONTENTSIZE_UNKNOWN + + return ZstdCompressionWriter( + self, writer, size, write_size, write_return_read, closefd=closefd + ) + + def read_to_iter( + self, + reader, + size=-1, + read_size=COMPRESSION_RECOMMENDED_INPUT_SIZE, + write_size=COMPRESSION_RECOMMENDED_OUTPUT_SIZE, + ): + """ + Read uncompressed data from a reader and return an iterator + + Returns an iterator of compressed data produced from reading from + ``reader``. + + This method provides a mechanism to stream compressed data out of a + source as an iterator of data chunks. + + Uncompressed data will be obtained from ``reader`` by calling the + ``read(size)`` method of it or by reading a slice (if ``reader`` + conforms to the *buffer protocol*). The source data will be streamed + into a compressor. As compressed data is available, it will be exposed + to the iterator. + + Data is read from the source in chunks of ``read_size``. Compressed + chunks are at most ``write_size`` bytes. Both values default to the + zstd input and and output defaults, respectively. + + If reading from the source via ``read()``, ``read()`` will be called + until it raises or returns an empty bytes (``b""``). It is perfectly + valid for the source to deliver fewer bytes than were what requested + by ``read(size)``. + + The caller is partially in control of how fast data is fed into the + compressor by how it consumes the returned iterator. The compressor + will not consume from the reader unless the caller consumes from the + iterator. + + >>> cctx = zstandard.ZstdCompressor() + >>> for chunk in cctx.read_to_iter(fh): + ... # Do something with emitted data. + + ``read_to_iter()`` accepts a ``size`` argument declaring the size of + the input stream: + + >>> cctx = zstandard.ZstdCompressor() + >>> for chunk in cctx.read_to_iter(fh, size=some_int): + >>> pass + + You can also control the size that data is ``read()`` from the source + and the ideal size of output chunks: + + >>> cctx = zstandard.ZstdCompressor() + >>> for chunk in cctx.read_to_iter(fh, read_size=16384, write_size=8192): + >>> pass + + ``read_to_iter()`` does not give direct control over the sizes of chunks + fed into the compressor. Instead, chunk sizes will be whatever the object + being read from delivers. These will often be of a uniform size. + + :param reader: + Stream providing data to be compressed. + :param size: + Size in bytes of input data. + :param read_size: + Controls how many bytes are ``read()`` from the source. + :param write_size: + Controls the output size of emitted chunks. + :return: + Iterator of ``bytes``. + """ + + if hasattr(reader, "read"): + have_read = True + elif hasattr(reader, "__getitem__"): + have_read = False + buffer_offset = 0 + size = len(reader) + else: + raise ValueError( + "must pass an object with a read() method or " + "conforms to buffer protocol" + ) + + lib.ZSTD_CCtx_reset(self._cctx, lib.ZSTD_reset_session_only) + + if size < 0: + size = lib.ZSTD_CONTENTSIZE_UNKNOWN + + zresult = lib.ZSTD_CCtx_setPledgedSrcSize(self._cctx, size) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error setting source size: %s" % _zstd_error(zresult) + ) + + in_buffer = ffi.new("ZSTD_inBuffer *") + out_buffer = ffi.new("ZSTD_outBuffer *") + + in_buffer.src = ffi.NULL + in_buffer.size = 0 + in_buffer.pos = 0 + + dst_buffer = ffi.new("char[]", write_size) + out_buffer.dst = dst_buffer + out_buffer.size = write_size + out_buffer.pos = 0 + + while True: + # We should never have output data sitting around after a previous + # iteration. + assert out_buffer.pos == 0 + + # Collect input data. + if have_read: + read_result = reader.read(read_size) + else: + remaining = len(reader) - buffer_offset + slice_size = min(remaining, read_size) + read_result = reader[buffer_offset : buffer_offset + slice_size] + buffer_offset += slice_size + + # No new input data. Break out of the read loop. + if not read_result: + break + + # Feed all read data into the compressor and emit output until + # exhausted. + read_buffer = ffi.from_buffer(read_result) + in_buffer.src = read_buffer + in_buffer.size = len(read_buffer) + in_buffer.pos = 0 + + while in_buffer.pos < in_buffer.size: + zresult = lib.ZSTD_compressStream2( + self._cctx, out_buffer, in_buffer, lib.ZSTD_e_continue + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd compress error: %s" % _zstd_error(zresult) + ) + + if out_buffer.pos: + data = ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + out_buffer.pos = 0 + yield data + + assert out_buffer.pos == 0 + + # And repeat the loop to collect more data. + continue + + # If we get here, input is exhausted. End the stream and emit what + # remains. + while True: + assert out_buffer.pos == 0 + zresult = lib.ZSTD_compressStream2( + self._cctx, out_buffer, in_buffer, lib.ZSTD_e_end + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "error ending compression stream: %s" % _zstd_error(zresult) + ) + + if out_buffer.pos: + data = ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + out_buffer.pos = 0 + yield data + + if zresult == 0: + break + + def multi_compress_to_buffer(self, data, threads=-1): + """ + Compress multiple pieces of data as a single function call. + + (Experimental. Not yet supported by CFFI backend.) + + This function is optimized to perform multiple compression operations + as as possible with as little overhead as possible. + + Data to be compressed can be passed as a ``BufferWithSegmentsCollection``, + a ``BufferWithSegments``, or a list containing byte like objects. Each + element of the container will be compressed individually using the + configured parameters on the ``ZstdCompressor`` instance. + + The ``threads`` argument controls how many threads to use for + compression. The default is ``0`` which means to use a single thread. + Negative values use the number of logical CPUs in the machine. + + The function returns a ``BufferWithSegmentsCollection``. This type + represents N discrete memory allocations, each holding 1 or more + compressed frames. + + Output data is written to shared memory buffers. This means that unlike + regular Python objects, a reference to *any* object within the collection + keeps the shared buffer and therefore memory backing it alive. This can + have undesirable effects on process memory usage. + + The API and behavior of this function is experimental and will likely + change. Known deficiencies include: + + * If asked to use multiple threads, it will always spawn that many + threads, even if the input is too small to use them. It should + automatically lower the thread count when the extra threads would + just add overhead. + * The buffer allocation strategy is fixed. There is room to make it + dynamic, perhaps even to allow one output buffer per input, + facilitating a variation of the API to return a list without the + adverse effects of shared memory buffers. + + :param data: + Source to read discrete pieces of data to compress. + + Can be a ``BufferWithSegmentsCollection``, a ``BufferWithSegments``, + or a ``list[bytes]``. + :return: + BufferWithSegmentsCollection holding compressed data. + """ + raise NotImplementedError() + + def frame_progression(self): + """ + Return information on how much work the compressor has done. + + Returns a 3-tuple of (ingested, consumed, produced). + + >>> cctx = zstandard.ZstdCompressor() + >>> (ingested, consumed, produced) = cctx.frame_progression() + """ + progression = lib.ZSTD_getFrameProgression(self._cctx) + + return progression.ingested, progression.consumed, progression.produced + + +class FrameParameters(object): + """Information about a zstd frame. + + Instances have the following attributes: + + ``content_size`` + Integer size of original, uncompressed content. This will be ``0`` if the + original content size isn't written to the frame (controlled with the + ``write_content_size`` argument to ``ZstdCompressor``) or if the input + content size was ``0``. + + ``window_size`` + Integer size of maximum back-reference distance in compressed data. + + ``dict_id`` + Integer of dictionary ID used for compression. ``0`` if no dictionary + ID was used or if the dictionary ID was ``0``. + + ``has_checksum`` + Bool indicating whether a 4 byte content checksum is stored at the end + of the frame. + """ + + def __init__(self, fparams): + self.content_size = fparams.frameContentSize + self.window_size = fparams.windowSize + self.dict_id = fparams.dictID + self.has_checksum = bool(fparams.checksumFlag) + + +def frame_content_size(data): + """Obtain the decompressed size of a frame. + + The returned value is usually accurate. But strictly speaking it should + not be trusted. + + :return: + ``-1`` if size unknown and a non-negative integer otherwise. + """ + data_buffer = ffi.from_buffer(data) + + size = lib.ZSTD_getFrameContentSize(data_buffer, len(data_buffer)) + + if size == lib.ZSTD_CONTENTSIZE_ERROR: + raise ZstdError("error when determining content size") + elif size == lib.ZSTD_CONTENTSIZE_UNKNOWN: + return -1 + else: + return size + + +def frame_header_size(data): + """Obtain the size of a frame header. + + :return: + Integer size in bytes. + """ + data_buffer = ffi.from_buffer(data) + + zresult = lib.ZSTD_frameHeaderSize(data_buffer, len(data_buffer)) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "could not determine frame header size: %s" % _zstd_error(zresult) + ) + + return zresult + + +def get_frame_parameters(data): + """ + Parse a zstd frame header into frame parameters. + + Depending on which fields are present in the frame and their values, the + length of the frame parameters varies. If insufficient bytes are passed + in to fully parse the frame parameters, ``ZstdError`` is raised. To ensure + frame parameters can be parsed, pass in at least 18 bytes. + + :param data: + Data from which to read frame parameters. + :return: + :py:class:`FrameParameters` + """ + params = ffi.new("ZSTD_frameHeader *") + + data_buffer = ffi.from_buffer(data) + zresult = lib.ZSTD_getFrameHeader(params, data_buffer, len(data_buffer)) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "cannot get frame parameters: %s" % _zstd_error(zresult) + ) + + if zresult: + raise ZstdError( + "not enough data for frame parameters; need %d bytes" % zresult + ) + + return FrameParameters(params[0]) + + +class ZstdCompressionDict(object): + """Represents a computed compression dictionary. + + Instances are obtained by calling :py:func:`train_dictionary` or by + passing bytes obtained from another source into the constructor. + + Instances can be constructed from bytes: + + >>> dict_data = zstandard.ZstdCompressionDict(data) + + It is possible to construct a dictionary from *any* data. If the data + doesn't begin with a magic header, it will be treated as a *prefix* + dictionary. *Prefix* dictionaries allow compression operations to + reference raw data within the dictionary. + + It is possible to force the use of *prefix* dictionaries or to require + a dictionary header: + + >>> dict_data = zstandard.ZstdCompressionDict(data, dict_type=zstandard.DICT_TYPE_RAWCONTENT) + >>> dict_data = zstandard.ZstdCompressionDict(data, dict_type=zstandard.DICT_TYPE_FULLDICT) + + You can see how many bytes are in the dictionary by calling ``len()``: + + >>> dict_data = zstandard.train_dictionary(size, samples) + >>> dict_size = len(dict_data) # will not be larger than ``size`` + + Once you have a dictionary, you can pass it to the objects performing + compression and decompression: + + >>> dict_data = zstandard.train_dictionary(131072, samples) + >>> cctx = zstandard.ZstdCompressor(dict_data=dict_data) + >>> for source_data in input_data: + ... compressed = cctx.compress(source_data) + ... # Do something with compressed data. + ... + >>> dctx = zstandard.ZstdDecompressor(dict_data=dict_data) + >>> for compressed_data in input_data: + ... buffer = io.BytesIO() + ... with dctx.stream_writer(buffer) as decompressor: + ... decompressor.write(compressed_data) + ... # Do something with raw data in ``buffer``. + + Dictionaries have unique integer IDs. You can retrieve this ID via: + + >>> dict_id = zstandard.dictionary_id(dict_data) + + You can obtain the raw data in the dict (useful for persisting and constructing + a ``ZstdCompressionDict`` later) via ``as_bytes()``: + + >>> dict_data = zstandard.train_dictionary(size, samples) + >>> raw_data = dict_data.as_bytes() + + By default, when a ``ZstdCompressionDict`` is *attached* to a + ``ZstdCompressor``, each ``ZstdCompressor`` performs work to prepare the + dictionary for use. This is fine if only 1 compression operation is being + performed or if the ``ZstdCompressor`` is being reused for multiple operations. + But if multiple ``ZstdCompressor`` instances are being used with the dictionary, + this can add overhead. + + It is possible to *precompute* the dictionary so it can readily be consumed + by multiple ``ZstdCompressor`` instances: + + >>> d = zstandard.ZstdCompressionDict(data) + >>> # Precompute for compression level 3. + >>> d.precompute_compress(level=3) + >>> # Precompute with specific compression parameters. + >>> params = zstandard.ZstdCompressionParameters(...) + >>> d.precompute_compress(compression_params=params) + + .. note:: + + When a dictionary is precomputed, the compression parameters used to + precompute the dictionary overwrite some of the compression parameters + specified to ``ZstdCompressor``. + + :param data: + Dictionary data. + :param dict_type: + Type of dictionary. One of the ``DICT_TYPE_*`` constants. + """ + + def __init__(self, data, dict_type=DICT_TYPE_AUTO, k=0, d=0): + assert isinstance(data, bytes) + self._data = data + self.k = k + self.d = d + + if dict_type not in ( + DICT_TYPE_AUTO, + DICT_TYPE_RAWCONTENT, + DICT_TYPE_FULLDICT, + ): + raise ValueError( + "invalid dictionary load mode: %d; must use " + "DICT_TYPE_* constants" + ) + + self._dict_type = dict_type + self._cdict = None + + def __len__(self): + return len(self._data) + + def dict_id(self): + """Obtain the integer ID of the dictionary.""" + return int(lib.ZDICT_getDictID(self._data, len(self._data))) + + def as_bytes(self): + """Obtain the ``bytes`` representation of the dictionary.""" + return self._data + + def precompute_compress(self, level=0, compression_params=None): + """Precompute a dictionary os it can be used by multiple compressors. + + Calling this method on an instance that will be used by multiple + :py:class:`ZstdCompressor` instances will improve performance. + """ + if level and compression_params: + raise ValueError( + "must only specify one of level or " "compression_params" + ) + + if not level and not compression_params: + raise ValueError("must specify one of level or compression_params") + + if level: + cparams = lib.ZSTD_getCParams(level, 0, len(self._data)) + else: + cparams = ffi.new("ZSTD_compressionParameters") + cparams.chainLog = compression_params.chain_log + cparams.hashLog = compression_params.hash_log + cparams.minMatch = compression_params.min_match + cparams.searchLog = compression_params.search_log + cparams.strategy = compression_params.strategy + cparams.targetLength = compression_params.target_length + cparams.windowLog = compression_params.window_log + + cdict = lib.ZSTD_createCDict_advanced( + self._data, + len(self._data), + lib.ZSTD_dlm_byRef, + self._dict_type, + cparams, + lib.ZSTD_defaultCMem, + ) + if cdict == ffi.NULL: + raise ZstdError("unable to precompute dictionary") + + self._cdict = ffi.gc( + cdict, lib.ZSTD_freeCDict, size=lib.ZSTD_sizeof_CDict(cdict) + ) + + @property + def _ddict(self): + ddict = lib.ZSTD_createDDict_advanced( + self._data, + len(self._data), + lib.ZSTD_dlm_byRef, + self._dict_type, + lib.ZSTD_defaultCMem, + ) + + if ddict == ffi.NULL: + raise ZstdError("could not create decompression dict") + + ddict = ffi.gc( + ddict, lib.ZSTD_freeDDict, size=lib.ZSTD_sizeof_DDict(ddict) + ) + self.__dict__["_ddict"] = ddict + + return ddict + + +def train_dictionary( + dict_size, + samples, + k=0, + d=0, + f=0, + split_point=0.0, + accel=0, + notifications=0, + dict_id=0, + level=0, + steps=0, + threads=0, +): + """Train a dictionary from sample data using the COVER algorithm. + + A compression dictionary of size ``dict_size`` will be created from the + iterable of ``samples``. The raw dictionary bytes will be returned. + + The dictionary training mechanism is known as *cover*. More details about it + are available in the paper *Effective Construction of Relative Lempel-Ziv + Dictionaries* (authors: Liao, Petri, Moffat, Wirth). + + The cover algorithm takes parameters ``k`` and ``d``. These are the + *segment size* and *dmer size*, respectively. The returned dictionary + instance created by this function has ``k`` and ``d`` attributes + containing the values for these parameters. If a ``ZstdCompressionDict`` + is constructed from raw bytes data (a content-only dictionary), the + ``k`` and ``d`` attributes will be ``0``. + + The segment and dmer size parameters to the cover algorithm can either be + specified manually or ``train_dictionary()`` can try multiple values + and pick the best one, where *best* means the smallest compressed data size. + This later mode is called *optimization* mode. + + Under the hood, this function always calls + ``ZDICT_optimizeTrainFromBuffer_fastCover()``. See the corresponding C library + documentation for more. + + If neither ``steps`` nor ``threads`` is defined, defaults for ``d``, ``steps``, + and ``level`` will be used that are equivalent with what + ``ZDICT_trainFromBuffer()`` would use. + + + :param dict_size: + Target size in bytes of the dictionary to generate. + :param samples: + A list of bytes holding samples the dictionary will be trained from. + :param k: + Segment size : constraint: 0 < k : Reasonable range [16, 2048+] + :param d: + dmer size : constraint: 0 < d <= k : Reasonable range [6, 16] + :param f: + log of size of frequency array : constraint: 0 < f <= 31 : 1 means + default(20) + :param split_point: + Percentage of samples used for training: Only used for optimization. + The first # samples * ``split_point`` samples will be used to training. + The last # samples * (1 - split_point) samples will be used for testing. + 0 means default (0.75), 1.0 when all samples are used for both training + and testing. + :param accel: + Acceleration level: constraint: 0 < accel <= 10. Higher means faster + and less accurate, 0 means default(1). + :param dict_id: + Integer dictionary ID for the produced dictionary. Default is 0, which uses + a random value. + :param steps: + Number of steps through ``k`` values to perform when trying parameter + variations. + :param threads: + Number of threads to use when trying parameter variations. Default is 0, + which means to use a single thread. A negative value can be specified to + use as many threads as there are detected logical CPUs. + :param level: + Integer target compression level when trying parameter variations. + :param notifications: + Controls writing of informational messages to ``stderr``. ``0`` (the + default) means to write nothing. ``1`` writes errors. ``2`` writes + progression info. ``3`` writes more details. And ``4`` writes all info. + """ + + if not isinstance(samples, list): + raise TypeError("samples must be a list") + + if threads < 0: + threads = _cpu_count() + + if not steps and not threads: + d = d or 8 + steps = steps or 4 + level = level or 3 + + total_size = sum(map(len, samples)) + + samples_buffer = new_nonzero("char[]", total_size) + sample_sizes = new_nonzero("size_t[]", len(samples)) + + offset = 0 + for i, sample in enumerate(samples): + if not isinstance(sample, bytes): + raise ValueError("samples must be bytes") + + l = len(sample) + ffi.memmove(samples_buffer + offset, sample, l) + offset += l + sample_sizes[i] = l + + dict_data = new_nonzero("char[]", dict_size) + + dparams = ffi.new("ZDICT_fastCover_params_t *")[0] + dparams.k = k + dparams.d = d + dparams.f = f + dparams.steps = steps + dparams.nbThreads = threads + dparams.splitPoint = split_point + dparams.accel = accel + dparams.zParams.notificationLevel = notifications + dparams.zParams.dictID = dict_id + dparams.zParams.compressionLevel = level + + zresult = lib.ZDICT_optimizeTrainFromBuffer_fastCover( + ffi.addressof(dict_data), + dict_size, + ffi.addressof(samples_buffer), + ffi.addressof(sample_sizes, 0), + len(samples), + ffi.addressof(dparams), + ) + + if lib.ZDICT_isError(zresult): + msg = ffi.string(lib.ZDICT_getErrorName(zresult)).decode("utf-8") + raise ZstdError("cannot train dict: %s" % msg) + + return ZstdCompressionDict( + ffi.buffer(dict_data, zresult)[:], + dict_type=DICT_TYPE_FULLDICT, + k=dparams.k, + d=dparams.d, + ) + + +class ZstdDecompressionObj(object): + """A standard library API compatible decompressor. + + This type implements a compressor that conforms to the API by other + decompressors in Python's standard library. e.g. ``zlib.decompressobj`` + or ``bz2.BZ2Decompressor``. This allows callers to use zstd compression + while conforming to a similar API. + + Compressed data chunks are fed into ``decompress(data)`` and + uncompressed output (or an empty bytes) is returned. Output from + subsequent calls needs to be concatenated to reassemble the full + decompressed byte sequence. + + Each instance is single use: once an input frame is decoded, + ``decompress()`` can no longer be called. + + >>> dctx = zstandard.ZstdDecompressor() + >>> dobj = dctx.decompressobj() + >>> data = dobj.decompress(compressed_chunk_0) + >>> data = dobj.decompress(compressed_chunk_1) + + By default, calls to ``decompress()`` write output data in chunks of size + ``DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE``. These chunks are concatenated + before being returned to the caller. It is possible to define the size of + these temporary chunks by passing ``write_size`` to ``decompressobj()``: + + >>> dctx = zstandard.ZstdDecompressor() + >>> dobj = dctx.decompressobj(write_size=1048576) + + .. note:: + + Because calls to ``decompress()`` may need to perform multiple + memory (re)allocations, this streaming decompression API isn't as + efficient as other APIs. + """ + + def __init__(self, decompressor, write_size): + self._decompressor = decompressor + self._write_size = write_size + self._finished = False + self._unused_input = b"" + + def decompress(self, data): + """Send compressed data to the decompressor and obtain decompressed data. + + :param data: + Data to feed into the decompressor. + :return: + Decompressed bytes. + """ + if self._finished: + raise ZstdError("cannot use a decompressobj multiple times") + + in_buffer = ffi.new("ZSTD_inBuffer *") + out_buffer = ffi.new("ZSTD_outBuffer *") + + data_buffer = ffi.from_buffer(data) + + if len(data_buffer) == 0: + return b"" + + in_buffer.src = data_buffer + in_buffer.size = len(data_buffer) + in_buffer.pos = 0 + + dst_buffer = ffi.new("char[]", self._write_size) + out_buffer.dst = dst_buffer + out_buffer.size = len(dst_buffer) + out_buffer.pos = 0 + + chunks = [] + + while True: + zresult = lib.ZSTD_decompressStream( + self._decompressor._dctx, out_buffer, in_buffer + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd decompressor error: %s" % _zstd_error(zresult) + ) + + # Always record any output from decompressor. + if out_buffer.pos: + chunks.append(ffi.buffer(out_buffer.dst, out_buffer.pos)[:]) + + # 0 is only seen when a frame is fully decoded *and* fully flushed. + # But there may be extra input data: make that available to + # `unused_input`. + if zresult == 0: + self._finished = True + self._decompressor = None + self._unused_input = data[in_buffer.pos : in_buffer.size] + break + + # We're not at the end of the frame *or* we're not fully flushed. + + # The decompressor will write out all the bytes it can to the output + # buffer. So if the output buffer is partially filled and the input + # is exhausted, there's nothing more to write. So we've done all we + # can. + elif ( + in_buffer.pos == in_buffer.size + and out_buffer.pos < out_buffer.size + ): + break + else: + out_buffer.pos = 0 + + return b"".join(chunks) + + def flush(self, length=0): + """Effectively a no-op. + + Implemented for compatibility with the standard library APIs. + + Safe to call at any time. + + :return: + Empty bytes. + """ + return b"" + + @property + def unused_data(self): + """Bytes past the end of compressed data. + + If ``decompress()`` is fed additional data beyond the end of a zstd + frame, this value will be non-empty once ``decompress()`` fully decodes + the input frame. + """ + return self._unused_input + + @property + def unconsumed_tail(self): + """Data that has not yet been fed into the decompressor.""" + return b"" + + @property + def eof(self): + """Whether the end of the compressed data stream has been reached.""" + return self._finished + + +class ZstdDecompressionReader(object): + """Read only decompressor that pull uncompressed data from another stream. + + This type provides a read-only stream interface for performing transparent + decompression from another stream or data source. It conforms to the + ``io.RawIOBase`` interface. Only methods relevant to reading are + implemented. + + >>> with open(path, 'rb') as fh: + >>> dctx = zstandard.ZstdDecompressor() + >>> reader = dctx.stream_reader(fh) + >>> while True: + ... chunk = reader.read(16384) + ... if not chunk: + ... break + ... # Do something with decompressed chunk. + + The stream can also be used as a context manager: + + >>> with open(path, 'rb') as fh: + ... dctx = zstandard.ZstdDecompressor() + ... with dctx.stream_reader(fh) as reader: + ... ... + + When used as a context manager, the stream is closed and the underlying + resources are released when the context manager exits. Future operations + against the stream will fail. + + The ``source`` argument to ``stream_reader()`` can be any object with a + ``read(size)`` method or any object implementing the *buffer protocol*. + + If the ``source`` is a stream, you can specify how large ``read()`` requests + to that stream should be via the ``read_size`` argument. It defaults to + ``zstandard.DECOMPRESSION_RECOMMENDED_INPUT_SIZE``.: + + >>> with open(path, 'rb') as fh: + ... dctx = zstandard.ZstdDecompressor() + ... # Will perform fh.read(8192) when obtaining data for the decompressor. + ... with dctx.stream_reader(fh, read_size=8192) as reader: + ... ... + + Instances are *partially* seekable. Absolute and relative positions + (``SEEK_SET`` and ``SEEK_CUR``) forward of the current position are + allowed. Offsets behind the current read position and offsets relative + to the end of stream are not allowed and will raise ``ValueError`` + if attempted. + + ``tell()`` returns the number of decompressed bytes read so far. + + Not all I/O methods are implemented. Notably missing is support for + ``readline()``, ``readlines()``, and linewise iteration support. This is + because streams operate on binary data - not text data. If you want to + convert decompressed output to text, you can chain an ``io.TextIOWrapper`` + to the stream: + + >>> with open(path, 'rb') as fh: + ... dctx = zstandard.ZstdDecompressor() + ... stream_reader = dctx.stream_reader(fh) + ... text_stream = io.TextIOWrapper(stream_reader, encoding='utf-8') + ... for line in text_stream: + ... ... + """ + + def __init__( + self, + decompressor, + source, + read_size, + read_across_frames, + closefd=True, + ): + self._decompressor = decompressor + self._source = source + self._read_size = read_size + self._read_across_frames = bool(read_across_frames) + self._closefd = bool(closefd) + self._entered = False + self._closed = False + self._bytes_decompressed = 0 + self._finished_input = False + self._finished_output = False + self._in_buffer = ffi.new("ZSTD_inBuffer *") + # Holds a ref to self._in_buffer.src. + self._source_buffer = None + + def __enter__(self): + if self._entered: + raise ValueError("cannot __enter__ multiple times") + + if self._closed: + raise ValueError("stream is closed") + + self._entered = True + return self + + def __exit__(self, exc_type, exc_value, exc_tb): + self._entered = False + self._decompressor = None + self.close() + self._source = None + + return False + + def readable(self): + return True + + def writable(self): + return False + + def seekable(self): + return False + + def readline(self, size=-1): + raise io.UnsupportedOperation() + + def readlines(self, hint=-1): + raise io.UnsupportedOperation() + + def write(self, data): + raise io.UnsupportedOperation() + + def writelines(self, lines): + raise io.UnsupportedOperation() + + def isatty(self): + return False + + def flush(self): + return None + + def close(self): + if self._closed: + return None + + self._closed = True + + f = getattr(self._source, "close", None) + if self._closefd and f: + f() + + @property + def closed(self): + return self._closed + + def tell(self): + return self._bytes_decompressed + + def readall(self): + chunks = [] + + while True: + chunk = self.read(1048576) + if not chunk: + break + + chunks.append(chunk) + + return b"".join(chunks) + + def __iter__(self): + raise io.UnsupportedOperation() + + def __next__(self): + raise io.UnsupportedOperation() + + next = __next__ + + def _read_input(self): + # We have data left over in the input buffer. Use it. + if self._in_buffer.pos < self._in_buffer.size: + return + + # All input data exhausted. Nothing to do. + if self._finished_input: + return + + # Else populate the input buffer from our source. + if hasattr(self._source, "read"): + data = self._source.read(self._read_size) + + if not data: + self._finished_input = True + return + + self._source_buffer = ffi.from_buffer(data) + self._in_buffer.src = self._source_buffer + self._in_buffer.size = len(self._source_buffer) + self._in_buffer.pos = 0 + else: + self._source_buffer = ffi.from_buffer(self._source) + self._in_buffer.src = self._source_buffer + self._in_buffer.size = len(self._source_buffer) + self._in_buffer.pos = 0 + + def _decompress_into_buffer(self, out_buffer): + """Decompress available input into an output buffer. + + Returns True if data in output buffer should be emitted. + """ + zresult = lib.ZSTD_decompressStream( + self._decompressor._dctx, out_buffer, self._in_buffer + ) + + if self._in_buffer.pos == self._in_buffer.size: + self._in_buffer.src = ffi.NULL + self._in_buffer.pos = 0 + self._in_buffer.size = 0 + self._source_buffer = None + + if not hasattr(self._source, "read"): + self._finished_input = True + + if lib.ZSTD_isError(zresult): + raise ZstdError("zstd decompress error: %s" % _zstd_error(zresult)) + + # Emit data if there is data AND either: + # a) output buffer is full (read amount is satisfied) + # b) we're at end of a frame and not in frame spanning mode + return out_buffer.pos and ( + out_buffer.pos == out_buffer.size + or zresult == 0 + and not self._read_across_frames + ) + + def read(self, size=-1): + if self._closed: + raise ValueError("stream is closed") + + if size < -1: + raise ValueError("cannot read negative amounts less than -1") + + if size == -1: + # This is recursive. But it gets the job done. + return self.readall() + + if self._finished_output or size == 0: + return b"" + + # We /could/ call into readinto() here. But that introduces more + # overhead. + dst_buffer = ffi.new("char[]", size) + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = dst_buffer + out_buffer.size = size + out_buffer.pos = 0 + + self._read_input() + if self._decompress_into_buffer(out_buffer): + self._bytes_decompressed += out_buffer.pos + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + while not self._finished_input: + self._read_input() + if self._decompress_into_buffer(out_buffer): + self._bytes_decompressed += out_buffer.pos + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + self._bytes_decompressed += out_buffer.pos + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + def readinto(self, b): + if self._closed: + raise ValueError("stream is closed") + + if self._finished_output: + return 0 + + # TODO use writable=True once we require CFFI >= 1.12. + dest_buffer = ffi.from_buffer(b) + ffi.memmove(b, b"", 0) + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = dest_buffer + out_buffer.size = len(dest_buffer) + out_buffer.pos = 0 + + self._read_input() + if self._decompress_into_buffer(out_buffer): + self._bytes_decompressed += out_buffer.pos + return out_buffer.pos + + while not self._finished_input: + self._read_input() + if self._decompress_into_buffer(out_buffer): + self._bytes_decompressed += out_buffer.pos + return out_buffer.pos + + self._bytes_decompressed += out_buffer.pos + return out_buffer.pos + + def read1(self, size=-1): + if self._closed: + raise ValueError("stream is closed") + + if size < -1: + raise ValueError("cannot read negative amounts less than -1") + + if self._finished_output or size == 0: + return b"" + + # -1 returns arbitrary number of bytes. + if size == -1: + size = DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE + + dst_buffer = ffi.new("char[]", size) + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = dst_buffer + out_buffer.size = size + out_buffer.pos = 0 + + # read1() dictates that we can perform at most 1 call to underlying + # stream to get input. However, we can't satisfy this restriction with + # decompression because not all input generates output. So we allow + # multiple read(). But unlike read(), we stop once we have any output. + while not self._finished_input: + self._read_input() + self._decompress_into_buffer(out_buffer) + + if out_buffer.pos: + break + + self._bytes_decompressed += out_buffer.pos + return ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + + def readinto1(self, b): + if self._closed: + raise ValueError("stream is closed") + + if self._finished_output: + return 0 + + # TODO use writable=True once we require CFFI >= 1.12. + dest_buffer = ffi.from_buffer(b) + ffi.memmove(b, b"", 0) + + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = dest_buffer + out_buffer.size = len(dest_buffer) + out_buffer.pos = 0 + + while not self._finished_input and not self._finished_output: + self._read_input() + self._decompress_into_buffer(out_buffer) + + if out_buffer.pos: + break + + self._bytes_decompressed += out_buffer.pos + return out_buffer.pos + + def seek(self, pos, whence=os.SEEK_SET): + if self._closed: + raise ValueError("stream is closed") + + read_amount = 0 + + if whence == os.SEEK_SET: + if pos < 0: + raise OSError("cannot seek to negative position with SEEK_SET") + + if pos < self._bytes_decompressed: + raise OSError( + "cannot seek zstd decompression stream " "backwards" + ) + + read_amount = pos - self._bytes_decompressed + + elif whence == os.SEEK_CUR: + if pos < 0: + raise OSError( + "cannot seek zstd decompression stream " "backwards" + ) + + read_amount = pos + elif whence == os.SEEK_END: + raise OSError( + "zstd decompression streams cannot be seeked " "with SEEK_END" + ) + + while read_amount: + result = self.read( + min(read_amount, DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE) + ) + + if not result: + break + + read_amount -= len(result) + + return self._bytes_decompressed + + +class ZstdDecompressionWriter(object): + """ + Write-only stream wrapper that performs decompression. + + This type provides a writable stream that performs decompression and writes + decompressed data to another stream. + + This type implements the ``io.RawIOBase`` interface. Only methods that + involve writing will do useful things. + + Behavior is similar to :py:meth:`ZstdCompressor.stream_writer`: compressed + data is sent to the decompressor by calling ``write(data)`` and decompressed + output is written to the inner stream by calling its ``write(data)`` + method: + + >>> dctx = zstandard.ZstdDecompressor() + >>> decompressor = dctx.stream_writer(fh) + >>> # Will call fh.write() with uncompressed data. + >>> decompressor.write(compressed_data) + + Instances can be used as context managers. However, context managers add no + extra special behavior other than automatically calling ``close()`` when + they exit. + + Calling ``close()`` will mark the stream as closed and subsequent I/O + operations will raise ``ValueError`` (per the documented behavior of + ``io.RawIOBase``). ``close()`` will also call ``close()`` on the + underlying stream if such a method exists and the instance was created with + ``closefd=True``. + + The size of chunks to ``write()`` to the destination can be specified: + + >>> dctx = zstandard.ZstdDecompressor() + >>> with dctx.stream_writer(fh, write_size=16384) as decompressor: + >>> pass + + You can see how much memory is being used by the decompressor: + + >>> dctx = zstandard.ZstdDecompressor() + >>> with dctx.stream_writer(fh) as decompressor: + >>> byte_size = decompressor.memory_size() + + ``stream_writer()`` accepts a ``write_return_read`` boolean argument to control + the return value of ``write()``. When ``True`` (the default)``, ``write()`` + returns the number of bytes that were read from the input. When ``False``, + ``write()`` returns the number of bytes that were ``write()`` to the inner + stream. + """ + + def __init__( + self, + decompressor, + writer, + write_size, + write_return_read, + closefd=True, + ): + decompressor._ensure_dctx() + + self._decompressor = decompressor + self._writer = writer + self._write_size = write_size + self._write_return_read = bool(write_return_read) + self._closefd = bool(closefd) + self._entered = False + self._closing = False + self._closed = False + + def __enter__(self): + if self._closed: + raise ValueError("stream is closed") + + if self._entered: + raise ZstdError("cannot __enter__ multiple times") + + self._entered = True + + return self + + def __exit__(self, exc_type, exc_value, exc_tb): + self._entered = False + self.close() + + return False + + def __iter__(self): + raise io.UnsupportedOperation() + + def __next__(self): + raise io.UnsupportedOperation() + + def memory_size(self): + return lib.ZSTD_sizeof_DCtx(self._decompressor._dctx) + + def close(self): + if self._closed: + return + + try: + self._closing = True + self.flush() + finally: + self._closing = False + self._closed = True + + f = getattr(self._writer, "close", None) + if self._closefd and f: + f() + + @property + def closed(self): + return self._closed + + def fileno(self): + f = getattr(self._writer, "fileno", None) + if f: + return f() + else: + raise OSError("fileno not available on underlying writer") + + def flush(self): + if self._closed: + raise ValueError("stream is closed") + + f = getattr(self._writer, "flush", None) + if f and not self._closing: + return f() + + def isatty(self): + return False + + def readable(self): + return False + + def readline(self, size=-1): + raise io.UnsupportedOperation() + + def readlines(self, hint=-1): + raise io.UnsupportedOperation() + + def seek(self, offset, whence=None): + raise io.UnsupportedOperation() + + def seekable(self): + return False + + def tell(self): + raise io.UnsupportedOperation() + + def truncate(self, size=None): + raise io.UnsupportedOperation() + + def writable(self): + return True + + def writelines(self, lines): + raise io.UnsupportedOperation() + + def read(self, size=-1): + raise io.UnsupportedOperation() + + def readall(self): + raise io.UnsupportedOperation() + + def readinto(self, b): + raise io.UnsupportedOperation() + + def write(self, data): + if self._closed: + raise ValueError("stream is closed") + + total_write = 0 + + in_buffer = ffi.new("ZSTD_inBuffer *") + out_buffer = ffi.new("ZSTD_outBuffer *") + + data_buffer = ffi.from_buffer(data) + in_buffer.src = data_buffer + in_buffer.size = len(data_buffer) + in_buffer.pos = 0 + + dst_buffer = ffi.new("char[]", self._write_size) + out_buffer.dst = dst_buffer + out_buffer.size = len(dst_buffer) + out_buffer.pos = 0 + + dctx = self._decompressor._dctx + + while in_buffer.pos < in_buffer.size: + zresult = lib.ZSTD_decompressStream(dctx, out_buffer, in_buffer) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd decompress error: %s" % _zstd_error(zresult) + ) + + if out_buffer.pos: + self._writer.write( + ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + ) + total_write += out_buffer.pos + out_buffer.pos = 0 + + if self._write_return_read: + return in_buffer.pos + else: + return total_write + + +class ZstdDecompressor(object): + """ + Context for performing zstandard decompression. + + Each instance is essentially a wrapper around a ``ZSTD_DCtx`` from zstd's + C API. + + An instance can compress data various ways. Instances can be used multiple + times. + + The interface of this class is very similar to + :py:class:`zstandard.ZstdCompressor` (by design). + + Assume that each ``ZstdDecompressor`` instance can only handle a single + logical compression operation at the same time. i.e. if you call a method + like ``decompressobj()`` to obtain multiple objects derived from the same + ``ZstdDecompressor`` instance and attempt to use them simultaneously, errors + will likely occur. + + If you need to perform multiple logical decompression operations and you + can't guarantee those operations are temporally non-overlapping, you need + to obtain multiple ``ZstdDecompressor`` instances. + + Unless specified otherwise, assume that no two methods of + ``ZstdDecompressor`` instances can be called from multiple Python + threads simultaneously. In other words, assume instances are not thread safe + unless stated otherwise. + + :param dict_data: + Compression dictionary to use. + :param max_window_size: + Sets an upper limit on the window size for decompression operations in + kibibytes. This setting can be used to prevent large memory allocations + for inputs using large compression windows. + :param format: + Set the format of data for the decoder. + + By default this is ``zstandard.FORMAT_ZSTD1``. It can be set to + ``zstandard.FORMAT_ZSTD1_MAGICLESS`` to allow decoding frames without + the 4 byte magic header. Not all decompression APIs support this mode. + """ + + def __init__(self, dict_data=None, max_window_size=0, format=FORMAT_ZSTD1): + self._dict_data = dict_data + self._max_window_size = max_window_size + self._format = format + + dctx = lib.ZSTD_createDCtx() + if dctx == ffi.NULL: + raise MemoryError() + + self._dctx = dctx + + # Defer setting up garbage collection until full state is loaded so + # the memory size is more accurate. + try: + self._ensure_dctx() + finally: + self._dctx = ffi.gc( + dctx, lib.ZSTD_freeDCtx, size=lib.ZSTD_sizeof_DCtx(dctx) + ) + + def memory_size(self): + """Size of decompression context, in bytes. + + >>> dctx = zstandard.ZstdDecompressor() + >>> size = dctx.memory_size() + """ + return lib.ZSTD_sizeof_DCtx(self._dctx) + + def decompress( + self, + data, + max_output_size=0, + read_across_frames=False, + allow_extra_data=True, + ): + """ + Decompress data in a single operation. + + This method will decompress the input data in a single operation and + return the decompressed data. + + The input bytes are expected to contain at least 1 full Zstandard frame + (something compressed with :py:meth:`ZstdCompressor.compress` or + similar). If the input does not contain a full frame, an exception will + be raised. + + ``read_across_frames`` controls whether to read multiple zstandard + frames in the input. When False, decompression stops after reading the + first frame. This feature is not yet implemented but the argument is + provided for forward API compatibility when the default is changed to + True in a future release. For now, if you need to decompress multiple + frames, use an API like :py:meth:`ZstdCompressor.stream_reader` with + ``read_across_frames=True``. + + ``allow_extra_data`` controls how to handle extra input data after a + fully decoded frame. If False, any extra data (which could be a valid + zstd frame) will result in ``ZstdError`` being raised. If True, extra + data is silently ignored. The default will likely change to False in a + future release when ``read_across_frames`` defaults to True. + + If the input contains extra data after a full frame, that extra input + data is silently ignored. This behavior is undesirable in many scenarios + and will likely be changed or controllable in a future release (see + #181). + + If the frame header of the compressed data does not contain the content + size, ``max_output_size`` must be specified or ``ZstdError`` will be + raised. An allocation of size ``max_output_size`` will be performed and an + attempt will be made to perform decompression into that buffer. If the + buffer is too small or cannot be allocated, ``ZstdError`` will be + raised. The buffer will be resized if it is too large. + + Uncompressed data could be much larger than compressed data. As a result, + calling this function could result in a very large memory allocation + being performed to hold the uncompressed data. This could potentially + result in ``MemoryError`` or system memory swapping. If you don't need + the full output data in a single contiguous array in memory, consider + using streaming decompression for more resilient memory behavior. + + Usage: + + >>> dctx = zstandard.ZstdDecompressor() + >>> decompressed = dctx.decompress(data) + + If the compressed data doesn't have its content size embedded within it, + decompression can be attempted by specifying the ``max_output_size`` + argument: + + >>> dctx = zstandard.ZstdDecompressor() + >>> uncompressed = dctx.decompress(data, max_output_size=1048576) + + Ideally, ``max_output_size`` will be identical to the decompressed + output size. + + .. important:: + + If the exact size of decompressed data is unknown (not passed in + explicitly and not stored in the zstd frame), for performance + reasons it is encouraged to use a streaming API. + + :param data: + Compressed data to decompress. + :param max_output_size: + Integer max size of response. + + If ``0``, there is no limit and we can attempt to allocate an output + buffer of infinite size. + :return: + ``bytes`` representing decompressed output. + """ + + if read_across_frames: + raise ZstdError( + "ZstdDecompressor.read_across_frames=True is not yet implemented" + ) + + self._ensure_dctx() + + data_buffer = ffi.from_buffer(data) + + output_size = lib.ZSTD_getFrameContentSize( + data_buffer, len(data_buffer) + ) + + if output_size == lib.ZSTD_CONTENTSIZE_ERROR: + raise ZstdError("error determining content size from frame header") + elif output_size == 0: + return b"" + elif output_size == lib.ZSTD_CONTENTSIZE_UNKNOWN: + if not max_output_size: + raise ZstdError( + "could not determine content size in frame header" + ) + + result_buffer = ffi.new("char[]", max_output_size) + result_size = max_output_size + output_size = 0 + else: + result_buffer = ffi.new("char[]", output_size) + result_size = output_size + + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = result_buffer + out_buffer.size = result_size + out_buffer.pos = 0 + + in_buffer = ffi.new("ZSTD_inBuffer *") + in_buffer.src = data_buffer + in_buffer.size = len(data_buffer) + in_buffer.pos = 0 + + zresult = lib.ZSTD_decompressStream(self._dctx, out_buffer, in_buffer) + if lib.ZSTD_isError(zresult): + raise ZstdError("decompression error: %s" % _zstd_error(zresult)) + elif zresult: + raise ZstdError( + "decompression error: did not decompress full frame" + ) + elif output_size and out_buffer.pos != output_size: + raise ZstdError( + "decompression error: decompressed %d bytes; expected %d" + % (zresult, output_size) + ) + elif not allow_extra_data and in_buffer.pos < in_buffer.size: + count = in_buffer.size - in_buffer.pos + + raise ZstdError( + "compressed input contains %d bytes of unused data, which is disallowed" + % count + ) + + return ffi.buffer(result_buffer, out_buffer.pos)[:] + + def stream_reader( + self, + source, + read_size=DECOMPRESSION_RECOMMENDED_INPUT_SIZE, + read_across_frames=False, + closefd=True, + ): + """ + Read-only stream wrapper that performs decompression. + + This method obtains an object that conforms to the ``io.RawIOBase`` + interface and performs transparent decompression via ``read()`` + operations. Source data is obtained by calling ``read()`` on a + source stream or object implementing the buffer protocol. + + See :py:class:`zstandard.ZstdDecompressionReader` for more documentation + and usage examples. + + :param source: + Source of compressed data to decompress. Can be any object + with a ``read(size)`` method or that conforms to the buffer protocol. + :param read_size: + Integer number of bytes to read from the source and feed into the + compressor at a time. + :param read_across_frames: + Whether to read data across multiple zstd frames. If False, + decompression is stopped at frame boundaries. + :param closefd: + Whether to close the source stream when this instance is closed. + :return: + :py:class:`zstandard.ZstdDecompressionReader`. + """ + self._ensure_dctx() + return ZstdDecompressionReader( + self, source, read_size, read_across_frames, closefd=closefd + ) + + def decompressobj(self, write_size=DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE): + """Obtain a standard library compatible incremental decompressor. + + See :py:class:`ZstdDecompressionObj` for more documentation + and usage examples. + + :param write_size: + :return: + :py:class:`zstandard.ZstdDecompressionObj` + """ + if write_size < 1: + raise ValueError("write_size must be positive") + + self._ensure_dctx() + return ZstdDecompressionObj(self, write_size=write_size) + + def read_to_iter( + self, + reader, + read_size=DECOMPRESSION_RECOMMENDED_INPUT_SIZE, + write_size=DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE, + skip_bytes=0, + ): + """Read compressed data to an iterator of uncompressed chunks. + + This method will read data from ``reader``, feed it to a decompressor, + and emit ``bytes`` chunks representing the decompressed result. + + >>> dctx = zstandard.ZstdDecompressor() + >>> for chunk in dctx.read_to_iter(fh): + ... # Do something with original data. + + ``read_to_iter()`` accepts an object with a ``read(size)`` method that + will return compressed bytes or an object conforming to the buffer + protocol. + + ``read_to_iter()`` returns an iterator whose elements are chunks of the + decompressed data. + + The size of requested ``read()`` from the source can be specified: + + >>> dctx = zstandard.ZstdDecompressor() + >>> for chunk in dctx.read_to_iter(fh, read_size=16384): + ... pass + + It is also possible to skip leading bytes in the input data: + + >>> dctx = zstandard.ZstdDecompressor() + >>> for chunk in dctx.read_to_iter(fh, skip_bytes=1): + ... pass + + .. tip:: + + Skipping leading bytes is useful if the source data contains extra + *header* data. Traditionally, you would need to create a slice or + ``memoryview`` of the data you want to decompress. This would create + overhead. It is more efficient to pass the offset into this API. + + Similarly to :py:meth:`ZstdCompressor.read_to_iter`, the consumer of the + iterator controls when data is decompressed. If the iterator isn't consumed, + decompression is put on hold. + + When ``read_to_iter()`` is passed an object conforming to the buffer protocol, + the behavior may seem similar to what occurs when the simple decompression + API is used. However, this API works when the decompressed size is unknown. + Furthermore, if feeding large inputs, the decompressor will work in chunks + instead of performing a single operation. + + :param reader: + Source of compressed data. Can be any object with a + ``read(size)`` method or any object conforming to the buffer + protocol. + :param read_size: + Integer size of data chunks to read from ``reader`` and feed into + the decompressor. + :param write_size: + Integer size of data chunks to emit from iterator. + :param skip_bytes: + Integer number of bytes to skip over before sending data into + the decompressor. + :return: + Iterator of ``bytes`` representing uncompressed data. + """ + + if skip_bytes >= read_size: + raise ValueError("skip_bytes must be smaller than read_size") + + if hasattr(reader, "read"): + have_read = True + elif hasattr(reader, "__getitem__"): + have_read = False + buffer_offset = 0 + size = len(reader) + else: + raise ValueError( + "must pass an object with a read() method or " + "conforms to buffer protocol" + ) + + if skip_bytes: + if have_read: + reader.read(skip_bytes) + else: + if skip_bytes > size: + raise ValueError("skip_bytes larger than first input chunk") + + buffer_offset = skip_bytes + + self._ensure_dctx() + + in_buffer = ffi.new("ZSTD_inBuffer *") + out_buffer = ffi.new("ZSTD_outBuffer *") + + dst_buffer = ffi.new("char[]", write_size) + out_buffer.dst = dst_buffer + out_buffer.size = len(dst_buffer) + out_buffer.pos = 0 + + while True: + assert out_buffer.pos == 0 + + if have_read: + read_result = reader.read(read_size) + else: + remaining = size - buffer_offset + slice_size = min(remaining, read_size) + read_result = reader[buffer_offset : buffer_offset + slice_size] + buffer_offset += slice_size + + # No new input. Break out of read loop. + if not read_result: + break + + # Feed all read data into decompressor and emit output until + # exhausted. + read_buffer = ffi.from_buffer(read_result) + in_buffer.src = read_buffer + in_buffer.size = len(read_buffer) + in_buffer.pos = 0 + + while in_buffer.pos < in_buffer.size: + assert out_buffer.pos == 0 + + zresult = lib.ZSTD_decompressStream( + self._dctx, out_buffer, in_buffer + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd decompress error: %s" % _zstd_error(zresult) + ) + + if out_buffer.pos: + data = ffi.buffer(out_buffer.dst, out_buffer.pos)[:] + out_buffer.pos = 0 + yield data + + if zresult == 0: + return + + # Repeat loop to collect more input data. + continue + + # If we get here, input is exhausted. + + def stream_writer( + self, + writer, + write_size=DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE, + write_return_read=True, + closefd=True, + ): + """ + Push-based stream wrapper that performs decompression. + + This method constructs a stream wrapper that conforms to the + ``io.RawIOBase`` interface and performs transparent decompression + when writing to a wrapper stream. + + See :py:class:`zstandard.ZstdDecompressionWriter` for more documentation + and usage examples. + + :param writer: + Destination for decompressed output. Can be any object with a + ``write(data)``. + :param write_size: + Integer size of chunks to ``write()`` to ``writer``. + :param write_return_read: + Whether ``write()`` should return the number of bytes of input + consumed. If False, ``write()`` returns the number of bytes sent + to the inner stream. + :param closefd: + Whether to ``close()`` the inner stream when this stream is closed. + :return: + :py:class:`zstandard.ZstdDecompressionWriter` + """ + if not hasattr(writer, "write"): + raise ValueError("must pass an object with a write() method") + + return ZstdDecompressionWriter( + self, + writer, + write_size, + write_return_read, + closefd=closefd, + ) + + def copy_stream( + self, + ifh, + ofh, + read_size=DECOMPRESSION_RECOMMENDED_INPUT_SIZE, + write_size=DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE, + ): + """ + Copy data between streams, decompressing in the process. + + Compressed data will be read from ``ifh``, decompressed, and written + to ``ofh``. + + >>> dctx = zstandard.ZstdDecompressor() + >>> dctx.copy_stream(ifh, ofh) + + e.g. to decompress a file to another file: + + >>> dctx = zstandard.ZstdDecompressor() + >>> with open(input_path, 'rb') as ifh, open(output_path, 'wb') as ofh: + ... dctx.copy_stream(ifh, ofh) + + The size of chunks being ``read()`` and ``write()`` from and to the + streams can be specified: + + >>> dctx = zstandard.ZstdDecompressor() + >>> dctx.copy_stream(ifh, ofh, read_size=8192, write_size=16384) + + :param ifh: + Source stream to read compressed data from. + + Must have a ``read()`` method. + :param ofh: + Destination stream to write uncompressed data to. + + Must have a ``write()`` method. + :param read_size: + The number of bytes to ``read()`` from the source in a single + operation. + :param write_size: + The number of bytes to ``write()`` to the destination in a single + operation. + :return: + 2-tuple of integers representing the number of bytes read and + written, respectively. + """ + + if not hasattr(ifh, "read"): + raise ValueError("first argument must have a read() method") + if not hasattr(ofh, "write"): + raise ValueError("second argument must have a write() method") + + self._ensure_dctx() + + in_buffer = ffi.new("ZSTD_inBuffer *") + out_buffer = ffi.new("ZSTD_outBuffer *") + + dst_buffer = ffi.new("char[]", write_size) + out_buffer.dst = dst_buffer + out_buffer.size = write_size + out_buffer.pos = 0 + + total_read, total_write = 0, 0 + + # Read all available input. + while True: + data = ifh.read(read_size) + if not data: + break + + data_buffer = ffi.from_buffer(data) + total_read += len(data_buffer) + in_buffer.src = data_buffer + in_buffer.size = len(data_buffer) + in_buffer.pos = 0 + + # Flush all read data to output. + while in_buffer.pos < in_buffer.size: + zresult = lib.ZSTD_decompressStream( + self._dctx, out_buffer, in_buffer + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "zstd decompressor error: %s" % _zstd_error(zresult) + ) + + if out_buffer.pos: + ofh.write(ffi.buffer(out_buffer.dst, out_buffer.pos)) + total_write += out_buffer.pos + out_buffer.pos = 0 + + # Continue loop to keep reading. + + return total_read, total_write + + def decompress_content_dict_chain(self, frames): + """ + Decompress a series of frames using the content dictionary chaining technique. + + Such a list of frames is produced by compressing discrete inputs where + each non-initial input is compressed with a *prefix* dictionary consisting + of the content of the previous input. + + For example, say you have the following inputs: + + >>> inputs = [b"input 1", b"input 2", b"input 3"] + + The zstd frame chain consists of: + + 1. ``b"input 1"`` compressed in standalone/discrete mode + 2. ``b"input 2"`` compressed using ``b"input 1"`` as a *prefix* dictionary + 3. ``b"input 3"`` compressed using ``b"input 2"`` as a *prefix* dictionary + + Each zstd frame **must** have the content size written. + + The following Python code can be used to produce a *prefix dictionary chain*: + + >>> def make_chain(inputs): + ... frames = [] + ... + ... # First frame is compressed in standalone/discrete mode. + ... zctx = zstandard.ZstdCompressor() + ... frames.append(zctx.compress(inputs[0])) + ... + ... # Subsequent frames use the previous fulltext as a prefix dictionary + ... for i, raw in enumerate(inputs[1:]): + ... dict_data = zstandard.ZstdCompressionDict( + ... inputs[i], dict_type=zstandard.DICT_TYPE_RAWCONTENT) + ... zctx = zstandard.ZstdCompressor(dict_data=dict_data) + ... frames.append(zctx.compress(raw)) + ... + ... return frames + + ``decompress_content_dict_chain()`` returns the uncompressed data of the last + element in the input chain. + + .. note:: + + It is possible to implement *prefix dictionary chain* decompression + on top of other APIs. However, this function will likely be faster - + especially for long input chains - as it avoids the overhead of + instantiating and passing around intermediate objects between + multiple functions. + + :param frames: + List of ``bytes`` holding compressed zstd frames. + :return: + """ + if not isinstance(frames, list): + raise TypeError("argument must be a list") + + if not frames: + raise ValueError("empty input chain") + + # First chunk should not be using a dictionary. We handle it specially. + chunk = frames[0] + if not isinstance(chunk, bytes): + raise ValueError("chunk 0 must be bytes") + + # All chunks should be zstd frames and should have content size set. + chunk_buffer = ffi.from_buffer(chunk) + params = ffi.new("ZSTD_frameHeader *") + zresult = lib.ZSTD_getFrameHeader( + params, chunk_buffer, len(chunk_buffer) + ) + if lib.ZSTD_isError(zresult): + raise ValueError("chunk 0 is not a valid zstd frame") + elif zresult: + raise ValueError("chunk 0 is too small to contain a zstd frame") + + if params.frameContentSize == lib.ZSTD_CONTENTSIZE_UNKNOWN: + raise ValueError("chunk 0 missing content size in frame") + + self._ensure_dctx(load_dict=False) + + last_buffer = ffi.new("char[]", params.frameContentSize) + + out_buffer = ffi.new("ZSTD_outBuffer *") + out_buffer.dst = last_buffer + out_buffer.size = len(last_buffer) + out_buffer.pos = 0 + + in_buffer = ffi.new("ZSTD_inBuffer *") + in_buffer.src = chunk_buffer + in_buffer.size = len(chunk_buffer) + in_buffer.pos = 0 + + zresult = lib.ZSTD_decompressStream(self._dctx, out_buffer, in_buffer) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "could not decompress chunk 0: %s" % _zstd_error(zresult) + ) + elif zresult: + raise ZstdError("chunk 0 did not decompress full frame") + + # Special case of chain length of 1 + if len(frames) == 1: + return ffi.buffer(last_buffer, len(last_buffer))[:] + + i = 1 + while i < len(frames): + chunk = frames[i] + if not isinstance(chunk, bytes): + raise ValueError("chunk %d must be bytes" % i) + + chunk_buffer = ffi.from_buffer(chunk) + zresult = lib.ZSTD_getFrameHeader( + params, chunk_buffer, len(chunk_buffer) + ) + if lib.ZSTD_isError(zresult): + raise ValueError("chunk %d is not a valid zstd frame" % i) + elif zresult: + raise ValueError( + "chunk %d is too small to contain a zstd frame" % i + ) + + if params.frameContentSize == lib.ZSTD_CONTENTSIZE_UNKNOWN: + raise ValueError("chunk %d missing content size in frame" % i) + + dest_buffer = ffi.new("char[]", params.frameContentSize) + + out_buffer.dst = dest_buffer + out_buffer.size = len(dest_buffer) + out_buffer.pos = 0 + + in_buffer.src = chunk_buffer + in_buffer.size = len(chunk_buffer) + in_buffer.pos = 0 + + zresult = lib.ZSTD_decompressStream( + self._dctx, out_buffer, in_buffer + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "could not decompress chunk %d: %s" % _zstd_error(zresult) + ) + elif zresult: + raise ZstdError("chunk %d did not decompress full frame" % i) + + last_buffer = dest_buffer + i += 1 + + return ffi.buffer(last_buffer, len(last_buffer))[:] + + def multi_decompress_to_buffer( + self, frames, decompressed_sizes=None, threads=0 + ): + """ + Decompress multiple zstd frames to output buffers as a single operation. + + (Experimental. Not available in CFFI backend.) + + Compressed frames can be passed to the function as a + ``BufferWithSegments``, a ``BufferWithSegmentsCollection``, or as a + list containing objects that conform to the buffer protocol. For best + performance, pass a ``BufferWithSegmentsCollection`` or a + ``BufferWithSegments``, as minimal input validation will be done for + that type. If calling from Python (as opposed to C), constructing one + of these instances may add overhead cancelling out the performance + overhead of validation for list inputs. + + Returns a ``BufferWithSegmentsCollection`` containing the decompressed + data. All decompressed data is allocated in a single memory buffer. The + ``BufferWithSegments`` instance tracks which objects are at which offsets + and their respective lengths. + + >>> dctx = zstandard.ZstdDecompressor() + >>> results = dctx.multi_decompress_to_buffer([b'...', b'...']) + + The decompressed size of each frame MUST be discoverable. It can either be + embedded within the zstd frame or passed in via the ``decompressed_sizes`` + argument. + + The ``decompressed_sizes`` argument is an object conforming to the buffer + protocol which holds an array of 64-bit unsigned integers in the machine's + native format defining the decompressed sizes of each frame. If this argument + is passed, it avoids having to scan each frame for its decompressed size. + This frame scanning can add noticeable overhead in some scenarios. + + >>> frames = [...] + >>> sizes = struct.pack('=QQQQ', len0, len1, len2, len3) + >>> + >>> dctx = zstandard.ZstdDecompressor() + >>> results = dctx.multi_decompress_to_buffer(frames, decompressed_sizes=sizes) + + .. note:: + + It is possible to pass a ``mmap.mmap()`` instance into this function by + wrapping it with a ``BufferWithSegments`` instance (which will define the + offsets of frames within the memory mapped region). + + This function is logically equivalent to performing + :py:meth:`ZstdCompressor.decompress` on each input frame and returning the + result. + + This function exists to perform decompression on multiple frames as fast + as possible by having as little overhead as possible. Since decompression is + performed as a single operation and since the decompressed output is stored in + a single buffer, extra memory allocations, Python objects, and Python function + calls are avoided. This is ideal for scenarios where callers know up front that + they need to access data for multiple frames, such as when *delta chains* are + being used. + + Currently, the implementation always spawns multiple threads when requested, + even if the amount of work to do is small. In the future, it will be smarter + about avoiding threads and their associated overhead when the amount of + work to do is small. + + :param frames: + Source defining zstd frames to decompress. + :param decompressed_sizes: + Array of integers representing sizes of decompressed zstd frames. + :param threads: + How many threads to use for decompression operations. + + Negative values will use the same number of threads as logical CPUs + on the machine. Values ``0`` or ``1`` use a single thread. + :return: + ``BufferWithSegmentsCollection`` + """ + raise NotImplementedError() + + def _ensure_dctx(self, load_dict=True): + lib.ZSTD_DCtx_reset(self._dctx, lib.ZSTD_reset_session_only) + + if self._max_window_size: + zresult = lib.ZSTD_DCtx_setMaxWindowSize( + self._dctx, self._max_window_size + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "unable to set max window size: %s" % _zstd_error(zresult) + ) + + zresult = lib.ZSTD_DCtx_setParameter( + self._dctx, lib.ZSTD_d_format, self._format + ) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "unable to set decoding format: %s" % _zstd_error(zresult) + ) + + if self._dict_data and load_dict: + zresult = lib.ZSTD_DCtx_refDDict(self._dctx, self._dict_data._ddict) + if lib.ZSTD_isError(zresult): + raise ZstdError( + "unable to reference prepared dictionary: %s" + % _zstd_error(zresult) + ) diff --git a/shared/package-files/9c/9c3908a896e6fdd46c56302ba7ba08b462881400274b17129e24b07353be0580/blob b/shared/package-files/9c/9c3908a896e6fdd46c56302ba7ba08b462881400274b17129e24b07353be0580/blob new file mode 100644 index 0000000000000000000000000000000000000000..ee52aee86a1ce1812d3326945edd223966ffedfe --- /dev/null +++ b/shared/package-files/9c/9c3908a896e6fdd46c56302ba7ba08b462881400274b17129e24b07353be0580/blob @@ -0,0 +1,222 @@ +from __future__ import annotations + +from enum import Enum + +__all__ = [ + "Keys", + "ALL_KEYS", +] + + +class Keys(str, Enum): + """ + List of keys for use in key bindings. + + Note that this is an "StrEnum", all values can be compared against + strings. + """ + + value: str + + Escape = "escape" # Also Control-[ + ShiftEscape = "s-escape" + + ControlAt = "c-@" # Also Control-Space. + + ControlA = "c-a" + ControlB = "c-b" + ControlC = "c-c" + ControlD = "c-d" + ControlE = "c-e" + ControlF = "c-f" + ControlG = "c-g" + ControlH = "c-h" + ControlI = "c-i" # Tab + ControlJ = "c-j" # Newline + ControlK = "c-k" + ControlL = "c-l" + ControlM = "c-m" # Carriage return + ControlN = "c-n" + ControlO = "c-o" + ControlP = "c-p" + ControlQ = "c-q" + ControlR = "c-r" + ControlS = "c-s" + ControlT = "c-t" + ControlU = "c-u" + ControlV = "c-v" + ControlW = "c-w" + ControlX = "c-x" + ControlY = "c-y" + ControlZ = "c-z" + + Control1 = "c-1" + Control2 = "c-2" + Control3 = "c-3" + Control4 = "c-4" + Control5 = "c-5" + Control6 = "c-6" + Control7 = "c-7" + Control8 = "c-8" + Control9 = "c-9" + Control0 = "c-0" + + ControlShift1 = "c-s-1" + ControlShift2 = "c-s-2" + ControlShift3 = "c-s-3" + ControlShift4 = "c-s-4" + ControlShift5 = "c-s-5" + ControlShift6 = "c-s-6" + ControlShift7 = "c-s-7" + ControlShift8 = "c-s-8" + ControlShift9 = "c-s-9" + ControlShift0 = "c-s-0" + + ControlBackslash = "c-\\" + ControlSquareClose = "c-]" + ControlCircumflex = "c-^" + ControlUnderscore = "c-_" + + Left = "left" + Right = "right" + Up = "up" + Down = "down" + Home = "home" + End = "end" + Insert = "insert" + Delete = "delete" + PageUp = "pageup" + PageDown = "pagedown" + + ControlLeft = "c-left" + ControlRight = "c-right" + ControlUp = "c-up" + ControlDown = "c-down" + ControlHome = "c-home" + ControlEnd = "c-end" + ControlInsert = "c-insert" + ControlDelete = "c-delete" + ControlPageUp = "c-pageup" + ControlPageDown = "c-pagedown" + + ShiftLeft = "s-left" + ShiftRight = "s-right" + ShiftUp = "s-up" + ShiftDown = "s-down" + ShiftHome = "s-home" + ShiftEnd = "s-end" + ShiftInsert = "s-insert" + ShiftDelete = "s-delete" + ShiftPageUp = "s-pageup" + ShiftPageDown = "s-pagedown" + + ControlShiftLeft = "c-s-left" + ControlShiftRight = "c-s-right" + ControlShiftUp = "c-s-up" + ControlShiftDown = "c-s-down" + ControlShiftHome = "c-s-home" + ControlShiftEnd = "c-s-end" + ControlShiftInsert = "c-s-insert" + ControlShiftDelete = "c-s-delete" + ControlShiftPageUp = "c-s-pageup" + ControlShiftPageDown = "c-s-pagedown" + + BackTab = "s-tab" # shift + tab + + F1 = "f1" + F2 = "f2" + F3 = "f3" + F4 = "f4" + F5 = "f5" + F6 = "f6" + F7 = "f7" + F8 = "f8" + F9 = "f9" + F10 = "f10" + F11 = "f11" + F12 = "f12" + F13 = "f13" + F14 = "f14" + F15 = "f15" + F16 = "f16" + F17 = "f17" + F18 = "f18" + F19 = "f19" + F20 = "f20" + F21 = "f21" + F22 = "f22" + F23 = "f23" + F24 = "f24" + + ControlF1 = "c-f1" + ControlF2 = "c-f2" + ControlF3 = "c-f3" + ControlF4 = "c-f4" + ControlF5 = "c-f5" + ControlF6 = "c-f6" + ControlF7 = "c-f7" + ControlF8 = "c-f8" + ControlF9 = "c-f9" + ControlF10 = "c-f10" + ControlF11 = "c-f11" + ControlF12 = "c-f12" + ControlF13 = "c-f13" + ControlF14 = "c-f14" + ControlF15 = "c-f15" + ControlF16 = "c-f16" + ControlF17 = "c-f17" + ControlF18 = "c-f18" + ControlF19 = "c-f19" + ControlF20 = "c-f20" + ControlF21 = "c-f21" + ControlF22 = "c-f22" + ControlF23 = "c-f23" + ControlF24 = "c-f24" + + # Matches any key. + Any = "" + + # Special. + ScrollUp = "" + ScrollDown = "" + + CPRResponse = "" + Vt100MouseEvent = "" + WindowsMouseEvent = "" + BracketedPaste = "" + + SIGINT = "" + + # For internal use: key which is ignored. + # (The key binding for this key should not do anything.) + Ignore = "" + + # Some 'Key' aliases (for backwards-compatibility). + ControlSpace = ControlAt + Tab = ControlI + Enter = ControlM + Backspace = ControlH + + # ShiftControl was renamed to ControlShift in + # 888fcb6fa4efea0de8333177e1bbc792f3ff3c24 (20 Feb 2020). + ShiftControlLeft = ControlShiftLeft + ShiftControlRight = ControlShiftRight + ShiftControlHome = ControlShiftHome + ShiftControlEnd = ControlShiftEnd + + +ALL_KEYS: list[str] = [k.value for k in Keys] + + +# Aliases. +KEY_ALIASES: dict[str, str] = { + "backspace": "c-h", + "c-space": "c-@", + "enter": "c-m", + "tab": "c-i", + # ShiftControl was renamed to ControlShift. + "s-c-left": "c-s-left", + "s-c-right": "c-s-right", + "s-c-home": "c-s-home", + "s-c-end": "c-s-end", +} diff --git a/shared/package-files/9c/9c3b1b6608879985260bc4d2bb56409a4e6e1151a512874537a07675787069e7/blob b/shared/package-files/9c/9c3b1b6608879985260bc4d2bb56409a4e6e1151a512874537a07675787069e7/blob new file mode 100644 index 0000000000000000000000000000000000000000..921841ea3e436303e8521d20c2a9d519728de1f8 --- /dev/null +++ b/shared/package-files/9c/9c3b1b6608879985260bc4d2bb56409a4e6e1151a512874537a07675787069e7/blob @@ -0,0 +1,117 @@ +import sys +from typing import Any, Collection, Optional, Set, Tuple, Type, TypeVar, Union + +from django.contrib.auth.backends import ModelBackend +from django.contrib.auth.base_user import AbstractBaseUser as AbstractBaseUser, BaseUserManager as BaseUserManager +from django.contrib.auth.validators import UnicodeUsernameValidator +from django.contrib.contenttypes.models import ContentType +from django.db.models.base import Model +from django.db.models.manager import EmptyManager + +from django.db import models + +if sys.version_info < (3, 8): + from typing_extensions import Literal +else: + from typing import Literal + +_AnyUser = Union[Model, "AnonymousUser"] + +def update_last_login(sender: Type[AbstractBaseUser], user: AbstractBaseUser, **kwargs: Any) -> None: ... + +class PermissionManager(models.Manager["Permission"]): + def get_by_natural_key(self, codename: str, app_label: str, model: str) -> Permission: ... + +class Permission(models.Model): + content_type_id: int + objects: PermissionManager + + name = models.CharField(max_length=255) + content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) + codename = models.CharField(max_length=100) + def natural_key(self) -> Tuple[str, str, str]: ... + +class GroupManager(models.Manager["Group"]): + def get_by_natural_key(self, name: str) -> Group: ... + +class Group(models.Model): + objects: GroupManager + + name = models.CharField(max_length=150) + permissions = models.ManyToManyField(Permission) + def natural_key(self): ... + +_T = TypeVar("_T", bound=Model) + +class UserManager(BaseUserManager[_T]): + def create_user( + self, username: str, email: Optional[str] = ..., password: Optional[str] = ..., **extra_fields: Any + ) -> _T: ... + def create_superuser( + self, username: str, email: Optional[str], password: Optional[str], **extra_fields: Any + ) -> _T: ... + def with_perm( + self, + perm: Union[str, Permission], + is_active: bool = ..., + include_superusers: bool = ..., + backend: Optional[Union[Type[ModelBackend], str]] = ..., + obj: Optional[Model] = ..., + ): ... + +class PermissionsMixin(models.Model): + is_superuser = models.BooleanField() + groups = models.ManyToManyField(Group) + user_permissions = models.ManyToManyField(Permission) + def get_user_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def get_group_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def get_all_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def has_perm(self, perm: str, obj: Optional[_AnyUser] = ...) -> bool: ... + def has_perms(self, perm_list: Collection[str], obj: Optional[_AnyUser] = ...) -> bool: ... + def has_module_perms(self, app_label: str) -> bool: ... + +class AbstractUser(AbstractBaseUser, PermissionsMixin): # type: ignore + username_validator: UnicodeUsernameValidator = ... + + username = models.CharField(max_length=150) + first_name = models.CharField(max_length=30, blank=True) + last_name = models.CharField(max_length=150, blank=True) + email = models.EmailField(blank=True) + is_staff = models.BooleanField() + is_active = models.BooleanField() + date_joined = models.DateTimeField() + + EMAIL_FIELD: str = ... + USERNAME_FIELD: str = ... + def get_full_name(self) -> str: ... + def get_short_name(self) -> str: ... + def email_user(self, subject: str, message: str, from_email: str = ..., **kwargs: Any) -> None: ... + +class User(AbstractUser): ... + +class AnonymousUser: + id: Any = ... + pk: Any = ... + username: str = ... + is_staff: bool = ... + is_active: bool = ... + is_superuser: bool = ... + def save(self) -> Any: ... + def delete(self) -> Any: ... + def set_password(self, raw_password: str) -> Any: ... + def check_password(self, raw_password: str) -> Any: ... + @property + def groups(self) -> EmptyManager: ... + @property + def user_permissions(self) -> EmptyManager: ... + def get_user_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def get_group_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[Any]: ... + def get_all_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def has_perm(self, perm: str, obj: Optional[_AnyUser] = ...) -> bool: ... + def has_perms(self, perm_list: Collection[str], obj: Optional[_AnyUser] = ...) -> bool: ... + def has_module_perms(self, module: str) -> bool: ... + @property + def is_anonymous(self) -> Literal[True]: ... + @property + def is_authenticated(self) -> Literal[False]: ... + def get_username(self) -> str: ... diff --git a/shared/package-files/9c/9c3b636eb844683bb7f3c7e9e0ee81192a5b8a16661e1ecfa0ecf6861164f908/blob b/shared/package-files/9c/9c3b636eb844683bb7f3c7e9e0ee81192a5b8a16661e1ecfa0ecf6861164f908/blob new file mode 100644 index 0000000000000000000000000000000000000000..948bcc6094d13684a39abd17b9519b2b78ca2813 --- /dev/null +++ b/shared/package-files/9c/9c3b636eb844683bb7f3c7e9e0ee81192a5b8a16661e1ecfa0ecf6861164f908/blob @@ -0,0 +1,80 @@ +import importlib.util +import sys + + +class VendorImporter: + """ + A PEP 302 meta path importer for finding optionally-vendored + or otherwise naturally-installed packages from root_name. + """ + + def __init__(self, root_name, vendored_names=(), vendor_pkg=None): + self.root_name = root_name + self.vendored_names = set(vendored_names) + self.vendor_pkg = vendor_pkg or root_name.replace('extern', '_vendor') + + @property + def search_path(self): + """ + Search first the vendor package then as a natural package. + """ + yield self.vendor_pkg + '.' + yield '' + + def _module_matches_namespace(self, fullname): + """Figure out if the target module is vendored.""" + root, base, target = fullname.partition(self.root_name + '.') + return not root and any(map(target.startswith, self.vendored_names)) + + def load_module(self, fullname): + """ + Iterate over the search path to locate and load fullname. + """ + root, base, target = fullname.partition(self.root_name + '.') + for prefix in self.search_path: + try: + extant = prefix + target + __import__(extant) + mod = sys.modules[extant] + sys.modules[fullname] = mod + return mod + except ImportError: + pass + else: + raise ImportError( + "The '{target}' package is required; " + "normally this is bundled with this package so if you get " + "this warning, consult the packager of your " + "distribution.".format(**locals()) + ) + + def create_module(self, spec): + return self.load_module(spec.name) + + def exec_module(self, module): + pass + + def find_spec(self, fullname, path=None, target=None): + """Return a module spec for vendored names.""" + return ( + importlib.util.spec_from_loader(fullname, self) + if self._module_matches_namespace(fullname) + else None + ) + + def install(self): + """ + Install this importer into sys.meta_path if not already present. + """ + if self not in sys.meta_path: + sys.meta_path.append(self) + + +names = ( + 'packaging', + 'platformdirs', + 'jaraco', + 'importlib_resources', + 'more_itertools', +) +VendorImporter(__name__, names).install() diff --git a/shared/package-files/9c/9c3ce4ae8916bdc98791e1d68c4f2e98f7f15f8951e809d0a2b015ee9a449422/blob b/shared/package-files/9c/9c3ce4ae8916bdc98791e1d68c4f2e98f7f15f8951e809d0a2b015ee9a449422/blob new file mode 100644 index 0000000000000000000000000000000000000000..cd28d519313ed36228040361dfbb2a8dccf77be5 --- /dev/null +++ b/shared/package-files/9c/9c3ce4ae8916bdc98791e1d68c4f2e98f7f15f8951e809d0a2b015ee9a449422/blob @@ -0,0 +1,611 @@ +import numpy as np +import pytest + +from pandas.errors import InvalidIndexError + +from pandas import ( + NA, + Index, + RangeIndex, + Series, + Timestamp, +) +import pandas._testing as tm +from pandas.core.arrays import ( + ArrowExtensionArray, + FloatingArray, +) + + +@pytest.fixture +def index_large(): + # large values used in Index[uint64] tests where no compat needed with Int64/Float64 + large = [2**63, 2**63 + 10, 2**63 + 15, 2**63 + 20, 2**63 + 25] + return Index(large, dtype=np.uint64) + + +class TestGetLoc: + def test_get_loc(self): + index = Index([0, 1, 2]) + assert index.get_loc(1) == 1 + + def test_get_loc_raises_bad_label(self): + index = Index([0, 1, 2]) + with pytest.raises(InvalidIndexError, match=r"\[1, 2\]"): + index.get_loc([1, 2]) + + def test_get_loc_float64(self): + idx = Index([0.0, 1.0, 2.0], dtype=np.float64) + + with pytest.raises(KeyError, match="^'foo'$"): + idx.get_loc("foo") + with pytest.raises(KeyError, match=r"^1\.5$"): + idx.get_loc(1.5) + with pytest.raises(KeyError, match="^True$"): + idx.get_loc(True) + with pytest.raises(KeyError, match="^False$"): + idx.get_loc(False) + + def test_get_loc_na(self): + idx = Index([np.nan, 1, 2], dtype=np.float64) + assert idx.get_loc(1) == 1 + assert idx.get_loc(np.nan) == 0 + + idx = Index([np.nan, 1, np.nan], dtype=np.float64) + assert idx.get_loc(1) == 1 + + # representable by slice [0:2:2] + msg = "'Cannot get left slice bound for non-unique label: nan'" + with pytest.raises(KeyError, match=msg): + idx.slice_locs(np.nan) + # not representable by slice + idx = Index([np.nan, 1, np.nan, np.nan], dtype=np.float64) + assert idx.get_loc(1) == 1 + msg = "'Cannot get left slice bound for non-unique label: nan" + with pytest.raises(KeyError, match=msg): + idx.slice_locs(np.nan) + + def test_get_loc_missing_nan(self): + # GH#8569 + idx = Index([1, 2], dtype=np.float64) + assert idx.get_loc(1) == 0 + with pytest.raises(KeyError, match=r"^3$"): + idx.get_loc(3) + with pytest.raises(KeyError, match="^nan$"): + idx.get_loc(np.nan) + with pytest.raises(InvalidIndexError, match=r"\[nan\]"): + # listlike/non-hashable raises TypeError + idx.get_loc([np.nan]) + + @pytest.mark.parametrize("vals", [[1], [1.0], [Timestamp("2019-12-31")], ["test"]]) + def test_get_loc_float_index_nan_with_method(self, vals): + # GH#39382 + idx = Index(vals) + with pytest.raises(KeyError, match="nan"): + idx.get_loc(np.nan) + + @pytest.mark.parametrize("dtype", ["f8", "i8", "u8"]) + def test_get_loc_numericindex_none_raises(self, dtype): + # case that goes through searchsorted and key is non-comparable to values + arr = np.arange(10**7, dtype=dtype) + idx = Index(arr) + with pytest.raises(KeyError, match="None"): + idx.get_loc(None) + + def test_get_loc_overflows(self): + # unique but non-monotonic goes through IndexEngine.mapping.get_item + idx = Index([0, 2, 1]) + + val = np.iinfo(np.int64).max + 1 + + with pytest.raises(KeyError, match=str(val)): + idx.get_loc(val) + with pytest.raises(KeyError, match=str(val)): + idx._engine.get_loc(val) + + +class TestGetIndexer: + def test_get_indexer(self): + index1 = Index([1, 2, 3, 4, 5]) + index2 = Index([2, 4, 6]) + + r1 = index1.get_indexer(index2) + e1 = np.array([1, 3, -1], dtype=np.intp) + tm.assert_almost_equal(r1, e1) + + @pytest.mark.parametrize("reverse", [True, False]) + @pytest.mark.parametrize( + "expected,method", + [ + (np.array([-1, 0, 0, 1, 1], dtype=np.intp), "pad"), + (np.array([-1, 0, 0, 1, 1], dtype=np.intp), "ffill"), + (np.array([0, 0, 1, 1, 2], dtype=np.intp), "backfill"), + (np.array([0, 0, 1, 1, 2], dtype=np.intp), "bfill"), + ], + ) + def test_get_indexer_methods(self, reverse, expected, method): + index1 = Index([1, 2, 3, 4, 5]) + index2 = Index([2, 4, 6]) + + if reverse: + index1 = index1[::-1] + expected = expected[::-1] + + result = index2.get_indexer(index1, method=method) + tm.assert_almost_equal(result, expected) + + def test_get_indexer_invalid(self): + # GH10411 + index = Index(np.arange(10)) + + with pytest.raises(ValueError, match="tolerance argument"): + index.get_indexer([1, 0], tolerance=1) + + with pytest.raises(ValueError, match="limit argument"): + index.get_indexer([1, 0], limit=1) + + @pytest.mark.parametrize( + "method, tolerance, indexer, expected", + [ + ("pad", None, [0, 5, 9], [0, 5, 9]), + ("backfill", None, [0, 5, 9], [0, 5, 9]), + ("nearest", None, [0, 5, 9], [0, 5, 9]), + ("pad", 0, [0, 5, 9], [0, 5, 9]), + ("backfill", 0, [0, 5, 9], [0, 5, 9]), + ("nearest", 0, [0, 5, 9], [0, 5, 9]), + ("pad", None, [0.2, 1.8, 8.5], [0, 1, 8]), + ("backfill", None, [0.2, 1.8, 8.5], [1, 2, 9]), + ("nearest", None, [0.2, 1.8, 8.5], [0, 2, 9]), + ("pad", 1, [0.2, 1.8, 8.5], [0, 1, 8]), + ("backfill", 1, [0.2, 1.8, 8.5], [1, 2, 9]), + ("nearest", 1, [0.2, 1.8, 8.5], [0, 2, 9]), + ("pad", 0.2, [0.2, 1.8, 8.5], [0, -1, -1]), + ("backfill", 0.2, [0.2, 1.8, 8.5], [-1, 2, -1]), + ("nearest", 0.2, [0.2, 1.8, 8.5], [0, 2, -1]), + ], + ) + def test_get_indexer_nearest(self, method, tolerance, indexer, expected): + index = Index(np.arange(10)) + + actual = index.get_indexer(indexer, method=method, tolerance=tolerance) + tm.assert_numpy_array_equal(actual, np.array(expected, dtype=np.intp)) + + @pytest.mark.parametrize("listtype", [list, tuple, Series, np.array]) + @pytest.mark.parametrize( + "tolerance, expected", + list( + zip( + [[0.3, 0.3, 0.1], [0.2, 0.1, 0.1], [0.1, 0.5, 0.5]], + [[0, 2, -1], [0, -1, -1], [-1, 2, 9]], + ) + ), + ) + def test_get_indexer_nearest_listlike_tolerance( + self, tolerance, expected, listtype + ): + index = Index(np.arange(10)) + + actual = index.get_indexer( + [0.2, 1.8, 8.5], method="nearest", tolerance=listtype(tolerance) + ) + tm.assert_numpy_array_equal(actual, np.array(expected, dtype=np.intp)) + + def test_get_indexer_nearest_error(self): + index = Index(np.arange(10)) + with pytest.raises(ValueError, match="limit argument"): + index.get_indexer([1, 0], method="nearest", limit=1) + + with pytest.raises(ValueError, match="tolerance size must match"): + index.get_indexer([1, 0], method="nearest", tolerance=[1, 2, 3]) + + @pytest.mark.parametrize( + "method,expected", + [("pad", [8, 7, 0]), ("backfill", [9, 8, 1]), ("nearest", [9, 7, 0])], + ) + def test_get_indexer_nearest_decreasing(self, method, expected): + index = Index(np.arange(10))[::-1] + + actual = index.get_indexer([0, 5, 9], method=method) + tm.assert_numpy_array_equal(actual, np.array([9, 4, 0], dtype=np.intp)) + + actual = index.get_indexer([0.2, 1.8, 8.5], method=method) + tm.assert_numpy_array_equal(actual, np.array(expected, dtype=np.intp)) + + @pytest.mark.parametrize("idx_dtype", ["int64", "float64", "uint64", "range"]) + @pytest.mark.parametrize("method", ["get_indexer", "get_indexer_non_unique"]) + def test_get_indexer_numeric_index_boolean_target(self, method, idx_dtype): + # GH 16877 + + if idx_dtype == "range": + numeric_index = RangeIndex(4) + else: + numeric_index = Index(np.arange(4, dtype=idx_dtype)) + + other = Index([True, False, True]) + + result = getattr(numeric_index, method)(other) + expected = np.array([-1, -1, -1], dtype=np.intp) + if method == "get_indexer": + tm.assert_numpy_array_equal(result, expected) + else: + missing = np.arange(3, dtype=np.intp) + tm.assert_numpy_array_equal(result[0], expected) + tm.assert_numpy_array_equal(result[1], missing) + + @pytest.mark.parametrize("method", ["pad", "backfill", "nearest"]) + def test_get_indexer_with_method_numeric_vs_bool(self, method): + left = Index([1, 2, 3]) + right = Index([True, False]) + + with pytest.raises(TypeError, match="Cannot compare"): + left.get_indexer(right, method=method) + + with pytest.raises(TypeError, match="Cannot compare"): + right.get_indexer(left, method=method) + + def test_get_indexer_numeric_vs_bool(self): + left = Index([1, 2, 3]) + right = Index([True, False]) + + res = left.get_indexer(right) + expected = -1 * np.ones(len(right), dtype=np.intp) + tm.assert_numpy_array_equal(res, expected) + + res = right.get_indexer(left) + expected = -1 * np.ones(len(left), dtype=np.intp) + tm.assert_numpy_array_equal(res, expected) + + res = left.get_indexer_non_unique(right)[0] + expected = -1 * np.ones(len(right), dtype=np.intp) + tm.assert_numpy_array_equal(res, expected) + + res = right.get_indexer_non_unique(left)[0] + expected = -1 * np.ones(len(left), dtype=np.intp) + tm.assert_numpy_array_equal(res, expected) + + def test_get_indexer_float64(self): + idx = Index([0.0, 1.0, 2.0], dtype=np.float64) + tm.assert_numpy_array_equal( + idx.get_indexer(idx), np.array([0, 1, 2], dtype=np.intp) + ) + + target = [-0.1, 0.5, 1.1] + tm.assert_numpy_array_equal( + idx.get_indexer(target, "pad"), np.array([-1, 0, 1], dtype=np.intp) + ) + tm.assert_numpy_array_equal( + idx.get_indexer(target, "backfill"), np.array([0, 1, 2], dtype=np.intp) + ) + tm.assert_numpy_array_equal( + idx.get_indexer(target, "nearest"), np.array([0, 1, 1], dtype=np.intp) + ) + + def test_get_indexer_nan(self): + # GH#7820 + result = Index([1, 2, np.nan], dtype=np.float64).get_indexer([np.nan]) + expected = np.array([2], dtype=np.intp) + tm.assert_numpy_array_equal(result, expected) + + def test_get_indexer_int64(self): + index = Index(range(0, 20, 2), dtype=np.int64) + target = Index(np.arange(10), dtype=np.int64) + indexer = index.get_indexer(target) + expected = np.array([0, -1, 1, -1, 2, -1, 3, -1, 4, -1], dtype=np.intp) + tm.assert_numpy_array_equal(indexer, expected) + + target = Index(np.arange(10), dtype=np.int64) + indexer = index.get_indexer(target, method="pad") + expected = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 4], dtype=np.intp) + tm.assert_numpy_array_equal(indexer, expected) + + target = Index(np.arange(10), dtype=np.int64) + indexer = index.get_indexer(target, method="backfill") + expected = np.array([0, 1, 1, 2, 2, 3, 3, 4, 4, 5], dtype=np.intp) + tm.assert_numpy_array_equal(indexer, expected) + + def test_get_indexer_uint64(self, index_large): + target = Index(np.arange(10).astype("uint64") * 5 + 2**63) + indexer = index_large.get_indexer(target) + expected = np.array([0, -1, 1, 2, 3, 4, -1, -1, -1, -1], dtype=np.intp) + tm.assert_numpy_array_equal(indexer, expected) + + target = Index(np.arange(10).astype("uint64") * 5 + 2**63) + indexer = index_large.get_indexer(target, method="pad") + expected = np.array([0, 0, 1, 2, 3, 4, 4, 4, 4, 4], dtype=np.intp) + tm.assert_numpy_array_equal(indexer, expected) + + target = Index(np.arange(10).astype("uint64") * 5 + 2**63) + indexer = index_large.get_indexer(target, method="backfill") + expected = np.array([0, 1, 1, 2, 3, 4, -1, -1, -1, -1], dtype=np.intp) + tm.assert_numpy_array_equal(indexer, expected) + + @pytest.mark.parametrize("val, val2", [(4, 5), (4, 4), (4, NA), (NA, NA)]) + def test_get_loc_masked(self, val, val2, any_numeric_ea_and_arrow_dtype): + # GH#39133 + idx = Index([1, 2, 3, val, val2], dtype=any_numeric_ea_and_arrow_dtype) + result = idx.get_loc(2) + assert result == 1 + + with pytest.raises(KeyError, match="9"): + idx.get_loc(9) + + def test_get_loc_masked_na(self, any_numeric_ea_and_arrow_dtype): + # GH#39133 + idx = Index([1, 2, NA], dtype=any_numeric_ea_and_arrow_dtype) + result = idx.get_loc(NA) + assert result == 2 + + idx = Index([1, 2, NA, NA], dtype=any_numeric_ea_and_arrow_dtype) + result = idx.get_loc(NA) + tm.assert_numpy_array_equal(result, np.array([False, False, True, True])) + + idx = Index([1, 2, 3], dtype=any_numeric_ea_and_arrow_dtype) + with pytest.raises(KeyError, match="NA"): + idx.get_loc(NA) + + def test_get_loc_masked_na_and_nan(self): + # GH#39133 + idx = Index( + FloatingArray( + np.array([1, 2, 1, np.nan]), mask=np.array([False, False, True, False]) + ) + ) + result = idx.get_loc(NA) + assert result == 2 + result = idx.get_loc(np.nan) + assert result == 3 + + idx = Index( + FloatingArray(np.array([1, 2, 1.0]), mask=np.array([False, False, True])) + ) + result = idx.get_loc(NA) + assert result == 2 + with pytest.raises(KeyError, match="nan"): + idx.get_loc(np.nan) + + idx = Index( + FloatingArray( + np.array([1, 2, np.nan]), mask=np.array([False, False, False]) + ) + ) + result = idx.get_loc(np.nan) + assert result == 2 + with pytest.raises(KeyError, match="NA"): + idx.get_loc(NA) + + @pytest.mark.parametrize("val", [4, 2]) + def test_get_indexer_masked_na(self, any_numeric_ea_and_arrow_dtype, val): + # GH#39133 + idx = Index([1, 2, NA, 3, val], dtype=any_numeric_ea_and_arrow_dtype) + result = idx.get_indexer_for([1, NA, 5]) + expected = np.array([0, 2, -1]) + tm.assert_numpy_array_equal(result, expected, check_dtype=False) + + @pytest.mark.parametrize("dtype", ["boolean", "bool[pyarrow]"]) + def test_get_indexer_masked_na_boolean(self, dtype): + # GH#39133 + if dtype == "bool[pyarrow]": + pytest.importorskip("pyarrow") + idx = Index([True, False, NA], dtype=dtype) + result = idx.get_loc(False) + assert result == 1 + result = idx.get_loc(NA) + assert result == 2 + + def test_get_indexer_arrow_dictionary_target(self): + pa = pytest.importorskip("pyarrow") + target = Index( + ArrowExtensionArray( + pa.array([1, 2], type=pa.dictionary(pa.int8(), pa.int8())) + ) + ) + idx = Index([1]) + + result = idx.get_indexer(target) + expected = np.array([0, -1], dtype=np.int64) + tm.assert_numpy_array_equal(result, expected) + + result_1, result_2 = idx.get_indexer_non_unique(target) + expected_1, expected_2 = np.array([0, -1], dtype=np.int64), np.array( + [1], dtype=np.int64 + ) + tm.assert_numpy_array_equal(result_1, expected_1) + tm.assert_numpy_array_equal(result_2, expected_2) + + +class TestWhere: + @pytest.mark.parametrize( + "index", + [ + Index(np.arange(5, dtype="float64")), + Index(range(0, 20, 2), dtype=np.int64), + Index(np.arange(5, dtype="uint64")), + ], + ) + def test_where(self, listlike_box, index): + cond = [True] * len(index) + expected = index + result = index.where(listlike_box(cond)) + + cond = [False] + [True] * (len(index) - 1) + expected = Index([index._na_value] + index[1:].tolist(), dtype=np.float64) + result = index.where(listlike_box(cond)) + tm.assert_index_equal(result, expected) + + def test_where_uint64(self): + idx = Index([0, 6, 2], dtype=np.uint64) + mask = np.array([False, True, False]) + other = np.array([1], dtype=np.int64) + + expected = Index([1, 6, 1], dtype=np.uint64) + + result = idx.where(mask, other) + tm.assert_index_equal(result, expected) + + result = idx.putmask(~mask, other) + tm.assert_index_equal(result, expected) + + def test_where_infers_type_instead_of_trying_to_convert_string_to_float(self): + # GH 32413 + index = Index([1, np.nan]) + cond = index.notna() + other = Index(["a", "b"], dtype="string") + + expected = Index([1.0, "b"]) + result = index.where(cond, other) + + tm.assert_index_equal(result, expected) + + +class TestTake: + @pytest.mark.parametrize("idx_dtype", [np.float64, np.int64, np.uint64]) + def test_take_preserve_name(self, idx_dtype): + index = Index([1, 2, 3, 4], dtype=idx_dtype, name="foo") + taken = index.take([3, 0, 1]) + assert index.name == taken.name + + def test_take_fill_value_float64(self): + # GH 12631 + idx = Index([1.0, 2.0, 3.0], name="xxx", dtype=np.float64) + result = idx.take(np.array([1, 0, -1])) + expected = Index([2.0, 1.0, 3.0], dtype=np.float64, name="xxx") + tm.assert_index_equal(result, expected) + + # fill_value + result = idx.take(np.array([1, 0, -1]), fill_value=True) + expected = Index([2.0, 1.0, np.nan], dtype=np.float64, name="xxx") + tm.assert_index_equal(result, expected) + + # allow_fill=False + result = idx.take(np.array([1, 0, -1]), allow_fill=False, fill_value=True) + expected = Index([2.0, 1.0, 3.0], dtype=np.float64, name="xxx") + tm.assert_index_equal(result, expected) + + msg = ( + "When allow_fill=True and fill_value is not None, " + "all indices must be >= -1" + ) + with pytest.raises(ValueError, match=msg): + idx.take(np.array([1, 0, -2]), fill_value=True) + with pytest.raises(ValueError, match=msg): + idx.take(np.array([1, 0, -5]), fill_value=True) + + msg = "index -5 is out of bounds for (axis 0 with )?size 3" + with pytest.raises(IndexError, match=msg): + idx.take(np.array([1, -5])) + + @pytest.mark.parametrize("dtype", [np.int64, np.uint64]) + def test_take_fill_value_ints(self, dtype): + # see gh-12631 + idx = Index([1, 2, 3], dtype=dtype, name="xxx") + result = idx.take(np.array([1, 0, -1])) + expected = Index([2, 1, 3], dtype=dtype, name="xxx") + tm.assert_index_equal(result, expected) + + name = type(idx).__name__ + msg = f"Unable to fill values because {name} cannot contain NA" + + # fill_value=True + with pytest.raises(ValueError, match=msg): + idx.take(np.array([1, 0, -1]), fill_value=True) + + # allow_fill=False + result = idx.take(np.array([1, 0, -1]), allow_fill=False, fill_value=True) + expected = Index([2, 1, 3], dtype=dtype, name="xxx") + tm.assert_index_equal(result, expected) + + with pytest.raises(ValueError, match=msg): + idx.take(np.array([1, 0, -2]), fill_value=True) + with pytest.raises(ValueError, match=msg): + idx.take(np.array([1, 0, -5]), fill_value=True) + + msg = "index -5 is out of bounds for (axis 0 with )?size 3" + with pytest.raises(IndexError, match=msg): + idx.take(np.array([1, -5])) + + +class TestContains: + @pytest.mark.parametrize("dtype", [np.float64, np.int64, np.uint64]) + def test_contains_none(self, dtype): + # GH#35788 should return False, not raise TypeError + index = Index([0, 1, 2, 3, 4], dtype=dtype) + assert None not in index + + def test_contains_float64_nans(self): + index = Index([1.0, 2.0, np.nan], dtype=np.float64) + assert np.nan in index + + def test_contains_float64_not_nans(self): + index = Index([1.0, 2.0, np.nan], dtype=np.float64) + assert 1.0 in index + + +class TestSliceLocs: + @pytest.mark.parametrize("dtype", [int, float]) + def test_slice_locs(self, dtype): + index = Index(np.array([0, 1, 2, 5, 6, 7, 9, 10], dtype=dtype)) + n = len(index) + + assert index.slice_locs(start=2) == (2, n) + assert index.slice_locs(start=3) == (3, n) + assert index.slice_locs(3, 8) == (3, 6) + assert index.slice_locs(5, 10) == (3, n) + assert index.slice_locs(end=8) == (0, 6) + assert index.slice_locs(end=9) == (0, 7) + + # reversed + index2 = index[::-1] + assert index2.slice_locs(8, 2) == (2, 6) + assert index2.slice_locs(7, 3) == (2, 5) + + @pytest.mark.parametrize("dtype", [int, float]) + def test_slice_locs_float_locs(self, dtype): + index = Index(np.array([0, 1, 2, 5, 6, 7, 9, 10], dtype=dtype)) + n = len(index) + assert index.slice_locs(5.0, 10.0) == (3, n) + assert index.slice_locs(4.5, 10.5) == (3, 8) + + index2 = index[::-1] + assert index2.slice_locs(8.5, 1.5) == (2, 6) + assert index2.slice_locs(10.5, -1) == (0, n) + + @pytest.mark.parametrize("dtype", [int, float]) + def test_slice_locs_dup_numeric(self, dtype): + index = Index(np.array([10, 12, 12, 14], dtype=dtype)) + assert index.slice_locs(12, 12) == (1, 3) + assert index.slice_locs(11, 13) == (1, 3) + + index2 = index[::-1] + assert index2.slice_locs(12, 12) == (1, 3) + assert index2.slice_locs(13, 11) == (1, 3) + + def test_slice_locs_na(self): + index = Index([np.nan, 1, 2]) + assert index.slice_locs(1) == (1, 3) + assert index.slice_locs(np.nan) == (0, 3) + + index = Index([0, np.nan, np.nan, 1, 2]) + assert index.slice_locs(np.nan) == (1, 5) + + def test_slice_locs_na_raises(self): + index = Index([np.nan, 1, 2]) + with pytest.raises(KeyError, match=""): + index.slice_locs(start=1.5) + + with pytest.raises(KeyError, match=""): + index.slice_locs(end=1.5) + + +class TestGetSliceBounds: + @pytest.mark.parametrize("side, expected", [("left", 4), ("right", 5)]) + def test_get_slice_bounds_within(self, side, expected): + index = Index(range(6)) + result = index.get_slice_bound(4, side=side) + assert result == expected + + @pytest.mark.parametrize("side", ["left", "right"]) + @pytest.mark.parametrize("bound, expected", [(-1, 0), (10, 6)]) + def test_get_slice_bounds_outside(self, side, expected, bound): + index = Index(range(6)) + result = index.get_slice_bound(bound, side=side) + assert result == expected diff --git a/shared/package-files/9c/9c40292e1310a9df0aba77da34a9779fcbdd7a20863f12ab48bd496b49cd0049/blob b/shared/package-files/9c/9c40292e1310a9df0aba77da34a9779fcbdd7a20863f12ab48bd496b49cd0049/blob new file mode 100644 index 0000000000000000000000000000000000000000..66076509a1202e7a1b4d8a481f64621a4bfbbf3e --- /dev/null +++ b/shared/package-files/9c/9c40292e1310a9df0aba77da34a9779fcbdd7a20863f12ab48bd496b49cd0049/blob @@ -0,0 +1,154 @@ +# +# We use a background thread for sharing fds on Unix, and for sharing sockets on +# Windows. +# +# A client which wants to pickle a resource registers it with the resource +# sharer and gets an identifier in return. The unpickling process will connect +# to the resource sharer, sends the identifier and its pid, and then receives +# the resource. +# + +import os +import signal +import socket +import sys +import threading + +from . import process +from .context import reduction +from . import util + +__all__ = ['stop'] + + +if sys.platform == 'win32': + __all__ += ['DupSocket'] + + class DupSocket(object): + '''Picklable wrapper for a socket.''' + def __init__(self, sock): + new_sock = sock.dup() + def send(conn, pid): + share = new_sock.share(pid) + conn.send_bytes(share) + self._id = _resource_sharer.register(send, new_sock.close) + + def detach(self): + '''Get the socket. This should only be called once.''' + with _resource_sharer.get_connection(self._id) as conn: + share = conn.recv_bytes() + return socket.fromshare(share) + +else: + __all__ += ['DupFd'] + + class DupFd(object): + '''Wrapper for fd which can be used at any time.''' + def __init__(self, fd): + new_fd = os.dup(fd) + def send(conn, pid): + reduction.send_handle(conn, new_fd, pid) + def close(): + os.close(new_fd) + self._id = _resource_sharer.register(send, close) + + def detach(self): + '''Get the fd. This should only be called once.''' + with _resource_sharer.get_connection(self._id) as conn: + return reduction.recv_handle(conn) + + +class _ResourceSharer(object): + '''Manager for resources using background thread.''' + def __init__(self): + self._key = 0 + self._cache = {} + self._lock = threading.Lock() + self._listener = None + self._address = None + self._thread = None + util.register_after_fork(self, _ResourceSharer._afterfork) + + def register(self, send, close): + '''Register resource, returning an identifier.''' + with self._lock: + if self._address is None: + self._start() + self._key += 1 + self._cache[self._key] = (send, close) + return (self._address, self._key) + + @staticmethod + def get_connection(ident): + '''Return connection from which to receive identified resource.''' + from .connection import Client + address, key = ident + c = Client(address, authkey=process.current_process().authkey) + c.send((key, os.getpid())) + return c + + def stop(self, timeout=None): + '''Stop the background thread and clear registered resources.''' + from .connection import Client + with self._lock: + if self._address is not None: + c = Client(self._address, + authkey=process.current_process().authkey) + c.send(None) + c.close() + self._thread.join(timeout) + if self._thread.is_alive(): + util.sub_warning('_ResourceSharer thread did ' + 'not stop when asked') + self._listener.close() + self._thread = None + self._address = None + self._listener = None + for key, (send, close) in self._cache.items(): + close() + self._cache.clear() + + def _afterfork(self): + for key, (send, close) in self._cache.items(): + close() + self._cache.clear() + self._lock._at_fork_reinit() + if self._listener is not None: + self._listener.close() + self._listener = None + self._address = None + self._thread = None + + def _start(self): + from .connection import Listener + assert self._listener is None, "Already have Listener" + util.debug('starting listener and thread for sending handles') + self._listener = Listener(authkey=process.current_process().authkey) + self._address = self._listener.address + t = threading.Thread(target=self._serve) + t.daemon = True + t.start() + self._thread = t + + def _serve(self): + if hasattr(signal, 'pthread_sigmask'): + signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals()) + while 1: + try: + with self._listener.accept() as conn: + msg = conn.recv() + if msg is None: + break + key, destination_pid = msg + send, close = self._cache.pop(key) + try: + send(conn, destination_pid) + finally: + close() + except: + if not util.is_exiting(): + sys.excepthook(*sys.exc_info()) + + +_resource_sharer = _ResourceSharer() +stop = _resource_sharer.stop diff --git a/shared/package-files/9c/9c41d90e04675de415c4a7958df7f1af85d7901a3e426733b3e97f009bd72666/blob b/shared/package-files/9c/9c41d90e04675de415c4a7958df7f1af85d7901a3e426733b3e97f009bd72666/blob new file mode 100644 index 0000000000000000000000000000000000000000..ceb9c2c5004cc337de0e7069e325fd01263842b1 --- /dev/null +++ b/shared/package-files/9c/9c41d90e04675de415c4a7958df7f1af85d7901a3e426733b3e97f009bd72666/blob @@ -0,0 +1,83 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API special_laguerre_polynomial_l { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_laguerre_polynomial_l") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_laguerre_polynomial_l(Tensor x, Tensor n) -> Tensor") + static at::Tensor call(const at::Tensor & x, const at::Tensor & n); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Tensor & n); +}; + +struct TORCH_API special_laguerre_polynomial_l_x_scalar { + using schema = at::Tensor (const at::Scalar &, const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_laguerre_polynomial_l") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "x_scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_laguerre_polynomial_l.x_scalar(Scalar x, Tensor n) -> Tensor") + static at::Tensor call(const at::Scalar & x, const at::Tensor & n); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & x, const at::Tensor & n); +}; + +struct TORCH_API special_laguerre_polynomial_l_n_scalar { + using schema = at::Tensor (const at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_laguerre_polynomial_l") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "n_scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_laguerre_polynomial_l.n_scalar(Tensor x, Scalar n) -> Tensor") + static at::Tensor call(const at::Tensor & x, const at::Scalar & n); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Scalar & n); +}; + +struct TORCH_API special_laguerre_polynomial_l_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_laguerre_polynomial_l") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_laguerre_polynomial_l.out(Tensor x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & x, const at::Tensor & n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Tensor & n, at::Tensor & out); +}; + +struct TORCH_API special_laguerre_polynomial_l_x_scalar_out { + using schema = at::Tensor & (const at::Scalar &, const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_laguerre_polynomial_l") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "x_scalar_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_laguerre_polynomial_l.x_scalar_out(Scalar x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Scalar & x, const at::Tensor & n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & x, const at::Tensor & n, at::Tensor & out); +}; + +struct TORCH_API special_laguerre_polynomial_l_n_scalar_out { + using schema = at::Tensor & (const at::Tensor &, const at::Scalar &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::special_laguerre_polynomial_l") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "n_scalar_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "special_laguerre_polynomial_l.n_scalar_out(Tensor x, Scalar n, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & x, const at::Scalar & n, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & x, const at::Scalar & n, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9c/9c441c88655b6ddf4111678399af5eb12794a82f616bba2fd0632b83c13e3c66/blob b/shared/package-files/9c/9c441c88655b6ddf4111678399af5eb12794a82f616bba2fd0632b83c13e3c66/blob new file mode 100644 index 0000000000000000000000000000000000000000..55bfff13ada41e1f54571c11165d8f89d673ac0c Binary files /dev/null and b/shared/package-files/9c/9c441c88655b6ddf4111678399af5eb12794a82f616bba2fd0632b83c13e3c66/blob differ diff --git a/shared/package-files/9c/9c46d9915fd27739f7067926494dd71fd3a72a20655a102e2dacb6142d2719bf/blob b/shared/package-files/9c/9c46d9915fd27739f7067926494dd71fd3a72a20655a102e2dacb6142d2719bf/blob new file mode 100644 index 0000000000000000000000000000000000000000..ba518e0ca05e111a9603807133598a120c4b93a1 Binary files /dev/null and b/shared/package-files/9c/9c46d9915fd27739f7067926494dd71fd3a72a20655a102e2dacb6142d2719bf/blob differ diff --git a/shared/package-files/9c/9c48815c3b5e7cf5f822561b9a7fe6c42ec473d41a3d9f9dd2720ed416ec1a1d/blob b/shared/package-files/9c/9c48815c3b5e7cf5f822561b9a7fe6c42ec473d41a3d9f9dd2720ed416ec1a1d/blob new file mode 100644 index 0000000000000000000000000000000000000000..3aeb09b6397c02e057c208bc8d1ac1add9271e31 --- /dev/null +++ b/shared/package-files/9c/9c48815c3b5e7cf5f822561b9a7fe6c42ec473d41a3d9f9dd2720ed416ec1a1d/blob @@ -0,0 +1,18 @@ +#pragma once +#include + +#include + +namespace c10 { + +/** + * quint8 is for unsigned 8 bit quantized Tensors + */ +struct alignas(1) quint8 { + using underlying = uint8_t; + uint8_t val_; + quint8() = default; + C10_HOST_DEVICE explicit quint8(uint8_t val) : val_(val) {} +}; + +} // namespace c10 diff --git a/shared/package-files/9c/9c498c2e2b4aa12006ee00411102d6ba6a2037e292dc305938064959c4839c5c/blob b/shared/package-files/9c/9c498c2e2b4aa12006ee00411102d6ba6a2037e292dc305938064959c4839c5c/blob new file mode 100644 index 0000000000000000000000000000000000000000..aaa83d2eb241274231130b6243ca2c970b5664e0 --- /dev/null +++ b/shared/package-files/9c/9c498c2e2b4aa12006ee00411102d6ba6a2037e292dc305938064959c4839c5c/blob @@ -0,0 +1,22 @@ +! Check that parameters are correct intercepted. +! Constants with comma separations are commonly +! used, for instance Pi = 3._dp +subroutine foo_int(x) + implicit none + integer, parameter :: ii = selected_int_kind(9) + integer(ii), intent(inout) :: x + dimension x(3) + integer(ii), parameter :: three = 3_ii + x(1) = x(1) + x(2) + x(3) * three + return +end subroutine + +subroutine foo_long(x) + implicit none + integer, parameter :: ii = selected_int_kind(18) + integer(ii), intent(inout) :: x + dimension x(3) + integer(ii), parameter :: three = 3_ii + x(1) = x(1) + x(2) + x(3) * three + return +end subroutine diff --git a/shared/package-files/9c/9c532a04e65e6a398573d0183b7c4aa305a6758ef72aa742c14b137a94984425/blob b/shared/package-files/9c/9c532a04e65e6a398573d0183b7c4aa305a6758ef72aa742c14b137a94984425/blob new file mode 100644 index 0000000000000000000000000000000000000000..2907aab6621cae3b687960d39315cd5947c82dd6 --- /dev/null +++ b/shared/package-files/9c/9c532a04e65e6a398573d0183b7c4aa305a6758ef72aa742c14b137a94984425/blob @@ -0,0 +1,160 @@ +""" +Tests of save / load / remove_data state space functionality. +""" +from pathlib import Path +import pickle +import tempfile + +from numpy.testing import assert_allclose +import pytest + +from statsmodels import datasets +from statsmodels.tsa.statespace import ( + dynamic_factor, + sarimax, + structural, + varmax, +) + +current_path = Path(__file__).resolve().parent +macrodata = datasets.macrodata.load_pandas().data + + +def temp_filename(): + _, filename = tempfile.mkstemp() + return filename + + +def test_sarimax(): + mod = sarimax.SARIMAX(macrodata["realgdp"].values, order=(4, 1, 0)) + res = mod.smooth(mod.start_params) + res.summary() + file_name = temp_filename() + res.save(file_name) + res2 = sarimax.SARIMAXResults.load(file_name) + assert_allclose(res.params, res2.params) + assert_allclose(res.bse, res2.bse) + assert_allclose(res.llf, res2.llf) + + +# GH7527 +@pytest.mark.parametrize("order", [(4, 1, 0), (0, 1, 4), (0, 2, 0)]) +def test_sarimax_save_remove_data(order): + mod = sarimax.SARIMAX(macrodata["realgdp"].values, order=order) + res = mod.smooth(mod.start_params) + res.summary() + file_name = temp_filename() + res.save(file_name, remove_data=True) + res2 = sarimax.SARIMAXResults.load(file_name) + assert_allclose(res.params, res2.params) + assert_allclose(res.bse, res2.bse) + assert_allclose(res.llf, res2.llf) + + +def test_sarimax_pickle(): + mod = sarimax.SARIMAX(macrodata["realgdp"].values, order=(4, 1, 0)) + pkl_mod = pickle.loads(pickle.dumps(mod)) + + res = mod.smooth(mod.start_params) + pkl_res = pkl_mod.smooth(mod.start_params) + + assert_allclose(res.params, pkl_res.params) + assert_allclose(res.bse, pkl_res.bse) + assert_allclose(res.llf, pkl_res.llf) + + +def test_structural(): + mod = structural.UnobservedComponents(macrodata["realgdp"].values, "llevel") + res = mod.smooth(mod.start_params) + res.summary() + file_name = temp_filename() + res.save(file_name) + res2 = structural.UnobservedComponentsResults.load(file_name) + assert_allclose(res.params, res2.params) + assert_allclose(res.bse, res2.bse) + assert_allclose(res.llf, res2.llf) + + +def test_structural_pickle(): + mod = structural.UnobservedComponents(macrodata["realgdp"].values, "llevel") + pkl_mod = pickle.loads(pickle.dumps(mod)) + + res = mod.smooth(mod.start_params) + pkl_res = pkl_mod.smooth(pkl_mod.start_params) + + assert_allclose(res.params, pkl_res.params) + assert_allclose(res.bse, pkl_res.bse) + assert_allclose(res.llf, pkl_res.llf) + + +def test_dynamic_factor(): + mod = dynamic_factor.DynamicFactor( + macrodata[["realgdp", "realcons"]].diff().iloc[1:].values, + k_factors=1, + factor_order=1, + ) + res = mod.smooth(mod.start_params) + res.summary() + file_name = temp_filename() + res.save(file_name) + res2 = dynamic_factor.DynamicFactorResults.load(file_name) + assert_allclose(res.params, res2.params) + assert_allclose(res.bse, res2.bse) + assert_allclose(res.llf, res2.llf) + + +def test_dynamic_factor_pickle(): + mod = varmax.VARMAX( + macrodata[["realgdp", "realcons"]].diff().iloc[1:].values, order=(1, 0) + ) + pkl_mod = pickle.loads(pickle.dumps(mod)) + + res = mod.smooth(mod.start_params) + pkl_res = pkl_mod.smooth(mod.start_params) + + assert_allclose(res.params, pkl_res.params) + assert_allclose(res.bse, pkl_res.bse) + assert_allclose(res.llf, pkl_res.llf) + + res.summary() + file_name = temp_filename() + res.save(file_name) + res2 = varmax.VARMAXResults.load(file_name) + assert_allclose(res.params, res2.params) + assert_allclose(res.bse, res2.bse) + assert_allclose(res.llf, res2.llf) + + +def test_varmax(): + mod = varmax.VARMAX( + macrodata[["realgdp", "realcons"]].diff().iloc[1:].values, order=(1, 0) + ) + res = mod.smooth(mod.start_params) + res.summary() + file_name = temp_filename() + res.save(file_name) + res2 = varmax.VARMAXResults.load(file_name) + assert_allclose(res.params, res2.params) + assert_allclose(res.bse, res2.bse) + assert_allclose(res.llf, res2.llf) + + +def test_varmax_pickle(): + mod = varmax.VARMAX( + macrodata[["realgdp", "realcons"]].diff().iloc[1:].values, order=(1, 0) + ) + res = mod.smooth(mod.start_params) + + res.summary() + file_name = temp_filename() + res.save(file_name) + res2 = varmax.VARMAXResults.load(file_name) + assert_allclose(res.params, res2.params) + assert_allclose(res.bse, res2.bse) + assert_allclose(res.llf, res2.llf) + + +def test_existing_pickle(): + pkl_file = Path(current_path).joinpath("results", "sm-0.9-sarimax.pkl") + loaded = sarimax.SARIMAXResults.load(pkl_file) + assert isinstance(loaded, sarimax.SARIMAXResultsWrapper) diff --git a/shared/package-files/9c/9c56c7ddd39fe527cda1a4f2370922bb6ab7651f3688f615afe2df5f3506cd88/blob b/shared/package-files/9c/9c56c7ddd39fe527cda1a4f2370922bb6ab7651f3688f615afe2df5f3506cd88/blob new file mode 100644 index 0000000000000000000000000000000000000000..c5cc11c617b218d73692fec4fd83b28eda84ea4e --- /dev/null +++ b/shared/package-files/9c/9c56c7ddd39fe527cda1a4f2370922bb6ab7651f3688f615afe2df5f3506cd88/blob @@ -0,0 +1,10 @@ +from typing import Any, Optional + +class User: + type: Any + id: Any + display_name: Any + def __init__(self, parent: Optional[Any] = ..., id: str = ..., display_name: str = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self, element_name: str = ...): ... diff --git a/shared/package-files/9c/9c57901c643d97e4765ff435b2730564fe0a434337e55e3c3ff8fd91d6a15b84/blob b/shared/package-files/9c/9c57901c643d97e4765ff435b2730564fe0a434337e55e3c3ff8fd91d6a15b84/blob new file mode 100644 index 0000000000000000000000000000000000000000..a800e765db38490b89b019cee3b3f88cab30d663 --- /dev/null +++ b/shared/package-files/9c/9c57901c643d97e4765ff435b2730564fe0a434337e55e3c3ff8fd91d6a15b84/blob @@ -0,0 +1,426 @@ +from sympy.codegen import Assignment +from sympy.codegen.ast import none +from sympy.codegen.cfunctions import expm1, log1p +from sympy.codegen.scipy_nodes import cosm1 +from sympy.codegen.matrix_nodes import MatrixSolve +from sympy.core import Expr, Mod, symbols, Eq, Le, Gt, zoo, oo, Rational, Pow +from sympy.core.numbers import pi +from sympy.core.singleton import S +from sympy.functions import acos, KroneckerDelta, Piecewise, sign, sqrt, Min, Max, cot, acsch, asec, coth +from sympy.logic import And, Or +from sympy.matrices import SparseMatrix, MatrixSymbol, Identity +from sympy.printing.pycode import ( + MpmathPrinter, PythonCodePrinter, pycode, SymPyPrinter +) +from sympy.printing.tensorflow import TensorflowPrinter +from sympy.printing.numpy import NumPyPrinter, SciPyPrinter +from sympy.testing.pytest import raises, skip +from sympy.tensor import IndexedBase, Idx +from sympy.tensor.array.expressions.array_expressions import ArraySymbol, ArrayDiagonal, ArrayContraction, ZeroArray, OneArray +from sympy.external import import_module +from sympy.functions.special.gamma_functions import loggamma + + +x, y, z = symbols('x y z') +p = IndexedBase("p") + + +def test_PythonCodePrinter(): + prntr = PythonCodePrinter() + + assert not prntr.module_imports + + assert prntr.doprint(x**y) == 'x**y' + assert prntr.doprint(Mod(x, 2)) == 'x % 2' + assert prntr.doprint(-Mod(x, y)) == '-(x % y)' + assert prntr.doprint(Mod(-x, y)) == '(-x) % y' + assert prntr.doprint(And(x, y)) == 'x and y' + assert prntr.doprint(Or(x, y)) == 'x or y' + assert prntr.doprint(1/(x+y)) == '1/(x + y)' + assert not prntr.module_imports + + assert prntr.doprint(pi) == 'math.pi' + assert prntr.module_imports == {'math': {'pi'}} + + assert prntr.doprint(x**Rational(1, 2)) == 'math.sqrt(x)' + assert prntr.doprint(sqrt(x)) == 'math.sqrt(x)' + assert prntr.module_imports == {'math': {'pi', 'sqrt'}} + + assert prntr.doprint(acos(x)) == 'math.acos(x)' + assert prntr.doprint(cot(x)) == '1/math.tan(x)' + assert prntr.doprint(coth(x)) == '(math.exp(x) + math.exp(-x))/(math.exp(x) - math.exp(-x))' + assert prntr.doprint(asec(x)) == 'math.acos(1/x)' + assert prntr.doprint(acsch(x)) == 'math.log(math.sqrt(1 + x**(-2)) + 1/x)' + + assert prntr.doprint(Assignment(x, 2)) == 'x = 2' + assert prntr.doprint(Piecewise((1, Eq(x, 0)), + (2, x>6))) == '((1) if (x == 0) else (2) if (x > 6) else None)' + assert prntr.doprint(Piecewise((2, Le(x, 0)), + (3, Gt(x, 0)), evaluate=False)) == '((2) if (x <= 0) else'\ + ' (3) if (x > 0) else None)' + assert prntr.doprint(sign(x)) == '(0.0 if x == 0 else math.copysign(1, x))' + assert prntr.doprint(p[0, 1]) == 'p[0, 1]' + assert prntr.doprint(KroneckerDelta(x,y)) == '(1 if x == y else 0)' + + assert prntr.doprint((2,3)) == "(2, 3)" + assert prntr.doprint([2,3]) == "[2, 3]" + + assert prntr.doprint(Min(x, y)) == "min(x, y)" + assert prntr.doprint(Max(x, y)) == "max(x, y)" + + +def test_PythonCodePrinter_standard(): + prntr = PythonCodePrinter() + + assert prntr.standard == 'python3' + + raises(ValueError, lambda: PythonCodePrinter({'standard':'python4'})) + + +def test_MpmathPrinter(): + p = MpmathPrinter() + assert p.doprint(sign(x)) == 'mpmath.sign(x)' + assert p.doprint(Rational(1, 2)) == 'mpmath.mpf(1)/mpmath.mpf(2)' + + assert p.doprint(S.Exp1) == 'mpmath.e' + assert p.doprint(S.Pi) == 'mpmath.pi' + assert p.doprint(S.GoldenRatio) == 'mpmath.phi' + assert p.doprint(S.EulerGamma) == 'mpmath.euler' + assert p.doprint(S.NaN) == 'mpmath.nan' + assert p.doprint(S.Infinity) == 'mpmath.inf' + assert p.doprint(S.NegativeInfinity) == 'mpmath.ninf' + assert p.doprint(loggamma(x)) == 'mpmath.loggamma(x)' + + +def test_NumPyPrinter(): + from sympy.core.function import Lambda + from sympy.matrices.expressions.adjoint import Adjoint + from sympy.matrices.expressions.diagonal import (DiagMatrix, DiagonalMatrix, DiagonalOf) + from sympy.matrices.expressions.funcmatrix import FunctionMatrix + from sympy.matrices.expressions.hadamard import HadamardProduct + from sympy.matrices.expressions.kronecker import KroneckerProduct + from sympy.matrices.expressions.special import (OneMatrix, ZeroMatrix) + from sympy.abc import a, b + p = NumPyPrinter() + assert p.doprint(sign(x)) == 'numpy.sign(x)' + A = MatrixSymbol("A", 2, 2) + B = MatrixSymbol("B", 2, 2) + C = MatrixSymbol("C", 1, 5) + D = MatrixSymbol("D", 3, 4) + assert p.doprint(A**(-1)) == "numpy.linalg.inv(A)" + assert p.doprint(A**5) == "numpy.linalg.matrix_power(A, 5)" + assert p.doprint(Identity(3)) == "numpy.eye(3)" + + u = MatrixSymbol('x', 2, 1) + v = MatrixSymbol('y', 2, 1) + assert p.doprint(MatrixSolve(A, u)) == 'numpy.linalg.solve(A, x)' + assert p.doprint(MatrixSolve(A, u) + v) == 'numpy.linalg.solve(A, x) + y' + + assert p.doprint(ZeroMatrix(2, 3)) == "numpy.zeros((2, 3))" + assert p.doprint(OneMatrix(2, 3)) == "numpy.ones((2, 3))" + assert p.doprint(FunctionMatrix(4, 5, Lambda((a, b), a + b))) == \ + "numpy.fromfunction(lambda a, b: a + b, (4, 5))" + assert p.doprint(HadamardProduct(A, B)) == "numpy.multiply(A, B)" + assert p.doprint(KroneckerProduct(A, B)) == "numpy.kron(A, B)" + assert p.doprint(Adjoint(A)) == "numpy.conjugate(numpy.transpose(A))" + assert p.doprint(DiagonalOf(A)) == "numpy.reshape(numpy.diag(A), (-1, 1))" + assert p.doprint(DiagMatrix(C)) == "numpy.diagflat(C)" + assert p.doprint(DiagonalMatrix(D)) == "numpy.multiply(D, numpy.eye(3, 4))" + + # Workaround for numpy negative integer power errors + assert p.doprint(x**-1) == 'x**(-1.0)' + assert p.doprint(x**-2) == 'x**(-2.0)' + + expr = Pow(2, -1, evaluate=False) + assert p.doprint(expr) == "2**(-1.0)" + + assert p.doprint(S.Exp1) == 'numpy.e' + assert p.doprint(S.Pi) == 'numpy.pi' + assert p.doprint(S.EulerGamma) == 'numpy.euler_gamma' + assert p.doprint(S.NaN) == 'numpy.nan' + assert p.doprint(S.Infinity) == 'numpy.PINF' + assert p.doprint(S.NegativeInfinity) == 'numpy.NINF' + + +def test_issue_18770(): + numpy = import_module('numpy') + if not numpy: + skip("numpy not installed.") + + from sympy.functions.elementary.miscellaneous import (Max, Min) + from sympy.utilities.lambdify import lambdify + + expr1 = Min(0.1*x + 3, x + 1, 0.5*x + 1) + func = lambdify(x, expr1, "numpy") + assert (func(numpy.linspace(0, 3, 3)) == [1.0, 1.75, 2.5 ]).all() + assert func(4) == 3 + + expr1 = Max(x**2, x**3) + func = lambdify(x,expr1, "numpy") + assert (func(numpy.linspace(-1, 2, 4)) == [1, 0, 1, 8] ).all() + assert func(4) == 64 + + +def test_SciPyPrinter(): + p = SciPyPrinter() + expr = acos(x) + assert 'numpy' not in p.module_imports + assert p.doprint(expr) == 'numpy.arccos(x)' + assert 'numpy' in p.module_imports + assert not any(m.startswith('scipy') for m in p.module_imports) + smat = SparseMatrix(2, 5, {(0, 1): 3}) + assert p.doprint(smat) == \ + 'scipy.sparse.coo_matrix(([3], ([0], [1])), shape=(2, 5))' + assert 'scipy.sparse' in p.module_imports + + assert p.doprint(S.GoldenRatio) == 'scipy.constants.golden_ratio' + assert p.doprint(S.Pi) == 'scipy.constants.pi' + assert p.doprint(S.Exp1) == 'numpy.e' + + +def test_pycode_reserved_words(): + s1, s2 = symbols('if else') + raises(ValueError, lambda: pycode(s1 + s2, error_on_reserved=True)) + py_str = pycode(s1 + s2) + assert py_str in ('else_ + if_', 'if_ + else_') + + +def test_issue_20762(): + # Make sure pycode removes curly braces from subscripted variables + a_b, b, a_11 = symbols('a_{b} b a_{11}') + expr = a_b*b + assert pycode(expr) == 'a_b*b' + expr = a_11*b + assert pycode(expr) == 'a_11*b' + + +def test_sqrt(): + prntr = PythonCodePrinter() + assert prntr._print_Pow(sqrt(x), rational=False) == 'math.sqrt(x)' + assert prntr._print_Pow(1/sqrt(x), rational=False) == '1/math.sqrt(x)' + + prntr = PythonCodePrinter({'standard' : 'python3'}) + assert prntr._print_Pow(sqrt(x), rational=True) == 'x**(1/2)' + assert prntr._print_Pow(1/sqrt(x), rational=True) == 'x**(-1/2)' + + prntr = MpmathPrinter() + assert prntr._print_Pow(sqrt(x), rational=False) == 'mpmath.sqrt(x)' + assert prntr._print_Pow(sqrt(x), rational=True) == \ + "x**(mpmath.mpf(1)/mpmath.mpf(2))" + + prntr = NumPyPrinter() + assert prntr._print_Pow(sqrt(x), rational=False) == 'numpy.sqrt(x)' + assert prntr._print_Pow(sqrt(x), rational=True) == 'x**(1/2)' + + prntr = SciPyPrinter() + assert prntr._print_Pow(sqrt(x), rational=False) == 'numpy.sqrt(x)' + assert prntr._print_Pow(sqrt(x), rational=True) == 'x**(1/2)' + + prntr = SymPyPrinter() + assert prntr._print_Pow(sqrt(x), rational=False) == 'sympy.sqrt(x)' + assert prntr._print_Pow(sqrt(x), rational=True) == 'x**(1/2)' + + +def test_frac(): + from sympy.functions.elementary.integers import frac + + expr = frac(x) + prntr = NumPyPrinter() + assert prntr.doprint(expr) == 'numpy.mod(x, 1)' + + prntr = SciPyPrinter() + assert prntr.doprint(expr) == 'numpy.mod(x, 1)' + + prntr = PythonCodePrinter() + assert prntr.doprint(expr) == 'x % 1' + + prntr = MpmathPrinter() + assert prntr.doprint(expr) == 'mpmath.frac(x)' + + prntr = SymPyPrinter() + assert prntr.doprint(expr) == 'sympy.functions.elementary.integers.frac(x)' + + +class CustomPrintedObject(Expr): + def _numpycode(self, printer): + return 'numpy' + + def _mpmathcode(self, printer): + return 'mpmath' + + +def test_printmethod(): + obj = CustomPrintedObject() + assert NumPyPrinter().doprint(obj) == 'numpy' + assert MpmathPrinter().doprint(obj) == 'mpmath' + + +def test_codegen_ast_nodes(): + assert pycode(none) == 'None' + + +def test_issue_14283(): + prntr = PythonCodePrinter() + + assert prntr.doprint(zoo) == "math.nan" + assert prntr.doprint(-oo) == "float('-inf')" + + +def test_NumPyPrinter_print_seq(): + n = NumPyPrinter() + + assert n._print_seq(range(2)) == '(0, 1,)' + + +def test_issue_16535_16536(): + from sympy.functions.special.gamma_functions import (lowergamma, uppergamma) + + a = symbols('a') + expr1 = lowergamma(a, x) + expr2 = uppergamma(a, x) + + prntr = SciPyPrinter() + assert prntr.doprint(expr1) == 'scipy.special.gamma(a)*scipy.special.gammainc(a, x)' + assert prntr.doprint(expr2) == 'scipy.special.gamma(a)*scipy.special.gammaincc(a, x)' + + prntr = NumPyPrinter() + assert "Not supported" in prntr.doprint(expr1) + assert "Not supported" in prntr.doprint(expr2) + + prntr = PythonCodePrinter() + assert "Not supported" in prntr.doprint(expr1) + assert "Not supported" in prntr.doprint(expr2) + + +def test_Integral(): + from sympy.functions.elementary.exponential import exp + from sympy.integrals.integrals import Integral + + single = Integral(exp(-x), (x, 0, oo)) + double = Integral(x**2*exp(x*y), (x, -z, z), (y, 0, z)) + indefinite = Integral(x**2, x) + evaluateat = Integral(x**2, (x, 1)) + + prntr = SciPyPrinter() + assert prntr.doprint(single) == 'scipy.integrate.quad(lambda x: numpy.exp(-x), 0, numpy.PINF)[0]' + assert prntr.doprint(double) == 'scipy.integrate.nquad(lambda x, y: x**2*numpy.exp(x*y), ((-z, z), (0, z)))[0]' + raises(NotImplementedError, lambda: prntr.doprint(indefinite)) + raises(NotImplementedError, lambda: prntr.doprint(evaluateat)) + + prntr = MpmathPrinter() + assert prntr.doprint(single) == 'mpmath.quad(lambda x: mpmath.exp(-x), (0, mpmath.inf))' + assert prntr.doprint(double) == 'mpmath.quad(lambda x, y: x**2*mpmath.exp(x*y), (-z, z), (0, z))' + raises(NotImplementedError, lambda: prntr.doprint(indefinite)) + raises(NotImplementedError, lambda: prntr.doprint(evaluateat)) + + +def test_fresnel_integrals(): + from sympy.functions.special.error_functions import (fresnelc, fresnels) + + expr1 = fresnelc(x) + expr2 = fresnels(x) + + prntr = SciPyPrinter() + assert prntr.doprint(expr1) == 'scipy.special.fresnel(x)[1]' + assert prntr.doprint(expr2) == 'scipy.special.fresnel(x)[0]' + + prntr = NumPyPrinter() + assert "Not supported" in prntr.doprint(expr1) + assert "Not supported" in prntr.doprint(expr2) + + prntr = PythonCodePrinter() + assert "Not supported" in prntr.doprint(expr1) + assert "Not supported" in prntr.doprint(expr2) + + prntr = MpmathPrinter() + assert prntr.doprint(expr1) == 'mpmath.fresnelc(x)' + assert prntr.doprint(expr2) == 'mpmath.fresnels(x)' + + +def test_beta(): + from sympy.functions.special.beta_functions import beta + + expr = beta(x, y) + + prntr = SciPyPrinter() + assert prntr.doprint(expr) == 'scipy.special.beta(x, y)' + + prntr = NumPyPrinter() + assert prntr.doprint(expr) == 'math.gamma(x)*math.gamma(y)/math.gamma(x + y)' + + prntr = PythonCodePrinter() + assert prntr.doprint(expr) == 'math.gamma(x)*math.gamma(y)/math.gamma(x + y)' + + prntr = PythonCodePrinter({'allow_unknown_functions': True}) + assert prntr.doprint(expr) == 'math.gamma(x)*math.gamma(y)/math.gamma(x + y)' + + prntr = MpmathPrinter() + assert prntr.doprint(expr) == 'mpmath.beta(x, y)' + +def test_airy(): + from sympy.functions.special.bessel import (airyai, airybi) + + expr1 = airyai(x) + expr2 = airybi(x) + + prntr = SciPyPrinter() + assert prntr.doprint(expr1) == 'scipy.special.airy(x)[0]' + assert prntr.doprint(expr2) == 'scipy.special.airy(x)[2]' + + prntr = NumPyPrinter() + assert "Not supported" in prntr.doprint(expr1) + assert "Not supported" in prntr.doprint(expr2) + + prntr = PythonCodePrinter() + assert "Not supported" in prntr.doprint(expr1) + assert "Not supported" in prntr.doprint(expr2) + +def test_airy_prime(): + from sympy.functions.special.bessel import (airyaiprime, airybiprime) + + expr1 = airyaiprime(x) + expr2 = airybiprime(x) + + prntr = SciPyPrinter() + assert prntr.doprint(expr1) == 'scipy.special.airy(x)[1]' + assert prntr.doprint(expr2) == 'scipy.special.airy(x)[3]' + + prntr = NumPyPrinter() + assert "Not supported" in prntr.doprint(expr1) + assert "Not supported" in prntr.doprint(expr2) + + prntr = PythonCodePrinter() + assert "Not supported" in prntr.doprint(expr1) + assert "Not supported" in prntr.doprint(expr2) + + +def test_numerical_accuracy_functions(): + prntr = SciPyPrinter() + assert prntr.doprint(expm1(x)) == 'numpy.expm1(x)' + assert prntr.doprint(log1p(x)) == 'numpy.log1p(x)' + assert prntr.doprint(cosm1(x)) == 'scipy.special.cosm1(x)' + +def test_array_printer(): + A = ArraySymbol('A', (4,4,6,6,6)) + I = IndexedBase('I') + i,j,k = Idx('i', (0,1)), Idx('j', (2,3)), Idx('k', (4,5)) + + prntr = NumPyPrinter() + assert prntr.doprint(ZeroArray(5)) == 'numpy.zeros((5,))' + assert prntr.doprint(OneArray(5)) == 'numpy.ones((5,))' + assert prntr.doprint(ArrayContraction(A, [2,3])) == 'numpy.einsum("abccd->abd", A)' + assert prntr.doprint(I) == 'I' + assert prntr.doprint(ArrayDiagonal(A, [2,3,4])) == 'numpy.einsum("abccc->abc", A)' + assert prntr.doprint(ArrayDiagonal(A, [0,1], [2,3])) == 'numpy.einsum("aabbc->cab", A)' + assert prntr.doprint(ArrayContraction(A, [2], [3])) == 'numpy.einsum("abcde->abe", A)' + assert prntr.doprint(Assignment(I[i,j,k], I[i,j,k])) == 'I = I' + + prntr = TensorflowPrinter() + assert prntr.doprint(ZeroArray(5)) == 'tensorflow.zeros((5,))' + assert prntr.doprint(OneArray(5)) == 'tensorflow.ones((5,))' + assert prntr.doprint(ArrayContraction(A, [2,3])) == 'tensorflow.linalg.einsum("abccd->abd", A)' + assert prntr.doprint(I) == 'I' + assert prntr.doprint(ArrayDiagonal(A, [2,3,4])) == 'tensorflow.linalg.einsum("abccc->abc", A)' + assert prntr.doprint(ArrayDiagonal(A, [0,1], [2,3])) == 'tensorflow.linalg.einsum("aabbc->cab", A)' + assert prntr.doprint(ArrayContraction(A, [2], [3])) == 'tensorflow.linalg.einsum("abcde->abe", A)' + assert prntr.doprint(Assignment(I[i,j,k], I[i,j,k])) == 'I = I' diff --git a/shared/package-files/9c/9c5bc31a58407f4c06fa96673e48098dfc031eb4f076ba373182229f0cb19fde/blob b/shared/package-files/9c/9c5bc31a58407f4c06fa96673e48098dfc031eb4f076ba373182229f0cb19fde/blob new file mode 100644 index 0000000000000000000000000000000000000000..2e3a407d565f6b9537a296af103ec0a4e137cff9 --- /dev/null +++ b/shared/package-files/9c/9c5bc31a58407f4c06fa96673e48098dfc031eb4f076ba373182229f0cb19fde/blob @@ -0,0 +1,141 @@ +from sympy.core.expr import unchanged +from sympy.core.singleton import S +from sympy.core.symbol import Symbol +from sympy.sets.contains import Contains +from sympy.sets.fancysets import Interval +from sympy.sets.powerset import PowerSet +from sympy.sets.sets import FiniteSet +from sympy.testing.pytest import raises, XFAIL + + +def test_powerset_creation(): + assert unchanged(PowerSet, FiniteSet(1, 2)) + assert unchanged(PowerSet, S.EmptySet) + raises(ValueError, lambda: PowerSet(123)) + assert unchanged(PowerSet, S.Reals) + assert unchanged(PowerSet, S.Integers) + + +def test_powerset_rewrite_FiniteSet(): + assert PowerSet(FiniteSet(1, 2)).rewrite(FiniteSet) == \ + FiniteSet(S.EmptySet, FiniteSet(1), FiniteSet(2), FiniteSet(1, 2)) + assert PowerSet(S.EmptySet).rewrite(FiniteSet) == FiniteSet(S.EmptySet) + assert PowerSet(S.Naturals).rewrite(FiniteSet) == PowerSet(S.Naturals) + + +def test_finiteset_rewrite_powerset(): + assert FiniteSet(S.EmptySet).rewrite(PowerSet) == PowerSet(S.EmptySet) + assert FiniteSet( + S.EmptySet, FiniteSet(1), + FiniteSet(2), FiniteSet(1, 2)).rewrite(PowerSet) == \ + PowerSet(FiniteSet(1, 2)) + assert FiniteSet(1, 2, 3).rewrite(PowerSet) == FiniteSet(1, 2, 3) + + +def test_powerset__contains__(): + subset_series = [ + S.EmptySet, + FiniteSet(1, 2), + S.Naturals, + S.Naturals0, + S.Integers, + S.Rationals, + S.Reals, + S.Complexes] + + l = len(subset_series) + for i in range(l): + for j in range(l): + if i <= j: + assert subset_series[i] in \ + PowerSet(subset_series[j], evaluate=False) + else: + assert subset_series[i] not in \ + PowerSet(subset_series[j], evaluate=False) + + +@XFAIL +def test_failing_powerset__contains__(): + # XXX These are failing when evaluate=True, + # but using unevaluated PowerSet works fine. + assert FiniteSet(1, 2) not in PowerSet(S.EmptySet).rewrite(FiniteSet) + assert S.Naturals not in PowerSet(S.EmptySet).rewrite(FiniteSet) + assert S.Naturals not in PowerSet(FiniteSet(1, 2)).rewrite(FiniteSet) + assert S.Naturals0 not in PowerSet(S.EmptySet).rewrite(FiniteSet) + assert S.Naturals0 not in PowerSet(FiniteSet(1, 2)).rewrite(FiniteSet) + assert S.Integers not in PowerSet(S.EmptySet).rewrite(FiniteSet) + assert S.Integers not in PowerSet(FiniteSet(1, 2)).rewrite(FiniteSet) + assert S.Rationals not in PowerSet(S.EmptySet).rewrite(FiniteSet) + assert S.Rationals not in PowerSet(FiniteSet(1, 2)).rewrite(FiniteSet) + assert S.Reals not in PowerSet(S.EmptySet).rewrite(FiniteSet) + assert S.Reals not in PowerSet(FiniteSet(1, 2)).rewrite(FiniteSet) + assert S.Complexes not in PowerSet(S.EmptySet).rewrite(FiniteSet) + assert S.Complexes not in PowerSet(FiniteSet(1, 2)).rewrite(FiniteSet) + + +def test_powerset__len__(): + A = PowerSet(S.EmptySet, evaluate=False) + assert len(A) == 1 + A = PowerSet(A, evaluate=False) + assert len(A) == 2 + A = PowerSet(A, evaluate=False) + assert len(A) == 4 + A = PowerSet(A, evaluate=False) + assert len(A) == 16 + + +def test_powerset__iter__(): + a = PowerSet(FiniteSet(1, 2)).__iter__() + assert next(a) == S.EmptySet + assert next(a) == FiniteSet(1) + assert next(a) == FiniteSet(2) + assert next(a) == FiniteSet(1, 2) + + a = PowerSet(S.Naturals).__iter__() + assert next(a) == S.EmptySet + assert next(a) == FiniteSet(1) + assert next(a) == FiniteSet(2) + assert next(a) == FiniteSet(1, 2) + assert next(a) == FiniteSet(3) + assert next(a) == FiniteSet(1, 3) + assert next(a) == FiniteSet(2, 3) + assert next(a) == FiniteSet(1, 2, 3) + + +def test_powerset_contains(): + A = PowerSet(FiniteSet(1), evaluate=False) + assert A.contains(2) == Contains(2, A) + + x = Symbol('x') + + A = PowerSet(FiniteSet(x), evaluate=False) + assert A.contains(FiniteSet(1)) == Contains(FiniteSet(1), A) + + +def test_powerset_method(): + # EmptySet + A = FiniteSet() + pset = A.powerset() + assert len(pset) == 1 + assert pset == FiniteSet(S.EmptySet) + + # FiniteSets + A = FiniteSet(1, 2) + pset = A.powerset() + assert len(pset) == 2**len(A) + assert pset == FiniteSet(FiniteSet(), FiniteSet(1), + FiniteSet(2), A) + # Not finite sets + A = Interval(0, 1) + assert A.powerset() == PowerSet(A) + +def test_is_subset(): + # covers line 101-102 + # initialize powerset(1), which is a subset of powerset(1,2) + subset = PowerSet(FiniteSet(1)) + pset = PowerSet(FiniteSet(1, 2)) + bad_set = PowerSet(FiniteSet(2, 3)) + # assert "subset" is subset of pset == True + assert subset.is_subset(pset) + # assert "bad_set" is subset of pset == False + assert not pset.is_subset(bad_set) diff --git a/shared/package-files/9c/9c5cc1f9b43437430e247505ae1a68c25b5bd033f6bb15a9a66ea27f799695c9/blob b/shared/package-files/9c/9c5cc1f9b43437430e247505ae1a68c25b5bd033f6bb15a9a66ea27f799695c9/blob new file mode 100644 index 0000000000000000000000000000000000000000..bfc3a49df65860e9c885dc2a3a451e1c4ff73aac --- /dev/null +++ b/shared/package-files/9c/9c5cc1f9b43437430e247505ae1a68c25b5bd033f6bb15a9a66ea27f799695c9/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor coalesce(const at::Tensor & self); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9c/9c5d4a71ea3cf87a657612cc682a348304d22d0458ff270f0695aeaf9388a2aa/blob b/shared/package-files/9c/9c5d4a71ea3cf87a657612cc682a348304d22d0458ff270f0695aeaf9388a2aa/blob new file mode 100644 index 0000000000000000000000000000000000000000..6f856aa5727070262d134c60881294cc15f0f269 --- /dev/null +++ b/shared/package-files/9c/9c5d4a71ea3cf87a657612cc682a348304d22d0458ff270f0695aeaf9388a2aa/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c5d4a71ea3cf87a657612cc682a348304d22d0458ff270f0695aeaf9388a2aa +size 208346 diff --git a/shared/package-files/9c/9c5da1342febca225c79ce7c0a7a7fd26006483d0b7ec9e36f352e087e29f8eb/blob b/shared/package-files/9c/9c5da1342febca225c79ce7c0a7a7fd26006483d0b7ec9e36f352e087e29f8eb/blob new file mode 100644 index 0000000000000000000000000000000000000000..d2ad5fd8cbf7d8eef42f2e70429aa658ff821169 --- /dev/null +++ b/shared/package-files/9c/9c5da1342febca225c79ce7c0a7a7fd26006483d0b7ec9e36f352e087e29f8eb/blob @@ -0,0 +1,2419 @@ +""" +A collection of utility functions and classes. Originally, many +(but not all) were from the Python Cookbook -- hence the name cbook. +""" + +import collections +import collections.abc +import contextlib +import functools +import gzip +import itertools +import math +import operator +import os +from pathlib import Path +import shlex +import subprocess +import sys +import time +import traceback +import types +import weakref + +import numpy as np + +try: + from numpy.exceptions import VisibleDeprecationWarning # numpy >= 1.25 +except ImportError: + from numpy import VisibleDeprecationWarning + +import matplotlib +from matplotlib import _api, _c_internal_utils + + +class _ExceptionInfo: + """ + A class to carry exception information around. + + This is used to store and later raise exceptions. It's an alternative to + directly storing Exception instances that circumvents traceback-related + issues: caching tracebacks can keep user's objects in local namespaces + alive indefinitely, which can lead to very surprising memory issues for + users and result in incorrect tracebacks. + """ + + def __init__(self, cls, *args): + self._cls = cls + self._args = args + + @classmethod + def from_exception(cls, exc): + return cls(type(exc), *exc.args) + + def to_exception(self): + return self._cls(*self._args) + + +def _get_running_interactive_framework(): + """ + Return the interactive framework whose event loop is currently running, if + any, or "headless" if no event loop can be started, or None. + + Returns + ------- + Optional[str] + One of the following values: "qt", "gtk3", "gtk4", "wx", "tk", + "macosx", "headless", ``None``. + """ + # Use ``sys.modules.get(name)`` rather than ``name in sys.modules`` as + # entries can also have been explicitly set to None. + QtWidgets = ( + sys.modules.get("PyQt6.QtWidgets") + or sys.modules.get("PySide6.QtWidgets") + or sys.modules.get("PyQt5.QtWidgets") + or sys.modules.get("PySide2.QtWidgets") + ) + if QtWidgets and QtWidgets.QApplication.instance(): + return "qt" + Gtk = sys.modules.get("gi.repository.Gtk") + if Gtk: + if Gtk.MAJOR_VERSION == 4: + from gi.repository import GLib + if GLib.main_depth(): + return "gtk4" + if Gtk.MAJOR_VERSION == 3 and Gtk.main_level(): + return "gtk3" + wx = sys.modules.get("wx") + if wx and wx.GetApp(): + return "wx" + tkinter = sys.modules.get("tkinter") + if tkinter: + codes = {tkinter.mainloop.__code__, tkinter.Misc.mainloop.__code__} + for frame in sys._current_frames().values(): + while frame: + if frame.f_code in codes: + return "tk" + frame = frame.f_back + # Preemptively break reference cycle between locals and the frame. + del frame + macosx = sys.modules.get("matplotlib.backends._macosx") + if macosx and macosx.event_loop_is_running(): + return "macosx" + if not _c_internal_utils.display_is_valid(): + return "headless" + return None + + +def _exception_printer(exc): + if _get_running_interactive_framework() in ["headless", None]: + raise exc + else: + traceback.print_exc() + + +class _StrongRef: + """ + Wrapper similar to a weakref, but keeping a strong reference to the object. + """ + + def __init__(self, obj): + self._obj = obj + + def __call__(self): + return self._obj + + def __eq__(self, other): + return isinstance(other, _StrongRef) and self._obj == other._obj + + def __hash__(self): + return hash(self._obj) + + +def _weak_or_strong_ref(func, callback): + """ + Return a `WeakMethod` wrapping *func* if possible, else a `_StrongRef`. + """ + try: + return weakref.WeakMethod(func, callback) + except TypeError: + return _StrongRef(func) + + +class _UnhashDict: + """ + A minimal dict-like class that also supports unhashable keys, storing them + in a list of key-value pairs. + + This class only implements the interface needed for `CallbackRegistry`, and + tries to minimize the overhead for the hashable case. + """ + + def __init__(self, pairs): + self._dict = {} + self._pairs = [] + for k, v in pairs: + self[k] = v + + def __setitem__(self, key, value): + try: + self._dict[key] = value + except TypeError: + for i, (k, v) in enumerate(self._pairs): + if k == key: + self._pairs[i] = (key, value) + break + else: + self._pairs.append((key, value)) + + def __getitem__(self, key): + try: + return self._dict[key] + except TypeError: + pass + for k, v in self._pairs: + if k == key: + return v + raise KeyError(key) + + def pop(self, key, *args): + try: + if key in self._dict: + return self._dict.pop(key) + except TypeError: + for i, (k, v) in enumerate(self._pairs): + if k == key: + del self._pairs[i] + return v + if args: + return args[0] + raise KeyError(key) + + def __iter__(self): + yield from self._dict + for k, v in self._pairs: + yield k + + +class CallbackRegistry: + """ + Handle registering, processing, blocking, and disconnecting + for a set of signals and callbacks: + + >>> def oneat(x): + ... print('eat', x) + >>> def ondrink(x): + ... print('drink', x) + + >>> from matplotlib.cbook import CallbackRegistry + >>> callbacks = CallbackRegistry() + + >>> id_eat = callbacks.connect('eat', oneat) + >>> id_drink = callbacks.connect('drink', ondrink) + + >>> callbacks.process('drink', 123) + drink 123 + >>> callbacks.process('eat', 456) + eat 456 + >>> callbacks.process('be merry', 456) # nothing will be called + + >>> callbacks.disconnect(id_eat) + >>> callbacks.process('eat', 456) # nothing will be called + + >>> with callbacks.blocked(signal='drink'): + ... callbacks.process('drink', 123) # nothing will be called + >>> callbacks.process('drink', 123) + drink 123 + + In practice, one should always disconnect all callbacks when they are + no longer needed to avoid dangling references (and thus memory leaks). + However, real code in Matplotlib rarely does so, and due to its design, + it is rather difficult to place this kind of code. To get around this, + and prevent this class of memory leaks, we instead store weak references + to bound methods only, so when the destination object needs to die, the + CallbackRegistry won't keep it alive. + + Parameters + ---------- + exception_handler : callable, optional + If not None, *exception_handler* must be a function that takes an + `Exception` as single parameter. It gets called with any `Exception` + raised by the callbacks during `CallbackRegistry.process`, and may + either re-raise the exception or handle it in another manner. + + The default handler prints the exception (with `traceback.print_exc`) if + an interactive event loop is running; it re-raises the exception if no + interactive event loop is running. + + signals : list, optional + If not None, *signals* is a list of signals that this registry handles: + attempting to `process` or to `connect` to a signal not in the list + throws a `ValueError`. The default, None, does not restrict the + handled signals. + """ + + # We maintain two mappings: + # callbacks: signal -> {cid -> weakref-to-callback} + # _func_cid_map: {(signal, weakref-to-callback) -> cid} + + def __init__(self, exception_handler=_exception_printer, *, signals=None): + self._signals = None if signals is None else list(signals) # Copy it. + self.exception_handler = exception_handler + self.callbacks = {} + self._cid_gen = itertools.count() + self._func_cid_map = _UnhashDict([]) + # A hidden variable that marks cids that need to be pickled. + self._pickled_cids = set() + + def __getstate__(self): + return { + **vars(self), + # In general, callbacks may not be pickled, so we just drop them, + # unless directed otherwise by self._pickled_cids. + "callbacks": {s: {cid: proxy() for cid, proxy in d.items() + if cid in self._pickled_cids} + for s, d in self.callbacks.items()}, + # It is simpler to reconstruct this from callbacks in __setstate__. + "_func_cid_map": None, + "_cid_gen": next(self._cid_gen) + } + + def __setstate__(self, state): + cid_count = state.pop('_cid_gen') + vars(self).update(state) + self.callbacks = { + s: {cid: _weak_or_strong_ref(func, functools.partial(self._remove_proxy, s)) + for cid, func in d.items()} + for s, d in self.callbacks.items()} + self._func_cid_map = _UnhashDict( + ((s, proxy), cid) + for s, d in self.callbacks.items() for cid, proxy in d.items()) + self._cid_gen = itertools.count(cid_count) + + def connect(self, signal, func): + """Register *func* to be called when signal *signal* is generated.""" + if self._signals is not None: + _api.check_in_list(self._signals, signal=signal) + proxy = _weak_or_strong_ref(func, functools.partial(self._remove_proxy, signal)) + try: + return self._func_cid_map[signal, proxy] + except KeyError: + cid = self._func_cid_map[signal, proxy] = next(self._cid_gen) + self.callbacks.setdefault(signal, {})[cid] = proxy + return cid + + def _connect_picklable(self, signal, func): + """ + Like `.connect`, but the callback is kept when pickling/unpickling. + + Currently internal-use only. + """ + cid = self.connect(signal, func) + self._pickled_cids.add(cid) + return cid + + # Keep a reference to sys.is_finalizing, as sys may have been cleared out + # at that point. + def _remove_proxy(self, signal, proxy, *, _is_finalizing=sys.is_finalizing): + if _is_finalizing(): + # Weakrefs can't be properly torn down at that point anymore. + return + cid = self._func_cid_map.pop((signal, proxy), None) + if cid is not None: + del self.callbacks[signal][cid] + self._pickled_cids.discard(cid) + else: # Not found + return + if len(self.callbacks[signal]) == 0: # Clean up empty dicts + del self.callbacks[signal] + + def disconnect(self, cid): + """ + Disconnect the callback registered with callback id *cid*. + + No error is raised if such a callback does not exist. + """ + self._pickled_cids.discard(cid) + for signal, proxy in self._func_cid_map: + if self._func_cid_map[signal, proxy] == cid: + break + else: # Not found + return + assert self.callbacks[signal][cid] == proxy + del self.callbacks[signal][cid] + self._func_cid_map.pop((signal, proxy)) + if len(self.callbacks[signal]) == 0: # Clean up empty dicts + del self.callbacks[signal] + + def process(self, s, *args, **kwargs): + """ + Process signal *s*. + + All of the functions registered to receive callbacks on *s* will be + called with ``*args`` and ``**kwargs``. + """ + if self._signals is not None: + _api.check_in_list(self._signals, signal=s) + for ref in list(self.callbacks.get(s, {}).values()): + func = ref() + if func is not None: + try: + func(*args, **kwargs) + # this does not capture KeyboardInterrupt, SystemExit, + # and GeneratorExit + except Exception as exc: + if self.exception_handler is not None: + self.exception_handler(exc) + else: + raise + + @contextlib.contextmanager + def blocked(self, *, signal=None): + """ + Block callback signals from being processed. + + A context manager to temporarily block/disable callback signals + from being processed by the registered listeners. + + Parameters + ---------- + signal : str, optional + The callback signal to block. The default is to block all signals. + """ + orig = self.callbacks + try: + if signal is None: + # Empty out the callbacks + self.callbacks = {} + else: + # Only remove the specific signal + self.callbacks = {k: orig[k] for k in orig if k != signal} + yield + finally: + self.callbacks = orig + + +class silent_list(list): + """ + A list with a short ``repr()``. + + This is meant to be used for a homogeneous list of artists, so that they + don't cause long, meaningless output. + + Instead of :: + + [, + , + ] + + one will get :: + + + + If ``self.type`` is None, the type name is obtained from the first item in + the list (if any). + """ + + def __init__(self, type, seq=None): + self.type = type + if seq is not None: + self.extend(seq) + + def __repr__(self): + if self.type is not None or len(self) != 0: + tp = self.type if self.type is not None else type(self[0]).__name__ + return f"" + else: + return "" + + +def _local_over_kwdict( + local_var, kwargs, *keys, + warning_cls=_api.MatplotlibDeprecationWarning): + out = local_var + for key in keys: + kwarg_val = kwargs.pop(key, None) + if kwarg_val is not None: + if out is None: + out = kwarg_val + else: + _api.warn_external(f'"{key}" keyword argument will be ignored', + warning_cls) + return out + + +def strip_math(s): + """ + Remove latex formatting from mathtext. + + Only handles fully math and fully non-math strings. + """ + if len(s) >= 2 and s[0] == s[-1] == "$": + s = s[1:-1] + for tex, plain in [ + (r"\times", "x"), # Specifically for Formatter support. + (r"\mathdefault", ""), + (r"\rm", ""), + (r"\cal", ""), + (r"\tt", ""), + (r"\it", ""), + ("\\", ""), + ("{", ""), + ("}", ""), + ]: + s = s.replace(tex, plain) + return s + + +def _strip_comment(s): + """Strip everything from the first unquoted #.""" + pos = 0 + while True: + quote_pos = s.find('"', pos) + hash_pos = s.find('#', pos) + if quote_pos < 0: + without_comment = s if hash_pos < 0 else s[:hash_pos] + return without_comment.strip() + elif 0 <= hash_pos < quote_pos: + return s[:hash_pos].strip() + else: + closing_quote_pos = s.find('"', quote_pos + 1) + if closing_quote_pos < 0: + raise ValueError( + f"Missing closing quote in: {s!r}. If you need a double-" + 'quote inside a string, use escaping: e.g. "the \" char"') + pos = closing_quote_pos + 1 # behind closing quote + + +def is_writable_file_like(obj): + """Return whether *obj* looks like a file object with a *write* method.""" + return callable(getattr(obj, 'write', None)) + + +def file_requires_unicode(x): + """ + Return whether the given writable file-like object requires Unicode to be + written to it. + """ + try: + x.write(b'') + except TypeError: + return True + else: + return False + + +def to_filehandle(fname, flag='r', return_opened=False, encoding=None): + """ + Convert a path to an open file handle or pass-through a file-like object. + + Consider using `open_file_cm` instead, as it allows one to properly close + newly created file objects more easily. + + Parameters + ---------- + fname : str or path-like or file-like + If `str` or `os.PathLike`, the file is opened using the flags specified + by *flag* and *encoding*. If a file-like object, it is passed through. + flag : str, default: 'r' + Passed as the *mode* argument to `open` when *fname* is `str` or + `os.PathLike`; ignored if *fname* is file-like. + return_opened : bool, default: False + If True, return both the file object and a boolean indicating whether + this was a new file (that the caller needs to close). If False, return + only the new file. + encoding : str or None, default: None + Passed as the *mode* argument to `open` when *fname* is `str` or + `os.PathLike`; ignored if *fname* is file-like. + + Returns + ------- + fh : file-like + opened : bool + *opened* is only returned if *return_opened* is True. + """ + if isinstance(fname, os.PathLike): + fname = os.fspath(fname) + if isinstance(fname, str): + if fname.endswith('.gz'): + fh = gzip.open(fname, flag) + elif fname.endswith('.bz2'): + # python may not be compiled with bz2 support, + # bury import until we need it + import bz2 + fh = bz2.BZ2File(fname, flag) + else: + fh = open(fname, flag, encoding=encoding) + opened = True + elif hasattr(fname, 'seek'): + fh = fname + opened = False + else: + raise ValueError('fname must be a PathLike or file handle') + if return_opened: + return fh, opened + return fh + + +def open_file_cm(path_or_file, mode="r", encoding=None): + r"""Pass through file objects and context-manage path-likes.""" + fh, opened = to_filehandle(path_or_file, mode, True, encoding) + return fh if opened else contextlib.nullcontext(fh) + + +def is_scalar_or_string(val): + """Return whether the given object is a scalar or string like.""" + return isinstance(val, str) or not np.iterable(val) + + +def get_sample_data(fname, asfileobj=True): + """ + Return a sample data file. *fname* is a path relative to the + :file:`mpl-data/sample_data` directory. If *asfileobj* is `True` + return a file object, otherwise just a file path. + + Sample data files are stored in the 'mpl-data/sample_data' directory within + the Matplotlib package. + + If the filename ends in .gz, the file is implicitly ungzipped. If the + filename ends with .npy or .npz, and *asfileobj* is `True`, the file is + loaded with `numpy.load`. + """ + path = _get_data_path('sample_data', fname) + if asfileobj: + suffix = path.suffix.lower() + if suffix == '.gz': + return gzip.open(path) + elif suffix in ['.npy', '.npz']: + return np.load(path) + elif suffix in ['.csv', '.xrc', '.txt']: + return path.open('r') + else: + return path.open('rb') + else: + return str(path) + + +def _get_data_path(*args): + """ + Return the `pathlib.Path` to a resource file provided by Matplotlib. + + ``*args`` specify a path relative to the base data path. + """ + return Path(matplotlib.get_data_path(), *args) + + +def flatten(seq, scalarp=is_scalar_or_string): + """ + Return a generator of flattened nested containers. + + For example: + + >>> from matplotlib.cbook import flatten + >>> l = (('John', ['Hunter']), (1, 23), [[([42, (5, 23)], )]]) + >>> print(list(flatten(l))) + ['John', 'Hunter', 1, 23, 42, 5, 23] + + By: Composite of Holger Krekel and Luther Blissett + From: https://code.activestate.com/recipes/121294-simple-generator-for-flattening-nested-containers/ + and Recipe 1.12 in cookbook + """ # noqa: E501 + for item in seq: + if scalarp(item) or item is None: + yield item + else: + yield from flatten(item, scalarp) + + +class _Stack: + """ + Stack of elements with a movable cursor. + + Mimics home/back/forward in a web browser. + """ + + def __init__(self): + self._pos = -1 + self._elements = [] + + def clear(self): + """Empty the stack.""" + self._pos = -1 + self._elements = [] + + def __call__(self): + """Return the current element, or None.""" + return self._elements[self._pos] if self._elements else None + + def __len__(self): + return len(self._elements) + + def __getitem__(self, ind): + return self._elements[ind] + + def forward(self): + """Move the position forward and return the current element.""" + self._pos = min(self._pos + 1, len(self._elements) - 1) + return self() + + def back(self): + """Move the position back and return the current element.""" + self._pos = max(self._pos - 1, 0) + return self() + + def push(self, o): + """ + Push *o* to the stack after the current position, and return *o*. + + Discard all later elements. + """ + self._elements[self._pos + 1:] = [o] + self._pos = len(self._elements) - 1 + return o + + def home(self): + """ + Push the first element onto the top of the stack. + + The first element is returned. + """ + return self.push(self._elements[0]) if self._elements else None + + +def safe_masked_invalid(x, copy=False): + x = np.array(x, subok=True, copy=copy) + if not x.dtype.isnative: + # If we have already made a copy, do the byteswap in place, else make a + # copy with the byte order swapped. + # Swap to native order. + x = x.byteswap(inplace=copy).view(x.dtype.newbyteorder('N')) + try: + xm = np.ma.masked_where(~(np.isfinite(x)), x, copy=False) + except TypeError: + return x + return xm + + +def print_cycles(objects, outstream=sys.stdout, show_progress=False): + """ + Print loops of cyclic references in the given *objects*. + + It is often useful to pass in ``gc.garbage`` to find the cycles that are + preventing some objects from being garbage collected. + + Parameters + ---------- + objects + A list of objects to find cycles in. + outstream + The stream for output. + show_progress : bool + If True, print the number of objects reached as they are found. + """ + import gc + + def print_path(path): + for i, step in enumerate(path): + # next "wraps around" + next = path[(i + 1) % len(path)] + + outstream.write(" %s -- " % type(step)) + if isinstance(step, dict): + for key, val in step.items(): + if val is next: + outstream.write(f"[{key!r}]") + break + if key is next: + outstream.write(f"[key] = {val!r}") + break + elif isinstance(step, list): + outstream.write("[%d]" % step.index(next)) + elif isinstance(step, tuple): + outstream.write("( tuple )") + else: + outstream.write(repr(step)) + outstream.write(" ->\n") + outstream.write("\n") + + def recurse(obj, start, all, current_path): + if show_progress: + outstream.write("%d\r" % len(all)) + + all[id(obj)] = None + + referents = gc.get_referents(obj) + for referent in referents: + # If we've found our way back to the start, this is + # a cycle, so print it out + if referent is start: + print_path(current_path) + + # Don't go back through the original list of objects, or + # through temporary references to the object, since those + # are just an artifact of the cycle detector itself. + elif referent is objects or isinstance(referent, types.FrameType): + continue + + # We haven't seen this object before, so recurse + elif id(referent) not in all: + recurse(referent, start, all, current_path + [obj]) + + for obj in objects: + outstream.write(f"Examining: {obj!r}\n") + recurse(obj, obj, {}, []) + + +class Grouper: + """ + A disjoint-set data structure. + + Objects can be joined using :meth:`join`, tested for connectedness + using :meth:`joined`, and all disjoint sets can be retrieved by + using the object as an iterator. + + The objects being joined must be hashable and weak-referenceable. + + Examples + -------- + >>> from matplotlib.cbook import Grouper + >>> class Foo: + ... def __init__(self, s): + ... self.s = s + ... def __repr__(self): + ... return self.s + ... + >>> a, b, c, d, e, f = [Foo(x) for x in 'abcdef'] + >>> grp = Grouper() + >>> grp.join(a, b) + >>> grp.join(b, c) + >>> grp.join(d, e) + >>> list(grp) + [[a, b, c], [d, e]] + >>> grp.joined(a, b) + True + >>> grp.joined(a, c) + True + >>> grp.joined(a, d) + False + """ + + def __init__(self, init=()): + self._mapping = weakref.WeakKeyDictionary( + {x: weakref.WeakSet([x]) for x in init}) + self._ordering = weakref.WeakKeyDictionary() + for x in init: + if x not in self._ordering: + self._ordering[x] = len(self._ordering) + self._next_order = len(self._ordering) # Plain int to simplify pickling. + + def __getstate__(self): + return { + **vars(self), + # Convert weak refs to strong ones. + "_mapping": {k: set(v) for k, v in self._mapping.items()}, + "_ordering": {**self._ordering}, + } + + def __setstate__(self, state): + vars(self).update(state) + # Convert strong refs to weak ones. + self._mapping = weakref.WeakKeyDictionary( + {k: weakref.WeakSet(v) for k, v in self._mapping.items()}) + self._ordering = weakref.WeakKeyDictionary(self._ordering) + + def __contains__(self, item): + return item in self._mapping + + def join(self, a, *args): + """ + Join given arguments into the same set. Accepts one or more arguments. + """ + mapping = self._mapping + try: + set_a = mapping[a] + except KeyError: + set_a = mapping[a] = weakref.WeakSet([a]) + self._ordering[a] = self._next_order + self._next_order += 1 + for arg in args: + try: + set_b = mapping[arg] + except KeyError: + set_b = mapping[arg] = weakref.WeakSet([arg]) + self._ordering[arg] = self._next_order + self._next_order += 1 + if set_b is not set_a: + if len(set_b) > len(set_a): + set_a, set_b = set_b, set_a + set_a.update(set_b) + for elem in set_b: + mapping[elem] = set_a + + def joined(self, a, b): + """Return whether *a* and *b* are members of the same set.""" + return (self._mapping.get(a, object()) is self._mapping.get(b)) + + def remove(self, a): + """Remove *a* from the grouper, doing nothing if it is not there.""" + self._mapping.pop(a, {a}).remove(a) + self._ordering.pop(a, None) + + def __iter__(self): + """ + Iterate over each of the disjoint sets as a list. + + The iterator is invalid if interleaved with calls to join(). + """ + unique_groups = {id(group): group for group in self._mapping.values()} + for group in unique_groups.values(): + yield sorted(group, key=self._ordering.__getitem__) + + def get_siblings(self, a): + """Return all of the items joined with *a*, including itself.""" + siblings = self._mapping.get(a, [a]) + return sorted(siblings, key=self._ordering.get) + + +class GrouperView: + """Immutable view over a `.Grouper`.""" + + def __init__(self, grouper): self._grouper = grouper + def __contains__(self, item): return item in self._grouper + def __iter__(self): return iter(self._grouper) + + def joined(self, a, b): + """ + Return whether *a* and *b* are members of the same set. + """ + return self._grouper.joined(a, b) + + def get_siblings(self, a): + """ + Return all of the items joined with *a*, including itself. + """ + return self._grouper.get_siblings(a) + + +def simple_linear_interpolation(a, steps): + """ + Resample an array with ``steps - 1`` points between original point pairs. + + Along each column of *a*, ``(steps - 1)`` points are introduced between + each original values; the values are linearly interpolated. + + Parameters + ---------- + a : array, shape (n, ...) + steps : int + + Returns + ------- + array + shape ``((n - 1) * steps + 1, ...)`` + """ + fps = a.reshape((len(a), -1)) + xp = np.arange(len(a)) * steps + x = np.arange((len(a) - 1) * steps + 1) + return (np.column_stack([np.interp(x, xp, fp) for fp in fps.T]) + .reshape((len(x),) + a.shape[1:])) + + +def delete_masked_points(*args): + """ + Find all masked and/or non-finite points in a set of arguments, + and return the arguments with only the unmasked points remaining. + + Arguments can be in any of 5 categories: + + 1) 1-D masked arrays + 2) 1-D ndarrays + 3) ndarrays with more than one dimension + 4) other non-string iterables + 5) anything else + + The first argument must be in one of the first four categories; + any argument with a length differing from that of the first + argument (and hence anything in category 5) then will be + passed through unchanged. + + Masks are obtained from all arguments of the correct length + in categories 1, 2, and 4; a point is bad if masked in a masked + array or if it is a nan or inf. No attempt is made to + extract a mask from categories 2, 3, and 4 if `numpy.isfinite` + does not yield a Boolean array. + + All input arguments that are not passed unchanged are returned + as ndarrays after removing the points or rows corresponding to + masks in any of the arguments. + + A vastly simpler version of this function was originally + written as a helper for Axes.scatter(). + + """ + if not len(args): + return () + if is_scalar_or_string(args[0]): + raise ValueError("First argument must be a sequence") + nrecs = len(args[0]) + margs = [] + seqlist = [False] * len(args) + for i, x in enumerate(args): + if not isinstance(x, str) and np.iterable(x) and len(x) == nrecs: + seqlist[i] = True + if isinstance(x, np.ma.MaskedArray): + if x.ndim > 1: + raise ValueError("Masked arrays must be 1-D") + else: + x = np.asarray(x) + margs.append(x) + masks = [] # List of masks that are True where good. + for i, x in enumerate(margs): + if seqlist[i]: + if x.ndim > 1: + continue # Don't try to get nan locations unless 1-D. + if isinstance(x, np.ma.MaskedArray): + masks.append(~np.ma.getmaskarray(x)) # invert the mask + xd = x.data + else: + xd = x + try: + mask = np.isfinite(xd) + if isinstance(mask, np.ndarray): + masks.append(mask) + except Exception: # Fixme: put in tuple of possible exceptions? + pass + if len(masks): + mask = np.logical_and.reduce(masks) + igood = mask.nonzero()[0] + if len(igood) < nrecs: + for i, x in enumerate(margs): + if seqlist[i]: + margs[i] = x[igood] + for i, x in enumerate(margs): + if seqlist[i] and isinstance(x, np.ma.MaskedArray): + margs[i] = x.filled() + return margs + + +def _combine_masks(*args): + """ + Find all masked and/or non-finite points in a set of arguments, + and return the arguments as masked arrays with a common mask. + + Arguments can be in any of 5 categories: + + 1) 1-D masked arrays + 2) 1-D ndarrays + 3) ndarrays with more than one dimension + 4) other non-string iterables + 5) anything else + + The first argument must be in one of the first four categories; + any argument with a length differing from that of the first + argument (and hence anything in category 5) then will be + passed through unchanged. + + Masks are obtained from all arguments of the correct length + in categories 1, 2, and 4; a point is bad if masked in a masked + array or if it is a nan or inf. No attempt is made to + extract a mask from categories 2 and 4 if `numpy.isfinite` + does not yield a Boolean array. Category 3 is included to + support RGB or RGBA ndarrays, which are assumed to have only + valid values and which are passed through unchanged. + + All input arguments that are not passed unchanged are returned + as masked arrays if any masked points are found, otherwise as + ndarrays. + + """ + if not len(args): + return () + if is_scalar_or_string(args[0]): + raise ValueError("First argument must be a sequence") + nrecs = len(args[0]) + margs = [] # Output args; some may be modified. + seqlist = [False] * len(args) # Flags: True if output will be masked. + masks = [] # List of masks. + for i, x in enumerate(args): + if is_scalar_or_string(x) or len(x) != nrecs: + margs.append(x) # Leave it unmodified. + else: + if isinstance(x, np.ma.MaskedArray) and x.ndim > 1: + raise ValueError("Masked arrays must be 1-D") + try: + x = np.asanyarray(x) + except (VisibleDeprecationWarning, ValueError): + # NumPy 1.19 raises a warning about ragged arrays, but we want + # to accept basically anything here. + x = np.asanyarray(x, dtype=object) + if x.ndim == 1: + x = safe_masked_invalid(x) + seqlist[i] = True + if np.ma.is_masked(x): + masks.append(np.ma.getmaskarray(x)) + margs.append(x) # Possibly modified. + if len(masks): + mask = np.logical_or.reduce(masks) + for i, x in enumerate(margs): + if seqlist[i]: + margs[i] = np.ma.array(x, mask=mask) + return margs + + +def _broadcast_with_masks(*args, compress=False): + """ + Broadcast inputs, combining all masked arrays. + + Parameters + ---------- + *args : array-like + The inputs to broadcast. + compress : bool, default: False + Whether to compress the masked arrays. If False, the masked values + are replaced by NaNs. + + Returns + ------- + list of array-like + The broadcasted and masked inputs. + """ + # extract the masks, if any + masks = [k.mask for k in args if isinstance(k, np.ma.MaskedArray)] + # broadcast to match the shape + bcast = np.broadcast_arrays(*args, *masks) + inputs = bcast[:len(args)] + masks = bcast[len(args):] + if masks: + # combine the masks into one + mask = np.logical_or.reduce(masks) + # put mask on and compress + if compress: + inputs = [np.ma.array(k, mask=mask).compressed() + for k in inputs] + else: + inputs = [np.ma.array(k, mask=mask, dtype=float).filled(np.nan).ravel() + for k in inputs] + else: + inputs = [np.ravel(k) for k in inputs] + return inputs + + +def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None, autorange=False): + r""" + Return a list of dictionaries of statistics used to draw a series of box + and whisker plots using `~.Axes.bxp`. + + Parameters + ---------- + X : array-like + Data that will be represented in the boxplots. Should have 2 or + fewer dimensions. + + whis : float or (float, float), default: 1.5 + The position of the whiskers. + + If a float, the lower whisker is at the lowest datum above + ``Q1 - whis*(Q3-Q1)``, and the upper whisker at the highest datum below + ``Q3 + whis*(Q3-Q1)``, where Q1 and Q3 are the first and third + quartiles. The default value of ``whis = 1.5`` corresponds to Tukey's + original definition of boxplots. + + If a pair of floats, they indicate the percentiles at which to draw the + whiskers (e.g., (5, 95)). In particular, setting this to (0, 100) + results in whiskers covering the whole range of the data. + + In the edge case where ``Q1 == Q3``, *whis* is automatically set to + (0, 100) (cover the whole range of the data) if *autorange* is True. + + Beyond the whiskers, data are considered outliers and are plotted as + individual points. + + bootstrap : int, optional + Number of times the confidence intervals around the median + should be bootstrapped (percentile method). + + labels : list of str, optional + Labels for each dataset. Length must be compatible with + dimensions of *X*. + + autorange : bool, optional (False) + When `True` and the data are distributed such that the 25th and 75th + percentiles are equal, ``whis`` is set to (0, 100) such that the + whisker ends are at the minimum and maximum of the data. + + Returns + ------- + list of dict + A list of dictionaries containing the results for each column + of data. Keys of each dictionary are the following: + + ======== =================================== + Key Value Description + ======== =================================== + label tick label for the boxplot + mean arithmetic mean value + med 50th percentile + q1 first quartile (25th percentile) + q3 third quartile (75th percentile) + iqr interquartile range + cilo lower notch around the median + cihi upper notch around the median + whislo end of the lower whisker + whishi end of the upper whisker + fliers outliers + ======== =================================== + + Notes + ----- + Non-bootstrapping approach to confidence interval uses Gaussian-based + asymptotic approximation: + + .. math:: + + \mathrm{med} \pm 1.57 \times \frac{\mathrm{iqr}}{\sqrt{N}} + + General approach from: + McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of + Boxplots", The American Statistician, 32:12-16. + """ + + def _bootstrap_median(data, N=5000): + # determine 95% confidence intervals of the median + M = len(data) + percentiles = [2.5, 97.5] + + bs_index = np.random.randint(M, size=(N, M)) + bsData = data[bs_index] + estimate = np.median(bsData, axis=1, overwrite_input=True) + + CI = np.percentile(estimate, percentiles) + return CI + + def _compute_conf_interval(data, med, iqr, bootstrap): + if bootstrap is not None: + # Do a bootstrap estimate of notch locations. + # get conf. intervals around median + CI = _bootstrap_median(data, N=bootstrap) + notch_min = CI[0] + notch_max = CI[1] + else: + + N = len(data) + notch_min = med - 1.57 * iqr / np.sqrt(N) + notch_max = med + 1.57 * iqr / np.sqrt(N) + + return notch_min, notch_max + + # output is a list of dicts + bxpstats = [] + + # convert X to a list of lists + X = _reshape_2D(X, "X") + + ncols = len(X) + if labels is None: + labels = itertools.repeat(None) + elif len(labels) != ncols: + raise ValueError("Dimensions of labels and X must be compatible") + + input_whis = whis + for ii, (x, label) in enumerate(zip(X, labels)): + + # empty dict + stats = {} + if label is not None: + stats['label'] = label + + # restore whis to the input values in case it got changed in the loop + whis = input_whis + + # note tricksiness, append up here and then mutate below + bxpstats.append(stats) + + # if empty, bail + if len(x) == 0: + stats['fliers'] = np.array([]) + stats['mean'] = np.nan + stats['med'] = np.nan + stats['q1'] = np.nan + stats['q3'] = np.nan + stats['iqr'] = np.nan + stats['cilo'] = np.nan + stats['cihi'] = np.nan + stats['whislo'] = np.nan + stats['whishi'] = np.nan + continue + + # up-convert to an array, just to be safe + x = np.ma.asarray(x) + x = x.data[~x.mask].ravel() + + # arithmetic mean + stats['mean'] = np.mean(x) + + # medians and quartiles + q1, med, q3 = np.percentile(x, [25, 50, 75]) + + # interquartile range + stats['iqr'] = q3 - q1 + if stats['iqr'] == 0 and autorange: + whis = (0, 100) + + # conf. interval around median + stats['cilo'], stats['cihi'] = _compute_conf_interval( + x, med, stats['iqr'], bootstrap + ) + + # lowest/highest non-outliers + if np.iterable(whis) and not isinstance(whis, str): + loval, hival = np.percentile(x, whis) + elif np.isreal(whis): + loval = q1 - whis * stats['iqr'] + hival = q3 + whis * stats['iqr'] + else: + raise ValueError('whis must be a float or list of percentiles') + + # get high extreme + wiskhi = x[x <= hival] + if len(wiskhi) == 0 or np.max(wiskhi) < q3: + stats['whishi'] = q3 + else: + stats['whishi'] = np.max(wiskhi) + + # get low extreme + wisklo = x[x >= loval] + if len(wisklo) == 0 or np.min(wisklo) > q1: + stats['whislo'] = q1 + else: + stats['whislo'] = np.min(wisklo) + + # compute a single array of outliers + stats['fliers'] = np.concatenate([ + x[x < stats['whislo']], + x[x > stats['whishi']], + ]) + + # add in the remaining stats + stats['q1'], stats['med'], stats['q3'] = q1, med, q3 + + return bxpstats + + +#: Maps short codes for line style to their full name used by backends. +ls_mapper = {'-': 'solid', '--': 'dashed', '-.': 'dashdot', ':': 'dotted'} +#: Maps full names for line styles used by backends to their short codes. +ls_mapper_r = {v: k for k, v in ls_mapper.items()} + + +def contiguous_regions(mask): + """ + Return a list of (ind0, ind1) such that ``mask[ind0:ind1].all()`` is + True and we cover all such regions. + """ + mask = np.asarray(mask, dtype=bool) + + if not mask.size: + return [] + + # Find the indices of region changes, and correct offset + idx, = np.nonzero(mask[:-1] != mask[1:]) + idx += 1 + + # List operations are faster for moderately sized arrays + idx = idx.tolist() + + # Add first and/or last index if needed + if mask[0]: + idx = [0] + idx + if mask[-1]: + idx.append(len(mask)) + + return list(zip(idx[::2], idx[1::2])) + + +def is_math_text(s): + """ + Return whether the string *s* contains math expressions. + + This is done by checking whether *s* contains an even number of + non-escaped dollar signs. + """ + s = str(s) + dollar_count = s.count(r'$') - s.count(r'\$') + even_dollars = (dollar_count > 0 and dollar_count % 2 == 0) + return even_dollars + + +def _to_unmasked_float_array(x): + """ + Convert a sequence to a float array; if input was a masked array, masked + values are converted to nans. + """ + if hasattr(x, 'mask'): + return np.ma.asarray(x, float).filled(np.nan) + else: + return np.asarray(x, float) + + +def _check_1d(x): + """Convert scalars to 1D arrays; pass-through arrays as is.""" + # Unpack in case of e.g. Pandas or xarray object + x = _unpack_to_numpy(x) + # plot requires `shape` and `ndim`. If passed an + # object that doesn't provide them, then force to numpy array. + # Note this will strip unit information. + if (not hasattr(x, 'shape') or + not hasattr(x, 'ndim') or + len(x.shape) < 1): + return np.atleast_1d(x) + else: + return x + + +def _reshape_2D(X, name): + """ + Use Fortran ordering to convert ndarrays and lists of iterables to lists of + 1D arrays. + + Lists of iterables are converted by applying `numpy.asanyarray` to each of + their elements. 1D ndarrays are returned in a singleton list containing + them. 2D ndarrays are converted to the list of their *columns*. + + *name* is used to generate the error message for invalid inputs. + """ + + # Unpack in case of e.g. Pandas or xarray object + X = _unpack_to_numpy(X) + + # Iterate over columns for ndarrays. + if isinstance(X, np.ndarray): + X = X.transpose() + + if len(X) == 0: + return [[]] + elif X.ndim == 1 and np.ndim(X[0]) == 0: + # 1D array of scalars: directly return it. + return [X] + elif X.ndim in [1, 2]: + # 2D array, or 1D array of iterables: flatten them first. + return [np.reshape(x, -1) for x in X] + else: + raise ValueError(f'{name} must have 2 or fewer dimensions') + + # Iterate over list of iterables. + if len(X) == 0: + return [[]] + + result = [] + is_1d = True + for xi in X: + # check if this is iterable, except for strings which we + # treat as singletons. + if not isinstance(xi, str): + try: + iter(xi) + except TypeError: + pass + else: + is_1d = False + xi = np.asanyarray(xi) + nd = np.ndim(xi) + if nd > 1: + raise ValueError(f'{name} must have 2 or fewer dimensions') + result.append(xi.reshape(-1)) + + if is_1d: + # 1D array of scalars: directly return it. + return [np.reshape(result, -1)] + else: + # 2D array, or 1D array of iterables: use flattened version. + return result + + +def violin_stats(X, method, points=100, quantiles=None): + """ + Return a list of dictionaries of data which can be used to draw a series + of violin plots. + + See the ``Returns`` section below to view the required keys of the + dictionary. + + Users can skip this function and pass a user-defined set of dictionaries + with the same keys to `~.axes.Axes.violinplot` instead of using Matplotlib + to do the calculations. See the *Returns* section below for the keys + that must be present in the dictionaries. + + Parameters + ---------- + X : array-like + Sample data that will be used to produce the gaussian kernel density + estimates. Must have 2 or fewer dimensions. + + method : callable + The method used to calculate the kernel density estimate for each + column of data. When called via ``method(v, coords)``, it should + return a vector of the values of the KDE evaluated at the values + specified in coords. + + points : int, default: 100 + Defines the number of points to evaluate each of the gaussian kernel + density estimates at. + + quantiles : array-like, default: None + Defines (if not None) a list of floats in interval [0, 1] for each + column of data, which represents the quantiles that will be rendered + for that column of data. Must have 2 or fewer dimensions. 1D array will + be treated as a singleton list containing them. + + Returns + ------- + list of dict + A list of dictionaries containing the results for each column of data. + The dictionaries contain at least the following: + + - coords: A list of scalars containing the coordinates this particular + kernel density estimate was evaluated at. + - vals: A list of scalars containing the values of the kernel density + estimate at each of the coordinates given in *coords*. + - mean: The mean value for this column of data. + - median: The median value for this column of data. + - min: The minimum value for this column of data. + - max: The maximum value for this column of data. + - quantiles: The quantile values for this column of data. + """ + + # List of dictionaries describing each of the violins. + vpstats = [] + + # Want X to be a list of data sequences + X = _reshape_2D(X, "X") + + # Want quantiles to be as the same shape as data sequences + if quantiles is not None and len(quantiles) != 0: + quantiles = _reshape_2D(quantiles, "quantiles") + # Else, mock quantiles if it's none or empty + else: + quantiles = [[]] * len(X) + + # quantiles should have the same size as dataset + if len(X) != len(quantiles): + raise ValueError("List of violinplot statistics and quantiles values" + " must have the same length") + + # Zip x and quantiles + for (x, q) in zip(X, quantiles): + # Dictionary of results for this distribution + stats = {} + + # Calculate basic stats for the distribution + min_val = np.min(x) + max_val = np.max(x) + quantile_val = np.percentile(x, 100 * q) + + # Evaluate the kernel density estimate + coords = np.linspace(min_val, max_val, points) + stats['vals'] = method(x, coords) + stats['coords'] = coords + + # Store additional statistics for this distribution + stats['mean'] = np.mean(x) + stats['median'] = np.median(x) + stats['min'] = min_val + stats['max'] = max_val + stats['quantiles'] = np.atleast_1d(quantile_val) + + # Append to output + vpstats.append(stats) + + return vpstats + + +def pts_to_prestep(x, *args): + """ + Convert continuous line to pre-steps. + + Given a set of ``N`` points, convert to ``2N - 1`` points, which when + connected linearly give a step function which changes values at the + beginning of the intervals. + + Parameters + ---------- + x : array + The x location of the steps. May be empty. + + y1, ..., yp : array + y arrays to be turned into steps; all must be the same length as ``x``. + + Returns + ------- + array + The x and y values converted to steps in the same order as the input; + can be unpacked as ``x_out, y1_out, ..., yp_out``. If the input is + length ``N``, each of these arrays will be length ``2N + 1``. For + ``N=0``, the length will be 0. + + Examples + -------- + >>> x_s, y1_s, y2_s = pts_to_prestep(x, y1, y2) + """ + steps = np.zeros((1 + len(args), max(2 * len(x) - 1, 0))) + # In all `pts_to_*step` functions, only assign once using *x* and *args*, + # as converting to an array may be expensive. + steps[0, 0::2] = x + steps[0, 1::2] = steps[0, 0:-2:2] + steps[1:, 0::2] = args + steps[1:, 1::2] = steps[1:, 2::2] + return steps + + +def pts_to_poststep(x, *args): + """ + Convert continuous line to post-steps. + + Given a set of ``N`` points convert to ``2N + 1`` points, which when + connected linearly give a step function which changes values at the end of + the intervals. + + Parameters + ---------- + x : array + The x location of the steps. May be empty. + + y1, ..., yp : array + y arrays to be turned into steps; all must be the same length as ``x``. + + Returns + ------- + array + The x and y values converted to steps in the same order as the input; + can be unpacked as ``x_out, y1_out, ..., yp_out``. If the input is + length ``N``, each of these arrays will be length ``2N + 1``. For + ``N=0``, the length will be 0. + + Examples + -------- + >>> x_s, y1_s, y2_s = pts_to_poststep(x, y1, y2) + """ + steps = np.zeros((1 + len(args), max(2 * len(x) - 1, 0))) + steps[0, 0::2] = x + steps[0, 1::2] = steps[0, 2::2] + steps[1:, 0::2] = args + steps[1:, 1::2] = steps[1:, 0:-2:2] + return steps + + +def pts_to_midstep(x, *args): + """ + Convert continuous line to mid-steps. + + Given a set of ``N`` points convert to ``2N`` points which when connected + linearly give a step function which changes values at the middle of the + intervals. + + Parameters + ---------- + x : array + The x location of the steps. May be empty. + + y1, ..., yp : array + y arrays to be turned into steps; all must be the same length as + ``x``. + + Returns + ------- + array + The x and y values converted to steps in the same order as the input; + can be unpacked as ``x_out, y1_out, ..., yp_out``. If the input is + length ``N``, each of these arrays will be length ``2N``. + + Examples + -------- + >>> x_s, y1_s, y2_s = pts_to_midstep(x, y1, y2) + """ + steps = np.zeros((1 + len(args), 2 * len(x))) + x = np.asanyarray(x) + steps[0, 1:-1:2] = steps[0, 2::2] = (x[:-1] + x[1:]) / 2 + steps[0, :1] = x[:1] # Also works for zero-sized input. + steps[0, -1:] = x[-1:] + steps[1:, 0::2] = args + steps[1:, 1::2] = steps[1:, 0::2] + return steps + + +STEP_LOOKUP_MAP = {'default': lambda x, y: (x, y), + 'steps': pts_to_prestep, + 'steps-pre': pts_to_prestep, + 'steps-post': pts_to_poststep, + 'steps-mid': pts_to_midstep} + + +def index_of(y): + """ + A helper function to create reasonable x values for the given *y*. + + This is used for plotting (x, y) if x values are not explicitly given. + + First try ``y.index`` (assuming *y* is a `pandas.Series`), if that + fails, use ``range(len(y))``. + + This will be extended in the future to deal with more types of + labeled data. + + Parameters + ---------- + y : float or array-like + + Returns + ------- + x, y : ndarray + The x and y values to plot. + """ + try: + return y.index.to_numpy(), y.to_numpy() + except AttributeError: + pass + try: + y = _check_1d(y) + except (VisibleDeprecationWarning, ValueError): + # NumPy 1.19 will warn on ragged input, and we can't actually use it. + pass + else: + return np.arange(y.shape[0], dtype=float), y + raise ValueError('Input could not be cast to an at-least-1D NumPy array') + + +def safe_first_element(obj): + """ + Return the first element in *obj*. + + This is a type-independent way of obtaining the first element, + supporting both index access and the iterator protocol. + """ + if isinstance(obj, collections.abc.Iterator): + # needed to accept `array.flat` as input. + # np.flatiter reports as an instance of collections.Iterator but can still be + # indexed via []. This has the side effect of re-setting the iterator, but + # that is acceptable. + try: + return obj[0] + except TypeError: + pass + raise RuntimeError("matplotlib does not support generators as input") + return next(iter(obj)) + + +def _safe_first_finite(obj): + """ + Return the first finite element in *obj* if one is available and skip_nonfinite is + True. Otherwise, return the first element. + + This is a method for internal use. + + This is a type-independent way of obtaining the first finite element, supporting + both index access and the iterator protocol. + """ + def safe_isfinite(val): + if val is None: + return False + try: + return math.isfinite(val) + except (TypeError, ValueError): + # if the outer object is 2d, then val is a 1d array, and + # - math.isfinite(numpy.zeros(3)) raises TypeError + # - math.isfinite(torch.zeros(3)) raises ValueError + pass + try: + return np.isfinite(val) if np.isscalar(val) else True + except TypeError: + # This is something that NumPy cannot make heads or tails of, + # assume "finite" + return True + + if isinstance(obj, np.flatiter): + # TODO do the finite filtering on this + return obj[0] + elif isinstance(obj, collections.abc.Iterator): + raise RuntimeError("matplotlib does not support generators as input") + else: + for val in obj: + if safe_isfinite(val): + return val + return safe_first_element(obj) + + +def sanitize_sequence(data): + """ + Convert dictview objects to list. Other inputs are returned unchanged. + """ + return (list(data) if isinstance(data, collections.abc.MappingView) + else data) + + +def normalize_kwargs(kw, alias_mapping=None): + """ + Helper function to normalize kwarg inputs. + + Parameters + ---------- + kw : dict or None + A dict of keyword arguments. None is explicitly supported and treated + as an empty dict, to support functions with an optional parameter of + the form ``props=None``. + + alias_mapping : dict or Artist subclass or Artist instance, optional + A mapping between a canonical name to a list of aliases, in order of + precedence from lowest to highest. + + If the canonical value is not in the list it is assumed to have the + highest priority. + + If an Artist subclass or instance is passed, use its properties alias + mapping. + + Raises + ------ + TypeError + To match what Python raises if invalid arguments/keyword arguments are + passed to a callable. + """ + from matplotlib.artist import Artist + + if kw is None: + return {} + + # deal with default value of alias_mapping + if alias_mapping is None: + alias_mapping = {} + elif (isinstance(alias_mapping, type) and issubclass(alias_mapping, Artist) + or isinstance(alias_mapping, Artist)): + alias_mapping = getattr(alias_mapping, "_alias_map", {}) + + to_canonical = {alias: canonical + for canonical, alias_list in alias_mapping.items() + for alias in alias_list} + canonical_to_seen = {} + ret = {} # output dictionary + + for k, v in kw.items(): + canonical = to_canonical.get(k, k) + if canonical in canonical_to_seen: + raise TypeError(f"Got both {canonical_to_seen[canonical]!r} and " + f"{k!r}, which are aliases of one another") + canonical_to_seen[canonical] = k + ret[canonical] = v + + return ret + + +@contextlib.contextmanager +def _lock_path(path): + """ + Context manager for locking a path. + + Usage:: + + with _lock_path(path): + ... + + Another thread or process that attempts to lock the same path will wait + until this context manager is exited. + + The lock is implemented by creating a temporary file in the parent + directory, so that directory must exist and be writable. + """ + path = Path(path) + lock_path = path.with_name(path.name + ".matplotlib-lock") + retries = 50 + sleeptime = 0.1 + for _ in range(retries): + try: + with lock_path.open("xb"): + break + except FileExistsError: + time.sleep(sleeptime) + else: + raise TimeoutError("""\ +Lock error: Matplotlib failed to acquire the following lock file: + {} +This maybe due to another process holding this lock file. If you are sure no +other Matplotlib process is running, remove this file and try again.""".format( + lock_path)) + try: + yield + finally: + lock_path.unlink() + + +def _topmost_artist( + artists, + _cached_max=functools.partial(max, key=operator.attrgetter("zorder"))): + """ + Get the topmost artist of a list. + + In case of a tie, return the *last* of the tied artists, as it will be + drawn on top of the others. `max` returns the first maximum in case of + ties, so we need to iterate over the list in reverse order. + """ + return _cached_max(reversed(artists)) + + +def _str_equal(obj, s): + """ + Return whether *obj* is a string equal to string *s*. + + This helper solely exists to handle the case where *obj* is a numpy array, + because in such cases, a naive ``obj == s`` would yield an array, which + cannot be used in a boolean context. + """ + return isinstance(obj, str) and obj == s + + +def _str_lower_equal(obj, s): + """ + Return whether *obj* is a string equal, when lowercased, to string *s*. + + This helper solely exists to handle the case where *obj* is a numpy array, + because in such cases, a naive ``obj == s`` would yield an array, which + cannot be used in a boolean context. + """ + return isinstance(obj, str) and obj.lower() == s + + +def _array_perimeter(arr): + """ + Get the elements on the perimeter of *arr*. + + Parameters + ---------- + arr : ndarray, shape (M, N) + The input array. + + Returns + ------- + ndarray, shape (2*(M - 1) + 2*(N - 1),) + The elements on the perimeter of the array:: + + [arr[0, 0], ..., arr[0, -1], ..., arr[-1, -1], ..., arr[-1, 0], ...] + + Examples + -------- + >>> i, j = np.ogrid[:3, :4] + >>> a = i*10 + j + >>> a + array([[ 0, 1, 2, 3], + [10, 11, 12, 13], + [20, 21, 22, 23]]) + >>> _array_perimeter(a) + array([ 0, 1, 2, 3, 13, 23, 22, 21, 20, 10]) + """ + # note we use Python's half-open ranges to avoid repeating + # the corners + forward = np.s_[0:-1] # [0 ... -1) + backward = np.s_[-1:0:-1] # [-1 ... 0) + return np.concatenate(( + arr[0, forward], + arr[forward, -1], + arr[-1, backward], + arr[backward, 0], + )) + + +def _unfold(arr, axis, size, step): + """ + Append an extra dimension containing sliding windows along *axis*. + + All windows are of size *size* and begin with every *step* elements. + + Parameters + ---------- + arr : ndarray, shape (N_1, ..., N_k) + The input array + axis : int + Axis along which the windows are extracted + size : int + Size of the windows + step : int + Stride between first elements of subsequent windows. + + Returns + ------- + ndarray, shape (N_1, ..., 1 + (N_axis-size)/step, ..., N_k, size) + + Examples + -------- + >>> i, j = np.ogrid[:3, :7] + >>> a = i*10 + j + >>> a + array([[ 0, 1, 2, 3, 4, 5, 6], + [10, 11, 12, 13, 14, 15, 16], + [20, 21, 22, 23, 24, 25, 26]]) + >>> _unfold(a, axis=1, size=3, step=2) + array([[[ 0, 1, 2], + [ 2, 3, 4], + [ 4, 5, 6]], + [[10, 11, 12], + [12, 13, 14], + [14, 15, 16]], + [[20, 21, 22], + [22, 23, 24], + [24, 25, 26]]]) + """ + new_shape = [*arr.shape, size] + new_strides = [*arr.strides, arr.strides[axis]] + new_shape[axis] = (new_shape[axis] - size) // step + 1 + new_strides[axis] = new_strides[axis] * step + return np.lib.stride_tricks.as_strided(arr, + shape=new_shape, + strides=new_strides, + writeable=False) + + +def _array_patch_perimeters(x, rstride, cstride): + """ + Extract perimeters of patches from *arr*. + + Extracted patches are of size (*rstride* + 1) x (*cstride* + 1) and + share perimeters with their neighbors. The ordering of the vertices matches + that returned by ``_array_perimeter``. + + Parameters + ---------- + x : ndarray, shape (N, M) + Input array + rstride : int + Vertical (row) stride between corresponding elements of each patch + cstride : int + Horizontal (column) stride between corresponding elements of each patch + + Returns + ------- + ndarray, shape (N/rstride * M/cstride, 2 * (rstride + cstride)) + """ + assert rstride > 0 and cstride > 0 + assert (x.shape[0] - 1) % rstride == 0 + assert (x.shape[1] - 1) % cstride == 0 + # We build up each perimeter from four half-open intervals. Here is an + # illustrated explanation for rstride == cstride == 3 + # + # T T T R + # L R + # L R + # L B B B + # + # where T means that this element will be in the top array, R for right, + # B for bottom and L for left. Each of the arrays below has a shape of: + # + # (number of perimeters that can be extracted vertically, + # number of perimeters that can be extracted horizontally, + # cstride for top and bottom and rstride for left and right) + # + # Note that _unfold doesn't incur any memory copies, so the only costly + # operation here is the np.concatenate. + top = _unfold(x[:-1:rstride, :-1], 1, cstride, cstride) + bottom = _unfold(x[rstride::rstride, 1:], 1, cstride, cstride)[..., ::-1] + right = _unfold(x[:-1, cstride::cstride], 0, rstride, rstride) + left = _unfold(x[1:, :-1:cstride], 0, rstride, rstride)[..., ::-1] + return (np.concatenate((top, right, bottom, left), axis=2) + .reshape(-1, 2 * (rstride + cstride))) + + +@contextlib.contextmanager +def _setattr_cm(obj, **kwargs): + """ + Temporarily set some attributes; restore original state at context exit. + """ + sentinel = object() + origs = {} + for attr in kwargs: + orig = getattr(obj, attr, sentinel) + if attr in obj.__dict__ or orig is sentinel: + # if we are pulling from the instance dict or the object + # does not have this attribute we can trust the above + origs[attr] = orig + else: + # if the attribute is not in the instance dict it must be + # from the class level + cls_orig = getattr(type(obj), attr) + # if we are dealing with a property (but not a general descriptor) + # we want to set the original value back. + if isinstance(cls_orig, property): + origs[attr] = orig + # otherwise this is _something_ we are going to shadow at + # the instance dict level from higher up in the MRO. We + # are going to assume we can delattr(obj, attr) to clean + # up after ourselves. It is possible that this code will + # fail if used with a non-property custom descriptor which + # implements __set__ (and __delete__ does not act like a + # stack). However, this is an internal tool and we do not + # currently have any custom descriptors. + else: + origs[attr] = sentinel + + try: + for attr, val in kwargs.items(): + setattr(obj, attr, val) + yield + finally: + for attr, orig in origs.items(): + if orig is sentinel: + delattr(obj, attr) + else: + setattr(obj, attr, orig) + + +class _OrderedSet(collections.abc.MutableSet): + def __init__(self): + self._od = collections.OrderedDict() + + def __contains__(self, key): + return key in self._od + + def __iter__(self): + return iter(self._od) + + def __len__(self): + return len(self._od) + + def add(self, key): + self._od.pop(key, None) + self._od[key] = None + + def discard(self, key): + self._od.pop(key, None) + + +# Agg's buffers are unmultiplied RGBA8888, which neither PyQt<=5.1 nor cairo +# support; however, both do support premultiplied ARGB32. + + +def _premultiplied_argb32_to_unmultiplied_rgba8888(buf): + """ + Convert a premultiplied ARGB32 buffer to an unmultiplied RGBA8888 buffer. + """ + rgba = np.take( # .take() ensures C-contiguity of the result. + buf, + [2, 1, 0, 3] if sys.byteorder == "little" else [1, 2, 3, 0], axis=2) + rgb = rgba[..., :-1] + alpha = rgba[..., -1] + # Un-premultiply alpha. The formula is the same as in cairo-png.c. + mask = alpha != 0 + for channel in np.rollaxis(rgb, -1): + channel[mask] = ( + (channel[mask].astype(int) * 255 + alpha[mask] // 2) + // alpha[mask]) + return rgba + + +def _unmultiplied_rgba8888_to_premultiplied_argb32(rgba8888): + """ + Convert an unmultiplied RGBA8888 buffer to a premultiplied ARGB32 buffer. + """ + if sys.byteorder == "little": + argb32 = np.take(rgba8888, [2, 1, 0, 3], axis=2) + rgb24 = argb32[..., :-1] + alpha8 = argb32[..., -1:] + else: + argb32 = np.take(rgba8888, [3, 0, 1, 2], axis=2) + alpha8 = argb32[..., :1] + rgb24 = argb32[..., 1:] + # Only bother premultiplying when the alpha channel is not fully opaque, + # as the cost is not negligible. The unsafe cast is needed to do the + # multiplication in-place in an integer buffer. + if alpha8.min() != 0xff: + np.multiply(rgb24, alpha8 / 0xff, out=rgb24, casting="unsafe") + return argb32 + + +def _get_nonzero_slices(buf): + """ + Return the bounds of the nonzero region of a 2D array as a pair of slices. + + ``buf[_get_nonzero_slices(buf)]`` is the smallest sub-rectangle in *buf* + that encloses all non-zero entries in *buf*. If *buf* is fully zero, then + ``(slice(0, 0), slice(0, 0))`` is returned. + """ + x_nz, = buf.any(axis=0).nonzero() + y_nz, = buf.any(axis=1).nonzero() + if len(x_nz) and len(y_nz): + l, r = x_nz[[0, -1]] + b, t = y_nz[[0, -1]] + return slice(b, t + 1), slice(l, r + 1) + else: + return slice(0, 0), slice(0, 0) + + +def _pformat_subprocess(command): + """Pretty-format a subprocess command for printing/logging purposes.""" + return (command if isinstance(command, str) + else " ".join(shlex.quote(os.fspath(arg)) for arg in command)) + + +def _check_and_log_subprocess(command, logger, **kwargs): + """ + Run *command*, returning its stdout output if it succeeds. + + If it fails (exits with nonzero return code), raise an exception whose text + includes the failed command and captured stdout and stderr output. + + Regardless of the return code, the command is logged at DEBUG level on + *logger*. In case of success, the output is likewise logged. + """ + logger.debug('%s', _pformat_subprocess(command)) + proc = subprocess.run(command, capture_output=True, **kwargs) + if proc.returncode: + stdout = proc.stdout + if isinstance(stdout, bytes): + stdout = stdout.decode() + stderr = proc.stderr + if isinstance(stderr, bytes): + stderr = stderr.decode() + raise RuntimeError( + f"The command\n" + f" {_pformat_subprocess(command)}\n" + f"failed and generated the following output:\n" + f"{stdout}\n" + f"and the following error:\n" + f"{stderr}") + if proc.stdout: + logger.debug("stdout:\n%s", proc.stdout) + if proc.stderr: + logger.debug("stderr:\n%s", proc.stderr) + return proc.stdout + + +def _setup_new_guiapp(): + """ + Perform OS-dependent setup when Matplotlib creates a new GUI application. + """ + # Windows: If not explicit app user model id has been set yet (so we're not + # already embedded), then set it to "matplotlib", so that taskbar icons are + # correct. + try: + _c_internal_utils.Win32_GetCurrentProcessExplicitAppUserModelID() + except OSError: + _c_internal_utils.Win32_SetCurrentProcessExplicitAppUserModelID( + "matplotlib") + + +def _format_approx(number, precision): + """ + Format the number with at most the number of decimals given as precision. + Remove trailing zeros and possibly the decimal point. + """ + return f'{number:.{precision}f}'.rstrip('0').rstrip('.') or '0' + + +def _g_sig_digits(value, delta): + """ + Return the number of significant digits to %g-format *value*, assuming that + it is known with an error of *delta*. + """ + # For inf or nan, the precision doesn't matter. + if not math.isfinite(value): + return 0 + if delta == 0: + if value == 0: + # if both value and delta are 0, np.spacing below returns 5e-324 + # which results in rather silly results + return 3 + # delta = 0 may occur when trying to format values over a tiny range; + # in that case, replace it by the distance to the closest float. + delta = abs(np.spacing(value)) + # If e.g. value = 45.67 and delta = 0.02, then we want to round to 2 digits + # after the decimal point (floor(log10(0.02)) = -2); 45.67 contributes 2 + # digits before the decimal point (floor(log10(45.67)) + 1 = 2): the total + # is 4 significant digits. A value of 0 contributes 1 "digit" before the + # decimal point. + return max( + 0, + (math.floor(math.log10(abs(value))) + 1 if value else 1) + - math.floor(math.log10(delta))) + + +def _unikey_or_keysym_to_mplkey(unikey, keysym): + """ + Convert a Unicode key or X keysym to a Matplotlib key name. + + The Unicode key is checked first; this avoids having to list most printable + keysyms such as ``EuroSign``. + """ + # For non-printable characters, gtk3 passes "\0" whereas tk passes an "". + if unikey and unikey.isprintable(): + return unikey + key = keysym.lower() + if key.startswith("kp_"): # keypad_x (including kp_enter). + key = key[3:] + if key.startswith("page_"): # page_{up,down} + key = key.replace("page_", "page") + if key.endswith(("_l", "_r")): # alt_l, ctrl_l, shift_l. + key = key[:-2] + if sys.platform == "darwin" and key == "meta": + # meta should be reported as command on mac + key = "cmd" + key = { + "return": "enter", + "prior": "pageup", # Used by tk. + "next": "pagedown", # Used by tk. + }.get(key, key) + return key + + +@functools.cache +def _make_class_factory(mixin_class, fmt, attr_name=None): + """ + Return a function that creates picklable classes inheriting from a mixin. + + After :: + + factory = _make_class_factory(FooMixin, fmt, attr_name) + FooAxes = factory(Axes) + + ``Foo`` is a class that inherits from ``FooMixin`` and ``Axes`` and **is + picklable** (picklability is what differentiates this from a plain call to + `type`). Its ``__name__`` is set to ``fmt.format(Axes.__name__)`` and the + base class is stored in the ``attr_name`` attribute, if not None. + + Moreover, the return value of ``factory`` is memoized: calls with the same + ``Axes`` class always return the same subclass. + """ + + @functools.cache + def class_factory(axes_class): + # if we have already wrapped this class, declare victory! + if issubclass(axes_class, mixin_class): + return axes_class + + # The parameter is named "axes_class" for backcompat but is really just + # a base class; no axes semantics are used. + base_class = axes_class + + class subcls(mixin_class, base_class): + # Better approximation than __module__ = "matplotlib.cbook". + __module__ = mixin_class.__module__ + + def __reduce__(self): + return (_picklable_class_constructor, + (mixin_class, fmt, attr_name, base_class), + self.__getstate__()) + + subcls.__name__ = subcls.__qualname__ = fmt.format(base_class.__name__) + if attr_name is not None: + setattr(subcls, attr_name, base_class) + return subcls + + class_factory.__module__ = mixin_class.__module__ + return class_factory + + +def _picklable_class_constructor(mixin_class, fmt, attr_name, base_class): + """Internal helper for _make_class_factory.""" + factory = _make_class_factory(mixin_class, fmt, attr_name) + cls = factory(base_class) + return cls.__new__(cls) + + +def _is_torch_array(x): + """Return whether *x* is a PyTorch Tensor.""" + try: + # We're intentionally not attempting to import torch. If somebody + # has created a torch array, torch should already be in sys.modules. + tp = sys.modules.get("torch").Tensor + except AttributeError: + return False # Module not imported or a nonstandard module with no Tensor attr. + return (isinstance(tp, type) # Just in case it's a very nonstandard module. + and isinstance(x, tp)) + + +def _is_jax_array(x): + """Return whether *x* is a JAX Array.""" + try: + # We're intentionally not attempting to import jax. If somebody + # has created a jax array, jax should already be in sys.modules. + tp = sys.modules.get("jax").Array + except AttributeError: + return False # Module not imported or a nonstandard module with no Array attr. + return (isinstance(tp, type) # Just in case it's a very nonstandard module. + and isinstance(x, tp)) + + +def _is_pandas_dataframe(x): + """Check if *x* is a Pandas DataFrame.""" + try: + # We're intentionally not attempting to import Pandas. If somebody + # has created a Pandas DataFrame, Pandas should already be in sys.modules. + tp = sys.modules.get("pandas").DataFrame + except AttributeError: + return False # Module not imported or a nonstandard module with no Array attr. + return (isinstance(tp, type) # Just in case it's a very nonstandard module. + and isinstance(x, tp)) + + +def _is_tensorflow_array(x): + """Return whether *x* is a TensorFlow Tensor or Variable.""" + try: + # We're intentionally not attempting to import TensorFlow. If somebody + # has created a TensorFlow array, TensorFlow should already be in + # sys.modules we use `is_tensor` to not depend on the class structure + # of TensorFlow arrays, as `tf.Variables` are not instances of + # `tf.Tensor` (they both convert the same way). + is_tensor = sys.modules.get("tensorflow").is_tensor + except AttributeError: + return False + try: + return is_tensor(x) + except Exception: + return False # Just in case it's a very nonstandard module. + + +def _unpack_to_numpy(x): + """Internal helper to extract data from e.g. pandas and xarray objects.""" + if isinstance(x, np.ndarray): + # If numpy, return directly + return x + if hasattr(x, 'to_numpy'): + # Assume that any to_numpy() method actually returns a numpy array + return x.to_numpy() + if hasattr(x, 'values'): + xtmp = x.values + # For example a dict has a 'values' attribute, but it is not a property + # so in this case we do not want to return a function + if isinstance(xtmp, np.ndarray): + return xtmp + if _is_torch_array(x) or _is_jax_array(x) or _is_tensorflow_array(x): + # using np.asarray() instead of explicitly __array__(), as the latter is + # only _one_ of many methods, and it's the last resort, see also + # https://numpy.org/devdocs/user/basics.interoperability.html#using-arbitrary-objects-in-numpy + # therefore, let arrays do better if they can + xtmp = np.asarray(x) + + # In case np.asarray method does not return a numpy array in future + if isinstance(xtmp, np.ndarray): + return xtmp + return x + + +def _auto_format_str(fmt, value): + """ + Apply *value* to the format string *fmt*. + + This works both with unnamed %-style formatting and + unnamed {}-style formatting. %-style formatting has priority. + If *fmt* is %-style formattable that will be used. Otherwise, + {}-formatting is applied. Strings without formatting placeholders + are passed through as is. + + Examples + -------- + >>> _auto_format_str('%.2f m', 0.2) + '0.20 m' + >>> _auto_format_str('{} m', 0.2) + '0.2 m' + >>> _auto_format_str('const', 0.2) + 'const' + >>> _auto_format_str('%d or {}', 0.2) + '0 or {}' + """ + try: + return fmt % (value,) + except (TypeError, ValueError): + return fmt.format(value) diff --git a/shared/package-files/9c/9c5e5810c9de4075508c9dad255d2895b576709d37feda5f415a7cbeb097956c/blob b/shared/package-files/9c/9c5e5810c9de4075508c9dad255d2895b576709d37feda5f415a7cbeb097956c/blob new file mode 100644 index 0000000000000000000000000000000000000000..764e1ad821c4fe73efcc44f87e87b5d3d5e87c03 --- /dev/null +++ b/shared/package-files/9c/9c5e5810c9de4075508c9dad255d2895b576709d37feda5f415a7cbeb097956c/blob @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::unsafe_split_with_sizes(Tensor self, SymInt[] split_sizes, int dim=0) -> Tensor[] +inline ::std::vector unsafe_split_with_sizes(const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::unsafe_split_with_sizes::call(self, c10::fromIntArrayRefSlow(split_sizes), dim); +} +namespace symint { + template ::value>> + ::std::vector unsafe_split_with_sizes(const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::unsafe_split_with_sizes::call(self, c10::fromIntArrayRefSlow(split_sizes), dim); + } +} + +// aten::unsafe_split_with_sizes(Tensor self, SymInt[] split_sizes, int dim=0) -> Tensor[] +inline ::std::vector unsafe_split_with_sizes_symint(const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::unsafe_split_with_sizes::call(self, split_sizes, dim); +} +namespace symint { + template ::value>> + ::std::vector unsafe_split_with_sizes(const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::unsafe_split_with_sizes::call(self, split_sizes, dim); + } +} + +// aten::unsafe_split_with_sizes.out(Tensor self, SymInt[] split_sizes, int dim=0, *, Tensor(a!)[] out) -> () +inline void unsafe_split_with_sizes_out(at::TensorList out, const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::unsafe_split_with_sizes_out::call(self, c10::fromIntArrayRefSlow(split_sizes), dim, out); +} +namespace symint { + template ::value>> + void unsafe_split_with_sizes_out(at::TensorList out, const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::unsafe_split_with_sizes_out::call(self, c10::fromIntArrayRefSlow(split_sizes), dim, out); + } +} + +// aten::unsafe_split_with_sizes.out(Tensor self, SymInt[] split_sizes, int dim=0, *, Tensor(a!)[] out) -> () +inline void unsafe_split_with_sizes_outf(const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim, at::TensorList out) { + return at::_ops::unsafe_split_with_sizes_out::call(self, c10::fromIntArrayRefSlow(split_sizes), dim, out); +} +namespace symint { + template ::value>> + void unsafe_split_with_sizes_outf(const at::Tensor & self, at::IntArrayRef split_sizes, int64_t dim, at::TensorList out) { + return at::_ops::unsafe_split_with_sizes_out::call(self, c10::fromIntArrayRefSlow(split_sizes), dim, out); + } +} + +// aten::unsafe_split_with_sizes.out(Tensor self, SymInt[] split_sizes, int dim=0, *, Tensor(a!)[] out) -> () +inline void unsafe_split_with_sizes_symint_out(at::TensorList out, const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::unsafe_split_with_sizes_out::call(self, split_sizes, dim, out); +} +namespace symint { + template ::value>> + void unsafe_split_with_sizes_out(at::TensorList out, const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim=0) { + return at::_ops::unsafe_split_with_sizes_out::call(self, split_sizes, dim, out); + } +} + +// aten::unsafe_split_with_sizes.out(Tensor self, SymInt[] split_sizes, int dim=0, *, Tensor(a!)[] out) -> () +inline void unsafe_split_with_sizes_symint_outf(const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim, at::TensorList out) { + return at::_ops::unsafe_split_with_sizes_out::call(self, split_sizes, dim, out); +} +namespace symint { + template ::value>> + void unsafe_split_with_sizes_outf(const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim, at::TensorList out) { + return at::_ops::unsafe_split_with_sizes_out::call(self, split_sizes, dim, out); + } +} + +} diff --git a/shared/package-files/9c/9c5ef418e851921e7be6cc706dc4c669f4a52e5dba63a5303585ac95a1a97fc3/blob b/shared/package-files/9c/9c5ef418e851921e7be6cc706dc4c669f4a52e5dba63a5303585ac95a1a97fc3/blob new file mode 100644 index 0000000000000000000000000000000000000000..da675e0f3dae8690f16957d1ecc2b0f245b40175 --- /dev/null +++ b/shared/package-files/9c/9c5ef418e851921e7be6cc706dc4c669f4a52e5dba63a5303585ac95a1a97fc3/blob @@ -0,0 +1,157 @@ +#pragma once + +#include +#include + +#include + +namespace torch { +namespace profiler { +namespace impl { + +// ---------------------------------------------------------------------------- +// -- Profiler Config --------------------------------------------------------- +// ---------------------------------------------------------------------------- +enum class C10_API_ENUM ActivityType { + CPU = 0, + XPU, // XPU kernels, runtime + CUDA, // CUDA kernels, runtime + MTIA, // MTIA kernels, runtime + NUM_KINETO_ACTIVITIES, // must be the last one +}; + +enum class C10_API_ENUM ProfilerState { + Disabled = 0, + CPU, // CPU-only profiling + CUDA, // CPU + CUDA events + NVTX, // only emit NVTX markers + ITT, // only emit ITT markers + KINETO, // use libkineto + KINETO_GPU_FALLBACK, // use CUDA events when CUPTI is not available + KINETO_PRIVATEUSE1_FALLBACK, // use PrivateUse1 events + KINETO_ONDEMAND, // run the profiler in on-demand mode + NUM_PROFILER_STATES, // must be the last one +}; + +enum class C10_API_ENUM ActiveProfilerType { + NONE = 0, + LEGACY, + KINETO, + NVTX, + ITT +}; + +struct TORCH_API ExperimentalConfig { + ExperimentalConfig( + std::vector profiler_metrics = {}, + bool profiler_measure_per_kernel = false, + bool verbose = false, + std::vector performance_events = {}, + bool enable_cuda_sync_events = false, + bool adjust_timestamps = false); + explicit operator bool() const; + + std::vector profiler_metrics; + bool profiler_measure_per_kernel; + bool verbose; + /* + * List of performance events to be profiled. + * An empty list will disable performance event based profiling altogether. + */ + std::vector performance_events; + /* + * For CUDA profiling mode, enable adding CUDA synchronization events + * that expose CUDA device, stream and event synchronization activities. + * This feature is new and currently disabled by default. + */ + bool enable_cuda_sync_events; + /* + * Controls whether or not timestamp adjustment occurs after profiling. + * The purpose of this is to adjust Vulkan event timelines to align with those + * of their parent CPU events. + * This sometimes requires increasing CPU event durations (to fully contain + * their child events) and delaying CPU event start times (to + * prevent overlaps), so this should not be used unless Vulkan events are + * being profiled and it is ok to use this modified timestamp/duration + * information instead of the original information. + */ + bool adjust_timestamps; +}; + +struct TORCH_API ProfilerConfig { + ProfilerConfig( + ProfilerState state, + bool report_input_shapes = false, + bool profile_memory = false, + bool with_stack = false, + bool with_flops = false, + bool with_modules = false, + ExperimentalConfig experimental_config = ExperimentalConfig()); + + bool disabled() const; + bool global() const; + + ProfilerState state; + ExperimentalConfig experimental_config; + bool report_input_shapes; + bool profile_memory; + bool with_stack; + bool with_flops; + bool with_modules; + + // For serialization + at::IValue toIValue() const; + static ProfilerConfig fromIValue(const at::IValue& profilerConfigIValue); +}; + +// ---------------------------------------------------------------------------- +// -- Profiler base class ----------------------------------------------------- +// ---------------------------------------------------------------------------- +struct TORCH_API ProfilerStateBase : public c10::MemoryReportingInfoBase { + explicit ProfilerStateBase(ProfilerConfig config); + ~ProfilerStateBase() override; + + static ProfilerStateBase* get(bool global); + static ProfilerStateBase* get() { + auto* out = get(/*global=*/true); + return out ? out : get(/*global=*/false); + } + + static void push(std::shared_ptr&& state); + + static std::shared_ptr pop(bool global); + static std::shared_ptr pop() { + auto out = pop(/*global=*/true); + return out ? std::move(out) : pop(/*global=*/false); + } + + const ProfilerConfig& config() const { + return config_; + } + + void setCallbackHandle(at::CallbackHandle handle); + void removeCallback(); + + bool memoryProfilingEnabled() const override { + return config_.profile_memory; + } + + virtual ActiveProfilerType profilerType() = 0; + + protected: + // NOLINTNEXTLINE(cppcoreguidelines-non-private-member-variables-in-classes) + std::mutex state_mutex_; + // NOLINTNEXTLINE(cppcoreguidelines-non-private-member-variables-in-classes) + ProfilerConfig config_ = ProfilerConfig(ProfilerState::Disabled); + // NOLINTNEXTLINE(cppcoreguidelines-non-private-member-variables-in-classes) + at::CallbackHandle handle_ = 0; +}; + +// Note: The following are only for the active *thread local* profiler. +TORCH_API bool profilerEnabled(); +TORCH_API ActiveProfilerType profilerType(); +TORCH_API ProfilerConfig getProfilerConfig(); + +} // namespace impl +} // namespace profiler +} // namespace torch diff --git a/shared/package-files/9c/9c60f3f4c7584f4666cb6127fd5a324f902affdfb4995d6a365d4c7736cdc08c/blob b/shared/package-files/9c/9c60f3f4c7584f4666cb6127fd5a324f902affdfb4995d6a365d4c7736cdc08c/blob new file mode 100644 index 0000000000000000000000000000000000000000..4d811d22e5e9272486bd1cdf594ed573478eb751 --- /dev/null +++ b/shared/package-files/9c/9c60f3f4c7584f4666cb6127fd5a324f902affdfb4995d6a365d4c7736cdc08c/blob @@ -0,0 +1,89 @@ +""" +Implementation of enums. +""" +import operator + +from numba.core.imputils import (lower_builtin, lower_getattr, + lower_getattr_generic, lower_cast, + lower_constant, impl_ret_untracked) +from numba.core import types +from numba.core.extending import overload_method + + +@lower_builtin(operator.eq, types.EnumMember, types.EnumMember) +def enum_eq(context, builder, sig, args): + tu, tv = sig.args + u, v = args + res = context.generic_compare(builder, operator.eq, + (tu.dtype, tv.dtype), (u, v)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.is_, types.EnumMember, types.EnumMember) +def enum_is(context, builder, sig, args): + tu, tv = sig.args + u, v = args + if tu == tv: + res = context.generic_compare(builder, operator.eq, + (tu.dtype, tv.dtype), (u, v)) + else: + res = context.get_constant(sig.return_type, False) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_builtin(operator.ne, types.EnumMember, types.EnumMember) +def enum_ne(context, builder, sig, args): + tu, tv = sig.args + u, v = args + res = context.generic_compare(builder, operator.ne, + (tu.dtype, tv.dtype), (u, v)) + return impl_ret_untracked(context, builder, sig.return_type, res) + + +@lower_getattr(types.EnumMember, 'value') +def enum_value(context, builder, ty, val): + return val + + +@lower_cast(types.IntEnumMember, types.Integer) +def int_enum_to_int(context, builder, fromty, toty, val): + """ + Convert an IntEnum member to its raw integer value. + """ + return context.cast(builder, val, fromty.dtype, toty) + + +@lower_constant(types.EnumMember) +def enum_constant(context, builder, ty, pyval): + """ + Return a LLVM constant representing enum member *pyval*. + """ + return context.get_constant_generic(builder, ty.dtype, pyval.value) + + +@lower_getattr_generic(types.EnumClass) +def enum_class_getattr(context, builder, ty, val, attr): + """ + Return an enum member by attribute name. + """ + member = getattr(ty.instance_class, attr) + return context.get_constant_generic(builder, ty.dtype, member.value) + + +@lower_builtin('static_getitem', types.EnumClass, types.StringLiteral) +def enum_class_getitem(context, builder, sig, args): + """ + Return an enum member by index name. + """ + enum_cls_typ, idx = sig.args + member = enum_cls_typ.instance_class[idx.literal_value] + return context.get_constant_generic(builder, enum_cls_typ.dtype, + member.value) + + +@overload_method(types.IntEnumMember, '__hash__') +def intenum_hash(val): + # uses the hash of the value, for IntEnums this will be int.__hash__ + def hash_impl(val): + return hash(val.value) + return hash_impl diff --git a/shared/package-files/9c/9c622f4ee7b7f23934babb8efba22fe7e7330ce29d5fd85666ac3b369f445c73/blob b/shared/package-files/9c/9c622f4ee7b7f23934babb8efba22fe7e7330ce29d5fd85666ac3b369f445c73/blob new file mode 100644 index 0000000000000000000000000000000000000000..12f9459dbfbbfb35554f05babcb35ddcde0b5efb --- /dev/null +++ b/shared/package-files/9c/9c622f4ee7b7f23934babb8efba22fe7e7330ce29d5fd85666ac3b369f445c73/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::batch_norm_gather_stats_with_counts(Tensor input, Tensor mean, Tensor invstd, Tensor? running_mean, Tensor? running_var, float momentum, float eps, Tensor counts) -> (Tensor, Tensor) +inline ::std::tuple batch_norm_gather_stats_with_counts(const at::Tensor & input, const at::Tensor & mean, const at::Tensor & invstd, const c10::optional & running_mean, const c10::optional & running_var, double momentum, double eps, const at::Tensor & counts) { + return at::_ops::batch_norm_gather_stats_with_counts::call(input, mean, invstd, running_mean, running_var, momentum, eps, counts); +} + +// aten::batch_norm_gather_stats_with_counts.out(Tensor input, Tensor mean, Tensor invstd, Tensor? running_mean, Tensor? running_var, float momentum, float eps, Tensor counts, *, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!)) +inline ::std::tuple batch_norm_gather_stats_with_counts_out(at::Tensor & out0, at::Tensor & out1, const at::Tensor & input, const at::Tensor & mean, const at::Tensor & invstd, const c10::optional & running_mean, const c10::optional & running_var, double momentum, double eps, const at::Tensor & counts) { + return at::_ops::batch_norm_gather_stats_with_counts_out::call(input, mean, invstd, running_mean, running_var, momentum, eps, counts, out0, out1); +} +// aten::batch_norm_gather_stats_with_counts.out(Tensor input, Tensor mean, Tensor invstd, Tensor? running_mean, Tensor? running_var, float momentum, float eps, Tensor counts, *, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!)) +inline ::std::tuple batch_norm_gather_stats_with_counts_outf(const at::Tensor & input, const at::Tensor & mean, const at::Tensor & invstd, const c10::optional & running_mean, const c10::optional & running_var, double momentum, double eps, const at::Tensor & counts, at::Tensor & out0, at::Tensor & out1) { + return at::_ops::batch_norm_gather_stats_with_counts_out::call(input, mean, invstd, running_mean, running_var, momentum, eps, counts, out0, out1); +} + +} diff --git a/shared/package-files/9c/9c673414f1b6fe2d4ba2658aa0e36f88625e8cc0772fef9d4e2bbbf8ca314040/blob b/shared/package-files/9c/9c673414f1b6fe2d4ba2658aa0e36f88625e8cc0772fef9d4e2bbbf8ca314040/blob new file mode 100644 index 0000000000000000000000000000000000000000..96b853cd2e27e947bf25b63325741637a801426f --- /dev/null +++ b/shared/package-files/9c/9c673414f1b6fe2d4ba2658aa0e36f88625e8cc0772fef9d4e2bbbf8ca314040/blob @@ -0,0 +1,31 @@ +from torch._functorch import config +from torch._functorch.aot_autograd import ( + aot_function, + aot_module, + aot_module_simplified, + compiled_function, + compiled_module, + get_aot_compilation_context, + get_aot_graph_name, + get_graph_being_compiled, + make_boxed_compiler, + make_boxed_func, +) +from torch._functorch.compilers import ( + debug_compile, + default_decompositions, + draw_graph_compile, + memory_efficient_fusion, + nnc_jit, + nop, + print_compile, + ts_compile, +) +from torch._functorch.fx_minifier import minifier +from torch._functorch.partitioners import ( + default_partition, + draw_graph, + draw_joint_graph, + min_cut_rematerialization_partition, +) +from torch._functorch.python_key import pythonkey_decompose diff --git a/shared/package-files/9c/9c68261194b777d6e30edbfb4fb0537fe2e0a21892cbd4e69564c9c9216fdfbf/blob b/shared/package-files/9c/9c68261194b777d6e30edbfb4fb0537fe2e0a21892cbd4e69564c9c9216fdfbf/blob new file mode 100644 index 0000000000000000000000000000000000000000..8c5003a676d80fea79e7facab42a2818d9e2aa74 --- /dev/null +++ b/shared/package-files/9c/9c68261194b777d6e30edbfb4fb0537fe2e0a21892cbd4e69564c9c9216fdfbf/blob @@ -0,0 +1,137 @@ +#pragma once + +#include +#include +#include +#include + +namespace at { + +class Tensor; + +namespace impl { + +// Use this to define the prototype for a meta function. There are two +// versions; one that takes one argument (just the operator name), or FUNC2 +// variant that takes two arguments (operator name and overload name). +// +// Example usage: +// +// TORCH_META_FUNC2(add, Tensor) ( +// const Tensor& self, const Tensor& other +// ) { +// ... compute sizes and options ... +// set_output(sizes, options); +// } +// +#define TORCH_META_FUNC(name) void structured_##name::meta +#define TORCH_META_FUNC2(name, overload) \ + void structured_##name##_##overload::meta + +// These are versions of TORCH_META_FUNC(2) that include a precompute_out struct +// as a return value. They should be used when the kernel in question has +// precomputed values declared in native_functions.yaml and the corresponding +// implementation should return an instance of the aforementioned struct. +#define TORCH_PRECOMPUTE_META_FUNC(name) \ + structured_##name::meta_return_ty structured_##name::meta +#define TORCH_PRECOMPUTE_META_FUNC2(name, overload) \ + structured_##name##_##overload::meta_return_ty \ + structured_##name##_##overload::meta + +// Use this to create a precompute struct in a meta function. +#define TORCH_PRECOMPUTE_STRUCT(name) structured_##name::precompute_out<> +#define TORCH_PRECOMPUTE_STRUCT2(name, overload) \ + structured_##name##_##overload::precompute_out<> + +// Use this to define the prototype for an implementation. This takes only +// one argument, which is the name of the dispatch key entry you're +// implementing. +// +// Example usage: +// +// TORCH_IMPL_FUNC(add_cpu) ( +// Tensor& result, const Tensor& self, const Tensor& other +// ) { +// ... do the actual implementation ... +// } +// +#define TORCH_IMPL_FUNC(name) void structured_##name::impl + +// Base class for all structured kernel classes. The set_output virtual +// method is varied depending whether or not the operator is +// functional/out/inplace, and could also be specialized for CPU/CUDA/etc +// (although presently it isn't). +// +// A notable subclass of this interface is TensorIteratorBase. +struct TORCH_API MetaBase { + MetaBase() = default; + MetaBase(const MetaBase&) = default; + MetaBase& operator=(const MetaBase&) = default; + MetaBase(MetaBase&&) noexcept = default; + MetaBase& operator=(MetaBase&&) noexcept = default; + virtual const Tensor& maybe_get_output(int64_t output_idx) = 0; + + // Note: [set_output_*] + // See: https://github.com/pytorch/pytorch/issues/69813 + // Whenever defining the output properties in the META function of a + // structured kernel (what was usually done with `set_output`), use one of + // these 3 variants, instead. In order to decide which variant to use, check + // the following decision tree: + // + // - Can the kernel you are going to implement support output tensors + // with arbitrary strides? + // | + // -- YES: `set_output_raw_strided` + // | + // -- NO: Should the output tensor strides be contiguous? + // | + // -- YES: `set_output_contiguous` + // | + // -- NO: `set_output_strided` + // + // Use this function whenever the kernel requires specific strides for the + // output. If `strides` does not match the given output strides, proxy outputs + // will be created and passed to the IMPL function. + virtual void set_output_strided( + int64_t output_idx, + IntArrayRef sizes, + IntArrayRef strides, + TensorOptions options, + DimnameList names = {}) { + TORCH_INTERNAL_ASSERT(false, "set_output_strided not implemented."); + } + + // Use this function whenever the kernel knows how to handle arbitrary strided + // outputs. This function has the same behavior as the old `set_output`: it + // will only re-stride if the given output was resized. + virtual void set_output_raw_strided( + int64_t output_idx, + IntArrayRef sizes, + IntArrayRef strides_hint, + TensorOptions options, + DimnameList names = {}) { + TORCH_INTERNAL_ASSERT(false, "set_output_strided not implemented."); + } + + // Use this function if the kernel requires contiguous strides. + // Alias for `set_output_strided`, but with contiguous strides. + void set_output_contiguous( + int64_t output_idx, + IntArrayRef sizes, + TensorOptions options, + DimnameList names = {}) { + auto strides = c10::contiguous_strides(sizes); + set_output_strided(output_idx, sizes, strides, options, names); + } + + // Returns a reference to an undefined tensor if there is no presupplied + // output + const Tensor& maybe_get_output() { + return maybe_get_output(0); + } + virtual ~MetaBase() = default; +}; + +} // namespace impl + +} // namespace at diff --git a/shared/package-files/9c/9c69094c0bd52d5ae8448431574eae8ee4be31ec2e8602366df6c6bf4bc89a58/blob b/shared/package-files/9c/9c69094c0bd52d5ae8448431574eae8ee4be31ec2e8602366df6c6bf4bc89a58/blob new file mode 100644 index 0000000000000000000000000000000000000000..c98b2a6a7d9ca24c3cb18b9f1e2eca4aa9ad82a1 --- /dev/null +++ b/shared/package-files/9c/9c69094c0bd52d5ae8448431574eae8ee4be31ec2e8602366df6c6bf4bc89a58/blob @@ -0,0 +1,50 @@ +# created by tools/loadICU.tcl -- do not edit +namespace eval ::tcl::clock { + ::msgcat::mcset vi DAYS_OF_WEEK_ABBREV [list \ + "Th 2"\ + "Th 3"\ + "Th 4"\ + "Th 5"\ + "Th 6"\ + "Th 7"\ + "CN"] + ::msgcat::mcset vi DAYS_OF_WEEK_FULL [list \ + "Th\u01b0\u0301 hai"\ + "Th\u01b0\u0301 ba"\ + "Th\u01b0\u0301 t\u01b0"\ + "Th\u01b0\u0301 n\u0103m"\ + "Th\u01b0\u0301 s\u00e1u"\ + "Th\u01b0\u0301 ba\u0309y"\ + "Chu\u0309 nh\u00e2\u0323t"] + ::msgcat::mcset vi MONTHS_ABBREV [list \ + "Thg 1"\ + "Thg 2"\ + "Thg 3"\ + "Thg 4"\ + "Thg 5"\ + "Thg 6"\ + "Thg 7"\ + "Thg 8"\ + "Thg 9"\ + "Thg 10"\ + "Thg 11"\ + "Thg 12"\ + ""] + ::msgcat::mcset vi MONTHS_FULL [list \ + "Th\u00e1ng m\u00f4\u0323t"\ + "Th\u00e1ng hai"\ + "Th\u00e1ng ba"\ + "Th\u00e1ng t\u01b0"\ + "Th\u00e1ng n\u0103m"\ + "Th\u00e1ng s\u00e1u"\ + "Th\u00e1ng ba\u0309y"\ + "Th\u00e1ng t\u00e1m"\ + "Th\u00e1ng ch\u00edn"\ + "Th\u00e1ng m\u01b0\u01a1\u0300i"\ + "Th\u00e1ng m\u01b0\u01a1\u0300i m\u00f4\u0323t"\ + "Th\u00e1ng m\u01b0\u01a1\u0300i hai"\ + ""] + ::msgcat::mcset vi DATE_FORMAT "%d %b %Y" + ::msgcat::mcset vi TIME_FORMAT "%H:%M:%S" + ::msgcat::mcset vi DATE_TIME_FORMAT "%d %b %Y %H:%M:%S %z" +} diff --git a/shared/package-files/9c/9c6a1a85eb74adf71ebdc2b2b86e7a4ce261e9c21181b87c9e85f1992af0f849/blob b/shared/package-files/9c/9c6a1a85eb74adf71ebdc2b2b86e7a4ce261e9c21181b87c9e85f1992af0f849/blob new file mode 100644 index 0000000000000000000000000000000000000000..3ff969183a4b7be6dac728dbc965f73e89b12012 --- /dev/null +++ b/shared/package-files/9c/9c6a1a85eb74adf71ebdc2b2b86e7a4ce261e9c21181b87c9e85f1992af0f849/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor max_pool2d_with_indices_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, const at::Tensor & indices); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9c/9c6b12f7fe66a98819a88c7e83e034790e1577d5905afa79dc5bfc3c4a407a27/blob b/shared/package-files/9c/9c6b12f7fe66a98819a88c7e83e034790e1577d5905afa79dc5bfc3c4a407a27/blob new file mode 100644 index 0000000000000000000000000000000000000000..970d6ccf20325d9d8bae86694bd428fd7bc9d959 --- /dev/null +++ b/shared/package-files/9c/9c6b12f7fe66a98819a88c7e83e034790e1577d5905afa79dc5bfc3c4a407a27/blob @@ -0,0 +1,10 @@ +from typing import AnyStr, Text, Tuple, overload + +def getstatus(file: Text) -> str: ... +def getoutput(cmd: Text) -> str: ... +def getstatusoutput(cmd: Text) -> Tuple[int, str]: ... +@overload +def mk2arg(head: bytes, x: bytes) -> bytes: ... +@overload +def mk2arg(head: Text, x: Text) -> Text: ... +def mkarg(x: AnyStr) -> AnyStr: ... diff --git a/shared/package-files/9c/9c6bc6d20bda726bfe5b829c0ea5c140a491ee3ee5c2fe7b276e4ce66bb6b100/blob b/shared/package-files/9c/9c6bc6d20bda726bfe5b829c0ea5c140a491ee3ee5c2fe7b276e4ce66bb6b100/blob new file mode 100644 index 0000000000000000000000000000000000000000..a9a0b4ecdcf8b9e323d41f0b39941528a2f0b0cd --- /dev/null +++ b/shared/package-files/9c/9c6bc6d20bda726bfe5b829c0ea5c140a491ee3ee5c2fe7b276e4ce66bb6b100/blob @@ -0,0 +1,86 @@ +#pragma once +#include +#include +#include + +#ifndef AT_PER_OPERATOR_HEADERS +#include +#else +#include +#endif + +namespace at { + +// Note [Tensor-subclass-like Tensors] +// Tensor-subclass-like is defined as: +// - a Tensor subclass (via __torch_dispatch__ in Python or extending +// TensorImpl in C++) +// - anything else that shares the same perils as Tensor subclasses. +// For example, many Tensor subclasses do not have storage and meta Tensors +// do not have storage either, so meta Tensors belong here. +// +// We should ensure that PyTorch internals supports Tensor-subclass-like +// objects. In particular, Tensor-subclass-like objects struggle with two +// classes of operations that are problematic for Tensor subclasses: +// 1. Because some Tensor subclasses do not have storage, .item() or +// .data_ptr() calls are not good. +// 2. Certain in-place operations can eliminate the typing of the Tensor +// subclass. For example: +// >>> torch.zeros(input.sizes(), grad.options()).diag().copy_(input) +// If input is a Tensor subclass, then the above ends up either erroring out +// or returning a regular non-Tensor-subclass Tensor! + +constexpr auto kFunctorchWrappedTensors = DispatchKeySet( + {DispatchKey::FuncTorchGradWrapper, + DispatchKey::FuncTorchBatched, + DispatchKey::Functionalize}); + +constexpr auto kTensorSubclassLike = + kFunctorchWrappedTensors | + DispatchKeySet( + {// WARNING: DO NOT put combined backend component + functionality keys + // here, you will incorrectly always match on the functionality key + // no matter the backend component + DispatchKey::Batched, + DispatchKey::Sparse, + DispatchKey::SparseCsr, + DispatchKey::Python}) | + DispatchKeySet(BackendComponent::MetaBit); + +inline bool isTensorSubclassLike(const Tensor& tensor) { + if (c10::impl::dispatch_mode_enabled()) + return true; + auto key_set = tensor.unsafeGetTensorImpl()->key_set(); + return !(key_set & kTensorSubclassLike).empty(); +} + +inline bool areAnyTensorSubclassLike(TensorList tensors) { + if (c10::impl::dispatch_mode_enabled()) + return true; + return std::any_of(tensors.begin(), tensors.end(), isTensorSubclassLike); +} + +inline bool areAnyOptionalTensorSubclassLike( + const c10::List>& tensors) { + if (c10::impl::dispatch_mode_enabled()) + return true; + return std::any_of( + tensors.begin(), tensors.end(), [](const optional& opt_tensor) { + return ( + opt_tensor.has_value() && isTensorSubclassLike(opt_tensor.value())); + }); +} + +// Helper function to deal testing truthfulness of a scalar tensor +// in a Composite Compliant manner. +// NOTE: This function expects a scalar tensor of boolean dtype. +// Eg. +// Non-Composite Compliant Pattern : (t == 0).all().item() +// Composite Compliant Patter : is_salar_tensor_true((t == 0).all()) +inline bool is_scalar_tensor_true(const Tensor& t) { + TORCH_INTERNAL_ASSERT(t.dim() == 0) + TORCH_INTERNAL_ASSERT(t.scalar_type() == kBool) + return at::equal(t, t.new_ones({}, t.options())); +} + +} // namespace at diff --git a/shared/package-files/9c/9c6c23dd46de071e5f5ee24cb2144f82e46365c9011bd8574bf210f0c8245043/blob b/shared/package-files/9c/9c6c23dd46de071e5f5ee24cb2144f82e46365c9011bd8574bf210f0c8245043/blob new file mode 100644 index 0000000000000000000000000000000000000000..a08d16a269e4afe6a0d5106c5dd438cc6f558059 Binary files /dev/null and b/shared/package-files/9c/9c6c23dd46de071e5f5ee24cb2144f82e46365c9011bd8574bf210f0c8245043/blob differ diff --git a/shared/package-files/9c/9c6d9dc0fe27526412ddee5e2118a7c6dd2cfdfe2cc7103561fa210a0fa76afa/blob b/shared/package-files/9c/9c6d9dc0fe27526412ddee5e2118a7c6dd2cfdfe2cc7103561fa210a0fa76afa/blob new file mode 100644 index 0000000000000000000000000000000000000000..541f551151f54b4bb649f403404325d2dd79cd7f --- /dev/null +++ b/shared/package-files/9c/9c6d9dc0fe27526412ddee5e2118a7c6dd2cfdfe2cc7103561fa210a0fa76afa/blob @@ -0,0 +1,248 @@ +""" +Build a c-extension module on-the-fly in tests. +See build_and_import_extensions for usage hints + +""" + +import os +import pathlib +import subprocess +import sys +import sysconfig +import textwrap + +__all__ = ['build_and_import_extension', 'compile_extension_module'] + + +def build_and_import_extension( + modname, functions, *, prologue="", build_dir=None, + include_dirs=[], more_init=""): + """ + Build and imports a c-extension module `modname` from a list of function + fragments `functions`. + + + Parameters + ---------- + functions : list of fragments + Each fragment is a sequence of func_name, calling convention, snippet. + prologue : string + Code to precede the rest, usually extra ``#include`` or ``#define`` + macros. + build_dir : pathlib.Path + Where to build the module, usually a temporary directory + include_dirs : list + Extra directories to find include files when compiling + more_init : string + Code to appear in the module PyMODINIT_FUNC + + Returns + ------- + out: module + The module will have been loaded and is ready for use + + Examples + -------- + >>> functions = [("test_bytes", "METH_O", \"\"\" + if ( !PyBytesCheck(args)) { + Py_RETURN_FALSE; + } + Py_RETURN_TRUE; + \"\"\")] + >>> mod = build_and_import_extension("testme", functions) + >>> assert not mod.test_bytes(u'abc') + >>> assert mod.test_bytes(b'abc') + """ + body = prologue + _make_methods(functions, modname) + init = """PyObject *mod = PyModule_Create(&moduledef); + """ + if not build_dir: + build_dir = pathlib.Path('.') + if more_init: + init += """#define INITERROR return NULL + """ + init += more_init + init += "\nreturn mod;" + source_string = _make_source(modname, init, body) + try: + mod_so = compile_extension_module( + modname, build_dir, include_dirs, source_string) + except Exception as e: + # shorten the exception chain + raise RuntimeError(f"could not compile in {build_dir}:") from e + import importlib.util + spec = importlib.util.spec_from_file_location(modname, mod_so) + foo = importlib.util.module_from_spec(spec) + spec.loader.exec_module(foo) + return foo + + +def compile_extension_module( + name, builddir, include_dirs, + source_string, libraries=[], library_dirs=[]): + """ + Build an extension module and return the filename of the resulting + native code file. + + Parameters + ---------- + name : string + name of the module, possibly including dots if it is a module inside a + package. + builddir : pathlib.Path + Where to build the module, usually a temporary directory + include_dirs : list + Extra directories to find include files when compiling + libraries : list + Libraries to link into the extension module + library_dirs: list + Where to find the libraries, ``-L`` passed to the linker + """ + modname = name.split('.')[-1] + dirname = builddir / name + dirname.mkdir(exist_ok=True) + cfile = _convert_str_to_file(source_string, dirname) + include_dirs = include_dirs + [sysconfig.get_config_var('INCLUDEPY')] + + return _c_compile( + cfile, outputfilename=dirname / modname, + include_dirs=include_dirs, libraries=[], library_dirs=[], + ) + + +def _convert_str_to_file(source, dirname): + """Helper function to create a file ``source.c`` in `dirname` that contains + the string in `source`. Returns the file name + """ + filename = dirname / 'source.c' + with filename.open('w') as f: + f.write(str(source)) + return filename + + +def _make_methods(functions, modname): + """ Turns the name, signature, code in functions into complete functions + and lists them in a methods_table. Then turns the methods_table into a + ``PyMethodDef`` structure and returns the resulting code fragment ready + for compilation + """ + methods_table = [] + codes = [] + for funcname, flags, code in functions: + cfuncname = "%s_%s" % (modname, funcname) + if 'METH_KEYWORDS' in flags: + signature = '(PyObject *self, PyObject *args, PyObject *kwargs)' + else: + signature = '(PyObject *self, PyObject *args)' + methods_table.append( + "{\"%s\", (PyCFunction)%s, %s}," % (funcname, cfuncname, flags)) + func_code = """ + static PyObject* {cfuncname}{signature} + {{ + {code} + }} + """.format(cfuncname=cfuncname, signature=signature, code=code) + codes.append(func_code) + + body = "\n".join(codes) + """ + static PyMethodDef methods[] = { + %(methods)s + { NULL } + }; + static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "%(modname)s", /* m_name */ + NULL, /* m_doc */ + -1, /* m_size */ + methods, /* m_methods */ + }; + """ % dict(methods='\n'.join(methods_table), modname=modname) + return body + + +def _make_source(name, init, body): + """ Combines the code fragments into source code ready to be compiled + """ + code = """ + #include + + %(body)s + + PyMODINIT_FUNC + PyInit_%(name)s(void) { + %(init)s + } + """ % dict( + name=name, init=init, body=body, + ) + return code + + +def _c_compile(cfile, outputfilename, include_dirs=[], libraries=[], + library_dirs=[]): + if sys.platform == 'win32': + compile_extra = ["/we4013"] + link_extra = ["/LIBPATH:" + os.path.join(sys.base_prefix, 'libs')] + elif sys.platform.startswith('linux'): + compile_extra = [ + "-O0", "-g", "-Werror=implicit-function-declaration", "-fPIC"] + link_extra = [] + else: + compile_extra = link_extra = [] + pass + if sys.platform == 'win32': + link_extra = link_extra + ['/DEBUG'] # generate .pdb file + if sys.platform == 'darwin': + # support Fink & Darwinports + for s in ('/sw/', '/opt/local/'): + if (s + 'include' not in include_dirs + and os.path.exists(s + 'include')): + include_dirs.append(s + 'include') + if s + 'lib' not in library_dirs and os.path.exists(s + 'lib'): + library_dirs.append(s + 'lib') + + outputfilename = outputfilename.with_suffix(get_so_suffix()) + build( + cfile, outputfilename, + compile_extra, link_extra, + include_dirs, libraries, library_dirs) + return outputfilename + + +def build(cfile, outputfilename, compile_extra, link_extra, + include_dirs, libraries, library_dirs): + "use meson to build" + + build_dir = cfile.parent / "build" + os.makedirs(build_dir, exist_ok=True) + so_name = outputfilename.parts[-1] + with open(cfile.parent / "meson.build", "wt") as fid: + includes = ['-I' + d for d in include_dirs] + link_dirs = ['-L' + d for d in library_dirs] + fid.write(textwrap.dedent(f"""\ + project('foo', 'c') + shared_module('{so_name}', '{cfile.parts[-1]}', + c_args: {includes} + {compile_extra}, + link_args: {link_dirs} + {link_extra}, + link_with: {libraries}, + name_prefix: '', + name_suffix: 'dummy', + ) + """)) + if sys.platform == "win32": + subprocess.check_call(["meson", "setup", + "--buildtype=release", + "--vsenv", ".."], + cwd=build_dir, + ) + else: + subprocess.check_call(["meson", "setup", "--vsenv", ".."], + cwd=build_dir + ) + subprocess.check_call(["meson", "compile"], cwd=build_dir) + os.rename(str(build_dir / so_name) + ".dummy", cfile.parent / so_name) + +def get_so_suffix(): + ret = sysconfig.get_config_var('EXT_SUFFIX') + assert ret + return ret diff --git a/shared/package-files/9c/9c6de0cbe2d14ff31289472a14f40e8e620fbb68d16de698c59fe8640b56c0df/blob b/shared/package-files/9c/9c6de0cbe2d14ff31289472a14f40e8e620fbb68d16de698c59fe8640b56c0df/blob new file mode 100644 index 0000000000000000000000000000000000000000..d22a3a425fe1d9a7fbfb460290cc4fb7feafb85c --- /dev/null +++ b/shared/package-files/9c/9c6de0cbe2d14ff31289472a14f40e8e620fbb68d16de698c59fe8640b56c0df/blob @@ -0,0 +1,189 @@ +from collections.abc import Callable +from typing import Any, TypeAlias, overload, type_check_only + +from _typeshed import Incomplete +from llvmlite.ir import IRBuilder +from typing_extensions import ( + Concatenate, + Generic, + Never, + ParamSpec, + Self, + TypeVar, + override, +) + +from numba.core import serialize +from numba.core.base import BaseContext +from numba.core.compiler import CompileResult +from numba.core.dispatcher import Dispatcher +from numba.core.types import Type +from numba.core.typing.templates import Signature +from numba.np import npyimpl + +from .ufunc_base import ( + UfuncBase, + UfuncLowererBase, + _AccumulateT_co, + _IdentityT_co, + _OuterT_co, + _ReduceAtT_co, + _ReduceT_co, +) + +### + +_T = TypeVar("_T") +_T1 = TypeVar("_T1") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_Tss = ParamSpec("_Tss") +_CallT_co = TypeVar( + "_CallT_co", + bound=Callable[Concatenate[Never, ...], object], + default=Callable[Concatenate[Any, ...], Any], + covariant=True, +) +_AtT_co = TypeVar( + "_AtT_co", + bound=Callable[[Never, Never, Never], None], + default=Callable[[Any, Any, Any | None], None], + covariant=True, +) +_DUFuncT = TypeVar("_DUFuncT", bound=DUFunc) +_DUFuncT_co = TypeVar("_DUFuncT_co", bound=DUFunc, covariant=True) + +_ToSignature: TypeAlias = Signature | tuple[Type | Signature, ...] | str + +@type_check_only +class DUFuncKernel(npyimpl._Kernel, Generic[_DUFuncT_co]): + __name__: str + + dufunc: _DUFuncT_co + + inner_sig: Signature | None + cres: CompileResult | None + +### + +# undocumented +class UfuncAtIterator: + ufunc: DUFunc + a: Incomplete + a_ty: Type + indices: Incomplete + indices_ty: Type + b: Incomplete + b_ty: Type + + def __init__( + self, + ufunc: DUFunc, + a: Incomplete, + a_ty: Type, + indices: Incomplete, + indices_ty: Type, + b: Incomplete | None = None, + b_ty: Type | None = None, + ) -> None: ... + def run(self, context: BaseContext, builder: IRBuilder) -> None: ... + def need_advanced_indexing(self) -> None: ... + +def make_dufunc_kernel(_dufunc: _DUFuncT) -> type[DUFuncKernel[_DUFuncT]]: ... + +class DUFuncLowerer( + UfuncLowererBase[_DUFuncT_co, DUFuncKernel[_DUFuncT_co]], + Generic[_DUFuncT_co], +): + def __init__(self, dufunc: _DUFuncT_co) -> None: ... + +# +class DUFunc( + serialize.ReduceMixin, + UfuncBase[ + _AtT_co, + _ReduceT_co, + _ReduceAtT_co, + _AccumulateT_co, + _OuterT_co, + _IdentityT_co, + None, + ], + Generic[ + _CallT_co, + _AtT_co, + _ReduceT_co, + _ReduceAtT_co, + _AccumulateT_co, + _OuterT_co, + _IdentityT_co, + ], +): + __name__: str + __doc__: str | None + reorderable: bool + + def __init__( + self, + py_func: Callable[..., object], + identity: _IdentityT_co | None = None, + cache: bool = False, + targetoptions: dict[str, Any] | None = None, + ) -> None: ... + def __call__( + self: DUFunc[Callable[Concatenate[_T1, _Tss], _T]], + arg0: _T1, + /, + *args: _Tss.args, + **kws: _Tss.kwargs, + ) -> _T: ... + + # + def build_ufunc(self) -> Self: ... + def add(self, sig: _ToSignature) -> CompileResult: ... + @override + def match_signature( # pyrefly:ignore[bad-override-mutable-attribute] + self, ewise_types: tuple[Type, ...], sig: Signature + ) -> bool: ... + + # + @property + def targetoptions(self) -> dict[str, Any]: ... + + # + @override # type: ignore[override] + @overload + def at( # pyrefly:ignore[bad-override] + self: DUFunc[Any, Callable[[_T1, _T2, None], Any]], + a: _T1, + indices: _T2, + b: None = None, + ) -> None: ... + @overload + def at( + self: DUFunc[Any, Callable[[_T1, _T2, _T3], Any]], + a: _T1, + indices: _T2, + b: _T3, + ) -> None: ... + + # `ReduceMixin` methods + @override + def _reduce_states(self) -> dict[str, Any]: ... + @classmethod + @override + def _rebuild( # type: ignore[override] # pyrefly:ignore[bad-override] + cls, + dispatcher: Dispatcher, + identity: _T, + frozen: bool, + siglist: list[Signature], + ) -> DUFunc[ + _CallT_co, + _AtT_co, + _ReduceT_co, + _ReduceAtT_co, + _AccumulateT_co, + _OuterT_co, + _T, + ]: ... diff --git a/shared/package-files/9c/9c731b962d663f97a6678cdcaa7b4660b0203169f01289295c1f8beff22f70da/blob b/shared/package-files/9c/9c731b962d663f97a6678cdcaa7b4660b0203169f01289295c1f8beff22f70da/blob new file mode 100644 index 0000000000000000000000000000000000000000..712a8750ad111a234e2f9fee1d021c37cbc3d041 --- /dev/null +++ b/shared/package-files/9c/9c731b962d663f97a6678cdcaa7b4660b0203169f01289295c1f8beff22f70da/blob @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +import warnings +from datetime import timedelta +from typing import List + + +def get_all(store, prefix: str, size: int): + r""" + Given a store and a prefix, the method goes through the array of keys + of the following format: ``{prefix}{idx}``, where idx is in a range + from 0 to size, and tries to retrieve the data. + + Usage + + :: + + values = get_all(store, 'torchelastic/data', 3) + value1 = values[0] # retrieves the data for key torchelastic/data0 + value2 = values[1] # retrieves the data for key torchelastic/data1 + value3 = values[2] # retrieves the data for key torchelastic/data2 + + """ + data_arr = [] + for idx in range(size): + data = store.get(f"{prefix}{idx}") + data_arr.append(data) + return data_arr + + +def synchronize( + store, + data: bytes, + rank: int, + world_size: int, + key_prefix: str, + barrier_timeout: float = 300, +) -> List[bytes]: + """ + Synchronizes ``world_size`` agents between each other using the underlying c10d store. + The ``data`` will be available on each of the agents. + + Note: The data on the path is not deleted, as a result there can be stale data if + you use the same key_prefix twice. + """ + warnings.warn( + "This is an experimental API and will be changed in future.", FutureWarning + ) + store.set_timeout(timedelta(seconds=barrier_timeout)) + store.set(f"{key_prefix}{rank}", data) + agent_data = get_all(store, key_prefix, world_size) + return agent_data + + +def barrier( + store, rank: int, world_size: int, key_prefix: str, barrier_timeout: float = 300 +) -> None: + """ + A global lock between agents. + + Note: Since the data is not removed from the store, the barrier can be used + once per unique ``key_prefix``. + """ + warnings.warn( + "This is an experimental API and will be changed in future.", FutureWarning + ) + data = f"{rank}".encode(encoding="UTF-8") + synchronize(store, data, rank, world_size, key_prefix, barrier_timeout) diff --git a/shared/package-files/9c/9c7437083ea6affbc3bc0aa90ed7721185e902f433ebba0f95a33d5eb8d5f5b4/blob b/shared/package-files/9c/9c7437083ea6affbc3bc0aa90ed7721185e902f433ebba0f95a33d5eb8d5f5b4/blob new file mode 100644 index 0000000000000000000000000000000000000000..234e116ef1d9038331211c49a8d133e82fee0a19 --- /dev/null +++ b/shared/package-files/9c/9c7437083ea6affbc3bc0aa90ed7721185e902f433ebba0f95a33d5eb8d5f5b4/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API swapaxes { + using schema = at::Tensor (const at::Tensor &, int64_t, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::swapaxes") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "swapaxes(Tensor(a) self, int axis0, int axis1) -> Tensor(a)") + static at::Tensor call(const at::Tensor & self, int64_t axis0, int64_t axis1); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t axis0, int64_t axis1); +}; + +struct TORCH_API swapaxes_ { + using schema = at::Tensor & (at::Tensor &, int64_t, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::swapaxes_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "swapaxes_(Tensor(a!) self, int axis0, int axis1) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self, int64_t axis0, int64_t axis1); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, int64_t axis0, int64_t axis1); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9c/9c74f69b89ac4b983240b60f228d97e97705ef2d294d1658254631646d180949/blob b/shared/package-files/9c/9c74f69b89ac4b983240b60f228d97e97705ef2d294d1658254631646d180949/blob new file mode 100644 index 0000000000000000000000000000000000000000..a9eaffa1f8214ec9654cb9a697c7b58341ee3e84 --- /dev/null +++ b/shared/package-files/9c/9c74f69b89ac4b983240b60f228d97e97705ef2d294d1658254631646d180949/blob @@ -0,0 +1,173 @@ +"""Shor's algorithm and helper functions. + +Todo: + +* Get the CMod gate working again using the new Gate API. +* Fix everything. +* Update docstrings and reformat. +""" + +import math +import random + +from sympy.core.mul import Mul +from sympy.core.singleton import S +from sympy.functions.elementary.exponential import log +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.core.numbers import igcd +from sympy.ntheory import continued_fraction_periodic as continued_fraction +from sympy.utilities.iterables import variations + +from sympy.physics.quantum.gate import Gate +from sympy.physics.quantum.qubit import Qubit, measure_partial_oneshot +from sympy.physics.quantum.qapply import qapply +from sympy.physics.quantum.qft import QFT +from sympy.physics.quantum.qexpr import QuantumError + + +class OrderFindingException(QuantumError): + pass + + +class CMod(Gate): + """A controlled mod gate. + + This is black box controlled Mod function for use by shor's algorithm. + TODO: implement a decompose property that returns how to do this in terms + of elementary gates + """ + + @classmethod + def _eval_args(cls, args): + # t = args[0] + # a = args[1] + # N = args[2] + raise NotImplementedError('The CMod gate has not been completed.') + + @property + def t(self): + """Size of 1/2 input register. First 1/2 holds output.""" + return self.label[0] + + @property + def a(self): + """Base of the controlled mod function.""" + return self.label[1] + + @property + def N(self): + """N is the type of modular arithmetic we are doing.""" + return self.label[2] + + def _apply_operator_Qubit(self, qubits, **options): + """ + This directly calculates the controlled mod of the second half of + the register and puts it in the second + This will look pretty when we get Tensor Symbolically working + """ + n = 1 + k = 0 + # Determine the value stored in high memory. + for i in range(self.t): + k += n*qubits[self.t + i] + n *= 2 + + # The value to go in low memory will be out. + out = int(self.a**k % self.N) + + # Create array for new qbit-ket which will have high memory unaffected + outarray = list(qubits.args[0][:self.t]) + + # Place out in low memory + for i in reversed(range(self.t)): + outarray.append((out >> i) & 1) + + return Qubit(*outarray) + + +def shor(N): + """This function implements Shor's factoring algorithm on the Integer N + + The algorithm starts by picking a random number (a) and seeing if it is + coprime with N. If it is not, then the gcd of the two numbers is a factor + and we are done. Otherwise, it begins the period_finding subroutine which + finds the period of a in modulo N arithmetic. This period, if even, can + be used to calculate factors by taking a**(r/2)-1 and a**(r/2)+1. + These values are returned. + """ + a = random.randrange(N - 2) + 2 + if igcd(N, a) != 1: + return igcd(N, a) + r = period_find(a, N) + if r % 2 == 1: + shor(N) + answer = (igcd(a**(r/2) - 1, N), igcd(a**(r/2) + 1, N)) + return answer + + +def getr(x, y, N): + fraction = continued_fraction(x, y) + # Now convert into r + total = ratioize(fraction, N) + return total + + +def ratioize(list, N): + if list[0] > N: + return S.Zero + if len(list) == 1: + return list[0] + return list[0] + ratioize(list[1:], N) + + +def period_find(a, N): + """Finds the period of a in modulo N arithmetic + + This is quantum part of Shor's algorithm. It takes two registers, + puts first in superposition of states with Hadamards so: ``|k>|0>`` + with k being all possible choices. It then does a controlled mod and + a QFT to determine the order of a. + """ + epsilon = .5 + # picks out t's such that maintains accuracy within epsilon + t = int(2*math.ceil(log(N, 2))) + # make the first half of register be 0's |000...000> + start = [0 for x in range(t)] + # Put second half into superposition of states so we have |1>x|0> + |2>x|0> + ... |k>x>|0> + ... + |2**n-1>x|0> + factor = 1/sqrt(2**t) + qubits = 0 + for arr in variations(range(2), t, repetition=True): + qbitArray = list(arr) + start + qubits = qubits + Qubit(*qbitArray) + circuit = (factor*qubits).expand() + # Controlled second half of register so that we have: + # |1>x|a**1 %N> + |2>x|a**2 %N> + ... + |k>x|a**k %N >+ ... + |2**n-1=k>x|a**k % n> + circuit = CMod(t, a, N)*circuit + # will measure first half of register giving one of the a**k%N's + + circuit = qapply(circuit) + for i in range(t): + circuit = measure_partial_oneshot(circuit, i) + # Now apply Inverse Quantum Fourier Transform on the second half of the register + + circuit = qapply(QFT(t, t*2).decompose()*circuit, floatingPoint=True) + for i in range(t): + circuit = measure_partial_oneshot(circuit, i + t) + if isinstance(circuit, Qubit): + register = circuit + elif isinstance(circuit, Mul): + register = circuit.args[-1] + else: + register = circuit.args[-1].args[-1] + + n = 1 + answer = 0 + for i in range(len(register)/2): + answer += n*register[i + t] + n = n << 1 + if answer == 0: + raise OrderFindingException( + "Order finder returned 0. Happens with chance %f" % epsilon) + #turn answer into r using continued fractions + g = getr(answer, 2**t, N) + return g diff --git a/shared/package-files/9c/9c75ab673fb45599db0c658a613d58a0ed25f142578632e5fdb77f4314c50baa/blob b/shared/package-files/9c/9c75ab673fb45599db0c658a613d58a0ed25f142578632e5fdb77f4314c50baa/blob new file mode 100644 index 0000000000000000000000000000000000000000..69b6f73e8566b7b889ba56626dbb7bb41fa415ef --- /dev/null +++ b/shared/package-files/9c/9c75ab673fb45599db0c658a613d58a0ed25f142578632e5fdb77f4314c50baa/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor acos(const at::Tensor & self); +TORCH_API at::Tensor & acos_out(at::Tensor & out, const at::Tensor & self); +TORCH_API at::Tensor & acos_outf(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & acos_(at::Tensor & self); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/9c/9c78a976bbc933863fb0e4c23ee62b26f8eb3d7f101d7d32e6768579499e43b1/blob b/shared/package-files/9c/9c78a976bbc933863fb0e4c23ee62b26f8eb3d7f101d7d32e6768579499e43b1/blob new file mode 100644 index 0000000000000000000000000000000000000000..14d2be5af65bb1163880c41a249721442513bac3 --- /dev/null +++ b/shared/package-files/9c/9c78a976bbc933863fb0e4c23ee62b26f8eb3d7f101d7d32e6768579499e43b1/blob @@ -0,0 +1,989 @@ +# xmfbox.tcl -- +# +# Implements the "Motif" style file selection dialog for the +# Unix platform. This implementation is used only if the +# "::tk_strictMotif" flag is set. +# +# Copyright (c) 1996 Sun Microsystems, Inc. +# Copyright (c) 1998-2000 Scriptics Corporation +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +namespace eval ::tk::dialog {} +namespace eval ::tk::dialog::file {} + + +# ::tk::MotifFDialog -- +# +# Implements a file dialog similar to the standard Motif file +# selection box. +# +# Arguments: +# type "open" or "save" +# args Options parsed by the procedure. +# +# Results: +# When -multiple is set to 0, this returns the absolute pathname +# of the selected file. (NOTE: This is not the same as a single +# element list.) +# +# When -multiple is set to > 0, this returns a Tcl list of absolute +# pathnames. The argument for -multiple is ignored, but for consistency +# with Windows it defines the maximum amount of memory to allocate for +# the returned filenames. + +proc ::tk::MotifFDialog {type args} { + variable ::tk::Priv + set dataName __tk_filedialog + upvar ::tk::dialog::file::$dataName data + + set w [MotifFDialog_Create $dataName $type $args] + + # Set a grab and claim the focus too. + + ::tk::SetFocusGrab $w $data(sEnt) + $data(sEnt) selection range 0 end + + # Wait for the user to respond, then restore the focus and + # return the index of the selected button. Restore the focus + # before deleting the window, since otherwise the window manager + # may take the focus away so we can't redirect it. Finally, + # restore any grab that was in effect. + + vwait ::tk::Priv(selectFilePath) + set result $Priv(selectFilePath) + ::tk::RestoreFocusGrab $w $data(sEnt) withdraw + + return $result +} + +# ::tk::MotifFDialog_Create -- +# +# Creates the Motif file dialog (if it doesn't exist yet) and +# initialize the internal data structure associated with the +# dialog. +# +# This procedure is used by ::tk::MotifFDialog to create the +# dialog. It's also used by the test suite to test the Motif +# file dialog implementation. User code shouldn't call this +# procedure directly. +# +# Arguments: +# dataName Name of the global "data" array for the file dialog. +# type "Save" or "Open" +# argList Options parsed by the procedure. +# +# Results: +# Pathname of the file dialog. + +proc ::tk::MotifFDialog_Create {dataName type argList} { + upvar ::tk::dialog::file::$dataName data + + MotifFDialog_Config $dataName $type $argList + + if {$data(-parent) eq "."} { + set w .$dataName + } else { + set w $data(-parent).$dataName + } + + # (re)create the dialog box if necessary + # + if {![winfo exists $w]} { + MotifFDialog_BuildUI $w + } elseif {[winfo class $w] ne "TkMotifFDialog"} { + destroy $w + MotifFDialog_BuildUI $w + } else { + set data(fEnt) $w.top.f1.ent + set data(dList) $w.top.f2.a.l + set data(fList) $w.top.f2.b.l + set data(sEnt) $w.top.f3.ent + set data(okBtn) $w.bot.ok + set data(filterBtn) $w.bot.filter + set data(cancelBtn) $w.bot.cancel + } + MotifFDialog_SetListMode $w + + # Dialog boxes should be transient with respect to their parent, + # so that they will always stay on top of their parent window. However, + # some window managers will create the window as withdrawn if the parent + # window is withdrawn or iconified. Combined with the grab we put on the + # window, this can hang the entire application. Therefore we only make + # the dialog transient if the parent is viewable. + + if {[winfo viewable [winfo toplevel $data(-parent)]] } { + wm transient $w $data(-parent) + } + + MotifFDialog_FileTypes $w + MotifFDialog_Update $w + + # Withdraw the window, then update all the geometry information + # so we know how big it wants to be, then center the window in the + # display (Motif style) and de-iconify it. + + ::tk::PlaceWindow $w + wm title $w $data(-title) + + return $w +} + +# ::tk::MotifFDialog_FileTypes -- +# +# Checks the -filetypes option. If present this adds a list of radio- +# buttons to pick the file types from. +# +# Arguments: +# w Pathname of the tk_get*File dialogue. +# +# Results: +# none + +proc ::tk::MotifFDialog_FileTypes {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + set f $w.top.f3.types + destroy $f + + # No file types: use "*" as the filter and display no radio-buttons + if {$data(-filetypes) eq ""} { + set data(filter) * + return + } + + # The filetypes radiobuttons + # set data(fileType) $data(-defaulttype) + # Default type to first entry + set initialTypeName [lindex $data(origfiletypes) 0 0] + if {$data(-typevariable) ne ""} { + upvar #0 $data(-typevariable) typeVariable + if {[info exists typeVariable]} { + set initialTypeName $typeVariable + } + } + set ix 0 + set data(fileType) 0 + foreach fltr $data(origfiletypes) { + set fname [lindex $fltr 0] + if {[string first $initialTypeName $fname] == 0} { + set data(fileType) $ix + break + } + incr ix + } + + MotifFDialog_SetFilter $w [lindex $data(-filetypes) $data(fileType)] + + #don't produce radiobuttons for only one filetype + if {[llength $data(-filetypes)] == 1} { + return + } + + frame $f + set cnt 0 + if {$data(-filetypes) ne {}} { + foreach type $data(-filetypes) { + set title [lindex $type 0] + set filter [lindex $type 1] + radiobutton $f.b$cnt \ + -text $title \ + -variable ::tk::dialog::file::[winfo name $w](fileType) \ + -value $cnt \ + -command [list tk::MotifFDialog_SetFilter $w $type] + pack $f.b$cnt -side left + incr cnt + } + } + $f.b$data(fileType) invoke + + pack $f -side bottom -fill both + + return +} + +# This proc gets called whenever data(filter) is set +# +proc ::tk::MotifFDialog_SetFilter {w type} { + upvar ::tk::dialog::file::[winfo name $w] data + variable ::tk::Priv + + set data(filter) [lindex $type 1] + set Priv(selectFileType) [lindex [lindex $type 0] 0] + + MotifFDialog_Update $w +} + +# ::tk::MotifFDialog_Config -- +# +# Iterates over the optional arguments to determine the option +# values for the Motif file dialog; gives default values to +# unspecified options. +# +# Arguments: +# dataName The name of the global variable in which +# data for the file dialog is stored. +# type "Save" or "Open" +# argList Options parsed by the procedure. + +proc ::tk::MotifFDialog_Config {dataName type argList} { + upvar ::tk::dialog::file::$dataName data + + set data(type) $type + + # 1: the configuration specs + # + set specs { + {-defaultextension "" "" ""} + {-filetypes "" "" ""} + {-initialdir "" "" ""} + {-initialfile "" "" ""} + {-parent "" "" "."} + {-title "" "" ""} + {-typevariable "" "" ""} + } + if {$type eq "open"} { + lappend specs {-multiple "" "" "0"} + } + if {$type eq "save"} { + lappend specs {-confirmoverwrite "" "" "1"} + } + + set data(-multiple) 0 + set data(-confirmoverwrite) 1 + # 2: default values depending on the type of the dialog + # + if {![info exists data(selectPath)]} { + # first time the dialog has been popped up + set data(selectPath) [pwd] + set data(selectFile) "" + } + + # 3: parse the arguments + # + tclParseConfigSpec ::tk::dialog::file::$dataName $specs "" $argList + + if {$data(-title) eq ""} { + if {$type eq "open"} { + if {$data(-multiple) != 0} { + set data(-title) "[mc {Open Multiple Files}]" + } else { + set data(-title) [mc "Open"] + } + } else { + set data(-title) [mc "Save As"] + } + } + + # 4: set the default directory and selection according to the -initial + # settings + # + if {$data(-initialdir) ne ""} { + if {[file isdirectory $data(-initialdir)]} { + set data(selectPath) [lindex [glob $data(-initialdir)] 0] + } else { + set data(selectPath) [pwd] + } + + # Convert the initialdir to an absolute path name. + + set old [pwd] + cd $data(selectPath) + set data(selectPath) [pwd] + cd $old + } + set data(selectFile) $data(-initialfile) + + # 5. Parse the -filetypes option. It is not used by the motif + # file dialog, but we check for validity of the value to make sure + # the application code also runs fine with the TK file dialog. + # + set data(origfiletypes) $data(-filetypes) + set data(-filetypes) [::tk::FDGetFileTypes $data(-filetypes)] + + if {![info exists data(filter)]} { + set data(filter) * + } + if {![winfo exists $data(-parent)]} { + return -code error -errorcode [list TK LOOKUP WINDOW $data(-parent)] \ + "bad window path name \"$data(-parent)\"" + } +} + +# ::tk::MotifFDialog_BuildUI -- +# +# Builds the UI components of the Motif file dialog. +# +# Arguments: +# w Pathname of the dialog to build. +# +# Results: +# None. + +proc ::tk::MotifFDialog_BuildUI {w} { + set dataName [lindex [split $w .] end] + upvar ::tk::dialog::file::$dataName data + + # Create the dialog toplevel and internal frames. + # + toplevel $w -class TkMotifFDialog + set top [frame $w.top -relief raised -bd 1] + set bot [frame $w.bot -relief raised -bd 1] + + pack $w.bot -side bottom -fill x + pack $w.top -side top -expand yes -fill both + + set f1 [frame $top.f1] + set f2 [frame $top.f2] + set f3 [frame $top.f3] + + pack $f1 -side top -fill x + pack $f3 -side bottom -fill x + pack $f2 -expand yes -fill both + + set f2a [frame $f2.a] + set f2b [frame $f2.b] + + grid $f2a -row 0 -column 0 -rowspan 1 -columnspan 1 -padx 4 -pady 4 \ + -sticky news + grid $f2b -row 0 -column 1 -rowspan 1 -columnspan 1 -padx 4 -pady 4 \ + -sticky news + grid rowconfigure $f2 0 -minsize 0 -weight 1 + grid columnconfigure $f2 0 -minsize 0 -weight 1 + grid columnconfigure $f2 1 -minsize 150 -weight 2 + + # The Filter box + # + bind [::tk::AmpWidget label $f1.lab -text [mc "Fil&ter:"] -anchor w] \ + <> [list focus $f1.ent] + entry $f1.ent + pack $f1.lab -side top -fill x -padx 6 -pady 4 + pack $f1.ent -side top -fill x -padx 4 -pady 0 + set data(fEnt) $f1.ent + + # The file and directory lists + # + set data(dList) [MotifFDialog_MakeSList $w $f2a \ + [mc "&Directory:"] DList] + set data(fList) [MotifFDialog_MakeSList $w $f2b \ + [mc "Fi&les:"] FList] + + # The Selection box + # + bind [::tk::AmpWidget label $f3.lab -text [mc "&Selection:"] -anchor w] \ + <> [list focus $f3.ent] + entry $f3.ent + pack $f3.lab -side top -fill x -padx 6 -pady 0 + pack $f3.ent -side top -fill x -padx 4 -pady 4 + set data(sEnt) $f3.ent + + # The buttons + # + set maxWidth [::tk::mcmaxamp &OK &Filter &Cancel] + set maxWidth [expr {$maxWidth<6?6:$maxWidth}] + set data(okBtn) [::tk::AmpWidget button $bot.ok -text [mc "&OK"] \ + -width $maxWidth \ + -command [list tk::MotifFDialog_OkCmd $w]] + set data(filterBtn) [::tk::AmpWidget button $bot.filter -text [mc "&Filter"] \ + -width $maxWidth \ + -command [list tk::MotifFDialog_FilterCmd $w]] + set data(cancelBtn) [::tk::AmpWidget button $bot.cancel -text [mc "&Cancel"] \ + -width $maxWidth \ + -command [list tk::MotifFDialog_CancelCmd $w]] + + pack $bot.ok $bot.filter $bot.cancel -padx 10 -pady 10 -expand yes \ + -side left + + # Create the bindings: + # + bind $w [list ::tk::AltKeyInDialog $w %A] + + bind $data(fEnt) [list tk::MotifFDialog_ActivateFEnt $w] + bind $data(sEnt) [list tk::MotifFDialog_ActivateSEnt $w] + bind $w [list tk::MotifFDialog_CancelCmd $w] + bind $w.bot {set ::tk::Priv(selectFilePath) {}} + + wm protocol $w WM_DELETE_WINDOW [list tk::MotifFDialog_CancelCmd $w] +} + +proc ::tk::MotifFDialog_SetListMode {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + if {$data(-multiple) != 0} { + set selectmode extended + } else { + set selectmode browse + } + set f $w.top.f2.b + $f.l configure -selectmode $selectmode +} + +# ::tk::MotifFDialog_MakeSList -- +# +# Create a scrolled-listbox and set the keyboard accelerator +# bindings so that the list selection follows what the user +# types. +# +# Arguments: +# w Pathname of the dialog box. +# f Frame widget inside which to create the scrolled +# listbox. This frame widget already exists. +# label The string to display on top of the listbox. +# under Sets the -under option of the label. +# cmdPrefix Specifies procedures to call when the listbox is +# browsed or activated. + +proc ::tk::MotifFDialog_MakeSList {w f label cmdPrefix} { + bind [::tk::AmpWidget label $f.lab -text $label -anchor w] \ + <> [list focus $f.l] + listbox $f.l -width 12 -height 5 -exportselection 0\ + -xscrollcommand [list $f.h set] -yscrollcommand [list $f.v set] + scrollbar $f.v -orient vertical -takefocus 0 -command [list $f.l yview] + scrollbar $f.h -orient horizontal -takefocus 0 -command [list $f.l xview] + grid $f.lab -row 0 -column 0 -sticky news -rowspan 1 -columnspan 2 \ + -padx 2 -pady 2 + grid $f.l -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news + grid $f.v -row 1 -column 1 -rowspan 1 -columnspan 1 -sticky news + grid $f.h -row 2 -column 0 -rowspan 1 -columnspan 1 -sticky news + + grid rowconfigure $f 0 -weight 0 -minsize 0 + grid rowconfigure $f 1 -weight 1 -minsize 0 + grid columnconfigure $f 0 -weight 1 -minsize 0 + + # bindings for the listboxes + # + set list $f.l + bind $list <> [list tk::MotifFDialog_Browse$cmdPrefix $w] + bind $list \ + [list tk::MotifFDialog_Activate$cmdPrefix $w] + bind $list "tk::MotifFDialog_Browse$cmdPrefix [list $w]; \ + tk::MotifFDialog_Activate$cmdPrefix [list $w]" + + bindtags $list [list Listbox $list [winfo toplevel $list] all] + ListBoxKeyAccel_Set $list + + return $f.l +} + +# ::tk::MotifFDialog_InterpFilter -- +# +# Interpret the string in the filter entry into two components: +# the directory and the pattern. If the string is a relative +# pathname, give a warning to the user and restore the pattern +# to original. +# +# Arguments: +# w pathname of the dialog box. +# +# Results: +# A list of two elements. The first element is the directory +# specified # by the filter. The second element is the filter +# pattern itself. + +proc ::tk::MotifFDialog_InterpFilter {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + set text [string trim [$data(fEnt) get]] + + # Perform tilde substitution + # + set badTilde 0 + if {[string index $text 0] eq "~"} { + set list [file split $text] + set tilde [lindex $list 0] + if {[catch {set tilde [glob $tilde]}]} { + set badTilde 1 + } else { + set text [eval file join [concat $tilde [lrange $list 1 end]]] + } + } + + # If the string is a relative pathname, combine it + # with the current selectPath. + + set relative 0 + if {[file pathtype $text] eq "relative"} { + set relative 1 + } elseif {$badTilde} { + set relative 1 + } + + if {$relative} { + tk_messageBox -icon warning -type ok \ + -message "\"$text\" must be an absolute pathname" + + $data(fEnt) delete 0 end + $data(fEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \ + $data(filter)] + + return [list $data(selectPath) $data(filter)] + } + + set resolved [::tk::dialog::file::JoinFile [file dirname $text] [file tail $text]] + + if {[file isdirectory $resolved]} { + set dir $resolved + set fil $data(filter) + } else { + set dir [file dirname $resolved] + set fil [file tail $resolved] + } + + return [list $dir $fil] +} + +# ::tk::MotifFDialog_Update +# +# Load the files and synchronize the "filter" and "selection" fields +# boxes. +# +# Arguments: +# w pathname of the dialog box. +# +# Results: +# None. + +proc ::tk::MotifFDialog_Update {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + $data(fEnt) delete 0 end + $data(fEnt) insert 0 \ + [::tk::dialog::file::JoinFile $data(selectPath) $data(filter)] + $data(sEnt) delete 0 end + $data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \ + $data(selectFile)] + + MotifFDialog_LoadFiles $w +} + +# ::tk::MotifFDialog_LoadFiles -- +# +# Loads the files and directories into the two listboxes according +# to the filter setting. +# +# Arguments: +# w pathname of the dialog box. +# +# Results: +# None. + +proc ::tk::MotifFDialog_LoadFiles {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + $data(dList) delete 0 end + $data(fList) delete 0 end + + set appPWD [pwd] + if {[catch {cd $data(selectPath)}]} { + cd $appPWD + + $data(dList) insert end ".." + return + } + + # Make the dir and file lists + # + # For speed we only have one glob, which reduces the file system + # calls (good for slow NFS networks). + # + # We also do two smaller sorts (files + dirs) instead of one large sort, + # which gives a small speed increase. + # + set top 0 + set dlist "" + set flist "" + foreach f [glob -nocomplain .* *] { + if {[file isdir ./$f]} { + lappend dlist $f + } else { + foreach pat $data(filter) { + if {[string match $pat $f]} { + if {[string match .* $f]} { + incr top + } + lappend flist $f + break + } + } + } + } + eval [list $data(dList) insert end] [lsort -dictionary $dlist] + eval [list $data(fList) insert end] [lsort -dictionary $flist] + + # The user probably doesn't want to see the . files. We adjust the view + # so that the listbox displays all the non-dot files + $data(fList) yview $top + + cd $appPWD +} + +# ::tk::MotifFDialog_BrowseDList -- +# +# This procedure is called when the directory list is browsed +# (clicked-over) by the user. +# +# Arguments: +# w The pathname of the dialog box. +# +# Results: +# None. + +proc ::tk::MotifFDialog_BrowseDList {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + focus $data(dList) + if {[$data(dList) curselection] eq ""} { + return + } + set subdir [$data(dList) get [$data(dList) curselection]] + if {$subdir eq ""} { + return + } + + $data(fList) selection clear 0 end + + set list [MotifFDialog_InterpFilter $w] + set data(filter) [lindex $list 1] + + switch -- $subdir { + . { + set newSpec [::tk::dialog::file::JoinFile $data(selectPath) $data(filter)] + } + .. { + set newSpec [::tk::dialog::file::JoinFile [file dirname $data(selectPath)] \ + $data(filter)] + } + default { + set newSpec [::tk::dialog::file::JoinFile [::tk::dialog::file::JoinFile \ + $data(selectPath) $subdir] $data(filter)] + } + } + + $data(fEnt) delete 0 end + $data(fEnt) insert 0 $newSpec +} + +# ::tk::MotifFDialog_ActivateDList -- +# +# This procedure is called when the directory list is activated +# (double-clicked) by the user. +# +# Arguments: +# w The pathname of the dialog box. +# +# Results: +# None. + +proc ::tk::MotifFDialog_ActivateDList {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + if {[$data(dList) curselection] eq ""} { + return + } + set subdir [$data(dList) get [$data(dList) curselection]] + if {$subdir eq ""} { + return + } + + $data(fList) selection clear 0 end + + switch -- $subdir { + . { + set newDir $data(selectPath) + } + .. { + set newDir [file dirname $data(selectPath)] + } + default { + set newDir [::tk::dialog::file::JoinFile $data(selectPath) $subdir] + } + } + + set data(selectPath) $newDir + MotifFDialog_Update $w + + if {$subdir ne ".."} { + $data(dList) selection set 0 + $data(dList) activate 0 + } else { + $data(dList) selection set 1 + $data(dList) activate 1 + } +} + +# ::tk::MotifFDialog_BrowseFList -- +# +# This procedure is called when the file list is browsed +# (clicked-over) by the user. +# +# Arguments: +# w The pathname of the dialog box. +# +# Results: +# None. + +proc ::tk::MotifFDialog_BrowseFList {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + focus $data(fList) + set data(selectFile) "" + foreach item [$data(fList) curselection] { + lappend data(selectFile) [$data(fList) get $item] + } + if {[llength $data(selectFile)] == 0} { + return + } + + $data(dList) selection clear 0 end + + $data(fEnt) delete 0 end + $data(fEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \ + $data(filter)] + $data(fEnt) xview end + + # if it's a multiple selection box, just put in the filenames + # otherwise put in the full path as usual + $data(sEnt) delete 0 end + if {$data(-multiple) != 0} { + $data(sEnt) insert 0 $data(selectFile) + } else { + $data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \ + [lindex $data(selectFile) 0]] + } + $data(sEnt) xview end +} + +# ::tk::MotifFDialog_ActivateFList -- +# +# This procedure is called when the file list is activated +# (double-clicked) by the user. +# +# Arguments: +# w The pathname of the dialog box. +# +# Results: +# None. + +proc ::tk::MotifFDialog_ActivateFList {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + if {[$data(fList) curselection] eq ""} { + return + } + set data(selectFile) [$data(fList) get [$data(fList) curselection]] + if {$data(selectFile) eq ""} { + return + } else { + MotifFDialog_ActivateSEnt $w + } +} + +# ::tk::MotifFDialog_ActivateFEnt -- +# +# This procedure is called when the user presses Return inside +# the "filter" entry. It updates the dialog according to the +# text inside the filter entry. +# +# Arguments: +# w The pathname of the dialog box. +# +# Results: +# None. + +proc ::tk::MotifFDialog_ActivateFEnt {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + set list [MotifFDialog_InterpFilter $w] + set data(selectPath) [lindex $list 0] + set data(filter) [lindex $list 1] + + MotifFDialog_Update $w +} + +# ::tk::MotifFDialog_ActivateSEnt -- +# +# This procedure is called when the user presses Return inside +# the "selection" entry. It sets the ::tk::Priv(selectFilePath) +# variable so that the vwait loop in tk::MotifFDialog will be +# terminated. +# +# Arguments: +# w The pathname of the dialog box. +# +# Results: +# None. + +proc ::tk::MotifFDialog_ActivateSEnt {w} { + variable ::tk::Priv + upvar ::tk::dialog::file::[winfo name $w] data + + set selectFilePath [string trim [$data(sEnt) get]] + + if {$selectFilePath eq ""} { + MotifFDialog_FilterCmd $w + return + } + + if {$data(-multiple) == 0} { + set selectFilePath [list $selectFilePath] + } + + if {[file isdirectory [lindex $selectFilePath 0]]} { + set data(selectPath) [lindex [glob $selectFilePath] 0] + set data(selectFile) "" + MotifFDialog_Update $w + return + } + + set newFileList "" + foreach item $selectFilePath { + if {[file pathtype $item] ne "absolute"} { + set item [file join $data(selectPath) $item] + } elseif {![file exists [file dirname $item]]} { + tk_messageBox -icon warning -type ok \ + -message [mc {Directory "%1$s" does not exist.} \ + [file dirname $item]] + return + } + + if {![file exists $item]} { + if {$data(type) eq "open"} { + tk_messageBox -icon warning -type ok \ + -message [mc {File "%1$s" does not exist.} $item] + return + } + } elseif {$data(type) eq "save" && $data(-confirmoverwrite)} { + set message [format %s%s \ + [mc "File \"%1\$s\" already exists.\n\n" $selectFilePath] \ + [mc {Replace existing file?}]] + set answer [tk_messageBox -icon warning -type yesno \ + -message $message] + if {$answer eq "no"} { + return + } + } + + lappend newFileList $item + } + + # Return selected filter + if {[info exists data(-typevariable)] && $data(-typevariable) ne "" + && [info exists data(-filetypes)] && $data(-filetypes) ne ""} { + upvar #0 $data(-typevariable) typeVariable + set typeVariable [lindex $data(origfiletypes) $data(fileType) 0] + } + + if {$data(-multiple) != 0} { + set Priv(selectFilePath) $newFileList + } else { + set Priv(selectFilePath) [lindex $newFileList 0] + } + + # Set selectFile and selectPath to first item in list + set Priv(selectFile) [file tail [lindex $newFileList 0]] + set Priv(selectPath) [file dirname [lindex $newFileList 0]] +} + + +proc ::tk::MotifFDialog_OkCmd {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + MotifFDialog_ActivateSEnt $w +} + +proc ::tk::MotifFDialog_FilterCmd {w} { + upvar ::tk::dialog::file::[winfo name $w] data + + MotifFDialog_ActivateFEnt $w +} + +proc ::tk::MotifFDialog_CancelCmd {w} { + variable ::tk::Priv + + set Priv(selectFilePath) "" + set Priv(selectFile) "" + set Priv(selectPath) "" +} + +proc ::tk::ListBoxKeyAccel_Set {w} { + bind Listbox "" + bind $w [list tk::ListBoxKeyAccel_Unset $w] + bind $w [list tk::ListBoxKeyAccel_Key $w %A] +} + +proc ::tk::ListBoxKeyAccel_Unset {w} { + variable ::tk::Priv + + catch {after cancel $Priv(lbAccel,$w,afterId)} + unset -nocomplain Priv(lbAccel,$w) Priv(lbAccel,$w,afterId) +} + +# ::tk::ListBoxKeyAccel_Key-- +# +# This procedure maintains a list of recently entered keystrokes +# over a listbox widget. It arranges an idle event to move the +# selection of the listbox to the entry that begins with the +# keystrokes. +# +# Arguments: +# w The pathname of the listbox. +# key The key which the user just pressed. +# +# Results: +# None. + +proc ::tk::ListBoxKeyAccel_Key {w key} { + variable ::tk::Priv + + if { $key eq "" } { + return + } + append Priv(lbAccel,$w) $key + ListBoxKeyAccel_Goto $w $Priv(lbAccel,$w) + catch { + after cancel $Priv(lbAccel,$w,afterId) + } + set Priv(lbAccel,$w,afterId) [after 500 \ + [list tk::ListBoxKeyAccel_Reset $w]] +} + +proc ::tk::ListBoxKeyAccel_Goto {w string} { + variable ::tk::Priv + + set string [string tolower $string] + set end [$w index end] + set theIndex -1 + + for {set i 0} {$i < $end} {incr i} { + set item [string tolower [$w get $i]] + if {[string compare $string $item] >= 0} { + set theIndex $i + } + if {[string compare $string $item] <= 0} { + set theIndex $i + break + } + } + + if {$theIndex >= 0} { + $w selection clear 0 end + $w selection set $theIndex $theIndex + $w activate $theIndex + $w see $theIndex + event generate $w <> + } +} + +proc ::tk::ListBoxKeyAccel_Reset {w} { + variable ::tk::Priv + + unset -nocomplain Priv(lbAccel,$w) +} + +proc ::tk_getFileType {} { + variable ::tk::Priv + + return $Priv(selectFileType) +} + diff --git a/shared/package-files/9c/9c7e5a46554ab6a8121832dc0cd9f7a60f5034cef1a5a7d61346bbd912516b54/blob b/shared/package-files/9c/9c7e5a46554ab6a8121832dc0cd9f7a60f5034cef1a5a7d61346bbd912516b54/blob new file mode 100644 index 0000000000000000000000000000000000000000..279a0bd82ad663e5c09d2fa7ef448472ee82b205 Binary files /dev/null and b/shared/package-files/9c/9c7e5a46554ab6a8121832dc0cd9f7a60f5034cef1a5a7d61346bbd912516b54/blob differ diff --git a/shared/package-files/9c/9c80142256cbe6c56aa5312ddf861d5060cd9aeeb46bb8ad05869a50cbb3008b/blob b/shared/package-files/9c/9c80142256cbe6c56aa5312ddf861d5060cd9aeeb46bb8ad05869a50cbb3008b/blob new file mode 100644 index 0000000000000000000000000000000000000000..dff6e5ed81a7ee8a89df3ceb41b063913b995da9 --- /dev/null +++ b/shared/package-files/9c/9c80142256cbe6c56aa5312ddf861d5060cd9aeeb46bb8ad05869a50cbb3008b/blob @@ -0,0 +1,217 @@ +""" + pygments.lexers.typoscript + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for TypoScript + + `TypoScriptLexer` + A TypoScript lexer. + + `TypoScriptCssDataLexer` + Lexer that highlights markers, constants and registers within css. + + `TypoScriptHtmlDataLexer` + Lexer that highlights markers, constants and registers within html tags. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import RegexLexer, include, bygroups, using +from pygments.token import Text, Comment, Name, String, Number, \ + Operator, Punctuation + +__all__ = ['TypoScriptLexer', 'TypoScriptCssDataLexer', 'TypoScriptHtmlDataLexer'] + + +class TypoScriptCssDataLexer(RegexLexer): + """ + Lexer that highlights markers, constants and registers within css blocks. + + .. versionadded:: 2.2 + """ + + name = 'TypoScriptCssData' + aliases = ['typoscriptcssdata'] + + tokens = { + 'root': [ + # marker: ###MARK### + (r'(.*)(###\w+###)(.*)', bygroups(String, Name.Constant, String)), + # constant: {$some.constant} + (r'(\{)(\$)((?:[\w\-]+\.)*)([\w\-]+)(\})', + bygroups(String.Symbol, Operator, Name.Constant, + Name.Constant, String.Symbol)), # constant + # constant: {register:somevalue} + (r'(.*)(\{)([\w\-]+)(\s*:\s*)([\w\-]+)(\})(.*)', + bygroups(String, String.Symbol, Name.Constant, Operator, + Name.Constant, String.Symbol, String)), # constant + # whitespace + (r'\s+', Text), + # comments + (r'/\*(?:(?!\*/).)*\*/', Comment), + (r'(?,:=.*%+|]', String), + (r'[\w"\-!/&;(){}]+', String), + ] + } + + +class TypoScriptHtmlDataLexer(RegexLexer): + """ + Lexer that highlights markers, constants and registers within html tags. + + .. versionadded:: 2.2 + """ + + name = 'TypoScriptHtmlData' + aliases = ['typoscripthtmldata'] + + tokens = { + 'root': [ + # INCLUDE_TYPOSCRIPT + (r'(INCLUDE_TYPOSCRIPT)', Name.Class), + # Language label or extension resource FILE:... or LLL:... or EXT:... + (r'(EXT|FILE|LLL):[^}\n"]*', String), + # marker: ###MARK### + (r'(.*)(###\w+###)(.*)', bygroups(String, Name.Constant, String)), + # constant: {$some.constant} + (r'(\{)(\$)((?:[\w\-]+\.)*)([\w\-]+)(\})', + bygroups(String.Symbol, Operator, Name.Constant, + Name.Constant, String.Symbol)), # constant + # constant: {register:somevalue} + (r'(.*)(\{)([\w\-]+)(\s*:\s*)([\w\-]+)(\})(.*)', + bygroups(String, String.Symbol, Name.Constant, Operator, + Name.Constant, String.Symbol, String)), # constant + # whitespace + (r'\s+', Text), + # other + (r'[<>,:=.*%+|]', String), + (r'[\w"\-!/&;(){}#]+', String), + ] + } + + +class TypoScriptLexer(RegexLexer): + """ + Lexer for TypoScript code. + + .. versionadded:: 2.2 + """ + + name = 'TypoScript' + url = 'http://docs.typo3.org/typo3cms/TyposcriptReference/' + aliases = ['typoscript'] + filenames = ['*.typoscript'] + mimetypes = ['text/x-typoscript'] + + flags = re.DOTALL | re.MULTILINE + + tokens = { + 'root': [ + include('comment'), + include('constant'), + include('html'), + include('label'), + include('whitespace'), + include('keywords'), + include('punctuation'), + include('operator'), + include('structure'), + include('literal'), + include('other'), + ], + 'keywords': [ + # Conditions + (r'(?i)(\[)(browser|compatVersion|dayofmonth|dayofweek|dayofyear|' + r'device|ELSE|END|GLOBAL|globalString|globalVar|hostname|hour|IP|' + r'language|loginUser|loginuser|minute|month|page|PIDinRootline|' + r'PIDupinRootline|system|treeLevel|useragent|userFunc|usergroup|' + r'version)([^\]]*)(\])', + bygroups(String.Symbol, Name.Constant, Text, String.Symbol)), + # Functions + (r'(?=[\w\-])(HTMLparser|HTMLparser_tags|addParams|cache|encapsLines|' + r'filelink|if|imageLinkWrap|imgResource|makelinks|numRows|numberFormat|' + r'parseFunc|replacement|round|select|split|stdWrap|strPad|tableStyle|' + r'tags|textStyle|typolink)(?![\w\-])', Name.Function), + # Toplevel objects and _* + (r'(?:(=?\s*]*>', using(TypoScriptHtmlDataLexer)), + (r'&[^;\n]*;', String), + (r'(?s)(_CSS_DEFAULT_STYLE)(\s*)(\()(.*(?=\n\)))', + bygroups(Name.Class, Text, String.Symbol, using(TypoScriptCssDataLexer))), + ], + 'literal': [ + (r'0x[0-9A-Fa-f]+t?', Number.Hex), + # (r'[0-9]*\.[0-9]+([eE][0-9]+)?[fd]?\s*(?:[^=])', Number.Float), + (r'[0-9]+', Number.Integer), + (r'(###\w+###)', Name.Constant), + ], + 'label': [ + # Language label or extension resource FILE:... or LLL:... or EXT:... + (r'(EXT|FILE|LLL):[^}\n"]*', String), + # Path to a resource + (r'(?![^\w\-])([\w\-]+(?:/[\w\-]+)+/?)(\S*\n)', + bygroups(String, String)), + ], + 'punctuation': [ + (r'[,.]', Punctuation), + ], + 'operator': [ + (r'[<>,:=.*%+|]', Operator), + ], + 'structure': [ + # Brackets and braces + (r'[{}()\[\]\\]', String.Symbol), + ], + 'constant': [ + # Constant: {$some.constant} + (r'(\{)(\$)((?:[\w\-]+\.)*)([\w\-]+)(\})', + bygroups(String.Symbol, Operator, Name.Constant, + Name.Constant, String.Symbol)), # constant + # Constant: {register:somevalue} + (r'(\{)([\w\-]+)(\s*:\s*)([\w\-]+)(\})', + bygroups(String.Symbol, Name.Constant, Operator, + Name.Constant, String.Symbol)), # constant + # Hex color: #ff0077 + (r'(#[a-fA-F0-9]{6}\b|#[a-fA-F0-9]{3}\b)', String.Char) + ], + 'comment': [ + (r'(? +#include +#include + +// ROCM hcc doesn't work well with using std:: in kernel functions +#if defined(__CUDA_ARCH__) +#include +#define compat_exp c10::cuda::compat::exp +#define compat_ceil c10::cuda::compat::ceil +#define compat_floor c10::cuda::compat::floor +#define compat_log c10::cuda::compat::log +#define compat_pow c10::cuda::compat::pow +#define compat_sqrt c10::cuda::compat::sqrt +#define compat_tan c10::cuda::compat::tan +#define compat_abs c10::cuda::compat::abs +#define compat_log1p c10::cuda::compat::log1p +#elif defined(__HIPCC__) +#include +#define compat_exp c10::hip::compat::exp +#define compat_ceil c10::hip::compat::ceil +#define compat_floor c10::hip::compat::floor +#define compat_log c10::hip::compat::log +#define compat_pow c10::hip::compat::pow +#define compat_sqrt c10::hip::compat::sqrt +#define compat_tan c10::hip::compat::tan +#define compat_abs c10::hip::compat::abs +#define compat_log1p c10::hip::compat::log1p +#else +#define compat_exp std::exp +#define compat_ceil std::ceil +#define compat_floor std::floor +#define compat_log std::log +#define compat_pow std::pow +#define compat_sqrt std::sqrt +#define compat_tan std::tan +#define compat_abs std::abs +#define compat_log1p std::log1p +#endif + +namespace { + +#if !defined(__CUDA_ARCH__) && !defined(__HIPCC__) +// we cannot use std::isnan directly due to some incompatibility of +// gcc constexpr'ing and nvcc +using std::isnan; +#endif + +// Here sampler_t should be function type scalar_t(void). For gpu +// "sampler" is a device function, but since ROCM doesn't have +// equivalent to nvstd::function, we use a template type parameter to +// capture it. +template +struct BaseSampler { + sampler_t sampler; + C10_DEVICE BaseSampler(const sampler_t& sampler): sampler(sampler) {} + C10_DEVICE scalar_t sample() { + return sampler(); + } +}; + +// The function `sample_gamma` is +// is adapted from Numpy's distributions.c implementation. +// It is MIT licensed, so here is the copyright: + +/* Copyright 2005 Robert Kern (robert.kern@gmail.com) + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +template +C10_DEVICE scalar_t sample_gamma(scalar_t alpha, BaseSampler& standard_uniform, BaseSampler& standard_normal) { + accscalar_t scale = 1.0f; + + // Boost alpha for higher acceptance probability. + if (alpha < 1.0f) { + if (alpha == 0.f) return 0.f; + scale *= compat_pow(1 - standard_uniform.sample(), 1.0f / alpha); + alpha += 1.0f; + } + + // This implements the acceptance-rejection method of Marsaglia and Tsang (2000) + // doi:10.1145/358407.358414 + const accscalar_t d = alpha - 1.0f / 3.0f; + const accscalar_t c = 1.0f / compat_sqrt(9.0f * d); + for (;;) { + accscalar_t x, y; + do { + x = standard_normal.sample(); + y = 1.0f + c * x; + } while (y <= 0); + const accscalar_t v = y * y * y; + const accscalar_t u = 1 - standard_uniform.sample(); + const accscalar_t xx = x * x; + if (u < 1.0f - 0.0331f * xx * xx) + return static_cast(scale * d * v); + if (compat_log(u) < 0.5f * xx + d * (1.0f - v + compat_log(v))) + return static_cast(scale * d * v); + } +} + +/* the functions stirling_approx_tail, binomial_inversion, and btrs are adapted + * from TensorFlow's random_binomial_op.cc implementation. That code is under + * copyright: 2019 The TensorFlow Authors. + * + * It was released under the Apache License, Version 2.0 (the "License"), available at: + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +template +C10_DEVICE scalar_t stirling_approx_tail(scalar_t k) { + const static scalar_t kTailValues[] = { + 0.0810614667953272, + 0.0413406959554092, + 0.0276779256849983, + 0.02079067210376509, + 0.0166446911898211, + 0.0138761288230707, + 0.0118967099458917, + 0.0104112652619720, + 0.00925546218271273, + 0.00833056343336287 + }; + if (k <= 9) { + return kTailValues[static_cast(k)]; + } + scalar_t kp1sq = (k + 1) * (k + 1); + return (1.0 / 12 - (1.0 / 360 - 1.0 / 1260 / kp1sq) / kp1sq) / (k + 1); +} + + +template +C10_DEVICE scalar_t binomial_inversion(scalar_t count, scalar_t prob, BaseSampler& standard_uniform) { + accscalar_t U; + accscalar_t geom_sum = 0; + scalar_t num_geom = 0; + + accscalar_t logprob = compat_log1p(-prob); + + while (1) { + U = standard_uniform.sample(); + accscalar_t geom = compat_ceil(compat_log(U) / logprob); + geom_sum += geom; + if (geom_sum > count) { + break; + } + num_geom = num_geom + 1; + } + return num_geom; +} + +template +C10_DEVICE scalar_t btrs(scalar_t count, scalar_t prob, BaseSampler& standard_uniform) { + scalar_t k; + accscalar_t U, V, us; + + // This is spq in the paper. + const accscalar_t stddev = compat_sqrt(count * prob * (1 - prob)); + + // Other coefficients for Transformed Rejection sampling. + const accscalar_t b = 1.15 + 2.53 * stddev; + const accscalar_t a = -0.0873 + 0.0248 * b + 0.01 * prob; + const accscalar_t c = count * prob + 0.5; + const accscalar_t v_r = 0.92 - 4.2 / b; + const accscalar_t r = prob / (1 - prob); + + const accscalar_t alpha = (2.83 + 5.1 / b) * stddev; + const accscalar_t m = compat_floor((count + 1) * prob); + + while (1) { + U = standard_uniform.sample() - 0.5; + V = standard_uniform.sample(); + + us = 0.5 - compat_abs(U); + k = static_cast(compat_floor((2 * a / us + b) * U + c)); + + // Reject non-sensical answers. + if (k < 0 || k > count) { + continue; + } + // Region for which the box is tight, and we can return our calculated value. + // This should happen 0.86 * v_r times. In the limit as n * p is large, + // the acceptance rate converges to ~79% (and in the lower regime it is ~24%). + if (us >= 0.07 && V <= v_r) { + return k; + } + + // This deviates from Hormann's BTRS algorithm, as there is a log missing. + // For all (u, v) pairs outside of the bounding box, this calculates the + // transformed-reject ratio. + V = compat_log(V * alpha / (a / (us * us) + b)); + accscalar_t upperbound = + ((m + 0.5) * compat_log((m + 1) / (r * (count - m + 1))) + + (count + 1) * compat_log((count - m + 1) / (count - k + 1)) + + (k + 0.5) * compat_log(r * (count - k + 1) / (k + 1)) + + stirling_approx_tail(m) + stirling_approx_tail(count - m) - + stirling_approx_tail(k) - stirling_approx_tail(count - k)); + + if (V <= upperbound) { + return k; + } + } +} + +template +C10_DEVICE scalar_t sample_binomial(scalar_t count, scalar_t prob, BaseSampler& standard_uniform) { + if (count <= 0.0 || prob <= 0.0) { + return 0; + } else if (prob >= 1.0) { + return count; + } else if (prob <= 0.5) { + if (count * prob >= 10.0) { + // btrs + return btrs(count, prob, standard_uniform); + } else { + // binomial inversion + return binomial_inversion(count, prob, standard_uniform); + } + } else if (prob > 0.5) { + scalar_t qprob = 1.0 - prob; + if (count * qprob >= 10.0) { + // btrs + return count - btrs(count, qprob, standard_uniform); + } else { + // count - binomial inversion + return count - binomial_inversion(count, qprob, standard_uniform); + } + } else { + // prob is nan? + return static_cast(NAN); + } +} + +/* + * This function is derived from the implementation of the digamma function in the Cephes Math Library. + * See note [3-Clause BSD License for the Cephes Math Library] in ATen/native/Math.h. + */ +template +C10_DEVICE static inline scalar_t digamma_one(scalar_t x) { + constexpr accscalar_t PSI_10 = 2.25175258906672110764; + if (x == 0) { + return INFINITY; + } + accscalar_t additional_summand = 0; + int x_is_integer = x == compat_floor(x); + if (x < 0) { + if (x_is_integer) { + return INFINITY; + } + // it is more standard to write this as recursion, but + // nvcc does not like that + additional_summand = -c10::pi / + compat_tan(c10::pi * x); + x = 1 - x; + } + + // Push x to be >= 10 + accscalar_t result = 0; + while (x < 10) { + result -= 1 / x; + x += 1; + } + if (x == 10) { + return result + PSI_10 + additional_summand; + } + + // Compute asymptotic digamma + static const accscalar_t A[] = { + 8.33333333333333333333E-2, + -2.10927960927960927961E-2, + 7.57575757575757575758E-3, + -4.16666666666666666667E-3, + 3.96825396825396825397E-3, + -8.33333333333333333333E-3, + 8.33333333333333333333E-2, + }; + + accscalar_t y = 0; + if (x < 1.0e17f) { + accscalar_t z = 1.0 / (x * x); + y = z * polevl(z, A, 6); + } + return static_cast( + result + compat_log(x) - (0.5f / x) - y + additional_summand); +} + +// Computes the reparameterized gradient -(d/dalpha cdf(x;alpha)) / pdf(x;alpha) +// for random number x drawn from a standard Gamma distribution Gamma(alpha). +template +C10_HOST_DEVICE scalar_t standard_gamma_grad_one(scalar_t alpha_, scalar_t x_) { + // Use a Taylor series expansion for small x. + accscalar_t x = static_cast(x_); + accscalar_t alpha = static_cast(alpha_); + if (x < 0.8f) { + accscalar_t numer = 1; + accscalar_t denom = alpha; + auto series1 = numer / denom; + auto series2 = numer / (denom * denom); + for (int i = 1; i <= 5; ++i) { + numer *= -x / static_cast(i); + denom += 1; + series1 += numer / denom; + series2 += numer / (denom * denom); + } + const auto pow_x_alpha = compat_pow(x, alpha); + const auto gamma_pdf = compat_pow(x, alpha - 1) * compat_exp(-x); + const auto gamma_cdf = pow_x_alpha * series1; + const auto gamma_cdf_alpha = + (compat_log(x) - digamma_one(alpha)) * + gamma_cdf - + pow_x_alpha * series2; + const auto result = -gamma_cdf_alpha / gamma_pdf; + return isnan(result) ? static_cast( 0.f ) : static_cast(result); + } + + // Use a Rice saddle point expansion for large alpha. + if (alpha > 8.0f) { + if (0.9f * alpha <= x && x <= 1.1f * alpha) { + const auto numer_1 = 1 + 24 * alpha * (1 + 12 * alpha); + const auto numer_2 = 1440 * (alpha * alpha) + 6 * x * (53 - 120 * x) + - 65 * x * x / alpha + alpha * (107 + 3600 * x); + const auto denom = 1244160 * (alpha * alpha) * (alpha * alpha); + return static_cast(numer_1 * numer_2 / denom); + } + const auto denom = compat_sqrt(8 * alpha); + const auto term2 = denom / (alpha - x); + const auto term3 = compat_pow( + x - alpha - alpha * compat_log(x / alpha), + static_cast(-1.5)); + const auto term23 = (x < alpha) ? term2 - term3 : term2 + term3; + const auto term1 = compat_log(x / alpha) * term23 - + compat_sqrt(2 / alpha) * (alpha + x) / ((alpha - x) * (alpha - x)); + const auto stirling = 1 + 1 / (12 * alpha) * (1 + 1 / (24 * alpha)); + const auto numer = x * term1; + return static_cast(-stirling * numer / denom); + } + + // Use a bivariate rational approximation to the reparameterized gradient. + const auto u = compat_log(x / alpha); + const auto v = compat_log(alpha); + static const accscalar_t coef_uv[3][8] = { + {0.16009398, -0.094634809, 0.025146376, -0.0030648343, + 1, 0.32668115, 0.10406089, 0.0014179084}, + {0.53487893, 0.1298071, 0.065735949, -0.0015649758, + 0.16639465, 0.020070113, -0.0035938915, -0.00058392623}, + {0.040121004, -0.0065914022, -0.0026286047, -0.0013441777, + 0.017050642, -0.0021309326, 0.00085092367, -1.5247877e-07}, + }; + accscalar_t coef_v[8]; + for (int i = 0; i < 8; ++ i) { + coef_v[i] = coef_uv[0][i] + u * (coef_uv[1][i] + u * coef_uv[2][i]); + } + const auto p = coef_v[0] + v * (coef_v[1] + v * (coef_v[2] + v * coef_v[3])); + const auto q = coef_v[4] + v * (coef_v[5] + v * (coef_v[6] + v * coef_v[7])); + return static_cast(compat_exp(p / q)); +} + +// Approximate reparameterized gradient of Beta(x,alpha,beta) wrt alpha. +// Assumes x is close to zero and uses a Taylor expansion. +template +C10_DEVICE static inline scalar_t _beta_grad_alpha_small(scalar_t x, scalar_t alpha, scalar_t beta) { + const scalar_t factor = digamma_one(alpha) + - digamma_one(alpha + beta) - compat_log(x); + scalar_t numer = 1; + scalar_t series = numer / alpha * (factor + 1 / alpha); + for (int i = 1; i <= 10; ++i) { + scalar_t casted_i = static_cast(i); + numer *= (casted_i - beta) * x / casted_i; + const scalar_t denom = alpha + casted_i; + series += numer / denom * (factor + 1 / denom); + } + const scalar_t result = x * compat_pow(1 - x, -beta) * series; + return isnan(result) ? static_cast( 0.f ) : result; +} + +// Approximate reparameterized gradient of Beta(x,alpha,beta) wrt beta. +// Assumes x is close to zero and uses a Taylor expansion. +template +C10_DEVICE static inline scalar_t _beta_grad_beta_small(scalar_t x, scalar_t alpha, scalar_t beta) { + const scalar_t factor = digamma_one(alpha + beta) - digamma_one(beta); + scalar_t numer = 1, betas = 1, dbetas = 0, series = factor / alpha; + for (int i = 1; i <= 8; ++i) { + scalar_t casted_i = static_cast(i); + numer *= -x / casted_i; + dbetas = dbetas * (beta - casted_i) + betas; + betas = betas * (beta - casted_i); + series += numer / (alpha + casted_i) * (dbetas + factor * betas); + } + const scalar_t result = -compat_pow(1 - x, 1 - beta) * series; + return isnan(result) ? static_cast( 0.f ) : result; +} + +// Approximate reparameterized gradient of Beta(x,alpha,beta) wrt alpha. +// Assumes alpha and beta are both large and uses a Rice saddle point expansion. +// To ensure numerical stability, this computation is performed at higher precision. +template +C10_DEVICE static inline scalar_t _beta_grad_alpha_mid(accscalar_t x, accscalar_t alpha, accscalar_t beta) { + const accscalar_t total = alpha + beta; + const accscalar_t mean = alpha / total; + const accscalar_t std = compat_sqrt(alpha * beta / (total + 1)) / total; + if (mean - 0.1 * std <= x && x <= mean + 0.1 * std) { + // Avoid the singularity at x = mean. + const accscalar_t poly = 47 * x * (beta * beta) * (beta * beta) + alpha * ( + (43 + 20 * (16 + 27 * beta) * x) * (beta * beta) * beta + alpha * ( + 3 * (59 + 180 * beta - 90 * x) * (beta * beta) + alpha * ( + (453 + 1620 * beta * (1 - x) - 455 * x) * beta + alpha * ( + 8 * (1 - x) * (135 * beta - 11))))); + const accscalar_t prefactor_num = (1 + 12 * alpha) * (1 + 12 * beta) / (total * total); + const accscalar_t prefactor_den = 12960 * alpha * alpha * alpha * beta * beta * (1 + 12 * total); + return prefactor_num / (1 - x) * poly / prefactor_den; + } + const accscalar_t prefactor = -x / compat_sqrt(2 * alpha * beta / total); + const accscalar_t stirling = (1 + 1 / (12 * alpha) + 1 / (288 * alpha * alpha)) + * (1 + 1 / (12 * beta) + 1 / (288 * beta * beta)) + / (1 + 1 / (12 * total) + 1 / (288 * total * total)); + const accscalar_t term1_num = 2 * (alpha * alpha) * (x - 1) + alpha * beta * (x - 1) - x * (beta * beta); + const accscalar_t axbx = alpha * (x - 1) + beta * x; + const accscalar_t term1_den = compat_sqrt(2 * alpha / beta) * compat_pow(total, static_cast(1.5f)) * axbx * axbx; + const accscalar_t term1 = term1_num / term1_den; + const accscalar_t term2 = 0.5f * compat_log(alpha / (total * x)); + const accscalar_t term3_num = compat_sqrt(8 * alpha * beta / total); + const accscalar_t term3_den = beta * x + alpha * (x - 1); + const accscalar_t term3 = term3_num / term3_den; + const accscalar_t term4_base = beta * compat_log(beta / (total * (1 - x))) + + alpha * compat_log(alpha / (total * x)); + const accscalar_t term4 = compat_pow(term4_base, static_cast(-1.5f)); + const accscalar_t term1234 = term1 + term2 * (term3 + (x < mean ? term4 : -term4)); + return static_cast(stirling * prefactor * term1234); +} + +// Computes a scaled reparameterized gradient +// -(d/dalpha cdf(x;alpha,beta)) / pdf(x;alpha,beta) / (1-x) +// for random number x drawn from a Beta distribution Beta(alpha,beta). +// This function inputs total=alpha+beta to make it easy to implement +// Dirichlet reparameterized gradients in terms of Betas. +template +C10_HOST_DEVICE static inline scalar_t dirichlet_grad_one(scalar_t x, scalar_t alpha, scalar_t total) { + accscalar_t x_ = static_cast(x); + accscalar_t alpha_ = static_cast(alpha); + accscalar_t total_ = static_cast(total); + + const scalar_t beta = total - alpha; + const accscalar_t beta_ = total_ - alpha_; + const scalar_t boundary = total * x * (1 - x); + + // Use an asymptotic approximation for x close to 0. + if (x <= 0.5f && boundary < 2.5f) { + return _beta_grad_alpha_small(x, alpha, beta); + } + + // Use an asymptotic approximation for x close to 1. + if (x >= 0.5f && boundary < 0.75f) { + return -_beta_grad_beta_small(1 - x, beta, alpha); + } + + // Use an asymptotic approximation when alpha and (total - alpha) are both large. + if (alpha > 6 && beta > 6) { + return _beta_grad_alpha_mid(x_, alpha_, beta_); + } + + // Use a rational correction to an analytic approximation. + static const accscalar_t c[2][3][3][4] = { + {{{1.003668233, -0.01061107488, -0.0657888334, 0.01201642863}, + {0.6336835991, -0.3557432599, 0.05486251648, -0.001465281033}, + {-0.03276231906, 0.004474107445, 0.002429354597, -0.0001557569013}}, + {{0.221950385, -0.3187676331, 0.01799915743, 0.01074823814}, + {-0.2951249643, 0.06219954479, 0.01535556598, 0.001550077057}, + {0.02155310298, 0.004170831599, 0.001292462449, 6.976601077e-05}}, + {{-0.05980841433, 0.008441916499, 0.01085618172, 0.002319392565}, + {0.02911413504, 0.01400243777, -0.002721828457, 0.000751041181}, + {0.005900514878, -0.001936558688, -9.495446725e-06, 5.385558597e-05}}}, + {{{1, -0.02924021934, -0.04438342661, 0.007285809825}, + {0.6357567472, -0.3473456711, 0.05454656494, -0.002407477521}, + {-0.03301322327, 0.004845219414, 0.00231480583, -0.0002307248149}}, + {{0.5925320577, -0.1757678135, 0.01505928619, 0.000564515273}, + {0.1014815858, -0.06589186703, 0.01272886114, -0.0007316646956}, + {-0.007258481865, 0.001096195486, 0.0003934994223, -4.12701925e-05}}, + {{0.06469649321, -0.0236701437, 0.002902096474, -5.896963079e-05}, + {0.001925008108, -0.002869809258, 0.0008000589141, -6.063713228e-05}, + {-0.0003477407336, 6.959756487e-05, 1.097287507e-05, -1.650964693e-06}}}, + }; + const accscalar_t u = compat_log(x_); + const accscalar_t a = compat_log(alpha_) - u; + const accscalar_t b = compat_log(total_) - a; + const accscalar_t pow_u[3] = {1, u, u * u}; + const accscalar_t pow_a[3] = {1, a, a * a}; + accscalar_t p = 0.0; + accscalar_t q = 0.0; + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + const accscalar_t ua = pow_u[i] * pow_a[j]; + p += ua * (c[0][i][j][0] + b * (c[0][i][j][1] + b * (c[0][i][j][2] + b * c[0][i][j][3]))); + q += ua * (c[1][i][j][0] + b * (c[1][i][j][1] + b * (c[1][i][j][2] + b * c[1][i][j][3]))); + } + } + const accscalar_t approx = x_ * (digamma_one(total_) - digamma_one(alpha_)) / beta_; + return static_cast(p / q * approx); +} + +} // namespace diff --git a/shared/package-files/9c/9c891a6d98ae2f3082dc24fb96f90bc31dbe6c135bdc808e779d92195f09e7dd/blob b/shared/package-files/9c/9c891a6d98ae2f3082dc24fb96f90bc31dbe6c135bdc808e779d92195f09e7dd/blob new file mode 100644 index 0000000000000000000000000000000000000000..b5d74baa7a799e424fe648740f17e3c369337d58 --- /dev/null +++ b/shared/package-files/9c/9c891a6d98ae2f3082dc24fb96f90bc31dbe6c135bdc808e779d92195f09e7dd/blob @@ -0,0 +1,137 @@ +""" +unit test for spline and other smoother classes + +Author: Luca Puggini + +""" + +import numpy as np +from numpy.testing import assert_allclose, assert_equal +import pytest + +from statsmodels.gam.smooth_basis import ( + BSplines, + CubicSplines, + PolynomialSmoother, + UnivariatePolynomialSmoother, + get_knots_bsplines, +) + + +def test_get_knots_bsplines_spacing(): + rs = np.random.RandomState(0) + x = rs.uniform(size=100) + + # df=8, degree=3 -> n_inner_knots=4 + knots_q = get_knots_bsplines(x, df=8, degree=3, spacing="quantile") + knots_e = get_knots_bsplines(x, df=8, degree=3, spacing="equal") + assert knots_q.ndim == 1 + assert knots_e.ndim == 1 + + with pytest.raises(ValueError, match="spacing"): + get_knots_bsplines(x, df=8, degree=3, spacing="not-a-spacing") + + # previously silent: an invalid `spacing` was never checked at all when + # `knots` was given directly instead of `df`, so this used to succeed + # (identically to spacing="quantile") instead of raising. + with pytest.raises(ValueError, match="spacing"): + get_knots_bsplines(x, knots=[0.25, 0.5, 0.75], degree=3, spacing="bogus") + + +@pytest.mark.parametrize( + "df,degree,n_inner_knots", + [ + (4, 3, 0), # cubic spline, no inner knots at all + (5, 3, 1), # cubic spline, exactly one inner knot + (3, 2, 0), # quadratic spline, no inner knots + (4, 2, 1), # quadratic spline, exactly one inner knot + ], +) +def test_get_knots_bsplines_spacing_equal_few_inner_knots(df, degree, n_inner_knots): + # GH: spacing="equal" raised IndexError ("index 1 is out of bounds") + # whenever n_inner_knots = df - (degree + 1) was 0 or 1, because + # diff_knots was computed as inner_knots[1] - inner_knots[0], which + # needs at least 2 inner knots to exist. + rs = np.random.RandomState(0) + x = rs.uniform(size=100) + x_min, x_max = x.min(), x.max() + order = degree + 1 + + all_knots = get_knots_bsplines(x, df=df, degree=degree, spacing="equal") + + assert all_knots.ndim == 1 + assert len(all_knots) == n_inner_knots + 2 * order + assert np.all(np.diff(all_knots) > 0) + + # Independent check, not just "it didn't raise": spacing="equal" means + # every gap between consecutive knots equals the width of one of the + # n_inner_knots + 1 equal segments spanning [x_min, x_max]. + expected_step = (x_max - x_min) / (n_inner_knots + 1) + assert_allclose(np.diff(all_knots), expected_step) + + expected_inner = x_min + expected_step * np.arange(1, n_inner_knots + 1) + assert_allclose(all_knots[order:order + n_inner_knots], expected_inner) + + +def test_get_knots_bsplines_spacing_equal_unchanged_for_multiple_inner_knots(): + # regression check for the fix above: n_inner_knots >= 2 must still + # match the pre-fix inner_knots[1] - inner_knots[0] formula, since that + # difference is well-defined there and was never broken. + rs = np.random.RandomState(0) + x = rs.uniform(size=100) + x_min, x_max = x.min(), x.max() + + for df, degree in [(6, 3), (12, 3), (9, 2)]: + order = degree + 1 + n_inner_knots = df - order + grid = np.linspace(0, 1, n_inner_knots + 2)[1:-1] + inner_knots = x_min + grid * (x_max - x_min) + diff_knots = inner_knots[1] - inner_knots[0] + diffs = np.arange(1, order + 1) * diff_knots + expected = np.sort(np.concatenate(( + inner_knots[0] - diffs[::-1], inner_knots, inner_knots[-1] + diffs, + ))) + + actual = get_knots_bsplines(x, df=df, degree=degree, spacing="equal") + assert_allclose(actual, expected) + + +def test_univariate_polynomial_smoother(): + x = np.linspace(0, 1, 5) + pol = UnivariatePolynomialSmoother(x, degree=3) + assert_equal(pol.basis.shape, (5, 3)) + assert_allclose(pol.basis[:, 2], x.ravel() ** 3) + + +def test_multivariate_polynomial_basis(): + rs = np.random.RandomState(1) + x = rs.normal(0, 1, (10, 2)) + degrees = [3, 4] + mps = PolynomialSmoother(x, degrees) + for i, deg in enumerate(degrees): + uv_basis = UnivariatePolynomialSmoother(x[:, i], degree=deg).basis + assert_allclose(mps.smoothers[i].basis, uv_basis) + + +@pytest.mark.parametrize( + "x, df, degree", + [ + (np.c_[np.linspace(0, 1, 100), np.linspace(0, 10, 100)], [5, 6], [3, 5]), + (np.linspace(0, 1, 100), 6, 3), + ], +) +def test_bsplines(x, df, degree): + bspline = BSplines(x, df, degree) + bspline.transform(x) + + +def test_cubic_splines_transform_not_shadowed(): + # GH: CubicSplines.__init__ stored its `transform` constructor argument + # (a string like "domain") as `self.transform`, shadowing the inherited + # AdditiveGamSmoother.transform(x_new) method needed for out-of-sample + # basis construction (e.g., GAM prediction on new data). Before the fix, + # `cs.transform` was the literal string "domain", not callable. + x = np.linspace(0, 1, 50) + cs = CubicSplines(x, df=[5], transform="domain") + assert cs.transform_arg == "domain" + assert callable(cs.transform) diff --git a/shared/package-files/9c/9c8a43f1714d284209751e91805f5ddfe374b8e48182a298233070e8fd22055b/blob b/shared/package-files/9c/9c8a43f1714d284209751e91805f5ddfe374b8e48182a298233070e8fd22055b/blob new file mode 100644 index 0000000000000000000000000000000000000000..9cd647597d42d461431164ec76a16ccccc75063e --- /dev/null +++ b/shared/package-files/9c/9c8a43f1714d284209751e91805f5ddfe374b8e48182a298233070e8fd22055b/blob @@ -0,0 +1,39 @@ +#pragma once + +#include + +namespace c10 { + +namespace impl { + namespace detail { + template class WrapFunctionIntoRuntimeFunctor_ {}; + template + class WrapFunctionIntoRuntimeFunctor_> final : public c10::OperatorKernel { + public: + template + explicit WrapFunctionIntoRuntimeFunctor_(FuncType_&& kernel_func) + : kernel_func_(std::forward(kernel_func)) {} + + decltype(auto) operator()(Parameters... args) { + return kernel_func_(std::forward(args)...); + } + + private: + FuncType kernel_func_; + }; + } + + // WrapFunctionIntoRuntimeFunctor: Wraps any runtime functor into a functor that + // inherits from c10::OperatorKernel, so it can be used as a c10 kernel. + // This can, for example, be used for lambdas, functors or even function pointers. + // In the case of function pointers, since it is a runtime function pointer, + // there is an overhead for calling it whenever the kernel is invoked. + template + using WrapFunctionIntoRuntimeFunctor = detail::WrapFunctionIntoRuntimeFunctor_< + FuncType, + typename guts::infer_function_traits_t::return_type, + typename guts::infer_function_traits_t::parameter_types + >; +} + +} diff --git a/shared/package-files/9c/9c8c5c6a443f6697d33467594b52fd74280d1a7e875739ea3e6f9e6828012a4e/blob b/shared/package-files/9c/9c8c5c6a443f6697d33467594b52fd74280d1a7e875739ea3e6f9e6828012a4e/blob new file mode 100644 index 0000000000000000000000000000000000000000..df159d65c6a9a6ee02aa3c91082f018aa9fb47d2 --- /dev/null +++ b/shared/package-files/9c/9c8c5c6a443f6697d33467594b52fd74280d1a7e875739ea3e6f9e6828012a4e/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor index_add(const at::Tensor & self, at::Dimname dim, const at::Tensor & index, const at::Tensor & source, const at::Scalar & alpha=1); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9c/9c8d4b3a8ceb50dd519eab96d03986d471f0282b7491de57bf0d3d59e57490de/blob b/shared/package-files/9c/9c8d4b3a8ceb50dd519eab96d03986d471f0282b7491de57bf0d3d59e57490de/blob new file mode 100644 index 0000000000000000000000000000000000000000..0eefb36a2a67b2b3aa719abafa1499d33ce5a34d --- /dev/null +++ b/shared/package-files/9c/9c8d4b3a8ceb50dd519eab96d03986d471f0282b7491de57bf0d3d59e57490de/blob @@ -0,0 +1,10976 @@ +# @generated from torch/_C/__init__.pyi.in +# mypy: disable-error-code="type-arg" + +import builtins +from enum import Enum, IntEnum +from pathlib import Path +from typing import ( + Any, + AnyStr, + BinaryIO, + Callable, + ContextManager, + Dict, + Generic, + Iterable, + Iterator, + List, + Literal, + NamedTuple, + Optional, + Protocol, + Sequence, + Set, + SupportsIndex, + Tuple, + Type, + TypeVar, + Union, + overload, + runtime_checkable, +) +from typing_extensions import ParamSpec + +import torch +from torch import inf, SymInt, Tensor +from torch.autograd.graph import Node as _Node +from torch.package import PackageExporter +from torch.storage import UntypedStorage, TypedStorage +from torch.types import ( + _bool, + _complex, + _device, + _dispatchkey, + _dtype, + _float, + _int, + _layout, + _qscheme, + _size, + Device, + Number, + Storage, +) + +from torch._prims_common import DeviceLikeType + +# This module is defined in torch/csrc/Module.cpp + +from . import _functorch, _lazy, _lazy_ts_backend, _nn, _onnx, _VariableFunctions, _cpu, _aoti, _verbose + +K = TypeVar("K") +T = TypeVar("T") +S = TypeVar("S", bound="torch.Tensor") +P = ParamSpec("P") +ReturnVal = TypeVar("ReturnVal", covariant=True) # return value (always covariant) +_T_co = TypeVar("_T_co", covariant=True) + + +@runtime_checkable +class _NestedSequence(Protocol[_T_co]): + """A protocol for representing nested sequences. + + References:: + `numpy._typing._NestedSequence` + + """ + + def __len__(self, /) -> builtins.int: ... + def __getitem__(self, index: builtins.int, /) -> _T_co | _NestedSequence[_T_co]: ... + def __contains__(self, x: builtins.object, /) -> builtins.bool: ... + def __iter__(self, /) -> Iterator[_T_co | _NestedSequence[_T_co]]: ... + def __reversed__(self, /) -> Iterator[_T_co | _NestedSequence[_T_co]]: ... + def count(self, value: Any, /) -> builtins.int: ... + def index(self, value: Any, /) -> builtins.int: ... + + +# Defined in torch/csrc/Device.cpp +class device: + type: str # THPDevice_type + index: _int # THPDevice_index + + def __get__(self, instance, owner=None) -> device: ... + + # THPDevice_pynew + @overload + def __init__(self, device: DeviceLikeType) -> None: ... + @overload + def __init__(self, type: str, index: _int) -> None: ... + + # Uncomment if we ever make torch.device a decorator + # def __call__(self, func: T) -> T: ... + + def __enter__(self) -> device: ... + def __exit__(self, exc_type, exc_val, exc_tb) -> None: ... + def __reduce__(self) -> Tuple[Any, ...]: ... # THPDevice_reduce + +# Defined in torch/csrc/Stream.cpp +class Stream: + stream_id: _int # Stream id + device_index: _int + device_type: _int + + device: device # The device of the stream + +# Defined in torch/csrc/Size.cpp +class Size(Tuple[_int, ...]): + # TODO: __reduce__ + + @overload # type: ignore[override] + def __getitem__(self: Size, key: _int) -> _int: ... + @overload + def __getitem__(self: Size, key: slice) -> Size: ... + def numel(self: Size) -> _int: ... + +# Defined in torch/csrc/Dtype.cpp +class dtype: + # TODO: __reduce__ + is_floating_point: _bool + is_complex: _bool + is_signed: _bool + itemsize: _int + def to_real(self) -> dtype: ... + def to_complex(self) -> dtype: ... + +# Defined in torch/csrc/TypeInfo.cpp +class iinfo: + bits: _int + min: _int + max: _int + dtype: str + + def __init__(self, dtype: _dtype) -> None: ... + +class finfo: + bits: _int + min: _float + max: _float + eps: _float + tiny: _float + smallest_normal: _float + resolution: _float + dtype: str + + @overload + def __init__(self, dtype: _dtype) -> None: ... + @overload + def __init__(self) -> None: ... + +float32: dtype = ... +float: dtype = ... +float64: dtype = ... +double: dtype = ... +float16: dtype = ... +bfloat16: dtype = ... +float8_e4m3fn: dtype = ... +float8_e4m3fnuz: dtype = ... +float8_e5m2: dtype = ... +float8_e5m2fnuz: dtype = ... +half: dtype = ... +uint8: dtype = ... +uint16: dtype = ... +uint32: dtype = ... +uint64: dtype = ... +int8: dtype = ... +int16: dtype = ... +short: dtype = ... +int32: dtype = ... +int: dtype = ... +int64: dtype = ... +long: dtype = ... +complex32: dtype = ... +complex64: dtype = ... +chalf: dtype = ... +cfloat: dtype = ... +complex128: dtype = ... +cdouble: dtype = ... +quint8: dtype = ... +qint8: dtype = ... +qint32: dtype = ... +bool: dtype = ... +quint4x2: dtype = ... +quint2x4: dtype = ... +bits1x8: dtype = ... +bits2x4: dtype = ... +bits4x2: dtype = ... +bits8: dtype = ... +bits16: dtype = ... + +# Defined in torch/csrc/Layout.cpp +class layout: ... + +# Defined in torch/csrc/utils/disable_torch_function.cpp +def DisableTorchFunction(): ... +def DisableTorchFunctionSubclass(): ... + +# Defined in torch/csrc/utils/tensor_layouts.cpp +strided: layout = ... +sparse_coo: layout = ... +sparse_csr: layout = ... +sparse_csc: layout = ... +sparse_bsr: layout = ... +sparse_bsc: layout = ... +_mkldnn: layout = ... +jagged: layout = ... + +# Defined in torch/csrc/MemoryFormat.cpp +class memory_format: ... + +# Defined in torch/csrc/utils/tensor_memoryformats.cpp +contiguous_format: memory_format = ... +channels_last: memory_format = ... +channels_last_3d: memory_format = ... +preserve_format: memory_format = ... + +# Defined in torch/csrc/QScheme.cpp +class qscheme: ... + +# Defined in torch/csrc/utils/tensor_qschemes.h +per_tensor_affine: qscheme = ... +per_channel_affine: qscheme = ... +per_tensor_symmetric: qscheme = ... +per_channel_symmetric: qscheme = ... +per_channel_affine_float_qparams: qscheme = ... + +# Defined in torch/csrc/autograd/python_function.cpp +class _FunctionBase: + saved_tensors: Tuple[Tensor] + _raw_saved_tensors: Tuple[Any] + next_functions: Tuple[Tuple[Any, _int], ...] + needs_input_grad: Tuple[_bool] + metadata: dict + _materialize_non_diff_grads: _bool + # skip adding type hints for the fields that have wrappers defined + # in torch/autograd/function.py + +# Defined in torch/csrc/autograd/python_legacy_variable.cpp +class _LegacyVariableBase(Tensor): # inherits from Tensor to appease mypy + def __init__( + self, + data: Optional[Tensor] = ..., + requires_grad: Optional[_bool] = ..., + volatile: Optional[_bool] = ..., + _grad_fn: Optional[_FunctionBase] = ..., + ) -> None: ... + +# Defined in torch/csrc/jit/python/init.cpp +class IODescriptor: ... +class JITException: ... + +class Future(Generic[T]): + def __init__(self, devices: List[device]) -> None: ... + def done(self) -> _bool: ... + def value(self) -> T: ... + def wait(self) -> T: ... + def add_done_callback(self, callback: Callable) -> None: ... + def then(self, callback: Callable) -> Future[T]: ... + def set_result(self, result: T) -> None: ... + def _set_unwrap_func(self, callback: Callable) -> None: ... + +class _Await: + def __init__(self) -> None: ... + def fn(self) -> Callable: ... + def args(self) -> Tuple[Any, ...]: ... + def is_nowait(self) -> _bool: ... + +def _jit_set_num_profiled_runs(num: _size) -> _size: ... + +# Defined in torch/csrc/jit/passes/mobile_optimizer_type.h +class _MobileOptimizerType: ... + +CONV_BN_FUSION: _MobileOptimizerType +INSERT_FOLD_PREPACK_OPS: _MobileOptimizerType +REMOVE_DROPOUT: _MobileOptimizerType +FUSE_ADD_RELU: _MobileOptimizerType +HOIST_CONV_PACKED_PARAMS: _MobileOptimizerType +VULKAN_AUTOMATIC_GPU_TRANSFER: _MobileOptimizerType + +def fork(*args: Any, **kwargs: Any) -> Future: ... +def wait(fut: Future) -> Any: ... +def _awaitable(*args: Any, **kwargs: Any) -> _Await: ... +def _awaitable_wait(aw: _Await) -> Any: ... +def _awaitable_nowait(x: Any) -> _Await: ... +def _collect_all(futures: List[Future]) -> Future: ... +def _set_print_stack_traces_on_fatal_signal(print: _bool) -> None: ... +def unify_type_list(types: List[JitType]) -> JitType: ... +def _freeze_module( + module: ScriptModule, + preserved_attrs: List[str] = [], + freeze_interfaces: _bool = True, + preserveParameters: _bool = True, +) -> ScriptModule: ... +def _jit_pass_optimize_frozen_graph(Graph, optimize_numerics: _bool = True) -> None: ... +def _jit_pass_optimize_for_inference( + module: torch.jit.ScriptModule, + other_methods: List[str] = [], +) -> None: ... +def _jit_pass_fold_frozen_conv_bn(graph: Graph): ... +def _jit_pass_fold_frozen_conv_add_or_sub(graph: Graph): ... +def _jit_pass_fold_frozen_conv_mul_or_div(graph: Graph): ... +def _jit_pass_fuse_frozen_conv_add_relu(graph: Graph): ... +def _jit_pass_concat_frozen_linear(graph: Graph): ... +def _jit_pass_convert_frozen_ops_to_mkldnn(graph: Graph): ... +def _jit_pass_transpose_frozen_linear(graph: Graph): ... +def _jit_pass_remove_dropout(module: torch.jit.ScriptModule): ... +def _is_tracing() -> _bool: ... +def _jit_init() -> _bool: ... +def _jit_flatten(arg: Any) -> Tuple[List[Tensor], IODescriptor]: ... +def _jit_unflatten(vars: List[Tensor], desc: IODescriptor) -> Any: ... +def _jit_get_operation(op_name: str) -> Tuple[Callable, List[str]]: ... +def _get_operation_overload( + op_name: str, + op_overload_name: str, +) -> Tuple[Callable, Callable, List[Any]]: ... +def _get_schema(op_name: str, overload_name: str) -> FunctionSchema: ... +def _jit_pass_optimize_for_mobile( + module: torch.jit.ScriptModule, + optimization_blocklist: Set[_MobileOptimizerType], + preserved_methods: List[AnyStr], +) -> torch.jit.ScriptModule: ... +def _clone_module_with_class( + module: torch.jit.ScriptModule, + ignored_methods: List[AnyStr], + ignored_attributes: List[AnyStr], +) -> torch.jit.ScriptModule: ... +def _jit_pass_vulkan_optimize_for_mobile( + module: torch.jit.ScriptModule, + optimization_blocklist: Set[_MobileOptimizerType], + preserved_methods: List[AnyStr], +) -> torch.jit.ScriptModule: ... +def _jit_pass_metal_optimize_for_mobile( + module: torch.jit.ScriptModule, + preserved_methods: List[AnyStr], +) -> torch.jit.ScriptModule: ... +def _jit_pass_inline(Graph) -> None: ... +def _jit_pass_constant_propagation(Graph) -> None: ... +def _jit_pass_propagate_shapes_on_graph(Graph) -> None: ... +def _jit_register_decomposition_for_schema(schema: FunctionSchema, Graph) -> None: ... +def _jit_erase_non_input_shape_information(Graph) -> None: ... +def _jit_get_schemas_for_operator(name: str) -> List[FunctionSchema]: ... +def _jit_get_all_schemas() -> List[FunctionSchema]: ... +def _jit_check_alias_annotation( + g: Graph, + args: Tuple[Any, ...], + unqualified_op_name: str, +): ... +def _jit_can_fuse_on_cpu() -> _bool: ... +def _jit_can_fuse_on_gpu() -> _bool: ... +def _jit_can_fuse_on_cpu_legacy() -> _bool: ... +def _debug_get_fusion_group_inlining() -> _bool: ... +def _debug_set_fusion_group_inlining(enable: _bool): ... +def _jit_texpr_fuser_enabled() -> _bool: ... +def _jit_nvfuser_enabled() -> _bool: ... +def _jit_llga_enabled() -> _bool: ... +def _jit_set_llga_enabled(enable: _bool): ... +def _llvm_enabled() -> _bool: ... +def _jit_override_can_fuse_on_cpu(override: _bool): ... +def _jit_override_can_fuse_on_gpu(override: _bool): ... +def _jit_override_can_fuse_on_cpu_legacy(override: _bool): ... +def _jit_set_symbolic_shapes_test_mode(override: _bool): ... +def _jit_symbolic_shapes_test_mode_enabled() -> _bool: ... +def _jit_set_texpr_fuser_enabled(enable: _bool): ... +def _jit_set_te_must_use_llvm_cpu(use_llvm: _bool): ... +def _jit_set_nvfuser_enabled(enable: _bool) -> _bool: ... +def _jit_cat_wo_conditionals(optimize_cat: _bool): ... +def _jit_opt_conditionals(opt_conds: _bool): ... +def _jit_pass_canonicalize(graph: Graph, keep_unique_names: _bool = True): ... +def _jit_pass_erase_shape_information(graph: Graph): ... +def _jit_pass_fold_convbn(module: torch.jit.ScriptModule): ... +def _jit_pass_insert_observers( + module: torch.jit.ScriptModule, + method_name: str, + qconfig_dict: Dict[str, Any], + inplace: _bool, + quant_type: _int, +): ... +def _jit_pass_insert_quant_dequant( + module: torch.jit.ScriptModule, + method_name: str, + inplace: _bool, + debug: _bool, + quant_type: _int, +): ... +def _jit_pass_insert_quant_dequant_for_ondevice_ptq( + module: torch.jit.ScriptModule, + method_name: str, + inplace: _bool, + debug: _bool, + quant_type: _int, +): ... +def _jit_pass_quant_finalize( + module: torch.jit.ScriptModule, + quant_type: _int, + preserved_attrs: Sequence[str], +): ... +def _jit_pass_quant_finalize_for_ondevice_ptq( + module: torch.jit.ScriptModule, + quant_type: _int, + method_name: str, +): ... +def _jit_pass_insert_observer_method_for_ondevice_ptq( + module: torch.jit.ScriptModule, + method_name: str, + qconfig_dict: Dict[str, Any], + inplace: _bool, + quant_type: _int, +): ... +def _jit_set_profiling_executor(profiling_flag: _bool) -> _bool: ... +def _jit_set_profiling_mode(profiling_flag: _bool) -> _bool: ... +def _jit_set_fusion_strategy( + strategy: List[Tuple[str, _int]], +) -> List[Tuple[str, _int]]: ... +def _jit_try_infer_type(obj: Any) -> InferredType: ... +def _jit_get_trigger_value(trigger_name: str) -> _int: ... + +# Defined in torch/csrc/jit/python/script_init.cpp +ResolutionCallback = Callable[[str], Callable[..., Any]] + +# Defined in torch/csrc/jit/python/script_init.cpp +# and torch/csrc/jit/python/init.cpp +def _create_function_from_graph(qualname: str, graph: Graph) -> ScriptFunction: ... +def _debug_set_autodiff_subgraph_inlining(disabled: _bool) -> None: ... +def _ivalue_tags_match(lhs: ScriptModule, rhs: ScriptModule) -> _bool: ... +def _jit_assert_is_instance(obj: Any, type: JitType): ... +def _jit_clear_class_registry() -> None: ... +def _jit_set_emit_hooks( + ModuleHook: Optional[Callable], + FunctionHook: Optional[Callable], +) -> None: ... +def _jit_get_emit_hooks() -> Tuple[Callable, Callable]: ... +def _load_for_lite_interpreter( + filename: Union[str, Path], + map_location: Optional[DeviceLikeType], +): ... +def _load_for_lite_interpreter_from_buffer( + buffer: BinaryIO, + map_location: Optional[DeviceLikeType], +): ... +def _export_operator_list(module: LiteScriptModule): ... +def _quantize_ondevice_ptq_dynamic(module: LiteScriptModule, method_name: str): ... +def _get_model_bytecode_version(filename: Union[str, Path]) -> _int: ... +def _get_model_bytecode_version_from_buffer(buffer: BinaryIO) -> _int: ... +def _backport_for_mobile( + filename_input: Union[str, Path], + filename_output: Union[str, Path], + to_version: _int, +) -> None: ... +def _backport_for_mobile_from_buffer( + buffer: BinaryIO, + filename_output: Union[str, Path], + to_version: _int, +) -> None: ... +def _backport_for_mobile_to_buffer( + filename_input: Union[str, Path], + to_version: _int, +) -> bytes: ... +def _backport_for_mobile_from_buffer_to_buffer( + buffer: BinaryIO, + to_version: _int, +) -> bytes: ... +def _get_model_ops_and_info(filename: Union[str, Path]): ... +def _get_model_ops_and_info_from_buffer(buffer: BinaryIO): ... +def _get_mobile_model_contained_types(filename: Union[str, Path]): ... +def _get_mobile_model_contained_types_from_buffer(buffer: BinaryIO): ... +def _logging_set_logger(logger: LoggerBase) -> LoggerBase: ... +def _get_graph_executor_optimize(optimize: Optional[_bool] = None) -> _bool: ... +def _set_graph_executor_optimize(optimize: _bool): ... +def _export_opnames(module: ScriptModule) -> List[str]: ... +def _create_function_from_trace( + qualname: str, + func: Callable[..., Any], + input_tuple: Tuple[Any, ...], + var_lookup_fn: Callable[[Tensor], str], + strict: _bool, + force_outplace: _bool, + argument_names: List[str], +) -> Tuple[Graph, Stack]: ... +def _create_function_from_trace_with_dict( + qualname: str, + func: Callable[..., Any], + input_dict: Dict[str, Any], + var_lookup_fn: Callable[[Tensor], str], + strict: _bool, + force_outplace: _bool, + argument_names: List[str], +) -> Tuple[Graph, Stack]: ... +def _jit_is_script_object(obj: Any) -> _bool: ... +def _last_executed_optimized_graph() -> Graph: ... +def parse_type_comment(comment: str) -> Decl: ... +def _get_upgraders_map_size() -> _int: ... +def _get_upgraders_entry_map() -> Dict[str, str]: ... +def _dump_upgraders_map() -> Dict[str, str]: ... +def _test_only_populate_upgraders(content: Dict[str, str]) -> None: ... +def _test_only_remove_upgraders(content: Dict[str, str]) -> None: ... +def merge_type_from_type_comment( + decl: Decl, + type_annotation_decl: Decl, + is_method: _bool, +) -> Decl: ... +def parse_ir(input: str, parse_tensor_constants: _bool = False) -> Graph: ... +def parse_schema(schema: str) -> FunctionSchema: ... +def get_device(input: Tensor) -> _int: ... +def _resolve_type_from_object( + obj: Any, + range: SourceRange, + rcb: ResolutionCallback, +) -> JitType: ... +def _create_module_with_type(ty: JitType) -> ScriptModule: ... +def _create_object_with_type(ty: ClassType) -> ScriptObject: ... +def _run_emit_module_hook(m: ScriptModule): ... +def _replace_overloaded_method_decl( + overload_decl: Decl, + implementation_def: Def, + new_name: str, +) -> Def: ... +def _jit_pass_lower_all_tuples(graph: Graph) -> None: ... +def _jit_pass_onnx_set_dynamic_input_shape( + graph: Graph, + dynamic_axes: Dict[str, Dict[_int, str]], + input_names: List[str], +) -> None: ... +def _jit_pass_onnx_graph_shape_type_inference( + graph: Graph, + params_dict: Dict[str, IValue], + opset_version: _int, +) -> None: ... +def _jit_pass_onnx_assign_output_shape( + graph: Graph, + tensors: List[Tensor], + desc: IODescriptor, + onnx_shape_inference: _bool, + is_script: _bool, + opset_version: _int, +) -> None: ... +def _jit_pass_onnx_remove_inplace_ops_for_onnx( + graph: Graph, + module: Optional[ScriptModule] = None, +) -> None: ... +def _jit_pass_remove_inplace_ops(graph: Graph) -> None: ... +def _jit_pass_canonicalize_graph_fuser_ops(graph: Graph) -> None: ... +def _jit_pass_peephole( + graph: Graph, + disable_shape_peepholes: _bool = False, +) -> None: ... +def _jit_pass_onnx_autograd_function_process(graph: Graph) -> None: ... +def _jit_pass_fuse_addmm(graph: Graph) -> None: ... +def _jit_pass_onnx_preprocess(graph: Graph) -> None: ... +def _jit_pass_prepare_division_for_onnx(graph: Graph) -> None: ... +def _jit_pass_onnx_remove_print(graph: Graph) -> None: ... +def _jit_pass_onnx_preprocess_caffe2(graph: Graph) -> None: ... +def _jit_pass_onnx_unpack_quantized_weights( + graph: Graph, + paramsDict: Dict[str, IValue], + caffe2: _bool, +) -> Dict[str, IValue]: ... +def _jit_pass_onnx_quantization_insert_permutes( + graph: Graph, + paramsDict: Dict[str, IValue], +) -> Dict[str, IValue]: ... +def _jit_pass_custom_pattern_based_rewrite_graph( + pattern: str, + fused_node_name: str, + graph: Graph, +) -> None: ... +def _jit_onnx_list_model_parameters( + module: ScriptModule, +) -> Tuple[ScriptModule, List[IValue]]: ... +def _jit_pass_erase_number_types(graph: Graph) -> None: ... +def _jit_pass_onnx_lint(graph: Graph) -> None: ... +def _jit_pass_onnx( + graph: Graph, + _jit_pass_onnx: _onnx.OperatorExportTypes, +) -> Graph: ... +def _jit_pass_onnx_scalar_type_analysis( + graph: Graph, + lowprecision_cast: _bool, + opset_version: _int, +) -> None: ... +def _jit_pass_onnx_peephole( + graph: Graph, + opset_version: _int, + fixed_batch_size: _bool, +) -> None: ... +def _jit_pass_dce_allow_deleting_nodes_with_side_effects(graph: Graph) -> None: ... +def _jit_pass_onnx_function_substitution(graph: Graph) -> None: ... +def _jit_pass_onnx_function_extraction( + graph: Graph, + module_names: Set[str], + param_names: List[str], +) -> Dict[Node, Dict[str, str]]: ... +def _jit_pass_onnx_clear_scope_records() -> None: ... +def _jit_pass_onnx_track_scope_attributes( + graph: Graph, + onnx_attrs: Dict[str, Any], +) -> None: ... +def _jit_is_onnx_log_enabled() -> _bool: ... +def _jit_set_onnx_log_enabled(enabled: _bool) -> None: ... +def _jit_set_onnx_log_output_stream(stream_name: str) -> None: ... +def _jit_onnx_log(*args: Any) -> None: ... +def _jit_pass_lower_graph(graph: Graph, m: Module) -> Tuple[Graph, List[IValue]]: ... +def _jit_pass_inline_fork_wait(graph: Graph) -> None: ... +def _jit_pass_onnx_deduplicate_initializers( + graph: Graph, + params_dict: Dict[str, IValue], + is_train: _bool, +) -> Dict[str, IValue]: ... +def _jit_pass_onnx_eval_peephole( + graph: Graph, + paramsDict: Dict[str, IValue], +) -> Dict[str, IValue]: ... +def _jit_pass_onnx_constant_fold( + graph: Graph, + paramsDict: Dict[str, IValue], + opset_version: _int, +) -> Dict[str, IValue]: ... +def _jit_pass_onnx_eliminate_unused_items( + graph: Graph, + paramsDict: Dict[str, IValue], +) -> Dict[str, IValue]: ... +def _jit_pass_onnx_cast_all_constant_to_floating(graph: Graph) -> None: ... +def _jit_pass_filter_non_tensor_arguments( + params: Dict[str, IValue], +) -> Dict[str, Tensor]: ... +def _jit_decay_packed_param_input_types(graph: Graph) -> None: ... +def _jit_pass_onnx_node_shape_type_inference( + n: Node, + paramsDict: Dict[str, IValue], + opset_version: _int, +) -> None: ... +def _jit_onnx_convert_pattern_from_subblock( + block: Block, + n: Node, + env: Dict[Value, Value], +) -> List[Value]: ... +def _jit_pass_onnx_block( + old_block: Block, + new_block: Block, + operator_export_type: _onnx.OperatorExportTypes, + env: Dict[Value, Value], + is_sub_block: _bool, +) -> Dict[Value, Value]: ... +def _jit_pass_onnx_assign_scoped_names_for_node_and_value(graph: Graph) -> None: ... +def _jit_pass_fixup_onnx_controlflow_node( + n: Node, + opset_version: _int, +) -> List[Value]: ... +def _jit_onnx_create_full_scope_name(class_name: str, variable_name: str) -> str: ... +def _compile_graph_to_code_table(name: str, graph: Graph) -> IValue: ... +def _generate_upgraders_graph() -> Dict[str, Graph]: ... +def _calculate_package_version_based_on_upgraders(val: _bool): ... +def _get_version_calculator_flag() -> _bool: ... +def _jit_script_interface_compile( + name: str, + class_def: ClassDef, + rcb: ResolutionCallback, + is_module: _bool, +): ... +def _jit_script_compile_overload( + qualname: str, + overload_decl: Decl, + implementation_def: Def, + rcb: ResolutionCallback, + implementation_defaults: Dict[str, Any], + signature: Any, +): ... +def _jit_script_compile( + qual_name: str, + definition: Def, + rcb: ResolutionCallback, + defaults: Dict[str, Any], +): ... +def _jit_script_class_compile( + qual_name: str, + definition: ClassDef, + defaults: Dict[str, Dict[str, Any]], + rcb: ResolutionCallback, +): ... +def _parse_source_def(src: str) -> Def: ... +def import_ir_module( + cu: CompilationUnit, + filename: Union[str, Path], + map_location: Optional[DeviceLikeType], + extra_files: Dict[str, Any], +) -> ScriptModule: ... +def import_ir_module_from_buffer( + cu: CompilationUnit, + buffer: BinaryIO, + map_location: Optional[DeviceLikeType], + extra_files: Dict[str, Any], +) -> ScriptModule: ... +def _import_ir_module_from_package( + cu: CompilationUnit, + reader: PyTorchFileReader, + storage_context: DeserializationStorageContext, + map_location: Optional[DeviceLikeType], + ts_id: str, +) -> ScriptModule: ... +def _assign_output_shapes(graph: Graph, inputs: List[Tensor]) -> Graph: ... +def _check_onnx_proto(proto: str) -> None: ... +def _propagate_and_assign_input_shapes( + graph: Graph, + inputs: Tuple[Tensor, ...], + param_count_list: List[_int], + with_grad: _bool, + propagate: _bool, +) -> Graph: ... + +# Defined in torch/csrc/jit/runtime/graph_executor.h +class GraphExecutorState: ... + +# Defined in torch/torch/csrc/jit/ir/alias_analysis.h +class AliasDb: + def __str__(self) -> str: ... + +class _InsertPoint: + def __enter__(self) -> None: ... + def __exit__(self, *args) -> None: ... + +# Defined in torch/csrc/jit/ir/ir.h +class Use: + @property + def user(self) -> Node: ... + @property + def offset(self) -> _int: ... + def isAfter(self, other: Use) -> _bool: ... + +# Defined in torch/csrc/jit/ir/ir.h +class Value: + def type(self) -> JitType: ... + def setType(self, t: JitType) -> Value: ... + def setTypeAs(self, other: Value) -> Value: ... + def inferTypeFrom(self, t: Tensor) -> None: ... + def debugName(self) -> str: ... + def setDebugName(self, name: str) -> None: ... + def unique(self) -> _int: ... + def offset(self) -> _int: ... + def node(self) -> Node: ... + def uses(self) -> List[Use]: ... + def replaceAllUsesWith(self, val: Value) -> None: ... + def replaceAllUsesAfterNodeWith(self, node: Node, val: Value) -> None: ... + def requires_grad(self) -> _bool: ... + def requiresGrad(self) -> _bool: ... + def copyMetadata(self, other: Value) -> Value: ... + def isCompleteTensor(self) -> _bool: ... + def toIValue(self) -> IValue: ... + +# Defined in torch/csrc/jit/ir/ir.h +class Block: + def inputs(self) -> Iterator[Value]: ... + def outputs(self) -> Iterator[Value]: ... + def nodes(self) -> Iterator[Node]: ... + def paramNode(self) -> Node: ... + def returnNode(self) -> Node: ... + def owningNode(self) -> Node: ... + def registerOutput(self, n: Value) -> _int: ... + def addNode(self, name: str, inputs: Sequence[Value]) -> Node: ... + +# Defined in torch/csrc/jit/ir/ir.h +class Node: + def __getitem__(self, key: str) -> Any: ... + def schema(self) -> str: ... + def input(self) -> Value: ... + def inputs(self) -> Iterator[Value]: ... + def inputsAt(self, idx: _int) -> Value: ... + def inputsSize(self) -> _int: ... + def output(self) -> Value: ... + def outputs(self) -> Iterator[Value]: ... + def outputsAt(self, idx: _int) -> Value: ... + def outputsSize(self) -> _int: ... + def hasMultipleOutputs(self) -> _bool: ... + def blocks(self) -> List[Block]: ... + def addBlock(self) -> Block: ... + def mustBeNone(self) -> _bool: ... + def matches(self, pattern: str) -> _bool: ... + def kind(self) -> str: ... + def kindOf(self, name: str) -> str: ... + def addInput(self, name: str) -> Value: ... + def replaceInput(self, i: _int, newValue: Value) -> Value: ... + def replaceInputWith(self, from_: Value, to: Value) -> None: ... + def replaceAllUsesWith(self, n: Node) -> None: ... + def insertBefore(self, n: Node) -> Node: ... + def insertAfter(self, n: Node) -> Node: ... + def isBefore(self, n: Node) -> _bool: ... + def isAfter(self, n: Node) -> _bool: ... + def moveBefore(self, n: Node) -> None: ... + def moveAfter(self, n: Node) -> None: ... + def removeInput(self, i: _int) -> None: ... + def removeAllInputs(self, i: _int) -> None: ... + def hasUses(self) -> _bool: ... + def eraseOutput(self, i: _int) -> None: ... + def addOutput(self) -> Value: ... + def scopeName(self) -> str: ... + def isNondeterministic(self) -> _bool: ... + def copyAttributes(self, rhs: Node) -> Node: ... + def copyMetadata(self, rhs: Node) -> Node: ... + def hasAttributes(self) -> _bool: ... + def hasAttribute(self, name: str) -> _bool: ... + def removeAttribute(self, attr: str) -> Node: ... + def namedInput(self, name: str) -> Value: ... + def sourceRange(self) -> SourceRange: ... + def owningBlock(self) -> Block: ... + def findNode(self, kind: str, recurse: _bool = True) -> Node: ... + def findAllNodes(self, kind: str, recurse: _bool = True) -> List[Node]: ... + def getModuleHierarchy(self) -> str: ... + def prev(self) -> Node: ... + def destroy(self) -> None: ... + def attributeNames(self) -> List[str]: ... + + # Accessors for attributes as types. + def f(self, name: str) -> _float: ... + def f_(self, name: str, val: _float) -> Node: ... + def fs(self, name: str) -> List[_float]: ... + def fs_(self, name: str, val: List[_float]) -> Node: ... + def c(self, name: str) -> complex: ... + def c_(self, name: str, val: complex) -> Node: ... + def s(self, name: str) -> str: ... + def s_(self, name: str, val: str) -> Node: ... + def ss(self, name: str) -> List[str]: ... + def ss_(self, name: str, val: List[str]) -> Node: ... + def i(self, name: str) -> _int: ... + def i_(self, name: str, val: _int) -> Node: ... + # Cannot define "is" like this because it's a reserved keyword in python. + # def is(self, name: str) -> List[_int]: ... + # def is_(self, name: str, val: List[_int]) -> Node: ... + def g(self, name: str) -> Graph: ... + def g_(self, name: str, val: Graph) -> Node: ... + def gs(self, name: str) -> List[Graph]: ... + def gs_(self, name: str, val: List[Graph]) -> Node: ... + def ival(self, name: str) -> IValue: ... + def ival_(self, name: str, val: IValue) -> Node: ... + def t(self, name: str) -> Tensor: ... + def t_(self, name: str, val: Tensor) -> Node: ... + def ts(self, name: str) -> List[Tensor]: ... + def ts_(self, name: str, val: List[Tensor]) -> Node: ... + def ty(self, name: str) -> JitType: ... + def ty_(self, name: str, val: JitType) -> Node: ... + def tys(self, name: str) -> List[JitType]: ... + def tys_(self, name: str, val: List[JitType]) -> Node: ... + +# Defined in torch/torch/csrc/jit/ir/ir.h +class Graph: + def inputs(self) -> Iterator[Value]: ... + def outputs(self) -> Iterator[Value]: ... + def nodes(self) -> Iterator[Node]: ... + def param_node(self) -> Node: ... + def return_node(self) -> Node: ... + def addInput(self, name: str = "") -> Value: ... + def eraseInput(self, i: _int) -> None: ... + def registerOutput(self, n: Value) -> _int: ... + def eraseOutput(self, i: _int) -> None: ... + def create(self, name: str, args, num_outputs: _int) -> Node: ... + def appendNode(self, n: Node) -> Node: ... + def prependNode(self, n: Node) -> Node: ... + def insertNode(self, n: Node) -> Node: ... + def block(self) -> Block: ... + def lint(self) -> None: ... + def alias_db(self) -> AliasDb: ... + def setInsertPoint(self, n: Union[Block, Node]) -> None: ... + def insert_point_guard(self, n: Union[Block, Node]) -> _InsertPoint: ... + def insertPoint(self) -> Node: ... + def insertGraph(self, callee: Graph, inputs: List[Value]) -> List[Value]: ... + def makeMultiOutputIntoTuple(self) -> None: ... + def copy(self) -> Graph: ... + +# Defined in torch/aten/src/ATen/core/alias_info.h +class AliasInfo: + is_write: _bool + before_set: Set[str] + after_set: Set[str] + +# Defined in torch/aten/src/ATen/core/function_schema.h +class Argument: + name: str + type: JitType + default_value: Optional[Any] + def has_default_value(self) -> _bool: ... + kwarg_only: _bool + is_out: _bool + alias_info: Optional[AliasInfo] + +class FunctionSchema: + arguments: List[Argument] + returns: List[Argument] + name: str + overload_name: str + +class _UpgraderEntry: + bumped_at_version: _int + upgrader_name: str + old_schema: str + def __init__( + self, + bumped_at_version: _int, + upgrader_name: str, + old_schema: str, + ) -> None: ... + +class _UpgraderRange: + min_version: _int + max_version: _int + +def _get_max_operator_version() -> _int: ... +def _get_operator_version_map() -> Dict[str, List[_UpgraderEntry]]: ... +def _get_upgrader_ranges(name: str) -> List[_UpgraderRange]: ... +def _test_only_add_entry_to_op_version(op_name: str, entry: _UpgraderEntry) -> None: ... +def _test_only_remove_entry_to_op_version(op_name: str) -> None: ... + +# Defined in torch/csrc/jit/python/script_init.cpp +class ScriptModuleSerializer: + def __init__(self, export_writer: PyTorchFileWriter) -> None: ... + def serialize(self, model: ScriptModule, script_module_id: _int) -> None: ... + def write_files(self) -> None: ... + def storage_context(self) -> SerializationStorageContext: ... + +# Defined in torch/csrc/jit/python/script_init.cpp +class SerializationStorageContext: + def __init__(self) -> None: ... + def has_storage(self, storage: Storage) -> _bool: ... + def get_or_add_storage(self, storage: Storage) -> _int: ... + +# Defined in torch/csrc/jit/python/script_init.cpp +class DeserializationStorageContext: + def __init__(self) -> None: ... + def get_storage(self, name: str, dtype: _dtype) -> Tensor: ... + def has_storage(self, name: str) -> _bool: ... + def add_storage(self, name: str, tensor: Tensor) -> _int: ... + +# Defined in torch/csrc/jit/python/script_init.cpp +class ConcreteModuleTypeBuilder: + def __init__(self, obj: Any) -> None: ... + def set_module_dict(self): ... + def set_module_list(self): ... + def set_parameter_list(self): ... + def set_parameter_dict(self): ... + def add_attribute( + self, + name: str, + ty: JitType, + is_param: _bool, + is_buffer: _bool, + ): ... + def add_module(self, name: str, meta: ConcreteModuleType): ... + def add_constant(self, name: str, value: Any): ... + def add_overload(self, method_name: str, overloaded_method_names: List[str]): ... + def add_builtin_function(self, name: str, symbol_name: str): ... + def add_failed_attribute(self, name: str, failure_reason: str): ... + def add_function_attribute( + self, + name: str, + ty: JitType, + func: Callable[..., Any], + ): ... + def add_ignored_attribute(self, name: str): ... + def add_ignored_attributes(self, names: List[str]): ... + def add_forward_hook(self, hook: Callable[..., Any]): ... + def add_forward_pre_hook(self, pre_hook: Callable[..., Any]): ... + +class ConcreteModuleType: + def get_constants(self) -> Dict[str, Any]: ... + def equals(self, other: ConcreteModuleType) -> _bool: ... + @staticmethod + def from_jit_type(ty: JitType) -> ConcreteModuleType: ... + +class CallStack: + def __init__(self, name: str, range: SourceRange): ... + +class ErrorReport: + def __init__(self, range: SourceRange) -> None: ... + def what(self) -> str: ... + @staticmethod + def call_stack() -> str: ... + +class CompilationUnit: + def __init__(self, lang: str = ..., _frames_up: _int = ...) -> None: ... + def find_function(self, name: str) -> ScriptFunction: ... + def __getattr__(self, name: str) -> ScriptFunction: ... + def define( + self, + script: str, + rcb: ResolutionCallback = ..., + _frames_up: _int = ..., + ): ... + def get_interface(self, name: str) -> InterfaceType: ... + def get_functions(self) -> List[ScriptFunction]: ... + def create_function( + self, + name: str, + graph: Graph, + shouldMangle: _bool = ..., + ) -> ScriptFunction: ... + def get_class(self, name: str) -> ClassType: ... + +class ScriptObject: + def setattr(self, name: str, value: Any): ... + +class ScriptModule(ScriptObject): + def _method_names(self) -> List[str]: ... + def _get_method(self, name: str) -> ScriptMethod: ... + +class LiteScriptModule: + def __call__(self, *input): ... + def find_method(self, method_name: str): ... + def forward(self, *input) -> List[str]: ... + def run_method(self, method_name: str, *input): ... + +# NOTE: switch to collections.abc.Callable in python 3.9 +class ScriptFunction(Generic[P, ReturnVal]): + def __call__(self, *args: P.args, **kwargs: P.kwargs) -> ReturnVal: ... + def save(self, filename: str, _extra_files: Dict[str, bytes]) -> None: ... + def save_to_buffer(self, _extra_files: Dict[str, bytes]) -> bytes: ... + @property + def graph(self) -> Graph: ... + def inlined_graph(self) -> Graph: ... + def schema(self) -> FunctionSchema: ... + def code(self) -> str: ... + def name(self) -> str: ... + @property + def qualified_name(self) -> str: ... + +# NOTE: switch to collections.abc.Callable in python 3.9 +class ScriptMethod(Generic[P, ReturnVal]): + graph: Graph + def __call__(self, *args: P.args, **kwargs: P.kwargs) -> ReturnVal: ... + @property + def owner(self) -> ScriptModule: ... + @property + def name(self) -> str: ... + +class ScriptDict(Generic[K, T]): + def __init__(self, dict: Dict[K, T]) -> None: ... + def __len__(self) -> _int: ... + def __contains__(self, key: K) -> _bool: ... + def __getitem__(self, key: K) -> T: ... + def __setitem__(self, key: K, value: T) -> None: ... + def __delitem__(self, key: K) -> None: ... + def __iter__(self) -> Iterator[K]: ... + def items(self) -> Iterator[tuple[K, T]]: ... + def keys(self) -> Iterator[K]: ... + +class ScriptList(Generic[T]): + def __init__(self, list: List[T]) -> None: ... + def __len__(self) -> _int: ... + def __contains__(self, item: T) -> _bool: ... + @overload + def __getitem__(self, idx: _int) -> T: ... + @overload + def __getitem__(self, idx: slice) -> ScriptList[T]: ... + @overload + def __setitem__(self, idx: _int, value: T) -> None: ... + @overload + def __setitem__(self, idx: slice, value: List[T]) -> None: ... + def __delitem__(self, idx: _int) -> None: ... + def __iter__(self) -> Iterator[T]: ... + def count(self, value: T) -> _int: ... + def remove(self, value: T) -> None: ... + def append(self, value: T) -> None: ... + def clear(self) -> None: ... + @overload + def extend(self, values: List[T]) -> None: ... + @overload + def extend(self, values: Iterable[T]) -> None: ... + @overload + def pop(self) -> T: ... + @overload + def pop(self, idx: _int) -> T: ... + +class ModuleDict: + def __init__(self, mod: ScriptModule) -> None: ... + def items(self) -> List[Tuple[str, Any]]: ... + +class ParameterDict: + def __init__(self, mod: ScriptModule) -> None: ... + +class BufferDict: + def __init__(self, mod: ScriptModule) -> None: ... + +# Defined in torch/csrc/jit/api/module.h +class Module: ... + +# Defined in torch/csrc/Module.cpp +def _initExtension(shm_manager_path: str) -> None: ... # THPModule_initExtension +def _autograd_init() -> _bool: ... # THPAutograd_initExtension +def _add_docstr(obj: T, doc_obj: str) -> T: ... # THPModule_addDocStr +def _init_names(arg: Sequence[Type]) -> None: ... # THPModule_initNames +def _has_distributed() -> _bool: ... # THPModule_hasDistributed +def _set_default_tensor_type(type) -> None: ... # THPModule_setDefaultTensorType +def _set_default_dtype(d: _dtype) -> None: ... # THPModule_setDefaultDtype +def _infer_size(arg1: Size, arg2: Size) -> Size: ... # THPModule_inferSize +def _crash_if_csrc_asan() -> _int: ... # THPModule_crashIfCsrcASAN +def _crash_if_csrc_ubsan() -> _int: ... # THPModule_crashIfCsrcUBSAN +def _crash_if_aten_asan() -> _int: ... # THPModule_crashIfATenASAN +def _show_config() -> str: ... # THPModule_showConfig +def _cxx_flags() -> str: ... # THPModule_cxxFlags +def _parallel_info() -> str: ... # THPModule_parallelInfo +def _get_cpu_capability() -> str: ... # THPModule_getCpuCapability +def _set_backcompat_broadcast_warn( + arg: _bool, +) -> None: ... # THPModule_setBackcompatBroadcastWarn +def _get_backcompat_broadcast_warn() -> _bool: ... # THPModule_getBackcompatBroadcastWarn +def _set_backcompat_keepdim_warn( + arg: _bool, +) -> None: ... # THPModule_setBackcompatKeepdimWarn +def _get_backcompat_keepdim_warn() -> _bool: ... # THPModule_getBackcompatKeepdimWarn +def get_num_thread() -> _int: ... # THPModule_getNumThreads +def set_num_threads(nthreads: _int) -> None: ... # THPModule_setNumThreads +def get_num_interop_threads() -> _int: ... # THPModule_getNumInteropThreads +def set_num_interop_threads( + nthreads: _int, +) -> None: ... # THPModule_setNumInteropThreads +def _get_cudnn_enabled() -> _bool: ... # THPModule_userEnabledCuDNN +def _set_cudnn_enabled(arg: _bool) -> None: ... # THPModule_setUserEnabledCuDNN +def _get_flash_sdp_enabled() -> _bool: ... # THPModule_userEnabledFusedSDP +def _set_sdp_use_flash(arg: _bool) -> None: ... # THPModule_setSDPUseFlash +def _get_mem_efficient_sdp_enabled() -> _bool: ... # THPModule_userEnabledMathSDP +def _set_sdp_use_mem_efficient( + arg: _bool, +) -> None: ... # THPModule_setSDPUseMemEfficient +def _get_math_sdp_enabled() -> _bool: ... # THPModule_userEnabledMathSDP +def _set_sdp_use_math(arg: _bool) -> None: ... # THPModule_setSDPUseMath +def _get_cudnn_sdp_enabled() -> _bool: ... # THPModule_userEnabledMathSDP +def _set_sdp_use_cudnn(arg: _bool) -> None: ... # THPModule_setSDPUseMath +def _get_mkldnn_enabled() -> _bool: ... # THPModule_userEnabledMkldnn +def _set_mkldnn_enabled(arg: _bool) -> None: ... # THPModule_setUserEnabledMkldnn +def _get_cudnn_benchmark() -> _bool: ... # THPModule_benchmarkCuDNN +def _set_cudnn_benchmark(arg: _bool) -> None: ... # THPModule_setBenchmarkCuDNN +def _get_cudnn_deterministic() -> _bool: ... # THPModule_deterministicCuDNN +def _set_cudnn_deterministic(arg: _bool) -> None: ... # THPModule_setDeterministicCuDNN +def _get_deterministic_algorithms() -> _bool: ... # THPModule_deterministicAlgorithms +def _get_deterministic_algorithms_warn_only() -> _bool: ... # THPModule_deterministicAlgorithmsWarnOnly +def _set_deterministic_algorithms( + mode: _bool, + *, + warn_only: _bool = ..., +) -> None: ... # THPModule_setDeterministicAlgorithms +def _get_deterministic_fill_uninitialized_memory() -> _bool: ... # THPModule_deterministicFillUninitializedMemory +def _set_deterministic_fill_uninitialized_memory(arg: _bool) -> None: ... # THPModule_setDeterministicFillUninitializedMemory +def _get_nnpack_enabled() -> _bool: ... # THPModule_userEnabledNNPACK +def _set_nnpack_enabled(arg: _bool) -> None: ... # THPModule_setUserEnabledNNPACK +def _get_warnAlways() -> _bool: ... # THPModule_warnAlways +def _set_warnAlways(arg: _bool) -> None: ... # THPModule_setWarnAlways +def _get_cudnn_allow_tf32() -> _bool: ... # THPModule_allowTF32CuDNN +def _set_cudnn_allow_tf32(arg: _bool) -> None: ... # THPModule_setAllowTF32CuDNN +def _get_cublas_allow_tf32() -> _bool: ... # THPModule_allowTF32CuBLAS +def _set_cublas_allow_tf32(arg: _bool) -> None: ... # THPModule_setAllowTF32CuBLAS +def _get_float32_matmul_precision() -> str: ... # THPModule_float32MatmulPrecision +def _set_float32_matmul_precision( + arg: str, +) -> None: ... # THPModule_setFloat32MatmulPrecision +def _get_cublas_allow_fp16_reduced_precision_reduction() -> _bool: ... # THPModule_allowFP16ReductionCuBLAS +def _set_cublas_allow_fp16_reduced_precision_reduction( + arg: _bool, +) -> None: ... # THPModule_setAllowFP16ReductionCuBLAS +def _get_cublas_allow_bf16_reduced_precision_reduction() -> _bool: ... # THPModule_allowBF16ReductionCuBLAS +def _set_cublas_allow_bf16_reduced_precision_reduction( + arg: _bool, +) -> None: ... # THPModule_setAllowBF16ReductionCuBLAS +def _set_conj(x: Tensor, conj: _bool) -> None: ... +def _set_neg(x: Tensor, neg: _bool) -> None: ... +def _set_meta_in_tls_dispatch_include(meta_in_tls: _bool) -> None: ... +def _meta_in_tls_dispatch_include() -> _bool: ... +def _stash_obj_in_tls(key: str, arg: Any) -> None: ... +def _get_obj_in_tls(key: str) -> Any: ... +def _is_key_in_tls(key: str) -> _bool: ... +def _select_conv_backend(*args, **kwargs) -> ConvBackend: ... +def _conv_determine_backend_memory_format( + input: Tensor, + weight: Tensor, + backend: ConvBackend, +) -> memory_format: ... +def _has_storage(x: Tensor) -> _bool: ... +def _construct_storage_from_data_pointer(data_ptr: _int, device: torch.device, size: _int) -> Storage: ... +def _should_allow_numbers_as_tensors(func_name: str) -> _bool: ... +def _group_tensors_by_device_and_dtype(nested_tensorlists: List[List[Optional[Tensor]]], with_indices: _bool = False) -> Dict[Tuple[torch.device, str], Tuple[List[List[Optional[Tensor]]], List[_int]]]: ... + +# NB: There is no Capsule type in typing, see +# https://code.activestate.com/lists/python-dev/139675/ +def _to_dlpack(data: Tensor) -> Any: ... # THPModule_toDLPack +def _from_dlpack(data: Any) -> Tensor: ... # THPModule_fromDLPack +def _get_cpp_backtrace( + frames_to_skip: _int, + maximum_number_of_frames: _int, +) -> str: ... # THPModule_getCppBacktrace +def set_flush_denormal(arg: _bool) -> _bool: ... # THPModule_setFlushDenormal +def get_default_dtype() -> _dtype: ... # THPModule_getDefaultDtype +def _get_default_device() -> str: ... # THPModule_getDefaultDevice +def _get_qengine() -> _int: ... # THPModule_qEngine +def _set_qengine(qengine: _int) -> None: ... # THPModule_setQEngine +def _supported_qengines() -> List[_int]: ... # THPModule_supportedQEngines +def _is_xnnpack_enabled() -> _bool: ... # THPModule_isEnabledXNNPACK +def _check_sparse_tensor_invariants() -> _bool: ... # THPModule_checkSparseTensorInvariants +def _set_check_sparse_tensor_invariants( + arg: _bool, +) -> None: ... # THPModule_setCheckSparseTensorInvariants +def _set_default_mobile_cpu_allocator() -> None: ... # THPModule_setDefaultMobileCPUAllocator +def _unset_default_mobile_cpu_allocator() -> None: ... # THPModule_unsetDefaultMobileCPUAllocator +def _is_torch_function_enabled() -> _bool: ... # THPModule_isEnabledTorchFunction +def _has_torch_function( + args: Iterable[Any], +) -> _bool: ... # THPModule_has_torch_function +def _has_torch_function_unary(Any) -> _bool: ... # THPModule_has_torch_function_unary +def _has_torch_function_variadic( + *args: Any, +) -> _bool: ... # THPModule_has_torch_function_variadic +def _vmapmode_increment_nesting() -> _int: ... # THPModule_vmapmode_increment_nesting +def _vmapmode_decrement_nesting() -> _int: ... # THPModule_vmapmode_decrement_nesting +def _log_api_usage_once(str) -> None: ... # LogAPIUsageOnceFromPython +def _log_api_usage_metadata(event: str, metadata_map: Dict[str, str]) -> None: ... # LogAPIUsageMetadataFromPython +def _demangle(str) -> str: ... # c10::demangle +def _disabled_torch_function_impl( + func: Callable, + types: Iterable[Type], + args: Tuple, + kwargs: Dict, +) -> Any: ... # THPModule_disable_torch_function +def _disabled_torch_dispatch_impl( + func: Callable, + types: Iterable[Type], + args: Tuple, + kwargs: Dict, +) -> Any: ... # THPModule_disable_dispatch_function +def _get_linalg_preferred_backend() -> torch._C._LinalgBackend: ... +def _set_linalg_preferred_backend(arg: torch._C._LinalgBackend): ... + +class _LinalgBackend: + Default: _LinalgBackend + Cusolver: _LinalgBackend + Magma: _LinalgBackend + +class ConvBackend(Enum): ... + +class Tag(Enum): + core: _int = 0 + data_dependent_output: _int = 1 + dynamic_output_shape: _int = 2 + generated: _int = 3 + inplace_view: _int = 4 + needs_fixed_stride_order: _int = 5 + nondeterministic_bitwise: _int = 6 + nondeterministic_seeded: _int = 7 + pointwise: _int = 8 + pt2_compliant_tag: _int = 9 + view_copy: _int = 10 + +# Defined in `valgrind.h` and `callgrind.h` respectively. +def _valgrind_supported_platform() -> _bool: ... # NVALGRIND +def _valgrind_toggle() -> None: ... # CALLGRIND_TOGGLE_COLLECT +def _valgrind_toggle_and_dump_stats() -> None: ... # CALLGRIND_TOGGLE_COLLECT and CALLGRIND_DUMP_STATS + +has_openmp: _bool +has_mkl: _bool +_has_mps: _bool +has_lapack: _bool +_has_cuda: _bool +_has_magma: _bool +_has_xpu: _bool +_has_mkldnn: _bool +_has_cudnn: _bool +has_spectral: _bool +_GLIBCXX_USE_CXX11_ABI: _bool +default_generator: Generator + +# Defined in torch/csrc/autograd/init.cpp +def _set_grad_enabled(enabled: _bool) -> None: ... +def is_grad_enabled() -> _bool: ... +def _set_fwd_grad_enabled(enabled: _bool) -> None: ... +def _is_fwd_grad_enabled() -> _bool: ... +def is_inference_mode_enabled() -> _bool: ... +def set_autocast_enabled(enabled: _bool) -> None: ... +def is_autocast_enabled() -> _bool: ... +def clear_autocast_cache() -> None: ... +def set_autocast_cpu_enabled(enabled: _bool) -> None: ... +def is_autocast_cpu_enabled() -> _bool: ... +def _is_any_autocast_enabled() -> _bool: ... +def set_autocast_cpu_dtype(dtype: _dtype) -> None: ... +def set_autocast_gpu_dtype(dtype: _dtype) -> None: ... +def get_autocast_cpu_dtype() -> _dtype: ... +def get_autocast_gpu_dtype() -> _dtype: ... +def autocast_increment_nesting() -> _int: ... +def autocast_decrement_nesting() -> _int: ... +def is_autocast_cache_enabled() -> _bool: ... +def set_autocast_cache_enabled(enabled: _bool) -> None: ... +def _increment_version(tensor: Tensor) -> None: ... +def set_anomaly_enabled(enabled: _bool, check_nan: _bool = True) -> None: ... +def is_anomaly_enabled() -> _bool: ... +def is_anomaly_check_nan_enabled() -> _bool: ... +def _is_multithreading_enabled() -> _bool: ... +def _set_multithreading_enabled(enabled: _bool) -> None: ... +def _set_view_replay_enabled(enabled: _bool) -> None: ... +def _is_view_replay_enabled() -> _bool: ... +def _enter_dual_level() -> _int: ... +def _exit_dual_level(level: _int) -> None: ... +def _make_dual(tensor: Tensor, tangent: Tensor, level: _int) -> Tensor: ... +def _unpack_dual(tensor: Tensor, level: _int) -> Tensor: ... +def __set_forward_AD_enabled(enabled: _bool) -> None: ... +def __is_forward_AD_enabled() -> _bool: ... +def _register_default_hooks(pack_hook: Callable, unpack_hook: Callable) -> None: ... +def _reset_default_hooks() -> None: ... +def _is_torch_function_mode_enabled() -> _bool: ... +def _set_torch_function_mode(cls: Any) -> None: ... +def _push_on_torch_function_stack(cls: Any) -> None: ... +def _pop_torch_function_stack() -> Any: ... +def _get_function_stack_at(idx: _int) -> Any: ... +def _len_torch_function_stack() -> _int: ... +def _set_torch_dispatch_mode(cls: Any) -> None: ... +def _push_on_torch_dispatch_stack(cls: Any) -> None: ... +def _pop_torch_dispatch_stack(mode_key: Optional[torch._C._TorchDispatchModeKey] = None) -> Any: ... +def _get_dispatch_mode(mode_key: Optional[torch._C._TorchDispatchModeKey]) -> Any: ... +def _unset_dispatch_mode(mode: torch._C._TorchDispatchModeKey) -> Any: ... +def _set_dispatch_mode(mode: Any) -> None: ... +def _get_dispatch_stack_at(idx: _int) -> Any: ... +def _len_torch_dispatch_stack() -> _int: ... + +class _DisableTorchDispatch: + def __init__(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _EnableTorchFunction: + def __init__(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _EnablePythonDispatcher: + def __init__(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _DisablePythonDispatcher: + def __init__(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _EnablePreDispatch: + def __init__(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _DisableFuncTorch: + def __init__(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _DisableAutocast: + def __init__(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _InferenceMode: + def __init__(self, enabled: _bool): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +def _set_autograd_fallback_mode(mode: str) -> None: ... +def _get_autograd_fallback_mode() -> str: ... + +# Defined in torch/csrc/jit/python/script_init.cpp +class LoggerBase: ... +class NoopLogger(LoggerBase): ... +class LockingLogger(LoggerBase): ... + +class AggregationType(Enum): + SUM = 0 + AVG = 1 + +class FileCheck: + def run(self, test_string: str) -> None: ... + def check(self, test_string: str) -> FileCheck: ... + def check_not(self, test_string: str) -> FileCheck: ... + def check_same(self, test_string: str) -> FileCheck: ... + def check_next(self, test_string: str) -> FileCheck: ... + def check_count( + self, + test_string: str, + count: _int, + exactly: _bool = False, + ) -> FileCheck: ... + def check_dag(self, test_string: str) -> FileCheck: ... + def check_source_highlighted(self, test_string: str) -> FileCheck: ... + def check_regex(self, test_string: str) -> FileCheck: ... + +# Defined in torch/csrc/jit/python/init.cpp +class PyTorchFileReader: + @overload + def __init__(self, name: str) -> None: ... + @overload + def __init__(self, buffer: BinaryIO) -> None: ... + def get_record(self, name: str) -> bytes: ... + def serialization_id(self) -> str: ... + +class PyTorchFileWriter: + @overload + def __init__(self, name: str) -> None: ... + @overload + def __init__(self, buffer: BinaryIO) -> None: ... + def write_record(self, name: str, data: Union[Storage, bytes, _int], size: _int) -> None: ... + def write_end_of_file(self) -> None: ... + def set_min_version(self, version: _int) -> None: ... + def get_all_written_records(self) -> List[str]: ... + def archive_name(self) -> str: ... + def serialization_id(self) -> str: ... + +def _jit_get_inline_everything_mode() -> _bool: ... +def _jit_set_inline_everything_mode(enabled: _bool) -> None: ... +def _jit_get_logging_option() -> str: ... +def _jit_set_logging_option(option: str) -> None: ... +def _jit_set_logging_stream(stream_name: str) -> None: ... +def _jit_pass_cse(Graph) -> _bool: ... +def _jit_pass_dce(Graph) -> None: ... +def _jit_pass_lint(Graph) -> None: ... + +# Defined in torch/csrc/jit/python/python_custom_class.cpp +def _get_custom_class_python_wrapper(name: str, attr: str) -> Any: ... + +# Defined in torch/csrc/Module.cpp +def _rename_privateuse1_backend(backend: str) -> None: ... +def _get_privateuse1_backend_name() -> str: ... + +# Defined in torch/csrc/Generator.cpp +class Generator: + device: _device + def __init__(self, device: Optional[DeviceLikeType] = None) -> None: ... + def get_state(self) -> Tensor: ... + def set_state(self, _new_state: Tensor) -> Generator: ... + def set_offset(self, offset: _int) -> Generator: ... + def get_offset(self) -> _int: ... + def manual_seed(self, seed: _int) -> Generator: ... + def seed(self) -> _int: ... + def initial_seed(self) -> _int: ... + +# Defined in torch/csrc/utils/python_dispatch.cpp + +class _DispatchOperatorHandle: + def schema(self) -> FunctionSchema: ... + def debug(self) -> str: ... + +class _DispatchModule: + def def_(self, schema: str, alias: str = "") -> _DispatchModule: ... + def def_legacy(self, schema: str) -> _DispatchModule: ... + def def_name_t_t( + self, + name: str, + dispatch: str, + debug: str = "default_def_name_t_t", + ) -> _DispatchModule: ... + def def_schema_t_t( + self, + schema: str, + dispatch: str, + alias: str, + debug: str = "default_def_schema_t_t", + ) -> _DispatchModule: ... + def impl_t_t( + self, + name: str, + dispatch: str, + debug: str = "impl_t_t", + ) -> _DispatchModule: ... + def impl(self, name: str, dispatch: str, func: Callable) -> _DispatchModule: ... + def define(self, schema: str, alias: str = "") -> _DispatchModule: ... + def fallback_fallthrough(self, dispatch: str = "") -> _DispatchModule: ... + +def _dispatch_library( + kind: str, + name: str, + dispatch: str, + file: str = "", + linenum: Any = 0, +) -> _DispatchModule: ... +def _dispatch_dump(name: str) -> str: ... +def _dispatch_dump_table(name: str) -> str: ... +def _dispatch_check_invariants(name: str) -> None: ... +def _dispatch_check_all_invariants() -> None: ... +def _dispatch_call_boxed(handle: _DispatchOperatorHandle, *args, **kwargs) -> Any: ... +def _dispatch_find_schema_or_throw(name: str, overload_name: str) -> _DispatchOperatorHandle: ... +def _dispatch_set_report_error_callback(handle: _DispatchOperatorHandle, callback: Callable) -> None: ... +def _dispatch_has_kernel(name: str) -> _bool: ... +def _dispatch_has_kernel_for_dispatch_key( + name: str, + dispatch: _dispatchkey, +) -> _bool: ... +def _dispatch_has_kernel_for_any_dispatch_key( + name: str, + dispatch_key_set: DispatchKeySet, +) -> _bool: ... +def _dispatch_has_computed_kernel_for_dispatch_key( + name: str, + dispatch: _dispatchkey, +) -> _bool: ... +def _dispatch_find_dangling_impls() -> List[str]: ... +def _dispatch_get_all_op_names() -> List[str]: ... +def _dispatch_tls_set_dispatch_key_excluded( + dispatch: _dispatchkey, + val: _bool, +) -> None: ... +def _dispatch_tls_is_dispatch_key_excluded(dispatch: _dispatchkey) -> _bool: ... +def _dispatch_tls_set_dispatch_key_included( + dispatch: _dispatchkey, + val: _bool, +) -> None: ... +def _dispatch_tls_is_dispatch_key_included(dispatch: _dispatchkey) -> _bool: ... +def _dispatch_isTensorSubclassLike(tensor: Tensor) -> _bool: ... +def _dispatch_key_name(dispatch: _dispatchkey) -> str: ... +def _dispatch_key_for_device(device_type: str) -> str: ... +def _parse_dispatch_key(key: str) -> Optional[DispatchKey]: ... +def _dispatch_key_parse(dispatch: _dispatchkey) -> DispatchKey: ... +def _dispatch_num_backends() -> _int: ... +def _dispatch_pystub(name: str, overload: str) -> Optional[Tuple[str, str]]: ... +def _dispatch_is_alias_key(dispatch: _dispatchkey) -> _bool: ... +def _functionality_to_backend_keys(dispatch: _dispatchkey) -> List[DispatchKey]: ... +def _functionalization_reapply_views_tls() -> _bool: ... + +class DispatchKey(Enum): + Undefined: DispatchKey = ... + FPGA: DispatchKey = ... + ORT: DispatchKey = ... + Vulkan: DispatchKey = ... + Metal: DispatchKey = ... + MKLDNN: DispatchKey = ... + OpenGL: DispatchKey = ... + OpenCL: DispatchKey = ... + IDEEP: DispatchKey = ... + CustomRNGKeyId: DispatchKey = ... + MkldnnCPU: DispatchKey = ... + Sparse: DispatchKey = ... + SparseCsr: DispatchKey = ... + NestedTensor: DispatchKey = ... + Dense: DispatchKey = ... + PreDispatch: DispatchKey = ... + Python: DispatchKey = ... + FuncTorchDynamicLayerBackMode: DispatchKey = ... + ZeroTensor: DispatchKey = ... + Conjugate: DispatchKey = ... + Negative: DispatchKey = ... + BackendSelect: DispatchKey = ... + Named: DispatchKey = ... + AutogradOther: DispatchKey = ... + AutogradFunctionality: DispatchKey = ... + AutogradNestedTensor: DispatchKey = ... + Tracer: DispatchKey = ... + Autocast: DispatchKey = ... + Batched: DispatchKey = ... + VmapMode: DispatchKey = ... + FuncTorchGradWrapper: DispatchKey = ... + FuncTorchBatched: DispatchKey = ... + BatchedNestedTensor: DispatchKey = ... + FuncTorchVmapMode: DispatchKey = ... + FuncTorchDynamicLayerFrontMode: DispatchKey = ... + Functionalize: DispatchKey = ... + TESTING_ONLY_GenericWrapper: DispatchKey = ... + TESTING_ONLY_GenericMode: DispatchKey = ... + ADInplaceOrView: DispatchKey = ... + Autograd: DispatchKey = ... + CompositeImplicitAutograd: DispatchKey = ... + CompositeImplicitAutogradNestedTensor: DispatchKey = ... + CompositeExplicitAutograd: DispatchKey = ... + CompositeExplicitAutogradNonFunctional: DispatchKey = ... + FuncTorchBatchedDecomposition: DispatchKey = ... + CPU: DispatchKey = ... + CUDA: DispatchKey = ... + HIP: DispatchKey = ... + XLA: DispatchKey = ... + MTIA: DispatchKey = ... + MPS: DispatchKey = ... + IPU: DispatchKey = ... + XPU: DispatchKey = ... + HPU: DispatchKey = ... + VE: DispatchKey = ... + Lazy: DispatchKey = ... + Meta: DispatchKey = ... + PrivateUse1: DispatchKey = ... + PrivateUse2: DispatchKey = ... + PrivateUse3: DispatchKey = ... + QuantizedCPU: DispatchKey = ... + QuantizedCUDA: DispatchKey = ... + QuantizedHIP: DispatchKey = ... + QuantizedXLA: DispatchKey = ... + QuantizedMTIA: DispatchKey = ... + QuantizedMPS: DispatchKey = ... + QuantizedIPU: DispatchKey = ... + QuantizedXPU: DispatchKey = ... + QuantizedHPU: DispatchKey = ... + QuantizedVE: DispatchKey = ... + QuantizedLazy: DispatchKey = ... + QuantizedMeta: DispatchKey = ... + QuantizedPrivateUse1: DispatchKey = ... + QuantizedPrivateUse2: DispatchKey = ... + QuantizedPrivateUse3: DispatchKey = ... + SparseCPU: DispatchKey = ... + SparseCUDA: DispatchKey = ... + SparseHIP: DispatchKey = ... + SparseXLA: DispatchKey = ... + SparseMTIA: DispatchKey = ... + SparseMPS: DispatchKey = ... + SparseIPU: DispatchKey = ... + SparseXPU: DispatchKey = ... + SparseHPU: DispatchKey = ... + SparseVE: DispatchKey = ... + SparseLazy: DispatchKey = ... + SparseMeta: DispatchKey = ... + SparsePrivateUse1: DispatchKey = ... + SparsePrivateUse2: DispatchKey = ... + SparsePrivateUse3: DispatchKey = ... + SparseCsrCPU: DispatchKey = ... + SparseCsrCUDA: DispatchKey = ... + SparseCsrHIP: DispatchKey = ... + SparseCsrXLA: DispatchKey = ... + SparseCsrMTIA: DispatchKey = ... + SparseCsrMPS: DispatchKey = ... + SparseCsrIPU: DispatchKey = ... + SparseCsrXPU: DispatchKey = ... + SparseCsrHPU: DispatchKey = ... + SparseCsrVE: DispatchKey = ... + SparseCsrLazy: DispatchKey = ... + SparseCsrMeta: DispatchKey = ... + SparseCsrPrivateUse1: DispatchKey = ... + SparseCsrPrivateUse2: DispatchKey = ... + SparseCsrPrivateUse3: DispatchKey = ... + NestedTensorCPU: DispatchKey = ... + NestedTensorCUDA: DispatchKey = ... + NestedTensorHIP: DispatchKey = ... + NestedTensorXLA: DispatchKey = ... + NestedTensorMTIA: DispatchKey = ... + NestedTensorMPS: DispatchKey = ... + NestedTensorIPU: DispatchKey = ... + NestedTensorXPU: DispatchKey = ... + NestedTensorHPU: DispatchKey = ... + NestedTensorVE: DispatchKey = ... + NestedTensorLazy: DispatchKey = ... + NestedTensorMeta: DispatchKey = ... + NestedTensorPrivateUse1: DispatchKey = ... + NestedTensorPrivateUse2: DispatchKey = ... + NestedTensorPrivateUse3: DispatchKey = ... + AutogradCPU: DispatchKey = ... + AutogradCUDA: DispatchKey = ... + AutogradHIP: DispatchKey = ... + AutogradXLA: DispatchKey = ... + AutogradMTIA: DispatchKey = ... + AutogradMPS: DispatchKey = ... + AutogradIPU: DispatchKey = ... + AutogradXPU: DispatchKey = ... + AutogradHPU: DispatchKey = ... + AutogradVE: DispatchKey = ... + AutogradLazy: DispatchKey = ... + AutogradMeta: DispatchKey = ... + AutogradPrivateUse1: DispatchKey = ... + AutogradPrivateUse2: DispatchKey = ... + AutogradPrivateUse3: DispatchKey = ... + +class DispatchKeySet: + def __init__(self, key: DispatchKey) -> None: ... + def __or__(self, other: DispatchKeySet) -> DispatchKeySet: ... + def __sub__(self, other: DispatchKeySet) -> DispatchKeySet: ... + def __and__(self, other: DispatchKeySet) -> DispatchKeySet: ... + def highestPriorityTypeId(self) -> DispatchKey: ... + def has(self, k: _dispatchkey) -> _bool: ... + def add(self, k: _dispatchkey) -> DispatchKeySet: ... + def remove(self, k: _dispatchkey) -> DispatchKeySet: ... + def __repr__(self) -> str: ... + +_dispatch_autogradother_backends: DispatchKeySet +_additional_keys_to_prop_for_wrapper_tensors: DispatchKeySet + +def _dispatch_has_backend_fallback(dispatch: _dispatchkey) -> _bool: ... +def _dispatch_keyset_full_after(t: _dispatchkey) -> DispatchKeySet: ... +def _dispatch_keyset_full() -> DispatchKeySet: ... +def _dispatch_keyset_to_string(keyset: DispatchKeySet) -> str: ... +def _dispatch_get_backend_keyset_from_autograd( + dispatch: _dispatchkey, +) -> DispatchKeySet: ... +def _dispatch_keys(tensor: Tensor) -> DispatchKeySet: ... +def _dispatch_tls_local_exclude_set() -> DispatchKeySet: ... +def _dispatch_tls_local_include_set() -> DispatchKeySet: ... +def _dispatch_is_included_in_alias( + dispatch_a: _dispatchkey, + dispatch_b: _dispatchkey, +) -> _bool: ... +def _propagate_xla_data(a: Tensor, b: Tensor) -> None: ... +def _replace_(a: Tensor, b: Tensor) -> None: ... +def _commit_update(a: Tensor) -> None: ... + +class _ExcludeDispatchKeyGuard: + def __init__(self, keyset: DispatchKeySet): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _IncludeDispatchKeyGuard: + def __init__(self, k: DispatchKey): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _ForceDispatchKeyGuard: + def __init__(self, include: DispatchKeySet, exclude: DispatchKeySet): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class _AutoDispatchBelowAutograd: + def __init__(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +def _dispatch_print_registrations_for_dispatch_key(dispatch_key: str = "") -> None: ... +def _dispatch_get_registrations_for_dispatch_key( + dispatch_key: str = "", +) -> List[str]: ... +def _are_functorch_transforms_active() -> _bool: ... + +# Define in torch/csrc/autograd/init.cpp +def _set_python_dispatcher(dispatcher: object) -> None: ... + +def _get_nested_int(id: _int, coeff: _int) -> SymInt: ... + +def _get_constant_bool_symnode(val: _bool) -> Any: ... + +class _TorchDispatchModeKey(Enum): + FAKE: _TorchDispatchModeKey = ... + PROXY: _TorchDispatchModeKey = ... + FUNCTIONAL: _TorchDispatchModeKey = ... + +class _SetExcludeDispatchKeyGuard: + def __init__(self, k: DispatchKey, enabled: _bool): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +# Defined in torch/csrc/utils/init.cpp +class BenchmarkConfig: + num_calling_threads: _int + num_worker_threads: _int + num_warmup_iters: _int + num_iters: _int + profiler_output_path: str + +class BenchmarkExecutionStats: + latency_avg_ms: _float + num_iters: _int + +class ThroughputBenchmark: + def __init__(self, module: Any) -> None: ... + def add_input(self, *args: Any, **kwargs: Any) -> None: ... + def run_once(self, *args: Any, **kwargs: Any) -> Any: ... + def benchmark(self, config: BenchmarkConfig) -> BenchmarkExecutionStats: ... + +# Defined in torch/csrc/Storage.cpp +class StorageBase(object): ... + +# TODO: where +class DoubleTensor(Tensor): ... +class FloatTensor(Tensor): ... +class BFloat16Tensor(Tensor): ... +class LongTensor(Tensor): ... +class IntTensor(Tensor): ... +class ShortTensor(Tensor): ... +class HalfTensor(Tensor): ... +class CharTensor(Tensor): ... +class ByteTensor(Tensor): ... +class BoolTensor(Tensor): ... + +# Defined in torch/csrc/autograd/python_engine.cpp +class _ImperativeEngine: + def queue_callback(self, callback: Callable[[], None]) -> None: ... + def run_backward(self, *args: Any, **kwargs: Any) -> Tuple[Tensor, ...]: ... + def is_checkpoint_valid(self) -> _bool: ... + +# Defined in torch/csrc/autograd/python_variable.cpp +class _TensorMeta(type): ... + +# Defined in torch/csrc/autograd/python_variable.cpp +class TensorBase(metaclass=_TensorMeta): + requires_grad: _bool + retains_grad: _bool + shape: Size + data: Tensor + names: List[str] + device: _device + dtype: _dtype + layout: _layout + real: Tensor + imag: Tensor + T: Tensor + H: Tensor + mT: Tensor + mH: Tensor + ndim: _int + output_nr: _int + _version: _int + _base: Optional[Tensor] + _cdata: _int + grad_fn: Optional[_Node] + _grad_fn: Any + _grad: Optional[Tensor] + grad: Optional[Tensor] + _backward_hooks: Optional[Dict[_int, Callable[[Tensor], Optional[Tensor]]]] + nbytes: _int + itemsize: _int + _has_symbolic_sizes_strides: _bool + def __abs__(self) -> Tensor: ... + def __add__(self, other: Any) -> Tensor: ... + @overload + def __and__(self, other: Tensor) -> Tensor: ... + @overload + def __and__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __and__(self, other: Any) -> Tensor: ... + def __bool__(self) -> builtins.bool: ... + def __complex__(self) -> builtins.complex: ... + def __div__(self, other: Any) -> Tensor: ... + def __eq__(self, other: Any) -> Tensor: ... # type: ignore[override] + def __float__(self) -> builtins.float: ... + def __floordiv__(self, other: Any) -> Tensor: ... + def __ge__(self, other: Any) -> Tensor: ... + def __getitem__(self, indices: Union[Union[SupportsIndex, Union[None, _bool, _int, slice, ellipsis, Tensor], _NestedSequence[Union[None, _bool, _int, slice, ellipsis, Tensor]]], tuple[Union[SupportsIndex, Union[None, _bool, _int, slice, ellipsis, Tensor], _NestedSequence[Union[None, _bool, _int, slice, ellipsis, Tensor]]], ...]]) -> Tensor: ... + def __gt__(self, other: Any) -> Tensor: ... + def __iadd__(self, other: Any) -> Tensor: ... + @overload + def __iand__(self, other: Tensor) -> Tensor: ... + @overload + def __iand__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __iand__(self, other: Any) -> Tensor: ... + def __idiv__(self, other: Any) -> Tensor: ... + def __ifloordiv__(self, other: Any) -> Tensor: ... + @overload + def __ilshift__(self, other: Tensor) -> Tensor: ... + @overload + def __ilshift__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __ilshift__(self, other: Any) -> Tensor: ... + def __imod__(self, other: Any) -> Tensor: ... + def __imul__(self, other: Any) -> Tensor: ... + def __index__(self) -> builtins.int: ... + @overload + def __init__(self, *args: Any, device: Optional[DeviceLikeType] = None) -> None: ... + @overload + def __init__(self, storage: Storage) -> None: ... + @overload + def __init__(self, other: Tensor) -> None: ... + @overload + def __init__(self, size: _size, *, device: Optional[DeviceLikeType] = None) -> None: ... + def __int__(self) -> builtins.int: ... + def __invert__(self) -> Tensor: ... + @overload + def __ior__(self, other: Tensor) -> Tensor: ... + @overload + def __ior__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __ior__(self, other: Any) -> Tensor: ... + @overload + def __irshift__(self, other: Tensor) -> Tensor: ... + @overload + def __irshift__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __irshift__(self, other: Any) -> Tensor: ... + def __isub__(self, other: Any) -> Tensor: ... + @overload + def __ixor__(self, other: Tensor) -> Tensor: ... + @overload + def __ixor__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __ixor__(self, other: Any) -> Tensor: ... + def __le__(self, other: Any) -> Tensor: ... + def __long__(self) -> builtins.int: ... + @overload + def __lshift__(self, other: Tensor) -> Tensor: ... + @overload + def __lshift__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __lshift__(self, other: Any) -> Tensor: ... + def __lt__(self, other: Any) -> Tensor: ... + def __matmul__(self, other: Any) -> Tensor: ... + def __mod__(self, other: Any) -> Tensor: ... + def __mul__(self, other: Any) -> Tensor: ... + def __ne__(self, other: Any) -> Tensor: ... # type: ignore[override] + def __neg__(self) -> Tensor: ... + def __new__(self, *args, **kwargs) -> Tensor: ... + def __nonzero__(self) -> builtins.bool: ... + @overload + def __or__(self, other: Tensor) -> Tensor: ... + @overload + def __or__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __or__(self, other: Any) -> Tensor: ... + def __pow__(self, other: Any) -> Tensor: ... + def __radd__(self, other: Any) -> Tensor: ... + def __rand__(self, other: Any) -> Tensor: ... + def __rfloordiv__(self, other: Any) -> Tensor: ... + def __rmul__(self, other: Any) -> Tensor: ... + def __ror__(self, other: Any) -> Tensor: ... + def __rpow__(self, other: Any) -> Tensor: ... + @overload + def __rshift__(self, other: Tensor) -> Tensor: ... + @overload + def __rshift__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __rshift__(self, other: Any) -> Tensor: ... + def __rsub__(self, other: Any) -> Tensor: ... + def __rtruediv__(self, other: Any) -> Tensor: ... + def __rxor__(self, other: Any) -> Tensor: ... + def __setitem__(self, indices: Union[Union[SupportsIndex, Union[None, _bool, _int, slice, ellipsis, Tensor], _NestedSequence[Union[None, _bool, _int, slice, ellipsis, Tensor]]], tuple[Union[SupportsIndex, Union[None, _bool, _int, slice, ellipsis, Tensor], _NestedSequence[Union[None, _bool, _int, slice, ellipsis, Tensor]]], ...]], val: Union[Tensor, Number]) -> None: ... + def __sub__(self, other: Any) -> Tensor: ... + def __truediv__(self, other: Any) -> Tensor: ... + @overload + def __xor__(self, other: Tensor) -> Tensor: ... + @overload + def __xor__(self, other: Union[Number, _complex]) -> Tensor: ... + @overload + def __xor__(self, other: Any) -> Tensor: ... + def _addmm_activation(self, mat1: Tensor, mat2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1, use_gelu: _bool = False) -> Tensor: ... + def _autocast_to_full_precision(self, cuda_enabled: _bool, cpu_enabled: _bool) -> Tensor: ... + def _autocast_to_reduced_precision(self, cuda_enabled: _bool, cpu_enabled: _bool, cuda_dtype: _dtype, cpu_dtype: _dtype) -> Tensor: ... + def _coalesced_(self, coalesced: _bool) -> Tensor: ... + def _conj(self) -> Tensor: ... + def _conj_physical(self) -> Tensor: ... + def _dimI(self) -> _int: ... + def _dimV(self) -> _int: ... + def _indices(self) -> Tensor: ... + def _is_all_true(self) -> Tensor: ... + def _is_any_true(self) -> Tensor: ... + def _is_view(self) -> _bool: ... + def _is_zerotensor(self) -> _bool: ... + def _lazy_clone(self) -> Tensor: ... + @staticmethod + def _make_subclass(cls: Type[S], data: Tensor, require_grad: _bool = False, dispatch_strides: _bool = False, dispatch_device: _bool = False, device_for_backend_keys: Optional[_device] = None) -> S: ... + def _neg_view(self) -> Tensor: ... + def _nested_tensor_size(self) -> Tensor: ... + def _nested_tensor_storage_offsets(self) -> Tensor: ... + def _nested_tensor_strides(self) -> Tensor: ... + def _nnz(self) -> _int: ... + def _sparse_mask_projection(self, mask: Tensor, accumulate_matches: _bool = False) -> Tensor: ... + def _to_dense(self, dtype: Optional[_dtype] = None, masked_grad: Optional[_bool] = None) -> Tensor: ... + @overload + def _to_sparse(self, *, layout: Optional[_layout] = None, blocksize: Optional[Union[_int, _size]] = None, dense_dim: Optional[_int] = None) -> Tensor: ... + @overload + def _to_sparse(self, sparse_dim: _int) -> Tensor: ... + def _to_sparse_bsc(self, blocksize: Union[_int, _size], dense_dim: Optional[_int] = None) -> Tensor: ... + def _to_sparse_bsr(self, blocksize: Union[_int, _size], dense_dim: Optional[_int] = None) -> Tensor: ... + def _to_sparse_csc(self, dense_dim: Optional[_int] = None) -> Tensor: ... + def _to_sparse_csr(self, dense_dim: Optional[_int] = None) -> Tensor: ... + def _values(self) -> Tensor: ... + def abs(self) -> Tensor: + r""" + abs() -> Tensor + + See :func:`torch.abs` + """ + ... + def abs_(self) -> Tensor: + r""" + abs_() -> Tensor + + In-place version of :meth:`~Tensor.abs` + """ + ... + def absolute(self) -> Tensor: + r""" + absolute() -> Tensor + + Alias for :func:`abs` + """ + ... + def absolute_(self) -> Tensor: + r""" + absolute_() -> Tensor + + In-place version of :meth:`~Tensor.absolute` + Alias for :func:`abs_` + """ + ... + def acos(self) -> Tensor: + r""" + acos() -> Tensor + + See :func:`torch.acos` + """ + ... + def acos_(self) -> Tensor: + r""" + acos_() -> Tensor + + In-place version of :meth:`~Tensor.acos` + """ + ... + def acosh(self) -> Tensor: + r""" + acosh() -> Tensor + + See :func:`torch.acosh` + """ + ... + def acosh_(self) -> Tensor: + r""" + acosh_() -> Tensor + + In-place version of :meth:`~Tensor.acosh` + """ + ... + def add(self, other: Union[Tensor, Number, _complex, torch.SymInt, torch.SymFloat], *, alpha: Optional[Union[Number, _complex]] = 1, out: Optional[Tensor] = None) -> Tensor: + r""" + add(other, *, alpha=1) -> Tensor + + Add a scalar or tensor to :attr:`self` tensor. If both :attr:`alpha` + and :attr:`other` are specified, each element of :attr:`other` is scaled by + :attr:`alpha` before being used. + + When :attr:`other` is a tensor, the shape of :attr:`other` must be + :ref:`broadcastable ` with the shape of the underlying + tensor + + See :func:`torch.add` + """ + ... + def add_(self, other: Union[Tensor, Number, _complex, torch.SymInt, torch.SymFloat], *, alpha: Optional[Union[Number, _complex]] = 1) -> Tensor: + r""" + add_(other, *, alpha=1) -> Tensor + + In-place version of :meth:`~Tensor.add` + """ + ... + def addbmm(self, batch1: Tensor, batch2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + addbmm(batch1, batch2, *, beta=1, alpha=1) -> Tensor + + See :func:`torch.addbmm` + """ + ... + def addbmm_(self, batch1: Tensor, batch2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + addbmm_(batch1, batch2, *, beta=1, alpha=1) -> Tensor + + In-place version of :meth:`~Tensor.addbmm` + """ + ... + def addcdiv(self, tensor1: Tensor, tensor2: Tensor, *, value: Union[Number, _complex] = 1) -> Tensor: + r""" + addcdiv(tensor1, tensor2, *, value=1) -> Tensor + + See :func:`torch.addcdiv` + """ + ... + def addcdiv_(self, tensor1: Tensor, tensor2: Tensor, *, value: Union[Number, _complex] = 1) -> Tensor: + r""" + addcdiv_(tensor1, tensor2, *, value=1) -> Tensor + + In-place version of :meth:`~Tensor.addcdiv` + """ + ... + def addcmul(self, tensor1: Tensor, tensor2: Tensor, *, value: Union[Number, _complex] = 1) -> Tensor: + r""" + addcmul(tensor1, tensor2, *, value=1) -> Tensor + + See :func:`torch.addcmul` + """ + ... + def addcmul_(self, tensor1: Tensor, tensor2: Tensor, *, value: Union[Number, _complex] = 1) -> Tensor: + r""" + addcmul_(tensor1, tensor2, *, value=1) -> Tensor + + In-place version of :meth:`~Tensor.addcmul` + """ + ... + def addmm(self, mat1: Tensor, mat2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + addmm(mat1, mat2, *, beta=1, alpha=1) -> Tensor + + See :func:`torch.addmm` + """ + ... + def addmm_(self, mat1: Tensor, mat2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + addmm_(mat1, mat2, *, beta=1, alpha=1) -> Tensor + + In-place version of :meth:`~Tensor.addmm` + """ + ... + def addmv(self, mat: Tensor, vec: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + addmv(mat, vec, *, beta=1, alpha=1) -> Tensor + + See :func:`torch.addmv` + """ + ... + def addmv_(self, mat: Tensor, vec: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + addmv_(mat, vec, *, beta=1, alpha=1) -> Tensor + + In-place version of :meth:`~Tensor.addmv` + """ + ... + def addr(self, vec1: Tensor, vec2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + addr(vec1, vec2, *, beta=1, alpha=1) -> Tensor + + See :func:`torch.addr` + """ + ... + def addr_(self, vec1: Tensor, vec2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + addr_(vec1, vec2, *, beta=1, alpha=1) -> Tensor + + In-place version of :meth:`~Tensor.addr` + """ + ... + def adjoint(self) -> Tensor: + r""" + adjoint() -> Tensor + + Alias for :func:`adjoint` + """ + ... + def align_as(self, other: Tensor) -> Tensor: + r""" + align_as(other) -> Tensor + + Permutes the dimensions of the :attr:`self` tensor to match the dimension order + in the :attr:`other` tensor, adding size-one dims for any new names. + + This operation is useful for explicit broadcasting by names (see examples). + + All of the dims of :attr:`self` must be named in order to use this method. + The resulting tensor is a view on the original tensor. + + All dimension names of :attr:`self` must be present in ``other.names``. + :attr:`other` may contain named dimensions that are not in ``self.names``; + the output tensor has a size-one dimension for each of those new names. + + To align a tensor to a specific order, use :meth:`~Tensor.align_to`. + + Examples:: + + # Example 1: Applying a mask + >>> mask = torch.randint(2, [127, 128], dtype=torch.bool).refine_names('W', 'H') + >>> imgs = torch.randn(32, 128, 127, 3, names=('N', 'H', 'W', 'C')) + >>> imgs.masked_fill_(mask.align_as(imgs), 0) + + + # Example 2: Applying a per-channel-scale + >>> def scale_channels(input, scale): + >>> scale = scale.refine_names('C') + >>> return input * scale.align_as(input) + + >>> num_channels = 3 + >>> scale = torch.randn(num_channels, names=('C',)) + >>> imgs = torch.rand(32, 128, 128, num_channels, names=('N', 'H', 'W', 'C')) + >>> more_imgs = torch.rand(32, num_channels, 128, 128, names=('N', 'C', 'H', 'W')) + >>> videos = torch.randn(3, num_channels, 128, 128, 128, names=('N', 'C', 'H', 'W', 'D')) + + # scale_channels is agnostic to the dimension order of the input + >>> scale_channels(imgs, scale) + >>> scale_channels(more_imgs, scale) + >>> scale_channels(videos, scale) + + .. warning:: + The named tensor API is experimental and subject to change. + """ + ... + @overload + def align_to(self, order: Sequence[Union[str, ellipsis, None]], ellipsis_idx: _int) -> Tensor: ... + @overload + def align_to(self, names: Sequence[Union[str, ellipsis, None]]) -> Tensor: ... + @overload + def all(self) -> Tensor: + r""" + all(dim=None, keepdim=False) -> Tensor + + See :func:`torch.all` + """ + ... + @overload + def all(self, dim: Optional[_size] = None, keepdim: _bool = False) -> Tensor: + r""" + all(dim=None, keepdim=False) -> Tensor + + See :func:`torch.all` + """ + ... + @overload + def all(self, dim: _int, keepdim: _bool = False) -> Tensor: + r""" + all(dim=None, keepdim=False) -> Tensor + + See :func:`torch.all` + """ + ... + @overload + def all(self, dim: Union[str, ellipsis, None], keepdim: _bool = False) -> Tensor: + r""" + all(dim=None, keepdim=False) -> Tensor + + See :func:`torch.all` + """ + ... + def allclose(self, other: Tensor, rtol: _float = 1e-05, atol: _float = 1e-08, equal_nan: _bool = False) -> _bool: + r""" + allclose(other, rtol=1e-05, atol=1e-08, equal_nan=False) -> Tensor + + See :func:`torch.allclose` + """ + ... + def amax(self, dim: Union[_int, _size] = (), keepdim: _bool = False) -> Tensor: + r""" + amax(dim=None, keepdim=False) -> Tensor + + See :func:`torch.amax` + """ + ... + def amin(self, dim: Union[_int, _size] = (), keepdim: _bool = False) -> Tensor: + r""" + amin(dim=None, keepdim=False) -> Tensor + + See :func:`torch.amin` + """ + ... + def aminmax(self, *, dim: Optional[_int] = None, keepdim: _bool = False) -> torch.return_types.aminmax: + r""" + aminmax(*, dim=None, keepdim=False) -> (Tensor min, Tensor max) + + See :func:`torch.aminmax` + """ + ... + def angle(self) -> Tensor: + r""" + angle() -> Tensor + + See :func:`torch.angle` + """ + ... + @overload + def any(self) -> Tensor: + r""" + any(dim=None, keepdim=False) -> Tensor + + See :func:`torch.any` + """ + ... + @overload + def any(self, dim: Optional[_size] = None, keepdim: _bool = False) -> Tensor: + r""" + any(dim=None, keepdim=False) -> Tensor + + See :func:`torch.any` + """ + ... + @overload + def any(self, dim: _int, keepdim: _bool = False) -> Tensor: + r""" + any(dim=None, keepdim=False) -> Tensor + + See :func:`torch.any` + """ + ... + @overload + def any(self, dim: Union[str, ellipsis, None], keepdim: _bool = False) -> Tensor: + r""" + any(dim=None, keepdim=False) -> Tensor + + See :func:`torch.any` + """ + ... + def apply_(self, callable: Callable) -> Tensor: + r""" + apply_(callable) -> Tensor + + Applies the function :attr:`callable` to each element in the tensor, replacing + each element with the value returned by :attr:`callable`. + + .. note:: + + This function only works with CPU tensors and should not be used in code + sections that require high performance. + """ + ... + def arccos(self) -> Tensor: + r""" + arccos() -> Tensor + + See :func:`torch.arccos` + """ + ... + def arccos_(self) -> Tensor: + r""" + arccos_() -> Tensor + + In-place version of :meth:`~Tensor.arccos` + """ + ... + def arccosh(self) -> Tensor: + r""" + acosh() -> Tensor + + See :func:`torch.arccosh` + """ + ... + def arccosh_(self) -> Tensor: + r""" + acosh_() -> Tensor + + In-place version of :meth:`~Tensor.arccosh` + """ + ... + def arcsin(self) -> Tensor: + r""" + arcsin() -> Tensor + + See :func:`torch.arcsin` + """ + ... + def arcsin_(self) -> Tensor: + r""" + arcsin_() -> Tensor + + In-place version of :meth:`~Tensor.arcsin` + """ + ... + def arcsinh(self) -> Tensor: + r""" + arcsinh() -> Tensor + + See :func:`torch.arcsinh` + """ + ... + def arcsinh_(self) -> Tensor: + r""" + arcsinh_() -> Tensor + + In-place version of :meth:`~Tensor.arcsinh` + """ + ... + def arctan(self) -> Tensor: + r""" + arctan() -> Tensor + + See :func:`torch.arctan` + """ + ... + def arctan2(self, other: Tensor) -> Tensor: + r""" + arctan2(other) -> Tensor + + See :func:`torch.arctan2` + """ + ... + def arctan2_(self, other: Tensor) -> Tensor: + r""" + atan2_(other) -> Tensor + + In-place version of :meth:`~Tensor.arctan2` + """ + ... + def arctan_(self) -> Tensor: + r""" + arctan_() -> Tensor + + In-place version of :meth:`~Tensor.arctan` + """ + ... + def arctanh(self) -> Tensor: + r""" + arctanh() -> Tensor + + See :func:`torch.arctanh` + """ + ... + def arctanh_(self) -> Tensor: + r""" + arctanh_(other) -> Tensor + + In-place version of :meth:`~Tensor.arctanh` + """ + ... + def argmax(self, dim: Optional[_int] = None, keepdim: _bool = False) -> Tensor: + r""" + argmax(dim=None, keepdim=False) -> LongTensor + + See :func:`torch.argmax` + """ + ... + def argmin(self, dim: Optional[_int] = None, keepdim: _bool = False) -> Tensor: + r""" + argmin(dim=None, keepdim=False) -> LongTensor + + See :func:`torch.argmin` + """ + ... + @overload + def argsort(self, *, stable: _bool, dim: _int = -1, descending: _bool = False) -> Tensor: + r""" + argsort(dim=-1, descending=False) -> LongTensor + + See :func:`torch.argsort` + """ + ... + @overload + def argsort(self, dim: _int = -1, descending: _bool = False) -> Tensor: + r""" + argsort(dim=-1, descending=False) -> LongTensor + + See :func:`torch.argsort` + """ + ... + @overload + def argsort(self, dim: Union[str, ellipsis, None], descending: _bool = False) -> Tensor: + r""" + argsort(dim=-1, descending=False) -> LongTensor + + See :func:`torch.argsort` + """ + ... + def argwhere(self) -> Tensor: + r""" + argwhere() -> Tensor + + See :func:`torch.argwhere` + """ + ... + def as_strided(self, size: Sequence[Union[_int, SymInt]], stride: Sequence[Union[_int, SymInt]], storage_offset: Optional[Union[_int, SymInt]] = None) -> Tensor: + r""" + as_strided(size, stride, storage_offset=None) -> Tensor + + See :func:`torch.as_strided` + """ + ... + def as_strided_(self, size: Sequence[Union[_int, SymInt]], stride: Sequence[Union[_int, SymInt]], storage_offset: Optional[Union[_int, SymInt]] = None) -> Tensor: + r""" + as_strided_(size, stride, storage_offset=None) -> Tensor + + In-place version of :meth:`~Tensor.as_strided` + """ + ... + def as_strided_scatter(self, src: Tensor, size: Sequence[Union[_int, SymInt]], stride: Sequence[Union[_int, SymInt]], storage_offset: Optional[Union[_int, SymInt]] = None) -> Tensor: + r""" + as_strided_scatter(src, size, stride, storage_offset=None) -> Tensor + + See :func:`torch.as_strided_scatter` + """ + ... + def as_subclass(self, cls: Type[S]) -> S: + r""" + as_subclass(cls) -> Tensor + + Makes a ``cls`` instance with the same data pointer as ``self``. Changes + in the output mirror changes in ``self``, and the output stays attached + to the autograd graph. ``cls`` must be a subclass of ``Tensor``. + """ + ... + def asin(self) -> Tensor: + r""" + asin() -> Tensor + + See :func:`torch.asin` + """ + ... + def asin_(self) -> Tensor: + r""" + asin_() -> Tensor + + In-place version of :meth:`~Tensor.asin` + """ + ... + def asinh(self) -> Tensor: + r""" + asinh() -> Tensor + + See :func:`torch.asinh` + """ + ... + def asinh_(self) -> Tensor: + r""" + asinh_() -> Tensor + + In-place version of :meth:`~Tensor.asinh` + """ + ... + def atan(self) -> Tensor: + r""" + atan() -> Tensor + + See :func:`torch.atan` + """ + ... + def atan2(self, other: Tensor) -> Tensor: + r""" + atan2(other) -> Tensor + + See :func:`torch.atan2` + """ + ... + def atan2_(self, other: Tensor) -> Tensor: + r""" + atan2_(other) -> Tensor + + In-place version of :meth:`~Tensor.atan2` + """ + ... + def atan_(self) -> Tensor: + r""" + atan_() -> Tensor + + In-place version of :meth:`~Tensor.atan` + """ + ... + def atanh(self) -> Tensor: + r""" + atanh() -> Tensor + + See :func:`torch.atanh` + """ + ... + def atanh_(self) -> Tensor: + r""" + atanh_(other) -> Tensor + + In-place version of :meth:`~Tensor.atanh` + """ + ... + def baddbmm(self, batch1: Tensor, batch2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + baddbmm(batch1, batch2, *, beta=1, alpha=1) -> Tensor + + See :func:`torch.baddbmm` + """ + ... + def baddbmm_(self, batch1: Tensor, batch2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + baddbmm_(batch1, batch2, *, beta=1, alpha=1) -> Tensor + + In-place version of :meth:`~Tensor.baddbmm` + """ + ... + @overload + def bernoulli(self, *, generator: Optional[Generator] = None) -> Tensor: + r""" + bernoulli(*, generator=None) -> Tensor + + Returns a result tensor where each :math:`\texttt{result[i]}` is independently + sampled from :math:`\text{Bernoulli}(\texttt{self[i]})`. :attr:`self` must have + floating point ``dtype``, and the result will have the same ``dtype``. + + See :func:`torch.bernoulli` + """ + ... + @overload + def bernoulli(self, p: _float, *, generator: Optional[Generator] = None) -> Tensor: + r""" + bernoulli(*, generator=None) -> Tensor + + Returns a result tensor where each :math:`\texttt{result[i]}` is independently + sampled from :math:`\text{Bernoulli}(\texttt{self[i]})`. :attr:`self` must have + floating point ``dtype``, and the result will have the same ``dtype``. + + See :func:`torch.bernoulli` + """ + ... + @overload + def bernoulli_(self, p: Tensor, *, generator: Optional[Generator] = None) -> Tensor: + r""" + bernoulli_(p=0.5, *, generator=None) -> Tensor + + Fills each location of :attr:`self` with an independent sample from + :math:`\text{Bernoulli}(\texttt{p})`. :attr:`self` can have integral + ``dtype``. + + :attr:`p` should either be a scalar or tensor containing probabilities to be + used for drawing the binary random number. + + If it is a tensor, the :math:`\text{i}^{th}` element of :attr:`self` tensor + will be set to a value sampled from + :math:`\text{Bernoulli}(\texttt{p\_tensor[i]})`. In this case `p` must have + floating point ``dtype``. + + See also :meth:`~Tensor.bernoulli` and :func:`torch.bernoulli` + """ + ... + @overload + def bernoulli_(self, p: _float = 0.5, *, generator: Optional[Generator] = None) -> Tensor: + r""" + bernoulli_(p=0.5, *, generator=None) -> Tensor + + Fills each location of :attr:`self` with an independent sample from + :math:`\text{Bernoulli}(\texttt{p})`. :attr:`self` can have integral + ``dtype``. + + :attr:`p` should either be a scalar or tensor containing probabilities to be + used for drawing the binary random number. + + If it is a tensor, the :math:`\text{i}^{th}` element of :attr:`self` tensor + will be set to a value sampled from + :math:`\text{Bernoulli}(\texttt{p\_tensor[i]})`. In this case `p` must have + floating point ``dtype``. + + See also :meth:`~Tensor.bernoulli` and :func:`torch.bernoulli` + """ + ... + def bfloat16(self) -> Tensor: + r""" + bfloat16(memory_format=torch.preserve_format) -> Tensor + ``self.bfloat16()`` is equivalent to ``self.to(torch.bfloat16)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + def bincount(self, weights: Optional[Tensor] = None, minlength: _int = 0) -> Tensor: + r""" + bincount(weights=None, minlength=0) -> Tensor + + See :func:`torch.bincount` + """ + ... + @overload + def bitwise_and(self, other: Tensor) -> Tensor: + r""" + bitwise_and() -> Tensor + + See :func:`torch.bitwise_and` + """ + ... + @overload + def bitwise_and(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_and() -> Tensor + + See :func:`torch.bitwise_and` + """ + ... + @overload + def bitwise_and_(self, other: Tensor) -> Tensor: + r""" + bitwise_and_() -> Tensor + + In-place version of :meth:`~Tensor.bitwise_and` + """ + ... + @overload + def bitwise_and_(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_and_() -> Tensor + + In-place version of :meth:`~Tensor.bitwise_and` + """ + ... + @overload + def bitwise_left_shift(self, other: Tensor) -> Tensor: + r""" + bitwise_left_shift(other) -> Tensor + + See :func:`torch.bitwise_left_shift` + """ + ... + @overload + def bitwise_left_shift(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_left_shift(other) -> Tensor + + See :func:`torch.bitwise_left_shift` + """ + ... + @overload + def bitwise_left_shift_(self, other: Tensor) -> Tensor: + r""" + bitwise_left_shift_(other) -> Tensor + + In-place version of :meth:`~Tensor.bitwise_left_shift` + """ + ... + @overload + def bitwise_left_shift_(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_left_shift_(other) -> Tensor + + In-place version of :meth:`~Tensor.bitwise_left_shift` + """ + ... + def bitwise_not(self) -> Tensor: + r""" + bitwise_not() -> Tensor + + See :func:`torch.bitwise_not` + """ + ... + def bitwise_not_(self) -> Tensor: + r""" + bitwise_not_() -> Tensor + + In-place version of :meth:`~Tensor.bitwise_not` + """ + ... + @overload + def bitwise_or(self, other: Tensor) -> Tensor: + r""" + bitwise_or() -> Tensor + + See :func:`torch.bitwise_or` + """ + ... + @overload + def bitwise_or(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_or() -> Tensor + + See :func:`torch.bitwise_or` + """ + ... + @overload + def bitwise_or_(self, other: Tensor) -> Tensor: + r""" + bitwise_or_() -> Tensor + + In-place version of :meth:`~Tensor.bitwise_or` + """ + ... + @overload + def bitwise_or_(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_or_() -> Tensor + + In-place version of :meth:`~Tensor.bitwise_or` + """ + ... + @overload + def bitwise_right_shift(self, other: Tensor) -> Tensor: + r""" + bitwise_right_shift(other) -> Tensor + + See :func:`torch.bitwise_right_shift` + """ + ... + @overload + def bitwise_right_shift(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_right_shift(other) -> Tensor + + See :func:`torch.bitwise_right_shift` + """ + ... + @overload + def bitwise_right_shift_(self, other: Tensor) -> Tensor: + r""" + bitwise_right_shift_(other) -> Tensor + + In-place version of :meth:`~Tensor.bitwise_right_shift` + """ + ... + @overload + def bitwise_right_shift_(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_right_shift_(other) -> Tensor + + In-place version of :meth:`~Tensor.bitwise_right_shift` + """ + ... + @overload + def bitwise_xor(self, other: Tensor) -> Tensor: + r""" + bitwise_xor() -> Tensor + + See :func:`torch.bitwise_xor` + """ + ... + @overload + def bitwise_xor(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_xor() -> Tensor + + See :func:`torch.bitwise_xor` + """ + ... + @overload + def bitwise_xor_(self, other: Tensor) -> Tensor: + r""" + bitwise_xor_() -> Tensor + + In-place version of :meth:`~Tensor.bitwise_xor` + """ + ... + @overload + def bitwise_xor_(self, other: Union[Number, _complex]) -> Tensor: + r""" + bitwise_xor_() -> Tensor + + In-place version of :meth:`~Tensor.bitwise_xor` + """ + ... + def bmm(self, mat2: Tensor) -> Tensor: + r""" + bmm(batch2) -> Tensor + + See :func:`torch.bmm` + """ + ... + def bool(self) -> Tensor: + r""" + bool(memory_format=torch.preserve_format) -> Tensor + + ``self.bool()`` is equivalent to ``self.to(torch.bool)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + @overload + def broadcast_to(self, size: Sequence[Union[_int, SymInt]]) -> Tensor: + r""" + broadcast_to(shape) -> Tensor + + See :func:`torch.broadcast_to`. + """ + ... + @overload + def broadcast_to(self, *size: _int) -> Tensor: + r""" + broadcast_to(shape) -> Tensor + + See :func:`torch.broadcast_to`. + """ + ... + def byte(self) -> Tensor: + r""" + byte(memory_format=torch.preserve_format) -> Tensor + + ``self.byte()`` is equivalent to ``self.to(torch.uint8)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + def cauchy_(self, median: _float = 0, sigma: _float = 1, *, generator: Optional[Generator] = None) -> Tensor: + r""" + cauchy_(median=0, sigma=1, *, generator=None) -> Tensor + + Fills the tensor with numbers drawn from the Cauchy distribution: + + .. math:: + + f(x) = \dfrac{1}{\pi} \dfrac{\sigma}{(x - \text{median})^2 + \sigma^2} + + .. note:: + Sigma (:math:`\sigma`) is used to denote the scale parameter in Cauchy distribution. + """ + ... + def ccol_indices(self) -> Tensor: ... + def ceil(self) -> Tensor: + r""" + ceil() -> Tensor + + See :func:`torch.ceil` + """ + ... + def ceil_(self) -> Tensor: + r""" + ceil_() -> Tensor + + In-place version of :meth:`~Tensor.ceil` + """ + ... + def chalf(self, *, memory_format: Optional[memory_format] = None) -> Tensor: + r""" + chalf(memory_format=torch.preserve_format) -> Tensor + + ``self.chalf()`` is equivalent to ``self.to(torch.complex32)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + def char(self) -> Tensor: + r""" + char(memory_format=torch.preserve_format) -> Tensor + + ``self.char()`` is equivalent to ``self.to(torch.int8)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + def cholesky(self, upper: _bool = False) -> Tensor: + r""" + cholesky(upper=False) -> Tensor + + See :func:`torch.cholesky` + """ + ... + def cholesky_inverse(self, upper: _bool = False) -> Tensor: + r""" + cholesky_inverse(upper=False) -> Tensor + + See :func:`torch.cholesky_inverse` + """ + ... + def cholesky_solve(self, input2: Tensor, upper: _bool = False) -> Tensor: + r""" + cholesky_solve(input2, upper=False) -> Tensor + + See :func:`torch.cholesky_solve` + """ + ... + def chunk(self, chunks: _int, dim: _int = 0) -> Tuple[Tensor, ...]: + r""" + chunk(chunks, dim=0) -> List of Tensors + + See :func:`torch.chunk` + """ + ... + @overload + def clamp(self, min: Optional[Tensor] = None, max: Optional[Tensor] = None) -> Tensor: + r""" + clamp(min=None, max=None) -> Tensor + + See :func:`torch.clamp` + """ + ... + @overload + def clamp(self, min: Optional[Union[Number, _complex]] = None, max: Optional[Union[Number, _complex]] = None) -> Tensor: + r""" + clamp(min=None, max=None) -> Tensor + + See :func:`torch.clamp` + """ + ... + @overload + def clamp_(self, min: Optional[Tensor] = None, max: Optional[Tensor] = None) -> Tensor: + r""" + clamp_(min=None, max=None) -> Tensor + + In-place version of :meth:`~Tensor.clamp` + """ + ... + @overload + def clamp_(self, min: Optional[Union[Number, _complex]] = None, max: Optional[Union[Number, _complex]] = None) -> Tensor: + r""" + clamp_(min=None, max=None) -> Tensor + + In-place version of :meth:`~Tensor.clamp` + """ + ... + @overload + def clamp_max(self, max: Tensor) -> Tensor: ... + @overload + def clamp_max(self, max: Union[Number, _complex]) -> Tensor: ... + @overload + def clamp_max_(self, max: Tensor) -> Tensor: ... + @overload + def clamp_max_(self, max: Union[Number, _complex]) -> Tensor: ... + @overload + def clamp_min(self, min: Tensor) -> Tensor: ... + @overload + def clamp_min(self, min: Union[Number, _complex]) -> Tensor: ... + @overload + def clamp_min_(self, min: Tensor) -> Tensor: ... + @overload + def clamp_min_(self, min: Union[Number, _complex]) -> Tensor: ... + @overload + def clip(self, min: Optional[Tensor] = None, max: Optional[Tensor] = None) -> Tensor: + r""" + clip(min=None, max=None) -> Tensor + + Alias for :meth:`~Tensor.clamp`. + """ + ... + @overload + def clip(self, min: Optional[Union[Number, _complex]] = None, max: Optional[Union[Number, _complex]] = None) -> Tensor: + r""" + clip(min=None, max=None) -> Tensor + + Alias for :meth:`~Tensor.clamp`. + """ + ... + @overload + def clip_(self, min: Optional[Tensor] = None, max: Optional[Tensor] = None) -> Tensor: + r""" + clip_(min=None, max=None) -> Tensor + + Alias for :meth:`~Tensor.clamp_`. + """ + ... + @overload + def clip_(self, min: Optional[Union[Number, _complex]] = None, max: Optional[Union[Number, _complex]] = None) -> Tensor: + r""" + clip_(min=None, max=None) -> Tensor + + Alias for :meth:`~Tensor.clamp_`. + """ + ... + def clone(self, *, memory_format: Optional[memory_format] = None) -> Tensor: + r""" + clone(*, memory_format=torch.preserve_format) -> Tensor + + See :func:`torch.clone` + """ + ... + def coalesce(self) -> Tensor: + r""" + coalesce() -> Tensor + + Returns a coalesced copy of :attr:`self` if :attr:`self` is an + :ref:`uncoalesced tensor `. + + Returns :attr:`self` if :attr:`self` is a coalesced tensor. + + .. warning:: + Throws an error if :attr:`self` is not a sparse COO tensor. + """ + ... + def col_indices(self) -> Tensor: + r""" + col_indices() -> IntTensor + + Returns the tensor containing the column indices of the :attr:`self` + tensor when :attr:`self` is a sparse CSR tensor of layout ``sparse_csr``. + The ``col_indices`` tensor is strictly of shape (:attr:`self`.nnz()) + and of type ``int32`` or ``int64``. When using MKL routines such as sparse + matrix multiplication, it is necessary to use ``int32`` indexing in order + to avoid downcasting and potentially losing information. + + Example:: + >>> csr = torch.eye(5,5).to_sparse_csr() + >>> csr.col_indices() + tensor([0, 1, 2, 3, 4], dtype=torch.int32) + """ + ... + def conj(self) -> Tensor: + r""" + conj() -> Tensor + + See :func:`torch.conj` + """ + ... + def conj_physical(self) -> Tensor: + r""" + conj_physical() -> Tensor + + See :func:`torch.conj_physical` + """ + ... + def conj_physical_(self) -> Tensor: + r""" + conj_physical_() -> Tensor + + In-place version of :meth:`~Tensor.conj_physical` + """ + ... + def contiguous(self, memory_format=torch.contiguous_format) -> Tensor: + r""" + contiguous(memory_format=torch.contiguous_format) -> Tensor + + Returns a contiguous in memory tensor containing the same data as :attr:`self` tensor. If + :attr:`self` tensor is already in the specified memory format, this function returns the + :attr:`self` tensor. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.contiguous_format``. + """ + ... + def copy_(self, src: Tensor, non_blocking: _bool = False) -> Tensor: + r""" + copy_(src, non_blocking=False) -> Tensor + + Copies the elements from :attr:`src` into :attr:`self` tensor and returns + :attr:`self`. + + The :attr:`src` tensor must be :ref:`broadcastable ` + with the :attr:`self` tensor. It may be of a different data type or reside on a + different device. + + Args: + src (Tensor): the source tensor to copy from + non_blocking (bool): if ``True`` and this copy is between CPU and GPU, + the copy may occur asynchronously with respect to the host. For other + cases, this argument has no effect. + """ + ... + @overload + def copysign(self, other: Tensor) -> Tensor: + r""" + copysign(other) -> Tensor + + See :func:`torch.copysign` + """ + ... + @overload + def copysign(self, other: Union[Number, _complex]) -> Tensor: + r""" + copysign(other) -> Tensor + + See :func:`torch.copysign` + """ + ... + @overload + def copysign_(self, other: Tensor) -> Tensor: + r""" + copysign_(other) -> Tensor + + In-place version of :meth:`~Tensor.copysign` + """ + ... + @overload + def copysign_(self, other: Union[Number, _complex]) -> Tensor: + r""" + copysign_(other) -> Tensor + + In-place version of :meth:`~Tensor.copysign` + """ + ... + def corrcoef(self) -> Tensor: + r""" + corrcoef() -> Tensor + + See :func:`torch.corrcoef` + """ + ... + def cos(self) -> Tensor: + r""" + cos() -> Tensor + + See :func:`torch.cos` + """ + ... + def cos_(self) -> Tensor: + r""" + cos_() -> Tensor + + In-place version of :meth:`~Tensor.cos` + """ + ... + def cosh(self) -> Tensor: + r""" + cosh() -> Tensor + + See :func:`torch.cosh` + """ + ... + def cosh_(self) -> Tensor: + r""" + cosh_() -> Tensor + + In-place version of :meth:`~Tensor.cosh` + """ + ... + @overload + def count_nonzero(self, dim: Optional[_int] = None) -> Tensor: + r""" + count_nonzero(dim=None) -> Tensor + + See :func:`torch.count_nonzero` + """ + ... + @overload + def count_nonzero(self, dim: _size) -> Tensor: + r""" + count_nonzero(dim=None) -> Tensor + + See :func:`torch.count_nonzero` + """ + ... + @overload + def count_nonzero(self, *dim: _int) -> Tensor: + r""" + count_nonzero(dim=None) -> Tensor + + See :func:`torch.count_nonzero` + """ + ... + def cov(self, *, correction: _int = 1, fweights: Optional[Tensor] = None, aweights: Optional[Tensor] = None) -> Tensor: + r""" + cov(*, correction=1, fweights=None, aweights=None) -> Tensor + + See :func:`torch.cov` + """ + ... + def cpu(self, memory_format: torch.memory_format = torch.preserve_format) -> Tensor: + r""" + cpu(memory_format=torch.preserve_format) -> Tensor + + Returns a copy of this object in CPU memory. + + If this object is already in CPU memory and on the correct device, + then no copy is performed and the original object is returned. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + def cross(self, other: Tensor, dim: Optional[_int] = None) -> Tensor: + r""" + cross(other, dim=None) -> Tensor + + See :func:`torch.cross` + """ + ... + def crow_indices(self) -> Tensor: + r""" + crow_indices() -> IntTensor + + Returns the tensor containing the compressed row indices of the :attr:`self` + tensor when :attr:`self` is a sparse CSR tensor of layout ``sparse_csr``. + The ``crow_indices`` tensor is strictly of shape (:attr:`self`.size(0) + 1) + and of type ``int32`` or ``int64``. When using MKL routines such as sparse + matrix multiplication, it is necessary to use ``int32`` indexing in order + to avoid downcasting and potentially losing information. + + Example:: + >>> csr = torch.eye(5,5).to_sparse_csr() + >>> csr.crow_indices() + tensor([0, 1, 2, 3, 4, 5], dtype=torch.int32) + """ + ... + def cuda(self, device: Optional[Union[_device, _int, str]] = None, non_blocking: _bool = False, memory_format: torch.memory_format = torch.preserve_format) -> Tensor: + r""" + cuda(device=None, non_blocking=False, memory_format=torch.preserve_format) -> Tensor + + Returns a copy of this object in CUDA memory. + + If this object is already in CUDA memory and on the correct device, + then no copy is performed and the original object is returned. + + Args: + device (:class:`torch.device`): The destination GPU device. + Defaults to the current CUDA device. + non_blocking (bool): If ``True`` and the source is in pinned memory, + the copy will be asynchronous with respect to the host. + Otherwise, the argument has no effect. Default: ``False``. + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + @overload + def cummax(self, dim: _int) -> torch.return_types.cummax: + r""" + cummax(dim) -> (Tensor, Tensor) + + See :func:`torch.cummax` + """ + ... + @overload + def cummax(self, dim: Union[str, ellipsis, None]) -> torch.return_types.cummax: + r""" + cummax(dim) -> (Tensor, Tensor) + + See :func:`torch.cummax` + """ + ... + @overload + def cummin(self, dim: _int) -> torch.return_types.cummin: + r""" + cummin(dim) -> (Tensor, Tensor) + + See :func:`torch.cummin` + """ + ... + @overload + def cummin(self, dim: Union[str, ellipsis, None]) -> torch.return_types.cummin: + r""" + cummin(dim) -> (Tensor, Tensor) + + See :func:`torch.cummin` + """ + ... + @overload + def cumprod(self, dim: _int, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + cumprod(dim, dtype=None) -> Tensor + + See :func:`torch.cumprod` + """ + ... + @overload + def cumprod(self, dim: Union[str, ellipsis, None], *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + cumprod(dim, dtype=None) -> Tensor + + See :func:`torch.cumprod` + """ + ... + @overload + def cumprod_(self, dim: _int, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + cumprod_(dim, dtype=None) -> Tensor + + In-place version of :meth:`~Tensor.cumprod` + """ + ... + @overload + def cumprod_(self, dim: Union[str, ellipsis, None], *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + cumprod_(dim, dtype=None) -> Tensor + + In-place version of :meth:`~Tensor.cumprod` + """ + ... + @overload + def cumsum(self, dim: _int, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + cumsum(dim, dtype=None) -> Tensor + + See :func:`torch.cumsum` + """ + ... + @overload + def cumsum(self, dim: Union[str, ellipsis, None], *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + cumsum(dim, dtype=None) -> Tensor + + See :func:`torch.cumsum` + """ + ... + @overload + def cumsum_(self, dim: _int, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + cumsum_(dim, dtype=None) -> Tensor + + In-place version of :meth:`~Tensor.cumsum` + """ + ... + @overload + def cumsum_(self, dim: Union[str, ellipsis, None], *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + cumsum_(dim, dtype=None) -> Tensor + + In-place version of :meth:`~Tensor.cumsum` + """ + ... + def data_ptr(self) -> _int: + r""" + data_ptr() -> int + + Returns the address of the first element of :attr:`self` tensor. + """ + ... + def deg2rad(self) -> Tensor: + r""" + deg2rad() -> Tensor + + See :func:`torch.deg2rad` + """ + ... + def deg2rad_(self) -> Tensor: + r""" + deg2rad_() -> Tensor + + In-place version of :meth:`~Tensor.deg2rad` + """ + ... + def dense_dim(self) -> _int: + r""" + dense_dim() -> int + + Return the number of dense dimensions in a :ref:`sparse tensor ` :attr:`self`. + + .. note:: + Returns ``len(self.shape)`` if :attr:`self` is not a sparse tensor. + + See also :meth:`Tensor.sparse_dim` and :ref:`hybrid tensors `. + """ + ... + def dequantize(self) -> Tensor: + r""" + dequantize() -> Tensor + + Given a quantized Tensor, dequantize it and return the dequantized float Tensor. + """ + ... + def det(self) -> Tensor: + r""" + det() -> Tensor + + See :func:`torch.det` + """ + ... + def detach(self) -> Tensor: ... + def detach_(self) -> Tensor: ... + def diag(self, diagonal: _int = 0) -> Tensor: + r""" + diag(diagonal=0) -> Tensor + + See :func:`torch.diag` + """ + ... + def diag_embed(self, offset: _int = 0, dim1: _int = -2, dim2: _int = -1) -> Tensor: + r""" + diag_embed(offset=0, dim1=-2, dim2=-1) -> Tensor + + See :func:`torch.diag_embed` + """ + ... + def diagflat(self, offset: _int = 0) -> Tensor: + r""" + diagflat(offset=0) -> Tensor + + See :func:`torch.diagflat` + """ + ... + @overload + def diagonal(self, *, outdim: Union[str, ellipsis, None], dim1: Union[str, ellipsis, None], dim2: Union[str, ellipsis, None], offset: _int = 0) -> Tensor: + r""" + diagonal(offset=0, dim1=0, dim2=1) -> Tensor + + See :func:`torch.diagonal` + """ + ... + @overload + def diagonal(self, offset: _int = 0, dim1: _int = 0, dim2: _int = 1) -> Tensor: + r""" + diagonal(offset=0, dim1=0, dim2=1) -> Tensor + + See :func:`torch.diagonal` + """ + ... + def diagonal_scatter(self, src: Tensor, offset: _int = 0, dim1: _int = 0, dim2: _int = 1) -> Tensor: + r""" + diagonal_scatter(src, offset=0, dim1=0, dim2=1) -> Tensor + + See :func:`torch.diagonal_scatter` + """ + ... + def diff(self, n: _int = 1, dim: _int = -1, prepend: Optional[Tensor] = None, append: Optional[Tensor] = None) -> Tensor: + r""" + diff(n=1, dim=-1, prepend=None, append=None) -> Tensor + + See :func:`torch.diff` + """ + ... + def digamma(self) -> Tensor: + r""" + digamma() -> Tensor + + See :func:`torch.digamma` + """ + ... + def digamma_(self) -> Tensor: + r""" + digamma_() -> Tensor + + In-place version of :meth:`~Tensor.digamma` + """ + ... + def dim(self) -> _int: + r""" + dim() -> int + + Returns the number of dimensions of :attr:`self` tensor. + """ + ... + def dist(self, other: Tensor, p: Union[Number, _complex] = 2) -> Tensor: + r""" + dist(other, p=2) -> Tensor + + See :func:`torch.dist` + """ + ... + def div(self, other: Union[Tensor, Number], *, rounding_mode: Optional[str] = None) -> Tensor: + r""" + div(value, *, rounding_mode=None) -> Tensor + + See :func:`torch.div` + """ + ... + def div_(self, other: Union[Tensor, Number], *, rounding_mode: Optional[str] = None) -> Tensor: + r""" + div_(value, *, rounding_mode=None) -> Tensor + + In-place version of :meth:`~Tensor.div` + """ + ... + @overload + def divide(self, other: Tensor) -> Tensor: + r""" + divide(value, *, rounding_mode=None) -> Tensor + + See :func:`torch.divide` + """ + ... + @overload + def divide(self, other: Tensor, *, rounding_mode: Optional[str]) -> Tensor: + r""" + divide(value, *, rounding_mode=None) -> Tensor + + See :func:`torch.divide` + """ + ... + @overload + def divide(self, other: Union[Number, _complex], *, rounding_mode: Optional[str]) -> Tensor: + r""" + divide(value, *, rounding_mode=None) -> Tensor + + See :func:`torch.divide` + """ + ... + @overload + def divide(self, other: Union[Number, _complex]) -> Tensor: + r""" + divide(value, *, rounding_mode=None) -> Tensor + + See :func:`torch.divide` + """ + ... + @overload + def divide_(self, other: Tensor) -> Tensor: + r""" + divide_(value, *, rounding_mode=None) -> Tensor + + In-place version of :meth:`~Tensor.divide` + """ + ... + @overload + def divide_(self, other: Tensor, *, rounding_mode: Optional[str]) -> Tensor: + r""" + divide_(value, *, rounding_mode=None) -> Tensor + + In-place version of :meth:`~Tensor.divide` + """ + ... + @overload + def divide_(self, other: Union[Number, _complex], *, rounding_mode: Optional[str]) -> Tensor: + r""" + divide_(value, *, rounding_mode=None) -> Tensor + + In-place version of :meth:`~Tensor.divide` + """ + ... + @overload + def divide_(self, other: Union[Number, _complex]) -> Tensor: + r""" + divide_(value, *, rounding_mode=None) -> Tensor + + In-place version of :meth:`~Tensor.divide` + """ + ... + def dot(self, tensor: Tensor) -> Tensor: + r""" + dot(other) -> Tensor + + See :func:`torch.dot` + """ + ... + def double(self) -> Tensor: + r""" + double(memory_format=torch.preserve_format) -> Tensor + + ``self.double()`` is equivalent to ``self.to(torch.float64)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + @overload + def dsplit(self, sections: _int) -> Tuple[Tensor, ...]: + r""" + dsplit(split_size_or_sections) -> List of Tensors + + See :func:`torch.dsplit` + """ + ... + @overload + def dsplit(self, indices: _size) -> Tuple[Tensor, ...]: + r""" + dsplit(split_size_or_sections) -> List of Tensors + + See :func:`torch.dsplit` + """ + ... + @overload + def dsplit(self, *indices: _int) -> Tuple[Tensor, ...]: + r""" + dsplit(split_size_or_sections) -> List of Tensors + + See :func:`torch.dsplit` + """ + ... + def element_size(self) -> _int: + r""" + element_size() -> int + + Returns the size in bytes of an individual element. + + Example:: + + >>> torch.tensor([]).element_size() + 4 + >>> torch.tensor([], dtype=torch.uint8).element_size() + 1 + """ + ... + @overload + def eq(self, other: Tensor) -> Tensor: + r""" + eq(other) -> Tensor + + See :func:`torch.eq` + """ + ... + @overload + def eq(self, other: Union[Number, _complex]) -> Tensor: + r""" + eq(other) -> Tensor + + See :func:`torch.eq` + """ + ... + @overload + def eq_(self, other: Tensor) -> Tensor: + r""" + eq_(other) -> Tensor + + In-place version of :meth:`~Tensor.eq` + """ + ... + @overload + def eq_(self, other: Union[Number, _complex]) -> Tensor: + r""" + eq_(other) -> Tensor + + In-place version of :meth:`~Tensor.eq` + """ + ... + def equal(self, other: Tensor) -> _bool: + r""" + equal(other) -> bool + + See :func:`torch.equal` + """ + ... + def erf(self) -> Tensor: + r""" + erf() -> Tensor + + See :func:`torch.erf` + """ + ... + def erf_(self) -> Tensor: + r""" + erf_() -> Tensor + + In-place version of :meth:`~Tensor.erf` + """ + ... + def erfc(self) -> Tensor: + r""" + erfc() -> Tensor + + See :func:`torch.erfc` + """ + ... + def erfc_(self) -> Tensor: + r""" + erfc_() -> Tensor + + In-place version of :meth:`~Tensor.erfc` + """ + ... + def erfinv(self) -> Tensor: + r""" + erfinv() -> Tensor + + See :func:`torch.erfinv` + """ + ... + def erfinv_(self) -> Tensor: + r""" + erfinv_() -> Tensor + + In-place version of :meth:`~Tensor.erfinv` + """ + ... + def exp(self) -> Tensor: + r""" + exp() -> Tensor + + See :func:`torch.exp` + """ + ... + def exp2(self) -> Tensor: + r""" + exp2() -> Tensor + + See :func:`torch.exp2` + """ + ... + def exp2_(self) -> Tensor: + r""" + exp2_() -> Tensor + + In-place version of :meth:`~Tensor.exp2` + """ + ... + def exp_(self) -> Tensor: + r""" + exp_() -> Tensor + + In-place version of :meth:`~Tensor.exp` + """ + ... + @overload + def expand(self, size: Sequence[Union[_int, SymInt]], *, implicit: _bool = False) -> Tensor: + r""" + expand(*sizes) -> Tensor + + Returns a new view of the :attr:`self` tensor with singleton dimensions expanded + to a larger size. + + Passing -1 as the size for a dimension means not changing the size of + that dimension. + + Tensor can be also expanded to a larger number of dimensions, and the + new ones will be appended at the front. For the new dimensions, the + size cannot be set to -1. + + Expanding a tensor does not allocate new memory, but only creates a + new view on the existing tensor where a dimension of size one is + expanded to a larger size by setting the ``stride`` to 0. Any dimension + of size 1 can be expanded to an arbitrary value without allocating new + memory. + + Args: + *sizes (torch.Size or int...): the desired expanded size + + .. warning:: + + More than one element of an expanded tensor may refer to a single + memory location. As a result, in-place operations (especially ones that + are vectorized) may result in incorrect behavior. If you need to write + to the tensors, please clone them first. + + Example:: + + >>> x = torch.tensor([[1], [2], [3]]) + >>> x.size() + torch.Size([3, 1]) + >>> x.expand(3, 4) + tensor([[ 1, 1, 1, 1], + [ 2, 2, 2, 2], + [ 3, 3, 3, 3]]) + >>> x.expand(-1, 4) # -1 means not changing the size of that dimension + tensor([[ 1, 1, 1, 1], + [ 2, 2, 2, 2], + [ 3, 3, 3, 3]]) + """ + ... + @overload + def expand(self, *size: _int, implicit: _bool = False) -> Tensor: + r""" + expand(*sizes) -> Tensor + + Returns a new view of the :attr:`self` tensor with singleton dimensions expanded + to a larger size. + + Passing -1 as the size for a dimension means not changing the size of + that dimension. + + Tensor can be also expanded to a larger number of dimensions, and the + new ones will be appended at the front. For the new dimensions, the + size cannot be set to -1. + + Expanding a tensor does not allocate new memory, but only creates a + new view on the existing tensor where a dimension of size one is + expanded to a larger size by setting the ``stride`` to 0. Any dimension + of size 1 can be expanded to an arbitrary value without allocating new + memory. + + Args: + *sizes (torch.Size or int...): the desired expanded size + + .. warning:: + + More than one element of an expanded tensor may refer to a single + memory location. As a result, in-place operations (especially ones that + are vectorized) may result in incorrect behavior. If you need to write + to the tensors, please clone them first. + + Example:: + + >>> x = torch.tensor([[1], [2], [3]]) + >>> x.size() + torch.Size([3, 1]) + >>> x.expand(3, 4) + tensor([[ 1, 1, 1, 1], + [ 2, 2, 2, 2], + [ 3, 3, 3, 3]]) + >>> x.expand(-1, 4) # -1 means not changing the size of that dimension + tensor([[ 1, 1, 1, 1], + [ 2, 2, 2, 2], + [ 3, 3, 3, 3]]) + """ + ... + def expand_as(self, other: Tensor) -> Tensor: + r""" + expand_as(other) -> Tensor + + Expand this tensor to the same size as :attr:`other`. + ``self.expand_as(other)`` is equivalent to ``self.expand(other.size())``. + + Please see :meth:`~Tensor.expand` for more information about ``expand``. + + Args: + other (:class:`torch.Tensor`): The result tensor has the same size + as :attr:`other`. + """ + ... + def expm1(self) -> Tensor: + r""" + expm1() -> Tensor + + See :func:`torch.expm1` + """ + ... + def expm1_(self) -> Tensor: + r""" + expm1_() -> Tensor + + In-place version of :meth:`~Tensor.expm1` + """ + ... + def exponential_(self, lambd: _float = 1, *, generator: Optional[Generator] = None) -> Tensor: + r""" + exponential_(lambd=1, *, generator=None) -> Tensor + + Fills :attr:`self` tensor with elements drawn from the PDF (probability density function): + + .. math:: + + f(x) = \lambda e^{-\lambda x}, x > 0 + + .. note:: + In probability theory, exponential distribution is supported on interval [0, :math:`\inf`) (i.e., :math:`x >= 0`) + implying that zero can be sampled from the exponential distribution. + However, :func:`torch.Tensor.exponential_` does not sample zero, + which means that its actual support is the interval (0, :math:`\inf`). + + Note that :func:`torch.distributions.exponential.Exponential` is supported on the interval [0, :math:`\inf`) and can sample zero. + """ + ... + @overload + def fill_(self, value: Tensor) -> Tensor: + r""" + fill_(value) -> Tensor + + Fills :attr:`self` tensor with the specified value. + """ + ... + @overload + def fill_(self, value: Union[Number, _complex]) -> Tensor: + r""" + fill_(value) -> Tensor + + Fills :attr:`self` tensor with the specified value. + """ + ... + def fill_diagonal_(self, fill_value: Union[Number, _complex], wrap: _bool = False) -> Tensor: + r""" + fill_diagonal_(fill_value, wrap=False) -> Tensor + + Fill the main diagonal of a tensor that has at least 2-dimensions. + When dims>2, all dimensions of input must be of equal length. + This function modifies the input tensor in-place, and returns the input tensor. + + Arguments: + fill_value (Scalar): the fill value + wrap (bool): the diagonal 'wrapped' after N columns for tall matrices. + + Example:: + + >>> a = torch.zeros(3, 3) + >>> a.fill_diagonal_(5) + tensor([[5., 0., 0.], + [0., 5., 0.], + [0., 0., 5.]]) + >>> b = torch.zeros(7, 3) + >>> b.fill_diagonal_(5) + tensor([[5., 0., 0.], + [0., 5., 0.], + [0., 0., 5.], + [0., 0., 0.], + [0., 0., 0.], + [0., 0., 0.], + [0., 0., 0.]]) + >>> c = torch.zeros(7, 3) + >>> c.fill_diagonal_(5, wrap=True) + tensor([[5., 0., 0.], + [0., 5., 0.], + [0., 0., 5.], + [0., 0., 0.], + [5., 0., 0.], + [0., 5., 0.], + [0., 0., 5.]]) + """ + ... + def fix(self) -> Tensor: + r""" + fix() -> Tensor + + See :func:`torch.fix`. + """ + ... + def fix_(self) -> Tensor: + r""" + fix_() -> Tensor + + In-place version of :meth:`~Tensor.fix` + """ + ... + @overload + def flatten(self, start_dim: _int = 0, end_dim: _int = -1) -> Tensor: + r""" + flatten(start_dim=0, end_dim=-1) -> Tensor + + See :func:`torch.flatten` + """ + ... + @overload + def flatten(self, start_dim: _int, end_dim: _int, out_dim: Union[str, ellipsis, None]) -> Tensor: + r""" + flatten(start_dim=0, end_dim=-1) -> Tensor + + See :func:`torch.flatten` + """ + ... + @overload + def flatten(self, start_dim: Union[str, ellipsis, None], end_dim: Union[str, ellipsis, None], out_dim: Union[str, ellipsis, None]) -> Tensor: + r""" + flatten(start_dim=0, end_dim=-1) -> Tensor + + See :func:`torch.flatten` + """ + ... + @overload + def flatten(self, dims: Sequence[Union[str, ellipsis, None]], out_dim: Union[str, ellipsis, None]) -> Tensor: + r""" + flatten(start_dim=0, end_dim=-1) -> Tensor + + See :func:`torch.flatten` + """ + ... + @overload + def flip(self, dims: _size) -> Tensor: + r""" + flip(dims) -> Tensor + + See :func:`torch.flip` + """ + ... + @overload + def flip(self, *dims: _int) -> Tensor: + r""" + flip(dims) -> Tensor + + See :func:`torch.flip` + """ + ... + def fliplr(self) -> Tensor: + r""" + fliplr() -> Tensor + + See :func:`torch.fliplr` + """ + ... + def flipud(self) -> Tensor: + r""" + flipud() -> Tensor + + See :func:`torch.flipud` + """ + ... + def float(self) -> Tensor: + r""" + float(memory_format=torch.preserve_format) -> Tensor + + ``self.float()`` is equivalent to ``self.to(torch.float32)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + @overload + def float_power(self, exponent: Tensor) -> Tensor: + r""" + float_power(exponent) -> Tensor + + See :func:`torch.float_power` + """ + ... + @overload + def float_power(self, exponent: Union[Number, _complex]) -> Tensor: + r""" + float_power(exponent) -> Tensor + + See :func:`torch.float_power` + """ + ... + @overload + def float_power_(self, exponent: Tensor) -> Tensor: + r""" + float_power_(exponent) -> Tensor + + In-place version of :meth:`~Tensor.float_power` + """ + ... + @overload + def float_power_(self, exponent: Union[Number, _complex]) -> Tensor: + r""" + float_power_(exponent) -> Tensor + + In-place version of :meth:`~Tensor.float_power` + """ + ... + def floor(self) -> Tensor: + r""" + floor() -> Tensor + + See :func:`torch.floor` + """ + ... + def floor_(self) -> Tensor: + r""" + floor_() -> Tensor + + In-place version of :meth:`~Tensor.floor` + """ + ... + def floor_divide(self, other: Union[Tensor, Number, torch.SymInt, torch.SymFloat], *, out: Optional[Tensor] = None) -> Tensor: + r""" + floor_divide(value) -> Tensor + + See :func:`torch.floor_divide` + """ + ... + def floor_divide_(self, other: Union[Tensor, Number, torch.SymInt, torch.SymFloat]) -> Tensor: + r""" + floor_divide_(value) -> Tensor + + In-place version of :meth:`~Tensor.floor_divide` + """ + ... + def fmax(self, other: Tensor) -> Tensor: + r""" + fmax(other) -> Tensor + + See :func:`torch.fmax` + """ + ... + def fmin(self, other: Tensor) -> Tensor: + r""" + fmin(other) -> Tensor + + See :func:`torch.fmin` + """ + ... + @overload + def fmod(self, other: Tensor) -> Tensor: + r""" + fmod(divisor) -> Tensor + + See :func:`torch.fmod` + """ + ... + @overload + def fmod(self, other: Union[Number, _complex]) -> Tensor: + r""" + fmod(divisor) -> Tensor + + See :func:`torch.fmod` + """ + ... + @overload + def fmod_(self, other: Tensor) -> Tensor: + r""" + fmod_(divisor) -> Tensor + + In-place version of :meth:`~Tensor.fmod` + """ + ... + @overload + def fmod_(self, other: Union[Number, _complex]) -> Tensor: + r""" + fmod_(divisor) -> Tensor + + In-place version of :meth:`~Tensor.fmod` + """ + ... + def frac(self) -> Tensor: + r""" + frac() -> Tensor + + See :func:`torch.frac` + """ + ... + def frac_(self) -> Tensor: + r""" + frac_() -> Tensor + + In-place version of :meth:`~Tensor.frac` + """ + ... + def frexp(self) -> torch.return_types.frexp: + r""" + frexp(input) -> (Tensor mantissa, Tensor exponent) + + See :func:`torch.frexp` + """ + ... + @overload + def gather(self, dim: _int, index: Tensor, *, sparse_grad: _bool = False) -> Tensor: + r""" + gather(dim, index) -> Tensor + + See :func:`torch.gather` + """ + ... + @overload + def gather(self, dim: Union[str, ellipsis, None], index: Tensor, *, sparse_grad: _bool = False) -> Tensor: + r""" + gather(dim, index) -> Tensor + + See :func:`torch.gather` + """ + ... + def gcd(self, other: Tensor) -> Tensor: + r""" + gcd(other) -> Tensor + + See :func:`torch.gcd` + """ + ... + def gcd_(self, other: Tensor) -> Tensor: + r""" + gcd_(other) -> Tensor + + In-place version of :meth:`~Tensor.gcd` + """ + ... + @overload + def ge(self, other: Tensor) -> Tensor: + r""" + ge(other) -> Tensor + + See :func:`torch.ge`. + """ + ... + @overload + def ge(self, other: Union[Number, _complex]) -> Tensor: + r""" + ge(other) -> Tensor + + See :func:`torch.ge`. + """ + ... + @overload + def ge_(self, other: Tensor) -> Tensor: + r""" + ge_(other) -> Tensor + + In-place version of :meth:`~Tensor.ge`. + """ + ... + @overload + def ge_(self, other: Union[Number, _complex]) -> Tensor: + r""" + ge_(other) -> Tensor + + In-place version of :meth:`~Tensor.ge`. + """ + ... + def geometric_(self, p: _float, *, generator: Optional[Generator] = None) -> Tensor: + r""" + geometric_(p, *, generator=None) -> Tensor + + Fills :attr:`self` tensor with elements drawn from the geometric distribution: + + .. math:: + + P(X=k) = (1 - p)^{k - 1} p, k = 1, 2, ... + + .. note:: + :func:`torch.Tensor.geometric_` `k`-th trial is the first success hence draws samples in :math:`\{1, 2, \ldots\}`, whereas + :func:`torch.distributions.geometric.Geometric` :math:`(k+1)`-th trial is the first success + hence draws samples in :math:`\{0, 1, \ldots\}`. + """ + ... + def geqrf(self) -> torch.return_types.geqrf: + r""" + geqrf() -> (Tensor, Tensor) + + See :func:`torch.geqrf` + """ + ... + def ger(self, vec2: Tensor) -> Tensor: + r""" + ger(vec2) -> Tensor + + See :func:`torch.ger` + """ + ... + def get_device(self) -> _int: + r""" + get_device() -> Device ordinal (Integer) + + For CUDA tensors, this function returns the device ordinal of the GPU on which the tensor resides. + For CPU tensors, this function returns `-1`. + + Example:: + + >>> x = torch.randn(3, 4, 5, device='cuda:0') + >>> x.get_device() + 0 + >>> x.cpu().get_device() + -1 + """ + ... + @overload + def greater(self, other: Tensor) -> Tensor: + r""" + greater(other) -> Tensor + + See :func:`torch.greater`. + """ + ... + @overload + def greater(self, other: Union[Number, _complex]) -> Tensor: + r""" + greater(other) -> Tensor + + See :func:`torch.greater`. + """ + ... + @overload + def greater_(self, other: Tensor) -> Tensor: + r""" + greater_(other) -> Tensor + + In-place version of :meth:`~Tensor.greater`. + """ + ... + @overload + def greater_(self, other: Union[Number, _complex]) -> Tensor: + r""" + greater_(other) -> Tensor + + In-place version of :meth:`~Tensor.greater`. + """ + ... + @overload + def greater_equal(self, other: Tensor) -> Tensor: + r""" + greater_equal(other) -> Tensor + + See :func:`torch.greater_equal`. + """ + ... + @overload + def greater_equal(self, other: Union[Number, _complex]) -> Tensor: + r""" + greater_equal(other) -> Tensor + + See :func:`torch.greater_equal`. + """ + ... + @overload + def greater_equal_(self, other: Tensor) -> Tensor: + r""" + greater_equal_(other) -> Tensor + + In-place version of :meth:`~Tensor.greater_equal`. + """ + ... + @overload + def greater_equal_(self, other: Union[Number, _complex]) -> Tensor: + r""" + greater_equal_(other) -> Tensor + + In-place version of :meth:`~Tensor.greater_equal`. + """ + ... + @overload + def gt(self, other: Tensor) -> Tensor: + r""" + gt(other) -> Tensor + + See :func:`torch.gt`. + """ + ... + @overload + def gt(self, other: Union[Number, _complex]) -> Tensor: + r""" + gt(other) -> Tensor + + See :func:`torch.gt`. + """ + ... + @overload + def gt_(self, other: Tensor) -> Tensor: + r""" + gt_(other) -> Tensor + + In-place version of :meth:`~Tensor.gt`. + """ + ... + @overload + def gt_(self, other: Union[Number, _complex]) -> Tensor: + r""" + gt_(other) -> Tensor + + In-place version of :meth:`~Tensor.gt`. + """ + ... + def half(self) -> Tensor: + r""" + half(memory_format=torch.preserve_format) -> Tensor + + ``self.half()`` is equivalent to ``self.to(torch.float16)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + def hardshrink(self, lambd: Union[Number, _complex] = 0.5) -> Tensor: + r""" + hardshrink(lambd=0.5) -> Tensor + + See :func:`torch.nn.functional.hardshrink` + """ + ... + def has_names(self) -> _bool: + r""" + Is ``True`` if any of this tensor's dimensions are named. Otherwise, is ``False``. + """ + ... + def heaviside(self, values: Tensor) -> Tensor: + r""" + heaviside(values) -> Tensor + + See :func:`torch.heaviside` + """ + ... + def heaviside_(self, values: Tensor) -> Tensor: + r""" + heaviside_(values) -> Tensor + + In-place version of :meth:`~Tensor.heaviside` + """ + ... + def histc(self, bins: _int = 100, min: Union[Number, _complex] = 0, max: Union[Number, _complex] = 0) -> Tensor: + r""" + histc(bins=100, min=0, max=0) -> Tensor + + See :func:`torch.histc` + """ + ... + @overload + def histogram(self, bins: Tensor, *, weight: Optional[Tensor] = None, density: _bool = False) -> torch.return_types.histogram: + r""" + histogram(input, bins, *, range=None, weight=None, density=False) -> (Tensor, Tensor) + + See :func:`torch.histogram` + """ + ... + @overload + def histogram(self, bins: _int = 100, *, range: Optional[Sequence[_float]] = None, weight: Optional[Tensor] = None, density: _bool = False) -> torch.return_types.histogram: + r""" + histogram(input, bins, *, range=None, weight=None, density=False) -> (Tensor, Tensor) + + See :func:`torch.histogram` + """ + ... + @overload + def hsplit(self, sections: _int) -> Tuple[Tensor, ...]: + r""" + hsplit(split_size_or_sections) -> List of Tensors + + See :func:`torch.hsplit` + """ + ... + @overload + def hsplit(self, indices: _size) -> Tuple[Tensor, ...]: + r""" + hsplit(split_size_or_sections) -> List of Tensors + + See :func:`torch.hsplit` + """ + ... + @overload + def hsplit(self, *indices: _int) -> Tuple[Tensor, ...]: + r""" + hsplit(split_size_or_sections) -> List of Tensors + + See :func:`torch.hsplit` + """ + ... + def hypot(self, other: Tensor) -> Tensor: + r""" + hypot(other) -> Tensor + + See :func:`torch.hypot` + """ + ... + def hypot_(self, other: Tensor) -> Tensor: + r""" + hypot_(other) -> Tensor + + In-place version of :meth:`~Tensor.hypot` + """ + ... + def i0(self) -> Tensor: + r""" + i0() -> Tensor + + See :func:`torch.i0` + """ + ... + def i0_(self) -> Tensor: + r""" + i0_() -> Tensor + + In-place version of :meth:`~Tensor.i0` + """ + ... + def igamma(self, other: Tensor) -> Tensor: + r""" + igamma(other) -> Tensor + + See :func:`torch.igamma` + """ + ... + def igamma_(self, other: Tensor) -> Tensor: + r""" + igamma_(other) -> Tensor + + In-place version of :meth:`~Tensor.igamma` + """ + ... + def igammac(self, other: Tensor) -> Tensor: + r""" + igammac(other) -> Tensor + See :func:`torch.igammac` + """ + ... + def igammac_(self, other: Tensor) -> Tensor: + r""" + igammac_(other) -> Tensor + In-place version of :meth:`~Tensor.igammac` + """ + ... + @overload + def index_add(self, dim: _int, index: Tensor, source: Tensor, *, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + index_add(dim, index, source, *, alpha=1) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.index_add_`. + """ + ... + @overload + def index_add(self, dim: Union[str, ellipsis, None], index: Tensor, source: Tensor, *, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + index_add(dim, index, source, *, alpha=1) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.index_add_`. + """ + ... + def index_add_(self, dim: _int, index: Tensor, source: Tensor, *, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + index_add_(dim, index, source, *, alpha=1) -> Tensor + + Accumulate the elements of :attr:`alpha` times ``source`` into the :attr:`self` + tensor by adding to the indices in the order given in :attr:`index`. For example, + if ``dim == 0``, ``index[i] == j``, and ``alpha=-1``, then the ``i``\ th row of + ``source`` is subtracted from the ``j``\ th row of :attr:`self`. + + The :attr:`dim`\ th dimension of ``source`` must have the same size as the + length of :attr:`index` (which must be a vector), and all other dimensions must + match :attr:`self`, or an error will be raised. + + For a 3-D tensor the output is given as:: + + self[index[i], :, :] += alpha * src[i, :, :] # if dim == 0 + self[:, index[i], :] += alpha * src[:, i, :] # if dim == 1 + self[:, :, index[i]] += alpha * src[:, :, i] # if dim == 2 + + Note: + This operation may behave nondeterministically when given tensors on a CUDA device. See :doc:`/notes/randomness` for more information. + + Args: + dim (int): dimension along which to index + index (Tensor): indices of ``source`` to select from, + should have dtype either `torch.int64` or `torch.int32` + source (Tensor): the tensor containing values to add + + Keyword args: + alpha (Number): the scalar multiplier for ``source`` + + Example:: + + >>> x = torch.ones(5, 3) + >>> t = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=torch.float) + >>> index = torch.tensor([0, 4, 2]) + >>> x.index_add_(0, index, t) + tensor([[ 2., 3., 4.], + [ 1., 1., 1.], + [ 8., 9., 10.], + [ 1., 1., 1.], + [ 5., 6., 7.]]) + >>> x.index_add_(0, index, t, alpha=-1) + tensor([[ 1., 1., 1.], + [ 1., 1., 1.], + [ 1., 1., 1.], + [ 1., 1., 1.], + [ 1., 1., 1.]]) + """ + ... + @overload + def index_copy(self, dim: _int, index: Tensor, source: Tensor) -> Tensor: + r""" + index_copy(dim, index, tensor2) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.index_copy_`. + """ + ... + @overload + def index_copy(self, dim: Union[str, ellipsis, None], index: Tensor, source: Tensor) -> Tensor: + r""" + index_copy(dim, index, tensor2) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.index_copy_`. + """ + ... + @overload + def index_copy_(self, dim: _int, index: Tensor, source: Tensor) -> Tensor: + r""" + index_copy_(dim, index, tensor) -> Tensor + + Copies the elements of :attr:`tensor` into the :attr:`self` tensor by selecting + the indices in the order given in :attr:`index`. For example, if ``dim == 0`` + and ``index[i] == j``, then the ``i``\ th row of :attr:`tensor` is copied to the + ``j``\ th row of :attr:`self`. + + The :attr:`dim`\ th dimension of :attr:`tensor` must have the same size as the + length of :attr:`index` (which must be a vector), and all other dimensions must + match :attr:`self`, or an error will be raised. + + .. note:: + If :attr:`index` contains duplicate entries, multiple elements from + :attr:`tensor` will be copied to the same index of :attr:`self`. The result + is nondeterministic since it depends on which copy occurs last. + + Args: + dim (int): dimension along which to index + index (LongTensor): indices of :attr:`tensor` to select from + tensor (Tensor): the tensor containing values to copy + + Example:: + + >>> x = torch.zeros(5, 3) + >>> t = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=torch.float) + >>> index = torch.tensor([0, 4, 2]) + >>> x.index_copy_(0, index, t) + tensor([[ 1., 2., 3.], + [ 0., 0., 0.], + [ 7., 8., 9.], + [ 0., 0., 0.], + [ 4., 5., 6.]]) + """ + ... + @overload + def index_copy_(self, dim: Union[str, ellipsis, None], index: Tensor, source: Tensor) -> Tensor: + r""" + index_copy_(dim, index, tensor) -> Tensor + + Copies the elements of :attr:`tensor` into the :attr:`self` tensor by selecting + the indices in the order given in :attr:`index`. For example, if ``dim == 0`` + and ``index[i] == j``, then the ``i``\ th row of :attr:`tensor` is copied to the + ``j``\ th row of :attr:`self`. + + The :attr:`dim`\ th dimension of :attr:`tensor` must have the same size as the + length of :attr:`index` (which must be a vector), and all other dimensions must + match :attr:`self`, or an error will be raised. + + .. note:: + If :attr:`index` contains duplicate entries, multiple elements from + :attr:`tensor` will be copied to the same index of :attr:`self`. The result + is nondeterministic since it depends on which copy occurs last. + + Args: + dim (int): dimension along which to index + index (LongTensor): indices of :attr:`tensor` to select from + tensor (Tensor): the tensor containing values to copy + + Example:: + + >>> x = torch.zeros(5, 3) + >>> t = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=torch.float) + >>> index = torch.tensor([0, 4, 2]) + >>> x.index_copy_(0, index, t) + tensor([[ 1., 2., 3.], + [ 0., 0., 0.], + [ 7., 8., 9.], + [ 0., 0., 0.], + [ 4., 5., 6.]]) + """ + ... + @overload + def index_fill(self, dim: _int, index: Tensor, value: Tensor) -> Tensor: + r""" + index_fill(dim, index, value) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.index_fill_`. + """ + ... + @overload + def index_fill(self, dim: Union[str, ellipsis, None], index: Tensor, value: Tensor) -> Tensor: + r""" + index_fill(dim, index, value) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.index_fill_`. + """ + ... + @overload + def index_fill(self, dim: _int, index: Tensor, value: Union[Number, _complex]) -> Tensor: + r""" + index_fill(dim, index, value) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.index_fill_`. + """ + ... + @overload + def index_fill(self, dim: Union[str, ellipsis, None], index: Tensor, value: Union[Number, _complex]) -> Tensor: + r""" + index_fill(dim, index, value) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.index_fill_`. + """ + ... + @overload + def index_fill_(self, dim: _int, index: Tensor, value: Tensor) -> Tensor: + r""" + index_fill_(dim, index, value) -> Tensor + + Fills the elements of the :attr:`self` tensor with value :attr:`value` by + selecting the indices in the order given in :attr:`index`. + + Args: + dim (int): dimension along which to index + index (LongTensor): indices of :attr:`self` tensor to fill in + value (float): the value to fill with + + Example:: + >>> x = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=torch.float) + >>> index = torch.tensor([0, 2]) + >>> x.index_fill_(1, index, -1) + tensor([[-1., 2., -1.], + [-1., 5., -1.], + [-1., 8., -1.]]) + """ + ... + @overload + def index_fill_(self, dim: Union[str, ellipsis, None], index: Tensor, value: Tensor) -> Tensor: + r""" + index_fill_(dim, index, value) -> Tensor + + Fills the elements of the :attr:`self` tensor with value :attr:`value` by + selecting the indices in the order given in :attr:`index`. + + Args: + dim (int): dimension along which to index + index (LongTensor): indices of :attr:`self` tensor to fill in + value (float): the value to fill with + + Example:: + >>> x = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=torch.float) + >>> index = torch.tensor([0, 2]) + >>> x.index_fill_(1, index, -1) + tensor([[-1., 2., -1.], + [-1., 5., -1.], + [-1., 8., -1.]]) + """ + ... + @overload + def index_fill_(self, dim: _int, index: Tensor, value: Union[Number, _complex]) -> Tensor: + r""" + index_fill_(dim, index, value) -> Tensor + + Fills the elements of the :attr:`self` tensor with value :attr:`value` by + selecting the indices in the order given in :attr:`index`. + + Args: + dim (int): dimension along which to index + index (LongTensor): indices of :attr:`self` tensor to fill in + value (float): the value to fill with + + Example:: + >>> x = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=torch.float) + >>> index = torch.tensor([0, 2]) + >>> x.index_fill_(1, index, -1) + tensor([[-1., 2., -1.], + [-1., 5., -1.], + [-1., 8., -1.]]) + """ + ... + @overload + def index_fill_(self, dim: Union[str, ellipsis, None], index: Tensor, value: Union[Number, _complex]) -> Tensor: + r""" + index_fill_(dim, index, value) -> Tensor + + Fills the elements of the :attr:`self` tensor with value :attr:`value` by + selecting the indices in the order given in :attr:`index`. + + Args: + dim (int): dimension along which to index + index (LongTensor): indices of :attr:`self` tensor to fill in + value (float): the value to fill with + + Example:: + >>> x = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=torch.float) + >>> index = torch.tensor([0, 2]) + >>> x.index_fill_(1, index, -1) + tensor([[-1., 2., -1.], + [-1., 5., -1.], + [-1., 8., -1.]]) + """ + ... + def index_put(self, indices: Optional[Union[Tuple[Tensor, ...], List[Tensor]]], values: Tensor, accumulate: _bool = False) -> Tensor: + r""" + index_put(indices, values, accumulate=False) -> Tensor + + Out-place version of :meth:`~Tensor.index_put_`. + """ + ... + def index_put_(self, indices: Optional[Union[Tuple[Tensor, ...], List[Tensor]]], values: Tensor, accumulate: _bool = False) -> Tensor: + r""" + index_put_(indices, values, accumulate=False) -> Tensor + + Puts values from the tensor :attr:`values` into the tensor :attr:`self` using + the indices specified in :attr:`indices` (which is a tuple of Tensors). The + expression ``tensor.index_put_(indices, values)`` is equivalent to + ``tensor[indices] = values``. Returns :attr:`self`. + + If :attr:`accumulate` is ``True``, the elements in :attr:`values` are added to + :attr:`self`. If accumulate is ``False``, the behavior is undefined if indices + contain duplicate elements. + + Args: + indices (tuple of LongTensor): tensors used to index into `self`. + values (Tensor): tensor of same dtype as `self`. + accumulate (bool): whether to accumulate into self + """ + ... + def index_reduce(self, dim: _int, index: Tensor, source: Tensor, reduce: str, *, include_self: _bool = True) -> Tensor: ... + def index_reduce_(self, dim: _int, index: Tensor, source: Tensor, reduce: str, *, include_self: _bool = True) -> Tensor: + r""" + index_reduce_(dim, index, source, reduce, *, include_self=True) -> Tensor + + Accumulate the elements of ``source`` into the :attr:`self` + tensor by accumulating to the indices in the order given in :attr:`index` + using the reduction given by the ``reduce`` argument. For example, if ``dim == 0``, + ``index[i] == j``, ``reduce == prod`` and ``include_self == True`` then the ``i``\ th + row of ``source`` is multiplied by the ``j``\ th row of :attr:`self`. If + :obj:`include_self="True"`, the values in the :attr:`self` tensor are included + in the reduction, otherwise, rows in the :attr:`self` tensor that are accumulated + to are treated as if they were filled with the reduction identites. + + The :attr:`dim`\ th dimension of ``source`` must have the same size as the + length of :attr:`index` (which must be a vector), and all other dimensions must + match :attr:`self`, or an error will be raised. + + For a 3-D tensor with :obj:`reduce="prod"` and :obj:`include_self=True` the + output is given as:: + + self[index[i], :, :] *= src[i, :, :] # if dim == 0 + self[:, index[i], :] *= src[:, i, :] # if dim == 1 + self[:, :, index[i]] *= src[:, :, i] # if dim == 2 + + Note: + This operation may behave nondeterministically when given tensors on a CUDA device. See :doc:`/notes/randomness` for more information. + + .. note:: + + This function only supports floating point tensors. + + .. warning:: + + This function is in beta and may change in the near future. + + Args: + dim (int): dimension along which to index + index (Tensor): indices of ``source`` to select from, + should have dtype either `torch.int64` or `torch.int32` + source (FloatTensor): the tensor containing values to accumulate + reduce (str): the reduction operation to apply + (:obj:`"prod"`, :obj:`"mean"`, :obj:`"amax"`, :obj:`"amin"`) + + Keyword args: + include_self (bool): whether the elements from the ``self`` tensor are + included in the reduction + + Example:: + + >>> x = torch.empty(5, 3).fill_(2) + >>> t = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]], dtype=torch.float) + >>> index = torch.tensor([0, 4, 2, 0]) + >>> x.index_reduce_(0, index, t, 'prod') + tensor([[20., 44., 72.], + [ 2., 2., 2.], + [14., 16., 18.], + [ 2., 2., 2.], + [ 8., 10., 12.]]) + >>> x = torch.empty(5, 3).fill_(2) + >>> x.index_reduce_(0, index, t, 'prod', include_self=False) + tensor([[10., 22., 36.], + [ 2., 2., 2.], + [ 7., 8., 9.], + [ 2., 2., 2.], + [ 4., 5., 6.]]) + """ + ... + @overload + def index_select(self, dim: _int, index: Tensor) -> Tensor: + r""" + index_select(dim, index) -> Tensor + + See :func:`torch.index_select` + """ + ... + @overload + def index_select(self, dim: Union[str, ellipsis, None], index: Tensor) -> Tensor: + r""" + index_select(dim, index) -> Tensor + + See :func:`torch.index_select` + """ + ... + def indices(self) -> Tensor: + r""" + indices() -> Tensor + + Return the indices tensor of a :ref:`sparse COO tensor `. + + .. warning:: + Throws an error if :attr:`self` is not a sparse COO tensor. + + See also :meth:`Tensor.values`. + + .. note:: + This method can only be called on a coalesced sparse tensor. See + :meth:`Tensor.coalesce` for details. + """ + ... + def inner(self, other: Tensor) -> Tensor: + r""" + inner(other) -> Tensor + + See :func:`torch.inner`. + """ + ... + def int(self) -> Tensor: + r""" + int(memory_format=torch.preserve_format) -> Tensor + + ``self.int()`` is equivalent to ``self.to(torch.int32)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + def int_repr(self) -> Tensor: + r""" + int_repr() -> Tensor + + Given a quantized Tensor, + ``self.int_repr()`` returns a CPU Tensor with uint8_t as data type that stores the + underlying uint8_t values of the given Tensor. + """ + ... + def inverse(self) -> Tensor: + r""" + inverse() -> Tensor + + See :func:`torch.inverse` + """ + ... + def is_coalesced(self) -> _bool: + r""" + is_coalesced() -> bool + + Returns ``True`` if :attr:`self` is a :ref:`sparse COO tensor + ` that is coalesced, ``False`` otherwise. + + .. warning:: + Throws an error if :attr:`self` is not a sparse COO tensor. + + See :meth:`coalesce` and :ref:`uncoalesced tensors `. + """ + ... + def is_complex(self) -> _bool: + r""" + is_complex() -> bool + + Returns True if the data type of :attr:`self` is a complex data type. + """ + ... + def is_conj(self) -> _bool: + r""" + is_conj() -> bool + + Returns True if the conjugate bit of :attr:`self` is set to true. + """ + ... + def is_contiguous(self, memory_format=torch.contiguous_format) -> _bool: + r""" + is_contiguous(memory_format=torch.contiguous_format) -> bool + + Returns True if :attr:`self` tensor is contiguous in memory in the order specified + by memory format. + + Args: + memory_format (:class:`torch.memory_format`, optional): Specifies memory allocation + order. Default: ``torch.contiguous_format``. + """ + ... + is_cpu: _bool + r"""Is ``True`` if the Tensor is stored on the CPU, ``False`` otherwise.""" + is_cuda: _bool + r"""Is ``True`` if the Tensor is stored on the GPU, ``False`` otherwise.""" + def is_distributed(self) -> _bool: ... + def is_floating_point(self) -> _bool: + r""" + is_floating_point() -> bool + + Returns True if the data type of :attr:`self` is a floating point data type. + """ + ... + def is_inference(self) -> _bool: + r""" + is_inference() -> bool + + See :func:`torch.is_inference` + """ + ... + is_ipu: _bool + r"""Is ``True`` if the Tensor is stored on the IPU, ``False`` otherwise.""" + is_leaf: _bool + r"""All Tensors that have :attr:`requires_grad` which is ``False`` will be leaf Tensors by convention. + + For Tensors that have :attr:`requires_grad` which is ``True``, they will be leaf Tensors if they were + created by the user. This means that they are not the result of an operation and so + :attr:`grad_fn` is None. + + Only leaf Tensors will have their :attr:`grad` populated during a call to :func:`backward`. + To get :attr:`grad` populated for non-leaf Tensors, you can use :func:`retain_grad`. + + Example:: + + >>> a = torch.rand(10, requires_grad=True) + >>> a.is_leaf + True + >>> b = torch.rand(10, requires_grad=True).cuda() + >>> b.is_leaf + False + # b was created by the operation that cast a cpu Tensor into a cuda Tensor + >>> c = torch.rand(10, requires_grad=True) + 2 + >>> c.is_leaf + False + # c was created by the addition operation + >>> d = torch.rand(10).cuda() + >>> d.is_leaf + True + # d does not require gradients and so has no operation creating it (that is tracked by the autograd engine) + >>> e = torch.rand(10).cuda().requires_grad_() + >>> e.is_leaf + True + # e requires gradients and has no operations creating it + >>> f = torch.rand(10, requires_grad=True, device="cuda") + >>> f.is_leaf + True + # f requires grad, has no operation creating it""" + is_meta: _bool + r"""Is ``True`` if the Tensor is a meta tensor, ``False`` otherwise. Meta tensors + are like normal tensors, but they carry no data.""" + is_mkldnn: _bool + is_mps: _bool + r"""Is ``True`` if the Tensor is stored on the MPS device, ``False`` otherwise.""" + is_mtia: _bool + def is_neg(self) -> _bool: + r""" + is_neg() -> bool + + Returns True if the negative bit of :attr:`self` is set to true. + """ + ... + is_nested: _bool + def is_nonzero(self) -> _bool: ... + is_ort: _bool + def is_pinned(self, device: Optional[Optional[DeviceLikeType]] = None) -> _bool: + r""" + Returns true if this tensor resides in pinned memory. + """ + ... + is_quantized: _bool + r"""Is ``True`` if the Tensor is quantized, ``False`` otherwise.""" + def is_same_size(self, other: Tensor) -> _bool: ... + def is_set_to(self, tensor: Tensor) -> _bool: + r""" + is_set_to(tensor) -> bool + + Returns True if both tensors are pointing to the exact same memory (same + storage, offset, size and stride). + """ + ... + def is_signed(self) -> _bool: + r""" + is_signed() -> bool + + Returns True if the data type of :attr:`self` is a signed data type. + """ + ... + is_sparse: _bool + r"""Is ``True`` if the Tensor uses sparse COO storage layout, ``False`` otherwise.""" + is_sparse_csr: _bool + r"""Is ``True`` if the Tensor uses sparse CSR storage layout, ``False`` otherwise.""" + is_vulkan: _bool + def isclose(self, other: Tensor, rtol: _float = 1e-05, atol: _float = 1e-08, equal_nan: _bool = False) -> Tensor: + r""" + isclose(other, rtol=1e-05, atol=1e-08, equal_nan=False) -> Tensor + + See :func:`torch.isclose` + """ + ... + def isfinite(self) -> Tensor: + r""" + isfinite() -> Tensor + + See :func:`torch.isfinite` + """ + ... + def isinf(self) -> Tensor: + r""" + isinf() -> Tensor + + See :func:`torch.isinf` + """ + ... + def isnan(self) -> Tensor: + r""" + isnan() -> Tensor + + See :func:`torch.isnan` + """ + ... + def isneginf(self) -> Tensor: + r""" + isneginf() -> Tensor + + See :func:`torch.isneginf` + """ + ... + def isposinf(self) -> Tensor: + r""" + isposinf() -> Tensor + + See :func:`torch.isposinf` + """ + ... + def isreal(self) -> Tensor: + r""" + isreal() -> Tensor + + See :func:`torch.isreal` + """ + ... + def istft(self, n_fft: _int, hop_length: Optional[_int] = None, win_length: Optional[_int] = None, window: Optional[Tensor] = None, center: _bool = True, normalized: _bool = False, onesided: Optional[_bool] = None, length: Optional[_int] = None, return_complex: _bool = False) -> Tensor: + r""" + istft(n_fft, hop_length=None, win_length=None, window=None, + center=True, normalized=False, onesided=True, length=None) -> Tensor + + See :func:`torch.istft` + """ + ... + def item(self) -> Number: + r""" + item() -> number + + Returns the value of this tensor as a standard Python number. This only works + for tensors with one element. For other cases, see :meth:`~Tensor.tolist`. + + This operation is not differentiable. + + Example:: + + >>> x = torch.tensor([1.0]) + >>> x.item() + 1.0 + """ + ... + def kron(self, other: Tensor) -> Tensor: + r""" + kron(other) -> Tensor + + See :func:`torch.kron` + """ + ... + @overload + def kthvalue(self, k: _int, dim: _int = -1, keepdim: _bool = False) -> torch.return_types.kthvalue: + r""" + kthvalue(k, dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.kthvalue` + """ + ... + @overload + def kthvalue(self, k: _int, dim: Union[str, ellipsis, None], keepdim: _bool = False) -> torch.return_types.kthvalue: + r""" + kthvalue(k, dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.kthvalue` + """ + ... + def lcm(self, other: Tensor) -> Tensor: + r""" + lcm(other) -> Tensor + + See :func:`torch.lcm` + """ + ... + def lcm_(self, other: Tensor) -> Tensor: + r""" + lcm_(other) -> Tensor + + In-place version of :meth:`~Tensor.lcm` + """ + ... + def ldexp(self, other: Tensor) -> Tensor: + r""" + ldexp(other) -> Tensor + + See :func:`torch.ldexp` + """ + ... + def ldexp_(self, other: Tensor) -> Tensor: + r""" + ldexp_(other) -> Tensor + + In-place version of :meth:`~Tensor.ldexp` + """ + ... + @overload + def le(self, other: Tensor) -> Tensor: + r""" + le(other) -> Tensor + + See :func:`torch.le`. + """ + ... + @overload + def le(self, other: Union[Number, _complex]) -> Tensor: + r""" + le(other) -> Tensor + + See :func:`torch.le`. + """ + ... + @overload + def le_(self, other: Tensor) -> Tensor: + r""" + le_(other) -> Tensor + + In-place version of :meth:`~Tensor.le`. + """ + ... + @overload + def le_(self, other: Union[Number, _complex]) -> Tensor: + r""" + le_(other) -> Tensor + + In-place version of :meth:`~Tensor.le`. + """ + ... + @overload + def lerp(self, end: Tensor, weight: Tensor) -> Tensor: + r""" + lerp(end, weight) -> Tensor + + See :func:`torch.lerp` + """ + ... + @overload + def lerp(self, end: Tensor, weight: Union[Number, _complex]) -> Tensor: + r""" + lerp(end, weight) -> Tensor + + See :func:`torch.lerp` + """ + ... + @overload + def lerp_(self, end: Tensor, weight: Tensor) -> Tensor: + r""" + lerp_(end, weight) -> Tensor + + In-place version of :meth:`~Tensor.lerp` + """ + ... + @overload + def lerp_(self, end: Tensor, weight: Union[Number, _complex]) -> Tensor: + r""" + lerp_(end, weight) -> Tensor + + In-place version of :meth:`~Tensor.lerp` + """ + ... + @overload + def less(self, other: Tensor) -> Tensor: + r""" + lt(other) -> Tensor + + See :func:`torch.less`. + """ + ... + @overload + def less(self, other: Union[Number, _complex]) -> Tensor: + r""" + lt(other) -> Tensor + + See :func:`torch.less`. + """ + ... + @overload + def less_(self, other: Tensor) -> Tensor: + r""" + less_(other) -> Tensor + + In-place version of :meth:`~Tensor.less`. + """ + ... + @overload + def less_(self, other: Union[Number, _complex]) -> Tensor: + r""" + less_(other) -> Tensor + + In-place version of :meth:`~Tensor.less`. + """ + ... + @overload + def less_equal(self, other: Tensor) -> Tensor: + r""" + less_equal(other) -> Tensor + + See :func:`torch.less_equal`. + """ + ... + @overload + def less_equal(self, other: Union[Number, _complex]) -> Tensor: + r""" + less_equal(other) -> Tensor + + See :func:`torch.less_equal`. + """ + ... + @overload + def less_equal_(self, other: Tensor) -> Tensor: + r""" + less_equal_(other) -> Tensor + + In-place version of :meth:`~Tensor.less_equal`. + """ + ... + @overload + def less_equal_(self, other: Union[Number, _complex]) -> Tensor: + r""" + less_equal_(other) -> Tensor + + In-place version of :meth:`~Tensor.less_equal`. + """ + ... + def lgamma(self) -> Tensor: + r""" + lgamma() -> Tensor + + See :func:`torch.lgamma` + """ + ... + def lgamma_(self) -> Tensor: + r""" + lgamma_() -> Tensor + + In-place version of :meth:`~Tensor.lgamma` + """ + ... + def log(self) -> Tensor: + r""" + log() -> Tensor + + See :func:`torch.log` + """ + ... + def log10(self) -> Tensor: + r""" + log10() -> Tensor + + See :func:`torch.log10` + """ + ... + def log10_(self) -> Tensor: + r""" + log10_() -> Tensor + + In-place version of :meth:`~Tensor.log10` + """ + ... + def log1p(self) -> Tensor: + r""" + log1p() -> Tensor + + See :func:`torch.log1p` + """ + ... + def log1p_(self) -> Tensor: + r""" + log1p_() -> Tensor + + In-place version of :meth:`~Tensor.log1p` + """ + ... + def log2(self) -> Tensor: + r""" + log2() -> Tensor + + See :func:`torch.log2` + """ + ... + def log2_(self) -> Tensor: + r""" + log2_() -> Tensor + + In-place version of :meth:`~Tensor.log2` + """ + ... + def log_(self) -> Tensor: + r""" + log_() -> Tensor + + In-place version of :meth:`~Tensor.log` + """ + ... + def log_normal_(self, mean: _float = 1, std: _float = 2, *, generator: Optional[Generator] = None) -> Tensor: + r""" + log_normal_(mean=1, std=2, *, generator=None) + + Fills :attr:`self` tensor with numbers samples from the log-normal distribution + parameterized by the given mean :math:`\mu` and standard deviation + :math:`\sigma`. Note that :attr:`mean` and :attr:`std` are the mean and + standard deviation of the underlying normal distribution, and not of the + returned distribution: + + .. math:: + + f(x) = \dfrac{1}{x \sigma \sqrt{2\pi}}\ e^{-\frac{(\ln x - \mu)^2}{2\sigma^2}} + """ + ... + @overload + def log_softmax(self, dim: _int, dtype: Optional[_dtype] = None) -> Tensor: ... + @overload + def log_softmax(self, dim: Union[str, ellipsis, None], *, dtype: Optional[_dtype] = None) -> Tensor: ... + def logaddexp(self, other: Tensor) -> Tensor: + r""" + logaddexp(other) -> Tensor + + See :func:`torch.logaddexp` + """ + ... + def logaddexp2(self, other: Tensor) -> Tensor: + r""" + logaddexp2(other) -> Tensor + + See :func:`torch.logaddexp2` + """ + ... + @overload + def logcumsumexp(self, dim: _int) -> Tensor: + r""" + logcumsumexp(dim) -> Tensor + + See :func:`torch.logcumsumexp` + """ + ... + @overload + def logcumsumexp(self, dim: Union[str, ellipsis, None]) -> Tensor: + r""" + logcumsumexp(dim) -> Tensor + + See :func:`torch.logcumsumexp` + """ + ... + def logdet(self) -> Tensor: + r""" + logdet() -> Tensor + + See :func:`torch.logdet` + """ + ... + def logical_and(self, other: Tensor) -> Tensor: + r""" + logical_and() -> Tensor + + See :func:`torch.logical_and` + """ + ... + def logical_and_(self, other: Tensor) -> Tensor: + r""" + logical_and_() -> Tensor + + In-place version of :meth:`~Tensor.logical_and` + """ + ... + def logical_not(self) -> Tensor: + r""" + logical_not() -> Tensor + + See :func:`torch.logical_not` + """ + ... + def logical_not_(self) -> Tensor: + r""" + logical_not_() -> Tensor + + In-place version of :meth:`~Tensor.logical_not` + """ + ... + def logical_or(self, other: Tensor) -> Tensor: + r""" + logical_or() -> Tensor + + See :func:`torch.logical_or` + """ + ... + def logical_or_(self, other: Tensor) -> Tensor: + r""" + logical_or_() -> Tensor + + In-place version of :meth:`~Tensor.logical_or` + """ + ... + def logical_xor(self, other: Tensor) -> Tensor: + r""" + logical_xor() -> Tensor + + See :func:`torch.logical_xor` + """ + ... + def logical_xor_(self, other: Tensor) -> Tensor: + r""" + logical_xor_() -> Tensor + + In-place version of :meth:`~Tensor.logical_xor` + """ + ... + def logit(self, eps: Optional[_float] = None) -> Tensor: + r""" + logit() -> Tensor + + See :func:`torch.logit` + """ + ... + def logit_(self, eps: Optional[_float] = None) -> Tensor: + r""" + logit_() -> Tensor + + In-place version of :meth:`~Tensor.logit` + """ + ... + @overload + def logsumexp(self, dim: Union[_int, _size], keepdim: _bool = False) -> Tensor: + r""" + logsumexp(dim, keepdim=False) -> Tensor + + See :func:`torch.logsumexp` + """ + ... + @overload + def logsumexp(self, dim: Sequence[Union[str, ellipsis, None]], keepdim: _bool = False) -> Tensor: + r""" + logsumexp(dim, keepdim=False) -> Tensor + + See :func:`torch.logsumexp` + """ + ... + def long(self) -> Tensor: + r""" + long(memory_format=torch.preserve_format) -> Tensor + + ``self.long()`` is equivalent to ``self.to(torch.int64)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + @overload + def lt(self, other: Tensor) -> Tensor: + r""" + lt(other) -> Tensor + + See :func:`torch.lt`. + """ + ... + @overload + def lt(self, other: Union[Number, _complex]) -> Tensor: + r""" + lt(other) -> Tensor + + See :func:`torch.lt`. + """ + ... + @overload + def lt_(self, other: Tensor) -> Tensor: + r""" + lt_(other) -> Tensor + + In-place version of :meth:`~Tensor.lt`. + """ + ... + @overload + def lt_(self, other: Union[Number, _complex]) -> Tensor: + r""" + lt_(other) -> Tensor + + In-place version of :meth:`~Tensor.lt`. + """ + ... + def lu_solve(self, LU_data: Tensor, LU_pivots: Tensor) -> Tensor: + r""" + lu_solve(LU_data, LU_pivots) -> Tensor + + See :func:`torch.lu_solve` + """ + ... + def map2_(self, x: Tensor, y: Tensor, callable: Callable) -> Tensor: ... + def map_(self, tensor: Tensor, callable: Callable) -> Tensor: + r""" + map_(tensor, callable) + + Applies :attr:`callable` for each element in :attr:`self` tensor and the given + :attr:`tensor` and stores the results in :attr:`self` tensor. :attr:`self` tensor and + the given :attr:`tensor` must be :ref:`broadcastable `. + + The :attr:`callable` should have the signature:: + + def callable(a, b) -> number + """ + ... + @overload + def masked_fill(self, mask: Tensor, value: Tensor) -> Tensor: + r""" + masked_fill(mask, value) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.masked_fill_` + """ + ... + @overload + def masked_fill(self, mask: Tensor, value: Union[Number, _complex]) -> Tensor: + r""" + masked_fill(mask, value) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.masked_fill_` + """ + ... + @overload + def masked_fill_(self, mask: Tensor, value: Tensor) -> Tensor: + r""" + masked_fill_(mask, value) + + Fills elements of :attr:`self` tensor with :attr:`value` where :attr:`mask` is + True. The shape of :attr:`mask` must be + :ref:`broadcastable ` with the shape of the underlying + tensor. + + Args: + mask (BoolTensor): the boolean mask + value (float): the value to fill in with + """ + ... + @overload + def masked_fill_(self, mask: Tensor, value: Union[Number, _complex]) -> Tensor: + r""" + masked_fill_(mask, value) + + Fills elements of :attr:`self` tensor with :attr:`value` where :attr:`mask` is + True. The shape of :attr:`mask` must be + :ref:`broadcastable ` with the shape of the underlying + tensor. + + Args: + mask (BoolTensor): the boolean mask + value (float): the value to fill in with + """ + ... + def masked_scatter(self, mask: Tensor, source: Tensor) -> Tensor: + r""" + masked_scatter(mask, tensor) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.masked_scatter_` + + .. note:: + + The inputs :attr:`self` and :attr:`mask` + :ref:`broadcast `. + + Example: + + >>> self = torch.tensor([0, 0, 0, 0, 0]) + >>> mask = torch.tensor([[0, 0, 0, 1, 1], [1, 1, 0, 1, 1]]) + >>> source = torch.tensor([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) + >>> self.masked_scatter(mask, source) + tensor([[0, 0, 0, 0, 1], + [2, 3, 0, 4, 5]]) + """ + ... + def masked_scatter_(self, mask: Tensor, source: Tensor) -> Tensor: + r""" + masked_scatter_(mask, source) + + Copies elements from :attr:`source` into :attr:`self` tensor at positions where + the :attr:`mask` is True. Elements from :attr:`source` are copied into :attr:`self` + starting at position 0 of :attr:`source` and continuing in order one-by-one for each + occurrence of :attr:`mask` being True. + The shape of :attr:`mask` must be :ref:`broadcastable ` + with the shape of the underlying tensor. The :attr:`source` should have at least + as many elements as the number of ones in :attr:`mask`. + + Args: + mask (BoolTensor): the boolean mask + source (Tensor): the tensor to copy from + + .. note:: + + The :attr:`mask` operates on the :attr:`self` tensor, not on the given + :attr:`source` tensor. + + Example: + + >>> self = torch.tensor([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]) + >>> mask = torch.tensor([[0, 0, 0, 1, 1], [1, 1, 0, 1, 1]]) + >>> source = torch.tensor([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) + >>> self.masked_scatter_(mask, source) + tensor([[0, 0, 0, 0, 1], + [2, 3, 0, 4, 5]]) + """ + ... + def masked_select(self, mask: Tensor) -> Tensor: + r""" + masked_select(mask) -> Tensor + + See :func:`torch.masked_select` + """ + ... + def matmul(self, other: Tensor) -> Tensor: + r""" + matmul(tensor2) -> Tensor + + See :func:`torch.matmul` + """ + ... + def matrix_exp(self) -> Tensor: + r""" + matrix_exp() -> Tensor + + See :func:`torch.matrix_exp` + """ + ... + def matrix_power(self, n: _int) -> Tensor: + r""" + matrix_power(n) -> Tensor + + .. note:: :meth:`~Tensor.matrix_power` is deprecated, use :func:`torch.linalg.matrix_power` instead. + + Alias for :func:`torch.linalg.matrix_power` + """ + ... + @overload + def max(self) -> Tensor: + r""" + max(dim=None, keepdim=False) -> Tensor or (Tensor, Tensor) + + See :func:`torch.max` + """ + ... + @overload + def max(self, other: Tensor) -> Tensor: + r""" + max(dim=None, keepdim=False) -> Tensor or (Tensor, Tensor) + + See :func:`torch.max` + """ + ... + @overload + def max(self, dim: _int, keepdim: _bool = False) -> torch.return_types.max: + r""" + max(dim=None, keepdim=False) -> Tensor or (Tensor, Tensor) + + See :func:`torch.max` + """ + ... + @overload + def max(self, dim: Union[str, ellipsis, None], keepdim: _bool = False) -> torch.return_types.max: + r""" + max(dim=None, keepdim=False) -> Tensor or (Tensor, Tensor) + + See :func:`torch.max` + """ + ... + def maximum(self, other: Tensor) -> Tensor: + r""" + maximum(other) -> Tensor + + See :func:`torch.maximum` + """ + ... + @overload + def mean(self, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + mean(dim=None, keepdim=False, *, dtype=None) -> Tensor + + See :func:`torch.mean` + """ + ... + @overload + def mean(self, dim: Optional[Union[_int, _size]], keepdim: _bool = False, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + mean(dim=None, keepdim=False, *, dtype=None) -> Tensor + + See :func:`torch.mean` + """ + ... + @overload + def mean(self, dim: Sequence[Union[str, ellipsis, None]], keepdim: _bool = False, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + mean(dim=None, keepdim=False, *, dtype=None) -> Tensor + + See :func:`torch.mean` + """ + ... + @overload + def median(self) -> Tensor: + r""" + median(dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.median` + """ + ... + @overload + def median(self, dim: _int, keepdim: _bool = False) -> torch.return_types.median: + r""" + median(dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.median` + """ + ... + @overload + def median(self, dim: Union[str, ellipsis, None], keepdim: _bool = False) -> torch.return_types.median: + r""" + median(dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.median` + """ + ... + @overload + def min(self) -> Tensor: + r""" + min(dim=None, keepdim=False) -> Tensor or (Tensor, Tensor) + + See :func:`torch.min` + """ + ... + @overload + def min(self, other: Tensor) -> Tensor: + r""" + min(dim=None, keepdim=False) -> Tensor or (Tensor, Tensor) + + See :func:`torch.min` + """ + ... + @overload + def min(self, dim: _int, keepdim: _bool = False) -> torch.return_types.min: + r""" + min(dim=None, keepdim=False) -> Tensor or (Tensor, Tensor) + + See :func:`torch.min` + """ + ... + @overload + def min(self, dim: Union[str, ellipsis, None], keepdim: _bool = False) -> torch.return_types.min: + r""" + min(dim=None, keepdim=False) -> Tensor or (Tensor, Tensor) + + See :func:`torch.min` + """ + ... + def minimum(self, other: Tensor) -> Tensor: + r""" + minimum(other) -> Tensor + + See :func:`torch.minimum` + """ + ... + def mm(self, mat2: Tensor) -> Tensor: + r""" + mm(mat2) -> Tensor + + See :func:`torch.mm` + """ + ... + @overload + def mode(self, dim: _int = -1, keepdim: _bool = False) -> torch.return_types.mode: + r""" + mode(dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.mode` + """ + ... + @overload + def mode(self, dim: Union[str, ellipsis, None], keepdim: _bool = False) -> torch.return_types.mode: + r""" + mode(dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.mode` + """ + ... + @overload + def moveaxis(self, source: _int, destination: _int) -> Tensor: + r""" + moveaxis(source, destination) -> Tensor + + See :func:`torch.moveaxis` + """ + ... + @overload + def moveaxis(self, source: _size, destination: _size) -> Tensor: + r""" + moveaxis(source, destination) -> Tensor + + See :func:`torch.moveaxis` + """ + ... + @overload + def movedim(self, source: _int, destination: _int) -> Tensor: + r""" + movedim(source, destination) -> Tensor + + See :func:`torch.movedim` + """ + ... + @overload + def movedim(self, source: _size, destination: _size) -> Tensor: + r""" + movedim(source, destination) -> Tensor + + See :func:`torch.movedim` + """ + ... + def msort(self) -> Tensor: + r""" + msort() -> Tensor + + See :func:`torch.msort` + """ + ... + def mul(self, other: Union[Tensor, Number, _complex, torch.SymInt, torch.SymFloat], *, out: Optional[Tensor] = None) -> Tensor: + r""" + mul(value) -> Tensor + + See :func:`torch.mul`. + """ + ... + def mul_(self, other: Union[Tensor, Number, _complex, torch.SymInt, torch.SymFloat]) -> Tensor: + r""" + mul_(value) -> Tensor + + In-place version of :meth:`~Tensor.mul`. + """ + ... + def multinomial(self, num_samples: _int, replacement: _bool = False, *, generator: Optional[Generator] = None) -> Tensor: + r""" + multinomial(num_samples, replacement=False, *, generator=None) -> Tensor + + See :func:`torch.multinomial` + """ + ... + @overload + def multiply(self, other: Tensor) -> Tensor: + r""" + multiply(value) -> Tensor + + See :func:`torch.multiply`. + """ + ... + @overload + def multiply(self, other: Union[Number, _complex]) -> Tensor: + r""" + multiply(value) -> Tensor + + See :func:`torch.multiply`. + """ + ... + @overload + def multiply_(self, other: Tensor) -> Tensor: + r""" + multiply_(value) -> Tensor + + In-place version of :meth:`~Tensor.multiply`. + """ + ... + @overload + def multiply_(self, other: Union[Number, _complex]) -> Tensor: + r""" + multiply_(value) -> Tensor + + In-place version of :meth:`~Tensor.multiply`. + """ + ... + def mv(self, vec: Tensor) -> Tensor: + r""" + mv(vec) -> Tensor + + See :func:`torch.mv` + """ + ... + def mvlgamma(self, p: _int) -> Tensor: + r""" + mvlgamma(p) -> Tensor + + See :func:`torch.mvlgamma` + """ + ... + def mvlgamma_(self, p: _int) -> Tensor: + r""" + mvlgamma_(p) -> Tensor + + In-place version of :meth:`~Tensor.mvlgamma` + """ + ... + def nan_to_num(self, nan: Optional[_float] = None, posinf: Optional[_float] = None, neginf: Optional[_float] = None) -> Tensor: + r""" + nan_to_num(nan=0.0, posinf=None, neginf=None) -> Tensor + + See :func:`torch.nan_to_num`. + """ + ... + def nan_to_num_(self, nan: Optional[_float] = None, posinf: Optional[_float] = None, neginf: Optional[_float] = None) -> Tensor: + r""" + nan_to_num_(nan=0.0, posinf=None, neginf=None) -> Tensor + + In-place version of :meth:`~Tensor.nan_to_num`. + """ + ... + def nanmean(self, dim: Optional[Union[_int, _size]] = None, keepdim: _bool = False, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + nanmean(dim=None, keepdim=False, *, dtype=None) -> Tensor + + See :func:`torch.nanmean` + """ + ... + @overload + def nanmedian(self) -> Tensor: + r""" + nanmedian(dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.nanmedian` + """ + ... + @overload + def nanmedian(self, dim: _int, keepdim: _bool = False) -> torch.return_types.nanmedian: + r""" + nanmedian(dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.nanmedian` + """ + ... + @overload + def nanmedian(self, dim: Union[str, ellipsis, None], keepdim: _bool = False) -> torch.return_types.nanmedian: + r""" + nanmedian(dim=None, keepdim=False) -> (Tensor, LongTensor) + + See :func:`torch.nanmedian` + """ + ... + @overload + def nanquantile(self, q: Tensor, dim: Optional[_int] = None, keepdim: _bool = False, *, interpolation: str = "linear") -> Tensor: + r""" + nanquantile(q, dim=None, keepdim=False, *, interpolation='linear') -> Tensor + + See :func:`torch.nanquantile` + """ + ... + @overload + def nanquantile(self, q: _float, dim: Optional[_int] = None, keepdim: _bool = False, *, interpolation: str = "linear") -> Tensor: + r""" + nanquantile(q, dim=None, keepdim=False, *, interpolation='linear') -> Tensor + + See :func:`torch.nanquantile` + """ + ... + def nansum(self, dim: Optional[Union[_int, _size]] = None, keepdim: _bool = False, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + nansum(dim=None, keepdim=False, dtype=None) -> Tensor + + See :func:`torch.nansum` + """ + ... + @overload + def narrow(self, dim: _int, start: Tensor, length: Union[_int, SymInt]) -> Tensor: + r""" + narrow(dimension, start, length) -> Tensor + + See :func:`torch.narrow`. + """ + ... + @overload + def narrow(self, dim: _int, start: Union[_int, SymInt], length: Union[_int, SymInt]) -> Tensor: + r""" + narrow(dimension, start, length) -> Tensor + + See :func:`torch.narrow`. + """ + ... + def narrow_copy(self, dim: _int, start: Union[_int, SymInt], length: Union[_int, SymInt]) -> Tensor: + r""" + narrow_copy(dimension, start, length) -> Tensor + + See :func:`torch.narrow_copy`. + """ + ... + def ndimension(self) -> _int: + r""" + ndimension() -> int + + Alias for :meth:`~Tensor.dim()` + """ + ... + @overload + def ne(self, other: Tensor) -> Tensor: + r""" + ne(other) -> Tensor + + See :func:`torch.ne`. + """ + ... + @overload + def ne(self, other: Union[Number, _complex]) -> Tensor: + r""" + ne(other) -> Tensor + + See :func:`torch.ne`. + """ + ... + @overload + def ne_(self, other: Tensor) -> Tensor: + r""" + ne_(other) -> Tensor + + In-place version of :meth:`~Tensor.ne`. + """ + ... + @overload + def ne_(self, other: Union[Number, _complex]) -> Tensor: + r""" + ne_(other) -> Tensor + + In-place version of :meth:`~Tensor.ne`. + """ + ... + def neg(self) -> Tensor: + r""" + neg() -> Tensor + + See :func:`torch.neg` + """ + ... + def neg_(self) -> Tensor: + r""" + neg_() -> Tensor + + In-place version of :meth:`~Tensor.neg` + """ + ... + def negative(self) -> Tensor: + r""" + negative() -> Tensor + + See :func:`torch.negative` + """ + ... + def negative_(self) -> Tensor: + r""" + negative_() -> Tensor + + In-place version of :meth:`~Tensor.negative` + """ + ... + def nelement(self) -> _int: + r""" + nelement() -> int + + Alias for :meth:`~Tensor.numel` + """ + ... + @overload + def new(self, *args: Any, device: Optional[DeviceLikeType] = None) -> Tensor: ... + @overload + def new(self, storage: Storage) -> Tensor: ... + @overload + def new(self, other: Tensor) -> Tensor: ... + @overload + def new(self, size: _size, *, device: Optional[DeviceLikeType] = None) -> Tensor: ... + @overload + def new_empty(self, size: Sequence[Union[_int, SymInt]], *, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: + r""" + new_empty(size, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a Tensor of size :attr:`size` filled with uninitialized data. + By default, the returned Tensor has the same :class:`torch.dtype` and + :class:`torch.device` as this tensor. + + Args: + size (int...): a list, tuple, or :class:`torch.Size` of integers defining the + shape of the output tensor. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.ones(()) + >>> tensor.new_empty((2, 3)) + tensor([[ 5.8182e-18, 4.5765e-41, -1.0545e+30], + [ 3.0949e-41, 4.4842e-44, 0.0000e+00]]) + """ + ... + @overload + def new_empty(self, *size: _int, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: + r""" + new_empty(size, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a Tensor of size :attr:`size` filled with uninitialized data. + By default, the returned Tensor has the same :class:`torch.dtype` and + :class:`torch.device` as this tensor. + + Args: + size (int...): a list, tuple, or :class:`torch.Size` of integers defining the + shape of the output tensor. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.ones(()) + >>> tensor.new_empty((2, 3)) + tensor([[ 5.8182e-18, 4.5765e-41, -1.0545e+30], + [ 3.0949e-41, 4.4842e-44, 0.0000e+00]]) + """ + ... + def new_empty_strided(self, size: Sequence[Union[_int, SymInt]], stride: Sequence[Union[_int, SymInt]], *, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: + r""" + new_empty_strided(size, stride, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a Tensor of size :attr:`size` and strides :attr:`stride` filled with + uninitialized data. By default, the returned Tensor has the same + :class:`torch.dtype` and :class:`torch.device` as this tensor. + + Args: + size (int...): a list, tuple, or :class:`torch.Size` of integers defining the + shape of the output tensor. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.ones(()) + >>> tensor.new_empty_strided((2, 3), (3, 1)) + tensor([[ 5.8182e-18, 4.5765e-41, -1.0545e+30], + [ 3.0949e-41, 4.4842e-44, 0.0000e+00]]) + """ + ... + def new_full(self, size: Sequence[Union[_int, SymInt]], fill_value: Union[Number, _complex], *, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: + r""" + new_full(size, fill_value, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a Tensor of size :attr:`size` filled with :attr:`fill_value`. + By default, the returned Tensor has the same :class:`torch.dtype` and + :class:`torch.device` as this tensor. + + Args: + fill_value (scalar): the number to fill the output tensor with. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.ones((2,), dtype=torch.float64) + >>> tensor.new_full((3, 4), 3.141592) + tensor([[ 3.1416, 3.1416, 3.1416, 3.1416], + [ 3.1416, 3.1416, 3.1416, 3.1416], + [ 3.1416, 3.1416, 3.1416, 3.1416]], dtype=torch.float64) + """ + ... + @overload + def new_ones(self, size: _size, dtype: Optional[_dtype] = None, device: Optional[DeviceLikeType] = None, requires_grad: _bool = False, pin_memory: _bool = False) -> Tensor: + r""" + new_ones(size, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a Tensor of size :attr:`size` filled with ``1``. + By default, the returned Tensor has the same :class:`torch.dtype` and + :class:`torch.device` as this tensor. + + Args: + size (int...): a list, tuple, or :class:`torch.Size` of integers defining the + shape of the output tensor. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.tensor((), dtype=torch.int32) + >>> tensor.new_ones((2, 3)) + tensor([[ 1, 1, 1], + [ 1, 1, 1]], dtype=torch.int32) + """ + ... + @overload + def new_ones(self, size: Sequence[Union[_int, SymInt]], *, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: + r""" + new_ones(size, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a Tensor of size :attr:`size` filled with ``1``. + By default, the returned Tensor has the same :class:`torch.dtype` and + :class:`torch.device` as this tensor. + + Args: + size (int...): a list, tuple, or :class:`torch.Size` of integers defining the + shape of the output tensor. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.tensor((), dtype=torch.int32) + >>> tensor.new_ones((2, 3)) + tensor([[ 1, 1, 1], + [ 1, 1, 1]], dtype=torch.int32) + """ + ... + @overload + def new_ones(self, *size: _int, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: + r""" + new_ones(size, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a Tensor of size :attr:`size` filled with ``1``. + By default, the returned Tensor has the same :class:`torch.dtype` and + :class:`torch.device` as this tensor. + + Args: + size (int...): a list, tuple, or :class:`torch.Size` of integers defining the + shape of the output tensor. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.tensor((), dtype=torch.int32) + >>> tensor.new_ones((2, 3)) + tensor([[ 1, 1, 1], + [ 1, 1, 1]], dtype=torch.int32) + """ + ... + def new_tensor(self, data: Any, dtype: Optional[_dtype] = None, device: Optional[DeviceLikeType] = None, requires_grad: _bool = False, pin_memory: _bool = False) -> Tensor: + r""" + new_tensor(data, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a new Tensor with :attr:`data` as the tensor data. + By default, the returned Tensor has the same :class:`torch.dtype` and + :class:`torch.device` as this tensor. + + .. warning:: + + :func:`new_tensor` always copies :attr:`data`. If you have a Tensor + ``data`` and want to avoid a copy, use :func:`torch.Tensor.requires_grad_` + or :func:`torch.Tensor.detach`. + If you have a numpy array and want to avoid a copy, use + :func:`torch.from_numpy`. + + .. warning:: + + When data is a tensor `x`, :func:`new_tensor()` reads out 'the data' from whatever it is passed, + and constructs a leaf variable. Therefore ``tensor.new_tensor(x)`` is equivalent to ``x.clone().detach()`` + and ``tensor.new_tensor(x, requires_grad=True)`` is equivalent to ``x.clone().detach().requires_grad_(True)``. + The equivalents using ``clone()`` and ``detach()`` are recommended. + + Args: + data (array_like): The returned Tensor copies :attr:`data`. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.ones((2,), dtype=torch.int8) + >>> data = [[0, 1], [2, 3]] + >>> tensor.new_tensor(data) + tensor([[ 0, 1], + [ 2, 3]], dtype=torch.int8) + """ + ... + @overload + def new_zeros(self, size: Sequence[Union[_int, SymInt]], *, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: + r""" + new_zeros(size, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a Tensor of size :attr:`size` filled with ``0``. + By default, the returned Tensor has the same :class:`torch.dtype` and + :class:`torch.device` as this tensor. + + Args: + size (int...): a list, tuple, or :class:`torch.Size` of integers defining the + shape of the output tensor. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.tensor((), dtype=torch.float64) + >>> tensor.new_zeros((2, 3)) + tensor([[ 0., 0., 0.], + [ 0., 0., 0.]], dtype=torch.float64) + """ + ... + @overload + def new_zeros(self, *size: _int, dtype: Optional[_dtype] = None, layout: Optional[_layout] = None, device: Optional[Optional[DeviceLikeType]] = None, pin_memory: Optional[_bool] = False, requires_grad: Optional[_bool] = False) -> Tensor: + r""" + new_zeros(size, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor + + + Returns a Tensor of size :attr:`size` filled with ``0``. + By default, the returned Tensor has the same :class:`torch.dtype` and + :class:`torch.device` as this tensor. + + Args: + size (int...): a list, tuple, or :class:`torch.Size` of integers defining the + shape of the output tensor. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired type of returned tensor. + Default: if None, same :class:`torch.dtype` as this tensor. + device (:class:`torch.device`, optional): the desired device of returned tensor. + Default: if None, same :class:`torch.device` as this tensor. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + + Example:: + + >>> tensor = torch.tensor((), dtype=torch.float64) + >>> tensor.new_zeros((2, 3)) + tensor([[ 0., 0., 0.], + [ 0., 0., 0.]], dtype=torch.float64) + """ + ... + def nextafter(self, other: Tensor) -> Tensor: + r""" + nextafter(other) -> Tensor + See :func:`torch.nextafter` + """ + ... + def nextafter_(self, other: Tensor) -> Tensor: + r""" + nextafter_(other) -> Tensor + In-place version of :meth:`~Tensor.nextafter` + """ + ... + @overload + def nonzero(self, *, as_tuple: Literal[False] = False) -> Tensor: + r""" + nonzero() -> LongTensor + + See :func:`torch.nonzero` + """ + ... + @overload + def nonzero(self, *, as_tuple: Literal[True]) -> Tuple[Tensor, ...]: + r""" + nonzero() -> LongTensor + + See :func:`torch.nonzero` + """ + ... + def nonzero_static(self, *, size: _int, fill_value: _int = -1) -> Tensor: + r""" + nonzero_static(input, *, size, fill_value=-1) -> Tensor + + Returns a 2-D tensor where each row is the index for a non-zero value. + The returned Tensor has the same `torch.dtype` as `torch.nonzero()`. + + Args: + input (Tensor): the input tensor to count non-zero elements. + + Keyword args: + size (int): the size of non-zero elements expected to be included in the out + tensor. Pad the out tensor with `fill_value` if the `size` is larger + than total number of non-zero elements, truncate out tensor if `size` + is smaller. The size must be a non-negative integer. + fill_value (int): the value to fill the output tensor with when `size` is larger + than the total number of non-zero elements. Default is `-1` to represent + invalid index. + + Example: + + # Example 1: Padding + >>> input_tensor = torch.tensor([[1, 0], [3, 2]]) + >>> static_size = 4 + >>> t = torch.nonzero_static(input_tensor, size = static_size) + tensor([[ 0, 0], + [ 1, 0], + [ 1, 1], + [ -1, -1]], dtype=torch.int64) + + # Example 2: Truncating + >>> input_tensor = torch.tensor([[1, 0], [3, 2]]) + >>> static_size = 2 + >>> t = torch.nonzero_static(input_tensor, size = static_size) + tensor([[ 0, 0], + [ 1, 0]], dtype=torch.int64) + + # Example 3: 0 size + >>> input_tensor = torch.tensor([10]) + >>> static_size = 0 + >>> t = torch.nonzero_static(input_tensor, size = static_size) + tensor([], size=(0, 1), dtype=torch.int64) + + # Example 4: 0 rank input + >>> input_tensor = torch.tensor(10) + >>> static_size = 2 + >>> t = torch.nonzero_static(input_tensor, size = static_size) + tensor([], size=(2, 0), dtype=torch.int64) + """ + ... + def normal_(self, mean: _float = 0, std: _float = 1, *, generator: Optional[Generator] = None) -> Tensor: + r""" + normal_(mean=0, std=1, *, generator=None) -> Tensor + + Fills :attr:`self` tensor with elements samples from the normal distribution + parameterized by :attr:`mean` and :attr:`std`. + """ + ... + @overload + def not_equal(self, other: Tensor) -> Tensor: + r""" + not_equal(other) -> Tensor + + See :func:`torch.not_equal`. + """ + ... + @overload + def not_equal(self, other: Union[Number, _complex]) -> Tensor: + r""" + not_equal(other) -> Tensor + + See :func:`torch.not_equal`. + """ + ... + @overload + def not_equal_(self, other: Tensor) -> Tensor: + r""" + not_equal_(other) -> Tensor + + In-place version of :meth:`~Tensor.not_equal`. + """ + ... + @overload + def not_equal_(self, other: Union[Number, _complex]) -> Tensor: + r""" + not_equal_(other) -> Tensor + + In-place version of :meth:`~Tensor.not_equal`. + """ + ... + def numel(self) -> _int: + r""" + numel() -> int + + See :func:`torch.numel` + """ + ... + def numpy(self, *, force: _bool = False) -> Any: + r""" + numpy(*, force=False) -> numpy.ndarray + + Returns the tensor as a NumPy :class:`ndarray`. + + If :attr:`force` is ``False`` (the default), the conversion + is performed only if the tensor is on the CPU, does not require grad, + does not have its conjugate bit set, and is a dtype and layout that + NumPy supports. The returned ndarray and the tensor will share their + storage, so changes to the tensor will be reflected in the ndarray + and vice versa. + + If :attr:`force` is ``True`` this is equivalent to + calling ``t.detach().cpu().resolve_conj().resolve_neg().numpy()``. + If the tensor isn't on the CPU or the conjugate or negative bit is set, + the tensor won't share its storage with the returned ndarray. + Setting :attr:`force` to ``True`` can be a useful shorthand. + + Args: + force (bool): if ``True``, the ndarray may be a copy of the tensor + instead of always sharing memory, defaults to ``False``. + """ + ... + def orgqr(self, input2: Tensor) -> Tensor: + r""" + orgqr(input2) -> Tensor + + See :func:`torch.orgqr` + """ + ... + def ormqr(self, input2: Tensor, input3: Tensor, left: _bool = True, transpose: _bool = False) -> Tensor: + r""" + ormqr(input2, input3, left=True, transpose=False) -> Tensor + + See :func:`torch.ormqr` + """ + ... + def outer(self, vec2: Tensor) -> Tensor: + r""" + outer(vec2) -> Tensor + + See :func:`torch.outer`. + """ + ... + @overload + def permute(self, dims: _size) -> Tensor: + r""" + permute(*dims) -> Tensor + + See :func:`torch.permute` + """ + ... + @overload + def permute(self, *dims: _int) -> Tensor: + r""" + permute(*dims) -> Tensor + + See :func:`torch.permute` + """ + ... + def pin_memory(self, device: Optional[Optional[DeviceLikeType]] = None) -> Tensor: + r""" + pin_memory() -> Tensor + + Copies the tensor to pinned memory, if it's not already pinned. + """ + ... + def pinverse(self, rcond: _float = 1e-15) -> Tensor: + r""" + pinverse() -> Tensor + + See :func:`torch.pinverse` + """ + ... + def polygamma(self, n: _int) -> Tensor: + r""" + polygamma(n) -> Tensor + + See :func:`torch.polygamma` + """ + ... + def polygamma_(self, n: _int) -> Tensor: + r""" + polygamma_(n) -> Tensor + + In-place version of :meth:`~Tensor.polygamma` + """ + ... + def positive(self) -> Tensor: + r""" + positive() -> Tensor + + See :func:`torch.positive` + """ + ... + @overload + def pow(self, exponent: Tensor) -> Tensor: + r""" + pow(exponent) -> Tensor + + See :func:`torch.pow` + """ + ... + @overload + def pow(self, exponent: Union[Number, _complex]) -> Tensor: + r""" + pow(exponent) -> Tensor + + See :func:`torch.pow` + """ + ... + @overload + def pow_(self, exponent: Tensor) -> Tensor: + r""" + pow_(exponent) -> Tensor + + In-place version of :meth:`~Tensor.pow` + """ + ... + @overload + def pow_(self, exponent: Union[Number, _complex]) -> Tensor: + r""" + pow_(exponent) -> Tensor + + In-place version of :meth:`~Tensor.pow` + """ + ... + def prelu(self, weight: Tensor) -> Tensor: ... + @overload + def prod(self, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + prod(dim=None, keepdim=False, dtype=None) -> Tensor + + See :func:`torch.prod` + """ + ... + @overload + def prod(self, dim: _int, keepdim: _bool = False, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + prod(dim=None, keepdim=False, dtype=None) -> Tensor + + See :func:`torch.prod` + """ + ... + @overload + def prod(self, dim: Union[str, ellipsis, None], keepdim: _bool = False, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + prod(dim=None, keepdim=False, dtype=None) -> Tensor + + See :func:`torch.prod` + """ + ... + def put(self, index: Tensor, source: Tensor, accumulate: _bool = False) -> Tensor: + r""" + put(input, index, source, accumulate=False) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.put_`. + `input` corresponds to `self` in :meth:`torch.Tensor.put_`. + """ + ... + def put_(self, index: Tensor, source: Tensor, accumulate: _bool = False) -> Tensor: + r""" + put_(index, source, accumulate=False) -> Tensor + + Copies the elements from :attr:`source` into the positions specified by + :attr:`index`. For the purpose of indexing, the :attr:`self` tensor is treated as if + it were a 1-D tensor. + + :attr:`index` and :attr:`source` need to have the same number of elements, but not necessarily + the same shape. + + If :attr:`accumulate` is ``True``, the elements in :attr:`source` are added to + :attr:`self`. If accumulate is ``False``, the behavior is undefined if :attr:`index` + contain duplicate elements. + + Args: + index (LongTensor): the indices into self + source (Tensor): the tensor containing values to copy from + accumulate (bool): whether to accumulate into self + + Example:: + + >>> src = torch.tensor([[4, 3, 5], + ... [6, 7, 8]]) + >>> src.put_(torch.tensor([1, 3]), torch.tensor([9, 10])) + tensor([[ 4, 9, 5], + [ 10, 7, 8]]) + """ + ... + def q_per_channel_axis(self) -> _int: + r""" + q_per_channel_axis() -> int + + Given a Tensor quantized by linear (affine) per-channel quantization, + returns the index of dimension on which per-channel quantization is applied. + """ + ... + def q_per_channel_scales(self) -> Tensor: + r""" + q_per_channel_scales() -> Tensor + + Given a Tensor quantized by linear (affine) per-channel quantization, + returns a Tensor of scales of the underlying quantizer. It has the number of + elements that matches the corresponding dimensions (from q_per_channel_axis) of + the tensor. + """ + ... + def q_per_channel_zero_points(self) -> Tensor: + r""" + q_per_channel_zero_points() -> Tensor + + Given a Tensor quantized by linear (affine) per-channel quantization, + returns a tensor of zero_points of the underlying quantizer. It has the number of + elements that matches the corresponding dimensions (from q_per_channel_axis) of + the tensor. + """ + ... + def q_scale(self) -> _float: + r""" + q_scale() -> float + + Given a Tensor quantized by linear(affine) quantization, + returns the scale of the underlying quantizer(). + """ + ... + def q_zero_point(self) -> _int: + r""" + q_zero_point() -> int + + Given a Tensor quantized by linear(affine) quantization, + returns the zero_point of the underlying quantizer(). + """ + ... + def qr(self, some: _bool = True) -> torch.return_types.qr: + r""" + qr(some=True) -> (Tensor, Tensor) + + See :func:`torch.qr` + """ + ... + def qscheme(self) -> _qscheme: + r""" + qscheme() -> torch.qscheme + + Returns the quantization scheme of a given QTensor. + """ + ... + @overload + def quantile(self, q: Tensor, dim: Optional[_int] = None, keepdim: _bool = False, *, interpolation: str = "linear") -> Tensor: + r""" + quantile(q, dim=None, keepdim=False, *, interpolation='linear') -> Tensor + + See :func:`torch.quantile` + """ + ... + @overload + def quantile(self, q: _float, dim: Optional[_int] = None, keepdim: _bool = False, *, interpolation: str = "linear") -> Tensor: + r""" + quantile(q, dim=None, keepdim=False, *, interpolation='linear') -> Tensor + + See :func:`torch.quantile` + """ + ... + def rad2deg(self) -> Tensor: + r""" + rad2deg() -> Tensor + + See :func:`torch.rad2deg` + """ + ... + def rad2deg_(self) -> Tensor: + r""" + rad2deg_() -> Tensor + + In-place version of :meth:`~Tensor.rad2deg` + """ + ... + @overload + def random_(self, *, generator: Optional[Generator] = None) -> Tensor: + r""" + random_(from=0, to=None, *, generator=None) -> Tensor + + Fills :attr:`self` tensor with numbers sampled from the discrete uniform + distribution over ``[from, to - 1]``. If not specified, the values are usually + only bounded by :attr:`self` tensor's data type. However, for floating point + types, if unspecified, range will be ``[0, 2^mantissa]`` to ensure that every + value is representable. For example, `torch.tensor(1, dtype=torch.double).random_()` + will be uniform in ``[0, 2^53]``. + """ + ... + @overload + def random_(self, from_: _int, to: Optional[_int], *, generator: Optional[Generator] = None) -> Tensor: + r""" + random_(from=0, to=None, *, generator=None) -> Tensor + + Fills :attr:`self` tensor with numbers sampled from the discrete uniform + distribution over ``[from, to - 1]``. If not specified, the values are usually + only bounded by :attr:`self` tensor's data type. However, for floating point + types, if unspecified, range will be ``[0, 2^mantissa]`` to ensure that every + value is representable. For example, `torch.tensor(1, dtype=torch.double).random_()` + will be uniform in ``[0, 2^53]``. + """ + ... + @overload + def random_(self, to: _int, *, generator: Optional[Generator] = None) -> Tensor: + r""" + random_(from=0, to=None, *, generator=None) -> Tensor + + Fills :attr:`self` tensor with numbers sampled from the discrete uniform + distribution over ``[from, to - 1]``. If not specified, the values are usually + only bounded by :attr:`self` tensor's data type. However, for floating point + types, if unspecified, range will be ``[0, 2^mantissa]`` to ensure that every + value is representable. For example, `torch.tensor(1, dtype=torch.double).random_()` + will be uniform in ``[0, 2^53]``. + """ + ... + def ravel(self) -> Tensor: + r""" + ravel() -> Tensor + + see :func:`torch.ravel` + """ + ... + def reciprocal(self) -> Tensor: + r""" + reciprocal() -> Tensor + + See :func:`torch.reciprocal` + """ + ... + def reciprocal_(self) -> Tensor: + r""" + reciprocal_() -> Tensor + + In-place version of :meth:`~Tensor.reciprocal` + """ + ... + def record_stream(self, s: Stream) -> None: + r""" + record_stream(stream) + + Marks the tensor as having been used by this stream. When the tensor + is deallocated, ensure the tensor memory is not reused for another tensor + until all work queued on :attr:`stream` at the time of deallocation is + complete. + + .. note:: + + The caching allocator is aware of only the stream where a tensor was + allocated. Due to the awareness, it already correctly manages the life + cycle of tensors on only one stream. But if a tensor is used on a stream + different from the stream of origin, the allocator might reuse the memory + unexpectedly. Calling this method lets the allocator know which streams + have used the tensor. + + .. warning:: + + This method is most suitable for use cases where you are providing a + function that created a tensor on a side stream, and want users to be able + to make use of the tensor without having to think carefully about stream + safety when making use of them. These safety guarantees come at some + performance and predictability cost (analogous to the tradeoff between GC + and manual memory management), so if you are in a situation where + you manage the full lifetime of your tensors, you may consider instead + manually managing CUDA events so that calling this method is not necessary. + In particular, when you call this method, on later allocations the + allocator will poll the recorded stream to see if all operations have + completed yet; you can potentially race with side stream computation and + non-deterministically reuse or fail to reuse memory for an allocation. + + You can safely use tensors allocated on side streams without + :meth:`~Tensor.record_stream`; you must manually ensure that + any non-creation stream uses of a tensor are synced back to the creation + stream before you deallocate the tensor. As the CUDA caching allocator + guarantees that the memory will only be reused with the same creation stream, + this is sufficient to ensure that writes to future reallocations of the + memory will be delayed until non-creation stream uses are done. + (Counterintuitively, you may observe that on the CPU side we have already + reallocated the tensor, even though CUDA kernels on the old tensor are + still in progress. This is fine, because CUDA operations on the new + tensor will appropriately wait for the old operations to complete, as they + are all on the same stream.) + + Concretely, this looks like this:: + + with torch.cuda.stream(s0): + x = torch.zeros(N) + + s1.wait_stream(s0) + with torch.cuda.stream(s1): + y = some_comm_op(x) + + ... some compute on s0 ... + + # synchronize creation stream s0 to side stream s1 + # before deallocating x + s0.wait_stream(s1) + del x + + Note that some discretion is required when deciding when to perform + ``s0.wait_stream(s1)``. In particular, if we were to wait immediately + after ``some_comm_op``, there wouldn't be any point in having the side + stream; it would be equivalent to have run ``some_comm_op`` on ``s0``. + Instead, the synchronization must be placed at some appropriate, later + point in time where you expect the side stream ``s1`` to have finished + work. This location is typically identified via profiling, e.g., using + Chrome traces produced + :meth:`torch.autograd.profiler.profile.export_chrome_trace`. If you + place the wait too early, work on s0 will block until ``s1`` has finished, + preventing further overlapping of communication and computation. If you + place the wait too late, you will use more memory than is strictly + necessary (as you are keeping ``x`` live for longer.) For a concrete + example of how this guidance can be applied in practice, see this post: + `FSDP and CUDACachingAllocator + `_. + """ + ... + def refine_names(self, names: Sequence[Union[str, ellipsis, None]]) -> Tensor: ... + def relu(self) -> Tensor: ... + def relu_(self) -> Tensor: ... + @overload + def remainder(self, other: Tensor) -> Tensor: + r""" + remainder(divisor) -> Tensor + + See :func:`torch.remainder` + """ + ... + @overload + def remainder(self, other: Union[Number, _complex]) -> Tensor: + r""" + remainder(divisor) -> Tensor + + See :func:`torch.remainder` + """ + ... + @overload + def remainder_(self, other: Tensor) -> Tensor: + r""" + remainder_(divisor) -> Tensor + + In-place version of :meth:`~Tensor.remainder` + """ + ... + @overload + def remainder_(self, other: Union[Number, _complex]) -> Tensor: + r""" + remainder_(divisor) -> Tensor + + In-place version of :meth:`~Tensor.remainder` + """ + ... + def rename(self, names: Optional[Sequence[Union[str, ellipsis, None]]]) -> Tensor: ... + def rename_(self, names: Optional[Sequence[Union[str, ellipsis, None]]]) -> Tensor: ... + def renorm(self, p: Union[Number, _complex], dim: _int, maxnorm: Union[Number, _complex]) -> Tensor: + r""" + renorm(p, dim, maxnorm) -> Tensor + + See :func:`torch.renorm` + """ + ... + def renorm_(self, p: Union[Number, _complex], dim: _int, maxnorm: Union[Number, _complex]) -> Tensor: + r""" + renorm_(p, dim, maxnorm) -> Tensor + + In-place version of :meth:`~Tensor.renorm` + """ + ... + @overload + def repeat(self, repeats: Sequence[Union[_int, SymInt]]) -> Tensor: + r""" + repeat(*sizes) -> Tensor + + Repeats this tensor along the specified dimensions. + + Unlike :meth:`~Tensor.expand`, this function copies the tensor's data. + + .. warning:: + + :meth:`~Tensor.repeat` behaves differently from + `numpy.repeat `_, + but is more similar to + `numpy.tile `_. + For the operator similar to `numpy.repeat`, see :func:`torch.repeat_interleave`. + + Args: + sizes (torch.Size or int...): The number of times to repeat this tensor along each + dimension + + Example:: + + >>> x = torch.tensor([1, 2, 3]) + >>> x.repeat(4, 2) + tensor([[ 1, 2, 3, 1, 2, 3], + [ 1, 2, 3, 1, 2, 3], + [ 1, 2, 3, 1, 2, 3], + [ 1, 2, 3, 1, 2, 3]]) + >>> x.repeat(4, 2, 1).size() + torch.Size([4, 2, 3]) + """ + ... + @overload + def repeat(self, *repeats: _int) -> Tensor: + r""" + repeat(*sizes) -> Tensor + + Repeats this tensor along the specified dimensions. + + Unlike :meth:`~Tensor.expand`, this function copies the tensor's data. + + .. warning:: + + :meth:`~Tensor.repeat` behaves differently from + `numpy.repeat `_, + but is more similar to + `numpy.tile `_. + For the operator similar to `numpy.repeat`, see :func:`torch.repeat_interleave`. + + Args: + sizes (torch.Size or int...): The number of times to repeat this tensor along each + dimension + + Example:: + + >>> x = torch.tensor([1, 2, 3]) + >>> x.repeat(4, 2) + tensor([[ 1, 2, 3, 1, 2, 3], + [ 1, 2, 3, 1, 2, 3], + [ 1, 2, 3, 1, 2, 3], + [ 1, 2, 3, 1, 2, 3]]) + >>> x.repeat(4, 2, 1).size() + torch.Size([4, 2, 3]) + """ + ... + @overload + def repeat_interleave(self, repeats: Tensor, dim: Optional[_int] = None, *, output_size: Optional[Union[_int, SymInt]] = None) -> Tensor: + r""" + repeat_interleave(repeats, dim=None, *, output_size=None) -> Tensor + + See :func:`torch.repeat_interleave`. + """ + ... + @overload + def repeat_interleave(self, repeats: Union[_int, SymInt], dim: Optional[_int] = None, *, output_size: Optional[Union[_int, SymInt]] = None) -> Tensor: + r""" + repeat_interleave(repeats, dim=None, *, output_size=None) -> Tensor + + See :func:`torch.repeat_interleave`. + """ + ... + def requires_grad_(self, mode: _bool = True) -> Tensor: + r""" + requires_grad_(requires_grad=True) -> Tensor + + Change if autograd should record operations on this tensor: sets this tensor's + :attr:`requires_grad` attribute in-place. Returns this tensor. + + :func:`requires_grad_`'s main use case is to tell autograd to begin recording + operations on a Tensor ``tensor``. If ``tensor`` has ``requires_grad=False`` + (because it was obtained through a DataLoader, or required preprocessing or + initialization), ``tensor.requires_grad_()`` makes it so that autograd will + begin to record operations on ``tensor``. + + Args: + requires_grad (bool): If autograd should record operations on this tensor. + Default: ``True``. + + Example:: + + >>> # Let's say we want to preprocess some saved weights and use + >>> # the result as new weights. + >>> saved_weights = [0.1, 0.2, 0.3, 0.25] + >>> loaded_weights = torch.tensor(saved_weights) + >>> weights = preprocess(loaded_weights) # some function + >>> weights + tensor([-0.5503, 0.4926, -2.1158, -0.8303]) + + >>> # Now, start to record operations done to weights + >>> weights.requires_grad_() + >>> out = weights.pow(2).sum() + >>> out.backward() + >>> weights.grad + tensor([-1.1007, 0.9853, -4.2316, -1.6606]) + """ + ... + @overload + def reshape(self, shape: Sequence[Union[_int, SymInt]]) -> Tensor: + r""" + reshape(*shape) -> Tensor + + Returns a tensor with the same data and number of elements as :attr:`self` + but with the specified shape. This method returns a view if :attr:`shape` is + compatible with the current shape. See :meth:`torch.Tensor.view` on when it is + possible to return a view. + + See :func:`torch.reshape` + + Args: + shape (tuple of ints or int...): the desired shape + """ + ... + @overload + def reshape(self, *shape: _int) -> Tensor: + r""" + reshape(*shape) -> Tensor + + Returns a tensor with the same data and number of elements as :attr:`self` + but with the specified shape. This method returns a view if :attr:`shape` is + compatible with the current shape. See :meth:`torch.Tensor.view` on when it is + possible to return a view. + + See :func:`torch.reshape` + + Args: + shape (tuple of ints or int...): the desired shape + """ + ... + def reshape_as(self, other: Tensor) -> Tensor: + r""" + reshape_as(other) -> Tensor + + Returns this tensor as the same shape as :attr:`other`. + ``self.reshape_as(other)`` is equivalent to ``self.reshape(other.sizes())``. + This method returns a view if ``other.sizes()`` is compatible with the current + shape. See :meth:`torch.Tensor.view` on when it is possible to return a view. + + Please see :meth:`reshape` for more information about ``reshape``. + + Args: + other (:class:`torch.Tensor`): The result tensor has the same shape + as :attr:`other`. + """ + ... + @overload + def resize_(self, size: Sequence[Union[_int, SymInt]], *, memory_format: Optional[memory_format] = None) -> Tensor: + r""" + resize_(*sizes, memory_format=torch.contiguous_format) -> Tensor + + Resizes :attr:`self` tensor to the specified size. If the number of elements is + larger than the current storage size, then the underlying storage is resized + to fit the new number of elements. If the number of elements is smaller, the + underlying storage is not changed. Existing elements are preserved but any new + memory is uninitialized. + + .. warning:: + + This is a low-level method. The storage is reinterpreted as C-contiguous, + ignoring the current strides (unless the target size equals the current + size, in which case the tensor is left unchanged). For most purposes, you + will instead want to use :meth:`~Tensor.view()`, which checks for + contiguity, or :meth:`~Tensor.reshape()`, which copies data if needed. To + change the size in-place with custom strides, see :meth:`~Tensor.set_()`. + + .. note:: + + If :func:`torch.use_deterministic_algorithms()` and + :attr:`torch.utils.deterministic.fill_uninitialized_memory` are both set to + ``True``, new elements are initialized to prevent nondeterministic behavior + from using the result as an input to an operation. Floating point and + complex values are set to NaN, and integer values are set to the maximum + value. + + Args: + sizes (torch.Size or int...): the desired size + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + Tensor. Default: ``torch.contiguous_format``. Note that memory format of + :attr:`self` is going to be unaffected if ``self.size()`` matches ``sizes``. + + Example:: + + >>> x = torch.tensor([[1, 2], [3, 4], [5, 6]]) + >>> x.resize_(2, 2) + tensor([[ 1, 2], + [ 3, 4]]) + """ + ... + @overload + def resize_(self, *size: _int, memory_format: Optional[memory_format] = None) -> Tensor: + r""" + resize_(*sizes, memory_format=torch.contiguous_format) -> Tensor + + Resizes :attr:`self` tensor to the specified size. If the number of elements is + larger than the current storage size, then the underlying storage is resized + to fit the new number of elements. If the number of elements is smaller, the + underlying storage is not changed. Existing elements are preserved but any new + memory is uninitialized. + + .. warning:: + + This is a low-level method. The storage is reinterpreted as C-contiguous, + ignoring the current strides (unless the target size equals the current + size, in which case the tensor is left unchanged). For most purposes, you + will instead want to use :meth:`~Tensor.view()`, which checks for + contiguity, or :meth:`~Tensor.reshape()`, which copies data if needed. To + change the size in-place with custom strides, see :meth:`~Tensor.set_()`. + + .. note:: + + If :func:`torch.use_deterministic_algorithms()` and + :attr:`torch.utils.deterministic.fill_uninitialized_memory` are both set to + ``True``, new elements are initialized to prevent nondeterministic behavior + from using the result as an input to an operation. Floating point and + complex values are set to NaN, and integer values are set to the maximum + value. + + Args: + sizes (torch.Size or int...): the desired size + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + Tensor. Default: ``torch.contiguous_format``. Note that memory format of + :attr:`self` is going to be unaffected if ``self.size()`` matches ``sizes``. + + Example:: + + >>> x = torch.tensor([[1, 2], [3, 4], [5, 6]]) + >>> x.resize_(2, 2) + tensor([[ 1, 2], + [ 3, 4]]) + """ + ... + def resize_as_(self, the_template: Tensor, *, memory_format: Optional[memory_format] = None) -> Tensor: + r""" + resize_as_(tensor, memory_format=torch.contiguous_format) -> Tensor + + Resizes the :attr:`self` tensor to be the same size as the specified + :attr:`tensor`. This is equivalent to ``self.resize_(tensor.size())``. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + Tensor. Default: ``torch.contiguous_format``. Note that memory format of + :attr:`self` is going to be unaffected if ``self.size()`` matches ``tensor.size()``. + """ + ... + def resize_as_sparse_(self, the_template: Tensor) -> Tensor: ... + def resolve_conj(self) -> Tensor: + r""" + resolve_conj() -> Tensor + + See :func:`torch.resolve_conj` + """ + ... + def resolve_neg(self) -> Tensor: + r""" + resolve_neg() -> Tensor + + See :func:`torch.resolve_neg` + """ + ... + def retain_grad(self) -> None: + r""" + retain_grad() -> None + + Enables this Tensor to have their :attr:`grad` populated during + :func:`backward`. This is a no-op for leaf tensors. + """ + ... + def roll(self, shifts: Union[Union[_int, SymInt], Sequence[Union[_int, SymInt]]], dims: Union[_int, _size] = ()) -> Tensor: + r""" + roll(shifts, dims) -> Tensor + + See :func:`torch.roll` + """ + ... + def rot90(self, k: _int = 1, dims: _size = (0,1)) -> Tensor: + r""" + rot90(k, dims) -> Tensor + + See :func:`torch.rot90` + """ + ... + @overload + def round(self) -> Tensor: + r""" + round(decimals=0) -> Tensor + + See :func:`torch.round` + """ + ... + @overload + def round(self, *, decimals: _int) -> Tensor: + r""" + round(decimals=0) -> Tensor + + See :func:`torch.round` + """ + ... + @overload + def round_(self) -> Tensor: + r""" + round_(decimals=0) -> Tensor + + In-place version of :meth:`~Tensor.round` + """ + ... + @overload + def round_(self, *, decimals: _int) -> Tensor: + r""" + round_(decimals=0) -> Tensor + + In-place version of :meth:`~Tensor.round` + """ + ... + def row_indices(self) -> Tensor: ... + def rsqrt(self) -> Tensor: + r""" + rsqrt() -> Tensor + + See :func:`torch.rsqrt` + """ + ... + def rsqrt_(self) -> Tensor: + r""" + rsqrt_() -> Tensor + + In-place version of :meth:`~Tensor.rsqrt` + """ + ... + @overload + def scatter(self, dim: _int, index: Tensor, src: Tensor) -> Tensor: + r""" + scatter(dim, index, src) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.scatter_` + """ + ... + @overload + def scatter(self, dim: _int, index: Tensor, src: Tensor, *, reduce: str) -> Tensor: + r""" + scatter(dim, index, src) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.scatter_` + """ + ... + @overload + def scatter(self, dim: _int, index: Tensor, value: Union[Number, _complex], *, reduce: str) -> Tensor: + r""" + scatter(dim, index, src) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.scatter_` + """ + ... + @overload + def scatter(self, dim: Union[str, ellipsis, None], index: Tensor, src: Tensor) -> Tensor: + r""" + scatter(dim, index, src) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.scatter_` + """ + ... + @overload + def scatter(self, dim: _int, index: Tensor, value: Union[Number, _complex]) -> Tensor: + r""" + scatter(dim, index, src) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.scatter_` + """ + ... + @overload + def scatter(self, dim: Union[str, ellipsis, None], index: Tensor, value: Union[Number, _complex]) -> Tensor: + r""" + scatter(dim, index, src) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.scatter_` + """ + ... + @overload + def scatter_(self, dim: _int, index: Tensor, src: Tensor) -> Tensor: + r""" + scatter_(dim, index, src, *, reduce=None) -> Tensor + + Writes all values from the tensor :attr:`src` into :attr:`self` at the indices + specified in the :attr:`index` tensor. For each value in :attr:`src`, its output + index is specified by its index in :attr:`src` for ``dimension != dim`` and by + the corresponding value in :attr:`index` for ``dimension = dim``. + + For a 3-D tensor, :attr:`self` is updated as:: + + self[index[i][j][k]][j][k] = src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] = src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] = src[i][j][k] # if dim == 2 + + This is the reverse operation of the manner described in :meth:`~Tensor.gather`. + + :attr:`self`, :attr:`index` and :attr:`src` (if it is a Tensor) should all have + the same number of dimensions. It is also required that + ``index.size(d) <= src.size(d)`` for all dimensions ``d``, and that + ``index.size(d) <= self.size(d)`` for all dimensions ``d != dim``. + Note that ``index`` and ``src`` do not broadcast. + + Moreover, as for :meth:`~Tensor.gather`, the values of :attr:`index` must be + between ``0`` and ``self.size(dim) - 1`` inclusive. + + .. warning:: + + When indices are not unique, the behavior is non-deterministic (one of the + values from ``src`` will be picked arbitrarily) and the gradient will be + incorrect (it will be propagated to all locations in the source that + correspond to the same index)! + + .. note:: + + The backward pass is implemented only for ``src.shape == index.shape``. + + Additionally accepts an optional :attr:`reduce` argument that allows + specification of an optional reduction operation, which is applied to all + values in the tensor :attr:`src` into :attr:`self` at the indices + specified in the :attr:`index`. For each value in :attr:`src`, the reduction + operation is applied to an index in :attr:`self` which is specified by + its index in :attr:`src` for ``dimension != dim`` and by the corresponding + value in :attr:`index` for ``dimension = dim``. + + Given a 3-D tensor and reduction using the multiplication operation, :attr:`self` + is updated as:: + + self[index[i][j][k]][j][k] *= src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] *= src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] *= src[i][j][k] # if dim == 2 + + Reducing with the addition operation is the same as using + :meth:`~torch.Tensor.scatter_add_`. + + .. warning:: + The reduce argument with Tensor ``src`` is deprecated and will be removed in + a future PyTorch release. Please use :meth:`~torch.Tensor.scatter_reduce_` + instead for more reduction options. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter, can be either empty + or of the same dimensionality as ``src``. When empty, the operation + returns ``self`` unchanged. + src (Tensor): the source element(s) to scatter. + + Keyword args: + reduce (str, optional): reduction operation to apply, can be either + ``'add'`` or ``'multiply'``. + + Example:: + + >>> src = torch.arange(1, 11).reshape((2, 5)) + >>> src + tensor([[ 1, 2, 3, 4, 5], + [ 6, 7, 8, 9, 10]]) + >>> index = torch.tensor([[0, 1, 2, 0]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_(0, index, src) + tensor([[1, 0, 0, 4, 0], + [0, 2, 0, 0, 0], + [0, 0, 3, 0, 0]]) + >>> index = torch.tensor([[0, 1, 2], [0, 1, 4]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_(1, index, src) + tensor([[1, 2, 3, 0, 0], + [6, 7, 0, 0, 8], + [0, 0, 0, 0, 0]]) + + >>> torch.full((2, 4), 2.).scatter_(1, torch.tensor([[2], [3]]), + ... 1.23, reduce='multiply') + tensor([[2.0000, 2.0000, 2.4600, 2.0000], + [2.0000, 2.0000, 2.0000, 2.4600]]) + >>> torch.full((2, 4), 2.).scatter_(1, torch.tensor([[2], [3]]), + ... 1.23, reduce='add') + tensor([[2.0000, 2.0000, 3.2300, 2.0000], + [2.0000, 2.0000, 2.0000, 3.2300]]) + + .. function:: scatter_(dim, index, value, *, reduce=None) -> Tensor: + :noindex: + + Writes the value from :attr:`value` into :attr:`self` at the indices + specified in the :attr:`index` tensor. This operation is equivalent to the previous version, + with the :attr:`src` tensor filled entirely with :attr:`value`. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter, can be either empty + or of the same dimensionality as ``src``. When empty, the operation + returns ``self`` unchanged. + value (Scalar): the value to scatter. + + Keyword args: + reduce (str, optional): reduction operation to apply, can be either + ``'add'`` or ``'multiply'``. + + Example:: + + >>> index = torch.tensor([[0, 1]]) + >>> value = 2 + >>> torch.zeros(3, 5).scatter_(0, index, value) + tensor([[2., 0., 0., 0., 0.], + [0., 2., 0., 0., 0.], + [0., 0., 0., 0., 0.]]) + """ + ... + @overload + def scatter_(self, dim: _int, index: Tensor, src: Tensor, *, reduce: str) -> Tensor: + r""" + scatter_(dim, index, src, *, reduce=None) -> Tensor + + Writes all values from the tensor :attr:`src` into :attr:`self` at the indices + specified in the :attr:`index` tensor. For each value in :attr:`src`, its output + index is specified by its index in :attr:`src` for ``dimension != dim`` and by + the corresponding value in :attr:`index` for ``dimension = dim``. + + For a 3-D tensor, :attr:`self` is updated as:: + + self[index[i][j][k]][j][k] = src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] = src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] = src[i][j][k] # if dim == 2 + + This is the reverse operation of the manner described in :meth:`~Tensor.gather`. + + :attr:`self`, :attr:`index` and :attr:`src` (if it is a Tensor) should all have + the same number of dimensions. It is also required that + ``index.size(d) <= src.size(d)`` for all dimensions ``d``, and that + ``index.size(d) <= self.size(d)`` for all dimensions ``d != dim``. + Note that ``index`` and ``src`` do not broadcast. + + Moreover, as for :meth:`~Tensor.gather`, the values of :attr:`index` must be + between ``0`` and ``self.size(dim) - 1`` inclusive. + + .. warning:: + + When indices are not unique, the behavior is non-deterministic (one of the + values from ``src`` will be picked arbitrarily) and the gradient will be + incorrect (it will be propagated to all locations in the source that + correspond to the same index)! + + .. note:: + + The backward pass is implemented only for ``src.shape == index.shape``. + + Additionally accepts an optional :attr:`reduce` argument that allows + specification of an optional reduction operation, which is applied to all + values in the tensor :attr:`src` into :attr:`self` at the indices + specified in the :attr:`index`. For each value in :attr:`src`, the reduction + operation is applied to an index in :attr:`self` which is specified by + its index in :attr:`src` for ``dimension != dim`` and by the corresponding + value in :attr:`index` for ``dimension = dim``. + + Given a 3-D tensor and reduction using the multiplication operation, :attr:`self` + is updated as:: + + self[index[i][j][k]][j][k] *= src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] *= src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] *= src[i][j][k] # if dim == 2 + + Reducing with the addition operation is the same as using + :meth:`~torch.Tensor.scatter_add_`. + + .. warning:: + The reduce argument with Tensor ``src`` is deprecated and will be removed in + a future PyTorch release. Please use :meth:`~torch.Tensor.scatter_reduce_` + instead for more reduction options. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter, can be either empty + or of the same dimensionality as ``src``. When empty, the operation + returns ``self`` unchanged. + src (Tensor): the source element(s) to scatter. + + Keyword args: + reduce (str, optional): reduction operation to apply, can be either + ``'add'`` or ``'multiply'``. + + Example:: + + >>> src = torch.arange(1, 11).reshape((2, 5)) + >>> src + tensor([[ 1, 2, 3, 4, 5], + [ 6, 7, 8, 9, 10]]) + >>> index = torch.tensor([[0, 1, 2, 0]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_(0, index, src) + tensor([[1, 0, 0, 4, 0], + [0, 2, 0, 0, 0], + [0, 0, 3, 0, 0]]) + >>> index = torch.tensor([[0, 1, 2], [0, 1, 4]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_(1, index, src) + tensor([[1, 2, 3, 0, 0], + [6, 7, 0, 0, 8], + [0, 0, 0, 0, 0]]) + + >>> torch.full((2, 4), 2.).scatter_(1, torch.tensor([[2], [3]]), + ... 1.23, reduce='multiply') + tensor([[2.0000, 2.0000, 2.4600, 2.0000], + [2.0000, 2.0000, 2.0000, 2.4600]]) + >>> torch.full((2, 4), 2.).scatter_(1, torch.tensor([[2], [3]]), + ... 1.23, reduce='add') + tensor([[2.0000, 2.0000, 3.2300, 2.0000], + [2.0000, 2.0000, 2.0000, 3.2300]]) + + .. function:: scatter_(dim, index, value, *, reduce=None) -> Tensor: + :noindex: + + Writes the value from :attr:`value` into :attr:`self` at the indices + specified in the :attr:`index` tensor. This operation is equivalent to the previous version, + with the :attr:`src` tensor filled entirely with :attr:`value`. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter, can be either empty + or of the same dimensionality as ``src``. When empty, the operation + returns ``self`` unchanged. + value (Scalar): the value to scatter. + + Keyword args: + reduce (str, optional): reduction operation to apply, can be either + ``'add'`` or ``'multiply'``. + + Example:: + + >>> index = torch.tensor([[0, 1]]) + >>> value = 2 + >>> torch.zeros(3, 5).scatter_(0, index, value) + tensor([[2., 0., 0., 0., 0.], + [0., 2., 0., 0., 0.], + [0., 0., 0., 0., 0.]]) + """ + ... + @overload + def scatter_(self, dim: _int, index: Tensor, value: Union[Number, _complex], *, reduce: str) -> Tensor: + r""" + scatter_(dim, index, src, *, reduce=None) -> Tensor + + Writes all values from the tensor :attr:`src` into :attr:`self` at the indices + specified in the :attr:`index` tensor. For each value in :attr:`src`, its output + index is specified by its index in :attr:`src` for ``dimension != dim`` and by + the corresponding value in :attr:`index` for ``dimension = dim``. + + For a 3-D tensor, :attr:`self` is updated as:: + + self[index[i][j][k]][j][k] = src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] = src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] = src[i][j][k] # if dim == 2 + + This is the reverse operation of the manner described in :meth:`~Tensor.gather`. + + :attr:`self`, :attr:`index` and :attr:`src` (if it is a Tensor) should all have + the same number of dimensions. It is also required that + ``index.size(d) <= src.size(d)`` for all dimensions ``d``, and that + ``index.size(d) <= self.size(d)`` for all dimensions ``d != dim``. + Note that ``index`` and ``src`` do not broadcast. + + Moreover, as for :meth:`~Tensor.gather`, the values of :attr:`index` must be + between ``0`` and ``self.size(dim) - 1`` inclusive. + + .. warning:: + + When indices are not unique, the behavior is non-deterministic (one of the + values from ``src`` will be picked arbitrarily) and the gradient will be + incorrect (it will be propagated to all locations in the source that + correspond to the same index)! + + .. note:: + + The backward pass is implemented only for ``src.shape == index.shape``. + + Additionally accepts an optional :attr:`reduce` argument that allows + specification of an optional reduction operation, which is applied to all + values in the tensor :attr:`src` into :attr:`self` at the indices + specified in the :attr:`index`. For each value in :attr:`src`, the reduction + operation is applied to an index in :attr:`self` which is specified by + its index in :attr:`src` for ``dimension != dim`` and by the corresponding + value in :attr:`index` for ``dimension = dim``. + + Given a 3-D tensor and reduction using the multiplication operation, :attr:`self` + is updated as:: + + self[index[i][j][k]][j][k] *= src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] *= src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] *= src[i][j][k] # if dim == 2 + + Reducing with the addition operation is the same as using + :meth:`~torch.Tensor.scatter_add_`. + + .. warning:: + The reduce argument with Tensor ``src`` is deprecated and will be removed in + a future PyTorch release. Please use :meth:`~torch.Tensor.scatter_reduce_` + instead for more reduction options. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter, can be either empty + or of the same dimensionality as ``src``. When empty, the operation + returns ``self`` unchanged. + src (Tensor): the source element(s) to scatter. + + Keyword args: + reduce (str, optional): reduction operation to apply, can be either + ``'add'`` or ``'multiply'``. + + Example:: + + >>> src = torch.arange(1, 11).reshape((2, 5)) + >>> src + tensor([[ 1, 2, 3, 4, 5], + [ 6, 7, 8, 9, 10]]) + >>> index = torch.tensor([[0, 1, 2, 0]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_(0, index, src) + tensor([[1, 0, 0, 4, 0], + [0, 2, 0, 0, 0], + [0, 0, 3, 0, 0]]) + >>> index = torch.tensor([[0, 1, 2], [0, 1, 4]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_(1, index, src) + tensor([[1, 2, 3, 0, 0], + [6, 7, 0, 0, 8], + [0, 0, 0, 0, 0]]) + + >>> torch.full((2, 4), 2.).scatter_(1, torch.tensor([[2], [3]]), + ... 1.23, reduce='multiply') + tensor([[2.0000, 2.0000, 2.4600, 2.0000], + [2.0000, 2.0000, 2.0000, 2.4600]]) + >>> torch.full((2, 4), 2.).scatter_(1, torch.tensor([[2], [3]]), + ... 1.23, reduce='add') + tensor([[2.0000, 2.0000, 3.2300, 2.0000], + [2.0000, 2.0000, 2.0000, 3.2300]]) + + .. function:: scatter_(dim, index, value, *, reduce=None) -> Tensor: + :noindex: + + Writes the value from :attr:`value` into :attr:`self` at the indices + specified in the :attr:`index` tensor. This operation is equivalent to the previous version, + with the :attr:`src` tensor filled entirely with :attr:`value`. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter, can be either empty + or of the same dimensionality as ``src``. When empty, the operation + returns ``self`` unchanged. + value (Scalar): the value to scatter. + + Keyword args: + reduce (str, optional): reduction operation to apply, can be either + ``'add'`` or ``'multiply'``. + + Example:: + + >>> index = torch.tensor([[0, 1]]) + >>> value = 2 + >>> torch.zeros(3, 5).scatter_(0, index, value) + tensor([[2., 0., 0., 0., 0.], + [0., 2., 0., 0., 0.], + [0., 0., 0., 0., 0.]]) + """ + ... + @overload + def scatter_(self, dim: _int, index: Tensor, value: Union[Number, _complex]) -> Tensor: + r""" + scatter_(dim, index, src, *, reduce=None) -> Tensor + + Writes all values from the tensor :attr:`src` into :attr:`self` at the indices + specified in the :attr:`index` tensor. For each value in :attr:`src`, its output + index is specified by its index in :attr:`src` for ``dimension != dim`` and by + the corresponding value in :attr:`index` for ``dimension = dim``. + + For a 3-D tensor, :attr:`self` is updated as:: + + self[index[i][j][k]][j][k] = src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] = src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] = src[i][j][k] # if dim == 2 + + This is the reverse operation of the manner described in :meth:`~Tensor.gather`. + + :attr:`self`, :attr:`index` and :attr:`src` (if it is a Tensor) should all have + the same number of dimensions. It is also required that + ``index.size(d) <= src.size(d)`` for all dimensions ``d``, and that + ``index.size(d) <= self.size(d)`` for all dimensions ``d != dim``. + Note that ``index`` and ``src`` do not broadcast. + + Moreover, as for :meth:`~Tensor.gather`, the values of :attr:`index` must be + between ``0`` and ``self.size(dim) - 1`` inclusive. + + .. warning:: + + When indices are not unique, the behavior is non-deterministic (one of the + values from ``src`` will be picked arbitrarily) and the gradient will be + incorrect (it will be propagated to all locations in the source that + correspond to the same index)! + + .. note:: + + The backward pass is implemented only for ``src.shape == index.shape``. + + Additionally accepts an optional :attr:`reduce` argument that allows + specification of an optional reduction operation, which is applied to all + values in the tensor :attr:`src` into :attr:`self` at the indices + specified in the :attr:`index`. For each value in :attr:`src`, the reduction + operation is applied to an index in :attr:`self` which is specified by + its index in :attr:`src` for ``dimension != dim`` and by the corresponding + value in :attr:`index` for ``dimension = dim``. + + Given a 3-D tensor and reduction using the multiplication operation, :attr:`self` + is updated as:: + + self[index[i][j][k]][j][k] *= src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] *= src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] *= src[i][j][k] # if dim == 2 + + Reducing with the addition operation is the same as using + :meth:`~torch.Tensor.scatter_add_`. + + .. warning:: + The reduce argument with Tensor ``src`` is deprecated and will be removed in + a future PyTorch release. Please use :meth:`~torch.Tensor.scatter_reduce_` + instead for more reduction options. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter, can be either empty + or of the same dimensionality as ``src``. When empty, the operation + returns ``self`` unchanged. + src (Tensor): the source element(s) to scatter. + + Keyword args: + reduce (str, optional): reduction operation to apply, can be either + ``'add'`` or ``'multiply'``. + + Example:: + + >>> src = torch.arange(1, 11).reshape((2, 5)) + >>> src + tensor([[ 1, 2, 3, 4, 5], + [ 6, 7, 8, 9, 10]]) + >>> index = torch.tensor([[0, 1, 2, 0]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_(0, index, src) + tensor([[1, 0, 0, 4, 0], + [0, 2, 0, 0, 0], + [0, 0, 3, 0, 0]]) + >>> index = torch.tensor([[0, 1, 2], [0, 1, 4]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_(1, index, src) + tensor([[1, 2, 3, 0, 0], + [6, 7, 0, 0, 8], + [0, 0, 0, 0, 0]]) + + >>> torch.full((2, 4), 2.).scatter_(1, torch.tensor([[2], [3]]), + ... 1.23, reduce='multiply') + tensor([[2.0000, 2.0000, 2.4600, 2.0000], + [2.0000, 2.0000, 2.0000, 2.4600]]) + >>> torch.full((2, 4), 2.).scatter_(1, torch.tensor([[2], [3]]), + ... 1.23, reduce='add') + tensor([[2.0000, 2.0000, 3.2300, 2.0000], + [2.0000, 2.0000, 2.0000, 3.2300]]) + + .. function:: scatter_(dim, index, value, *, reduce=None) -> Tensor: + :noindex: + + Writes the value from :attr:`value` into :attr:`self` at the indices + specified in the :attr:`index` tensor. This operation is equivalent to the previous version, + with the :attr:`src` tensor filled entirely with :attr:`value`. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter, can be either empty + or of the same dimensionality as ``src``. When empty, the operation + returns ``self`` unchanged. + value (Scalar): the value to scatter. + + Keyword args: + reduce (str, optional): reduction operation to apply, can be either + ``'add'`` or ``'multiply'``. + + Example:: + + >>> index = torch.tensor([[0, 1]]) + >>> value = 2 + >>> torch.zeros(3, 5).scatter_(0, index, value) + tensor([[2., 0., 0., 0., 0.], + [0., 2., 0., 0., 0.], + [0., 0., 0., 0., 0.]]) + """ + ... + @overload + def scatter_add(self, dim: _int, index: Tensor, src: Tensor) -> Tensor: + r""" + scatter_add(dim, index, src) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.scatter_add_` + """ + ... + @overload + def scatter_add(self, dim: Union[str, ellipsis, None], index: Tensor, src: Tensor) -> Tensor: + r""" + scatter_add(dim, index, src) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.scatter_add_` + """ + ... + def scatter_add_(self, dim: _int, index: Tensor, src: Tensor) -> Tensor: + r""" + scatter_add_(dim, index, src) -> Tensor + + Adds all values from the tensor :attr:`src` into :attr:`self` at the indices + specified in the :attr:`index` tensor in a similar fashion as + :meth:`~torch.Tensor.scatter_`. For each value in :attr:`src`, it is added to + an index in :attr:`self` which is specified by its index in :attr:`src` + for ``dimension != dim`` and by the corresponding value in :attr:`index` for + ``dimension = dim``. + + For a 3-D tensor, :attr:`self` is updated as:: + + self[index[i][j][k]][j][k] += src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] += src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] += src[i][j][k] # if dim == 2 + + :attr:`self`, :attr:`index` and :attr:`src` should have same number of + dimensions. It is also required that ``index.size(d) <= src.size(d)`` for all + dimensions ``d``, and that ``index.size(d) <= self.size(d)`` for all dimensions + ``d != dim``. Note that ``index`` and ``src`` do not broadcast. + + Note: + This operation may behave nondeterministically when given tensors on a CUDA device. See :doc:`/notes/randomness` for more information. + + .. note:: + + The backward pass is implemented only for ``src.shape == index.shape``. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter and add, can be + either empty or of the same dimensionality as ``src``. When empty, the + operation returns ``self`` unchanged. + src (Tensor): the source elements to scatter and add + + Example:: + + >>> src = torch.ones((2, 5)) + >>> index = torch.tensor([[0, 1, 2, 0, 0]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_add_(0, index, src) + tensor([[1., 0., 0., 1., 1.], + [0., 1., 0., 0., 0.], + [0., 0., 1., 0., 0.]]) + >>> index = torch.tensor([[0, 1, 2, 0, 0], [0, 1, 2, 2, 2]]) + >>> torch.zeros(3, 5, dtype=src.dtype).scatter_add_(0, index, src) + tensor([[2., 0., 0., 1., 1.], + [0., 2., 0., 0., 0.], + [0., 0., 2., 1., 1.]]) + """ + ... + def scatter_reduce(self, dim: _int, index: Tensor, src: Tensor, reduce: str, *, include_self: _bool = True) -> Tensor: + r""" + scatter_reduce(dim, index, src, reduce, *, include_self=True) -> Tensor + + Out-of-place version of :meth:`torch.Tensor.scatter_reduce_` + """ + ... + def scatter_reduce_(self, dim: _int, index: Tensor, src: Tensor, reduce: str, *, include_self: _bool = True) -> Tensor: + r""" + scatter_reduce_(dim, index, src, reduce, *, include_self=True) -> Tensor + + Reduces all values from the :attr:`src` tensor to the indices specified in + the :attr:`index` tensor in the :attr:`self` tensor using the applied reduction + defined via the :attr:`reduce` argument (:obj:`"sum"`, :obj:`"prod"`, :obj:`"mean"`, + :obj:`"amax"`, :obj:`"amin"`). For each value in :attr:`src`, it is reduced to an + index in :attr:`self` which is specified by its index in :attr:`src` for + ``dimension != dim`` and by the corresponding value in :attr:`index` for + ``dimension = dim``. If :obj:`include_self="True"`, the values in the :attr:`self` + tensor are included in the reduction. + + :attr:`self`, :attr:`index` and :attr:`src` should all have + the same number of dimensions. It is also required that + ``index.size(d) <= src.size(d)`` for all dimensions ``d``, and that + ``index.size(d) <= self.size(d)`` for all dimensions ``d != dim``. + Note that ``index`` and ``src`` do not broadcast. + + For a 3-D tensor with :obj:`reduce="sum"` and :obj:`include_self=True` the + output is given as:: + + self[index[i][j][k]][j][k] += src[i][j][k] # if dim == 0 + self[i][index[i][j][k]][k] += src[i][j][k] # if dim == 1 + self[i][j][index[i][j][k]] += src[i][j][k] # if dim == 2 + + Note: + This operation may behave nondeterministically when given tensors on a CUDA device. See :doc:`/notes/randomness` for more information. + + .. note:: + + The backward pass is implemented only for ``src.shape == index.shape``. + + .. warning:: + + This function is in beta and may change in the near future. + + Args: + dim (int): the axis along which to index + index (LongTensor): the indices of elements to scatter and reduce. + src (Tensor): the source elements to scatter and reduce + reduce (str): the reduction operation to apply for non-unique indices + (:obj:`"sum"`, :obj:`"prod"`, :obj:`"mean"`, :obj:`"amax"`, :obj:`"amin"`) + include_self (bool): whether elements from the :attr:`self` tensor are + included in the reduction + + Example:: + + >>> src = torch.tensor([1., 2., 3., 4., 5., 6.]) + >>> index = torch.tensor([0, 1, 0, 1, 2, 1]) + >>> input = torch.tensor([1., 2., 3., 4.]) + >>> input.scatter_reduce(0, index, src, reduce="sum") + tensor([5., 14., 8., 4.]) + >>> input.scatter_reduce(0, index, src, reduce="sum", include_self=False) + tensor([4., 12., 5., 4.]) + >>> input2 = torch.tensor([5., 4., 3., 2.]) + >>> input2.scatter_reduce(0, index, src, reduce="amax") + tensor([5., 6., 5., 2.]) + >>> input2.scatter_reduce(0, index, src, reduce="amax", include_self=False) + tensor([3., 6., 5., 2.]) + """ + ... + @overload + def select(self, dim: _int, index: Union[_int, SymInt]) -> Tensor: + r""" + select(dim, index) -> Tensor + + See :func:`torch.select` + """ + ... + @overload + def select(self, dim: Union[str, ellipsis, None], index: _int) -> Tensor: + r""" + select(dim, index) -> Tensor + + See :func:`torch.select` + """ + ... + def select_scatter(self, src: Tensor, dim: _int, index: Union[_int, SymInt]) -> Tensor: + r""" + select_scatter(src, dim, index) -> Tensor + + See :func:`torch.select_scatter` + """ + ... + @overload + def set_(self, storage: Union[Storage, TypedStorage, UntypedStorage], offset: _int, size: _size, stride: _size) -> Tensor: + r""" + set_(source=None, storage_offset=0, size=None, stride=None) -> Tensor + + Sets the underlying storage, size, and strides. If :attr:`source` is a tensor, + :attr:`self` tensor will share the same storage and have the same size and + strides as :attr:`source`. Changes to elements in one tensor will be reflected + in the other. + + If :attr:`source` is a :class:`~torch.Storage`, the method sets the underlying + storage, offset, size, and stride. + + Args: + source (Tensor or Storage): the tensor or storage to use + storage_offset (int, optional): the offset in the storage + size (torch.Size, optional): the desired size. Defaults to the size of the source. + stride (tuple, optional): the desired stride. Defaults to C-contiguous strides. + """ + ... + @overload + def set_(self, storage: Union[Storage, TypedStorage, UntypedStorage]) -> Tensor: + r""" + set_(source=None, storage_offset=0, size=None, stride=None) -> Tensor + + Sets the underlying storage, size, and strides. If :attr:`source` is a tensor, + :attr:`self` tensor will share the same storage and have the same size and + strides as :attr:`source`. Changes to elements in one tensor will be reflected + in the other. + + If :attr:`source` is a :class:`~torch.Storage`, the method sets the underlying + storage, offset, size, and stride. + + Args: + source (Tensor or Storage): the tensor or storage to use + storage_offset (int, optional): the offset in the storage + size (torch.Size, optional): the desired size. Defaults to the size of the source. + stride (tuple, optional): the desired stride. Defaults to C-contiguous strides. + """ + ... + def sgn(self) -> Tensor: + r""" + sgn() -> Tensor + + See :func:`torch.sgn` + """ + ... + def sgn_(self) -> Tensor: + r""" + sgn_() -> Tensor + + In-place version of :meth:`~Tensor.sgn` + """ + ... + def short(self) -> Tensor: + r""" + short(memory_format=torch.preserve_format) -> Tensor + + ``self.short()`` is equivalent to ``self.to(torch.int16)``. See :func:`to`. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + """ + ... + def sigmoid(self) -> Tensor: + r""" + sigmoid() -> Tensor + + See :func:`torch.sigmoid` + """ + ... + def sigmoid_(self) -> Tensor: + r""" + sigmoid_() -> Tensor + + In-place version of :meth:`~Tensor.sigmoid` + """ + ... + def sign(self) -> Tensor: + r""" + sign() -> Tensor + + See :func:`torch.sign` + """ + ... + def sign_(self) -> Tensor: + r""" + sign_() -> Tensor + + In-place version of :meth:`~Tensor.sign` + """ + ... + def signbit(self) -> Tensor: + r""" + signbit() -> Tensor + + See :func:`torch.signbit` + """ + ... + def sin(self) -> Tensor: + r""" + sin() -> Tensor + + See :func:`torch.sin` + """ + ... + def sin_(self) -> Tensor: + r""" + sin_() -> Tensor + + In-place version of :meth:`~Tensor.sin` + """ + ... + def sinc(self) -> Tensor: + r""" + sinc() -> Tensor + + See :func:`torch.sinc` + """ + ... + def sinc_(self) -> Tensor: + r""" + sinc_() -> Tensor + + In-place version of :meth:`~Tensor.sinc` + """ + ... + def sinh(self) -> Tensor: + r""" + sinh() -> Tensor + + See :func:`torch.sinh` + """ + ... + def sinh_(self) -> Tensor: + r""" + sinh_() -> Tensor + + In-place version of :meth:`~Tensor.sinh` + """ + ... + @overload + def size(self, dim: None = None) -> Size: + r""" + size(dim=None) -> torch.Size or int + + Returns the size of the :attr:`self` tensor. If ``dim`` is not specified, + the returned value is a :class:`torch.Size`, a subclass of :class:`tuple`. + If ``dim`` is specified, returns an int holding the size of that dimension. + + Args: + dim (int, optional): The dimension for which to retrieve the size. + + Example:: + + >>> t = torch.empty(3, 4, 5) + >>> t.size() + torch.Size([3, 4, 5]) + >>> t.size(dim=1) + 4 + """ + ... + @overload + def size(self, dim: _int) -> _int: + r""" + size(dim=None) -> torch.Size or int + + Returns the size of the :attr:`self` tensor. If ``dim`` is not specified, + the returned value is a :class:`torch.Size`, a subclass of :class:`tuple`. + If ``dim`` is specified, returns an int holding the size of that dimension. + + Args: + dim (int, optional): The dimension for which to retrieve the size. + + Example:: + + >>> t = torch.empty(3, 4, 5) + >>> t.size() + torch.Size([3, 4, 5]) + >>> t.size(dim=1) + 4 + """ + ... + def slice_inverse(self, src: Tensor, dim: _int = 0, start: Optional[Union[_int, SymInt]] = None, end: Optional[Union[_int, SymInt]] = None, step: Union[_int, SymInt] = 1) -> Tensor: ... + def slice_scatter(self, src: Tensor, dim: _int = 0, start: Optional[Union[_int, SymInt]] = None, end: Optional[Union[_int, SymInt]] = None, step: Union[_int, SymInt] = 1) -> Tensor: + r""" + slice_scatter(src, dim=0, start=None, end=None, step=1) -> Tensor + + See :func:`torch.slice_scatter` + """ + ... + def slogdet(self) -> torch.return_types.slogdet: + r""" + slogdet() -> (Tensor, Tensor) + + See :func:`torch.slogdet` + """ + ... + def smm(self, mat2: Tensor) -> Tensor: + r""" + smm(mat) -> Tensor + + See :func:`torch.smm` + """ + ... + @overload + def softmax(self, dim: _int, dtype: Optional[_dtype] = None) -> Tensor: + r""" + softmax(dim) -> Tensor + + Alias for :func:`torch.nn.functional.softmax`. + """ + ... + @overload + def softmax(self, dim: Union[str, ellipsis, None], *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + softmax(dim) -> Tensor + + Alias for :func:`torch.nn.functional.softmax`. + """ + ... + @overload + def sort(self, *, stable: Optional[_bool], dim: _int = -1, descending: _bool = False) -> torch.return_types.sort: + r""" + sort(dim=-1, descending=False) -> (Tensor, LongTensor) + + See :func:`torch.sort` + """ + ... + @overload + def sort(self, dim: _int = -1, descending: _bool = False) -> torch.return_types.sort: + r""" + sort(dim=-1, descending=False) -> (Tensor, LongTensor) + + See :func:`torch.sort` + """ + ... + @overload + def sort(self, *, stable: Optional[_bool], dim: Union[str, ellipsis, None], descending: _bool = False) -> torch.return_types.sort: + r""" + sort(dim=-1, descending=False) -> (Tensor, LongTensor) + + See :func:`torch.sort` + """ + ... + @overload + def sort(self, dim: Union[str, ellipsis, None], descending: _bool = False) -> torch.return_types.sort: + r""" + sort(dim=-1, descending=False) -> (Tensor, LongTensor) + + See :func:`torch.sort` + """ + ... + def sparse_dim(self) -> _int: + r""" + sparse_dim() -> int + + Return the number of sparse dimensions in a :ref:`sparse tensor ` :attr:`self`. + + .. note:: + Returns ``0`` if :attr:`self` is not a sparse tensor. + + See also :meth:`Tensor.dense_dim` and :ref:`hybrid tensors `. + """ + ... + def sparse_mask(self, mask: Tensor) -> Tensor: + r""" + sparse_mask(mask) -> Tensor + + Returns a new :ref:`sparse tensor ` with values from a + strided tensor :attr:`self` filtered by the indices of the sparse + tensor :attr:`mask`. The values of :attr:`mask` sparse tensor are + ignored. :attr:`self` and :attr:`mask` tensors must have the same + shape. + + .. note:: + + The returned sparse tensor might contain duplicate values if :attr:`mask` + is not coalesced. It is therefore advisable to pass ``mask.coalesce()`` + if such behavior is not desired. + + .. note:: + + The returned sparse tensor has the same indices as the sparse tensor + :attr:`mask`, even when the corresponding values in :attr:`self` are + zeros. + + Args: + mask (Tensor): a sparse tensor whose indices are used as a filter + + Example:: + + >>> nse = 5 + >>> dims = (5, 5, 2, 2) + >>> I = torch.cat([torch.randint(0, dims[0], size=(nse,)), + ... torch.randint(0, dims[1], size=(nse,))], 0).reshape(2, nse) + >>> V = torch.randn(nse, dims[2], dims[3]) + >>> S = torch.sparse_coo_tensor(I, V, dims).coalesce() + >>> D = torch.randn(dims) + >>> D.sparse_mask(S) + tensor(indices=tensor([[0, 0, 0, 2], + [0, 1, 4, 3]]), + values=tensor([[[ 1.6550, 0.2397], + [-0.1611, -0.0779]], + + [[ 0.2326, -1.0558], + [ 1.4711, 1.9678]], + + [[-0.5138, -0.0411], + [ 1.9417, 0.5158]], + + [[ 0.0793, 0.0036], + [-0.2569, -0.1055]]]), + size=(5, 5, 2, 2), nnz=4, layout=torch.sparse_coo) + """ + ... + def sparse_resize_(self, size: _size, sparse_dim: _int, dense_dim: _int) -> Tensor: + r""" + sparse_resize_(size, sparse_dim, dense_dim) -> Tensor + + Resizes :attr:`self` :ref:`sparse tensor ` to the desired + size and the number of sparse and dense dimensions. + + .. note:: + If the number of specified elements in :attr:`self` is zero, then + :attr:`size`, :attr:`sparse_dim`, and :attr:`dense_dim` can be any + size and positive integers such that ``len(size) == sparse_dim + + dense_dim``. + + If :attr:`self` specifies one or more elements, however, then each + dimension in :attr:`size` must not be smaller than the corresponding + dimension of :attr:`self`, :attr:`sparse_dim` must equal the number + of sparse dimensions in :attr:`self`, and :attr:`dense_dim` must + equal the number of dense dimensions in :attr:`self`. + + .. warning:: + Throws an error if :attr:`self` is not a sparse tensor. + + Args: + size (torch.Size): the desired size. If :attr:`self` is non-empty + sparse tensor, the desired size cannot be smaller than the + original size. + sparse_dim (int): the number of sparse dimensions + dense_dim (int): the number of dense dimensions + """ + ... + def sparse_resize_and_clear_(self, size: _size, sparse_dim: _int, dense_dim: _int) -> Tensor: + r""" + sparse_resize_and_clear_(size, sparse_dim, dense_dim) -> Tensor + + Removes all specified elements from a :ref:`sparse tensor + ` :attr:`self` and resizes :attr:`self` to the desired + size and the number of sparse and dense dimensions. + + .. warning: + Throws an error if :attr:`self` is not a sparse tensor. + + Args: + size (torch.Size): the desired size. + sparse_dim (int): the number of sparse dimensions + dense_dim (int): the number of dense dimensions + """ + ... + @overload + def split(self, split_size: _int, dim: _int = 0) -> Sequence[Tensor]: ... + @overload + def split(self, split_size: Tuple[_int, ...], dim: _int = 0) -> Sequence[Tensor]: ... + def split_with_sizes(self, split_sizes: Sequence[Union[_int, SymInt]], dim: _int = 0) -> Tuple[Tensor, ...]: ... + def sqrt(self) -> Tensor: + r""" + sqrt() -> Tensor + + See :func:`torch.sqrt` + """ + ... + def sqrt_(self) -> Tensor: + r""" + sqrt_() -> Tensor + + In-place version of :meth:`~Tensor.sqrt` + """ + ... + def square(self) -> Tensor: + r""" + square() -> Tensor + + See :func:`torch.square` + """ + ... + def square_(self) -> Tensor: + r""" + square_() -> Tensor + + In-place version of :meth:`~Tensor.square` + """ + ... + @overload + def squeeze(self) -> Tensor: + r""" + squeeze(dim=None) -> Tensor + + See :func:`torch.squeeze` + """ + ... + @overload + def squeeze(self, dim: _int) -> Tensor: + r""" + squeeze(dim=None) -> Tensor + + See :func:`torch.squeeze` + """ + ... + @overload + def squeeze(self, dim: _size) -> Tensor: + r""" + squeeze(dim=None) -> Tensor + + See :func:`torch.squeeze` + """ + ... + @overload + def squeeze(self, *dim: _int) -> Tensor: + r""" + squeeze(dim=None) -> Tensor + + See :func:`torch.squeeze` + """ + ... + @overload + def squeeze(self, dim: Union[str, ellipsis, None]) -> Tensor: + r""" + squeeze(dim=None) -> Tensor + + See :func:`torch.squeeze` + """ + ... + @overload + def squeeze_(self) -> Tensor: + r""" + squeeze_(dim=None) -> Tensor + + In-place version of :meth:`~Tensor.squeeze` + """ + ... + @overload + def squeeze_(self, dim: _int) -> Tensor: + r""" + squeeze_(dim=None) -> Tensor + + In-place version of :meth:`~Tensor.squeeze` + """ + ... + @overload + def squeeze_(self, dim: _size) -> Tensor: + r""" + squeeze_(dim=None) -> Tensor + + In-place version of :meth:`~Tensor.squeeze` + """ + ... + @overload + def squeeze_(self, *dim: _int) -> Tensor: + r""" + squeeze_(dim=None) -> Tensor + + In-place version of :meth:`~Tensor.squeeze` + """ + ... + @overload + def squeeze_(self, dim: Union[str, ellipsis, None]) -> Tensor: + r""" + squeeze_(dim=None) -> Tensor + + In-place version of :meth:`~Tensor.squeeze` + """ + ... + def sspaddmm(self, mat1: Tensor, mat2: Tensor, *, beta: Union[Number, _complex] = 1, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + sspaddmm(mat1, mat2, *, beta=1, alpha=1) -> Tensor + + See :func:`torch.sspaddmm` + """ + ... + @overload + def std(self, dim: Optional[Union[_int, _size]], unbiased: _bool = True, keepdim: _bool = False) -> Tensor: + r""" + std(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.std` + """ + ... + @overload + def std(self, dim: Optional[Union[_int, _size]] = None, *, correction: Optional[Union[Number, _complex]] = None, keepdim: _bool = False) -> Tensor: + r""" + std(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.std` + """ + ... + @overload + def std(self, unbiased: _bool = True) -> Tensor: + r""" + std(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.std` + """ + ... + @overload + def std(self, dim: Sequence[Union[str, ellipsis, None]], unbiased: _bool = True, keepdim: _bool = False) -> Tensor: + r""" + std(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.std` + """ + ... + @overload + def std(self, dim: Sequence[Union[str, ellipsis, None]], *, correction: Optional[Union[Number, _complex]] = None, keepdim: _bool = False) -> Tensor: + r""" + std(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.std` + """ + ... + def untyped_storage(self) -> UntypedStorage: ... + def storage_offset(self) -> _int: + r""" + storage_offset() -> int + + Returns :attr:`self` tensor's offset in the underlying storage in terms of + number of storage elements (not bytes). + + Example:: + + >>> x = torch.tensor([1, 2, 3, 4, 5]) + >>> x.storage_offset() + 0 + >>> x[3:].storage_offset() + 3 + """ + ... + def storage_type(self) -> Storage: ... + @overload + def stride(self, dim: None = None) -> Tuple[_int, ...]: + r""" + stride(dim) -> tuple or int + + Returns the stride of :attr:`self` tensor. + + Stride is the jump necessary to go from one element to the next one in the + specified dimension :attr:`dim`. A tuple of all strides is returned when no + argument is passed in. Otherwise, an integer value is returned as the stride in + the particular dimension :attr:`dim`. + + Args: + dim (int, optional): the desired dimension in which stride is required + + Example:: + + >>> x = torch.tensor([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]]) + >>> x.stride() + (5, 1) + >>> x.stride(0) + 5 + >>> x.stride(-1) + 1 + """ + ... + @overload + def stride(self, dim: _int) -> _int: + r""" + stride(dim) -> tuple or int + + Returns the stride of :attr:`self` tensor. + + Stride is the jump necessary to go from one element to the next one in the + specified dimension :attr:`dim`. A tuple of all strides is returned when no + argument is passed in. Otherwise, an integer value is returned as the stride in + the particular dimension :attr:`dim`. + + Args: + dim (int, optional): the desired dimension in which stride is required + + Example:: + + >>> x = torch.tensor([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]]) + >>> x.stride() + (5, 1) + >>> x.stride(0) + 5 + >>> x.stride(-1) + 1 + """ + ... + def sub(self, other: Union[Tensor, Number, _complex, torch.SymInt, torch.SymFloat], *, alpha: Optional[Union[Number, _complex]] = 1, out: Optional[Tensor] = None) -> Tensor: + r""" + sub(other, *, alpha=1) -> Tensor + + See :func:`torch.sub`. + """ + ... + def sub_(self, other: Union[Tensor, Number, _complex, torch.SymInt, torch.SymFloat], *, alpha: Optional[Union[Number, _complex]] = 1) -> Tensor: + r""" + sub_(other, *, alpha=1) -> Tensor + + In-place version of :meth:`~Tensor.sub` + """ + ... + @overload + def subtract(self, other: Tensor, *, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + subtract(other, *, alpha=1) -> Tensor + + See :func:`torch.subtract`. + """ + ... + @overload + def subtract(self, other: Union[Number, _complex], alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + subtract(other, *, alpha=1) -> Tensor + + See :func:`torch.subtract`. + """ + ... + @overload + def subtract_(self, other: Tensor, *, alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + subtract_(other, *, alpha=1) -> Tensor + + In-place version of :meth:`~Tensor.subtract`. + """ + ... + @overload + def subtract_(self, other: Union[Number, _complex], alpha: Union[Number, _complex] = 1) -> Tensor: + r""" + subtract_(other, *, alpha=1) -> Tensor + + In-place version of :meth:`~Tensor.subtract`. + """ + ... + @overload + def sum(self, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + sum(dim=None, keepdim=False, dtype=None) -> Tensor + + See :func:`torch.sum` + """ + ... + @overload + def sum(self, dim: Optional[Union[_int, _size]], keepdim: _bool = False, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + sum(dim=None, keepdim=False, dtype=None) -> Tensor + + See :func:`torch.sum` + """ + ... + @overload + def sum(self, dim: Sequence[Union[str, ellipsis, None]], keepdim: _bool = False, *, dtype: Optional[_dtype] = None) -> Tensor: + r""" + sum(dim=None, keepdim=False, dtype=None) -> Tensor + + See :func:`torch.sum` + """ + ... + @overload + def sum_to_size(self, size: Sequence[Union[_int, SymInt]]) -> Tensor: + r""" + sum_to_size(*size) -> Tensor + + Sum ``this`` tensor to :attr:`size`. + :attr:`size` must be broadcastable to ``this`` tensor size. + + Args: + size (int...): a sequence of integers defining the shape of the output tensor. + """ + ... + @overload + def sum_to_size(self, *size: _int) -> Tensor: + r""" + sum_to_size(*size) -> Tensor + + Sum ``this`` tensor to :attr:`size`. + :attr:`size` must be broadcastable to ``this`` tensor size. + + Args: + size (int...): a sequence of integers defining the shape of the output tensor. + """ + ... + def svd(self, some: _bool = True, compute_uv: _bool = True) -> torch.return_types.svd: + r""" + svd(some=True, compute_uv=True) -> (Tensor, Tensor, Tensor) + + See :func:`torch.svd` + """ + ... + def swapaxes(self, axis0: _int, axis1: _int) -> Tensor: + r""" + swapaxes(axis0, axis1) -> Tensor + + See :func:`torch.swapaxes` + """ + ... + def swapaxes_(self, axis0: _int, axis1: _int) -> Tensor: + r""" + swapaxes_(axis0, axis1) -> Tensor + + In-place version of :meth:`~Tensor.swapaxes` + """ + ... + def swapdims(self, dim0: _int, dim1: _int) -> Tensor: + r""" + swapdims(dim0, dim1) -> Tensor + + See :func:`torch.swapdims` + """ + ... + def swapdims_(self, dim0: _int, dim1: _int) -> Tensor: + r""" + swapdims_(dim0, dim1) -> Tensor + + In-place version of :meth:`~Tensor.swapdims` + """ + ... + def t(self) -> Tensor: + r""" + t() -> Tensor + + See :func:`torch.t` + """ + ... + def t_(self) -> Tensor: + r""" + t_() -> Tensor + + In-place version of :meth:`~Tensor.t` + """ + ... + def take(self, index: Tensor) -> Tensor: + r""" + take(indices) -> Tensor + + See :func:`torch.take` + """ + ... + def take_along_dim(self, indices: Tensor, dim: Optional[_int] = None) -> Tensor: + r""" + take_along_dim(indices, dim) -> Tensor + + See :func:`torch.take_along_dim` + """ + ... + def tan(self) -> Tensor: + r""" + tan() -> Tensor + + See :func:`torch.tan` + """ + ... + def tan_(self) -> Tensor: + r""" + tan_() -> Tensor + + In-place version of :meth:`~Tensor.tan` + """ + ... + def tanh(self) -> Tensor: + r""" + tanh() -> Tensor + + See :func:`torch.tanh` + """ + ... + def tanh_(self) -> Tensor: + r""" + tanh_() -> Tensor + + In-place version of :meth:`~Tensor.tanh` + """ + ... + @overload + def tensor_split(self, indices: Sequence[Union[_int, SymInt]], dim: _int = 0) -> Tuple[Tensor, ...]: + r""" + tensor_split(indices_or_sections, dim=0) -> List of Tensors + + See :func:`torch.tensor_split` + """ + ... + @overload + def tensor_split(self, tensor_indices_or_sections: Tensor, dim: _int = 0) -> Tuple[Tensor, ...]: + r""" + tensor_split(indices_or_sections, dim=0) -> List of Tensors + + See :func:`torch.tensor_split` + """ + ... + @overload + def tensor_split(self, sections: Union[_int, SymInt], dim: _int = 0) -> Tuple[Tensor, ...]: + r""" + tensor_split(indices_or_sections, dim=0) -> List of Tensors + + See :func:`torch.tensor_split` + """ + ... + @overload + def tile(self, dims: Sequence[Union[_int, SymInt]]) -> Tensor: + r""" + tile(dims) -> Tensor + + See :func:`torch.tile` + """ + ... + @overload + def tile(self, *dims: _int) -> Tensor: + r""" + tile(dims) -> Tensor + + See :func:`torch.tile` + """ + ... + @overload + def to(self, dtype: _dtype, non_blocking: _bool = False, copy: _bool = False, *, memory_format: Optional[torch.memory_format] = None) -> Tensor: + r""" + to(*args, **kwargs) -> Tensor + + Performs Tensor dtype and/or device conversion. A :class:`torch.dtype` and :class:`torch.device` are + inferred from the arguments of ``self.to(*args, **kwargs)``. + + .. note:: + + If the ``self`` Tensor already + has the correct :class:`torch.dtype` and :class:`torch.device`, then ``self`` is returned. + Otherwise, the returned tensor is a copy of ``self`` with the desired + :class:`torch.dtype` and :class:`torch.device`. + + Here are the ways to call ``to``: + + .. method:: to(dtype, non_blocking=False, copy=False, memory_format=torch.preserve_format) -> Tensor + :noindex: + + Returns a Tensor with the specified :attr:`dtype` + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + + .. method:: to(device=None, dtype=None, non_blocking=False, copy=False, memory_format=torch.preserve_format) -> Tensor + :noindex: + + Returns a Tensor with the specified :attr:`device` and (optional) + :attr:`dtype`. If :attr:`dtype` is ``None`` it is inferred to be ``self.dtype``. + When :attr:`non_blocking`, tries to convert asynchronously with respect to + the host if possible, e.g., converting a CPU Tensor with pinned memory to a + CUDA Tensor. + When :attr:`copy` is set, a new Tensor is created even when the Tensor + already matches the desired conversion. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + + .. method:: to(other, non_blocking=False, copy=False) -> Tensor + :noindex: + + Returns a Tensor with same :class:`torch.dtype` and :class:`torch.device` as + the Tensor :attr:`other`. When :attr:`non_blocking`, tries to convert + asynchronously with respect to the host if possible, e.g., converting a CPU + Tensor with pinned memory to a CUDA Tensor. + When :attr:`copy` is set, a new Tensor is created even when the Tensor + already matches the desired conversion. + + Example:: + + >>> tensor = torch.randn(2, 2) # Initially dtype=float32, device=cpu + >>> tensor.to(torch.float64) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], dtype=torch.float64) + + >>> cuda0 = torch.device('cuda:0') + >>> tensor.to(cuda0) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], device='cuda:0') + + >>> tensor.to(cuda0, dtype=torch.float64) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0') + + >>> other = torch.randn((), dtype=torch.float64, device=cuda0) + >>> tensor.to(other, non_blocking=True) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0') + """ + ... + @overload + def to(self, device: Optional[DeviceLikeType] = None, dtype: Optional[_dtype] = None, non_blocking: _bool = False, copy: _bool = False, *, memory_format: Optional[torch.memory_format] = None) -> Tensor: + r""" + to(*args, **kwargs) -> Tensor + + Performs Tensor dtype and/or device conversion. A :class:`torch.dtype` and :class:`torch.device` are + inferred from the arguments of ``self.to(*args, **kwargs)``. + + .. note:: + + If the ``self`` Tensor already + has the correct :class:`torch.dtype` and :class:`torch.device`, then ``self`` is returned. + Otherwise, the returned tensor is a copy of ``self`` with the desired + :class:`torch.dtype` and :class:`torch.device`. + + Here are the ways to call ``to``: + + .. method:: to(dtype, non_blocking=False, copy=False, memory_format=torch.preserve_format) -> Tensor + :noindex: + + Returns a Tensor with the specified :attr:`dtype` + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + + .. method:: to(device=None, dtype=None, non_blocking=False, copy=False, memory_format=torch.preserve_format) -> Tensor + :noindex: + + Returns a Tensor with the specified :attr:`device` and (optional) + :attr:`dtype`. If :attr:`dtype` is ``None`` it is inferred to be ``self.dtype``. + When :attr:`non_blocking`, tries to convert asynchronously with respect to + the host if possible, e.g., converting a CPU Tensor with pinned memory to a + CUDA Tensor. + When :attr:`copy` is set, a new Tensor is created even when the Tensor + already matches the desired conversion. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + + .. method:: to(other, non_blocking=False, copy=False) -> Tensor + :noindex: + + Returns a Tensor with same :class:`torch.dtype` and :class:`torch.device` as + the Tensor :attr:`other`. When :attr:`non_blocking`, tries to convert + asynchronously with respect to the host if possible, e.g., converting a CPU + Tensor with pinned memory to a CUDA Tensor. + When :attr:`copy` is set, a new Tensor is created even when the Tensor + already matches the desired conversion. + + Example:: + + >>> tensor = torch.randn(2, 2) # Initially dtype=float32, device=cpu + >>> tensor.to(torch.float64) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], dtype=torch.float64) + + >>> cuda0 = torch.device('cuda:0') + >>> tensor.to(cuda0) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], device='cuda:0') + + >>> tensor.to(cuda0, dtype=torch.float64) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0') + + >>> other = torch.randn((), dtype=torch.float64, device=cuda0) + >>> tensor.to(other, non_blocking=True) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0') + """ + ... + @overload + def to(self, other: Tensor, non_blocking: _bool = False, copy: _bool = False, *, memory_format: Optional[torch.memory_format] = None) -> Tensor: + r""" + to(*args, **kwargs) -> Tensor + + Performs Tensor dtype and/or device conversion. A :class:`torch.dtype` and :class:`torch.device` are + inferred from the arguments of ``self.to(*args, **kwargs)``. + + .. note:: + + If the ``self`` Tensor already + has the correct :class:`torch.dtype` and :class:`torch.device`, then ``self`` is returned. + Otherwise, the returned tensor is a copy of ``self`` with the desired + :class:`torch.dtype` and :class:`torch.device`. + + Here are the ways to call ``to``: + + .. method:: to(dtype, non_blocking=False, copy=False, memory_format=torch.preserve_format) -> Tensor + :noindex: + + Returns a Tensor with the specified :attr:`dtype` + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + + .. method:: to(device=None, dtype=None, non_blocking=False, copy=False, memory_format=torch.preserve_format) -> Tensor + :noindex: + + Returns a Tensor with the specified :attr:`device` and (optional) + :attr:`dtype`. If :attr:`dtype` is ``None`` it is inferred to be ``self.dtype``. + When :attr:`non_blocking`, tries to convert asynchronously with respect to + the host if possible, e.g., converting a CPU Tensor with pinned memory to a + CUDA Tensor. + When :attr:`copy` is set, a new Tensor is created even when the Tensor + already matches the desired conversion. + + Args: + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.preserve_format``. + + .. method:: to(other, non_blocking=False, copy=False) -> Tensor + :noindex: + + Returns a Tensor with same :class:`torch.dtype` and :class:`torch.device` as + the Tensor :attr:`other`. When :attr:`non_blocking`, tries to convert + asynchronously with respect to the host if possible, e.g., converting a CPU + Tensor with pinned memory to a CUDA Tensor. + When :attr:`copy` is set, a new Tensor is created even when the Tensor + already matches the desired conversion. + + Example:: + + >>> tensor = torch.randn(2, 2) # Initially dtype=float32, device=cpu + >>> tensor.to(torch.float64) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], dtype=torch.float64) + + >>> cuda0 = torch.device('cuda:0') + >>> tensor.to(cuda0) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], device='cuda:0') + + >>> tensor.to(cuda0, dtype=torch.float64) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0') + + >>> other = torch.randn((), dtype=torch.float64, device=cuda0) + >>> tensor.to(other, non_blocking=True) + tensor([[-0.5044, 0.0005], + [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0') + """ + ... + def to_dense(self, dtype: Optional[_dtype] = None, *, masked_grad: Optional[_bool] = None) -> Tensor: + r""" + to_dense(dtype=None, *, masked_grad=True) -> Tensor + + Creates a strided copy of :attr:`self` if :attr:`self` is not a strided tensor, otherwise returns :attr:`self`. + + Keyword args: + {dtype} + masked_grad (bool, optional): If set to ``True`` (default) and + :attr:`self` has a sparse layout then the backward of + :meth:`to_dense` returns ``grad.sparse_mask(self)``. + + Example:: + + >>> s = torch.sparse_coo_tensor( + ... torch.tensor([[1, 1], + ... [0, 2]]), + ... torch.tensor([9, 10]), + ... size=(3, 3)) + >>> s.to_dense() + tensor([[ 0, 0, 0], + [ 9, 0, 10], + [ 0, 0, 0]]) + """ + ... + def to_mkldnn(self, dtype: Optional[_dtype] = None) -> Tensor: + r""" + to_mkldnn() -> Tensor + Returns a copy of the tensor in ``torch.mkldnn`` layout. + """ + ... + def to_padded_tensor(self, padding: _float, output_size: Optional[Sequence[Union[_int, SymInt]]] = None) -> Tensor: + r""" + to_padded_tensor(padding, output_size=None) -> Tensor + See :func:`to_padded_tensor` + """ + ... + @overload + def to_sparse(self, *, layout: Optional[_layout] = None, blocksize: Optional[Union[_int, _size]] = None, dense_dim: Optional[_int] = None) -> Tensor: + r""" + to_sparse(sparseDims) -> Tensor + + Returns a sparse copy of the tensor. PyTorch supports sparse tensors in + :ref:`coordinate format `. + + Args: + sparseDims (int, optional): the number of sparse dimensions to include in the new sparse tensor + + Example:: + + >>> d = torch.tensor([[0, 0, 0], [9, 0, 10], [0, 0, 0]]) + >>> d + tensor([[ 0, 0, 0], + [ 9, 0, 10], + [ 0, 0, 0]]) + >>> d.to_sparse() + tensor(indices=tensor([[1, 1], + [0, 2]]), + values=tensor([ 9, 10]), + size=(3, 3), nnz=2, layout=torch.sparse_coo) + >>> d.to_sparse(1) + tensor(indices=tensor([[1]]), + values=tensor([[ 9, 0, 10]]), + size=(3, 3), nnz=1, layout=torch.sparse_coo) + + .. method:: to_sparse(*, layout=None, blocksize=None, dense_dim=None) -> Tensor + :noindex: + + Returns a sparse tensor with the specified layout and blocksize. If + the :attr:`self` is strided, the number of dense dimensions could be + specified, and a hybrid sparse tensor will be created, with + `dense_dim` dense dimensions and `self.dim() - 2 - dense_dim` batch + dimension. + + .. note:: If the :attr:`self` layout and blocksize parameters match + with the specified layout and blocksize, return + :attr:`self`. Otherwise, return a sparse tensor copy of + :attr:`self`. + + Args: + + layout (:class:`torch.layout`, optional): The desired sparse + layout. One of ``torch.sparse_coo``, ``torch.sparse_csr``, + ``torch.sparse_csc``, ``torch.sparse_bsr``, or + ``torch.sparse_bsc``. Default: if ``None``, + ``torch.sparse_coo``. + + blocksize (list, tuple, :class:`torch.Size`, optional): Block size + of the resulting BSR or BSC tensor. For other layouts, + specifying the block size that is not ``None`` will result in a + RuntimeError exception. A block size must be a tuple of length + two such that its items evenly divide the two sparse dimensions. + + dense_dim (int, optional): Number of dense dimensions of the + resulting CSR, CSC, BSR or BSC tensor. This argument should be + used only if :attr:`self` is a strided tensor, and must be a + value between 0 and dimension of :attr:`self` tensor minus two. + + Example:: + + >>> x = torch.tensor([[1, 0], [0, 0], [2, 3]]) + >>> x.to_sparse(layout=torch.sparse_coo) + tensor(indices=tensor([[0, 2, 2], + [0, 0, 1]]), + values=tensor([1, 2, 3]), + size=(3, 2), nnz=3, layout=torch.sparse_coo) + >>> x.to_sparse(layout=torch.sparse_bsr, blocksize=(1, 2)) + tensor(crow_indices=tensor([0, 1, 1, 2]), + col_indices=tensor([0, 0]), + values=tensor([[[1, 0]], + [[2, 3]]]), size=(3, 2), nnz=2, layout=torch.sparse_bsr) + >>> x.to_sparse(layout=torch.sparse_bsr, blocksize=(2, 1)) + RuntimeError: Tensor size(-2) 3 needs to be divisible by blocksize[0] 2 + >>> x.to_sparse(layout=torch.sparse_csr, blocksize=(3, 1)) + RuntimeError: to_sparse for Strided to SparseCsr conversion does not use specified blocksize + + >>> x = torch.tensor([[[1], [0]], [[0], [0]], [[2], [3]]]) + >>> x.to_sparse(layout=torch.sparse_csr, dense_dim=1) + tensor(crow_indices=tensor([0, 1, 1, 3]), + col_indices=tensor([0, 0, 1]), + values=tensor([[1], + [2], + [3]]), size=(3, 2, 1), nnz=3, layout=torch.sparse_csr) + """ + ... + @overload + def to_sparse(self, sparse_dim: _int) -> Tensor: + r""" + to_sparse(sparseDims) -> Tensor + + Returns a sparse copy of the tensor. PyTorch supports sparse tensors in + :ref:`coordinate format `. + + Args: + sparseDims (int, optional): the number of sparse dimensions to include in the new sparse tensor + + Example:: + + >>> d = torch.tensor([[0, 0, 0], [9, 0, 10], [0, 0, 0]]) + >>> d + tensor([[ 0, 0, 0], + [ 9, 0, 10], + [ 0, 0, 0]]) + >>> d.to_sparse() + tensor(indices=tensor([[1, 1], + [0, 2]]), + values=tensor([ 9, 10]), + size=(3, 3), nnz=2, layout=torch.sparse_coo) + >>> d.to_sparse(1) + tensor(indices=tensor([[1]]), + values=tensor([[ 9, 0, 10]]), + size=(3, 3), nnz=1, layout=torch.sparse_coo) + + .. method:: to_sparse(*, layout=None, blocksize=None, dense_dim=None) -> Tensor + :noindex: + + Returns a sparse tensor with the specified layout and blocksize. If + the :attr:`self` is strided, the number of dense dimensions could be + specified, and a hybrid sparse tensor will be created, with + `dense_dim` dense dimensions and `self.dim() - 2 - dense_dim` batch + dimension. + + .. note:: If the :attr:`self` layout and blocksize parameters match + with the specified layout and blocksize, return + :attr:`self`. Otherwise, return a sparse tensor copy of + :attr:`self`. + + Args: + + layout (:class:`torch.layout`, optional): The desired sparse + layout. One of ``torch.sparse_coo``, ``torch.sparse_csr``, + ``torch.sparse_csc``, ``torch.sparse_bsr``, or + ``torch.sparse_bsc``. Default: if ``None``, + ``torch.sparse_coo``. + + blocksize (list, tuple, :class:`torch.Size`, optional): Block size + of the resulting BSR or BSC tensor. For other layouts, + specifying the block size that is not ``None`` will result in a + RuntimeError exception. A block size must be a tuple of length + two such that its items evenly divide the two sparse dimensions. + + dense_dim (int, optional): Number of dense dimensions of the + resulting CSR, CSC, BSR or BSC tensor. This argument should be + used only if :attr:`self` is a strided tensor, and must be a + value between 0 and dimension of :attr:`self` tensor minus two. + + Example:: + + >>> x = torch.tensor([[1, 0], [0, 0], [2, 3]]) + >>> x.to_sparse(layout=torch.sparse_coo) + tensor(indices=tensor([[0, 2, 2], + [0, 0, 1]]), + values=tensor([1, 2, 3]), + size=(3, 2), nnz=3, layout=torch.sparse_coo) + >>> x.to_sparse(layout=torch.sparse_bsr, blocksize=(1, 2)) + tensor(crow_indices=tensor([0, 1, 1, 2]), + col_indices=tensor([0, 0]), + values=tensor([[[1, 0]], + [[2, 3]]]), size=(3, 2), nnz=2, layout=torch.sparse_bsr) + >>> x.to_sparse(layout=torch.sparse_bsr, blocksize=(2, 1)) + RuntimeError: Tensor size(-2) 3 needs to be divisible by blocksize[0] 2 + >>> x.to_sparse(layout=torch.sparse_csr, blocksize=(3, 1)) + RuntimeError: to_sparse for Strided to SparseCsr conversion does not use specified blocksize + + >>> x = torch.tensor([[[1], [0]], [[0], [0]], [[2], [3]]]) + >>> x.to_sparse(layout=torch.sparse_csr, dense_dim=1) + tensor(crow_indices=tensor([0, 1, 1, 3]), + col_indices=tensor([0, 0, 1]), + values=tensor([[1], + [2], + [3]]), size=(3, 2, 1), nnz=3, layout=torch.sparse_csr) + """ + ... + def to_sparse_bsc(self, blocksize: Union[_int, _size], dense_dim: Optional[_int] = None) -> Tensor: + r""" + to_sparse_bsc(blocksize, dense_dim) -> Tensor + + Convert a tensor to a block sparse column (BSC) storage format of + given blocksize. If the :attr:`self` is strided, then the number of + dense dimensions could be specified, and a hybrid BSC tensor will be + created, with `dense_dim` dense dimensions and `self.dim() - 2 - + dense_dim` batch dimension. + + Args: + + blocksize (list, tuple, :class:`torch.Size`, optional): Block size + of the resulting BSC tensor. A block size must be a tuple of + length two such that its items evenly divide the two sparse + dimensions. + + dense_dim (int, optional): Number of dense dimensions of the + resulting BSC tensor. This argument should be used only if + :attr:`self` is a strided tensor, and must be a value between 0 + and dimension of :attr:`self` tensor minus two. + + Example:: + + >>> dense = torch.randn(10, 10) + >>> sparse = dense.to_sparse_csr() + >>> sparse_bsc = sparse.to_sparse_bsc((5, 5)) + >>> sparse_bsc.row_indices() + tensor([0, 1, 0, 1]) + + >>> dense = torch.zeros(4, 3, 1) + >>> dense[0:2, 0] = dense[0:2, 2] = dense[2:4, 1] = 1 + >>> dense.to_sparse_bsc((2, 1), 1) + tensor(ccol_indices=tensor([0, 1, 2, 3]), + row_indices=tensor([0, 1, 0]), + values=tensor([[[[1.]], + + [[1.]]], + + + [[[1.]], + + [[1.]]], + + + [[[1.]], + + [[1.]]]]), size=(4, 3, 1), nnz=3, + layout=torch.sparse_bsc) + """ + ... + def to_sparse_bsr(self, blocksize: Union[_int, _size], dense_dim: Optional[_int] = None) -> Tensor: + r""" + to_sparse_bsr(blocksize, dense_dim) -> Tensor + + Convert a tensor to a block sparse row (BSR) storage format of given + blocksize. If the :attr:`self` is strided, then the number of dense + dimensions could be specified, and a hybrid BSR tensor will be + created, with `dense_dim` dense dimensions and `self.dim() - 2 - + dense_dim` batch dimension. + + Args: + + blocksize (list, tuple, :class:`torch.Size`, optional): Block size + of the resulting BSR tensor. A block size must be a tuple of + length two such that its items evenly divide the two sparse + dimensions. + + dense_dim (int, optional): Number of dense dimensions of the + resulting BSR tensor. This argument should be used only if + :attr:`self` is a strided tensor, and must be a value between 0 + and dimension of :attr:`self` tensor minus two. + + Example:: + + >>> dense = torch.randn(10, 10) + >>> sparse = dense.to_sparse_csr() + >>> sparse_bsr = sparse.to_sparse_bsr((5, 5)) + >>> sparse_bsr.col_indices() + tensor([0, 1, 0, 1]) + + >>> dense = torch.zeros(4, 3, 1) + >>> dense[0:2, 0] = dense[0:2, 2] = dense[2:4, 1] = 1 + >>> dense.to_sparse_bsr((2, 1), 1) + tensor(crow_indices=tensor([0, 2, 3]), + col_indices=tensor([0, 2, 1]), + values=tensor([[[[1.]], + + [[1.]]], + + + [[[1.]], + + [[1.]]], + + + [[[1.]], + + [[1.]]]]), size=(4, 3, 1), nnz=3, + layout=torch.sparse_bsr) + """ + ... + def to_sparse_csc(self, dense_dim: Optional[_int] = None) -> Tensor: + r""" + to_sparse_csc() -> Tensor + + Convert a tensor to compressed column storage (CSC) format. Except + for strided tensors, only works with 2D tensors. If the :attr:`self` + is strided, then the number of dense dimensions could be specified, + and a hybrid CSC tensor will be created, with `dense_dim` dense + dimensions and `self.dim() - 2 - dense_dim` batch dimension. + + Args: + + dense_dim (int, optional): Number of dense dimensions of the + resulting CSC tensor. This argument should be used only if + :attr:`self` is a strided tensor, and must be a value between 0 + and dimension of :attr:`self` tensor minus two. + + Example:: + + >>> dense = torch.randn(5, 5) + >>> sparse = dense.to_sparse_csc() + >>> sparse._nnz() + 25 + + >>> dense = torch.zeros(3, 3, 1, 1) + >>> dense[0, 0] = dense[1, 2] = dense[2, 1] = 1 + >>> dense.to_sparse_csc(dense_dim=2) + tensor(ccol_indices=tensor([0, 1, 2, 3]), + row_indices=tensor([0, 2, 1]), + values=tensor([[[1.]], + + [[1.]], + + [[1.]]]), size=(3, 3, 1, 1), nnz=3, + layout=torch.sparse_csc) + """ + ... + def to_sparse_csr(self, dense_dim: Optional[_int] = None) -> Tensor: + r""" + to_sparse_csr(dense_dim=None) -> Tensor + + Convert a tensor to compressed row storage format (CSR). Except for + strided tensors, only works with 2D tensors. If the :attr:`self` is + strided, then the number of dense dimensions could be specified, and a + hybrid CSR tensor will be created, with `dense_dim` dense dimensions + and `self.dim() - 2 - dense_dim` batch dimension. + + Args: + + dense_dim (int, optional): Number of dense dimensions of the + resulting CSR tensor. This argument should be used only if + :attr:`self` is a strided tensor, and must be a value between 0 + and dimension of :attr:`self` tensor minus two. + + Example:: + + >>> dense = torch.randn(5, 5) + >>> sparse = dense.to_sparse_csr() + >>> sparse._nnz() + 25 + + >>> dense = torch.zeros(3, 3, 1, 1) + >>> dense[0, 0] = dense[1, 2] = dense[2, 1] = 1 + >>> dense.to_sparse_csr(dense_dim=2) + tensor(crow_indices=tensor([0, 1, 2, 3]), + col_indices=tensor([0, 2, 1]), + values=tensor([[[1.]], + + [[1.]], + + [[1.]]]), size=(3, 3, 1, 1), nnz=3, + layout=torch.sparse_csr) + """ + ... + def tolist(self) -> List: + r""" + tolist() -> list or number + + Returns the tensor as a (nested) list. For scalars, a standard + Python number is returned, just like with :meth:`~Tensor.item`. + Tensors are automatically moved to the CPU first if necessary. + + This operation is not differentiable. + + Examples:: + + >>> a = torch.randn(2, 2) + >>> a.tolist() + [[0.012766935862600803, 0.5415473580360413], + [-0.08909505605697632, 0.7729271650314331]] + >>> a[0,0].tolist() + 0.012766935862600803 + """ + ... + def topk(self, k: Union[_int, SymInt], dim: _int = -1, largest: _bool = True, sorted: _bool = True) -> torch.return_types.topk: + r""" + topk(k, dim=None, largest=True, sorted=True) -> (Tensor, LongTensor) + + See :func:`torch.topk` + """ + ... + def trace(self) -> Tensor: + r""" + trace() -> Tensor + + See :func:`torch.trace` + """ + ... + @overload + def transpose(self, dim0: _int, dim1: _int) -> Tensor: + r""" + transpose(dim0, dim1) -> Tensor + + See :func:`torch.transpose` + """ + ... + @overload + def transpose(self, dim0: Union[str, ellipsis, None], dim1: Union[str, ellipsis, None]) -> Tensor: + r""" + transpose(dim0, dim1) -> Tensor + + See :func:`torch.transpose` + """ + ... + def transpose_(self, dim0: _int, dim1: _int) -> Tensor: + r""" + transpose_(dim0, dim1) -> Tensor + + In-place version of :meth:`~Tensor.transpose` + """ + ... + def triangular_solve(self, A: Tensor, upper: _bool = True, transpose: _bool = False, unitriangular: _bool = False) -> torch.return_types.triangular_solve: + r""" + triangular_solve(A, upper=True, transpose=False, unitriangular=False) -> (Tensor, Tensor) + + See :func:`torch.triangular_solve` + """ + ... + def tril(self, diagonal: _int = 0) -> Tensor: + r""" + tril(diagonal=0) -> Tensor + + See :func:`torch.tril` + """ + ... + def tril_(self, diagonal: _int = 0) -> Tensor: + r""" + tril_(diagonal=0) -> Tensor + + In-place version of :meth:`~Tensor.tril` + """ + ... + def triu(self, diagonal: _int = 0) -> Tensor: + r""" + triu(diagonal=0) -> Tensor + + See :func:`torch.triu` + """ + ... + def triu_(self, diagonal: _int = 0) -> Tensor: + r""" + triu_(diagonal=0) -> Tensor + + In-place version of :meth:`~Tensor.triu` + """ + ... + def true_divide(self, other: Union[Tensor, Number, torch.SymInt, torch.SymFloat], *, out: Optional[Tensor] = None) -> Tensor: + r""" + true_divide(value) -> Tensor + + See :func:`torch.true_divide` + """ + ... + def true_divide_(self, other: Union[Tensor, Number, torch.SymInt, torch.SymFloat]) -> Tensor: + r""" + true_divide_(value) -> Tensor + + In-place version of :meth:`~Tensor.true_divide_` + """ + ... + def trunc(self) -> Tensor: + r""" + trunc() -> Tensor + + See :func:`torch.trunc` + """ + ... + def trunc_(self) -> Tensor: + r""" + trunc_() -> Tensor + + In-place version of :meth:`~Tensor.trunc` + """ + ... + @overload + def type(self, dtype: None = None, non_blocking: _bool = False) -> str: + r""" + type(dtype=None, non_blocking=False, **kwargs) -> str or Tensor + Returns the type if `dtype` is not provided, else casts this object to + the specified type. + + If this is already of the correct type, no copy is performed and the + original object is returned. + + Args: + dtype (dtype or string): The desired type + non_blocking (bool): If ``True``, and the source is in pinned memory + and destination is on the GPU or vice versa, the copy is performed + asynchronously with respect to the host. Otherwise, the argument + has no effect. + **kwargs: For compatibility, may contain the key ``async`` in place of + the ``non_blocking`` argument. The ``async`` arg is deprecated. + """ + ... + @overload + def type(self, dtype: Union[str, _dtype], non_blocking: _bool = False) -> Tensor: + r""" + type(dtype=None, non_blocking=False, **kwargs) -> str or Tensor + Returns the type if `dtype` is not provided, else casts this object to + the specified type. + + If this is already of the correct type, no copy is performed and the + original object is returned. + + Args: + dtype (dtype or string): The desired type + non_blocking (bool): If ``True``, and the source is in pinned memory + and destination is on the GPU or vice versa, the copy is performed + asynchronously with respect to the host. Otherwise, the argument + has no effect. + **kwargs: For compatibility, may contain the key ``async`` in place of + the ``non_blocking`` argument. The ``async`` arg is deprecated. + """ + ... + def type_as(self, other: Tensor) -> Tensor: + r""" + type_as(tensor) -> Tensor + + Returns this tensor cast to the type of the given tensor. + + This is a no-op if the tensor is already of the correct type. This is + equivalent to ``self.type(tensor.type())`` + + Args: + tensor (Tensor): the tensor which has the desired type + """ + ... + @overload + def unbind(self, dim: _int = 0) -> Tuple[Tensor, ...]: + r""" + unbind(dim=0) -> seq + + See :func:`torch.unbind` + """ + ... + @overload + def unbind(self, dim: Union[str, ellipsis, None]) -> Tuple[Tensor, ...]: + r""" + unbind(dim=0) -> seq + + See :func:`torch.unbind` + """ + ... + @overload + def unflatten(self, dim: Union[str, ellipsis, None], sizes: Sequence[Union[_int, SymInt]], names: Sequence[Union[str, ellipsis, None]]) -> Tensor: ... + @overload + def unflatten(self, dim: _int, sizes: Sequence[Union[_int, SymInt]]) -> Tensor: ... + def unfold(self, dimension: _int, size: _int, step: _int) -> Tensor: + r""" + unfold(dimension, size, step) -> Tensor + + Returns a view of the original tensor which contains all slices of size :attr:`size` from + :attr:`self` tensor in the dimension :attr:`dimension`. + + Step between two slices is given by :attr:`step`. + + If `sizedim` is the size of dimension :attr:`dimension` for :attr:`self`, the size of + dimension :attr:`dimension` in the returned tensor will be + `(sizedim - size) / step + 1`. + + An additional dimension of size :attr:`size` is appended in the returned tensor. + + Args: + dimension (int): dimension in which unfolding happens + size (int): the size of each slice that is unfolded + step (int): the step between each slice + + Example:: + + >>> x = torch.arange(1., 8) + >>> x + tensor([ 1., 2., 3., 4., 5., 6., 7.]) + >>> x.unfold(0, 2, 1) + tensor([[ 1., 2.], + [ 2., 3.], + [ 3., 4.], + [ 4., 5.], + [ 5., 6.], + [ 6., 7.]]) + >>> x.unfold(0, 2, 2) + tensor([[ 1., 2.], + [ 3., 4.], + [ 5., 6.]]) + """ + ... + def uniform_(self, from_: _float = 0, to: _float = 1, *, generator: Optional[Generator] = None) -> Tensor: + r""" + uniform_(from=0, to=1, *, generator=None) -> Tensor + + Fills :attr:`self` tensor with numbers sampled from the continuous uniform + distribution: + + .. math:: + f(x) = \dfrac{1}{\text{to} - \text{from}} + """ + ... + def unsafe_chunk(self, chunks: _int, dim: _int = 0) -> Tuple[Tensor, ...]: + r""" + unsafe_chunk(chunks, dim=0) -> List of Tensors + + See :func:`torch.unsafe_chunk` + """ + ... + def unsafe_split(self, split_size: Union[_int, SymInt], dim: _int = 0) -> Tuple[Tensor, ...]: + r""" + unsafe_split(split_size, dim=0) -> List of Tensors + + See :func:`torch.unsafe_split` + """ + ... + def unsafe_split_with_sizes(self, split_sizes: Sequence[Union[_int, SymInt]], dim: _int = 0) -> Tuple[Tensor, ...]: ... + def unsqueeze(self, dim: _int) -> Tensor: + r""" + unsqueeze(dim) -> Tensor + + See :func:`torch.unsqueeze` + """ + ... + def unsqueeze_(self, dim: _int) -> Tensor: + r""" + unsqueeze_(dim) -> Tensor + + In-place version of :meth:`~Tensor.unsqueeze` + """ + ... + def values(self) -> Tensor: + r""" + values() -> Tensor + + Return the values tensor of a :ref:`sparse COO tensor `. + + .. warning:: + Throws an error if :attr:`self` is not a sparse COO tensor. + + See also :meth:`Tensor.indices`. + + .. note:: + This method can only be called on a coalesced sparse tensor. See + :meth:`Tensor.coalesce` for details. + """ + ... + @overload + def var(self, dim: Optional[Union[_int, _size]], unbiased: _bool = True, keepdim: _bool = False) -> Tensor: + r""" + var(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.var` + """ + ... + @overload + def var(self, dim: Optional[Union[_int, _size]] = None, *, correction: Optional[Union[Number, _complex]] = None, keepdim: _bool = False) -> Tensor: + r""" + var(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.var` + """ + ... + @overload + def var(self, unbiased: _bool = True) -> Tensor: + r""" + var(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.var` + """ + ... + @overload + def var(self, dim: Sequence[Union[str, ellipsis, None]], unbiased: _bool = True, keepdim: _bool = False) -> Tensor: + r""" + var(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.var` + """ + ... + @overload + def var(self, dim: Sequence[Union[str, ellipsis, None]], *, correction: Optional[Union[Number, _complex]] = None, keepdim: _bool = False) -> Tensor: + r""" + var(dim=None, *, correction=1, keepdim=False) -> Tensor + + See :func:`torch.var` + """ + ... + def vdot(self, other: Tensor) -> Tensor: + r""" + vdot(other) -> Tensor + + See :func:`torch.vdot` + """ + ... + @overload + def view(self, dtype: _dtype) -> Tensor: + r""" + view(*shape) -> Tensor + + Returns a new tensor with the same data as the :attr:`self` tensor but of a + different :attr:`shape`. + + The returned tensor shares the same data and must have the same number + of elements, but may have a different size. For a tensor to be viewed, the new + view size must be compatible with its original size and stride, i.e., each new + view dimension must either be a subspace of an original dimension, or only span + across original dimensions :math:`d, d+1, \dots, d+k` that satisfy the following + contiguity-like condition that :math:`\forall i = d, \dots, d+k-1`, + + .. math:: + + \text{stride}[i] = \text{stride}[i+1] \times \text{size}[i+1] + + Otherwise, it will not be possible to view :attr:`self` tensor as :attr:`shape` + without copying it (e.g., via :meth:`contiguous`). When it is unclear whether a + :meth:`view` can be performed, it is advisable to use :meth:`reshape`, which + returns a view if the shapes are compatible, and copies (equivalent to calling + :meth:`contiguous`) otherwise. + + Args: + shape (torch.Size or int...): the desired size + + Example:: + + >>> x = torch.randn(4, 4) + >>> x.size() + torch.Size([4, 4]) + >>> y = x.view(16) + >>> y.size() + torch.Size([16]) + >>> z = x.view(-1, 8) # the size -1 is inferred from other dimensions + >>> z.size() + torch.Size([2, 8]) + + >>> a = torch.randn(1, 2, 3, 4) + >>> a.size() + torch.Size([1, 2, 3, 4]) + >>> b = a.transpose(1, 2) # Swaps 2nd and 3rd dimension + >>> b.size() + torch.Size([1, 3, 2, 4]) + >>> c = a.view(1, 3, 2, 4) # Does not change tensor layout in memory + >>> c.size() + torch.Size([1, 3, 2, 4]) + >>> torch.equal(b, c) + False + + + .. method:: view(dtype) -> Tensor + :noindex: + + Returns a new tensor with the same data as the :attr:`self` tensor but of a + different :attr:`dtype`. + + If the element size of :attr:`dtype` is different than that of ``self.dtype``, + then the size of the last dimension of the output will be scaled + proportionally. For instance, if :attr:`dtype` element size is twice that of + ``self.dtype``, then each pair of elements in the last dimension of + :attr:`self` will be combined, and the size of the last dimension of the output + will be half that of :attr:`self`. If :attr:`dtype` element size is half that + of ``self.dtype``, then each element in the last dimension of :attr:`self` will + be split in two, and the size of the last dimension of the output will be + double that of :attr:`self`. For this to be possible, the following conditions + must be true: + + * ``self.dim()`` must be greater than 0. + * ``self.stride(-1)`` must be 1. + + Additionally, if the element size of :attr:`dtype` is greater than that of + ``self.dtype``, the following conditions must be true as well: + + * ``self.size(-1)`` must be divisible by the ratio between the element + sizes of the dtypes. + * ``self.storage_offset()`` must be divisible by the ratio between the + element sizes of the dtypes. + * The strides of all dimensions, except the last dimension, must be + divisible by the ratio between the element sizes of the dtypes. + + If any of the above conditions are not met, an error is thrown. + + .. warning:: + + This overload is not supported by TorchScript, and using it in a Torchscript + program will cause undefined behavior. + + + Args: + dtype (:class:`torch.dtype`): the desired dtype + + Example:: + + >>> x = torch.randn(4, 4) + >>> x + tensor([[ 0.9482, -0.0310, 1.4999, -0.5316], + [-0.1520, 0.7472, 0.5617, -0.8649], + [-2.4724, -0.0334, -0.2976, -0.8499], + [-0.2109, 1.9913, -0.9607, -0.6123]]) + >>> x.dtype + torch.float32 + + >>> y = x.view(torch.int32) + >>> y + tensor([[ 1064483442, -1124191867, 1069546515, -1089989247], + [-1105482831, 1061112040, 1057999968, -1084397505], + [-1071760287, -1123489973, -1097310419, -1084649136], + [-1101533110, 1073668768, -1082790149, -1088634448]], + dtype=torch.int32) + >>> y[0, 0] = 1000000000 + >>> x + tensor([[ 0.0047, -0.0310, 1.4999, -0.5316], + [-0.1520, 0.7472, 0.5617, -0.8649], + [-2.4724, -0.0334, -0.2976, -0.8499], + [-0.2109, 1.9913, -0.9607, -0.6123]]) + + >>> x.view(torch.cfloat) + tensor([[ 0.0047-0.0310j, 1.4999-0.5316j], + [-0.1520+0.7472j, 0.5617-0.8649j], + [-2.4724-0.0334j, -0.2976-0.8499j], + [-0.2109+1.9913j, -0.9607-0.6123j]]) + >>> x.view(torch.cfloat).size() + torch.Size([4, 2]) + + >>> x.view(torch.uint8) + tensor([[ 0, 202, 154, 59, 182, 243, 253, 188, 185, 252, 191, 63, 240, 22, + 8, 191], + [227, 165, 27, 190, 128, 72, 63, 63, 146, 203, 15, 63, 22, 106, + 93, 191], + [205, 59, 30, 192, 112, 206, 8, 189, 7, 95, 152, 190, 12, 147, + 89, 191], + [ 43, 246, 87, 190, 235, 226, 254, 63, 111, 240, 117, 191, 177, 191, + 28, 191]], dtype=torch.uint8) + >>> x.view(torch.uint8).size() + torch.Size([4, 16]) + """ + ... + @overload + def view(self, size: Sequence[Union[_int, SymInt]]) -> Tensor: + r""" + view(*shape) -> Tensor + + Returns a new tensor with the same data as the :attr:`self` tensor but of a + different :attr:`shape`. + + The returned tensor shares the same data and must have the same number + of elements, but may have a different size. For a tensor to be viewed, the new + view size must be compatible with its original size and stride, i.e., each new + view dimension must either be a subspace of an original dimension, or only span + across original dimensions :math:`d, d+1, \dots, d+k` that satisfy the following + contiguity-like condition that :math:`\forall i = d, \dots, d+k-1`, + + .. math:: + + \text{stride}[i] = \text{stride}[i+1] \times \text{size}[i+1] + + Otherwise, it will not be possible to view :attr:`self` tensor as :attr:`shape` + without copying it (e.g., via :meth:`contiguous`). When it is unclear whether a + :meth:`view` can be performed, it is advisable to use :meth:`reshape`, which + returns a view if the shapes are compatible, and copies (equivalent to calling + :meth:`contiguous`) otherwise. + + Args: + shape (torch.Size or int...): the desired size + + Example:: + + >>> x = torch.randn(4, 4) + >>> x.size() + torch.Size([4, 4]) + >>> y = x.view(16) + >>> y.size() + torch.Size([16]) + >>> z = x.view(-1, 8) # the size -1 is inferred from other dimensions + >>> z.size() + torch.Size([2, 8]) + + >>> a = torch.randn(1, 2, 3, 4) + >>> a.size() + torch.Size([1, 2, 3, 4]) + >>> b = a.transpose(1, 2) # Swaps 2nd and 3rd dimension + >>> b.size() + torch.Size([1, 3, 2, 4]) + >>> c = a.view(1, 3, 2, 4) # Does not change tensor layout in memory + >>> c.size() + torch.Size([1, 3, 2, 4]) + >>> torch.equal(b, c) + False + + + .. method:: view(dtype) -> Tensor + :noindex: + + Returns a new tensor with the same data as the :attr:`self` tensor but of a + different :attr:`dtype`. + + If the element size of :attr:`dtype` is different than that of ``self.dtype``, + then the size of the last dimension of the output will be scaled + proportionally. For instance, if :attr:`dtype` element size is twice that of + ``self.dtype``, then each pair of elements in the last dimension of + :attr:`self` will be combined, and the size of the last dimension of the output + will be half that of :attr:`self`. If :attr:`dtype` element size is half that + of ``self.dtype``, then each element in the last dimension of :attr:`self` will + be split in two, and the size of the last dimension of the output will be + double that of :attr:`self`. For this to be possible, the following conditions + must be true: + + * ``self.dim()`` must be greater than 0. + * ``self.stride(-1)`` must be 1. + + Additionally, if the element size of :attr:`dtype` is greater than that of + ``self.dtype``, the following conditions must be true as well: + + * ``self.size(-1)`` must be divisible by the ratio between the element + sizes of the dtypes. + * ``self.storage_offset()`` must be divisible by the ratio between the + element sizes of the dtypes. + * The strides of all dimensions, except the last dimension, must be + divisible by the ratio between the element sizes of the dtypes. + + If any of the above conditions are not met, an error is thrown. + + .. warning:: + + This overload is not supported by TorchScript, and using it in a Torchscript + program will cause undefined behavior. + + + Args: + dtype (:class:`torch.dtype`): the desired dtype + + Example:: + + >>> x = torch.randn(4, 4) + >>> x + tensor([[ 0.9482, -0.0310, 1.4999, -0.5316], + [-0.1520, 0.7472, 0.5617, -0.8649], + [-2.4724, -0.0334, -0.2976, -0.8499], + [-0.2109, 1.9913, -0.9607, -0.6123]]) + >>> x.dtype + torch.float32 + + >>> y = x.view(torch.int32) + >>> y + tensor([[ 1064483442, -1124191867, 1069546515, -1089989247], + [-1105482831, 1061112040, 1057999968, -1084397505], + [-1071760287, -1123489973, -1097310419, -1084649136], + [-1101533110, 1073668768, -1082790149, -1088634448]], + dtype=torch.int32) + >>> y[0, 0] = 1000000000 + >>> x + tensor([[ 0.0047, -0.0310, 1.4999, -0.5316], + [-0.1520, 0.7472, 0.5617, -0.8649], + [-2.4724, -0.0334, -0.2976, -0.8499], + [-0.2109, 1.9913, -0.9607, -0.6123]]) + + >>> x.view(torch.cfloat) + tensor([[ 0.0047-0.0310j, 1.4999-0.5316j], + [-0.1520+0.7472j, 0.5617-0.8649j], + [-2.4724-0.0334j, -0.2976-0.8499j], + [-0.2109+1.9913j, -0.9607-0.6123j]]) + >>> x.view(torch.cfloat).size() + torch.Size([4, 2]) + + >>> x.view(torch.uint8) + tensor([[ 0, 202, 154, 59, 182, 243, 253, 188, 185, 252, 191, 63, 240, 22, + 8, 191], + [227, 165, 27, 190, 128, 72, 63, 63, 146, 203, 15, 63, 22, 106, + 93, 191], + [205, 59, 30, 192, 112, 206, 8, 189, 7, 95, 152, 190, 12, 147, + 89, 191], + [ 43, 246, 87, 190, 235, 226, 254, 63, 111, 240, 117, 191, 177, 191, + 28, 191]], dtype=torch.uint8) + >>> x.view(torch.uint8).size() + torch.Size([4, 16]) + """ + ... + @overload + def view(self, *size: _int) -> Tensor: + r""" + view(*shape) -> Tensor + + Returns a new tensor with the same data as the :attr:`self` tensor but of a + different :attr:`shape`. + + The returned tensor shares the same data and must have the same number + of elements, but may have a different size. For a tensor to be viewed, the new + view size must be compatible with its original size and stride, i.e., each new + view dimension must either be a subspace of an original dimension, or only span + across original dimensions :math:`d, d+1, \dots, d+k` that satisfy the following + contiguity-like condition that :math:`\forall i = d, \dots, d+k-1`, + + .. math:: + + \text{stride}[i] = \text{stride}[i+1] \times \text{size}[i+1] + + Otherwise, it will not be possible to view :attr:`self` tensor as :attr:`shape` + without copying it (e.g., via :meth:`contiguous`). When it is unclear whether a + :meth:`view` can be performed, it is advisable to use :meth:`reshape`, which + returns a view if the shapes are compatible, and copies (equivalent to calling + :meth:`contiguous`) otherwise. + + Args: + shape (torch.Size or int...): the desired size + + Example:: + + >>> x = torch.randn(4, 4) + >>> x.size() + torch.Size([4, 4]) + >>> y = x.view(16) + >>> y.size() + torch.Size([16]) + >>> z = x.view(-1, 8) # the size -1 is inferred from other dimensions + >>> z.size() + torch.Size([2, 8]) + + >>> a = torch.randn(1, 2, 3, 4) + >>> a.size() + torch.Size([1, 2, 3, 4]) + >>> b = a.transpose(1, 2) # Swaps 2nd and 3rd dimension + >>> b.size() + torch.Size([1, 3, 2, 4]) + >>> c = a.view(1, 3, 2, 4) # Does not change tensor layout in memory + >>> c.size() + torch.Size([1, 3, 2, 4]) + >>> torch.equal(b, c) + False + + + .. method:: view(dtype) -> Tensor + :noindex: + + Returns a new tensor with the same data as the :attr:`self` tensor but of a + different :attr:`dtype`. + + If the element size of :attr:`dtype` is different than that of ``self.dtype``, + then the size of the last dimension of the output will be scaled + proportionally. For instance, if :attr:`dtype` element size is twice that of + ``self.dtype``, then each pair of elements in the last dimension of + :attr:`self` will be combined, and the size of the last dimension of the output + will be half that of :attr:`self`. If :attr:`dtype` element size is half that + of ``self.dtype``, then each element in the last dimension of :attr:`self` will + be split in two, and the size of the last dimension of the output will be + double that of :attr:`self`. For this to be possible, the following conditions + must be true: + + * ``self.dim()`` must be greater than 0. + * ``self.stride(-1)`` must be 1. + + Additionally, if the element size of :attr:`dtype` is greater than that of + ``self.dtype``, the following conditions must be true as well: + + * ``self.size(-1)`` must be divisible by the ratio between the element + sizes of the dtypes. + * ``self.storage_offset()`` must be divisible by the ratio between the + element sizes of the dtypes. + * The strides of all dimensions, except the last dimension, must be + divisible by the ratio between the element sizes of the dtypes. + + If any of the above conditions are not met, an error is thrown. + + .. warning:: + + This overload is not supported by TorchScript, and using it in a Torchscript + program will cause undefined behavior. + + + Args: + dtype (:class:`torch.dtype`): the desired dtype + + Example:: + + >>> x = torch.randn(4, 4) + >>> x + tensor([[ 0.9482, -0.0310, 1.4999, -0.5316], + [-0.1520, 0.7472, 0.5617, -0.8649], + [-2.4724, -0.0334, -0.2976, -0.8499], + [-0.2109, 1.9913, -0.9607, -0.6123]]) + >>> x.dtype + torch.float32 + + >>> y = x.view(torch.int32) + >>> y + tensor([[ 1064483442, -1124191867, 1069546515, -1089989247], + [-1105482831, 1061112040, 1057999968, -1084397505], + [-1071760287, -1123489973, -1097310419, -1084649136], + [-1101533110, 1073668768, -1082790149, -1088634448]], + dtype=torch.int32) + >>> y[0, 0] = 1000000000 + >>> x + tensor([[ 0.0047, -0.0310, 1.4999, -0.5316], + [-0.1520, 0.7472, 0.5617, -0.8649], + [-2.4724, -0.0334, -0.2976, -0.8499], + [-0.2109, 1.9913, -0.9607, -0.6123]]) + + >>> x.view(torch.cfloat) + tensor([[ 0.0047-0.0310j, 1.4999-0.5316j], + [-0.1520+0.7472j, 0.5617-0.8649j], + [-2.4724-0.0334j, -0.2976-0.8499j], + [-0.2109+1.9913j, -0.9607-0.6123j]]) + >>> x.view(torch.cfloat).size() + torch.Size([4, 2]) + + >>> x.view(torch.uint8) + tensor([[ 0, 202, 154, 59, 182, 243, 253, 188, 185, 252, 191, 63, 240, 22, + 8, 191], + [227, 165, 27, 190, 128, 72, 63, 63, 146, 203, 15, 63, 22, 106, + 93, 191], + [205, 59, 30, 192, 112, 206, 8, 189, 7, 95, 152, 190, 12, 147, + 89, 191], + [ 43, 246, 87, 190, 235, 226, 254, 63, 111, 240, 117, 191, 177, 191, + 28, 191]], dtype=torch.uint8) + >>> x.view(torch.uint8).size() + torch.Size([4, 16]) + """ + ... + def view_as(self, other: Tensor) -> Tensor: + r""" + view_as(other) -> Tensor + + View this tensor as the same size as :attr:`other`. + ``self.view_as(other)`` is equivalent to ``self.view(other.size())``. + + Please see :meth:`~Tensor.view` for more information about ``view``. + + Args: + other (:class:`torch.Tensor`): The result tensor has the same size + as :attr:`other`. + """ + ... + @overload + def vsplit(self, sections: _int) -> Tuple[Tensor, ...]: + r""" + vsplit(split_size_or_sections) -> List of Tensors + + See :func:`torch.vsplit` + """ + ... + @overload + def vsplit(self, indices: _size) -> Tuple[Tensor, ...]: + r""" + vsplit(split_size_or_sections) -> List of Tensors + + See :func:`torch.vsplit` + """ + ... + @overload + def vsplit(self, *indices: _int) -> Tuple[Tensor, ...]: + r""" + vsplit(split_size_or_sections) -> List of Tensors + + See :func:`torch.vsplit` + """ + ... + @overload + def where(self, condition: Tensor, other: Tensor) -> Tensor: + r""" + where(condition, y) -> Tensor + + ``self.where(condition, y)`` is equivalent to ``torch.where(condition, self, y)``. + See :func:`torch.where` + """ + ... + @overload + def where(self, condition: Tensor, other: Union[Number, _complex]) -> Tensor: + r""" + where(condition, y) -> Tensor + + ``self.where(condition, y)`` is equivalent to ``torch.where(condition, self, y)``. + See :func:`torch.where` + """ + ... + @overload + def xlogy(self, other: Tensor) -> Tensor: + r""" + xlogy(other) -> Tensor + + See :func:`torch.xlogy` + """ + ... + @overload + def xlogy(self, other: Union[Number, _complex]) -> Tensor: + r""" + xlogy(other) -> Tensor + + See :func:`torch.xlogy` + """ + ... + @overload + def xlogy_(self, other: Tensor) -> Tensor: + r""" + xlogy_(other) -> Tensor + + In-place version of :meth:`~Tensor.xlogy` + """ + ... + @overload + def xlogy_(self, other: Union[Number, _complex]) -> Tensor: + r""" + xlogy_(other) -> Tensor + + In-place version of :meth:`~Tensor.xlogy` + """ + ... + def zero_(self) -> Tensor: + r""" + zero_() -> Tensor + + Fills :attr:`self` tensor with zeros. + """ + ... + +_TensorBase = TensorBase + +# Defined in torch/csrc/multiprocessing/init.cpp +def _multiprocessing_init() -> None: ... + +# Defined in torch/csrc/mps/Module.cpp +def _mps_deviceSynchronize() -> None: ... +def _mps_get_default_generator() -> Generator: ... +def _mps_emptyCache() -> None: ... +def _mps_setMemoryFraction(fraction: _float) -> None: ... +def _mps_currentAllocatedMemory() -> _int: ... +def _mps_driverAllocatedMemory() -> _int: ... +def _mps_is_available() -> _bool: ... +def _mps_is_on_macos_or_newer(major: _int, minor: _int) -> _bool: ... +def _mps_profilerStartTrace(mode: str, wait_until_completed: _bool) -> None: ... +def _mps_profilerStopTrace() -> None: ... +def _mps_acquireEvent(enable_timing: _bool) -> _int: ... +def _mps_releaseEvent(event_id: _int) -> None: ... +def _mps_recordEvent(event_id: _int) -> None: ... +def _mps_waitForEvent(event_id: _int) -> None: ... +def _mps_synchronizeEvent(event_id: _int) -> None: ... +def _mps_queryEvent(event_id: _int) -> _bool: ... +def _mps_elapsedTimeOfEvents(start_event_id: _int, end_event_id: _int) -> _float: ... + + +# Defined in torch/csrc/cuda/Module.cpp +def _cuda_getCurrentStream(device: _int) -> Tuple: ... +def _cuda_getCurrentRawStream(device: _int) -> _int: ... +def _cuda_getDefaultStream(device: _int) -> Tuple: ... +def _cuda_getCurrentBlasHandle() -> _int: ... +def _cuda_clearCublasWorkspaces() -> None: ... +def _cuda_setDevice(device: _int) -> None: ... +def _cuda_exchangeDevice(device: _int) -> _int: ... +def _cuda_maybeExchangeDevice(device: _int) -> _int: ... +def _cuda_getDevice() -> _int: ... +def _cuda_getDeviceCount() -> _int: ... +def _cuda_set_sync_debug_mode(warn_level: Union[_int, str]) -> None: ... +def _cuda_get_sync_debug_mode() -> _int: ... +def _cuda_sleep(cycles: _int) -> None: ... +def _cuda_synchronize() -> None: ... +def _cuda_ipc_collect() -> None: ... +def _cuda_getArchFlags() -> Optional[str]: ... +def _cuda_init() -> None: ... +def _cuda_setStream(stream_id: _int, device_index: _int, device_type: _int) -> None: ... +def _cuda_getCompiledVersion() -> _int: ... +def _cuda_cudaHostAllocator() -> _int: ... +def _cuda_cudaCachingAllocator_raw_alloc(size: _int, cuda_stream: _int) -> _int: ... +def _cuda_cudaCachingAllocator_raw_delete(ptr: _int) -> None: ... +def _cuda_cudaCachingAllocator_set_allocator_settings(env: str) -> None: ... +def _cuda_beginAllocateCurrentStreamToPool(device: _int, mempool_id: Tuple[_int, _int]) -> None: ... +def _cuda_endAllocateCurrentStreamToPool(device: _int, mempool_id: Tuple[_int, _int]) -> None: ... +def _cuda_releasePool(device: _int, mempool_id: Tuple[_int, _int]) -> None: ... +def _cuda_checkPoolLiveAllocations(device: _int, mempool_id: Tuple[_int, _int], expected_live_allocations: Set) -> _bool: ... +def _cuda_setCheckpointPoolState(device: _int, state: _cuda_CUDAAllocator_AllocatorState, stale_storages: List[_int], storages_to_add_deleters_to: List[_int]) -> None: ... +def _cuda_setMemoryFraction(fraction: _float, device: _int) -> None: ... +def _cuda_emptyCache() -> None: ... +def _cuda_memoryStats(device: _int) -> Dict[str, Any]: ... +def _cuda_resetAccumulatedMemoryStats(device: _int) -> None: ... +def _cuda_resetPeakMemoryStats(device: _int) -> None: ... +def _cuda_memorySnapshot() -> Dict[str, Any]: ... +def _cuda_record_memory_history_legacy( + enabled: _bool, + record_context: _bool, + record_context_cpp: _bool, + alloc_trace_max_entries: _int, + alloc_trace_record_context: _bool, +) -> None: ... +def _cuda_record_memory_history( + enabled: Optional[str], + context: Optional[str], + stacks: str, + max_entries +) -> None: ... +def _cuda_isHistoryEnabled() -> _bool: ... + +def _cuda_getAllocatorBackend() -> str: ... +class _cuda_CUDAAllocator_AllocatorState: + pass +def _cuda_getCheckpointState(device: _int, mempool: Tuple[_int, _int]) -> _cuda_CUDAAllocator_AllocatorState: ... +def _set_cached_tensors_enabled(enabled: _bool) -> None: ... +def _add_cached_tensor(t: Tensor) -> None: ... +def _remove_cached_tensor(t: Tensor) -> None: ... +def _construct_CUDA_Tensor_From_Storage_And_Metadata(metadata: dict, storage: Storage) -> Tensor: ... +def _storage_Use_Count(storage_ptr: _int) -> _int: ... +def _set_storage_access_error_msg(t: Tensor, s: str) -> None: ... +def _free_And_Remove_DeleterFn(storage_ptr: _int) -> None: ... +def _has_Standard_Deleter(storage_ptr: _int) -> _bool: ... + +class _cuda_CUDAAllocator: ... + +def _cuda_customAllocator(alloc_fn: _int, free_fn: _int) -> _cuda_CUDAAllocator: ... +def _cuda_changeCurrentAllocator(allocator: _cuda_CUDAAllocator) -> None: ... +def _cuda_getAllocator() -> _cuda_CUDAAllocator: ... +def _cuda_lock_mutex() -> None: ... +def _cuda_unlock_mutex() -> None: ... +def _cuda_canDeviceAccessPeer(device: _int, peer_device: _int) -> _bool: ... +def _cuda_jiterator_compile_and_launch_kernel( + code_string: str, + kernel_name: str, + return_by_ref: _bool, + num_outputs: _int, + tensors: Tuple, + kwargs: Dict[str, Union[_int, _float, _bool]], +) -> Tensor: ... +def _cuda_get_cudnn_benchmark_limit() -> _int: ... +def _cuda_set_cudnn_benchmark_limit(arg: _int) -> None: ... +def _cuda_get_conv_benchmark_empty_cache() -> _bool: ... +def _cudnn_set_conv_benchmark_empty_cache(enable: _bool) -> None: ... +def _nccl_version() -> _int: ... +def _nccl_version_suffix() -> bytes : ... +def _nccl_unique_id() -> bytes: ... +def _nccl_init_rank(nranks: _int, comm_id: bytes, rank: _int) -> object: ... +def _nccl_reduce( + input: Sequence[Tensor], + output: Tensor, + root: _int, + op: _int, + streams: Optional[Sequence[_CudaStreamBase]], + comms: Optional[Sequence[object]], +) -> None: ... +def _nccl_all_reduce( + input: Sequence[Tensor], + output: Sequence[Tensor], + op: _int, + streams: Optional[Sequence[_CudaStreamBase]], + comms: Optional[Sequence[object]], +) -> None: ... +def _nccl_broadcast( + input: Sequence[Tensor], + root: _int, + streams: Optional[Sequence[_CudaStreamBase]], + comms: Optional[Sequence[object]], +) -> None: ... +def _nccl_all_gather( + input: Sequence[Tensor], + output: Sequence[Tensor], + streams: Optional[Sequence[_CudaStreamBase]], + comms: Optional[Sequence[object]], +) -> None: ... +def _nccl_reduce_scatter( + input: Sequence[Tensor], + output: Sequence[Tensor], + op: _int, + streams: Optional[Sequence[_CudaStreamBase]], + comms: Optional[Sequence[object]], +) -> None: ... +def _rocm_is_backward_pass() -> _bool: ... + +class _CudaDeviceProperties: + name: str + major: _int + minor: _int + multi_processor_count: _int + total_memory: _int + is_integrated: _int + is_multi_gpu_board: _int + max_threads_per_multi_processor: _int + gcnArchName: str + +# Functions related to SDPA +class _SDPAParams: + query: Tensor + key: Tensor + value: Tensor + attn_mask: Optional[Tensor] + dropout: _float + is_causal: _bool + def __init__( + self, + query: Tensor, + key: Tensor, + value: Tensor, + attn_mask: Optional[Tensor], + dropout: _float, + is_causal: _bool) -> None: ... + +class _SDPBackend(Enum): + ERROR = -1 + MATH = 0 + FLASH_ATTENTION = 1 + EFFICIENT_ATTENTION = 2 + CUDNN_ATTENTION = 3 + +def _can_use_flash_attention(params: _SDPAParams, debug: _bool) -> _bool: ... +def _can_use_mem_efficient_attention(params: _SDPAParams, debug: _bool) -> _bool: ... + +# Defined in torch/csrc/cuda/python_comm.cpp +def _broadcast(tensor: Tensor, devices: List[_int]) -> List[Tensor]: ... +def _broadcast_out(tensor: Tensor, out_tensors: List[Tensor]) -> List[Tensor]: ... +def _broadcast_coalesced( + tensors: List[Tensor], + devices: List[_int], + buffer_size: _int, +) -> List[List[Tensor]]: ... +def _scatter( + tensor: Tensor, + devices: List[_int], + chunk_sizes: Optional[List[_int]], + dim: _int, + streams: Optional[List[Stream]], +) -> List[Tensor]: ... +def _scatter_out( + tensor: Tensor, + out_tensors: List[Tensor], + dim: _int, + streams: Optional[List[Stream]], +) -> List[Tensor]: ... +def _gather( + tensors: List[Tensor], + dim: _int, + destination_index: Optional[_int], +) -> Tensor: ... +def _gather_out(tensors: List[Tensor], out_tensor: Tensor, dim: _int) -> Tensor: ... + +# Defined in torch/csrc/cuda/Stream.cpp +class _CudaStreamBase(Stream): + stream_id: _int + device_index: _int + device_type: _int + + device: _device + cuda_stream: _int + priority: _int + + def __new__( + self, + priority: _int = 0, + stream_id: _int = 0, + device_index: _int = 0, + stream_ptr: _int = 0, + ) -> _CudaStreamBase: ... + def query(self) -> _bool: ... + def synchronize(self) -> None: ... + def priority_range(self) -> Tuple[_int, _int]: ... + +# Defined in torch/csrc/cuda/Event.cpp +class _CudaEventBase: + device: _device + cuda_event: _int + + def __new__( + cls, + enable_timing: _bool = False, + blocking: _bool = False, + interprocess: _bool = False, + ) -> _CudaEventBase: ... + @classmethod + def from_ipc_handle(cls, device: _device, ipc_handle: bytes) -> _CudaEventBase: ... + def record(self, stream: _CudaStreamBase) -> None: ... + def wait(self, stream: _CudaStreamBase) -> None: ... + def query(self) -> _bool: ... + def elapsed_time(self, other: _CudaEventBase) -> _float: ... + def synchronize(self) -> None: ... + def ipc_handle(self) -> bytes: ... + +# Defined in torch/csrc/cuda/Graph.cpp +class _CUDAGraph: + def capture_begin(self, pool: Optional[Tuple[_int, _int]] = ..., capture_error_mode: str = "global") -> None: ... + def capture_end(self) -> None: ... + def replay(self) -> None: ... + def reset(self) -> None: ... + def pool(self) -> Tuple[_int, _int]: ... + def enable_debug_mode(self) -> None: ... + def debug_dump(self, debug_path: str) -> None: ... + +def _cuda_isCurrentStreamCapturing() -> _bool: ... +def _graph_pool_handle() -> Tuple[_int, _int]: ... + +# Defined in torch/csrc/xpu/Module.cpp +def _xpu_setDevice(device: _int) -> None: ... +def _xpu_exchangeDevice(device: _int) -> _int: ... +def _xpu_maybeExchangeDevice(device: _int) -> _int: ... +def _xpu_getDevice() -> _int: ... +def _xpu_getDeviceCount() -> _int: ... +def _xpu_init() -> None: ... +def _xpu_setStream(stream_id: _int, device_index: _int, device_type: _int) -> None: ... +def _xpu_getCurrentStream(device: _int) -> Tuple: ... +def _xpu_getCurrentRawStream(device: _int) -> _int: ... +def _xpu_synchronize(device: _int) -> None: ... +def _xpu_emptyCache() -> None: ... + +class _XpuDeviceProperties: + name: str + platform_name: str + total_memory: _int + max_compute_units: _int + gpu_eu_count: _int + gpu_subslice_count: _int + max_work_group_size: _int + max_num_sub_groups: _int + sub_group_sizes: List[_int] + type: str + +# Defined in torch/csrc/xpu/Stream.cpp +class _XpuStreamBase(Stream): + stream_id: _int + device_index: _int + device_type: _int + + device: _device + sycl_queue: _int + priority: _int + + def __new__( + cls, + priority: _int = 0, + stream_id: _int = 0, + device_index: _int = 0, + device_type: _int = 0, + ) -> _XpuStreamBase: ... + def query(self) -> _bool: ... + def synchronize(self) -> None: ... + @staticmethod + def priority_range() -> Tuple: ... + +# Defined in torch/csrc/xpu/Event.cpp +class _XpuEventBase: + device: _device + sycl_event: _int + + def __new__(cls, enable_timing: _bool = False) -> _XpuEventBase: ... + def record(self, stream: _XpuEventBase) -> None: ... + def wait(self, stream: _XpuStreamBase) -> None: ... + def query(self) -> _bool: ... + def elapsed_time(self, other: _XpuEventBase) -> _float: ... + def synchronize(self) -> None: ... + +# Defined in torch/csrc/DataLoader.cpp +def _set_worker_signal_handlers( + *arg: Any, +) -> None: ... # THPModule_setWorkerSignalHandlers +def _set_worker_pids( + key: _int, + child_pids: Tuple[_int, ...], +) -> None: ... # THPModule_setWorkerPIDs +def _remove_worker_pids(loader_id: _int) -> None: ... # THPModule_removeWorkerPIDs +def _error_if_any_worker_fails() -> None: ... # THPModule_errorIfAnyWorkerFails + +# Defined in torch/csrc/jit/python/python_tracer.cpp +class TracingState: + def push_scope(self, scope_name: str) -> None: ... + def pop_scope(self) -> None: ... + def current_scope(self) -> str: ... + def set_graph(self, graph: Graph) -> None: ... + def graph(self) -> Graph: ... + +def _create_graph_by_tracing( + func: Callable[..., Any], + inputs: Any, + var_name_lookup_fn: Callable[[Tensor], str], + strict: Any, + force_outplace: Any, + self: Any = None, + argument_names: List[str] = [], +) -> Tuple[Graph, Stack]: ... +def _tracer_warn_use_python(): ... +def _get_tracing_state() -> TracingState: ... + +# Defined in torch/csrc/jit/python/python_ir.cpp +# Not actually defined in python_ir.cpp, not sure where they are. +class IValue: ... + +Stack = List[IValue] + +class JitType: + annotation_str: str + def isSubtypeOf(self, other: JitType) -> _bool: ... + def with_dtype(self, dtype: _dtype) -> JitType: ... + def with_sizes(self, sizes: List[Optional[_int]]) -> JitType: ... + def kind(self) -> str: ... + def scalarType(self) -> Optional[str]: ... + def getElementType(self) -> JitType: ... + def dtype(self) -> Optional[_dtype]: ... + +class InferredType: + def __init__(self, arg: Union[JitType, str]): ... + def type(self) -> JitType: ... + def success(self) -> _bool: ... + def reason(self) -> str: ... + +R = TypeVar("R", bound=JitType) + +class AnyType(JitType): + @staticmethod + def get() -> AnyType: ... + +class NoneType(JitType): + @staticmethod + def get() -> NoneType: ... + +class BoolType(JitType): + @staticmethod + def get() -> BoolType: ... + +class FloatType(JitType): + @staticmethod + def get() -> FloatType: ... + +class ComplexType(JitType): + @staticmethod + def get() -> ComplexType: ... + +class IntType(JitType): + @staticmethod + def get() -> IntType: ... + +class SymIntType(JitType): + @staticmethod + def get() -> SymIntType: ... + +class SymBoolType(JitType): + @staticmethod + def get() -> SymBoolType: ... + +class NumberType(JitType): + @staticmethod + def get() -> NumberType: ... + +class StringType(JitType): + @staticmethod + def get() -> StringType: ... + +class DeviceObjType(JitType): + @staticmethod + def get() -> DeviceObjType: ... + +class _GeneratorType(JitType): + @staticmethod + def get() -> _GeneratorType: ... + +class StreamObjType(JitType): + @staticmethod + def get() -> StreamObjType: ... + +class ListType(JitType): + def __init__(self, a: JitType) -> None: ... + def getElementType(self) -> JitType: ... + @staticmethod + def ofInts() -> ListType: ... + @staticmethod + def ofTensors() -> ListType: ... + @staticmethod + def ofFloats() -> ListType: ... + @staticmethod + def ofComplexDoubles() -> ListType: ... + @staticmethod + def ofBools() -> ListType: ... + @staticmethod + def ofStrings() -> ListType: ... + +class DictType(JitType): + def __init__(self, key: JitType, value: JitType) -> None: ... + def getKeyType(self) -> JitType: ... + def getValueType(self) -> JitType: ... + +class TupleType(JitType): + def __init__(self, a: List[Optional[JitType]]) -> None: ... + def elements(self) -> List[JitType]: ... + +class UnionType(JitType): + def __init__(self, a: List[JitType]) -> None: ... + +class ClassType(JitType): + def __init__(self, qualified_name: str) -> None: ... + +class InterfaceType(JitType): + def __init__(self, qualified_name: str) -> None: ... + def getMethod(self, name: str) -> Optional[FunctionSchema]: ... + def getMethodNames(self) -> List[str]: ... + +class OptionalType(JitType, Generic[R]): + def __init__(self, a: JitType) -> None: ... + def getElementType(self) -> JitType: ... + @staticmethod + def ofTensor() -> OptionalType: ... + +class FutureType(JitType): + def __init__(self, a: JitType) -> None: ... + def getElementType(self) -> JitType: ... + +class AwaitType(JitType): + def __init__(self, a: JitType) -> None: ... + def getElementType(self) -> JitType: ... + +class RRefType(JitType): + def __init__(self, a: JitType) -> None: ... + +class EnumType(JitType): + def __init__( + self, + qualified_name: str, + value_type: JitType, + enum_names_values: List[Any], + ) -> None: ... + +class TensorType(JitType): + @classmethod + def get(cls) -> TensorType: ... + @classmethod + def getInferred(cls) -> TensorType: ... + def with_sizes(self, other: Optional[List[Optional[_int]]]) -> TensorType: ... + def sizes(self) -> Optional[List[_int]]: ... + def varyingSizes(self) -> Optional[List[Optional[_int]]]: ... + def strides(self) -> Optional[List[_int]]: ... + def device(self) -> Optional[_device]: ... + def dim(self) -> _int: ... + def dtype(self) -> Optional[_dtype]: ... + @staticmethod + def create_from_tensor(t: Tensor) -> TensorType: ... + +# Defined in torch/csrc/jit/python/python_tree_views.cpp +class SourceRange: ... +class TreeView: ... + +class Ident(TreeView): + @property + def name(self) -> str: ... + +class ClassDef(TreeView): ... + +class Def(TreeView): + def name(self) -> Ident: ... + +class Decl(TreeView): ... + +# Defined in torch/csrc/distributed/rpc/init.cpp +def _rpc_init() -> _bool: ... + +# Defined in torch/csrc/distributed/autograd/init.cpp +def _dist_autograd_init() -> _bool: ... + +# Defined in torch/csrc/distributed/c10d/init.cpp +def _c10d_init() -> _bool: ... + +# Defined in torch/csrc/distributed/rpc/testing/init.cpp +def _faulty_agent_init() -> _bool: ... +def _register_py_class_for_device(device: str, cls: Any) -> None: ... +def _activate_cuda_trace() -> None: ... + +# Defined in torch/csrc/Module.cpp +def _current_graph_task_id() -> _int: ... +def _current_autograd_node() -> _Node: ... + +# Defined in torch/csrc/Exceptions.cpp +class _OutOfMemoryError(RuntimeError): ... +class _DistError(RuntimeError): ... +class _DistBackendError(RuntimeError): ... +class _DistStoreError(RuntimeError): ... +class _DistNetworkError(RuntimeError): ... + +# Defined in torch/csrc/profiler/init.cpp +class CapturedTraceback: + pass +def gather_traceback(python: _bool, script: _bool, cpp: _bool) -> CapturedTraceback: ... +def symbolize_tracebacks(tracebacks: List[CapturedTraceback]) -> List[Dict[str, Any]]: ... + +def _load_mobile_module_from_file(filename: str): ... +def _load_mobile_module_from_bytes(bytes_: bytes): ... +def _load_jit_module_from_file(filename: str): ... +def _load_jit_module_from_bytes(bytes_: bytes): ... +def _save_mobile_module(m: LiteScriptModule, filename: str): ... +def _save_jit_module(m: ScriptModule, filename: str, extra_files: Dict[str, Any]): ... +def _save_mobile_module_to_bytes(m: LiteScriptModule) -> bytes: ... +def _save_jit_module_to_bytes(m: ScriptModule, extra_files: Dict[str, Any]) -> bytes: ... +def _get_module_info_from_flatbuffer(data: bytes): ... +def _jit_resolve_packet(op_name: str, *args, **kwargs) -> str: ... +def _swap_tensor_impl(t1: Tensor, t2: Tensor): ... +def _save_pickle(obj: Any) -> bytes: ... + +# Defined in torch/csrc/jit/runtime/static/init.cpp +def _jit_to_static_module(graph_or_module: Union[Graph,ScriptModule]) -> Any: ... +def _fuse_to_static_module(graph_or_module: Union[Graph,ScriptModule], min_size: _int) -> Any: ... diff --git a/shared/package-files/9c/9c8e69bc5b89cdb9a86bc64e219e08f7850f4ad1ed58cff042c3bce1af09e29c/blob b/shared/package-files/9c/9c8e69bc5b89cdb9a86bc64e219e08f7850f4ad1ed58cff042c3bce1af09e29c/blob new file mode 100644 index 0000000000000000000000000000000000000000..5e447a249bf822561e63b5174f49d5bcb45ce260 --- /dev/null +++ b/shared/package-files/9c/9c8e69bc5b89cdb9a86bc64e219e08f7850f4ad1ed58cff042c3bce1af09e29c/blob @@ -0,0 +1,490 @@ +import sys +from typing import IO, Any, BinaryIO, NamedTuple, Optional, Tuple, Union, overload + +_chtype = Union[str, bytes, int] + +ALL_MOUSE_EVENTS: int +A_ALTCHARSET: int +A_ATTRIBUTES: int +A_BLINK: int +A_BOLD: int +A_CHARTEXT: int +A_COLOR: int +A_DIM: int +A_HORIZONTAL: int +A_INVIS: int +if sys.version_info >= (3, 7): + A_ITALIC: int +A_LEFT: int +A_LOW: int +A_NORMAL: int +A_PROTECT: int +A_REVERSE: int +A_RIGHT: int +A_STANDOUT: int +A_TOP: int +A_UNDERLINE: int +A_VERTICAL: int +BUTTON1_CLICKED: int +BUTTON1_DOUBLE_CLICKED: int +BUTTON1_PRESSED: int +BUTTON1_RELEASED: int +BUTTON1_TRIPLE_CLICKED: int +BUTTON2_CLICKED: int +BUTTON2_DOUBLE_CLICKED: int +BUTTON2_PRESSED: int +BUTTON2_RELEASED: int +BUTTON2_TRIPLE_CLICKED: int +BUTTON3_CLICKED: int +BUTTON3_DOUBLE_CLICKED: int +BUTTON3_PRESSED: int +BUTTON3_RELEASED: int +BUTTON3_TRIPLE_CLICKED: int +BUTTON4_CLICKED: int +BUTTON4_DOUBLE_CLICKED: int +BUTTON4_PRESSED: int +BUTTON4_RELEASED: int +BUTTON4_TRIPLE_CLICKED: int +BUTTON_ALT: int +BUTTON_CTRL: int +BUTTON_SHIFT: int +COLOR_BLACK: int +COLOR_BLUE: int +COLOR_CYAN: int +COLOR_GREEN: int +COLOR_MAGENTA: int +COLOR_RED: int +COLOR_WHITE: int +COLOR_YELLOW: int +ERR: int +KEY_A1: int +KEY_A3: int +KEY_B2: int +KEY_BACKSPACE: int +KEY_BEG: int +KEY_BREAK: int +KEY_BTAB: int +KEY_C1: int +KEY_C3: int +KEY_CANCEL: int +KEY_CATAB: int +KEY_CLEAR: int +KEY_CLOSE: int +KEY_COMMAND: int +KEY_COPY: int +KEY_CREATE: int +KEY_CTAB: int +KEY_DC: int +KEY_DL: int +KEY_DOWN: int +KEY_EIC: int +KEY_END: int +KEY_ENTER: int +KEY_EOL: int +KEY_EOS: int +KEY_EXIT: int +KEY_F0: int +KEY_F1: int +KEY_F10: int +KEY_F11: int +KEY_F12: int +KEY_F13: int +KEY_F14: int +KEY_F15: int +KEY_F16: int +KEY_F17: int +KEY_F18: int +KEY_F19: int +KEY_F2: int +KEY_F20: int +KEY_F21: int +KEY_F22: int +KEY_F23: int +KEY_F24: int +KEY_F25: int +KEY_F26: int +KEY_F27: int +KEY_F28: int +KEY_F29: int +KEY_F3: int +KEY_F30: int +KEY_F31: int +KEY_F32: int +KEY_F33: int +KEY_F34: int +KEY_F35: int +KEY_F36: int +KEY_F37: int +KEY_F38: int +KEY_F39: int +KEY_F4: int +KEY_F40: int +KEY_F41: int +KEY_F42: int +KEY_F43: int +KEY_F44: int +KEY_F45: int +KEY_F46: int +KEY_F47: int +KEY_F48: int +KEY_F49: int +KEY_F5: int +KEY_F50: int +KEY_F51: int +KEY_F52: int +KEY_F53: int +KEY_F54: int +KEY_F55: int +KEY_F56: int +KEY_F57: int +KEY_F58: int +KEY_F59: int +KEY_F6: int +KEY_F60: int +KEY_F61: int +KEY_F62: int +KEY_F63: int +KEY_F7: int +KEY_F8: int +KEY_F9: int +KEY_FIND: int +KEY_HELP: int +KEY_HOME: int +KEY_IC: int +KEY_IL: int +KEY_LEFT: int +KEY_LL: int +KEY_MARK: int +KEY_MAX: int +KEY_MESSAGE: int +KEY_MIN: int +KEY_MOUSE: int +KEY_MOVE: int +KEY_NEXT: int +KEY_NPAGE: int +KEY_OPEN: int +KEY_OPTIONS: int +KEY_PPAGE: int +KEY_PREVIOUS: int +KEY_PRINT: int +KEY_REDO: int +KEY_REFERENCE: int +KEY_REFRESH: int +KEY_REPLACE: int +KEY_RESET: int +KEY_RESIZE: int +KEY_RESTART: int +KEY_RESUME: int +KEY_RIGHT: int +KEY_SAVE: int +KEY_SBEG: int +KEY_SCANCEL: int +KEY_SCOMMAND: int +KEY_SCOPY: int +KEY_SCREATE: int +KEY_SDC: int +KEY_SDL: int +KEY_SELECT: int +KEY_SEND: int +KEY_SEOL: int +KEY_SEXIT: int +KEY_SF: int +KEY_SFIND: int +KEY_SHELP: int +KEY_SHOME: int +KEY_SIC: int +KEY_SLEFT: int +KEY_SMESSAGE: int +KEY_SMOVE: int +KEY_SNEXT: int +KEY_SOPTIONS: int +KEY_SPREVIOUS: int +KEY_SPRINT: int +KEY_SR: int +KEY_SREDO: int +KEY_SREPLACE: int +KEY_SRESET: int +KEY_SRIGHT: int +KEY_SRSUME: int +KEY_SSAVE: int +KEY_SSUSPEND: int +KEY_STAB: int +KEY_SUNDO: int +KEY_SUSPEND: int +KEY_UNDO: int +KEY_UP: int +OK: int +REPORT_MOUSE_POSITION: int +_C_API: Any +version: bytes + +def baudrate() -> int: ... +def beep() -> None: ... +def can_change_color() -> bool: ... +def cbreak(__flag: bool = ...) -> None: ... +def color_content(__color_number: int) -> Tuple[int, int, int]: ... +def color_pair(__color_number: int) -> int: ... +def curs_set(__visibility: int) -> int: ... +def def_prog_mode() -> None: ... +def def_shell_mode() -> None: ... +def delay_output(__ms: int) -> None: ... +def doupdate() -> None: ... +def echo(__flag: bool = ...) -> None: ... +def endwin() -> None: ... +def erasechar() -> bytes: ... +def filter() -> None: ... +def flash() -> None: ... +def flushinp() -> None: ... +def getmouse() -> Tuple[int, int, int, int, int]: ... +def getsyx() -> Tuple[int, int]: ... +def getwin(__file: BinaryIO) -> _CursesWindow: ... +def halfdelay(__tenths: int) -> None: ... +def has_colors() -> bool: ... +def has_ic() -> bool: ... +def has_il() -> bool: ... +def has_key(__key: int) -> bool: ... +def init_color(__color_number: int, __r: int, __g: int, __b: int) -> None: ... +def init_pair(__pair_number: int, __fg: int, __bg: int) -> None: ... +def initscr() -> _CursesWindow: ... +def intrflush(__flag: bool) -> None: ... +def is_term_resized(__nlines: int, __ncols: int) -> bool: ... +def isendwin() -> bool: ... +def keyname(__key: int) -> bytes: ... +def killchar() -> bytes: ... +def longname() -> bytes: ... +def meta(__yes: bool) -> None: ... +def mouseinterval(__interval: int) -> None: ... +def mousemask(__newmask: int) -> Tuple[int, int]: ... +def napms(__ms: int) -> int: ... +def newpad(__nlines: int, __ncols: int) -> _CursesWindow: ... +def newwin(__nlines: int, __ncols: int, __begin_y: int = ..., __begin_x: int = ...) -> _CursesWindow: ... +def nl(__flag: bool = ...) -> None: ... +def nocbreak() -> None: ... +def noecho() -> None: ... +def nonl() -> None: ... +def noqiflush() -> None: ... +def noraw() -> None: ... +def pair_content(__pair_number: int) -> Tuple[int, int]: ... +def pair_number(__attr: int) -> int: ... +def putp(__string: bytes) -> None: ... +def qiflush(__flag: bool = ...) -> None: ... +def raw(__flag: bool = ...) -> None: ... +def reset_prog_mode() -> None: ... +def reset_shell_mode() -> None: ... +def resetty() -> None: ... +def resize_term(__nlines: int, __ncols: int) -> None: ... +def resizeterm(__nlines: int, __ncols: int) -> None: ... +def savetty() -> None: ... +def setsyx(__y: int, __x: int) -> None: ... +def setupterm(term: Optional[str] = ..., fd: int = ...) -> None: ... +def start_color() -> None: ... +def termattrs() -> int: ... +def termname() -> bytes: ... +def tigetflag(__capname: str) -> int: ... +def tigetnum(__capname: str) -> int: ... +def tigetstr(__capname: str) -> bytes: ... +def tparm( + __str: bytes, + __i1: int = ..., + __i2: int = ..., + __i3: int = ..., + __i4: int = ..., + __i5: int = ..., + __i6: int = ..., + __i7: int = ..., + __i8: int = ..., + __i9: int = ..., +) -> bytes: ... +def typeahead(__fd: int) -> None: ... +def unctrl(__ch: _chtype) -> bytes: ... + +if sys.version_info >= (3, 3): + def unget_wch(__ch: Union[int, str]) -> None: ... + +def ungetch(__ch: _chtype) -> None: ... +def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ... + +if sys.version_info >= (3, 5): + def update_lines_cols() -> int: ... + +def use_default_colors() -> None: ... +def use_env(__flag: bool) -> None: ... + +class error(Exception): ... + +class _CursesWindow: + if sys.version_info >= (3, 3): + encoding: str + @overload + def addch(self, ch: _chtype, attr: int = ...) -> None: ... + @overload + def addch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ... + @overload + def addnstr(self, str: str, n: int, attr: int = ...) -> None: ... + @overload + def addnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... + @overload + def addstr(self, str: str, attr: int = ...) -> None: ... + @overload + def addstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... + def attroff(self, attr: int) -> None: ... + def attron(self, attr: int) -> None: ... + def attrset(self, attr: int) -> None: ... + def bkgd(self, ch: _chtype, attr: int = ...) -> None: ... + def bkgdset(self, ch: _chtype, attr: int = ...) -> None: ... + def border( + self, + ls: _chtype = ..., + rs: _chtype = ..., + ts: _chtype = ..., + bs: _chtype = ..., + tl: _chtype = ..., + tr: _chtype = ..., + bl: _chtype = ..., + br: _chtype = ..., + ) -> None: ... + @overload + def box(self) -> None: ... + @overload + def box(self, vertch: _chtype = ..., horch: _chtype = ...) -> None: ... + @overload + def chgat(self, attr: int) -> None: ... + @overload + def chgat(self, num: int, attr: int) -> None: ... + @overload + def chgat(self, y: int, x: int, attr: int) -> None: ... + @overload + def chgat(self, y: int, x: int, num: int, attr: int) -> None: ... + def clear(self) -> None: ... + def clearok(self, yes: int) -> None: ... + def clrtobot(self) -> None: ... + def clrtoeol(self) -> None: ... + def cursyncup(self) -> None: ... + @overload + def delch(self) -> None: ... + @overload + def delch(self, y: int, x: int) -> None: ... + def deleteln(self) -> None: ... + @overload + def derwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + def echochar(self, ch: _chtype, attr: int = ...) -> None: ... + def enclose(self, y: int, x: int) -> bool: ... + def erase(self) -> None: ... + def getbegyx(self) -> Tuple[int, int]: ... + def getbkgd(self) -> Tuple[int, int]: ... + @overload + def getch(self) -> int: ... + @overload + def getch(self, y: int, x: int) -> int: ... + if sys.version_info >= (3, 3): + @overload + def get_wch(self) -> Union[int, str]: ... + @overload + def get_wch(self, y: int, x: int) -> Union[int, str]: ... + @overload + def getkey(self) -> str: ... + @overload + def getkey(self, y: int, x: int) -> str: ... + def getmaxyx(self) -> Tuple[int, int]: ... + def getparyx(self) -> Tuple[int, int]: ... + @overload + def getstr(self) -> _chtype: ... + @overload + def getstr(self, n: int) -> _chtype: ... + @overload + def getstr(self, y: int, x: int) -> _chtype: ... + @overload + def getstr(self, y: int, x: int, n: int) -> _chtype: ... + def getyx(self) -> Tuple[int, int]: ... + @overload + def hline(self, ch: _chtype, n: int) -> None: ... + @overload + def hline(self, y: int, x: int, ch: _chtype, n: int) -> None: ... + def idcok(self, flag: bool) -> None: ... + def idlok(self, yes: bool) -> None: ... + def immedok(self, flag: bool) -> None: ... + @overload + def inch(self) -> _chtype: ... + @overload + def inch(self, y: int, x: int) -> _chtype: ... + @overload + def insch(self, ch: _chtype, attr: int = ...) -> None: ... + @overload + def insch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ... + def insdelln(self, nlines: int) -> None: ... + def insertln(self) -> None: ... + @overload + def insnstr(self, str: str, n: int, attr: int = ...) -> None: ... + @overload + def insnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... + @overload + def insstr(self, str: str, attr: int = ...) -> None: ... + @overload + def insstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... + @overload + def instr(self, n: int = ...) -> _chtype: ... + @overload + def instr(self, y: int, x: int, n: int = ...) -> _chtype: ... + def is_linetouched(self, line: int) -> bool: ... + def is_wintouched(self) -> bool: ... + def keypad(self, yes: bool) -> None: ... + def leaveok(self, yes: bool) -> None: ... + def move(self, new_y: int, new_x: int) -> None: ... + def mvderwin(self, y: int, x: int) -> None: ... + def mvwin(self, new_y: int, new_x: int) -> None: ... + def nodelay(self, yes: bool) -> None: ... + def notimeout(self, yes: bool) -> None: ... + def noutrefresh(self) -> None: ... + @overload + def overlay(self, destwin: _CursesWindow) -> None: ... + @overload + def overlay( + self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int + ) -> None: ... + @overload + def overwrite(self, destwin: _CursesWindow) -> None: ... + @overload + def overwrite( + self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int + ) -> None: ... + def putwin(self, file: IO[Any]) -> None: ... + def redrawln(self, beg: int, num: int) -> None: ... + def redrawwin(self) -> None: ... + @overload + def refresh(self) -> None: ... + @overload + def refresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ... + def resize(self, nlines: int, ncols: int) -> None: ... + def scroll(self, lines: int = ...) -> None: ... + def scrollok(self, flag: bool) -> None: ... + def setscrreg(self, top: int, bottom: int) -> None: ... + def standend(self) -> None: ... + def standout(self) -> None: ... + @overload + def subpad(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subpad(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + def syncdown(self) -> None: ... + def syncok(self, flag: bool) -> None: ... + def syncup(self) -> None: ... + def timeout(self, delay: int) -> None: ... + def touchline(self, start: int, count: int, changed: bool = ...) -> None: ... + def touchwin(self) -> None: ... + def untouchwin(self) -> None: ... + @overload + def vline(self, ch: _chtype, n: int) -> None: ... + @overload + def vline(self, y: int, x: int, ch: _chtype, n: int) -> None: ... + +if sys.version_info >= (3, 8): + class _ncurses_version(NamedTuple): + major: int + minor: int + patch: int + ncurses_version: _ncurses_version diff --git a/shared/package-files/9c/9c8e7dd8af08d629ca2b64ebb0949305c15afe663a4bbff664d32ad65be19695/blob b/shared/package-files/9c/9c8e7dd8af08d629ca2b64ebb0949305c15afe663a4bbff664d32ad65be19695/blob new file mode 100644 index 0000000000000000000000000000000000000000..e5f34405328ec6b3f720e1eeda0bd36beb7235e8 --- /dev/null +++ b/shared/package-files/9c/9c8e7dd8af08d629ca2b64ebb0949305c15afe663a4bbff664d32ad65be19695/blob @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_prelu_kernel(Tensor self, Tensor weight) -> Tensor +inline at::Tensor _prelu_kernel(const at::Tensor & self, const at::Tensor & weight) { + return at::_ops::_prelu_kernel::call(self, weight); +} + +} diff --git a/shared/package-files/9c/9c8f332f0979366cc303a064494a5e1538bd5859013021e7e6901ac47548cf9f/blob b/shared/package-files/9c/9c8f332f0979366cc303a064494a5e1538bd5859013021e7e6901ac47548cf9f/blob new file mode 100644 index 0000000000000000000000000000000000000000..dd4b16889c882e68e20616c799f5b1502dbfc977 --- /dev/null +++ b/shared/package-files/9c/9c8f332f0979366cc303a064494a5e1538bd5859013021e7e6901ac47548cf9f/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c8f332f0979366cc303a064494a5e1538bd5859013021e7e6901ac47548cf9f +size 2071644 diff --git a/shared/package-files/9c/9c9043814abdbe7dc39ff98f3857d5d110a84c978ad2304158d810a4e9eacef1/blob b/shared/package-files/9c/9c9043814abdbe7dc39ff98f3857d5d110a84c978ad2304158d810a4e9eacef1/blob new file mode 100644 index 0000000000000000000000000000000000000000..b5415ba366582bb3ea90dfef584357ba74fd442e --- /dev/null +++ b/shared/package-files/9c/9c9043814abdbe7dc39ff98f3857d5d110a84c978ad2304158d810a4e9eacef1/blob @@ -0,0 +1,308 @@ +""" Python Character Mapping Codec koi8_t +""" +# http://ru.wikipedia.org/wiki/КОИ-8 +# http://www.opensource.apple.com/source/libiconv/libiconv-4/libiconv/tests/KOI8-T.TXT + +import codecs + +### Codec APIs + +class Codec(codecs.Codec): + + def encode(self,input,errors='strict'): + return codecs.charmap_encode(input,errors,encoding_table) + + def decode(self,input,errors='strict'): + return codecs.charmap_decode(input,errors,decoding_table) + +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input, final=False): + return codecs.charmap_encode(input,self.errors,encoding_table)[0] + +class IncrementalDecoder(codecs.IncrementalDecoder): + def decode(self, input, final=False): + return codecs.charmap_decode(input,self.errors,decoding_table)[0] + +class StreamWriter(Codec,codecs.StreamWriter): + pass + +class StreamReader(Codec,codecs.StreamReader): + pass + +### encodings module API + +def getregentry(): + return codecs.CodecInfo( + name='koi8-t', + encode=Codec().encode, + decode=Codec().decode, + incrementalencoder=IncrementalEncoder, + incrementaldecoder=IncrementalDecoder, + streamreader=StreamReader, + streamwriter=StreamWriter, + ) + + +### Decoding Table + +decoding_table = ( + '\x00' # 0x00 -> NULL + '\x01' # 0x01 -> START OF HEADING + '\x02' # 0x02 -> START OF TEXT + '\x03' # 0x03 -> END OF TEXT + '\x04' # 0x04 -> END OF TRANSMISSION + '\x05' # 0x05 -> ENQUIRY + '\x06' # 0x06 -> ACKNOWLEDGE + '\x07' # 0x07 -> BELL + '\x08' # 0x08 -> BACKSPACE + '\t' # 0x09 -> HORIZONTAL TABULATION + '\n' # 0x0A -> LINE FEED + '\x0b' # 0x0B -> VERTICAL TABULATION + '\x0c' # 0x0C -> FORM FEED + '\r' # 0x0D -> CARRIAGE RETURN + '\x0e' # 0x0E -> SHIFT OUT + '\x0f' # 0x0F -> SHIFT IN + '\x10' # 0x10 -> DATA LINK ESCAPE + '\x11' # 0x11 -> DEVICE CONTROL ONE + '\x12' # 0x12 -> DEVICE CONTROL TWO + '\x13' # 0x13 -> DEVICE CONTROL THREE + '\x14' # 0x14 -> DEVICE CONTROL FOUR + '\x15' # 0x15 -> NEGATIVE ACKNOWLEDGE + '\x16' # 0x16 -> SYNCHRONOUS IDLE + '\x17' # 0x17 -> END OF TRANSMISSION BLOCK + '\x18' # 0x18 -> CANCEL + '\x19' # 0x19 -> END OF MEDIUM + '\x1a' # 0x1A -> SUBSTITUTE + '\x1b' # 0x1B -> ESCAPE + '\x1c' # 0x1C -> FILE SEPARATOR + '\x1d' # 0x1D -> GROUP SEPARATOR + '\x1e' # 0x1E -> RECORD SEPARATOR + '\x1f' # 0x1F -> UNIT SEPARATOR + ' ' # 0x20 -> SPACE + '!' # 0x21 -> EXCLAMATION MARK + '"' # 0x22 -> QUOTATION MARK + '#' # 0x23 -> NUMBER SIGN + '$' # 0x24 -> DOLLAR SIGN + '%' # 0x25 -> PERCENT SIGN + '&' # 0x26 -> AMPERSAND + "'" # 0x27 -> APOSTROPHE + '(' # 0x28 -> LEFT PARENTHESIS + ')' # 0x29 -> RIGHT PARENTHESIS + '*' # 0x2A -> ASTERISK + '+' # 0x2B -> PLUS SIGN + ',' # 0x2C -> COMMA + '-' # 0x2D -> HYPHEN-MINUS + '.' # 0x2E -> FULL STOP + '/' # 0x2F -> SOLIDUS + '0' # 0x30 -> DIGIT ZERO + '1' # 0x31 -> DIGIT ONE + '2' # 0x32 -> DIGIT TWO + '3' # 0x33 -> DIGIT THREE + '4' # 0x34 -> DIGIT FOUR + '5' # 0x35 -> DIGIT FIVE + '6' # 0x36 -> DIGIT SIX + '7' # 0x37 -> DIGIT SEVEN + '8' # 0x38 -> DIGIT EIGHT + '9' # 0x39 -> DIGIT NINE + ':' # 0x3A -> COLON + ';' # 0x3B -> SEMICOLON + '<' # 0x3C -> LESS-THAN SIGN + '=' # 0x3D -> EQUALS SIGN + '>' # 0x3E -> GREATER-THAN SIGN + '?' # 0x3F -> QUESTION MARK + '@' # 0x40 -> COMMERCIAL AT + 'A' # 0x41 -> LATIN CAPITAL LETTER A + 'B' # 0x42 -> LATIN CAPITAL LETTER B + 'C' # 0x43 -> LATIN CAPITAL LETTER C + 'D' # 0x44 -> LATIN CAPITAL LETTER D + 'E' # 0x45 -> LATIN CAPITAL LETTER E + 'F' # 0x46 -> LATIN CAPITAL LETTER F + 'G' # 0x47 -> LATIN CAPITAL LETTER G + 'H' # 0x48 -> LATIN CAPITAL LETTER H + 'I' # 0x49 -> LATIN CAPITAL LETTER I + 'J' # 0x4A -> LATIN CAPITAL LETTER J + 'K' # 0x4B -> LATIN CAPITAL LETTER K + 'L' # 0x4C -> LATIN CAPITAL LETTER L + 'M' # 0x4D -> LATIN CAPITAL LETTER M + 'N' # 0x4E -> LATIN CAPITAL LETTER N + 'O' # 0x4F -> LATIN CAPITAL LETTER O + 'P' # 0x50 -> LATIN CAPITAL LETTER P + 'Q' # 0x51 -> LATIN CAPITAL LETTER Q + 'R' # 0x52 -> LATIN CAPITAL LETTER R + 'S' # 0x53 -> LATIN CAPITAL LETTER S + 'T' # 0x54 -> LATIN CAPITAL LETTER T + 'U' # 0x55 -> LATIN CAPITAL LETTER U + 'V' # 0x56 -> LATIN CAPITAL LETTER V + 'W' # 0x57 -> LATIN CAPITAL LETTER W + 'X' # 0x58 -> LATIN CAPITAL LETTER X + 'Y' # 0x59 -> LATIN CAPITAL LETTER Y + 'Z' # 0x5A -> LATIN CAPITAL LETTER Z + '[' # 0x5B -> LEFT SQUARE BRACKET + '\\' # 0x5C -> REVERSE SOLIDUS + ']' # 0x5D -> RIGHT SQUARE BRACKET + '^' # 0x5E -> CIRCUMFLEX ACCENT + '_' # 0x5F -> LOW LINE + '`' # 0x60 -> GRAVE ACCENT + 'a' # 0x61 -> LATIN SMALL LETTER A + 'b' # 0x62 -> LATIN SMALL LETTER B + 'c' # 0x63 -> LATIN SMALL LETTER C + 'd' # 0x64 -> LATIN SMALL LETTER D + 'e' # 0x65 -> LATIN SMALL LETTER E + 'f' # 0x66 -> LATIN SMALL LETTER F + 'g' # 0x67 -> LATIN SMALL LETTER G + 'h' # 0x68 -> LATIN SMALL LETTER H + 'i' # 0x69 -> LATIN SMALL LETTER I + 'j' # 0x6A -> LATIN SMALL LETTER J + 'k' # 0x6B -> LATIN SMALL LETTER K + 'l' # 0x6C -> LATIN SMALL LETTER L + 'm' # 0x6D -> LATIN SMALL LETTER M + 'n' # 0x6E -> LATIN SMALL LETTER N + 'o' # 0x6F -> LATIN SMALL LETTER O + 'p' # 0x70 -> LATIN SMALL LETTER P + 'q' # 0x71 -> LATIN SMALL LETTER Q + 'r' # 0x72 -> LATIN SMALL LETTER R + 's' # 0x73 -> LATIN SMALL LETTER S + 't' # 0x74 -> LATIN SMALL LETTER T + 'u' # 0x75 -> LATIN SMALL LETTER U + 'v' # 0x76 -> LATIN SMALL LETTER V + 'w' # 0x77 -> LATIN SMALL LETTER W + 'x' # 0x78 -> LATIN SMALL LETTER X + 'y' # 0x79 -> LATIN SMALL LETTER Y + 'z' # 0x7A -> LATIN SMALL LETTER Z + '{' # 0x7B -> LEFT CURLY BRACKET + '|' # 0x7C -> VERTICAL LINE + '}' # 0x7D -> RIGHT CURLY BRACKET + '~' # 0x7E -> TILDE + '\x7f' # 0x7F -> DELETE + '\u049b' # 0x80 -> CYRILLIC SMALL LETTER KA WITH DESCENDER + '\u0493' # 0x81 -> CYRILLIC SMALL LETTER GHE WITH STROKE + '\u201a' # 0x82 -> SINGLE LOW-9 QUOTATION MARK + '\u0492' # 0x83 -> CYRILLIC CAPITAL LETTER GHE WITH STROKE + '\u201e' # 0x84 -> DOUBLE LOW-9 QUOTATION MARK + '\u2026' # 0x85 -> HORIZONTAL ELLIPSIS + '\u2020' # 0x86 -> DAGGER + '\u2021' # 0x87 -> DOUBLE DAGGER + '\ufffe' # 0x88 -> UNDEFINED + '\u2030' # 0x89 -> PER MILLE SIGN + '\u04b3' # 0x8A -> CYRILLIC SMALL LETTER HA WITH DESCENDER + '\u2039' # 0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK + '\u04b2' # 0x8C -> CYRILLIC CAPITAL LETTER HA WITH DESCENDER + '\u04b7' # 0x8D -> CYRILLIC SMALL LETTER CHE WITH DESCENDER + '\u04b6' # 0x8E -> CYRILLIC CAPITAL LETTER CHE WITH DESCENDER + '\ufffe' # 0x8F -> UNDEFINED + '\u049a' # 0x90 -> CYRILLIC CAPITAL LETTER KA WITH DESCENDER + '\u2018' # 0x91 -> LEFT SINGLE QUOTATION MARK + '\u2019' # 0x92 -> RIGHT SINGLE QUOTATION MARK + '\u201c' # 0x93 -> LEFT DOUBLE QUOTATION MARK + '\u201d' # 0x94 -> RIGHT DOUBLE QUOTATION MARK + '\u2022' # 0x95 -> BULLET + '\u2013' # 0x96 -> EN DASH + '\u2014' # 0x97 -> EM DASH + '\ufffe' # 0x98 -> UNDEFINED + '\u2122' # 0x99 -> TRADE MARK SIGN + '\ufffe' # 0x9A -> UNDEFINED + '\u203a' # 0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + '\ufffe' # 0x9C -> UNDEFINED + '\ufffe' # 0x9D -> UNDEFINED + '\ufffe' # 0x9E -> UNDEFINED + '\ufffe' # 0x9F -> UNDEFINED + '\ufffe' # 0xA0 -> UNDEFINED + '\u04ef' # 0xA1 -> CYRILLIC SMALL LETTER U WITH MACRON + '\u04ee' # 0xA2 -> CYRILLIC CAPITAL LETTER U WITH MACRON + '\u0451' # 0xA3 -> CYRILLIC SMALL LETTER IO + '\xa4' # 0xA4 -> CURRENCY SIGN + '\u04e3' # 0xA5 -> CYRILLIC SMALL LETTER I WITH MACRON + '\xa6' # 0xA6 -> BROKEN BAR + '\xa7' # 0xA7 -> SECTION SIGN + '\ufffe' # 0xA8 -> UNDEFINED + '\ufffe' # 0xA9 -> UNDEFINED + '\ufffe' # 0xAA -> UNDEFINED + '\xab' # 0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + '\xac' # 0xAC -> NOT SIGN + '\xad' # 0xAD -> SOFT HYPHEN + '\xae' # 0xAE -> REGISTERED SIGN + '\ufffe' # 0xAF -> UNDEFINED + '\xb0' # 0xB0 -> DEGREE SIGN + '\xb1' # 0xB1 -> PLUS-MINUS SIGN + '\xb2' # 0xB2 -> SUPERSCRIPT TWO + '\u0401' # 0xB3 -> CYRILLIC CAPITAL LETTER IO + '\ufffe' # 0xB4 -> UNDEFINED + '\u04e2' # 0xB5 -> CYRILLIC CAPITAL LETTER I WITH MACRON + '\xb6' # 0xB6 -> PILCROW SIGN + '\xb7' # 0xB7 -> MIDDLE DOT + '\ufffe' # 0xB8 -> UNDEFINED + '\u2116' # 0xB9 -> NUMERO SIGN + '\ufffe' # 0xBA -> UNDEFINED + '\xbb' # 0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + '\ufffe' # 0xBC -> UNDEFINED + '\ufffe' # 0xBD -> UNDEFINED + '\ufffe' # 0xBE -> UNDEFINED + '\xa9' # 0xBF -> COPYRIGHT SIGN + '\u044e' # 0xC0 -> CYRILLIC SMALL LETTER YU + '\u0430' # 0xC1 -> CYRILLIC SMALL LETTER A + '\u0431' # 0xC2 -> CYRILLIC SMALL LETTER BE + '\u0446' # 0xC3 -> CYRILLIC SMALL LETTER TSE + '\u0434' # 0xC4 -> CYRILLIC SMALL LETTER DE + '\u0435' # 0xC5 -> CYRILLIC SMALL LETTER IE + '\u0444' # 0xC6 -> CYRILLIC SMALL LETTER EF + '\u0433' # 0xC7 -> CYRILLIC SMALL LETTER GHE + '\u0445' # 0xC8 -> CYRILLIC SMALL LETTER HA + '\u0438' # 0xC9 -> CYRILLIC SMALL LETTER I + '\u0439' # 0xCA -> CYRILLIC SMALL LETTER SHORT I + '\u043a' # 0xCB -> CYRILLIC SMALL LETTER KA + '\u043b' # 0xCC -> CYRILLIC SMALL LETTER EL + '\u043c' # 0xCD -> CYRILLIC SMALL LETTER EM + '\u043d' # 0xCE -> CYRILLIC SMALL LETTER EN + '\u043e' # 0xCF -> CYRILLIC SMALL LETTER O + '\u043f' # 0xD0 -> CYRILLIC SMALL LETTER PE + '\u044f' # 0xD1 -> CYRILLIC SMALL LETTER YA + '\u0440' # 0xD2 -> CYRILLIC SMALL LETTER ER + '\u0441' # 0xD3 -> CYRILLIC SMALL LETTER ES + '\u0442' # 0xD4 -> CYRILLIC SMALL LETTER TE + '\u0443' # 0xD5 -> CYRILLIC SMALL LETTER U + '\u0436' # 0xD6 -> CYRILLIC SMALL LETTER ZHE + '\u0432' # 0xD7 -> CYRILLIC SMALL LETTER VE + '\u044c' # 0xD8 -> CYRILLIC SMALL LETTER SOFT SIGN + '\u044b' # 0xD9 -> CYRILLIC SMALL LETTER YERU + '\u0437' # 0xDA -> CYRILLIC SMALL LETTER ZE + '\u0448' # 0xDB -> CYRILLIC SMALL LETTER SHA + '\u044d' # 0xDC -> CYRILLIC SMALL LETTER E + '\u0449' # 0xDD -> CYRILLIC SMALL LETTER SHCHA + '\u0447' # 0xDE -> CYRILLIC SMALL LETTER CHE + '\u044a' # 0xDF -> CYRILLIC SMALL LETTER HARD SIGN + '\u042e' # 0xE0 -> CYRILLIC CAPITAL LETTER YU + '\u0410' # 0xE1 -> CYRILLIC CAPITAL LETTER A + '\u0411' # 0xE2 -> CYRILLIC CAPITAL LETTER BE + '\u0426' # 0xE3 -> CYRILLIC CAPITAL LETTER TSE + '\u0414' # 0xE4 -> CYRILLIC CAPITAL LETTER DE + '\u0415' # 0xE5 -> CYRILLIC CAPITAL LETTER IE + '\u0424' # 0xE6 -> CYRILLIC CAPITAL LETTER EF + '\u0413' # 0xE7 -> CYRILLIC CAPITAL LETTER GHE + '\u0425' # 0xE8 -> CYRILLIC CAPITAL LETTER HA + '\u0418' # 0xE9 -> CYRILLIC CAPITAL LETTER I + '\u0419' # 0xEA -> CYRILLIC CAPITAL LETTER SHORT I + '\u041a' # 0xEB -> CYRILLIC CAPITAL LETTER KA + '\u041b' # 0xEC -> CYRILLIC CAPITAL LETTER EL + '\u041c' # 0xED -> CYRILLIC CAPITAL LETTER EM + '\u041d' # 0xEE -> CYRILLIC CAPITAL LETTER EN + '\u041e' # 0xEF -> CYRILLIC CAPITAL LETTER O + '\u041f' # 0xF0 -> CYRILLIC CAPITAL LETTER PE + '\u042f' # 0xF1 -> CYRILLIC CAPITAL LETTER YA + '\u0420' # 0xF2 -> CYRILLIC CAPITAL LETTER ER + '\u0421' # 0xF3 -> CYRILLIC CAPITAL LETTER ES + '\u0422' # 0xF4 -> CYRILLIC CAPITAL LETTER TE + '\u0423' # 0xF5 -> CYRILLIC CAPITAL LETTER U + '\u0416' # 0xF6 -> CYRILLIC CAPITAL LETTER ZHE + '\u0412' # 0xF7 -> CYRILLIC CAPITAL LETTER VE + '\u042c' # 0xF8 -> CYRILLIC CAPITAL LETTER SOFT SIGN + '\u042b' # 0xF9 -> CYRILLIC CAPITAL LETTER YERU + '\u0417' # 0xFA -> CYRILLIC CAPITAL LETTER ZE + '\u0428' # 0xFB -> CYRILLIC CAPITAL LETTER SHA + '\u042d' # 0xFC -> CYRILLIC CAPITAL LETTER E + '\u0429' # 0xFD -> CYRILLIC CAPITAL LETTER SHCHA + '\u0427' # 0xFE -> CYRILLIC CAPITAL LETTER CHE + '\u042a' # 0xFF -> CYRILLIC CAPITAL LETTER HARD SIGN +) + +### Encoding table +encoding_table=codecs.charmap_build(decoding_table) diff --git a/shared/package-files/9c/9c90f07920fbfcd0613a547773c6e428930a33ea719404bc2b287c19c093d9d9/blob b/shared/package-files/9c/9c90f07920fbfcd0613a547773c6e428930a33ea719404bc2b287c19c093d9d9/blob new file mode 100644 index 0000000000000000000000000000000000000000..7adf4c51fd2d7b06ec051d95245af6cb8c5931ed --- /dev/null +++ b/shared/package-files/9c/9c90f07920fbfcd0613a547773c6e428930a33ea719404bc2b287c19c093d9d9/blob @@ -0,0 +1 @@ +asttokens diff --git a/shared/package-files/9c/9c91a7bd2ff29ab47e44fc55217511b7c1143c129bd21a9b2390ec4202f4e961/blob b/shared/package-files/9c/9c91a7bd2ff29ab47e44fc55217511b7c1143c129bd21a9b2390ec4202f4e961/blob new file mode 100644 index 0000000000000000000000000000000000000000..251da1bfe5a5250ad267d04eaf14779e37d99a9e --- /dev/null +++ b/shared/package-files/9c/9c91a7bd2ff29ab47e44fc55217511b7c1143c129bd21a9b2390ec4202f4e961/blob @@ -0,0 +1,439 @@ +""" +Created on Fri Jan 29 19:19:45 2021 + +Author: Josef Perktold +Author: Pamphile Roy +License: BSD-3 + +""" + +from statsmodels.compat.pandas import deprecate_kwarg + +import numpy as np +from scipy import stats + +from statsmodels.distributions.copula.copulas import Copula +from statsmodels.tools.rng_qrng import check_random_state + + +class EllipticalCopula(Copula): + """Base class for elliptical copula + + This class requires subclassing and currently does not have generic + methods based on an elliptical generator. + + Notes + ----- + Elliptical copulas require that copula parameters are set when the + instance is created. Those parameters currently cannot be provided in the + call to methods. (This will most likely change in future versions.) + If non-empty ``args`` are provided in methods, then a ValueError is raised. + The ``args`` keyword is provided for a consistent interface across + copulas. + + """ + + def _handle_args(self, args): + if args != () and args is not None: + msg = ( + "Methods in elliptical copulas use copula parameters in" + " attributes. `arg` in the method is ignored" + ) + raise ValueError(msg) + else: + return args + + @deprecate_kwarg("random_state", "rng") + def rvs(self, nobs=1, args=(), rng=None): + """Generate random variates from the copula. + + Parameters + ---------- + nobs : int, optional + Number of samples to generate from the copula. Default is 1. + args : tuple, optional + Arguments for copula parameters. Not used by elliptical copulas, + which take their parameters as attributes. + rng : int, array_like of int, numpy.random.Generator, or numpy.random.RandomState, optional + If `rng` is None, a new ``Generator`` is created using fresh + entropy from the operating system. If `rng` is an int or array + of ints, a new ``Generator`` is created, seeded with `rng`. If + `rng` is already a ``Generator`` or ``RandomState`` instance, + that instance is used. + random_state : int, array_like of int, numpy.random.Generator, or numpy.random.RandomState, optional + .. deprecated:: 0.15 + + random_state has been deprecated. In-line with SPEC-007, use + rng for passing a random number generator or seed. + + Returns + ------- + sample : ndarray of shape (nobs, k_dim) + Sample from the copula. + """ + self._handle_args(args) + rng = check_random_state(rng) + x = self.distr_mv.rvs(size=nobs, random_state=rng) + return self.distr_uv.cdf(x) + + def pdf(self, u, args=()): + """Evaluate the pdf of the copula. + + Parameters + ---------- + u : array_like, 2-D + Points of random variables in unit hypercube at which method is + evaluated. + args : tuple, optional + Arguments for copula parameters. Not used by elliptical copulas, + which take their parameters as attributes. + + Returns + ------- + ndarray + Copula pdf evaluated at points ``u``. + """ + self._handle_args(args) + ppf = self.distr_uv.ppf(u) + mv_pdf_ppf = self.distr_mv.pdf(ppf) + + return mv_pdf_ppf / np.prod(self.distr_uv.pdf(ppf), axis=-1) + + @deprecate_kwarg("random_state", "rng") + def cdf(self, u, args=(), rng=None): + """Evaluate the cdf of the copula. + + Parameters + ---------- + u : array_like, 2-D + Points of random variables in unit hypercube at which method is + evaluated. + args : tuple, optional + Arguments for copula parameters. Not used by elliptical copulas, + which take their parameters as attributes. + rng : int, array_like of int, numpy.random.Generator, or numpy.random.RandomState, optional + Passed to the underlying SciPy distribution's ``rng`` argument, + if supported by the installed SciPy version, to control the + quasi-Monte Carlo integration used to evaluate the cdf. If + `rng` is None, a new ``Generator`` is created using fresh + entropy from the operating system. If `rng` is an int or array + of ints, a new ``Generator`` is created, seeded with `rng`. If + `rng` is already a ``Generator`` or ``RandomState`` instance, + that instance is used. + random_state : int, array_like of int, numpy.random.Generator, or numpy.random.RandomState, optional + .. deprecated:: 0.15 + + random_state has been deprecated. In-line with SPEC-007, use + rng for passing a random number generator or seed. + + Returns + ------- + cdf : ndarray + Copula cdf evaluated at points ``u``. + """ + self._handle_args(args) + ppf = self.distr_uv.ppf(u) + rng = check_random_state(rng) + try: + # Modern SciPy supports this and is needed to avoid global random state + return self.distr_mv.cdf(ppf, rng=rng) + except TypeError: + return self.distr_mv.cdf(ppf) + + def tau(self, corr=None): + """Bivariate kendall's tau based on correlation coefficient. + + Parameters + ---------- + corr : float, optional + Pearson correlation. If corr is None, then the correlation will be + taken from the copula attribute. + + Returns + ------- + float or ndarray + Kendall's tau that corresponds to pearson correlation in the + elliptical copula. + """ + if corr is None: + corr = self.corr + if corr.shape == (2, 2): + corr = corr[0, 1] + rho = 2 * np.arcsin(corr) / np.pi + return rho + + def corr_from_tau(self, tau): + """Pearson correlation from kendall's tau. + + Parameters + ---------- + tau : array_like + Kendall's tau correlation coefficient. + + Returns + ------- + float or ndarray + Pearson correlation coefficient for given tau in elliptical + copula. This can be used as parameter for an elliptical copula. + """ + corr = np.sin(tau * np.pi / 2) + return corr + + def fit_corr_param(self, data): + """Copula correlation parameter using Kendall's tau of sample data. + + Parameters + ---------- + data : array_like + Sample data used to fit `theta` using Kendall's tau. + + Returns + ------- + corr_param : float or ndarray + Correlation parameter of the copula, ``theta`` in Archimedean and + pearson correlation in elliptical. For the bivariate case + (k_dim == 2) this is a scalar; if k_dim > 2, then the full + k_dim x k_dim matrix of pairwise correlations is returned. + """ + x = np.asarray(data) + + if x.shape[1] == 2: + tau = stats.kendalltau(x[:, 0], x[:, 1])[0] + else: + k = self.k_dim + tau = np.eye(k) + for i in range(k): + for j in range(i + 1, k): + tau_ij = stats.kendalltau(x[..., i], x[..., j])[0] + tau[i, j] = tau[j, i] = tau_ij + + return self._arg_from_tau(tau) + + +class GaussianCopula(EllipticalCopula): + r"""Gaussian copula. + + It is constructed from a multivariate normal distribution over + :math:`\mathbb{R}^d` by using the probability integral transform. + + For a given correlation matrix :math:`R \in[-1, 1]^{d \times d}`, + the Gaussian copula with parameter matrix :math:`R` can be written + as: + + .. math:: + + C_R^{\text{Gauss}}(u) = \Phi_R\left(\Phi^{-1}(u_1),\dots, + \Phi^{-1}(u_d) \right), + + where :math:`\Phi^{-1}` is the inverse cumulative distribution function + of a standard normal and :math:`\Phi_R` is the joint cumulative + distribution function of a multivariate normal distribution with mean + vector zero and covariance matrix equal to the correlation + matrix :math:`R`. + + Parameters + ---------- + corr : float or array_like, optional + Correlation or scatter matrix for the elliptical copula. In the + bivariate case, ``corr`` can be a scalar and is then considered as + the correlation coefficient. If ``corr`` is None, then the scatter + matrix is the identity matrix. + k_dim : int, optional + Dimension, number of components in the multivariate random variable. + allow_singular : bool, optional + Allow singular correlation matrix. + The behavior when the correlation matrix is singular is determined by + ``scipy.stats.multivariate_normal`` and might not be appropriate for + all copula or copula distribution methods. Behavior might change in + future versions. + + Notes + ----- + Elliptical copulas require that copula parameters are set when the + instance is created. Those parameters currently cannot be provided in the + call to methods. (This will most likely change in future versions.) + If non-empty ``args`` are provided in methods, then a ValueError is raised. + The ``args`` keyword is provided for a consistent interface across + copulas. + + References + ---------- + .. [1] Joe, Harry, 2014, Dependence modeling with copulas. CRC press. + p. 163 + + """ + + def __init__(self, corr=None, k_dim=2, allow_singular=False): + super().__init__(k_dim=k_dim) + if corr is None: + corr = np.eye(k_dim) + elif k_dim == 2 and np.size(corr) == 1: + corr = np.array([[1.0, corr], [corr, 1.0]]) + + self.corr = np.asarray(corr) + self.args = (self.corr,) + self.distr_uv = stats.norm + self.distr_mv = stats.multivariate_normal( + cov=corr, allow_singular=allow_singular + ) + + def dependence_tail(self, corr=None): + """ + Bivariate tail dependence parameter. + + Joe (2014) p. 182 + + Parameters + ---------- + corr : float, optional + Tail dependence for Gaussian copulas is always zero. + Argument will be ignored + + Returns + ------- + lower : float + Lower tail dependence coefficient, always 0 for the Gaussian + copula. + upper : float + Upper tail dependence coefficient, always 0 for the Gaussian + copula. + """ + + return 0, 0 + + def _arg_from_tau(self, tau): + # for generic compat + return self.corr_from_tau(tau) + + +class StudentTCopula(EllipticalCopula): + """Student t copula. + + Parameters + ---------- + corr : float or array_like, optional + Correlation or scatter matrix for the elliptical copula. In the + bivariate case, ``corr`` can be a scalar and is then considered as + the correlation coefficient. If ``corr`` is None, then the scatter + matrix is the identity matrix. + df : float, optional + Degrees of freedom of the multivariate t distribution. + k_dim : int, optional + Dimension, number of components in the multivariate random variable. + + Notes + ----- + Elliptical copulas require that copula parameters are set when the + instance is created. Those parameters currently cannot be provided in the + call to methods. (This will most likely change in future versions.) + If non-empty ``args`` are provided in methods, then a ValueError is raised. + The ``args`` keyword is provided for a consistent interface across + copulas. + + References + ---------- + .. [1] Joe, Harry, 2014, Dependence modeling with copulas. CRC press. + p. 181 + """ + + def __init__(self, corr=None, df=None, k_dim=2): + super().__init__(k_dim=k_dim) + if corr is None: + corr = np.eye(k_dim) + elif k_dim == 2 and np.size(corr) == 1: + corr = np.array([[1.0, corr], [corr, 1.0]]) + + self.df = df + self.corr = np.asarray(corr) + self.args = (corr, df) + # both uv and mv are frozen distributions + self.distr_uv = stats.t(df=df) + self.distr_mv = stats.multivariate_t(shape=corr, df=df) + + def cdf(self, u, args=()): + """Evaluate the cdf of the copula. + + Not implemented for the Student t copula. + + Parameters + ---------- + u : array_like, 2-D + Points of random variables in unit hypercube at which method + would be evaluated. + args : tuple, optional + Arguments for copula parameters. Not used by elliptical copulas, + which take their parameters as attributes. + + Raises + ------ + NotImplementedError + The cdf of the Student t copula is not available in closed + form. + """ + raise NotImplementedError("CDF not available in closed form.") + # ppf = self.distr_uv.ppf(u) + # mvt = MVT([0, 0], self.corr, self.df) + # return mvt.cdf(ppf) + + def spearmans_rho(self, corr=None): + """ + Bivariate Spearman's rho based on correlation coefficient. + + Joe (2014) p. 182 + + Parameters + ---------- + corr : float, optional + Pearson correlation. If corr is None, then the correlation will be + taken from the copula attribute. + + Returns + ------- + float or ndarray + Spearman's rho that corresponds to pearson correlation in the + elliptical copula. + """ + if corr is None: + corr = self.corr + if corr.shape == (2, 2): + corr = corr[0, 1] + + tau = 6 * np.arcsin(corr / 2) / np.pi + return tau + + def dependence_tail(self, corr=None): + """ + Bivariate tail dependence parameter. + + Joe (2014) p. 182 + + Parameters + ---------- + corr : float, optional + Pearson correlation. If corr is None, then the correlation will be + taken from the copula attribute. + + Returns + ------- + lower : float or ndarray + Lower tail dependence coefficient of the copula with given + Pearson correlation coefficient. + upper : float or ndarray + Upper tail dependence coefficient of the copula with given + Pearson correlation coefficient. + """ + if corr is None: + corr = self.corr + if corr.shape == (2, 2): + corr = corr[0, 1] + + df = self.df + t = -np.sqrt((df + 1) * (1 - corr) / (1 + corr)) + # Note self.distr_uv is frozen, df cannot change, use stats.t instead + lam = 2 * stats.t.cdf(t, df + 1) + return lam, lam + + def _arg_from_tau(self, tau): + # for generic compat + # this does not provide an estimate of df + return self.corr_from_tau(tau) diff --git a/shared/package-files/9c/9c958d98efa4130848c22ce3155b6c279bb03d5a7958f47af2116a0dbc3d6954/blob b/shared/package-files/9c/9c958d98efa4130848c22ce3155b6c279bb03d5a7958f47af2116a0dbc3d6954/blob new file mode 100644 index 0000000000000000000000000000000000000000..66e1a0f74c99445ff59e1f00af048a8e1f4e6e70 --- /dev/null +++ b/shared/package-files/9c/9c958d98efa4130848c22ce3155b6c279bb03d5a7958f47af2116a0dbc3d6954/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor pdist(const at::Tensor & self, double p=2); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9c/9c9627ede39b22378c16e58fcb4e525c5060718932ee470f63746f6c30b08d0f/blob b/shared/package-files/9c/9c9627ede39b22378c16e58fcb4e525c5060718932ee470f63746f6c30b08d0f/blob new file mode 100644 index 0000000000000000000000000000000000000000..0fe19016ca137b462b288279b92774109961fd72 --- /dev/null +++ b/shared/package-files/9c/9c9627ede39b22378c16e58fcb4e525c5060718932ee470f63746f6c30b08d0f/blob @@ -0,0 +1,29 @@ +import types + +from .utils import ExactWeakKeyDictionary + + +class CodeContextDict: + def __init__(self): + self.code_context = ExactWeakKeyDictionary() + + def has_context(self, code: types.CodeType): + return code in self.code_context + + def get_context(self, code: types.CodeType): + ctx = self.code_context.get(code) + if ctx is None: + ctx = {} + self.code_context[code] = ctx + return ctx + + def pop_context(self, code: types.CodeType): + ctx = self.get_context(code) + self.code_context._remove_id(id(code)) + return ctx + + def clear(self): + self.code_context.clear() + + +code_context = CodeContextDict() diff --git a/shared/package-files/9c/9c962c8a3d72016933faeea1f730fd0b5f2b5b5b7a81845c37ff4a3a5828e1dc/blob b/shared/package-files/9c/9c962c8a3d72016933faeea1f730fd0b5f2b5b5b7a81845c37ff4a3a5828e1dc/blob new file mode 100644 index 0000000000000000000000000000000000000000..262603e8f6aa6a87aea8ce8e3f92e20d53ca0676 --- /dev/null +++ b/shared/package-files/9c/9c962c8a3d72016933faeea1f730fd0b5f2b5b5b7a81845c37ff4a3a5828e1dc/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor linalg_cross(const at::Tensor & self, const at::Tensor & other, int64_t dim=-1); +TORCH_API at::Tensor & linalg_cross_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, int64_t dim=-1); +TORCH_API at::Tensor & linalg_cross_outf(const at::Tensor & self, const at::Tensor & other, int64_t dim, at::Tensor & out); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/9c/9c9cfdb3af956944b3fc3e4a8ff9ee6cc271e87c3326227a0481e69f17f6146e/blob b/shared/package-files/9c/9c9cfdb3af956944b3fc3e4a8ff9ee6cc271e87c3326227a0481e69f17f6146e/blob new file mode 100644 index 0000000000000000000000000000000000000000..e73dc12216fa051e6de0de0905aff1e0cd9ff4d1 Binary files /dev/null and b/shared/package-files/9c/9c9cfdb3af956944b3fc3e4a8ff9ee6cc271e87c3326227a0481e69f17f6146e/blob differ diff --git a/shared/package-files/9c/9c9ebd3cc4c651b573bc5d43bedab61d3c308475ecad77675f9cbddf4be30221/blob b/shared/package-files/9c/9c9ebd3cc4c651b573bc5d43bedab61d3c308475ecad77675f9cbddf4be30221/blob new file mode 100644 index 0000000000000000000000000000000000000000..04c0fcbe526164eda632c94fb2dcbca359e432d8 --- /dev/null +++ b/shared/package-files/9c/9c9ebd3cc4c651b573bc5d43bedab61d3c308475ecad77675f9cbddf4be30221/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_replication_pad1d : public at::impl::MetaBase { + + + void meta(const at::Tensor & self, at::ArrayRef padding); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/9c/9c9f1a8da5d2bb7f917d560f32d7899152f02f78470eeb33f1fa83b66a95bbed/blob b/shared/package-files/9c/9c9f1a8da5d2bb7f917d560f32d7899152f02f78470eeb33f1fa83b66a95bbed/blob new file mode 100644 index 0000000000000000000000000000000000000000..ad7b1a24e873be9c672d4a79ad0ab7b5ddf78d05 Binary files /dev/null and b/shared/package-files/9c/9c9f1a8da5d2bb7f917d560f32d7899152f02f78470eeb33f1fa83b66a95bbed/blob differ diff --git a/shared/package-files/9c/9ca0d5ac2e3fe0405fc846c741d56be2682601a4af769e9c244d973d97d4c1a0/blob b/shared/package-files/9c/9ca0d5ac2e3fe0405fc846c741d56be2682601a4af769e9c244d973d97d4c1a0/blob new file mode 100644 index 0000000000000000000000000000000000000000..1b7a02e1085a3be99a4ecd301fae425ea656440d --- /dev/null +++ b/shared/package-files/9c/9ca0d5ac2e3fe0405fc846c741d56be2682601a4af769e9c244d973d97d4c1a0/blob @@ -0,0 +1,1840 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +#pragma once + +#include +#include +#include +#include + +#include "arrow/type.h" +#include "arrow/util/bit_util.h" + +namespace arrow { + +// +// Per-type id type lookup +// + +template +struct TypeIdTraits {}; + +#define TYPE_ID_TRAIT(_id, _typeclass) \ + template <> \ + struct TypeIdTraits { \ + using Type = _typeclass; \ + }; + +TYPE_ID_TRAIT(NA, NullType) +TYPE_ID_TRAIT(BOOL, BooleanType) +TYPE_ID_TRAIT(INT8, Int8Type) +TYPE_ID_TRAIT(INT16, Int16Type) +TYPE_ID_TRAIT(INT32, Int32Type) +TYPE_ID_TRAIT(INT64, Int64Type) +TYPE_ID_TRAIT(UINT8, UInt8Type) +TYPE_ID_TRAIT(UINT16, UInt16Type) +TYPE_ID_TRAIT(UINT32, UInt32Type) +TYPE_ID_TRAIT(UINT64, UInt64Type) +TYPE_ID_TRAIT(HALF_FLOAT, HalfFloatType) +TYPE_ID_TRAIT(FLOAT, FloatType) +TYPE_ID_TRAIT(DOUBLE, DoubleType) +TYPE_ID_TRAIT(STRING, StringType) +TYPE_ID_TRAIT(BINARY, BinaryType) +TYPE_ID_TRAIT(LARGE_STRING, LargeStringType) +TYPE_ID_TRAIT(LARGE_BINARY, LargeBinaryType) +TYPE_ID_TRAIT(FIXED_SIZE_BINARY, FixedSizeBinaryType) +TYPE_ID_TRAIT(DATE32, Date32Type) +TYPE_ID_TRAIT(DATE64, Date64Type) +TYPE_ID_TRAIT(TIME32, Time32Type) +TYPE_ID_TRAIT(TIME64, Time64Type) +TYPE_ID_TRAIT(TIMESTAMP, TimestampType) +TYPE_ID_TRAIT(INTERVAL_DAY_TIME, DayTimeIntervalType) +TYPE_ID_TRAIT(INTERVAL_MONTH_DAY_NANO, MonthDayNanoIntervalType) +TYPE_ID_TRAIT(INTERVAL_MONTHS, MonthIntervalType) +TYPE_ID_TRAIT(DURATION, DurationType) +TYPE_ID_TRAIT(DECIMAL32, Decimal32Type) +TYPE_ID_TRAIT(DECIMAL64, Decimal64Type) +TYPE_ID_TRAIT(DECIMAL128, Decimal128Type) +TYPE_ID_TRAIT(DECIMAL256, Decimal256Type) +TYPE_ID_TRAIT(STRUCT, StructType) +TYPE_ID_TRAIT(LIST, ListType) +TYPE_ID_TRAIT(LARGE_LIST, LargeListType) +TYPE_ID_TRAIT(FIXED_SIZE_LIST, FixedSizeListType) +TYPE_ID_TRAIT(MAP, MapType) +TYPE_ID_TRAIT(DENSE_UNION, DenseUnionType) +TYPE_ID_TRAIT(SPARSE_UNION, SparseUnionType) +TYPE_ID_TRAIT(DICTIONARY, DictionaryType) +TYPE_ID_TRAIT(EXTENSION, ExtensionType) + +#undef TYPE_ID_TRAIT + +// +// Per-type type traits +// + +/// \addtogroup type-traits +/// \brief Base template for type traits of Arrow data types +/// Type traits provide various information about a type at compile time, such +/// as the associated ArrayType, BuilderType, and ScalarType. Not all types +/// provide all information. +/// \tparam T An Arrow data type +template +struct TypeTraits {}; + +/// \brief Base template for type traits of C++ types +/// \tparam T A standard C++ type +template +struct CTypeTraits {}; + +/// \addtogroup type-traits +/// @{ +template <> +struct TypeTraits { + using ArrayType = NullArray; + using BuilderType = NullBuilder; + using ScalarType = NullScalar; + + static constexpr int64_t bytes_required(int64_t) { return 0; } + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return null(); } +}; + +template <> +struct TypeTraits { + using ArrayType = BooleanArray; + using BuilderType = BooleanBuilder; + using ScalarType = BooleanScalar; + using CType = bool; + + static constexpr int64_t bytes_required(int64_t elements) { + return bit_util::BytesForBits(elements); + } + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return boolean(); } +}; +/// @} + +/// \addtogroup c-type-traits +template <> +struct CTypeTraits : public TypeTraits { + using ArrowType = BooleanType; +}; + +#define PRIMITIVE_TYPE_TRAITS_DEF_(CType_, ArrowType_, ArrowArrayType, ArrowBuilderType, \ + ArrowScalarType, ArrowTensorType, SingletonFn) \ + template <> \ + struct TypeTraits { \ + using ArrayType = ArrowArrayType; \ + using BuilderType = ArrowBuilderType; \ + using ScalarType = ArrowScalarType; \ + using TensorType = ArrowTensorType; \ + using CType = ArrowType_::c_type; \ + static constexpr int64_t bytes_required(int64_t elements) { \ + return elements * static_cast(sizeof(CType)); \ + } \ + constexpr static bool is_parameter_free = true; \ + static inline std::shared_ptr type_singleton() { return SingletonFn(); } \ + }; \ + \ + template <> \ + struct CTypeTraits : public TypeTraits { \ + using ArrowType = ArrowType_; \ + }; + +#define PRIMITIVE_TYPE_TRAITS_DEF(CType, ArrowShort, SingletonFn) \ + PRIMITIVE_TYPE_TRAITS_DEF_( \ + CType, ARROW_CONCAT(ArrowShort, Type), ARROW_CONCAT(ArrowShort, Array), \ + ARROW_CONCAT(ArrowShort, Builder), ARROW_CONCAT(ArrowShort, Scalar), \ + ARROW_CONCAT(ArrowShort, Tensor), SingletonFn) + +PRIMITIVE_TYPE_TRAITS_DEF(uint8_t, UInt8, uint8) +PRIMITIVE_TYPE_TRAITS_DEF(int8_t, Int8, int8) +PRIMITIVE_TYPE_TRAITS_DEF(uint16_t, UInt16, uint16) +PRIMITIVE_TYPE_TRAITS_DEF(int16_t, Int16, int16) +PRIMITIVE_TYPE_TRAITS_DEF(uint32_t, UInt32, uint32) +PRIMITIVE_TYPE_TRAITS_DEF(int32_t, Int32, int32) +PRIMITIVE_TYPE_TRAITS_DEF(uint64_t, UInt64, uint64) +PRIMITIVE_TYPE_TRAITS_DEF(int64_t, Int64, int64) +PRIMITIVE_TYPE_TRAITS_DEF(float, Float, float32) +PRIMITIVE_TYPE_TRAITS_DEF(double, Double, float64) + +#undef PRIMITIVE_TYPE_TRAITS_DEF +#undef PRIMITIVE_TYPE_TRAITS_DEF_ + +/// \addtogroup type-traits +/// @{ +template <> +struct TypeTraits { + using ArrayType = Date64Array; + using BuilderType = Date64Builder; + using ScalarType = Date64Scalar; + using CType = Date64Type::c_type; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * static_cast(sizeof(int64_t)); + } + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return date64(); } +}; + +template <> +struct TypeTraits { + using ArrayType = Date32Array; + using BuilderType = Date32Builder; + using ScalarType = Date32Scalar; + using CType = Date32Type::c_type; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * static_cast(sizeof(int32_t)); + } + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return date32(); } +}; + +template <> +struct TypeTraits { + using ArrayType = TimestampArray; + using BuilderType = TimestampBuilder; + using ScalarType = TimestampScalar; + using CType = TimestampType::c_type; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * static_cast(sizeof(int64_t)); + } + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = DurationArray; + using BuilderType = DurationBuilder; + using ScalarType = DurationScalar; + using CType = DurationType::c_type; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * static_cast(sizeof(int64_t)); + } + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = DayTimeIntervalArray; + using BuilderType = DayTimeIntervalBuilder; + using ScalarType = DayTimeIntervalScalar; + using CType = DayTimeIntervalType::c_type; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * static_cast(sizeof(DayTimeIntervalType::DayMilliseconds)); + } + constexpr static bool is_parameter_free = true; + static std::shared_ptr type_singleton() { return day_time_interval(); } +}; + +template <> +struct TypeTraits { + using ArrayType = MonthDayNanoIntervalArray; + using BuilderType = MonthDayNanoIntervalBuilder; + using ScalarType = MonthDayNanoIntervalScalar; + using CType = MonthDayNanoIntervalType::c_type; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * + static_cast(sizeof(MonthDayNanoIntervalType::MonthDayNanos)); + } + constexpr static bool is_parameter_free = true; + static std::shared_ptr type_singleton() { return month_day_nano_interval(); } +}; + +template <> +struct TypeTraits { + using ArrayType = MonthIntervalArray; + using BuilderType = MonthIntervalBuilder; + using ScalarType = MonthIntervalScalar; + using CType = MonthIntervalType::c_type; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * static_cast(sizeof(int32_t)); + } + constexpr static bool is_parameter_free = true; + static std::shared_ptr type_singleton() { return month_interval(); } +}; + +template <> +struct TypeTraits { + using ArrayType = Time32Array; + using BuilderType = Time32Builder; + using ScalarType = Time32Scalar; + using CType = Time32Type::c_type; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * static_cast(sizeof(int32_t)); + } + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = Time64Array; + using BuilderType = Time64Builder; + using ScalarType = Time64Scalar; + using CType = Time64Type::c_type; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * static_cast(sizeof(int64_t)); + } + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = HalfFloatArray; + using BuilderType = HalfFloatBuilder; + using ScalarType = HalfFloatScalar; + using TensorType = HalfFloatTensor; + using CType = uint16_t; + + static constexpr int64_t bytes_required(int64_t elements) { + return elements * static_cast(sizeof(uint16_t)); + } + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return float16(); } +}; + +template <> +struct CTypeTraits : public TypeTraits { + using ArrowType = HalfFloatType; +}; + +template <> +struct TypeTraits { + using ArrayType = Decimal32Array; + using BuilderType = Decimal32Builder; + using ScalarType = Decimal32Scalar; + using CType = Decimal32; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = Decimal64Array; + using BuilderType = Decimal64Builder; + using ScalarType = Decimal64Scalar; + using CType = Decimal64; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = Decimal128Array; + using BuilderType = Decimal128Builder; + using ScalarType = Decimal128Scalar; + using CType = Decimal128; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = Decimal256Array; + using BuilderType = Decimal256Builder; + using ScalarType = Decimal256Scalar; + using CType = Decimal256; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = BinaryArray; + using BuilderType = BinaryBuilder; + using ScalarType = BinaryScalar; + using OffsetType = Int32Type; + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return binary(); } +}; + +template <> +struct TypeTraits { + using ArrayType = BinaryViewArray; + using BuilderType = BinaryViewBuilder; + using ScalarType = BinaryViewScalar; + using CType = BinaryViewType::c_type; + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return binary_view(); } +}; + +template <> +struct TypeTraits { + using ArrayType = LargeBinaryArray; + using BuilderType = LargeBinaryBuilder; + using ScalarType = LargeBinaryScalar; + using OffsetType = Int64Type; + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return large_binary(); } +}; + +template <> +struct TypeTraits { + using ArrayType = FixedSizeBinaryArray; + using BuilderType = FixedSizeBinaryBuilder; + using ScalarType = FixedSizeBinaryScalar; + // FixedSizeBinary doesn't have offsets per se, but string length is int32 sized + using OffsetType = Int32Type; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = StringArray; + using BuilderType = StringBuilder; + using ScalarType = StringScalar; + using OffsetType = Int32Type; + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return utf8(); } +}; + +template <> +struct TypeTraits { + using ArrayType = StringViewArray; + using BuilderType = StringViewBuilder; + using ScalarType = StringViewScalar; + using CType = BinaryViewType::c_type; + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return utf8_view(); } +}; + +template <> +struct TypeTraits { + using ArrayType = LargeStringArray; + using BuilderType = LargeStringBuilder; + using ScalarType = LargeStringScalar; + using OffsetType = Int64Type; + constexpr static bool is_parameter_free = true; + static inline std::shared_ptr type_singleton() { return large_utf8(); } +}; + +template <> +struct TypeTraits { + using ArrayType = RunEndEncodedArray; + using BuilderType = RunEndEncodedBuilder; + using ScalarType = RunEndEncodedScalar; + + constexpr static bool is_parameter_free = false; +}; + +/// @} + +/// \addtogroup c-type-traits +/// @{ +template <> +struct CTypeTraits : public TypeTraits { + using ArrowType = StringType; +}; + +template <> +struct CTypeTraits : public TypeTraits { + using ArrowType = BinaryViewType; +}; + +template <> +struct CTypeTraits : public CTypeTraits {}; + +template +struct CTypeTraits : public CTypeTraits {}; + +template <> +struct CTypeTraits + : public TypeTraits { + using ArrowType = DayTimeIntervalType; +}; +/// @} + +/// \addtogroup type-traits +/// @{ +template <> +struct TypeTraits { + using ArrayType = ListArray; + using BuilderType = ListBuilder; + using ScalarType = ListScalar; + using OffsetType = Int32Type; + using OffsetArrayType = Int32Array; + using OffsetBuilderType = Int32Builder; + using OffsetScalarType = Int32Scalar; + constexpr static bool is_parameter_free = false; + using LargeType = LargeListType; +}; + +template <> +struct TypeTraits { + using ArrayType = LargeListArray; + using BuilderType = LargeListBuilder; + using ScalarType = LargeListScalar; + using OffsetType = Int64Type; + using OffsetArrayType = Int64Array; + using OffsetBuilderType = Int64Builder; + using OffsetScalarType = Int64Scalar; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = ListViewArray; + using BuilderType = ListViewBuilder; + using ScalarType = ListViewScalar; + using OffsetType = Int32Type; + using OffsetArrayType = Int32Array; + using OffsetBuilderType = Int32Builder; + using OffsetScalarType = Int32Scalar; + constexpr static bool is_parameter_free = false; + using LargeType = LargeListViewType; +}; + +template <> +struct TypeTraits { + using ArrayType = LargeListViewArray; + using BuilderType = LargeListViewBuilder; + using ScalarType = LargeListViewScalar; + using OffsetType = Int64Type; + using OffsetArrayType = Int64Array; + using OffsetBuilderType = Int64Builder; + using OffsetScalarType = Int64Scalar; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = MapArray; + using BuilderType = MapBuilder; + using ScalarType = MapScalar; + using OffsetType = Int32Type; + using OffsetArrayType = Int32Array; + using OffsetBuilderType = Int32Builder; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = FixedSizeListArray; + using BuilderType = FixedSizeListBuilder; + using ScalarType = FixedSizeListScalar; + constexpr static bool is_parameter_free = false; +}; +/// @} + +/// \addtogroup c-type-traits +template +struct CTypeTraits> : public TypeTraits { + using ArrowType = ListType; + + static inline std::shared_ptr type_singleton() { + return list(CTypeTraits::type_singleton()); + } +}; + +/// \addtogroup c-type-traits +template +struct CTypeTraits> : public TypeTraits { + using ArrowType = FixedSizeListType; + + static auto type_singleton() { + return fixed_size_list(CTypeTraits::type_singleton(), N); + } +}; + +/// \addtogroup type-traits +/// @{ +template <> +struct TypeTraits { + using ArrayType = StructArray; + using BuilderType = StructBuilder; + using ScalarType = StructScalar; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = SparseUnionArray; + using BuilderType = SparseUnionBuilder; + using ScalarType = SparseUnionScalar; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = DenseUnionArray; + using BuilderType = DenseUnionBuilder; + using ScalarType = DenseUnionScalar; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = DictionaryArray; + using ScalarType = DictionaryScalar; + constexpr static bool is_parameter_free = false; +}; + +template <> +struct TypeTraits { + using ArrayType = ExtensionArray; + using ScalarType = ExtensionScalar; + constexpr static bool is_parameter_free = false; +}; +/// @} + +namespace internal { + +template +struct make_void { + using type = void; +}; + +template +using void_t = typename make_void::type; + +} // namespace internal + +// +// Useful type predicates +// + +/// \addtogroup type-predicates +/// @{ + +// only in C++14 +template +using enable_if_t = typename std::enable_if::type; + +template +using is_null_type = std::is_same; + +template +using enable_if_null = enable_if_t::value, R>; + +template +using is_boolean_type = std::is_same; + +template +using enable_if_boolean = enable_if_t::value, R>; + +template +using is_number_type = std::is_base_of; + +template +using enable_if_number = enable_if_t::value, R>; + +template +using is_integer_type = std::is_base_of; + +template +using enable_if_integer = enable_if_t::value, R>; + +template +using is_signed_integer_type = + std::integral_constant::value && + std::is_signed::value>; + +template +using enable_if_signed_integer = enable_if_t::value, R>; + +template +using is_unsigned_integer_type = + std::integral_constant::value && + std::is_unsigned::value>; + +template +using enable_if_unsigned_integer = enable_if_t::value, R>; + +// Note this will also include HalfFloatType which is represented by a +// non-floating point primitive (uint16_t). +template +using is_floating_type = std::is_base_of; + +template +using enable_if_floating_point = enable_if_t::value, R>; + +// Half floats are special in that they behave physically like an unsigned +// integer. +template +using is_half_float_type = std::is_same; + +template +using enable_if_half_float = enable_if_t::value, R>; + +// Binary Types + +// Base binary refers to Binary/LargeBinary/String/LargeString +template +using is_base_binary_type = std::is_base_of; + +template +using enable_if_base_binary = enable_if_t::value, R>; + +// Any binary excludes string from Base binary +template +using is_binary_type = + std::integral_constant::value || + std::is_same::value>; + +template +using enable_if_binary = enable_if_t::value, R>; + +template +using is_string_type = + std::integral_constant::value || + std::is_same::value>; + +template +using enable_if_string = enable_if_t::value, R>; + +template +using is_binary_view_like_type = std::is_base_of; + +template +using is_binary_view_type = std::is_same; + +template +using is_string_view_type = std::is_same; + +template +using enable_if_binary_view_like = enable_if_t::value, R>; + +template +using enable_if_binary_view = enable_if_t::value, R>; + +template +using enable_if_string_view = enable_if_t::value, R>; + +template +using is_string_like_type = + std::integral_constant::value && T::is_utf8>; + +template +using enable_if_string_like = enable_if_t::value, R>; + +template +using enable_if_same = enable_if_t::value, R>; + +// Note that this also includes DecimalType +template +using is_fixed_size_binary_type = std::is_base_of; + +template +using enable_if_fixed_size_binary = enable_if_t::value, R>; + +// This includes primitive, dictionary, and fixed-size-binary types +template +using is_fixed_width_type = std::is_base_of; + +template +using enable_if_fixed_width_type = enable_if_t::value, R>; + +template +using is_binary_like_type = + std::integral_constant::value && + !is_string_like_type::value) || + is_fixed_size_binary_type::value>; + +template +using enable_if_binary_like = enable_if_t::value, R>; + +template +using is_decimal_type = std::is_base_of; + +template +using enable_if_decimal = enable_if_t::value, R>; + +template +using is_decimal32_type = std::is_base_of; + +template +using enable_if_decimal32 = enable_if_t::value, R>; + +template +using is_decimal64_type = std::is_base_of; + +template +using enable_if_decimal64 = enable_if_t::value, R>; + +template +using is_decimal128_type = std::is_base_of; + +template +using enable_if_decimal128 = enable_if_t::value, R>; + +template +using is_decimal256_type = std::is_base_of; + +template +using enable_if_decimal256 = enable_if_t::value, R>; + +// Nested Types + +template +using is_nested_type = std::is_base_of; + +template +using enable_if_nested = enable_if_t::value, R>; + +template +using enable_if_not_nested = enable_if_t::value, R>; + +template +using is_var_length_list_type = + std::integral_constant::value || + std::is_base_of::value>; + +template +using enable_if_var_size_list = enable_if_t::value, R>; + +// DEPRECATED use is_var_length_list_type. +template +using is_base_list_type = is_var_length_list_type; + +// DEPRECATED use enable_if_var_size_list +template +using enable_if_base_list = enable_if_var_size_list; + +template +using is_fixed_size_list_type = std::is_same; + +template +using enable_if_fixed_size_list = enable_if_t::value, R>; + +template +using is_list_type = + std::integral_constant::value || + std::is_same::value || + std::is_same::value>; + +template +using enable_if_list_type = enable_if_t::value, R>; + +template +using is_list_view_type = + std::disjunction, std::is_same>; + +template +using enable_if_list_view = enable_if_t::value, R>; + +template +using is_list_like_type = + std::integral_constant::value || + is_fixed_size_list_type::value>; + +template +using enable_if_list_like = enable_if_t::value, R>; + +template +using is_var_length_list_like_type = + std::disjunction, is_list_view_type>; + +template +using enable_if_var_length_list_like = + enable_if_t::value, R>; + +template +using is_struct_type = std::is_base_of; + +template +using enable_if_struct = enable_if_t::value, R>; + +template +using is_union_type = std::is_base_of; + +template +using enable_if_union = enable_if_t::value, R>; + +// TemporalTypes + +template +using is_temporal_type = std::is_base_of; + +template +using enable_if_temporal = enable_if_t::value, R>; + +template +using is_date_type = std::is_base_of; + +template +using enable_if_date = enable_if_t::value, R>; + +template +using is_time_type = std::is_base_of; + +template +using enable_if_time = enable_if_t::value, R>; + +template +using is_timestamp_type = std::is_base_of; + +template +using enable_if_timestamp = enable_if_t::value, R>; + +template +using is_duration_type = std::is_base_of; + +template +using enable_if_duration = enable_if_t::value, R>; + +template +using is_interval_type = std::is_base_of; + +template +using enable_if_interval = enable_if_t::value, R>; + +template +using is_run_end_encoded_type = std::is_base_of; + +template +using enable_if_run_end_encoded = enable_if_t::value, R>; + +template +using is_dictionary_type = std::is_base_of; + +template +using enable_if_dictionary = enable_if_t::value, R>; + +template +using is_extension_type = std::is_base_of; + +template +using enable_if_extension = enable_if_t::value, R>; + +// Attribute differentiation + +template +using is_primitive_ctype = std::is_base_of; + +template +using enable_if_primitive_ctype = enable_if_t::value, R>; + +template +using has_c_type = std::integral_constant::value || + is_temporal_type::value>; + +template +using enable_if_has_c_type = enable_if_t::value, R>; + +template +using has_string_view = + std::integral_constant::value || + std::is_same::value || + std::is_same::value || + std::is_same::value || + std::is_same::value || + std::is_same::value || + std::is_same::value>; + +template +using enable_if_has_string_view = enable_if_t::value, R>; + +template +using is_8bit_int = std::integral_constant::value || + std::is_same::value>; + +template +using enable_if_8bit_int = enable_if_t::value, R>; + +template +using is_parameter_free_type = + std::integral_constant::is_parameter_free>; + +template +using enable_if_parameter_free = enable_if_t::value, R>; + +// Physical representation quirks + +template +using is_physical_signed_integer_type = + std::integral_constant::value || + (is_temporal_type::value && has_c_type::value && + std::is_integral::value)>; + +template +using enable_if_physical_signed_integer = + enable_if_t::value, R>; + +template +using is_physical_unsigned_integer_type = + std::integral_constant::value || + is_half_float_type::value>; + +template +using enable_if_physical_unsigned_integer = + enable_if_t::value, R>; + +template +using is_physical_integer_type = + std::integral_constant::value || + is_physical_signed_integer_type::value>; + +template +using enable_if_physical_integer = enable_if_t::value, R>; + +// Like is_floating_type but excluding half-floats which don't have a +// float-like c type. +template +using is_physical_floating_type = + std::integral_constant::value && !is_half_float_type::value>; + +template +using enable_if_physical_floating_point = + enable_if_t::value, R>; + +/// @} + +/// \addtogroup runtime-type-predicates +/// @{ + +/// \brief Check for an integer type (signed or unsigned) +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is an integer type one +constexpr bool is_integer(Type::type type_id) { + switch (type_id) { + case Type::UINT8: + case Type::INT8: + case Type::UINT16: + case Type::INT16: + case Type::UINT32: + case Type::INT32: + case Type::UINT64: + case Type::INT64: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a signed integer type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a signed integer type one +constexpr bool is_signed_integer(Type::type type_id) { + switch (type_id) { + case Type::INT8: + case Type::INT16: + case Type::INT32: + case Type::INT64: + return true; + default: + break; + } + return false; +} + +/// \brief Check for an unsigned integer type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is an unsigned integer type one +constexpr bool is_unsigned_integer(Type::type type_id) { + switch (type_id) { + case Type::UINT8: + case Type::UINT16: + case Type::UINT32: + case Type::UINT64: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a floating point type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a floating point type one +constexpr bool is_floating(Type::type type_id) { + switch (type_id) { + case Type::HALF_FLOAT: + case Type::FLOAT: + case Type::DOUBLE: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a physical floating point type +/// +/// This predicate matches floating-point types, except half-float. +constexpr bool is_physical_floating(Type::type type_id) { + return is_floating(type_id) && type_id != Type::HALF_FLOAT; +} + +/// \brief Check for a numeric type +/// +/// This predicate doesn't match decimals (see `is_decimal`). +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a numeric type one +constexpr bool is_numeric(Type::type type_id) { + switch (type_id) { + case Type::UINT8: + case Type::INT8: + case Type::UINT16: + case Type::INT16: + case Type::UINT32: + case Type::INT32: + case Type::UINT64: + case Type::INT64: + case Type::HALF_FLOAT: + case Type::FLOAT: + case Type::DOUBLE: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a decimal type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a decimal type one +constexpr bool is_decimal(Type::type type_id) { + switch (type_id) { + case Type::DECIMAL32: + case Type::DECIMAL64: + case Type::DECIMAL128: + case Type::DECIMAL256: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a type that can be used as a run-end in Run-End Encoded +/// arrays +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id can represent a run-end value +constexpr bool is_run_end_type(Type::type type_id) { + switch (type_id) { + case Type::INT16: + case Type::INT32: + case Type::INT64: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a primitive type +/// +/// This predicate doesn't match null, decimals and binary-like types. +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a primitive type one +constexpr bool is_primitive(Type::type type_id) { + switch (type_id) { + case Type::BOOL: + case Type::UINT8: + case Type::INT8: + case Type::UINT16: + case Type::INT16: + case Type::UINT32: + case Type::INT32: + case Type::UINT64: + case Type::INT64: + case Type::HALF_FLOAT: + case Type::FLOAT: + case Type::DOUBLE: + case Type::DATE32: + case Type::DATE64: + case Type::TIME32: + case Type::TIME64: + case Type::TIMESTAMP: + case Type::DURATION: + case Type::INTERVAL_MONTHS: + case Type::INTERVAL_MONTH_DAY_NANO: + case Type::INTERVAL_DAY_TIME: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a base-binary-like type +/// +/// This predicate doesn't match fixed-size binary types and will otherwise +/// match all binary- and string-like types regardless of offset width. +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a base-binary-like type one +constexpr bool is_base_binary_like(Type::type type_id) { + switch (type_id) { + case Type::BINARY: + case Type::LARGE_BINARY: + case Type::STRING: + case Type::LARGE_STRING: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a binary-like type (i.e. with 32-bit offsets) +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a binary-like type one +constexpr bool is_binary_like(Type::type type_id) { + switch (type_id) { + case Type::BINARY: + case Type::STRING: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a large-binary-like type (i.e. with 64-bit offsets) +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a large-binary-like type one +constexpr bool is_large_binary_like(Type::type type_id) { + switch (type_id) { + case Type::LARGE_BINARY: + case Type::LARGE_STRING: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a binary (non-string) type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a binary type one +constexpr bool is_binary(Type::type type_id) { + switch (type_id) { + case Type::BINARY: + case Type::LARGE_BINARY: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a binary or binary view (non-string) type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a binary type one +constexpr bool is_binary_or_binary_view(Type::type type_id) { + switch (type_id) { + case Type::BINARY: + case Type::LARGE_BINARY: + case Type::BINARY_VIEW: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a string type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a string type one +constexpr bool is_string(Type::type type_id) { + switch (type_id) { + case Type::STRING: + case Type::LARGE_STRING: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a string or string view type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a string type one +constexpr bool is_string_or_string_view(Type::type type_id) { + switch (type_id) { + case Type::STRING: + case Type::LARGE_STRING: + case Type::STRING_VIEW: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a binary-view-like type (i.e. string view and binary view) +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a binary-view-like type one +constexpr bool is_binary_view_like(Type::type type_id) { + switch (type_id) { + case Type::STRING_VIEW: + case Type::BINARY_VIEW: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a temporal type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a temporal type one +constexpr bool is_temporal(Type::type type_id) { + switch (type_id) { + case Type::DATE32: + case Type::DATE64: + case Type::TIME32: + case Type::TIME64: + case Type::TIMESTAMP: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a time type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a primitive type one +constexpr bool is_time(Type::type type_id) { + switch (type_id) { + case Type::TIME32: + case Type::TIME64: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a date type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a primitive type one +constexpr bool is_date(Type::type type_id) { + switch (type_id) { + case Type::DATE32: + case Type::DATE64: + return true; + default: + break; + } + return false; +} + +/// \brief Check for an interval type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is an interval type one +constexpr bool is_interval(Type::type type_id) { + switch (type_id) { + case Type::INTERVAL_MONTHS: + case Type::INTERVAL_DAY_TIME: + case Type::INTERVAL_MONTH_DAY_NANO: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a dictionary type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a dictionary type one +constexpr bool is_dictionary(Type::type type_id) { return type_id == Type::DICTIONARY; } + +/// \brief Check for a fixed-size-binary type +/// +/// This predicate also matches decimals. +/// \param[in] type_id the type-id to check +/// \return whether type-id is a fixed-size-binary type one +constexpr bool is_fixed_size_binary(Type::type type_id) { + switch (type_id) { + case Type::DECIMAL32: + case Type::DECIMAL64: + case Type::DECIMAL128: + case Type::DECIMAL256: + case Type::FIXED_SIZE_BINARY: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a fixed-width type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a fixed-width type one +constexpr bool is_fixed_width(Type::type type_id) { + return is_primitive(type_id) || is_dictionary(type_id) || is_fixed_size_binary(type_id); +} + +/// \brief Check for a variable-length list type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a variable-length list type one +constexpr bool is_var_length_list(Type::type type_id) { + switch (type_id) { + case Type::LIST: + case Type::LARGE_LIST: + case Type::MAP: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a list type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a list type one +constexpr bool is_list(Type::type type_id) { + switch (type_id) { + case Type::LIST: + case Type::LARGE_LIST: + case Type::FIXED_SIZE_LIST: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a list-like type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a list-like type one +constexpr bool is_list_like(Type::type type_id) { + switch (type_id) { + case Type::LIST: + case Type::LARGE_LIST: + case Type::FIXED_SIZE_LIST: + case Type::MAP: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a var-length list or list-view like type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a var-length list or list-view like type +constexpr bool is_var_length_list_like(Type::type type_id) { + switch (type_id) { + case Type::LIST: + case Type::LARGE_LIST: + case Type::LIST_VIEW: + case Type::LARGE_LIST_VIEW: + case Type::MAP: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a list-view type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a list-view type one +constexpr bool is_list_view(Type::type type_id) { + switch (type_id) { + case Type::LIST_VIEW: + case Type::LARGE_LIST_VIEW: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a nested type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a nested type one +constexpr bool is_nested(Type::type type_id) { + switch (type_id) { + case Type::LIST: + case Type::LARGE_LIST: + case Type::LIST_VIEW: + case Type::LARGE_LIST_VIEW: + case Type::FIXED_SIZE_LIST: + case Type::MAP: + case Type::STRUCT: + case Type::SPARSE_UNION: + case Type::DENSE_UNION: + case Type::RUN_END_ENCODED: + return true; + default: + break; + } + return false; +} + +/// \brief Check for a union type +/// +/// \param[in] type_id the type-id to check +/// \return whether type-id is a union type one +constexpr bool is_union(Type::type type_id) { + switch (type_id) { + case Type::SPARSE_UNION: + case Type::DENSE_UNION: + return true; + default: + break; + } + return false; +} + +/// \brief Return the values bit width of a type +/// +/// \param[in] type_id the type-id to check +/// \return the values bit width, or 0 if the type does not have fixed-width values +/// +/// For Type::FIXED_SIZE_BINARY, you will instead need to inspect the concrete +/// DataType to get this information. +constexpr int bit_width(Type::type type_id) { + switch (type_id) { + case Type::BOOL: + return 1; + case Type::UINT8: + case Type::INT8: + return 8; + case Type::UINT16: + case Type::INT16: + return 16; + case Type::UINT32: + case Type::INT32: + case Type::DATE32: + case Type::TIME32: + return 32; + case Type::UINT64: + case Type::INT64: + case Type::DATE64: + case Type::TIME64: + case Type::TIMESTAMP: + case Type::DURATION: + return 64; + + case Type::HALF_FLOAT: + return 16; + case Type::FLOAT: + return 32; + case Type::DOUBLE: + return 64; + + case Type::INTERVAL_MONTHS: + return 32; + case Type::INTERVAL_DAY_TIME: + return 64; + case Type::INTERVAL_MONTH_DAY_NANO: + return 128; + + case Type::DECIMAL32: + return 32; + case Type::DECIMAL64: + return 64; + case Type::DECIMAL128: + return 128; + case Type::DECIMAL256: + return 256; + + default: + break; + } + return 0; +} + +/// \brief Return the offsets bit width of a type +/// +/// \param[in] type_id the type-id to check +/// \return the offsets bit width, or 0 if the type does not have offsets +constexpr int offset_bit_width(Type::type type_id) { + switch (type_id) { + case Type::STRING: + case Type::BINARY: + case Type::LIST: + case Type::LIST_VIEW: + case Type::MAP: + case Type::DENSE_UNION: + return 32; + case Type::LARGE_STRING: + case Type::LARGE_BINARY: + case Type::LARGE_LIST: + case Type::LARGE_LIST_VIEW: + return 64; + default: + break; + } + return 0; +} + +/// \brief Get the alignment a buffer should have to be considered "value aligned" +/// +/// Some buffers are frequently type-punned. For example, in an int32 array the +/// values buffer is frequently cast to int32_t* +/// +/// This sort of punning is technically only valid if the pointer is aligned to a +/// proper width (e.g. 4 bytes in the case of int32). However, most modern compilers +/// are quite permissive if we get this wrong. Note that this alignment is something +/// that is guaranteed by malloc (e.g. new int32_t[] will return a buffer that is 4 +/// byte aligned) or common libraries (e.g. numpy) but it is not currently guaranteed +/// by flight (GH-32276). +/// +/// We call this "value aligned" and this method will calculate that required alignment. +/// +/// \param type_id the type of the array containing the buffer +/// Note: this should be the indices type for a dictionary array since +/// A dictionary array's buffers are indices. It should be the storage +/// type for an extension array. +/// \param buffer_index the index of the buffer to check, for example 0 will typically +/// give you the alignment expected of the validity buffer +/// \return the required value alignment in bytes (1 if no alignment required) +int RequiredValueAlignmentForBuffer(Type::type type_id, int buffer_index); + +/// \brief Check for an integer type (signed or unsigned) +/// +/// \param[in] type the type to check +/// \return whether type is an integer type +/// +/// Convenience for checking using the type's id +constexpr bool is_integer(const DataType& type) { return is_integer(type.id()); } + +/// \brief Check for a signed integer type +/// +/// \param[in] type the type to check +/// \return whether type is a signed integer type +/// +/// Convenience for checking using the type's id +constexpr bool is_signed_integer(const DataType& type) { + return is_signed_integer(type.id()); +} + +/// \brief Check for an unsigned integer type +/// +/// \param[in] type the type to check +/// \return whether type is an unsigned integer type +/// +/// Convenience for checking using the type's id +constexpr bool is_unsigned_integer(const DataType& type) { + return is_unsigned_integer(type.id()); +} + +/// \brief Check for a floating point type +/// +/// \param[in] type the type to check +/// \return whether type is a floating point type +/// +/// Convenience for checking using the type's id +constexpr bool is_floating(const DataType& type) { return is_floating(type.id()); } + +/// \brief Check for a numeric type (number except boolean type) +/// +/// \param[in] type the type to check +/// \return whether type is a numeric type +/// +/// Convenience for checking using the type's id +constexpr bool is_numeric(const DataType& type) { return is_numeric(type.id()); } + +/// \brief Check for a decimal type +/// +/// \param[in] type the type to check +/// \return whether type is a decimal type +/// +/// Convenience for checking using the type's id +constexpr bool is_decimal(const DataType& type) { return is_decimal(type.id()); } + +/// \brief Check for a primitive type +/// +/// \param[in] type the type to check +/// \return whether type is a primitive type +/// +/// Convenience for checking using the type's id +constexpr bool is_primitive(const DataType& type) { return is_primitive(type.id()); } + +/// \brief Check for a binary or string-like type (except fixed-size binary) +/// +/// \param[in] type the type to check +/// \return whether type is a binary or string-like type +/// +/// Convenience for checking using the type's id +constexpr bool is_base_binary_like(const DataType& type) { + return is_base_binary_like(type.id()); +} + +/// \brief Check for a binary-like type +/// +/// \param[in] type the type to check +/// \return whether type is a binary-like type +/// +/// Convenience for checking using the type's id +constexpr bool is_binary_like(const DataType& type) { return is_binary_like(type.id()); } + +/// \brief Check for a large-binary-like type +/// +/// \param[in] type the type to check +/// \return whether type is a large-binary-like type +/// +/// Convenience for checking using the type's id +constexpr bool is_large_binary_like(const DataType& type) { + return is_large_binary_like(type.id()); +} + +/// \brief Check for a binary type +/// +/// \param[in] type the type to check +/// \return whether type is a binary type +/// +/// Convenience for checking using the type's id +constexpr bool is_binary(const DataType& type) { return is_binary(type.id()); } + +/// \brief Check for a string type +/// +/// \param[in] type the type to check +/// \return whether type is a string type +/// +/// Convenience for checking using the type's id +constexpr bool is_string(const DataType& type) { return is_string(type.id()); } + +/// \brief Check for a binary-view-like type +/// +/// \param[in] type the type to check +/// \return whether type is a binary-view-like type +/// +/// Convenience for checking using the type's id +constexpr bool is_binary_view_like(const DataType& type) { + return is_binary_view_like(type.id()); +} + +/// \brief Check for a temporal type, including time and timestamps for each unit +/// +/// \param[in] type the type to check +/// \return whether type is a temporal type +/// +/// Convenience for checking using the type's id +constexpr bool is_temporal(const DataType& type) { return is_temporal(type.id()); } + +/// \brief Check for an interval type +/// +/// \param[in] type the type to check +/// \return whether type is a interval type +/// +/// Convenience for checking using the type's id +constexpr bool is_interval(const DataType& type) { return is_interval(type.id()); } + +/// \brief Check for a dictionary type +/// +/// \param[in] type the type to check +/// \return whether type is a dictionary type +/// +/// Convenience for checking using the type's id +constexpr bool is_dictionary(const DataType& type) { return is_dictionary(type.id()); } + +/// \brief Check for a fixed-size-binary type +/// +/// \param[in] type the type to check +/// \return whether type is a fixed-size-binary type +/// +/// Convenience for checking using the type's id +constexpr bool is_fixed_size_binary(const DataType& type) { + return is_fixed_size_binary(type.id()); +} + +/// \brief Check for a fixed-width type +/// +/// \param[in] type the type to check +/// \return whether type is a fixed-width type +/// +/// Convenience for checking using the type's id +constexpr bool is_fixed_width(const DataType& type) { return is_fixed_width(type.id()); } + +/// \brief Check for a variable-length list type +/// +/// \param[in] type the type to check +/// \return whether type is a variable-length list type +/// +/// Convenience for checking using the type's id +constexpr bool is_var_length_list(const DataType& type) { + return is_var_length_list(type.id()); +} + +/// \brief Check for a list-like type +/// +/// \param[in] type the type to check +/// \return whether type is a list-like type +/// +/// Convenience for checking using the type's id +constexpr bool is_list_like(const DataType& type) { return is_list_like(type.id()); } + +/// \brief Check for a var-length list or list-view like type +/// +/// \param[in] type the type to check +/// \return whether type is a var-length list or list-view like type +/// +/// Convenience for checking using the type's id +constexpr bool is_var_length_list_like(const DataType& type) { + return is_var_length_list_like(type.id()); +} + +/// \brief Check for a list-view type +/// +/// \param[in] type the type to check +/// \return whether type is a list-view type +/// +/// Convenience for checking using the type's id +constexpr bool is_list_view(const DataType& type) { return is_list_view(type.id()); } + +/// \brief Check for a nested type +/// +/// \param[in] type the type to check +/// \return whether type is a nested type +/// +/// Convenience for checking using the type's id +constexpr bool is_nested(const DataType& type) { return is_nested(type.id()); } + +/// \brief Check for a union type +/// +/// \param[in] type the type to check +/// \return whether type is a union type +/// +/// Convenience for checking using the type's id +constexpr bool is_union(const DataType& type) { return is_union(type.id()); } + +/// @} + +} // namespace arrow diff --git a/shared/package-files/9c/9ca38cfbfc1c387cc7844795f4a07370c54d96f8892b89cfd6714152dbe78d33/blob b/shared/package-files/9c/9ca38cfbfc1c387cc7844795f4a07370c54d96f8892b89cfd6714152dbe78d33/blob new file mode 100644 index 0000000000000000000000000000000000000000..7fcdd498e0073ada094a20a9ae423e01cb0f8ceb --- /dev/null +++ b/shared/package-files/9c/9ca38cfbfc1c387cc7844795f4a07370c54d96f8892b89cfd6714152dbe78d33/blob @@ -0,0 +1,49 @@ +from cupy.linalg import * # noqa: F403 +# cupy.linalg doesn't have __all__. If it is added, replace this with +# +# from cupy.linalg import __all__ as linalg_all +_n = {} +exec('from cupy.linalg import *', _n) +del _n['__builtins__'] +linalg_all = list(_n) +del _n + +from ..common import _linalg +from .._internal import get_xp + +import cupy as cp + +# These functions are in both the main and linalg namespaces +from ._aliases import matmul, matrix_transpose, tensordot, vecdot # noqa: F401 + +cross = get_xp(cp)(_linalg.cross) +outer = get_xp(cp)(_linalg.outer) +EighResult = _linalg.EighResult +QRResult = _linalg.QRResult +SlogdetResult = _linalg.SlogdetResult +SVDResult = _linalg.SVDResult +eigh = get_xp(cp)(_linalg.eigh) +qr = get_xp(cp)(_linalg.qr) +slogdet = get_xp(cp)(_linalg.slogdet) +svd = get_xp(cp)(_linalg.svd) +cholesky = get_xp(cp)(_linalg.cholesky) +matrix_rank = get_xp(cp)(_linalg.matrix_rank) +pinv = get_xp(cp)(_linalg.pinv) +matrix_norm = get_xp(cp)(_linalg.matrix_norm) +svdvals = get_xp(cp)(_linalg.svdvals) +diagonal = get_xp(cp)(_linalg.diagonal) +trace = get_xp(cp)(_linalg.trace) + +# These functions are completely new here. If the library already has them +# (i.e., numpy 2.0), use the library version instead of our wrapper. +if hasattr(cp.linalg, 'vector_norm'): + vector_norm = cp.linalg.vector_norm +else: + vector_norm = get_xp(cp)(_linalg.vector_norm) + +__all__ = linalg_all + _linalg.__all__ + +del get_xp +del cp +del linalg_all +del _linalg diff --git a/shared/package-files/9c/9ca544e2f2b89680e3b108026e73c5ecbb01281646105d7cc81dc14741aa4ecb/blob b/shared/package-files/9c/9ca544e2f2b89680e3b108026e73c5ecbb01281646105d7cc81dc14741aa4ecb/blob new file mode 100644 index 0000000000000000000000000000000000000000..9449e4469022080ee41ae3609f93691db0c114e1 --- /dev/null +++ b/shared/package-files/9c/9ca544e2f2b89680e3b108026e73c5ecbb01281646105d7cc81dc14741aa4ecb/blob @@ -0,0 +1,105 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API linspace { + using schema = at::Tensor (const at::Scalar &, const at::Scalar &, int64_t, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linspace") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linspace(Scalar start, Scalar end, int steps, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor") + static at::Tensor call(const at::Scalar & start, const at::Scalar & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & start, const at::Scalar & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +struct TORCH_API linspace_Tensor_Tensor { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, int64_t, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linspace") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor_Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linspace.Tensor_Tensor(Tensor start, Tensor end, int steps, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor") + static at::Tensor call(const at::Tensor & start, const at::Tensor & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & start, const at::Tensor & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +struct TORCH_API linspace_Tensor_Scalar { + using schema = at::Tensor (const at::Tensor &, const at::Scalar &, int64_t, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linspace") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor_Scalar") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linspace.Tensor_Scalar(Tensor start, Scalar end, int steps, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor") + static at::Tensor call(const at::Tensor & start, const at::Scalar & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & start, const at::Scalar & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +struct TORCH_API linspace_Scalar_Tensor { + using schema = at::Tensor (const at::Scalar &, const at::Tensor &, int64_t, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linspace") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar_Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linspace.Scalar_Tensor(Scalar start, Tensor end, int steps, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor") + static at::Tensor call(const at::Scalar & start, const at::Tensor & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & start, const at::Tensor & end, int64_t steps, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +struct TORCH_API linspace_out { + using schema = at::Tensor & (const at::Scalar &, const at::Scalar &, int64_t, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linspace") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linspace.out(Scalar start, Scalar end, int steps, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Scalar & start, const at::Scalar & end, int64_t steps, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & start, const at::Scalar & end, int64_t steps, at::Tensor & out); +}; + +struct TORCH_API linspace_Tensor_Tensor_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, int64_t, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linspace") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor_Tensor_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linspace.Tensor_Tensor_out(Tensor start, Tensor end, int steps, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & start, const at::Tensor & end, int64_t steps, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & start, const at::Tensor & end, int64_t steps, at::Tensor & out); +}; + +struct TORCH_API linspace_Tensor_Scalar_out { + using schema = at::Tensor & (const at::Tensor &, const at::Scalar &, int64_t, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linspace") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor_Scalar_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linspace.Tensor_Scalar_out(Tensor start, Scalar end, int steps, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & start, const at::Scalar & end, int64_t steps, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & start, const at::Scalar & end, int64_t steps, at::Tensor & out); +}; + +struct TORCH_API linspace_Scalar_Tensor_out { + using schema = at::Tensor & (const at::Scalar &, const at::Tensor &, int64_t, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::linspace") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar_Tensor_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "linspace.Scalar_Tensor_out(Scalar start, Tensor end, int steps, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Scalar & start, const at::Tensor & end, int64_t steps, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Scalar & start, const at::Tensor & end, int64_t steps, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9c/9cafe29b50db74818c320c4581ea353277458da07e42591cd996254aab8b8ecd/blob b/shared/package-files/9c/9cafe29b50db74818c320c4581ea353277458da07e42591cd996254aab8b8ecd/blob new file mode 100644 index 0000000000000000000000000000000000000000..49727d36e57b7743536a6b1e7f40efd06d4c4d47 --- /dev/null +++ b/shared/package-files/9c/9cafe29b50db74818c320c4581ea353277458da07e42591cd996254aab8b8ecd/blob @@ -0,0 +1,1077 @@ +# +# DEPRECATED: implementation for ffi.verify() +# +import sys +from . import model +from .error import VerificationError +from . import _imp_emulation as imp + + +class VCPythonEngine(object): + _class_key = 'x' + _gen_python_module = True + + def __init__(self, verifier): + self.verifier = verifier + self.ffi = verifier.ffi + self._struct_pending_verification = {} + self._types_of_builtin_functions = {} + + def patch_extension_kwds(self, kwds): + pass + + def find_module(self, module_name, path, so_suffixes): + try: + f, filename, descr = imp.find_module(module_name, path) + except ImportError: + return None + if f is not None: + f.close() + # Note that after a setuptools installation, there are both .py + # and .so files with the same basename. The code here relies on + # imp.find_module() locating the .so in priority. + if descr[0] not in so_suffixes: + return None + return filename + + def collect_types(self): + self._typesdict = {} + self._generate("collecttype") + + def _prnt(self, what=''): + self._f.write(what + '\n') + + def _gettypenum(self, type): + # a KeyError here is a bug. please report it! :-) + return self._typesdict[type] + + def _do_collect_type(self, tp): + if ((not isinstance(tp, model.PrimitiveType) + or tp.name == 'long double') + and tp not in self._typesdict): + num = len(self._typesdict) + self._typesdict[tp] = num + + def write_source_to_f(self): + self.collect_types() + # + # The new module will have a _cffi_setup() function that receives + # objects from the ffi world, and that calls some setup code in + # the module. This setup code is split in several independent + # functions, e.g. one per constant. The functions are "chained" + # by ending in a tail call to each other. + # + # This is further split in two chained lists, depending on if we + # can do it at import-time or if we must wait for _cffi_setup() to + # provide us with the objects. This is needed because we + # need the values of the enum constants in order to build the + # that we may have to pass to _cffi_setup(). + # + # The following two 'chained_list_constants' items contains + # the head of these two chained lists, as a string that gives the + # call to do, if any. + self._chained_list_constants = ['((void)lib,0)', '((void)lib,0)'] + # + prnt = self._prnt + # first paste some standard set of lines that are mostly '#define' + prnt(cffimod_header) + prnt() + # then paste the C source given by the user, verbatim. + prnt(self.verifier.preamble) + prnt() + # + # call generate_cpy_xxx_decl(), for every xxx found from + # ffi._parser._declarations. This generates all the functions. + self._generate("decl") + # + # implement the function _cffi_setup_custom() as calling the + # head of the chained list. + self._generate_setup_custom() + prnt() + # + # produce the method table, including the entries for the + # generated Python->C function wrappers, which are done + # by generate_cpy_function_method(). + prnt('static PyMethodDef _cffi_methods[] = {') + self._generate("method") + prnt(' {"_cffi_setup", _cffi_setup, METH_VARARGS, NULL},') + prnt(' {NULL, NULL, 0, NULL} /* Sentinel */') + prnt('};') + prnt() + # + # standard init. + modname = self.verifier.get_module_name() + constants = self._chained_list_constants[False] + prnt('#if PY_MAJOR_VERSION >= 3') + prnt() + prnt('static struct PyModuleDef _cffi_module_def = {') + prnt(' PyModuleDef_HEAD_INIT,') + prnt(' "%s",' % modname) + prnt(' NULL,') + prnt(' -1,') + prnt(' _cffi_methods,') + prnt(' NULL, NULL, NULL, NULL') + prnt('};') + prnt() + prnt('PyMODINIT_FUNC') + prnt('PyInit_%s(void)' % modname) + prnt('{') + prnt(' PyObject *lib;') + prnt(' lib = PyModule_Create(&_cffi_module_def);') + prnt(' if (lib == NULL)') + prnt(' return NULL;') + prnt(' if (%s < 0 || _cffi_init() < 0) {' % (constants,)) + prnt(' Py_DECREF(lib);') + prnt(' return NULL;') + prnt(' }') + prnt(' return lib;') + prnt('}') + prnt() + prnt('#else') + prnt() + prnt('PyMODINIT_FUNC') + prnt('init%s(void)' % modname) + prnt('{') + prnt(' PyObject *lib;') + prnt(' lib = Py_InitModule("%s", _cffi_methods);' % modname) + prnt(' if (lib == NULL)') + prnt(' return;') + prnt(' if (%s < 0 || _cffi_init() < 0)' % (constants,)) + prnt(' return;') + prnt(' return;') + prnt('}') + prnt() + prnt('#endif') + + def load_library(self, flags=None): + # XXX review all usages of 'self' here! + # import it as a new extension module + imp.acquire_lock() + try: + if hasattr(sys, "getdlopenflags"): + previous_flags = sys.getdlopenflags() + try: + if hasattr(sys, "setdlopenflags") and flags is not None: + sys.setdlopenflags(flags) + module = imp.load_dynamic(self.verifier.get_module_name(), + self.verifier.modulefilename) + except ImportError as e: + error = "importing %r: %s" % (self.verifier.modulefilename, e) + raise VerificationError(error) + finally: + if hasattr(sys, "setdlopenflags"): + sys.setdlopenflags(previous_flags) + finally: + imp.release_lock() + # + # call loading_cpy_struct() to get the struct layout inferred by + # the C compiler + self._load(module, 'loading') + # + # the C code will need the objects. Collect them in + # order in a list. + revmapping = dict([(value, key) + for (key, value) in self._typesdict.items()]) + lst = [revmapping[i] for i in range(len(revmapping))] + lst = list(map(self.ffi._get_cached_btype, lst)) + # + # build the FFILibrary class and instance and call _cffi_setup(). + # this will set up some fields like '_cffi_types', and only then + # it will invoke the chained list of functions that will really + # build (notably) the constant objects, as if they are + # pointers, and store them as attributes on the 'library' object. + class FFILibrary(object): + _cffi_python_module = module + _cffi_ffi = self.ffi + _cffi_dir = [] + def __dir__(self): + return FFILibrary._cffi_dir + list(self.__dict__) + library = FFILibrary() + if module._cffi_setup(lst, VerificationError, library): + import warnings + warnings.warn("reimporting %r might overwrite older definitions" + % (self.verifier.get_module_name())) + # + # finally, call the loaded_cpy_xxx() functions. This will perform + # the final adjustments, like copying the Python->C wrapper + # functions from the module to the 'library' object, and setting + # up the FFILibrary class with properties for the global C variables. + self._load(module, 'loaded', library=library) + module._cffi_original_ffi = self.ffi + module._cffi_types_of_builtin_funcs = self._types_of_builtin_functions + return library + + def _get_declarations(self): + lst = [(key, tp) for (key, (tp, qual)) in + self.ffi._parser._declarations.items()] + lst.sort() + return lst + + def _generate(self, step_name): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + try: + method = getattr(self, '_generate_cpy_%s_%s' % (kind, + step_name)) + except AttributeError: + raise VerificationError( + "not implemented in verify(): %r" % name) + try: + method(tp, realname) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _load(self, module, step_name, **kwds): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + method = getattr(self, '_%s_cpy_%s' % (step_name, kind)) + try: + method(tp, realname, module, **kwds) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _generate_nothing(self, tp, name): + pass + + def _loaded_noop(self, tp, name, module, **kwds): + pass + + # ---------- + + def _convert_funcarg_to_c(self, tp, fromvar, tovar, errcode): + extraarg = '' + if isinstance(tp, model.PrimitiveType): + if tp.is_integer_type() and tp.name != '_Bool': + converter = '_cffi_to_c_int' + extraarg = ', %s' % tp.name + else: + converter = '(%s)_cffi_to_c_%s' % (tp.get_c_name(''), + tp.name.replace(' ', '_')) + errvalue = '-1' + # + elif isinstance(tp, model.PointerType): + self._convert_funcarg_to_c_ptr_or_array(tp, fromvar, + tovar, errcode) + return + # + elif isinstance(tp, (model.StructOrUnion, model.EnumType)): + # a struct (not a struct pointer) as a function argument + self._prnt(' if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)' + % (tovar, self._gettypenum(tp), fromvar)) + self._prnt(' %s;' % errcode) + return + # + elif isinstance(tp, model.FunctionPtrType): + converter = '(%s)_cffi_to_c_pointer' % tp.get_c_name('') + extraarg = ', _cffi_type(%d)' % self._gettypenum(tp) + errvalue = 'NULL' + # + else: + raise NotImplementedError(tp) + # + self._prnt(' %s = %s(%s%s);' % (tovar, converter, fromvar, extraarg)) + self._prnt(' if (%s == (%s)%s && PyErr_Occurred())' % ( + tovar, tp.get_c_name(''), errvalue)) + self._prnt(' %s;' % errcode) + + def _extra_local_variables(self, tp, localvars, freelines): + if isinstance(tp, model.PointerType): + localvars.add('Py_ssize_t datasize') + localvars.add('struct _cffi_freeme_s *large_args_free = NULL') + freelines.add('if (large_args_free != NULL)' + ' _cffi_free_array_arguments(large_args_free);') + + def _convert_funcarg_to_c_ptr_or_array(self, tp, fromvar, tovar, errcode): + self._prnt(' datasize = _cffi_prepare_pointer_call_argument(') + self._prnt(' _cffi_type(%d), %s, (char **)&%s);' % ( + self._gettypenum(tp), fromvar, tovar)) + self._prnt(' if (datasize != 0) {') + self._prnt(' %s = ((size_t)datasize) <= 640 ? ' + 'alloca((size_t)datasize) : NULL;' % (tovar,)) + self._prnt(' if (_cffi_convert_array_argument(_cffi_type(%d), %s, ' + '(char **)&%s,' % (self._gettypenum(tp), fromvar, tovar)) + self._prnt(' datasize, &large_args_free) < 0)') + self._prnt(' %s;' % errcode) + self._prnt(' }') + + def _convert_expr_from_c(self, tp, var, context): + if isinstance(tp, model.PrimitiveType): + if tp.is_integer_type() and tp.name != '_Bool': + return '_cffi_from_c_int(%s, %s)' % (var, tp.name) + elif tp.name != 'long double': + return '_cffi_from_c_%s(%s)' % (tp.name.replace(' ', '_'), var) + else: + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, (model.PointerType, model.FunctionPtrType)): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.ArrayType): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(model.PointerType(tp.item))) + elif isinstance(tp, model.StructOrUnion): + if tp.fldnames is None: + raise TypeError("'%s' is used as %s, but is opaque" % ( + tp._get_c_name(), context)) + return '_cffi_from_c_struct((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.EnumType): + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + else: + raise NotImplementedError(tp) + + # ---------- + # typedefs: generates no code so far + + _generate_cpy_typedef_collecttype = _generate_nothing + _generate_cpy_typedef_decl = _generate_nothing + _generate_cpy_typedef_method = _generate_nothing + _loading_cpy_typedef = _loaded_noop + _loaded_cpy_typedef = _loaded_noop + + # ---------- + # function declarations + + def _generate_cpy_function_collecttype(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + self._do_collect_type(tp) + else: + # don't call _do_collect_type(tp) in this common case, + # otherwise test_autofilled_struct_as_argument fails + for type in tp.args: + self._do_collect_type(type) + self._do_collect_type(tp.result) + + def _generate_cpy_function_decl(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + # cannot support vararg functions better than this: check for its + # exact type (including the fixed arguments), and build it as a + # constant function pointer (no CPython wrapper) + self._generate_cpy_const(False, name, tp) + return + prnt = self._prnt + numargs = len(tp.args) + if numargs == 0: + argname = 'noarg' + elif numargs == 1: + argname = 'arg0' + else: + argname = 'args' + prnt('static PyObject *') + prnt('_cffi_f_%s(PyObject *self, PyObject *%s)' % (name, argname)) + prnt('{') + # + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + prnt(' %s;' % type.get_c_name(' x%d' % i, context)) + # + localvars = set() + freelines = set() + for type in tp.args: + self._extra_local_variables(type, localvars, freelines) + for decl in sorted(localvars): + prnt(' %s;' % (decl,)) + # + if not isinstance(tp.result, model.VoidType): + result_code = 'result = ' + context = 'result of %s' % name + prnt(' %s;' % tp.result.get_c_name(' result', context)) + prnt(' PyObject *pyresult;') + else: + result_code = '' + # + if len(tp.args) > 1: + rng = range(len(tp.args)) + for i in rng: + prnt(' PyObject *arg%d;' % i) + prnt() + prnt(' if (!PyArg_ParseTuple(args, "%s:%s", %s))' % ( + 'O' * numargs, name, ', '.join(['&arg%d' % i for i in rng]))) + prnt(' return NULL;') + prnt() + # + for i, type in enumerate(tp.args): + self._convert_funcarg_to_c(type, 'arg%d' % i, 'x%d' % i, + 'return NULL') + prnt() + # + prnt(' Py_BEGIN_ALLOW_THREADS') + prnt(' _cffi_restore_errno();') + prnt(' { %s%s(%s); }' % ( + result_code, name, + ', '.join(['x%d' % i for i in range(len(tp.args))]))) + prnt(' _cffi_save_errno();') + prnt(' Py_END_ALLOW_THREADS') + prnt() + # + prnt(' (void)self; /* unused */') + if numargs == 0: + prnt(' (void)noarg; /* unused */') + if result_code: + prnt(' pyresult = %s;' % + self._convert_expr_from_c(tp.result, 'result', 'result type')) + for freeline in freelines: + prnt(' ' + freeline) + prnt(' return pyresult;') + else: + for freeline in freelines: + prnt(' ' + freeline) + prnt(' Py_INCREF(Py_None);') + prnt(' return Py_None;') + prnt('}') + prnt() + + def _generate_cpy_function_method(self, tp, name): + if tp.ellipsis: + return + numargs = len(tp.args) + if numargs == 0: + meth = 'METH_NOARGS' + elif numargs == 1: + meth = 'METH_O' + else: + meth = 'METH_VARARGS' + self._prnt(' {"%s", _cffi_f_%s, %s, NULL},' % (name, name, meth)) + + _loading_cpy_function = _loaded_noop + + def _loaded_cpy_function(self, tp, name, module, library): + if tp.ellipsis: + return + func = getattr(module, name) + setattr(library, name, func) + self._types_of_builtin_functions[func] = tp + + # ---------- + # named structs + + _generate_cpy_struct_collecttype = _generate_nothing + def _generate_cpy_struct_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'struct', name) + def _generate_cpy_struct_method(self, tp, name): + self._generate_struct_or_union_method(tp, 'struct', name) + def _loading_cpy_struct(self, tp, name, module): + self._loading_struct_or_union(tp, 'struct', name, module) + def _loaded_cpy_struct(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + _generate_cpy_union_collecttype = _generate_nothing + def _generate_cpy_union_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'union', name) + def _generate_cpy_union_method(self, tp, name): + self._generate_struct_or_union_method(tp, 'union', name) + def _loading_cpy_union(self, tp, name, module): + self._loading_struct_or_union(tp, 'union', name, module) + def _loaded_cpy_union(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + def _generate_struct_or_union_decl(self, tp, prefix, name): + if tp.fldnames is None: + return # nothing to do with opaque structs + checkfuncname = '_cffi_check_%s_%s' % (prefix, name) + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + cname = ('%s %s' % (prefix, name)).strip() + # + prnt = self._prnt + prnt('static void %s(%s *p)' % (checkfuncname, cname)) + prnt('{') + prnt(' /* only to generate compile-time warnings or errors */') + prnt(' (void)p;') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if (isinstance(ftype, model.PrimitiveType) + and ftype.is_integer_type()) or fbitsize >= 0: + # accept all integers, but complain on float or double + prnt(' (void)((p->%s) << 1);' % fname) + else: + # only accept exactly the type declared. + try: + prnt(' { %s = &p->%s; (void)tmp; }' % ( + ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual), + fname)) + except VerificationError as e: + prnt(' /* %s */' % str(e)) # cannot verify it, ignore + prnt('}') + prnt('static PyObject *') + prnt('%s(PyObject *self, PyObject *noarg)' % (layoutfuncname,)) + prnt('{') + prnt(' struct _cffi_aligncheck { char x; %s y; };' % cname) + prnt(' static Py_ssize_t nums[] = {') + prnt(' sizeof(%s),' % cname) + prnt(' offsetof(struct _cffi_aligncheck, y),') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + prnt(' offsetof(%s, %s),' % (cname, fname)) + if isinstance(ftype, model.ArrayType) and ftype.length is None: + prnt(' 0, /* %s */' % ftype._get_c_name()) + else: + prnt(' sizeof(((%s *)0)->%s),' % (cname, fname)) + prnt(' -1') + prnt(' };') + prnt(' (void)self; /* unused */') + prnt(' (void)noarg; /* unused */') + prnt(' return _cffi_get_struct_layout(nums);') + prnt(' /* the next line is not executed, but compiled */') + prnt(' %s(0);' % (checkfuncname,)) + prnt('}') + prnt() + + def _generate_struct_or_union_method(self, tp, prefix, name): + if tp.fldnames is None: + return # nothing to do with opaque structs + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + self._prnt(' {"%s", %s, METH_NOARGS, NULL},' % (layoutfuncname, + layoutfuncname)) + + def _loading_struct_or_union(self, tp, prefix, name, module): + if tp.fldnames is None: + return # nothing to do with opaque structs + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + # + function = getattr(module, layoutfuncname) + layout = function() + if isinstance(tp, model.StructOrUnion) and tp.partial: + # use the function()'s sizes and offsets to guide the + # layout of the struct + totalsize = layout[0] + totalalignment = layout[1] + fieldofs = layout[2::2] + fieldsize = layout[3::2] + tp.force_flatten() + assert len(fieldofs) == len(fieldsize) == len(tp.fldnames) + tp.fixedlayout = fieldofs, fieldsize, totalsize, totalalignment + else: + cname = ('%s %s' % (prefix, name)).strip() + self._struct_pending_verification[tp] = layout, cname + + def _loaded_struct_or_union(self, tp): + if tp.fldnames is None: + return # nothing to do with opaque structs + self.ffi._get_cached_btype(tp) # force 'fixedlayout' to be considered + + if tp in self._struct_pending_verification: + # check that the layout sizes and offsets match the real ones + def check(realvalue, expectedvalue, msg): + if realvalue != expectedvalue: + raise VerificationError( + "%s (we have %d, but C compiler says %d)" + % (msg, expectedvalue, realvalue)) + ffi = self.ffi + BStruct = ffi._get_cached_btype(tp) + layout, cname = self._struct_pending_verification.pop(tp) + check(layout[0], ffi.sizeof(BStruct), "wrong total size") + check(layout[1], ffi.alignof(BStruct), "wrong total alignment") + i = 2 + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + check(layout[i], ffi.offsetof(BStruct, fname), + "wrong offset for field %r" % (fname,)) + if layout[i+1] != 0: + BField = ffi._get_cached_btype(ftype) + check(layout[i+1], ffi.sizeof(BField), + "wrong size for field %r" % (fname,)) + i += 2 + assert i == len(layout) + + # ---------- + # 'anonymous' declarations. These are produced for anonymous structs + # or unions; the 'name' is obtained by a typedef. + + _generate_cpy_anonymous_collecttype = _generate_nothing + + def _generate_cpy_anonymous_decl(self, tp, name): + if isinstance(tp, model.EnumType): + self._generate_cpy_enum_decl(tp, name, '') + else: + self._generate_struct_or_union_decl(tp, '', name) + + def _generate_cpy_anonymous_method(self, tp, name): + if not isinstance(tp, model.EnumType): + self._generate_struct_or_union_method(tp, '', name) + + def _loading_cpy_anonymous(self, tp, name, module): + if isinstance(tp, model.EnumType): + self._loading_cpy_enum(tp, name, module) + else: + self._loading_struct_or_union(tp, '', name, module) + + def _loaded_cpy_anonymous(self, tp, name, module, **kwds): + if isinstance(tp, model.EnumType): + self._loaded_cpy_enum(tp, name, module, **kwds) + else: + self._loaded_struct_or_union(tp) + + # ---------- + # constants, likely declared with '#define' + + def _generate_cpy_const(self, is_int, name, tp=None, category='const', + vartp=None, delayed=True, size_too=False, + check_value=None): + prnt = self._prnt + funcname = '_cffi_%s_%s' % (category, name) + prnt('static int %s(PyObject *lib)' % funcname) + prnt('{') + prnt(' PyObject *o;') + prnt(' int res;') + if not is_int: + prnt(' %s;' % (vartp or tp).get_c_name(' i', name)) + else: + assert category == 'const' + # + if check_value is not None: + self._check_int_constant_value(name, check_value) + # + if not is_int: + if category == 'var': + realexpr = '&' + name + else: + realexpr = name + prnt(' i = (%s);' % (realexpr,)) + prnt(' o = %s;' % (self._convert_expr_from_c(tp, 'i', + 'variable type'),)) + assert delayed + else: + prnt(' o = _cffi_from_c_int_const(%s);' % name) + prnt(' if (o == NULL)') + prnt(' return -1;') + if size_too: + prnt(' {') + prnt(' PyObject *o1 = o;') + prnt(' o = Py_BuildValue("On", o1, (Py_ssize_t)sizeof(%s));' + % (name,)) + prnt(' Py_DECREF(o1);') + prnt(' if (o == NULL)') + prnt(' return -1;') + prnt(' }') + prnt(' res = PyObject_SetAttrString(lib, "%s", o);' % name) + prnt(' Py_DECREF(o);') + prnt(' if (res < 0)') + prnt(' return -1;') + prnt(' return %s;' % self._chained_list_constants[delayed]) + self._chained_list_constants[delayed] = funcname + '(lib)' + prnt('}') + prnt() + + def _generate_cpy_constant_collecttype(self, tp, name): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + if not is_int: + self._do_collect_type(tp) + + def _generate_cpy_constant_decl(self, tp, name): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + self._generate_cpy_const(is_int, name, tp) + + _generate_cpy_constant_method = _generate_nothing + _loading_cpy_constant = _loaded_noop + _loaded_cpy_constant = _loaded_noop + + # ---------- + # enums + + def _check_int_constant_value(self, name, value, err_prefix=''): + prnt = self._prnt + if value <= 0: + prnt(' if ((%s) > 0 || (long)(%s) != %dL) {' % ( + name, name, value)) + else: + prnt(' if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {' % ( + name, name, value)) + prnt(' char buf[64];') + prnt(' if ((%s) <= 0)' % name) + prnt(' snprintf(buf, 63, "%%ld", (long)(%s));' % name) + prnt(' else') + prnt(' snprintf(buf, 63, "%%lu", (unsigned long)(%s));' % + name) + prnt(' PyErr_Format(_cffi_VerificationError,') + prnt(' "%s%s has the real value %s, not %s",') + prnt(' "%s", "%s", buf, "%d");' % ( + err_prefix, name, value)) + prnt(' return -1;') + prnt(' }') + + def _enum_funcname(self, prefix, name): + # "$enum_$1" => "___D_enum____D_1" + name = name.replace('$', '___D_') + return '_cffi_e_%s_%s' % (prefix, name) + + def _generate_cpy_enum_decl(self, tp, name, prefix='enum'): + if tp.partial: + for enumerator in tp.enumerators: + self._generate_cpy_const(True, enumerator, delayed=False) + return + # + funcname = self._enum_funcname(prefix, name) + prnt = self._prnt + prnt('static int %s(PyObject *lib)' % funcname) + prnt('{') + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + self._check_int_constant_value(enumerator, enumvalue, + "enum %s: " % name) + prnt(' return %s;' % self._chained_list_constants[True]) + self._chained_list_constants[True] = funcname + '(lib)' + prnt('}') + prnt() + + _generate_cpy_enum_collecttype = _generate_nothing + _generate_cpy_enum_method = _generate_nothing + + def _loading_cpy_enum(self, tp, name, module): + if tp.partial: + enumvalues = [getattr(module, enumerator) + for enumerator in tp.enumerators] + tp.enumvalues = tuple(enumvalues) + tp.partial_resolved = True + + def _loaded_cpy_enum(self, tp, name, module, library): + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + setattr(library, enumerator, enumvalue) + + # ---------- + # macros: for now only for integers + + def _generate_cpy_macro_decl(self, tp, name): + if tp == '...': + check_value = None + else: + check_value = tp # an integer + self._generate_cpy_const(True, name, check_value=check_value) + + _generate_cpy_macro_collecttype = _generate_nothing + _generate_cpy_macro_method = _generate_nothing + _loading_cpy_macro = _loaded_noop + _loaded_cpy_macro = _loaded_noop + + # ---------- + # global variables + + def _generate_cpy_variable_collecttype(self, tp, name): + if isinstance(tp, model.ArrayType): + tp_ptr = model.PointerType(tp.item) + else: + tp_ptr = model.PointerType(tp) + self._do_collect_type(tp_ptr) + + def _generate_cpy_variable_decl(self, tp, name): + if isinstance(tp, model.ArrayType): + tp_ptr = model.PointerType(tp.item) + self._generate_cpy_const(False, name, tp, vartp=tp_ptr, + size_too = tp.length_is_unknown()) + else: + tp_ptr = model.PointerType(tp) + self._generate_cpy_const(False, name, tp_ptr, category='var') + + _generate_cpy_variable_method = _generate_nothing + _loading_cpy_variable = _loaded_noop + + def _loaded_cpy_variable(self, tp, name, module, library): + value = getattr(library, name) + if isinstance(tp, model.ArrayType): # int a[5] is "constant" in the + # sense that "a=..." is forbidden + if tp.length_is_unknown(): + assert isinstance(value, tuple) + (value, size) = value + BItemType = self.ffi._get_cached_btype(tp.item) + length, rest = divmod(size, self.ffi.sizeof(BItemType)) + if rest != 0: + raise VerificationError( + "bad size: %r does not seem to be an array of %s" % + (name, tp.item)) + tp = tp.resolve_length(length) + # 'value' is a which we have to replace with + # a if the N is actually known + if tp.length is not None: + BArray = self.ffi._get_cached_btype(tp) + value = self.ffi.cast(BArray, value) + setattr(library, name, value) + return + # remove ptr= from the library instance, and replace + # it by a property on the class, which reads/writes into ptr[0]. + ptr = value + delattr(library, name) + def getter(library): + return ptr[0] + def setter(library, value): + ptr[0] = value + setattr(type(library), name, property(getter, setter)) + type(library)._cffi_dir.append(name) + + # ---------- + + def _generate_setup_custom(self): + prnt = self._prnt + prnt('static int _cffi_setup_custom(PyObject *lib)') + prnt('{') + prnt(' return %s;' % self._chained_list_constants[True]) + prnt('}') + +cffimod_header = r''' +#include +#include + +/* this block of #ifs should be kept exactly identical between + c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py + and cffi/_cffi_include.h */ +#if defined(_MSC_VER) +# include /* for alloca() */ +# if _MSC_VER < 1600 /* MSVC < 2010 */ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + typedef __int8 int_least8_t; + typedef __int16 int_least16_t; + typedef __int32 int_least32_t; + typedef __int64 int_least64_t; + typedef unsigned __int8 uint_least8_t; + typedef unsigned __int16 uint_least16_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int64 uint_least64_t; + typedef __int8 int_fast8_t; + typedef __int16 int_fast16_t; + typedef __int32 int_fast32_t; + typedef __int64 int_fast64_t; + typedef unsigned __int8 uint_fast8_t; + typedef unsigned __int16 uint_fast16_t; + typedef unsigned __int32 uint_fast32_t; + typedef unsigned __int64 uint_fast64_t; + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; +# else +# include +# endif +# if _MSC_VER < 1800 /* MSVC < 2013 */ +# ifndef __cplusplus + typedef unsigned char _Bool; +# endif +# endif +#else +# include +# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) +# include +# endif +#endif + +#if PY_MAJOR_VERSION < 3 +# undef PyCapsule_CheckExact +# undef PyCapsule_GetPointer +# define PyCapsule_CheckExact(capsule) (PyCObject_Check(capsule)) +# define PyCapsule_GetPointer(capsule, name) \ + (PyCObject_AsVoidPtr(capsule)) +#endif + +#if PY_MAJOR_VERSION >= 3 +# define PyInt_FromLong PyLong_FromLong +#endif + +#define _cffi_from_c_double PyFloat_FromDouble +#define _cffi_from_c_float PyFloat_FromDouble +#define _cffi_from_c_long PyInt_FromLong +#define _cffi_from_c_ulong PyLong_FromUnsignedLong +#define _cffi_from_c_longlong PyLong_FromLongLong +#define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong +#define _cffi_from_c__Bool PyBool_FromLong + +#define _cffi_to_c_double PyFloat_AsDouble +#define _cffi_to_c_float PyFloat_AsDouble + +#define _cffi_from_c_int_const(x) \ + (((x) > 0) ? \ + ((unsigned long long)(x) <= (unsigned long long)LONG_MAX) ? \ + PyInt_FromLong((long)(x)) : \ + PyLong_FromUnsignedLongLong((unsigned long long)(x)) : \ + ((long long)(x) >= (long long)LONG_MIN) ? \ + PyInt_FromLong((long)(x)) : \ + PyLong_FromLongLong((long long)(x))) + +#define _cffi_from_c_int(x, type) \ + (((type)-1) > 0 ? /* unsigned */ \ + (sizeof(type) < sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + sizeof(type) == sizeof(long) ? \ + PyLong_FromUnsignedLong((unsigned long)x) : \ + PyLong_FromUnsignedLongLong((unsigned long long)x)) : \ + (sizeof(type) <= sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + PyLong_FromLongLong((long long)x))) + +#define _cffi_to_c_int(o, type) \ + ((type)( \ + sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ + : (type)_cffi_to_c_i8(o)) : \ + sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \ + : (type)_cffi_to_c_i16(o)) : \ + sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \ + : (type)_cffi_to_c_i32(o)) : \ + sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \ + : (type)_cffi_to_c_i64(o)) : \ + (Py_FatalError("unsupported size for type " #type), (type)0))) + +#define _cffi_to_c_i8 \ + ((int(*)(PyObject *))_cffi_exports[1]) +#define _cffi_to_c_u8 \ + ((int(*)(PyObject *))_cffi_exports[2]) +#define _cffi_to_c_i16 \ + ((int(*)(PyObject *))_cffi_exports[3]) +#define _cffi_to_c_u16 \ + ((int(*)(PyObject *))_cffi_exports[4]) +#define _cffi_to_c_i32 \ + ((int(*)(PyObject *))_cffi_exports[5]) +#define _cffi_to_c_u32 \ + ((unsigned int(*)(PyObject *))_cffi_exports[6]) +#define _cffi_to_c_i64 \ + ((long long(*)(PyObject *))_cffi_exports[7]) +#define _cffi_to_c_u64 \ + ((unsigned long long(*)(PyObject *))_cffi_exports[8]) +#define _cffi_to_c_char \ + ((int(*)(PyObject *))_cffi_exports[9]) +#define _cffi_from_c_pointer \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[10]) +#define _cffi_to_c_pointer \ + ((char *(*)(PyObject *, CTypeDescrObject *))_cffi_exports[11]) +#define _cffi_get_struct_layout \ + ((PyObject *(*)(Py_ssize_t[]))_cffi_exports[12]) +#define _cffi_restore_errno \ + ((void(*)(void))_cffi_exports[13]) +#define _cffi_save_errno \ + ((void(*)(void))_cffi_exports[14]) +#define _cffi_from_c_char \ + ((PyObject *(*)(char))_cffi_exports[15]) +#define _cffi_from_c_deref \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[16]) +#define _cffi_to_c \ + ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[17]) +#define _cffi_from_c_struct \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[18]) +#define _cffi_to_c_wchar_t \ + ((wchar_t(*)(PyObject *))_cffi_exports[19]) +#define _cffi_from_c_wchar_t \ + ((PyObject *(*)(wchar_t))_cffi_exports[20]) +#define _cffi_to_c_long_double \ + ((long double(*)(PyObject *))_cffi_exports[21]) +#define _cffi_to_c__Bool \ + ((_Bool(*)(PyObject *))_cffi_exports[22]) +#define _cffi_prepare_pointer_call_argument \ + ((Py_ssize_t(*)(CTypeDescrObject *, PyObject *, char **))_cffi_exports[23]) +#define _cffi_convert_array_from_object \ + ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[24]) +#define _CFFI_NUM_EXPORTS 25 + +typedef struct _ctypedescr CTypeDescrObject; + +static void *_cffi_exports[_CFFI_NUM_EXPORTS]; +static PyObject *_cffi_types, *_cffi_VerificationError; + +static int _cffi_setup_custom(PyObject *lib); /* forward */ + +static PyObject *_cffi_setup(PyObject *self, PyObject *args) +{ + PyObject *library; + int was_alive = (_cffi_types != NULL); + (void)self; /* unused */ + if (!PyArg_ParseTuple(args, "OOO", &_cffi_types, &_cffi_VerificationError, + &library)) + return NULL; + Py_INCREF(_cffi_types); + Py_INCREF(_cffi_VerificationError); + if (_cffi_setup_custom(library) < 0) + return NULL; + return PyBool_FromLong(was_alive); +} + +union _cffi_union_alignment_u { + unsigned char m_char; + unsigned short m_short; + unsigned int m_int; + unsigned long m_long; + unsigned long long m_longlong; + float m_float; + double m_double; + long double m_longdouble; +}; + +struct _cffi_freeme_s { + struct _cffi_freeme_s *next; + union _cffi_union_alignment_u alignment; +}; + +#ifdef __GNUC__ + __attribute__((unused)) +#endif +static int _cffi_convert_array_argument(CTypeDescrObject *ctptr, PyObject *arg, + char **output_data, Py_ssize_t datasize, + struct _cffi_freeme_s **freeme) +{ + char *p; + if (datasize < 0) + return -1; + + p = *output_data; + if (p == NULL) { + struct _cffi_freeme_s *fp = (struct _cffi_freeme_s *)PyObject_Malloc( + offsetof(struct _cffi_freeme_s, alignment) + (size_t)datasize); + if (fp == NULL) + return -1; + fp->next = *freeme; + *freeme = fp; + p = *output_data = (char *)&fp->alignment; + } + memset((void *)p, 0, (size_t)datasize); + return _cffi_convert_array_from_object(p, ctptr, arg); +} + +#ifdef __GNUC__ + __attribute__((unused)) +#endif +static void _cffi_free_array_arguments(struct _cffi_freeme_s *freeme) +{ + do { + void *p = (void *)freeme; + freeme = freeme->next; + PyObject_Free(p); + } while (freeme != NULL); +} + +static int _cffi_init(void) +{ + PyObject *module, *c_api_object = NULL; + + module = PyImport_ImportModule("_cffi_backend"); + if (module == NULL) + goto failure; + + c_api_object = PyObject_GetAttrString(module, "_C_API"); + if (c_api_object == NULL) + goto failure; + if (!PyCapsule_CheckExact(c_api_object)) { + PyErr_SetNone(PyExc_ImportError); + goto failure; + } + memcpy(_cffi_exports, PyCapsule_GetPointer(c_api_object, "cffi"), + _CFFI_NUM_EXPORTS * sizeof(void *)); + + Py_DECREF(module); + Py_DECREF(c_api_object); + return 0; + + failure: + Py_XDECREF(module); + Py_XDECREF(c_api_object); + return -1; +} + +#define _cffi_type(num) ((CTypeDescrObject *)PyList_GET_ITEM(_cffi_types, num)) + +/**********/ +''' diff --git a/shared/package-files/9c/9cb24eb15304562da0414549a1414a31901ebb67fb19132318cbcd496cb3d017/blob b/shared/package-files/9c/9cb24eb15304562da0414549a1414a31901ebb67fb19132318cbcd496cb3d017/blob new file mode 100644 index 0000000000000000000000000000000000000000..c12beef0b2a4344a4e0daca2540bbfd0c58ce777 --- /dev/null +++ b/shared/package-files/9c/9cb24eb15304562da0414549a1414a31901ebb67fb19132318cbcd496cb3d017/blob @@ -0,0 +1,317 @@ +import contextlib +import functools +import logging +import os +from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, cast + +from pip._vendor.packaging.utils import canonicalize_name +from pip._vendor.resolvelib import BaseReporter, ResolutionImpossible +from pip._vendor.resolvelib import Resolver as RLResolver +from pip._vendor.resolvelib.structs import DirectedGraph + +from pip._internal.cache import WheelCache +from pip._internal.index.package_finder import PackageFinder +from pip._internal.operations.prepare import RequirementPreparer +from pip._internal.req.constructors import install_req_extend_extras +from pip._internal.req.req_install import InstallRequirement +from pip._internal.req.req_set import RequirementSet +from pip._internal.resolution.base import BaseResolver, InstallRequirementProvider +from pip._internal.resolution.resolvelib.provider import PipProvider +from pip._internal.resolution.resolvelib.reporter import ( + PipDebuggingReporter, + PipReporter, +) +from pip._internal.utils.packaging import get_requirement + +from .base import Candidate, Requirement +from .factory import Factory + +if TYPE_CHECKING: + from pip._vendor.resolvelib.resolvers import Result as RLResult + + Result = RLResult[Requirement, Candidate, str] + + +logger = logging.getLogger(__name__) + + +class Resolver(BaseResolver): + _allowed_strategies = {"eager", "only-if-needed", "to-satisfy-only"} + + def __init__( + self, + preparer: RequirementPreparer, + finder: PackageFinder, + wheel_cache: Optional[WheelCache], + make_install_req: InstallRequirementProvider, + use_user_site: bool, + ignore_dependencies: bool, + ignore_installed: bool, + ignore_requires_python: bool, + force_reinstall: bool, + upgrade_strategy: str, + py_version_info: Optional[Tuple[int, ...]] = None, + ): + super().__init__() + assert upgrade_strategy in self._allowed_strategies + + self.factory = Factory( + finder=finder, + preparer=preparer, + make_install_req=make_install_req, + wheel_cache=wheel_cache, + use_user_site=use_user_site, + force_reinstall=force_reinstall, + ignore_installed=ignore_installed, + ignore_requires_python=ignore_requires_python, + py_version_info=py_version_info, + ) + self.ignore_dependencies = ignore_dependencies + self.upgrade_strategy = upgrade_strategy + self._result: Optional[Result] = None + + def resolve( + self, root_reqs: List[InstallRequirement], check_supported_wheels: bool + ) -> RequirementSet: + collected = self.factory.collect_root_requirements(root_reqs) + provider = PipProvider( + factory=self.factory, + constraints=collected.constraints, + ignore_dependencies=self.ignore_dependencies, + upgrade_strategy=self.upgrade_strategy, + user_requested=collected.user_requested, + ) + if "PIP_RESOLVER_DEBUG" in os.environ: + reporter: BaseReporter = PipDebuggingReporter() + else: + reporter = PipReporter() + resolver: RLResolver[Requirement, Candidate, str] = RLResolver( + provider, + reporter, + ) + + try: + limit_how_complex_resolution_can_be = 200000 + result = self._result = resolver.resolve( + collected.requirements, max_rounds=limit_how_complex_resolution_can_be + ) + + except ResolutionImpossible as e: + error = self.factory.get_installation_error( + cast("ResolutionImpossible[Requirement, Candidate]", e), + collected.constraints, + ) + raise error from e + + req_set = RequirementSet(check_supported_wheels=check_supported_wheels) + # process candidates with extras last to ensure their base equivalent is + # already in the req_set if appropriate. + # Python's sort is stable so using a binary key function keeps relative order + # within both subsets. + for candidate in sorted( + result.mapping.values(), key=lambda c: c.name != c.project_name + ): + ireq = candidate.get_install_requirement() + if ireq is None: + if candidate.name != candidate.project_name: + # extend existing req's extras + with contextlib.suppress(KeyError): + req = req_set.get_requirement(candidate.project_name) + req_set.add_named_requirement( + install_req_extend_extras( + req, get_requirement(candidate.name).extras + ) + ) + continue + + # Check if there is already an installation under the same name, + # and set a flag for later stages to uninstall it, if needed. + installed_dist = self.factory.get_dist_to_uninstall(candidate) + if installed_dist is None: + # There is no existing installation -- nothing to uninstall. + ireq.should_reinstall = False + elif self.factory.force_reinstall: + # The --force-reinstall flag is set -- reinstall. + ireq.should_reinstall = True + elif installed_dist.version != candidate.version: + # The installation is different in version -- reinstall. + ireq.should_reinstall = True + elif candidate.is_editable or installed_dist.editable: + # The incoming distribution is editable, or different in + # editable-ness to installation -- reinstall. + ireq.should_reinstall = True + elif candidate.source_link and candidate.source_link.is_file: + # The incoming distribution is under file:// + if candidate.source_link.is_wheel: + # is a local wheel -- do nothing. + logger.info( + "%s is already installed with the same version as the " + "provided wheel. Use --force-reinstall to force an " + "installation of the wheel.", + ireq.name, + ) + continue + + # is a local sdist or path -- reinstall + ireq.should_reinstall = True + else: + continue + + link = candidate.source_link + if link and link.is_yanked: + # The reason can contain non-ASCII characters, Unicode + # is required for Python 2. + msg = ( + "The candidate selected for download or install is a " + "yanked version: {name!r} candidate (version {version} " + "at {link})\nReason for being yanked: {reason}" + ).format( + name=candidate.name, + version=candidate.version, + link=link, + reason=link.yanked_reason or "", + ) + logger.warning(msg) + + req_set.add_named_requirement(ireq) + + reqs = req_set.all_requirements + self.factory.preparer.prepare_linked_requirements_more(reqs) + for req in reqs: + req.prepared = True + req.needs_more_preparation = False + return req_set + + def get_installation_order( + self, req_set: RequirementSet + ) -> List[InstallRequirement]: + """Get order for installation of requirements in RequirementSet. + + The returned list contains a requirement before another that depends on + it. This helps ensure that the environment is kept consistent as they + get installed one-by-one. + + The current implementation creates a topological ordering of the + dependency graph, giving more weight to packages with less + or no dependencies, while breaking any cycles in the graph at + arbitrary points. We make no guarantees about where the cycle + would be broken, other than it *would* be broken. + """ + assert self._result is not None, "must call resolve() first" + + if not req_set.requirements: + # Nothing is left to install, so we do not need an order. + return [] + + graph = self._result.graph + weights = get_topological_weights(graph, set(req_set.requirements.keys())) + + sorted_items = sorted( + req_set.requirements.items(), + key=functools.partial(_req_set_item_sorter, weights=weights), + reverse=True, + ) + return [ireq for _, ireq in sorted_items] + + +def get_topological_weights( + graph: "DirectedGraph[Optional[str]]", requirement_keys: Set[str] +) -> Dict[Optional[str], int]: + """Assign weights to each node based on how "deep" they are. + + This implementation may change at any point in the future without prior + notice. + + We first simplify the dependency graph by pruning any leaves and giving them + the highest weight: a package without any dependencies should be installed + first. This is done again and again in the same way, giving ever less weight + to the newly found leaves. The loop stops when no leaves are left: all + remaining packages have at least one dependency left in the graph. + + Then we continue with the remaining graph, by taking the length for the + longest path to any node from root, ignoring any paths that contain a single + node twice (i.e. cycles). This is done through a depth-first search through + the graph, while keeping track of the path to the node. + + Cycles in the graph result would result in node being revisited while also + being on its own path. In this case, take no action. This helps ensure we + don't get stuck in a cycle. + + When assigning weight, the longer path (i.e. larger length) is preferred. + + We are only interested in the weights of packages that are in the + requirement_keys. + """ + path: Set[Optional[str]] = set() + weights: Dict[Optional[str], int] = {} + + def visit(node: Optional[str]) -> None: + if node in path: + # We hit a cycle, so we'll break it here. + return + + # Time to visit the children! + path.add(node) + for child in graph.iter_children(node): + visit(child) + path.remove(node) + + if node not in requirement_keys: + return + + last_known_parent_count = weights.get(node, 0) + weights[node] = max(last_known_parent_count, len(path)) + + # Simplify the graph, pruning leaves that have no dependencies. + # This is needed for large graphs (say over 200 packages) because the + # `visit` function is exponentially slower then, taking minutes. + # See https://github.com/pypa/pip/issues/10557 + # We will loop until we explicitly break the loop. + while True: + leaves = set() + for key in graph: + if key is None: + continue + for _child in graph.iter_children(key): + # This means we have at least one child + break + else: + # No child. + leaves.add(key) + if not leaves: + # We are done simplifying. + break + # Calculate the weight for the leaves. + weight = len(graph) - 1 + for leaf in leaves: + if leaf not in requirement_keys: + continue + weights[leaf] = weight + # Remove the leaves from the graph, making it simpler. + for leaf in leaves: + graph.remove(leaf) + + # Visit the remaining graph. + # `None` is guaranteed to be the root node by resolvelib. + visit(None) + + # Sanity check: all requirement keys should be in the weights, + # and no other keys should be in the weights. + difference = set(weights.keys()).difference(requirement_keys) + assert not difference, difference + + return weights + + +def _req_set_item_sorter( + item: Tuple[str, InstallRequirement], + weights: Dict[Optional[str], int], +) -> Tuple[int, str]: + """Key function used to sort install requirements for installation. + + Based on the "weight" mapping calculated in ``get_installation_order()``. + The canonical package name is returned as the second member as a tie- + breaker to ensure the result is predictable, which is useful in tests. + """ + name = canonicalize_name(item[0]) + return weights[name], name diff --git a/shared/package-files/9c/9cb3f30a68dd5c75abb24b8b7c51c77fe96e1431cd8261df041cc7fb2c529432/blob b/shared/package-files/9c/9cb3f30a68dd5c75abb24b8b7c51c77fe96e1431cd8261df041cc7fb2c529432/blob new file mode 100644 index 0000000000000000000000000000000000000000..100f6b30a01dd648ea02d67d20b3ffd20a7e25e7 --- /dev/null +++ b/shared/package-files/9c/9cb3f30a68dd5c75abb24b8b7c51c77fe96e1431cd8261df041cc7fb2c529432/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API ::std::tuple unique_dim_consecutive(const at::Tensor & self, int64_t dim, bool return_inverse=false, bool return_counts=false); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/9c/9cb4208f99128a0489b6c8e6c61637617dd7d4250c59e065491957eda084dd10/blob b/shared/package-files/9c/9cb4208f99128a0489b6c8e6c61637617dd7d4250c59e065491957eda084dd10/blob new file mode 100644 index 0000000000000000000000000000000000000000..86ca8b8a8414b3860aa80599394e806e156f4b5b --- /dev/null +++ b/shared/package-files/9c/9cb4208f99128a0489b6c8e6c61637617dd7d4250c59e065491957eda084dd10/blob @@ -0,0 +1,3 @@ +from _collections_abc import * +from _collections_abc import __all__ +from _collections_abc import _CallableGenericAlias diff --git a/shared/package-files/9c/9cb53faa550f41bb2b369de6a363339fe89b49d4e17e51253670ca6317da1c8d/blob b/shared/package-files/9c/9cb53faa550f41bb2b369de6a363339fe89b49d4e17e51253670ca6317da1c8d/blob new file mode 100644 index 0000000000000000000000000000000000000000..a85c98e3663dca80dbb0a09dda38f1210359b424 --- /dev/null +++ b/shared/package-files/9c/9cb53faa550f41bb2b369de6a363339fe89b49d4e17e51253670ca6317da1c8d/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor linalg_ldl_solve(const at::Tensor & LD, const at::Tensor & pivots, const at::Tensor & B, bool hermitian=false); +TORCH_API at::Tensor & linalg_ldl_solve_out(at::Tensor & out, const at::Tensor & LD, const at::Tensor & pivots, const at::Tensor & B, bool hermitian=false); +TORCH_API at::Tensor & linalg_ldl_solve_outf(const at::Tensor & LD, const at::Tensor & pivots, const at::Tensor & B, bool hermitian, at::Tensor & out); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/9c/9cb76ffca1908209c944139599b5b51aef2bdaae66a257ba8bb35c49e5bbab2f/blob b/shared/package-files/9c/9cb76ffca1908209c944139599b5b51aef2bdaae66a257ba8bb35c49e5bbab2f/blob new file mode 100644 index 0000000000000000000000000000000000000000..f7fce9a89b30dc292743c0e72a4bc2b159df804b Binary files /dev/null and b/shared/package-files/9c/9cb76ffca1908209c944139599b5b51aef2bdaae66a257ba8bb35c49e5bbab2f/blob differ diff --git a/shared/package-files/9c/9cbb6e957572dd351983cffc4653dc748d899a422876cc23492c27847391366a/blob b/shared/package-files/9c/9cbb6e957572dd351983cffc4653dc748d899a422876cc23492c27847391366a/blob new file mode 100644 index 0000000000000000000000000000000000000000..c72ef4a9af53948eed675b5b770724c65b3c9326 --- /dev/null +++ b/shared/package-files/9c/9cbb6e957572dd351983cffc4653dc748d899a422876cc23492c27847391366a/blob @@ -0,0 +1,28 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor slow_conv_transpose2d(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef output_padding=0, at::IntArrayRef dilation=1); +TORCH_API at::Tensor slow_conv_transpose2d_symint(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias={}, c10::SymIntArrayRef stride=c10::SymInt(1), c10::SymIntArrayRef padding=c10::SymInt(0), c10::SymIntArrayRef output_padding=c10::SymInt(0), c10::SymIntArrayRef dilation=c10::SymInt(1)); +TORCH_API at::Tensor & slow_conv_transpose2d_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef output_padding=0, at::IntArrayRef dilation=1); +TORCH_API at::Tensor & slow_conv_transpose2d_outf(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef dilation, at::Tensor & out); +TORCH_API at::Tensor & slow_conv_transpose2d_symint_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias={}, c10::SymIntArrayRef stride=c10::SymInt(1), c10::SymIntArrayRef padding=c10::SymInt(0), c10::SymIntArrayRef output_padding=c10::SymInt(0), c10::SymIntArrayRef dilation=c10::SymInt(1)); +TORCH_API at::Tensor & slow_conv_transpose2d_symint_outf(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef kernel_size, const c10::optional & bias, c10::SymIntArrayRef stride, c10::SymIntArrayRef padding, c10::SymIntArrayRef output_padding, c10::SymIntArrayRef dilation, at::Tensor & out); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/9c/9cbbd3d4d184d0f0b4bad64582c6d60d5b61d3af18f007110f19b85a9e7e8d3c/blob b/shared/package-files/9c/9cbbd3d4d184d0f0b4bad64582c6d60d5b61d3af18f007110f19b85a9e7e8d3c/blob new file mode 100644 index 0000000000000000000000000000000000000000..dd43b0bbfab2a176c238000147a20db046a6056d --- /dev/null +++ b/shared/package-files/9c/9cbbd3d4d184d0f0b4bad64582c6d60d5b61d3af18f007110f19b85a9e7e8d3c/blob @@ -0,0 +1,23 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor arcsin(const at::Tensor & self); +TORCH_API at::Tensor & arcsin_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & arcsin_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/9c/9cc2dd9747330a0835a503d23bef18f034725256e4eadfdcccce06cd17b5a400/blob b/shared/package-files/9c/9cc2dd9747330a0835a503d23bef18f034725256e4eadfdcccce06cd17b5a400/blob new file mode 100644 index 0000000000000000000000000000000000000000..16d64c045fbf5f4e59a145f1510d570e5e30b206 --- /dev/null +++ b/shared/package-files/9c/9cc2dd9747330a0835a503d23bef18f034725256e4eadfdcccce06cd17b5a400/blob @@ -0,0 +1,42 @@ +from datetime import timedelta +from typing import Any, Dict, Optional, Protocol, Type, Union + +class BadSignature(Exception): ... +class SignatureExpired(BadSignature): ... + +def b64_encode(s: bytes) -> bytes: ... +def b64_decode(s: bytes) -> bytes: ... +def base64_hmac(salt: str, value: Union[bytes, str], key: Union[bytes, str]) -> str: ... +def get_cookie_signer(salt: str = ...) -> TimestampSigner: ... + +class Serializer(Protocol): + def dumps(self, obj: Any) -> bytes: ... + def loads(self, data: bytes) -> Any: ... + +class JSONSerializer: + def dumps(self, obj: Any) -> bytes: ... + def loads(self, data: bytes) -> Dict[str, Union[int, str]]: ... + +def dumps( + obj: Any, key: None = ..., salt: str = ..., serializer: Type[Serializer] = ..., compress: bool = ... +) -> str: ... +def loads( + s: str, + key: None = ..., + salt: str = ..., + serializer: Type[Serializer] = ..., + max_age: Optional[Union[int, timedelta]] = ..., +) -> Any: ... + +class Signer: + key: str = ... + sep: str = ... + salt: str = ... + def __init__(self, key: Optional[Union[bytes, str]] = ..., sep: str = ..., salt: Optional[str] = ...) -> None: ... + def signature(self, value: Union[bytes, str]) -> str: ... + def sign(self, value: str) -> str: ... + def unsign(self, signed_value: str) -> str: ... + +class TimestampSigner(Signer): + def timestamp(self) -> str: ... + def unsign(self, value: str, max_age: Optional[Union[int, timedelta]] = ...) -> str: ... diff --git a/shared/package-files/9c/9cc4329abe21b37d93a95a3901b0ab99c24486f3d487bc57965bb2ab0b252e24/blob b/shared/package-files/9c/9cc4329abe21b37d93a95a3901b0ab99c24486f3d487bc57965bb2ab0b252e24/blob new file mode 100644 index 0000000000000000000000000000000000000000..f2cf635e2937ee9b123a1498c5c5f723a6e20084 --- /dev/null +++ b/shared/package-files/9c/9cc4329abe21b37d93a95a3901b0ab99c24486f3d487bc57965bb2ab0b252e24/blob @@ -0,0 +1,50 @@ +""" +requests._internal_utils +~~~~~~~~~~~~~~ + +Provides utility functions that are consumed internally by Requests +which depend on extremely few external helpers (such as compat) +""" +import re + +from .compat import builtin_str + +_VALID_HEADER_NAME_RE_BYTE = re.compile(rb"^[^:\s][^:\r\n]*$") +_VALID_HEADER_NAME_RE_STR = re.compile(r"^[^:\s][^:\r\n]*$") +_VALID_HEADER_VALUE_RE_BYTE = re.compile(rb"^\S[^\r\n]*$|^$") +_VALID_HEADER_VALUE_RE_STR = re.compile(r"^\S[^\r\n]*$|^$") + +_HEADER_VALIDATORS_STR = (_VALID_HEADER_NAME_RE_STR, _VALID_HEADER_VALUE_RE_STR) +_HEADER_VALIDATORS_BYTE = (_VALID_HEADER_NAME_RE_BYTE, _VALID_HEADER_VALUE_RE_BYTE) +HEADER_VALIDATORS = { + bytes: _HEADER_VALIDATORS_BYTE, + str: _HEADER_VALIDATORS_STR, +} + + +def to_native_string(string, encoding="ascii"): + """Given a string object, regardless of type, returns a representation of + that string in the native string type, encoding and decoding where + necessary. This assumes ASCII unless told otherwise. + """ + if isinstance(string, builtin_str): + out = string + else: + out = string.decode(encoding) + + return out + + +def unicode_is_ascii(u_string): + """Determine if unicode string only contains ASCII characters. + + :param str u_string: unicode string to check. Must be unicode + and not Python 2 `str`. + :rtype: bool + """ + assert isinstance(u_string, str) + try: + u_string.encode("ascii") + return True + except UnicodeEncodeError: + return False diff --git a/shared/package-files/9c/9cc51068807a95f87747e2751ab3edaf7d0958feabce4184493e486eb303c263/blob b/shared/package-files/9c/9cc51068807a95f87747e2751ab3edaf7d0958feabce4184493e486eb303c263/blob new file mode 100644 index 0000000000000000000000000000000000000000..759dc0006b7b5a965dc1f61bb03e7e98d73f38e5 --- /dev/null +++ b/shared/package-files/9c/9cc51068807a95f87747e2751ab3edaf7d0958feabce4184493e486eb303c263/blob @@ -0,0 +1,145 @@ +# unicodeout.tcl -- +# +# This demonstration script shows how you can produce output (in label +# widgets) using many different alphabets. + +if {![info exists widgetDemo]} { + error "This script should be run from the \"widget\" demo." +} + +package require Tk + +set w .unicodeout +catch {destroy $w} +toplevel $w +wm title $w "Unicode Label Demonstration" +wm iconname $w "unicodeout" +positionWindow $w + +label $w.msg -font $font -wraplength 4i -anchor w -justify left \ + -text "This is a sample of Tk's support for languages that use\ + non-Western character sets. However, what you will actually see\ + below depends largely on what character sets you have installed,\ + and what you see for characters that are not present varies greatly\ + between platforms as well. The strings are written in Tcl using\ + UNICODE characters using the \\uXXXX escape so as to do so in a\ + portable fashion." +pack $w.msg -side top + +## See Code / Dismiss buttons +set btns [addSeeDismiss $w.buttons $w] +pack $btns -side bottom -fill x + +## The frame that will contain the sample texts. +pack [frame $w.f] -side bottom -expand 1 -fill both -padx 2m -pady 1m +grid columnconfigure $w.f 1 -weight 1 +set i 0 +proc addSample {w language args} { + global font i + set sample [join $args ""] + set j [incr i] + label $w.f.l$j -font $font -text "${language}:" -anchor nw -pady 0 + label $w.f.s$j -font $font -text $sample -anchor nw -width 30 -pady 0 + grid $w.f.l$j $w.f.s$j -sticky ew -pady 0 + grid configure $w.f.l$j -padx 1m +} + +## A helper procedure that determines what form to use to express languages +## that have complex rendering rules... +proc usePresentationFormsFor {language} { + switch [tk windowingsystem] { + aqua { + # OSX wants natural character order; the renderer knows how to + # compose things for display for all languages. + return false + } + x11 { + # The X11 font renderers that Tk supports all know nothing about + # composing characters, so we need to use presentation forms. + return true + } + win32 { + # On Windows, we need to determine whether the font system will + # render right-to-left text. This varies by language! + try { + package require registry + set rkey [join { + HKEY_LOCAL_MACHINE + SOFTWARE + Microsoft + {Windows NT} + CurrentVersion + LanguagePack + } \\] + return [expr { + [string toupper $language] ni [registry values $rkey] + }] + } trap error {} { + # Cannot work it out, so use presentation forms. + return true + } + } + default { + # Default to using presentation forms. + return true + } + } +} + +## Processing when some characters are not currently cached by the display +## engine might take a while, so make sure we're displaying something in the +## meantime... +pack [label $w.wait -text "Please wait while loading fonts..." \ + -font {Helvetica 12 italic}] +set oldCursor [$w cget -cursor] +$w conf -cursor watch +update + +## Add the samples... +if {[usePresentationFormsFor Arabic]} { + # Using presentation forms (pre-layouted) + addSample $w Arabic \ + "\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D " \ + "\uFE94\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D" +} else { + # Using standard text characters + addSample $w Arabic \ + "\u0627\u0644\u0643\u0644\u0645\u0629 " \ + "\u0627\u0644\u0639\u0631\u0628\u064A\u0629" +} +addSample $w "Trad. Chinese" "\u4E2D\u570B\u7684\u6F22\u5B57" +addSample $w "Simpl. Chinese" "\u6C49\u8BED" +addSample $w French "Langue fran\xE7aise" +addSample $w Greek \ + "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE " \ + "\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1" +if {[usePresentationFormsFor Hebrew]} { + # Visual order (pre-layouted) + addSample $w Hebrew \ + "\u05EA\u05D9\u05E8\u05D1\u05E2 \u05D1\u05EA\u05DB" +} else { + # Standard logical order + addSample $w Hebrew \ + "\u05DB\u05EA\u05D1 \u05E2\u05D1\u05E8\u05D9\u05EA" +} +addSample $w Hindi \ + "\u0939\u093F\u0928\u094D\u0926\u0940 \u092D\u093E\u0937\u093E" +addSample $w Icelandic "\xCDslenska" +addSample $w Japanese \ + "\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, " \ + "\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA" +addSample $w Korean "\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00" +addSample $w Russian \ + "\u0420\u0443\u0441\u0441\u043A\u0438\u0439 \u044F\u0437\u044B\u043A" +if {([tk windowingsystem] ne "x11") || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))} { + if {[package vsatisfies [package provide Tcl] 8.7-]} { + addSample $w Emoji "😀💩👍🇳🇱" + } else { + addSample $w Emoji \ + "\uD83D\uDE00\uD83D\uDCA9\uD83D\uDC4D\uD83C\uDDF3\uD83C\uDDF1" + } +} + +## We're done processing, so change things back to normal running... +destroy $w.wait +$w conf -cursor $oldCursor diff --git a/shared/package-files/9c/9cc51c0f0cf90ff156a3473ab67430b4e9b0b0e035e47bdfaee89faded7456d8/blob b/shared/package-files/9c/9cc51c0f0cf90ff156a3473ab67430b4e9b0b0e035e47bdfaee89faded7456d8/blob new file mode 100644 index 0000000000000000000000000000000000000000..86ad13859c9e0b3154ee71a1ec534e95c27bb7e1 Binary files /dev/null and b/shared/package-files/9c/9cc51c0f0cf90ff156a3473ab67430b4e9b0b0e035e47bdfaee89faded7456d8/blob differ diff --git a/shared/package-files/9c/9cc7c8bdea484861437b13eb3189792d6b5d9ade94cbd4ca3f31780556b2c362/blob b/shared/package-files/9c/9cc7c8bdea484861437b13eb3189792d6b5d9ade94cbd4ca3f31780556b2c362/blob new file mode 100644 index 0000000000000000000000000000000000000000..f0dc88bdd3724189dcc7cb91402db6067f8330be --- /dev/null +++ b/shared/package-files/9c/9cc7c8bdea484861437b13eb3189792d6b5d9ade94cbd4ca3f31780556b2c362/blob @@ -0,0 +1,16 @@ +#include +/** + * Test DQ mask operations due to: + * - MSVC has supported it since vs2019 see, + * https://developercommunity.visualstudio.com/content/problem/518298/missing-avx512bw-mask-intrinsics.html + * - Clang >= v8.0 + * - GCC >= v7.1 + */ +int main(void) +{ + __mmask8 m8 = _mm512_cmpeq_epi64_mask(_mm512_set1_epi64(1), _mm512_set1_epi64(1)); + m8 = _kor_mask8(m8, m8); + m8 = _kxor_mask8(m8, m8); + m8 = _cvtu32_mask8(_cvtmask8_u32(m8)); + return (int)_cvtmask8_u32(m8); +} diff --git a/shared/package-files/9c/9cc7d6d4b427ed89496ae35c79e47eba8ff23f1446d84f2171b82a4c1331687e/blob b/shared/package-files/9c/9cc7d6d4b427ed89496ae35c79e47eba8ff23f1446d84f2171b82a4c1331687e/blob new file mode 100644 index 0000000000000000000000000000000000000000..c6fc1659500e62423f20cca44b40762bee60509d --- /dev/null +++ b/shared/package-files/9c/9cc7d6d4b427ed89496ae35c79e47eba8ff23f1446d84f2171b82a4c1331687e/blob @@ -0,0 +1,118 @@ +import numpy as np +import pytest + +import pandas as pd +from pandas import ( + DataFrame, + Series, +) +import pandas._testing as tm + + +@pytest.fixture +def m(): + return 5 + + +@pytest.fixture +def n(): + return 100 + + +@pytest.fixture +def cols(): + return ["jim", "joe", "jolie", "joline", "jolia"] + + +@pytest.fixture +def vals(n): + vals = [ + np.random.default_rng(2).integers(0, 10, n), + np.random.default_rng(2).choice(list("abcdefghij"), n), + np.random.default_rng(2).choice( + pd.date_range("20141009", periods=10).tolist(), n + ), + np.random.default_rng(2).choice(list("ZYXWVUTSRQ"), n), + np.random.default_rng(2).standard_normal(n), + ] + vals = list(map(tuple, zip(*vals))) + return vals + + +@pytest.fixture +def keys(n, m, vals): + # bunch of keys for testing + keys = [ + np.random.default_rng(2).integers(0, 11, m), + np.random.default_rng(2).choice(list("abcdefghijk"), m), + np.random.default_rng(2).choice( + pd.date_range("20141009", periods=11).tolist(), m + ), + np.random.default_rng(2).choice(list("ZYXWVUTSRQP"), m), + ] + keys = list(map(tuple, zip(*keys))) + keys += [t[:-1] for t in vals[:: n // m]] + return keys + + +# covers both unique index and non-unique index +@pytest.fixture +def df(vals, cols): + return DataFrame(vals, columns=cols) + + +@pytest.fixture +def a(df): + return pd.concat([df, df]) + + +@pytest.fixture +def b(df, cols): + return df.drop_duplicates(subset=cols[:-1]) + + +@pytest.mark.filterwarnings("ignore::pandas.errors.PerformanceWarning") +@pytest.mark.parametrize("lexsort_depth", list(range(5))) +@pytest.mark.parametrize("frame_fixture", ["a", "b"]) +def test_multiindex_get_loc(request, lexsort_depth, keys, frame_fixture, cols): + # GH7724, GH2646 + + frame = request.getfixturevalue(frame_fixture) + if lexsort_depth == 0: + df = frame.copy(deep=False) + else: + df = frame.sort_values(by=cols[:lexsort_depth]) + + mi = df.set_index(cols[:-1]) + assert not mi.index._lexsort_depth < lexsort_depth + for key in keys: + mask = np.ones(len(df), dtype=bool) + + # test for all partials of this key + for i, k in enumerate(key): + mask &= df.iloc[:, i] == k + + if not mask.any(): + assert key[: i + 1] not in mi.index + continue + + assert key[: i + 1] in mi.index + right = df[mask].copy(deep=False) + + if i + 1 != len(key): # partial key + return_value = right.drop(cols[: i + 1], axis=1, inplace=True) + assert return_value is None + return_value = right.set_index(cols[i + 1 : -1], inplace=True) + assert return_value is None + tm.assert_frame_equal(mi.loc[key[: i + 1]], right) + + else: # full key + return_value = right.set_index(cols[:-1], inplace=True) + assert return_value is None + if len(right) == 1: # single hit + right = Series( + right["jolia"].values, name=right.index[0], index=["jolia"] + ) + tm.assert_series_equal(mi.loc[key[: i + 1]], right) + else: # multi hit + tm.assert_frame_equal(mi.loc[key[: i + 1]], right) diff --git a/shared/package-files/9c/9ccd3265f96b81baa651b72f0aaa7c00db6f04acdee81e3f0423b0e049066b30/blob b/shared/package-files/9c/9ccd3265f96b81baa651b72f0aaa7c00db6f04acdee81e3f0423b0e049066b30/blob new file mode 100644 index 0000000000000000000000000000000000000000..254a15d78807862a6081199a1efa53b6f728af2c Binary files /dev/null and b/shared/package-files/9c/9ccd3265f96b81baa651b72f0aaa7c00db6f04acdee81e3f0423b0e049066b30/blob differ diff --git a/shared/package-files/9c/9cce34d24e1c99accfbd2afb8e47156b6c8d97c685fb7c52d9dc7700ffc74cab/blob b/shared/package-files/9c/9cce34d24e1c99accfbd2afb8e47156b6c8d97c685fb7c52d9dc7700ffc74cab/blob new file mode 100644 index 0000000000000000000000000000000000000000..1e77caba4aea00fc8c56431f4c4f59d4929a3bad --- /dev/null +++ b/shared/package-files/9c/9cce34d24e1c99accfbd2afb8e47156b6c8d97c685fb7c52d9dc7700ffc74cab/blob @@ -0,0 +1,3466 @@ +{ + "microarchitectures": { + "x86": { + "from": [], + "vendor": "generic", + "features": [] + }, + "i686": { + "from": ["x86"], + "vendor": "GenuineIntel", + "features": [] + }, + "pentium2": { + "from": ["i686"], + "vendor": "GenuineIntel", + "features": [ + "mmx" + ] + }, + "pentium3": { + "from": ["pentium2"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse" + ] + }, + "pentium4": { + "from": ["pentium3"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2" + ] + }, + "prescott": { + "from": ["pentium4"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "sse3" + ] + }, + "x86_64": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "4.2.0:", + "name": "x86-64", + "flags": "-march={name} -mtune=generic" + }, + { + "versions": ":4.1.2", + "name": "x86-64", + "flags": "-march={name} -mtune={name}" + } + ], + "apple-clang": [ + { + "versions": ":", + "name": "x86-64", + "flags": "-march={name}" + } + ], + "clang": [ + { + "versions": ":", + "name": "x86-64", + "flags": "-march={name} -mtune=generic" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "x86-64", + "flags": "-march={name} -mtune=generic" + } + ], + "intel": [ + { + "versions": ":", + "name": "pentium4", + "flags": "-march={name} -mtune=generic" + } + ], + "oneapi": [ + { + "versions": ":", + "name": "x86-64", + "flags": "-march={name} -mtune=generic" + } + ], + "dpcpp": [ + { + "versions": ":", + "name": "x86-64", + "flags": "-march={name} -mtune=generic" + } + ], + "nvhpc": [] + } + }, + "x86_64_v2": { + "from": ["x86_64"], + "vendor": "generic", + "features": [ + "cx16", + "lahf_lm", + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt" + ], + "compilers": { + "gcc": [ + { + "versions": "11.1:", + "name": "x86-64-v2", + "flags": "-march={name} -mtune=generic" + }, + { + "versions": "4.6:11.0", + "name": "x86-64", + "flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3" + } + ], + "clang": [ + { + "versions": "12.0:", + "name": "x86-64-v2", + "flags": "-march={name} -mtune=generic" + }, + { + "versions": "3.9:11.1", + "name": "x86-64", + "flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3" + } + ], + "intel": [ + { + "versions": "16.0:", + "name": "corei7", + "flags": "-march={name} -mtune=generic -mpopcnt" + } + ], + "oneapi": [ + { + "versions": "2021.2.0:", + "name": "x86-64-v2", + "flags": "-march={name} -mtune=generic" + } + ], + "dpcpp": [ + { + "versions": "2021.2.0:", + "name": "x86-64-v2", + "flags": "-march={name} -mtune=generic" + } + ], + "nvhpc": [] + } + }, + "x86_64_v3": { + "from": ["x86_64_v2"], + "vendor": "generic", + "features": [ + "cx16", + "lahf_lm", + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "avx", + "avx2", + "bmi1", + "bmi2", + "f16c", + "fma", + "abm", + "movbe", + "xsave" + ], + "compilers": { + "gcc": [ + { + "versions": "11.1:", + "name": "x86-64-v3", + "flags": "-march={name} -mtune=generic" + }, + { + "versions": "4.8:11.0", + "name": "x86-64", + "flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mmovbe -mxsave" + } + ], + "clang": [ + { + "versions": "12.0:", + "name": "x86-64-v3", + "flags": "-march={name} -mtune=generic" + }, + { + "versions": "3.9:11.1", + "name": "x86-64", + "flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mmovbe -mxsave" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "name": "x86-64", + "flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mmovbe -mxsave" + } + ], + "intel": [ + { + "versions": "16.0:", + "name": "core-avx2", + "flags": "-march={name} -mtune={name} -fma -mf16c" + } + ], + "oneapi": [ + { + "versions": "2021.2.0:", + "name": "x86-64-v3", + "flags": "-march={name} -mtune=generic" + } + ], + "dpcpp": [ + { + "versions": "2021.2.0:", + "name": "x86-64-v3", + "flags": "-march={name} -mtune=generic" + } + ], + "nvhpc" : [ + { + "versions": ":", + "name": "px", + "flags": "-tp {name} -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mxsave" + } + ] + } + }, + "x86_64_v4": { + "from": ["x86_64_v3"], + "vendor": "generic", + "features": [ + "cx16", + "lahf_lm", + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "avx", + "avx2", + "bmi1", + "bmi2", + "f16c", + "fma", + "abm", + "movbe", + "xsave", + "avx512f", + "avx512bw", + "avx512cd", + "avx512dq", + "avx512vl" + ], + "compilers": { + "gcc": [ + { + "versions": "11.1:", + "name": "x86-64-v4", + "flags": "-march={name} -mtune=generic" + }, + { + "versions": "6.0:11.0", + "name": "x86-64", + "flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mmovbe -mxsave -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl" + } + ], + "clang": [ + { + "versions": "12.0:", + "name": "x86-64-v4", + "flags": "-march={name} -mtune=generic" + }, + { + "versions": "3.9:11.1", + "name": "x86-64", + "flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mmovbe -mxsave -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "name": "x86-64", + "flags": "-march={name} -mtune=generic -mcx16 -msahf -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mmovbe -mxsave -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl" + } + ], + "intel": [ + { + "versions": "16.0:", + "name": "skylake-avx512", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": "2021.2.0:", + "name": "x86-64-v4", + "flags": "-march={name} -mtune=generic" + } + ], + "dpcpp": [ + { + "versions": "2021.2.0:", + "name": "x86-64-v4", + "flags": "-march={name} -mtune=generic" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "px", + "flags": "-tp {name} -mpopcnt -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -mavx2 -mbmi -mbmi2 -mf16c -mfma -mlzcnt -mxsave -mavx512f -mavx512bw -mavx512cd -mavx512dq -mavx512vl" + } + ] + } + }, + "nocona": { + "from": ["x86_64"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "sse3" + ], + "compilers": { + "gcc": [ + { + "versions": "4.0.4:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [] + } + }, + "core2": { + "from": ["nocona"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3" + ], + "compilers": { + "gcc": [ + { + "versions": "4.3.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [] + } + }, + "nehalem": { + "from": ["core2", "x86_64_v2"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt" + ], + "compilers": { + "gcc": [ + { + "versions": "4.9:", + "flags": "-march={name} -mtune={name}" + }, + { + "versions": "4.6:4.8.5", + "name": "corei7", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "name": "corei7", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "name": "corei7", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "name": "corei7", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [] + } + }, + "westmere": { + "from": ["nehalem"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq" + ], + "compilers": { + "gcc": [ + { + "versions": "4.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "name": "corei7", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "name": "corei7", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "name": "corei7", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [] + } + }, + "sandybridge": { + "from": ["westmere"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx" + ], + "compilers": { + "gcc": [ + { + "versions": "4.9:", + "flags": "-march={name} -mtune={name}" + }, + { + "versions": "4.6:4.8.5", + "name": "corei7-avx", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune={name}" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:17.9.0", + "name": "corei7-avx", + "flags": "-march={name} -mtune={name}" + }, + { + "versions": "18.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "flags": "-tp {name}" + } + ] + } + }, + "ivybridge": { + "from": ["sandybridge"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c" + ], + "compilers": { + "gcc": [ + { + "versions": "4.9:", + "flags": "-march={name} -mtune={name}" + }, + { + "versions": "4.6:4.8.5", + "name": "core-avx-i", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune={name}" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:17.9.0", + "name": "core-avx-i", + "flags": "-march={name} -mtune={name}" + }, + { + "versions": "18.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "flags": "-tp {name}" + } + ] + } + }, + "haswell": { + "from": ["ivybridge", "x86_64_v3"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c", + "movbe", + "fma", + "avx2", + "bmi1", + "bmi2" + ], + "compilers": { + "gcc": [ + { + "versions": "4.9:", + "flags": "-march={name} -mtune={name}" + }, + { + "versions": "4.8:4.8.5", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune={name}" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:17.9.0", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + }, + { + "versions": "18.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "flags": "-tp {name}" + } + ] + } + }, + "broadwell": { + "from": ["haswell"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c", + "movbe", + "fma", + "avx2", + "bmi1", + "bmi2", + "rdseed", + "adx" + ], + "compilers": { + "gcc": [ + { + "versions": "4.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune={name}" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "18.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "haswell", + "flags": "-tp {name}" + } + ] + } + }, + "skylake": { + "from": ["broadwell"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c", + "movbe", + "fma", + "avx2", + "bmi1", + "bmi2", + "rdseed", + "adx", + "clflushopt", + "xsavec", + "xsaveopt" + ], + "compilers": { + "gcc": [ + { + "versions": "6.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune={name}" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "18.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "haswell", + "flags": "-tp {name}" + } + ] + } + }, + "mic_knl": { + "from": ["broadwell"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c", + "movbe", + "avx2", + "fma", + "avx2", + "bmi1", + "bmi2", + "rdseed", + "adx", + "avx512f", + "avx512pf", + "avx512er", + "avx512cd" + ], + "compilers": { + "gcc": [ + { + "versions": "5.1:", + "name": "knl", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "name": "knl", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "knl", + "flags": "-march={name} -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "18.0:2021.2", + "name": "knl", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":2021.2", + "name": "knl", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":2021.2", + "name": "knl", + "flags": "-march={name} -mtune={name}" + } + ] + } + }, + "skylake_avx512": { + "from": ["skylake", "x86_64_v4"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c", + "movbe", + "fma", + "avx2", + "bmi1", + "bmi2", + "rdseed", + "adx", + "clflushopt", + "xsavec", + "xsaveopt", + "avx512f", + "clwb", + "avx512vl", + "avx512bw", + "avx512dq", + "avx512cd" + ], + "compilers": { + "gcc": [ + { + "name": "skylake-avx512", + "versions": "6.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "name": "skylake-avx512", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "skylake-avx512", + "flags": "-march={name} -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "18.0:", + "name": "skylake-avx512", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "name": "skylake-avx512", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "name": "skylake-avx512", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "skylake", + "flags": "-tp {name}" + } + ] + } + }, + "cannonlake": { + "from": ["skylake"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c", + "movbe", + "fma", + "avx2", + "bmi1", + "bmi2", + "rdseed", + "adx", + "clflushopt", + "xsavec", + "xsaveopt", + "avx512f", + "avx512vl", + "avx512bw", + "avx512dq", + "avx512cd", + "avx512vbmi", + "avx512ifma", + "sha" + ], + "compilers": { + "gcc": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune={name}" + } + ], + "apple-clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "18.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "skylake", + "flags": "-tp {name}" + } + ] + } + }, + "cascadelake": { + "from": ["skylake_avx512"], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c", + "movbe", + "fma", + "avx2", + "bmi1", + "bmi2", + "rdseed", + "adx", + "clflushopt", + "xsavec", + "xsaveopt", + "avx512f", + "clwb", + "avx512vl", + "avx512bw", + "avx512dq", + "avx512cd", + "avx512_vnni" + ], + "compilers": { + "gcc": [ + { + "versions": "9.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "flags": "-march={name} -mtune={name}" + } + ], + "apple-clang": [ + { + "versions": "11.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "19.0.1:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "skylake", + "flags": "-tp {name}" + } + ] + } + }, + "icelake": { + "from": [ + "cascadelake", + "cannonlake" + ], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c", + "movbe", + "fma", + "avx2", + "bmi1", + "bmi2", + "rdseed", + "adx", + "clflushopt", + "xsavec", + "xsaveopt", + "avx512f", + "avx512vl", + "avx512bw", + "avx512dq", + "avx512cd", + "avx512vbmi", + "avx512ifma", + "sha_ni", + "clwb", + "rdpid", + "gfni", + "avx512_vbmi2", + "avx512_vpopcntdq", + "avx512_bitalg", + "avx512_vnni", + "vpclmulqdq", + "vaes" + ], + "compilers": { + "gcc": [ + { + "name": "icelake-client", + "versions": "8.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "7.0:", + "name": "icelake-client", + "flags": "-march={name} -mtune={name}" + }, + { + "versions": "6.0:6.9", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "icelake-client", + "flags": "-march={name} -mtune={name}" + } + ], + "apple-clang": [ + { + "versions": "10.0.1:", + "name": "icelake-client", + "flags": "-march={name} -mtune={name}" + }, + { + "versions": "10.0.0:10.0.99", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "18.0:", + "name": "icelake-client", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "name": "icelake-client", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "name": "icelake-client", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "skylake", + "flags": "-tp {name}" + } + ] + } + }, + "sapphirerapids": { + "from": [ + "icelake" + ], + "vendor": "GenuineIntel", + "features": [ + "mmx", + "sse", + "sse2", + "ssse3", + "sse4_1", + "sse4_2", + "popcnt", + "aes", + "pclmulqdq", + "avx", + "rdrand", + "f16c", + "movbe", + "fma", + "avx2", + "bmi1", + "bmi2", + "rdseed", + "adx", + "clflushopt", + "xsavec", + "xsaveopt", + "avx512f", + "avx512vl", + "avx512bw", + "avx512dq", + "avx512cd", + "avx512vbmi", + "avx512ifma", + "sha_ni", + "clwb", + "rdpid", + "gfni", + "avx512_vbmi2", + "avx512_vpopcntdq", + "avx512_bitalg", + "avx512_vnni", + "vpclmulqdq", + "vaes", + "avx512_bf16", + "cldemote", + "movdir64b", + "movdiri", + "pdcm", + "serialize", + "waitpkg" + ], + "compilers": { + "gcc": [ + { + "versions": "11.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "12.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "2021.2:", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": "2021.2:", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": "2021.2:", + "flags": "-march={name} -mtune={name}" + } + ] + } + }, + "k10": { + "from": ["x86_64"], + "vendor": "AuthenticAMD", + "features": [ + "mmx", + "sse", + "sse2", + "sse4a", + "abm", + "cx16", + "3dnow", + "3dnowext" + ], + "compilers": { + "gcc": [ + { + "name": "amdfam10", + "versions": "4.3:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "name": "amdfam10", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "amdfam10", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse2" + } + ], + "oneapi": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse2" + } + ], + "dpcpp": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse2" + } + ], + "nvhpc": [] + } + }, + "bulldozer": { + "from": ["x86_64_v2"], + "vendor": "AuthenticAMD", + "features": [ + "mmx", + "sse", + "sse2", + "sse4a", + "abm", + "avx", + "xop", + "fma4", + "aes", + "pclmulqdq", + "cx16", + "ssse3", + "sse4_1", + "sse4_2" + ], + "compilers": { + "gcc": [ + { + "name": "bdver1", + "versions": "4.7:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "name": "bdver1", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "bdver1", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse3" + } + ], + "oneapi": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse3" + } + ], + "dpcpp": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse3" + } + ], + "nvhpc": [ + { + "versions": ":", + "flags": "-tp {name}" + } + ] + } + }, + "piledriver": { + "from": ["bulldozer"], + "vendor": "AuthenticAMD", + "features": [ + "mmx", + "sse", + "sse2", + "sse4a", + "abm", + "avx", + "xop", + "fma4", + "aes", + "pclmulqdq", + "cx16", + "ssse3", + "sse4_1", + "sse4_2", + "bmi1", + "f16c", + "fma", + "tbm" + ], + "compilers": { + "gcc": [ + { + "name": "bdver2", + "versions": "4.7:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "name": "bdver2", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "bdver2", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse3" + } + ], + "oneapi": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse3" + } + ], + "dpcpp": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse3" + } + ], + "nvhpc": [ + { + "versions": ":", + "flags": "-tp {name}" + } + ] + } + }, + "steamroller": { + "from": ["piledriver"], + "vendor": "AuthenticAMD", + "features": [ + "mmx", + "sse", + "sse2", + "sse4a", + "abm", + "avx", + "xop", + "fma4", + "aes", + "pclmulqdq", + "cx16", + "ssse3", + "sse4_1", + "sse4_2", + "bmi1", + "f16c", + "fma", + "fsgsbase", + "tbm" + ], + "compilers": { + "gcc": [ + { + "name": "bdver3", + "versions": "4.8:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "name": "bdver3", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "bdver3", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse4.2" + } + ], + "oneapi": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse4.2" + } + ], + "dpcpp": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "flags": "-msse4.2" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "piledriver", + "flags": "-tp {name}" + } + ] + } + }, + "excavator": { + "from": ["steamroller", "x86_64_v3"], + "vendor": "AuthenticAMD", + "features": [ + "mmx", + "sse", + "sse2", + "sse4a", + "abm", + "avx", + "xop", + "fma4", + "aes", + "pclmulqdq", + "cx16", + "ssse3", + "sse4_1", + "sse4_2", + "bmi1", + "f16c", + "fma", + "fsgsbase", + "bmi2", + "avx2", + "movbe", + "tbm" + ], + "compilers": { + "gcc": [ + { + "name": "bdver4", + "versions": "4.9:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "name": "bdver4", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "bdver4", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "piledriver", + "flags": "-tp {name}" + } + ] + } + }, + "zen": { + "from": ["x86_64_v3"], + "vendor": "AuthenticAMD", + "features": [ + "bmi1", + "bmi2", + "f16c", + "fma", + "fsgsbase", + "avx", + "avx2", + "rdseed", + "clzero", + "aes", + "pclmulqdq", + "cx16", + "movbe", + "mmx", + "sse", + "sse2", + "sse4a", + "ssse3", + "sse4_1", + "sse4_2", + "abm", + "xsavec", + "xsaveopt", + "clflushopt", + "popcnt" + ], + "compilers": { + "gcc": [ + { + "name": "znver1", + "versions": "6.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "4.0:", + "name": "znver1", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "znver1", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "flags": "-tp {name}" + } + ] + } + }, + "zen2": { + "from": ["zen"], + "vendor": "AuthenticAMD", + "features": [ + "bmi1", + "bmi2", + "f16c", + "fma", + "fsgsbase", + "avx", + "avx2", + "rdseed", + "clzero", + "aes", + "pclmulqdq", + "cx16", + "movbe", + "mmx", + "sse", + "sse2", + "sse4a", + "ssse3", + "sse4_1", + "sse4_2", + "abm", + "xsavec", + "xsaveopt", + "clflushopt", + "popcnt", + "clwb" + ], + "compilers": { + "gcc": [ + { + "name": "znver2", + "versions": "9.0:", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "9.0:", + "name": "znver2", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "2.2:", + "name": "znver2", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": "20.5:", + "flags": "-tp {name}" + } + ] + } + }, + "zen3": { + "from": ["zen2"], + "vendor": "AuthenticAMD", + "features": [ + "bmi1", + "bmi2", + "f16c", + "fma", + "fsgsbase", + "avx", + "avx2", + "rdseed", + "clzero", + "aes", + "pclmulqdq", + "cx16", + "movbe", + "mmx", + "sse", + "sse2", + "sse4a", + "ssse3", + "sse4_1", + "sse4_2", + "abm", + "xsavec", + "xsaveopt", + "clflushopt", + "popcnt", + "clwb", + "vaes", + "vpclmulqdq", + "pku" + ], + "compilers": { + "gcc": [ + { + "versions": "10.3:", + "name": "znver3", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "12.0:", + "name": "znver3", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "3.0:", + "name": "znver3", + "flags": "-march={name} -mtune={name}" + } + ], + "intel": [ + { + "versions": "16.0:", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "oneapi": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "dpcpp": [ + { + "versions": ":", + "warnings": "Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors", + "name": "core-avx2", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": "21.11:", + "flags": "-tp {name}" + } + ] + } + }, + "zen4": { + "from": ["zen3", "x86_64_v4"], + "vendor": "AuthenticAMD", + "features": [ + "bmi1", + "bmi2", + "f16c", + "fma", + "fsgsbase", + "avx", + "avx2", + "rdseed", + "clzero", + "aes", + "pclmulqdq", + "cx16", + "movbe", + "mmx", + "sse", + "sse2", + "sse4a", + "ssse3", + "sse4_1", + "sse4_2", + "abm", + "xsavec", + "xsaveopt", + "clflushopt", + "popcnt", + "clwb", + "vaes", + "vpclmulqdq", + "pku", + "gfni", + "flush_l1d", + "avx512f", + "avx512dq", + "avx512ifma", + "avx512cd", + "avx512bw", + "avx512vl", + "avx512_bf16", + "avx512vbmi", + "avx512_vbmi2", + "avx512_vnni", + "avx512_bitalg", + "avx512_vpopcntdq" + ], + "compilers": { + "gcc": [ + { + "versions": "10.3:12.2", + "name": "znver3", + "flags": "-march={name} -mtune={name} -mavx512f -mavx512dq -mavx512ifma -mavx512cd -mavx512bw -mavx512vl -mavx512vbmi -mavx512vbmi2 -mavx512vnni -mavx512bitalg" + }, + { + "versions": "12.3:", + "name": "znver4", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "12.0:15.9", + "name": "znver3", + "flags": "-march={name} -mtune={name} -mavx512f -mavx512dq -mavx512ifma -mavx512cd -mavx512bw -mavx512vl -mavx512vbmi -mavx512vbmi2 -mavx512vnni -mavx512bitalg" + }, + { + "versions": "16.0:", + "name": "znver4", + "flags": "-march={name} -mtune={name}" + } + ], + "aocc": [ + { + "versions": "3.0:3.9", + "name": "znver3", + "flags": "-march={name} -mtune={name} -mavx512f -mavx512dq -mavx512ifma -mavx512cd -mavx512bw -mavx512vl -mavx512vbmi -mavx512vbmi2 -mavx512vnni -mavx512bitalg", + "warnings": "Zen4 processors are not fully supported by AOCC versions < 4.0. For optimal performance please upgrade to a newer version of AOCC" + }, + { + "versions": "4.0:", + "name": "znver4", + "flags": "-march={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": "21.11:", + "name": "zen3", + "flags": "-tp {name}", + "warnings": "zen4 is not fully supported by nvhpc yet, falling back to zen3" + } + ] + } + }, + "ppc64": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "name": "powerpc64", + "versions": ":", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": ":", + "flags": "-mcpu={name} -mtune={name}" + } + ] + } + }, + "power7": { + "from": ["ppc64"], + "vendor": "IBM", + "generation": 7, + "features": [], + "compilers": { + "gcc": [ + { + "versions": "4.4:", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-mcpu={name} -mtune={name}" + } + ] + } + }, + "power8": { + "from": ["power7"], + "vendor": "IBM", + "generation": 8, + "features": [], + "compilers": { + "gcc": [ + { + "versions": "4.9:", + "flags": "-mcpu={name} -mtune={name}" + }, + { + "versions": "4.8:4.8.5", + "warnings": "Using GCC 4.8 to optimize for Power 8 might not work if you are not on Red Hat Enterprise Linux 7, where a custom backport of the feature has been done. Upstream support from GCC starts in version 4.9", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-mcpu={name} -mtune={name}" + } + ] + } + }, + "power9": { + "from": ["power8"], + "vendor": "IBM", + "generation": 9, + "features": [], + "compilers": { + "gcc": [ + { + "versions": "6.0:", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "flags": "-mcpu={name} -mtune={name}" + } + ] + } + }, + "power10": { + "from": ["power9"], + "vendor": "IBM", + "generation": 10, + "features": [], + "compilers": { + "gcc": [ + { + "versions": "11.1:", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "11.0:", + "flags": "-mcpu={name} -mtune={name}" + } + ] + } + }, + "ppc64le": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "name": "powerpc64le", + "versions": "4.8:", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": ":", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "nvhpc": [] + } + }, + "power8le": { + "from": ["ppc64le"], + "vendor": "IBM", + "generation": 8, + "features": [], + "compilers": { + "gcc": [ + { + "versions": "4.9:", + "name": "power8", + "flags": "-mcpu={name} -mtune={name}" + }, + { + "versions": "4.8:4.8.5", + "warnings": "Using GCC 4.8 to optimize for Power 8 might not work if you are not on Red Hat Enterprise Linux 7, where a custom backport of the feature has been done. Upstream support from GCC starts in version 4.9", + "name": "power8", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "family": "ppc64le", + "name": "power8", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "pwr8", + "flags": "-tp {name}" + } + ] + } + }, + "power9le": { + "from": ["power8le"], + "vendor": "IBM", + "generation": 9, + "features": [], + "compilers": { + "gcc": [ + { + "name": "power9", + "versions": "6.0:", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "3.9:", + "family": "ppc64le", + "name": "power9", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "nvhpc": [ + { + "versions": ":", + "name": "pwr9", + "flags": "-tp {name}" + } + ] + } + }, + "power10le": { + "from": ["power9le"], + "vendor": "IBM", + "generation": 10, + "features": [], + "compilers": { + "gcc": [ + { + "name": "power10", + "versions": "11.1:", + "flags": "-mcpu={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "11.0:", + "family": "ppc64le", + "name": "power10", + "flags": "-mcpu={name} -mtune={name}" + } + ] + } + }, + "aarch64": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "4.8.0:", + "flags": "-march=armv8-a -mtune=generic" + } + ], + "clang": [ + { + "versions": ":", + "flags": "-march=armv8-a -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": ":", + "flags": "-march=armv8-a -mtune=generic" + } + ], + "arm": [ + { + "versions": ":", + "flags": "-march=armv8-a -mtune=generic" + } + ], + "nvhpc": [] + } + }, + "armv8.1a": { + "from": ["aarch64"], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "5:", + "flags": "-march=armv8.1-a -mtune=generic" + } + ], + "clang": [ + { + "versions": ":", + "flags": "-march=armv8.1-a -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": ":", + "flags": "-march=armv8.1-a -mtune=generic" + } + ], + "arm": [ + { + "versions": ":", + "flags": "-march=armv8.1-a -mtune=generic" + } + ] + } + }, + "armv8.2a": { + "from": ["armv8.1a"], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "6:", + "flags": "-march=armv8.2-a -mtune=generic" + } + ], + "clang": [ + { + "versions": ":", + "flags": "-march=armv8.2-a -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": ":", + "flags": "-march=armv8.2-a -mtune=generic" + } + ], + "arm": [ + { + "versions": ":", + "flags": "-march=armv8.2-a -mtune=generic" + } + ] + } + }, + "armv8.3a": { + "from": ["armv8.2a"], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "6:", + "flags": "-march=armv8.3-a -mtune=generic" + } + ], + "clang": [ + { + "versions": "6:", + "flags": "-march=armv8.3-a -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": ":", + "flags": "-march=armv8.3-a -mtune=generic" + } + ], + "arm": [ + { + "versions": ":", + "flags": "-march=armv8.3-a -mtune=generic" + } + ] + } + }, + "armv8.4a": { + "from": ["armv8.3a"], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "8:", + "flags": "-march=armv8.4-a -mtune=generic" + } + ], + "clang": [ + { + "versions": "8:", + "flags": "-march=armv8.4-a -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": ":", + "flags": "-march=armv8.4-a -mtune=generic" + } + ], + "arm": [ + { + "versions": ":", + "flags": "-march=armv8.4-a -mtune=generic" + } + ] + } + }, + "armv8.5a": { + "from": ["armv8.4a"], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "9:", + "flags": "-march=armv8.5-a -mtune=generic" + } + ], + "clang": [ + { + "versions": "11:", + "flags": "-march=armv8.5-a -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": ":", + "flags": "-march=armv8.5-a -mtune=generic" + } + ], + "arm": [ + { + "versions": ":", + "flags": "-march=armv8.5-a -mtune=generic" + } + ] + } + }, + "armv9.0a": { + "from": ["armv8.5a"], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "12:", + "flags": "-march=armv9-a -mtune=generic" + } + ], + "clang": [ + { + "versions": "14:", + "flags": "-march=armv9-a -mtune=generic" + } + ], + "apple-clang": [ + { + "versions": ":", + "flags": "-march=armv9-a -mtune=generic" + } + ], + "arm": [ + { + "versions": ":", + "flags": "-march=armv9-a -mtune=generic" + } + ] + } + }, + "thunderx2": { + "from": ["armv8.1a"], + "vendor": "Cavium", + "features": [ + "fp", + "asimd", + "evtstrm", + "aes", + "pmull", + "sha1", + "sha2", + "crc32", + "atomics", + "cpuid", + "asimdrdm" + ], + "compilers": { + "gcc": [ + { + "versions": "4.8:4.8.9", + "flags": "-march=armv8-a" + }, + { + "versions": "4.9:5.9", + "flags": "-march=armv8-a+crc+crypto" + }, + { + "versions": "6:6.9", + "flags": "-march=armv8.1-a+crc+crypto" + }, + { + "versions": "7:", + "flags": "-mcpu=thunderx2t99" + } + ], + "clang": [ + { + "versions": "3.9:4.9", + "flags": "-march=armv8.1-a+crc+crypto" + }, + { + "versions": "5:", + "flags": "-mcpu=thunderx2t99" + } + ] + } + }, + "a64fx": { + "from": ["armv8.2a"], + "vendor": "Fujitsu", + "features": [ + "fp", + "asimd", + "evtstrm", + "sha1", + "sha2", + "crc32", + "atomics", + "cpuid", + "asimdrdm", + "fphp", + "asimdhp", + "fcma", + "dcpop", + "sve" + ], + "compilers": { + "gcc": [ + { + "versions": "4.8:4.8.9", + "flags": "-march=armv8-a" + }, + { + "versions": "4.9:5.9", + "flags": "-march=armv8-a+crc+crypto" + }, + { + "versions": "6:6.9", + "flags": "-march=armv8.1-a+crc+crypto" + }, + { + "versions": "7:7.9", + "flags": "-march=armv8.2-a+crc+crypto+fp16" + }, + { + "versions": "8:10.2", + "flags": "-march=armv8.2-a+crc+sha2+fp16+sve -msve-vector-bits=512" + }, + { + "versions": "10.3:", + "flags": "-mcpu=a64fx -msve-vector-bits=512" + } + ], + "clang": [ + { + "versions": "3.9:4.9", + "flags": "-march=armv8.2-a+crc+sha2+fp16" + }, + { + "versions": "5:10", + "flags": "-march=armv8.2-a+crc+sha2+fp16+sve" + }, + { + "versions": "11:", + "flags": "-mcpu=a64fx" + } + ], + "arm": [ + { + "versions": "20:", + "flags": "-march=armv8.2-a+crc+crypto+fp16+sve" + } + ] + } + }, + "cortex_a72": { + "from": ["aarch64"], + "vendor": "ARM", + "features": [ + "fp", + "asimd", + "evtstrm", + "aes", + "pmull", + "sha1", + "sha2", + "crc32", + "cpuid" + ], + "compilers" : { + "gcc": [ + { + "versions": "4.8:4.8.9", + "flags" : "-march=armv8-a" + }, + { + "versions": "4.9:5.9", + "flags" : "-march=armv8-a+crc+crypto" + }, + { + "versions": "6:", + "flags" : "-mcpu=cortex-a72" + } + ], + "clang" : [ + { + "versions": "3.9:", + "flags" : "-mcpu=cortex-a72" + } + ] + } + }, + "neoverse_n1": { + "from": ["cortex_a72", "armv8.2a"], + "vendor": "ARM", + "features": [ + "fp", + "asimd", + "evtstrm", + "aes", + "pmull", + "sha1", + "sha2", + "crc32", + "atomics", + "fphp", + "asimdhp", + "cpuid", + "asimdrdm", + "lrcpc", + "dcpop", + "asimddp", + "ssbs" + ], + "compilers" : { + "gcc": [ + { + "versions": "4.8:4.8.9", + "flags": "-march=armv8-a" + }, + { + "versions": "4.9:5.9", + "flags": "-march=armv8-a+crc+crypto" + }, + { + "versions": "6:6.9", + "flags" : "-march=armv8.1-a" + }, + { + "versions": "7:7.9", + "flags" : "-march=armv8.2-a+fp16 -mtune=cortex-a72" + }, + { + "versions": "8.0:8.0", + "flags" : "-march=armv8.2-a+fp16+dotprod+crypto -mtune=cortex-a72" + }, + { + "versions": "8.1:8.9", + "flags" : "-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=cortex-a72" + }, + { + "versions": "9.0:", + "flags" : "-mcpu=neoverse-n1" + } + ], + "clang" : [ + { + "versions": "3.9:4.9", + "flags" : "-march=armv8.2-a+fp16+crc+crypto" + }, + { + "versions": "5:", + "flags" : "-march=armv8.2-a+fp16+rcpc+dotprod+crypto" + }, + { + "versions": "10:", + "flags" : "-mcpu=neoverse-n1" + } + ], + "arm" : [ + { + "versions": "20:21.9", + "flags" : "-march=armv8.2-a+fp16+rcpc+dotprod+crypto" + }, + { + "versions": "22:", + "flags" : "-mcpu=neoverse-n1" + } + ], + "nvhpc" : [ + { + "versions": "22.5:", + "name": "neoverse-n1", + "flags": "-tp {name}" + } + ] + } + }, + "neoverse_v1": { + "from": ["neoverse_n1", "armv8.4a"], + "vendor": "ARM", + "features": [ + "fp", + "asimd", + "evtstrm", + "aes", + "pmull", + "sha1", + "sha2", + "crc32", + "atomics", + "fphp", + "asimdhp", + "cpuid", + "asimdrdm", + "jscvt", + "fcma", + "lrcpc", + "dcpop", + "sha3", + "sm3", + "sm4", + "asimddp", + "sha512", + "sve", + "asimdfhm", + "dit", + "uscat", + "ilrcpc", + "flagm", + "ssbs", + "paca", + "pacg", + "dcpodp", + "svei8mm", + "svebf16", + "i8mm", + "bf16", + "dgh", + "rng" + ], + "compilers" : { + "gcc": [ + { + "versions": "4.8:4.8.9", + "flags": "-march=armv8-a" + }, + { + "versions": "4.9:5.9", + "flags": "-march=armv8-a+crc+crypto" + }, + { + "versions": "6:6.9", + "flags" : "-march=armv8.1-a" + }, + { + "versions": "7:7.9", + "flags" : "-march=armv8.2-a+crypto+fp16 -mtune=cortex-a72" + }, + { + "versions": "8.0:8.4", + "flags" : "-march=armv8.2-a+fp16+dotprod+crypto -mtune=cortex-a72" + }, + { + "versions": "8.5:8.9", + "flags" : "-mcpu=neoverse-v1" + }, + { + "versions": "9.0:9.3", + "flags" : "-march=armv8.2-a+fp16+dotprod+crypto -mtune=cortex-a72" + }, + { + "versions": "9.4:9.9", + "flags" : "-mcpu=neoverse-v1" + }, + { + "versions": "10.0:10.1", + "flags" : "-march=armv8.2-a+fp16+dotprod+crypto -mtune=cortex-a72" + }, + { + "versions": "10.2:10.2.99", + "flags" : "-mcpu=zeus" + }, + { + "versions": "10.3:", + "flags" : "-mcpu=neoverse-v1" + } + + ], + "clang" : [ + { + "versions": "3.9:4.9", + "flags" : "-march=armv8.2-a+fp16+crc+crypto" + }, + { + "versions": "5:10", + "flags" : "-march=armv8.2-a+fp16+rcpc+dotprod+crypto" + }, + { + "versions": "11:", + "flags" : "-march=armv8.4-a+sve+ssbs+fp16+bf16+crypto+i8mm+rng" + }, + { + "versions": "12:", + "flags" : "-mcpu=neoverse-v1" + } + ], + "arm" : [ + { + "versions": "20:21.9", + "flags" : "-march=armv8.2-a+sve+fp16+rcpc+dotprod+crypto" + }, + { + "versions": "22:", + "flags" : "-mcpu=neoverse-v1" + } + ], + "nvhpc" : [ + { + "versions": "22.5:", + "name": "neoverse-n1", + "flags": "-tp {name}" + } + ] + } + }, + "neoverse_v2": { + "from": ["neoverse_n1", "armv9.0a"], + "vendor": "ARM", + "features": [ + "fp", + "asimd", + "evtstrm", + "aes", + "pmull", + "sha1", + "sha2", + "crc32", + "atomics", + "fphp", + "asimdhp", + "cpuid", + "asimdrdm", + "jscvt", + "fcma", + "lrcpc", + "dcpop", + "sha3", + "sm3", + "sm4", + "asimddp", + "sha512", + "sve", + "asimdfhm", + "dit", + "uscat", + "ilrcpc", + "flagm", + "ssbs", + "sb", + "paca", + "pacg", + "dcpodp", + "sve2", + "sveaes", + "svepmull", + "svebitperm", + "svesha3", + "svesm4", + "flagm2", + "frint", + "svei8mm", + "svebf16", + "i8mm", + "bf16", + "dgh", + "bti" + ], + "compilers" : { + "gcc": [ + { + "versions": "4.8:5.99", + "flags": "-march=armv8-a" + }, + { + "versions": "6:6.99", + "flags" : "-march=armv8.1-a" + }, + { + "versions": "7.0:7.99", + "flags" : "-march=armv8.2-a -mtune=cortex-a72" + }, + { + "versions": "8.0:8.99", + "flags" : "-march=armv8.4-a+sve -mtune=cortex-a72" + }, + { + "versions": "9.0:9.99", + "flags" : "-march=armv8.5-a+sve -mtune=cortex-a76" + }, + { + "versions": "10.0:11.99", + "flags" : "-march=armv8.5-a+sve+sve2+i8mm+bf16 -mtune=cortex-a77" + }, + { + "versions": "12.0:12.99", + "flags" : "-march=armv9-a+i8mm+bf16 -mtune=cortex-a710" + }, + { + "versions": "13.0:", + "flags" : "-mcpu=neoverse-v2" + } + ], + "clang" : [ + { + "versions": "9.0:10.99", + "flags" : "-march=armv8.5-a+sve" + }, + { + "versions": "11.0:13.99", + "flags" : "-march=armv8.5-a+sve+sve2+i8mm+bf16" + }, + { + "versions": "14.0:15.99", + "flags" : "-march=armv9-a+i8mm+bf16" + }, + { + "versions": "16.0:", + "flags" : "-mcpu=neoverse-v2" + } + ], + "arm" : [ + { + "versions": "23.04.0:", + "flags" : "-mcpu=neoverse-v2" + } + ], + "nvhpc" : [ + { + "versions": "23.3:", + "name": "neoverse-v2", + "flags": "-tp {name}" + } + ] + } + }, + "m1": { + "from": ["armv8.4a"], + "vendor": "Apple", + "features": [ + "fp", + "asimd", + "evtstrm", + "aes", + "pmull", + "sha1", + "sha2", + "crc32", + "atomics", + "fphp", + "asimdhp", + "cpuid", + "asimdrdm", + "jscvt", + "fcma", + "lrcpc", + "dcpop", + "sha3", + "asimddp", + "sha512", + "asimdfhm", + "dit", + "uscat", + "ilrcpc", + "flagm", + "ssbs", + "sb", + "paca", + "pacg", + "dcpodp", + "flagm2", + "frint" + ], + "compilers": { + "gcc": [ + { + "versions": "8.0:", + "flags" : "-march=armv8.4-a -mtune=generic" + } + ], + "clang" : [ + { + "versions": "9.0:12.0", + "flags" : "-march=armv8.4-a" + }, + { + "versions": "13.0:", + "flags" : "-mcpu=apple-m1" + } + ], + "apple-clang": [ + { + "versions": "11.0:12.5", + "flags" : "-march=armv8.4-a" + }, + { + "versions": "13.0:", + "flags" : "-mcpu=apple-m1" + } + ] + } + }, + "m2": { + "from": ["m1", "armv8.5a"], + "vendor": "Apple", + "features": [ + "fp", + "asimd", + "evtstrm", + "aes", + "pmull", + "sha1", + "sha2", + "crc32", + "atomics", + "fphp", + "asimdhp", + "cpuid", + "asimdrdm", + "jscvt", + "fcma", + "lrcpc", + "dcpop", + "sha3", + "asimddp", + "sha512", + "asimdfhm", + "dit", + "uscat", + "ilrcpc", + "flagm", + "ssbs", + "sb", + "paca", + "pacg", + "dcpodp", + "flagm2", + "frint", + "ecv", + "bf16", + "i8mm", + "bti" + ], + "compilers": { + "gcc": [ + { + "versions": "8.0:", + "flags" : "-march=armv8.5-a -mtune=generic" + } + ], + "clang" : [ + { + "versions": "9.0:12.0", + "flags" : "-march=armv8.5-a" + }, + { + "versions": "13.0:", + "flags" : "-mcpu=apple-m1" + }, + { + "versions": "16.0:", + "flags" : "-mcpu=apple-m2" + } + ], + "apple-clang": [ + { + "versions": "11.0:12.5", + "flags" : "-march=armv8.5-a" + }, + { + "versions": "13.0:14.0.2", + "flags" : "-mcpu=apple-m1" + }, + { + "versions": "14.0.2:", + "flags" : "-mcpu=apple-m2" + } + ] + } + }, + "arm": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + "clang": [ + { + "versions": ":", + "family": "arm", + "flags": "-march={family} -mcpu=generic" + } + ] + } + }, + "ppc": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + } + }, + "ppcle": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + } + }, + "sparc": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + } + }, + "sparc64": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + } + }, + "riscv64": { + "from": [], + "vendor": "generic", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "7.1:", + "flags" : "-march=rv64gc" + } + ], + "clang": [ + { + "versions": "9.0:", + "flags" : "-march=rv64gc" + } + ] + } + }, + "u74mc": { + "from": ["riscv64"], + "vendor": "SiFive", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "10.2:", + "flags" : "-march=rv64gc -mtune=sifive-7-series" + } + ], + "clang" : [ + { + "versions": "12.0:", + "flags" : "-march=rv64gc -mtune=sifive-7-series" + } + ] + } + } + }, + "feature_aliases": { + "sse3": { + "reason": "ssse3 is a superset of sse3 and might be the only one listed", + "any_of": [ + "ssse3" + ] + }, + "avx512": { + "reason": "avx512 indicates generic support for any of the avx512 instruction sets", + "any_of": [ + "avx512f", + "avx512vl", + "avx512bw", + "avx512dq", + "avx512cd" + ] + }, + "altivec": { + "reason": "altivec is supported by Power PC architectures, but might not be listed in features", + "families": [ + "ppc64le", + "ppc64" + ] + }, + "vsx": { + "reason": "VSX alitvec extensions are supported by PowerISA from v2.06 (Power7+), but might not be listed in features", + "families": [ + "ppc64le", + "ppc64" + ] + }, + "fma": { + "reason": "FMA has been supported by PowerISA since Power1, but might not be listed in features", + "families": [ + "ppc64le", + "ppc64" + ] + }, + "sse4.1": { + "reason": "permits to refer to sse4_1 also as sse4.1", + "any_of": [ + "sse4_1" + ] + }, + "sse4.2": { + "reason": "permits to refer to sse4_2 also as sse4.2", + "any_of": [ + "sse4_2" + ] + }, + "neon": { + "reason": "NEON is required in all standard ARMv8 implementations", + "families": [ + "aarch64" + ] + } + }, + "conversions": { + "description": "Conversions that map some platform specific values to canonical values", + "arm_vendors": { + "0x41": "ARM", + "0x42": "Broadcom", + "0x43": "Cavium", + "0x44": "DEC", + "0x46": "Fujitsu", + "0x48": "HiSilicon", + "0x49": "Infineon Technologies AG", + "0x4d": "Motorola", + "0x4e": "Nvidia", + "0x50": "APM", + "0x51": "Qualcomm", + "0x53": "Samsung", + "0x56": "Marvell", + "0x61": "Apple", + "0x66": "Faraday", + "0x68": "HXT", + "0x69": "Intel" + }, + "darwin_flags": { + "sse4.1": "sse4_1", + "sse4.2": "sse4_2", + "avx1.0": "avx", + "clfsopt": "clflushopt", + "xsave": "xsavec xsaveopt" + } + } +} diff --git a/shared/package-files/9c/9ccf827ad52d112107df57ddba0ace976d06579fa9094600beeeb917060325e2/blob b/shared/package-files/9c/9ccf827ad52d112107df57ddba0ace976d06579fa9094600beeeb917060325e2/blob new file mode 100644 index 0000000000000000000000000000000000000000..1bf73d595f6c224fc68996da7d90504f9671ca51 --- /dev/null +++ b/shared/package-files/9c/9ccf827ad52d112107df57ddba0ace976d06579fa9094600beeeb917060325e2/blob @@ -0,0 +1,119 @@ +import logging +from collections import OrderedDict +from typing import Dict, List + +from pip._vendor.packaging.specifiers import LegacySpecifier +from pip._vendor.packaging.utils import canonicalize_name +from pip._vendor.packaging.version import LegacyVersion + +from pip._internal.req.req_install import InstallRequirement +from pip._internal.utils.deprecation import deprecated + +logger = logging.getLogger(__name__) + + +class RequirementSet: + def __init__(self, check_supported_wheels: bool = True) -> None: + """Create a RequirementSet.""" + + self.requirements: Dict[str, InstallRequirement] = OrderedDict() + self.check_supported_wheels = check_supported_wheels + + self.unnamed_requirements: List[InstallRequirement] = [] + + def __str__(self) -> str: + requirements = sorted( + (req for req in self.requirements.values() if not req.comes_from), + key=lambda req: canonicalize_name(req.name or ""), + ) + return " ".join(str(req.req) for req in requirements) + + def __repr__(self) -> str: + requirements = sorted( + self.requirements.values(), + key=lambda req: canonicalize_name(req.name or ""), + ) + + format_string = "<{classname} object; {count} requirement(s): {reqs}>" + return format_string.format( + classname=self.__class__.__name__, + count=len(requirements), + reqs=", ".join(str(req.req) for req in requirements), + ) + + def add_unnamed_requirement(self, install_req: InstallRequirement) -> None: + assert not install_req.name + self.unnamed_requirements.append(install_req) + + def add_named_requirement(self, install_req: InstallRequirement) -> None: + assert install_req.name + + project_name = canonicalize_name(install_req.name) + self.requirements[project_name] = install_req + + def has_requirement(self, name: str) -> bool: + project_name = canonicalize_name(name) + + return ( + project_name in self.requirements + and not self.requirements[project_name].constraint + ) + + def get_requirement(self, name: str) -> InstallRequirement: + project_name = canonicalize_name(name) + + if project_name in self.requirements: + return self.requirements[project_name] + + raise KeyError(f"No project with the name {name!r}") + + @property + def all_requirements(self) -> List[InstallRequirement]: + return self.unnamed_requirements + list(self.requirements.values()) + + @property + def requirements_to_install(self) -> List[InstallRequirement]: + """Return the list of requirements that need to be installed. + + TODO remove this property together with the legacy resolver, since the new + resolver only returns requirements that need to be installed. + """ + return [ + install_req + for install_req in self.all_requirements + if not install_req.constraint and not install_req.satisfied_by + ] + + def warn_legacy_versions_and_specifiers(self) -> None: + for req in self.requirements_to_install: + version = req.get_dist().version + if isinstance(version, LegacyVersion): + deprecated( + reason=( + f"pip has selected the non standard version {version} " + f"of {req}. In the future this version will be " + f"ignored as it isn't standard compliant." + ), + replacement=( + "set or update constraints to select another version " + "or contact the package author to fix the version number" + ), + issue=12063, + gone_in="24.0", + ) + for dep in req.get_dist().iter_dependencies(): + if any(isinstance(spec, LegacySpecifier) for spec in dep.specifier): + deprecated( + reason=( + f"pip has selected {req} {version} which has non " + f"standard dependency specifier {dep}. " + f"In the future this version of {req} will be " + f"ignored as it isn't standard compliant." + ), + replacement=( + "set or update constraints to select another version " + "or contact the package author to fix the version number" + ), + issue=12063, + gone_in="24.0", + ) diff --git a/shared/package-files/9c/9cd075b86b790db21a7af672a11ce74ff1ef50c1ad60fe7a101d12734b7f130c/blob b/shared/package-files/9c/9cd075b86b790db21a7af672a11ce74ff1ef50c1ad60fe7a101d12734b7f130c/blob new file mode 100644 index 0000000000000000000000000000000000000000..ed1a0ebdf20ea9deb348f24e2b1fbc1d1f5a29bc --- /dev/null +++ b/shared/package-files/9c/9cd075b86b790db21a7af672a11ce74ff1ef50c1ad60fe7a101d12734b7f130c/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor _ctc_loss_backward(const at::Tensor & grad, const at::Tensor & log_probs, const at::Tensor & targets, at::IntArrayRef input_lengths, at::IntArrayRef target_lengths, const at::Tensor & neg_log_likelihood, const at::Tensor & log_alpha, int64_t blank, bool zero_infinity=false); +TORCH_API at::Tensor _ctc_loss_backward(const at::Tensor & grad, const at::Tensor & log_probs, const at::Tensor & targets, const at::Tensor & input_lengths, const at::Tensor & target_lengths, const at::Tensor & neg_log_likelihood, const at::Tensor & log_alpha, int64_t blank, bool zero_infinity=false); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/9c/9cd0fe6540641d67d87afbdb446f987ce48815ccf3fdea7332a58ae4f1fa9ea0/blob b/shared/package-files/9c/9cd0fe6540641d67d87afbdb446f987ce48815ccf3fdea7332a58ae4f1fa9ea0/blob new file mode 100644 index 0000000000000000000000000000000000000000..d87e5fa8ef5f0584f1563e0afd6581f945dea4b7 --- /dev/null +++ b/shared/package-files/9c/9cd0fe6540641d67d87afbdb446f987ce48815ccf3fdea7332a58ae4f1fa9ea0/blob @@ -0,0 +1,123 @@ +# encoding: utf-8 +""" +Utilities for timing code execution. +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import time + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + +# If possible (Unix), use the resource module instead of time.clock() +try: + import resource +except ModuleNotFoundError: + resource = None # type: ignore [assignment] + +# Some implementations (like jyputerlite) don't have getrusage +if resource is not None and hasattr(resource, "getrusage"): + def clocku(): + """clocku() -> floating point number + + Return the *USER* CPU time in seconds since the start of the process. + This is done via a call to resource.getrusage, so it avoids the + wraparound problems in time.clock().""" + + return resource.getrusage(resource.RUSAGE_SELF)[0] + + def clocks(): + """clocks() -> floating point number + + Return the *SYSTEM* CPU time in seconds since the start of the process. + This is done via a call to resource.getrusage, so it avoids the + wraparound problems in time.clock().""" + + return resource.getrusage(resource.RUSAGE_SELF)[1] + + def clock(): + """clock() -> floating point number + + Return the *TOTAL USER+SYSTEM* CPU time in seconds since the start of + the process. This is done via a call to resource.getrusage, so it + avoids the wraparound problems in time.clock().""" + + u,s = resource.getrusage(resource.RUSAGE_SELF)[:2] + return u+s + + def clock2(): + """clock2() -> (t_user,t_system) + + Similar to clock(), but return a tuple of user/system times.""" + return resource.getrusage(resource.RUSAGE_SELF)[:2] + +else: + # There is no distinction of user/system time under windows, so we just use + # time.process_time() for everything... + clocku = clocks = clock = time.process_time + + def clock2(): + """Under windows, system CPU time can't be measured. + + This just returns process_time() and zero.""" + return time.process_time(), 0.0 + + +def timings_out(reps,func,*args,**kw): + """timings_out(reps,func,*args,**kw) -> (t_total,t_per_call,output) + + Execute a function reps times, return a tuple with the elapsed total + CPU time in seconds, the time per call and the function's output. + + Under Unix, the return value is the sum of user+system time consumed by + the process, computed via the resource module. This prevents problems + related to the wraparound effect which the time.clock() function has. + + Under Windows the return value is in wall clock seconds. See the + documentation for the time module for more details.""" + + reps = int(reps) + assert reps >=1, 'reps must be >= 1' + if reps==1: + start = clock() + out = func(*args,**kw) + tot_time = clock()-start + else: + rng = range(reps-1) # the last time is executed separately to store output + start = clock() + for dummy in rng: func(*args,**kw) + out = func(*args,**kw) # one last time + tot_time = clock()-start + av_time = tot_time / reps + return tot_time,av_time,out + + +def timings(reps,func,*args,**kw): + """timings(reps,func,*args,**kw) -> (t_total,t_per_call) + + Execute a function reps times, return a tuple with the elapsed total CPU + time in seconds and the time per call. These are just the first two values + in timings_out().""" + + return timings_out(reps,func,*args,**kw)[0:2] + + +def timing(func,*args,**kw): + """timing(func,*args,**kw) -> t_total + + Execute a function once, return the elapsed total CPU time in + seconds. This is just the first value in timings_out().""" + + return timings_out(1,func,*args,**kw)[0] + diff --git a/shared/package-files/9c/9cd17f07a665e58c66be9a48f1310f386ae80ec6e0c8b4c5ea30667491f6014c/blob b/shared/package-files/9c/9cd17f07a665e58c66be9a48f1310f386ae80ec6e0c8b4c5ea30667491f6014c/blob new file mode 100644 index 0000000000000000000000000000000000000000..9c8d53040380808c03358b905878cc4a8b9b9679 --- /dev/null +++ b/shared/package-files/9c/9cd17f07a665e58c66be9a48f1310f386ae80ec6e0c8b4c5ea30667491f6014c/blob @@ -0,0 +1,310 @@ +import numpy as np +from numpy.testing import assert_allclose, assert_array_less +import pytest + +from scipy import stats +from scipy.stats import sobol_indices +from scipy.stats._resampling import BootstrapResult +from scipy.stats._sensitivity_analysis import ( + BootstrapSobolResult, f_ishigami, sample_AB, sample_A_B +) + + +@pytest.fixture(scope='session') +def ishigami_ref_indices(): + """Reference values for Ishigami from Saltelli2007. + + Chapter 4, exercise 5 pages 179-182. + """ + a = 7. + b = 0.1 + + var = 0.5 + a**2/8 + b*np.pi**4/5 + b**2*np.pi**8/18 + v1 = 0.5 + b*np.pi**4/5 + b**2*np.pi**8/50 + v2 = a**2/8 + v3 = 0 + v12 = 0 + # v13: mistake in the book, see other derivations e.g. in 10.1002/nme.4856 + v13 = b**2*np.pi**8*8/225 + v23 = 0 + + s_first = np.array([v1, v2, v3])/var + s_second = np.array([ + [0., 0., v13], + [v12, 0., v23], + [v13, v23, 0.] + ])/var + s_total = s_first + s_second.sum(axis=1) + + return s_first, s_total + + +def f_ishigami_vec(x): + """Output of shape (2, n).""" + res = f_ishigami(x) + return res, res + + +class TestSobolIndices: + + dists = [ + stats.uniform(loc=-np.pi, scale=2*np.pi) # type: ignore[attr-defined] + ] * 3 + + def test_sample_AB(self): + # (d, n) + A = np.array( + [[1, 4, 7, 10], + [2, 5, 8, 11], + [3, 6, 9, 12]] + ) + B = A + 100 + # (d, d, n) + ref = np.array( + [[[101, 104, 107, 110], + [2, 5, 8, 11], + [3, 6, 9, 12]], + [[1, 4, 7, 10], + [102, 105, 108, 111], + [3, 6, 9, 12]], + [[1, 4, 7, 10], + [2, 5, 8, 11], + [103, 106, 109, 112]]] + ) + AB = sample_AB(A=A, B=B) + assert_allclose(AB, ref) + + @pytest.mark.xslow + @pytest.mark.xfail_on_32bit("Can't create large array for test") + @pytest.mark.parametrize( + 'func', + [f_ishigami, pytest.param(f_ishigami_vec, marks=pytest.mark.slow)], + ids=['scalar', 'vector'] + ) + def test_ishigami(self, ishigami_ref_indices, func): + rng = np.random.default_rng(28631265345463262246170309650372465332) + res = sobol_indices( + func=func, n=4096, + dists=self.dists, + rng=rng + ) + + if func.__name__ == 'f_ishigami_vec': + ishigami_ref_indices = [ + [ishigami_ref_indices[0], ishigami_ref_indices[0]], + [ishigami_ref_indices[1], ishigami_ref_indices[1]] + ] + + assert_allclose(res.first_order, ishigami_ref_indices[0], atol=1e-2) + assert_allclose(res.total_order, ishigami_ref_indices[1], atol=1e-2) + + assert res._bootstrap_result is None + bootstrap_res = res.bootstrap(n_resamples=99) + assert isinstance(bootstrap_res, BootstrapSobolResult) + assert isinstance(res._bootstrap_result, BootstrapResult) + + assert res._bootstrap_result.confidence_interval.low.shape[0] == 2 + assert res._bootstrap_result.confidence_interval.low[1].shape \ + == res.first_order.shape + + assert bootstrap_res.first_order.confidence_interval.low.shape \ + == res.first_order.shape + assert bootstrap_res.total_order.confidence_interval.low.shape \ + == res.total_order.shape + + assert_array_less( + bootstrap_res.first_order.confidence_interval.low, res.first_order + ) + assert_array_less( + res.first_order, bootstrap_res.first_order.confidence_interval.high + ) + assert_array_less( + bootstrap_res.total_order.confidence_interval.low, res.total_order + ) + assert_array_less( + res.total_order, bootstrap_res.total_order.confidence_interval.high + ) + + # call again to use previous results and change a param + assert isinstance( + res.bootstrap(confidence_level=0.9, n_resamples=99), + BootstrapSobolResult + ) + assert isinstance(res._bootstrap_result, BootstrapResult) + + def test_func_dict(self, ishigami_ref_indices): + rng = np.random.default_rng(28631265345463262246170309650372465332) + n = 4096 + dists = [ + stats.uniform(loc=-np.pi, scale=2*np.pi), + stats.uniform(loc=-np.pi, scale=2*np.pi), + stats.uniform(loc=-np.pi, scale=2*np.pi) + ] + + A, B = sample_A_B(n=n, dists=dists, rng=rng) + AB = sample_AB(A=A, B=B) + + func = { + 'f_A': f_ishigami(A).reshape(1, -1), + 'f_B': f_ishigami(B).reshape(1, -1), + 'f_AB': f_ishigami(AB).reshape((3, 1, -1)) + } + + # preserve use of old random_state during SPEC 7 transition + res = sobol_indices( + func=func, n=n, + dists=dists, + rng=rng + ) + assert_allclose(res.first_order, ishigami_ref_indices[0], atol=1e-2) + + res = sobol_indices( + func=func, n=n, + rng=rng + ) + assert_allclose(res.first_order, ishigami_ref_indices[0], atol=1e-2) + # Ideally should be exactly equal but since f_ishigami + # uses floating point operations, so exact equality + # might not be possible (due to flakiness in computation). + # So, assert_allclose is used with default parameters + # Regression test for https://github.com/scipy/scipy/issues/21383 + assert_allclose(f_ishigami(A).reshape(1, -1), func['f_A']) + assert_allclose(f_ishigami(B).reshape(1, -1), func['f_B']) + assert_allclose(f_ishigami(AB).reshape((3, 1, -1)), func['f_AB']) + + def test_method(self, ishigami_ref_indices): + def jansen_sobol(f_A, f_B, f_AB): + """Jansen for S and Sobol' for St. + + From Saltelli2010, table 2 formulations (c) and (e).""" + var = np.var([f_A, f_B], axis=(0, -1)) + + s = (var - 0.5*np.mean((f_B - f_AB)**2, axis=-1)) / var + st = np.mean(f_A*(f_A - f_AB), axis=-1) / var + + return s.T, st.T + + rng = np.random.default_rng(28631265345463262246170309650372465332) + res = sobol_indices( + func=f_ishigami, n=4096, + dists=self.dists, + method=jansen_sobol, + rng=rng + ) + + assert_allclose(res.first_order, ishigami_ref_indices[0], atol=1e-2) + assert_allclose(res.total_order, ishigami_ref_indices[1], atol=1e-2) + + def jansen_sobol_typed( + f_A: np.ndarray, f_B: np.ndarray, f_AB: np.ndarray + ) -> tuple[np.ndarray, np.ndarray]: + return jansen_sobol(f_A, f_B, f_AB) + + _ = sobol_indices( + func=f_ishigami, n=8, + dists=self.dists, + method=jansen_sobol_typed, + rng=rng + ) + + def test_normalization(self, ishigami_ref_indices): + rng = np.random.default_rng(28631265345463262246170309650372465332) + res = sobol_indices( + func=lambda x: f_ishigami(x) + 1000, n=4096, + dists=self.dists, + rng=rng + ) + + assert_allclose(res.first_order, ishigami_ref_indices[0], atol=1e-2) + assert_allclose(res.total_order, ishigami_ref_indices[1], atol=1e-2) + + def test_constant_function(self, ishigami_ref_indices): + + def f_ishigami_vec_const(x): + """Output of shape (3, n).""" + res = f_ishigami(x) + return res, res * 0 + 10, res + + rng = np.random.default_rng(28631265345463262246170309650372465332) + res = sobol_indices( + func=f_ishigami_vec_const, n=4096, + dists=self.dists, + rng=rng + ) + + ishigami_vec_indices = [ + [ishigami_ref_indices[0], [0, 0, 0], ishigami_ref_indices[0]], + [ishigami_ref_indices[1], [0, 0, 0], ishigami_ref_indices[1]] + ] + + assert_allclose(res.first_order, ishigami_vec_indices[0], atol=1e-2) + assert_allclose(res.total_order, ishigami_vec_indices[1], atol=1e-2) + + @pytest.mark.xfail_on_32bit("Can't create large array for test") + def test_more_converged(self, ishigami_ref_indices): + rng = np.random.default_rng(28631265345463262246170309650372465332) + res = sobol_indices( + func=f_ishigami, n=2**19, # 524288 + dists=self.dists, + rng=rng + ) + + assert_allclose(res.first_order, ishigami_ref_indices[0], atol=1e-4) + assert_allclose(res.total_order, ishigami_ref_indices[1], atol=1e-4) + + def test_raises(self): + + message = r"Each distribution in `dists` must have method `ppf`" + with pytest.raises(ValueError, match=message): + sobol_indices(n=0, func=f_ishigami, dists="uniform") + + with pytest.raises(ValueError, match=message): + sobol_indices(n=0, func=f_ishigami, dists=[lambda x: x]) + + message = r"The balance properties of Sobol'" + with pytest.raises(ValueError, match=message): + sobol_indices(n=7, func=f_ishigami, dists=[stats.uniform()]) + + with pytest.raises(ValueError, match=message): + sobol_indices(n=4.1, func=f_ishigami, dists=[stats.uniform()]) + + message = r"'toto' is not a valid 'method'" + with pytest.raises(ValueError, match=message): + sobol_indices(n=0, func=f_ishigami, method='toto') + + message = r"must have the following signature" + with pytest.raises(ValueError, match=message): + sobol_indices(n=0, func=f_ishigami, method=lambda x: x) + + message = r"'dists' must be defined when 'func' is a callable" + with pytest.raises(ValueError, match=message): + sobol_indices(n=0, func=f_ishigami) + + def func_wrong_shape_output(x): + return x.reshape(-1, 1) + + message = r"'func' output should have a shape" + with pytest.raises(ValueError, match=message): + sobol_indices( + n=2, func=func_wrong_shape_output, dists=[stats.uniform()] + ) + + message = r"When 'func' is a dictionary" + with pytest.raises(ValueError, match=message): + sobol_indices( + n=2, func={'f_A': [], 'f_AB': []}, dists=[stats.uniform()] + ) + + with pytest.raises(ValueError, match=message): + # f_B malformed + sobol_indices( + n=2, + func={'f_A': [1, 2], 'f_B': [3], 'f_AB': [5, 6, 7, 8]}, + ) + + with pytest.raises(ValueError, match=message): + # f_AB malformed + sobol_indices( + n=2, + func={'f_A': [1, 2], 'f_B': [3, 4], 'f_AB': [5, 6, 7]}, + ) diff --git a/shared/package-files/9c/9cd54ec24cbdbec5e4fe543dda8ca95390678d432d33201fa1c32b61f8fe225a/blob b/shared/package-files/9c/9cd54ec24cbdbec5e4fe543dda8ca95390678d432d33201fa1c32b61f8fe225a/blob new file mode 100644 index 0000000000000000000000000000000000000000..4b19670fc6dc2c3a4412fa8f49b2de77347b5cc3 --- /dev/null +++ b/shared/package-files/9c/9cd54ec24cbdbec5e4fe543dda8ca95390678d432d33201fa1c32b61f8fe225a/blob @@ -0,0 +1,7 @@ +# created by tools/loadICU.tcl -- do not edit +namespace eval ::tcl::clock { + ::msgcat::mcset nl_BE DATE_FORMAT "%d-%m-%y" + ::msgcat::mcset nl_BE TIME_FORMAT "%T" + ::msgcat::mcset nl_BE TIME_FORMAT_12 "%T" + ::msgcat::mcset nl_BE DATE_TIME_FORMAT "%a %d %b %Y %T %z" +} diff --git a/shared/package-files/9c/9cd671c66a0941e8a4c49bf15ad6696523bb1d4e6a3c2b324db371eca580bc99/blob b/shared/package-files/9c/9cd671c66a0941e8a4c49bf15ad6696523bb1d4e6a3c2b324db371eca580bc99/blob new file mode 100644 index 0000000000000000000000000000000000000000..6468b6532937471b856b263df4f6264408c41894 --- /dev/null +++ b/shared/package-files/9c/9cd671c66a0941e8a4c49bf15ad6696523bb1d4e6a3c2b324db371eca580bc99/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor rrelu(const at::Tensor & self, const at::Scalar & lower=0.125, const at::Scalar & upper=0.3333333333333333, bool training=false, c10::optional generator=c10::nullopt); +TORCH_API at::Tensor & rrelu_(at::Tensor & self, const at::Scalar & lower=0.125, const at::Scalar & upper=0.3333333333333333, bool training=false, c10::optional generator=c10::nullopt); +} // namespace native +} // namespace at diff --git a/shared/package-files/9c/9cd80df8b49367c552d52fbcefef42a4b62312269fb7103acad4e074939416ee/blob b/shared/package-files/9c/9cd80df8b49367c552d52fbcefef42a4b62312269fb7103acad4e074939416ee/blob new file mode 100644 index 0000000000000000000000000000000000000000..92abb2fec268db7a38d1d36e608a8ed0d59ee8f0 Binary files /dev/null and b/shared/package-files/9c/9cd80df8b49367c552d52fbcefef42a4b62312269fb7103acad4e074939416ee/blob differ diff --git a/shared/package-files/9c/9cd8c3073f466736b26d3449f0c6c15c0f80324f339818a87a7b026847a7a0dd/blob b/shared/package-files/9c/9cd8c3073f466736b26d3449f0c6c15c0f80324f339818a87a7b026847a7a0dd/blob new file mode 100644 index 0000000000000000000000000000000000000000..126d26818c83b9ebad0f72293f84d5e638e03601 --- /dev/null +++ b/shared/package-files/9c/9cd8c3073f466736b26d3449f0c6c15c0f80324f339818a87a7b026847a7a0dd/blob @@ -0,0 +1,614 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunctions_inl.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +#if defined(AT_PER_OPERATOR_HEADERS) && defined(TORCH_ASSERT_ONLY_METHOD_OPERATORS) +#error This change adds a dependency on all pytorch operators, meaning the \ + file will need to be re-compiled every time an operator is changed or added. \ + Consider including a specific operator from \ + . \ + See NOTE [TORCH_ASSERT_ONLY_METHOD_OPERATORS]. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + diff --git a/shared/package-files/9c/9ce170662f7c8b5f94bcff5a950fada9c6b6180ebc029e5af0a05bfa5ffde772/blob b/shared/package-files/9c/9ce170662f7c8b5f94bcff5a950fada9c6b6180ebc029e5af0a05bfa5ffde772/blob new file mode 100644 index 0000000000000000000000000000000000000000..9e084b04489c48e964a4b57ca9f25fbf7f1b058c --- /dev/null +++ b/shared/package-files/9c/9ce170662f7c8b5f94bcff5a950fada9c6b6180ebc029e5af0a05bfa5ffde772/blob @@ -0,0 +1,48 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +""" +Global flags for aot autograd +""" +import os +import sys +from typing import TYPE_CHECKING + +# Converts torch rng ops to their functional philox rng equivalents. Note that +# we functionalize only CUDA rng ops today. +functionalize_rng_ops = False + +# can be useful for debugging if we are incorrectly creating meta fake tensors +fake_tensor_allow_meta = os.environ.get("FAKE_ALLOW_META", True) + +# Enables optional asserts in hotpath code to check for errors. If +# you are seeing weird accuracy problems, try turning this on. +# This is currently off by default as it will harm tracing time, +# but it is on by default for aot_eager. +debug_assert = False + +debug_partitioner = os.environ.get("AOT_PARTITIONER_DEBUG", False) + +static_weight_shapes = True + +# Applies CSE to the graph before partitioning +cse = True + +# Restricts the amount of computation AOTAutograd can do. +max_dist_from_bw = 3 + +# Enable aggressive_recomputation in the min-cut algorithm in partitioners to reduce +# memory usage with some penalty of performance. It allows more ops to be considered +# as recomputable except random ops and compute-intensive ops. +aggressive_recomputation = False + +if TYPE_CHECKING: + from torch.utils._config_typing import * # noqa: F401, F403 + +from torch.utils._config_module import install_config_module + +# adds patch, save_config, invalid config checks, etc +install_config_module(sys.modules[__name__]) diff --git a/shared/package-files/9c/9ce352ef392c1874eb6c4263ef72d84595bdeb83a7710ba3fd5e9f363a43a10d/blob b/shared/package-files/9c/9ce352ef392c1874eb6c4263ef72d84595bdeb83a7710ba3fd5e9f363a43a10d/blob new file mode 100644 index 0000000000000000000000000000000000000000..95e055cb55d19335fa96f1a8d81fb5620f790771 Binary files /dev/null and b/shared/package-files/9c/9ce352ef392c1874eb6c4263ef72d84595bdeb83a7710ba3fd5e9f363a43a10d/blob differ diff --git a/shared/package-files/9c/9ce42e3270eec6cfae871660d6018fd49a19db57abbc1496bf0136237e37b786/blob b/shared/package-files/9c/9ce42e3270eec6cfae871660d6018fd49a19db57abbc1496bf0136237e37b786/blob new file mode 100644 index 0000000000000000000000000000000000000000..55446063ff3060b3092fb0c906ec2d3137afec74 Binary files /dev/null and b/shared/package-files/9c/9ce42e3270eec6cfae871660d6018fd49a19db57abbc1496bf0136237e37b786/blob differ diff --git a/shared/package-files/9c/9ce635a4788b380d118ad5bafbab2da3cdcc9a480b2f035e6abe1e97f390c8ed/blob b/shared/package-files/9c/9ce635a4788b380d118ad5bafbab2da3cdcc9a480b2f035e6abe1e97f390c8ed/blob new file mode 100644 index 0000000000000000000000000000000000000000..cbc76a31f8ceecc7a8a187e342786bd759cde090 --- /dev/null +++ b/shared/package-files/9c/9ce635a4788b380d118ad5bafbab2da3cdcc9a480b2f035e6abe1e97f390c8ed/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & mkldnn_linear_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias={}); +TORCH_API at::Tensor & mkldnn_linear_outf(const at::Tensor & self, const at::Tensor & weight, const c10::optional & bias, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9c/9ce73744038fb2602d0c25770bfb4f26f5e8da93cf94472646eb8f816e26419b/blob b/shared/package-files/9c/9ce73744038fb2602d0c25770bfb4f26f5e8da93cf94472646eb8f816e26419b/blob new file mode 100644 index 0000000000000000000000000000000000000000..38cece7da3308d6ec4b484238d702cf298ebcca0 --- /dev/null +++ b/shared/package-files/9c/9ce73744038fb2602d0c25770bfb4f26f5e8da93cf94472646eb8f816e26419b/blob @@ -0,0 +1,172 @@ +import warnings + +import numpy as np +import pytest + +from pandas.compat.numpy import np_version_gt2 + +from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike +from pandas.core.dtypes.common import is_extension_array_dtype +from pandas.core.dtypes.dtypes import ExtensionDtype + +import pandas as pd +import pandas._testing as tm + + +class BaseInterfaceTests: + """Tests that the basic interface is satisfied.""" + + # ------------------------------------------------------------------------ + # Interface + # ------------------------------------------------------------------------ + + def test_len(self, data): + assert len(data) == 100 + + def test_size(self, data): + assert data.size == 100 + + def test_ndim(self, data): + assert data.ndim == 1 + + def test_can_hold_na_valid(self, data): + # GH-20761 + assert data._can_hold_na is True + + def test_contains(self, data, data_missing): + # GH-37867 + # Tests for membership checks. Membership checks for nan-likes is tricky and + # the settled on rule is: `nan_like in arr` is True if nan_like is + # arr.dtype.na_value and arr.isna().any() is True. Else the check returns False. + + na_value = data.dtype.na_value + # ensure data without missing values + data = data[~data.isna()] + + # first elements are non-missing + assert data[0] in data + assert data_missing[0] in data_missing + + # check the presence of na_value + assert na_value in data_missing + assert na_value not in data + + # the data can never contain other nan-likes than na_value + for na_value_obj in tm.NULL_OBJECTS: + if na_value_obj is na_value or type(na_value_obj) == type(na_value): + # type check for e.g. two instances of Decimal("NAN") + continue + assert na_value_obj not in data + assert na_value_obj not in data_missing + + def test_memory_usage(self, data): + s = pd.Series(data) + result = s.memory_usage(index=False) + assert result == s.nbytes + + def test_array_interface(self, data): + result = np.array(data) + assert result[0] == data[0] + + result = np.array(data, dtype=object) + expected = np.array(list(data), dtype=object) + if expected.ndim > 1: + # nested data, explicitly construct as 1D + expected = construct_1d_object_array_from_listlike(list(data)) + tm.assert_numpy_array_equal(result, expected) + + def test_array_interface_copy(self, data): + result_copy1 = np.array(data, copy=True) + result_copy2 = np.array(data, copy=True) + assert not np.may_share_memory(result_copy1, result_copy2) + + if not np_version_gt2: + # copy=False semantics are only supported in NumPy>=2. + return + + warning_raised = False + msg = "Starting with NumPy 2.0, the behavior of the 'copy' keyword has changed" + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + result_nocopy1 = np.array(data, copy=False) + assert len(w) <= 1 + if len(w): + warning_raised = True + assert msg in str(w[0].message) + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + result_nocopy2 = np.array(data, copy=False) + assert len(w) <= 1 + if len(w): + warning_raised = True + assert msg in str(w[0].message) + + if not warning_raised: + # If copy=False was given and did not raise, these must share the same data + assert np.may_share_memory(result_nocopy1, result_nocopy2) + + def test_is_extension_array_dtype(self, data): + assert is_extension_array_dtype(data) + assert is_extension_array_dtype(data.dtype) + assert is_extension_array_dtype(pd.Series(data)) + assert isinstance(data.dtype, ExtensionDtype) + + def test_no_values_attribute(self, data): + # GH-20735: EA's with .values attribute give problems with internal + # code, disallowing this for now until solved + assert not hasattr(data, "values") + assert not hasattr(data, "_values") + + def test_is_numeric_honored(self, data): + result = pd.Series(data) + if hasattr(result._mgr, "blocks"): + assert result._mgr.blocks[0].is_numeric is data.dtype._is_numeric + + def test_isna_extension_array(self, data_missing): + # If your `isna` returns an ExtensionArray, you must also implement + # _reduce. At the *very* least, you must implement any and all + na = data_missing.isna() + if is_extension_array_dtype(na): + assert na._reduce("any") + assert na.any() + + assert not na._reduce("all") + assert not na.all() + + assert na.dtype._is_boolean + + def test_copy(self, data): + # GH#27083 removing deep keyword from EA.copy + assert data[0] != data[1] + result = data.copy() + + if data.dtype._is_immutable: + pytest.skip(f"test_copy assumes mutability and {data.dtype} is immutable") + + data[1] = data[0] + assert result[1] != result[0] + + def test_view(self, data): + # view with no dtype should return a shallow copy, *not* the same + # object + assert data[1] != data[0] + + result = data.view() + assert result is not data + assert type(result) == type(data) + + if data.dtype._is_immutable: + pytest.skip(f"test_view assumes mutability and {data.dtype} is immutable") + + result[1] = result[0] + assert data[1] == data[0] + + # check specifically that the `dtype` kwarg is accepted + data.view(dtype=None) + + def test_tolist(self, data): + result = data.tolist() + expected = list(data) + assert isinstance(result, list) + assert result == expected diff --git a/shared/package-files/9c/9ce8c52970aa60dbb63bb4b37354c3d71d5bb147213d1006de71a534611dd588/blob b/shared/package-files/9c/9ce8c52970aa60dbb63bb4b37354c3d71d5bb147213d1006de71a534611dd588/blob new file mode 100644 index 0000000000000000000000000000000000000000..30cc61b1ee651ca032e165cd67926fa33c71354f --- /dev/null +++ b/shared/package-files/9c/9ce8c52970aa60dbb63bb4b37354c3d71d5bb147213d1006de71a534611dd588/blob @@ -0,0 +1,63 @@ +from sympy.core.symbol import Symbol +from sympy.matrices.expressions.matexpr import MatrixSymbol +from sympy.tensor.array.arrayop import (permutedims, tensorcontraction, tensordiagonal, tensorproduct) +from sympy.tensor.array.dense_ndim_array import ImmutableDenseNDimArray +from sympy.tensor.array.expressions.array_expressions import ZeroArray, OneArray, ArraySymbol, \ + ArrayTensorProduct, PermuteDims, ArrayDiagonal, ArrayContraction, ArrayAdd +from sympy.testing.pytest import raises + + +def test_array_as_explicit_call(): + + assert ZeroArray(3, 2, 4).as_explicit() == ImmutableDenseNDimArray.zeros(3, 2, 4) + assert OneArray(3, 2, 4).as_explicit() == ImmutableDenseNDimArray([1 for i in range(3*2*4)]).reshape(3, 2, 4) + + k = Symbol("k") + X = ArraySymbol("X", (k, 3, 2)) + raises(ValueError, lambda: X.as_explicit()) + raises(ValueError, lambda: ZeroArray(k, 2, 3).as_explicit()) + raises(ValueError, lambda: OneArray(2, k, 2).as_explicit()) + + A = ArraySymbol("A", (3, 3)) + B = ArraySymbol("B", (3, 3)) + + texpr = tensorproduct(A, B) + assert isinstance(texpr, ArrayTensorProduct) + assert texpr.as_explicit() == tensorproduct(A.as_explicit(), B.as_explicit()) + + texpr = tensorcontraction(A, (0, 1)) + assert isinstance(texpr, ArrayContraction) + assert texpr.as_explicit() == A[0, 0] + A[1, 1] + A[2, 2] + + texpr = tensordiagonal(A, (0, 1)) + assert isinstance(texpr, ArrayDiagonal) + assert texpr.as_explicit() == ImmutableDenseNDimArray([A[0, 0], A[1, 1], A[2, 2]]) + + texpr = permutedims(A, [1, 0]) + assert isinstance(texpr, PermuteDims) + assert texpr.as_explicit() == permutedims(A.as_explicit(), [1, 0]) + + +def test_array_as_explicit_matrix_symbol(): + + A = MatrixSymbol("A", 3, 3) + B = MatrixSymbol("B", 3, 3) + + texpr = tensorproduct(A, B) + assert isinstance(texpr, ArrayTensorProduct) + assert texpr.as_explicit() == tensorproduct(A.as_explicit(), B.as_explicit()) + + texpr = tensorcontraction(A, (0, 1)) + assert isinstance(texpr, ArrayContraction) + assert texpr.as_explicit() == A[0, 0] + A[1, 1] + A[2, 2] + + texpr = tensordiagonal(A, (0, 1)) + assert isinstance(texpr, ArrayDiagonal) + assert texpr.as_explicit() == ImmutableDenseNDimArray([A[0, 0], A[1, 1], A[2, 2]]) + + texpr = permutedims(A, [1, 0]) + assert isinstance(texpr, PermuteDims) + assert texpr.as_explicit() == permutedims(A.as_explicit(), [1, 0]) + + expr = ArrayAdd(ArrayTensorProduct(A, B), ArrayTensorProduct(B, A)) + assert expr.as_explicit() == expr.args[0].as_explicit() + expr.args[1].as_explicit() diff --git a/shared/package-files/9c/9cefb79bbb5bff2b635f1d19f12a8190f4809cf543cff3cbdebd9fcd6b44edf8/blob b/shared/package-files/9c/9cefb79bbb5bff2b635f1d19f12a8190f4809cf543cff3cbdebd9fcd6b44edf8/blob new file mode 100644 index 0000000000000000000000000000000000000000..376b51dd98bb1b1c7c6c8a67914bc72f6c6c588d --- /dev/null +++ b/shared/package-files/9c/9cefb79bbb5bff2b635f1d19f12a8190f4809cf543cff3cbdebd9fcd6b44edf8/blob @@ -0,0 +1,168 @@ +from datetime import ( + datetime, + timedelta, +) + +import numpy as np +import pytest + +import pandas._testing as tm +from pandas.core.indexes.api import ( + Index, + RangeIndex, +) + + +@pytest.fixture +def index_large(): + # large values used in TestUInt64Index where no compat needed with int64/float64 + large = [2**63, 2**63 + 10, 2**63 + 15, 2**63 + 20, 2**63 + 25] + return Index(large, dtype=np.uint64) + + +class TestSetOps: + @pytest.mark.parametrize("dtype", ["f8", "u8", "i8"]) + def test_union_non_numeric(self, dtype): + # corner case, non-numeric + index = Index(np.arange(5, dtype=dtype), dtype=dtype) + assert index.dtype == dtype + + other = Index([datetime.now() + timedelta(i) for i in range(4)], dtype=object) + result = index.union(other) + expected = Index(np.concatenate((index, other))) + tm.assert_index_equal(result, expected) + + result = other.union(index) + expected = Index(np.concatenate((other, index))) + tm.assert_index_equal(result, expected) + + def test_intersection(self): + index = Index(range(5), dtype=np.int64) + + other = Index([1, 2, 3, 4, 5]) + result = index.intersection(other) + expected = Index(np.sort(np.intersect1d(index.values, other.values))) + tm.assert_index_equal(result, expected) + + result = other.intersection(index) + expected = Index( + np.sort(np.asarray(np.intersect1d(index.values, other.values))) + ) + tm.assert_index_equal(result, expected) + + @pytest.mark.parametrize("dtype", ["int64", "uint64"]) + def test_int_float_union_dtype(self, dtype): + # https://github.com/pandas-dev/pandas/issues/26778 + # [u]int | float -> float + index = Index([0, 2, 3], dtype=dtype) + other = Index([0.5, 1.5], dtype=np.float64) + expected = Index([0.0, 0.5, 1.5, 2.0, 3.0], dtype=np.float64) + result = index.union(other) + tm.assert_index_equal(result, expected) + + result = other.union(index) + tm.assert_index_equal(result, expected) + + def test_range_float_union_dtype(self): + # https://github.com/pandas-dev/pandas/issues/26778 + index = RangeIndex(start=0, stop=3) + other = Index([0.5, 1.5], dtype=np.float64) + result = index.union(other) + expected = Index([0.0, 0.5, 1, 1.5, 2.0], dtype=np.float64) + tm.assert_index_equal(result, expected) + + result = other.union(index) + tm.assert_index_equal(result, expected) + + def test_range_uint64_union_dtype(self): + # https://github.com/pandas-dev/pandas/issues/26778 + index = RangeIndex(start=0, stop=3) + other = Index([0, 10], dtype=np.uint64) + result = index.union(other) + expected = Index([0, 1, 2, 10], dtype=object) + tm.assert_index_equal(result, expected) + + result = other.union(index) + tm.assert_index_equal(result, expected) + + def test_float64_index_difference(self): + # https://github.com/pandas-dev/pandas/issues/35217 + float_index = Index([1.0, 2, 3]) + string_index = Index(["1", "2", "3"]) + + result = float_index.difference(string_index) + tm.assert_index_equal(result, float_index) + + result = string_index.difference(float_index) + tm.assert_index_equal(result, string_index) + + def test_intersection_uint64_outside_int64_range(self, index_large): + other = Index([2**63, 2**63 + 5, 2**63 + 10, 2**63 + 15, 2**63 + 20]) + result = index_large.intersection(other) + expected = Index(np.sort(np.intersect1d(index_large.values, other.values))) + tm.assert_index_equal(result, expected) + + result = other.intersection(index_large) + expected = Index( + np.sort(np.asarray(np.intersect1d(index_large.values, other.values))) + ) + tm.assert_index_equal(result, expected) + + @pytest.mark.parametrize( + "index2,keeps_name", + [ + (Index([4, 7, 6, 5, 3], name="index"), True), + (Index([4, 7, 6, 5, 3], name="other"), False), + ], + ) + def test_intersection_monotonic(self, index2, keeps_name, sort): + index1 = Index([5, 3, 2, 4, 1], name="index") + expected = Index([5, 3, 4]) + + if keeps_name: + expected.name = "index" + + result = index1.intersection(index2, sort=sort) + if sort is None: + expected = expected.sort_values() + tm.assert_index_equal(result, expected) + + def test_symmetric_difference(self, sort): + # smoke + index1 = Index([5, 2, 3, 4], name="index1") + index2 = Index([2, 3, 4, 1]) + result = index1.symmetric_difference(index2, sort=sort) + expected = Index([5, 1]) + if sort is not None: + tm.assert_index_equal(result, expected) + else: + tm.assert_index_equal(result, expected.sort_values()) + assert result.name is None + if sort is None: + expected = expected.sort_values() + tm.assert_index_equal(result, expected) + + +class TestSetOpsSort: + @pytest.mark.parametrize("slice_", [slice(None), slice(0)]) + def test_union_sort_other_special(self, slice_): + # https://github.com/pandas-dev/pandas/issues/24959 + + idx = Index([1, 0, 2]) + # default, sort=None + other = idx[slice_] + tm.assert_index_equal(idx.union(other), idx) + tm.assert_index_equal(other.union(idx), idx) + + # sort=False + tm.assert_index_equal(idx.union(other, sort=False), idx) + + @pytest.mark.parametrize("slice_", [slice(None), slice(0)]) + def test_union_sort_special_true(self, slice_): + idx = Index([1, 0, 2]) + # default, sort=None + other = idx[slice_] + + result = idx.union(other, sort=True) + expected = Index([0, 1, 2]) + tm.assert_index_equal(result, expected) diff --git a/shared/package-files/9c/9cf1f45f9ed1629b00911a305698d0887139eba4e1513c7b617aec69d9ab9879/blob b/shared/package-files/9c/9cf1f45f9ed1629b00911a305698d0887139eba4e1513c7b617aec69d9ab9879/blob new file mode 100644 index 0000000000000000000000000000000000000000..9c03508bc89bf087e24c684802eeec344d76bb9e --- /dev/null +++ b/shared/package-files/9c/9cf1f45f9ed1629b00911a305698d0887139eba4e1513c7b617aec69d9ab9879/blob @@ -0,0 +1,18 @@ +# This file is dual licensed under the terms of the Apache License, Version +# 2.0, and the BSD License. See the LICENSE file in the root of this repository +# for complete details. + +import typing + +from cryptography.hazmat.primitives import ciphers + +class CMAC: + def __init__( + self, + algorithm: ciphers.BlockCipherAlgorithm, + backend: typing.Any = None, + ) -> None: ... + def update(self, data: bytes) -> None: ... + def finalize(self) -> bytes: ... + def verify(self, signature: bytes) -> None: ... + def copy(self) -> CMAC: ... diff --git a/shared/package-files/9c/9cf2fad80a87a684ad8779790cd0e5d84c9b478f1bba6932326ca2adec78eff0/blob b/shared/package-files/9c/9cf2fad80a87a684ad8779790cd0e5d84c9b478f1bba6932326ca2adec78eff0/blob new file mode 100644 index 0000000000000000000000000000000000000000..fe1706a296e431a9080b684c48cf976261e62583 --- /dev/null +++ b/shared/package-files/9c/9cf2fad80a87a684ad8779790cd0e5d84c9b478f1bba6932326ca2adec78eff0/blob @@ -0,0 +1,14 @@ +from .base import FormulaMaterializer +from .narwhals import NarwhalsMaterializer +from .pandas import PandasMaterializer +from .types import ClusterBy, FactorValues, NAAction + +__all__ = [ + "FormulaMaterializer", + "NarwhalsMaterializer", + "PandasMaterializer", + # Useful types + "ClusterBy", + "FactorValues", + "NAAction", +] diff --git a/shared/package-files/9c/9cf4734decff5b2dd85f2df364d24d3ccb29033c5b2ce76886a857c28bb030b3/blob b/shared/package-files/9c/9cf4734decff5b2dd85f2df364d24d3ccb29033c5b2ce76886a857c28bb030b3/blob new file mode 100644 index 0000000000000000000000000000000000000000..4fa051c1d2e0a6695f1c410e00169808e44dd44c --- /dev/null +++ b/shared/package-files/9c/9cf4734decff5b2dd85f2df364d24d3ccb29033c5b2ce76886a857c28bb030b3/blob @@ -0,0 +1,314 @@ + +/* These pointers will be stored in the C-object for use in other + extension modules +*/ + +void *PyArray_API[] = { + (void *) PyArray_GetNDArrayCVersion, + (void *) &PyBigArray_Type, + (void *) &PyArray_Type, + (void *) &PyArrayDescr_Type, + (void *) &PyArrayFlags_Type, + (void *) &PyArrayIter_Type, + (void *) &PyArrayMultiIter_Type, + (int *) &NPY_NUMUSERTYPES, + (void *) &PyBoolArrType_Type, + (void *) &_PyArrayScalar_BoolValues, + (void *) &PyGenericArrType_Type, + (void *) &PyNumberArrType_Type, + (void *) &PyIntegerArrType_Type, + (void *) &PySignedIntegerArrType_Type, + (void *) &PyUnsignedIntegerArrType_Type, + (void *) &PyInexactArrType_Type, + (void *) &PyFloatingArrType_Type, + (void *) &PyComplexFloatingArrType_Type, + (void *) &PyFlexibleArrType_Type, + (void *) &PyCharacterArrType_Type, + (void *) &PyByteArrType_Type, + (void *) &PyShortArrType_Type, + (void *) &PyIntArrType_Type, + (void *) &PyLongArrType_Type, + (void *) &PyLongLongArrType_Type, + (void *) &PyUByteArrType_Type, + (void *) &PyUShortArrType_Type, + (void *) &PyUIntArrType_Type, + (void *) &PyULongArrType_Type, + (void *) &PyULongLongArrType_Type, + (void *) &PyFloatArrType_Type, + (void *) &PyDoubleArrType_Type, + (void *) &PyLongDoubleArrType_Type, + (void *) &PyCFloatArrType_Type, + (void *) &PyCDoubleArrType_Type, + (void *) &PyCLongDoubleArrType_Type, + (void *) &PyObjectArrType_Type, + (void *) &PyStringArrType_Type, + (void *) &PyUnicodeArrType_Type, + (void *) &PyVoidArrType_Type, + (void *) PyArray_SetNumericOps, + (void *) PyArray_GetNumericOps, + (void *) PyArray_INCREF, + (void *) PyArray_XDECREF, + (void *) PyArray_SetStringFunction, + (void *) PyArray_DescrFromType, + (void *) PyArray_TypeObjectFromType, + (void *) PyArray_Zero, + (void *) PyArray_One, + (void *) PyArray_CastToType, + (void *) PyArray_CastTo, + (void *) PyArray_CastAnyTo, + (void *) PyArray_CanCastSafely, + (void *) PyArray_CanCastTo, + (void *) PyArray_ObjectType, + (void *) PyArray_DescrFromObject, + (void *) PyArray_ConvertToCommonType, + (void *) PyArray_DescrFromScalar, + (void *) PyArray_DescrFromTypeObject, + (void *) PyArray_Size, + (void *) PyArray_Scalar, + (void *) PyArray_FromScalar, + (void *) PyArray_ScalarAsCtype, + (void *) PyArray_CastScalarToCtype, + (void *) PyArray_CastScalarDirect, + (void *) PyArray_ScalarFromObject, + (void *) PyArray_GetCastFunc, + (void *) PyArray_FromDims, + (void *) PyArray_FromDimsAndDataAndDescr, + (void *) PyArray_FromAny, + (void *) PyArray_EnsureArray, + (void *) PyArray_EnsureAnyArray, + (void *) PyArray_FromFile, + (void *) PyArray_FromString, + (void *) PyArray_FromBuffer, + (void *) PyArray_FromIter, + (void *) PyArray_Return, + (void *) PyArray_GetField, + (void *) PyArray_SetField, + (void *) PyArray_Byteswap, + (void *) PyArray_Resize, + (void *) PyArray_MoveInto, + (void *) PyArray_CopyInto, + (void *) PyArray_CopyAnyInto, + (void *) PyArray_CopyObject, + (void *) PyArray_NewCopy, + (void *) PyArray_ToList, + (void *) PyArray_ToString, + (void *) PyArray_ToFile, + (void *) PyArray_Dump, + (void *) PyArray_Dumps, + (void *) PyArray_ValidType, + (void *) PyArray_UpdateFlags, + (void *) PyArray_New, + (void *) PyArray_NewFromDescr, + (void *) PyArray_DescrNew, + (void *) PyArray_DescrNewFromType, + (void *) PyArray_GetPriority, + (void *) PyArray_IterNew, + (void *) PyArray_MultiIterNew, + (void *) PyArray_PyIntAsInt, + (void *) PyArray_PyIntAsIntp, + (void *) PyArray_Broadcast, + (void *) PyArray_FillObjectArray, + (void *) PyArray_FillWithScalar, + (void *) PyArray_CheckStrides, + (void *) PyArray_DescrNewByteorder, + (void *) PyArray_IterAllButAxis, + (void *) PyArray_CheckFromAny, + (void *) PyArray_FromArray, + (void *) PyArray_FromInterface, + (void *) PyArray_FromStructInterface, + (void *) PyArray_FromArrayAttr, + (void *) PyArray_ScalarKind, + (void *) PyArray_CanCoerceScalar, + (void *) PyArray_NewFlagsObject, + (void *) PyArray_CanCastScalar, + (void *) PyArray_CompareUCS4, + (void *) PyArray_RemoveSmallest, + (void *) PyArray_ElementStrides, + (void *) PyArray_Item_INCREF, + (void *) PyArray_Item_XDECREF, + (void *) PyArray_FieldNames, + (void *) PyArray_Transpose, + (void *) PyArray_TakeFrom, + (void *) PyArray_PutTo, + (void *) PyArray_PutMask, + (void *) PyArray_Repeat, + (void *) PyArray_Choose, + (void *) PyArray_Sort, + (void *) PyArray_ArgSort, + (void *) PyArray_SearchSorted, + (void *) PyArray_ArgMax, + (void *) PyArray_ArgMin, + (void *) PyArray_Reshape, + (void *) PyArray_Newshape, + (void *) PyArray_Squeeze, + (void *) PyArray_View, + (void *) PyArray_SwapAxes, + (void *) PyArray_Max, + (void *) PyArray_Min, + (void *) PyArray_Ptp, + (void *) PyArray_Mean, + (void *) PyArray_Trace, + (void *) PyArray_Diagonal, + (void *) PyArray_Clip, + (void *) PyArray_Conjugate, + (void *) PyArray_Nonzero, + (void *) PyArray_Std, + (void *) PyArray_Sum, + (void *) PyArray_CumSum, + (void *) PyArray_Prod, + (void *) PyArray_CumProd, + (void *) PyArray_All, + (void *) PyArray_Any, + (void *) PyArray_Compress, + (void *) PyArray_Flatten, + (void *) PyArray_Ravel, + (void *) PyArray_MultiplyList, + (void *) PyArray_MultiplyIntList, + (void *) PyArray_GetPtr, + (void *) PyArray_CompareLists, + (void *) PyArray_AsCArray, + (void *) PyArray_As1D, + (void *) PyArray_As2D, + (void *) PyArray_Free, + (void *) PyArray_Converter, + (void *) PyArray_IntpFromSequence, + (void *) PyArray_Concatenate, + (void *) PyArray_InnerProduct, + (void *) PyArray_MatrixProduct, + (void *) PyArray_CopyAndTranspose, + (void *) PyArray_Correlate, + (void *) PyArray_TypestrConvert, + (void *) PyArray_DescrConverter, + (void *) PyArray_DescrConverter2, + (void *) PyArray_IntpConverter, + (void *) PyArray_BufferConverter, + (void *) PyArray_AxisConverter, + (void *) PyArray_BoolConverter, + (void *) PyArray_ByteorderConverter, + (void *) PyArray_OrderConverter, + (void *) PyArray_EquivTypes, + (void *) PyArray_Zeros, + (void *) PyArray_Empty, + (void *) PyArray_Where, + (void *) PyArray_Arange, + (void *) PyArray_ArangeObj, + (void *) PyArray_SortkindConverter, + (void *) PyArray_LexSort, + (void *) PyArray_Round, + (void *) PyArray_EquivTypenums, + (void *) PyArray_RegisterDataType, + (void *) PyArray_RegisterCastFunc, + (void *) PyArray_RegisterCanCast, + (void *) PyArray_InitArrFuncs, + (void *) PyArray_IntTupleFromIntp, + (void *) PyArray_TypeNumFromName, + (void *) PyArray_ClipmodeConverter, + (void *) PyArray_OutputConverter, + (void *) PyArray_BroadcastToShape, + (void *) _PyArray_SigintHandler, + (void *) _PyArray_GetSigintBuf, + (void *) PyArray_DescrAlignConverter, + (void *) PyArray_DescrAlignConverter2, + (void *) PyArray_SearchsideConverter, + (void *) PyArray_CheckAxis, + (void *) PyArray_OverflowMultiplyList, + (void *) PyArray_CompareString, + (void *) PyArray_MultiIterFromObjects, + (void *) PyArray_GetEndianness, + (void *) PyArray_GetNDArrayCFeatureVersion, + (void *) PyArray_Correlate2, + (void *) PyArray_NeighborhoodIterNew, + (void *) &PyTimeIntegerArrType_Type, + (void *) &PyDatetimeArrType_Type, + (void *) &PyTimedeltaArrType_Type, + (void *) &PyHalfArrType_Type, + (void *) &NpyIter_Type, + (void *) PyArray_SetDatetimeParseFunction, + (void *) PyArray_DatetimeToDatetimeStruct, + (void *) PyArray_TimedeltaToTimedeltaStruct, + (void *) PyArray_DatetimeStructToDatetime, + (void *) PyArray_TimedeltaStructToTimedelta, + (void *) NpyIter_New, + (void *) NpyIter_MultiNew, + (void *) NpyIter_AdvancedNew, + (void *) NpyIter_Copy, + (void *) NpyIter_Deallocate, + (void *) NpyIter_HasDelayedBufAlloc, + (void *) NpyIter_HasExternalLoop, + (void *) NpyIter_EnableExternalLoop, + (void *) NpyIter_GetInnerStrideArray, + (void *) NpyIter_GetInnerLoopSizePtr, + (void *) NpyIter_Reset, + (void *) NpyIter_ResetBasePointers, + (void *) NpyIter_ResetToIterIndexRange, + (void *) NpyIter_GetNDim, + (void *) NpyIter_GetNOp, + (void *) NpyIter_GetIterNext, + (void *) NpyIter_GetIterSize, + (void *) NpyIter_GetIterIndexRange, + (void *) NpyIter_GetIterIndex, + (void *) NpyIter_GotoIterIndex, + (void *) NpyIter_HasMultiIndex, + (void *) NpyIter_GetShape, + (void *) NpyIter_GetGetMultiIndex, + (void *) NpyIter_GotoMultiIndex, + (void *) NpyIter_RemoveMultiIndex, + (void *) NpyIter_HasIndex, + (void *) NpyIter_IsBuffered, + (void *) NpyIter_IsGrowInner, + (void *) NpyIter_GetBufferSize, + (void *) NpyIter_GetIndexPtr, + (void *) NpyIter_GotoIndex, + (void *) NpyIter_GetDataPtrArray, + (void *) NpyIter_GetDescrArray, + (void *) NpyIter_GetOperandArray, + (void *) NpyIter_GetIterView, + (void *) NpyIter_GetReadFlags, + (void *) NpyIter_GetWriteFlags, + (void *) NpyIter_DebugPrint, + (void *) NpyIter_IterationNeedsAPI, + (void *) NpyIter_GetInnerFixedStrideArray, + (void *) NpyIter_RemoveAxis, + (void *) NpyIter_GetAxisStrideArray, + (void *) NpyIter_RequiresBuffering, + (void *) NpyIter_GetInitialDataPtrArray, + (void *) NpyIter_CreateCompatibleStrides, + (void *) PyArray_CastingConverter, + (void *) PyArray_CountNonzero, + (void *) PyArray_PromoteTypes, + (void *) PyArray_MinScalarType, + (void *) PyArray_ResultType, + (void *) PyArray_CanCastArrayTo, + (void *) PyArray_CanCastTypeTo, + (void *) PyArray_EinsteinSum, + (void *) PyArray_NewLikeArray, + (void *) PyArray_GetArrayParamsFromObject, + (void *) PyArray_ConvertClipmodeSequence, + (void *) PyArray_MatrixProduct2, + (void *) NpyIter_IsFirstVisit, + (void *) PyArray_SetBaseObject, + (void *) PyArray_CreateSortedStridePerm, + (void *) PyArray_RemoveAxesInPlace, + (void *) PyArray_DebugPrint, + (void *) PyArray_FailUnlessWriteable, + (void *) PyArray_SetUpdateIfCopyBase, + (void *) PyDataMem_NEW, + (void *) PyDataMem_FREE, + (void *) PyDataMem_RENEW, + (void *) PyDataMem_SetEventHook, + (NPY_CASTING *) &NPY_DEFAULT_ASSIGN_CASTING, + (void *) PyArray_MapIterSwapAxes, + (void *) PyArray_MapIterArray, + (void *) PyArray_MapIterNext, + (void *) PyArray_Partition, + (void *) PyArray_ArgPartition, + (void *) PyArray_SelectkindConverter, + (void *) PyDataMem_NEW_ZEROED, + (void *) PyArray_CheckAnyScalarExact, + (void *) PyArray_MapIterArrayCopyIfOverlap, + (void *) PyArray_ResolveWritebackIfCopy, + (void *) PyArray_SetWritebackIfCopyBase, + (void *) PyDataMem_SetHandler, + (void *) PyDataMem_GetHandler, + (PyObject* *) &PyDataMem_DefaultHandler +}; diff --git a/shared/package-files/9c/9cf474f83ed17b556c61783b0bcbc08d335a6ccc4c3051b1f2d627938aa5a7bc/blob b/shared/package-files/9c/9cf474f83ed17b556c61783b0bcbc08d335a6ccc4c3051b1f2d627938aa5a7bc/blob new file mode 100644 index 0000000000000000000000000000000000000000..9b201d8b06bfb94efa8d1e10f00fe79fbd30649a --- /dev/null +++ b/shared/package-files/9c/9cf474f83ed17b556c61783b0bcbc08d335a6ccc4c3051b1f2d627938aa5a7bc/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API max_unpool2d_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, c10::SymIntArrayRef, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::max_unpool2d") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "max_unpool2d.out(Tensor self, Tensor indices, SymInt[2] output_size, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, const at::Tensor & indices, c10::SymIntArrayRef output_size, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & indices, c10::SymIntArrayRef output_size, at::Tensor & out); +}; + +struct TORCH_API max_unpool2d { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, c10::SymIntArrayRef); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::max_unpool2d") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "max_unpool2d(Tensor self, Tensor indices, SymInt[2] output_size) -> Tensor") + static at::Tensor call(const at::Tensor & self, const at::Tensor & indices, c10::SymIntArrayRef output_size); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & indices, c10::SymIntArrayRef output_size); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9c/9cf8a86c9b1493cf2c4b3806762d26d894c90ed5cb250b4aa65dc2219160d3fe/blob b/shared/package-files/9c/9cf8a86c9b1493cf2c4b3806762d26d894c90ed5cb250b4aa65dc2219160d3fe/blob new file mode 100644 index 0000000000000000000000000000000000000000..97dc2862aef8b05b114c7719f5b341bc062fee00 --- /dev/null +++ b/shared/package-files/9c/9cf8a86c9b1493cf2c4b3806762d26d894c90ed5cb250b4aa65dc2219160d3fe/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API expand_copy { + using schema = at::Tensor (const at::Tensor &, c10::SymIntArrayRef, bool); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::expand_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "expand_copy(Tensor self, SymInt[] size, *, bool implicit=False) -> Tensor") + static at::Tensor call(const at::Tensor & self, c10::SymIntArrayRef size, bool implicit); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::SymIntArrayRef size, bool implicit); +}; + +struct TORCH_API expand_copy_out { + using schema = at::Tensor & (const at::Tensor &, c10::SymIntArrayRef, bool, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::expand_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "expand_copy.out(Tensor self, SymInt[] size, *, bool implicit=False, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, c10::SymIntArrayRef size, bool implicit, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::SymIntArrayRef size, bool implicit, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9c/9cfa91192175184bd4475eabca8f9d3aa97a7cb753bf3066624f18dcc2fe38d7/blob b/shared/package-files/9c/9cfa91192175184bd4475eabca8f9d3aa97a7cb753bf3066624f18dcc2fe38d7/blob new file mode 100644 index 0000000000000000000000000000000000000000..f026e4b0a481ab6ad3f104926297ffab33bf1fa9 --- /dev/null +++ b/shared/package-files/9c/9cfa91192175184bd4475eabca8f9d3aa97a7cb753bf3066624f18dcc2fe38d7/blob @@ -0,0 +1,285 @@ +import pytest + +import networkx as nx + + +class TestImmediateDominators: + def test_exceptions(self): + G = nx.Graph() + G.add_node(0) + pytest.raises(nx.NetworkXNotImplemented, nx.immediate_dominators, G, 0) + G = nx.MultiGraph(G) + pytest.raises(nx.NetworkXNotImplemented, nx.immediate_dominators, G, 0) + G = nx.DiGraph([[0, 0]]) + pytest.raises(nx.NetworkXError, nx.immediate_dominators, G, 1) + + def test_singleton(self): + G = nx.DiGraph() + G.add_node(0) + assert nx.immediate_dominators(G, 0) == {0: 0} + G.add_edge(0, 0) + assert nx.immediate_dominators(G, 0) == {0: 0} + + def test_path(self): + n = 5 + G = nx.path_graph(n, create_using=nx.DiGraph()) + assert nx.immediate_dominators(G, 0) == {i: max(i - 1, 0) for i in range(n)} + + def test_cycle(self): + n = 5 + G = nx.cycle_graph(n, create_using=nx.DiGraph()) + assert nx.immediate_dominators(G, 0) == {i: max(i - 1, 0) for i in range(n)} + + def test_unreachable(self): + n = 5 + assert n > 1 + G = nx.path_graph(n, create_using=nx.DiGraph()) + assert nx.immediate_dominators(G, n // 2) == { + i: max(i - 1, n // 2) for i in range(n // 2, n) + } + + def test_irreducible1(self): + # Graph taken from Figure 2 of + # K. D. Cooper, T. J. Harvey, and K. Kennedy. + # A simple, fast dominance algorithm. + # Software Practice & Experience, 4:110, 2001. + edges = [(1, 2), (2, 1), (3, 2), (4, 1), (5, 3), (5, 4)] + G = nx.DiGraph(edges) + assert nx.immediate_dominators(G, 5) == {i: 5 for i in range(1, 6)} + + def test_irreducible2(self): + # Graph taken from Figure 4 of + # K. D. Cooper, T. J. Harvey, and K. Kennedy. + # A simple, fast dominance algorithm. + # Software Practice & Experience, 4:110, 2001. + edges = [(1, 2), (2, 1), (2, 3), (3, 2), (4, 2), (4, 3), (5, 1), (6, 4), (6, 5)] + G = nx.DiGraph(edges) + result = nx.immediate_dominators(G, 6) + assert result == {i: 6 for i in range(1, 7)} + + def test_domrel_png(self): + # Graph taken from https://commons.wikipedia.org/wiki/File:Domrel.png + edges = [(1, 2), (2, 3), (2, 4), (2, 6), (3, 5), (4, 5), (5, 2)] + G = nx.DiGraph(edges) + result = nx.immediate_dominators(G, 1) + assert result == {1: 1, 2: 1, 3: 2, 4: 2, 5: 2, 6: 2} + # Test postdominance. + result = nx.immediate_dominators(G.reverse(copy=False), 6) + assert result == {1: 2, 2: 6, 3: 5, 4: 5, 5: 2, 6: 6} + + def test_boost_example(self): + # Graph taken from Figure 1 of + # http://www.boost.org/doc/libs/1_56_0/libs/graph/doc/lengauer_tarjan_dominator.htm + edges = [(0, 1), (1, 2), (1, 3), (2, 7), (3, 4), (4, 5), (4, 6), (5, 7), (6, 4)] + G = nx.DiGraph(edges) + result = nx.immediate_dominators(G, 0) + assert result == {0: 0, 1: 0, 2: 1, 3: 1, 4: 3, 5: 4, 6: 4, 7: 1} + # Test postdominance. + result = nx.immediate_dominators(G.reverse(copy=False), 7) + assert result == {0: 1, 1: 7, 2: 7, 3: 4, 4: 5, 5: 7, 6: 4, 7: 7} + + +class TestDominanceFrontiers: + def test_exceptions(self): + G = nx.Graph() + G.add_node(0) + pytest.raises(nx.NetworkXNotImplemented, nx.dominance_frontiers, G, 0) + G = nx.MultiGraph(G) + pytest.raises(nx.NetworkXNotImplemented, nx.dominance_frontiers, G, 0) + G = nx.DiGraph([[0, 0]]) + pytest.raises(nx.NetworkXError, nx.dominance_frontiers, G, 1) + + def test_singleton(self): + G = nx.DiGraph() + G.add_node(0) + assert nx.dominance_frontiers(G, 0) == {0: set()} + G.add_edge(0, 0) + assert nx.dominance_frontiers(G, 0) == {0: set()} + + def test_path(self): + n = 5 + G = nx.path_graph(n, create_using=nx.DiGraph()) + assert nx.dominance_frontiers(G, 0) == {i: set() for i in range(n)} + + def test_cycle(self): + n = 5 + G = nx.cycle_graph(n, create_using=nx.DiGraph()) + assert nx.dominance_frontiers(G, 0) == {i: set() for i in range(n)} + + def test_unreachable(self): + n = 5 + assert n > 1 + G = nx.path_graph(n, create_using=nx.DiGraph()) + assert nx.dominance_frontiers(G, n // 2) == {i: set() for i in range(n // 2, n)} + + def test_irreducible1(self): + # Graph taken from Figure 2 of + # K. D. Cooper, T. J. Harvey, and K. Kennedy. + # A simple, fast dominance algorithm. + # Software Practice & Experience, 4:110, 2001. + edges = [(1, 2), (2, 1), (3, 2), (4, 1), (5, 3), (5, 4)] + G = nx.DiGraph(edges) + assert dict(nx.dominance_frontiers(G, 5).items()) == { + 1: {2}, + 2: {1}, + 3: {2}, + 4: {1}, + 5: set(), + } + + def test_irreducible2(self): + # Graph taken from Figure 4 of + # K. D. Cooper, T. J. Harvey, and K. Kennedy. + # A simple, fast dominance algorithm. + # Software Practice & Experience, 4:110, 2001. + edges = [(1, 2), (2, 1), (2, 3), (3, 2), (4, 2), (4, 3), (5, 1), (6, 4), (6, 5)] + G = nx.DiGraph(edges) + assert nx.dominance_frontiers(G, 6) == { + 1: {2}, + 2: {1, 3}, + 3: {2}, + 4: {2, 3}, + 5: {1}, + 6: set(), + } + + def test_domrel_png(self): + # Graph taken from https://commons.wikipedia.org/wiki/File:Domrel.png + edges = [(1, 2), (2, 3), (2, 4), (2, 6), (3, 5), (4, 5), (5, 2)] + G = nx.DiGraph(edges) + assert nx.dominance_frontiers(G, 1) == { + 1: set(), + 2: {2}, + 3: {5}, + 4: {5}, + 5: {2}, + 6: set(), + } + # Test postdominance. + result = nx.dominance_frontiers(G.reverse(copy=False), 6) + assert result == {1: set(), 2: {2}, 3: {2}, 4: {2}, 5: {2}, 6: set()} + + def test_boost_example(self): + # Graph taken from Figure 1 of + # http://www.boost.org/doc/libs/1_56_0/libs/graph/doc/lengauer_tarjan_dominator.htm + edges = [(0, 1), (1, 2), (1, 3), (2, 7), (3, 4), (4, 5), (4, 6), (5, 7), (6, 4)] + G = nx.DiGraph(edges) + assert nx.dominance_frontiers(G, 0) == { + 0: set(), + 1: set(), + 2: {7}, + 3: {7}, + 4: {4, 7}, + 5: {7}, + 6: {4}, + 7: set(), + } + # Test postdominance. + result = nx.dominance_frontiers(G.reverse(copy=False), 7) + expected = { + 0: set(), + 1: set(), + 2: {1}, + 3: {1}, + 4: {1, 4}, + 5: {1}, + 6: {4}, + 7: set(), + } + assert result == expected + + def test_discard_issue(self): + # https://github.com/networkx/networkx/issues/2071 + g = nx.DiGraph() + g.add_edges_from( + [ + ("b0", "b1"), + ("b1", "b2"), + ("b2", "b3"), + ("b3", "b1"), + ("b1", "b5"), + ("b5", "b6"), + ("b5", "b8"), + ("b6", "b7"), + ("b8", "b7"), + ("b7", "b3"), + ("b3", "b4"), + ] + ) + df = nx.dominance_frontiers(g, "b0") + assert df == { + "b4": set(), + "b5": {"b3"}, + "b6": {"b7"}, + "b7": {"b3"}, + "b0": set(), + "b1": {"b1"}, + "b2": {"b3"}, + "b3": {"b1"}, + "b8": {"b7"}, + } + + def test_loop(self): + g = nx.DiGraph() + g.add_edges_from([("a", "b"), ("b", "c"), ("b", "a")]) + df = nx.dominance_frontiers(g, "a") + assert df == {"a": set(), "b": set(), "c": set()} + + def test_missing_immediate_doms(self): + # see https://github.com/networkx/networkx/issues/2070 + g = nx.DiGraph() + edges = [ + ("entry_1", "b1"), + ("b1", "b2"), + ("b2", "b3"), + ("b3", "exit"), + ("entry_2", "b3"), + ] + + # entry_1 + # | + # b1 + # | + # b2 entry_2 + # | / + # b3 + # | + # exit + + g.add_edges_from(edges) + # formerly raised KeyError on entry_2 when parsing b3 + # because entry_2 does not have immediate doms (no path) + nx.dominance_frontiers(g, "entry_1") + + def test_loops_larger(self): + # from + # http://ecee.colorado.edu/~waite/Darmstadt/motion.html + g = nx.DiGraph() + edges = [ + ("entry", "exit"), + ("entry", "1"), + ("1", "2"), + ("2", "3"), + ("3", "4"), + ("4", "5"), + ("5", "6"), + ("6", "exit"), + ("6", "2"), + ("5", "3"), + ("4", "4"), + ] + + g.add_edges_from(edges) + df = nx.dominance_frontiers(g, "entry") + answer = { + "entry": set(), + "1": {"exit"}, + "2": {"exit", "2"}, + "3": {"exit", "3", "2"}, + "4": {"exit", "4", "3", "2"}, + "5": {"exit", "3", "2"}, + "6": {"exit", "2"}, + "exit": set(), + } + for n in df: + assert set(df[n]) == set(answer[n]) diff --git a/shared/package-files/9c/9cfb906e25e76cbb0d73b8b3dceecd4372a19712c1439a8753adcd77615188ea/blob b/shared/package-files/9c/9cfb906e25e76cbb0d73b8b3dceecd4372a19712c1439a8753adcd77615188ea/blob new file mode 100644 index 0000000000000000000000000000000000000000..9ce383d5c70f0dc6fa728ac7f6f973a986fcb89c --- /dev/null +++ b/shared/package-files/9c/9cfb906e25e76cbb0d73b8b3dceecd4372a19712c1439a8753adcd77615188ea/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_sparse_sparse_matmul(Tensor self, Tensor other) -> Tensor +inline at::Tensor _sparse_sparse_matmul(const at::Tensor & self, const at::Tensor & other) { + return at::_ops::_sparse_sparse_matmul::call(self, other); +} + +// aten::_sparse_sparse_matmul.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _sparse_sparse_matmul_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other) { + return at::_ops::_sparse_sparse_matmul_out::call(self, other, out); +} +// aten::_sparse_sparse_matmul.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _sparse_sparse_matmul_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out) { + return at::_ops::_sparse_sparse_matmul_out::call(self, other, out); +} + +} diff --git a/shared/package-files/9c/9cfc9198db456ce52f4970b07a0000a5015f87c508fcaf47ab974de283c0c5da/blob b/shared/package-files/9c/9cfc9198db456ce52f4970b07a0000a5015f87c508fcaf47ab974de283c0c5da/blob new file mode 100644 index 0000000000000000000000000000000000000000..91c0220d7310870a7803ecceb2c32b8b32f8c11d --- /dev/null +++ b/shared/package-files/9c/9cfc9198db456ce52f4970b07a0000a5015f87c508fcaf47ab974de283c0c5da/blob @@ -0,0 +1,33 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +# distutils: language = c++ +# cython: language_level = 3 + +from pyarrow.includes.common cimport * +from pyarrow.includes.libarrow cimport CStatus + + +ctypedef CStatus cb_test_func() + +cdef extern from "arrow/python/python_test.h" namespace "arrow::py::testing" nogil: + + cdef cppclass CTestCase "arrow::py::testing::TestCase": + c_string name + cb_test_func func + + vector[CTestCase] GetCppTestCases() diff --git a/shared/package-files/9c/9cfccb29c00925aa1981d2e8ab5fc25e1896285047fbea78b7a76ae08dec57d0/blob b/shared/package-files/9c/9cfccb29c00925aa1981d2e8ab5fc25e1896285047fbea78b7a76ae08dec57d0/blob new file mode 100644 index 0000000000000000000000000000000000000000..5c713861f983b2ada656eafffb66723ea93c0611 --- /dev/null +++ b/shared/package-files/9c/9cfccb29c00925aa1981d2e8ab5fc25e1896285047fbea78b7a76ae08dec57d0/blob @@ -0,0 +1,196 @@ +import sympy +from sympy.parsing.sympy_parser import ( + parse_expr, + standard_transformations, + convert_xor, + implicit_multiplication_application, + implicit_multiplication, + implicit_application, + function_exponentiation, + split_symbols, + split_symbols_custom, + _token_splittable +) +from sympy.testing.pytest import raises + + +def test_implicit_multiplication(): + cases = { + '5x': '5*x', + 'abc': 'a*b*c', + '3sin(x)': '3*sin(x)', + '(x+1)(x+2)': '(x+1)*(x+2)', + '(5 x**2)sin(x)': '(5*x**2)*sin(x)', + '2 sin(x) cos(x)': '2*sin(x)*cos(x)', + 'pi x': 'pi*x', + 'x pi': 'x*pi', + 'E x': 'E*x', + 'EulerGamma y': 'EulerGamma*y', + 'E pi': 'E*pi', + 'pi (x + 2)': 'pi*(x+2)', + '(x + 2) pi': '(x+2)*pi', + 'pi sin(x)': 'pi*sin(x)', + } + transformations = standard_transformations + (convert_xor,) + transformations2 = transformations + (split_symbols, + implicit_multiplication) + for case in cases: + implicit = parse_expr(case, transformations=transformations2) + normal = parse_expr(cases[case], transformations=transformations) + assert(implicit == normal) + + application = ['sin x', 'cos 2*x', 'sin cos x'] + for case in application: + raises(SyntaxError, + lambda: parse_expr(case, transformations=transformations2)) + raises(TypeError, + lambda: parse_expr('sin**2(x)', transformations=transformations2)) + + +def test_implicit_application(): + cases = { + 'factorial': 'factorial', + 'sin x': 'sin(x)', + 'tan y**3': 'tan(y**3)', + 'cos 2*x': 'cos(2*x)', + '(cot)': 'cot', + 'sin cos tan x': 'sin(cos(tan(x)))' + } + transformations = standard_transformations + (convert_xor,) + transformations2 = transformations + (implicit_application,) + for case in cases: + implicit = parse_expr(case, transformations=transformations2) + normal = parse_expr(cases[case], transformations=transformations) + assert(implicit == normal), (implicit, normal) + + multiplication = ['x y', 'x sin x', '2x'] + for case in multiplication: + raises(SyntaxError, + lambda: parse_expr(case, transformations=transformations2)) + raises(TypeError, + lambda: parse_expr('sin**2(x)', transformations=transformations2)) + + +def test_function_exponentiation(): + cases = { + 'sin**2(x)': 'sin(x)**2', + 'exp^y(z)': 'exp(z)^y', + 'sin**2(E^(x))': 'sin(E^(x))**2' + } + transformations = standard_transformations + (convert_xor,) + transformations2 = transformations + (function_exponentiation,) + for case in cases: + implicit = parse_expr(case, transformations=transformations2) + normal = parse_expr(cases[case], transformations=transformations) + assert(implicit == normal) + + other_implicit = ['x y', 'x sin x', '2x', 'sin x', + 'cos 2*x', 'sin cos x'] + for case in other_implicit: + raises(SyntaxError, + lambda: parse_expr(case, transformations=transformations2)) + + assert parse_expr('x**2', local_dict={ 'x': sympy.Symbol('x') }, + transformations=transformations2) == parse_expr('x**2') + + +def test_symbol_splitting(): + # By default Greek letter names should not be split (lambda is a keyword + # so skip it) + transformations = standard_transformations + (split_symbols,) + greek_letters = ('alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', + 'eta', 'theta', 'iota', 'kappa', 'mu', 'nu', 'xi', + 'omicron', 'pi', 'rho', 'sigma', 'tau', 'upsilon', + 'phi', 'chi', 'psi', 'omega') + + for letter in greek_letters: + assert(parse_expr(letter, transformations=transformations) == + parse_expr(letter)) + + # Make sure symbol splitting resolves names + transformations += (implicit_multiplication,) + local_dict = { 'e': sympy.E } + cases = { + 'xe': 'E*x', + 'Iy': 'I*y', + 'ee': 'E*E', + } + for case, expected in cases.items(): + assert(parse_expr(case, local_dict=local_dict, + transformations=transformations) == + parse_expr(expected)) + + # Make sure custom splitting works + def can_split(symbol): + if symbol not in ('unsplittable', 'names'): + return _token_splittable(symbol) + return False + transformations = standard_transformations + transformations += (split_symbols_custom(can_split), + implicit_multiplication) + + assert(parse_expr('unsplittable', transformations=transformations) == + parse_expr('unsplittable')) + assert(parse_expr('names', transformations=transformations) == + parse_expr('names')) + assert(parse_expr('xy', transformations=transformations) == + parse_expr('x*y')) + for letter in greek_letters: + assert(parse_expr(letter, transformations=transformations) == + parse_expr(letter)) + + +def test_all_implicit_steps(): + cases = { + '2x': '2*x', # implicit multiplication + 'x y': 'x*y', + 'xy': 'x*y', + 'sin x': 'sin(x)', # add parentheses + '2sin x': '2*sin(x)', + 'x y z': 'x*y*z', + 'sin(2 * 3x)': 'sin(2 * 3 * x)', + 'sin(x) (1 + cos(x))': 'sin(x) * (1 + cos(x))', + '(x + 2) sin(x)': '(x + 2) * sin(x)', + '(x + 2) sin x': '(x + 2) * sin(x)', + 'sin(sin x)': 'sin(sin(x))', + 'sin x!': 'sin(factorial(x))', + 'sin x!!': 'sin(factorial2(x))', + 'factorial': 'factorial', # don't apply a bare function + 'x sin x': 'x * sin(x)', # both application and multiplication + 'xy sin x': 'x * y * sin(x)', + '(x+2)(x+3)': '(x + 2) * (x+3)', + 'x**2 + 2xy + y**2': 'x**2 + 2 * x * y + y**2', # split the xy + 'pi': 'pi', # don't mess with constants + 'None': 'None', + 'ln sin x': 'ln(sin(x))', # multiple implicit function applications + 'factorial': 'factorial', # don't add parentheses + 'sin x**2': 'sin(x**2)', # implicit application to an exponential + 'alpha': 'Symbol("alpha")', # don't split Greek letters/subscripts + 'x_2': 'Symbol("x_2")', + 'sin^2 x**2': 'sin(x**2)**2', # function raised to a power + 'sin**3(x)': 'sin(x)**3', + '(factorial)': 'factorial', + 'tan 3x': 'tan(3*x)', + 'sin^2(3*E^(x))': 'sin(3*E**(x))**2', + 'sin**2(E^(3x))': 'sin(E**(3*x))**2', + 'sin^2 (3x*E^(x))': 'sin(3*x*E^x)**2', + 'pi sin x': 'pi*sin(x)', + } + transformations = standard_transformations + (convert_xor,) + transformations2 = transformations + (implicit_multiplication_application,) + for case in cases: + implicit = parse_expr(case, transformations=transformations2) + normal = parse_expr(cases[case], transformations=transformations) + assert(implicit == normal) + + +def test_no_methods_implicit_multiplication(): + # Issue 21020 + u = sympy.Symbol('u') + transformations = standard_transformations + \ + (implicit_multiplication,) + expr = parse_expr('x.is_polynomial(x)', transformations=transformations) + assert expr == True + expr = parse_expr('(exp(x) / (1 + exp(2x))).subs(exp(x), u)', + transformations=transformations) + assert expr == u/(u**2 + 1) diff --git a/shared/package-files/9c/9cfd4c9cad958c30b2e09c9935b251e9c384621031aeb5f96eba3c009854191f/blob b/shared/package-files/9c/9cfd4c9cad958c30b2e09c9935b251e9c384621031aeb5f96eba3c009854191f/blob new file mode 100644 index 0000000000000000000000000000000000000000..ccda4681f538984e490c9b4dfa2f608df3c07b39 --- /dev/null +++ b/shared/package-files/9c/9cfd4c9cad958c30b2e09c9935b251e9c384621031aeb5f96eba3c009854191f/blob @@ -0,0 +1,13 @@ +*** Sat, 3 Sep 2016 22:21:06 *** +TEST FOR GRANGER-CAUSALITY: +H0: "realinv" do not Granger-cause "realcons, realgdp" + +Test statistic l = 4.3526 +pval-F( l; 8, 552) = 0.0000 + +TEST FOR INSTANTANEOUS CAUSALITY: +H0: No instantaneous causality between "realinv" and "realcons, realgdp" + +Test statistic: c = 79.2548 +pval-Chi( c; 2) = 0.0000 + diff --git a/shared/package-files/9d/9d00a62ededb5a4d2277bc4cba6670fbe3f311ed7117d3d3427de5bc7c8d0ba2/blob b/shared/package-files/9d/9d00a62ededb5a4d2277bc4cba6670fbe3f311ed7117d3d3427de5bc7c8d0ba2/blob new file mode 100644 index 0000000000000000000000000000000000000000..5065b6fc835e019fcb7cd4e60a3a36d267f34235 --- /dev/null +++ b/shared/package-files/9d/9d00a62ededb5a4d2277bc4cba6670fbe3f311ed7117d3d3427de5bc7c8d0ba2/blob @@ -0,0 +1,203 @@ +"""Tests to ensure that the lxml tree builder generates good trees.""" + +import pickle +import pytest +import re +import warnings +from . import LXML_PRESENT, LXML_VERSION + +if LXML_PRESENT: + from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML + +from bs4 import ( + BeautifulSoup, + BeautifulStoneSoup, + ) +from bs4.element import Comment, Doctype, SoupStrainer +from . import ( + HTMLTreeBuilderSmokeTest, + XMLTreeBuilderSmokeTest, + SOUP_SIEVE_PRESENT, + SoupTest, +) + +@pytest.mark.skipif( + not LXML_PRESENT, + reason="lxml seems not to be present, not testing its tree builder." +) +class TestLXMLTreeBuilder(SoupTest, HTMLTreeBuilderSmokeTest): + """See ``HTMLTreeBuilderSmokeTest``.""" + + @property + def default_builder(self): + return LXMLTreeBuilder + + def test_out_of_range_entity(self): + self.assert_soup( + "

foo�bar

", "

foobar

") + self.assert_soup( + "

foo�bar

", "

foobar

") + self.assert_soup( + "

foo�bar

", "

foobar

") + + def test_entities_in_foreign_document_encoding(self): + # We can't implement this case correctly because by the time we + # hear about markup like "“", it's been (incorrectly) converted into + # a string like u'\x93' + pass + + # In lxml < 2.3.5, an empty doctype causes a segfault. Skip this + # test if an old version of lxml is installed. + + @pytest.mark.skipif( + not LXML_PRESENT or LXML_VERSION < (2,3,5,0), + reason="Skipping doctype test for old version of lxml to avoid segfault." + ) + def test_empty_doctype(self): + soup = self.soup("") + doctype = soup.contents[0] + assert "" == doctype.strip() + + def test_beautifulstonesoup_is_xml_parser(self): + # Make sure that the deprecated BSS class uses an xml builder + # if one is installed. + with warnings.catch_warnings(record=True) as w: + soup = BeautifulStoneSoup("") + assert "" == str(soup.b) + [warning] = w + assert warning.filename == __file__ + assert "BeautifulStoneSoup class is deprecated" in str(warning.message) + + def test_tracking_line_numbers(self): + # The lxml TreeBuilder cannot keep track of line numbers from + # the original markup. Even if you ask for line numbers, we + # don't have 'em. + # + # This means that if you have a tag like or + # , attribute access will find it rather than + # giving you a numeric answer. + soup = self.soup( + "\n

\n\n\ntext

", + store_line_numbers=True + ) + assert "sourceline" == soup.p.sourceline.name + assert "sourcepos" == soup.p.sourcepos.name + +@pytest.mark.skipif( + not LXML_PRESENT, + reason="lxml seems not to be present, not testing its XML tree builder." +) +class TestLXMLXMLTreeBuilder(SoupTest, XMLTreeBuilderSmokeTest): + """See ``HTMLTreeBuilderSmokeTest``.""" + + @property + def default_builder(self): + return LXMLTreeBuilderForXML + + def test_namespace_indexing(self): + soup = self.soup( + '\n' + '' + 'content' + 'content' + '' + '' + '' + '' + '' + ) + + # The BeautifulSoup object includes every namespace prefix + # defined in the entire document. This is the default set of + # namespaces used by soupsieve. + # + # Un-prefixed namespaces are not included, and if a given + # prefix is defined twice, only the first prefix encountered + # in the document shows up here. + assert soup._namespaces == { + 'xml': 'http://www.w3.org/XML/1998/namespace', + 'prefix': 'http://prefixed-namespace.com', + 'prefix2': 'http://another-namespace.com' + } + + # A Tag object includes only the namespace prefixes + # that were in scope when it was parsed. + + # We do not track un-prefixed namespaces as we can only hold + # one (the first one), and it will be recognized as the + # default namespace by soupsieve, even when operating from a + # tag with a different un-prefixed namespace. + assert soup.tag._namespaces == { + 'xml': 'http://www.w3.org/XML/1998/namespace', + } + + assert soup.tag2._namespaces == { + 'prefix': 'http://prefixed-namespace.com', + 'xml': 'http://www.w3.org/XML/1998/namespace', + } + + assert soup.subtag._namespaces == { + 'prefix2': 'http://another-namespace.com', + 'xml': 'http://www.w3.org/XML/1998/namespace', + } + + assert soup.subsubtag._namespaces == { + 'prefix2': 'http://another-namespace.com', + 'xml': 'http://www.w3.org/XML/1998/namespace', + } + + + @pytest.mark.skipif( + not SOUP_SIEVE_PRESENT, reason="Soup Sieve not installed" + ) + def test_namespace_interaction_with_select_and_find(self): + # Demonstrate how namespaces interact with select* and + # find* methods. + + soup = self.soup( + '\n' + '' + 'content' + 'content' + '' + '' + '' + '' + ) + + # soupselect uses namespace URIs. + assert soup.select_one('tag').name == 'tag' + assert soup.select_one('prefix|tag2').name == 'tag2' + + # If a prefix is declared more than once, only the first usage + # is registered with the BeautifulSoup object. + assert soup.select_one('prefix|tag3') is None + + # But you can always explicitly specify a namespace dictionary. + assert soup.select_one( + 'prefix|tag3', namespaces=soup.subtag._namespaces + ).name == 'tag3' + + # And a Tag (as opposed to the BeautifulSoup object) will + # have a set of default namespaces scoped to that Tag. + assert soup.subtag.select_one('prefix|tag3').name=='tag3' + + # the find() methods aren't fully namespace-aware; they just + # look at prefixes. + assert soup.find('tag').name == 'tag' + assert soup.find('prefix:tag2').name == 'tag2' + assert soup.find('prefix:tag3').name == 'tag3' + assert soup.subtag.find('prefix:tag3').name == 'tag3' + + def test_pickle_restores_builder(self): + # The lxml TreeBuilder is not picklable, so when unpickling + # a document created with it, a new TreeBuilder of the + # appropriate class is created. + soup = self.soup("
some markup") + assert isinstance(soup.builder, self.default_builder) + pickled = pickle.dumps(soup) + unpickled = pickle.loads(pickled) + + assert "some markup" == unpickled.a.string + assert unpickled.builder != soup.builder + assert isinstance(unpickled.builder, self.default_builder) diff --git a/shared/package-files/9d/9d00ce12e1717730f778b448f7d2c5c2a7f9638ad4e8b54e453e9978ae9b4796/blob b/shared/package-files/9d/9d00ce12e1717730f778b448f7d2c5c2a7f9638ad4e8b54e453e9978ae9b4796/blob new file mode 100644 index 0000000000000000000000000000000000000000..95cc335266a7818a33dbe2e20636ce3632991253 --- /dev/null +++ b/shared/package-files/9d/9d00ce12e1717730f778b448f7d2c5c2a7f9638ad4e8b54e453e9978ae9b4796/blob @@ -0,0 +1,65 @@ +""" +Created on Tue May 27 13:26:01 2014 + +Author: Josef Perktold +License: BSD-3 + +""" +import numpy as np +from numpy.testing import assert_allclose, assert_equal +import pytest +from scipy import stats + +from statsmodels.regression.linear_model import OLS +from statsmodels.tools.transform_model import StandardizeTransform + + +def test_standardize1(): + + rs = np.random.RandomState(123) + x = 1 + rs.randn(5, 4) + + transf = StandardizeTransform(x) + xs1 = transf(x) + + assert_allclose(transf.mean, x.mean(0), rtol=1e-13) + assert_allclose(transf.scale, x.std(0, ddof=1), rtol=1e-13) + + xs2 = stats.zscore(x, ddof=1) + assert_allclose(xs1, xs2, rtol=1e-13, atol=1e-20) + + # check we use stored transformation + xs4 = transf(2 * x) + assert_allclose(xs4, (2 * x - transf.mean) / transf.scale, rtol=1e-13, atol=1e-20) + + # affine transform does not change standardized + x2 = 2 * x + rs.randn(4) + transf2 = StandardizeTransform(x2) + xs3 = transf2(x2) + assert_allclose(xs3, xs1, rtol=1e-13, atol=1e-20) + + # check constant + x5 = np.column_stack((np.ones(x.shape[0]), x)) + transf5 = StandardizeTransform(x5) + xs5 = transf5(x5) + + assert_equal(transf5.const_idx, 0) + assert_equal(xs5[:, 0], np.ones(x.shape[0])) + assert_allclose(xs5[:, 1:], xs1, rtol=1e-13, atol=1e-20) + + +@pytest.mark.parametrize("ddof", [1, 5]) +def test_standardize_ols(ddof): + + rs = np.random.RandomState(123) + nobs = 20 + x = 1 + rs.randn(nobs, 4) + exog = np.column_stack((np.ones(nobs), x)) + endog = exog.sum(1) + rs.randn(nobs) + + res2 = OLS(endog, exog).fit() + transf = StandardizeTransform(exog, ddof=ddof) + exog_st = transf(exog) + res1 = OLS(endog, exog_st).fit() + params = transf.transform_params(res1.params) + assert_allclose(params, res2.params, rtol=1e-13) diff --git a/shared/package-files/9d/9d00da166d3a75a6f4ea7199d66e149466a4993c08466cc5be318ce5b12b9758/blob b/shared/package-files/9d/9d00da166d3a75a6f4ea7199d66e149466a4993c08466cc5be318ce5b12b9758/blob new file mode 100644 index 0000000000000000000000000000000000000000..835810fee0335b08735257b60afd96a3381f46a3 --- /dev/null +++ b/shared/package-files/9d/9d00da166d3a75a6f4ea7199d66e149466a4993c08466cc5be318ce5b12b9758/blob @@ -0,0 +1,29 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_sinh_out : public at::meta::structured_sinh { +void impl(const at::Tensor & self, const at::Tensor & out); +}; +TORCH_API at::Tensor sinh_sparse(const at::Tensor & self); +TORCH_API at::Tensor & sinh_sparse_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & sinh_sparse_(at::Tensor & self); +TORCH_API at::Tensor sinh_sparse_csr(const at::Tensor & self); +TORCH_API at::Tensor & sinh_sparse_csr_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & sinh_sparse_csr_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9d0121626828ade681673c85cf062c5f124046eddfa38124ba7535eb7535ea21/blob b/shared/package-files/9d/9d0121626828ade681673c85cf062c5f124046eddfa38124ba7535eb7535ea21/blob new file mode 100644 index 0000000000000000000000000000000000000000..ca0fe442d9ca499466df9438df16eca405c5f102 --- /dev/null +++ b/shared/package-files/9d/9d0121626828ade681673c85cf062c5f124046eddfa38124ba7535eb7535ea21/blob @@ -0,0 +1,393 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2012-2013 Python Software Foundation. +# See LICENSE.txt and CONTRIBUTORS.txt. +# +""" +Class representing the list of files in a distribution. + +Equivalent to distutils.filelist, but fixes some problems. +""" +import fnmatch +import logging +import os +import re +import sys + +from . import DistlibException +from .compat import fsdecode +from .util import convert_path + + +__all__ = ['Manifest'] + +logger = logging.getLogger(__name__) + +# a \ followed by some spaces + EOL +_COLLAPSE_PATTERN = re.compile('\\\\w*\n', re.M) +_COMMENTED_LINE = re.compile('#.*?(?=\n)|\n(?=$)', re.M | re.S) + +# +# Due to the different results returned by fnmatch.translate, we need +# to do slightly different processing for Python 2.7 and 3.2 ... this needed +# to be brought in for Python 3.6 onwards. +# +_PYTHON_VERSION = sys.version_info[:2] + +class Manifest(object): + """A list of files built by on exploring the filesystem and filtered by + applying various patterns to what we find there. + """ + + def __init__(self, base=None): + """ + Initialise an instance. + + :param base: The base directory to explore under. + """ + self.base = os.path.abspath(os.path.normpath(base or os.getcwd())) + self.prefix = self.base + os.sep + self.allfiles = None + self.files = set() + + # + # Public API + # + + def findall(self): + """Find all files under the base and set ``allfiles`` to the absolute + pathnames of files found. + """ + from stat import S_ISREG, S_ISDIR, S_ISLNK + + self.allfiles = allfiles = [] + root = self.base + stack = [root] + pop = stack.pop + push = stack.append + + while stack: + root = pop() + names = os.listdir(root) + + for name in names: + fullname = os.path.join(root, name) + + # Avoid excess stat calls -- just one will do, thank you! + stat = os.stat(fullname) + mode = stat.st_mode + if S_ISREG(mode): + allfiles.append(fsdecode(fullname)) + elif S_ISDIR(mode) and not S_ISLNK(mode): + push(fullname) + + def add(self, item): + """ + Add a file to the manifest. + + :param item: The pathname to add. This can be relative to the base. + """ + if not item.startswith(self.prefix): + item = os.path.join(self.base, item) + self.files.add(os.path.normpath(item)) + + def add_many(self, items): + """ + Add a list of files to the manifest. + + :param items: The pathnames to add. These can be relative to the base. + """ + for item in items: + self.add(item) + + def sorted(self, wantdirs=False): + """ + Return sorted files in directory order + """ + + def add_dir(dirs, d): + dirs.add(d) + logger.debug('add_dir added %s', d) + if d != self.base: + parent, _ = os.path.split(d) + assert parent not in ('', '/') + add_dir(dirs, parent) + + result = set(self.files) # make a copy! + if wantdirs: + dirs = set() + for f in result: + add_dir(dirs, os.path.dirname(f)) + result |= dirs + return [os.path.join(*path_tuple) for path_tuple in + sorted(os.path.split(path) for path in result)] + + def clear(self): + """Clear all collected files.""" + self.files = set() + self.allfiles = [] + + def process_directive(self, directive): + """ + Process a directive which either adds some files from ``allfiles`` to + ``files``, or removes some files from ``files``. + + :param directive: The directive to process. This should be in a format + compatible with distutils ``MANIFEST.in`` files: + + http://docs.python.org/distutils/sourcedist.html#commands + """ + # Parse the line: split it up, make sure the right number of words + # is there, and return the relevant words. 'action' is always + # defined: it's the first word of the line. Which of the other + # three are defined depends on the action; it'll be either + # patterns, (dir and patterns), or (dirpattern). + action, patterns, thedir, dirpattern = self._parse_directive(directive) + + # OK, now we know that the action is valid and we have the + # right number of words on the line for that action -- so we + # can proceed with minimal error-checking. + if action == 'include': + for pattern in patterns: + if not self._include_pattern(pattern, anchor=True): + logger.warning('no files found matching %r', pattern) + + elif action == 'exclude': + for pattern in patterns: + found = self._exclude_pattern(pattern, anchor=True) + #if not found: + # logger.warning('no previously-included files ' + # 'found matching %r', pattern) + + elif action == 'global-include': + for pattern in patterns: + if not self._include_pattern(pattern, anchor=False): + logger.warning('no files found matching %r ' + 'anywhere in distribution', pattern) + + elif action == 'global-exclude': + for pattern in patterns: + found = self._exclude_pattern(pattern, anchor=False) + #if not found: + # logger.warning('no previously-included files ' + # 'matching %r found anywhere in ' + # 'distribution', pattern) + + elif action == 'recursive-include': + for pattern in patterns: + if not self._include_pattern(pattern, prefix=thedir): + logger.warning('no files found matching %r ' + 'under directory %r', pattern, thedir) + + elif action == 'recursive-exclude': + for pattern in patterns: + found = self._exclude_pattern(pattern, prefix=thedir) + #if not found: + # logger.warning('no previously-included files ' + # 'matching %r found under directory %r', + # pattern, thedir) + + elif action == 'graft': + if not self._include_pattern(None, prefix=dirpattern): + logger.warning('no directories found matching %r', + dirpattern) + + elif action == 'prune': + if not self._exclude_pattern(None, prefix=dirpattern): + logger.warning('no previously-included directories found ' + 'matching %r', dirpattern) + else: # pragma: no cover + # This should never happen, as it should be caught in + # _parse_template_line + raise DistlibException( + 'invalid action %r' % action) + + # + # Private API + # + + def _parse_directive(self, directive): + """ + Validate a directive. + :param directive: The directive to validate. + :return: A tuple of action, patterns, thedir, dir_patterns + """ + words = directive.split() + if len(words) == 1 and words[0] not in ('include', 'exclude', + 'global-include', + 'global-exclude', + 'recursive-include', + 'recursive-exclude', + 'graft', 'prune'): + # no action given, let's use the default 'include' + words.insert(0, 'include') + + action = words[0] + patterns = thedir = dir_pattern = None + + if action in ('include', 'exclude', + 'global-include', 'global-exclude'): + if len(words) < 2: + raise DistlibException( + '%r expects ...' % action) + + patterns = [convert_path(word) for word in words[1:]] + + elif action in ('recursive-include', 'recursive-exclude'): + if len(words) < 3: + raise DistlibException( + '%r expects ...' % action) + + thedir = convert_path(words[1]) + patterns = [convert_path(word) for word in words[2:]] + + elif action in ('graft', 'prune'): + if len(words) != 2: + raise DistlibException( + '%r expects a single ' % action) + + dir_pattern = convert_path(words[1]) + + else: + raise DistlibException('unknown action %r' % action) + + return action, patterns, thedir, dir_pattern + + def _include_pattern(self, pattern, anchor=True, prefix=None, + is_regex=False): + """Select strings (presumably filenames) from 'self.files' that + match 'pattern', a Unix-style wildcard (glob) pattern. + + Patterns are not quite the same as implemented by the 'fnmatch' + module: '*' and '?' match non-special characters, where "special" + is platform-dependent: slash on Unix; colon, slash, and backslash on + DOS/Windows; and colon on Mac OS. + + If 'anchor' is true (the default), then the pattern match is more + stringent: "*.py" will match "foo.py" but not "foo/bar.py". If + 'anchor' is false, both of these will match. + + If 'prefix' is supplied, then only filenames starting with 'prefix' + (itself a pattern) and ending with 'pattern', with anything in between + them, will match. 'anchor' is ignored in this case. + + If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and + 'pattern' is assumed to be either a string containing a regex or a + regex object -- no translation is done, the regex is just compiled + and used as-is. + + Selected strings will be added to self.files. + + Return True if files are found. + """ + # XXX docstring lying about what the special chars are? + found = False + pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex) + + # delayed loading of allfiles list + if self.allfiles is None: + self.findall() + + for name in self.allfiles: + if pattern_re.search(name): + self.files.add(name) + found = True + return found + + def _exclude_pattern(self, pattern, anchor=True, prefix=None, + is_regex=False): + """Remove strings (presumably filenames) from 'files' that match + 'pattern'. + + Other parameters are the same as for 'include_pattern()', above. + The list 'self.files' is modified in place. Return True if files are + found. + + This API is public to allow e.g. exclusion of SCM subdirs, e.g. when + packaging source distributions + """ + found = False + pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex) + for f in list(self.files): + if pattern_re.search(f): + self.files.remove(f) + found = True + return found + + def _translate_pattern(self, pattern, anchor=True, prefix=None, + is_regex=False): + """Translate a shell-like wildcard pattern to a compiled regular + expression. + + Return the compiled regex. If 'is_regex' true, + then 'pattern' is directly compiled to a regex (if it's a string) + or just returned as-is (assumes it's a regex object). + """ + if is_regex: + if isinstance(pattern, str): + return re.compile(pattern) + else: + return pattern + + if _PYTHON_VERSION > (3, 2): + # ditch start and end characters + start, _, end = self._glob_to_re('_').partition('_') + + if pattern: + pattern_re = self._glob_to_re(pattern) + if _PYTHON_VERSION > (3, 2): + assert pattern_re.startswith(start) and pattern_re.endswith(end) + else: + pattern_re = '' + + base = re.escape(os.path.join(self.base, '')) + if prefix is not None: + # ditch end of pattern character + if _PYTHON_VERSION <= (3, 2): + empty_pattern = self._glob_to_re('') + prefix_re = self._glob_to_re(prefix)[:-len(empty_pattern)] + else: + prefix_re = self._glob_to_re(prefix) + assert prefix_re.startswith(start) and prefix_re.endswith(end) + prefix_re = prefix_re[len(start): len(prefix_re) - len(end)] + sep = os.sep + if os.sep == '\\': + sep = r'\\' + if _PYTHON_VERSION <= (3, 2): + pattern_re = '^' + base + sep.join((prefix_re, + '.*' + pattern_re)) + else: + pattern_re = pattern_re[len(start): len(pattern_re) - len(end)] + pattern_re = r'%s%s%s%s.*%s%s' % (start, base, prefix_re, sep, + pattern_re, end) + else: # no prefix -- respect anchor flag + if anchor: + if _PYTHON_VERSION <= (3, 2): + pattern_re = '^' + base + pattern_re + else: + pattern_re = r'%s%s%s' % (start, base, pattern_re[len(start):]) + + return re.compile(pattern_re) + + def _glob_to_re(self, pattern): + """Translate a shell-like glob pattern to a regular expression. + + Return a string containing the regex. Differs from + 'fnmatch.translate()' in that '*' does not match "special characters" + (which are platform-specific). + """ + pattern_re = fnmatch.translate(pattern) + + # '?' and '*' in the glob pattern become '.' and '.*' in the RE, which + # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix, + # and by extension they shouldn't match such "special characters" under + # any OS. So change all non-escaped dots in the RE to match any + # character except the special characters (currently: just os.sep). + sep = os.sep + if os.sep == '\\': + # we're using a regex to manipulate a regex, so we need + # to escape the backslash twice + sep = r'\\\\' + escaped = r'\1[^%s]' % sep + pattern_re = re.sub(r'((? +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor addcdiv(const at::Tensor & self, const at::Tensor & tensor1, const at::Tensor & tensor2, const at::Scalar & value=1); +TORCH_API at::Tensor & addcdiv_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & tensor1, const at::Tensor & tensor2, const at::Scalar & value=1); +TORCH_API at::Tensor & addcdiv_outf(const at::Tensor & self, const at::Tensor & tensor1, const at::Tensor & tensor2, const at::Scalar & value, at::Tensor & out); +TORCH_API at::Tensor & addcdiv_(at::Tensor & self, const at::Tensor & tensor1, const at::Tensor & tensor2, const at::Scalar & value=1); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/9d/9d02c3b8318aec59e34efdf9879a166871b1123ecb5314e95c798cd5b3d5d67d/blob b/shared/package-files/9d/9d02c3b8318aec59e34efdf9879a166871b1123ecb5314e95c798cd5b3d5d67d/blob new file mode 100644 index 0000000000000000000000000000000000000000..3742aa4fb99c5f0b6aaddfa4f0bfb41bc61f22c1 --- /dev/null +++ b/shared/package-files/9d/9d02c3b8318aec59e34efdf9879a166871b1123ecb5314e95c798cd5b3d5d67d/blob @@ -0,0 +1,36 @@ +# noinspection PyUnresolvedReferences +from .base import ( + clear_script_prefix as clear_script_prefix, + clear_url_caches as clear_url_caches, + get_script_prefix as get_script_prefix, + get_urlconf as get_urlconf, + is_valid_path as is_valid_path, + resolve as resolve, + reverse as reverse, + reverse_lazy as reverse_lazy, + set_script_prefix as set_script_prefix, + set_urlconf as set_urlconf, + translate_url as translate_url, +) + +# noinspection PyUnresolvedReferences +from .conf import include as include, path as path, re_path as re_path + +# noinspection PyUnresolvedReferences +from .converters import register_converter as register_converter + +# noinspection PyUnresolvedReferences +from .exceptions import NoReverseMatch as NoReverseMatch, Resolver404 as Resolver404 + +# noinspection PyUnresolvedReferences +from .resolvers import ( + LocalePrefixPattern as LocalePrefixPattern, + ResolverMatch as ResolverMatch, + URLPattern as URLPattern, + URLResolver as URLResolver, + get_ns_resolver as get_ns_resolver, + get_resolver as get_resolver, +) + +# noinspection PyUnresolvedReferences +from .utils import get_callable as get_callable, get_mod_func as get_mod_func diff --git a/shared/package-files/9d/9d05cf6532f7c5ae129be6be1affbc6e916cfaa00e64792a5a603f9be7522d5c/blob b/shared/package-files/9d/9d05cf6532f7c5ae129be6be1affbc6e916cfaa00e64792a5a603f9be7522d5c/blob new file mode 100644 index 0000000000000000000000000000000000000000..514cda320012316b1f9bc04a76c45159dc5bd181 --- /dev/null +++ b/shared/package-files/9d/9d05cf6532f7c5ae129be6be1affbc6e916cfaa00e64792a5a603f9be7522d5c/blob @@ -0,0 +1,49 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +#pragma once + +#include "arrow/array.h" +#include "arrow/python/platform.h" + +namespace arrow { +namespace py { +namespace internal { +// TODO(ARROW-12976): See if we can refactor Pandas ObjectWriter logic +// to the .cc file and move this there as well if we can. + +// Converts array to a sequency of python objects. +template +inline Status WriteArrayObjects(const ArrayType& arr, WriteValue&& write_func, + Assigner out_values) { + // TODO(ARROW-12976): Use visitor here? + const bool has_nulls = arr.null_count() > 0; + for (int64_t i = 0; i < arr.length(); ++i) { + if (has_nulls && arr.IsNull(i)) { + Py_INCREF(Py_None); + *out_values = Py_None; + } else { + RETURN_NOT_OK(write_func(arr.GetView(i), out_values)); + } + ++out_values; + } + return Status::OK(); +} + +} // namespace internal +} // namespace py +} // namespace arrow diff --git a/shared/package-files/9d/9d096ca5252ed4d6d3bd6310b43d5f27dfecb7e1d12e91c6139c54e18ad0440e/blob b/shared/package-files/9d/9d096ca5252ed4d6d3bd6310b43d5f27dfecb7e1d12e91c6139c54e18ad0440e/blob new file mode 100644 index 0000000000000000000000000000000000000000..20c5b42c213f1e8bcf90dd645d60f68d292a7db6 Binary files /dev/null and b/shared/package-files/9d/9d096ca5252ed4d6d3bd6310b43d5f27dfecb7e1d12e91c6139c54e18ad0440e/blob differ diff --git a/shared/package-files/9d/9d0a17ad8b00f4e187f05cebda3974706ff2162bf718a9c98e15848817ca9a50/blob b/shared/package-files/9d/9d0a17ad8b00f4e187f05cebda3974706ff2162bf718a9c98e15848817ca9a50/blob new file mode 100644 index 0000000000000000000000000000000000000000..367f80850f980ae63fbac81cb493839940659251 --- /dev/null +++ b/shared/package-files/9d/9d0a17ad8b00f4e187f05cebda3974706ff2162bf718a9c98e15848817ca9a50/blob @@ -0,0 +1,12 @@ +prefix=/opt/conda +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libwebpmux +Description: Library for manipulating the WebP graphics format container +Version: 1.3.2 +Requires.private: libwebp >= 0.2.0 +Cflags: -I${includedir} +Libs: -L${libdir} -lwebpmux +Libs.private: -lm diff --git a/shared/package-files/9d/9d0ae52047961633b2d04d646edce5137e48d895af63e6c61aa49d87ac96bf53/blob b/shared/package-files/9d/9d0ae52047961633b2d04d646edce5137e48d895af63e6c61aa49d87ac96bf53/blob new file mode 100644 index 0000000000000000000000000000000000000000..50ead7556f375f3c5699f69a7d65316c501d5a75 --- /dev/null +++ b/shared/package-files/9d/9d0ae52047961633b2d04d646edce5137e48d895af63e6c61aa49d87ac96bf53/blob @@ -0,0 +1,869 @@ +from __future__ import annotations + +import inspect +import logging +import operator +import re +import types +from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union + +import onnxscript # type: ignore[import] +from onnxscript.function_libs.torch_lib import ( # type: ignore[import] + graph_building as onnxscript_graph_building, +) + +import torch +import torch.fx +from torch.onnx import _type_utils as jit_type_utils +from torch.onnx._internal import _beartype +from torch.onnx._internal.fx import ( + _pass, + diagnostics, + onnxfunction_dispatcher, + op_validation, + type_utils as fx_type_utils, +) +from torch.utils import _pytree + + +@_beartype.beartype +def _fx_node_to_onnx_message_formatter( + fn: Callable, + self, + node: torch.fx.Node, + *args, + **kwargs, +) -> str: + return f"FX Node: {node.op}:{node.target}[name={node.name}]. " + + +@_beartype.beartype +def _fx_graph_to_onnx_message_formatter( + fn: Callable, + self, + fx_graph_module: torch.fx.GraphModule, + *args, + **kwargs, +) -> str: + return f"FX Graph: {fx_graph_module._get_name()}. " + + +def _location_from_fx_stack_trace( + node_stack_trace: str, +) -> Optional[diagnostics.infra.Location]: + """Extract location from FX node stack trace. + + TODO(bowbao): Create fx utils module and move this function there. + + Args: + node_stack_trace: The stack trace of the FX node. Example: + + File "path/file.py", line 311, in + + | File "path/file2.py", line 389, in + + + Returns: + location: The location of the FX node. + """ + if "File" not in node_stack_trace: + return None + + lines = node_stack_trace.strip().split("\n") + idx = 0 + while idx < len(lines) and "File" not in lines[idx]: + idx += 1 + if idx + 1 >= len(lines): + return None + + pattern = re.compile(r"^File \"(.+)\", line (\d+), in (.+)$") + matches = pattern.match(lines[idx].strip()) + if matches: + uri = matches.group(1) + line_number = int(matches.group(2)) + snippet = lines[idx + 1].strip() + return diagnostics.infra.Location(uri=uri, line=line_number, snippet=snippet) + return None + + +@_beartype.beartype +def _retrieve_or_adapt_input_to_graph_set( + fx_node_arg: fx_type_utils.Argument, + fx_name_to_onnxscript_value: Dict[ + str, + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + ], + tracer: onnxscript_graph_building.TorchScriptTracingEvaluator, +): + """Map FX value to TorchScript value. + + When creating TorchScript graph from FX graph, we need a mapping from FX variable + to TorchScript variable. This function maps FX variable, fx_node_arg, to torch.jit.Value. + """ + + onnx_tensor = fx_node_arg + if isinstance(onnx_tensor, torch.fx.Node): + # 1. fx_node_arg is a torch.fx.Node, which means + # fx_node_arg stands for the output of that torch.fx.Node. + # 2. fx_node_arg (variable in torch.fx.Graph) is be mapped to + # torch.jit.Value, fx_name_to_onnxscript_value[fx_node_arg.name], + # in TorchScript graph. + return fx_name_to_onnxscript_value[onnx_tensor.name] + elif isinstance(onnx_tensor, (tuple, list)) and any( + isinstance(node, torch.fx.Node) + and fx_type_utils.is_torch_symbolic_type(node.meta.get("val")) + for node in onnx_tensor + ): + # This intends to handle dynamic axes. for example, if the input size of op.Expand + # is dynamic, each dimension would be variable (i.e., sym variable in Pytorch + # FX graph. Note that sym variable is mapped to tensor in ONNX Script world) + # calculated by other operators. + sequence_mixed_elements: List[ + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + List[int], + ] + ] = [] + # onnx_tensor contains a list of scalars which could be one of + # - tensor with empty shape, + # - tensor with tensor with shape (1,), + # - torch.SymInt, + # - int + # - ... + # They should all be promoted to tensor with shape (1,) + # in order to call ONNX's Concat. + for tensor in onnx_tensor: + # Prepare `tensor` as input of ONNX's Concat. + + if isinstance( + tensor, torch.fx.Node + ) and fx_type_utils.is_torch_symbolic_type(tensor.meta.get("val")): + # In this case, tensor is a torch.SymInt from Dynamo's perspective. + # It might be mapped to tensor with shape () or (1,) in ONNX. + element_value = fx_name_to_onnxscript_value[tensor.name] + if isinstance( + element_value, onnxscript_graph_building.TorchScriptTensor + ): + # All elements sequence_mixed_elements will be send to onnx's Concat + # as inputs. Therefore, they are required to have the same rank. + # Since tensors with rank=0 (i.e., scalar) cannot be concated, all + # scalars are promoted to tensors with shape (1,). + with onnxscript.evaluator.default_as(tracer): + element_value = onnxscript.opset18.Reshape(element_value, [1]) # type: ignore[arg-type, type-var] + sequence_mixed_elements.append(element_value) + elif isinstance(tensor, int): + # NOTE: op.Concat doesn't support scalar, so we need to wrap it with + # dim, and onnx-script will promote it to tensor(int64) + sequence_mixed_elements.append([tensor]) + else: + raise RuntimeError( + f"Unsupported type in sequence_mixed_elements: {type(tensor)}" + ) + # Concat all the elements in the sequence. + # shapes are mapped to tensors in ONNX graph (TorchScriptGraph), + # so list of sym_ints is concatenated to a tensor before calling ONNX op. + + # For example: + # inputs: [[2], [4], fx.Node(SymIntA), [1], fx.Node(SymIntB)] + # outputs: op.Concat([op.Constant(2), op.Constant(4), TorchScriptTensor(A), op.Constant(1), TorchScriptTensor(B)]) + + # onnx-script auto wraps python number with op.Constants, + # so we don't need to specifically process them. + with onnxscript.evaluator.default_as(tracer): + output = onnxscript.opset18.Concat(*sequence_mixed_elements, axis=0) # type: ignore[type-var] + output.dtype = torch.int64 # type: ignore[union-attr] + output.shape = [len(sequence_mixed_elements)] # type: ignore[union-attr] + return output + elif isinstance(onnx_tensor, (tuple, list)) and all( + isinstance(node, torch.fx.Node) or node is None for node in onnx_tensor + ): + sequence_elements: List[ + Union[ + Optional[onnxscript_graph_building.TorchScriptTensor], + Tuple[ + onnxscript_graph_building.TorchScriptTensor, + ..., + ], + ] + ] = [] + for tensor in onnx_tensor: + sequence_elements.append( + fx_name_to_onnxscript_value[tensor.name] if tensor is not None else None + ) + return sequence_elements + if isinstance(onnx_tensor, torch.dtype): + onnx_tensor = int( + jit_type_utils.JitScalarType.from_dtype(onnx_tensor).onnx_type() + ) + # NOTE: if device is specified in kwargs (not consumed), it's free to ignored. But + # if it's in args, we need to set it to string for dispatcher to match schema. + if isinstance(onnx_tensor, torch.device): + # torch.device is not supported by onnxscript (no op). We turn it into + # a string. + return str(onnx_tensor) + # all other cases, we do nothing. + return onnx_tensor + + +def filter_incompatible_and_dtype_convert_kwargs(kwargs): + """Filter out kwargs that are not supported by onnxscript.""" + filtered = {} + for key, value in kwargs.items(): + if key in { + "layout", + "device", + "requires_grad", + "pin_memory", + "memory_format", + "implicit", + }: + continue + if key == "dtype": + if value is None: + # We omit if dtype is not provided, because onnxscript handles the + # default case. + continue + else: + value = int(jit_type_utils.JitScalarType.from_dtype(value).onnx_type()) + filtered[key] = value + return filtered + + +@_beartype.beartype +def _fill_tensor_shape_type( + onnxscript_values: Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + name: str, + expected_values: Union[ + fx_type_utils.META_VALUE_TYPE, + List[fx_type_utils.META_VALUE_TYPE], + Tuple[Optional[fx_type_utils.META_VALUE_TYPE], ...], + ], +): + """Fill the meta information of onnxscript_values with that from the fx FakeTensor.""" + + if isinstance(expected_values, (list, tuple)) and not isinstance( + onnxscript_values, (list, tuple) + ): + # ex: aten::split - in onnx_dtype: seq(tensor) + # onnxscript_values is a single tensor, but expected_values is a list of tensors. + return + + flat_onnxscript_values, _ = _pytree.tree_flatten(onnxscript_values) + flat_expected_values, _ = _pytree.tree_flatten(expected_values) + for i, (onnxscript_value, expected_value) in enumerate( + zip(flat_onnxscript_values, flat_expected_values) + ): + if expected_value is None: + # There is no shape/type from None. + # NOTE: according to https://github.com/pytorch/pytorch/blob/main/torch/_meta_registrations.py, + # None could be a valid value for return type, so we need to handle it. + # e.g. the function: meta__scaled_dot_product_flash() in cpu mode. + continue + elif fx_type_utils.is_torch_symbolic_type(expected_value): + # aten::sym_size output is a int, not a tensor, which stands + # for the size of one dim. We treat it as 1-D tensor. + onnxscript_value.dtype = fx_type_utils.from_sym_value_to_torch_dtype( + expected_value + ) + onnxscript_value.shape = torch.Size([1]) + elif isinstance(expected_value, (int, float, bool)): + onnxscript_value.dtype = fx_type_utils.from_scalar_type_to_torch_dtype( + type(expected_value) + ) + onnxscript_value.shape = torch.Size([]) + elif isinstance(expected_value, complex): + # From complex scalar to real representation + onnxscript_value_to_torch_dtype = ( + fx_type_utils.from_scalar_type_to_torch_dtype(type(expected_value)) + ) + onnxscript_value.dtype = ( + fx_type_utils.from_complex_to_float(onnxscript_value_to_torch_dtype) + if onnxscript_value_to_torch_dtype is not None + else None + ) + onnxscript_value.shape = torch.Size([2]) + elif fx_type_utils.is_torch_complex_dtype(expected_value.dtype): + # Like torch.view_as_real, we flatten complex tensors to real tensors with + # additional last dimension of 2 + onnxscript_value.shape = torch.Size((*expected_value.size(), 2)) + # complex64 -> float32, complex128 -> float64, etc. + onnxscript_value.dtype = fx_type_utils.from_complex_to_float( + expected_value.dtype + ) + # Dispatcher needs to know the value is complex + onnxscript_value.is_complex = True + else: + # We set node output sizes to be dynamic to continue the model conversion, + # and inputs are also set to be dynamic in add_input(). + onnxscript_value.shape = expected_value.size() + onnxscript_value.dtype = expected_value.dtype + + # naming + if i > 0: + onnxscript_value.name = f"{name}_{i}" + else: + onnxscript_value.name = name + + +@_beartype.beartype +def _fill_in_default_kwargs( + node: torch.fx.Node, +) -> Tuple[List[fx_type_utils.Argument], Dict[str, fx_type_utils.Argument]]: + """Find and Fill in the not provided kwargs with default values.""" + + # TODO: aten::sym_size has overload, but fx graph is using + # overloadpacket for some reasons. + # https://github.com/pytorch/pytorch/issues/97201 + # We manually assigned overload for aten::sym_size. + if hasattr(node.target, "_schema"): + node_schema = node.target._schema # type: ignore[union-attr] + else: + node_schema = torch.ops.aten.sym_size.int._schema # type: ignore[union-attr] + + # This function assumes the order of arguments in FX op is the + # same as the order of arguments in TorchScript op. + complete_args: List[fx_type_utils.Argument] = [] + complete_kwargs: Dict[str, fx_type_utils.Argument] = {} + + if inspect.isbuiltin(node.target): + complete_args = list(node.args) + else: + for i, expected_arg in enumerate(node_schema.arguments): + if i < len(node.args): + complete_args.append(node.args[i]) + elif expected_arg.name in node.kwargs: + complete_kwargs[expected_arg.name] = node.kwargs[expected_arg.name] + else: + # Get default from schema. + complete_kwargs[expected_arg.name] = expected_arg.default_value + + return complete_args, complete_kwargs + + +@_beartype.beartype +def _wrap_fx_args_as_onnxscript_args( + complete_args: List[fx_type_utils.Argument], + complete_kwargs: Dict[str, fx_type_utils.Argument], + fx_name_to_onnxscript_value: Dict[ + str, + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + ], + tracer: onnxscript_graph_building.TorchScriptTracingEvaluator, +) -> Tuple[ + Sequence[ + Optional[ + Union[ + onnxscript_graph_building.TorchScriptTensor, + str, + int, + float, + bool, + list, + complex, + ] + ] + ], + Dict[str, fx_type_utils.Argument], +]: + """Map all FX arguments of a node to arguments in TorchScript graph.""" + + onnxscript_args = tuple( + _retrieve_or_adapt_input_to_graph_set(arg, fx_name_to_onnxscript_value, tracer) + for arg in complete_args + ) + onnxscript_kwargs = filter_incompatible_and_dtype_convert_kwargs(complete_kwargs) + + return onnxscript_args, onnxscript_kwargs + + +class FxOnnxInterpreter: + """Stateless class to process FX graph Nodes and translate them into their ONNX counterparts. + + All FX nodes described by [FX Graph](https://pytorch.org/docs/stable/fx.html#torch.fx.Graph) are supported. + Similarly to [FX Interpreter pattern](https://pytorch.org/docs/stable/fx.html#torch.fx.Interpreter), each FX node + must be implemented on its own method in this class. + + Each operator's implementation returns either an `onnxscript.OnnxFunction` or + `onnxscript.TracedOnnxFunction` instance based on the dispatch algorithm. They can + also raise RuntimeError: If there are no overloaded functions available for the given FX node. + + TODO: Convert methods to @staticmethod when the diagnostic system supports it + DO NOT ADD NEW ATTRIBUTES TO THIS CLASS! + """ + + def __init__( + self, + diagnostic_context: diagnostics.DiagnosticContext, + ): + # THIS SHOULD BE THE ONLY STATE IN THIS CLASS (constraint from diagnosticS API) + # TODO: Diagnostics API should be revised to get rid of this attribute. + # DO NOT add other class-level attributes. + self.diagnostic_context = diagnostic_context + + @_beartype.beartype + @diagnostics.diagnose_call( + diagnostics.rules.fx_node_to_onnx, + diagnostic_message_formatter=_fx_node_to_onnx_message_formatter, + ) + def run_node( + self, + node, + fx_graph_module: torch.fx.GraphModule, + onnxfunction_dispatcher: onnxfunction_dispatcher.OnnxFunctionDispatcher, + op_level_debug: bool, + onnxscript_graph: onnxscript_graph_building.TorchScriptGraph, + onnxscript_tracer: onnxscript_graph_building.TorchScriptTracingEvaluator, + fx_name_to_onnxscript_value: Dict[ + str, + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + ], + ): + """Execute a single FX node to produce its ONNX counterpart. + + Args: + node: The FX node to be translated. + fx_graph_module: The FX graph module containing the node. + onnxfunction_dispatcher: The dispatcher to find the best matched ONNX op. + op_level_debug (bool): Whether to enable op level debug. + onnxscript_graph: The ONNX graph to be populated. + onnxscript_tracer: The tracer to trace the ONNX graph. + fx_name_to_onnxscript_value: The mapping from FX node name to ONNX Script value. + + Raises: + RuntimeError: When a node.op is not supported. + """ + # Record stack trace of node in diagnostic. + node_stack_trace = node.stack_trace + if node_stack_trace: + diagnostic = self.diagnostic_context.inflight_diagnostic( + rule=diagnostics.rules.fx_node_to_onnx + ) + with diagnostic.log_section(logging.INFO, "PyTorch source information"): + diagnostic.info("```\n%s\n```", node_stack_trace) + location = _location_from_fx_stack_trace(node_stack_trace) + if location is not None: + diagnostic.with_location(location) + + if node.op == "placeholder": + self.placeholder(node, onnxscript_graph, fx_name_to_onnxscript_value) + elif node.op == "get_attr": + self.get_attr( + node, + onnxscript_graph, + fx_name_to_onnxscript_value, + fx_graph_module, + ) + elif node.op == "call_function": + self.call_function( + node, + onnxscript_tracer, + fx_name_to_onnxscript_value, + onnxfunction_dispatcher, + op_level_debug, + fx_graph_module, + ) + elif node.op == "call_method": + self.call_method(node) + elif node.op == "call_module": + self.call_module( + node, + onnxscript_graph, + fx_name_to_onnxscript_value, + onnxscript_tracer, + fx_graph_module, + onnxfunction_dispatcher, + op_level_debug, + ) + elif node.op == "output": + self.output(node, onnxscript_graph, fx_name_to_onnxscript_value) + else: + raise RuntimeError(f"Found node type not defined in torch.fx: {node.op}") + + @_beartype.beartype + @diagnostics.diagnose_call( + diagnostics.rules.fx_graph_to_onnx, + diagnostic_message_formatter=_fx_graph_to_onnx_message_formatter, + ) + def run( + self, + fx_graph_module: torch.fx.GraphModule, + onnxfunction_dispatcher: onnxfunction_dispatcher.OnnxFunctionDispatcher, + op_level_debug: bool, + parent_onnxscript_graph: Optional[ + onnxscript_graph_building.TorchScriptGraph + ] = None, + ) -> onnxscript_graph_building.TorchScriptGraph: + """Analyze all FX nodes and trigger their ONNX translation. + + Args: + fx_graph_module: FX graph module to be translated. + onnxfunction_dispatcher: ONNX function dispatcher. + op_level_debug: Whether to enable op-level debug. + parent_onnxscript_graph: The parent TorchScript graph. Must be provided if + `fx_graph_module` is a submodule. If not provided, + `fx_graph_module` is assumed to be the root module. + """ + diagnostic = self.diagnostic_context.inflight_diagnostic() + with diagnostic.log_section(logging.DEBUG, "FX Graph:"): + diagnostic.debug( + "```\n%s\n```", + diagnostics.LazyString(fx_graph_module.print_readable, False), + ) + + if parent_onnxscript_graph is not None: + # If parent_onnxscript_graph is provided, we assume fx_graph_module is a + # submodule representing a forward call of an nn.Module. + # Compose package and version where the nn.Module is defined as domain name + # for the local function. + + onnx_meta: Optional[_pass.GraphModuleOnnxMeta] = fx_graph_module.meta.get( + "onnx" + ) + if onnx_meta is None: + raise RuntimeError( + f"ONNX meta is not found in submodule {fx_graph_module._get_name()}. " + f"Only submodules produced by `Modularize` pass is supported in ONNX export." + ) + + onnx_domain = onnx_meta.package_info.to_onnx_domain_string() + else: + # Leave as default domain name for the root module. + onnx_domain = None + + onnxscript_graph = onnxscript_graph_building.TorchScriptGraph( + parent_onnxscript_graph, domain_name=onnx_domain + ) + onnxscript_tracer = onnxscript_graph_building.TorchScriptTracingEvaluator( + onnxscript_graph + ) + # In the following loop, a TorchScript graph is created to + # represent the input FX graph with ONNX symbols (e.g., onnx::add). + # To connect the values to nodes in the TorchScript graph, we maintain + # fx_name_to_onnxscript_value. Basically, we want to translate + # fx_tensor_x (type: torch.fx.Node) -> fx_node_1 -> fx_tensor_y (type: torch.fx.Node) + # to + # fx_name_to_onnxscript_value[fx_tensor_x.name] -> onnx_node_1 -> fx_name_to_onnxscript_value[fx_tensor_y.name] + fx_name_to_onnxscript_value: Dict[ + str, + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + ] = {} + + # TODO: Fix FakeTensorMode limitation asap + # We want to pass list of ints and floats to TorchScript graph correctly + # in _export_fx_to_ts, so we must disable FakeTensorMode. Otherwise, graph may + # receive FakeTensor and results runtime error. In addition, TorchScript-based + # ONNX exporter used in _ts_graph_to_onnx_model_in_protobuf is not compatible + # with FakeTensorMode. + with torch.utils._mode_utils.no_dispatch(): + # node_fixed_shape is only used on op_level_debug purpose. + for node in fx_graph_module.graph.nodes: + self.run_node( + node, + fx_graph_module, + onnxfunction_dispatcher, + op_level_debug, + onnxscript_graph, + onnxscript_tracer, + fx_name_to_onnxscript_value, + ) + + with diagnostic.log_section(logging.DEBUG, "ONNX Graph:"): + diagnostic.debug("```\n%s\n```", onnxscript_graph.torch_graph) + + return onnxscript_graph + + @_beartype.beartype + def placeholder( + self, + node: torch.fx.Node, + onnxscript_graph: onnxscript_graph_building.TorchScriptGraph, + fx_name_to_onnxscript_value: Dict[ + str, + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + ], + ): + # Input of graph. + # The node.meta["val"] is generated by FakeTensorProp. + # NOTE: add_input() intends to create nodes with shape/type + fake_tensor = node.meta.get("val", None) + # NOTE: During the tracing, when inputs are constants, they are represented + # by nodes with node.meta['val'] being None (nn.Module to dynamo_export) + # or nodes with node.meta['val'] being a builtin value (ExportedProgram to dynamo_export). + # Nonethless, the nodes are not consumed by others, so we don't need to + # create a TorchScriptTensor for them. + if fake_tensor is None or isinstance(fake_tensor, (int, float, bool, str)): + output = onnxscript_graph.add_input( + input_name=None, + ) + elif isinstance(fake_tensor, torch.Tensor): + # NOTE: ONNX doesn't support tensor of complex64/complex128, so we + # convert them to float32/float64 with real representation. + if fx_type_utils.is_torch_complex_dtype(fake_tensor.dtype): + fake_tensor = torch.view_as_real(fake_tensor.resolve_conj()) + output = onnxscript_graph.add_input( + input_name=node.name, + shape=fake_tensor.shape, + dtype=fake_tensor.dtype, + ) + + elif fx_type_utils.is_torch_symbolic_type(fake_tensor): + output = onnxscript_graph.add_input( + input_name=node.name, + shape=torch.Size([]), + dtype=fx_type_utils.from_sym_value_to_torch_dtype(fake_tensor), + ) + else: + raise RuntimeError( + f"Unsupported type(node.meta['val']) for placeholder: {type(fake_tensor)}" + ) + assert ( + output is not None + ), f"Node creates None with target={node.target} and name={node.name}" + + assert isinstance(output, onnxscript_graph_building.TorchScriptTensor) + assert isinstance(output, onnxscript.tensor.Tensor) + + fx_name_to_onnxscript_value[node.name] = output + + @_beartype.beartype + def call_function( + self, + node: torch.fx.Node, + onnxscript_tracer: onnxscript_graph_building.TorchScriptTracingEvaluator, + fx_name_to_onnxscript_value: Dict[ + str, + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + ], + onnxfunction_dispatcher: onnxfunction_dispatcher.OnnxFunctionDispatcher, + op_level_debug: bool, + fx_graph_module: torch.fx.GraphModule, + ): + # aten ops and other stateless functions. + if node.target == operator.getitem and isinstance( + fx_name_to_onnxscript_value[node.args[0].name], tuple # type: ignore[union-attr,index] + ): + onnx_tensor_tuple = fx_name_to_onnxscript_value[node.args[0].name] # type: ignore[union-attr,index] + index = node.args[1] + output = onnx_tensor_tuple[index] # type: ignore[index] + assert ( + output is not None + ), f"Node creates None with target={node.target} and name={node.name}" + assert isinstance( + output, (onnxscript_graph_building.TorchScriptTensor, tuple) + ), type(output) + + fx_name_to_onnxscript_value[node.name] = output + return + + # Map FX inputs to ONNX inputs and fill optional inputs with default values. + # torch_args and torch_kwargs are for op-level validation + fx_args, fx_kwargs = _fill_in_default_kwargs(node) + + onnx_args, onnx_kwargs = _wrap_fx_args_as_onnxscript_args( + fx_args, + fx_kwargs, + fx_name_to_onnxscript_value, + onnxscript_tracer, + ) + # Dispatch to ONNX op through OpShema. The input argument dtypes are compared to + # function signature in OpSchema, and find the best matched overload. + symbolic_fn = onnxfunction_dispatcher.dispatch( + node=node, + onnx_args=onnx_args, + onnx_kwargs=onnx_kwargs, + diagnostic_context=self.diagnostic_context, + ) + with onnxscript.evaluator.default_as(onnxscript_tracer): + output: Union[ # type: ignore[no-redef] + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ] = symbolic_fn(*onnx_args, **onnx_kwargs) + assert ( + output is not None + ), f"Node creates None with target={node.target}, name={node.name}, args={onnx_args}, kwargs={onnx_kwargs}" + # Assign type and shape from fx graph. + _fill_tensor_shape_type(output, node.name, node.meta["val"]) + # One fx node could produce multiple outputs (e.g., tuple of tensors); in + # that case, v is a tuple of TorchScriptTensors. + assert isinstance( + output, (onnxscript_graph_building.TorchScriptTensor, tuple) + ), type(output) + # NOTE(titaiwang): We bypass two kinds of ops as it's not meaningful to + # validate them with op level debug. + # 1. aten::sym_size: The op is simply get item from a list of tensors. + # 2. BuiltinFunction: It doesn't supported tensor + if ( + op_level_debug + and node.target != torch.ops.aten.sym_size + and not isinstance(node.target, types.BuiltinFunctionType) + ): + op_validation.validate_op_between_ort_torch( + self.diagnostic_context, + node, + symbolic_fn, + fx_args, + fx_kwargs, + fx_graph_module, + ) + fx_name_to_onnxscript_value[node.name] = output + + @_beartype.beartype + def output( + self, + node: torch.fx.Node, + onnxscript_graph: onnxscript_graph_building.TorchScriptGraph, + fx_name_to_onnxscript_value: Dict[ + str, + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + ], + ): + if isinstance(node.args[0], torch.fx.Node): + onnx_tensor_or_tensor_tuple = fx_name_to_onnxscript_value[node.args[0].name] + onnxscript_graph.register_outputs(onnx_tensor_or_tensor_tuple) + else: + # ONNX can't represent collection types (e.g., dictionary, tuple of tuple of + # tensor, etc), we flatten the collection and register each element as output. + flat_args, _ = _pytree.tree_flatten(node.args[0]) + for arg in flat_args: + assert isinstance( + arg, torch.fx.Node + ), f"arg must be a torch.fx.Node, not {type(arg)}" + onnx_tensor_or_tensor_tuple = fx_name_to_onnxscript_value[arg.name] + onnxscript_graph.register_outputs(onnx_tensor_or_tensor_tuple) + + @_beartype.beartype + def call_method(self, node: torch.fx.Node): + # TODO(wechi): Support call_method. + raise RuntimeError("call_method is not supported yet.") + + @_beartype.beartype + def call_module( + self, + node: torch.fx.Node, + parent_onnxscript_graph: onnxscript_graph_building.TorchScriptGraph, + fx_name_to_onnxscript_value: Dict[ + str, + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + ], + tracer: onnxscript_graph_building.TorchScriptTracingEvaluator, + root_fx_graph_module: torch.fx.GraphModule, + onnxfunction_dispatcher: onnxfunction_dispatcher.OnnxFunctionDispatcher, + op_level_debug: bool, + ) -> None: + """Export a fx.GraphModule submodule to ONNXScript graph. + + The export process specifically targets `call_module` nodes that are created by + the exporter's `Modularize` pass. Each `call_module` node has an associated fx.GraphModule + by `node.target` underneath the root fx.GraphModule. These `call_module` nodes are exported as ONNX + function nodes. The related `sub_module` is then exported as an ONNX model local function, + which is represented by another `TorchScriptGraph`. This `TorchScriptGraph` sets the current + `onnxscript_graph` as its parent. + + Args: + node: The call_module node in the FX graph that represents the submodule call. + parent_onnxscript_graph: The parent ONNXScript graph to which the ONNX function and + function node belong. + fx_name_to_onnxscript_value: The mapping from FX node name to ONNXScript value. + tracer: The tracer used to trace the ONNXScript graph. + root_fx_graph_module: The root FX module. + onnxfunction_dispatcher: The dispatcher. + op_level_debug: Whether to enable op-level debug. + """ + assert isinstance( + node.target, str + ), f"node.target must be a str, not {type(node.target)} for node {node}." + + sub_module = root_fx_graph_module.get_submodule(node.target) + + assert isinstance( + sub_module, torch.fx.GraphModule + ), f"sub_module must be a torch.fx.GraphModule, not {type(sub_module)} for node {node}." + + sub_onnxscript_graph = self.run( + sub_module, onnxfunction_dispatcher, op_level_debug, parent_onnxscript_graph + ) + + onnx_args, _ = _wrap_fx_args_as_onnxscript_args( + list(node.args), {}, fx_name_to_onnxscript_value, tracer + ) + + # TODO: We may want to consider other naming styles. The goal is to be stable and + # unique such that it can be easily identified in case of kernel substitution. + # Example for current style is combination of qualified module class name and + # module attribute name: `torch_nn_modules_conv_Conv2d_conv1`. + # Other naming styles such as qualified module class name made unique can also + # be considered. + unique_module_name = f"{sub_module._get_name()}_{node.target}" + + outputs: Union[ # type: ignore[no-redef] + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ] = parent_onnxscript_graph.add_module_call( + unique_module_name, sub_onnxscript_graph, onnx_args + ) + + assert isinstance( + outputs, (onnxscript_graph_building.TorchScriptTensor, tuple) + ), f"Unexpected outputs type {type(outputs)} for node {node}." + + _fill_tensor_shape_type(outputs, node.name, node.meta["val"]) + fx_name_to_onnxscript_value[node.name] = outputs + + # Skip op_level_validation for call_module. Subgraph nodes are validated individually. + + @_beartype.beartype + def get_attr( + self, + node: torch.fx.Node, + onnxscript_graph: onnxscript_graph_building.TorchScriptGraph, + fx_name_to_onnxscript_value: Dict[ + str, + Union[ + onnxscript_graph_building.TorchScriptTensor, + Tuple[onnxscript_graph_building.TorchScriptTensor, ...], + ], + ], + fx_graph_module: torch.fx.GraphModule, + ): + assert isinstance(node.target, str), f"node.target {node.target} is not a str." + attr_tensor = getattr(fx_graph_module, node.target) + assert isinstance(attr_tensor, torch.Tensor), f"{attr_tensor} is not a tensor." + + # Parameter/buffer name cannot contain "." + # Revert from "/" to restore namespace formatting. + input_ = onnxscript_graph.add_initializer( + name=node.target.replace("/", "."), + value=attr_tensor, + ) + + assert isinstance(input_, onnxscript_graph_building.TorchScriptTensor) + assert isinstance(input_, onnxscript.tensor.Tensor) + fx_name_to_onnxscript_value[node.name] = input_ diff --git a/shared/package-files/9d/9d0be8462097f393b89818a0896dcfb693484875eb7ac5ce100cea61a8b9aa53/blob b/shared/package-files/9d/9d0be8462097f393b89818a0896dcfb693484875eb7ac5ce100cea61a8b9aa53/blob new file mode 100644 index 0000000000000000000000000000000000000000..7563f1ce877bc71409360f89a3d937e8ffbcbd00 --- /dev/null +++ b/shared/package-files/9d/9d0be8462097f393b89818a0896dcfb693484875eb7ac5ce100cea61a8b9aa53/blob @@ -0,0 +1,1236 @@ +""" +Test np.datetime64 and np.timedelta64 support. +""" + +# NOTE: datetime64 and timedelta64 ufuncs are tested in test_ufuncs. + + +import contextlib +import itertools +import re +import unittest +import warnings + +import numpy as np + +from numba import jit, vectorize, njit +from numba.np.numpy_support import numpy_version +from numba.core import types, config +from numba.core.errors import TypingError +from numba.tests.support import TestCase, tag, skip_parfors_unsupported +from numba.np import npdatetime_helpers, numpy_support +from numba.np import types as npy_types + +TIMEDELTA_M = np.dtype('timedelta64[M]') +TIMEDELTA_Y = np.dtype('timedelta64[Y]') + +def value_unit(val): + ty = numpy_support.from_dtype(val.dtype) + return ty.unit + + +date_units = ('Y', 'M') +time_units = ('W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', 'ps', 'fs', 'as') +# All except generic ("") +all_units = date_units + time_units + + +def add_usecase(x, y): + return x + y + +def sub_usecase(x, y): + return x - y + +def mul_usecase(x, y): + return x * y + +def div_usecase(x, y): + return x / y + +def floordiv_usecase(x, y): + return x // y + +def eq_usecase(x, y): + return x == y + +def ne_usecase(x, y): + return x != y + +def lt_usecase(x, y): + return x < y + +def le_usecase(x, y): + return x <= y + +def gt_usecase(x, y): + return x > y + +def ge_usecase(x, y): + return x >= y + +def pos_usecase(x): + return +x + +def neg_usecase(x): + return -x + +def abs_usecase(x): + return abs(x) + +def hash_usecase(x): + return hash(x) + +def min_usecase(x, y): + return min(x, y) + +def max_usecase(x, y): + return max(x, y) + +def int_cast_usecase(x): + return int(x) + +def make_add_constant(const): + def add_constant(x): + return x + const + return add_constant + + +class TestModuleHelpers(TestCase): + """ + Test the various helpers in numba.npdatetime_helpers. + """ + + def test_can_cast_timedelta(self): + f = npdatetime_helpers.can_cast_timedelta_units + for a, b in itertools.product(date_units, time_units): + self.assertFalse(f(a, b), (a, b)) + self.assertFalse(f(b, a), (a, b)) + for unit in all_units: + self.assertFalse(f(unit, '')) + self.assertTrue(f('', unit)) + for unit in all_units + ('',): + self.assertTrue(f(unit, unit)) + + def check_units_group(group): + for i, a in enumerate(group): + for b in group[:i]: + # large into smaller is ok + self.assertTrue(f(b, a)) + # small into larger is not + self.assertFalse(f(a, b)) + + check_units_group(date_units) + check_units_group(time_units) + + def test_timedelta_conversion(self): + f = npdatetime_helpers.get_timedelta_conversion_factor + for unit in all_units + ('',): + self.assertEqual(f(unit, unit), 1) + for unit in all_units: + self.assertEqual(f('', unit), 1) + for a, b in itertools.product(time_units, date_units): + self.assertIs(f(a, b), None) + self.assertIs(f(b, a), None) + + def check_units_group(group): + for i, a in enumerate(group): + for b in group[:i]: + self.assertGreater(f(b, a), 1, (b, a)) + self.assertIs(f(a, b), None) + + check_units_group(date_units) + check_units_group(time_units) + + # Check some hand-picked values + self.assertEqual(f('Y', 'M'), 12) + self.assertEqual(f('W', 'h'), 24 * 7) + self.assertEqual(f('W', 'm'), 24 * 7 * 60) + self.assertEqual(f('W', 'us'), 24 * 7 * 3600 * 1000 * 1000) + + def test_datetime_timedelta_scaling(self): + f = npdatetime_helpers.get_datetime_timedelta_conversion + def check_error(dt_unit, td_unit): + with self.assertRaises(RuntimeError): + f(dt_unit, td_unit) + # Cannot combine a Y or M timedelta64 with a finer-grained datetime64 + for dt_unit, td_unit in itertools.product(time_units, date_units): + check_error(dt_unit, td_unit) + # Sanity check that all other unit pairs can be converted, we'll + # check individual results below + for dt_unit, td_unit in itertools.product(time_units, time_units): + f(dt_unit, td_unit) + for dt_unit, td_unit in itertools.product(date_units, time_units): + f(dt_unit, td_unit) + for dt_unit, td_unit in itertools.product(date_units, date_units): + f(dt_unit, td_unit) + # No-op conversions + for unit in all_units: + self.assertEqual(f(unit, unit), (unit, 1, 1)) + self.assertEqual(f(unit, ''), (unit, 1, 1)) + self.assertEqual(f('', unit), ('', 1, 1)) + self.assertEqual(f('', ''), ('', 1, 1)) + # "Regular" values + self.assertEqual(f('Y', 'M'), ('M', 12, 1)) + self.assertEqual(f('M', 'Y'), ('M', 1, 12)) + self.assertEqual(f('W', 'D'), ('D', 7, 1)) + self.assertEqual(f('D', 'W'), ('D', 1, 7)) + self.assertEqual(f('W', 's'), ('s', 7 * 24 * 3600, 1)) + self.assertEqual(f('s', 'W'), ('s', 1, 7 * 24 * 3600)) + self.assertEqual(f('s', 'as'), ('as', 1000 ** 6, 1)) + self.assertEqual(f('as', 's'), ('as', 1, 1000 ** 6)) + # "Interesting" values + self.assertEqual(f('Y', 'D'), ('D', 97 + 400 * 365, 400)) + self.assertEqual(f('Y', 'W'), ('W', 97 + 400 * 365, 400 * 7)) + self.assertEqual(f('M', 'D'), ('D', 97 + 400 * 365, 400 * 12)) + self.assertEqual(f('M', 'W'), ('W', 97 + 400 * 365, 400 * 12 * 7)) + self.assertEqual(f('Y', 's'), ('s', (97 + 400 * 365) * 24 * 3600, 400)) + self.assertEqual(f('M', 's'), ('s', (97 + 400 * 365) * 24 * 3600, 400 * 12)) + + def test_combine_datetime_timedelta_units(self): + f = npdatetime_helpers.combine_datetime_timedelta_units + for unit in all_units: + self.assertEqual(f(unit, unit), unit) + self.assertEqual(f('', unit), unit) + self.assertEqual(f(unit, ''), unit) + self.assertEqual(f('', ''), '') + for dt_unit, td_unit in itertools.product(time_units, date_units): + self.assertIs(f(dt_unit, td_unit), None) + for dt_unit, td_unit in itertools.product(date_units, time_units): + self.assertEqual(f(dt_unit, td_unit), td_unit) + + def test_same_kind(self): + f = npdatetime_helpers.same_kind + for u in all_units: + self.assertTrue(f(u, u)) + A = ('Y', 'M', 'W', 'D') + B = ('h', 'm', 's', 'ms', 'us', 'ns', 'ps', 'fs', 'as') + for a, b in itertools.product(A, A): + self.assertTrue(f(a, b)) + for a, b in itertools.product(B, B): + self.assertTrue(f(a, b)) + for a, b in itertools.product(A, B): + self.assertFalse(f(a, b)) + self.assertFalse(f(b, a)) + + +TD = np.timedelta64 +DT = np.datetime64 + + +class TestMiscCompiling(TestCase): + + def test_jit_explicit_signature(self): + def _check_explicit_signature(sig): + f = jit(sig, nopython=True)(add_usecase) + # Just a sanity check + args = DT(1, 'ms'), TD(2, 'us') + expected = add_usecase(*args) + self.assertPreciseEqual(f(*args), expected) + + # Test passing the signature in object form + sig = npy_types.NPDatetime('us')(npy_types.NPDatetime('ms'), npy_types.NPTimedelta('us')) + _check_explicit_signature(sig) + # Same with the signature in string form + sig = "NPDatetime('us')(NPDatetime('ms'), NPTimedelta('us'))" + _check_explicit_signature(sig) + + def test_vectorize_explicit_signature(self): + def _check_explicit_signature(sig): + f = vectorize([sig], nopython=True)(mul_usecase) + # This isn't really right but we can't do better than this, + # since Numpy's ufuncs don't store the metadata of return types. + # Related to https://github.com/numpy/numpy/issues/5429 + self.assertPreciseEqual(f(TD(2), 3), TD(6)) + + # Test passing the signature in object form (issue #917) + sig = npy_types.NPTimedelta('s')(npy_types.NPTimedelta('s'), types.int64) + _check_explicit_signature(sig) + # Same with the signature in string form + sig = "NPTimedelta('s')(NPTimedelta('s'), int64)" + _check_explicit_signature(sig) + + def test_constant_datetime(self): + def check(const): + pyfunc = make_add_constant(const) + f = jit(nopython=True)(pyfunc) + x = TD(4, 'D') + expected = pyfunc(x) + self.assertPreciseEqual(f(x), expected) + check(DT('2001-01-01')) + check(DT('NaT', 'D')) + + def test_constant_timedelta(self): + def check(const): + pyfunc = make_add_constant(const) + f = jit(nopython=True)(pyfunc) + x = TD(4, 'D') + expected = pyfunc(x) + self.assertPreciseEqual(f(x), expected) + check(TD(4, 'D')) + check(TD(-4, 'D')) + check(TD('NaT', 'D')) + + +class TestTimedeltaArithmetic(TestCase): + + jitargs = dict(forceobj=True) + + def jit(self, pyfunc): + return jit(**self.jitargs)(pyfunc) + + def test_add(self): + f = self.jit(add_usecase) + def check(a, b, expected): + self.assertPreciseEqual(f(a, b), expected) + self.assertPreciseEqual(f(b, a), expected) + + check(TD(1), TD(2), TD(3)) + check(TD(1, 's'), TD(2, 's'), TD(3, 's')) + # Implicit unit promotion + check(TD(1, 's'), TD(2, 'us'), TD(1000002, 'us')) + check(TD(1, 'W'), TD(2, 'D'), TD(9, 'D')) + # NaTs + check(TD('NaT'), TD(1), TD('NaT')) + check(TD('NaT', 's'), TD(1, 'D'), TD('NaT', 's')) + check(TD('NaT', 's'), TD(1, 'ms'), TD('NaT', 'ms')) + # Cannot add days and months + with self.assertRaises((TypeError, TypingError)): + f(TD(1, 'M'), TD(1, 'D')) + + def test_sub(self): + f = self.jit(sub_usecase) + def check(a, b, expected): + self.assertPreciseEqual(f(a, b), expected) + self.assertPreciseEqual(f(b, a), -expected) + + check(TD(3), TD(2), TD(1)) + check(TD(3, 's'), TD(2, 's'), TD(1, 's')) + # Implicit unit promotion + check(TD(3, 's'), TD(2, 'us'), TD(2999998, 'us')) + check(TD(1, 'W'), TD(2, 'D'), TD(5, 'D')) + # NaTs + check(TD('NaT'), TD(1), TD('NaT')) + check(TD('NaT', 's'), TD(1, 'D'), TD('NaT', 's')) + check(TD('NaT', 's'), TD(1, 'ms'), TD('NaT', 'ms')) + # Cannot sub days to months + with self.assertRaises((TypeError, TypingError)): + f(TD(1, 'M'), TD(1, 'D')) + + def test_mul(self): + f = self.jit(mul_usecase) + def check(a, b, expected): + self.assertPreciseEqual(f(a, b), expected) + self.assertPreciseEqual(f(b, a), expected) + + # non-int64 int * timedelta64 + check(TD(3), np.uint32(2), TD(6)) + # int * timedelta64 + check(TD(3), 2, TD(6)) + check(TD(3, 'ps'), 2, TD(6, 'ps')) + check(TD('NaT', 'ps'), 2, TD('NaT', 'ps')) + # float * timedelta64 + check(TD(7), 1.5, TD(10)) + check(TD(-7), 1.5, TD(-10)) + check(TD(7, 'ps'), -1.5, TD(-10, 'ps')) + check(TD(-7), -1.5, TD(10)) + check(TD('NaT', 'ps'), -1.5, TD('NaT', 'ps')) + check(TD(7, 'ps'), float('nan'), TD('NaT', 'ps')) + if numpy_version < (2, 5): + # wraparound on overflow, post NumPy 2.5, + # timedelta64s raise on overflow instead. + check(TD(2**62, 'ps'), 16, TD(0, 'ps')) + + def test_div(self): + div = self.jit(div_usecase) + floordiv = self.jit(floordiv_usecase) + def check(a, b, expected): + self.assertPreciseEqual(div(a, b), expected) + self.assertPreciseEqual(floordiv(a, b), expected) + + # timedelta64 / non-int64 int + check(TD(-3, 'ps'), np.uint32(2), TD(-1, 'ps')) + # timedelta64 / int + check(TD(3), 2, TD(1)) + check(TD(-3, 'ps'), 2, TD(-1, 'ps')) + check(TD('NaT', 'ps'), 2, TD('NaT', 'ps')) + check(TD(3, 'ps'), 0, TD('NaT', 'ps')) + check(TD('NaT', 'ps'), 0, TD('NaT', 'ps')) + # timedelta64 / float + check(TD(7), 0.5, TD(14)) + check(TD(-7, 'ps'), 1.5, TD(-4, 'ps')) + check(TD('NaT', 'ps'), 2.5, TD('NaT', 'ps')) + check(TD(3, 'ps'), 0.0, TD('NaT', 'ps')) + check(TD('NaT', 'ps'), 0.0, TD('NaT', 'ps')) + check(TD(3, 'ps'), float('nan'), TD('NaT', 'ps')) + check(TD('NaT', 'ps'), float('nan'), TD('NaT', 'ps')) + + def test_homogeneous_div(self): + div = self.jit(div_usecase) + def check(a, b, expected): + self.assertPreciseEqual(div(a, b), expected) + + # timedelta64 / timedelta64 + check(TD(7), TD(3), 7. / 3.) + check(TD(7, 'us'), TD(3, 'ms'), 7. / 3000.) + check(TD(7, 'ms'), TD(3, 'us'), 7000. / 3.) + check(TD(7), TD(0), float('+inf')) + check(TD(-7), TD(0), float('-inf')) + check(TD(0), TD(0), float('nan')) + # NaTs + check(TD('nat'), TD(3), float('nan')) + check(TD(3), TD('nat'), float('nan')) + check(TD('nat'), TD(0), float('nan')) + # Cannot div months with days + with self.assertRaises((TypeError, TypingError)): + div(TD(1, 'M'), TD(1, 'D')) + + def test_eq_ne(self): + eq = self.jit(eq_usecase) + ne = self.jit(ne_usecase) + def check(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # all NaT comparisons are False, including NaT==NaT, + # conversely != is True + if np.isnat(a) or np.isnat(a): + expected_val = False + not_expected_val = True + + self.assertPreciseEqual(eq(a, b), expected_val) + self.assertPreciseEqual(eq(b, a), expected_val) + self.assertPreciseEqual(ne(a, b), not_expected_val) + self.assertPreciseEqual(ne(b, a), not_expected_val) + + check(TD(1), TD(2), False) + check(TD(1), TD(1), True) + check(TD(1, 's'), TD(2, 's'), False) + check(TD(1, 's'), TD(1, 's'), True) + check(TD(2000, 's'), TD(2, 's'), False) + check(TD(2000, 'ms'), TD(2, 's'), True) + check(TD(1, 'Y'), TD(12, 'M'), True) + # NaTs + check(TD('Nat'), TD('Nat'), True) + check(TD('Nat', 'ms'), TD('Nat', 's'), True) + check(TD('Nat'), TD(1), False) + # Incompatible units => timedeltas compare unequal + if numpy_version < (1, 25): + check(TD(1, 'Y'), TD(365, 'D'), False) + check(TD(1, 'Y'), TD(366, 'D'), False) + # ... except when both are NaT! + check(TD('NaT', 'W'), TD('NaT', 'D'), True) + else: + # incompatible units raise + # The exception is different depending on Python mode + with self.assertRaises((TypeError, TypingError)): + eq(TD(1, 'Y'), TD(365, 'D')) + with self.assertRaises((TypeError, TypingError)): + ne(TD(1, 'Y'), TD(365, 'D')) + + def test_lt_ge(self): + lt = self.jit(lt_usecase) + ge = self.jit(ge_usecase) + def check(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # since np 1.16 all NaT magnitude comparisons including equality + # are False (as NaT == NaT is now False) + if np.isnat(a) or np.isnat(a): + expected_val = False + not_expected_val = False + + self.assertPreciseEqual(lt(a, b), expected_val) + self.assertPreciseEqual(ge(a, b), not_expected_val) + + check(TD(1), TD(2), True) + check(TD(1), TD(1), False) + check(TD(2), TD(1), False) + check(TD(1, 's'), TD(2, 's'), True) + check(TD(1, 's'), TD(1, 's'), False) + check(TD(2, 's'), TD(1, 's'), False) + check(TD(1, 'm'), TD(61, 's'), True) + check(TD(1, 'm'), TD(60, 's'), False) + # NaTs + check(TD('Nat'), TD('Nat'), False) + check(TD('Nat', 'ms'), TD('Nat', 's'), False) + check(TD('Nat'), TD(-(2**63)+1), True) + # Incompatible units => exception raised + with self.assertRaises((TypeError, TypingError)): + lt(TD(1, 'Y'), TD(365, 'D')) + with self.assertRaises((TypeError, TypingError)): + ge(TD(1, 'Y'), TD(365, 'D')) + # ... even when both are NaT + with self.assertRaises((TypeError, TypingError)): + lt(TD('NaT', 'Y'), TD('NaT', 'D')) + with self.assertRaises((TypeError, TypingError)): + ge(TD('NaT', 'Y'), TD('NaT', 'D')) + + def test_le_gt(self): + le = self.jit(le_usecase) + gt = self.jit(gt_usecase) + def check(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # since np 1.16 all NaT magnitude comparisons including equality + # are False (as NaT == NaT is now False) + if np.isnat(a) or np.isnat(a): + expected_val = False + not_expected_val = False + self.assertPreciseEqual(le(a, b), expected_val) + self.assertPreciseEqual(gt(a, b), not_expected_val) + + check(TD(1), TD(2), True) + check(TD(1), TD(1), True) + check(TD(2), TD(1), False) + check(TD(1, 's'), TD(2, 's'), True) + check(TD(1, 's'), TD(1, 's'), True) + check(TD(2, 's'), TD(1, 's'), False) + check(TD(1, 'm'), TD(61, 's'), True) + check(TD(1, 'm'), TD(60, 's'), True) + check(TD(1, 'm'), TD(59, 's'), False) + # NaTs + check(TD('Nat'), TD('Nat'), True) + check(TD('Nat', 'ms'), TD('Nat', 's'), True) + check(TD('Nat'), TD(-(2**63)+1), True) + # Incompatible units => exception raised + with self.assertRaises((TypeError, TypingError)): + le(TD(1, 'Y'), TD(365, 'D')) + with self.assertRaises((TypeError, TypingError)): + gt(TD(1, 'Y'), TD(365, 'D')) + # ... even when both are NaT + with self.assertRaises((TypeError, TypingError)): + le(TD('NaT', 'Y'), TD('NaT', 'D')) + with self.assertRaises((TypeError, TypingError)): + gt(TD('NaT', 'Y'), TD('NaT', 'D')) + + def test_pos(self): + pos = self.jit(pos_usecase) + def check(a): + self.assertPreciseEqual(pos(a), +a) + + check(TD(3)) + check(TD(-4)) + check(TD(3, 'ms')) + check(TD(-4, 'ms')) + check(TD('NaT')) + check(TD('NaT', 'ms')) + + def test_neg(self): + neg = self.jit(neg_usecase) + def check(a): + self.assertPreciseEqual(neg(a), -a) + + check(TD(3)) + check(TD(-4)) + check(TD(3, 'ms')) + check(TD(-4, 'ms')) + check(TD('NaT')) + check(TD('NaT', 'ms')) + + def test_abs(self): + f = self.jit(abs_usecase) + def check(a): + self.assertPreciseEqual(f(a), abs(a)) + + check(TD(3)) + check(TD(-4)) + check(TD(3, 'ms')) + check(TD(-4, 'ms')) + check(TD('NaT')) + check(TD('NaT', 'ms')) + + def test_hash(self): + f = self.jit(hash_usecase) + def check(a): + if numpy_version >= (2, 2): + # Generic timedeltas (those without a unit) + # are no longer hashable beyond NumPy 2.2 + # Non-generic timedeltas will have dtype name + # as timedelta64[] + if a.dtype.name == 'timedelta64': + return + + # If the function is not being compiled in objmode + # then the hash should be equal to the hash of the + # integer representation of the timedelta + if self.jitargs.get('nopython', False): + self.assertPreciseEqual(f(a), a.astype(int)) + else: + self.assertPreciseEqual(f(a), hash(a)) + else: + self.assertPreciseEqual(f(a), hash(a)) + + TD_CASES = ((3,), (-4,), (3, 'ms'), (-4, 'ms'), (27, 'D'), + (2, 'D'), (2, 'W'), (2, 'Y'), (3, 'W'), + (365, 'D'), (10000, 'D'), (-10000, 'D'), + ('NaT',), ('NaT', 'ms'), ('NaT', 'D'), (-1,)) + DT_CASES = (('2014',), ('2016',), ('2000',), ('2014-02',), + ('2014-03',), ('2014-04',), ('2016-02',), ('2000-12-31',), + ('2014-01-16',), ('2014-01-05',), ('2014-01-07',), + ('2014-01-06',), ('2014-02-02',), ('2014-02-27',), + ('2014-02-16',), ('2014-03-01',), ('2000-01-01T01:02:03.002Z',), + ('2000-01-01T01:02:03Z',), ('NaT',)) + + for case, typ in zip(TD_CASES + DT_CASES, + (TD,) * len(TD_CASES) + (DT,) * len(TD_CASES)): + check(typ(*case)) + + if numpy_version >= (2, 2): + with self.assertRaises(ValueError) as raises: + f(TD(3)) + self.assertIn("Can't hash generic timedelta64", str(raises.exception)) + + def _test_min_max(self, usecase): + f = self.jit(usecase) + def check(a, b): + self.assertPreciseEqual(f(a, b), usecase(a, b)) + + for cases in ( + (TD(0), TD(1), TD(2), TD('NaT')), + (TD(0, 's'), TD(1, 's'), TD(2, 's'), TD('NaT', 's')), + ): + for a, b in itertools.product(cases, cases): + check(a, b) + + def test_min(self): + self._test_min_max(min_usecase) + + def test_max(self): + self._test_min_max(max_usecase) + + +class TestTimedeltaArithmeticNoPython(TestTimedeltaArithmetic): + + jitargs = dict(nopython=True) + + def test_int_cast(self): + f = self.jit(int_cast_usecase) + def check(a): + self.assertPreciseEqual(f(a), int(a)) + + for (delta, unit) in ((3, 'ns'), (-4, 'ns'), (30000, 'ns'), + (-40000000, 'ns'), (1, 'Y')): + check(TD(delta, unit).astype('timedelta64[ns]')) + + for time in ('2014', '2016', '2000', '2014-02', '2014-03', '2014-04', + '2016-02', '2000-12-31', '2014-01-16', '2014-01-05', + '2014-01-07', '2014-01-06', '2014-02-02', '2014-02-27', + '2014-02-16', '2014-03-01', '2000-01-01T01:02:03.002Z', + '2000-01-01T01:02:03Z'): + check(DT(time).astype('datetime64[ns]')) + + with self.assertRaises(TypingError, msg=('Only datetime64[ns] can be ' + + 'converted, but got ' + + 'datetime64[y]')): + f(DT('2014')) + + +class TestDatetimeArithmetic(TestCase): + + jitargs = dict(forceobj=True) + + def jit(self, pyfunc): + return jit(**self.jitargs)(pyfunc) + + @contextlib.contextmanager + def silence_numpy_warnings(self): + # Numpy can raise warnings when combining e.g. a generic timedelta64 + # with a non-generic datetime64. + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', + message='Implicitly casting between incompatible kinds', + category=DeprecationWarning) + yield + + def test_add_sub_timedelta(self): + """ + Test `datetime64 + timedelta64` and `datetime64 - timedelta64`. + """ + add = self.jit(add_usecase) + sub = self.jit(sub_usecase) + def check(a, b, expected): + with self.silence_numpy_warnings(): + self.assertPreciseEqual(add(a, b), expected, (a, b)) + self.assertPreciseEqual(add(b, a), expected, (a, b)) + self.assertPreciseEqual(sub(a, -b), expected, (a, b)) + # Did we get it right? + self.assertPreciseEqual(a + b, expected) + + # Y + ... + check(DT('2014'), TD(2, 'Y'), DT('2016')) + check(DT('2014'), TD(2, 'M'), DT('2014-03')) + check(DT('2014'), TD(3, 'W'), DT('2014-01-16', 'W')) + check(DT('2014'), TD(4, 'D'), DT('2014-01-05')) + check(DT('2000'), TD(365, 'D'), DT('2000-12-31')) + # M + ... + check(DT('2014-02'), TD(2, 'Y'), DT('2016-02')) + check(DT('2014-02'), TD(2, 'M'), DT('2014-04')) + check(DT('2014-02'), TD(2, 'D'), DT('2014-02-03')) + # W + ... + check(DT('2014-01-07', 'W'), TD(2, 'W'), DT('2014-01-16', 'W')) + # D + ... + check(DT('2014-02-02'), TD(27, 'D'), DT('2014-03-01')) + check(DT('2012-02-02'), TD(27, 'D'), DT('2012-02-29')) + check(DT('2012-02-02'), TD(2, 'W'), DT('2012-02-16')) + # s + ... + check(DT('2000-01-01T01:02:03Z'), TD(2, 'h'), DT('2000-01-01T03:02:03Z')) + check(DT('2000-01-01T01:02:03Z'), TD(2, 'ms'), DT('2000-01-01T01:02:03.002Z')) + # More thorough checking with leap years and faraway years + for dt_str in ('600', '601', '604', '801', + '1900', '1904', '2200', '2300', '2304', + '2400', '6001'): + for dt_suffix in ('', '-01', '-12'): + dt = DT(dt_str + dt_suffix) + for td in [TD(2, 'D'), TD(2, 'W'), + TD(100, 'D'), TD(10000, 'D'), + TD(-100, 'D'), TD(-10000, 'D'), + TD(100, 'W'), TD(10000, 'W'), + TD(-100, 'W'), TD(-10000, 'W'), + TD(100, 'M'), TD(10000, 'M'), + TD(-100, 'M'), TD(-10000, 'M')]: + self.assertEqual(add(dt, td), dt + td, (dt, td)) + self.assertEqual(add(td, dt), dt + td, (dt, td)) + self.assertEqual(sub(dt, -td), dt + td, (dt, td)) + + # NaTs + check(DT('NaT'), TD(2), DT('NaT')) + check(DT('NaT', 's'), TD(2, 'h'), DT('NaT', 's')) + check(DT('NaT', 's'), TD(2, 'ms'), DT('NaT', 'ms')) + check(DT('2014'), TD('NaT', 'W'), DT('NaT', 'W')) + check(DT('2014-01-01'), TD('NaT', 'W'), DT('NaT', 'D')) + check(DT('NaT', 's'), TD('NaT', 'ms'), DT('NaT', 'ms')) + + # Cannot add datetime days and timedelta months or years + for f in (add, sub): + with self.assertRaises((TypeError, TypingError)): + f(DT(1, '2014-01-01'), TD(1, 'Y')) + with self.assertRaises((TypeError, TypingError)): + f(DT(1, '2014-01-01'), TD(1, 'M')) + + def datetime_samples(self): + dt_years = ['600', '601', '604', '1968', '1969', '1973', + '2000', '2004', '2005', '2100', '2400', '2401'] + dt_suffixes = ['', '-01', '-12', '-02-28', '-12-31', + '-01-05T12:30:56Z', '-01-05T12:30:56.008Z'] + dts = [DT(a + b) for (a, b) in itertools.product(dt_years, dt_suffixes)] + dts += [DT(s, 'W') for s in dt_years] + return dts + + def test_datetime_difference(self): + """ + Test `datetime64 - datetime64`. + """ + sub = self.jit(sub_usecase) + def check(a, b, expected=None): + with self.silence_numpy_warnings(): + self.assertPreciseEqual(sub(a, b), a - b, (a, b)) + self.assertPreciseEqual(sub(b, a), b - a, (a, b)) + # Did we get it right? + self.assertPreciseEqual(a - b, expected) + + check(DT('2014'), DT('2017'), TD(-3, 'Y')) + check(DT('2014-02'), DT('2017-01'), TD(-35, 'M')) + check(DT('2014-02-28'), DT('2015-03-01'), TD(-366, 'D')) + # NaTs + check(DT('NaT', 'M'), DT('2000'), TD('NaT', 'M')) + check(DT('NaT', 'M'), DT('2000-01-01'), TD('NaT', 'D')) + check(DT('NaT'), DT('NaT'), TD('NaT')) + # Test many more values + with self.silence_numpy_warnings(): + dts = self.datetime_samples() + for a, b in itertools.product(dts, dts): + if (not npdatetime_helpers.same_kind(value_unit(a), value_unit(b))): + continue + self.assertPreciseEqual(sub(a, b), a - b, (a, b)) + + def test_comparisons(self): + # Test all datetime comparisons all at once + eq = self.jit(eq_usecase) + ne = self.jit(ne_usecase) + lt = self.jit(lt_usecase) + le = self.jit(le_usecase) + gt = self.jit(gt_usecase) + ge = self.jit(ge_usecase) + + def check_eq(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # since np 1.16 all NaT comparisons bar != are False, including + # NaT==NaT + if np.isnat(a) or np.isnat(b): + expected_val = False + not_expected_val = True + self.assertFalse(le(a, b), (a, b)) + self.assertFalse(ge(a, b), (a, b)) + self.assertFalse(le(b, a), (a, b)) + self.assertFalse(ge(b, a), (a, b)) + self.assertFalse(lt(a, b), (a, b)) + self.assertFalse(gt(a, b), (a, b)) + self.assertFalse(lt(b, a), (a, b)) + self.assertFalse(gt(b, a), (a, b)) + + with self.silence_numpy_warnings(): + self.assertPreciseEqual(eq(a, b), expected_val, (a, b, expected)) + self.assertPreciseEqual(eq(b, a), expected_val, (a, b, expected)) + self.assertPreciseEqual(ne(a, b), not_expected_val, (a, b, expected)) + self.assertPreciseEqual(ne(b, a), not_expected_val, (a, b, expected)) + if expected_val: + # If equal, then equal-ordered comparisons are true + self.assertTrue(le(a, b), (a, b)) + self.assertTrue(ge(a, b), (a, b)) + self.assertTrue(le(b, a), (a, b)) + self.assertTrue(ge(b, a), (a, b)) + # and strictly ordered comparisons are false + self.assertFalse(lt(a, b), (a, b)) + self.assertFalse(gt(a, b), (a, b)) + self.assertFalse(lt(b, a), (a, b)) + self.assertFalse(gt(b, a), (a, b)) + # Did we get it right? + self.assertPreciseEqual(a == b, expected_val) + + def check_lt(a, b, expected): + expected_val = expected + not_expected_val = not expected + + # since np 1.16 all NaT magnitude comparisons including equality + # are False (as NaT == NaT is now False) + if np.isnat(a) or np.isnat(b): + expected_val = False + not_expected_val = False + + with self.silence_numpy_warnings(): + lt = self.jit(lt_usecase) + self.assertPreciseEqual(lt(a, b), expected_val, (a, b, expected)) + self.assertPreciseEqual(gt(b, a), expected_val, (a, b, expected)) + self.assertPreciseEqual(ge(a, b), not_expected_val, (a, b, expected)) + self.assertPreciseEqual(le(b, a), not_expected_val, (a, b, expected)) + if expected_val: + # If true, then values are not equal + check_eq(a, b, False) + # Did we get it right? + self.assertPreciseEqual(a < b, expected_val) + + check_eq(DT('2014'), DT('2017'), False) + check_eq(DT('2014'), DT('2014-01'), True) + check_eq(DT('2014'), DT('2014-01-01'), True) + check_eq(DT('2014'), DT('2014-01-01', 'W'), True) + check_eq(DT('2014-01'), DT('2014-01-01', 'W'), True) + # Yes, it's not transitive + check_eq(DT('2014-01-01'), DT('2014-01-01', 'W'), False) + check_eq(DT('2014-01-02'), DT('2014-01-06', 'W'), True) + # with times + check_eq(DT('2014-01-01T00:01:00Z', 's'), + DT('2014-01-01T00:01Z', 'm'), True) + check_eq(DT('2014-01-01T00:01:01Z', 's'), + DT('2014-01-01T00:01Z', 'm'), False) + # NaTs + check_lt(DT('NaT', 'Y'), DT('2017'), True) + check_eq(DT('NaT'), DT('NaT'), True) + + # Check comparison between various units + dts = self.datetime_samples() + for a in dts: + # Take a number of smaller units + a_unit = a.dtype.str.split('[')[1][:-1] + i = all_units.index(a_unit) + units = all_units[i:i+6] + for unit in units: + if numpy_version >= (2, 5): + try: + # Post NumPy 2.5 it is possible for + # astype to raise on overflow, pre + # 2.5 it wraps around. + b = a.astype('M8[%s]' % unit) + except OverflowError: + continue + # Force conversion + b = a.astype('M8[%s]' % unit) + if (not npdatetime_helpers.same_kind(value_unit(a), + value_unit(b))): + continue + check_eq(a, b, True) + check_lt(a, b + np.timedelta64(1, unit), True) + check_lt(b - np.timedelta64(1, unit), a, True) + + def _test_min_max(self, usecase): + f = self.jit(usecase) + def check(a, b): + self.assertPreciseEqual(f(a, b), usecase(a, b)) + + for cases in ( + (DT(0, 'ns'), DT(1, 'ns'), DT(2, 'ns'), DT('NaT', 'ns')), + (DT(0, 's'), DT(1, 's'), DT(2, 's'), DT('NaT', 's')), + ): + for a, b in itertools.product(cases, cases): + check(a, b) + + def test_min(self): + self._test_min_max(min_usecase) + + def test_max(self): + self._test_min_max(max_usecase) + +class TestDatetimeArithmeticNoPython(TestDatetimeArithmetic): + + jitargs = dict(nopython=True) + + +class TestMetadataScalingFactor(TestCase): + """ + Tests than non-1 scaling factors are not supported in datetime64 + and timedelta64 dtypes. + """ + + def test_datetime(self, jitargs=None): + if jitargs is None: + jitargs = {'forceobj': True} + eq = jit(**jitargs)(eq_usecase) + self.assertTrue(eq(DT('2014', '10Y'), DT('2010'))) + + def test_datetime_npm(self): + with self.assertTypingError(): + self.test_datetime(jitargs={'nopython':True}) + + def test_timedelta(self, jitargs=None): + if jitargs is None: + jitargs = {'forceobj': True} + eq = jit(**jitargs)(eq_usecase) + self.assertTrue(eq(TD(2, '10Y'), TD(20, 'Y'))) + + def test_timedelta_npm(self): + with self.assertTypingError(): + self.test_timedelta(jitargs={'nopython':True}) + + +class TestDatetimeDeltaOps(TestCase): + def test_div(self): + """ + Test the division of a timedelta by numeric types + """ + def arr_div(a, b): + return a / b + + py_func = arr_div + cfunc = njit(arr_div) + test_cases = [ + (np.ones(3, TIMEDELTA_M), np.ones(3, TIMEDELTA_M)), + (np.ones(3, TIMEDELTA_M), np.ones(3, TIMEDELTA_Y)), + (np.ones(3, TIMEDELTA_Y), np.ones(3, TIMEDELTA_M)), + (np.ones(3, TIMEDELTA_Y), np.ones(3, TIMEDELTA_Y)), + (np.ones(3, TIMEDELTA_M), 1), + (np.ones(3, TIMEDELTA_M), np.ones(3, np.int64)), + (np.ones(3, TIMEDELTA_M), np.ones(3, np.float64)), + ] + for a, b in test_cases: + self.assertTrue(np.array_equal(py_func(a, b), cfunc(a, b))) + + +class TestDatetimeArrayOps(TestCase): + + def _test_td_add_or_sub(self, operation, parallel): + """ + Test the addition/subtraction of a datetime array with a timedelta type + """ + def impl(a, b): + return operation(a, b) + + arr_one = np.array([ + np.datetime64("2011-01-01"), + np.datetime64("1971-02-02"), + np.datetime64("2021-03-03"), + np.datetime64("2004-12-07"), + ], dtype="datetime64[ns]") + arr_two = np.array([ + np.datetime64("2011-01-01"), + np.datetime64("1971-02-02"), + np.datetime64("2021-03-03"), + np.datetime64("2004-12-07"), + ], dtype="datetime64[D]") + py_func = impl + cfunc = njit(parallel=parallel)(impl) + test_cases = [ + (arr_one, np.timedelta64(1000)), + (arr_two, np.timedelta64(1000)), + (arr_one, np.timedelta64(-54557)), + (arr_two, np.timedelta64(-54557)), + ] + # np.add is commutative so test the reversed order + if operation is np.add: + test_cases.extend([ + (np.timedelta64(1000), arr_one), + (np.timedelta64(1000), arr_two), + (np.timedelta64(-54557), arr_one), + (np.timedelta64(-54557), arr_two), + ]) + for a, b in test_cases: + self.assertTrue(np.array_equal(py_func(a, b), cfunc(a, b))) + + def test_add_td(self): + self._test_td_add_or_sub(np.add, False) + + @skip_parfors_unsupported + def test_add_td_parallel(self): + self._test_td_add_or_sub(np.add, True) + + def test_sub_td(self): + self._test_td_add_or_sub(np.subtract, False) + + @skip_parfors_unsupported + def test_sub_td_parallel(self): + self._test_td_add_or_sub(np.subtract, True) + + def _test_add_sub_td_no_match(self, operation): + """ + Tests that attempting to add/sub a datetime64 and timedelta64 + with types that cannot be cast raises a reasonable exception. + """ + @njit + def impl(a, b): + return operation(a, b) + + fname = operation.__name__ + expected = re.escape((f"ufunc '{fname}' is not supported between " + "datetime64[ns] and timedelta64[M]")) + with self.assertRaisesRegex((TypingError, TypeError), expected): + impl( + np.array([np.datetime64("2011-01-01"),], + dtype="datetime64[ns]"), + np.timedelta64(1000,'M') + ) + + def test_add_td_no_match(self): + self._test_add_sub_td_no_match(np.add) + + def test_sub_td_no_match(self): + self._test_add_sub_td_no_match(np.subtract) + + def _get_testcases(self): + test_cases = [ + np.array([ + DT(0, "ns"), + DT(1, "ns"), + DT(2, "ns"), + DT(3, "ns"), + ]), + np.array([ + DT("2011-01-01", "ns"), + DT("1971-02-02", "ns"), + DT("1900-01-01", "ns"), + DT("2021-03-03", "ns"), + DT("2004-12-07", "ns"), + ]), + np.array([ + DT("2011-01-01", "D"), + DT("1971-02-02", "D"), + DT("1900-01-01", "D"), + DT("2021-03-03", "D"), + DT("2004-12-07", "D"), + ]), + np.array([ + DT("2011-01-01", "ns"), + DT("1971-02-02", "ns"), + DT("1900-01-01", "ns"), + DT("2021-03-03", "ns"), + DT("2004-12-07", "ns"), + DT("NaT", "ns"), + ]), + np.array([ + DT("NaT", "ns"), + DT("2011-01-01", "ns"), + DT("1971-02-02", "ns"), + DT("1900-01-01", "ns"), + DT("2021-03-03", "ns"), + DT("2004-12-07", "ns"), + ]), + np.array([ + DT("1971-02-02", "ns"), + DT("NaT", "ns"), + ]), + np.array([ + DT("NaT", "ns"), + DT("NaT", "ns"), + DT("NaT", "ns"), + ]), + np.array([ + TD(1, "ns"), + TD(2, "ns"), + TD(3, "ns"), + TD(4, "ns"), + ]), + np.array([ + TD(1, "D"), + TD(2, "D"), + TD(3, "D"), + TD(4, "D"), + ]), + np.array([ + TD("NaT", "ns"), + TD(1, "ns"), + TD(2, "ns"), + TD(3, "ns"), + TD(4, "ns"), + ]), + np.array([ + TD(1, "ns"), + TD(2, "ns"), + TD(3, "ns"), + TD(4, "ns"), + TD("NaT", "ns"), + ]), + np.array([ + TD("NaT", "ns"), + ]), + np.array([ + TD("NaT", "ns"), + TD("NaT", "ns"), + TD("NaT", "ns"), + ]), + ] + return test_cases + + def _test_min_max(self, operation, parallel, method): + if method: + if operation is np.min: + def impl(arr): + return arr.min() + else: + def impl(arr): + return arr.max() + else: + def impl(arr): + return operation(arr) + + py_func = impl + cfunc = njit(parallel=parallel)(impl) + + test_cases = self._get_testcases() + for arr in test_cases: + py_res = py_func(arr) + c_res = cfunc(arr) + if np.isnat(py_res) or np.isnat(c_res): + self.assertTrue(np.isnat(py_res)) + self.assertTrue(np.isnat(c_res)) + else: + self.assertEqual(py_res, c_res) + + def test_min_func(self): + self._test_min_max(min, False, False) + + def test_np_min_func(self): + self._test_min_max(np.min, False, False) + + def test_min_method(self): + self._test_min_max(np.min, False, True) + + def test_max_func(self): + self._test_min_max(max, False, False) + + def test_np_max_func(self): + self._test_min_max(np.max, False, False) + + def test_max_method(self): + self._test_min_max(np.max, False, True) + + @skip_parfors_unsupported + def test_min_func_parallel(self): + self._test_min_max(np.min, True, False) + + @skip_parfors_unsupported + def test_min_method_parallel(self): + self._test_min_max(np.min, True, True) + + @skip_parfors_unsupported + def test_max_func_parallel(self): + self._test_min_max(np.max, True, False) + + @skip_parfors_unsupported + def test_max_method_parallel(self): + self._test_min_max(np.max, True, True) + + def test_searchsorted_datetime(self): + from .test_np_functions import ( + searchsorted, searchsorted_left, searchsorted_right, + ) + pyfunc_list = [searchsorted, searchsorted_left, searchsorted_right] + cfunc_list = [jit(fn) for fn in pyfunc_list] + + def check(pyfunc, cfunc, a, v): + expected = pyfunc(a, v) + got = cfunc(a, v) + self.assertPreciseEqual(expected, got) + + cases = self._get_testcases() + for pyfunc, cfunc in zip(pyfunc_list, cfunc_list): + for arr in cases: + arr = np.sort(arr) + for n in range(1, min(3, arr.size) + 1): + idx = np.random.randint(0, arr.size, n) + vs = arr[idx] + if n == 1: + [v] = vs + check(pyfunc, cfunc, arr, v) + check(pyfunc, cfunc, arr, vs) + + + +class TestDatetimeTypeOps(TestCase): + def test_isinstance_datetime(self): + @njit + def is_complex(a): + return isinstance(a, complex) + @njit + def is_datetime(a): + return isinstance(a, np.datetime64) + @njit + def is_timedelta(a): + return isinstance(a, np.timedelta64) + + dt_a = np.datetime64(1, 'ns') + dt_b = np.datetime64(2, 'ns') + td_c = dt_b - dt_a + + def check(jit_func, x): + with self.subTest(f'{jit_func.__name__}({type(x).__name__})'): + got = jit_func(x) + expect = jit_func.py_func(x) + self.assertEqual(got, expect) + + fns = [ + is_complex, + is_datetime, + is_timedelta, + ] + args = [ + dt_a, + dt_b, + td_c, + ] + for fn, arg in itertools.product(fns, args): + check(fn, arg) + + +class TestDatetimeIssues(TestCase): + def test_10y_issue_9585(self): + @njit + def f(x): + return x + 1 + + arr = np.array('2010', dtype='datetime64[10Y]') + + with self.assertRaises(TypingError) as e: + f(arr) + + message = e.exception.args[0] + + argument_index = "argument 0" + self.assertIn(argument_index, message) + + unsupported_type = "Unsupported array dtype: datetime64[10Y]" + self.assertIn(unsupported_type, message) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/9d/9d0ce1d9aac350b4adc10c2682bb642845852d421b40d8ccf541bab4bfe82f76/blob b/shared/package-files/9d/9d0ce1d9aac350b4adc10c2682bb642845852d421b40d8ccf541bab4bfe82f76/blob new file mode 100644 index 0000000000000000000000000000000000000000..adaa4d299c741a257db5f9f11d4336c31b9a0dae --- /dev/null +++ b/shared/package-files/9d/9d0ce1d9aac350b4adc10c2682bb642845852d421b40d8ccf541bab4bfe82f76/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor special_log_softmax(const at::Tensor & self, int64_t dim, c10::optional dtype=c10::nullopt); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9d13a8abac0b3261825b28590acad607581cbcc84898d3bec23b002a5679e962/blob b/shared/package-files/9d/9d13a8abac0b3261825b28590acad607581cbcc84898d3bec23b002a5679e962/blob new file mode 100644 index 0000000000000000000000000000000000000000..1d8b1ea76f9f8d5ee051250143fed2364799a34c --- /dev/null +++ b/shared/package-files/9d/9d13a8abac0b3261825b28590acad607581cbcc84898d3bec23b002a5679e962/blob @@ -0,0 +1,141 @@ +# This file is part of Hypothesis, which may be found at +# https://github.com/HypothesisWorks/hypothesis/ +# +# Copyright the Hypothesis Authors. +# Individual contributors are listed in AUTHORS.rst and the git log. +# +# This Source Code Form is subject to the terms of the Mozilla Public License, +# v. 2.0. If a copy of the MPL was not distributed with this file, You can +# obtain one at https://mozilla.org/MPL/2.0/. + +from hypothesis.strategies._internal import SearchStrategy +from hypothesis.strategies._internal.collections import tuples +from hypothesis.strategies._internal.core import ( + DataObject, + DrawFn, + binary, + booleans, + builds, + characters, + complex_numbers, + composite, + data, + decimals, + deferred, + dictionaries, + emails, + fixed_dictionaries, + fractions, + from_regex, + from_type, + frozensets, + functions, + iterables, + lists, + permutations, + random_module, + randoms, + recursive, + register_type_strategy, + runner, + sampled_from, + sets, + shared, + slices, + text, + uuids, +) +from hypothesis.strategies._internal.datetime import ( + dates, + datetimes, + timedeltas, + times, + timezone_keys, + timezones, +) +from hypothesis.strategies._internal.ipaddress import ip_addresses +from hypothesis.strategies._internal.misc import just, none, nothing +from hypothesis.strategies._internal.numbers import floats, integers +from hypothesis.strategies._internal.strategies import one_of +from hypothesis.strategies._internal.utils import _strategies + +# The implementation of all of these lives in `_strategies.py`, but we +# re-export them via this module to avoid exposing implementation details +# to over-zealous tab completion in editors that do not respect __all__. + + +__all__ = [ + "binary", + "booleans", + "builds", + "characters", + "complex_numbers", + "composite", + "data", + "DataObject", + "dates", + "datetimes", + "decimals", + "deferred", + "dictionaries", + "DrawFn", + "emails", + "fixed_dictionaries", + "floats", + "fractions", + "from_regex", + "from_type", + "frozensets", + "functions", + "integers", + "ip_addresses", + "iterables", + "just", + "lists", + "none", + "nothing", + "one_of", + "permutations", + "random_module", + "randoms", + "recursive", + "register_type_strategy", + "runner", + "sampled_from", + "sets", + "shared", + "slices", + "text", + "timedeltas", + "times", + "timezone_keys", + "timezones", + "tuples", + "uuids", + "SearchStrategy", +] + + +def _check_exports(_public): + assert set(__all__) == _public, (set(__all__) - _public, _public - set(__all__)) + + # Verify that all exported strategy functions were registered with + # @declares_strategy. + + existing_strategies = set(_strategies) - {"_maybe_nil_uuids"} + + exported_strategies = set(__all__) - { + "DataObject", + "DrawFn", + "SearchStrategy", + "composite", + "register_type_strategy", + } + assert existing_strategies == exported_strategies, ( + existing_strategies - exported_strategies, + exported_strategies - existing_strategies, + ) + + +_check_exports({n for n in dir() if n[0] not in "_@"}) +del _check_exports diff --git a/shared/package-files/9d/9d15d63676eae75530c2b82c3639dbf3753ca61ddb25d40a869a24e00caee4e6/blob b/shared/package-files/9d/9d15d63676eae75530c2b82c3639dbf3753ca61ddb25d40a869a24e00caee4e6/blob new file mode 100644 index 0000000000000000000000000000000000000000..9b08f5982db5ec8302958f3b5adad46e1b3020c2 --- /dev/null +++ b/shared/package-files/9d/9d15d63676eae75530c2b82c3639dbf3753ca61ddb25d40a869a24e00caee4e6/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _fft_c2r { + using schema = at::Tensor (const at::Tensor &, at::IntArrayRef, int64_t, c10::SymInt); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_fft_c2r") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_fft_c2r(Tensor self, int[] dim, int normalization, SymInt last_dim_size) -> Tensor") + static at::Tensor call(const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, c10::SymInt last_dim_size); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, c10::SymInt last_dim_size); +}; + +struct TORCH_API _fft_c2r_out { + using schema = at::Tensor & (const at::Tensor &, at::IntArrayRef, int64_t, c10::SymInt, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_fft_c2r") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_fft_c2r.out(Tensor self, int[] dim, int normalization, SymInt last_dim_size, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, c10::SymInt last_dim_size, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, c10::SymInt last_dim_size, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9d/9d1817f3f797fbf564bf1a17d3de905a8cfc3ecd101d4004c482c263fecf9dc3/blob b/shared/package-files/9d/9d1817f3f797fbf564bf1a17d3de905a8cfc3ecd101d4004c482c263fecf9dc3/blob new file mode 100644 index 0000000000000000000000000000000000000000..41784104ee4bd5796006d1052536325d52db1e8c --- /dev/null +++ b/shared/package-files/9d/9d1817f3f797fbf564bf1a17d3de905a8cfc3ecd101d4004c482c263fecf9dc3/blob @@ -0,0 +1,22 @@ +import collections + +from ..packages import six +from ..packages.six.moves import queue + +if six.PY2: + # Queue is imported for side effects on MS Windows. See issue #229. + import Queue as _unused_module_Queue # noqa: F401 + + +class LifoQueue(queue.Queue): + def _init(self, _): + self.queue = collections.deque() + + def _qsize(self, len=len): + return len(self.queue) + + def _put(self, item): + self.queue.append(item) + + def _get(self): + return self.queue.pop() diff --git a/shared/package-files/9d/9d1932506ac107f12ced32b20f14bfb37bb67458017f38e87089c8f446be275d/blob b/shared/package-files/9d/9d1932506ac107f12ced32b20f14bfb37bb67458017f38e87089c8f446be275d/blob new file mode 100644 index 0000000000000000000000000000000000000000..4c51ab7154bd44aa294755827861d347107352a0 --- /dev/null +++ b/shared/package-files/9d/9d1932506ac107f12ced32b20f14bfb37bb67458017f38e87089c8f446be275d/blob @@ -0,0 +1,135 @@ +import sys +from typing import Any + +import numpy as np +import numpy.typing as npt +from numpy._typing import _64Bit, _32Bit + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + +i8 = np.int64(1) +u8 = np.uint64(1) + +i4 = np.int32(1) +u4 = np.uint32(1) + +b_ = np.bool_(1) + +b = bool(1) +i = int(1) + +AR = np.array([0, 1, 2], dtype=np.int32) +AR.setflags(write=False) + + +assert_type(i8 << i8, np.int64) +assert_type(i8 >> i8, np.int64) +assert_type(i8 | i8, np.int64) +assert_type(i8 ^ i8, np.int64) +assert_type(i8 & i8, np.int64) + +assert_type(i8 << AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(i8 >> AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(i8 | AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(i8 ^ AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(i8 & AR, npt.NDArray[np.signedinteger[Any]]) + +assert_type(i4 << i4, np.int32) +assert_type(i4 >> i4, np.int32) +assert_type(i4 | i4, np.int32) +assert_type(i4 ^ i4, np.int32) +assert_type(i4 & i4, np.int32) + +assert_type(i8 << i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i8 >> i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i8 | i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i8 ^ i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i8 & i4, np.signedinteger[_32Bit | _64Bit]) + +assert_type(i8 << b_, np.int64) +assert_type(i8 >> b_, np.int64) +assert_type(i8 | b_, np.int64) +assert_type(i8 ^ b_, np.int64) +assert_type(i8 & b_, np.int64) + +assert_type(i8 << b, np.int64) +assert_type(i8 >> b, np.int64) +assert_type(i8 | b, np.int64) +assert_type(i8 ^ b, np.int64) +assert_type(i8 & b, np.int64) + +assert_type(u8 << u8, np.uint64) +assert_type(u8 >> u8, np.uint64) +assert_type(u8 | u8, np.uint64) +assert_type(u8 ^ u8, np.uint64) +assert_type(u8 & u8, np.uint64) + +assert_type(u8 << AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(u8 >> AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(u8 | AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(u8 ^ AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(u8 & AR, npt.NDArray[np.signedinteger[Any]]) + +assert_type(u4 << u4, np.uint32) +assert_type(u4 >> u4, np.uint32) +assert_type(u4 | u4, np.uint32) +assert_type(u4 ^ u4, np.uint32) +assert_type(u4 & u4, np.uint32) + +assert_type(u4 << i4, np.signedinteger[Any]) +assert_type(u4 >> i4, np.signedinteger[Any]) +assert_type(u4 | i4, np.signedinteger[Any]) +assert_type(u4 ^ i4, np.signedinteger[Any]) +assert_type(u4 & i4, np.signedinteger[Any]) + +assert_type(u4 << i, np.signedinteger[Any]) +assert_type(u4 >> i, np.signedinteger[Any]) +assert_type(u4 | i, np.signedinteger[Any]) +assert_type(u4 ^ i, np.signedinteger[Any]) +assert_type(u4 & i, np.signedinteger[Any]) + +assert_type(u8 << b_, np.uint64) +assert_type(u8 >> b_, np.uint64) +assert_type(u8 | b_, np.uint64) +assert_type(u8 ^ b_, np.uint64) +assert_type(u8 & b_, np.uint64) + +assert_type(u8 << b, np.uint64) +assert_type(u8 >> b, np.uint64) +assert_type(u8 | b, np.uint64) +assert_type(u8 ^ b, np.uint64) +assert_type(u8 & b, np.uint64) + +assert_type(b_ << b_, np.int8) +assert_type(b_ >> b_, np.int8) +assert_type(b_ | b_, np.bool_) +assert_type(b_ ^ b_, np.bool_) +assert_type(b_ & b_, np.bool_) + +assert_type(b_ << AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(b_ >> AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(b_ | AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(b_ ^ AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(b_ & AR, npt.NDArray[np.signedinteger[Any]]) + +assert_type(b_ << b, np.int8) +assert_type(b_ >> b, np.int8) +assert_type(b_ | b, np.bool_) +assert_type(b_ ^ b, np.bool_) +assert_type(b_ & b, np.bool_) + +assert_type(b_ << i, np.int_) +assert_type(b_ >> i, np.int_) +assert_type(b_ | i, np.int_) +assert_type(b_ ^ i, np.int_) +assert_type(b_ & i, np.int_) + +assert_type(~i8, np.int64) +assert_type(~i4, np.int32) +assert_type(~u8, np.uint64) +assert_type(~u4, np.uint32) +assert_type(~b_, np.bool_) +assert_type(~AR, npt.NDArray[np.int32]) diff --git a/shared/package-files/9d/9d1c4ae11f0276ae0d8bd7bfea7e1f4638abdd504e9973330085e79513500f76/blob b/shared/package-files/9d/9d1c4ae11f0276ae0d8bd7bfea7e1f4638abdd504e9973330085e79513500f76/blob new file mode 100644 index 0000000000000000000000000000000000000000..62de63cbcaadb0fd536ceb87932b8d7495334b15 --- /dev/null +++ b/shared/package-files/9d/9d1c4ae11f0276ae0d8bd7bfea7e1f4638abdd504e9973330085e79513500f76/blob @@ -0,0 +1,27 @@ +from sympy.combinatorics.group_numbers import (is_nilpotent_number, + is_abelian_number, is_cyclic_number) +from sympy.testing.pytest import raises +from sympy import randprime + + +def test_is_nilpotent_number(): + assert is_nilpotent_number(21) == False + assert is_nilpotent_number(randprime(1, 30)**12) == True + raises(ValueError, lambda: is_nilpotent_number(-5)) + + +def test_is_abelian_number(): + assert is_abelian_number(4) == True + assert is_abelian_number(randprime(1, 2000)**2) == True + assert is_abelian_number(randprime(1000, 100000)) == True + assert is_abelian_number(60) == False + assert is_abelian_number(24) == False + raises(ValueError, lambda: is_abelian_number(-5)) + + +def test_is_cyclic_number(): + assert is_cyclic_number(15) == True + assert is_cyclic_number(randprime(1, 2000)**2) == False + assert is_cyclic_number(randprime(1000, 100000)) == True + assert is_cyclic_number(4) == False + raises(ValueError, lambda: is_cyclic_number(-5)) diff --git a/shared/package-files/9d/9d1d28d099b4b8f1feea5d1fb755911ea625abeea8f385fa334697d5427d22f1/blob b/shared/package-files/9d/9d1d28d099b4b8f1feea5d1fb755911ea625abeea8f385fa334697d5427d22f1/blob new file mode 100644 index 0000000000000000000000000000000000000000..33b2fd8be4cdac2437ead73c6be972902edfcb4f --- /dev/null +++ b/shared/package-files/9d/9d1d28d099b4b8f1feea5d1fb755911ea625abeea8f385fa334697d5427d22f1/blob @@ -0,0 +1,32 @@ +from matplotlib.tri import Triangulation, TriFinder + +from typing import Literal +import numpy as np +from numpy.typing import ArrayLike + +class TriInterpolator: + def __init__( + self, + triangulation: Triangulation, + z: ArrayLike, + trifinder: TriFinder | None = ..., + ) -> None: ... + # __call__ and gradient are not actually implemented by the ABC, but are specified as required + def __call__(self, x: ArrayLike, y: ArrayLike) -> np.ma.MaskedArray: ... + def gradient( + self, x: ArrayLike, y: ArrayLike + ) -> tuple[np.ma.MaskedArray, np.ma.MaskedArray]: ... + +class LinearTriInterpolator(TriInterpolator): ... + +class CubicTriInterpolator(TriInterpolator): + def __init__( + self, + triangulation: Triangulation, + z: ArrayLike, + kind: Literal["min_E", "geom", "user"] = ..., + trifinder: TriFinder | None = ..., + dz: tuple[ArrayLike, ArrayLike] | None = ..., + ) -> None: ... + +__all__ = ('TriInterpolator', 'LinearTriInterpolator', 'CubicTriInterpolator') diff --git a/shared/package-files/9d/9d1d6b3f050664bff639b919463d2c5533a5fb5c488ac43b91fcd75d4054c07f/blob b/shared/package-files/9d/9d1d6b3f050664bff639b919463d2c5533a5fb5c488ac43b91fcd75d4054c07f/blob new file mode 100644 index 0000000000000000000000000000000000000000..a7ed84ff52304a1ea6fb5bf17d5ad9f552d96769 --- /dev/null +++ b/shared/package-files/9d/9d1d6b3f050664bff639b919463d2c5533a5fb5c488ac43b91fcd75d4054c07f/blob @@ -0,0 +1,285 @@ +from __future__ import annotations # noqa: D100 + +import contextlib +import datetime +import json +import typing +from decimal import Decimal + +import polars as pl +from polars.io.plugins import register_io_source + +import duckdb + +if typing.TYPE_CHECKING: + from collections.abc import Iterator + + import typing_extensions + +_ExpressionTree: typing_extensions.TypeAlias = typing.Dict[str, typing.Union[str, int, "_ExpressionTree", typing.Any]] # noqa: UP006 + + +def _predicate_to_expression(predicate: pl.Expr) -> duckdb.Expression | None: + """Convert a Polars predicate expression to a DuckDB-compatible SQL expression. + + Parameters: + predicate (pl.Expr): A Polars expression (e.g., col("foo") > 5) + + Returns: + SQLExpression: A DuckDB SQL expression string equivalent. + None: If conversion fails. + + Example: + >>> _predicate_to_expression(pl.col("foo") > 5) + SQLExpression("(foo > 5)") + """ + # Serialize the Polars expression tree to JSON + tree = json.loads(predicate.meta.serialize(format="json")) + + try: + # Convert the tree to SQL + sql_filter = _pl_tree_to_sql(tree) + return duckdb.SQLExpression(sql_filter) + except Exception: + # If the conversion fails, we return None + return None + + +def _pl_operation_to_sql(op: str) -> str: + """Map Polars binary operation strings to SQL equivalents. + + Example: + >>> _pl_operation_to_sql("Eq") + '=' + """ + try: + return { + "Lt": "<", + "LtEq": "<=", + "Gt": ">", + "GtEq": ">=", + "Eq": "=", + "Modulus": "%", + "And": "AND", + "Or": "OR", + }[op] + except KeyError: + raise NotImplementedError(op) # noqa: B904 + + +def _escape_sql_identifier(identifier: str) -> str: + """Escape SQL identifiers by doubling any double quotes and wrapping in double quotes. + + Example: + >>> _escape_sql_identifier('column"name') + '"column""name"' + """ + escaped = identifier.replace('"', '""') + return f'"{escaped}"' + + +def _pl_tree_to_sql(tree: _ExpressionTree) -> str: + """Recursively convert a Polars expression tree (as JSON) to a SQL string. + + Parameters: + tree (dict): JSON-deserialized expression tree from Polars + + Returns: + str: SQL expression string + + Example: + Input tree: + { + "BinaryExpr": { + "left": { "Column": "foo" }, + "op": "Gt", + "right": { "Literal": { "Int": 5 } } + } + } + Output: "(foo > 5)" + """ + [node_type] = tree.keys() + + if node_type == "BinaryExpr": + # Binary expressions: left OP right + bin_expr_tree = tree[node_type] + assert isinstance(bin_expr_tree, dict), f"A {node_type} should be a dict but got {type(bin_expr_tree)}" + lhs, op, rhs = bin_expr_tree["left"], bin_expr_tree["op"], bin_expr_tree["right"] + assert isinstance(lhs, dict), f"LHS of a {node_type} should be a dict but got {type(lhs)}" + assert isinstance(op, str), f"The op of a {node_type} should be a str but got {type(op)}" + assert isinstance(rhs, dict), f"RHS of a {node_type} should be a dict but got {type(rhs)}" + return f"({_pl_tree_to_sql(lhs)} {_pl_operation_to_sql(op)} {_pl_tree_to_sql(rhs)})" + if node_type == "Column": + # A reference to a column name + # Wrap in quotes to handle special characters + col_name = tree[node_type] + assert isinstance(col_name, str), f"The col name of a {node_type} should be a str but got {type(col_name)}" + return _escape_sql_identifier(col_name) + + if node_type in ("Literal", "Dyn"): + # Recursively process dynamic or literal values + val_tree = tree[node_type] + assert isinstance(val_tree, dict), f"A {node_type} should be a dict but got {type(val_tree)}" + return _pl_tree_to_sql(val_tree) + + if node_type == "Int": + # Direct integer literals + int_literal = tree[node_type] + assert isinstance(int_literal, (int, str)), ( + f"The value of an Int should be an int or str but got {type(int_literal)}" + ) + return str(int_literal) + + if node_type == "Function": + # Handle boolean functions like IsNull, IsNotNull + func_tree = tree[node_type] + assert isinstance(func_tree, dict), f"A {node_type} should be a dict but got {type(func_tree)}" + inputs = func_tree["input"] + assert isinstance(inputs, list), f"A {node_type} should have a list of dicts as input but got {type(inputs)}" + input_tree = inputs[0] + assert isinstance(input_tree, dict), ( + f"A {node_type} should have a list of dicts as input but got {type(input_tree)}" + ) + func_dict = func_tree["function"] + assert isinstance(func_dict, dict), ( + f"A {node_type} should have a function dict as input but got {type(func_dict)}" + ) + + if "Boolean" in func_dict: + func = func_dict["Boolean"] + arg_sql = _pl_tree_to_sql(inputs[0]) + + if func == "IsNull": + return f"({arg_sql} IS NULL)" + if func == "IsNotNull": + return f"({arg_sql} IS NOT NULL)" + msg = f"Boolean function not supported: {func}" + raise NotImplementedError(msg) + + msg = f"Unsupported function type: {func_dict}" + raise NotImplementedError(msg) + + if node_type == "Scalar": + # Detect format: old style (dtype/value) or new style (direct type key) + scalar_tree = tree[node_type] + assert isinstance(scalar_tree, dict), f"A {node_type} should be a dict but got {type(scalar_tree)}" + if "dtype" in scalar_tree and "value" in scalar_tree: + dtype = str(scalar_tree["dtype"]) + value = scalar_tree["value"] + else: + # New style: dtype is the single key in the dict + dtype = next(iter(scalar_tree.keys())) + value = scalar_tree + assert isinstance(dtype, str), f"A {node_type} should have a str dtype but got {type(dtype)}" + assert isinstance(value, dict), f"A {node_type} should have a dict value but got {type(value)}" + + # Decimal support + if dtype.startswith("{'Decimal'") or dtype == "Decimal": + decimal_value = value["Decimal"] + assert isinstance(decimal_value, list), ( + f"A {dtype} should be a two or three member list but got {type(decimal_value)}" + ) + assert 2 <= len(decimal_value) <= 3, ( + f"A {dtype} should be a two or three member list but got {len(decimal_value)} member list" + ) + return str(Decimal(decimal_value[0]) / Decimal(10 ** decimal_value[-1])) + + # Datetime with microseconds since epoch + if dtype.startswith("{'Datetime'") or dtype == "Datetime": + micros = value["Datetime"] + assert isinstance(micros, list), f"A {dtype} should be a one member list but got {type(micros)}" + dt_timestamp = datetime.datetime.fromtimestamp(micros[0] / 1_000_000, tz=datetime.timezone.utc) + return f"'{dt_timestamp!s}'::TIMESTAMP" + + # Match simple numeric/boolean types + if dtype in ( + "Int8", + "Int16", + "Int32", + "Int64", + "UInt8", + "UInt16", + "UInt32", + "UInt64", + "Float32", + "Float64", + "Boolean", + ): + return str(value[dtype]) + + # Time type + if dtype == "Time": + nanoseconds = value["Time"] + assert isinstance(nanoseconds, int), f"A {dtype} should be an int but got {type(nanoseconds)}" + seconds = nanoseconds // 1_000_000_000 + microseconds = (nanoseconds % 1_000_000_000) // 1_000 + dt_time = (datetime.datetime.min + datetime.timedelta(seconds=seconds, microseconds=microseconds)).time() + return f"'{dt_time}'::TIME" + + # Date type + if dtype == "Date": + days_since_epoch = value["Date"] + assert isinstance(days_since_epoch, (float, int)), ( + f"A {dtype} should be a number but got {type(days_since_epoch)}" + ) + date = datetime.date(1970, 1, 1) + datetime.timedelta(days=days_since_epoch) + return f"'{date}'::DATE" + + # Binary type + if dtype == "Binary": + bin_value = value["Binary"] + assert isinstance(bin_value, list), f"A {dtype} should be a list but got {type(bin_value)}" + binary_data = bytes(bin_value) + escaped = "".join(f"\\x{b:02x}" for b in binary_data) + return f"'{escaped}'::BLOB" + + # String type + if dtype == "String" or dtype == "StringOwned": + # Some new formats may store directly under StringOwned + string_val = value.get("StringOwned", value.get("String", None)) + # the string must be a string constant + return str(duckdb.ConstantExpression(string_val)) + + msg = f"Unsupported scalar type {dtype!s}, with value {value}" + raise NotImplementedError(msg) + + msg = f"Node type: {node_type} is not implemented. {tree[node_type]}" + raise NotImplementedError(msg) + + +def duckdb_source(relation: duckdb.DuckDBPyRelation, schema: pl.schema.Schema) -> pl.LazyFrame: + """A polars IO plugin for DuckDB.""" + + def source_generator( + with_columns: list[str] | None, + predicate: pl.Expr | None, + n_rows: int | None, + batch_size: int | None, + ) -> Iterator[pl.DataFrame]: + duck_predicate = None + relation_final = relation + if with_columns is not None: + cols = ",".join(map(_escape_sql_identifier, with_columns)) + relation_final = relation_final.project(cols) + if n_rows is not None: + relation_final = relation_final.limit(n_rows) + if predicate is not None: + # We have a predicate, if possible, we push it down to DuckDB + with contextlib.suppress(AssertionError, KeyError): + duck_predicate = _predicate_to_expression(predicate) + # Try to pushdown filter, if one exists + if duck_predicate is not None: + relation_final = relation_final.filter(duck_predicate) + if batch_size is None: + results = relation_final.fetch_arrow_reader() + else: + results = relation_final.fetch_arrow_reader(batch_size) + + for record_batch in iter(results.read_next_batch, None): + if predicate is not None and duck_predicate is None: + # We have a predicate, but did not manage to push it down, we fallback here + yield pl.from_arrow(record_batch).filter(predicate) # type: ignore[arg-type,misc,unused-ignore] + else: + yield pl.from_arrow(record_batch) # type: ignore[misc,unused-ignore] + + return register_io_source(source_generator, schema=schema) diff --git a/shared/package-files/9d/9d1f1e2741674fc52e4e45927d57b52b9505a2b89b24134c3358cba3c4139178/blob b/shared/package-files/9d/9d1f1e2741674fc52e4e45927d57b52b9505a2b89b24134c3358cba3c4139178/blob new file mode 100644 index 0000000000000000000000000000000000000000..cd557786f03b0feb101db17ecef43930b5d13c30 --- /dev/null +++ b/shared/package-files/9d/9d1f1e2741674fc52e4e45927d57b52b9505a2b89b24134c3358cba3c4139178/blob @@ -0,0 +1,37 @@ +from torch._C._monitor import * # noqa: F403 + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from torch.utils.tensorboard import SummaryWriter + + +STAT_EVENT = "torch.monitor.Stat" + + +class TensorboardEventHandler: + """ + TensorboardEventHandler is an event handler that will write known events to + the provided SummaryWriter. + + This currently only supports ``torch.monitor.Stat`` events which are logged + as scalars. + + Example: + >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_MONITOR) + >>> # xdoctest: +REQUIRES(module:tensorboard) + >>> from torch.utils.tensorboard import SummaryWriter + >>> from torch.monitor import TensorboardEventHandler, register_event_handler + >>> writer = SummaryWriter("log_dir") + >>> register_event_handler(TensorboardEventHandler(writer)) + """ + def __init__(self, writer: "SummaryWriter") -> None: + """ + Constructs the ``TensorboardEventHandler``. + """ + self._writer = writer + + def __call__(self, event: Event) -> None: + if event.name == STAT_EVENT: + for k, v in event.data.items(): + self._writer.add_scalar(k, v, walltime=event.timestamp.timestamp()) diff --git a/shared/package-files/9d/9d1f5908ad763186b706541025cffe2195ca0644d3d1b3031c8ba57f8a8993b2/blob b/shared/package-files/9d/9d1f5908ad763186b706541025cffe2195ca0644d3d1b3031c8ba57f8a8993b2/blob new file mode 100644 index 0000000000000000000000000000000000000000..8e54800060f7903c0aa9741f6176ad2f35f481bd Binary files /dev/null and b/shared/package-files/9d/9d1f5908ad763186b706541025cffe2195ca0644d3d1b3031c8ba57f8a8993b2/blob differ diff --git a/shared/package-files/9d/9d20cb2c000f4f355c0d074071b67126d589edbe561ea8ee6b0ddbd627495fed/blob b/shared/package-files/9d/9d20cb2c000f4f355c0d074071b67126d589edbe561ea8ee6b0ddbd627495fed/blob new file mode 100644 index 0000000000000000000000000000000000000000..1f754351b597abea53139931a2df24092ec7e688 --- /dev/null +++ b/shared/package-files/9d/9d20cb2c000f4f355c0d074071b67126d589edbe561ea8ee6b0ddbd627495fed/blob @@ -0,0 +1,76 @@ +"X1","X2","X3","Y" +10.1,19.6,28.3,9.7 +9.5,20.5,28.9,10.1 +10.7,20.2,31,10.3 +9.9,21.5,31.7,9.5 +10.3,21.1,31.1,10 +10.8,20.4,29.2,10 +10.5,20.9,29.1,10.8 +9.9,19.6,28.8,10.3 +9.7,20.7,31,9.6 +9.3,19.7,30.3,9.9 +11,24,35,-0.2 +12,23,37,-0.4 +12,26,34,0.7 +11,34,34,0.1 +3.4,2.9,2.1,-0.4 +3.1,2.2,0.3,0.6 +0,1.6,0.2,-0.2 +2.3,1.6,2,0 +0.8,2.9,1.6,0.1 +3.1,3.4,2.2,0.4 +2.6,2.2,1.9,0.9 +0.4,3.2,1.9,0.3 +2,2.3,0.8,-0.8 +1.3,2.3,0.5,0.7 +1,0,0.4,-0.3 +0.9,3.3,2.5,-0.8 +3.3,2.5,2.9,-0.7 +1.8,0.8,2,0.3 +1.2,0.9,0.8,0.3 +1.2,0.7,3.4,-0.3 +3.1,1.4,1,0 +0.5,2.4,0.3,-0.4 +1.5,3.1,1.5,-0.6 +0.4,0,0.7,-0.7 +3.1,2.4,3,0.3 +1.1,2.2,2.7,-1 +0.1,3,2.6,-0.6 +1.5,1.2,0.2,0.9 +2.1,0,1.2,-0.7 +0.5,2,1.2,-0.5 +3.4,1.6,2.9,-0.1 +0.3,1,2.7,-0.7 +0.1,3.3,0.9,0.6 +1.8,0.5,3.2,-0.7 +1.9,0.1,0.6,-0.5 +1.8,0.5,3,-0.4 +3,0.1,0.8,-0.9 +3.1,1.6,3,0.1 +3.1,2.5,1.9,0.9 +2.1,2.8,2.9,-0.4 +2.3,1.5,0.4,0.7 +3.3,0.6,1.2,-0.5 +0.3,0.4,3.3,0.7 +1.1,3,0.3,0.7 +0.5,2.4,0.9,0 +1.8,3.2,0.9,0.1 +1.8,0.7,0.7,0.7 +2.4,3.4,1.5,-0.1 +1.6,2.1,3,-0.3 +0.3,1.5,3.3,-0.9 +0.4,3.4,3,-0.3 +0.9,0.1,0.3,0.6 +1.1,2.7,0.2,-0.3 +2.8,3,2.9,-0.5 +2,0.7,2.7,0.6 +0.2,1.8,0.8,-0.9 +1.6,2,1.2,-0.7 +0.1,0,1.1,0.6 +2,0.6,0.3,0.2 +1,2.2,2.9,0.7 +2.2,2.5,2.3,0.2 +0.6,2,1.5,-0.2 +0.3,1.7,2.2,0.4 +0,2.2,1.6,-0.9 +0.3,0.4,2.6,0.2 diff --git a/shared/package-files/9d/9d235ee1fb2ab2250f8d16418ed66527c536f794a5f6917a51ba5d4855f1748b/blob b/shared/package-files/9d/9d235ee1fb2ab2250f8d16418ed66527c536f794a5f6917a51ba5d4855f1748b/blob new file mode 100644 index 0000000000000000000000000000000000000000..3a67976643bbf8c4bab149bb60484f6344569caa --- /dev/null +++ b/shared/package-files/9d/9d235ee1fb2ab2250f8d16418ed66527c536f794a5f6917a51ba5d4855f1748b/blob @@ -0,0 +1,29 @@ +name: advanced-pip-example + +dependencies: + - pip + - pip: + + # Global options can be tweaked. + # For example, if you want to use a pypi mirror first: + - --index-url https://pypi.doubanio.com/simple + - --extra-index-url https://pypi.python.org/simple + # (check https://www.pypi-mirrors.org/) + + # Current syntax still works + - xmltodict==0.10.2 + + # Install in editable mode. + # More natural than - "--editable=git+https://github.com/neithere/argh.git#egg=argh + - -e git+https://github.com/neithere/argh.git#egg=argh + + # You could also specify a package in a directory. + # The directory can be relative to this environment file. + - -e ./module_to_install_in_editable_mode + + # Use another requirements file. + # Note that here also we can use relative paths. + # pip will be run from the environment file directory, if provided. + - -r another-project-requirements.txt + + # Anything else that pip requirement files allows should work seamlessly... diff --git a/shared/package-files/9d/9d28629cceccf3f92a358b3ed84d59b24ad32da1cf1cefa9fe1d7798b5d7bc28/blob b/shared/package-files/9d/9d28629cceccf3f92a358b3ed84d59b24ad32da1cf1cefa9fe1d7798b5d7bc28/blob new file mode 100644 index 0000000000000000000000000000000000000000..12882704b1313bbac0b9f533ffe6dba754203905 --- /dev/null +++ b/shared/package-files/9d/9d28629cceccf3f92a358b3ed84d59b24ad32da1cf1cefa9fe1d7798b5d7bc28/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & select_copy_out(at::Tensor & out, const at::Tensor & self, int64_t dim, int64_t index); +TORCH_API at::Tensor & select_copy_outf(const at::Tensor & self, int64_t dim, int64_t index, at::Tensor & out); +TORCH_API at::Tensor & select_copy_symint_out(at::Tensor & out, const at::Tensor & self, int64_t dim, c10::SymInt index); +TORCH_API at::Tensor & select_copy_symint_outf(const at::Tensor & self, int64_t dim, c10::SymInt index, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9d/9d2c5d94e66bc37c2d6af4b8d93311fdbfc41a03c1bf6db88a8641328e5ea02f/blob b/shared/package-files/9d/9d2c5d94e66bc37c2d6af4b8d93311fdbfc41a03c1bf6db88a8641328e5ea02f/blob new file mode 100644 index 0000000000000000000000000000000000000000..67f062b0a0cedac437fc7144a04192496d70d0b7 --- /dev/null +++ b/shared/package-files/9d/9d2c5d94e66bc37c2d6af4b8d93311fdbfc41a03c1bf6db88a8641328e5ea02f/blob @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, NoReturn + +from narwhals._interchange.dataframe import map_interchange_dtype_to_narwhals_dtype +from narwhals._utils import Version + +if TYPE_CHECKING: + from typing_extensions import Self + + from narwhals.dtypes import DType + + +class InterchangeSeries: + _version = Version.V1 + + def __init__(self, df: Any) -> None: + self._native_series = df + + def __narwhals_series__(self) -> Self: + return self + + def __native_namespace__(self) -> NoReturn: + msg = ( + "Cannot access native namespace for interchange-level series with unknown backend. " + "If you would like to see this kind of object supported in Narwhals, please " + "open a feature request at https://github.com/narwhals-dev/narwhals/issues." + ) + raise NotImplementedError(msg) + + @property + def dtype(self) -> DType: + return map_interchange_dtype_to_narwhals_dtype(self._native_series.dtype) + + @property + def native(self) -> Any: + return self._native_series + + def __getattr__(self, attr: str) -> NoReturn: + msg = ( # pragma: no cover + f"Attribute {attr} is not supported for interchange-level dataframes.\n\n" + "Hint: you probably called `nw.from_native` on an object which isn't fully " + "supported by Narwhals, yet implements `__dataframe__`. If you would like to " + "see this kind of object supported in Narwhals, please open a feature request " + "at https://github.com/narwhals-dev/narwhals/issues." + ) + raise NotImplementedError(msg) diff --git a/shared/package-files/9d/9d2c929c8208050b0a60e95f896b9edd4681e5b27d37607f8b78b586dd2a6164/blob b/shared/package-files/9d/9d2c929c8208050b0a60e95f896b9edd4681e5b27d37607f8b78b586dd2a6164/blob new file mode 100644 index 0000000000000000000000000000000000000000..89e53a2c56b5f654b66163a685940ecb596781ee --- /dev/null +++ b/shared/package-files/9d/9d2c929c8208050b0a60e95f896b9edd4681e5b27d37607f8b78b586dd2a6164/blob @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::q_scale(Tensor self) -> float +inline double q_scale(const at::Tensor & self) { + return at::_ops::q_scale::call(self); +} + +} diff --git a/shared/package-files/9d/9d2dcce4829efa27ded0b12b9328768689b780fca14bc87c38ce21b2c72ce303/blob b/shared/package-files/9d/9d2dcce4829efa27ded0b12b9328768689b780fca14bc87c38ce21b2c72ce303/blob new file mode 100644 index 0000000000000000000000000000000000000000..96397a56eac8617b94d6562f38406d5b8a9136a4 --- /dev/null +++ b/shared/package-files/9d/9d2dcce4829efa27ded0b12b9328768689b780fca14bc87c38ce21b2c72ce303/blob @@ -0,0 +1,46 @@ +#pragma once + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace torch { +namespace jit { + +struct TORCH_API CompilationOptions { + bool incl_interface_call = false; + bool enable_default_value_for_unspecified_arg = false; + bool enable_default_args_before_out_args = true; + bool enable_emit_promoted_ops = true; + int model_version = caffe2::serialize::kProducedBytecodeVersion; +}; + +TORCH_API mobile::Module jitModuleToMobile( + const Module& module, + const CompilationOptions& options); + +mobile::Code compileGraphToMobileCode( + const std::string& name, + const std::shared_ptr& graph, + const CompilationOptions& compilation_options, + BackendDebugInfoRecorder& debug_info_recorder); + +TORCH_API std::unique_ptr convertJitFunctionToMobileFunction( + const GraphFunction& function, + const CompilationOptions& options); + +TORCH_API IValue convertMobileFunctionToCodeTable( + const mobile::Function& func, + const CompilationOptions& compilation_options); + +} // namespace jit +} // namespace torch diff --git a/shared/package-files/9d/9d2e93aa9c0f744793b14979c0d47824d92604d1da48b84b1c45cee2932a8f50/blob b/shared/package-files/9d/9d2e93aa9c0f744793b14979c0d47824d92604d1da48b84b1c45cee2932a8f50/blob new file mode 100644 index 0000000000000000000000000000000000000000..994c50ad9e61c6b0634d80ec3921824f662de59c --- /dev/null +++ b/shared/package-files/9d/9d2e93aa9c0f744793b14979c0d47824d92604d1da48b84b1c45cee2932a8f50/blob @@ -0,0 +1,393 @@ +// Copyright © 2022 Apple Inc. + +#pragma once + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace at::mps { + +namespace Profiler { + +struct BaseInfo { + // profiling info types + enum class Type { + GRAPH, + KERNEL, + COPY, + CPU_FALLBACK, + }; + + BaseInfo(Type infoType, uint64_t Id, const uintptr_t Handle) : + type(infoType), profileId(Id), handle(Handle) { } + virtual ~BaseInfo() = default; + + // type of profiling info + Type type; + // unique profile ID for execution instances of operations or copies + uint64_t profileId; + // ID generated by os_signpost + // since it's possible to use event and interval-based signposts at the + // same time, we need separate IDs for each. + os_signpost_id_t eventSignpostId = 0, intervalSignpostId = 0; + // accumulated GPU time in ms (obtained from CompletionHandler's "GPUEndTime - GPUStartTime") + std::atomic totalGpuTime{0.0}; + // accumulated Scheduling time in ms (obtained from CompletionHandler's "KernelEndTime - KernelStartTime") + std::atomic totalSchedulingTime{0.0}; + // indicates if the operation or copy execution has completed + std::atomic_bool completed{false}; + // handle used to identify the profile info's instance (usually the pointer) + const uintptr_t handle; + + virtual const std::string toString(double gpuTime = 0, double schedulingTime = 0) const; + // builds a string for a tensor (format: Device:ScalarType[tensor.sizes()]) + static std::string buildTensorString(const Tensor& tensor, bool includeBufferId = false) { + if (tensor.defined()) { + std::stringstream tensorStr; + auto deviceType = tensor.device().type(); + tensorStr << c10::DeviceTypeName(deviceType); + // see comments for INCLUDE_BUFFER_ID + if (includeBufferId && deviceType == at::kMPS) { + id buffer = __builtin_bit_cast(id, tensor.storage().data()); + tensorStr << "(buf#" << (getIMPSAllocator()->getBufferId(buffer)) + << ":" << buffer.retainCount << ")"; + } + tensorStr << ":" + << tensor.scalar_type() << tensor.sizes(); + return tensorStr.str(); + } else { + return "undefined"; + } + } + static uint64_t getTime() { + return clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW); + } +}; + +struct OperationInfo : BaseInfo { + OperationInfo(const void* Handle, bool IsGraph, uint64_t Id, const std::string& StrKey) : + BaseInfo(IsGraph ? Type::GRAPH : Type::KERNEL, Id, uintptr_t(Handle)), strKey(StrKey) { } + + uint64_t runCount = 0; + std::string strKey; + + const std::string toString(double gpuTime = 0, double schedulingTime = 0) const override; + + // builds a string for a kernel + static std::string buildKernelString(const std::string& kernelName, + const TensorList& tensors, + bool includeBufferId = false) { + std::stringstream kernelStr; + kernelStr << kernelName; + for (const Tensor& tensor: tensors) { + kernelStr << ":" << BaseInfo::buildTensorString(tensor, includeBufferId); + } + return kernelStr.str(); + } +}; + +struct CpuFbInfo : BaseInfo { + CpuFbInfo(uint64_t Id, const std::string& OpName) : + BaseInfo(Type::CPU_FALLBACK, Id, 0), opName(OpName) { } + + uint64_t runCount = 0; + // the current and total overhead of copies in bytes required to convert the Op's + // input tensors from MPS to CPU and then output from CPU back to MPS + size_t currentCopyOverhead = 0; + size_t totalCopyOverhead = 0; + std::string opName; + std::string strKey; + uint64_t startTime = 0; + + const std::string toString(double gpuTime = 0, double schedulingTime = 0) const override; + + void updateCopyOverhead(const TensorList& tensors) { + currentCopyOverhead = 0; + for (const Tensor& tensor: tensors) { + if (tensor.defined()) { + currentCopyOverhead += tensor.nbytes(); + } + } + totalCopyOverhead += currentCopyOverhead; + } +}; + +struct CopyInfo : BaseInfo { + enum class Kind { + MPS_TO_MPS, + MPS_TO_CPU, + CPU_TO_MPS, + }; + + CopyInfo(const void* Handle, size_t Length, uint64_t Id, bool IsNonBlocking, bool UsesBlitter) : + BaseInfo(Type::COPY, Id, uintptr_t(Handle)), kind(Kind::MPS_TO_MPS), + length(Length), isNonBlocking(IsNonBlocking), usesBlitter(UsesBlitter) { } + + Kind kind; + size_t length; + bool isNonBlocking; + bool usesBlitter; + std::string srcStrKey; + std::string dstStrKey; + // for copies that don't use blitters, we measure CPU time + uint64_t startTime = 0; + + const std::string toString(double gpuTime = 0, double schedulingTime = 0) const override; + + static std::string buildTensorString(const void* buffer, const OptionalTensorRef tensor, bool includeBufferId = false); + + static bool isStorageOnMPS(const void* buffer, const OptionalTensorRef tensor) { + if (tensor.has_value()) { + return tensor->device().type() == at::kMPS; + } + TORCH_INTERNAL_ASSERT_DEBUG_ONLY(buffer); + // getUnalignedBufferSize() returns -1 if input buffer is not on MPS device + return getIMPSAllocator()->getUnalignedBufferSize(buffer) >= 0; + } + + static Kind getCopyKind(const void* srcBuffer, const void* dstBuffer, + const OptionalTensorRef srcTensor, const OptionalTensorRef dstTensor) { + const bool isSrcOnMPS = isStorageOnMPS(srcBuffer, srcTensor); + const bool isDstOnMPS = isStorageOnMPS(dstBuffer, dstTensor); + TORCH_INTERNAL_ASSERT_DEBUG_ONLY(isSrcOnMPS || isDstOnMPS); + if (isSrcOnMPS && !isDstOnMPS) { + return Kind::MPS_TO_CPU; + } else if (!isSrcOnMPS && isDstOnMPS) { + return Kind::CPU_TO_MPS; + } + return Kind::MPS_TO_MPS; + } +}; + +struct CopyStat : CopyInfo { + explicit CopyStat(std::string CopyKindStr) : + CopyInfo(nullptr, 0, 0, false, false), kindStr(std::move(CopyKindStr)) {} + // total number of copies + size_t totalCount = 0; + // number of Scalar copies (i.e., less than sizeof(int64)) + size_t scalarsCount = 0; + // number of blocking copies (i.e., require syncing to GPU) + size_t blockingCount = 0; + // number of copies that used memcpy(), instead of Metal Blit Encoder + size_t memcpyCount = 0; + // accumulated GPU time in ms for the scalar copies + std::atomic scalarsGpuTime{0.0}; + // copy kind in string type + std::string kindStr; +}; + +class MPSProfiler { +public: + // lower 16 bits used for profiler options + enum ProfileOptions : uint32_t { + OPTIONS_NONE = 0, + // ALL_* means, all signpost types (RUN_OPERATION|BLIT_COPY|CPU_FALLBACK, etc.) + // (used for convenience to not compute bit flags by OR-ing manually) + // trace all signpost types using events + ALL_SIGNPOST_EVENTS = (1 << 0), + // trace all signpost types using intervals + ALL_SIGNPOST_INTERVALS = (1 << 1), + // always wait for command buffer to finish executing after each commit + WAIT_UNTIL_COMPLETED = (1 << 2), + // for interval-based signposts, include the scheduling portion of + // Graph/Kernel/Copy executions as well. + // if flag is disable, only "GPU run time" is included in interval, + // and not schedule time. + INCLUDE_SCHEDULE_INTERVAL = (1 << 3), + + // use these if you need to trace signposts types individually (rarely required) + // trace signpost using intervals + USE_INTERVALS = (1 << 4), + // trace signpost by emitting events + USE_EVENTS = (1 << 5), + // used for sanity check (Change this when new option added) + OPTIONS_COUNT = (USE_EVENTS << 1) - 1, + }; + + // when adding new types, #define the type string in MPSProfiler.mm as well. + // upper 16 bits used for event types + enum SignpostTypes : uint32_t { + SIGNPOST_NONE = 0, + // trace signposts for PyTorch operation executions + RUN_OPERATION = (1 << 16), + // trace signposts for blitter copies + BLIT_COPY = (1 << 17), + // trace signposts for ops that fall back on CPU + CPU_FALLBACK = (1 << 18), + // used for sanity check (Change this when new type added) + SIGNPOST_COUNT = (CPU_FALLBACK << 1) - 1, + }; + + enum LogOptions : uint32_t { + LOG_NONE = 0, + + // Info logging options during execution + // ------------------------------------- + // prints operation info (id/key/run_count) during execution + OPERATION_INFO = (1 << 0), + // prints copy info (src/dst tensors/buffers, size, etc.) during execution + COPY_INFO = (1 << 1), + // prints CPU Fallback info (id/runCount/opName/copyOverhead) during execution + CPU_FALLBACK_INFO = (1 << 2), + + // Profiling Statistics logging options when process terminates + // ------------------------------------------------------------ + // prints all stats (OPERATION_STATS, COPY_STATS, CPU_FALLBACK_STATS) before process terminates + // this is convenient to not combine following stats bit flags manually + ALL_STATS = (1 << 3), + // prints operation stats (GPU times, run count, etc.) before process terminates + OPERATION_STATS = (1 << 4), + // prints copies stats (GPU times, copy kinds, sizes, etc.) before process terminates + COPY_STATS = (1 << 5), + // prints CPU Fallback stats (CPU times, run times, size of MPS<->CPU copies + // for tensors, etc.) before process terminates + CPU_FALLBACK_STATS = (1 << 6), + + // Metadata format options when logging the info + // --------------------------------------------- + // if enabled, includes GPU run time in metadata (i.e., GPUEndTime-GPUStartTime + // from Metal Command Buffers) (e.g., [GPU=0.324 ms]) + INCLUDE_GPU_TIME = (1 << 7), + // if enabled, includes GPU scheduling time in metadata separately + // (i.e., KernelEndTime-KernelStartTime from Metal Command Buffers) + // e.g., [GPU=0.324 ms, KRNL=0.036 ms] + INCLUDE_KERNEL_TIME = (1 << 8), + // if enabled, includes the unique buffer ID in metadata for the storage + // of a tensor that was allocated on MPSAllocator. This is useful (along with + // the EV "PYTORCH_DEBUG_MPS_ALLOCATOR") to identify buffers that are involved + // with various operations. + INCLUDE_BUFFER_ID = (1 << 9), + + // used for sanity check (Change this when new option added) + LOG_COUNT = (INCLUDE_BUFFER_ID << 1) - 1, + }; + + explicit MPSProfiler(); + ~MPSProfiler(); + + // the handle is either "MPSGraph*" or "id" for Metal Kernels + // the beginProfile*() functions return a profileId which is unique per graph/kernel/copy + uint64_t beginProfileKernel(const void* handle, const std::string& strKey, bool isGraph); + uint64_t beginProfileKernel(const void* handle, const std::string& kernelName, const TensorList& tensors); + uint64_t beginProfileCopy(const void* srcBuffer, const void* dstBuffer, + const OptionalTensorRef srcTensor, + const OptionalTensorRef dstTensor, + size_t length, bool isNonBlocking, bool usesBlitter = true); + uint64_t beginProfileCPUFallback(const std::string& opName, const TensorList& tensors); + void beginProfileGPUInterval(const void* handle); + + void endProfileCopy(uint64_t profileId, SyncType syncType); + void endProfileKernel(const void* handle, SyncType syncType = SyncType::NONE); + void endProfileCPUFallback(const std::string& opName); + + // these are used to hook into Python bindings for torch.mps.profiler module. + // this enables generating OS Signpost traces from MPSProfiler on-demand + // during runtime (instead of environment variables). + // The "mode" could be either "interval", "event", or both "interval,event" + // for interval-based and/or event-based signpost tracing. + void StartTrace(const string& mode, bool waitUntilCompleted); + void StopTrace(); + + // convenience functions to indicate whether signpost tracing or + // logging are enabled for the SignpostTypes + bool isOperationProfilingEnabled() const { + return (m_signpost_types & SignpostTypes::RUN_OPERATION) || + (m_log_options & (LogOptions::OPERATION_INFO | LogOptions::OPERATION_STATS)); + } + bool isCopyProfilingEnabled() const { + return (m_signpost_types & SignpostTypes::BLIT_COPY) || + (m_log_options & (LogOptions::COPY_INFO | LogOptions::COPY_STATS)); + } + bool isCPUFallbackProfilingEnabled() const { + return (m_signpost_types & SignpostTypes::CPU_FALLBACK) || + (m_log_options & (LogOptions::CPU_FALLBACK_INFO | LogOptions::CPU_FALLBACK_STATS)); + } + bool isSignpostTracingEnabled() const { + return (m_signpost_types != SignpostTypes::SIGNPOST_NONE); + } + + private: + // indicates what type of signpost types are enabled and traced by MPS profiler. + uint32_t m_signpost_types = 0; + uint32_t m_profile_options = 0; + uint32_t m_log_options = 0; + uint64_t m_kernel_counter = 0; + uint64_t m_graph_counter = 0; + uint64_t m_cpu_fb_counter = 0; + uint64_t m_copy_counter = 0; + // technically, it's possible to trace both events and intervals at the same time + // so we use separate os_log categories for them + os_log_t m_os_log_events; + os_log_t m_os_log_intervals; + // stats logging could run either from destructor or signal handler + // so this is used to check if logging has already started. + std::atomic_bool hasLoggedStats{false}; + // indicates there are pending completionHandler callbacks that haven't been called yet. + std::atomic_bool hasPendingCompletionHandlers{false}; + // used to capture sigint signal to log profiling stats + static struct sigaction currentSigint, previousSigint; + + // We use the following lists for two reasons: + // 1- for interval-based signposts the "begin" point won't be in same function + // as the "end" point where we need to be able to retrieve signpost's info + // 2- if Operations info need to be logged when process ends using LogOptions::OPERATION_INFO. + + // the pointer key for this map is either "MPSGraph*" or "id" for Metal Kernels + // this list is retained and could be logged along with aggregate profiling numbers when the process ends. + std::unordered_map> m_op_info_list{}; + // the string key for this map is the op name that we fall back to execute on CPU + // this list is retained and could be logged along with aggregate profiling numbers when the process ends. + std::unordered_map> m_cpu_fb_info_list{}; + // this list contains the info for copies, and its key is the unique profileId + // which is generated from m_copy_counter + // The copyInfo list is not retained. + std::unordered_map> m_copy_info_list{}; + // a short list that contains copy stats + std::unordered_map> m_copy_stat_list{}; + + void initialize(); + void beginProfileExecution(BaseInfo& info, bool cpuExecution = false); + void endProfileExecution(BaseInfo& info, os_signpost_id_t event_signpost_id, + os_signpost_id_t interval_signpost_id, + double gpuTime, double schedulingTime); + void addProfilerScheduledHandler(BaseInfo& info); + void addProfilerCompletedHandler(BaseInfo& info, SyncType syncType); + void emitSignpostEvent(SignpostTypes signpost_type, os_signpost_id_t signpost_id, + const std::string& msg) const; + void beginSignpostInterval(SignpostTypes signpost_type, os_signpost_id_t signpost_id, + const std::string& msg) const; + void endSignpostInterval(SignpostTypes signpost_type, os_signpost_id_t signpost_id) const; + + void updateCopyStats(const CopyInfo& copyInfo, double gpuTime, double schedulingTime); + // returns true if logging the profiling info "during the execution" is enabled + bool isProfileInfoLoggingEnabled(BaseInfo::Type infoType, bool isExecutionEnded); + // logs all the profiling stats that are enabled + void logProfilingStats(); + // logs kernel profiling stats when the process ends. + void logOperationsProfilingStats(std::FILE* f) const; + // logs CPU Fallback profiling stats when the process ends. + void logCPUFallbackProfilingStats(std::FILE* f) const; + // logs copy profiling stats when the process ends. + void logCopyProfilingStats(std::FILE* f) const; + + os_signpost_id_t generateSignpostId(os_signpost_type_t signpostType, const void* ptr = nullptr); + static SignpostTypes getSignpostType(BaseInfo::Type infoType); + static void handleIntSignal(int signal); +}; + +} // namespace Profiler + +Profiler::MPSProfiler& getMPSProfiler(); + +} // namespace at::mps diff --git a/shared/package-files/9d/9d301e88794ca87d56d1e43037867d7c815e96acee8f5b4cc72496d465afdb89/blob b/shared/package-files/9d/9d301e88794ca87d56d1e43037867d7c815e96acee8f5b4cc72496d465afdb89/blob new file mode 100644 index 0000000000000000000000000000000000000000..17d68fe437c3f01ed448da416307dda827609f67 --- /dev/null +++ b/shared/package-files/9d/9d301e88794ca87d56d1e43037867d7c815e96acee8f5b4cc72496d465afdb89/blob @@ -0,0 +1,24 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & _ctc_loss_backward_out(const at::Tensor & grad, const at::Tensor & log_probs, const at::Tensor & targets, at::IntArrayRef input_lengths, at::IntArrayRef target_lengths, const at::Tensor & neg_log_likelihood, const at::Tensor & log_alpha, int64_t blank, bool zero_infinity, at::Tensor & out); +TORCH_API at::Tensor ctc_loss_backward_cpu(const at::Tensor & grad, const at::Tensor & log_probs, const at::Tensor & targets, at::IntArrayRef input_lengths, at::IntArrayRef target_lengths, const at::Tensor & neg_log_likelihood, const at::Tensor & log_alpha, int64_t blank, bool zero_infinity=false); +TORCH_API at::Tensor ctc_loss_backward_gpu(const at::Tensor & grad, const at::Tensor & log_probs, const at::Tensor & targets, at::IntArrayRef input_lengths, at::IntArrayRef target_lengths, const at::Tensor & neg_log_likelihood, const at::Tensor & log_alpha, int64_t blank, bool zero_infinity=false); +TORCH_API at::Tensor ctc_loss_backward_tensor(const at::Tensor & grad, const at::Tensor & log_probs, const at::Tensor & targets, const at::Tensor & input_lengths, const at::Tensor & target_lengths, const at::Tensor & neg_log_likelihood, const at::Tensor & log_alpha, int64_t blank, bool zero_infinity=false); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9d313e7efada2caeb14d970fe2e3d5d36c0e4a1cd82960daa1aa71df901e0ce6/blob b/shared/package-files/9d/9d313e7efada2caeb14d970fe2e3d5d36c0e4a1cd82960daa1aa71df901e0ce6/blob new file mode 100644 index 0000000000000000000000000000000000000000..ce41de43596e305278acf6a9efb82fa49a43da1a --- /dev/null +++ b/shared/package-files/9d/9d313e7efada2caeb14d970fe2e3d5d36c0e4a1cd82960daa1aa71df901e0ce6/blob @@ -0,0 +1,301 @@ +from __future__ import annotations + +from typing import Any +import numpy as np + +c16 = np.complex128() +f8 = np.float64() +i8 = np.int64() +u8 = np.uint64() + +c8 = np.complex64() +f4 = np.float32() +i4 = np.int32() +u4 = np.uint32() + +dt = np.datetime64(0, "D") +td = np.timedelta64(0, "D") + +b_ = np.bool_() + +b = bool() +c = complex() +f = float() +i = int() + +SEQ = (0, 1, 2, 3, 4) + +AR_b: np.ndarray[Any, np.dtype[np.bool_]] = np.array([True]) +AR_u: np.ndarray[Any, np.dtype[np.uint32]] = np.array([1], dtype=np.uint32) +AR_i: np.ndarray[Any, np.dtype[np.int_]] = np.array([1]) +AR_f: np.ndarray[Any, np.dtype[np.float_]] = np.array([1.0]) +AR_c: np.ndarray[Any, np.dtype[np.complex_]] = np.array([1.0j]) +AR_m: np.ndarray[Any, np.dtype[np.timedelta64]] = np.array([np.timedelta64("1")]) +AR_M: np.ndarray[Any, np.dtype[np.datetime64]] = np.array([np.datetime64("1")]) +AR_O: np.ndarray[Any, np.dtype[np.object_]] = np.array([1], dtype=object) + +# Arrays + +AR_b > AR_b +AR_b > AR_u +AR_b > AR_i +AR_b > AR_f +AR_b > AR_c + +AR_u > AR_b +AR_u > AR_u +AR_u > AR_i +AR_u > AR_f +AR_u > AR_c + +AR_i > AR_b +AR_i > AR_u +AR_i > AR_i +AR_i > AR_f +AR_i > AR_c + +AR_f > AR_b +AR_f > AR_u +AR_f > AR_i +AR_f > AR_f +AR_f > AR_c + +AR_c > AR_b +AR_c > AR_u +AR_c > AR_i +AR_c > AR_f +AR_c > AR_c + +AR_m > AR_b +AR_m > AR_u +AR_m > AR_i +AR_b > AR_m +AR_u > AR_m +AR_i > AR_m + +AR_M > AR_M + +AR_O > AR_O +1 > AR_O +AR_O > 1 + +# Time structures + +dt > dt + +td > td +td > i +td > i4 +td > i8 +td > AR_i +td > SEQ + +# boolean + +b_ > b +b_ > b_ +b_ > i +b_ > i8 +b_ > i4 +b_ > u8 +b_ > u4 +b_ > f +b_ > f8 +b_ > f4 +b_ > c +b_ > c16 +b_ > c8 +b_ > AR_i +b_ > SEQ + +# Complex + +c16 > c16 +c16 > f8 +c16 > i8 +c16 > c8 +c16 > f4 +c16 > i4 +c16 > b_ +c16 > b +c16 > c +c16 > f +c16 > i +c16 > AR_i +c16 > SEQ + +c16 > c16 +f8 > c16 +i8 > c16 +c8 > c16 +f4 > c16 +i4 > c16 +b_ > c16 +b > c16 +c > c16 +f > c16 +i > c16 +AR_i > c16 +SEQ > c16 + +c8 > c16 +c8 > f8 +c8 > i8 +c8 > c8 +c8 > f4 +c8 > i4 +c8 > b_ +c8 > b +c8 > c +c8 > f +c8 > i +c8 > AR_i +c8 > SEQ + +c16 > c8 +f8 > c8 +i8 > c8 +c8 > c8 +f4 > c8 +i4 > c8 +b_ > c8 +b > c8 +c > c8 +f > c8 +i > c8 +AR_i > c8 +SEQ > c8 + +# Float + +f8 > f8 +f8 > i8 +f8 > f4 +f8 > i4 +f8 > b_ +f8 > b +f8 > c +f8 > f +f8 > i +f8 > AR_i +f8 > SEQ + +f8 > f8 +i8 > f8 +f4 > f8 +i4 > f8 +b_ > f8 +b > f8 +c > f8 +f > f8 +i > f8 +AR_i > f8 +SEQ > f8 + +f4 > f8 +f4 > i8 +f4 > f4 +f4 > i4 +f4 > b_ +f4 > b +f4 > c +f4 > f +f4 > i +f4 > AR_i +f4 > SEQ + +f8 > f4 +i8 > f4 +f4 > f4 +i4 > f4 +b_ > f4 +b > f4 +c > f4 +f > f4 +i > f4 +AR_i > f4 +SEQ > f4 + +# Int + +i8 > i8 +i8 > u8 +i8 > i4 +i8 > u4 +i8 > b_ +i8 > b +i8 > c +i8 > f +i8 > i +i8 > AR_i +i8 > SEQ + +u8 > u8 +u8 > i4 +u8 > u4 +u8 > b_ +u8 > b +u8 > c +u8 > f +u8 > i +u8 > AR_i +u8 > SEQ + +i8 > i8 +u8 > i8 +i4 > i8 +u4 > i8 +b_ > i8 +b > i8 +c > i8 +f > i8 +i > i8 +AR_i > i8 +SEQ > i8 + +u8 > u8 +i4 > u8 +u4 > u8 +b_ > u8 +b > u8 +c > u8 +f > u8 +i > u8 +AR_i > u8 +SEQ > u8 + +i4 > i8 +i4 > i4 +i4 > i +i4 > b_ +i4 > b +i4 > AR_i +i4 > SEQ + +u4 > i8 +u4 > i4 +u4 > u8 +u4 > u4 +u4 > i +u4 > b_ +u4 > b +u4 > AR_i +u4 > SEQ + +i8 > i4 +i4 > i4 +i > i4 +b_ > i4 +b > i4 +AR_i > i4 +SEQ > i4 + +i8 > u4 +i4 > u4 +u8 > u4 +u4 > u4 +b_ > u4 +b > u4 +i > u4 +AR_i > u4 +SEQ > u4 diff --git a/shared/package-files/9d/9d31444a6a9718043757681c00930fd22ba9255031b44ecaa447382cc2964e82/blob b/shared/package-files/9d/9d31444a6a9718043757681c00930fd22ba9255031b44ecaa447382cc2964e82/blob new file mode 100644 index 0000000000000000000000000000000000000000..ef6b2b84dd774012b664d1a180ee2b221753d4ae --- /dev/null +++ b/shared/package-files/9d/9d31444a6a9718043757681c00930fd22ba9255031b44ecaa447382cc2964e82/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API int64_t output_nr(const at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9d31718fcdc3562e0e122f01f70a24112d9587e1f052cc591e2100e0f707d3af/blob b/shared/package-files/9d/9d31718fcdc3562e0e122f01f70a24112d9587e1f052cc591e2100e0f707d3af/blob new file mode 100644 index 0000000000000000000000000000000000000000..5bd9f53a8a8d4e74faa6e6f825c5a2c01f2fa008 --- /dev/null +++ b/shared/package-files/9d/9d31718fcdc3562e0e122f01f70a24112d9587e1f052cc591e2100e0f707d3af/blob @@ -0,0 +1,12 @@ +from typing import Tuple + +from cryptography.hazmat.primitives.hashes import HashAlgorithm + +def decode_dss_signature(signature: bytes) -> Tuple[int, int]: ... +def encode_dss_signature(r: int, s: int) -> bytes: ... + +class Prehashed(object): + _algorithm: HashAlgorithm # undocumented + _digest_size: int # undocumented + def __init__(self, algorithm: HashAlgorithm) -> None: ... + digest_size: int diff --git a/shared/package-files/9d/9d32d6149d89003023d624e43c66d0c65b9b2ed08e4764b4ca44962daa14a320/blob b/shared/package-files/9d/9d32d6149d89003023d624e43c66d0c65b9b2ed08e4764b4ca44962daa14a320/blob new file mode 100644 index 0000000000000000000000000000000000000000..9e59fe98bf26600514e5d749ced3f8b4f25fb692 Binary files /dev/null and b/shared/package-files/9d/9d32d6149d89003023d624e43c66d0c65b9b2ed08e4764b4ca44962daa14a320/blob differ diff --git a/shared/package-files/9d/9d33df6e1cfdd2cf2553f5e2758f457d710caff5f8c69968f2665accd6e9a6fd/blob b/shared/package-files/9d/9d33df6e1cfdd2cf2553f5e2758f457d710caff5f8c69968f2665accd6e9a6fd/blob new file mode 100644 index 0000000000000000000000000000000000000000..8da8cd69c30e9102fba9fc9895693f0069a4674f --- /dev/null +++ b/shared/package-files/9d/9d33df6e1cfdd2cf2553f5e2758f457d710caff5f8c69968f2665accd6e9a6fd/blob @@ -0,0 +1,801 @@ +# Encoding file: cp932, multi-byte +M +003F 0 46 +00 +0000000100020003000400050006000700080009000A000B000C000D000E000F +0010001100120013001400150016001700180019001A001B001C001D001E001F +0020002100220023002400250026002700280029002A002B002C002D002E002F +0030003100320033003400350036003700380039003A003B003C003D003E003F +0040004100420043004400450046004700480049004A004B004C004D004E004F +0050005100520053005400550056005700580059005A005B005C005D005E005F +0060006100620063006400650066006700680069006A006B006C006D006E006F +0070007100720073007400750076007700780079007A007B007C007D007E007F +0080000000000000000000850086000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F +FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F +FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F +FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +81 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +300030013002FF0CFF0E30FBFF1AFF1BFF1FFF01309B309C00B4FF4000A8FF3E +FFE3FF3F30FD30FE309D309E30034EDD30053006300730FC20152010FF0FFF3C +FF5E2225FF5C2026202520182019201C201DFF08FF0930143015FF3BFF3DFF5B +FF5D30083009300A300B300C300D300E300F30103011FF0BFF0D00B100D70000 +00F7FF1D2260FF1CFF1E22662267221E22342642264000B0203220332103FFE5 +FF04FFE0FFE1FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C725C6 +25A125A025B325B225BD25BC203B301221922190219121933013000000000000 +000000000000000000000000000000002208220B2286228722822283222A2229 +0000000000000000000000000000000022272228FFE221D221D4220022030000 +0000000000000000000000000000000000000000222022A52312220222072261 +2252226A226B221A223D221D2235222B222C0000000000000000000000000000 +212B2030266F266D266A2020202100B6000000000000000025EF000000000000 +82 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000FF10 +FF11FF12FF13FF14FF15FF16FF17FF18FF190000000000000000000000000000 +FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2FFF30 +FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3A000000000000000000000000 +0000FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F +FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5A00000000000000003041 +30423043304430453046304730483049304A304B304C304D304E304F30503051 +30523053305430553056305730583059305A305B305C305D305E305F30603061 +30623063306430653066306730683069306A306B306C306D306E306F30703071 +30723073307430753076307730783079307A307B307C307D307E307F30803081 +30823083308430853086308730883089308A308B308C308D308E308F30903091 +3092309300000000000000000000000000000000000000000000000000000000 +83 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +30A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF30B0 +30B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF30C0 +30C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF30D0 +30D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF0000 +30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF +30F030F130F230F330F430F530F6000000000000000000000000000000000391 +03920393039403950396039703980399039A039B039C039D039E039F03A003A1 +03A303A403A503A603A703A803A90000000000000000000000000000000003B1 +03B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF03C003C1 +03C303C403C503C603C703C803C9000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +84 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +04100411041204130414041504010416041704180419041A041B041C041D041E +041F0420042104220423042404250426042704280429042A042B042C042D042E +042F000000000000000000000000000000000000000000000000000000000000 +04300431043204330434043504510436043704380439043A043B043C043D0000 +043E043F0440044104420443044404450446044704480449044A044B044C044D +044E044F00000000000000000000000000000000000000000000000000002500 +2502250C251025182514251C252C25242534253C25012503250F2513251B2517 +25232533252B253B254B2520252F25282537253F251D25302525253825420000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +87 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +2460246124622463246424652466246724682469246A246B246C246D246E246F +2470247124722473216021612162216321642165216621672168216900003349 +33143322334D331833273303333633513357330D33263323332B334A333B339C +339D339E338E338F33C433A100000000000000000000000000000000337B0000 +301D301F211633CD212132A432A532A632A732A8323132323239337E337D337C +22522261222B222E2211221A22A52220221F22BF22352229222A000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +88 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000004E9C +55165A03963F54C0611B632859F690228475831C7A5060AA63E16E2565ED8466 +82A69BF56893572765A162715B9B59D0867B98F47D627DBE9B8E62167C9F88B7 +5B895EB563096697684895C7978D674F4EE54F0A4F4D4F9D504956F2593759D4 +5A015C0960DF610F61706613690570BA754F757079FB7DAD7DEF80C3840E8863 +8B029055907A533B4E954EA557DF80B290C178EF4E0058F16EA290387A328328 +828B9C2F5141537054BD54E156E059FB5F1598F26DEB80E4852D000000000000 +89 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +9662967096A097FB540B53F35B8770CF7FBD8FC296E8536F9D5C7ABA4E117893 +81FC6E26561855046B1D851A9C3B59E553A96D6674DC958F56424E91904B96F2 +834F990C53E155B65B305F71662066F368046C386CF36D29745B76C87A4E9834 +82F1885B8A6092ED6DB275AB76CA99C560A68B018D8A95B2698E53AD51860000 +5712583059445BB45EF6602863A963F46CBF6F14708E7114715971D5733F7E01 +827682D185979060925B9D1B586965BC6C5A752551F9592E59655F805FDC62BC +65FA6A2A6B276BB4738B7FC189569D2C9D0E9EC45CA16C96837B51045C4B61B6 +81C6687672614E594FFA537860696E297A4F97F34E0B53164EEE4F554F3D4FA1 +4F7352A053EF5609590F5AC15BB65BE179D16687679C67B66B4C6CB3706B73C2 +798D79BE7A3C7B8782B182DB8304837783EF83D387668AB256298CA88FE6904E +971E868A4FC45CE862117259753B81E582BD86FE8CC096C5991399D54ECB4F1A +89E356DE584A58CA5EFB5FEB602A6094606261D0621262D06539000000000000 +8A +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +9B41666668B06D777070754C76867D7582A587F9958B968E8C9D51F152BE5916 +54B35BB35D16616869826DAF788D84CB88578A7293A79AB86D6C99A886D957A3 +67FF86CE920E5283568754045ED362E164B9683C68386BBB737278BA7A6B899A +89D28D6B8F0390ED95A3969497695B665CB3697D984D984E639B7B206A2B0000 +6A7F68B69C0D6F5F5272559D607062EC6D3B6E076ED1845B89108F444E149C39 +53F6691B6A3A9784682A515C7AC384B291DC938C565B9D286822830584317CA5 +520882C574E64E7E4F8351A05BD2520A52D852E75DFB559A582A59E65B8C5B98 +5BDB5E725E7960A3611F616361BE63DB656267D1685368FA6B3E6B536C576F22 +6F976F4574B0751876E3770B7AFF7BA17C217DE97F367FF0809D8266839E89B3 +8ACC8CAB908494519593959195A2966597D3992882184E38542B5CB85DCC73A9 +764C773C5CA97FEB8D0B96C19811985498584F014F0E5371559C566857FA5947 +5B095BC45C905E0C5E7E5FCC63EE673A65D765E2671F68CB68C4000000000000 +8B +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +6A5F5E306BC56C176C7D757F79485B637A007D005FBD898F8A188CB48D778ECC +8F1D98E29A0E9B3C4E80507D510059935B9C622F628064EC6B3A72A075917947 +7FA987FB8ABC8B7063AC83CA97A05409540355AB68546A588A70782767759ECD +53745BA2811A865090064E184E454EC74F1153CA54385BAE5F13602565510000 +673D6C426C726CE3707874037A767AAE7B087D1A7CFE7D6665E7725B53BB5C45 +5DE862D262E063196E20865A8A318DDD92F86F0179A69B5A4EA84EAB4EAC4F9B +4FA050D151477AF6517151F653545321537F53EB55AC58835CE15F375F4A602F +6050606D631F65596A4B6CC172C272ED77EF80F881058208854E90F793E197FF +99579A5A4EF051DD5C2D6681696D5C4066F26975738968507C8150C552E45747 +5DFE932665A46B236B3D7434798179BD7B4B7DCA82B983CC887F895F8B398FD1 +91D1541F92804E5D503653E5533A72D7739677E982E68EAF99C699C899D25177 +611A865E55B07A7A50765BD3904796854E326ADB91E75C515C48000000000000 +8C +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +63987A9F6C9397748F617AAA718A96887C8268177E706851936C52F2541B85AB +8A137FA48ECD90E15366888879414FC250BE521151445553572D73EA578B5951 +5F625F8460756176616761A963B2643A656C666F68426E1375667A3D7CFB7D4C +7D997E4B7F6B830E834A86CD8A088A638B668EFD981A9D8F82B88FCE9BE80000 +5287621F64836FC09699684150916B206C7A6F547A747D5088408A2367084EF6 +503950265065517C5238526355A7570F58055ACC5EFA61B261F862F36372691C +6A29727D72AC732E7814786F7D79770C80A9898B8B198CE28ED290639375967A +98559A139E785143539F53B35E7B5F266E1B6E90738473FE7D4382378A008AFA +96504E4E500B53E4547C56FA59D15B645DF15EAB5F276238654567AF6E5672D0 +7CCA88B480A180E183F0864E8A878DE8923796C798679F134E944E924F0D5348 +5449543E5A2F5F8C5FA1609F68A76A8E745A78818A9E8AA48B7791904E5E9BC9 +4EA44F7C4FAF501950165149516C529F52B952FE539A53E35411000000000000 +8D +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +540E5589575157A2597D5B545B5D5B8F5DE55DE75DF75E785E835E9A5EB75F18 +6052614C629762D863A7653B6602664366F4676D6821689769CB6C5F6D2A6D69 +6E2F6E9D75327687786C7A3F7CE07D057D187D5E7DB18015800380AF80B18154 +818F822A8352884C88618B1B8CA28CFC90CA91759271783F92FC95A4964D0000 +980599999AD89D3B525B52AB53F7540858D562F76FE08C6A8F5F9EB9514B523B +544A56FD7A4091779D609ED273446F09817075115FFD60DA9AA872DB8FBC6B64 +98034ECA56F0576458BE5A5A606861C7660F6606683968B16DF775D57D3A826E +9B424E9B4F5053C955065D6F5DE65DEE67FB6C99747378028A50939688DF5750 +5EA7632B50B550AC518D670054C9585E59BB5BB05F69624D63A1683D6B736E08 +707D91C7728078157826796D658E7D3083DC88C18F09969B5264572867507F6A +8CA151B45742962A583A698A80B454B25D0E57FC78959DFA4F5C524A548B643E +6628671467F57A847B567D22932F685C9BAD7B395319518A5237000000000000 +8E +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +5BDF62F664AE64E6672D6BBA85A996D176909BD6634C93069BAB76BF66524E09 +509853C25C7160E864926563685F71E673CA75237B977E8286958B838CDB9178 +991065AC66AB6B8B4ED54ED44F3A4F7F523A53F853F255E356DB58EB59CB59C9 +59FF5B505C4D5E025E2B5FD7601D6307652F5B5C65AF65BD65E8679D6B620000 +6B7B6C0F7345794979C17CF87D197D2B80A2810281F389968A5E8A698A668A8C +8AEE8CC78CDC96CC98FC6B6F4E8B4F3C4F8D51505B575BFA6148630166426B21 +6ECB6CBB723E74BD75D478C1793A800C803381EA84948F9E6C509E7F5F0F8B58 +9D2B7AFA8EF85B8D96EB4E0353F157F759315AC95BA460896E7F6F0675BE8CEA +5B9F85007BE0507267F4829D5C61854A7E1E820E51995C0463688D66659C716E +793E7D1780058B1D8ECA906E86C790AA501F52FA5C3A6753707C7235914C91C8 +932B82E55BC25F3160F94E3B53D65B88624B67316B8A72E973E07A2E816B8DA3 +91529996511253D7546A5BFF63886A397DAC970056DA53CE5468000000000000 +8F +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +5B975C315DDE4FEE610162FE6D3279C079CB7D427E4D7FD281ED821F84908846 +89728B908E748F2F9031914B916C96C6919C4EC04F4F514553415F93620E67D4 +6C416E0B73637E2691CD928353D459195BBF6DD1795D7E2E7C9B587E719F51FA +88538FF04FCA5CFB662577AC7AE3821C99FF51C65FAA65EC696F6B896DF30000 +6E966F6476FE7D145DE190759187980651E6521D6240669166D96E1A5EB67DD2 +7F7266F885AF85F78AF852A953D959735E8F5F90605592E4966450B7511F52DD +5320534753EC54E8554655315617596859BE5A3C5BB55C065C0F5C115C1A5E84 +5E8A5EE05F70627F628462DB638C63776607660C662D6676677E68A26A1F6A35 +6CBC6D886E096E58713C7126716775C77701785D7901796579F07AE07B117CA7 +7D39809683D6848B8549885D88F38A1F8A3C8A548A738C618CDE91A49266937E +9418969C97984E0A4E084E1E4E575197527057CE583458CC5B225E3860C564FE +676167566D4472B675737A6384B88B7291B89320563157F498FE000000000000 +90 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +62ED690D6B9671ED7E548077827289E698DF87558FB15C3B4F384FE14FB55507 +5A205BDD5BE95FC3614E632F65B0664B68EE699B6D786DF1753375B9771F795E +79E67D3381E382AF85AA89AA8A3A8EAB8F9B903291DD97074EBA4EC152035875 +58EC5C0B751A5C3D814E8A0A8FC59663976D7B258ACF9808916256F353A80000 +9017543957825E2563A86C34708A77617C8B7FE088709042915493109318968F +745E9AC45D075D69657067A28DA896DB636E6749691983C5981796C088FE6F84 +647A5BF84E16702C755D662F51C4523652E259D35F8160276210653F6574661F +667468F268166B636E057272751F76DB7CBE805658F088FD897F8AA08A938ACB +901D91929752975965897A0E810696BB5E2D60DC621A65A56614679077F37A4D +7C4D7E3E810A8CAC8D648DE18E5F78A9520762D963A5644262988A2D7A837BC0 +8AAC96EA7D76820C87494ED95148534353605BA35C025C165DDD6226624764B0 +681368346CC96D456D1767D36F5C714E717D65CB7A7F7BAD7DDA000000000000 +91 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +7E4A7FA8817A821B823985A68A6E8CCE8DF59078907792AD929195839BAE524D +55846F387136516879857E5581B37CCE564C58515CA863AA66FE66FD695A72D9 +758F758E790E795679DF7C977D207D4486078A34963B90619F2050E7527553CC +53E2500955AA58EE594F723D5B8B5C64531D60E360F3635C6383633F63BB0000 +64CD65E966F95DE369CD69FD6F1571E54E8975E976F87A937CDF7DCF7D9C8061 +83498358846C84BC85FB88C58D709001906D9397971C9A1250CF5897618E81D3 +85358D0890204FC3507452475373606F6349675F6E2C8DB3901F4FD75C5E8CCA +65CF7D9A53528896517663C35B585B6B5C0A640D6751905C4ED6591A592A6C70 +8A51553E581559A560F0625367C182356955964099C49A284F5358065BFE8010 +5CB15E2F5F856020614B623466FF6CF06EDE80CE817F82D4888B8CB89000902E +968A9EDB9BDB4EE353F059277B2C918D984C9DF96EDD7027535355445B856258 +629E62D36CA26FEF74228A1794386FC18AFE833851E786F853EA000000000000 +92 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +53E94F4690548FB0596A81315DFD7AEA8FBF68DA8C3772F89C486A3D8AB04E39 +53585606576662C563A265E66B4E6DE16E5B70AD77ED7AEF7BAA7DBB803D80C6 +86CB8A95935B56E358C75F3E65AD66966A806BB575378AC7502477E557305F1B +6065667A6C6075F47A1A7F6E81F48718904599B37BC9755C7AF97B5184C40000 +901079E97A9283365AE177404E2D4EF25B995FE062BD663C67F16CE8866B8877 +8A3B914E92F399D06A177026732A82E784578CAF4E01514651CB558B5BF55E16 +5E335E815F145F355F6B5FB461F2631166A2671D6F6E7252753A773A80748139 +817887768ABF8ADC8D858DF3929A957798029CE552C5635776F467156C8873CD +8CC393AE96736D25589C690E69CC8FFD939A75DB901A585A680263B469FB4F43 +6F2C67D88FBB85267DB49354693F6F70576A58F75B2C7D2C722A540A91E39DB4 +4EAD4F4E505C507552438C9E544858245B9A5E1D5E955EAD5EF75F1F608C62B5 +633A63D068AF6C407887798E7A0B7DE082478A028AE68E449013000000000000 +93 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +90B8912D91D89F0E6CE5645864E265756EF476847B1B906993D16EBA54F25FB9 +64A48F4D8FED92445178586B59295C555E976DFB7E8F751C8CBC8EE2985B70B9 +4F1D6BBF6FB1753096FB514E54105835585759AC5C605F926597675C6E21767B +83DF8CED901490FD934D7825783A52AA5EA6571F597460125012515A51AC0000 +51CD520055105854585859575B955CF65D8B60BC6295642D6771684368BC68DF +76D76DD86E6F6D9B706F71C85F5375D879777B497B547B527CD67D7152308463 +856985E48A0E8B048C468E0F9003900F94199676982D9A3095D850CD52D5540C +58025C0E61A7649E6D1E77B37AE580F48404905392855CE09D07533F5F975FB3 +6D9C7279776379BF7BE46BD272EC8AAD68036A6151F87A8169345C4A9CF682EB +5BC59149701E56785C6F60C765666C8C8C5A90419813545166C7920D594890A3 +51854E4D51EA85998B0E7058637A934B696299B47E047577535769608EDF96E3 +6C5D4E8C5C3C5F108FE953028CD1808986795EFF65E54E735165000000000000 +94 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +59825C3F97EE4EFB598A5FCD8A8D6FE179B079625BE78471732B71B15E745FF5 +637B649A71C37C984E435EFC4E4B57DC56A260A96FC37D0D80FD813381BF8FB2 +899786A45DF4628A64AD898767776CE26D3E743678345A467F7582AD99AC4FF3 +5EC362DD63926557676F76C3724C80CC80BA8F29914D500D57F95A9268850000 +6973716472FD8CB758F28CE0966A9019877F79E477E784294F2F5265535A62CD +67CF6CCA767D7B947C95823685848FEB66DD6F2072067E1B83AB99C19EA651FD +7BB178727BB880877B486AE85E61808C75517560516B92626E8C767A91979AEA +4F107F70629C7B4F95A59CE9567A585986E496BC4F345224534A53CD53DB5E06 +642C6591677F6C3E6C4E724872AF73ED75547E41822C85E98CA97BC491C67169 +981298EF633D6669756A76E478D0854386EE532A5351542659835E875F7C60B2 +6249627962AB65906BD46CCC75B276AE789179D87DCB7F7780A588AB8AB98CBB +907F975E98DB6A0B7C3850995C3E5FAE67876BD8743577097F8E000000000000 +95 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +9F3B67CA7A175339758B9AED5F66819D83F180985F3C5FC575627B46903C6867 +59EB5A9B7D10767E8B2C4FF55F6A6A196C376F0274E2796888688A558C795EDF +63CF75C579D282D7932892F2849C86ED9C2D54C15F6C658C6D5C70158CA78CD3 +983B654F74F64E0D4ED857E0592B5A665BCC51A85E035E9C6016627665770000 +65A7666E6D6E72367B268150819A82998B5C8CA08CE68D74961C96444FAE64AB +6B66821E8461856A90E85C01695398A8847A85574F0F526F5FA95E45670D798F +8179890789866DF55F1762556CB84ECF72699B925206543B567458B361A4626E +711A596E7C897CDE7D1B96F06587805E4E194F75517558405E635E735F0A67C4 +4E26853D9589965B7C73980150FB58C1765678A7522577A585117B86504F5909 +72477BC77DE88FBA8FD4904D4FBF52C95A295F0197AD4FDD821792EA57036355 +6B69752B88DC8F147A4252DF58936155620A66AE6BCD7C3F83E950234FF85305 +5446583159495B9D5CF05CEF5D295E9662B16367653E65B9670B000000000000 +96 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +6CD56CE170F978327E2B80DE82B3840C84EC870289128A2A8C4A90A692D298FD +9CF39D6C4E4F4EA1508D5256574A59A85E3D5FD85FD9623F66B4671B67D068D2 +51927D2180AA81A88B008C8C8CBF927E96325420982C531750D5535C58A864B2 +6734726777667A4691E652C36CA16B8658005E4C5954672C7FFB51E176C60000 +646978E89B549EBB57CB59B96627679A6BCE54E969D95E55819C67959BAA67FE +9C52685D4EA64FE353C862B9672B6CAB8FC44FAD7E6D9EBF4E0761626E806F2B +85135473672A9B455DF37B955CAC5BC6871C6E4A84D17A14810859997C8D6C11 +772052D959227121725F77DB97279D61690B5A7F5A1851A5540D547D660E76DF +8FF792989CF459EA725D6EC5514D68C97DBF7DEC97629EBA64786A2183025984 +5B5F6BDB731B76F27DB280178499513267289ED976EE676252FF99055C24623B +7C7E8CB0554F60B67D0B958053014E5F51B6591C723A803691CE5F2577E25384 +5F797D0485AC8A338E8D975667F385AE9453610961086CB97652000000000000 +97 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +8AED8F38552F4F51512A52C753CB5BA55E7D60A0618263D6670967DA6E676D8C +733673377531795088D58A98904A909190F596C4878D59154E884F594E0E8A89 +8F3F981050AD5E7C59965BB95EB863DA63FA64C166DC694A69D86D0B6EB67194 +75287AAF7F8A8000844984C989818B218E0A9065967D990A617E62916B320000 +6C836D747FCC7FFC6DC07F8587BA88F8676583B1983C96F76D1B7D61843D916A +4E7153755D506B046FEB85CD862D89A75229540F5C65674E68A87406748375E2 +88CF88E191CC96E296785F8B73877ACB844E63A0756552896D416E9C74097559 +786B7C9296867ADC9F8D4FB6616E65C5865C4E864EAE50DA4E2151CC5BEE6599 +68816DBC731F764277AD7A1C7CE7826F8AD2907C91CF96759818529B7DD1502B +539867976DCB71D0743381E88F2A96A39C579E9F746058416D997D2F985E4EE4 +4F364F8B51B752B15DBA601C73B2793C82D3923496B796F6970A9E979F6266A6 +6B74521752A370C888C25EC9604B61906F2371497C3E7DF4806F000000000000 +98 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +84EE9023932C54429B6F6AD370898CC28DEF973252B45A415ECA5F046717697C +69946D6A6F0F726272FC7BED8001807E874B90CE516D9E937984808B93328AD6 +502D548C8A716B6A8CC4810760D167A09DF24E994E989C108A6B85C185686900 +6E7E789781550000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000005F0C +4E104E154E2A4E314E364E3C4E3F4E424E564E584E824E858C6B4E8A82125F0D +4E8E4E9E4E9F4EA04EA24EB04EB34EB64ECE4ECD4EC44EC64EC24ED74EDE4EED +4EDF4EF74F094F5A4F304F5B4F5D4F574F474F764F884F8F4F984F7B4F694F70 +4F914F6F4F864F9651184FD44FDF4FCE4FD84FDB4FD14FDA4FD04FE44FE5501A +50285014502A502550054F1C4FF650215029502C4FFE4FEF5011500650435047 +6703505550505048505A5056506C50785080509A508550B450B2000000000000 +99 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +50C950CA50B350C250D650DE50E550ED50E350EE50F950F55109510151025116 +51155114511A5121513A5137513C513B513F51405152514C515451627AF85169 +516A516E5180518256D8518C5189518F519151935195519651A451A651A251A9 +51AA51AB51B351B151B251B051B551BD51C551C951DB51E0865551E951ED0000 +51F051F551FE5204520B5214520E5227522A522E52335239524F5244524B524C +525E5254526A527452695273527F527D528D529452925271528852918FA88FA7 +52AC52AD52BC52B552C152CD52D752DE52E352E698ED52E052F352F552F852F9 +530653087538530D5310530F5315531A5323532F533153335338534053465345 +4E175349534D51D6535E5369536E5918537B53775382539653A053A653A553AE +53B053B653C37C1296D953DF66FC71EE53EE53E853ED53FA5401543D5440542C +542D543C542E54365429541D544E548F5475548E545F5471547754705492547B +5480547654845490548654C754A254B854A554AC54C454C854A8000000000000 +9A +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +54AB54C254A454BE54BC54D854E554E6550F551454FD54EE54ED54FA54E25539 +55405563554C552E555C55455556555755385533555D5599558054AF558A559F +557B557E5598559E55AE557C558355A9558755A855DA55C555DF55C455DC55E4 +55D4561455F7561655FE55FD561B55F9564E565071DF56345636563256380000 +566B5664562F566C566A56865680568A56A05694568F56A556AE56B656B456C2 +56BC56C156C356C056C856CE56D156D356D756EE56F9570056FF570457095708 +570B570D57135718571655C7571C572657375738574E573B5740574F576957C0 +57885761577F5789579357A057B357A457AA57B057C357C657D457D257D3580A +57D657E3580B5819581D587258215862584B58706BC05852583D5879588558B9 +589F58AB58BA58DE58BB58B858AE58C558D358D158D758D958D858E558DC58E4 +58DF58EF58FA58F958FB58FC58FD5902590A5910591B68A65925592C592D5932 +5938593E7AD259555950594E595A5958596259605967596C5969000000000000 +9B +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +59785981599D4F5E4FAB59A359B259C659E859DC598D59D959DA5A255A1F5A11 +5A1C5A095A1A5A405A6C5A495A355A365A625A6A5A9A5ABC5ABE5ACB5AC25ABD +5AE35AD75AE65AE95AD65AFA5AFB5B0C5B0B5B165B325AD05B2A5B365B3E5B43 +5B455B405B515B555B5A5B5B5B655B695B705B735B755B7865885B7A5B800000 +5B835BA65BB85BC35BC75BC95BD45BD05BE45BE65BE25BDE5BE55BEB5BF05BF6 +5BF35C055C075C085C0D5C135C205C225C285C385C395C415C465C4E5C535C50 +5C4F5B715C6C5C6E4E625C765C795C8C5C915C94599B5CAB5CBB5CB65CBC5CB7 +5CC55CBE5CC75CD95CE95CFD5CFA5CED5D8C5CEA5D0B5D155D175D5C5D1F5D1B +5D115D145D225D1A5D195D185D4C5D525D4E5D4B5D6C5D735D765D875D845D82 +5DA25D9D5DAC5DAE5DBD5D905DB75DBC5DC95DCD5DD35DD25DD65DDB5DEB5DF2 +5DF55E0B5E1A5E195E115E1B5E365E375E445E435E405E4E5E575E545E5F5E62 +5E645E475E755E765E7A9EBC5E7F5EA05EC15EC25EC85ED05ECF000000000000 +9C +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +5ED65EE35EDD5EDA5EDB5EE25EE15EE85EE95EEC5EF15EF35EF05EF45EF85EFE +5F035F095F5D5F5C5F0B5F115F165F295F2D5F385F415F485F4C5F4E5F2F5F51 +5F565F575F595F615F6D5F735F775F835F825F7F5F8A5F885F915F875F9E5F99 +5F985FA05FA85FAD5FBC5FD65FFB5FE45FF85FF15FDD60B35FFF602160600000 +601960106029600E6031601B6015602B6026600F603A605A6041606A6077605F +604A6046604D6063604360646042606C606B60596081608D60E76083609A6084 +609B60966097609260A7608B60E160B860E060D360B45FF060BD60C660B560D8 +614D6115610660F660F7610060F460FA6103612160FB60F1610D610E6147613E +61286127614A613F613C612C6134613D614261446173617761586159615A616B +6174616F61656171615F615D6153617561996196618761AC6194619A618A6191 +61AB61AE61CC61CA61C961F761C861C361C661BA61CB7F7961CD61E661E361F6 +61FA61F461FF61FD61FC61FE620062086209620D620C6214621B000000000000 +9D +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +621E6221622A622E6230623262336241624E625E6263625B62606268627C6282 +6289627E62926293629662D46283629462D762D162BB62CF62FF62C664D462C8 +62DC62CC62CA62C262C7629B62C9630C62EE62F163276302630862EF62F56350 +633E634D641C634F6396638E638063AB637663A3638F6389639F63B5636B0000 +636963BE63E963C063C663E363C963D263F663C4641664346406641364266436 +651D64176428640F6467646F6476644E652A6495649364A564A9648864BC64DA +64D264C564C764BB64D864C264F164E7820964E064E162AC64E364EF652C64F6 +64F464F264FA650064FD6518651C650565246523652B65346535653765366538 +754B654865566555654D6558655E655D65726578658265838B8A659B659F65AB +65B765C365C665C165C465CC65D265DB65D965E065E165F16772660A660365FB +6773663566366634661C664F664466496641665E665D666466676668665F6662 +667066836688668E668966846698669D66C166B966C966BE66BC000000000000 +9E +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +66C466B866D666DA66E0663F66E666E966F066F566F7670F6716671E67266727 +9738672E673F67366741673867376746675E67606759676367646789677067A9 +677C676A678C678B67A667A1678567B767EF67B467EC67B367E967B867E467DE +67DD67E267EE67B967CE67C667E76A9C681E684668296840684D6832684E0000 +68B3682B685968636877687F689F688F68AD6894689D689B68836AAE68B96874 +68B568A068BA690F688D687E690168CA690868D86922692668E1690C68CD68D4 +68E768D569366912690468D768E3692568F968E068EF6928692A691A69236921 +68C669796977695C6978696B6954697E696E69396974693D695969306961695E +695D6981696A69B269AE69D069BF69C169D369BE69CE5BE869CA69DD69BB69C3 +69A76A2E699169A0699C699569B469DE69E86A026A1B69FF6B0A69F969F269E7 +6A0569B16A1E69ED6A1469EB6A0A6A126AC16A236A136A446A0C6A726A366A78 +6A476A626A596A666A486A386A226A906A8D6AA06A846AA26AA3000000000000 +9F +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +6A9786176ABB6AC36AC26AB86AB36AAC6ADE6AD16ADF6AAA6ADA6AEA6AFB6B05 +86166AFA6B126B169B316B1F6B386B3776DC6B3998EE6B476B436B496B506B59 +6B546B5B6B5F6B616B786B796B7F6B806B846B836B8D6B986B956B9E6BA46BAA +6BAB6BAF6BB26BB16BB36BB76BBC6BC66BCB6BD36BDF6BEC6BEB6BF36BEF0000 +9EBE6C086C136C146C1B6C246C236C5E6C556C626C6A6C826C8D6C9A6C816C9B +6C7E6C686C736C926C906CC46CF16CD36CBD6CD76CC56CDD6CAE6CB16CBE6CBA +6CDB6CEF6CD96CEA6D1F884D6D366D2B6D3D6D386D196D356D336D126D0C6D63 +6D936D646D5A6D796D596D8E6D956FE46D856DF96E156E0A6DB56DC76DE66DB8 +6DC66DEC6DDE6DCC6DE86DD26DC56DFA6DD96DE46DD56DEA6DEE6E2D6E6E6E2E +6E196E726E5F6E3E6E236E6B6E2B6E766E4D6E1F6E436E3A6E4E6E246EFF6E1D +6E386E826EAA6E986EC96EB76ED36EBD6EAF6EC46EB26ED46ED56E8F6EA56EC2 +6E9F6F416F11704C6EEC6EF86EFE6F3F6EF26F316EEF6F326ECC000000000000 +E0 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +6F3E6F136EF76F866F7A6F786F816F806F6F6F5B6FF36F6D6F826F7C6F586F8E +6F916FC26F666FB36FA36FA16FA46FB96FC66FAA6FDF6FD56FEC6FD46FD86FF1 +6FEE6FDB7009700B6FFA70117001700F6FFE701B701A6F74701D7018701F7030 +703E7032705170637099709270AF70F170AC70B870B370AE70DF70CB70DD0000 +70D9710970FD711C711971657155718871667162714C7156716C718F71FB7184 +719571A871AC71D771B971BE71D271C971D471CE71E071EC71E771F571FC71F9 +71FF720D7210721B7228722D722C72307232723B723C723F72407246724B7258 +7274727E7282728172877292729672A272A772B972B272C372C672C472CE72D2 +72E272E072E172F972F7500F7317730A731C7316731D7334732F73297325733E +734E734F9ED87357736A7368737073787375737B737A73C873B373CE73BB73C0 +73E573EE73DE74A27405746F742573F87432743A7455743F745F74597441745C +746974707463746A7476747E748B749E74A774CA74CF74D473F1000000000000 +E1 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +74E074E374E774E974EE74F274F074F174F874F7750475037505750C750E750D +75157513751E7526752C753C7544754D754A7549755B7546755A756975647567 +756B756D75787576758675877574758A758975827594759A759D75A575A375C2 +75B375C375B575BD75B875BC75B175CD75CA75D275D975E375DE75FE75FF0000 +75FC760175F075FA75F275F3760B760D7609761F762776207621762276247634 +7630763B764776487646765C76587661766276687669766A7667766C76707672 +76767678767C768076837688768B768E769676937699769A76B076B476B876B9 +76BA76C276CD76D676D276DE76E176E576E776EA862F76FB7708770777047729 +7724771E77257726771B773777387747775A7768776B775B7765777F777E7779 +778E778B779177A0779E77B077B677B977BF77BC77BD77BB77C777CD77D777DA +77DC77E377EE77FC780C781279267820792A7845788E78747886787C789A788C +78A378B578AA78AF78D178C678CB78D478BE78BC78C578CA78EC000000000000 +E2 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +78E778DA78FD78F47907791279117919792C792B794079607957795F795A7955 +7953797A797F798A799D79A79F4B79AA79AE79B379B979BA79C979D579E779EC +79E179E37A087A0D7A187A197A207A1F79807A317A3B7A3E7A377A437A577A49 +7A617A627A699F9D7A707A797A7D7A887A977A957A987A967AA97AC87AB00000 +7AB67AC57AC47ABF90837AC77ACA7ACD7ACF7AD57AD37AD97ADA7ADD7AE17AE2 +7AE67AED7AF07B027B0F7B0A7B067B337B187B197B1E7B357B287B367B507B7A +7B047B4D7B0B7B4C7B457B757B657B747B677B707B717B6C7B6E7B9D7B987B9F +7B8D7B9C7B9A7B8B7B927B8F7B5D7B997BCB7BC17BCC7BCF7BB47BC67BDD7BE9 +7C117C147BE67BE57C607C007C077C137BF37BF77C177C0D7BF67C237C277C2A +7C1F7C377C2B7C3D7C4C7C437C547C4F7C407C507C587C5F7C647C567C657C6C +7C757C837C907CA47CAD7CA27CAB7CA17CA87CB37CB27CB17CAE7CB97CBD7CC0 +7CC57CC27CD87CD27CDC7CE29B3B7CEF7CF27CF47CF67CFA7D06000000000000 +E3 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +7D027D1C7D157D0A7D457D4B7D2E7D327D3F7D357D467D737D567D4E7D727D68 +7D6E7D4F7D637D937D897D5B7D8F7D7D7D9B7DBA7DAE7DA37DB57DC77DBD7DAB +7E3D7DA27DAF7DDC7DB87D9F7DB07DD87DDD7DE47DDE7DFB7DF27DE17E057E0A +7E237E217E127E317E1F7E097E0B7E227E467E667E3B7E357E397E437E370000 +7E327E3A7E677E5D7E567E5E7E597E5A7E797E6A7E697E7C7E7B7E837DD57E7D +8FAE7E7F7E887E897E8C7E927E907E937E947E967E8E7E9B7E9C7F387F3A7F45 +7F4C7F4D7F4E7F507F517F557F547F587F5F7F607F687F697F677F787F827F86 +7F837F887F877F8C7F947F9E7F9D7F9A7FA37FAF7FB27FB97FAE7FB67FB88B71 +7FC57FC67FCA7FD57FD47FE17FE67FE97FF37FF998DC80068004800B80128018 +8019801C80218028803F803B804A804680528058805A805F8062806880738072 +807080768079807D807F808480868085809B8093809A80AD519080AC80DB80E5 +80D980DD80C480DA80D6810980EF80F1811B81298123812F814B000000000000 +E4 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +968B8146813E8153815180FC8171816E81658166817481838188818A81808182 +81A0819581A481A3815F819381A981B081B581BE81B881BD81C081C281BA81C9 +81CD81D181D981D881C881DA81DF81E081E781FA81FB81FE8201820282058207 +820A820D821082168229822B82388233824082598258825D825A825F82640000 +82628268826A826B822E827182778278827E828D829282AB829F82BB82AC82E1 +82E382DF82D282F482F382FA8393830382FB82F982DE830682DC830982D98335 +83348316833283318340833983508345832F832B831783188385839A83AA839F +83A283968323838E8387838A837C83B58373837583A0838983A883F4841383EB +83CE83FD840383D8840B83C183F7840783E083F2840D8422842083BD84388506 +83FB846D842A843C855A84848477846B84AD846E848284698446842C846F8479 +843584CA846284B984BF849F84D984CD84BB84DA84D084C184C684D684A18521 +84FF84F485178518852C851F8515851484FC8540856385588548000000000000 +E5 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +85418602854B8555858085A485888591858A85A8856D8594859B85EA8587859C +8577857E859085C985BA85CF85B985D085D585DD85E585DC85F9860A8613860B +85FE85FA86068622861A8630863F864D4E558654865F86678671869386A386A9 +86AA868B868C86B686AF86C486C686B086C9882386AB86D486DE86E986EC0000 +86DF86DB86EF8712870687088700870386FB87118709870D86F9870A8734873F +8737873B87258729871A8760875F8778874C874E877487578768876E87598753 +8763876A880587A2879F878287AF87CB87BD87C087D096D687AB87C487B387C7 +87C687BB87EF87F287E0880F880D87FE87F687F7880E87D28811881688158822 +88218831883688398827883B8844884288528859885E8862886B8881887E889E +8875887D88B5887288828897889288AE889988A2888D88A488B088BF88B188C3 +88C488D488D888D988DD88F9890288FC88F488E888F28904890C890A89138943 +891E8925892A892B89418944893B89368938894C891D8960895E000000000000 +E6 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +89668964896D896A896F89748977897E89838988898A8993899889A189A989A6 +89AC89AF89B289BA89BD89BF89C089DA89DC89DD89E789F489F88A038A168A10 +8A0C8A1B8A1D8A258A368A418A5B8A528A468A488A7C8A6D8A6C8A628A858A82 +8A848AA88AA18A918AA58AA68A9A8AA38AC48ACD8AC28ADA8AEB8AF38AE70000 +8AE48AF18B148AE08AE28AF78ADE8ADB8B0C8B078B1A8AE18B168B108B178B20 +8B3397AB8B268B2B8B3E8B288B418B4C8B4F8B4E8B498B568B5B8B5A8B6B8B5F +8B6C8B6F8B748B7D8B808B8C8B8E8B928B938B968B998B9A8C3A8C418C3F8C48 +8C4C8C4E8C508C558C628C6C8C788C7A8C828C898C858C8A8C8D8C8E8C948C7C +8C98621D8CAD8CAA8CBD8CB28CB38CAE8CB68CC88CC18CE48CE38CDA8CFD8CFA +8CFB8D048D058D0A8D078D0F8D0D8D109F4E8D138CCD8D148D168D678D6D8D71 +8D738D818D998DC28DBE8DBA8DCF8DDA8DD68DCC8DDB8DCB8DEA8DEB8DDF8DE3 +8DFC8E088E098DFF8E1D8E1E8E108E1F8E428E358E308E348E4A000000000000 +E7 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +8E478E498E4C8E508E488E598E648E608E2A8E638E558E768E728E7C8E818E87 +8E858E848E8B8E8A8E938E918E948E998EAA8EA18EAC8EB08EC68EB18EBE8EC5 +8EC88ECB8EDB8EE38EFC8EFB8EEB8EFE8F0A8F058F158F128F198F138F1C8F1F +8F1B8F0C8F268F338F3B8F398F458F428F3E8F4C8F498F468F4E8F578F5C0000 +8F628F638F648F9C8F9F8FA38FAD8FAF8FB78FDA8FE58FE28FEA8FEF90878FF4 +90058FF98FFA901190159021900D901E9016900B90279036903590398FF8904F +905090519052900E9049903E90569058905E9068906F907696A890729082907D +90819080908A9089908F90A890AF90B190B590E290E4624890DB910291129119 +91329130914A9156915891639165916991739172918B9189918291A291AB91AF +91AA91B591B491BA91C091C191C991CB91D091D691DF91E191DB91FC91F591F6 +921E91FF9214922C92159211925E925792459249926492489295923F924B9250 +929C92969293929B925A92CF92B992B792E9930F92FA9344932E000000000000 +E8 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +93199322931A9323933A9335933B935C9360937C936E935693B093AC93AD9394 +93B993D693D793E893E593D893C393DD93D093C893E4941A9414941394039407 +94109436942B94359421943A944194529444945B94609462945E946A92299470 +94759477947D945A947C947E9481947F95829587958A95949596959895990000 +95A095A895A795AD95BC95BB95B995BE95CA6FF695C395CD95CC95D595D495D6 +95DC95E195E595E296219628962E962F9642964C964F964B9677965C965E965D +965F96669672966C968D96989695969796AA96A796B196B296B096B496B696B8 +96B996CE96CB96C996CD894D96DC970D96D596F99704970697089713970E9711 +970F971697199724972A97309739973D973E97449746974897429749975C9760 +97649766976852D2976B977197799785977C9781977A9786978B978F9790979C +97A897A697A397B397B497C397C697C897CB97DC97ED9F4F97F27ADF97F697F5 +980F980C9838982498219837983D9846984F984B986B986F9870000000000000 +E9 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +98719874987398AA98AF98B198B698C498C398C698E998EB9903990999129914 +99189921991D991E99249920992C992E993D993E9942994999459950994B9951 +9952994C99559997999899A599AD99AE99BC99DF99DB99DD99D899D199ED99EE +99F199F299FB99F89A019A0F9A0599E29A199A2B9A379A459A429A409A430000 +9A3E9A559A4D9A5B9A579A5F9A629A659A649A699A6B9A6A9AAD9AB09ABC9AC0 +9ACF9AD19AD39AD49ADE9ADF9AE29AE39AE69AEF9AEB9AEE9AF49AF19AF79AFB +9B069B189B1A9B1F9B229B239B259B279B289B299B2A9B2E9B2F9B329B449B43 +9B4F9B4D9B4E9B519B589B749B939B839B919B969B979B9F9BA09BA89BB49BC0 +9BCA9BB99BC69BCF9BD19BD29BE39BE29BE49BD49BE19C3A9BF29BF19BF09C15 +9C149C099C139C0C9C069C089C129C0A9C049C2E9C1B9C259C249C219C309C47 +9C329C469C3E9C5A9C609C679C769C789CE79CEC9CF09D099D089CEB9D039D06 +9D2A9D269DAF9D239D1F9D449D159D129D419D3F9D3E9D469D48000000000000 +EA +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +9D5D9D5E9D649D519D509D599D729D899D879DAB9D6F9D7A9D9A9DA49DA99DB2 +9DC49DC19DBB9DB89DBA9DC69DCF9DC29DD99DD39DF89DE69DED9DEF9DFD9E1A +9E1B9E1E9E759E799E7D9E819E889E8B9E8C9E929E959E919E9D9EA59EA99EB8 +9EAA9EAD97619ECC9ECE9ECF9ED09ED49EDC9EDE9EDD9EE09EE59EE89EEF0000 +9EF49EF69EF79EF99EFB9EFC9EFD9F079F0876B79F159F219F2C9F3E9F4A9F52 +9F549F639F5F9F609F619F669F679F6C9F6A9F779F729F769F959F9C9FA0582F +69C79059746451DC719900000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +ED +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +7E8A891C9348928884DC4FC970BB663168C892F966FB5F454E284EE14EFC4F00 +4F034F394F564F924F8A4F9A4F944FCD504050224FFF501E5046507050425094 +50F450D8514A5164519D51BE51EC5215529C52A652C052DB5300530753245372 +539353B253DDFA0E549C548A54A954FF55865759576557AC57C857C7FA0F0000 +FA10589E58B2590B5953595B595D596359A459BA5B565BC0752F5BD85BEC5C1E +5CA65CBA5CF55D275D53FA115D425D6D5DB85DB95DD05F215F345F675FB75FDE +605D6085608A60DE60D5612060F26111613761306198621362A663F56460649D +64CE654E66006615663B6609662E661E6624666566576659FA126673669966A0 +66B266BF66FA670EF929676667BB685267C06801684468CFFA136968FA146998 +69E26A306A6B6A466A736A7E6AE26AE46BD66C3F6C5C6C866C6F6CDA6D046D87 +6D6F6D966DAC6DCF6DF86DF26DFC6E396E5C6E276E3C6EBF6F886FB56FF57005 +70077028708570AB710F7104715C71467147FA1571C171FE72B1000000000000 +EE +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +72BE7324FA16737773BD73C973D673E373D2740773F57426742A7429742E7462 +7489749F7501756F7682769C769E769B76A6FA17774652AF7821784E7864787A +7930FA18FA19FA1A7994FA1B799B7AD17AE7FA1C7AEB7B9EFA1D7D487D5C7DB7 +7DA07DD67E527F477FA1FA1E83018362837F83C783F6844884B4855385590000 +856BFA1F85B0FA20FA21880788F58A128A378A798AA78ABE8ADFFA228AF68B53 +8B7F8CF08CF48D128D76FA238ECFFA24FA25906790DEFA269115912791DA91D7 +91DE91ED91EE91E491E592069210920A923A9240923C924E9259925192399267 +92A79277927892E792D792D992D0FA2792D592E092D39325932192FBFA28931E +92FF931D93029370935793A493C693DE93F89431944594489592F9DCFA29969D +96AF9733973B9743974D974F9751975598579865FA2AFA2B9927FA2C999E9A4E +9AD99ADC9B759B729B8F9BB19BBB9C009D709D6BFA2D9E199ED1000000002170 +217121722173217421752176217721782179FFE2FFE4FF07FF02000000000000 +FA +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +2170217121722173217421752176217721782179216021612162216321642165 +2166216721682169FFE2FFE4FF07FF0232312116212122357E8A891C93489288 +84DC4FC970BB663168C892F966FB5F454E284EE14EFC4F004F034F394F564F92 +4F8A4F9A4F944FCD504050224FFF501E504650705042509450F450D8514A0000 +5164519D51BE51EC5215529C52A652C052DB5300530753245372539353B253DD +FA0E549C548A54A954FF55865759576557AC57C857C7FA0FFA10589E58B2590B +5953595B595D596359A459BA5B565BC0752F5BD85BEC5C1E5CA65CBA5CF55D27 +5D53FA115D425D6D5DB85DB95DD05F215F345F675FB75FDE605D6085608A60DE +60D5612060F26111613761306198621362A663F56460649D64CE654E66006615 +663B6609662E661E6624666566576659FA126673669966A066B266BF66FA670E +F929676667BB685267C06801684468CFFA136968FA14699869E26A306A6B6A46 +6A736A7E6AE26AE46BD66C3F6C5C6C866C6F6CDA6D046D876D6F000000000000 +FB +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +6D966DAC6DCF6DF86DF26DFC6E396E5C6E276E3C6EBF6F886FB56FF570057007 +7028708570AB710F7104715C71467147FA1571C171FE72B172BE7324FA167377 +73BD73C973D673E373D2740773F57426742A7429742E74627489749F7501756F +7682769C769E769B76A6FA17774652AF7821784E7864787A7930FA18FA190000 +FA1A7994FA1B799B7AD17AE7FA1C7AEB7B9EFA1D7D487D5C7DB77DA07DD67E52 +7F477FA1FA1E83018362837F83C783F6844884B485538559856BFA1F85B0FA20 +FA21880788F58A128A378A798AA78ABE8ADFFA228AF68B538B7F8CF08CF48D12 +8D76FA238ECFFA24FA25906790DEFA269115912791DA91D791DE91ED91EE91E4 +91E592069210920A923A9240923C924E925992519239926792A79277927892E7 +92D792D992D0FA2792D592E092D39325932192FBFA28931E92FF931D93029370 +935793A493C693DE93F89431944594489592F9DCFA29969D96AF9733973B9743 +974D974F9751975598579865FA2AFA2B9927FA2C999E9A4E9AD9000000000000 +FC +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +9ADC9B759B729B8F9BB19BBB9C009D709D6BFA2D9E199ED10000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +R +8160 301C FF5E +8161 2016 2225 +817C 2212 FF0D +8191 00A2 FFE0 +8192 00A3 FFE1 +81CA 00AC FFE2 +81BE 222a +81BF 2229 +81DA 2220 +81DB 22a5 +81DF 2261 +81E0 2252 +81E3 221a +81E6 2235 +81E7 222b diff --git a/shared/package-files/9d/9d357623cf0645c910b979c6b3b6b359def19d4e23d4e50c763b26fb391a56e6/blob b/shared/package-files/9d/9d357623cf0645c910b979c6b3b6b359def19d4e23d4e50c763b26fb391a56e6/blob new file mode 100644 index 0000000000000000000000000000000000000000..15e00d11e7926fa290877ea84b1c93885b66ecfa --- /dev/null +++ b/shared/package-files/9d/9d357623cf0645c910b979c6b3b6b359def19d4e23d4e50c763b26fb391a56e6/blob @@ -0,0 +1,4029 @@ +"""Provides optimal triton kernel parameters. + +Aim +--- + +The usage of optimal triton kernel parameters may increase the +performance of operations several times. For example, for large tensor +shapes, the usage of a bsr tensor as mat1 argument in addmm-based +operations typically outperforms the corresponding operation with +strided-only inputs when the blocked representation of a tensor +provides a better alignement with memory access than what the strided +representation would provide. + +Pre-computed kernel parameters +------------------------------ + +This script finds and stores the optimal triton kernel parameters for +a specific set of shape configurations. For instance, the set of shape +configurations of the bsr_dense_addmm kernel is defined as + + input, out: M x N strided tensor + mat1: M x K bsr tensor with blocksize (BM, BK) and given sparsity + mat2: M x N strided tensor + dtype = float16, bfloat16, float32 + sparsity = 0.5 + M = 256, 512, ..., 16384 + K = M + N = 256, 512, ..., 131072 + BM = 16, 32, ..., 128 + BK = BM + alpha = 1 + beta = 0, 1 + GPUs: NVIDIA A100-SXM4-80GB + +Approximations +-------------- + +It is practically infeasible to pre-compute optimal kernel parameter +for all possible shape configurations as well as for all existing +GPUs. Therefore, we'll assume that the pre-computed optimal parameters +are good enough approximations when +1) the used GPU is any of NVIDIA A100 Tensor Core GPUs, +2) the actual sparsity of mat1 is different from sparsity value 0.5. + +If a particular shape configuration does not fall in the set of +pre-computed kernel parameters, or it does not match with the listed +approximations above, or the used GPU device is not a NVIDIA A100 GPU, +then a reference set of triton kernel parameters will be used when +executing operations. The reference kernel parameters are defined in +torch/sparse/_triton_ops.py, see bsr_dense_addmm_meta function, for +instance. + +Computing optimal kernel parameters +----------------------------------- + +If the approximations listed above are unacceptable, e.g. when one +seeks a maximal performance possible, the optimal kernel parameters +for a particular GPU can be computed by simply running this script in +the pytorch developement tree:: + + cd /path/to/pytorch + python setup.py develop + python torch/sparse/_triton_ops_meta.py + +This will compute the optimal kernel parameters for the GPU device +available in the host system for all shape configurations listed in +"Pre-computed kernel parameters" above. The results will be stored in +the database of kernel parameters. Currently, this database is defined +as this module (see "BEGIN GENERATED DATA" comment below) that will be +modified when the script is run. Create a pytorch PR with the +corresponding modifications in this file to make the computed optimal +kernel parameters available for other users as pre-computed kernel +parameters. + +Moreover, one can compute the optimal kernel parameters for a specific +set of shape configurations and specific sparsity patterns. For that, +use tuning functions provided by this module: + + tune_bsr_dense_addmm(input, mat1, mat2, beta=1, alpha=1, out=None, verbose=False, store=False) -> meta + +The tuning functions return a dictionary of optimal kernel parameters +that can be passed to the corresponding operation, e.g. + + bsr_dense_addmm(..., meta=meta) + +Or, when store==True, the optimal kernel parameters will be stored in +the database of pre-computed kernel parameters in runtime so that all +addmm-based operations such as torch.addmm, torch.mm, +torch.nn.functional.linear will benefit from using the computed +optimal set of kernel parameters. + +Note that running tune_bsr_dense_addmm can take several minutes. So, +use it wisely, e.g. by implementing persisten storage of optimized +kernel parameters. See the source code of get_meta and +tune_bsr_dense_addmm to learn how to register a custom set of optimal +kernel parameters for addmm-based operations. + +""" +__all__ = ["get_meta", "tune_bsr_dense_addmm"] + +import inspect +import itertools +import re +import warnings +from typing import Any, Dict + +import torch +from torch.hub import tqdm +from torch.testing import make_tensor + + +def get_meta(op, key, device_name=None, version=(0, torch.float16, 0.5), exact=False): + """Return triton kernel meta parameters of the specified op and its inputs key. + + Parameters + ---------- + op (str): The name of an operation that implementation uses meta parameters. + key (tuple): A tuple of op input parameters, e.g. shapes, etc. + device_name (optional, str): The name of a device for which op + parameters are provided. + version (optional, hashable): Specifies the version of parameters. + exact (optional, bool): When True, the returned data (if + available) corresponds exactly to the specified device_name and + version information. Otherwise, if the corresponding data is not + available but there exists a data set that is computed for a + similar GPU device, then this data set will be returned. + + Returns + ------- + result (dict): The requested mapping of parameter names and + values, or None when no data is available. + """ + if device_name is None: + device_name = torch.cuda.get_device_name() + op_data = _operation_device_version_data.get((op, device_name, version)) + if op_data is None and not exact: + # A lack of op data could be due to using a (slightly) + # different GPU model compared to a model for which optimal + # meta parameters have been computed. In the following we'll + # assume that there is a set of GPU models that all have + # a similar set of optimal meta parameters. + if re.match(r"NVIDIA A100[^\d]", device_name) is not None: + device_name = "NVIDIA A100-SXM4-80GB" + else: + return + op_data = _operation_device_version_data.get((op, device_name, version)) + if op_data is None: + return + values = op_data.get(key) + if values is not None: + if op == "scatter_mm": + names = ( + "GROUP_SIZE", + "SPLIT_N", + "TILE_M", + "TILE_N", + "num_stages", + "num_warps", + ) + return dict(zip(names, values)) + elif op == "bsr_dense_addmm": + return dict( + zip(("GROUP_SIZE_ROW", "SPLIT_N", "num_stages", "num_warps"), values) + ) + raise NotImplementedError(f"names for {op=}") + + +def update(op, device_name, version, key, value): + """Update the db of op parameters.""" + if (op, device_name, version) in _operation_device_version_data: + if _operation_device_version_data[op, device_name, version].get(key) == value: + return + _operation_device_version_data[op, device_name, version][key] = value + else: + _operation_device_version_data[op, device_name, version] = {key: value} + + +def dump(): + """Store the current runtime db state to the module file.""" + current_file = inspect.getfile(dump) + f = open(current_file) + current_content = f.read() + f.close() + begin_data_str = "# BEGIN GENERATED DATA\n" + begin_data_index = current_content.find(begin_data_str) + end_data_index = current_content.find(" # END GENERATED DATA\n") + if begin_data_index == -1 or end_data_index == -1: + warnings.warn( + f"{current_file} cannot be updated:" + " BEGIN/END GENERATED DATA comment blocks appear to be corrupted" + ) + return + + def sort_key(key): + op, device_name, version = key + version = tuple( + (str(item) if isinstance(item, torch.dtype) else item) for item in version + ) + return (op, device_name, version) + + part1 = current_content[: begin_data_index + len(begin_data_str)] + part2 = current_content[end_data_index:] + data_part = [] + for op_key in sorted(_operation_device_version_data, key=sort_key): + data_part.append(" " + repr(op_key).replace("'", '"') + ": {") + op_data = _operation_device_version_data[op_key] + for key in sorted(op_data): + data_part.append(f" {key}: {op_data[key]},") + data_part.append(" },") + new_content = part1 + "\n".join(data_part) + "\n" + part2 + if current_content != new_content: + f = open(current_file, "w") + f.write(new_content) + f.close() + + +def minimize( + target_func, + initial_parameters, + reference_parameters, + step_func, + max_step=2, + verbose=False, + all_values=None, +): + """Find a dict of parameters that minimizes the target function using + the initial dict of parameters and a step function that progresses + a specified parameter in a dict of parameters. + + Parameters + ---------- + target_func (callable): a functional with the signature + ``target_func(parameters: dict) -> float`` + initial_parameters (dict): a set of parameters used as an initial + value to the minimization process. + reference_parameters (dict): a set of parameters used as an + reference value with respect to which the speed up is computed. + step_func (callable): a functional with the signature + ``step_func(parameter_name:str, parameter_value:int, direction:int, parameters:dict) -> int`` + that increments or decrements (when ``direction`` is positive or + negative, respectively) the parameter with given name and value. + When return value is equal to ``parameter_value``, it means that + no step along the given direction can be made. + + Returns + ------- + parameters (dict): a set of parameters that minimizes the target + function. + speedup_incr (float): a speedup change given in percentage. + timing (float): the value of the target function at the parameters. + sensitivity_message (str): a message containing sensitivity. + information of parameters around the target function minimizer. + """ + + def to_key(parameters): + return tuple(parameters[k] for k in sorted(parameters)) + + def from_key(key, parameters): + return dict(zip(sorted(parameters), key)) + + if all_values is None: + all_values = dict() + + directions = list(range(-max_step, max_step + 1)) + names = sorted(initial_parameters) + all_directions = [] + for d_tuple in itertools.product(*((directions,) * len(names))): + dist = sum(map(abs, d_tuple)) + if dist > 0 and dist <= max_step: + all_directions.append((dist, d_tuple)) + all_directions.sort() + + try: + reference_target = target_func(reference_parameters) + except Exception as msg: + if verbose and "out of resource" not in str(msg): + print(f"{reference_parameters=} lead to failure: {msg}.") + reference_target = None + if reference_target is not None: + all_values[to_key(reference_parameters)] = reference_target + + parameters = initial_parameters + try: + initial_target = target_func(parameters) + except Exception as msg: + if reference_target is None: + if verbose: + print( + f"{initial_parameters=} lead to failure: {msg}. Optimization failed!" + ) + return {}, -1, -1, f"{msg}" + if verbose and "out of resource" not in str(msg): + print( + f"{initial_parameters=} lead to failure: {msg}. Using reference parameters instead of initial parameters." + ) + parameters = reference_parameters + initial_target = reference_target + + if reference_target is None: + if verbose: + print("Using initial parameters instead of reference parameters.") + reference_target = initial_target + + initial_key = to_key(parameters) + minimal_target = all_values[initial_key] = initial_target + pbar = tqdm( + total=len(all_directions), + desc="Tuning...", + disable=not verbose, + ncols=75, + ) + while True: + for i, (_, d_tuple) in enumerate(all_directions): + pbar.update(1) + next_parameters = parameters.copy() + for name, direction in zip(names, d_tuple): + value = next_parameters[name] + if direction == 0: + continue + next_value = step_func(name, value, direction, parameters) + if next_value == value: + break + next_parameters[name] = next_value + else: + next_key = to_key(next_parameters) + if next_key in all_values: + continue + try: + next_target = target_func(next_parameters) + except Exception as msg: + all_values[next_key] = str(msg) + if verbose and "out of resource" not in str(msg): + print(f"{next_parameters=} lead to failure: {msg}. Skipping.") + continue + all_values[next_key] = next_target + + if next_target < minimal_target: + minimal_target = next_target + parameters = next_parameters + pbar.total += i + 1 + break + else: + # ensure stable minimizer: + minimizer_keys = { + k + for k, v in all_values.items() + if isinstance(v, float) and abs(1 - v / minimal_target) < 0.001 + } + minimizer_key = ( + initial_key if initial_key in minimizer_keys else min(minimizer_keys) + ) + minimizer_target = all_values[minimizer_key] + parameters = from_key(minimizer_key, parameters) + speedup_incr = (1 - minimal_target / reference_target) * 100 + if speedup_incr < 0: + if verbose: + print( + f"{speedup_incr=} is negative. Rerunning minimize with reference parameters as initial parameters." + ) + return minimize( + target_func, + reference_parameters, + reference_parameters, + step_func, + max_step=max_step, + verbose=verbose, + all_values=all_values, + ) + sensitivity = [] + for name in parameters: + value = parameters[name] + rel_diffs = [] + for direction in range(-max_step, max_step + 1): + if direction == 0: + continue + next_value = step_func(name, value, direction, parameters) + if next_value == value: + rel_diffs.append(0) + continue + next_parameters = parameters.copy() + next_parameters[name] = next_value + next_key = to_key(next_parameters) + next_target = all_values.get(next_key) + if next_target is None or isinstance(next_target, str): + rel_diffs.append(0) + continue + rel_diff = (next_target / minimal_target - 1) * 100 + rel_diffs.append(rel_diff) + sensitivity.append((max(rel_diffs), rel_diffs, name)) + + sensitivity_message = [f"timing0={initial_target:.3f}"] + for _, rel_diffs, name in sorted(sensitivity, reverse=True): + left_diffs = "|".join( + [f"{rel_diff:.1f}" for rel_diff in rel_diffs[:max_step]] + ) + right_diffs = "|".join( + [f"{rel_diff:.1f}" for rel_diff in rel_diffs[max_step:]] + ) + sensitivity_message.append( + f"{name}={parameters[name]} ({left_diffs}...{right_diffs} %)" + ) + sensitivity_message = ", ".join(sensitivity_message) + return parameters, speedup_incr, minimal_target, sensitivity_message + + +def create_blocked_tensor(B, M, N, blocksize, sparsity, dtype, device): + assert ( + sparsity <= 1.0 and sparsity >= 0.0 + ), "sparsity should be a value between 0 and 1" + assert M % blocksize[0] == 0 + assert N % blocksize[1] == 0 + shape = (B, M // blocksize[0], N // blocksize[1])[int(B == 0) :] + A = torch.bernoulli(torch.full(shape, 1 - sparsity, dtype=dtype, device=device)) + expected_nnz = int((1 - sparsity) * M * N / (blocksize[0] * blocksize[1])) + nonzero_indices = A.flatten().nonzero() + actual_nnz = nonzero_indices.shape[0] + if actual_nnz > expected_nnz: + selected_nonzeros = torch.randperm(actual_nnz)[: actual_nnz - expected_nnz] + A.flatten()[nonzero_indices[selected_nonzeros]] = 0 + elif actual_nnz < expected_nnz: + zero_indices = (A == 0).flatten().nonzero() + selected_zeros = torch.randperm(zero_indices.shape[0])[ + : expected_nnz - actual_nnz + ] + A.flatten()[zero_indices[selected_zeros]] = 1 + A = torch.repeat_interleave(A, blocksize[0], dim=-2) + A = torch.repeat_interleave(A, blocksize[1], dim=-1) + return A + + +def optimize_scatter_mm( + m, k, n, bm, bk, dtype=torch.float16, device="cuda", sparsity=0.5, force=False +): + import triton + + from torch.sparse._triton_ops import bsr_scatter_mm, bsr_scatter_mm_indices_data + + key = (m, k, n, bm, bk) + + version = (0, dtype, sparsity) + device_name = torch.cuda.get_device_name() + + reference_meta = dict( + GROUP_SIZE=1, + TILE_M=16, + TILE_N=16, + SPLIT_N=n // 16, + num_stages=1, + num_warps=1, + ) + + initial_meta = get_meta( + "scatter_mm", key, device_name=device_name, version=version, exact=True + ) + + if initial_meta is None: + initial_meta = get_meta( + "bsr_dense_addmm", + key, + device_name=device_name, + version=(0, dtype, 0.5), + exact=True, + ) + if initial_meta is None: + initial_meta = reference_meta + elif not force: + return + + print(f"{m, k, n, bm, bk, initial_meta, reference_meta=}") + torch.manual_seed(0) + bsr = create_blocked_tensor( + 0, m, k, (bm, bk), sparsity, dtype, device + ).to_sparse_bsr((bm, bk)) + dense = make_tensor(k, n, dtype=dtype, device=device) + + def bench(meta, bsr=bsr, dense=dense): + indices_data = bsr_scatter_mm_indices_data( + bsr, dense, indices_format="bsr_strided_mm_compressed", **meta + ) + + def test_func(): + return bsr_scatter_mm(bsr, dense, indices_data=indices_data) + + ms_min = triton.testing.do_bench( + test_func, warmup=500, rep=100, fast_flush=False + ) + + return ms_min + + def step_meta_parameter(name, value, direction, meta, m=m, n=n, k=k, bm=bm, bk=bk): + # return next value in positive or negative direction, or + # input value if the step will result an invalid + # value. The input value is assumed to be valid. + + is_log = name in {"SPLIT_N", "TILE_M", "TILE_N", "num_warps"} + min_value = dict( + SPLIT_N=1, TILE_M=16, TILE_N=16, num_warps=1, num_stages=1, GROUP_SIZE=1 + )[name] + max_value = dict( + SPLIT_N=n // meta["TILE_N"], TILE_M=bm, TILE_N=n // meta["SPLIT_N"] + ).get(name) + value_step = dict( + SPLIT_N=2, TILE_M=2, TILE_N=2, num_warps=2, num_stages=1, GROUP_SIZE=1 + )[name] + if is_log: + next_value = ( + value * value_step**direction + if direction > 0 + else value // (value_step ** abs(direction)) + ) + else: + next_value = value + value_step * direction + if min_value is not None: + next_value = max(next_value, min_value) + if max_value is not None: + next_value = min(next_value, max_value) + if name == "SPLIT_N" and n % next_value != 0: + return value + # Hard-skip parameter combinations that break CUDA state for pytorch: + if (dtype, name, next_value, m, n, k, bm, bk) in { + (torch.float32, "num_warps", 32, 256, 256, 256, 16, 16), + (torch.float32, "num_warps", 16, 256, 256, 256, 32, 32), + (torch.float32, "num_warps", 16, 256, 256, 256, 64, 64), + (torch.float32, "num_warps", 16, 256, 256, 256, 128, 128), + (torch.float32, "num_warps", 16, 512, 512, 256, 128, 128), + } and re.match(r"NVIDIA A100[^\d]", device_name) is not None: + return value + return next_value + + meta, speedup, timing, sensitivity_message = minimize( + bench, initial_meta, reference_meta, step_meta_parameter + ) + if initial_meta is not reference_meta and initial_meta == meta and not force: + return + print(f"{meta=} {speedup=:.1f} % {timing=:.3f} ms") + if speedup < 0: + return + device_name = torch.cuda.get_device_name() + + update( + "scatter_mm", device_name, version, key, tuple(meta[k] for k in sorted(meta)) + ) + + +def tune_bsr_dense_addmm( + input, + bsr, + dense, + *, + beta=1, + alpha=1, + out=None, + store=False, + verbose=False, + force=False, +): + """Tune bsr_dense_addmm kernel parameters against the given inputs. + + When store is True, the tuning results will be stored in the + database of kernel parameters. + """ + import triton + + from torch.sparse._triton_ops import bsr_dense_addmm + + N = dense.shape[-1] + values = bsr.values() + crow_indices = bsr.crow_indices() + batch_ndim = crow_indices.dim() - 1 + M, K = bsr.shape[batch_ndim : batch_ndim + 2] + BM, BK = values.shape[batch_ndim + 1 : batch_ndim + 3] + + # Reference parameters is a set of parameters that leads to a + # successful kernel call and the corresponding timing is used as a + # reference for computing speedups. Avoid changing the reference + # parameters when possible. + reference_meta = dict( + GROUP_SIZE_ROW=1, num_stages=1, num_warps=4, SPLIT_N=max(N // BM, 1) + ) + + # Compute the key of parameters: + sparsity = round(1 - bsr._nnz() * BM * BK / (M * K), 2) + dtype = bsr.dtype + version = (0, dtype, sparsity) + key = (M, K, N, BM, BK, beta == 0, beta == 1, alpha == 1) + + # For tuning, for an initial state, use parameters from the + # database if available, otherwise, use the reference parameters. + initial_meta = get_meta("bsr_dense_addmm", key, version=version, exact=True) + if initial_meta is None: + may_skip_update = False + initial_meta = get_meta( + "bsr_dense_addmm", key, version=(0, dtype, 0.5), exact=True + ) + if initial_meta is None: + initial_meta = reference_meta + elif not force: + return initial_meta + else: + may_skip_update = True + + # The target function that is minimized in the tuning process: + def bench(meta, input=input, bsr=bsr, dense=dense, alpha=alpha, out=out): + def test_func(): + return bsr_dense_addmm( + input, bsr, dense, beta=beta, alpha=alpha, meta=meta, out=out + ) + + return triton.testing.do_bench(test_func, warmup=500, rep=100, fast_flush=False) + + # The step function that increments a specified meta parameter: + def step_meta_parameter(name, value, direction, meta, M=M, N=N, K=K, BM=BM, BK=BK): + # return next value in positive or negative direction, or + # input value if the step will result an invalid + # value. The input value is assumed to be valid. + is_log = name in {"SPLIT_N", "num_warps"} + min_value = dict(SPLIT_N=1, num_warps=1, num_stages=1, GROUP_SIZE_ROW=1)[name] + max_value = dict(SPLIT_N=max(N // BM, 1)).get(name) + value_step = dict(SPLIT_N=2, num_warps=2, num_stages=1, GROUP_SIZE_ROW=1)[name] + if is_log: + next_value = ( + value * value_step**direction + if direction > 0 + else value // (value_step ** abs(direction)) + ) + else: + next_value = value + value_step * direction + if min_value is not None: + next_value = max(next_value, min_value) + if max_value is not None: + next_value = min(next_value, max_value) + if name == "SPLIT_N" and N % next_value != 0: + return value + return next_value + + # Tune: + meta, speedup, timing, sensitivity_message = minimize( + bench, + initial_meta, + reference_meta, + step_meta_parameter, + max_step=2, + verbose=verbose, + ) + if verbose: + print(f"-> {sensitivity_message}, {speedup=:.1f} %, {timing=:.3f} ms") + + if store and not ( + may_skip_update and meta == initial_meta and initial_meta is not reference_meta + ): + device_name = torch.cuda.get_device_name() + update( + "bsr_dense_addmm", + device_name, + version, + key, + tuple(meta[k] for k in sorted(meta)), + ) + + return meta + + +def optimize_bsr_dense_addmm( + m, + k, + n, + bm, + bk, + beta=1, + alpha=1, + dtype=torch.float16, + device="cuda", + sparsity=0.5, + force=False, + verbose=False, +): + torch.manual_seed(0) + bsr = create_blocked_tensor( + 0, m, k, (bm, bk), sparsity, dtype, device + ).to_sparse_bsr((bm, bk)) + dense = make_tensor(k, n, dtype=dtype, device=device) + input = make_tensor(m, n, dtype=dtype, device=device) + tune_bsr_dense_addmm( + input, + bsr, + dense, + beta=beta, + alpha=alpha, + store=True, + force=force, + verbose=verbose, + ) + + +def main(op="scatter_mm", force=False, dtype=torch.float16, verbose=True): + import itertools + + sizes_lst = [256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072] + shapes_lst = [(sz, sz) for sz in sizes_lst[:-3]] + blocksize_lst = [(16, 16), (32, 32), (64, 64), (128, 128)] + sparsity_lst = [0.5, 0.7, 0.3][:1] + for sparsity in sparsity_lst: + print(f"{op, dtype, sparsity=}") + try: + for (M, K), N, (BM, BK) in itertools.product( + shapes_lst, sizes_lst, blocksize_lst + ): + if op == "scatter_mm": + optimize_scatter_mm( + M, K, N, BM, BK, force=force, sparsity=sparsity, dtype=dtype + ) + elif op == "bsr_dense_addmm": + for alpha, beta in [(1, 1), (1, 0)]: + optimize_bsr_dense_addmm( + M, + K, + N, + BM, + BK, + beta=beta, + alpha=alpha, + force=force, + sparsity=sparsity, + dtype=dtype, + verbose=verbose, + ) + else: + raise NotImplementedError(op) + except KeyboardInterrupt: + break + except Exception as msg: + dump() + raise + dump() + + if 0: + # Check performance dependence on sparsity and apply + # adjustments when differences are noticable (more than 10%). + # + # When using NVIDIA A100 GPU, the performance dependence on + # sparsity is insignificant (0 % ... 10 %) for majority of + # shapes/blocksizes combinations. However, for a very few + # specific size combinations, the effect of sparsity on + # performance can be up to 20 %. + for (M, K), N, (BM, BK) in itertools.product( + shapes_lst, sizes_lst, blocksize_lst + ): + meta_lst: list = [] + key = (M, K, N, BM, BK) + for sparsity1 in sparsity_lst: + torch.manual_seed(0) + bsr = create_blocked_tensor( + 0, M, K, (BM, BK), sparsity1, dtype, device="cuda" + ).to_sparse_bsr((BM, BK)) + dense = make_tensor(K, N, dtype=dtype, device="cuda") + meta_lst = [] + for sparsity in sparsity_lst: + meta = get_meta(op, key, version=(0, dtype, sparsity), exact=True) + if meta is None: + continue + + def bench(meta, bsr=bsr, dense=dense): + import triton + + if op == "scatter_mm": + from torch.sparse._triton_ops import ( + bsr_scatter_mm, + bsr_scatter_mm_indices_data, + ) + + indices_data = bsr_scatter_mm_indices_data( + bsr, + dense, + indices_format="bsr_strided_mm_compressed", + **meta, + ) + + def test_func(): + return bsr_scatter_mm( + bsr, dense, indices_data=indices_data + ) + + else: + raise NotImplementedError(op) + + ms_min = triton.testing.do_bench( + test_func, warmup=500, rep=100, fast_flush=False + ) + + return ms_min + + meta_lst.append( + (bench(meta), sparsity, tuple(meta[k] for k in sorted(meta))) + ) + if not meta_lst: + continue + meta_lst = sorted(meta_lst) + index = next( + i for i, item in enumerate(meta_lst) if item[1] == sparsity1 + ) + if meta_lst[0][2] == meta_lst[index][2]: + continue + speeddiff = (1 - meta_lst[index][0] / meta_lst[0][0]) * 100 + if abs(speeddiff) < 10: + continue + + print(sparsity1, index, key, meta_lst, speeddiff) + + if index > 0: + device_name = torch.cuda.get_device_name() + meta = get_meta( + op, key, version=(0, dtype, meta_lst[0][1]), exact=True + ) + update( + op, + device_name, + (0, dtype, sparsity1), + key, + tuple(meta[k] for k in sorted(meta)), + ) + print("update") + dump() + + +_operation_device_version_data: Dict[Any, Dict] = { + # Warning: the data in between the BEGIN/END DATA comment lines + # below is generated. It can be updated either manually or via + # calling dump function defined above. + # + # Legend [op: key -> data]: + # scatter_mm : M, K, N, Ms, Ks -> GROUP_SIZE, SPLIT_N, TILE_M, TILE_N, num_stages, num_warps + # bsr_dense_addmm : M, K, N, Ms, Ks, beta==0, beta==1, alpha==1 -> GROUP_SIZE_ROW, SPLIT_N, num_stages, num_warps + # + # BEGIN GENERATED DATA + ("bsr_dense_addmm", "NVIDIA A100-SXM4-80GB", (0, torch.bfloat16, 0.5)): { + (16, 16, 16, 16, 16, False, False, False): (2, 1, 1, 2), + (16, 16, 16, 16, 16, False, False, True): (1, 1, 1, 4), + (16, 16, 16, 16, 16, False, True, False): (1, 1, 3, 16), + (16, 16, 16, 16, 16, False, True, True): (1, 1, 1, 8), + (16, 16, 16, 16, 16, True, False, False): (2, 1, 1, 8), + (16, 16, 16, 16, 16, True, False, True): (1, 1, 1, 8), + (16, 16, 32, 16, 16, False, False, False): (1, 2, 1, 8), + (16, 16, 32, 16, 16, False, False, True): (1, 2, 2, 4), + (16, 16, 32, 16, 16, False, True, False): (1, 1, 2, 4), + (16, 16, 32, 16, 16, False, True, True): (1, 1, 2, 4), + (16, 16, 32, 16, 16, True, False, False): (1, 1, 2, 4), + (16, 16, 32, 16, 16, True, False, True): (2, 2, 1, 2), + (16, 16, 64, 16, 16, False, False, False): (1, 4, 2, 4), + (16, 16, 64, 16, 16, False, False, True): (1, 2, 1, 2), + (16, 16, 64, 16, 16, False, True, False): (2, 1, 1, 2), + (16, 16, 64, 16, 16, False, True, True): (1, 4, 1, 8), + (16, 16, 64, 16, 16, True, False, False): (1, 4, 1, 1), + (16, 16, 64, 16, 16, True, False, True): (1, 4, 2, 4), + (16, 32, 16, 16, 16, False, False, False): (1, 1, 2, 2), + (16, 32, 16, 16, 16, False, False, True): (1, 1, 1, 4), + (16, 32, 16, 16, 16, False, True, False): (1, 1, 1, 2), + (16, 32, 16, 16, 16, False, True, True): (1, 1, 1, 1), + (16, 32, 16, 16, 16, True, False, False): (1, 1, 1, 2), + (16, 32, 16, 16, 16, True, False, True): (2, 1, 1, 2), + (16, 32, 16, 16, 32, False, False, False): (1, 1, 1, 4), + (16, 32, 16, 16, 32, False, False, True): (1, 1, 1, 8), + (16, 32, 16, 16, 32, False, True, False): (1, 1, 1, 8), + (16, 32, 16, 16, 32, False, True, True): (1, 1, 2, 4), + (16, 32, 16, 16, 32, True, False, False): (1, 1, 1, 2), + (16, 32, 16, 16, 32, True, False, True): (1, 1, 1, 1), + (16, 32, 32, 16, 16, False, False, False): (2, 2, 1, 4), + (16, 32, 32, 16, 16, False, False, True): (2, 2, 1, 2), + (16, 32, 32, 16, 16, False, True, False): (1, 1, 2, 8), + (16, 32, 32, 16, 16, False, True, True): (1, 2, 1, 1), + (16, 32, 32, 16, 16, True, False, False): (1, 1, 1, 8), + (16, 32, 32, 16, 16, True, False, True): (1, 2, 1, 4), + (16, 32, 32, 16, 32, False, False, False): (1, 1, 2, 8), + (16, 32, 32, 16, 32, False, False, True): (2, 1, 1, 8), + (16, 32, 32, 16, 32, False, True, False): (1, 1, 1, 4), + (16, 32, 32, 16, 32, False, True, True): (1, 1, 1, 4), + (16, 32, 32, 16, 32, True, False, False): (1, 2, 1, 8), + (16, 32, 32, 16, 32, True, False, True): (1, 1, 1, 4), + (16, 32, 64, 16, 16, False, False, False): (1, 4, 3, 8), + (16, 32, 64, 16, 16, False, False, True): (1, 4, 1, 4), + (16, 32, 64, 16, 16, False, True, False): (1, 4, 1, 4), + (16, 32, 64, 16, 16, False, True, True): (2, 4, 1, 4), + (16, 32, 64, 16, 16, True, False, False): (1, 2, 1, 4), + (16, 32, 64, 16, 16, True, False, True): (1, 2, 1, 4), + (16, 32, 64, 16, 32, False, False, False): (1, 4, 1, 8), + (16, 32, 64, 16, 32, False, False, True): (1, 4, 1, 4), + (16, 32, 64, 16, 32, False, True, False): (1, 4, 1, 2), + (16, 32, 64, 16, 32, False, True, True): (1, 2, 1, 4), + (16, 32, 64, 16, 32, True, False, False): (1, 2, 1, 4), + (16, 32, 64, 16, 32, True, False, True): (1, 2, 1, 2), + (16, 64, 16, 16, 32, False, False, False): (1, 1, 1, 2), + (16, 64, 16, 16, 32, False, False, True): (1, 1, 2, 2), + (16, 64, 16, 16, 32, False, True, False): (1, 1, 2, 8), + (16, 64, 16, 16, 32, False, True, True): (1, 1, 1, 4), + (16, 64, 16, 16, 32, True, False, False): (1, 1, 1, 8), + (16, 64, 16, 16, 32, True, False, True): (1, 1, 1, 4), + (16, 64, 32, 16, 32, False, False, False): (1, 2, 1, 2), + (16, 64, 32, 16, 32, False, False, True): (1, 2, 1, 4), + (16, 64, 32, 16, 32, False, True, False): (1, 2, 1, 4), + (16, 64, 32, 16, 32, False, True, True): (2, 2, 1, 4), + (16, 64, 32, 16, 32, True, False, False): (1, 2, 1, 4), + (16, 64, 32, 16, 32, True, False, True): (1, 2, 1, 8), + (16, 64, 64, 16, 32, False, False, False): (1, 2, 1, 4), + (16, 64, 64, 16, 32, False, False, True): (1, 4, 2, 2), + (16, 64, 64, 16, 32, False, True, False): (1, 1, 1, 4), + (16, 64, 64, 16, 32, False, True, True): (1, 4, 1, 2), + (16, 64, 64, 16, 32, True, False, False): (1, 2, 1, 4), + (16, 64, 64, 16, 32, True, False, True): (1, 4, 1, 4), + (32, 16, 16, 16, 16, False, False, False): (1, 1, 1, 8), + (32, 16, 16, 16, 16, False, False, True): (1, 1, 2, 4), + (32, 16, 16, 16, 16, False, True, False): (1, 1, 1, 4), + (32, 16, 16, 16, 16, False, True, True): (1, 1, 2, 4), + (32, 16, 16, 16, 16, True, False, False): (1, 1, 1, 2), + (32, 16, 16, 16, 16, True, False, True): (1, 1, 1, 4), + (32, 16, 32, 16, 16, False, False, False): (1, 1, 1, 4), + (32, 16, 32, 16, 16, False, False, True): (2, 2, 1, 4), + (32, 16, 32, 16, 16, False, True, False): (1, 2, 2, 2), + (32, 16, 32, 16, 16, False, True, True): (2, 2, 1, 4), + (32, 16, 32, 16, 16, True, False, False): (1, 2, 2, 8), + (32, 16, 32, 16, 16, True, False, True): (1, 2, 1, 2), + (32, 16, 64, 16, 16, False, False, False): (1, 4, 1, 4), + (32, 16, 64, 16, 16, False, False, True): (1, 4, 2, 4), + (32, 16, 64, 16, 16, False, True, False): (1, 2, 2, 2), + (32, 16, 64, 16, 16, False, True, True): (3, 4, 1, 4), + (32, 16, 64, 16, 16, True, False, False): (1, 2, 1, 2), + (32, 16, 64, 16, 16, True, False, True): (1, 2, 1, 4), + (32, 32, 16, 16, 16, False, False, False): (1, 1, 3, 4), + (32, 32, 16, 16, 16, False, False, True): (1, 1, 1, 4), + (32, 32, 16, 16, 16, False, True, False): (1, 1, 1, 2), + (32, 32, 16, 16, 16, False, True, True): (1, 1, 1, 4), + (32, 32, 16, 16, 16, True, False, False): (1, 1, 1, 4), + (32, 32, 16, 16, 16, True, False, True): (1, 1, 2, 2), + (32, 32, 16, 16, 32, False, False, False): (2, 1, 1, 4), + (32, 32, 16, 16, 32, False, False, True): (1, 1, 1, 4), + (32, 32, 16, 16, 32, False, True, False): (1, 1, 1, 4), + (32, 32, 16, 16, 32, False, True, True): (3, 1, 2, 4), + (32, 32, 16, 16, 32, True, False, False): (1, 1, 1, 4), + (32, 32, 16, 16, 32, True, False, True): (1, 1, 1, 4), + (32, 32, 16, 32, 32, False, False, False): (1, 1, 1, 8), + (32, 32, 16, 32, 32, False, False, True): (1, 1, 1, 4), + (32, 32, 16, 32, 32, False, True, False): (1, 1, 2, 1), + (32, 32, 16, 32, 32, False, True, True): (2, 1, 2, 2), + (32, 32, 16, 32, 32, True, False, False): (1, 1, 1, 8), + (32, 32, 16, 32, 32, True, False, True): (2, 1, 3, 4), + (32, 32, 32, 16, 16, False, False, False): (1, 2, 1, 4), + (32, 32, 32, 16, 16, False, False, True): (2, 2, 1, 4), + (32, 32, 32, 16, 16, False, True, False): (1, 1, 1, 8), + (32, 32, 32, 16, 16, False, True, True): (2, 2, 1, 4), + (32, 32, 32, 16, 16, True, False, False): (1, 1, 1, 4), + (32, 32, 32, 16, 16, True, False, True): (2, 2, 2, 4), + (32, 32, 32, 16, 32, False, False, False): (2, 2, 1, 8), + (32, 32, 32, 16, 32, False, False, True): (1, 2, 1, 2), + (32, 32, 32, 16, 32, False, True, False): (1, 2, 1, 4), + (32, 32, 32, 16, 32, False, True, True): (1, 2, 1, 4), + (32, 32, 32, 16, 32, True, False, False): (1, 2, 1, 4), + (32, 32, 32, 16, 32, True, False, True): (1, 2, 1, 2), + (32, 32, 32, 32, 32, False, False, False): (1, 1, 3, 8), + (32, 32, 32, 32, 32, False, False, True): (1, 1, 1, 8), + (32, 32, 32, 32, 32, False, True, False): (2, 1, 3, 4), + (32, 32, 32, 32, 32, False, True, True): (2, 1, 1, 2), + (32, 32, 32, 32, 32, True, False, False): (1, 1, 1, 2), + (32, 32, 32, 32, 32, True, False, True): (4, 1, 1, 1), + (32, 32, 64, 16, 16, False, False, False): (1, 4, 1, 4), + (32, 32, 64, 16, 16, False, False, True): (1, 4, 1, 4), + (32, 32, 64, 16, 16, False, True, False): (1, 2, 1, 8), + (32, 32, 64, 16, 16, False, True, True): (1, 4, 1, 2), + (32, 32, 64, 16, 16, True, False, False): (2, 4, 1, 2), + (32, 32, 64, 16, 16, True, False, True): (1, 4, 1, 2), + (32, 32, 64, 16, 32, False, False, False): (1, 2, 1, 8), + (32, 32, 64, 16, 32, False, False, True): (1, 4, 2, 2), + (32, 32, 64, 16, 32, False, True, False): (1, 2, 1, 4), + (32, 32, 64, 16, 32, False, True, True): (1, 4, 1, 4), + (32, 32, 64, 16, 32, True, False, False): (1, 4, 2, 2), + (32, 32, 64, 16, 32, True, False, True): (3, 4, 2, 2), + (32, 32, 64, 32, 32, False, False, False): (2, 2, 1, 4), + (32, 32, 64, 32, 32, False, False, True): (1, 2, 1, 4), + (32, 32, 64, 32, 32, False, True, False): (1, 1, 1, 8), + (32, 32, 64, 32, 32, False, True, True): (1, 1, 1, 4), + (32, 32, 64, 32, 32, True, False, False): (1, 2, 1, 2), + (32, 32, 64, 32, 32, True, False, True): (3, 2, 1, 8), + (32, 64, 16, 16, 32, False, False, False): (1, 1, 2, 2), + (32, 64, 16, 16, 32, False, False, True): (1, 1, 1, 4), + (32, 64, 16, 16, 32, False, True, False): (1, 1, 2, 4), + (32, 64, 16, 16, 32, False, True, True): (1, 1, 1, 4), + (32, 64, 16, 16, 32, True, False, False): (1, 1, 1, 2), + (32, 64, 16, 16, 32, True, False, True): (2, 1, 2, 2), + (32, 64, 16, 32, 32, False, False, False): (1, 1, 1, 1), + (32, 64, 16, 32, 32, False, False, True): (2, 1, 1, 4), + (32, 64, 16, 32, 32, False, True, False): (1, 1, 1, 1), + (32, 64, 16, 32, 32, False, True, True): (1, 1, 2, 2), + (32, 64, 16, 32, 32, True, False, False): (1, 1, 2, 4), + (32, 64, 16, 32, 32, True, False, True): (1, 1, 1, 4), + (32, 64, 32, 16, 32, False, False, False): (2, 2, 1, 4), + (32, 64, 32, 16, 32, False, False, True): (1, 2, 1, 4), + (32, 64, 32, 16, 32, False, True, False): (1, 1, 1, 4), + (32, 64, 32, 16, 32, False, True, True): (2, 2, 3, 4), + (32, 64, 32, 16, 32, True, False, False): (1, 1, 1, 2), + (32, 64, 32, 16, 32, True, False, True): (1, 2, 1, 2), + (32, 64, 32, 32, 32, False, False, False): (1, 1, 1, 2), + (32, 64, 32, 32, 32, False, False, True): (2, 1, 1, 4), + (32, 64, 32, 32, 32, False, True, False): (1, 1, 1, 8), + (32, 64, 32, 32, 32, False, True, True): (1, 1, 2, 4), + (32, 64, 32, 32, 32, True, False, False): (2, 1, 1, 4), + (32, 64, 32, 32, 32, True, False, True): (1, 1, 2, 4), + (32, 64, 64, 16, 32, False, False, False): (1, 4, 1, 4), + (32, 64, 64, 16, 32, False, False, True): (1, 4, 2, 4), + (32, 64, 64, 16, 32, False, True, False): (1, 4, 2, 2), + (32, 64, 64, 16, 32, False, True, True): (1, 4, 1, 4), + (32, 64, 64, 16, 32, True, False, False): (1, 4, 1, 8), + (32, 64, 64, 16, 32, True, False, True): (1, 4, 2, 1), + (32, 64, 64, 32, 32, False, False, False): (1, 1, 1, 4), + (32, 64, 64, 32, 32, False, False, True): (2, 2, 1, 4), + (32, 64, 64, 32, 32, False, True, False): (1, 1, 1, 4), + (32, 64, 64, 32, 32, False, True, True): (2, 2, 1, 4), + (32, 64, 64, 32, 32, True, False, False): (1, 2, 2, 4), + (32, 64, 64, 32, 32, True, False, True): (2, 2, 3, 4), + (64, 32, 16, 32, 32, False, False, False): (1, 1, 1, 4), + (64, 32, 16, 32, 32, False, False, True): (1, 1, 1, 4), + (64, 32, 16, 32, 32, False, True, False): (1, 1, 1, 8), + (64, 32, 16, 32, 32, False, True, True): (1, 1, 1, 4), + (64, 32, 16, 32, 32, True, False, False): (1, 1, 1, 16), + (64, 32, 16, 32, 32, True, False, True): (2, 1, 1, 4), + (64, 32, 32, 32, 32, False, False, False): (1, 1, 3, 4), + (64, 32, 32, 32, 32, False, False, True): (2, 1, 1, 4), + (64, 32, 32, 32, 32, False, True, False): (1, 1, 2, 4), + (64, 32, 32, 32, 32, False, True, True): (2, 1, 1, 4), + (64, 32, 32, 32, 32, True, False, False): (2, 1, 1, 16), + (64, 32, 32, 32, 32, True, False, True): (2, 1, 1, 4), + (64, 32, 64, 32, 32, False, False, False): (1, 2, 1, 4), + (64, 32, 64, 32, 32, False, False, True): (2, 2, 1, 4), + (64, 32, 64, 32, 32, False, True, False): (1, 1, 1, 4), + (64, 32, 64, 32, 32, False, True, True): (2, 2, 1, 4), + (64, 32, 64, 32, 32, True, False, False): (1, 2, 1, 8), + (64, 32, 64, 32, 32, True, False, True): (2, 2, 3, 4), + (64, 64, 16, 32, 32, False, False, False): (1, 1, 2, 16), + (64, 64, 16, 32, 32, False, False, True): (1, 1, 3, 4), + (64, 64, 16, 32, 32, False, True, False): (1, 1, 1, 2), + (64, 64, 16, 32, 32, False, True, True): (2, 1, 1, 4), + (64, 64, 16, 32, 32, True, False, False): (2, 1, 3, 2), + (64, 64, 16, 32, 32, True, False, True): (1, 1, 2, 4), + (64, 64, 32, 32, 32, False, False, False): (1, 1, 1, 8), + (64, 64, 32, 32, 32, False, False, True): (2, 1, 2, 4), + (64, 64, 32, 32, 32, False, True, False): (2, 1, 1, 4), + (64, 64, 32, 32, 32, False, True, True): (1, 1, 2, 4), + (64, 64, 32, 32, 32, True, False, False): (2, 1, 1, 4), + (64, 64, 32, 32, 32, True, False, True): (1, 1, 2, 4), + (64, 64, 64, 32, 32, False, False, False): (1, 2, 2, 4), + (64, 64, 64, 32, 32, False, False, True): (1, 2, 2, 2), + (64, 64, 64, 32, 32, False, True, False): (1, 2, 1, 2), + (64, 64, 64, 32, 32, False, True, True): (1, 2, 1, 4), + (64, 64, 64, 32, 32, True, False, False): (1, 2, 1, 4), + (64, 64, 64, 32, 32, True, False, True): (1, 2, 1, 4), + (256, 256, 256, 16, 16, False, True, True): (4, 8, 5, 1), + (256, 256, 256, 16, 16, True, False, True): (2, 8, 4, 2), + (256, 256, 256, 32, 32, False, True, True): (2, 8, 5, 2), + (256, 256, 256, 32, 32, True, False, True): (1, 8, 5, 4), + (256, 256, 256, 64, 64, False, True, True): (2, 4, 4, 4), + (256, 256, 256, 64, 64, True, False, True): (1, 4, 3, 4), + (256, 256, 256, 128, 128, False, True, True): (4, 2, 2, 8), + (256, 256, 256, 128, 128, True, False, True): (1, 2, 2, 8), + (256, 256, 512, 16, 16, False, True, True): (1, 16, 5, 1), + (256, 256, 512, 16, 16, True, False, True): (3, 16, 3, 2), + (256, 256, 512, 32, 32, False, True, True): (2, 8, 5, 2), + (256, 256, 512, 32, 32, True, False, True): (1, 16, 4, 4), + (256, 256, 512, 64, 64, False, True, True): (1, 8, 4, 4), + (256, 256, 512, 64, 64, True, False, True): (3, 8, 3, 4), + (256, 256, 512, 128, 128, False, True, True): (1, 4, 2, 8), + (256, 256, 512, 128, 128, True, False, True): (1, 4, 2, 8), + (256, 256, 1024, 16, 16, False, True, True): (1, 16, 5, 4), + (256, 256, 1024, 16, 16, True, False, True): (5, 16, 4, 2), + (256, 256, 1024, 32, 32, False, True, True): (1, 32, 5, 2), + (256, 256, 1024, 32, 32, True, False, True): (2, 16, 5, 2), + (256, 256, 1024, 64, 64, False, True, True): (1, 16, 4, 4), + (256, 256, 1024, 64, 64, True, False, True): (1, 16, 4, 4), + (256, 256, 1024, 128, 128, False, True, True): (1, 8, 2, 8), + (256, 256, 1024, 128, 128, True, False, True): (1, 8, 2, 8), + (256, 256, 2048, 16, 16, False, True, True): (1, 16, 4, 4), + (256, 256, 2048, 16, 16, True, False, True): (2, 32, 5, 1), + (256, 256, 2048, 32, 32, False, True, True): (1, 64, 4, 1), + (256, 256, 2048, 32, 32, True, False, True): (2, 32, 4, 2), + (256, 256, 2048, 64, 64, False, True, True): (8, 16, 5, 4), + (256, 256, 2048, 64, 64, True, False, True): (1, 16, 4, 4), + (256, 256, 2048, 128, 128, False, True, True): (2, 16, 2, 8), + (256, 256, 2048, 128, 128, True, False, True): (1, 16, 2, 8), + (256, 256, 4096, 16, 16, False, True, True): (1, 64, 1, 4), + (256, 256, 4096, 16, 16, True, False, True): (1, 16, 3, 2), + (256, 256, 4096, 32, 32, False, True, True): (6, 32, 3, 2), + (256, 256, 4096, 32, 32, True, False, True): (4, 32, 4, 2), + (256, 256, 4096, 64, 64, False, True, True): (6, 64, 3, 4), + (256, 256, 4096, 64, 64, True, False, True): (2, 64, 3, 4), + (256, 256, 4096, 128, 128, False, True, True): (1, 32, 2, 8), + (256, 256, 4096, 128, 128, True, False, True): (1, 32, 2, 8), + (256, 256, 8192, 16, 16, False, True, True): (2, 32, 3, 4), + (256, 256, 8192, 16, 16, True, False, True): (4, 64, 3, 2), + (256, 256, 8192, 32, 32, False, True, True): (1, 64, 3, 4), + (256, 256, 8192, 32, 32, True, False, True): (3, 128, 1, 2), + (256, 256, 8192, 64, 64, False, True, True): (9, 128, 1, 4), + (256, 256, 8192, 64, 64, True, False, True): (8, 128, 1, 4), + (256, 256, 8192, 128, 128, False, True, True): (7, 64, 1, 4), + (256, 256, 8192, 128, 128, True, False, True): (1, 32, 1, 16), + (256, 256, 16384, 16, 16, False, True, True): (3, 128, 3, 2), + (256, 256, 16384, 16, 16, True, False, True): (5, 64, 3, 2), + (256, 256, 16384, 32, 32, False, True, True): (3, 128, 3, 2), + (256, 256, 16384, 32, 32, True, False, True): (1, 128, 3, 2), + (256, 256, 16384, 64, 64, False, True, True): (3, 128, 1, 4), + (256, 256, 16384, 64, 64, True, False, True): (2, 128, 1, 4), + (256, 256, 16384, 128, 128, False, True, True): (7, 128, 1, 4), + (256, 256, 16384, 128, 128, True, False, True): (1, 128, 2, 8), + (256, 256, 32768, 16, 16, False, True, True): (2, 128, 3, 2), + (256, 256, 32768, 16, 16, True, False, True): (1, 128, 3, 2), + (256, 256, 32768, 32, 32, False, True, True): (1, 256, 3, 4), + (256, 256, 32768, 32, 32, True, False, True): (3, 256, 3, 2), + (256, 256, 32768, 64, 64, False, True, True): (1, 256, 1, 4), + (256, 256, 32768, 64, 64, True, False, True): (3, 256, 1, 4), + (256, 256, 32768, 128, 128, False, True, True): (9, 256, 1, 4), + (256, 256, 32768, 128, 128, True, False, True): (2, 256, 1, 4), + (256, 256, 65536, 16, 16, False, True, True): (1, 256, 3, 2), + (256, 256, 65536, 16, 16, True, False, True): (1, 256, 3, 2), + (256, 256, 65536, 32, 32, False, True, True): (2, 512, 3, 2), + (256, 256, 65536, 32, 32, True, False, True): (2, 512, 3, 2), + (256, 256, 65536, 64, 64, False, True, True): (2, 512, 1, 4), + (256, 256, 65536, 64, 64, True, False, True): (1, 512, 1, 4), + (256, 256, 65536, 128, 128, False, True, True): (7, 512, 1, 4), + (256, 256, 65536, 128, 128, True, False, True): (2, 512, 1, 4), + (256, 256, 131072, 16, 16, False, True, True): (1, 512, 3, 2), + (256, 256, 131072, 16, 16, True, False, True): (1, 512, 3, 2), + (256, 256, 131072, 32, 32, False, True, True): (1, 1024, 3, 2), + (256, 256, 131072, 32, 32, True, False, True): (1, 1024, 3, 2), + (256, 256, 131072, 64, 64, False, True, True): (1, 1024, 1, 4), + (256, 256, 131072, 64, 64, True, False, True): (1, 1024, 1, 4), + (256, 256, 131072, 128, 128, False, True, True): (3, 1024, 1, 4), + (256, 256, 131072, 128, 128, True, False, True): (1, 1024, 1, 4), + (512, 512, 256, 16, 16, False, True, True): (2, 4, 5, 4), + (512, 512, 256, 16, 16, True, False, True): (3, 4, 5, 4), + (512, 512, 256, 32, 32, False, True, True): (1, 4, 5, 2), + (512, 512, 256, 32, 32, True, False, True): (4, 8, 5, 1), + (512, 512, 256, 64, 64, False, True, True): (4, 4, 5, 4), + (512, 512, 256, 64, 64, True, False, True): (5, 4, 5, 4), + (512, 512, 256, 128, 128, False, True, True): (3, 2, 2, 8), + (512, 512, 256, 128, 128, True, False, True): (2, 2, 2, 8), + (512, 512, 512, 16, 16, False, True, True): (1, 8, 5, 4), + (512, 512, 512, 16, 16, True, False, True): (4, 8, 5, 2), + (512, 512, 512, 32, 32, False, True, True): (1, 16, 4, 1), + (512, 512, 512, 32, 32, True, False, True): (1, 8, 5, 2), + (512, 512, 512, 64, 64, False, True, True): (4, 8, 5, 4), + (512, 512, 512, 64, 64, True, False, True): (2, 8, 5, 4), + (512, 512, 512, 128, 128, False, True, True): (2, 4, 2, 8), + (512, 512, 512, 128, 128, True, False, True): (1, 4, 2, 8), + (512, 512, 1024, 16, 16, False, True, True): (2, 8, 4, 4), + (512, 512, 1024, 16, 16, True, False, True): (1, 8, 4, 4), + (512, 512, 1024, 32, 32, False, True, True): (3, 16, 4, 2), + (512, 512, 1024, 32, 32, True, False, True): (1, 16, 5, 2), + (512, 512, 1024, 64, 64, False, True, True): (2, 8, 3, 4), + (512, 512, 1024, 64, 64, True, False, True): (2, 16, 3, 4), + (512, 512, 1024, 128, 128, False, True, True): (2, 8, 2, 8), + (512, 512, 1024, 128, 128, True, False, True): (3, 8, 2, 8), + (512, 512, 2048, 16, 16, False, True, True): (4, 16, 3, 2), + (512, 512, 2048, 16, 16, True, False, True): (1, 16, 4, 2), + (512, 512, 2048, 32, 32, False, True, True): (3, 32, 3, 2), + (512, 512, 2048, 32, 32, True, False, True): (2, 32, 3, 2), + (512, 512, 2048, 64, 64, False, True, True): (6, 32, 3, 2), + (512, 512, 2048, 64, 64, True, False, True): (1, 32, 3, 2), + (512, 512, 2048, 128, 128, False, True, True): (4, 16, 2, 8), + (512, 512, 2048, 128, 128, True, False, True): (1, 16, 2, 8), + (512, 512, 4096, 16, 16, False, True, True): (1, 16, 3, 2), + (512, 512, 4096, 16, 16, True, False, True): (4, 32, 3, 2), + (512, 512, 4096, 32, 32, False, True, True): (3, 32, 3, 2), + (512, 512, 4096, 32, 32, True, False, True): (2, 32, 3, 2), + (512, 512, 4096, 64, 64, False, True, True): (1, 32, 3, 4), + (512, 512, 4096, 64, 64, True, False, True): (1, 64, 3, 4), + (512, 512, 4096, 128, 128, False, True, True): (4, 32, 1, 4), + (512, 512, 4096, 128, 128, True, False, True): (4, 32, 2, 8), + (512, 512, 8192, 16, 16, False, True, True): (8, 64, 3, 2), + (512, 512, 8192, 16, 16, True, False, True): (4, 64, 3, 2), + (512, 512, 8192, 32, 32, False, True, True): (3, 64, 3, 2), + (512, 512, 8192, 32, 32, True, False, True): (3, 64, 3, 2), + (512, 512, 8192, 64, 64, False, True, True): (1, 64, 3, 4), + (512, 512, 8192, 64, 64, True, False, True): (7, 64, 3, 4), + (512, 512, 8192, 128, 128, False, True, True): (1, 64, 1, 4), + (512, 512, 8192, 128, 128, True, False, True): (4, 64, 2, 8), + (512, 512, 16384, 16, 16, False, True, True): (1, 64, 3, 2), + (512, 512, 16384, 16, 16, True, False, True): (1, 128, 3, 2), + (512, 512, 16384, 32, 32, False, True, True): (3, 128, 3, 2), + (512, 512, 16384, 32, 32, True, False, True): (1, 128, 3, 2), + (512, 512, 16384, 64, 64, False, True, True): (4, 64, 2, 4), + (512, 512, 16384, 64, 64, True, False, True): (2, 64, 2, 4), + (512, 512, 16384, 128, 128, False, True, True): (4, 128, 1, 4), + (512, 512, 16384, 128, 128, True, False, True): (2, 128, 1, 4), + (512, 512, 32768, 16, 16, False, True, True): (1, 128, 3, 2), + (512, 512, 32768, 16, 16, True, False, True): (1, 128, 3, 2), + (512, 512, 32768, 32, 32, False, True, True): (1, 256, 3, 2), + (512, 512, 32768, 32, 32, True, False, True): (1, 256, 3, 2), + (512, 512, 32768, 64, 64, False, True, True): (1, 256, 3, 4), + (512, 512, 32768, 64, 64, True, False, True): (2, 256, 3, 4), + (512, 512, 32768, 128, 128, False, True, True): (5, 256, 1, 4), + (512, 512, 32768, 128, 128, True, False, True): (4, 256, 1, 4), + (512, 512, 65536, 16, 16, False, True, True): (1, 256, 3, 2), + (512, 512, 65536, 16, 16, True, False, True): (1, 256, 3, 1), + (512, 512, 65536, 32, 32, False, True, True): (1, 512, 3, 2), + (512, 512, 65536, 32, 32, True, False, True): (1, 512, 3, 2), + (512, 512, 65536, 64, 64, False, True, True): (4, 256, 2, 4), + (512, 512, 65536, 64, 64, True, False, True): (2, 512, 3, 4), + (512, 512, 65536, 128, 128, False, True, True): (6, 512, 1, 4), + (512, 512, 65536, 128, 128, True, False, True): (4, 512, 1, 4), + (512, 512, 131072, 16, 16, False, True, True): (1, 512, 3, 2), + (512, 512, 131072, 16, 16, True, False, True): (1, 512, 3, 1), + (512, 512, 131072, 32, 32, False, True, True): (1, 1024, 3, 2), + (512, 512, 131072, 32, 32, True, False, True): (1, 1024, 3, 2), + (512, 512, 131072, 64, 64, False, True, True): (4, 512, 2, 4), + (512, 512, 131072, 64, 64, True, False, True): (4, 1024, 3, 4), + (512, 512, 131072, 128, 128, False, True, True): (6, 1024, 1, 4), + (512, 512, 131072, 128, 128, True, False, True): (4, 1024, 1, 4), + (1024, 1024, 256, 16, 16, False, True, True): (1, 4, 5, 4), + (1024, 1024, 256, 16, 16, True, False, True): (3, 4, 4, 4), + (1024, 1024, 256, 32, 32, False, True, True): (4, 4, 5, 2), + (1024, 1024, 256, 32, 32, True, False, True): (3, 4, 5, 2), + (1024, 1024, 256, 64, 64, False, True, True): (1, 4, 5, 4), + (1024, 1024, 256, 64, 64, True, False, True): (1, 4, 5, 4), + (1024, 1024, 256, 128, 128, False, True, True): (1, 2, 2, 8), + (1024, 1024, 256, 128, 128, True, False, True): (2, 2, 2, 8), + (1024, 1024, 512, 16, 16, False, True, True): (3, 4, 4, 4), + (1024, 1024, 512, 16, 16, True, False, True): (4, 8, 5, 2), + (1024, 1024, 512, 32, 32, False, True, True): (1, 8, 4, 2), + (1024, 1024, 512, 32, 32, True, False, True): (1, 8, 4, 2), + (1024, 1024, 512, 64, 64, False, True, True): (4, 8, 4, 4), + (1024, 1024, 512, 64, 64, True, False, True): (2, 8, 3, 4), + (1024, 1024, 512, 128, 128, False, True, True): (2, 4, 2, 8), + (1024, 1024, 512, 128, 128, True, False, True): (1, 4, 2, 8), + (1024, 1024, 1024, 16, 16, False, True, True): (3, 8, 4, 4), + (1024, 1024, 1024, 16, 16, True, False, True): (4, 8, 4, 2), + (1024, 1024, 1024, 32, 32, False, True, True): (1, 16, 3, 2), + (1024, 1024, 1024, 32, 32, True, False, True): (1, 16, 3, 2), + (1024, 1024, 1024, 64, 64, False, True, True): (1, 16, 3, 4), + (1024, 1024, 1024, 64, 64, True, False, True): (3, 16, 3, 2), + (1024, 1024, 1024, 128, 128, False, True, True): (1, 8, 2, 8), + (1024, 1024, 1024, 128, 128, True, False, True): (2, 8, 2, 8), + (1024, 1024, 2048, 16, 16, False, True, True): (3, 8, 3, 4), + (1024, 1024, 2048, 16, 16, True, False, True): (3, 8, 3, 2), + (1024, 1024, 2048, 32, 32, False, True, True): (5, 16, 3, 4), + (1024, 1024, 2048, 32, 32, True, False, True): (1, 16, 3, 2), + (1024, 1024, 2048, 64, 64, False, True, True): (6, 16, 4, 4), + (1024, 1024, 2048, 64, 64, True, False, True): (5, 16, 3, 4), + (1024, 1024, 2048, 128, 128, False, True, True): (4, 16, 2, 8), + (1024, 1024, 2048, 128, 128, True, False, True): (4, 16, 2, 8), + (1024, 1024, 4096, 16, 16, False, True, True): (8, 32, 3, 2), + (1024, 1024, 4096, 16, 16, True, False, True): (4, 32, 3, 2), + (1024, 1024, 4096, 32, 32, False, True, True): (2, 32, 3, 4), + (1024, 1024, 4096, 32, 32, True, False, True): (3, 32, 3, 2), + (1024, 1024, 4096, 64, 64, False, True, True): (3, 32, 3, 4), + (1024, 1024, 4096, 64, 64, True, False, True): (1, 32, 3, 4), + (1024, 1024, 4096, 128, 128, False, True, True): (4, 32, 2, 8), + (1024, 1024, 4096, 128, 128, True, False, True): (1, 32, 2, 8), + (1024, 1024, 8192, 16, 16, False, True, True): (4, 64, 3, 2), + (1024, 1024, 8192, 16, 16, True, False, True): (4, 64, 3, 2), + (1024, 1024, 8192, 32, 32, False, True, True): (8, 64, 3, 4), + (1024, 1024, 8192, 32, 32, True, False, True): (4, 32, 3, 4), + (1024, 1024, 8192, 64, 64, False, True, True): (4, 64, 3, 4), + (1024, 1024, 8192, 64, 64, True, False, True): (2, 64, 3, 4), + (1024, 1024, 8192, 128, 128, False, True, True): (4, 64, 2, 8), + (1024, 1024, 8192, 128, 128, True, False, True): (4, 64, 1, 4), + (1024, 1024, 16384, 16, 16, False, True, True): (1, 64, 3, 2), + (1024, 1024, 16384, 16, 16, True, False, True): (1, 64, 3, 2), + (1024, 1024, 16384, 32, 32, False, True, True): (1, 128, 3, 2), + (1024, 1024, 16384, 32, 32, True, False, True): (1, 64, 3, 4), + (1024, 1024, 16384, 64, 64, False, True, True): (1, 128, 3, 4), + (1024, 1024, 16384, 64, 64, True, False, True): (1, 128, 3, 4), + (1024, 1024, 16384, 128, 128, False, True, True): (2, 128, 1, 4), + (1024, 1024, 16384, 128, 128, True, False, True): (4, 128, 1, 4), + (1024, 1024, 32768, 16, 16, False, True, True): (1, 128, 3, 2), + (1024, 1024, 32768, 16, 16, True, False, True): (1, 128, 3, 2), + (1024, 1024, 32768, 32, 32, False, True, True): (1, 256, 3, 2), + (1024, 1024, 32768, 32, 32, True, False, True): (1, 128, 3, 4), + (1024, 1024, 32768, 64, 64, False, True, True): (2, 128, 2, 4), + (1024, 1024, 32768, 64, 64, True, False, True): (1, 256, 3, 4), + (1024, 1024, 32768, 128, 128, False, True, True): (2, 256, 1, 4), + (1024, 1024, 32768, 128, 128, True, False, True): (4, 256, 1, 4), + (1024, 1024, 65536, 16, 16, False, True, True): (1, 256, 3, 4), + (1024, 1024, 65536, 16, 16, True, False, True): (1, 256, 3, 4), + (1024, 1024, 65536, 32, 32, False, True, True): (9, 256, 3, 4), + (1024, 1024, 65536, 32, 32, True, False, True): (7, 256, 3, 4), + (1024, 1024, 65536, 64, 64, False, True, True): (2, 256, 2, 4), + (1024, 1024, 65536, 64, 64, True, False, True): (2, 512, 3, 4), + (1024, 1024, 65536, 128, 128, False, True, True): (2, 512, 1, 4), + (1024, 1024, 65536, 128, 128, True, False, True): (4, 512, 1, 4), + (1024, 1024, 131072, 16, 16, False, True, True): (11, 512, 3, 2), + (1024, 1024, 131072, 16, 16, True, False, True): (11, 512, 3, 2), + (1024, 1024, 131072, 32, 32, False, True, True): (4, 512, 3, 4), + (1024, 1024, 131072, 32, 32, True, False, True): (6, 512, 3, 4), + (1024, 1024, 131072, 64, 64, False, True, True): (2, 512, 2, 4), + (1024, 1024, 131072, 64, 64, True, False, True): (2, 1024, 3, 4), + (1024, 1024, 131072, 128, 128, False, True, True): (4, 1024, 1, 4), + (1024, 1024, 131072, 128, 128, True, False, True): (4, 1024, 1, 4), + (2048, 2048, 256, 16, 16, False, True, True): (1, 4, 5, 2), + (2048, 2048, 256, 16, 16, True, False, True): (4, 4, 5, 2), + (2048, 2048, 256, 32, 32, False, True, True): (3, 4, 6, 2), + (2048, 2048, 256, 32, 32, True, False, True): (2, 4, 5, 2), + (2048, 2048, 256, 64, 64, False, True, True): (2, 4, 4, 4), + (2048, 2048, 256, 64, 64, True, False, True): (2, 4, 3, 4), + (2048, 2048, 256, 128, 128, False, True, True): (3, 2, 2, 8), + (2048, 2048, 256, 128, 128, True, False, True): (3, 2, 2, 8), + (2048, 2048, 512, 16, 16, False, True, True): (3, 4, 4, 4), + (2048, 2048, 512, 16, 16, True, False, True): (1, 4, 4, 4), + (2048, 2048, 512, 32, 32, False, True, True): (1, 4, 3, 4), + (2048, 2048, 512, 32, 32, True, False, True): (1, 4, 4, 2), + (2048, 2048, 512, 64, 64, False, True, True): (1, 8, 3, 4), + (2048, 2048, 512, 64, 64, True, False, True): (1, 8, 3, 4), + (2048, 2048, 512, 128, 128, False, True, True): (3, 4, 2, 8), + (2048, 2048, 512, 128, 128, True, False, True): (2, 4, 2, 8), + (2048, 2048, 1024, 16, 16, False, True, True): (3, 4, 3, 4), + (2048, 2048, 1024, 16, 16, True, False, True): (4, 8, 3, 2), + (2048, 2048, 1024, 32, 32, False, True, True): (3, 8, 3, 4), + (2048, 2048, 1024, 32, 32, True, False, True): (1, 8, 3, 2), + (2048, 2048, 1024, 64, 64, False, True, True): (1, 8, 3, 4), + (2048, 2048, 1024, 64, 64, True, False, True): (1, 8, 3, 4), + (2048, 2048, 1024, 128, 128, False, True, True): (4, 8, 1, 4), + (2048, 2048, 1024, 128, 128, True, False, True): (2, 8, 1, 4), + (2048, 2048, 2048, 16, 16, False, True, True): (4, 16, 3, 2), + (2048, 2048, 2048, 16, 16, True, False, True): (4, 16, 3, 2), + (2048, 2048, 2048, 32, 32, False, True, True): (1, 16, 3, 2), + (2048, 2048, 2048, 32, 32, True, False, True): (1, 16, 3, 2), + (2048, 2048, 2048, 64, 64, False, True, True): (4, 16, 3, 4), + (2048, 2048, 2048, 64, 64, True, False, True): (4, 16, 3, 4), + (2048, 2048, 2048, 128, 128, False, True, True): (6, 16, 2, 8), + (2048, 2048, 2048, 128, 128, True, False, True): (3, 16, 1, 4), + (2048, 2048, 4096, 16, 16, False, True, True): (4, 32, 4, 2), + (2048, 2048, 4096, 16, 16, True, False, True): (4, 32, 3, 2), + (2048, 2048, 4096, 32, 32, False, True, True): (4, 16, 3, 8), + (2048, 2048, 4096, 32, 32, True, False, True): (4, 16, 3, 8), + (2048, 2048, 4096, 64, 64, False, True, True): (1, 32, 3, 4), + (2048, 2048, 4096, 64, 64, True, False, True): (3, 32, 3, 4), + (2048, 2048, 4096, 128, 128, False, True, True): (2, 32, 1, 4), + (2048, 2048, 4096, 128, 128, True, False, True): (2, 32, 1, 4), + (2048, 2048, 8192, 16, 16, False, True, True): (4, 64, 4, 2), + (2048, 2048, 8192, 16, 16, True, False, True): (4, 64, 4, 2), + (2048, 2048, 8192, 32, 32, False, True, True): (4, 32, 4, 8), + (2048, 2048, 8192, 32, 32, True, False, True): (4, 32, 3, 8), + (2048, 2048, 8192, 64, 64, False, True, True): (4, 64, 3, 4), + (2048, 2048, 8192, 64, 64, True, False, True): (4, 64, 3, 4), + (2048, 2048, 8192, 128, 128, False, True, True): (2, 64, 1, 4), + (2048, 2048, 8192, 128, 128, True, False, True): (2, 64, 1, 4), + (2048, 2048, 16384, 16, 16, False, True, True): (4, 64, 3, 2), + (2048, 2048, 16384, 16, 16, True, False, True): (1, 64, 3, 2), + (2048, 2048, 16384, 32, 32, False, True, True): (4, 64, 3, 4), + (2048, 2048, 16384, 32, 32, True, False, True): (4, 64, 3, 4), + (2048, 2048, 16384, 64, 64, False, True, True): (4, 128, 3, 4), + (2048, 2048, 16384, 64, 64, True, False, True): (4, 128, 3, 4), + (2048, 2048, 16384, 128, 128, False, True, True): (2, 128, 1, 4), + (2048, 2048, 16384, 128, 128, True, False, True): (2, 128, 1, 4), + (2048, 2048, 32768, 16, 16, False, True, True): (8, 128, 3, 2), + (2048, 2048, 32768, 16, 16, True, False, True): (8, 128, 3, 4), + (2048, 2048, 32768, 32, 32, False, True, True): (8, 128, 3, 4), + (2048, 2048, 32768, 32, 32, True, False, True): (8, 128, 3, 4), + (2048, 2048, 32768, 64, 64, False, True, True): (1, 128, 2, 4), + (2048, 2048, 32768, 64, 64, True, False, True): (8, 256, 3, 4), + (2048, 2048, 32768, 128, 128, False, True, True): (2, 256, 1, 4), + (2048, 2048, 32768, 128, 128, True, False, True): (2, 256, 1, 4), + (2048, 2048, 65536, 16, 16, False, True, True): (9, 256, 4, 4), + (2048, 2048, 65536, 16, 16, True, False, True): (7, 256, 4, 4), + (2048, 2048, 65536, 32, 32, False, True, True): (7, 256, 3, 4), + (2048, 2048, 65536, 32, 32, True, False, True): (3, 256, 3, 4), + (2048, 2048, 65536, 64, 64, False, True, True): (2, 256, 2, 4), + (2048, 2048, 65536, 64, 64, True, False, True): (6, 512, 3, 4), + (2048, 2048, 65536, 128, 128, False, True, True): (2, 512, 1, 4), + (2048, 2048, 65536, 128, 128, True, False, True): (2, 512, 1, 4), + (2048, 2048, 131072, 16, 16, False, True, True): (9, 512, 4, 4), + (2048, 2048, 131072, 16, 16, True, False, True): (9, 512, 4, 4), + (2048, 2048, 131072, 32, 32, False, True, True): (7, 512, 4, 4), + (2048, 2048, 131072, 32, 32, True, False, True): (3, 512, 3, 4), + (2048, 2048, 131072, 64, 64, False, True, True): (2, 512, 2, 4), + (2048, 2048, 131072, 64, 64, True, False, True): (4, 1024, 3, 4), + (2048, 2048, 131072, 128, 128, False, True, True): (1, 1024, 1, 4), + (2048, 2048, 131072, 128, 128, True, False, True): (2, 1024, 1, 4), + (4096, 4096, 256, 16, 16, False, True, True): (2, 2, 5, 4), + (4096, 4096, 256, 16, 16, True, False, True): (2, 2, 4, 2), + (4096, 4096, 256, 32, 32, False, True, True): (1, 2, 4, 4), + (4096, 4096, 256, 32, 32, True, False, True): (3, 2, 4, 2), + (4096, 4096, 256, 64, 64, False, True, True): (3, 4, 3, 4), + (4096, 4096, 256, 64, 64, True, False, True): (1, 4, 3, 2), + (4096, 4096, 256, 128, 128, False, True, True): (1, 2, 2, 8), + (4096, 4096, 256, 128, 128, True, False, True): (1, 2, 2, 8), + (4096, 4096, 512, 16, 16, False, True, True): (4, 2, 3, 4), + (4096, 4096, 512, 16, 16, True, False, True): (1, 2, 3, 4), + (4096, 4096, 512, 32, 32, False, True, True): (1, 4, 3, 4), + (4096, 4096, 512, 32, 32, True, False, True): (3, 4, 3, 2), + (4096, 4096, 512, 64, 64, False, True, True): (4, 4, 4, 4), + (4096, 4096, 512, 64, 64, True, False, True): (3, 4, 3, 4), + (4096, 4096, 512, 128, 128, False, True, True): (2, 4, 2, 8), + (4096, 4096, 512, 128, 128, True, False, True): (2, 4, 1, 4), + (4096, 4096, 1024, 16, 16, False, True, True): (2, 8, 3, 2), + (4096, 4096, 1024, 16, 16, True, False, True): (2, 8, 3, 2), + (4096, 4096, 1024, 32, 32, False, True, True): (1, 8, 3, 4), + (4096, 4096, 1024, 32, 32, True, False, True): (1, 8, 3, 2), + (4096, 4096, 1024, 64, 64, False, True, True): (1, 8, 3, 4), + (4096, 4096, 1024, 64, 64, True, False, True): (1, 8, 3, 4), + (4096, 4096, 1024, 128, 128, False, True, True): (4, 8, 1, 4), + (4096, 4096, 1024, 128, 128, True, False, True): (2, 8, 2, 8), + (4096, 4096, 2048, 16, 16, False, True, True): (2, 8, 4, 4), + (4096, 4096, 2048, 16, 16, True, False, True): (2, 8, 4, 4), + (4096, 4096, 2048, 32, 32, False, True, True): (4, 8, 3, 8), + (4096, 4096, 2048, 32, 32, True, False, True): (4, 8, 4, 8), + (4096, 4096, 2048, 64, 64, False, True, True): (4, 16, 3, 4), + (4096, 4096, 2048, 64, 64, True, False, True): (4, 16, 3, 4), + (4096, 4096, 2048, 128, 128, False, True, True): (1, 16, 1, 4), + (4096, 4096, 2048, 128, 128, True, False, True): (4, 16, 1, 4), + (4096, 4096, 4096, 16, 16, False, True, True): (4, 32, 4, 4), + (4096, 4096, 4096, 16, 16, True, False, True): (2, 32, 4, 4), + (4096, 4096, 4096, 32, 32, False, True, True): (4, 16, 4, 8), + (4096, 4096, 4096, 32, 32, True, False, True): (4, 16, 4, 8), + (4096, 4096, 4096, 64, 64, False, True, True): (4, 32, 3, 4), + (4096, 4096, 4096, 64, 64, True, False, True): (2, 32, 3, 4), + (4096, 4096, 4096, 128, 128, False, True, True): (2, 32, 1, 4), + (4096, 4096, 4096, 128, 128, True, False, True): (2, 32, 1, 4), + (4096, 4096, 8192, 16, 16, False, True, True): (4, 64, 4, 2), + (4096, 4096, 8192, 16, 16, True, False, True): (4, 64, 4, 2), + (4096, 4096, 8192, 32, 32, False, True, True): (4, 32, 4, 8), + (4096, 4096, 8192, 32, 32, True, False, True): (4, 32, 4, 8), + (4096, 4096, 8192, 64, 64, False, True, True): (4, 64, 3, 4), + (4096, 4096, 8192, 64, 64, True, False, True): (4, 64, 3, 4), + (4096, 4096, 8192, 128, 128, False, True, True): (1, 64, 1, 4), + (4096, 4096, 8192, 128, 128, True, False, True): (1, 64, 1, 4), + (4096, 4096, 16384, 16, 16, False, True, True): (4, 64, 4, 4), + (4096, 4096, 16384, 16, 16, True, False, True): (4, 64, 4, 4), + (4096, 4096, 16384, 32, 32, False, True, True): (4, 64, 4, 8), + (4096, 4096, 16384, 32, 32, True, False, True): (4, 64, 4, 8), + (4096, 4096, 16384, 64, 64, False, True, True): (4, 128, 3, 4), + (4096, 4096, 16384, 64, 64, True, False, True): (4, 128, 3, 4), + (4096, 4096, 16384, 128, 128, False, True, True): (1, 128, 1, 4), + (4096, 4096, 16384, 128, 128, True, False, True): (1, 128, 1, 4), + (4096, 4096, 32768, 16, 16, False, True, True): (8, 128, 4, 4), + (4096, 4096, 32768, 16, 16, True, False, True): (5, 128, 4, 4), + (4096, 4096, 32768, 32, 32, False, True, True): (5, 128, 4, 4), + (4096, 4096, 32768, 32, 32, True, False, True): (3, 128, 4, 8), + (4096, 4096, 32768, 64, 64, False, True, True): (3, 256, 3, 4), + (4096, 4096, 32768, 64, 64, True, False, True): (2, 256, 3, 4), + (4096, 4096, 32768, 128, 128, False, True, True): (1, 256, 1, 4), + (4096, 4096, 32768, 128, 128, True, False, True): (1, 256, 1, 4), + (4096, 4096, 65536, 16, 16, False, True, True): (5, 256, 4, 4), + (4096, 4096, 65536, 16, 16, True, False, True): (5, 256, 4, 4), + (4096, 4096, 65536, 32, 32, False, True, True): (4, 256, 4, 8), + (4096, 4096, 65536, 32, 32, True, False, True): (4, 256, 4, 8), + (4096, 4096, 65536, 64, 64, False, True, True): (1, 512, 3, 4), + (4096, 4096, 65536, 64, 64, True, False, True): (3, 512, 3, 4), + (4096, 4096, 65536, 128, 128, False, True, True): (1, 512, 1, 4), + (4096, 4096, 65536, 128, 128, True, False, True): (1, 512, 1, 4), + (4096, 4096, 131072, 16, 16, False, True, True): (5, 512, 4, 4), + (4096, 4096, 131072, 16, 16, True, False, True): (5, 512, 4, 4), + (4096, 4096, 131072, 32, 32, False, True, True): (4, 512, 4, 4), + (4096, 4096, 131072, 32, 32, True, False, True): (2, 512, 3, 4), + (4096, 4096, 131072, 64, 64, False, True, True): (1, 1024, 3, 4), + (4096, 4096, 131072, 64, 64, True, False, True): (3, 1024, 3, 4), + (4096, 4096, 131072, 128, 128, False, True, True): (1, 1024, 1, 4), + (4096, 4096, 131072, 128, 128, True, False, True): (1, 1024, 1, 4), + (8192, 8192, 256, 16, 16, False, True, True): (1, 1, 3, 4), + (8192, 8192, 256, 16, 16, True, False, True): (4, 1, 3, 4), + (8192, 8192, 256, 32, 32, False, True, True): (1, 2, 3, 4), + (8192, 8192, 256, 32, 32, True, False, True): (1, 2, 3, 4), + (8192, 8192, 256, 64, 64, False, True, True): (6, 2, 3, 8), + (8192, 8192, 256, 64, 64, True, False, True): (4, 2, 3, 8), + (8192, 8192, 256, 128, 128, False, True, True): (1, 2, 1, 4), + (8192, 8192, 256, 128, 128, True, False, True): (1, 2, 1, 4), + (8192, 8192, 512, 16, 16, False, True, True): (4, 4, 3, 2), + (8192, 8192, 512, 16, 16, True, False, True): (4, 4, 3, 4), + (8192, 8192, 512, 32, 32, False, True, True): (1, 4, 3, 4), + (8192, 8192, 512, 32, 32, True, False, True): (3, 4, 3, 2), + (8192, 8192, 512, 64, 64, False, True, True): (1, 4, 3, 4), + (8192, 8192, 512, 64, 64, True, False, True): (1, 4, 3, 4), + (8192, 8192, 512, 128, 128, False, True, True): (4, 4, 2, 8), + (8192, 8192, 512, 128, 128, True, False, True): (4, 4, 2, 8), + (8192, 8192, 1024, 16, 16, False, True, True): (4, 8, 4, 4), + (8192, 8192, 1024, 16, 16, True, False, True): (2, 8, 4, 4), + (8192, 8192, 1024, 32, 32, False, True, True): (2, 4, 4, 8), + (8192, 8192, 1024, 32, 32, True, False, True): (1, 4, 3, 4), + (8192, 8192, 1024, 64, 64, False, True, True): (4, 8, 3, 4), + (8192, 8192, 1024, 64, 64, True, False, True): (2, 8, 3, 4), + (8192, 8192, 1024, 128, 128, False, True, True): (4, 8, 1, 4), + (8192, 8192, 1024, 128, 128, True, False, True): (4, 8, 1, 4), + (8192, 8192, 2048, 16, 16, False, True, True): (2, 8, 4, 4), + (8192, 8192, 2048, 16, 16, True, False, True): (2, 8, 4, 4), + (8192, 8192, 2048, 32, 32, False, True, True): (2, 8, 4, 8), + (8192, 8192, 2048, 32, 32, True, False, True): (2, 8, 4, 8), + (8192, 8192, 2048, 64, 64, False, True, True): (4, 8, 2, 4), + (8192, 8192, 2048, 64, 64, True, False, True): (4, 16, 3, 4), + (8192, 8192, 2048, 128, 128, False, True, True): (4, 16, 1, 4), + (8192, 8192, 2048, 128, 128, True, False, True): (4, 16, 1, 4), + (8192, 8192, 4096, 16, 16, False, True, True): (4, 16, 4, 4), + (8192, 8192, 4096, 16, 16, True, False, True): (4, 32, 4, 2), + (8192, 8192, 4096, 32, 32, False, True, True): (2, 16, 4, 8), + (8192, 8192, 4096, 32, 32, True, False, True): (2, 16, 4, 8), + (8192, 8192, 4096, 64, 64, False, True, True): (4, 32, 3, 4), + (8192, 8192, 4096, 64, 64, True, False, True): (4, 16, 2, 4), + (8192, 8192, 4096, 128, 128, False, True, True): (4, 32, 1, 4), + (8192, 8192, 4096, 128, 128, True, False, True): (4, 32, 1, 4), + (8192, 8192, 8192, 16, 16, False, True, True): (4, 64, 4, 2), + (8192, 8192, 8192, 16, 16, True, False, True): (4, 64, 4, 2), + (8192, 8192, 8192, 32, 32, False, True, True): (2, 32, 4, 8), + (8192, 8192, 8192, 32, 32, True, False, True): (2, 32, 4, 8), + (8192, 8192, 8192, 64, 64, False, True, True): (4, 32, 3, 8), + (8192, 8192, 8192, 64, 64, True, False, True): (4, 32, 2, 4), + (8192, 8192, 8192, 128, 128, False, True, True): (4, 64, 1, 4), + (8192, 8192, 8192, 128, 128, True, False, True): (4, 64, 1, 4), + (8192, 8192, 16384, 16, 16, False, True, True): (4, 64, 4, 4), + (8192, 8192, 16384, 16, 16, True, False, True): (4, 64, 4, 4), + (8192, 8192, 16384, 32, 32, False, True, True): (4, 64, 3, 4), + (8192, 8192, 16384, 32, 32, True, False, True): (4, 64, 4, 8), + (8192, 8192, 16384, 64, 64, False, True, True): (4, 64, 2, 4), + (8192, 8192, 16384, 64, 64, True, False, True): (4, 64, 2, 4), + (8192, 8192, 16384, 128, 128, False, True, True): (4, 128, 1, 4), + (8192, 8192, 16384, 128, 128, True, False, True): (4, 128, 1, 4), + (8192, 8192, 32768, 16, 16, False, True, True): (3, 128, 4, 4), + (8192, 8192, 32768, 16, 16, True, False, True): (3, 128, 4, 4), + (8192, 8192, 32768, 32, 32, False, True, True): (2, 128, 4, 8), + (8192, 8192, 32768, 32, 32, True, False, True): (2, 128, 4, 8), + (8192, 8192, 32768, 64, 64, False, True, True): (2, 128, 2, 4), + (8192, 8192, 32768, 64, 64, True, False, True): (2, 128, 2, 4), + (8192, 8192, 32768, 128, 128, False, True, True): (4, 256, 1, 4), + (8192, 8192, 32768, 128, 128, True, False, True): (4, 256, 1, 4), + (8192, 8192, 65536, 16, 16, False, True, True): (3, 256, 4, 4), + (8192, 8192, 65536, 16, 16, True, False, True): (3, 256, 4, 4), + (8192, 8192, 65536, 32, 32, False, True, True): (2, 256, 3, 4), + (8192, 8192, 65536, 32, 32, True, False, True): (2, 256, 3, 4), + (8192, 8192, 65536, 64, 64, False, True, True): (2, 256, 2, 4), + (8192, 8192, 65536, 64, 64, True, False, True): (2, 256, 3, 8), + (8192, 8192, 65536, 128, 128, False, True, True): (4, 512, 1, 4), + (8192, 8192, 65536, 128, 128, True, False, True): (4, 512, 1, 4), + (8192, 8192, 131072, 16, 16, False, True, True): (3, 512, 4, 4), + (8192, 8192, 131072, 16, 16, True, False, True): (3, 512, 4, 4), + (8192, 8192, 131072, 32, 32, False, True, True): (2, 512, 4, 4), + (8192, 8192, 131072, 32, 32, True, False, True): (2, 512, 3, 4), + (8192, 8192, 131072, 64, 64, False, True, True): (4, 512, 2, 4), + (8192, 8192, 131072, 64, 64, True, False, True): (2, 512, 2, 4), + (8192, 8192, 131072, 128, 128, False, True, True): (4, 1024, 1, 4), + (8192, 8192, 131072, 128, 128, True, False, True): (4, 1024, 1, 4), + (16384, 16384, 256, 16, 16, False, True, True): (2, 2, 6, 4), + (16384, 16384, 256, 16, 16, True, False, True): (2, 2, 6, 4), + (16384, 16384, 256, 32, 32, False, True, True): (4, 2, 3, 2), + (16384, 16384, 256, 32, 32, True, False, True): (4, 2, 3, 2), + (16384, 16384, 256, 64, 64, False, True, True): (2, 2, 4, 4), + (16384, 16384, 256, 64, 64, True, False, True): (4, 2, 3, 8), + (16384, 16384, 256, 128, 128, False, True, True): (4, 2, 2, 8), + (16384, 16384, 256, 128, 128, True, False, True): (4, 2, 2, 8), + (16384, 16384, 512, 16, 16, False, True, True): (1, 2, 4, 4), + (16384, 16384, 512, 16, 16, True, False, True): (1, 2, 4, 4), + (16384, 16384, 512, 32, 32, False, True, True): (2, 2, 4, 8), + (16384, 16384, 512, 32, 32, True, False, True): (2, 2, 4, 8), + (16384, 16384, 512, 64, 64, False, True, True): (4, 4, 3, 4), + (16384, 16384, 512, 64, 64, True, False, True): (4, 4, 3, 4), + (16384, 16384, 512, 128, 128, False, True, True): (4, 4, 2, 8), + (16384, 16384, 512, 128, 128, True, False, True): (4, 4, 2, 8), + (16384, 16384, 1024, 16, 16, False, True, True): (3, 4, 4, 4), + (16384, 16384, 1024, 16, 16, True, False, True): (2, 8, 4, 4), + (16384, 16384, 1024, 32, 32, False, True, True): (2, 4, 4, 8), + (16384, 16384, 1024, 32, 32, True, False, True): (1, 4, 4, 8), + (16384, 16384, 1024, 64, 64, False, True, True): (2, 8, 3, 4), + (16384, 16384, 1024, 64, 64, True, False, True): (2, 8, 3, 4), + (16384, 16384, 1024, 128, 128, False, True, True): (4, 8, 1, 4), + (16384, 16384, 1024, 128, 128, True, False, True): (4, 8, 1, 4), + (16384, 16384, 2048, 16, 16, False, True, True): (2, 8, 4, 4), + (16384, 16384, 2048, 16, 16, True, False, True): (2, 8, 4, 4), + (16384, 16384, 2048, 32, 32, False, True, True): (1, 8, 4, 8), + (16384, 16384, 2048, 32, 32, True, False, True): (2, 8, 4, 8), + (16384, 16384, 2048, 64, 64, False, True, True): (2, 8, 2, 4), + (16384, 16384, 2048, 64, 64, True, False, True): (2, 8, 2, 4), + (16384, 16384, 2048, 128, 128, False, True, True): (4, 16, 1, 4), + (16384, 16384, 2048, 128, 128, True, False, True): (4, 16, 1, 4), + (16384, 16384, 4096, 16, 16, False, True, True): (2, 16, 4, 4), + (16384, 16384, 4096, 16, 16, True, False, True): (2, 16, 4, 4), + (16384, 16384, 4096, 32, 32, False, True, True): (1, 8, 3, 8), + (16384, 16384, 4096, 32, 32, True, False, True): (2, 16, 3, 4), + (16384, 16384, 4096, 64, 64, False, True, True): (2, 16, 2, 4), + (16384, 16384, 4096, 64, 64, True, False, True): (2, 16, 2, 4), + (16384, 16384, 4096, 128, 128, False, True, True): (4, 32, 1, 4), + (16384, 16384, 4096, 128, 128, True, False, True): (4, 32, 1, 4), + (16384, 16384, 8192, 16, 16, False, True, True): (4, 64, 4, 2), + (16384, 16384, 8192, 16, 16, True, False, True): (4, 64, 4, 2), + (16384, 16384, 8192, 32, 32, False, True, True): (2, 32, 4, 8), + (16384, 16384, 8192, 32, 32, True, False, True): (2, 32, 3, 4), + (16384, 16384, 8192, 64, 64, False, True, True): (2, 32, 4, 8), + (16384, 16384, 8192, 64, 64, True, False, True): (2, 32, 3, 8), + (16384, 16384, 8192, 128, 128, False, True, True): (4, 64, 1, 4), + (16384, 16384, 8192, 128, 128, True, False, True): (4, 64, 1, 4), + (16384, 16384, 16384, 16, 16, False, True, True): (1, 64, 4, 4), + (16384, 16384, 16384, 16, 16, True, False, True): (1, 64, 4, 4), + (16384, 16384, 16384, 32, 32, False, True, True): (1, 64, 3, 8), + (16384, 16384, 16384, 32, 32, True, False, True): (1, 64, 3, 4), + (16384, 16384, 16384, 64, 64, False, True, True): (1, 64, 2, 4), + (16384, 16384, 16384, 64, 64, True, False, True): (1, 64, 4, 8), + (16384, 16384, 16384, 128, 128, False, True, True): (4, 128, 1, 4), + (16384, 16384, 16384, 128, 128, True, False, True): (4, 128, 1, 4), + (16384, 16384, 32768, 16, 16, False, True, True): (1, 128, 4, 4), + (16384, 16384, 32768, 16, 16, True, False, True): (1, 128, 4, 4), + (16384, 16384, 32768, 32, 32, False, True, True): (1, 128, 4, 2), + (16384, 16384, 32768, 32, 32, True, False, True): (1, 128, 3, 8), + (16384, 16384, 32768, 64, 64, False, True, True): (2, 128, 2, 4), + (16384, 16384, 32768, 64, 64, True, False, True): (1, 128, 3, 8), + (16384, 16384, 32768, 128, 128, False, True, True): (4, 256, 1, 4), + (16384, 16384, 32768, 128, 128, True, False, True): (4, 256, 1, 4), + (16384, 16384, 65536, 16, 16, False, True, True): (1, 256, 4, 4), + (16384, 16384, 65536, 16, 16, True, False, True): (1, 256, 4, 4), + (16384, 16384, 65536, 32, 32, False, True, True): (1, 256, 3, 4), + (16384, 16384, 65536, 32, 32, True, False, True): (1, 256, 3, 4), + (16384, 16384, 65536, 64, 64, False, True, True): (1, 256, 2, 4), + (16384, 16384, 65536, 64, 64, True, False, True): (2, 256, 2, 4), + (16384, 16384, 65536, 128, 128, False, True, True): (4, 512, 1, 4), + (16384, 16384, 65536, 128, 128, True, False, True): (4, 512, 1, 4), + (16384, 16384, 131072, 16, 16, False, True, True): (2, 512, 4, 4), + (16384, 16384, 131072, 16, 16, True, False, True): (1, 512, 4, 4), + (16384, 16384, 131072, 32, 32, False, True, True): (1, 512, 4, 8), + (16384, 16384, 131072, 32, 32, True, False, True): (1, 512, 3, 4), + (16384, 16384, 131072, 64, 64, False, True, True): (2, 512, 2, 4), + (16384, 16384, 131072, 64, 64, True, False, True): (1, 512, 2, 4), + (16384, 16384, 131072, 128, 128, False, True, True): (4, 1024, 1, 4), + (16384, 16384, 131072, 128, 128, True, False, True): (4, 1024, 1, 4), + }, + ("bsr_dense_addmm", "NVIDIA A100-SXM4-80GB", (0, torch.float16, 0.5)): { + (16, 16, 16, 16, 16, False, False, False): (1, 1, 1, 1), + (16, 16, 16, 16, 16, False, False, True): (1, 1, 2, 2), + (16, 16, 16, 16, 16, False, True, False): (1, 1, 1, 1), + (16, 16, 16, 16, 16, False, True, True): (1, 1, 1, 8), + (16, 16, 16, 16, 16, True, False, False): (3, 1, 3, 4), + (16, 16, 16, 16, 16, True, False, True): (1, 1, 2, 1), + (16, 16, 32, 16, 16, False, False, False): (1, 2, 1, 8), + (16, 16, 32, 16, 16, False, False, True): (1, 2, 1, 2), + (16, 16, 32, 16, 16, False, True, False): (2, 1, 1, 4), + (16, 16, 32, 16, 16, False, True, True): (1, 2, 1, 4), + (16, 16, 32, 16, 16, True, False, False): (1, 1, 1, 4), + (16, 16, 32, 16, 16, True, False, True): (1, 2, 1, 2), + (16, 16, 64, 16, 16, False, False, False): (1, 4, 1, 1), + (16, 16, 64, 16, 16, False, False, True): (1, 2, 2, 4), + (16, 16, 64, 16, 16, False, True, False): (1, 4, 1, 4), + (16, 16, 64, 16, 16, False, True, True): (1, 2, 1, 4), + (16, 16, 64, 16, 16, True, False, False): (1, 4, 1, 2), + (16, 16, 64, 16, 16, True, False, True): (1, 1, 1, 2), + (16, 32, 16, 16, 16, False, False, False): (1, 1, 2, 4), + (16, 32, 16, 16, 16, False, False, True): (1, 1, 1, 4), + (16, 32, 16, 16, 16, False, True, False): (1, 1, 1, 2), + (16, 32, 16, 16, 16, False, True, True): (1, 1, 1, 2), + (16, 32, 16, 16, 16, True, False, False): (1, 1, 2, 16), + (16, 32, 16, 16, 16, True, False, True): (1, 1, 1, 4), + (16, 32, 16, 16, 32, False, False, False): (2, 1, 1, 8), + (16, 32, 16, 16, 32, False, False, True): (2, 1, 1, 8), + (16, 32, 16, 16, 32, False, True, False): (1, 1, 2, 1), + (16, 32, 16, 16, 32, False, True, True): (1, 1, 1, 4), + (16, 32, 16, 16, 32, True, False, False): (2, 1, 1, 8), + (16, 32, 16, 16, 32, True, False, True): (1, 1, 2, 4), + (16, 32, 32, 16, 16, False, False, False): (1, 1, 1, 16), + (16, 32, 32, 16, 16, False, False, True): (1, 2, 1, 2), + (16, 32, 32, 16, 16, False, True, False): (1, 2, 1, 8), + (16, 32, 32, 16, 16, False, True, True): (3, 2, 1, 4), + (16, 32, 32, 16, 16, True, False, False): (1, 2, 1, 4), + (16, 32, 32, 16, 16, True, False, True): (1, 2, 1, 2), + (16, 32, 32, 16, 32, False, False, False): (1, 2, 1, 2), + (16, 32, 32, 16, 32, False, False, True): (1, 1, 1, 4), + (16, 32, 32, 16, 32, False, True, False): (1, 1, 2, 4), + (16, 32, 32, 16, 32, False, True, True): (1, 2, 1, 2), + (16, 32, 32, 16, 32, True, False, False): (1, 2, 1, 2), + (16, 32, 32, 16, 32, True, False, True): (1, 2, 1, 16), + (16, 32, 64, 16, 16, False, False, False): (1, 4, 1, 4), + (16, 32, 64, 16, 16, False, False, True): (2, 4, 1, 4), + (16, 32, 64, 16, 16, False, True, False): (1, 4, 1, 4), + (16, 32, 64, 16, 16, False, True, True): (1, 4, 1, 4), + (16, 32, 64, 16, 16, True, False, False): (3, 4, 1, 2), + (16, 32, 64, 16, 16, True, False, True): (1, 4, 1, 1), + (16, 32, 64, 16, 32, False, False, False): (1, 4, 1, 16), + (16, 32, 64, 16, 32, False, False, True): (1, 2, 1, 2), + (16, 32, 64, 16, 32, False, True, False): (1, 4, 2, 2), + (16, 32, 64, 16, 32, False, True, True): (1, 4, 1, 8), + (16, 32, 64, 16, 32, True, False, False): (1, 4, 1, 8), + (16, 32, 64, 16, 32, True, False, True): (1, 2, 1, 4), + (16, 64, 16, 16, 32, False, False, False): (1, 1, 1, 2), + (16, 64, 16, 16, 32, False, False, True): (1, 1, 1, 4), + (16, 64, 16, 16, 32, False, True, False): (2, 1, 2, 4), + (16, 64, 16, 16, 32, False, True, True): (1, 1, 1, 4), + (16, 64, 16, 16, 32, True, False, False): (1, 1, 1, 4), + (16, 64, 16, 16, 32, True, False, True): (1, 1, 1, 4), + (16, 64, 32, 16, 32, False, False, False): (1, 2, 1, 2), + (16, 64, 32, 16, 32, False, False, True): (1, 1, 1, 4), + (16, 64, 32, 16, 32, False, True, False): (1, 1, 1, 4), + (16, 64, 32, 16, 32, False, True, True): (1, 2, 3, 2), + (16, 64, 32, 16, 32, True, False, False): (1, 1, 1, 4), + (16, 64, 32, 16, 32, True, False, True): (1, 1, 2, 4), + (16, 64, 64, 16, 32, False, False, False): (1, 4, 1, 8), + (16, 64, 64, 16, 32, False, False, True): (1, 4, 1, 4), + (16, 64, 64, 16, 32, False, True, False): (1, 4, 1, 1), + (16, 64, 64, 16, 32, False, True, True): (2, 4, 1, 4), + (16, 64, 64, 16, 32, True, False, False): (1, 4, 1, 4), + (16, 64, 64, 16, 32, True, False, True): (1, 4, 1, 4), + (32, 16, 16, 16, 16, False, False, False): (2, 1, 2, 4), + (32, 16, 16, 16, 16, False, False, True): (2, 1, 1, 2), + (32, 16, 16, 16, 16, False, True, False): (1, 1, 2, 4), + (32, 16, 16, 16, 16, False, True, True): (1, 1, 1, 2), + (32, 16, 16, 16, 16, True, False, False): (1, 1, 1, 4), + (32, 16, 16, 16, 16, True, False, True): (2, 1, 1, 2), + (32, 16, 32, 16, 16, False, False, False): (1, 1, 1, 4), + (32, 16, 32, 16, 16, False, False, True): (1, 1, 1, 4), + (32, 16, 32, 16, 16, False, True, False): (1, 2, 1, 4), + (32, 16, 32, 16, 16, False, True, True): (2, 2, 1, 4), + (32, 16, 32, 16, 16, True, False, False): (2, 1, 1, 4), + (32, 16, 32, 16, 16, True, False, True): (2, 2, 1, 2), + (32, 16, 64, 16, 16, False, False, False): (1, 4, 1, 2), + (32, 16, 64, 16, 16, False, False, True): (1, 4, 1, 4), + (32, 16, 64, 16, 16, False, True, False): (1, 2, 1, 4), + (32, 16, 64, 16, 16, False, True, True): (1, 4, 1, 2), + (32, 16, 64, 16, 16, True, False, False): (1, 4, 2, 8), + (32, 16, 64, 16, 16, True, False, True): (1, 4, 1, 1), + (32, 32, 16, 16, 16, False, False, False): (1, 1, 1, 4), + (32, 32, 16, 16, 16, False, False, True): (2, 1, 1, 4), + (32, 32, 16, 16, 16, False, True, False): (1, 1, 2, 4), + (32, 32, 16, 16, 16, False, True, True): (1, 1, 2, 2), + (32, 32, 16, 16, 16, True, False, False): (1, 1, 1, 8), + (32, 32, 16, 16, 16, True, False, True): (1, 1, 1, 4), + (32, 32, 16, 16, 32, False, False, False): (1, 1, 3, 2), + (32, 32, 16, 16, 32, False, False, True): (2, 1, 1, 4), + (32, 32, 16, 16, 32, False, True, False): (3, 1, 1, 4), + (32, 32, 16, 16, 32, False, True, True): (1, 1, 1, 4), + (32, 32, 16, 16, 32, True, False, False): (2, 1, 1, 8), + (32, 32, 16, 16, 32, True, False, True): (1, 1, 3, 2), + (32, 32, 16, 32, 32, False, False, False): (1, 1, 1, 2), + (32, 32, 16, 32, 32, False, False, True): (2, 1, 1, 8), + (32, 32, 16, 32, 32, False, True, False): (1, 1, 1, 2), + (32, 32, 16, 32, 32, False, True, True): (1, 1, 1, 8), + (32, 32, 16, 32, 32, True, False, False): (1, 1, 2, 4), + (32, 32, 16, 32, 32, True, False, True): (1, 1, 1, 2), + (32, 32, 32, 16, 16, False, False, False): (1, 1, 1, 4), + (32, 32, 32, 16, 16, False, False, True): (1, 2, 1, 4), + (32, 32, 32, 16, 16, False, True, False): (1, 2, 1, 4), + (32, 32, 32, 16, 16, False, True, True): (1, 2, 1, 2), + (32, 32, 32, 16, 16, True, False, False): (1, 2, 1, 4), + (32, 32, 32, 16, 16, True, False, True): (1, 2, 1, 4), + (32, 32, 32, 16, 32, False, False, False): (1, 2, 1, 4), + (32, 32, 32, 16, 32, False, False, True): (1, 2, 1, 2), + (32, 32, 32, 16, 32, False, True, False): (1, 2, 1, 4), + (32, 32, 32, 16, 32, False, True, True): (1, 2, 1, 2), + (32, 32, 32, 16, 32, True, False, False): (1, 2, 1, 1), + (32, 32, 32, 16, 32, True, False, True): (1, 2, 1, 2), + (32, 32, 32, 32, 32, False, False, False): (1, 1, 1, 4), + (32, 32, 32, 32, 32, False, False, True): (2, 1, 1, 4), + (32, 32, 32, 32, 32, False, True, False): (1, 1, 1, 8), + (32, 32, 32, 32, 32, False, True, True): (1, 1, 1, 8), + (32, 32, 32, 32, 32, True, False, False): (1, 1, 3, 4), + (32, 32, 32, 32, 32, True, False, True): (1, 1, 1, 8), + (32, 32, 64, 16, 16, False, False, False): (1, 4, 1, 4), + (32, 32, 64, 16, 16, False, False, True): (1, 4, 1, 2), + (32, 32, 64, 16, 16, False, True, False): (1, 1, 1, 4), + (32, 32, 64, 16, 16, False, True, True): (1, 4, 1, 4), + (32, 32, 64, 16, 16, True, False, False): (1, 4, 1, 8), + (32, 32, 64, 16, 16, True, False, True): (1, 4, 1, 2), + (32, 32, 64, 16, 32, False, False, False): (1, 1, 1, 4), + (32, 32, 64, 16, 32, False, False, True): (1, 4, 1, 4), + (32, 32, 64, 16, 32, False, True, False): (1, 1, 1, 4), + (32, 32, 64, 16, 32, False, True, True): (1, 4, 1, 4), + (32, 32, 64, 16, 32, True, False, False): (2, 2, 1, 8), + (32, 32, 64, 16, 32, True, False, True): (1, 2, 1, 2), + (32, 32, 64, 32, 32, False, False, False): (1, 2, 1, 4), + (32, 32, 64, 32, 32, False, False, True): (1, 2, 1, 1), + (32, 32, 64, 32, 32, False, True, False): (1, 2, 2, 8), + (32, 32, 64, 32, 32, False, True, True): (1, 1, 1, 4), + (32, 32, 64, 32, 32, True, False, False): (1, 2, 1, 4), + (32, 32, 64, 32, 32, True, False, True): (2, 2, 1, 4), + (32, 64, 16, 16, 32, False, False, False): (1, 1, 1, 8), + (32, 64, 16, 16, 32, False, False, True): (1, 1, 1, 4), + (32, 64, 16, 16, 32, False, True, False): (2, 1, 1, 4), + (32, 64, 16, 16, 32, False, True, True): (1, 1, 1, 4), + (32, 64, 16, 16, 32, True, False, False): (1, 1, 2, 4), + (32, 64, 16, 16, 32, True, False, True): (1, 1, 2, 2), + (32, 64, 16, 32, 32, False, False, False): (1, 1, 1, 8), + (32, 64, 16, 32, 32, False, False, True): (2, 1, 1, 4), + (32, 64, 16, 32, 32, False, True, False): (1, 1, 1, 4), + (32, 64, 16, 32, 32, False, True, True): (1, 1, 2, 2), + (32, 64, 16, 32, 32, True, False, False): (1, 1, 1, 2), + (32, 64, 16, 32, 32, True, False, True): (2, 1, 2, 4), + (32, 64, 32, 16, 32, False, False, False): (1, 1, 1, 4), + (32, 64, 32, 16, 32, False, False, True): (1, 2, 1, 2), + (32, 64, 32, 16, 32, False, True, False): (1, 2, 3, 4), + (32, 64, 32, 16, 32, False, True, True): (2, 2, 1, 4), + (32, 64, 32, 16, 32, True, False, False): (1, 1, 1, 4), + (32, 64, 32, 16, 32, True, False, True): (1, 2, 2, 1), + (32, 64, 32, 32, 32, False, False, False): (1, 1, 1, 8), + (32, 64, 32, 32, 32, False, False, True): (1, 1, 1, 4), + (32, 64, 32, 32, 32, False, True, False): (1, 1, 2, 4), + (32, 64, 32, 32, 32, False, True, True): (1, 1, 1, 4), + (32, 64, 32, 32, 32, True, False, False): (2, 1, 1, 2), + (32, 64, 32, 32, 32, True, False, True): (1, 1, 1, 4), + (32, 64, 64, 16, 32, False, False, False): (1, 4, 2, 1), + (32, 64, 64, 16, 32, False, False, True): (3, 4, 1, 4), + (32, 64, 64, 16, 32, False, True, False): (1, 1, 1, 8), + (32, 64, 64, 16, 32, False, True, True): (1, 4, 1, 4), + (32, 64, 64, 16, 32, True, False, False): (1, 4, 1, 4), + (32, 64, 64, 16, 32, True, False, True): (2, 2, 3, 4), + (32, 64, 64, 32, 32, False, False, False): (1, 2, 1, 4), + (32, 64, 64, 32, 32, False, False, True): (1, 2, 1, 4), + (32, 64, 64, 32, 32, False, True, False): (1, 2, 2, 8), + (32, 64, 64, 32, 32, False, True, True): (1, 2, 1, 4), + (32, 64, 64, 32, 32, True, False, False): (1, 2, 2, 4), + (32, 64, 64, 32, 32, True, False, True): (1, 2, 1, 4), + (64, 32, 16, 32, 32, False, False, False): (1, 1, 1, 1), + (64, 32, 16, 32, 32, False, False, True): (1, 1, 2, 4), + (64, 32, 16, 32, 32, False, True, False): (2, 1, 1, 8), + (64, 32, 16, 32, 32, False, True, True): (1, 1, 1, 4), + (64, 32, 16, 32, 32, True, False, False): (2, 1, 1, 2), + (64, 32, 16, 32, 32, True, False, True): (1, 1, 1, 4), + (64, 32, 32, 32, 32, False, False, False): (3, 1, 1, 4), + (64, 32, 32, 32, 32, False, False, True): (1, 1, 1, 4), + (64, 32, 32, 32, 32, False, True, False): (1, 1, 1, 8), + (64, 32, 32, 32, 32, False, True, True): (1, 1, 1, 2), + (64, 32, 32, 32, 32, True, False, False): (1, 1, 1, 2), + (64, 32, 32, 32, 32, True, False, True): (1, 1, 1, 4), + (64, 32, 64, 32, 32, False, False, False): (1, 2, 1, 2), + (64, 32, 64, 32, 32, False, False, True): (3, 2, 1, 4), + (64, 32, 64, 32, 32, False, True, False): (1, 1, 1, 1), + (64, 32, 64, 32, 32, False, True, True): (1, 2, 1, 4), + (64, 32, 64, 32, 32, True, False, False): (1, 1, 3, 4), + (64, 32, 64, 32, 32, True, False, True): (1, 2, 2, 4), + (64, 64, 16, 32, 32, False, False, False): (1, 1, 2, 2), + (64, 64, 16, 32, 32, False, False, True): (1, 1, 3, 2), + (64, 64, 16, 32, 32, False, True, False): (1, 1, 1, 8), + (64, 64, 16, 32, 32, False, True, True): (1, 1, 2, 4), + (64, 64, 16, 32, 32, True, False, False): (1, 1, 2, 4), + (64, 64, 16, 32, 32, True, False, True): (2, 1, 2, 4), + (64, 64, 32, 32, 32, False, False, False): (1, 1, 2, 8), + (64, 64, 32, 32, 32, False, False, True): (1, 1, 2, 4), + (64, 64, 32, 32, 32, False, True, False): (1, 1, 1, 4), + (64, 64, 32, 32, 32, False, True, True): (1, 1, 1, 4), + (64, 64, 32, 32, 32, True, False, False): (1, 1, 1, 4), + (64, 64, 32, 32, 32, True, False, True): (2, 1, 2, 4), + (64, 64, 64, 32, 32, False, False, False): (1, 2, 1, 4), + (64, 64, 64, 32, 32, False, False, True): (1, 2, 1, 4), + (64, 64, 64, 32, 32, False, True, False): (1, 2, 1, 4), + (64, 64, 64, 32, 32, False, True, True): (3, 2, 1, 4), + (64, 64, 64, 32, 32, True, False, False): (1, 2, 1, 8), + (64, 64, 64, 32, 32, True, False, True): (1, 2, 3, 4), + (256, 256, 256, 16, 16, False, True, True): (4, 8, 6, 2), + (256, 256, 256, 16, 16, True, False, True): (5, 16, 5, 1), + (256, 256, 256, 32, 32, False, True, True): (1, 8, 7, 4), + (256, 256, 256, 32, 32, True, False, True): (1, 8, 5, 4), + (256, 256, 256, 64, 64, False, True, True): (1, 4, 5, 4), + (256, 256, 256, 64, 64, True, False, True): (2, 4, 3, 4), + (256, 256, 256, 128, 128, False, True, True): (1, 2, 2, 8), + (256, 256, 256, 128, 128, True, False, True): (1, 2, 2, 8), + (256, 256, 512, 16, 16, False, True, True): (4, 8, 4, 4), + (256, 256, 512, 16, 16, True, False, True): (4, 8, 6, 2), + (256, 256, 512, 32, 32, False, True, True): (3, 8, 5, 4), + (256, 256, 512, 32, 32, True, False, True): (2, 8, 5, 4), + (256, 256, 512, 64, 64, False, True, True): (2, 8, 4, 4), + (256, 256, 512, 64, 64, True, False, True): (1, 8, 7, 4), + (256, 256, 512, 128, 128, False, True, True): (2, 4, 2, 8), + (256, 256, 512, 128, 128, True, False, True): (5, 4, 2, 8), + (256, 256, 1024, 16, 16, False, True, True): (1, 8, 4, 4), + (256, 256, 1024, 16, 16, True, False, True): (1, 16, 4, 2), + (256, 256, 1024, 32, 32, False, True, True): (5, 32, 5, 1), + (256, 256, 1024, 32, 32, True, False, True): (1, 16, 4, 2), + (256, 256, 1024, 64, 64, False, True, True): (1, 16, 4, 4), + (256, 256, 1024, 64, 64, True, False, True): (2, 16, 3, 4), + (256, 256, 1024, 128, 128, False, True, True): (9, 8, 2, 8), + (256, 256, 1024, 128, 128, True, False, True): (1, 8, 2, 8), + (256, 256, 2048, 16, 16, False, True, True): (6, 32, 5, 2), + (256, 256, 2048, 16, 16, True, False, True): (2, 32, 4, 2), + (256, 256, 2048, 32, 32, False, True, True): (1, 32, 3, 2), + (256, 256, 2048, 32, 32, True, False, True): (1, 32, 3, 2), + (256, 256, 2048, 64, 64, False, True, True): (2, 32, 4, 4), + (256, 256, 2048, 64, 64, True, False, True): (2, 16, 4, 4), + (256, 256, 2048, 128, 128, False, True, True): (3, 16, 2, 8), + (256, 256, 2048, 128, 128, True, False, True): (4, 16, 2, 8), + (256, 256, 4096, 16, 16, False, True, True): (1, 32, 3, 4), + (256, 256, 4096, 16, 16, True, False, True): (3, 16, 3, 2), + (256, 256, 4096, 32, 32, False, True, True): (3, 32, 3, 2), + (256, 256, 4096, 32, 32, True, False, True): (1, 32, 3, 2), + (256, 256, 4096, 64, 64, False, True, True): (2, 32, 3, 4), + (256, 256, 4096, 64, 64, True, False, True): (2, 32, 3, 4), + (256, 256, 4096, 128, 128, False, True, True): (5, 32, 2, 8), + (256, 256, 4096, 128, 128, True, False, True): (1, 32, 2, 8), + (256, 256, 8192, 16, 16, False, True, True): (8, 32, 3, 4), + (256, 256, 8192, 16, 16, True, False, True): (1, 32, 3, 2), + (256, 256, 8192, 32, 32, False, True, True): (3, 64, 3, 4), + (256, 256, 8192, 32, 32, True, False, True): (2, 128, 1, 2), + (256, 256, 8192, 64, 64, False, True, True): (7, 128, 1, 4), + (256, 256, 8192, 64, 64, True, False, True): (4, 128, 1, 4), + (256, 256, 8192, 128, 128, False, True, True): (2, 64, 1, 4), + (256, 256, 8192, 128, 128, True, False, True): (4, 64, 1, 4), + (256, 256, 16384, 16, 16, False, True, True): (4, 128, 3, 2), + (256, 256, 16384, 16, 16, True, False, True): (5, 64, 3, 2), + (256, 256, 16384, 32, 32, False, True, True): (5, 128, 3, 2), + (256, 256, 16384, 32, 32, True, False, True): (5, 128, 3, 2), + (256, 256, 16384, 64, 64, False, True, True): (1, 256, 1, 4), + (256, 256, 16384, 64, 64, True, False, True): (5, 128, 3, 4), + (256, 256, 16384, 128, 128, False, True, True): (11, 128, 2, 8), + (256, 256, 16384, 128, 128, True, False, True): (3, 128, 1, 4), + (256, 256, 32768, 16, 16, False, True, True): (1, 128, 3, 4), + (256, 256, 32768, 16, 16, True, False, True): (2, 128, 3, 2), + (256, 256, 32768, 32, 32, False, True, True): (4, 256, 3, 2), + (256, 256, 32768, 32, 32, True, False, True): (1, 256, 3, 2), + (256, 256, 32768, 64, 64, False, True, True): (2, 256, 1, 4), + (256, 256, 32768, 64, 64, True, False, True): (2, 256, 1, 4), + (256, 256, 32768, 128, 128, False, True, True): (3, 256, 1, 4), + (256, 256, 32768, 128, 128, True, False, True): (2, 256, 1, 4), + (256, 256, 65536, 16, 16, False, True, True): (1, 256, 3, 2), + (256, 256, 65536, 16, 16, True, False, True): (1, 256, 3, 2), + (256, 256, 65536, 32, 32, False, True, True): (1, 512, 3, 2), + (256, 256, 65536, 32, 32, True, False, True): (4, 512, 3, 2), + (256, 256, 65536, 64, 64, False, True, True): (2, 512, 1, 4), + (256, 256, 65536, 64, 64, True, False, True): (5, 512, 1, 4), + (256, 256, 65536, 128, 128, False, True, True): (3, 512, 1, 4), + (256, 256, 65536, 128, 128, True, False, True): (1, 512, 1, 4), + (256, 256, 131072, 16, 16, False, True, True): (1, 512, 3, 1), + (256, 256, 131072, 16, 16, True, False, True): (1, 512, 3, 2), + (256, 256, 131072, 32, 32, False, True, True): (2, 1024, 3, 2), + (256, 256, 131072, 32, 32, True, False, True): (1, 1024, 3, 2), + (256, 256, 131072, 64, 64, False, True, True): (1, 1024, 1, 4), + (256, 256, 131072, 64, 64, True, False, True): (1, 1024, 1, 4), + (256, 256, 131072, 128, 128, False, True, True): (7, 1024, 1, 4), + (256, 256, 131072, 128, 128, True, False, True): (1, 1024, 1, 4), + (512, 512, 256, 16, 16, False, True, True): (1, 8, 5, 1), + (512, 512, 256, 16, 16, True, False, True): (2, 16, 5, 1), + (512, 512, 256, 32, 32, False, True, True): (2, 8, 5, 2), + (512, 512, 256, 32, 32, True, False, True): (4, 4, 5, 2), + (512, 512, 256, 64, 64, False, True, True): (1, 4, 5, 4), + (512, 512, 256, 64, 64, True, False, True): (3, 4, 5, 4), + (512, 512, 256, 128, 128, False, True, True): (1, 2, 2, 8), + (512, 512, 256, 128, 128, True, False, True): (1, 2, 2, 8), + (512, 512, 512, 16, 16, False, True, True): (1, 8, 4, 4), + (512, 512, 512, 16, 16, True, False, True): (4, 16, 5, 1), + (512, 512, 512, 32, 32, False, True, True): (4, 8, 5, 2), + (512, 512, 512, 32, 32, True, False, True): (7, 16, 4, 1), + (512, 512, 512, 64, 64, False, True, True): (3, 8, 5, 4), + (512, 512, 512, 64, 64, True, False, True): (1, 8, 4, 4), + (512, 512, 512, 128, 128, False, True, True): (4, 4, 2, 8), + (512, 512, 512, 128, 128, True, False, True): (4, 4, 2, 8), + (512, 512, 1024, 16, 16, False, True, True): (2, 8, 4, 4), + (512, 512, 1024, 16, 16, True, False, True): (2, 16, 4, 2), + (512, 512, 1024, 32, 32, False, True, True): (3, 16, 4, 2), + (512, 512, 1024, 32, 32, True, False, True): (3, 16, 3, 2), + (512, 512, 1024, 64, 64, False, True, True): (5, 8, 5, 4), + (512, 512, 1024, 64, 64, True, False, True): (4, 16, 3, 4), + (512, 512, 1024, 128, 128, False, True, True): (6, 8, 2, 8), + (512, 512, 1024, 128, 128, True, False, True): (4, 8, 2, 8), + (512, 512, 2048, 16, 16, False, True, True): (2, 16, 3, 4), + (512, 512, 2048, 16, 16, True, False, True): (1, 16, 4, 2), + (512, 512, 2048, 32, 32, False, True, True): (2, 32, 3, 2), + (512, 512, 2048, 32, 32, True, False, True): (2, 32, 3, 2), + (512, 512, 2048, 64, 64, False, True, True): (1, 32, 3, 4), + (512, 512, 2048, 64, 64, True, False, True): (1, 32, 3, 2), + (512, 512, 2048, 128, 128, False, True, True): (3, 16, 2, 8), + (512, 512, 2048, 128, 128, True, False, True): (1, 16, 2, 8), + (512, 512, 4096, 16, 16, False, True, True): (4, 32, 3, 2), + (512, 512, 4096, 16, 16, True, False, True): (1, 32, 3, 2), + (512, 512, 4096, 32, 32, False, True, True): (3, 32, 3, 2), + (512, 512, 4096, 32, 32, True, False, True): (3, 32, 3, 2), + (512, 512, 4096, 64, 64, False, True, True): (1, 32, 3, 4), + (512, 512, 4096, 64, 64, True, False, True): (1, 64, 1, 4), + (512, 512, 4096, 128, 128, False, True, True): (7, 32, 2, 8), + (512, 512, 4096, 128, 128, True, False, True): (1, 32, 2, 8), + (512, 512, 8192, 16, 16, False, True, True): (4, 64, 3, 2), + (512, 512, 8192, 16, 16, True, False, True): (1, 64, 3, 2), + (512, 512, 8192, 32, 32, False, True, True): (3, 64, 3, 2), + (512, 512, 8192, 32, 32, True, False, True): (1, 64, 3, 2), + (512, 512, 8192, 64, 64, False, True, True): (1, 64, 3, 4), + (512, 512, 8192, 64, 64, True, False, True): (1, 64, 3, 4), + (512, 512, 8192, 128, 128, False, True, True): (7, 64, 2, 8), + (512, 512, 8192, 128, 128, True, False, True): (1, 64, 1, 4), + (512, 512, 16384, 16, 16, False, True, True): (1, 128, 3, 2), + (512, 512, 16384, 16, 16, True, False, True): (1, 64, 3, 2), + (512, 512, 16384, 32, 32, False, True, True): (1, 128, 3, 2), + (512, 512, 16384, 32, 32, True, False, True): (1, 128, 3, 2), + (512, 512, 16384, 64, 64, False, True, True): (1, 128, 3, 4), + (512, 512, 16384, 64, 64, True, False, True): (4, 128, 3, 4), + (512, 512, 16384, 128, 128, False, True, True): (5, 128, 2, 8), + (512, 512, 16384, 128, 128, True, False, True): (2, 128, 1, 4), + (512, 512, 32768, 16, 16, False, True, True): (1, 128, 3, 4), + (512, 512, 32768, 16, 16, True, False, True): (1, 128, 3, 2), + (512, 512, 32768, 32, 32, False, True, True): (1, 256, 3, 2), + (512, 512, 32768, 32, 32, True, False, True): (1, 256, 3, 2), + (512, 512, 32768, 64, 64, False, True, True): (1, 256, 3, 4), + (512, 512, 32768, 64, 64, True, False, True): (1, 256, 3, 4), + (512, 512, 32768, 128, 128, False, True, True): (5, 256, 1, 4), + (512, 512, 32768, 128, 128, True, False, True): (1, 256, 1, 4), + (512, 512, 65536, 16, 16, False, True, True): (1, 256, 3, 2), + (512, 512, 65536, 16, 16, True, False, True): (1, 256, 3, 1), + (512, 512, 65536, 32, 32, False, True, True): (1, 512, 3, 2), + (512, 512, 65536, 32, 32, True, False, True): (1, 512, 3, 2), + (512, 512, 65536, 64, 64, False, True, True): (2, 256, 2, 4), + (512, 512, 65536, 64, 64, True, False, True): (1, 512, 3, 4), + (512, 512, 65536, 128, 128, False, True, True): (7, 512, 1, 4), + (512, 512, 65536, 128, 128, True, False, True): (5, 512, 1, 4), + (512, 512, 131072, 16, 16, False, True, True): (1, 512, 3, 1), + (512, 512, 131072, 16, 16, True, False, True): (1, 512, 3, 1), + (512, 512, 131072, 32, 32, False, True, True): (1, 1024, 3, 2), + (512, 512, 131072, 32, 32, True, False, True): (1, 1024, 3, 2), + (512, 512, 131072, 64, 64, False, True, True): (4, 512, 2, 4), + (512, 512, 131072, 64, 64, True, False, True): (2, 512, 2, 4), + (512, 512, 131072, 128, 128, False, True, True): (5, 1024, 1, 4), + (512, 512, 131072, 128, 128, True, False, True): (4, 1024, 1, 4), + (1024, 1024, 256, 16, 16, False, True, True): (3, 4, 5, 4), + (1024, 1024, 256, 16, 16, True, False, True): (3, 4, 5, 4), + (1024, 1024, 256, 32, 32, False, True, True): (2, 4, 6, 2), + (1024, 1024, 256, 32, 32, True, False, True): (2, 4, 6, 2), + (1024, 1024, 256, 64, 64, False, True, True): (1, 4, 4, 4), + (1024, 1024, 256, 64, 64, True, False, True): (2, 4, 6, 4), + (1024, 1024, 256, 128, 128, False, True, True): (1, 2, 2, 8), + (1024, 1024, 256, 128, 128, True, False, True): (1, 2, 2, 8), + (1024, 1024, 512, 16, 16, False, True, True): (3, 4, 5, 4), + (1024, 1024, 512, 16, 16, True, False, True): (3, 8, 4, 2), + (1024, 1024, 512, 32, 32, False, True, True): (1, 8, 4, 2), + (1024, 1024, 512, 32, 32, True, False, True): (1, 8, 4, 2), + (1024, 1024, 512, 64, 64, False, True, True): (2, 8, 3, 4), + (1024, 1024, 512, 64, 64, True, False, True): (1, 4, 4, 4), + (1024, 1024, 512, 128, 128, False, True, True): (7, 4, 2, 8), + (1024, 1024, 512, 128, 128, True, False, True): (1, 4, 2, 8), + (1024, 1024, 1024, 16, 16, False, True, True): (4, 8, 4, 2), + (1024, 1024, 1024, 16, 16, True, False, True): (3, 8, 5, 2), + (1024, 1024, 1024, 32, 32, False, True, True): (1, 8, 4, 4), + (1024, 1024, 1024, 32, 32, True, False, True): (1, 8, 4, 2), + (1024, 1024, 1024, 64, 64, False, True, True): (1, 16, 3, 4), + (1024, 1024, 1024, 64, 64, True, False, True): (3, 16, 3, 4), + (1024, 1024, 1024, 128, 128, False, True, True): (6, 8, 2, 8), + (1024, 1024, 1024, 128, 128, True, False, True): (4, 8, 2, 8), + (1024, 1024, 2048, 16, 16, False, True, True): (3, 8, 3, 4), + (1024, 1024, 2048, 16, 16, True, False, True): (3, 8, 3, 4), + (1024, 1024, 2048, 32, 32, False, True, True): (1, 16, 3, 4), + (1024, 1024, 2048, 32, 32, True, False, True): (1, 16, 3, 2), + (1024, 1024, 2048, 64, 64, False, True, True): (5, 16, 3, 4), + (1024, 1024, 2048, 64, 64, True, False, True): (5, 16, 3, 4), + (1024, 1024, 2048, 128, 128, False, True, True): (3, 16, 2, 8), + (1024, 1024, 2048, 128, 128, True, False, True): (4, 16, 2, 16), + (1024, 1024, 4096, 16, 16, False, True, True): (4, 32, 3, 2), + (1024, 1024, 4096, 16, 16, True, False, True): (8, 32, 3, 2), + (1024, 1024, 4096, 32, 32, False, True, True): (9, 32, 3, 2), + (1024, 1024, 4096, 32, 32, True, False, True): (1, 32, 3, 2), + (1024, 1024, 4096, 64, 64, False, True, True): (6, 32, 3, 4), + (1024, 1024, 4096, 64, 64, True, False, True): (1, 32, 3, 4), + (1024, 1024, 4096, 128, 128, False, True, True): (4, 32, 2, 8), + (1024, 1024, 4096, 128, 128, True, False, True): (4, 32, 1, 4), + (1024, 1024, 8192, 16, 16, False, True, True): (4, 64, 3, 2), + (1024, 1024, 8192, 16, 16, True, False, True): (4, 64, 3, 2), + (1024, 1024, 8192, 32, 32, False, True, True): (8, 64, 3, 2), + (1024, 1024, 8192, 32, 32, True, False, True): (6, 64, 3, 2), + (1024, 1024, 8192, 64, 64, False, True, True): (2, 64, 3, 4), + (1024, 1024, 8192, 64, 64, True, False, True): (2, 64, 3, 4), + (1024, 1024, 8192, 128, 128, False, True, True): (3, 64, 1, 4), + (1024, 1024, 8192, 128, 128, True, False, True): (2, 64, 1, 4), + (1024, 1024, 16384, 16, 16, False, True, True): (1, 64, 3, 4), + (1024, 1024, 16384, 16, 16, True, False, True): (1, 64, 3, 2), + (1024, 1024, 16384, 32, 32, False, True, True): (1, 128, 3, 4), + (1024, 1024, 16384, 32, 32, True, False, True): (1, 64, 3, 4), + (1024, 1024, 16384, 64, 64, False, True, True): (1, 128, 3, 4), + (1024, 1024, 16384, 64, 64, True, False, True): (1, 128, 3, 4), + (1024, 1024, 16384, 128, 128, False, True, True): (11, 128, 1, 4), + (1024, 1024, 16384, 128, 128, True, False, True): (4, 128, 1, 4), + (1024, 1024, 32768, 16, 16, False, True, True): (1, 128, 3, 4), + (1024, 1024, 32768, 16, 16, True, False, True): (1, 128, 3, 1), + (1024, 1024, 32768, 32, 32, False, True, True): (1, 256, 3, 2), + (1024, 1024, 32768, 32, 32, True, False, True): (1, 128, 3, 4), + (1024, 1024, 32768, 64, 64, False, True, True): (2, 128, 2, 4), + (1024, 1024, 32768, 64, 64, True, False, True): (1, 256, 3, 4), + (1024, 1024, 32768, 128, 128, False, True, True): (7, 256, 1, 4), + (1024, 1024, 32768, 128, 128, True, False, True): (4, 256, 1, 4), + (1024, 1024, 65536, 16, 16, False, True, True): (1, 256, 3, 4), + (1024, 1024, 65536, 16, 16, True, False, True): (1, 256, 3, 1), + (1024, 1024, 65536, 32, 32, False, True, True): (1, 512, 3, 2), + (1024, 1024, 65536, 32, 32, True, False, True): (1, 256, 3, 4), + (1024, 1024, 65536, 64, 64, False, True, True): (2, 256, 2, 4), + (1024, 1024, 65536, 64, 64, True, False, True): (1, 512, 3, 4), + (1024, 1024, 65536, 128, 128, False, True, True): (10, 512, 1, 4), + (1024, 1024, 65536, 128, 128, True, False, True): (4, 512, 1, 4), + (1024, 1024, 131072, 16, 16, False, True, True): (11, 512, 3, 2), + (1024, 1024, 131072, 16, 16, True, False, True): (11, 512, 3, 2), + (1024, 1024, 131072, 32, 32, False, True, True): (7, 1024, 3, 2), + (1024, 1024, 131072, 32, 32, True, False, True): (6, 512, 3, 4), + (1024, 1024, 131072, 64, 64, False, True, True): (1, 512, 2, 4), + (1024, 1024, 131072, 64, 64, True, False, True): (4, 1024, 3, 4), + (1024, 1024, 131072, 128, 128, False, True, True): (12, 1024, 1, 4), + (1024, 1024, 131072, 128, 128, True, False, True): (4, 1024, 1, 4), + (2048, 2048, 256, 16, 16, False, True, True): (4, 4, 6, 2), + (2048, 2048, 256, 16, 16, True, False, True): (2, 8, 4, 1), + (2048, 2048, 256, 32, 32, False, True, True): (3, 4, 4, 2), + (2048, 2048, 256, 32, 32, True, False, True): (1, 4, 5, 2), + (2048, 2048, 256, 64, 64, False, True, True): (2, 4, 4, 4), + (2048, 2048, 256, 64, 64, True, False, True): (2, 4, 4, 4), + (2048, 2048, 256, 128, 128, False, True, True): (3, 2, 2, 8), + (2048, 2048, 256, 128, 128, True, False, True): (5, 2, 2, 8), + (2048, 2048, 512, 16, 16, False, True, True): (5, 4, 4, 4), + (2048, 2048, 512, 16, 16, True, False, True): (2, 4, 4, 2), + (2048, 2048, 512, 32, 32, False, True, True): (1, 4, 3, 4), + (2048, 2048, 512, 32, 32, True, False, True): (3, 4, 4, 2), + (2048, 2048, 512, 64, 64, False, True, True): (1, 8, 3, 4), + (2048, 2048, 512, 64, 64, True, False, True): (1, 8, 3, 2), + (2048, 2048, 512, 128, 128, False, True, True): (3, 4, 2, 8), + (2048, 2048, 512, 128, 128, True, False, True): (2, 4, 2, 8), + (2048, 2048, 1024, 16, 16, False, True, True): (3, 4, 3, 4), + (2048, 2048, 1024, 16, 16, True, False, True): (2, 8, 3, 2), + (2048, 2048, 1024, 32, 32, False, True, True): (3, 8, 3, 4), + (2048, 2048, 1024, 32, 32, True, False, True): (1, 8, 3, 2), + (2048, 2048, 1024, 64, 64, False, True, True): (1, 8, 3, 4), + (2048, 2048, 1024, 64, 64, True, False, True): (1, 8, 3, 4), + (2048, 2048, 1024, 128, 128, False, True, True): (4, 8, 2, 8), + (2048, 2048, 1024, 128, 128, True, False, True): (4, 8, 1, 4), + (2048, 2048, 2048, 16, 16, False, True, True): (4, 16, 3, 2), + (2048, 2048, 2048, 16, 16, True, False, True): (2, 16, 3, 2), + (2048, 2048, 2048, 32, 32, False, True, True): (1, 16, 3, 4), + (2048, 2048, 2048, 32, 32, True, False, True): (1, 16, 3, 2), + (2048, 2048, 2048, 64, 64, False, True, True): (1, 16, 3, 4), + (2048, 2048, 2048, 64, 64, True, False, True): (1, 16, 3, 4), + (2048, 2048, 2048, 128, 128, False, True, True): (6, 16, 2, 8), + (2048, 2048, 2048, 128, 128, True, False, True): (5, 16, 1, 4), + (2048, 2048, 4096, 16, 16, False, True, True): (4, 32, 4, 2), + (2048, 2048, 4096, 16, 16, True, False, True): (4, 32, 3, 2), + (2048, 2048, 4096, 32, 32, False, True, True): (4, 16, 3, 8), + (2048, 2048, 4096, 32, 32, True, False, True): (4, 16, 3, 4), + (2048, 2048, 4096, 64, 64, False, True, True): (4, 32, 3, 4), + (2048, 2048, 4096, 64, 64, True, False, True): (4, 32, 3, 4), + (2048, 2048, 4096, 128, 128, False, True, True): (4, 32, 2, 8), + (2048, 2048, 4096, 128, 128, True, False, True): (2, 32, 1, 4), + (2048, 2048, 8192, 16, 16, False, True, True): (4, 64, 4, 2), + (2048, 2048, 8192, 16, 16, True, False, True): (4, 64, 4, 2), + (2048, 2048, 8192, 32, 32, False, True, True): (4, 32, 3, 8), + (2048, 2048, 8192, 32, 32, True, False, True): (4, 32, 4, 8), + (2048, 2048, 8192, 64, 64, False, True, True): (2, 64, 3, 4), + (2048, 2048, 8192, 64, 64, True, False, True): (4, 64, 3, 4), + (2048, 2048, 8192, 128, 128, False, True, True): (3, 64, 1, 4), + (2048, 2048, 8192, 128, 128, True, False, True): (2, 64, 1, 4), + (2048, 2048, 16384, 16, 16, False, True, True): (4, 64, 3, 4), + (2048, 2048, 16384, 16, 16, True, False, True): (1, 64, 3, 4), + (2048, 2048, 16384, 32, 32, False, True, True): (4, 64, 3, 4), + (2048, 2048, 16384, 32, 32, True, False, True): (4, 64, 3, 4), + (2048, 2048, 16384, 64, 64, False, True, True): (4, 128, 3, 4), + (2048, 2048, 16384, 64, 64, True, False, True): (4, 128, 3, 4), + (2048, 2048, 16384, 128, 128, False, True, True): (3, 128, 1, 4), + (2048, 2048, 16384, 128, 128, True, False, True): (2, 128, 1, 4), + (2048, 2048, 32768, 16, 16, False, True, True): (8, 128, 3, 2), + (2048, 2048, 32768, 16, 16, True, False, True): (8, 128, 3, 4), + (2048, 2048, 32768, 32, 32, False, True, True): (8, 128, 3, 4), + (2048, 2048, 32768, 32, 32, True, False, True): (8, 128, 3, 4), + (2048, 2048, 32768, 64, 64, False, True, True): (8, 256, 3, 4), + (2048, 2048, 32768, 64, 64, True, False, True): (8, 256, 3, 4), + (2048, 2048, 32768, 128, 128, False, True, True): (3, 256, 1, 4), + (2048, 2048, 32768, 128, 128, True, False, True): (1, 256, 1, 4), + (2048, 2048, 65536, 16, 16, False, True, True): (9, 256, 3, 2), + (2048, 2048, 65536, 16, 16, True, False, True): (9, 256, 4, 4), + (2048, 2048, 65536, 32, 32, False, True, True): (7, 256, 3, 4), + (2048, 2048, 65536, 32, 32, True, False, True): (7, 256, 3, 4), + (2048, 2048, 65536, 64, 64, False, True, True): (2, 256, 2, 4), + (2048, 2048, 65536, 64, 64, True, False, True): (9, 512, 3, 4), + (2048, 2048, 65536, 128, 128, False, True, True): (5, 512, 1, 4), + (2048, 2048, 65536, 128, 128, True, False, True): (1, 512, 1, 4), + (2048, 2048, 131072, 16, 16, False, True, True): (9, 512, 3, 2), + (2048, 2048, 131072, 16, 16, True, False, True): (9, 512, 4, 4), + (2048, 2048, 131072, 32, 32, False, True, True): (7, 512, 3, 4), + (2048, 2048, 131072, 32, 32, True, False, True): (3, 512, 3, 4), + (2048, 2048, 131072, 64, 64, False, True, True): (1, 512, 2, 4), + (2048, 2048, 131072, 64, 64, True, False, True): (2, 1024, 3, 4), + (2048, 2048, 131072, 128, 128, False, True, True): (3, 1024, 1, 4), + (2048, 2048, 131072, 128, 128, True, False, True): (1, 1024, 1, 4), + (4096, 4096, 256, 16, 16, False, True, True): (2, 2, 6, 4), + (4096, 4096, 256, 16, 16, True, False, True): (2, 2, 5, 4), + (4096, 4096, 256, 32, 32, False, True, True): (7, 2, 4, 4), + (4096, 4096, 256, 32, 32, True, False, True): (1, 2, 4, 4), + (4096, 4096, 256, 64, 64, False, True, True): (3, 4, 3, 4), + (4096, 4096, 256, 64, 64, True, False, True): (3, 4, 3, 4), + (4096, 4096, 256, 128, 128, False, True, True): (1, 2, 2, 8), + (4096, 4096, 256, 128, 128, True, False, True): (1, 2, 2, 8), + (4096, 4096, 512, 16, 16, False, True, True): (4, 2, 3, 4), + (4096, 4096, 512, 16, 16, True, False, True): (2, 4, 3, 2), + (4096, 4096, 512, 32, 32, False, True, True): (3, 4, 3, 4), + (4096, 4096, 512, 32, 32, True, False, True): (3, 4, 3, 2), + (4096, 4096, 512, 64, 64, False, True, True): (3, 4, 3, 4), + (4096, 4096, 512, 64, 64, True, False, True): (3, 4, 3, 4), + (4096, 4096, 512, 128, 128, False, True, True): (2, 4, 2, 8), + (4096, 4096, 512, 128, 128, True, False, True): (2, 4, 1, 4), + (4096, 4096, 1024, 16, 16, False, True, True): (2, 8, 3, 2), + (4096, 4096, 1024, 16, 16, True, False, True): (2, 8, 3, 2), + (4096, 4096, 1024, 32, 32, False, True, True): (3, 8, 3, 4), + (4096, 4096, 1024, 32, 32, True, False, True): (1, 8, 3, 2), + (4096, 4096, 1024, 64, 64, False, True, True): (1, 8, 3, 4), + (4096, 4096, 1024, 64, 64, True, False, True): (1, 8, 3, 4), + (4096, 4096, 1024, 128, 128, False, True, True): (2, 8, 2, 8), + (4096, 4096, 1024, 128, 128, True, False, True): (2, 8, 2, 8), + (4096, 4096, 2048, 16, 16, False, True, True): (2, 8, 4, 4), + (4096, 4096, 2048, 16, 16, True, False, True): (2, 8, 4, 4), + (4096, 4096, 2048, 32, 32, False, True, True): (4, 8, 4, 8), + (4096, 4096, 2048, 32, 32, True, False, True): (4, 8, 4, 8), + (4096, 4096, 2048, 64, 64, False, True, True): (1, 16, 3, 4), + (4096, 4096, 2048, 64, 64, True, False, True): (4, 16, 3, 4), + (4096, 4096, 2048, 128, 128, False, True, True): (2, 16, 2, 8), + (4096, 4096, 2048, 128, 128, True, False, True): (4, 16, 1, 4), + (4096, 4096, 4096, 16, 16, False, True, True): (4, 32, 4, 4), + (4096, 4096, 4096, 16, 16, True, False, True): (4, 32, 4, 2), + (4096, 4096, 4096, 32, 32, False, True, True): (4, 16, 4, 8), + (4096, 4096, 4096, 32, 32, True, False, True): (4, 16, 3, 8), + (4096, 4096, 4096, 64, 64, False, True, True): (1, 32, 3, 4), + (4096, 4096, 4096, 64, 64, True, False, True): (1, 32, 3, 4), + (4096, 4096, 4096, 128, 128, False, True, True): (3, 32, 1, 4), + (4096, 4096, 4096, 128, 128, True, False, True): (2, 32, 1, 4), + (4096, 4096, 8192, 16, 16, False, True, True): (4, 64, 4, 2), + (4096, 4096, 8192, 16, 16, True, False, True): (4, 64, 4, 2), + (4096, 4096, 8192, 32, 32, False, True, True): (4, 32, 4, 8), + (4096, 4096, 8192, 32, 32, True, False, True): (4, 32, 4, 8), + (4096, 4096, 8192, 64, 64, False, True, True): (2, 64, 3, 4), + (4096, 4096, 8192, 64, 64, True, False, True): (2, 64, 3, 4), + (4096, 4096, 8192, 128, 128, False, True, True): (3, 64, 1, 4), + (4096, 4096, 8192, 128, 128, True, False, True): (1, 64, 1, 4), + (4096, 4096, 16384, 16, 16, False, True, True): (4, 64, 3, 4), + (4096, 4096, 16384, 16, 16, True, False, True): (4, 64, 4, 4), + (4096, 4096, 16384, 32, 32, False, True, True): (4, 64, 4, 8), + (4096, 4096, 16384, 32, 32, True, False, True): (4, 64, 4, 8), + (4096, 4096, 16384, 64, 64, False, True, True): (1, 64, 2, 4), + (4096, 4096, 16384, 64, 64, True, False, True): (1, 64, 3, 8), + (4096, 4096, 16384, 128, 128, False, True, True): (3, 128, 1, 4), + (4096, 4096, 16384, 128, 128, True, False, True): (1, 128, 1, 4), + (4096, 4096, 32768, 16, 16, False, True, True): (8, 128, 3, 2), + (4096, 4096, 32768, 16, 16, True, False, True): (5, 128, 4, 4), + (4096, 4096, 32768, 32, 32, False, True, True): (3, 128, 4, 4), + (4096, 4096, 32768, 32, 32, True, False, True): (3, 128, 4, 8), + (4096, 4096, 32768, 64, 64, False, True, True): (1, 128, 2, 4), + (4096, 4096, 32768, 64, 64, True, False, True): (3, 256, 3, 4), + (4096, 4096, 32768, 128, 128, False, True, True): (3, 256, 1, 4), + (4096, 4096, 32768, 128, 128, True, False, True): (1, 256, 1, 4), + (4096, 4096, 65536, 16, 16, False, True, True): (5, 256, 4, 4), + (4096, 4096, 65536, 16, 16, True, False, True): (5, 256, 4, 4), + (4096, 4096, 65536, 32, 32, False, True, True): (4, 256, 4, 8), + (4096, 4096, 65536, 32, 32, True, False, True): (4, 256, 3, 8), + (4096, 4096, 65536, 64, 64, False, True, True): (1, 256, 2, 4), + (4096, 4096, 65536, 64, 64, True, False, True): (1, 512, 3, 4), + (4096, 4096, 65536, 128, 128, False, True, True): (3, 512, 1, 4), + (4096, 4096, 65536, 128, 128, True, False, True): (1, 512, 1, 4), + (4096, 4096, 131072, 16, 16, False, True, True): (4, 512, 3, 4), + (4096, 4096, 131072, 16, 16, True, False, True): (5, 512, 4, 4), + (4096, 4096, 131072, 32, 32, False, True, True): (1, 512, 4, 8), + (4096, 4096, 131072, 32, 32, True, False, True): (4, 512, 4, 8), + (4096, 4096, 131072, 64, 64, False, True, True): (1, 512, 2, 4), + (4096, 4096, 131072, 64, 64, True, False, True): (1, 512, 2, 4), + (4096, 4096, 131072, 128, 128, False, True, True): (3, 1024, 1, 4), + (4096, 4096, 131072, 128, 128, True, False, True): (1, 1024, 1, 4), + (8192, 8192, 256, 16, 16, False, True, True): (2, 2, 6, 4), + (8192, 8192, 256, 16, 16, True, False, True): (2, 4, 2, 2), + (8192, 8192, 256, 32, 32, False, True, True): (4, 2, 3, 4), + (8192, 8192, 256, 32, 32, True, False, True): (4, 2, 3, 4), + (8192, 8192, 256, 64, 64, False, True, True): (2, 2, 3, 8), + (8192, 8192, 256, 64, 64, True, False, True): (6, 2, 3, 8), + (8192, 8192, 256, 128, 128, False, True, True): (3, 2, 1, 4), + (8192, 8192, 256, 128, 128, True, False, True): (1, 2, 1, 4), + (8192, 8192, 512, 16, 16, False, True, True): (4, 4, 3, 2), + (8192, 8192, 512, 16, 16, True, False, True): (4, 4, 3, 4), + (8192, 8192, 512, 32, 32, False, True, True): (1, 4, 3, 4), + (8192, 8192, 512, 32, 32, True, False, True): (5, 4, 3, 2), + (8192, 8192, 512, 64, 64, False, True, True): (1, 4, 3, 4), + (8192, 8192, 512, 64, 64, True, False, True): (2, 2, 3, 8), + (8192, 8192, 512, 128, 128, False, True, True): (4, 4, 2, 8), + (8192, 8192, 512, 128, 128, True, False, True): (4, 4, 2, 8), + (8192, 8192, 1024, 16, 16, False, True, True): (4, 8, 4, 4), + (8192, 8192, 1024, 16, 16, True, False, True): (4, 8, 4, 4), + (8192, 8192, 1024, 32, 32, False, True, True): (2, 4, 4, 8), + (8192, 8192, 1024, 32, 32, True, False, True): (1, 4, 3, 4), + (8192, 8192, 1024, 64, 64, False, True, True): (4, 8, 3, 4), + (8192, 8192, 1024, 64, 64, True, False, True): (2, 8, 3, 4), + (8192, 8192, 1024, 128, 128, False, True, True): (4, 8, 2, 8), + (8192, 8192, 1024, 128, 128, True, False, True): (4, 8, 1, 4), + (8192, 8192, 2048, 16, 16, False, True, True): (2, 8, 4, 4), + (8192, 8192, 2048, 16, 16, True, False, True): (2, 8, 4, 4), + (8192, 8192, 2048, 32, 32, False, True, True): (2, 8, 4, 8), + (8192, 8192, 2048, 32, 32, True, False, True): (2, 8, 4, 8), + (8192, 8192, 2048, 64, 64, False, True, True): (4, 8, 2, 4), + (8192, 8192, 2048, 64, 64, True, False, True): (4, 16, 3, 4), + (8192, 8192, 2048, 128, 128, False, True, True): (6, 16, 1, 4), + (8192, 8192, 2048, 128, 128, True, False, True): (4, 16, 1, 4), + (8192, 8192, 4096, 16, 16, False, True, True): (4, 32, 4, 2), + (8192, 8192, 4096, 16, 16, True, False, True): (4, 32, 4, 2), + (8192, 8192, 4096, 32, 32, False, True, True): (2, 16, 4, 8), + (8192, 8192, 4096, 32, 32, True, False, True): (4, 16, 4, 8), + (8192, 8192, 4096, 64, 64, False, True, True): (4, 16, 2, 4), + (8192, 8192, 4096, 64, 64, True, False, True): (4, 16, 2, 4), + (8192, 8192, 4096, 128, 128, False, True, True): (6, 32, 1, 4), + (8192, 8192, 4096, 128, 128, True, False, True): (4, 32, 1, 4), + (8192, 8192, 8192, 16, 16, False, True, True): (4, 64, 4, 2), + (8192, 8192, 8192, 16, 16, True, False, True): (4, 64, 4, 2), + (8192, 8192, 8192, 32, 32, False, True, True): (2, 32, 4, 8), + (8192, 8192, 8192, 32, 32, True, False, True): (2, 32, 4, 8), + (8192, 8192, 8192, 64, 64, False, True, True): (2, 32, 2, 4), + (8192, 8192, 8192, 64, 64, True, False, True): (4, 32, 2, 4), + (8192, 8192, 8192, 128, 128, False, True, True): (6, 64, 1, 4), + (8192, 8192, 8192, 128, 128, True, False, True): (4, 64, 1, 4), + (8192, 8192, 16384, 16, 16, False, True, True): (4, 64, 3, 4), + (8192, 8192, 16384, 16, 16, True, False, True): (4, 64, 4, 4), + (8192, 8192, 16384, 32, 32, False, True, True): (4, 64, 4, 8), + (8192, 8192, 16384, 32, 32, True, False, True): (4, 64, 4, 8), + (8192, 8192, 16384, 64, 64, False, True, True): (4, 64, 2, 4), + (8192, 8192, 16384, 64, 64, True, False, True): (4, 64, 3, 8), + (8192, 8192, 16384, 128, 128, False, True, True): (6, 128, 1, 4), + (8192, 8192, 16384, 128, 128, True, False, True): (4, 128, 1, 4), + (8192, 8192, 32768, 16, 16, False, True, True): (3, 128, 4, 4), + (8192, 8192, 32768, 16, 16, True, False, True): (3, 128, 4, 4), + (8192, 8192, 32768, 32, 32, False, True, True): (2, 128, 4, 8), + (8192, 8192, 32768, 32, 32, True, False, True): (2, 128, 4, 8), + (8192, 8192, 32768, 64, 64, False, True, True): (2, 128, 2, 4), + (8192, 8192, 32768, 64, 64, True, False, True): (2, 128, 3, 8), + (8192, 8192, 32768, 128, 128, False, True, True): (6, 256, 1, 4), + (8192, 8192, 32768, 128, 128, True, False, True): (4, 256, 1, 4), + (8192, 8192, 65536, 16, 16, False, True, True): (3, 256, 4, 4), + (8192, 8192, 65536, 16, 16, True, False, True): (4, 256, 4, 4), + (8192, 8192, 65536, 32, 32, False, True, True): (2, 256, 4, 8), + (8192, 8192, 65536, 32, 32, True, False, True): (2, 256, 3, 8), + (8192, 8192, 65536, 64, 64, False, True, True): (2, 256, 2, 4), + (8192, 8192, 65536, 64, 64, True, False, True): (4, 256, 3, 8), + (8192, 8192, 65536, 128, 128, False, True, True): (6, 512, 1, 4), + (8192, 8192, 65536, 128, 128, True, False, True): (4, 512, 1, 4), + (8192, 8192, 131072, 16, 16, False, True, True): (4, 512, 4, 4), + (8192, 8192, 131072, 16, 16, True, False, True): (3, 512, 4, 4), + (8192, 8192, 131072, 32, 32, False, True, True): (2, 512, 4, 8), + (8192, 8192, 131072, 32, 32, True, False, True): (2, 512, 4, 8), + (8192, 8192, 131072, 64, 64, False, True, True): (2, 512, 2, 4), + (8192, 8192, 131072, 64, 64, True, False, True): (2, 512, 2, 4), + (8192, 8192, 131072, 128, 128, False, True, True): (4, 1024, 1, 4), + (8192, 8192, 131072, 128, 128, True, False, True): (4, 1024, 1, 4), + (16384, 16384, 256, 16, 16, False, True, True): (2, 2, 3, 2), + (16384, 16384, 256, 16, 16, True, False, True): (2, 2, 6, 4), + (16384, 16384, 256, 32, 32, False, True, True): (4, 2, 3, 4), + (16384, 16384, 256, 32, 32, True, False, True): (4, 2, 3, 2), + (16384, 16384, 256, 64, 64, False, True, True): (2, 2, 5, 4), + (16384, 16384, 256, 64, 64, True, False, True): (2, 2, 3, 8), + (16384, 16384, 256, 128, 128, False, True, True): (4, 2, 2, 8), + (16384, 16384, 256, 128, 128, True, False, True): (2, 2, 1, 4), + (16384, 16384, 512, 16, 16, False, True, True): (1, 2, 4, 4), + (16384, 16384, 512, 16, 16, True, False, True): (1, 2, 4, 4), + (16384, 16384, 512, 32, 32, False, True, True): (2, 2, 3, 8), + (16384, 16384, 512, 32, 32, True, False, True): (2, 2, 4, 8), + (16384, 16384, 512, 64, 64, False, True, True): (4, 4, 3, 4), + (16384, 16384, 512, 64, 64, True, False, True): (2, 4, 3, 4), + (16384, 16384, 512, 128, 128, False, True, True): (4, 4, 2, 8), + (16384, 16384, 512, 128, 128, True, False, True): (4, 4, 2, 8), + (16384, 16384, 1024, 16, 16, False, True, True): (4, 8, 4, 4), + (16384, 16384, 1024, 16, 16, True, False, True): (2, 4, 4, 4), + (16384, 16384, 1024, 32, 32, False, True, True): (2, 4, 4, 8), + (16384, 16384, 1024, 32, 32, True, False, True): (2, 4, 4, 8), + (16384, 16384, 1024, 64, 64, False, True, True): (4, 4, 2, 4), + (16384, 16384, 1024, 64, 64, True, False, True): (2, 4, 2, 4), + (16384, 16384, 1024, 128, 128, False, True, True): (6, 8, 1, 4), + (16384, 16384, 1024, 128, 128, True, False, True): (4, 8, 1, 4), + (16384, 16384, 2048, 16, 16, False, True, True): (2, 8, 4, 4), + (16384, 16384, 2048, 16, 16, True, False, True): (2, 8, 4, 4), + (16384, 16384, 2048, 32, 32, False, True, True): (2, 8, 4, 8), + (16384, 16384, 2048, 32, 32, True, False, True): (2, 8, 4, 8), + (16384, 16384, 2048, 64, 64, False, True, True): (2, 8, 2, 4), + (16384, 16384, 2048, 64, 64, True, False, True): (2, 8, 2, 4), + (16384, 16384, 2048, 128, 128, False, True, True): (4, 16, 2, 8), + (16384, 16384, 2048, 128, 128, True, False, True): (4, 16, 1, 4), + (16384, 16384, 4096, 16, 16, False, True, True): (2, 16, 4, 4), + (16384, 16384, 4096, 16, 16, True, False, True): (2, 16, 4, 4), + (16384, 16384, 4096, 32, 32, False, True, True): (1, 16, 4, 8), + (16384, 16384, 4096, 32, 32, True, False, True): (2, 16, 3, 4), + (16384, 16384, 4096, 64, 64, False, True, True): (1, 16, 2, 4), + (16384, 16384, 4096, 64, 64, True, False, True): (2, 16, 2, 4), + (16384, 16384, 4096, 128, 128, False, True, True): (4, 32, 2, 8), + (16384, 16384, 4096, 128, 128, True, False, True): (4, 32, 1, 4), + (16384, 16384, 8192, 16, 16, False, True, True): (2, 64, 4, 2), + (16384, 16384, 8192, 16, 16, True, False, True): (2, 64, 4, 2), + (16384, 16384, 8192, 32, 32, False, True, True): (2, 32, 4, 8), + (16384, 16384, 8192, 32, 32, True, False, True): (2, 32, 4, 8), + (16384, 16384, 8192, 64, 64, False, True, True): (2, 32, 2, 4), + (16384, 16384, 8192, 64, 64, True, False, True): (2, 32, 4, 8), + (16384, 16384, 8192, 128, 128, False, True, True): (4, 64, 2, 8), + (16384, 16384, 8192, 128, 128, True, False, True): (4, 64, 1, 4), + (16384, 16384, 16384, 16, 16, False, True, True): (1, 64, 4, 4), + (16384, 16384, 16384, 16, 16, True, False, True): (1, 64, 4, 4), + (16384, 16384, 16384, 32, 32, False, True, True): (1, 64, 4, 8), + (16384, 16384, 16384, 32, 32, True, False, True): (1, 64, 4, 8), + (16384, 16384, 16384, 64, 64, False, True, True): (1, 64, 2, 4), + (16384, 16384, 16384, 64, 64, True, False, True): (1, 64, 3, 8), + (16384, 16384, 16384, 128, 128, False, True, True): (4, 128, 1, 4), + (16384, 16384, 16384, 128, 128, True, False, True): (4, 128, 1, 4), + (16384, 16384, 32768, 16, 16, False, True, True): (1, 128, 4, 4), + (16384, 16384, 32768, 16, 16, True, False, True): (1, 128, 4, 4), + (16384, 16384, 32768, 32, 32, False, True, True): (1, 128, 3, 4), + (16384, 16384, 32768, 32, 32, True, False, True): (1, 128, 3, 8), + (16384, 16384, 32768, 64, 64, False, True, True): (2, 128, 2, 4), + (16384, 16384, 32768, 64, 64, True, False, True): (1, 128, 4, 8), + (16384, 16384, 32768, 128, 128, False, True, True): (4, 256, 2, 8), + (16384, 16384, 32768, 128, 128, True, False, True): (4, 256, 1, 4), + (16384, 16384, 65536, 16, 16, False, True, True): (1, 256, 3, 4), + (16384, 16384, 65536, 16, 16, True, False, True): (1, 256, 4, 4), + (16384, 16384, 65536, 32, 32, False, True, True): (1, 256, 4, 8), + (16384, 16384, 65536, 32, 32, True, False, True): (1, 256, 3, 4), + (16384, 16384, 65536, 64, 64, False, True, True): (2, 256, 2, 4), + (16384, 16384, 65536, 64, 64, True, False, True): (1, 256, 3, 8), + (16384, 16384, 65536, 128, 128, False, True, True): (4, 512, 2, 8), + (16384, 16384, 65536, 128, 128, True, False, True): (4, 512, 1, 4), + (16384, 16384, 131072, 16, 16, False, True, True): (1, 512, 4, 4), + (16384, 16384, 131072, 16, 16, True, False, True): (1, 512, 3, 2), + (16384, 16384, 131072, 32, 32, False, True, True): (1, 512, 4, 8), + (16384, 16384, 131072, 32, 32, True, False, True): (1, 512, 3, 2), + (16384, 16384, 131072, 64, 64, False, True, True): (1, 512, 2, 4), + (16384, 16384, 131072, 64, 64, True, False, True): (1, 512, 2, 4), + (16384, 16384, 131072, 128, 128, False, True, True): (4, 1024, 1, 4), + (16384, 16384, 131072, 128, 128, True, False, True): (4, 1024, 1, 4), + }, + ("bsr_dense_addmm", "NVIDIA A100-SXM4-80GB", (0, torch.float32, 0.5)): { + (16, 16, 16, 16, 16, False, False, False): (2, 1, 1, 16), + (16, 16, 16, 16, 16, False, False, True): (1, 1, 2, 4), + (16, 16, 16, 16, 16, False, True, False): (1, 1, 2, 16), + (16, 16, 16, 16, 16, False, True, True): (2, 1, 2, 8), + (16, 16, 16, 16, 16, True, False, False): (1, 1, 1, 2), + (16, 16, 16, 16, 16, True, False, True): (2, 1, 1, 4), + (16, 16, 32, 16, 16, False, False, False): (1, 1, 1, 2), + (16, 16, 32, 16, 16, False, False, True): (1, 1, 2, 8), + (16, 16, 32, 16, 16, False, True, False): (1, 2, 1, 4), + (16, 16, 32, 16, 16, False, True, True): (1, 2, 2, 4), + (16, 16, 32, 16, 16, True, False, False): (1, 1, 2, 4), + (16, 16, 32, 16, 16, True, False, True): (1, 2, 2, 4), + (16, 16, 64, 16, 16, False, False, False): (1, 4, 1, 4), + (16, 16, 64, 16, 16, False, False, True): (2, 2, 1, 4), + (16, 16, 64, 16, 16, False, True, False): (1, 4, 1, 4), + (16, 16, 64, 16, 16, False, True, True): (1, 4, 1, 8), + (16, 16, 64, 16, 16, True, False, False): (1, 2, 1, 4), + (16, 16, 64, 16, 16, True, False, True): (1, 4, 2, 8), + (16, 32, 16, 16, 16, False, False, False): (1, 1, 2, 8), + (16, 32, 16, 16, 16, False, False, True): (2, 1, 1, 4), + (16, 32, 16, 16, 16, False, True, False): (1, 1, 1, 4), + (16, 32, 16, 16, 16, False, True, True): (1, 1, 1, 4), + (16, 32, 16, 16, 16, True, False, False): (1, 1, 1, 4), + (16, 32, 16, 16, 16, True, False, True): (1, 1, 2, 8), + (16, 32, 16, 16, 32, False, False, False): (1, 1, 2, 4), + (16, 32, 16, 16, 32, False, False, True): (2, 1, 2, 2), + (16, 32, 16, 16, 32, False, True, False): (1, 1, 1, 8), + (16, 32, 16, 16, 32, False, True, True): (1, 1, 1, 2), + (16, 32, 16, 16, 32, True, False, False): (3, 1, 1, 4), + (16, 32, 16, 16, 32, True, False, True): (1, 1, 1, 4), + (16, 32, 32, 16, 16, False, False, False): (1, 2, 1, 4), + (16, 32, 32, 16, 16, False, False, True): (2, 2, 1, 4), + (16, 32, 32, 16, 16, False, True, False): (1, 2, 1, 2), + (16, 32, 32, 16, 16, False, True, True): (1, 2, 1, 4), + (16, 32, 32, 16, 16, True, False, False): (1, 2, 1, 4), + (16, 32, 32, 16, 16, True, False, True): (1, 2, 1, 4), + (16, 32, 32, 16, 32, False, False, False): (1, 1, 2, 4), + (16, 32, 32, 16, 32, False, False, True): (1, 2, 1, 4), + (16, 32, 32, 16, 32, False, True, False): (1, 2, 2, 8), + (16, 32, 32, 16, 32, False, True, True): (1, 2, 1, 1), + (16, 32, 32, 16, 32, True, False, False): (1, 2, 1, 2), + (16, 32, 32, 16, 32, True, False, True): (1, 2, 1, 4), + (16, 32, 64, 16, 16, False, False, False): (1, 2, 1, 4), + (16, 32, 64, 16, 16, False, False, True): (2, 4, 1, 4), + (16, 32, 64, 16, 16, False, True, False): (1, 4, 2, 4), + (16, 32, 64, 16, 16, False, True, True): (1, 4, 1, 4), + (16, 32, 64, 16, 16, True, False, False): (1, 2, 2, 8), + (16, 32, 64, 16, 16, True, False, True): (1, 4, 1, 2), + (16, 32, 64, 16, 32, False, False, False): (1, 4, 1, 4), + (16, 32, 64, 16, 32, False, False, True): (1, 4, 3, 4), + (16, 32, 64, 16, 32, False, True, False): (1, 2, 1, 4), + (16, 32, 64, 16, 32, False, True, True): (1, 4, 1, 4), + (16, 32, 64, 16, 32, True, False, False): (1, 2, 1, 8), + (16, 32, 64, 16, 32, True, False, True): (1, 2, 1, 4), + (16, 64, 16, 16, 32, False, False, False): (1, 1, 1, 2), + (16, 64, 16, 16, 32, False, False, True): (1, 1, 1, 8), + (16, 64, 16, 16, 32, False, True, False): (1, 1, 1, 8), + (16, 64, 16, 16, 32, False, True, True): (1, 1, 1, 4), + (16, 64, 16, 16, 32, True, False, False): (1, 1, 1, 8), + (16, 64, 16, 16, 32, True, False, True): (1, 1, 1, 4), + (16, 64, 32, 16, 32, False, False, False): (1, 2, 1, 4), + (16, 64, 32, 16, 32, False, False, True): (1, 1, 1, 4), + (16, 64, 32, 16, 32, False, True, False): (1, 2, 1, 1), + (16, 64, 32, 16, 32, False, True, True): (1, 2, 1, 8), + (16, 64, 32, 16, 32, True, False, False): (2, 2, 1, 4), + (16, 64, 32, 16, 32, True, False, True): (2, 2, 1, 4), + (16, 64, 64, 16, 32, False, False, False): (1, 2, 1, 4), + (16, 64, 64, 16, 32, False, False, True): (1, 4, 1, 4), + (16, 64, 64, 16, 32, False, True, False): (1, 4, 1, 4), + (16, 64, 64, 16, 32, False, True, True): (1, 4, 1, 4), + (16, 64, 64, 16, 32, True, False, False): (1, 4, 1, 2), + (16, 64, 64, 16, 32, True, False, True): (3, 4, 1, 4), + (32, 16, 16, 16, 16, False, False, False): (1, 1, 2, 4), + (32, 16, 16, 16, 16, False, False, True): (1, 1, 1, 2), + (32, 16, 16, 16, 16, False, True, False): (1, 1, 2, 4), + (32, 16, 16, 16, 16, False, True, True): (1, 1, 2, 4), + (32, 16, 16, 16, 16, True, False, False): (1, 1, 3, 8), + (32, 16, 16, 16, 16, True, False, True): (1, 1, 2, 4), + (32, 16, 32, 16, 16, False, False, False): (1, 2, 1, 4), + (32, 16, 32, 16, 16, False, False, True): (1, 2, 3, 4), + (32, 16, 32, 16, 16, False, True, False): (1, 1, 1, 8), + (32, 16, 32, 16, 16, False, True, True): (1, 2, 1, 4), + (32, 16, 32, 16, 16, True, False, False): (1, 1, 1, 2), + (32, 16, 32, 16, 16, True, False, True): (1, 1, 1, 4), + (32, 16, 64, 16, 16, False, False, False): (1, 4, 1, 4), + (32, 16, 64, 16, 16, False, False, True): (3, 4, 1, 4), + (32, 16, 64, 16, 16, False, True, False): (1, 4, 1, 1), + (32, 16, 64, 16, 16, False, True, True): (1, 4, 1, 4), + (32, 16, 64, 16, 16, True, False, False): (1, 4, 1, 4), + (32, 16, 64, 16, 16, True, False, True): (1, 4, 1, 4), + (32, 32, 16, 16, 16, False, False, False): (1, 1, 1, 2), + (32, 32, 16, 16, 16, False, False, True): (2, 1, 1, 4), + (32, 32, 16, 16, 16, False, True, False): (1, 1, 1, 2), + (32, 32, 16, 16, 16, False, True, True): (2, 1, 1, 4), + (32, 32, 16, 16, 16, True, False, False): (3, 1, 2, 4), + (32, 32, 16, 16, 16, True, False, True): (1, 1, 2, 4), + (32, 32, 16, 16, 32, False, False, False): (2, 1, 1, 2), + (32, 32, 16, 16, 32, False, False, True): (1, 1, 1, 4), + (32, 32, 16, 16, 32, False, True, False): (1, 1, 1, 4), + (32, 32, 16, 16, 32, False, True, True): (1, 1, 1, 8), + (32, 32, 16, 16, 32, True, False, False): (1, 1, 1, 8), + (32, 32, 16, 16, 32, True, False, True): (1, 1, 1, 4), + (32, 32, 16, 32, 32, False, False, False): (2, 1, 1, 4), + (32, 32, 16, 32, 32, False, False, True): (1, 1, 2, 4), + (32, 32, 16, 32, 32, False, True, False): (2, 1, 1, 1), + (32, 32, 16, 32, 32, False, True, True): (2, 1, 2, 4), + (32, 32, 16, 32, 32, True, False, False): (1, 1, 1, 8), + (32, 32, 16, 32, 32, True, False, True): (1, 1, 1, 4), + (32, 32, 32, 16, 16, False, False, False): (1, 1, 1, 4), + (32, 32, 32, 16, 16, False, False, True): (1, 2, 1, 2), + (32, 32, 32, 16, 16, False, True, False): (2, 2, 1, 4), + (32, 32, 32, 16, 16, False, True, True): (1, 2, 2, 4), + (32, 32, 32, 16, 16, True, False, False): (1, 2, 1, 4), + (32, 32, 32, 16, 16, True, False, True): (2, 2, 1, 4), + (32, 32, 32, 16, 32, False, False, False): (1, 2, 1, 4), + (32, 32, 32, 16, 32, False, False, True): (1, 2, 1, 4), + (32, 32, 32, 16, 32, False, True, False): (1, 2, 1, 4), + (32, 32, 32, 16, 32, False, True, True): (1, 2, 1, 4), + (32, 32, 32, 16, 32, True, False, False): (2, 1, 1, 2), + (32, 32, 32, 16, 32, True, False, True): (2, 2, 2, 4), + (32, 32, 32, 32, 32, False, False, False): (1, 1, 1, 4), + (32, 32, 32, 32, 32, False, False, True): (1, 1, 1, 2), + (32, 32, 32, 32, 32, False, True, False): (1, 1, 1, 4), + (32, 32, 32, 32, 32, False, True, True): (1, 1, 2, 2), + (32, 32, 32, 32, 32, True, False, False): (1, 1, 1, 2), + (32, 32, 32, 32, 32, True, False, True): (1, 1, 2, 1), + (32, 32, 64, 16, 16, False, False, False): (2, 4, 1, 4), + (32, 32, 64, 16, 16, False, False, True): (1, 4, 2, 4), + (32, 32, 64, 16, 16, False, True, False): (1, 4, 1, 4), + (32, 32, 64, 16, 16, False, True, True): (1, 4, 1, 4), + (32, 32, 64, 16, 16, True, False, False): (1, 2, 1, 4), + (32, 32, 64, 16, 16, True, False, True): (2, 4, 1, 4), + (32, 32, 64, 16, 32, False, False, False): (1, 4, 1, 8), + (32, 32, 64, 16, 32, False, False, True): (1, 4, 1, 4), + (32, 32, 64, 16, 32, False, True, False): (1, 4, 1, 4), + (32, 32, 64, 16, 32, False, True, True): (2, 4, 1, 4), + (32, 32, 64, 16, 32, True, False, False): (1, 2, 2, 4), + (32, 32, 64, 16, 32, True, False, True): (2, 4, 1, 4), + (32, 32, 64, 32, 32, False, False, False): (2, 2, 1, 4), + (32, 32, 64, 32, 32, False, False, True): (1, 1, 1, 4), + (32, 32, 64, 32, 32, False, True, False): (1, 1, 1, 8), + (32, 32, 64, 32, 32, False, True, True): (2, 1, 1, 4), + (32, 32, 64, 32, 32, True, False, False): (1, 1, 1, 4), + (32, 32, 64, 32, 32, True, False, True): (1, 2, 1, 1), + (32, 64, 16, 16, 32, False, False, False): (1, 1, 2, 2), + (32, 64, 16, 16, 32, False, False, True): (2, 1, 1, 4), + (32, 64, 16, 16, 32, False, True, False): (1, 1, 1, 8), + (32, 64, 16, 16, 32, False, True, True): (1, 1, 3, 4), + (32, 64, 16, 16, 32, True, False, False): (1, 1, 1, 2), + (32, 64, 16, 16, 32, True, False, True): (1, 1, 2, 4), + (32, 64, 16, 32, 32, False, False, False): (1, 1, 1, 2), + (32, 64, 16, 32, 32, False, False, True): (1, 1, 3, 4), + (32, 64, 16, 32, 32, False, True, False): (1, 1, 2, 4), + (32, 64, 16, 32, 32, False, True, True): (1, 1, 1, 8), + (32, 64, 16, 32, 32, True, False, False): (1, 1, 2, 4), + (32, 64, 16, 32, 32, True, False, True): (1, 1, 1, 8), + (32, 64, 32, 16, 32, False, False, False): (1, 2, 1, 4), + (32, 64, 32, 16, 32, False, False, True): (1, 2, 3, 4), + (32, 64, 32, 16, 32, False, True, False): (1, 2, 1, 8), + (32, 64, 32, 16, 32, False, True, True): (3, 2, 1, 4), + (32, 64, 32, 16, 32, True, False, False): (1, 1, 1, 8), + (32, 64, 32, 16, 32, True, False, True): (1, 2, 1, 4), + (32, 64, 32, 32, 32, False, False, False): (1, 1, 1, 1), + (32, 64, 32, 32, 32, False, False, True): (1, 1, 1, 4), + (32, 64, 32, 32, 32, False, True, False): (1, 1, 1, 4), + (32, 64, 32, 32, 32, False, True, True): (1, 1, 1, 4), + (32, 64, 32, 32, 32, True, False, False): (1, 1, 1, 4), + (32, 64, 32, 32, 32, True, False, True): (1, 1, 2, 8), + (32, 64, 64, 16, 32, False, False, False): (2, 4, 1, 4), + (32, 64, 64, 16, 32, False, False, True): (1, 4, 1, 4), + (32, 64, 64, 16, 32, False, True, False): (1, 4, 1, 4), + (32, 64, 64, 16, 32, False, True, True): (2, 4, 1, 4), + (32, 64, 64, 16, 32, True, False, False): (1, 4, 1, 4), + (32, 64, 64, 16, 32, True, False, True): (1, 4, 1, 4), + (32, 64, 64, 32, 32, False, False, False): (2, 2, 1, 4), + (32, 64, 64, 32, 32, False, False, True): (1, 2, 1, 8), + (32, 64, 64, 32, 32, False, True, False): (1, 2, 1, 4), + (32, 64, 64, 32, 32, False, True, True): (1, 2, 1, 4), + (32, 64, 64, 32, 32, True, False, False): (2, 2, 1, 4), + (32, 64, 64, 32, 32, True, False, True): (1, 2, 3, 8), + (64, 32, 16, 32, 32, False, False, False): (1, 1, 1, 4), + (64, 32, 16, 32, 32, False, False, True): (3, 1, 2, 4), + (64, 32, 16, 32, 32, False, True, False): (2, 1, 1, 2), + (64, 32, 16, 32, 32, False, True, True): (1, 1, 1, 8), + (64, 32, 16, 32, 32, True, False, False): (1, 1, 1, 2), + (64, 32, 16, 32, 32, True, False, True): (1, 1, 1, 4), + (64, 32, 32, 32, 32, False, False, False): (1, 1, 1, 4), + (64, 32, 32, 32, 32, False, False, True): (1, 1, 2, 8), + (64, 32, 32, 32, 32, False, True, False): (1, 1, 1, 8), + (64, 32, 32, 32, 32, False, True, True): (1, 1, 1, 4), + (64, 32, 32, 32, 32, True, False, False): (1, 1, 2, 4), + (64, 32, 32, 32, 32, True, False, True): (1, 1, 3, 8), + (64, 32, 64, 32, 32, False, False, False): (1, 2, 1, 4), + (64, 32, 64, 32, 32, False, False, True): (2, 2, 1, 4), + (64, 32, 64, 32, 32, False, True, False): (1, 1, 1, 4), + (64, 32, 64, 32, 32, False, True, True): (1, 2, 1, 8), + (64, 32, 64, 32, 32, True, False, False): (2, 2, 1, 4), + (64, 32, 64, 32, 32, True, False, True): (1, 2, 1, 8), + (64, 64, 16, 32, 32, False, False, False): (1, 1, 2, 8), + (64, 64, 16, 32, 32, False, False, True): (2, 1, 2, 4), + (64, 64, 16, 32, 32, False, True, False): (1, 1, 1, 2), + (64, 64, 16, 32, 32, False, True, True): (1, 1, 2, 4), + (64, 64, 16, 32, 32, True, False, False): (1, 1, 1, 2), + (64, 64, 16, 32, 32, True, False, True): (1, 1, 2, 4), + (64, 64, 32, 32, 32, False, False, False): (1, 1, 1, 4), + (64, 64, 32, 32, 32, False, False, True): (2, 1, 1, 4), + (64, 64, 32, 32, 32, False, True, False): (1, 1, 1, 8), + (64, 64, 32, 32, 32, False, True, True): (2, 1, 1, 4), + (64, 64, 32, 32, 32, True, False, False): (1, 1, 1, 4), + (64, 64, 32, 32, 32, True, False, True): (1, 1, 1, 8), + (64, 64, 64, 32, 32, False, False, False): (2, 2, 1, 4), + (64, 64, 64, 32, 32, False, False, True): (1, 2, 1, 4), + (64, 64, 64, 32, 32, False, True, False): (1, 2, 1, 4), + (64, 64, 64, 32, 32, False, True, True): (2, 2, 1, 4), + (64, 64, 64, 32, 32, True, False, False): (1, 1, 1, 8), + (64, 64, 64, 32, 32, True, False, True): (1, 2, 2, 4), + (256, 256, 256, 16, 16, False, True, True): (1, 16, 3, 4), + (256, 256, 256, 16, 16, True, False, True): (2, 16, 1, 4), + (256, 256, 256, 32, 32, False, True, True): (1, 8, 4, 8), + (256, 256, 256, 32, 32, True, False, True): (4, 8, 4, 4), + (256, 256, 256, 64, 64, False, True, True): (1, 4, 4, 8), + (256, 256, 256, 64, 64, True, False, True): (1, 4, 3, 8), + (256, 256, 256, 128, 128, False, True, True): (7, 2, 1, 32), + (256, 256, 256, 128, 128, True, False, True): (3, 2, 1, 32), + (256, 256, 512, 16, 16, False, True, True): (1, 16, 5, 4), + (256, 256, 512, 16, 16, True, False, True): (1, 16, 3, 2), + (256, 256, 512, 32, 32, False, True, True): (4, 16, 4, 4), + (256, 256, 512, 32, 32, True, False, True): (4, 16, 3, 4), + (256, 256, 512, 64, 64, False, True, True): (1, 8, 3, 8), + (256, 256, 512, 64, 64, True, False, True): (1, 8, 3, 8), + (256, 256, 512, 128, 128, False, True, True): (1, 4, 1, 32), + (256, 256, 512, 128, 128, True, False, True): (3, 4, 1, 32), + (256, 256, 1024, 16, 16, False, True, True): (3, 32, 5, 2), + (256, 256, 1024, 16, 16, True, False, True): (2, 32, 5, 2), + (256, 256, 1024, 32, 32, False, True, True): (1, 32, 4, 4), + (256, 256, 1024, 32, 32, True, False, True): (1, 32, 5, 4), + (256, 256, 1024, 64, 64, False, True, True): (4, 16, 3, 8), + (256, 256, 1024, 64, 64, True, False, True): (1, 16, 3, 8), + (256, 256, 1024, 128, 128, False, True, True): (1, 8, 1, 32), + (256, 256, 1024, 128, 128, True, False, True): (3, 8, 1, 32), + (256, 256, 2048, 16, 16, False, True, True): (3, 32, 3, 4), + (256, 256, 2048, 16, 16, True, False, True): (1, 64, 3, 2), + (256, 256, 2048, 32, 32, False, True, True): (1, 64, 3, 4), + (256, 256, 2048, 32, 32, True, False, True): (1, 64, 3, 4), + (256, 256, 2048, 64, 64, False, True, True): (2, 32, 1, 8), + (256, 256, 2048, 64, 64, True, False, True): (2, 32, 1, 8), + (256, 256, 2048, 128, 128, False, True, True): (4, 16, 1, 32), + (256, 256, 2048, 128, 128, True, False, True): (4, 16, 1, 32), + (256, 256, 4096, 16, 16, False, True, True): (1, 32, 2, 4), + (256, 256, 4096, 16, 16, True, False, True): (1, 32, 3, 4), + (256, 256, 4096, 32, 32, False, True, True): (1, 128, 2, 4), + (256, 256, 4096, 32, 32, True, False, True): (1, 128, 2, 4), + (256, 256, 4096, 64, 64, False, True, True): (2, 64, 4, 8), + (256, 256, 4096, 64, 64, True, False, True): (3, 64, 2, 8), + (256, 256, 4096, 128, 128, False, True, True): (3, 32, 1, 32), + (256, 256, 4096, 128, 128, True, False, True): (2, 32, 1, 32), + (256, 256, 8192, 16, 16, False, True, True): (1, 64, 3, 4), + (256, 256, 8192, 16, 16, True, False, True): (2, 128, 3, 2), + (256, 256, 8192, 32, 32, False, True, True): (3, 128, 3, 4), + (256, 256, 8192, 32, 32, True, False, True): (1, 128, 3, 4), + (256, 256, 8192, 64, 64, False, True, True): (3, 128, 1, 4), + (256, 256, 8192, 64, 64, True, False, True): (4, 128, 2, 8), + (256, 256, 8192, 128, 128, False, True, True): (6, 64, 1, 32), + (256, 256, 8192, 128, 128, True, False, True): (2, 64, 1, 32), + (256, 256, 16384, 16, 16, False, True, True): (4, 128, 3, 4), + (256, 256, 16384, 16, 16, True, False, True): (3, 128, 3, 4), + (256, 256, 16384, 32, 32, False, True, True): (4, 256, 3, 4), + (256, 256, 16384, 32, 32, True, False, True): (2, 256, 3, 4), + (256, 256, 16384, 64, 64, False, True, True): (3, 256, 1, 4), + (256, 256, 16384, 64, 64, True, False, True): (2, 256, 2, 4), + (256, 256, 16384, 128, 128, False, True, True): (1, 128, 1, 32), + (256, 256, 16384, 128, 128, True, False, True): (3, 128, 1, 32), + (256, 256, 32768, 16, 16, False, True, True): (1, 256, 3, 4), + (256, 256, 32768, 16, 16, True, False, True): (2, 128, 3, 4), + (256, 256, 32768, 32, 32, False, True, True): (2, 512, 3, 4), + (256, 256, 32768, 32, 32, True, False, True): (4, 512, 3, 4), + (256, 256, 32768, 64, 64, False, True, True): (1, 512, 1, 8), + (256, 256, 32768, 64, 64, True, False, True): (1, 512, 2, 4), + (256, 256, 32768, 128, 128, False, True, True): (1, 256, 1, 32), + (256, 256, 32768, 128, 128, True, False, True): (1, 256, 1, 32), + (256, 256, 65536, 16, 16, False, True, True): (2, 512, 3, 4), + (256, 256, 65536, 16, 16, True, False, True): (1, 256, 3, 4), + (256, 256, 65536, 32, 32, False, True, True): (1, 1024, 3, 4), + (256, 256, 65536, 32, 32, True, False, True): (2, 1024, 3, 4), + (256, 256, 65536, 64, 64, False, True, True): (1, 1024, 2, 4), + (256, 256, 65536, 64, 64, True, False, True): (1, 1024, 2, 4), + (256, 256, 65536, 128, 128, False, True, True): (1, 512, 1, 32), + (256, 256, 65536, 128, 128, True, False, True): (2, 512, 1, 32), + (256, 256, 131072, 16, 16, False, True, True): (1, 1024, 3, 4), + (256, 256, 131072, 16, 16, True, False, True): (1, 512, 3, 4), + (256, 256, 131072, 32, 32, False, True, True): (1, 2048, 3, 4), + (256, 256, 131072, 32, 32, True, False, True): (1, 2048, 3, 4), + (256, 256, 131072, 64, 64, False, True, True): (1, 2048, 1, 8), + (256, 256, 131072, 64, 64, True, False, True): (1, 2048, 2, 4), + (256, 256, 131072, 128, 128, False, True, True): (1, 1024, 1, 32), + (256, 256, 131072, 128, 128, True, False, True): (4, 1024, 1, 32), + (512, 512, 256, 16, 16, False, True, True): (1, 8, 4, 4), + (512, 512, 256, 16, 16, True, False, True): (1, 8, 3, 2), + (512, 512, 256, 32, 32, False, True, True): (4, 8, 3, 4), + (512, 512, 256, 32, 32, True, False, True): (4, 8, 3, 4), + (512, 512, 256, 64, 64, False, True, True): (3, 4, 3, 8), + (512, 512, 256, 64, 64, True, False, True): (5, 4, 3, 8), + (512, 512, 256, 128, 128, False, True, True): (1, 2, 1, 32), + (512, 512, 256, 128, 128, True, False, True): (3, 2, 1, 32), + (512, 512, 512, 16, 16, False, True, True): (2, 16, 3, 2), + (512, 512, 512, 16, 16, True, False, True): (1, 8, 4, 4), + (512, 512, 512, 32, 32, False, True, True): (3, 16, 3, 4), + (512, 512, 512, 32, 32, True, False, True): (5, 16, 2, 4), + (512, 512, 512, 64, 64, False, True, True): (1, 8, 3, 8), + (512, 512, 512, 64, 64, True, False, True): (3, 8, 3, 8), + (512, 512, 512, 128, 128, False, True, True): (1, 4, 1, 32), + (512, 512, 512, 128, 128, True, False, True): (3, 4, 1, 16), + (512, 512, 1024, 16, 16, False, True, True): (1, 16, 3, 4), + (512, 512, 1024, 16, 16, True, False, True): (3, 16, 3, 4), + (512, 512, 1024, 32, 32, False, True, True): (3, 32, 3, 4), + (512, 512, 1024, 32, 32, True, False, True): (3, 32, 2, 4), + (512, 512, 1024, 64, 64, False, True, True): (1, 16, 3, 8), + (512, 512, 1024, 64, 64, True, False, True): (4, 16, 3, 8), + (512, 512, 1024, 128, 128, False, True, True): (4, 8, 1, 32), + (512, 512, 1024, 128, 128, True, False, True): (4, 8, 1, 32), + (512, 512, 2048, 16, 16, False, True, True): (5, 16, 3, 4), + (512, 512, 2048, 16, 16, True, False, True): (5, 16, 3, 4), + (512, 512, 2048, 32, 32, False, True, True): (1, 32, 3, 4), + (512, 512, 2048, 32, 32, True, False, True): (1, 32, 4, 4), + (512, 512, 2048, 64, 64, False, True, True): (4, 32, 3, 8), + (512, 512, 2048, 64, 64, True, False, True): (4, 32, 3, 8), + (512, 512, 2048, 128, 128, False, True, True): (3, 16, 1, 32), + (512, 512, 2048, 128, 128, True, False, True): (3, 16, 1, 32), + (512, 512, 4096, 16, 16, False, True, True): (4, 32, 3, 4), + (512, 512, 4096, 16, 16, True, False, True): (4, 64, 3, 2), + (512, 512, 4096, 32, 32, False, True, True): (3, 64, 3, 4), + (512, 512, 4096, 32, 32, True, False, True): (3, 64, 3, 4), + (512, 512, 4096, 64, 64, False, True, True): (4, 64, 2, 4), + (512, 512, 4096, 64, 64, True, False, True): (1, 64, 2, 4), + (512, 512, 4096, 128, 128, False, True, True): (1, 32, 1, 32), + (512, 512, 4096, 128, 128, True, False, True): (1, 32, 1, 32), + (512, 512, 8192, 16, 16, False, True, True): (1, 64, 3, 4), + (512, 512, 8192, 16, 16, True, False, True): (4, 64, 3, 4), + (512, 512, 8192, 32, 32, False, True, True): (2, 128, 3, 4), + (512, 512, 8192, 32, 32, True, False, True): (3, 128, 3, 4), + (512, 512, 8192, 64, 64, False, True, True): (1, 128, 2, 4), + (512, 512, 8192, 64, 64, True, False, True): (1, 128, 2, 4), + (512, 512, 8192, 128, 128, False, True, True): (6, 64, 1, 32), + (512, 512, 8192, 128, 128, True, False, True): (4, 64, 1, 32), + (512, 512, 16384, 16, 16, False, True, True): (1, 128, 3, 4), + (512, 512, 16384, 16, 16, True, False, True): (1, 64, 3, 4), + (512, 512, 16384, 32, 32, False, True, True): (1, 256, 3, 4), + (512, 512, 16384, 32, 32, True, False, True): (4, 256, 3, 4), + (512, 512, 16384, 64, 64, False, True, True): (1, 256, 2, 4), + (512, 512, 16384, 64, 64, True, False, True): (1, 256, 2, 4), + (512, 512, 16384, 128, 128, False, True, True): (1, 128, 1, 32), + (512, 512, 16384, 128, 128, True, False, True): (2, 128, 1, 32), + (512, 512, 32768, 16, 16, False, True, True): (1, 256, 3, 4), + (512, 512, 32768, 16, 16, True, False, True): (1, 128, 3, 4), + (512, 512, 32768, 32, 32, False, True, True): (1, 512, 3, 4), + (512, 512, 32768, 32, 32, True, False, True): (1, 512, 3, 4), + (512, 512, 32768, 64, 64, False, True, True): (1, 512, 2, 4), + (512, 512, 32768, 64, 64, True, False, True): (2, 512, 2, 4), + (512, 512, 32768, 128, 128, False, True, True): (1, 256, 1, 32), + (512, 512, 32768, 128, 128, True, False, True): (2, 256, 1, 32), + (512, 512, 65536, 16, 16, False, True, True): (1, 512, 3, 4), + (512, 512, 65536, 16, 16, True, False, True): (1, 256, 3, 4), + (512, 512, 65536, 32, 32, False, True, True): (1, 1024, 3, 4), + (512, 512, 65536, 32, 32, True, False, True): (1, 1024, 3, 4), + (512, 512, 65536, 64, 64, False, True, True): (1, 1024, 2, 4), + (512, 512, 65536, 64, 64, True, False, True): (1, 1024, 2, 4), + (512, 512, 65536, 128, 128, False, True, True): (1, 512, 1, 32), + (512, 512, 65536, 128, 128, True, False, True): (4, 512, 1, 32), + (512, 512, 131072, 16, 16, False, True, True): (1, 512, 3, 4), + (512, 512, 131072, 16, 16, True, False, True): (1, 512, 3, 4), + (512, 512, 131072, 32, 32, False, True, True): (1, 2048, 3, 4), + (512, 512, 131072, 32, 32, True, False, True): (1, 2048, 3, 4), + (512, 512, 131072, 64, 64, False, True, True): (1, 2048, 2, 4), + (512, 512, 131072, 64, 64, True, False, True): (1, 2048, 2, 4), + (512, 512, 131072, 128, 128, False, True, True): (1, 1024, 1, 32), + (512, 512, 131072, 128, 128, True, False, True): (2, 1024, 1, 32), + (1024, 1024, 256, 16, 16, False, True, True): (4, 8, 3, 2), + (1024, 1024, 256, 16, 16, True, False, True): (2, 8, 3, 2), + (1024, 1024, 256, 32, 32, False, True, True): (1, 8, 3, 4), + (1024, 1024, 256, 32, 32, True, False, True): (1, 8, 3, 4), + (1024, 1024, 256, 64, 64, False, True, True): (1, 4, 3, 8), + (1024, 1024, 256, 64, 64, True, False, True): (2, 4, 3, 8), + (1024, 1024, 256, 128, 128, False, True, True): (3, 2, 1, 32), + (1024, 1024, 256, 128, 128, True, False, True): (5, 2, 1, 32), + (1024, 1024, 512, 16, 16, False, True, True): (3, 8, 3, 4), + (1024, 1024, 512, 16, 16, True, False, True): (3, 8, 3, 4), + (1024, 1024, 512, 32, 32, False, True, True): (1, 16, 3, 4), + (1024, 1024, 512, 32, 32, True, False, True): (3, 16, 3, 4), + (1024, 1024, 512, 64, 64, False, True, True): (6, 8, 3, 8), + (1024, 1024, 512, 64, 64, True, False, True): (8, 8, 3, 8), + (1024, 1024, 512, 128, 128, False, True, True): (1, 4, 1, 32), + (1024, 1024, 512, 128, 128, True, False, True): (1, 4, 1, 32), + (1024, 1024, 1024, 16, 16, False, True, True): (4, 8, 3, 4), + (1024, 1024, 1024, 16, 16, True, False, True): (1, 8, 3, 4), + (1024, 1024, 1024, 32, 32, False, True, True): (4, 16, 4, 4), + (1024, 1024, 1024, 32, 32, True, False, True): (5, 16, 3, 4), + (1024, 1024, 1024, 64, 64, False, True, True): (6, 16, 3, 8), + (1024, 1024, 1024, 64, 64, True, False, True): (3, 16, 2, 4), + (1024, 1024, 1024, 128, 128, False, True, True): (1, 8, 1, 32), + (1024, 1024, 1024, 128, 128, True, False, True): (2, 8, 1, 32), + (1024, 1024, 2048, 16, 16, False, True, True): (4, 16, 3, 4), + (1024, 1024, 2048, 16, 16, True, False, True): (1, 16, 3, 4), + (1024, 1024, 2048, 32, 32, False, True, True): (1, 32, 3, 4), + (1024, 1024, 2048, 32, 32, True, False, True): (2, 32, 3, 4), + (1024, 1024, 2048, 64, 64, False, True, True): (4, 32, 2, 4), + (1024, 1024, 2048, 64, 64, True, False, True): (8, 32, 2, 4), + (1024, 1024, 2048, 128, 128, False, True, True): (1, 16, 1, 32), + (1024, 1024, 2048, 128, 128, True, False, True): (1, 16, 1, 32), + (1024, 1024, 4096, 16, 16, False, True, True): (4, 32, 3, 4), + (1024, 1024, 4096, 16, 16, True, False, True): (1, 64, 3, 2), + (1024, 1024, 4096, 32, 32, False, True, True): (1, 64, 3, 4), + (1024, 1024, 4096, 32, 32, True, False, True): (1, 64, 3, 4), + (1024, 1024, 4096, 64, 64, False, True, True): (2, 64, 2, 4), + (1024, 1024, 4096, 64, 64, True, False, True): (2, 64, 2, 4), + (1024, 1024, 4096, 128, 128, False, True, True): (1, 32, 1, 32), + (1024, 1024, 4096, 128, 128, True, False, True): (4, 32, 1, 32), + (1024, 1024, 8192, 16, 16, False, True, True): (1, 128, 3, 1), + (1024, 1024, 8192, 16, 16, True, False, True): (1, 128, 3, 1), + (1024, 1024, 8192, 32, 32, False, True, True): (1, 128, 3, 4), + (1024, 1024, 8192, 32, 32, True, False, True): (1, 128, 3, 4), + (1024, 1024, 8192, 64, 64, False, True, True): (2, 128, 2, 4), + (1024, 1024, 8192, 64, 64, True, False, True): (2, 128, 2, 4), + (1024, 1024, 8192, 128, 128, False, True, True): (1, 64, 1, 32), + (1024, 1024, 8192, 128, 128, True, False, True): (4, 64, 1, 32), + (1024, 1024, 16384, 16, 16, False, True, True): (1, 128, 2, 4), + (1024, 1024, 16384, 16, 16, True, False, True): (4, 256, 3, 1), + (1024, 1024, 16384, 32, 32, False, True, True): (1, 256, 3, 4), + (1024, 1024, 16384, 32, 32, True, False, True): (1, 256, 3, 4), + (1024, 1024, 16384, 64, 64, False, True, True): (1, 256, 2, 4), + (1024, 1024, 16384, 64, 64, True, False, True): (1, 256, 2, 4), + (1024, 1024, 16384, 128, 128, False, True, True): (1, 128, 1, 32), + (1024, 1024, 16384, 128, 128, True, False, True): (4, 128, 1, 32), + (1024, 1024, 32768, 16, 16, False, True, True): (1, 256, 2, 4), + (1024, 1024, 32768, 16, 16, True, False, True): (4, 512, 3, 1), + (1024, 1024, 32768, 32, 32, False, True, True): (1, 512, 3, 4), + (1024, 1024, 32768, 32, 32, True, False, True): (1, 512, 3, 4), + (1024, 1024, 32768, 64, 64, False, True, True): (1, 512, 2, 4), + (1024, 1024, 32768, 64, 64, True, False, True): (1, 512, 2, 4), + (1024, 1024, 32768, 128, 128, False, True, True): (1, 256, 1, 32), + (1024, 1024, 32768, 128, 128, True, False, True): (1, 256, 1, 32), + (1024, 1024, 65536, 16, 16, False, True, True): (1, 512, 2, 4), + (1024, 1024, 65536, 16, 16, True, False, True): (1, 1024, 3, 1), + (1024, 1024, 65536, 32, 32, False, True, True): (1, 1024, 3, 4), + (1024, 1024, 65536, 32, 32, True, False, True): (1, 512, 3, 4), + (1024, 1024, 65536, 64, 64, False, True, True): (1, 1024, 2, 4), + (1024, 1024, 65536, 64, 64, True, False, True): (1, 1024, 2, 4), + (1024, 1024, 65536, 128, 128, False, True, True): (1, 512, 1, 32), + (1024, 1024, 65536, 128, 128, True, False, True): (1, 512, 1, 32), + (1024, 1024, 131072, 16, 16, False, True, True): (4, 2048, 3, 1), + (1024, 1024, 131072, 16, 16, True, False, True): (4, 2048, 3, 1), + (1024, 1024, 131072, 32, 32, False, True, True): (1, 2048, 3, 4), + (1024, 1024, 131072, 32, 32, True, False, True): (1, 1024, 3, 4), + (1024, 1024, 131072, 64, 64, False, True, True): (1, 2048, 2, 4), + (1024, 1024, 131072, 64, 64, True, False, True): (1, 2048, 2, 4), + (1024, 1024, 131072, 128, 128, False, True, True): (1, 1024, 1, 32), + (1024, 1024, 131072, 128, 128, True, False, True): (1, 1024, 1, 32), + (2048, 2048, 256, 16, 16, False, True, True): (1, 4, 3, 4), + (2048, 2048, 256, 16, 16, True, False, True): (1, 4, 3, 4), + (2048, 2048, 256, 32, 32, False, True, True): (3, 8, 3, 4), + (2048, 2048, 256, 32, 32, True, False, True): (3, 8, 3, 4), + (2048, 2048, 256, 64, 64, False, True, True): (4, 4, 4, 8), + (2048, 2048, 256, 64, 64, True, False, True): (8, 4, 4, 8), + (2048, 2048, 256, 128, 128, False, True, True): (3, 2, 1, 32), + (2048, 2048, 256, 128, 128, True, False, True): (3, 2, 1, 32), + (2048, 2048, 512, 16, 16, False, True, True): (4, 8, 3, 2), + (2048, 2048, 512, 16, 16, True, False, True): (4, 8, 3, 2), + (2048, 2048, 512, 32, 32, False, True, True): (3, 8, 3, 4), + (2048, 2048, 512, 32, 32, True, False, True): (1, 16, 2, 4), + (2048, 2048, 512, 64, 64, False, True, True): (4, 8, 2, 4), + (2048, 2048, 512, 64, 64, True, False, True): (4, 8, 2, 4), + (2048, 2048, 512, 128, 128, False, True, True): (1, 4, 1, 32), + (2048, 2048, 512, 128, 128, True, False, True): (4, 4, 1, 32), + (2048, 2048, 1024, 16, 16, False, True, True): (4, 8, 3, 4), + (2048, 2048, 1024, 16, 16, True, False, True): (4, 8, 3, 4), + (2048, 2048, 1024, 32, 32, False, True, True): (4, 16, 3, 4), + (2048, 2048, 1024, 32, 32, True, False, True): (1, 16, 3, 4), + (2048, 2048, 1024, 64, 64, False, True, True): (2, 16, 2, 4), + (2048, 2048, 1024, 64, 64, True, False, True): (2, 16, 2, 4), + (2048, 2048, 1024, 128, 128, False, True, True): (8, 8, 1, 32), + (2048, 2048, 1024, 128, 128, True, False, True): (4, 8, 1, 32), + (2048, 2048, 2048, 16, 16, False, True, True): (4, 32, 3, 1), + (2048, 2048, 2048, 16, 16, True, False, True): (3, 32, 3, 2), + (2048, 2048, 2048, 32, 32, False, True, True): (1, 32, 3, 4), + (2048, 2048, 2048, 32, 32, True, False, True): (1, 32, 3, 4), + (2048, 2048, 2048, 64, 64, False, True, True): (2, 32, 2, 4), + (2048, 2048, 2048, 64, 64, True, False, True): (2, 32, 2, 4), + (2048, 2048, 2048, 128, 128, False, True, True): (6, 16, 1, 32), + (2048, 2048, 2048, 128, 128, True, False, True): (4, 16, 1, 32), + (2048, 2048, 4096, 16, 16, False, True, True): (4, 64, 3, 1), + (2048, 2048, 4096, 16, 16, True, False, True): (1, 64, 3, 1), + (2048, 2048, 4096, 32, 32, False, True, True): (1, 64, 3, 4), + (2048, 2048, 4096, 32, 32, True, False, True): (4, 64, 3, 4), + (2048, 2048, 4096, 64, 64, False, True, True): (2, 64, 2, 4), + (2048, 2048, 4096, 64, 64, True, False, True): (2, 64, 2, 4), + (2048, 2048, 4096, 128, 128, False, True, True): (4, 32, 1, 32), + (2048, 2048, 4096, 128, 128, True, False, True): (4, 32, 1, 32), + (2048, 2048, 8192, 16, 16, False, True, True): (4, 128, 3, 1), + (2048, 2048, 8192, 16, 16, True, False, True): (1, 128, 3, 1), + (2048, 2048, 8192, 32, 32, False, True, True): (4, 128, 3, 4), + (2048, 2048, 8192, 32, 32, True, False, True): (4, 64, 3, 4), + (2048, 2048, 8192, 64, 64, False, True, True): (1, 128, 2, 4), + (2048, 2048, 8192, 64, 64, True, False, True): (2, 128, 2, 4), + (2048, 2048, 8192, 128, 128, False, True, True): (1, 64, 1, 32), + (2048, 2048, 8192, 128, 128, True, False, True): (4, 64, 1, 32), + (2048, 2048, 16384, 16, 16, False, True, True): (4, 256, 3, 1), + (2048, 2048, 16384, 16, 16, True, False, True): (1, 256, 3, 1), + (2048, 2048, 16384, 32, 32, False, True, True): (1, 256, 3, 4), + (2048, 2048, 16384, 32, 32, True, False, True): (1, 128, 3, 4), + (2048, 2048, 16384, 64, 64, False, True, True): (1, 256, 2, 4), + (2048, 2048, 16384, 64, 64, True, False, True): (1, 256, 2, 4), + (2048, 2048, 16384, 128, 128, False, True, True): (1, 128, 1, 32), + (2048, 2048, 16384, 128, 128, True, False, True): (4, 128, 1, 32), + (2048, 2048, 32768, 16, 16, False, True, True): (8, 512, 3, 1), + (2048, 2048, 32768, 16, 16, True, False, True): (1, 512, 3, 1), + (2048, 2048, 32768, 32, 32, False, True, True): (1, 512, 3, 4), + (2048, 2048, 32768, 32, 32, True, False, True): (1, 256, 3, 4), + (2048, 2048, 32768, 64, 64, False, True, True): (1, 512, 2, 4), + (2048, 2048, 32768, 64, 64, True, False, True): (1, 512, 2, 4), + (2048, 2048, 32768, 128, 128, False, True, True): (1, 256, 1, 32), + (2048, 2048, 32768, 128, 128, True, False, True): (4, 256, 1, 32), + (2048, 2048, 65536, 16, 16, False, True, True): (4, 1024, 3, 1), + (2048, 2048, 65536, 16, 16, True, False, True): (1, 1024, 3, 1), + (2048, 2048, 65536, 32, 32, False, True, True): (1, 1024, 3, 4), + (2048, 2048, 65536, 32, 32, True, False, True): (1, 512, 3, 4), + (2048, 2048, 65536, 64, 64, False, True, True): (1, 1024, 2, 4), + (2048, 2048, 65536, 64, 64, True, False, True): (1, 1024, 2, 4), + (2048, 2048, 65536, 128, 128, False, True, True): (1, 512, 1, 32), + (2048, 2048, 65536, 128, 128, True, False, True): (4, 512, 1, 32), + (2048, 2048, 131072, 16, 16, False, True, True): (4, 2048, 3, 1), + (2048, 2048, 131072, 16, 16, True, False, True): (1, 2048, 3, 1), + (2048, 2048, 131072, 32, 32, False, True, True): (1, 2048, 3, 4), + (2048, 2048, 131072, 32, 32, True, False, True): (1, 1024, 3, 4), + (2048, 2048, 131072, 64, 64, False, True, True): (1, 2048, 2, 4), + (2048, 2048, 131072, 64, 64, True, False, True): (1, 2048, 2, 4), + (2048, 2048, 131072, 128, 128, False, True, True): (1, 1024, 1, 32), + (2048, 2048, 131072, 128, 128, True, False, True): (4, 1024, 1, 32), + (4096, 4096, 256, 16, 16, False, True, True): (1, 4, 3, 2), + (4096, 4096, 256, 16, 16, True, False, True): (1, 2, 3, 4), + (4096, 4096, 256, 32, 32, False, True, True): (4, 4, 4, 4), + (4096, 4096, 256, 32, 32, True, False, True): (4, 4, 4, 4), + (4096, 4096, 256, 64, 64, False, True, True): (1, 4, 3, 8), + (4096, 4096, 256, 64, 64, True, False, True): (4, 4, 2, 4), + (4096, 4096, 256, 128, 128, False, True, True): (1, 2, 1, 32), + (4096, 4096, 256, 128, 128, True, False, True): (3, 2, 1, 32), + (4096, 4096, 512, 16, 16, False, True, True): (1, 4, 3, 4), + (4096, 4096, 512, 16, 16, True, False, True): (5, 8, 3, 2), + (4096, 4096, 512, 32, 32, False, True, True): (4, 8, 3, 4), + (4096, 4096, 512, 32, 32, True, False, True): (4, 8, 3, 4), + (4096, 4096, 512, 64, 64, False, True, True): (1, 8, 2, 4), + (4096, 4096, 512, 64, 64, True, False, True): (1, 8, 2, 4), + (4096, 4096, 512, 128, 128, False, True, True): (4, 4, 1, 32), + (4096, 4096, 512, 128, 128, True, False, True): (4, 4, 1, 32), + (4096, 4096, 1024, 16, 16, False, True, True): (1, 8, 3, 4), + (4096, 4096, 1024, 16, 16, True, False, True): (1, 8, 3, 4), + (4096, 4096, 1024, 32, 32, False, True, True): (1, 16, 3, 4), + (4096, 4096, 1024, 32, 32, True, False, True): (1, 16, 3, 4), + (4096, 4096, 1024, 64, 64, False, True, True): (4, 16, 2, 4), + (4096, 4096, 1024, 64, 64, True, False, True): (4, 16, 2, 4), + (4096, 4096, 1024, 128, 128, False, True, True): (4, 8, 1, 32), + (4096, 4096, 1024, 128, 128, True, False, True): (4, 8, 1, 32), + (4096, 4096, 2048, 16, 16, False, True, True): (1, 32, 3, 1), + (4096, 4096, 2048, 16, 16, True, False, True): (6, 8, 3, 4), + (4096, 4096, 2048, 32, 32, False, True, True): (1, 32, 3, 4), + (4096, 4096, 2048, 32, 32, True, False, True): (1, 32, 3, 4), + (4096, 4096, 2048, 64, 64, False, True, True): (4, 32, 2, 4), + (4096, 4096, 2048, 64, 64, True, False, True): (4, 32, 2, 4), + (4096, 4096, 2048, 128, 128, False, True, True): (4, 16, 1, 32), + (4096, 4096, 2048, 128, 128, True, False, True): (4, 16, 1, 32), + (4096, 4096, 4096, 16, 16, False, True, True): (1, 16, 3, 4), + (4096, 4096, 4096, 16, 16, True, False, True): (1, 64, 3, 1), + (4096, 4096, 4096, 32, 32, False, True, True): (1, 64, 3, 4), + (4096, 4096, 4096, 32, 32, True, False, True): (1, 32, 3, 4), + (4096, 4096, 4096, 64, 64, False, True, True): (4, 64, 2, 4), + (4096, 4096, 4096, 64, 64, True, False, True): (4, 64, 2, 4), + (4096, 4096, 4096, 128, 128, False, True, True): (4, 32, 1, 32), + (4096, 4096, 4096, 128, 128, True, False, True): (4, 32, 1, 32), + (4096, 4096, 8192, 16, 16, False, True, True): (4, 128, 3, 1), + (4096, 4096, 8192, 16, 16, True, False, True): (1, 128, 3, 1), + (4096, 4096, 8192, 32, 32, False, True, True): (1, 128, 3, 4), + (4096, 4096, 8192, 32, 32, True, False, True): (1, 64, 3, 4), + (4096, 4096, 8192, 64, 64, False, True, True): (4, 128, 2, 4), + (4096, 4096, 8192, 64, 64, True, False, True): (4, 128, 2, 4), + (4096, 4096, 8192, 128, 128, False, True, True): (4, 64, 1, 32), + (4096, 4096, 8192, 128, 128, True, False, True): (4, 64, 1, 32), + (4096, 4096, 16384, 16, 16, False, True, True): (1, 64, 3, 4), + (4096, 4096, 16384, 16, 16, True, False, True): (1, 256, 3, 1), + (4096, 4096, 16384, 32, 32, False, True, True): (1, 256, 3, 4), + (4096, 4096, 16384, 32, 32, True, False, True): (1, 128, 3, 4), + (4096, 4096, 16384, 64, 64, False, True, True): (4, 256, 2, 4), + (4096, 4096, 16384, 64, 64, True, False, True): (4, 256, 2, 4), + (4096, 4096, 16384, 128, 128, False, True, True): (4, 128, 1, 32), + (4096, 4096, 16384, 128, 128, True, False, True): (4, 128, 1, 32), + (4096, 4096, 32768, 16, 16, False, True, True): (1, 128, 3, 4), + (4096, 4096, 32768, 16, 16, True, False, True): (1, 512, 3, 1), + (4096, 4096, 32768, 32, 32, False, True, True): (1, 512, 3, 4), + (4096, 4096, 32768, 32, 32, True, False, True): (1, 256, 3, 4), + (4096, 4096, 32768, 64, 64, False, True, True): (4, 512, 2, 4), + (4096, 4096, 32768, 64, 64, True, False, True): (4, 512, 2, 4), + (4096, 4096, 32768, 128, 128, False, True, True): (4, 256, 1, 32), + (4096, 4096, 32768, 128, 128, True, False, True): (4, 256, 1, 32), + (4096, 4096, 65536, 16, 16, False, True, True): (1, 256, 3, 4), + (4096, 4096, 65536, 16, 16, True, False, True): (1, 1024, 3, 1), + (4096, 4096, 65536, 32, 32, False, True, True): (1, 1024, 3, 4), + (4096, 4096, 65536, 32, 32, True, False, True): (1, 512, 3, 4), + (4096, 4096, 65536, 64, 64, False, True, True): (4, 1024, 2, 4), + (4096, 4096, 65536, 64, 64, True, False, True): (2, 1024, 2, 4), + (4096, 4096, 65536, 128, 128, False, True, True): (4, 512, 1, 32), + (4096, 4096, 65536, 128, 128, True, False, True): (4, 512, 1, 32), + (4096, 4096, 131072, 16, 16, False, True, True): (2, 2048, 3, 1), + (4096, 4096, 131072, 16, 16, True, False, True): (1, 2048, 3, 1), + (4096, 4096, 131072, 32, 32, False, True, True): (2, 2048, 3, 4), + (4096, 4096, 131072, 32, 32, True, False, True): (1, 1024, 3, 4), + (4096, 4096, 131072, 64, 64, False, True, True): (2, 2048, 2, 4), + (4096, 4096, 131072, 64, 64, True, False, True): (2, 2048, 2, 4), + (4096, 4096, 131072, 128, 128, False, True, True): (4, 1024, 1, 32), + (4096, 4096, 131072, 128, 128, True, False, True): (4, 1024, 1, 32), + (8192, 8192, 256, 16, 16, False, True, True): (2, 2, 4, 4), + (8192, 8192, 256, 16, 16, True, False, True): (1, 1, 3, 4), + (8192, 8192, 256, 32, 32, False, True, True): (2, 4, 3, 4), + (8192, 8192, 256, 32, 32, True, False, True): (2, 4, 3, 4), + (8192, 8192, 256, 64, 64, False, True, True): (4, 4, 2, 4), + (8192, 8192, 256, 64, 64, True, False, True): (4, 4, 2, 4), + (8192, 8192, 256, 128, 128, False, True, True): (1, 2, 1, 32), + (8192, 8192, 256, 128, 128, True, False, True): (4, 2, 1, 32), + (8192, 8192, 512, 16, 16, False, True, True): (1, 4, 3, 4), + (8192, 8192, 512, 16, 16, True, False, True): (3, 4, 3, 4), + (8192, 8192, 512, 32, 32, False, True, True): (1, 8, 3, 4), + (8192, 8192, 512, 32, 32, True, False, True): (6, 8, 3, 4), + (8192, 8192, 512, 64, 64, False, True, True): (4, 8, 2, 4), + (8192, 8192, 512, 64, 64, True, False, True): (4, 8, 2, 4), + (8192, 8192, 512, 128, 128, False, True, True): (4, 4, 1, 32), + (8192, 8192, 512, 128, 128, True, False, True): (4, 4, 1, 32), + (8192, 8192, 1024, 16, 16, False, True, True): (1, 4, 3, 4), + (8192, 8192, 1024, 16, 16, True, False, True): (1, 32, 3, 1), + (8192, 8192, 1024, 32, 32, False, True, True): (1, 16, 3, 4), + (8192, 8192, 1024, 32, 32, True, False, True): (1, 16, 3, 4), + (8192, 8192, 1024, 64, 64, False, True, True): (4, 16, 2, 4), + (8192, 8192, 1024, 64, 64, True, False, True): (4, 16, 2, 4), + (8192, 8192, 1024, 128, 128, False, True, True): (4, 8, 1, 32), + (8192, 8192, 1024, 128, 128, True, False, True): (4, 8, 1, 32), + (8192, 8192, 2048, 16, 16, False, True, True): (4, 8, 3, 4), + (8192, 8192, 2048, 16, 16, True, False, True): (1, 32, 3, 1), + (8192, 8192, 2048, 32, 32, False, True, True): (1, 32, 3, 4), + (8192, 8192, 2048, 32, 32, True, False, True): (1, 16, 4, 4), + (8192, 8192, 2048, 64, 64, False, True, True): (4, 32, 2, 4), + (8192, 8192, 2048, 64, 64, True, False, True): (4, 32, 2, 4), + (8192, 8192, 2048, 128, 128, False, True, True): (4, 16, 1, 32), + (8192, 8192, 2048, 128, 128, True, False, True): (4, 16, 1, 32), + (8192, 8192, 4096, 16, 16, False, True, True): (3, 16, 3, 4), + (8192, 8192, 4096, 16, 16, True, False, True): (2, 64, 3, 1), + (8192, 8192, 4096, 32, 32, False, True, True): (1, 64, 3, 4), + (8192, 8192, 4096, 32, 32, True, False, True): (1, 32, 3, 4), + (8192, 8192, 4096, 64, 64, False, True, True): (4, 64, 2, 4), + (8192, 8192, 4096, 64, 64, True, False, True): (2, 64, 2, 4), + (8192, 8192, 4096, 128, 128, False, True, True): (4, 32, 1, 32), + (8192, 8192, 4096, 128, 128, True, False, True): (4, 32, 1, 32), + (8192, 8192, 8192, 16, 16, False, True, True): (2, 128, 3, 1), + (8192, 8192, 8192, 16, 16, True, False, True): (2, 128, 3, 1), + (8192, 8192, 8192, 32, 32, False, True, True): (1, 128, 3, 4), + (8192, 8192, 8192, 32, 32, True, False, True): (1, 64, 3, 4), + (8192, 8192, 8192, 64, 64, False, True, True): (4, 128, 2, 4), + (8192, 8192, 8192, 64, 64, True, False, True): (2, 128, 2, 4), + (8192, 8192, 8192, 128, 128, False, True, True): (4, 64, 1, 32), + (8192, 8192, 8192, 128, 128, True, False, True): (4, 64, 1, 32), + (8192, 8192, 16384, 16, 16, False, True, True): (1, 64, 3, 4), + (8192, 8192, 16384, 16, 16, True, False, True): (1, 256, 3, 1), + (8192, 8192, 16384, 32, 32, False, True, True): (1, 256, 3, 4), + (8192, 8192, 16384, 32, 32, True, False, True): (1, 128, 3, 4), + (8192, 8192, 16384, 64, 64, False, True, True): (2, 256, 2, 4), + (8192, 8192, 16384, 64, 64, True, False, True): (2, 256, 2, 4), + (8192, 8192, 16384, 128, 128, False, True, True): (4, 128, 1, 32), + (8192, 8192, 16384, 128, 128, True, False, True): (4, 128, 1, 32), + (8192, 8192, 32768, 16, 16, False, True, True): (1, 512, 3, 1), + (8192, 8192, 32768, 16, 16, True, False, True): (1, 512, 3, 1), + (8192, 8192, 32768, 32, 32, False, True, True): (1, 512, 3, 4), + (8192, 8192, 32768, 32, 32, True, False, True): (1, 256, 3, 4), + (8192, 8192, 32768, 64, 64, False, True, True): (2, 512, 2, 4), + (8192, 8192, 32768, 64, 64, True, False, True): (2, 512, 2, 4), + (8192, 8192, 32768, 128, 128, False, True, True): (4, 256, 1, 32), + (8192, 8192, 32768, 128, 128, True, False, True): (4, 256, 1, 32), + (8192, 8192, 65536, 16, 16, False, True, True): (1, 256, 3, 4), + (8192, 8192, 65536, 16, 16, True, False, True): (1, 1024, 3, 1), + (8192, 8192, 65536, 32, 32, False, True, True): (1, 1024, 3, 4), + (8192, 8192, 65536, 32, 32, True, False, True): (1, 512, 3, 4), + (8192, 8192, 65536, 64, 64, False, True, True): (4, 1024, 2, 4), + (8192, 8192, 65536, 64, 64, True, False, True): (2, 1024, 2, 4), + (8192, 8192, 65536, 128, 128, False, True, True): (4, 512, 1, 32), + (8192, 8192, 65536, 128, 128, True, False, True): (4, 512, 1, 32), + (8192, 8192, 131072, 16, 16, False, True, True): (1, 2048, 3, 1), + (8192, 8192, 131072, 16, 16, True, False, True): (2, 2048, 3, 1), + (8192, 8192, 131072, 32, 32, False, True, True): (4, 2048, 3, 4), + (8192, 8192, 131072, 32, 32, True, False, True): (1, 1024, 3, 4), + (8192, 8192, 131072, 64, 64, False, True, True): (2, 2048, 2, 4), + (8192, 8192, 131072, 64, 64, True, False, True): (2, 2048, 2, 4), + (8192, 8192, 131072, 128, 128, False, True, True): (4, 1024, 1, 32), + (8192, 8192, 131072, 128, 128, True, False, True): (4, 1024, 1, 32), + (16384, 16384, 256, 16, 16, False, True, True): (1, 2, 3, 4), + (16384, 16384, 256, 16, 16, True, False, True): (1, 2, 3, 4), + (16384, 16384, 256, 32, 32, False, True, True): (1, 4, 3, 4), + (16384, 16384, 256, 32, 32, True, False, True): (1, 4, 3, 4), + (16384, 16384, 256, 64, 64, False, True, True): (2, 4, 2, 4), + (16384, 16384, 256, 64, 64, True, False, True): (2, 4, 2, 4), + (16384, 16384, 256, 128, 128, False, True, True): (2, 2, 1, 32), + (16384, 16384, 256, 128, 128, True, False, True): (2, 2, 1, 32), + (16384, 16384, 512, 16, 16, False, True, True): (1, 2, 3, 4), + (16384, 16384, 512, 16, 16, True, False, True): (5, 2, 3, 4), + (16384, 16384, 512, 32, 32, False, True, True): (1, 8, 3, 4), + (16384, 16384, 512, 32, 32, True, False, True): (1, 4, 3, 4), + (16384, 16384, 512, 64, 64, False, True, True): (4, 8, 2, 4), + (16384, 16384, 512, 64, 64, True, False, True): (4, 8, 2, 4), + (16384, 16384, 512, 128, 128, False, True, True): (4, 4, 1, 32), + (16384, 16384, 512, 128, 128, True, False, True): (4, 4, 1, 32), + (16384, 16384, 1024, 16, 16, False, True, True): (1, 4, 3, 4), + (16384, 16384, 1024, 16, 16, True, False, True): (2, 16, 3, 1), + (16384, 16384, 1024, 32, 32, False, True, True): (1, 16, 3, 4), + (16384, 16384, 1024, 32, 32, True, False, True): (1, 8, 3, 4), + (16384, 16384, 1024, 64, 64, False, True, True): (4, 16, 2, 4), + (16384, 16384, 1024, 64, 64, True, False, True): (4, 16, 2, 4), + (16384, 16384, 1024, 128, 128, False, True, True): (4, 8, 1, 32), + (16384, 16384, 1024, 128, 128, True, False, True): (4, 8, 1, 32), + (16384, 16384, 2048, 16, 16, False, True, True): (1, 8, 3, 4), + (16384, 16384, 2048, 16, 16, True, False, True): (2, 32, 3, 1), + (16384, 16384, 2048, 32, 32, False, True, True): (1, 32, 3, 4), + (16384, 16384, 2048, 32, 32, True, False, True): (1, 16, 3, 4), + (16384, 16384, 2048, 64, 64, False, True, True): (4, 32, 2, 4), + (16384, 16384, 2048, 64, 64, True, False, True): (2, 32, 2, 4), + (16384, 16384, 2048, 128, 128, False, True, True): (4, 16, 1, 32), + (16384, 16384, 2048, 128, 128, True, False, True): (4, 16, 1, 32), + (16384, 16384, 4096, 16, 16, False, True, True): (1, 16, 3, 4), + (16384, 16384, 4096, 16, 16, True, False, True): (2, 64, 3, 1), + (16384, 16384, 4096, 32, 32, False, True, True): (1, 64, 3, 4), + (16384, 16384, 4096, 32, 32, True, False, True): (1, 32, 3, 4), + (16384, 16384, 4096, 64, 64, False, True, True): (4, 64, 2, 4), + (16384, 16384, 4096, 64, 64, True, False, True): (2, 64, 2, 4), + (16384, 16384, 4096, 128, 128, False, True, True): (4, 32, 1, 32), + (16384, 16384, 4096, 128, 128, True, False, True): (4, 32, 1, 32), + (16384, 16384, 8192, 16, 16, False, True, True): (1, 128, 3, 1), + (16384, 16384, 8192, 16, 16, True, False, True): (2, 128, 3, 1), + (16384, 16384, 8192, 32, 32, False, True, True): (1, 128, 3, 4), + (16384, 16384, 8192, 32, 32, True, False, True): (1, 64, 3, 4), + (16384, 16384, 8192, 64, 64, False, True, True): (2, 128, 2, 4), + (16384, 16384, 8192, 64, 64, True, False, True): (2, 128, 2, 4), + (16384, 16384, 8192, 128, 128, False, True, True): (4, 64, 1, 32), + (16384, 16384, 8192, 128, 128, True, False, True): (4, 64, 1, 32), + (16384, 16384, 16384, 16, 16, False, True, True): (1, 64, 3, 4), + (16384, 16384, 16384, 16, 16, True, False, True): (2, 256, 3, 1), + (16384, 16384, 16384, 32, 32, False, True, True): (1, 256, 3, 4), + (16384, 16384, 16384, 32, 32, True, False, True): (1, 128, 3, 4), + (16384, 16384, 16384, 64, 64, False, True, True): (2, 256, 2, 4), + (16384, 16384, 16384, 64, 64, True, False, True): (2, 256, 2, 4), + (16384, 16384, 16384, 128, 128, False, True, True): (4, 128, 1, 32), + (16384, 16384, 16384, 128, 128, True, False, True): (4, 128, 1, 32), + (16384, 16384, 32768, 16, 16, False, True, True): (1, 512, 3, 1), + (16384, 16384, 32768, 16, 16, True, False, True): (1, 128, 3, 4), + (16384, 16384, 32768, 32, 32, False, True, True): (2, 512, 3, 4), + (16384, 16384, 32768, 32, 32, True, False, True): (1, 256, 4, 4), + (16384, 16384, 32768, 64, 64, False, True, True): (2, 512, 2, 4), + (16384, 16384, 32768, 64, 64, True, False, True): (2, 512, 2, 4), + (16384, 16384, 32768, 128, 128, False, True, True): (4, 256, 1, 32), + (16384, 16384, 32768, 128, 128, True, False, True): (4, 256, 1, 32), + (16384, 16384, 65536, 16, 16, False, True, True): (1, 256, 3, 4), + (16384, 16384, 65536, 16, 16, True, False, True): (1, 1024, 3, 1), + (16384, 16384, 65536, 32, 32, False, True, True): (1, 1024, 3, 4), + (16384, 16384, 65536, 32, 32, True, False, True): (1, 512, 4, 4), + (16384, 16384, 65536, 64, 64, False, True, True): (2, 1024, 2, 4), + (16384, 16384, 65536, 64, 64, True, False, True): (2, 1024, 2, 4), + (16384, 16384, 65536, 128, 128, False, True, True): (4, 512, 1, 32), + (16384, 16384, 65536, 128, 128, True, False, True): (4, 512, 1, 32), + (16384, 16384, 131072, 16, 16, False, True, True): (1, 1024, 4, 4), + (16384, 16384, 131072, 16, 16, True, False, True): (2, 2048, 3, 1), + (16384, 16384, 131072, 32, 32, False, True, True): (1, 1024, 2, 4), + (16384, 16384, 131072, 32, 32, True, False, True): (1, 1024, 2, 4), + (16384, 16384, 131072, 64, 64, False, True, True): (4, 2048, 2, 4), + (16384, 16384, 131072, 64, 64, True, False, True): (2, 2048, 2, 4), + (16384, 16384, 131072, 128, 128, False, True, True): (4, 1024, 1, 32), + (16384, 16384, 131072, 128, 128, True, False, True): (4, 1024, 1, 32), + }, + ("scatter_mm", "NVIDIA A100-SXM4-80GB", (0, torch.bfloat16, 0.5)): { + (256, 256, 256, 16, 16): (1, 1, 16, 16, 1, 2), + (256, 256, 256, 32, 32): (1, 1, 16, 16, 1, 4), + (256, 256, 256, 64, 64): (1, 1, 16, 16, 1, 1), + (256, 256, 256, 128, 128): (2, 4, 16, 64, 1, 4), + (256, 256, 512, 16, 16): (1, 1, 16, 16, 1, 4), + (256, 256, 512, 32, 32): (1, 1, 16, 32, 1, 4), + (256, 256, 512, 64, 64): (1, 1, 16, 32, 1, 1), + (256, 256, 512, 128, 128): (1, 1, 32, 32, 1, 4), + (256, 256, 1024, 16, 16): (1, 1, 16, 16, 1, 4), + (256, 256, 1024, 32, 32): (1, 2, 16, 32, 1, 1), + (256, 256, 1024, 64, 64): (1, 1, 32, 32, 1, 2), + (256, 256, 1024, 128, 128): (1, 1, 32, 64, 1, 4), + (256, 256, 2048, 16, 16): (1, 1, 16, 64, 1, 8), + (256, 256, 2048, 32, 32): (2, 1, 32, 64, 1, 2), + (256, 256, 2048, 64, 64): (1, 1, 32, 32, 1, 1), + (256, 256, 2048, 128, 128): (1, 1, 64, 64, 1, 4), + (256, 256, 4096, 16, 16): (1, 1, 16, 64, 1, 1), + (256, 256, 4096, 32, 32): (2, 2, 32, 64, 1, 2), + (256, 256, 4096, 64, 64): (1, 1, 32, 128, 1, 4), + (256, 256, 4096, 128, 128): (1, 1, 64, 64, 1, 4), + (256, 256, 8192, 16, 16): (1, 2, 16, 64, 1, 2), + (256, 256, 8192, 32, 32): (1, 1, 32, 64, 1, 2), + (256, 256, 8192, 64, 64): (1, 1, 32, 64, 1, 2), + (256, 256, 8192, 128, 128): (1, 1, 64, 64, 1, 4), + (256, 256, 16384, 16, 16): (1, 1, 16, 64, 1, 2), + (256, 256, 16384, 32, 32): (1, 1, 32, 64, 1, 2), + (256, 256, 16384, 64, 64): (1, 1, 64, 64, 1, 2), + (256, 256, 16384, 128, 128): (2, 16, 64, 64, 1, 4), + (256, 256, 32768, 16, 16): (1, 1, 16, 128, 1, 2), + (256, 256, 32768, 32, 32): (1, 1, 32, 64, 1, 2), + (256, 256, 32768, 64, 64): (1, 1, 64, 64, 1, 2), + (256, 256, 32768, 128, 128): (2, 32, 64, 64, 1, 4), + (256, 256, 65536, 16, 16): (1, 1, 16, 64, 1, 1), + (256, 256, 65536, 32, 32): (1, 1, 32, 64, 1, 2), + (256, 256, 65536, 64, 64): (1, 1, 64, 32, 1, 1), + (256, 256, 65536, 128, 128): (2, 32, 64, 64, 1, 4), + (256, 256, 131072, 16, 16): (1, 1, 16, 64, 1, 1), + (256, 256, 131072, 32, 32): (1, 1, 32, 64, 1, 2), + (256, 256, 131072, 64, 64): (4, 1, 64, 32, 1, 1), + (256, 256, 131072, 128, 128): (2, 64, 64, 64, 1, 4), + (512, 512, 256, 16, 16): (1, 1, 16, 16, 1, 2), + (512, 512, 256, 32, 32): (1, 1, 16, 32, 1, 1), + (512, 512, 256, 64, 64): (1, 2, 16, 32, 1, 1), + (512, 512, 256, 128, 128): (2, 16, 64, 16, 2, 4), + (512, 512, 512, 16, 16): (1, 1, 16, 16, 1, 4), + (512, 512, 512, 32, 32): (1, 1, 16, 32, 1, 1), + (512, 512, 512, 64, 64): (1, 1, 32, 32, 1, 2), + (512, 512, 512, 128, 128): (2, 8, 32, 64, 1, 4), + (512, 512, 1024, 16, 16): (1, 1, 16, 64, 1, 8), + (512, 512, 1024, 32, 32): (1, 1, 32, 32, 3, 1), + (512, 512, 1024, 64, 64): (1, 4, 32, 64, 1, 2), + (512, 512, 1024, 128, 128): (1, 4, 64, 64, 1, 4), + (512, 512, 2048, 16, 16): (1, 1, 16, 64, 1, 2), + (512, 512, 2048, 32, 32): (1, 1, 32, 64, 1, 2), + (512, 512, 2048, 64, 64): (1, 1, 64, 64, 3, 4), + (512, 512, 2048, 128, 128): (1, 1, 64, 64, 1, 4), + (512, 512, 4096, 16, 16): (1, 1, 16, 64, 1, 2), + (512, 512, 4096, 32, 32): (2, 64, 32, 64, 1, 2), + (512, 512, 4096, 64, 64): (1, 1, 64, 64, 3, 4), + (512, 512, 4096, 128, 128): (1, 1, 64, 64, 1, 4), + (512, 512, 8192, 16, 16): (1, 2, 16, 128, 1, 2), + (512, 512, 8192, 32, 32): (1, 1, 32, 64, 1, 2), + (512, 512, 8192, 64, 64): (1, 1, 64, 64, 1, 2), + (512, 512, 8192, 128, 128): (1, 1, 64, 64, 1, 4), + (512, 512, 16384, 16, 16): (1, 2, 16, 128, 1, 2), + (512, 512, 16384, 32, 32): (1, 1, 32, 64, 1, 2), + (512, 512, 16384, 64, 64): (1, 1, 64, 64, 3, 2), + (512, 512, 16384, 128, 128): (2, 1, 64, 64, 1, 4), + (512, 512, 32768, 16, 16): (1, 2, 16, 128, 1, 2), + (512, 512, 32768, 32, 32): (1, 1, 32, 64, 1, 2), + (512, 512, 32768, 64, 64): (1, 1, 64, 64, 3, 4), + (512, 512, 32768, 128, 128): (2, 1, 64, 64, 1, 4), + (512, 512, 65536, 16, 16): (1, 2, 16, 128, 1, 2), + (512, 512, 65536, 32, 32): (1, 1, 32, 64, 1, 2), + (512, 512, 65536, 64, 64): (1, 1, 64, 64, 3, 4), + (512, 512, 65536, 128, 128): (2, 1, 64, 64, 1, 4), + (512, 512, 131072, 16, 16): (1, 1, 16, 64, 1, 1), + (512, 512, 131072, 32, 32): (1, 1, 32, 64, 1, 2), + (512, 512, 131072, 64, 64): (1, 1, 64, 64, 3, 4), + (512, 512, 131072, 128, 128): (2, 4, 64, 64, 1, 4), + (1024, 1024, 256, 16, 16): (1, 1, 16, 16, 1, 4), + (1024, 1024, 256, 32, 32): (2, 16, 32, 16, 3, 4), + (1024, 1024, 256, 64, 64): (1, 4, 32, 32, 1, 2), + (1024, 1024, 256, 128, 128): (1, 4, 128, 16, 3, 16), + (1024, 1024, 512, 16, 16): (1, 1, 16, 64, 1, 2), + (1024, 1024, 512, 32, 32): (2, 2, 32, 64, 1, 2), + (1024, 1024, 512, 64, 64): (2, 8, 64, 64, 3, 4), + (1024, 1024, 512, 128, 128): (1, 4, 64, 64, 1, 8), + (1024, 1024, 1024, 16, 16): (1, 1, 16, 64, 1, 2), + (1024, 1024, 1024, 32, 32): (1, 1, 32, 64, 1, 2), + (1024, 1024, 1024, 64, 64): (1, 8, 64, 64, 3, 4), + (1024, 1024, 1024, 128, 128): (1, 8, 64, 64, 1, 4), + (1024, 1024, 2048, 16, 16): (1, 2, 16, 64, 1, 2), + (1024, 1024, 2048, 32, 32): (1, 1, 32, 64, 1, 2), + (1024, 1024, 2048, 64, 64): (2, 16, 64, 64, 2, 2), + (1024, 1024, 2048, 128, 128): (2, 32, 64, 64, 1, 4), + (1024, 1024, 4096, 16, 16): (2, 16, 16, 128, 1, 2), + (1024, 1024, 4096, 32, 32): (1, 16, 32, 64, 3, 2), + (1024, 1024, 4096, 64, 64): (1, 1, 64, 64, 3, 4), + (1024, 1024, 4096, 128, 128): (2, 64, 128, 64, 1, 4), + (1024, 1024, 8192, 16, 16): (2, 16, 16, 128, 1, 2), + (1024, 1024, 8192, 32, 32): (1, 16, 32, 64, 3, 2), + (1024, 1024, 8192, 64, 64): (1, 1, 64, 64, 3, 4), + (1024, 1024, 8192, 128, 128): (2, 1, 64, 64, 1, 4), + (1024, 1024, 16384, 16, 16): (1, 2, 16, 128, 1, 2), + (1024, 1024, 16384, 32, 32): (1, 16, 32, 64, 3, 2), + (1024, 1024, 16384, 64, 64): (1, 1, 64, 64, 3, 4), + (1024, 1024, 16384, 128, 128): (2, 16, 128, 64, 1, 4), + (1024, 1024, 32768, 16, 16): (1, 1, 16, 128, 1, 2), + (1024, 1024, 32768, 32, 32): (1, 1, 32, 128, 1, 2), + (1024, 1024, 32768, 64, 64): (1, 32, 64, 32, 2, 1), + (1024, 1024, 32768, 128, 128): (2, 8, 128, 64, 1, 4), + (1024, 1024, 65536, 16, 16): (3, 2, 16, 128, 1, 2), + (1024, 1024, 65536, 32, 32): (1, 1, 32, 128, 1, 2), + (1024, 1024, 65536, 64, 64): (2, 4, 64, 32, 2, 1), + (1024, 1024, 65536, 128, 128): (2, 8, 128, 64, 1, 4), + (1024, 1024, 131072, 16, 16): (2, 1, 16, 128, 1, 2), + (1024, 1024, 131072, 32, 32): (1, 1, 32, 128, 1, 2), + (1024, 1024, 131072, 64, 64): (1, 4, 64, 32, 2, 1), + (1024, 1024, 131072, 128, 128): (4, 1, 128, 64, 1, 4), + (2048, 2048, 256, 16, 16): (1, 1, 16, 64, 1, 8), + (2048, 2048, 256, 32, 32): (1, 1, 32, 32, 3, 1), + (2048, 2048, 256, 64, 64): (1, 1, 32, 32, 2, 1), + (2048, 2048, 256, 128, 128): (1, 4, 64, 64, 1, 8), + (2048, 2048, 512, 16, 16): (1, 2, 16, 64, 1, 2), + (2048, 2048, 512, 32, 32): (1, 2, 32, 64, 1, 4), + (2048, 2048, 512, 64, 64): (1, 4, 64, 64, 1, 8), + (2048, 2048, 512, 128, 128): (1, 4, 64, 64, 1, 4), + (2048, 2048, 1024, 16, 16): (1, 2, 16, 128, 1, 2), + (2048, 2048, 1024, 32, 32): (1, 1, 32, 64, 1, 2), + (2048, 2048, 1024, 64, 64): (1, 8, 64, 64, 1, 4), + (2048, 2048, 1024, 128, 128): (1, 8, 128, 64, 1, 4), + (2048, 2048, 2048, 16, 16): (3, 4, 16, 128, 1, 2), + (2048, 2048, 2048, 32, 32): (1, 16, 32, 64, 5, 2), + (2048, 2048, 2048, 64, 64): (1, 1, 64, 64, 3, 4), + (2048, 2048, 2048, 128, 128): (1, 8, 128, 64, 1, 4), + (2048, 2048, 4096, 16, 16): (1, 2, 16, 128, 1, 2), + (2048, 2048, 4096, 32, 32): (1, 8, 32, 64, 3, 2), + (2048, 2048, 4096, 64, 64): (1, 1, 64, 64, 3, 4), + (2048, 2048, 4096, 128, 128): (1, 8, 128, 64, 1, 4), + (2048, 2048, 8192, 16, 16): (2, 4, 16, 128, 1, 2), + (2048, 2048, 8192, 32, 32): (1, 4, 32, 128, 3, 2), + (2048, 2048, 8192, 64, 64): (1, 8, 64, 64, 3, 2), + (2048, 2048, 8192, 128, 128): (1, 8, 128, 64, 1, 4), + (2048, 2048, 16384, 16, 16): (1, 2, 16, 128, 1, 2), + (2048, 2048, 16384, 32, 32): (1, 4, 32, 128, 3, 2), + (2048, 2048, 16384, 64, 64): (1, 8, 64, 64, 3, 2), + (2048, 2048, 16384, 128, 128): (1, 4, 128, 64, 1, 4), + (2048, 2048, 32768, 16, 16): (3, 2, 16, 128, 1, 2), + (2048, 2048, 32768, 32, 32): (1, 1, 32, 128, 3, 2), + (2048, 2048, 32768, 64, 64): (1, 1, 64, 64, 3, 2), + (2048, 2048, 32768, 128, 128): (1, 4, 128, 64, 1, 4), + (2048, 2048, 65536, 16, 16): (1, 2, 16, 128, 1, 2), + (2048, 2048, 65536, 32, 32): (1, 4, 32, 128, 1, 2), + (2048, 2048, 65536, 64, 64): (1, 1, 64, 64, 3, 2), + (2048, 2048, 65536, 128, 128): (1, 2, 128, 64, 1, 4), + (2048, 2048, 131072, 16, 16): (4, 2, 16, 128, 1, 2), + (2048, 2048, 131072, 32, 32): (1, 1, 32, 128, 3, 2), + (2048, 2048, 131072, 64, 64): (1, 1, 64, 64, 3, 2), + (2048, 2048, 131072, 128, 128): (1, 2, 128, 64, 1, 4), + (4096, 4096, 256, 16, 16): (1, 1, 16, 64, 1, 2), + (4096, 4096, 256, 32, 32): (1, 1, 32, 64, 3, 4), + (4096, 4096, 256, 64, 64): (1, 1, 64, 64, 3, 4), + (4096, 4096, 256, 128, 128): (3, 4, 128, 32, 1, 4), + (4096, 4096, 512, 16, 16): (1, 2, 16, 128, 1, 2), + (4096, 4096, 512, 32, 32): (1, 2, 32, 64, 3, 2), + (4096, 4096, 512, 64, 64): (1, 4, 64, 64, 1, 4), + (4096, 4096, 512, 128, 128): (1, 4, 128, 64, 1, 4), + (4096, 4096, 1024, 16, 16): (1, 2, 16, 128, 1, 2), + (4096, 4096, 1024, 32, 32): (1, 8, 32, 64, 3, 2), + (4096, 4096, 1024, 64, 64): (1, 4, 64, 64, 1, 4), + (4096, 4096, 1024, 128, 128): (2, 4, 128, 64, 1, 4), + (4096, 4096, 2048, 16, 16): (1, 1, 16, 128, 1, 2), + (4096, 4096, 2048, 32, 32): (1, 4, 32, 128, 1, 4), + (4096, 4096, 2048, 64, 64): (1, 1, 64, 64, 3, 4), + (4096, 4096, 2048, 128, 128): (1, 16, 128, 64, 1, 4), + (4096, 4096, 4096, 16, 16): (1, 1, 16, 64, 3, 1), + (4096, 4096, 4096, 32, 32): (1, 4, 32, 64, 3, 2), + (4096, 4096, 4096, 64, 64): (1, 1, 64, 64, 3, 4), + (4096, 4096, 4096, 128, 128): (5, 1, 128, 64, 1, 4), + (4096, 4096, 8192, 16, 16): (1, 1, 16, 128, 1, 2), + (4096, 4096, 8192, 32, 32): (1, 1, 32, 128, 3, 2), + (4096, 4096, 8192, 64, 64): (1, 1, 64, 64, 3, 4), + (4096, 4096, 8192, 128, 128): (2, 1, 128, 64, 1, 4), + (4096, 4096, 16384, 16, 16): (1, 1, 16, 128, 1, 2), + (4096, 4096, 16384, 32, 32): (1, 1, 32, 128, 3, 2), + (4096, 4096, 16384, 64, 64): (1, 1, 64, 64, 4, 4), + (4096, 4096, 16384, 128, 128): (2, 1, 128, 64, 1, 4), + (4096, 4096, 32768, 16, 16): (3, 1, 16, 128, 1, 2), + (4096, 4096, 32768, 32, 32): (1, 1, 32, 128, 3, 2), + (4096, 4096, 32768, 64, 64): (1, 1, 64, 64, 3, 4), + (4096, 4096, 32768, 128, 128): (2, 1, 128, 64, 1, 4), + (4096, 4096, 65536, 16, 16): (2, 2, 16, 128, 1, 2), + (4096, 4096, 65536, 32, 32): (1, 1, 32, 128, 4, 2), + (4096, 4096, 65536, 64, 64): (1, 1, 64, 64, 4, 4), + (4096, 4096, 65536, 128, 128): (2, 1, 128, 64, 1, 4), + (4096, 4096, 131072, 16, 16): (2, 1, 16, 128, 1, 2), + (4096, 4096, 131072, 32, 32): (1, 1, 32, 128, 3, 2), + (4096, 4096, 131072, 64, 64): (1, 1, 64, 64, 3, 4), + (4096, 4096, 131072, 128, 128): (2, 1, 128, 64, 1, 4), + (8192, 8192, 256, 16, 16): (1, 2, 16, 64, 1, 2), + (8192, 8192, 256, 32, 32): (1, 1, 32, 64, 1, 2), + (8192, 8192, 256, 64, 64): (1, 2, 64, 64, 1, 4), + (8192, 8192, 256, 128, 128): (3, 16, 128, 16, 1, 2), + (8192, 8192, 512, 16, 16): (1, 2, 16, 128, 1, 2), + (8192, 8192, 512, 32, 32): (1, 4, 32, 64, 3, 2), + (8192, 8192, 512, 64, 64): (2, 8, 64, 64, 4, 4), + (8192, 8192, 512, 128, 128): (1, 8, 128, 64, 1, 4), + (8192, 8192, 1024, 16, 16): (4, 2, 16, 128, 1, 2), + (8192, 8192, 1024, 32, 32): (1, 8, 32, 128, 1, 2), + (8192, 8192, 1024, 64, 64): (1, 16, 64, 64, 3, 2), + (8192, 8192, 1024, 128, 128): (2, 16, 128, 64, 2, 4), + (8192, 8192, 2048, 16, 16): (2, 1, 16, 64, 4, 1), + (8192, 8192, 2048, 32, 32): (1, 16, 32, 64, 5, 2), + (8192, 8192, 2048, 64, 64): (1, 16, 64, 64, 3, 2), + (8192, 8192, 2048, 128, 128): (2, 16, 128, 64, 2, 4), + (8192, 8192, 4096, 16, 16): (1, 1, 16, 64, 4, 1), + (8192, 8192, 4096, 32, 32): (1, 16, 32, 64, 5, 2), + (8192, 8192, 4096, 64, 64): (1, 16, 64, 64, 3, 2), + (8192, 8192, 4096, 128, 128): (2, 64, 128, 64, 2, 4), + (8192, 8192, 8192, 16, 16): (1, 1, 16, 64, 4, 1), + (8192, 8192, 8192, 32, 32): (1, 8, 32, 128, 5, 4), + (8192, 8192, 8192, 64, 64): (1, 8, 64, 64, 3, 2), + (8192, 8192, 8192, 128, 128): (2, 8, 128, 64, 1, 4), + (8192, 8192, 16384, 16, 16): (1, 1, 16, 64, 4, 1), + (8192, 8192, 16384, 32, 32): (1, 8, 32, 64, 5, 2), + (8192, 8192, 16384, 64, 64): (1, 8, 64, 64, 3, 2), + (8192, 8192, 16384, 128, 128): (1, 8, 128, 64, 1, 4), + (8192, 8192, 32768, 16, 16): (1, 1, 16, 64, 4, 1), + (8192, 8192, 32768, 32, 32): (1, 8, 32, 64, 5, 2), + (8192, 8192, 32768, 64, 64): (3, 8, 64, 64, 3, 2), + (8192, 8192, 32768, 128, 128): (2, 8, 128, 64, 1, 4), + (8192, 8192, 65536, 16, 16): (1, 1, 16, 64, 4, 1), + (8192, 8192, 65536, 32, 32): (5, 4, 32, 64, 3, 2), + (8192, 8192, 65536, 64, 64): (1, 8, 64, 64, 3, 2), + (8192, 8192, 65536, 128, 128): (2, 8, 128, 64, 1, 4), + (8192, 8192, 131072, 16, 16): (2, 1, 16, 64, 4, 1), + (8192, 8192, 131072, 32, 32): (1, 4, 32, 64, 5, 2), + (8192, 8192, 131072, 64, 64): (1, 4, 64, 128, 3, 4), + (8192, 8192, 131072, 128, 128): (2, 8, 128, 64, 1, 4), + (16384, 16384, 256, 16, 16): (1, 2, 16, 128, 1, 2), + (16384, 16384, 256, 32, 32): (1, 4, 32, 64, 3, 2), + (16384, 16384, 256, 64, 64): (2, 4, 64, 64, 4, 4), + (16384, 16384, 256, 128, 128): (1, 4, 128, 64, 1, 16), + (16384, 16384, 512, 16, 16): (1, 2, 16, 128, 3, 2), + (16384, 16384, 512, 32, 32): (1, 4, 32, 128, 5, 4), + (16384, 16384, 512, 64, 64): (1, 8, 64, 64, 3, 2), + (16384, 16384, 512, 128, 128): (2, 8, 128, 64, 1, 4), + (16384, 16384, 1024, 16, 16): (1, 2, 16, 128, 1, 2), + (16384, 16384, 1024, 32, 32): (1, 8, 32, 64, 5, 2), + (16384, 16384, 1024, 64, 64): (1, 16, 64, 64, 3, 2), + (16384, 16384, 1024, 128, 128): (5, 16, 128, 64, 2, 4), + (16384, 16384, 2048, 16, 16): (1, 2, 16, 128, 1, 2), + (16384, 16384, 2048, 32, 32): (1, 8, 32, 64, 5, 2), + (16384, 16384, 2048, 64, 64): (1, 16, 64, 64, 3, 2), + (16384, 16384, 2048, 128, 128): (4, 32, 128, 64, 2, 4), + (16384, 16384, 4096, 16, 16): (3, 2, 16, 128, 1, 2), + (16384, 16384, 4096, 32, 32): (1, 4, 32, 64, 5, 2), + (16384, 16384, 4096, 64, 64): (2, 16, 64, 64, 3, 2), + (16384, 16384, 4096, 128, 128): (3, 32, 128, 64, 2, 4), + (16384, 16384, 8192, 16, 16): (1, 2, 16, 128, 1, 2), + (16384, 16384, 8192, 32, 32): (1, 4, 32, 64, 5, 2), + (16384, 16384, 8192, 64, 64): (4, 8, 64, 64, 3, 2), + (16384, 16384, 8192, 128, 128): (5, 8, 128, 64, 1, 4), + (16384, 16384, 16384, 16, 16): (1, 2, 16, 128, 1, 2), + (16384, 16384, 16384, 32, 32): (1, 4, 32, 64, 5, 2), + (16384, 16384, 16384, 64, 64): (2, 4, 64, 128, 3, 4), + (16384, 16384, 16384, 128, 128): (4, 8, 128, 64, 1, 4), + (16384, 16384, 32768, 16, 16): (4, 2, 16, 128, 1, 2), + (16384, 16384, 32768, 32, 32): (1, 4, 32, 64, 5, 2), + (16384, 16384, 32768, 64, 64): (1, 8, 64, 64, 3, 2), + (16384, 16384, 32768, 128, 128): (2, 512, 128, 64, 2, 4), + (16384, 16384, 65536, 16, 16): (3, 2, 16, 128, 1, 2), + (16384, 16384, 65536, 32, 32): (1, 4, 32, 64, 5, 2), + (16384, 16384, 65536, 64, 64): (1, 4, 64, 128, 3, 4), + (16384, 16384, 65536, 128, 128): (2, 1024, 128, 64, 2, 4), + (16384, 16384, 131072, 16, 16): (1, 2, 16, 128, 1, 2), + (16384, 16384, 131072, 32, 32): (1, 4, 32, 64, 5, 2), + (16384, 16384, 131072, 64, 64): (3, 4, 64, 128, 3, 4), + (16384, 16384, 131072, 128, 128): (4, 2048, 128, 64, 2, 4), + }, + ("scatter_mm", "NVIDIA A100-SXM4-80GB", (0, torch.float16, 0.5)): { + (256, 256, 256, 16, 16): (5, 4, 16, 16, 1, 4), + (256, 256, 256, 32, 32): (5, 2, 32, 16, 1, 4), + (256, 256, 256, 64, 64): (4, 1, 32, 32, 1, 8), + (256, 256, 256, 128, 128): (2, 1, 32, 32, 1, 4), + (256, 256, 512, 16, 16): (2, 2, 16, 32, 1, 4), + (256, 256, 512, 32, 32): (4, 8, 32, 32, 1, 8), + (256, 256, 512, 64, 64): (4, 8, 32, 64, 1, 4), + (256, 256, 512, 128, 128): (4, 8, 32, 64, 1, 4), + (256, 256, 1024, 16, 16): (4, 2, 16, 64, 1, 2), + (256, 256, 1024, 32, 32): (4, 16, 32, 64, 1, 2), + (256, 256, 1024, 64, 64): (4, 16, 32, 64, 1, 4), + (256, 256, 1024, 128, 128): (4, 16, 64, 64, 1, 8), + (256, 256, 2048, 16, 16): (2, 16, 16, 64, 1, 8), + (256, 256, 2048, 32, 32): (4, 16, 32, 64, 1, 2), + (256, 256, 2048, 64, 64): (4, 16, 32, 64, 1, 4), + (256, 256, 2048, 128, 128): (4, 16, 64, 64, 1, 4), + (256, 256, 4096, 16, 16): (4, 32, 16, 64, 1, 1), + (256, 256, 4096, 32, 32): (2, 64, 32, 64, 1, 2), + (256, 256, 4096, 64, 64): (4, 64, 64, 64, 1, 4), + (256, 256, 4096, 128, 128): (4, 32, 64, 64, 1, 4), + (256, 256, 8192, 16, 16): (4, 64, 16, 64, 1, 1), + (256, 256, 8192, 32, 32): (4, 128, 32, 64, 1, 2), + (256, 256, 8192, 64, 64): (4, 64, 64, 64, 1, 4), + (256, 256, 8192, 128, 128): (4, 64, 64, 64, 1, 4), + (256, 256, 16384, 16, 16): (4, 128, 16, 64, 1, 1), + (256, 256, 16384, 32, 32): (2, 128, 32, 64, 1, 2), + (256, 256, 16384, 64, 64): (4, 32, 32, 128, 1, 4), + (256, 256, 16384, 128, 128): (4, 16, 64, 64, 1, 4), + (256, 256, 32768, 16, 16): (4, 64, 16, 64, 1, 1), + (256, 256, 32768, 32, 32): (2, 256, 32, 64, 1, 2), + (256, 256, 32768, 64, 64): (4, 32, 32, 128, 1, 4), + (256, 256, 32768, 128, 128): (4, 32, 64, 64, 1, 4), + (256, 256, 65536, 16, 16): (4, 128, 16, 64, 1, 1), + (256, 256, 65536, 32, 32): (4, 1, 32, 64, 1, 2), + (256, 256, 65536, 64, 64): (2, 1, 64, 64, 1, 2), + (256, 256, 65536, 128, 128): (4, 32, 64, 64, 1, 4), + (256, 256, 131072, 16, 16): (4, 64, 16, 64, 1, 1), + (256, 256, 131072, 32, 32): (2, 1, 32, 64, 1, 2), + (256, 256, 131072, 64, 64): (4, 32, 32, 128, 1, 4), + (256, 256, 131072, 128, 128): (4, 32, 64, 64, 1, 4), + (512, 512, 256, 16, 16): (4, 16, 16, 16, 1, 4), + (512, 512, 256, 32, 32): (2, 4, 32, 16, 1, 4), + (512, 512, 256, 64, 64): (2, 16, 64, 16, 3, 8), + (512, 512, 256, 128, 128): (4, 16, 64, 16, 1, 4), + (512, 512, 512, 16, 16): (1, 1, 16, 64, 1, 8), + (512, 512, 512, 32, 32): (2, 4, 16, 32, 1, 1), + (512, 512, 512, 64, 64): (2, 1, 32, 32, 1, 2), + (512, 512, 512, 128, 128): (4, 8, 32, 64, 1, 4), + (512, 512, 1024, 16, 16): (2, 8, 16, 64, 1, 8), + (512, 512, 1024, 32, 32): (4, 16, 32, 64, 1, 2), + (512, 512, 1024, 64, 64): (4, 16, 64, 64, 1, 4), + (512, 512, 1024, 128, 128): (2, 8, 64, 64, 1, 4), + (512, 512, 2048, 16, 16): (4, 16, 16, 64, 1, 4), + (512, 512, 2048, 32, 32): (4, 16, 32, 64, 1, 2), + (512, 512, 2048, 64, 64): (4, 16, 64, 64, 1, 8), + (512, 512, 2048, 128, 128): (4, 16, 64, 64, 1, 4), + (512, 512, 4096, 16, 16): (4, 32, 16, 128, 1, 2), + (512, 512, 4096, 32, 32): (4, 32, 32, 64, 1, 2), + (512, 512, 4096, 64, 64): (4, 32, 64, 64, 1, 4), + (512, 512, 4096, 128, 128): (4, 32, 64, 64, 1, 4), + (512, 512, 8192, 16, 16): (2, 32, 16, 128, 1, 2), + (512, 512, 8192, 32, 32): (4, 64, 32, 64, 1, 2), + (512, 512, 8192, 64, 64): (4, 128, 64, 64, 1, 2), + (512, 512, 8192, 128, 128): (4, 64, 64, 64, 1, 4), + (512, 512, 16384, 16, 16): (4, 32, 16, 64, 1, 1), + (512, 512, 16384, 32, 32): (4, 64, 32, 64, 1, 2), + (512, 512, 16384, 64, 64): (4, 16, 64, 64, 1, 4), + (512, 512, 16384, 128, 128): (4, 32, 64, 64, 1, 4), + (512, 512, 32768, 16, 16): (7, 16, 16, 128, 1, 2), + (512, 512, 32768, 32, 32): (4, 64, 32, 64, 1, 2), + (512, 512, 32768, 64, 64): (2, 32, 64, 64, 3, 2), + (512, 512, 32768, 128, 128): (2, 32, 64, 64, 1, 4), + (512, 512, 65536, 16, 16): (2, 32, 16, 64, 1, 1), + (512, 512, 65536, 32, 32): (4, 64, 32, 64, 1, 2), + (512, 512, 65536, 64, 64): (3, 32, 64, 64, 3, 2), + (512, 512, 65536, 128, 128): (4, 16, 64, 64, 1, 4), + (512, 512, 131072, 16, 16): (3, 32, 16, 128, 1, 2), + (512, 512, 131072, 32, 32): (4, 64, 32, 64, 1, 2), + (512, 512, 131072, 64, 64): (2, 32, 64, 64, 3, 2), + (512, 512, 131072, 128, 128): (3, 1, 64, 64, 1, 4), + (1024, 1024, 256, 16, 16): (4, 16, 16, 16, 1, 4), + (1024, 1024, 256, 32, 32): (4, 16, 32, 16, 1, 4), + (1024, 1024, 256, 64, 64): (4, 4, 64, 32, 1, 16), + (1024, 1024, 256, 128, 128): (4, 16, 64, 16, 1, 8), + (1024, 1024, 512, 16, 16): (2, 8, 16, 64, 1, 8), + (1024, 1024, 512, 32, 32): (3, 2, 32, 64, 1, 2), + (1024, 1024, 512, 64, 64): (4, 8, 32, 64, 1, 8), + (1024, 1024, 512, 128, 128): (4, 8, 64, 64, 1, 8), + (1024, 1024, 1024, 16, 16): (2, 2, 16, 64, 1, 2), + (1024, 1024, 1024, 32, 32): (2, 8, 32, 64, 1, 2), + (1024, 1024, 1024, 64, 64): (2, 8, 32, 128, 1, 4), + (1024, 1024, 1024, 128, 128): (2, 8, 64, 64, 1, 4), + (1024, 1024, 2048, 16, 16): (2, 16, 16, 128, 3, 2), + (1024, 1024, 2048, 32, 32): (4, 32, 32, 64, 1, 2), + (1024, 1024, 2048, 64, 64): (4, 16, 64, 64, 1, 4), + (1024, 1024, 2048, 128, 128): (4, 32, 64, 64, 1, 4), + (1024, 1024, 4096, 16, 16): (4, 16, 16, 128, 1, 2), + (1024, 1024, 4096, 32, 32): (3, 32, 32, 64, 1, 2), + (1024, 1024, 4096, 64, 64): (4, 32, 64, 64, 1, 4), + (1024, 1024, 4096, 128, 128): (4, 32, 64, 64, 1, 4), + (1024, 1024, 8192, 16, 16): (5, 16, 16, 128, 1, 2), + (1024, 1024, 8192, 32, 32): (2, 32, 32, 64, 3, 2), + (1024, 1024, 8192, 64, 64): (1, 16, 64, 64, 3, 2), + (1024, 1024, 8192, 128, 128): (4, 32, 64, 64, 1, 4), + (1024, 1024, 16384, 16, 16): (4, 16, 16, 128, 1, 2), + (1024, 1024, 16384, 32, 32): (1, 32, 32, 64, 3, 2), + (1024, 1024, 16384, 64, 64): (4, 16, 64, 64, 3, 2), + (1024, 1024, 16384, 128, 128): (4, 32, 128, 64, 1, 4), + (1024, 1024, 32768, 16, 16): (3, 16, 16, 128, 1, 2), + (1024, 1024, 32768, 32, 32): (1, 8, 32, 64, 3, 2), + (1024, 1024, 32768, 64, 64): (4, 16, 64, 64, 3, 2), + (1024, 1024, 32768, 128, 128): (4, 8, 128, 64, 2, 4), + (1024, 1024, 65536, 16, 16): (1, 2, 16, 128, 1, 2), + (1024, 1024, 65536, 32, 32): (2, 4, 32, 64, 3, 2), + (1024, 1024, 65536, 64, 64): (5, 16, 64, 64, 3, 2), + (1024, 1024, 65536, 128, 128): (5, 8, 128, 64, 2, 4), + (1024, 1024, 131072, 16, 16): (5, 2, 16, 128, 1, 2), + (1024, 1024, 131072, 32, 32): (1, 2, 32, 64, 3, 2), + (1024, 1024, 131072, 64, 64): (5, 16, 64, 64, 3, 2), + (1024, 1024, 131072, 128, 128): (2, 1, 128, 64, 2, 4), + (2048, 2048, 256, 16, 16): (4, 4, 16, 64, 1, 8), + (2048, 2048, 256, 32, 32): (4, 8, 32, 32, 1, 8), + (2048, 2048, 256, 64, 64): (4, 16, 64, 16, 1, 8), + (2048, 2048, 256, 128, 128): (4, 4, 128, 32, 3, 8), + (2048, 2048, 512, 16, 16): (2, 2, 16, 64, 1, 2), + (2048, 2048, 512, 32, 32): (2, 4, 32, 64, 3, 2), + (2048, 2048, 512, 64, 64): (4, 4, 64, 64, 1, 8), + (2048, 2048, 512, 128, 128): (4, 8, 64, 64, 1, 4), + (2048, 2048, 1024, 16, 16): (1, 8, 16, 64, 1, 2), + (2048, 2048, 1024, 32, 32): (2, 16, 32, 64, 3, 2), + (2048, 2048, 1024, 64, 64): (4, 8, 64, 64, 1, 4), + (2048, 2048, 1024, 128, 128): (4, 8, 128, 64, 1, 4), + (2048, 2048, 2048, 16, 16): (5, 4, 16, 128, 1, 2), + (2048, 2048, 2048, 32, 32): (1, 16, 32, 64, 3, 2), + (2048, 2048, 2048, 64, 64): (2, 8, 64, 64, 1, 4), + (2048, 2048, 2048, 128, 128): (2, 8, 128, 64, 1, 4), + (2048, 2048, 4096, 16, 16): (4, 2, 16, 128, 1, 2), + (2048, 2048, 4096, 32, 32): (2, 16, 32, 64, 3, 2), + (2048, 2048, 4096, 64, 64): (2, 8, 64, 64, 3, 2), + (2048, 2048, 4096, 128, 128): (4, 8, 128, 64, 1, 4), + (2048, 2048, 8192, 16, 16): (5, 4, 16, 128, 1, 2), + (2048, 2048, 8192, 32, 32): (2, 8, 32, 64, 3, 2), + (2048, 2048, 8192, 64, 64): (4, 8, 64, 64, 3, 2), + (2048, 2048, 8192, 128, 128): (4, 8, 128, 64, 1, 4), + (2048, 2048, 16384, 16, 16): (3, 2, 16, 128, 1, 2), + (2048, 2048, 16384, 32, 32): (2, 4, 32, 128, 3, 2), + (2048, 2048, 16384, 64, 64): (4, 8, 64, 64, 3, 2), + (2048, 2048, 16384, 128, 128): (4, 4, 128, 64, 1, 4), + (2048, 2048, 32768, 16, 16): (3, 2, 16, 128, 1, 2), + (2048, 2048, 32768, 32, 32): (3, 4, 32, 128, 3, 2), + (2048, 2048, 32768, 64, 64): (6, 4, 64, 64, 3, 2), + (2048, 2048, 32768, 128, 128): (3, 4, 128, 64, 1, 4), + (2048, 2048, 65536, 16, 16): (6, 2, 16, 128, 1, 2), + (2048, 2048, 65536, 32, 32): (1, 2, 32, 128, 1, 2), + (2048, 2048, 65536, 64, 64): (5, 4, 64, 64, 3, 2), + (2048, 2048, 65536, 128, 128): (5, 1, 128, 64, 2, 4), + (2048, 2048, 131072, 16, 16): (3, 2, 16, 128, 1, 2), + (2048, 2048, 131072, 32, 32): (2, 1, 32, 128, 3, 2), + (2048, 2048, 131072, 64, 64): (4, 1, 64, 64, 3, 2), + (2048, 2048, 131072, 128, 128): (3, 1, 128, 64, 2, 4), + (4096, 4096, 256, 16, 16): (5, 8, 16, 32, 1, 4), + (4096, 4096, 256, 32, 32): (4, 16, 32, 16, 2, 4), + (4096, 4096, 256, 64, 64): (2, 1, 64, 64, 3, 4), + (4096, 4096, 256, 128, 128): (4, 4, 128, 32, 1, 4), + (4096, 4096, 512, 16, 16): (4, 2, 16, 128, 1, 2), + (4096, 4096, 512, 32, 32): (4, 8, 32, 64, 1, 2), + (4096, 4096, 512, 64, 64): (4, 4, 64, 64, 1, 4), + (4096, 4096, 512, 128, 128): (4, 8, 128, 64, 2, 4), + (4096, 4096, 1024, 16, 16): (1, 2, 16, 128, 1, 2), + (4096, 4096, 1024, 32, 32): (6, 8, 32, 64, 3, 2), + (4096, 4096, 1024, 64, 64): (2, 16, 64, 64, 4, 4), + (4096, 4096, 1024, 128, 128): (2, 4, 128, 64, 2, 4), + (4096, 4096, 2048, 16, 16): (3, 1, 16, 128, 1, 2), + (4096, 4096, 2048, 32, 32): (1, 4, 32, 64, 5, 2), + (4096, 4096, 2048, 64, 64): (3, 16, 64, 64, 3, 2), + (4096, 4096, 2048, 128, 128): (4, 32, 128, 64, 2, 4), + (4096, 4096, 4096, 16, 16): (1, 2, 16, 128, 1, 2), + (4096, 4096, 4096, 32, 32): (1, 4, 32, 64, 3, 2), + (4096, 4096, 4096, 64, 64): (1, 1, 64, 64, 4, 4), + (4096, 4096, 4096, 128, 128): (2, 1, 128, 128, 1, 8), + (4096, 4096, 8192, 16, 16): (3, 1, 16, 128, 1, 2), + (4096, 4096, 8192, 32, 32): (2, 2, 32, 64, 5, 2), + (4096, 4096, 8192, 64, 64): (4, 16, 64, 64, 3, 2), + (4096, 4096, 8192, 128, 128): (4, 16, 128, 64, 2, 4), + (4096, 4096, 16384, 16, 16): (1, 2, 16, 128, 1, 2), + (4096, 4096, 16384, 32, 32): (4, 2, 32, 64, 5, 2), + (4096, 4096, 16384, 64, 64): (4, 16, 64, 64, 3, 2), + (4096, 4096, 16384, 128, 128): (4, 16, 128, 64, 2, 4), + (4096, 4096, 32768, 16, 16): (3, 1, 16, 128, 1, 2), + (4096, 4096, 32768, 32, 32): (3, 1, 32, 128, 1, 4), + (4096, 4096, 32768, 64, 64): (3, 1, 64, 64, 3, 4), + (4096, 4096, 32768, 128, 128): (5, 16, 128, 64, 2, 4), + (4096, 4096, 65536, 16, 16): (5, 1, 16, 128, 1, 2), + (4096, 4096, 65536, 32, 32): (5, 1, 32, 128, 1, 4), + (4096, 4096, 65536, 64, 64): (1, 1, 64, 64, 3, 4), + (4096, 4096, 65536, 128, 128): (3, 16, 128, 64, 2, 4), + (4096, 4096, 131072, 16, 16): (3, 1, 16, 128, 1, 2), + (4096, 4096, 131072, 32, 32): (3, 1, 32, 128, 3, 2), + (4096, 4096, 131072, 64, 64): (2, 1, 64, 64, 3, 4), + (4096, 4096, 131072, 128, 128): (1, 1, 128, 64, 1, 4), + (8192, 8192, 256, 16, 16): (4, 16, 16, 16, 1, 4), + (8192, 8192, 256, 32, 32): (1, 16, 32, 16, 4, 4), + (8192, 8192, 256, 64, 64): (4, 16, 64, 16, 3, 8), + (8192, 8192, 256, 128, 128): (4, 16, 128, 16, 1, 2), + (8192, 8192, 512, 16, 16): (2, 8, 16, 64, 1, 4), + (8192, 8192, 512, 32, 32): (4, 8, 32, 64, 3, 2), + (8192, 8192, 512, 64, 64): (2, 8, 64, 64, 4, 4), + (8192, 8192, 512, 128, 128): (4, 8, 128, 64, 2, 4), + (8192, 8192, 1024, 16, 16): (4, 16, 16, 64, 1, 8), + (8192, 8192, 1024, 32, 32): (2, 8, 32, 64, 5, 2), + (8192, 8192, 1024, 64, 64): (1, 16, 64, 64, 3, 2), + (8192, 8192, 1024, 128, 128): (5, 16, 128, 64, 2, 4), + (8192, 8192, 2048, 16, 16): (7, 2, 16, 128, 1, 2), + (8192, 8192, 2048, 32, 32): (1, 16, 32, 64, 5, 2), + (8192, 8192, 2048, 64, 64): (4, 16, 64, 64, 3, 2), + (8192, 8192, 2048, 128, 128): (6, 16, 128, 64, 2, 4), + (8192, 8192, 4096, 16, 16): (4, 2, 16, 128, 1, 2), + (8192, 8192, 4096, 32, 32): (2, 8, 32, 64, 5, 2), + (8192, 8192, 4096, 64, 64): (3, 16, 64, 64, 3, 2), + (8192, 8192, 4096, 128, 128): (3, 64, 128, 64, 2, 4), + (8192, 8192, 8192, 16, 16): (4, 2, 16, 128, 1, 2), + (8192, 8192, 8192, 32, 32): (1, 4, 32, 128, 5, 4), + (8192, 8192, 8192, 64, 64): (4, 4, 64, 64, 1, 4), + (8192, 8192, 8192, 128, 128): (2, 2, 128, 128, 3, 8), + (8192, 8192, 16384, 16, 16): (1, 2, 16, 128, 1, 2), + (8192, 8192, 16384, 32, 32): (4, 8, 32, 64, 5, 2), + (8192, 8192, 16384, 64, 64): (5, 8, 64, 64, 3, 2), + (8192, 8192, 16384, 128, 128): (3, 16, 128, 64, 2, 4), + (8192, 8192, 32768, 16, 16): (7, 2, 16, 128, 1, 2), + (8192, 8192, 32768, 32, 32): (3, 4, 32, 64, 3, 2), + (8192, 8192, 32768, 64, 64): (2, 8, 64, 64, 3, 2), + (8192, 8192, 32768, 128, 128): (6, 16, 128, 64, 2, 4), + (8192, 8192, 65536, 16, 16): (9, 2, 16, 128, 1, 2), + (8192, 8192, 65536, 32, 32): (7, 4, 32, 64, 5, 2), + (8192, 8192, 65536, 64, 64): (4, 8, 64, 64, 3, 2), + (8192, 8192, 65536, 128, 128): (3, 16, 128, 64, 2, 4), + (8192, 8192, 131072, 16, 16): (9, 2, 16, 128, 1, 2), + (8192, 8192, 131072, 32, 32): (1, 8, 32, 64, 5, 2), + (8192, 8192, 131072, 64, 64): (1, 8, 64, 64, 3, 2), + (8192, 8192, 131072, 128, 128): (4, 16, 128, 64, 2, 4), + (16384, 16384, 256, 16, 16): (5, 16, 16, 16, 1, 4), + (16384, 16384, 256, 32, 32): (4, 16, 32, 16, 4, 4), + (16384, 16384, 256, 64, 64): (4, 16, 64, 16, 3, 8), + (16384, 16384, 256, 128, 128): (4, 16, 128, 16, 1, 2), + (16384, 16384, 512, 16, 16): (2, 8, 16, 64, 1, 4), + (16384, 16384, 512, 32, 32): (1, 4, 32, 64, 5, 2), + (16384, 16384, 512, 64, 64): (4, 8, 64, 64, 1, 4), + (16384, 16384, 512, 128, 128): (3, 8, 128, 64, 2, 4), + (16384, 16384, 1024, 16, 16): (4, 2, 16, 128, 1, 2), + (16384, 16384, 1024, 32, 32): (4, 8, 32, 64, 5, 2), + (16384, 16384, 1024, 64, 64): (6, 16, 64, 64, 3, 2), + (16384, 16384, 1024, 128, 128): (3, 16, 128, 64, 2, 4), + (16384, 16384, 2048, 16, 16): (3, 2, 16, 128, 1, 2), + (16384, 16384, 2048, 32, 32): (1, 8, 32, 64, 5, 2), + (16384, 16384, 2048, 64, 64): (5, 16, 64, 64, 3, 2), + (16384, 16384, 2048, 128, 128): (2, 32, 128, 64, 2, 4), + (16384, 16384, 4096, 16, 16): (2, 2, 16, 128, 1, 2), + (16384, 16384, 4096, 32, 32): (1, 4, 32, 64, 3, 2), + (16384, 16384, 4096, 64, 64): (2, 8, 64, 64, 3, 2), + (16384, 16384, 4096, 128, 128): (3, 16, 128, 64, 2, 4), + (16384, 16384, 8192, 16, 16): (3, 2, 16, 128, 1, 2), + (16384, 16384, 8192, 32, 32): (2, 4, 32, 64, 5, 2), + (16384, 16384, 8192, 64, 64): (4, 8, 64, 64, 3, 2), + (16384, 16384, 8192, 128, 128): (8, 32, 128, 64, 2, 4), + (16384, 16384, 16384, 16, 16): (1, 2, 16, 256, 1, 4), + (16384, 16384, 16384, 32, 32): (1, 4, 32, 128, 3, 4), + (16384, 16384, 16384, 64, 64): (5, 4, 64, 64, 1, 4), + (16384, 16384, 16384, 128, 128): (4, 8, 128, 64, 2, 4), + (16384, 16384, 32768, 16, 16): (2, 2, 16, 128, 1, 2), + (16384, 16384, 32768, 32, 32): (1, 4, 32, 64, 3, 2), + (16384, 16384, 32768, 64, 64): (5, 4, 64, 64, 1, 4), + (16384, 16384, 32768, 128, 128): (5, 8, 128, 64, 2, 4), + (16384, 16384, 65536, 16, 16): (8, 2, 16, 128, 1, 2), + (16384, 16384, 65536, 32, 32): (6, 4, 32, 64, 5, 2), + (16384, 16384, 65536, 64, 64): (2, 4, 64, 64, 1, 4), + (16384, 16384, 65536, 128, 128): (4, 8, 128, 64, 2, 4), + (16384, 16384, 131072, 16, 16): (3, 1, 16, 128, 1, 2), + (16384, 16384, 131072, 32, 32): (1, 4, 32, 64, 3, 2), + (16384, 16384, 131072, 64, 64): (4, 4, 64, 64, 1, 4), + (16384, 16384, 131072, 128, 128): (1, 8, 128, 64, 2, 4), + (32768, 32768, 256, 16, 16): (4, 16, 16, 16, 1, 4), + (32768, 32768, 512, 16, 16): (4, 2, 16, 128, 1, 2), + (32768, 32768, 1024, 16, 16): (3, 2, 16, 128, 1, 2), + (32768, 32768, 2048, 16, 16): (4, 2, 16, 128, 1, 2), + (32768, 32768, 4096, 16, 16): (5, 4, 16, 64, 1, 1), + (32768, 32768, 8192, 16, 16): (4, 4, 16, 64, 1, 1), + (32768, 32768, 16384, 16, 16): (4, 4, 16, 64, 1, 1), + (32768, 32768, 32768, 16, 16): (5, 4, 16, 64, 1, 1), + }, + ("scatter_mm", "NVIDIA A100-SXM4-80GB", (0, torch.float32, 0.5)): { + (256, 256, 256, 16, 16): (1, 1, 16, 16, 1, 8), + (256, 256, 256, 32, 32): (1, 1, 16, 16, 1, 4), + (256, 256, 256, 64, 64): (1, 1, 16, 16, 1, 4), + (256, 256, 256, 128, 128): (1, 1, 16, 16, 1, 1), + (256, 256, 512, 16, 16): (1, 1, 16, 16, 1, 4), + (256, 256, 512, 32, 32): (1, 16, 16, 16, 1, 1), + (256, 256, 512, 64, 64): (1, 1, 16, 16, 1, 1), + (256, 256, 512, 128, 128): (1, 1, 32, 32, 1, 4), + (256, 256, 1024, 16, 16): (1, 1, 16, 32, 1, 2), + (256, 256, 1024, 32, 32): (1, 4, 16, 16, 1, 1), + (256, 256, 1024, 64, 64): (1, 1, 32, 32, 1, 4), + (256, 256, 1024, 128, 128): (1, 1, 32, 32, 1, 4), + (256, 256, 2048, 16, 16): (1, 2, 16, 32, 1, 2), + (256, 256, 2048, 32, 32): (1, 1, 16, 32, 1, 2), + (256, 256, 2048, 64, 64): (2, 1, 16, 32, 1, 2), + (256, 256, 2048, 128, 128): (1, 1, 16, 16, 1, 1), + (256, 256, 4096, 16, 16): (1, 1, 16, 32, 1, 2), + (256, 256, 4096, 32, 32): (1, 1, 16, 32, 1, 2), + (256, 256, 4096, 64, 64): (1, 1, 32, 32, 1, 4), + (256, 256, 4096, 128, 128): (3, 1, 32, 64, 1, 4), + (256, 256, 8192, 16, 16): (1, 32, 16, 64, 1, 2), + (256, 256, 8192, 32, 32): (1, 1, 32, 64, 1, 4), + (256, 256, 8192, 64, 64): (1, 1, 32, 64, 1, 4), + (256, 256, 8192, 128, 128): (2, 1, 64, 32, 1, 4), + (256, 256, 16384, 16, 16): (1, 1, 16, 64, 1, 2), + (256, 256, 16384, 32, 32): (1, 1, 32, 64, 1, 4), + (256, 256, 16384, 64, 64): (1, 128, 64, 64, 1, 4), + (256, 256, 16384, 128, 128): (2, 1, 64, 32, 1, 4), + (256, 256, 32768, 16, 16): (2, 128, 16, 64, 1, 1), + (256, 256, 32768, 32, 32): (1, 1, 32, 64, 1, 4), + (256, 256, 32768, 64, 64): (1, 128, 64, 64, 1, 4), + (256, 256, 32768, 128, 128): (2, 1, 64, 64, 1, 4), + (256, 256, 65536, 16, 16): (1, 1, 16, 64, 1, 2), + (256, 256, 65536, 32, 32): (1, 1, 32, 64, 1, 4), + (256, 256, 65536, 64, 64): (2, 1, 64, 64, 1, 4), + (256, 256, 65536, 128, 128): (1, 1, 128, 32, 1, 4), + (256, 256, 131072, 16, 16): (3, 128, 16, 64, 1, 1), + (256, 256, 131072, 32, 32): (1, 1, 32, 64, 1, 4), + (256, 256, 131072, 64, 64): (2, 1, 64, 64, 1, 4), + (256, 256, 131072, 128, 128): (1, 8192, 64, 16, 1, 4), + (512, 512, 256, 16, 16): (1, 2, 16, 16, 1, 1), + (512, 512, 256, 32, 32): (1, 4, 16, 16, 1, 1), + (512, 512, 256, 64, 64): (1, 16, 16, 16, 1, 1), + (512, 512, 256, 128, 128): (1, 1, 16, 32, 1, 4), + (512, 512, 512, 16, 16): (1, 8, 16, 32, 1, 2), + (512, 512, 512, 32, 32): (1, 8, 16, 32, 1, 2), + (512, 512, 512, 64, 64): (1, 2, 16, 32, 1, 2), + (512, 512, 512, 128, 128): (1, 1, 32, 32, 1, 4), + (512, 512, 1024, 16, 16): (1, 1, 16, 32, 1, 2), + (512, 512, 1024, 32, 32): (1, 1, 16, 32, 1, 2), + (512, 512, 1024, 64, 64): (1, 1, 16, 32, 1, 2), + (512, 512, 1024, 128, 128): (1, 1, 64, 32, 1, 4), + (512, 512, 2048, 16, 16): (1, 16, 16, 64, 1, 2), + (512, 512, 2048, 32, 32): (1, 1, 32, 32, 1, 4), + (512, 512, 2048, 64, 64): (1, 1, 32, 32, 1, 4), + (512, 512, 2048, 128, 128): (2, 1, 32, 32, 1, 4), + (512, 512, 4096, 16, 16): (2, 64, 16, 64, 1, 1), + (512, 512, 4096, 32, 32): (1, 64, 32, 64, 1, 4), + (512, 512, 4096, 64, 64): (1, 1, 32, 32, 1, 4), + (512, 512, 4096, 128, 128): (1, 1, 64, 32, 1, 4), + (512, 512, 8192, 16, 16): (2, 64, 16, 64, 1, 1), + (512, 512, 8192, 32, 32): (1, 256, 32, 32, 1, 1), + (512, 512, 8192, 64, 64): (1, 64, 64, 64, 1, 4), + (512, 512, 8192, 128, 128): (2, 1, 64, 32, 1, 8), + (512, 512, 16384, 16, 16): (2, 64, 16, 64, 1, 1), + (512, 512, 16384, 32, 32): (1, 128, 32, 32, 1, 1), + (512, 512, 16384, 64, 64): (1, 64, 64, 64, 1, 4), + (512, 512, 16384, 128, 128): (3, 1, 64, 32, 1, 8), + (512, 512, 32768, 16, 16): (2, 64, 16, 64, 1, 1), + (512, 512, 32768, 32, 32): (1, 128, 32, 32, 1, 1), + (512, 512, 32768, 64, 64): (1, 64, 64, 64, 1, 4), + (512, 512, 32768, 128, 128): (2, 1, 64, 32, 1, 8), + (512, 512, 65536, 16, 16): (2, 32, 16, 64, 1, 1), + (512, 512, 65536, 32, 32): (1, 128, 32, 32, 1, 1), + (512, 512, 65536, 64, 64): (1, 64, 64, 64, 1, 4), + (512, 512, 65536, 128, 128): (2, 1, 64, 32, 1, 8), + (512, 512, 131072, 16, 16): (2, 32, 16, 64, 1, 1), + (512, 512, 131072, 32, 32): (1, 128, 32, 32, 1, 1), + (512, 512, 131072, 64, 64): (3, 64, 64, 64, 1, 4), + (512, 512, 131072, 128, 128): (1, 8192, 64, 16, 1, 4), + (1024, 1024, 256, 16, 16): (1, 4, 16, 32, 1, 2), + (1024, 1024, 256, 32, 32): (1, 4, 16, 32, 1, 2), + (1024, 1024, 256, 64, 64): (1, 1, 16, 32, 1, 2), + (1024, 1024, 256, 128, 128): (1, 1, 16, 16, 1, 1), + (1024, 1024, 512, 16, 16): (1, 8, 16, 32, 1, 2), + (1024, 1024, 512, 32, 32): (1, 8, 16, 32, 1, 1), + (1024, 1024, 512, 64, 64): (1, 8, 32, 32, 1, 4), + (1024, 1024, 512, 128, 128): (2, 1, 32, 32, 1, 4), + (1024, 1024, 1024, 16, 16): (1, 16, 16, 32, 1, 2), + (1024, 1024, 1024, 32, 32): (1, 16, 32, 64, 1, 4), + (1024, 1024, 1024, 64, 64): (1, 16, 32, 64, 1, 4), + (1024, 1024, 1024, 128, 128): (1, 1, 32, 32, 1, 4), + (1024, 1024, 2048, 16, 16): (2, 32, 16, 64, 1, 1), + (1024, 1024, 2048, 32, 32): (1, 32, 32, 64, 1, 4), + (1024, 1024, 2048, 64, 64): (1, 32, 64, 64, 1, 4), + (1024, 1024, 2048, 128, 128): (1, 1, 32, 64, 1, 4), + (1024, 1024, 4096, 16, 16): (2, 16, 16, 64, 1, 1), + (1024, 1024, 4096, 32, 32): (1, 64, 32, 32, 1, 1), + (1024, 1024, 4096, 64, 64): (1, 64, 64, 64, 1, 4), + (1024, 1024, 4096, 128, 128): (2, 64, 64, 32, 1, 8), + (1024, 1024, 8192, 16, 16): (2, 16, 16, 64, 1, 1), + (1024, 1024, 8192, 32, 32): (1, 64, 32, 32, 1, 1), + (1024, 1024, 8192, 64, 64): (1, 64, 64, 64, 1, 4), + (1024, 1024, 8192, 128, 128): (4, 1, 32, 64, 1, 4), + (1024, 1024, 16384, 16, 16): (2, 16, 16, 64, 1, 1), + (1024, 1024, 16384, 32, 32): (1, 64, 32, 32, 1, 1), + (1024, 1024, 16384, 64, 64): (1, 32, 64, 64, 1, 4), + (1024, 1024, 16384, 128, 128): (2, 64, 64, 32, 1, 4), + (1024, 1024, 32768, 16, 16): (2, 16, 16, 64, 1, 1), + (1024, 1024, 32768, 32, 32): (1, 64, 32, 32, 1, 1), + (1024, 1024, 32768, 64, 64): (1, 32, 64, 64, 1, 4), + (1024, 1024, 32768, 128, 128): (4, 1, 32, 64, 1, 4), + (1024, 1024, 65536, 16, 16): (2, 16, 16, 64, 1, 1), + (1024, 1024, 65536, 32, 32): (1, 32, 32, 32, 1, 1), + (1024, 1024, 65536, 64, 64): (2, 32, 64, 64, 1, 4), + (1024, 1024, 65536, 128, 128): (4, 1, 64, 32, 1, 4), + (1024, 1024, 131072, 16, 16): (2, 16, 16, 64, 1, 1), + (1024, 1024, 131072, 32, 32): (1, 32, 32, 32, 1, 1), + (1024, 1024, 131072, 64, 64): (1, 16, 64, 64, 1, 4), + (1024, 1024, 131072, 128, 128): (1, 8192, 64, 16, 1, 4), + (2048, 2048, 256, 16, 16): (1, 4, 16, 32, 1, 2), + (2048, 2048, 256, 32, 32): (1, 8, 16, 32, 1, 1), + (2048, 2048, 256, 64, 64): (1, 8, 32, 32, 1, 4), + (2048, 2048, 256, 128, 128): (1, 4, 64, 64, 1, 8), + (2048, 2048, 512, 16, 16): (2, 8, 16, 32, 1, 2), + (2048, 2048, 512, 32, 32): (2, 8, 32, 64, 1, 4), + (2048, 2048, 512, 64, 64): (2, 4, 64, 64, 1, 4), + (2048, 2048, 512, 128, 128): (1, 8, 32, 64, 1, 4), + (2048, 2048, 1024, 16, 16): (2, 16, 16, 64, 3, 1), + (2048, 2048, 1024, 32, 32): (1, 32, 32, 32, 1, 1), + (2048, 2048, 1024, 64, 64): (1, 16, 64, 64, 1, 4), + (2048, 2048, 1024, 128, 128): (2, 4, 64, 64, 1, 8), + (2048, 2048, 2048, 16, 16): (2, 16, 16, 64, 1, 1), + (2048, 2048, 2048, 32, 32): (1, 32, 32, 32, 1, 1), + (2048, 2048, 2048, 64, 64): (1, 16, 64, 64, 1, 4), + (2048, 2048, 2048, 128, 128): (2, 32, 32, 64, 1, 4), + (2048, 2048, 4096, 16, 16): (3, 2, 16, 64, 1, 1), + (2048, 2048, 4096, 32, 32): (3, 4, 32, 32, 1, 1), + (2048, 2048, 4096, 64, 64): (1, 16, 64, 64, 1, 4), + (2048, 2048, 4096, 128, 128): (2, 32, 64, 32, 1, 4), + (2048, 2048, 8192, 16, 16): (3, 4, 16, 64, 1, 1), + (2048, 2048, 8192, 32, 32): (2, 4, 32, 32, 1, 1), + (2048, 2048, 8192, 64, 64): (2, 32, 64, 32, 1, 2), + (2048, 2048, 8192, 128, 128): (4, 1, 32, 64, 1, 4), + (2048, 2048, 16384, 16, 16): (3, 4, 16, 64, 1, 1), + (2048, 2048, 16384, 32, 32): (1, 4, 32, 32, 1, 1), + (2048, 2048, 16384, 64, 64): (2, 8, 64, 32, 1, 2), + (2048, 2048, 16384, 128, 128): (2, 8, 64, 32, 1, 4), + (2048, 2048, 32768, 16, 16): (2, 4, 16, 64, 1, 1), + (2048, 2048, 32768, 32, 32): (2, 8, 32, 32, 1, 1), + (2048, 2048, 32768, 64, 64): (1, 16, 64, 32, 1, 2), + (2048, 2048, 32768, 128, 128): (4, 1, 32, 64, 1, 4), + (2048, 2048, 65536, 16, 16): (3, 4, 16, 64, 1, 1), + (2048, 2048, 65536, 32, 32): (1, 8, 32, 32, 1, 1), + (2048, 2048, 65536, 64, 64): (1, 8, 64, 32, 1, 2), + (2048, 2048, 65536, 128, 128): (4, 1, 64, 32, 1, 4), + (2048, 2048, 131072, 16, 16): (2, 4, 16, 64, 1, 1), + (2048, 2048, 131072, 32, 32): (1, 8, 32, 32, 1, 1), + (2048, 2048, 131072, 64, 64): (3, 1, 64, 32, 1, 2), + (2048, 2048, 131072, 128, 128): (1, 8192, 128, 16, 1, 8), + (4096, 4096, 256, 16, 16): (2, 4, 16, 32, 1, 2), + (4096, 4096, 256, 32, 32): (1, 4, 32, 64, 1, 4), + (4096, 4096, 256, 64, 64): (1, 4, 64, 64, 1, 4), + (4096, 4096, 256, 128, 128): (1, 4, 32, 64, 1, 4), + (4096, 4096, 512, 16, 16): (2, 8, 16, 64, 3, 1), + (4096, 4096, 512, 32, 32): (2, 16, 32, 32, 1, 1), + (4096, 4096, 512, 64, 64): (1, 8, 64, 64, 1, 4), + (4096, 4096, 512, 128, 128): (1, 8, 32, 64, 1, 4), + (4096, 4096, 1024, 16, 16): (1, 8, 16, 64, 3, 1), + (4096, 4096, 1024, 32, 32): (1, 16, 32, 32, 1, 1), + (4096, 4096, 1024, 64, 64): (1, 16, 64, 32, 1, 2), + (4096, 4096, 1024, 128, 128): (1, 16, 32, 64, 1, 4), + (4096, 4096, 2048, 16, 16): (1, 16, 16, 64, 3, 1), + (4096, 4096, 2048, 32, 32): (1, 16, 32, 32, 1, 1), + (4096, 4096, 2048, 64, 64): (3, 16, 64, 32, 1, 2), + (4096, 4096, 2048, 128, 128): (4, 8, 32, 64, 1, 4), + (4096, 4096, 4096, 16, 16): (1, 8, 16, 64, 3, 1), + (4096, 4096, 4096, 32, 32): (1, 1, 32, 32, 1, 1), + (4096, 4096, 4096, 64, 64): (2, 16, 64, 32, 1, 2), + (4096, 4096, 4096, 128, 128): (4, 8, 32, 64, 1, 4), + (4096, 4096, 8192, 16, 16): (1, 8, 16, 64, 3, 1), + (4096, 4096, 8192, 32, 32): (2, 1, 32, 32, 1, 1), + (4096, 4096, 8192, 64, 64): (1, 16, 64, 32, 1, 2), + (4096, 4096, 8192, 128, 128): (2, 1, 32, 64, 1, 4), + (4096, 4096, 16384, 16, 16): (1, 8, 16, 64, 3, 1), + (4096, 4096, 16384, 32, 32): (1, 1, 32, 32, 1, 1), + (4096, 4096, 16384, 64, 64): (2, 8, 64, 32, 1, 2), + (4096, 4096, 16384, 128, 128): (2, 1, 32, 64, 1, 4), + (4096, 4096, 32768, 16, 16): (1, 8, 16, 64, 3, 1), + (4096, 4096, 32768, 32, 32): (1, 1, 32, 32, 1, 1), + (4096, 4096, 32768, 64, 64): (1, 8, 64, 32, 1, 2), + (4096, 4096, 32768, 128, 128): (2, 1, 32, 64, 1, 4), + (4096, 4096, 65536, 16, 16): (1, 8, 16, 64, 3, 1), + (4096, 4096, 65536, 32, 32): (3, 1, 32, 32, 1, 1), + (4096, 4096, 65536, 64, 64): (3, 4, 64, 32, 1, 2), + (4096, 4096, 65536, 128, 128): (2, 1, 32, 64, 1, 4), + (4096, 4096, 131072, 16, 16): (1, 8, 16, 64, 3, 1), + (4096, 4096, 131072, 32, 32): (1, 1, 32, 32, 1, 1), + (4096, 4096, 131072, 64, 64): (2, 8, 64, 32, 1, 2), + (4096, 4096, 131072, 128, 128): (1, 8192, 128, 16, 1, 8), + (8192, 8192, 256, 16, 16): (2, 4, 16, 64, 3, 1), + (8192, 8192, 256, 32, 32): (1, 8, 32, 32, 1, 1), + (8192, 8192, 256, 64, 64): (1, 4, 64, 64, 1, 4), + (8192, 8192, 256, 128, 128): (1, 4, 32, 64, 1, 4), + (8192, 8192, 512, 16, 16): (1, 4, 16, 64, 3, 1), + (8192, 8192, 512, 32, 32): (1, 16, 32, 32, 1, 1), + (8192, 8192, 512, 64, 64): (2, 4, 64, 64, 1, 4), + (8192, 8192, 512, 128, 128): (2, 1, 32, 64, 1, 4), + (8192, 8192, 1024, 16, 16): (3, 8, 16, 64, 3, 1), + (8192, 8192, 1024, 32, 32): (1, 16, 32, 32, 1, 1), + (8192, 8192, 1024, 64, 64): (1, 8, 64, 32, 1, 2), + (8192, 8192, 1024, 128, 128): (2, 4, 32, 64, 1, 4), + (8192, 8192, 2048, 16, 16): (1, 8, 16, 64, 3, 1), + (8192, 8192, 2048, 32, 32): (1, 16, 32, 32, 1, 1), + (8192, 8192, 2048, 64, 64): (2, 8, 64, 32, 1, 2), + (8192, 8192, 2048, 128, 128): (4, 1, 32, 64, 1, 4), + (8192, 8192, 4096, 16, 16): (1, 8, 16, 64, 3, 1), + (8192, 8192, 4096, 32, 32): (1, 16, 32, 32, 1, 1), + (8192, 8192, 4096, 64, 64): (1, 4, 64, 32, 1, 2), + (8192, 8192, 4096, 128, 128): (3, 1, 32, 64, 1, 4), + (8192, 8192, 8192, 16, 16): (1, 8, 16, 64, 3, 1), + (8192, 8192, 8192, 32, 32): (1, 8, 32, 32, 1, 1), + (8192, 8192, 8192, 64, 64): (1, 8, 64, 32, 1, 2), + (8192, 8192, 8192, 128, 128): (4, 1, 32, 64, 1, 4), + (8192, 8192, 16384, 16, 16): (3, 4, 16, 64, 3, 1), + (8192, 8192, 16384, 32, 32): (1, 8, 32, 32, 1, 1), + (8192, 8192, 16384, 64, 64): (2, 2, 64, 32, 1, 2), + (8192, 8192, 16384, 128, 128): (7, 1, 32, 64, 1, 4), + (8192, 8192, 32768, 16, 16): (1, 4, 16, 64, 3, 1), + (8192, 8192, 32768, 32, 32): (1, 8, 32, 32, 1, 1), + (8192, 8192, 32768, 64, 64): (3, 2, 64, 32, 1, 2), + (8192, 8192, 32768, 128, 128): (6, 1, 32, 64, 1, 4), + (8192, 8192, 65536, 16, 16): (1, 4, 16, 64, 3, 1), + (8192, 8192, 65536, 32, 32): (4, 8, 32, 32, 1, 1), + (8192, 8192, 65536, 64, 64): (1, 2, 64, 32, 1, 2), + (8192, 8192, 65536, 128, 128): (4, 1, 32, 64, 1, 4), + (8192, 8192, 131072, 16, 16): (1, 4, 16, 64, 3, 1), + (8192, 8192, 131072, 32, 32): (1, 8, 32, 32, 1, 1), + (8192, 8192, 131072, 64, 64): (5, 4, 64, 32, 1, 2), + (8192, 8192, 131072, 128, 128): (1, 4096, 128, 16, 1, 8), + (16384, 16384, 256, 16, 16): (1, 4, 16, 64, 3, 1), + (16384, 16384, 256, 32, 32): (1, 8, 32, 32, 1, 1), + (16384, 16384, 256, 64, 64): (1, 4, 64, 32, 1, 2), + (16384, 16384, 256, 128, 128): (1, 4, 32, 64, 1, 4), + (16384, 16384, 512, 16, 16): (1, 8, 16, 64, 3, 1), + (16384, 16384, 512, 32, 32): (1, 16, 32, 32, 1, 1), + (16384, 16384, 512, 64, 64): (1, 4, 64, 32, 1, 2), + (16384, 16384, 512, 128, 128): (3, 1, 32, 64, 1, 4), + (16384, 16384, 1024, 16, 16): (1, 8, 16, 64, 3, 1), + (16384, 16384, 1024, 32, 32): (1, 16, 32, 32, 1, 1), + (16384, 16384, 1024, 64, 64): (2, 4, 64, 32, 1, 2), + (16384, 16384, 1024, 128, 128): (1, 2, 32, 64, 1, 4), + (16384, 16384, 2048, 16, 16): (1, 4, 16, 64, 3, 1), + (16384, 16384, 2048, 32, 32): (1, 16, 32, 32, 1, 1), + (16384, 16384, 2048, 64, 64): (3, 4, 64, 32, 1, 2), + (16384, 16384, 2048, 128, 128): (2, 1, 32, 64, 1, 4), + (16384, 16384, 4096, 16, 16): (4, 8, 16, 64, 3, 1), + (16384, 16384, 4096, 32, 32): (5, 16, 32, 32, 1, 1), + (16384, 16384, 4096, 64, 64): (3, 2, 64, 32, 1, 2), + (16384, 16384, 4096, 128, 128): (2, 1, 32, 64, 1, 4), + (16384, 16384, 8192, 16, 16): (1, 4, 16, 64, 3, 1), + (16384, 16384, 8192, 32, 32): (1, 4, 32, 32, 1, 1), + (16384, 16384, 8192, 64, 64): (1, 2, 64, 32, 1, 2), + (16384, 16384, 8192, 128, 128): (2, 1, 32, 64, 1, 4), + (16384, 16384, 16384, 16, 16): (1, 8, 16, 64, 3, 1), + (16384, 16384, 16384, 32, 32): (1, 4, 32, 32, 1, 1), + (16384, 16384, 16384, 64, 64): (1, 2, 64, 32, 1, 2), + (16384, 16384, 16384, 128, 128): (3, 1, 32, 64, 1, 4), + (16384, 16384, 32768, 16, 16): (1, 4, 16, 64, 3, 1), + (16384, 16384, 32768, 32, 32): (1, 2, 32, 32, 1, 1), + (16384, 16384, 32768, 64, 64): (3, 2, 64, 32, 1, 2), + (16384, 16384, 32768, 128, 128): (3, 1, 32, 64, 1, 4), + (16384, 16384, 65536, 16, 16): (1, 8, 16, 64, 3, 1), + (16384, 16384, 65536, 32, 32): (1, 4, 32, 32, 1, 1), + (16384, 16384, 65536, 64, 64): (4, 4, 64, 32, 1, 2), + (16384, 16384, 65536, 128, 128): (5, 1, 32, 64, 1, 4), + (16384, 16384, 131072, 16, 16): (1, 2, 16, 64, 3, 1), + (16384, 16384, 131072, 32, 32): (1, 4, 32, 32, 1, 1), + (16384, 16384, 131072, 64, 64): (1, 2, 64, 32, 1, 2), + (16384, 16384, 131072, 128, 128): (1, 4096, 128, 16, 1, 8), + }, + # END GENERATED DATA +} + +if __name__ == "__main__": + for dtype in [torch.float16, torch.bfloat16, torch.float32]: + for op in ["bsr_dense_addmm"]: + main(op=op, force=False, dtype=dtype) diff --git a/shared/package-files/9d/9d36572326145887f2e599849c88d4b55b274c4ab34c36ef14a81bd83a643c6c/blob b/shared/package-files/9d/9d36572326145887f2e599849c88d4b55b274c4ab34c36ef14a81bd83a643c6c/blob new file mode 100644 index 0000000000000000000000000000000000000000..5ae0db8726b069b9e23f40905c6685fddb630910 --- /dev/null +++ b/shared/package-files/9d/9d36572326145887f2e599849c88d4b55b274c4ab34c36ef14a81bd83a643c6c/blob @@ -0,0 +1,724 @@ +""" +Robust linear models with support for the M-estimators listed under +:ref:`norms ` + +References +---------- +PJ Huber. 'Robust Statistics' John Wiley and Sons, Inc., New York. 1981. + +PJ Huber. 1973, 'The 1972 Wald Memorial Lectures: Robust Regression: + Asymptotics, Conjectures, and Monte Carlo.' The Annals of Statistics, + 1.5, 799-821. + +R Venables, B Ripley. 'Modern Applied Statistics in S' Springer, New York, + 2002. +""" + +import numpy as np +from scipy import stats + +import statsmodels.base.model as base +import statsmodels.base.wrapper as wrap +import statsmodels.regression._tools as reg_tools +import statsmodels.regression.linear_model as lm +from statsmodels.robust import norms, scale +from statsmodels.tools._decorators import cache_readonly +from statsmodels.tools.sm_exceptions import ConvergenceWarning +from statsmodels.tools.validation import string_like + +__all__ = ["RLM"] + + +def _check_convergence(criterion, iteration, tol, maxiter): + cond = np.abs(criterion[iteration] - criterion[iteration - 1]) + return not (np.any(cond > tol) and iteration < maxiter) + + +class RLM(base.LikelihoodModel): + __doc__ = f""" + Robust Linear Model + + Estimate a robust linear model via iteratively reweighted least squares + given a robust criterion estimator. + + {base._model_params_doc} + M : statsmodels.robust.norms.RobustNorm, optional + The robust criterion function for downweighting outliers. + The current options are LeastSquares, HuberT, RamsayE, AndrewWave, + TrimmedMean, Hampel, TukeyBiweight, TukeyQuartic, StudentT, and + MQuantileNorm. The default is HuberT(). + See statsmodels.robust.norms for more information. + {base._missing_param_doc} + + Attributes + ---------- + df_model : float + The degrees of freedom of the model. The number of regressors p less + one for the intercept. Note that the reported model degrees + of freedom does not count the intercept as a regressor, though + the model is assumed to have an intercept. + df_resid : float + The residual degrees of freedom. The number of observations n + less the number of regressors p. Note that here p does include + the intercept as using a degree of freedom. + endog : ndarray + See above. Note that endog is a reference to the data so that if + data is already an array and it is changed, then `endog` changes + as well. + exog : ndarray + See above. Note that endog is a reference to the data so that if + data is already an array and it is changed, then `endog` changes + as well. + M : statsmodels.robust.norms.RobustNorm + See above. Robust estimator instance instantiated. + nobs : float + The number of observations n + pinv_wexog : ndarray + The pseudoinverse of the design / exogenous data array. Note that + RLM has no whiten method, so this is just the pseudo inverse of the + design. + normalized_cov_params : ndarray + The p x p normalized covariance of the design / exogenous data. + This is approximately equal to (X.T X)^(-1) + + Examples + -------- + >>> import statsmodels.api as sm + >>> data = sm.datasets.stackloss.load() + >>> data.exog = sm.add_constant(data.exog) + >>> rlm_model = sm.RLM(data.endog, data.exog, M=sm.robust.norms.HuberT()) + >>> rlm_results = rlm_model.fit() + >>> rlm_results.params + array([ 0.82938433, 0.92606597, -0.12784672, -41.02649835]) + >>> rlm_results.bse + array([ 0.11100521, 0.30293016, 0.12864961, 9.79189854]) + >>> rlm_results_HC2 = rlm_model.fit(cov="H2") + >>> rlm_results_HC2.params + array([ 0.82938433, 0.92606597, -0.12784672, -41.02649835]) + >>> rlm_results_HC2.bse + array([ 0.11945975, 0.32235497, 0.11796313, 9.08950419]) + >>> mod = sm.RLM(data.endog, data.exog, M=sm.robust.norms.Hampel()) + >>> rlm_hamp_hub = mod.fit(scale_est=sm.robust.scale.HuberScale()) + >>> rlm_hamp_hub.params + array([ 0.73175452, 1.25082038, -0.14794399, -40.27122257]) + """ + + def __init__(self, endog, exog, M=None, missing="none", **kwargs): + self._check_kwargs(kwargs) + self.M = M if M is not None else norms.HuberT() + super(base.LikelihoodModel, self).__init__( + endog, exog, missing=missing, **kwargs + ) + self._initialize() + # things to remove_data + self._data_attr.extend(["weights", "pinv_wexog"]) + + # Populated by `fit`; declared here so they exist (as None) even + # before `fit` has been called. + self.cov = None + self.scale_est = None + self.scale = None + self.weights = None + + def _initialize(self): + """ + Initialize the model for the IRLS fit + + Resets the history and number of iterations. + """ + self.pinv_wexog = np.linalg.pinv(self.exog) + self.normalized_cov_params = np.dot( + self.pinv_wexog, np.transpose(self.pinv_wexog) + ) + self.df_resid = float(self.exog.shape[0] - np.linalg.matrix_rank(self.exog)) + self.df_model = float(np.linalg.matrix_rank(self.exog) - 1) + self.nobs = float(self.endog.shape[0]) + + def score(self, params): + raise NotImplementedError + + def information(self, params): + raise NotImplementedError + + def predict(self, params, exog=None): + """ + Return linear predicted values from a design matrix + + Parameters + ---------- + params : array_like + Parameters of a linear model + exog : array_like, optional + Design / exogenous data. Model exog is used if None. + + Returns + ------- + ndarray + The predicted values. + """ + # copied from linear_model # TODO: then is it needed? + if exog is None: + exog = self.exog + return np.dot(exog, params) + + def loglike(self, params): + raise NotImplementedError + + def deviance(self, tmp_results): + """ + Return the (unnormalized) log-likelihood from the M estimator + + Parameters + ---------- + tmp_results : Results + Results from intermediate fit containing ``fittedvalues`` and + ``scale`` used to compute the residuals. + + Returns + ------- + float + The value of the deviance. + """ + tmp_resid = self.endog - tmp_results.fittedvalues + return self.M(tmp_resid / tmp_results.scale).sum() + + def _update_history(self, tmp_results, history, conv): + history["params"].append(tmp_results.params) + history["scale"].append(self.scale) + if conv == "dev": + history["deviance"].append(self.deviance(tmp_results)) + elif conv == "sresid": + history["sresid"].append(tmp_results.resid / tmp_results.scale) + elif conv == "weights": + history["weights"].append(tmp_results.model.weights) + return history + + def _estimate_scale(self, resid, scale_est): + """ + Estimate the scale based on the option provided to the fit method + + Parameters + ---------- + resid : ndarray + The residuals used to estimate the scale. + scale_est : {"mad"} or callable + The scale estimator requested in the call to `fit`. + + Returns + ------- + float + The estimated scale. + """ + if isinstance(scale_est, str): + _ = string_like(scale_est, "scale_est", options=("mad",)) + return scale.mad(resid, center=0) + elif isinstance(scale_est, scale.HuberScale): + return scale_est(self.df_resid, self.nobs, resid) + else: + try: + return scale_est(self, resid) + except TypeError: + return scale_est(resid) * np.sqrt(self.nobs / self.df_resid) + + def fit( + self, + maxiter=50, + tol=1e-8, + scale_est="mad", + cov="H1", + update_scale=True, + conv="dev", + start_params=None, + start_scale=None, + ): + """ + Fit the model using iteratively reweighted least squares + + The IRLS routine runs until the specified objective converges to `tol` + or `maxiter` has been reached. + + Parameters + ---------- + conv : {"coefs", "dev", "sresid", "weights"}, optional + Indicates the convergence criteria. + Available options are "coefs" (the coefficients), "weights" (the + weights in the iteration), "sresid" (the standardized residuals), + and "dev" (the un-normalized log-likelihood for the M + estimator). The default is "dev". + cov : {"H1", "H2", "H3"}, optional + Indicates how the covariance matrix is estimated. Default is 'H1'. + See rlm.RLMResults for more information. + maxiter : int, optional + The maximum number of iterations to try. Default is 50. + scale_est : {"mad"}, HuberScale or callable, optional + Indicates the estimate to use for scaling the weights in the IRLS. + The default is 'mad' (median absolute deviation). Other options are + 'HuberScale' for Huber's proposal 2. Huber's proposal 2 has + optional keyword arguments d, tol, and maxiter for specifying the + tuning constant, the convergence tolerance, and the maximum number + of iterations. Custom callables can accept either ``resid`` or + ``(model, resid)`` and must return the scale estimate. The ``model`` + object provides useful afftributes like ``nobs`` and ``df_reside`` + that may be needed in scale estimation. Due to backward compatability + issues, single- argument callables use the same degrees-of-freedom + correction as the built-in non-Huber scale estimators (nobs/df_resid). + Scale estimates from two argument functions are used without + modification. See statsmodels.robust.scale for more information or + the examples below. + tol : float, optional + The convergence tolerance of the estimate. Default is 1e-8. + update_scale : bool, optional + If `update_scale` is False then the scale estimate for the + weights is held constant over the iteration. Otherwise, it + is updated for each fit in the iteration. Default is True. + start_params : array_like, optional + Initial guess of the solution of the optimizer. If not provided, + the initial parameters are computed using OLS. + start_scale : float, optional + Initial scale. If update_scale is False, then the scale will be + fixed at this level for the estimation of the mean parameters. + during iteration. If not provided, then the initial scale is + estimated from the OLS residuals + + Returns + ------- + results : statsmodels.robust.robust_linear_model.RLMResults + Results instance + + Examples + -------- + >>> import statsmodels.api as sm + >>> data = sm.datasets.stackloss.load() + >>> data.exog = sm.add_constant(data.exog) + >>> rlm_model = sm.RLM(data.endog, data.exog, M=sm.robust.norms.HuberT()) + >>> rlm_results_mad = rlm_model.fit(scale_est="mad") + + >>> from statsmodels.robust import HuberScale + >>> hs = HuberScale(d=1.345, tol=1e-6, maxiter=100) + >>> rlm_results_mad = rlm_model.fit(scale_est=hs) + + Next we use a custom callable to estimate the scale. The callable can + either accept a single argument (the residuals) or two arguments (the + model and the residuals). In this example, we use a callable that computes + the average absolute deviation of the residuals. Note that the scale + estimate from this one-input callable is adjusted for degrees of freedom, + so it will be different than the two-input callable version below. + + >>> import numpy as np + >>> def avg_abs_deviation(resid): + ... median = np.median(resid) + ... c = np.sqrt(np.pi / 2) + ... return c * np.mean(np.abs(resid - median)) + >>> rlm_results_custom = rlm_model.fit(scale_est=avg_abs_deviation) + >>> print(f"{rlm_results_custom.scale:.4f}") + 3.0997 + + This second version accepts two versions. While the function value is the same + it will behave differently in practice since the scale estimate is not adjusted + for degrees of freedom. + + >>> def avg_abs_deviation_with_model(model, resid): + ... median = np.median(resid) + ... c = np.sqrt(np.pi / 2) + ... return c * np.mean(np.abs(resid - median)) + >>> rlm_results_custom_2 = rlm_model.fit(scale_est=avg_abs_deviation_with_model) + >>> print(f"{rlm_results_custom_2.scale:.4f}") + 2.7686 + """ + # options are upper-cased for display/storage, unlike most other + # string options in this codebase which are lower-cased + cov = string_like(cov, "cov", options=("h1", "h2", "h3")).upper() + conv = string_like(conv, "conv", options=("weights", "coefs", "dev", "sresid")) + + if start_params is None: + wls_results = lm.WLS(self.endog, self.exog).fit() + else: + start_params = np.asarray(start_params, dtype=np.double).squeeze() + start_params = np.atleast_1d(start_params) + if start_params.shape[0] != self.exog.shape[1] or start_params.ndim != 1: + raise ValueError( + f"start_params must by a 1-d array with {self.exog.shape[1]} " + "values" + ) + fake_wls = reg_tools._MinimalWLS( + self.endog, + self.exog, + weights=np.ones_like(self.endog), + check_weights=False, + ) + wls_results = fake_wls.results(start_params) + + if not start_scale: + self.scale = self._estimate_scale(wls_results.resid, scale_est) + elif start_scale: + self.scale = start_scale + if not update_scale: + scale_est = "fixed" + + history = dict(params=[np.inf], scale=[]) + if conv == "coefs": + criterion = history["params"] + elif conv == "dev": + history.update(dict(deviance=[np.inf])) + criterion = history["deviance"] + elif conv == "sresid": + history.update(dict(sresid=[np.inf])) + criterion = history["sresid"] + else: # conv == "weights" + history.update(dict(weights=[np.inf])) + criterion = history["weights"] + + # done one iteration so update + history = self._update_history(wls_results, history, conv) + iteration = 1 + converged = 0 + while not converged: + if self.scale == 0.0: + import warnings + + warnings.warn( + "Estimated scale is 0.0 indicating that the most" + " last iteration produced a perfect fit of the " + "weighted data.", + ConvergenceWarning, + stacklevel=2, + ) + break + self.weights = self.M.weights(wls_results.resid / self.scale) + wls_results = reg_tools._MinimalWLS( + self.endog, self.exog, weights=self.weights, check_weights=True + ).fit() + if update_scale is True: + self.scale = self._estimate_scale(wls_results.resid, scale_est) + history = self._update_history(wls_results, history, conv) + iteration += 1 + converged = _check_convergence(criterion, iteration, tol, maxiter) + results = RLMResults( + self, + wls_results.params, + self.normalized_cov_params, + self.scale, + cov=cov, + ) + + history["iteration"] = iteration + results.fit_history = history + results.fit_options = dict( + cov=cov, + scale_est=scale_est, + norm=self.M.__class__.__name__, + conv=conv, + ) + # norm is not changed in fit, no old state + + return RLMResultsWrapper(results) + + +class RLMResults(base.LikelihoodModelResults): + """ + Class to contain RLM results + + Attributes + ---------- + bcov_scaled : ndarray + p x p scaled covariance matrix specified in the model fit method. + The default is H1. H1 is defined as + ``k**2 * (1/df_resid*sum(M.psi(sresid)**2)*scale**2)/ + ((1/nobs*sum(M.psi_deriv(sresid)))**2) * (X.T X)^(-1)`` + + where ``k = 1 + (df_model +1)/nobs * var_psiprime/m**2`` + where ``m = mean(M.psi_deriv(sresid))`` and + ``var_psiprime = var(M.psi_deriv(sresid))`` + + H2 is defined as + ``k * (1/df_resid) * sum(M.psi(sresid)**2) *scale**2/ + ((1/nobs)*sum(M.psi_deriv(sresid)))*W_inv`` + + H3 is defined as + ``1/k * (1/df_resid * sum(M.psi(sresid)**2)*scale**2 * + (W_inv X.T X W_inv))`` + + where `k` is defined as above and + ``W_inv = (M.psi_deriv(sresid) exog.T exog)^(-1)`` + + See the technical documentation for cleaner formulae. + bcov_unscaled : ndarray + The usual p x p covariance matrix with scale set equal to 1. It + is then just equivalent to normalized_cov_params. + bse : ndarray + An array of the standard errors of the parameters. The standard + errors are taken from the robust covariance matrix specified in the + argument to fit. + chisq : ndarray + An array of the chi-squared values of the parameter estimates. + df_model : float + See RLM.df_model + df_resid : float + See RLM.df_resid + fit_history : dict + Contains information about the iterations. Its keys are `deviance`, + `params`, `iteration` and the convergence criteria specified in + `RLM.fit`, if different from `deviance` or `params`. + fit_options : dict + Contains the options given to fit. + fittedvalues : ndarray + The linear predicted values. dot(exog, params) + model : statsmodels.robust.robust_linear_model.RLM + A reference to the model instance + nobs : float + The number of observations n + normalized_cov_params : ndarray + See RLM.normalized_cov_params + params : ndarray + The coefficients of the fitted model + pvalues : ndarray + The p values associated with `tvalues`. Note that `tvalues` are assumed + to be distributed standard normal rather than Student's t. + resid : ndarray + The residuals of the fitted model. endog - fittedvalues + scale : float + The type of scale is determined in the arguments to the fit method in + RLM. The reported scale is taken from the residuals of the weighted + least squares in the last IRLS iteration if update_scale is True. If + update_scale is False, then it is the scale given by the first OLS + fit before the IRLS iterations. + sresid : ndarray + The scaled residuals. + tvalues : ndarray + The "t-statistics" of params. These are defined as params/bse where + bse are taken from the robust covariance matrix specified in the + argument to fit. + weights : ndarray + The reported weights are determined by passing the scaled residuals + from the last weighted least squares fit in the IRLS algorithm. + + See Also + -------- + statsmodels.base.model.LikelihoodModelResults + """ + + def __init__(self, model, params, normalized_cov_params, scale, cov="H1"): + super().__init__(model, params, normalized_cov_params, scale) + self.model = model + self.df_model = model.df_model + self.df_resid = model.df_resid + self.nobs = model.nobs + # cov is a public constructor argument (not only reachable through + # the already-validated RLM.fit), so it needs its own validation + self.cov = string_like(cov, "cov", options=("h1", "h2", "h3")).upper() + # Snapshot the final IRLS weights now, rather than deferring to + # model.weights, so this result is unaffected by any later fit() + # call on the same model instance. + self.weights = model.weights + self._cache = {} + # for remove_data + self._data_in_cache.extend(["sresid"]) + self._data_attr.extend(["weights"]) + + self.cov_params_default = self.bcov_scaled + # TODO: "pvals" should come from chisq on bse? + + @cache_readonly + def fittedvalues(self): + return np.dot(self.model.exog, self.params) + + @cache_readonly + def resid(self): + return self.model.endog - self.fittedvalues # before bcov + + @cache_readonly + def sresid(self): + if self.scale == 0.0: + sresid = self.resid.copy() + sresid[:] = 0.0 + return sresid + return self.resid / self.scale + + @cache_readonly + def bcov_unscaled(self): + return self.normalized_cov_params + + @cache_readonly + def bcov_scaled(self): + model = self.model + m = np.mean(model.M.psi_deriv(self.sresid)) + var_psiprime = np.var(model.M.psi_deriv(self.sresid)) + k = 1 + (self.df_model + 1) / self.nobs * var_psiprime / m**2 + + if self.cov == "H1": + ss_psi = np.sum(model.M.psi(self.sresid) ** 2) + s_psi_deriv = np.sum(model.M.psi_deriv(self.sresid)) + return ( + k**2 + * (1 / self.df_resid * ss_psi * self.scale**2) + / ((1 / self.nobs * s_psi_deriv) ** 2) + * model.normalized_cov_params + ) + else: + W = np.dot(model.M.psi_deriv(self.sresid) * model.exog.T, model.exog) + W_inv = np.linalg.inv(W) + # [W_jk]^-1 = [SUM(psi_deriv(Sr_i)*x_ij*x_jk)]^-1 + # where Sr are the standardized residuals + if self.cov == "H2": + # These are correct, based on Huber (1973) 8.13 + return ( + k + * (1 / self.df_resid) + * np.sum(model.M.psi(self.sresid) ** 2) + * self.scale**2 + / ((1 / self.nobs) * np.sum(model.M.psi_deriv(self.sresid))) + * W_inv + ) + else: # self.cov == "H3" + return ( + k**-1 + * 1 + / self.df_resid + * np.sum(model.M.psi(self.sresid) ** 2) + * self.scale**2 + * np.dot(np.dot(W_inv, np.dot(model.exog.T, model.exog)), W_inv) + ) + + @cache_readonly + def pvalues(self): + return stats.norm.sf(np.abs(self.tvalues)) * 2 + + @cache_readonly + def bse(self): + # Use cov_params_default (a plain attribute snapshotted once in + # __init__) rather than bcov_scaled directly, so bse still works + # after remove_data() has cleared model.exog. + return np.sqrt(np.diag(self.cov_params_default)) + + @cache_readonly + def chisq(self): + return (self.params / self.bse) ** 2 + + def summary(self, yname=None, xname=None, title=None, alpha=0.05, return_fmt="text"): + """ + Summarize the fitted model + + Parameters + ---------- + yname : str, optional + Name of the dependent variable (optional) + xname : list[str], optional + Names for the exogenous variables. Default is `var_##` where + `##` is the 0-based index of the regressor. Must match the + number of parameters in the model + title : str, optional + Title for the top table. If not None, then this replaces the + default title + alpha : float, optional + Significance level for the confidence intervals + return_fmt : str, optional + Unused + + Returns + ------- + Summary + Instance holding the summary tables and text, which can be + printed or converted to various output formats. + """ + top_left = [ + ("Dep. Variable:", None), + ("Model:", None), + ("Method:", ["IRLS"]), + ("Norm:", [self.fit_options["norm"]]), + ("Scale Est.:", [self.fit_options["scale_est"]]), + ("Cov Type:", [self.fit_options["cov"]]), + ("Date:", None), + ("Time:", None), + ("No. Iterations:", ["{:d}".format(self.fit_history["iteration"])]), + ] + top_right = [ + ("No. Observations:", None), + ("Df Residuals:", None), + ("Df Model:", None), + ] + + if title is None: + title = "Robust Linear Model Regression Results" + + # boiler plate + from statsmodels.iolib.summary import Summary + + smry = Summary() + smry.add_table_2cols( + self, + gleft=top_left, + gright=top_right, + yname=yname, + xname=xname, + title=title, + ) + smry.add_table_params( + self, yname=yname, xname=xname, alpha=alpha, use_t=self.use_t + ) + + # add warnings/notes, added to text format only + etext = [] + wstr = ( + "If the model instance has been used for another fit with " + "different fit parameters, then the fit options might not be " + "the correct ones anymore ." + ) + etext.append(wstr) + + if etext: + smry.add_extra_txt(etext) + + return smry + + def summary2( + self, xname=None, yname=None, title=None, alpha=0.05, float_format="%.4f" + ): + """ + Experimental summary function for regression results + + Parameters + ---------- + xname : list[str], optional + Names for the exogenous variables. Default is `var_##` where + `##` is the 0-based index of the regressor. Must match the + number of parameters in the model + yname : str, optional + Name of the dependent variable (optional) + title : str, optional + Title for the top table. If not None, then this replaces the + default title + alpha : float, optional + Significance level for the confidence intervals + float_format : str, optional + Print format for floats in parameters summary + + Returns + ------- + smry : Summary instance + This holds the summary tables and text, which can be printed or + converted to various output formats. + + See Also + -------- + statsmodels.iolib.summary2.Summary : class to hold summary results + """ + from statsmodels.iolib import summary2 + + smry = summary2.Summary() + smry.add_base( + results=self, + alpha=alpha, + float_format=float_format, + xname=xname, + yname=yname, + title=title, + ) + + return smry + + +class RLMResultsWrapper(lm.RegressionResultsWrapper): + pass + + +wrap.populate_wrapper(RLMResultsWrapper, RLMResults) diff --git a/shared/package-files/9d/9d39302db52ddec6e68b3ecebe865572a71fc9c171a141fd0814addfc4142e61/blob b/shared/package-files/9d/9d39302db52ddec6e68b3ecebe865572a71fc9c171a141fd0814addfc4142e61/blob new file mode 100644 index 0000000000000000000000000000000000000000..32c1d368da9f44952bf4f46aeedc2a608a579da0 --- /dev/null +++ b/shared/package-files/9d/9d39302db52ddec6e68b3ecebe865572a71fc9c171a141fd0814addfc4142e61/blob @@ -0,0 +1,27 @@ +import torch + +__all__ = ["GradScaler"] + + +class GradScaler(torch.amp.GradScaler): + r""" + See :class:`torch.amp.GradScaler`. + ``torch.cpu.amp.GradScaler(args...)`` is equivalent to ``torch.amp.GradScaler("cpu", args...)`` + """ + + def __init__( + self, + init_scale: float = 2.0**16, + growth_factor: float = 2.0, + backoff_factor: float = 0.5, + growth_interval: int = 2000, + enabled: bool = True, + ) -> None: + super().__init__( + "cpu", + init_scale=init_scale, + growth_factor=growth_factor, + backoff_factor=backoff_factor, + growth_interval=growth_interval, + enabled=enabled, + ) diff --git a/shared/package-files/9d/9d3a561a2087eca6ae15604454e5b6625cea16887faa61bd2c572b5899c010ac/blob b/shared/package-files/9d/9d3a561a2087eca6ae15604454e5b6625cea16887faa61bd2c572b5899c010ac/blob new file mode 100644 index 0000000000000000000000000000000000000000..41f2cad2c4d31a7caac94c7ebf4bd4d4393a2234 --- /dev/null +++ b/shared/package-files/9d/9d3a561a2087eca6ae15604454e5b6625cea16887faa61bd2c572b5899c010ac/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor _sparse_broadcast_to_copy(const at::Tensor & self, at::IntArrayRef size); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9d/9d3a669606c93cace348a07b4f376701b5fc7cfe28cf3ad97f1cf6b50e4634bb/blob b/shared/package-files/9d/9d3a669606c93cace348a07b4f376701b5fc7cfe28cf3ad97f1cf6b50e4634bb/blob new file mode 100644 index 0000000000000000000000000000000000000000..9ba69e90ecf528054d2f712d37f16dccfafd02cb --- /dev/null +++ b/shared/package-files/9d/9d3a669606c93cace348a07b4f376701b5fc7cfe28cf3ad97f1cf6b50e4634bb/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & quantized_max_pool1d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, at::IntArrayRef dilation=1, bool ceil_mode=false); +TORCH_API at::Tensor & quantized_max_pool1d_outf(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9d/9d3b3c85dcb80f7373de86569b624cb80d369e863fd29591616abf469b6acc76/blob b/shared/package-files/9d/9d3b3c85dcb80f7373de86569b624cb80d369e863fd29591616abf469b6acc76/blob new file mode 100644 index 0000000000000000000000000000000000000000..662b16ec40a9485547ce01b32ea0325a23122711 --- /dev/null +++ b/shared/package-files/9d/9d3b3c85dcb80f7373de86569b624cb80d369e863fd29591616abf469b6acc76/blob @@ -0,0 +1,36 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +#pragma once + +#include +#include + +#include "arrow/csv/options.h" +#include "arrow/status.h" +#include "arrow/util/delimiting.h" +#include "arrow/util/macros.h" +#include "arrow/util/visibility.h" + +namespace arrow { +namespace csv { + +ARROW_EXPORT +std::unique_ptr MakeChunker(const ParseOptions& options); + +} // namespace csv +} // namespace arrow diff --git a/shared/package-files/9d/9d3c6598c8221941281b0e3fef8ce089bbfdd89ce4c080107e74f013a9071787/blob b/shared/package-files/9d/9d3c6598c8221941281b0e3fef8ce089bbfdd89ce4c080107e74f013a9071787/blob new file mode 100644 index 0000000000000000000000000000000000000000..c0f65d6af92f321b67c08733a235418910715621 --- /dev/null +++ b/shared/package-files/9d/9d3c6598c8221941281b0e3fef8ce089bbfdd89ce4c080107e74f013a9071787/blob @@ -0,0 +1,24 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & _adaptive_avg_pool3d_out_symint(const at::Tensor & self, c10::SymIntArrayRef output_size, at::Tensor & out); +TORCH_API at::Tensor adaptive_avg_pool3d_cpu(const at::Tensor & self, at::IntArrayRef output_size); +TORCH_API at::Tensor adaptive_avg_pool3d_cuda(const at::Tensor & self, at::IntArrayRef output_size); +TORCH_API at::Tensor adaptive_avg_pool3d_quantized_cpu(const at::Tensor & self, at::IntArrayRef output_size); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9d3cbf67c8af18407aa85c152e0eff87aaead09b74254e4fcf670bdbf16348c4/blob b/shared/package-files/9d/9d3cbf67c8af18407aa85c152e0eff87aaead09b74254e4fcf670bdbf16348c4/blob new file mode 100644 index 0000000000000000000000000000000000000000..3f78a79a0f2d50333e0936e383d5fd80de48c119 --- /dev/null +++ b/shared/package-files/9d/9d3cbf67c8af18407aa85c152e0eff87aaead09b74254e4fcf670bdbf16348c4/blob @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.37.1) +Root-Is-Purelib: false +Tag: cp310-cp310-linux_x86_64 + diff --git a/shared/package-files/9d/9d3d5db972b79ec1e83ae32df8710e00697fd6f6aee17e47627f71363f2d6398/blob b/shared/package-files/9d/9d3d5db972b79ec1e83ae32df8710e00697fd6f6aee17e47627f71363f2d6398/blob new file mode 100644 index 0000000000000000000000000000000000000000..ebcd1228061e27368eb6acc98b45afb16ac8c567 --- /dev/null +++ b/shared/package-files/9d/9d3d5db972b79ec1e83ae32df8710e00697fd6f6aee17e47627f71363f2d6398/blob @@ -0,0 +1,242 @@ +#pragma once + +// define constants like M_PI and C keywords for MSVC +#ifdef _MSC_VER +#define _USE_MATH_DEFINES +#include +#endif + + +#ifdef __CUDACC__ +#include +#endif + +#include +#include +#include +#include +#include +#include + +namespace at { + +// typedefs for holding vector data +namespace detail { + +typedef at::detail::Array UINT4; +typedef at::detail::Array UINT2; +typedef at::detail::Array DOUBLE2; +typedef at::detail::Array FLOAT2; + +} // namespace detail + +/** + * Note [Philox Engine implementation] + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Originally implemented in PyTorch's fusion compiler + * Refer to: http://www.thesalmons.org/john/random123/papers/random123sc11.pdf + * for details regarding the engine. + * + * Note that currently this implementation of the philox engine is not used + * anywhere except for tests in cpu_generator_test.cpp. However, this engine + * will replace curandStatePhilox4_32_10_t in the future. + * + * The philox engine takes a seed value, a subsequeunce + * for starting the generation and an offset for the subsequence. + * Think of this engine as an algorithm producing a huge array. We are + * parallelizing this array by partitioning the huge array and assigning + * a thread index to each partition. In other words, each seed value + * (there are 2^64 possible seed values) gives a sub array of size + * 2^128 (each element in that array is a 128 bit number). Reasoning + * behind the array being of size 2^128 is, there are 2^64 possible + * thread index value and there is an array of size 2^64 for each of + * those thread index. Hence 2^64 * 2^64 = 2^128 for each seed value. + * + * In short, this generator can produce 2^64 (seed values) * 2^128 (number + * of elements in an array given by a seed value) = 2^192 values. + * + * Arguments: + * seed: Seed values could be any number from 0 to 2^64-1. + * subsequence: Subsequence is just the cuda thread indexing with: + * - blockIdx.x * blockDim.x + threadIdx.x + * offset: The offset variable in PhiloxEngine decides how many 128-bit + * random numbers to skip (i.e. how many groups of 4, 32-bit numbers to skip) + * and hence really decides the total number of randoms that can be achieved + * for the given subsequence. + */ + +class philox_engine { +public: + + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) + C10_HOST_DEVICE inline explicit philox_engine(uint64_t seed = 67280421310721, + uint64_t subsequence = 0, + uint64_t offset = 0) { + + reset_state(seed, subsequence); + incr_n(offset); + } + + C10_HOST_DEVICE inline void reset_state(uint64_t seed = 67280421310721, + uint64_t subsequence = 0) { + key_[0] = static_cast(seed); + key_[1] = static_cast(seed >> 32); + counter_ = detail::UINT4(0); + counter_[2] = static_cast(subsequence); + counter_[3] = static_cast(subsequence >> 32); + STATE = 0; + } + + /** + * Set the offset field of Philox Generator to the desired offset. + */ + C10_HOST_DEVICE inline void set_offset(uint64_t offset) { + counter_[0] = static_cast(offset); + counter_[1] = static_cast(offset >> 32); + } + + /** + * Gets the current offset of the Philox Generator. + */ + C10_HOST_DEVICE uint64_t get_offset() const { + uint64_t lo = static_cast(counter_[0]); + uint64_t hi = static_cast(counter_[1]) << 32; + return lo | hi; + } + + /** + * Produces a unique 32-bit pseudo random number on every invocation. Bookeeps state to avoid waste. + */ + C10_HOST_DEVICE inline uint32_t operator()(int32_t n_rounds = 10) { // 10 here to preserve back-compat behavior + if(STATE == 0) { + detail::UINT4 counter = counter_; + detail::UINT2 key = key_; + output_ = rand(counter, key, n_rounds); + incr(); + } + uint32_t ret = output_[static_cast(STATE)]; + STATE = (STATE + 1) & 3; + return ret; + } + + inline float randn(uint32_t n_rounds) { + #ifdef __CUDA_ARCH__ + AT_ASSERT(false, "Unsupported invocation of randn on CUDA"); + #endif + if(STATE == 0) { + detail::UINT4 counter = counter_; + detail::UINT2 key = key_; + output_ = rand(counter, key, n_rounds); + incr(); + } + // TODO(min-jean-cho) change to Polar method, a more efficient version of Box-Muller method + // TODO(voz) We use std:: below, and thus need a separate impl for CUDA. + float u1 = 1 - uint32_to_uniform_float(output_[0]); // uint32_to_uniform_float returns [0,1), we need (0,1] to avoid passing 0 to log. + float u2 = 1 - uint32_to_uniform_float(output_[1]); + return static_cast(std::sqrt(-2.0 * std::log(u1)) * std::cos(2.0 * M_PI * u2)); + } + + /** + * Function that Skips N 128 bit numbers in a subsequence + */ + C10_HOST_DEVICE inline void incr_n(uint64_t n) { + uint32_t nlo = static_cast(n); + uint32_t nhi = static_cast(n >> 32); + counter_[0] += nlo; + // if overflow in x has occurred, carry over to nhi + if (counter_[0] < nlo) { + nhi++; + // if overflow in nhi has occurred during carry over, + // propagate that overflow to y and exit to increment z + // otherwise return + counter_[1] += nhi; + if(nhi != 0) { + if (nhi <= counter_[1]) { + return; + } + } + } else { + // if overflow in y has occurred during addition, + // exit to increment z + // otherwise return + counter_[1] += nhi; + if (nhi <= counter_[1]) { + return; + } + } + if (++counter_[2]) + return; + ++counter_[3]; + } + + /** + * Function that Skips one 128 bit number in a subsequence + */ + C10_HOST_DEVICE inline void incr() { + if (++counter_[0]) + return; + if (++counter_[1]) + return; + if (++counter_[2]) { + return; + } + ++counter_[3]; + } + +private: + detail::UINT4 counter_; + detail::UINT4 output_; + detail::UINT2 key_; + uint32_t STATE; + + C10_HOST_DEVICE inline uint32_t mulhilo32(uint32_t a, uint32_t b, + uint32_t *result_high) { + #ifdef __CUDA_ARCH__ + *result_high = __umulhi(a, b); + return a*b; + #else + const uint64_t product = static_cast(a) * b; + *result_high = static_cast(product >> 32); + return static_cast(product); + #endif + } + + C10_HOST_DEVICE inline detail::UINT4 single_round(detail::UINT4 ctr, detail::UINT2 in_key) { + uint32_t hi0 = 0; + uint32_t hi1 = 0; + uint32_t lo0 = mulhilo32(kPhiloxSA, ctr[0], &hi0); + uint32_t lo1 = mulhilo32(kPhiloxSB, ctr[2], &hi1); + detail::UINT4 ret; + ret[0] = hi1 ^ ctr[1] ^ in_key[0]; + ret[1] = lo1; + ret[2] = hi0 ^ ctr[3] ^ in_key[1]; + ret[3] = lo0; + return ret; + } + + C10_HOST_DEVICE constexpr float uint32_to_uniform_float(uint32_t value) { + // maximum value such that `MAX_INT * scale < 1.0` (with float rounding) + constexpr float scale = 4.6566127342e-10; + return static_cast(value & 0x7FFFFFFF) * scale; + } + + + + C10_HOST_DEVICE inline detail::UINT4 rand(detail::UINT4& counter, detail::UINT2& key, uint32_t n_rounds) { + for (uint32_t round = 0; round < (n_rounds - 1); round++) { + counter = single_round(counter, key); + key[0] += (kPhilox10A); key[1] += (kPhilox10B); + } + return single_round(counter, key); + } + + + static const uint32_t kPhilox10A = 0x9E3779B9; + static const uint32_t kPhilox10B = 0xBB67AE85; + static const uint32_t kPhiloxSA = 0xD2511F53; + static const uint32_t kPhiloxSB = 0xCD9E8D57; +}; + +typedef philox_engine Philox4_32; + +} // namespace at diff --git a/shared/package-files/9d/9d3fe02962269c6ef8a36d74c33358c4f9a30d63d25e0ab992a8fbc13d99e292/blob b/shared/package-files/9d/9d3fe02962269c6ef8a36d74c33358c4f9a30d63d25e0ab992a8fbc13d99e292/blob new file mode 100644 index 0000000000000000000000000000000000000000..c30c0effa8c427534c3b420e863042eee32cb093 --- /dev/null +++ b/shared/package-files/9d/9d3fe02962269c6ef8a36d74c33358c4f9a30d63d25e0ab992a8fbc13d99e292/blob @@ -0,0 +1,944 @@ +""" +User interface Controls for the layout. +""" +from __future__ import annotations + +import time +from abc import ABCMeta, abstractmethod +from typing import TYPE_CHECKING, Callable, Hashable, Iterable, NamedTuple + +from prompt_toolkit.application.current import get_app +from prompt_toolkit.buffer import Buffer +from prompt_toolkit.cache import SimpleCache +from prompt_toolkit.data_structures import Point +from prompt_toolkit.document import Document +from prompt_toolkit.filters import FilterOrBool, to_filter +from prompt_toolkit.formatted_text import ( + AnyFormattedText, + StyleAndTextTuples, + to_formatted_text, +) +from prompt_toolkit.formatted_text.utils import ( + fragment_list_to_text, + fragment_list_width, + split_lines, +) +from prompt_toolkit.lexers import Lexer, SimpleLexer +from prompt_toolkit.mouse_events import MouseButton, MouseEvent, MouseEventType +from prompt_toolkit.search import SearchState +from prompt_toolkit.selection import SelectionType +from prompt_toolkit.utils import get_cwidth + +from .processors import ( + DisplayMultipleCursors, + HighlightIncrementalSearchProcessor, + HighlightSearchProcessor, + HighlightSelectionProcessor, + Processor, + TransformationInput, + merge_processors, +) + +if TYPE_CHECKING: + from prompt_toolkit.key_binding.key_bindings import ( + KeyBindingsBase, + NotImplementedOrNone, + ) + from prompt_toolkit.utils import Event + + +__all__ = [ + "BufferControl", + "SearchBufferControl", + "DummyControl", + "FormattedTextControl", + "UIControl", + "UIContent", +] + +GetLinePrefixCallable = Callable[[int, int], AnyFormattedText] + + +class UIControl(metaclass=ABCMeta): + """ + Base class for all user interface controls. + """ + + def reset(self) -> None: + # Default reset. (Doesn't have to be implemented.) + pass + + def preferred_width(self, max_available_width: int) -> int | None: + return None + + def preferred_height( + self, + width: int, + max_available_height: int, + wrap_lines: bool, + get_line_prefix: GetLinePrefixCallable | None, + ) -> int | None: + return None + + def is_focusable(self) -> bool: + """ + Tell whether this user control is focusable. + """ + return False + + @abstractmethod + def create_content(self, width: int, height: int) -> UIContent: + """ + Generate the content for this user control. + + Returns a :class:`.UIContent` instance. + """ + + def mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrNone: + """ + Handle mouse events. + + When `NotImplemented` is returned, it means that the given event is not + handled by the `UIControl` itself. The `Window` or key bindings can + decide to handle this event as scrolling or changing focus. + + :param mouse_event: `MouseEvent` instance. + """ + return NotImplemented + + def move_cursor_down(self) -> None: + """ + Request to move the cursor down. + This happens when scrolling down and the cursor is completely at the + top. + """ + + def move_cursor_up(self) -> None: + """ + Request to move the cursor up. + """ + + def get_key_bindings(self) -> KeyBindingsBase | None: + """ + The key bindings that are specific for this user control. + + Return a :class:`.KeyBindings` object if some key bindings are + specified, or `None` otherwise. + """ + + def get_invalidate_events(self) -> Iterable[Event[object]]: + """ + Return a list of `Event` objects. This can be a generator. + (The application collects all these events, in order to bind redraw + handlers to these events.) + """ + return [] + + +class UIContent: + """ + Content generated by a user control. This content consists of a list of + lines. + + :param get_line: Callable that takes a line number and returns the current + line. This is a list of (style_str, text) tuples. + :param line_count: The number of lines. + :param cursor_position: a :class:`.Point` for the cursor position. + :param menu_position: a :class:`.Point` for the menu position. + :param show_cursor: Make the cursor visible. + """ + + def __init__( + self, + get_line: Callable[[int], StyleAndTextTuples] = (lambda i: []), + line_count: int = 0, + cursor_position: Point | None = None, + menu_position: Point | None = None, + show_cursor: bool = True, + ): + self.get_line = get_line + self.line_count = line_count + self.cursor_position = cursor_position or Point(x=0, y=0) + self.menu_position = menu_position + self.show_cursor = show_cursor + + # Cache for line heights. Maps cache key -> height + self._line_heights_cache: dict[Hashable, int] = {} + + def __getitem__(self, lineno: int) -> StyleAndTextTuples: + "Make it iterable (iterate line by line)." + if lineno < self.line_count: + return self.get_line(lineno) + else: + raise IndexError + + def get_height_for_line( + self, + lineno: int, + width: int, + get_line_prefix: GetLinePrefixCallable | None, + slice_stop: int | None = None, + ) -> int: + """ + Return the height that a given line would need if it is rendered in a + space with the given width (using line wrapping). + + :param get_line_prefix: None or a `Window.get_line_prefix` callable + that returns the prefix to be inserted before this line. + :param slice_stop: Wrap only "line[:slice_stop]" and return that + partial result. This is needed for scrolling the window correctly + when line wrapping. + :returns: The computed height. + """ + # Instead of using `get_line_prefix` as key, we use render_counter + # instead. This is more reliable, because this function could still be + # the same, while the content would change over time. + key = get_app().render_counter, lineno, width, slice_stop + + try: + return self._line_heights_cache[key] + except KeyError: + if width == 0: + height = 10**8 + else: + # Calculate line width first. + line = fragment_list_to_text(self.get_line(lineno))[:slice_stop] + text_width = get_cwidth(line) + + if get_line_prefix: + # Add prefix width. + text_width += fragment_list_width( + to_formatted_text(get_line_prefix(lineno, 0)) + ) + + # Slower path: compute path when there's a line prefix. + height = 1 + + # Keep wrapping as long as the line doesn't fit. + # Keep adding new prefixes for every wrapped line. + while text_width > width: + height += 1 + text_width -= width + + fragments2 = to_formatted_text( + get_line_prefix(lineno, height - 1) + ) + prefix_width = get_cwidth(fragment_list_to_text(fragments2)) + + if prefix_width >= width: # Prefix doesn't fit. + height = 10**8 + break + + text_width += prefix_width + else: + # Fast path: compute height when there's no line prefix. + try: + quotient, remainder = divmod(text_width, width) + except ZeroDivisionError: + height = 10**8 + else: + if remainder: + quotient += 1 # Like math.ceil. + height = max(1, quotient) + + # Cache and return + self._line_heights_cache[key] = height + return height + + +class FormattedTextControl(UIControl): + """ + Control that displays formatted text. This can be either plain text, an + :class:`~prompt_toolkit.formatted_text.HTML` object an + :class:`~prompt_toolkit.formatted_text.ANSI` object, a list of ``(style_str, + text)`` tuples or a callable that takes no argument and returns one of + those, depending on how you prefer to do the formatting. See + ``prompt_toolkit.layout.formatted_text`` for more information. + + (It's mostly optimized for rather small widgets, like toolbars, menus, etc...) + + When this UI control has the focus, the cursor will be shown in the upper + left corner of this control by default. There are two ways for specifying + the cursor position: + + - Pass a `get_cursor_position` function which returns a `Point` instance + with the current cursor position. + + - If the (formatted) text is passed as a list of ``(style, text)`` tuples + and there is one that looks like ``('[SetCursorPosition]', '')``, then + this will specify the cursor position. + + Mouse support: + + The list of fragments can also contain tuples of three items, looking like: + (style_str, text, handler). When mouse support is enabled and the user + clicks on this fragment, then the given handler is called. That handler + should accept two inputs: (Application, MouseEvent) and it should + either handle the event or return `NotImplemented` in case we want the + containing Window to handle this event. + + :param focusable: `bool` or :class:`.Filter`: Tell whether this control is + focusable. + + :param text: Text or formatted text to be displayed. + :param style: Style string applied to the content. (If you want to style + the whole :class:`~prompt_toolkit.layout.Window`, pass the style to the + :class:`~prompt_toolkit.layout.Window` instead.) + :param key_bindings: a :class:`.KeyBindings` object. + :param get_cursor_position: A callable that returns the cursor position as + a `Point` instance. + """ + + def __init__( + self, + text: AnyFormattedText = "", + style: str = "", + focusable: FilterOrBool = False, + key_bindings: KeyBindingsBase | None = None, + show_cursor: bool = True, + modal: bool = False, + get_cursor_position: Callable[[], Point | None] | None = None, + ) -> None: + self.text = text # No type check on 'text'. This is done dynamically. + self.style = style + self.focusable = to_filter(focusable) + + # Key bindings. + self.key_bindings = key_bindings + self.show_cursor = show_cursor + self.modal = modal + self.get_cursor_position = get_cursor_position + + #: Cache for the content. + self._content_cache: SimpleCache[Hashable, UIContent] = SimpleCache(maxsize=18) + self._fragment_cache: SimpleCache[int, StyleAndTextTuples] = SimpleCache( + maxsize=1 + ) + # Only cache one fragment list. We don't need the previous item. + + # Render info for the mouse support. + self._fragments: StyleAndTextTuples | None = None + + def reset(self) -> None: + self._fragments = None + + def is_focusable(self) -> bool: + return self.focusable() + + def __repr__(self) -> str: + return f"{self.__class__.__name__}({self.text!r})" + + def _get_formatted_text_cached(self) -> StyleAndTextTuples: + """ + Get fragments, but only retrieve fragments once during one render run. + (This function is called several times during one rendering, because + we also need those for calculating the dimensions.) + """ + return self._fragment_cache.get( + get_app().render_counter, lambda: to_formatted_text(self.text, self.style) + ) + + def preferred_width(self, max_available_width: int) -> int: + """ + Return the preferred width for this control. + That is the width of the longest line. + """ + text = fragment_list_to_text(self._get_formatted_text_cached()) + line_lengths = [get_cwidth(l) for l in text.split("\n")] + return max(line_lengths) + + def preferred_height( + self, + width: int, + max_available_height: int, + wrap_lines: bool, + get_line_prefix: GetLinePrefixCallable | None, + ) -> int | None: + """ + Return the preferred height for this control. + """ + content = self.create_content(width, None) + if wrap_lines: + height = 0 + for i in range(content.line_count): + height += content.get_height_for_line(i, width, get_line_prefix) + if height >= max_available_height: + return max_available_height + return height + else: + return content.line_count + + def create_content(self, width: int, height: int | None) -> UIContent: + # Get fragments + fragments_with_mouse_handlers = self._get_formatted_text_cached() + fragment_lines_with_mouse_handlers = list( + split_lines(fragments_with_mouse_handlers) + ) + + # Strip mouse handlers from fragments. + fragment_lines: list[StyleAndTextTuples] = [ + [(item[0], item[1]) for item in line] + for line in fragment_lines_with_mouse_handlers + ] + + # Keep track of the fragments with mouse handler, for later use in + # `mouse_handler`. + self._fragments = fragments_with_mouse_handlers + + # If there is a `[SetCursorPosition]` in the fragment list, set the + # cursor position here. + def get_cursor_position( + fragment: str = "[SetCursorPosition]", + ) -> Point | None: + for y, line in enumerate(fragment_lines): + x = 0 + for style_str, text, *_ in line: + if fragment in style_str: + return Point(x=x, y=y) + x += len(text) + return None + + # If there is a `[SetMenuPosition]`, set the menu over here. + def get_menu_position() -> Point | None: + return get_cursor_position("[SetMenuPosition]") + + cursor_position = (self.get_cursor_position or get_cursor_position)() + + # Create content, or take it from the cache. + key = (tuple(fragments_with_mouse_handlers), width, cursor_position) + + def get_content() -> UIContent: + return UIContent( + get_line=lambda i: fragment_lines[i], + line_count=len(fragment_lines), + show_cursor=self.show_cursor, + cursor_position=cursor_position, + menu_position=get_menu_position(), + ) + + return self._content_cache.get(key, get_content) + + def mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrNone: + """ + Handle mouse events. + + (When the fragment list contained mouse handlers and the user clicked on + on any of these, the matching handler is called. This handler can still + return `NotImplemented` in case we want the + :class:`~prompt_toolkit.layout.Window` to handle this particular + event.) + """ + if self._fragments: + # Read the generator. + fragments_for_line = list(split_lines(self._fragments)) + + try: + fragments = fragments_for_line[mouse_event.position.y] + except IndexError: + return NotImplemented + else: + # Find position in the fragment list. + xpos = mouse_event.position.x + + # Find mouse handler for this character. + count = 0 + for item in fragments: + count += len(item[1]) + if count > xpos: + if len(item) >= 3: + # Handler found. Call it. + # (Handler can return NotImplemented, so return + # that result.) + handler = item[2] + return handler(mouse_event) + else: + break + + # Otherwise, don't handle here. + return NotImplemented + + def is_modal(self) -> bool: + return self.modal + + def get_key_bindings(self) -> KeyBindingsBase | None: + return self.key_bindings + + +class DummyControl(UIControl): + """ + A dummy control object that doesn't paint any content. + + Useful for filling a :class:`~prompt_toolkit.layout.Window`. (The + `fragment` and `char` attributes of the `Window` class can be used to + define the filling.) + """ + + def create_content(self, width: int, height: int) -> UIContent: + def get_line(i: int) -> StyleAndTextTuples: + return [] + + return UIContent(get_line=get_line, line_count=100**100) # Something very big. + + def is_focusable(self) -> bool: + return False + + +class _ProcessedLine(NamedTuple): + fragments: StyleAndTextTuples + source_to_display: Callable[[int], int] + display_to_source: Callable[[int], int] + + +class BufferControl(UIControl): + """ + Control for visualizing the content of a :class:`.Buffer`. + + :param buffer: The :class:`.Buffer` object to be displayed. + :param input_processors: A list of + :class:`~prompt_toolkit.layout.processors.Processor` objects. + :param include_default_input_processors: When True, include the default + processors for highlighting of selection, search and displaying of + multiple cursors. + :param lexer: :class:`.Lexer` instance for syntax highlighting. + :param preview_search: `bool` or :class:`.Filter`: Show search while + typing. When this is `True`, probably you want to add a + ``HighlightIncrementalSearchProcessor`` as well. Otherwise only the + cursor position will move, but the text won't be highlighted. + :param focusable: `bool` or :class:`.Filter`: Tell whether this control is focusable. + :param focus_on_click: Focus this buffer when it's click, but not yet focused. + :param key_bindings: a :class:`.KeyBindings` object. + """ + + def __init__( + self, + buffer: Buffer | None = None, + input_processors: list[Processor] | None = None, + include_default_input_processors: bool = True, + lexer: Lexer | None = None, + preview_search: FilterOrBool = False, + focusable: FilterOrBool = True, + search_buffer_control: ( + None | SearchBufferControl | Callable[[], SearchBufferControl] + ) = None, + menu_position: Callable[[], int | None] | None = None, + focus_on_click: FilterOrBool = False, + key_bindings: KeyBindingsBase | None = None, + ): + self.input_processors = input_processors + self.include_default_input_processors = include_default_input_processors + + self.default_input_processors = [ + HighlightSearchProcessor(), + HighlightIncrementalSearchProcessor(), + HighlightSelectionProcessor(), + DisplayMultipleCursors(), + ] + + self.preview_search = to_filter(preview_search) + self.focusable = to_filter(focusable) + self.focus_on_click = to_filter(focus_on_click) + + self.buffer = buffer or Buffer() + self.menu_position = menu_position + self.lexer = lexer or SimpleLexer() + self.key_bindings = key_bindings + self._search_buffer_control = search_buffer_control + + #: Cache for the lexer. + #: Often, due to cursor movement, undo/redo and window resizing + #: operations, it happens that a short time, the same document has to be + #: lexed. This is a fairly easy way to cache such an expensive operation. + self._fragment_cache: SimpleCache[ + Hashable, Callable[[int], StyleAndTextTuples] + ] = SimpleCache(maxsize=8) + + self._last_click_timestamp: float | None = None + self._last_get_processed_line: Callable[[int], _ProcessedLine] | None = None + + def __repr__(self) -> str: + return f"<{self.__class__.__name__} buffer={self.buffer!r} at {id(self)!r}>" + + @property + def search_buffer_control(self) -> SearchBufferControl | None: + result: SearchBufferControl | None + + if callable(self._search_buffer_control): + result = self._search_buffer_control() + else: + result = self._search_buffer_control + + assert result is None or isinstance(result, SearchBufferControl) + return result + + @property + def search_buffer(self) -> Buffer | None: + control = self.search_buffer_control + if control is not None: + return control.buffer + return None + + @property + def search_state(self) -> SearchState: + """ + Return the `SearchState` for searching this `BufferControl`. This is + always associated with the search control. If one search bar is used + for searching multiple `BufferControls`, then they share the same + `SearchState`. + """ + search_buffer_control = self.search_buffer_control + if search_buffer_control: + return search_buffer_control.searcher_search_state + else: + return SearchState() + + def is_focusable(self) -> bool: + return self.focusable() + + def preferred_width(self, max_available_width: int) -> int | None: + """ + This should return the preferred width. + + Note: We don't specify a preferred width according to the content, + because it would be too expensive. Calculating the preferred + width can be done by calculating the longest line, but this would + require applying all the processors to each line. This is + unfeasible for a larger document, and doing it for small + documents only would result in inconsistent behavior. + """ + return None + + def preferred_height( + self, + width: int, + max_available_height: int, + wrap_lines: bool, + get_line_prefix: GetLinePrefixCallable | None, + ) -> int | None: + # Calculate the content height, if it was drawn on a screen with the + # given width. + height = 0 + content = self.create_content(width, height=1) # Pass a dummy '1' as height. + + # When line wrapping is off, the height should be equal to the amount + # of lines. + if not wrap_lines: + return content.line_count + + # When the number of lines exceeds the max_available_height, just + # return max_available_height. No need to calculate anything. + if content.line_count >= max_available_height: + return max_available_height + + for i in range(content.line_count): + height += content.get_height_for_line(i, width, get_line_prefix) + + if height >= max_available_height: + return max_available_height + + return height + + def _get_formatted_text_for_line_func( + self, document: Document + ) -> Callable[[int], StyleAndTextTuples]: + """ + Create a function that returns the fragments for a given line. + """ + + # Cache using `document.text`. + def get_formatted_text_for_line() -> Callable[[int], StyleAndTextTuples]: + return self.lexer.lex_document(document) + + key = (document.text, self.lexer.invalidation_hash()) + return self._fragment_cache.get(key, get_formatted_text_for_line) + + def _create_get_processed_line_func( + self, document: Document, width: int, height: int + ) -> Callable[[int], _ProcessedLine]: + """ + Create a function that takes a line number of the current document and + returns a _ProcessedLine(processed_fragments, source_to_display, display_to_source) + tuple. + """ + # Merge all input processors together. + input_processors = self.input_processors or [] + if self.include_default_input_processors: + input_processors = self.default_input_processors + input_processors + + merged_processor = merge_processors(input_processors) + + def transform(lineno: int, fragments: StyleAndTextTuples) -> _ProcessedLine: + "Transform the fragments for a given line number." + + # Get cursor position at this line. + def source_to_display(i: int) -> int: + """X position from the buffer to the x position in the + processed fragment list. By default, we start from the 'identity' + operation.""" + return i + + transformation = merged_processor.apply_transformation( + TransformationInput( + self, document, lineno, source_to_display, fragments, width, height + ) + ) + + return _ProcessedLine( + transformation.fragments, + transformation.source_to_display, + transformation.display_to_source, + ) + + def create_func() -> Callable[[int], _ProcessedLine]: + get_line = self._get_formatted_text_for_line_func(document) + cache: dict[int, _ProcessedLine] = {} + + def get_processed_line(i: int) -> _ProcessedLine: + try: + return cache[i] + except KeyError: + processed_line = transform(i, get_line(i)) + cache[i] = processed_line + return processed_line + + return get_processed_line + + return create_func() + + def create_content( + self, width: int, height: int, preview_search: bool = False + ) -> UIContent: + """ + Create a UIContent. + """ + buffer = self.buffer + + # Trigger history loading of the buffer. We do this during the + # rendering of the UI here, because it needs to happen when an + # `Application` with its event loop is running. During the rendering of + # the buffer control is the earliest place we can achieve this, where + # we're sure the right event loop is active, and don't require user + # interaction (like in a key binding). + buffer.load_history_if_not_yet_loaded() + + # Get the document to be shown. If we are currently searching (the + # search buffer has focus, and the preview_search filter is enabled), + # then use the search document, which has possibly a different + # text/cursor position.) + search_control = self.search_buffer_control + preview_now = preview_search or bool( + # Only if this feature is enabled. + self.preview_search() + and + # And something was typed in the associated search field. + search_control + and search_control.buffer.text + and + # And we are searching in this control. (Many controls can point to + # the same search field, like in Pyvim.) + get_app().layout.search_target_buffer_control == self + ) + + if preview_now and search_control is not None: + ss = self.search_state + + document = buffer.document_for_search( + SearchState( + text=search_control.buffer.text, + direction=ss.direction, + ignore_case=ss.ignore_case, + ) + ) + else: + document = buffer.document + + get_processed_line = self._create_get_processed_line_func( + document, width, height + ) + self._last_get_processed_line = get_processed_line + + def translate_rowcol(row: int, col: int) -> Point: + "Return the content column for this coordinate." + return Point(x=get_processed_line(row).source_to_display(col), y=row) + + def get_line(i: int) -> StyleAndTextTuples: + "Return the fragments for a given line number." + fragments = get_processed_line(i).fragments + + # Add a space at the end, because that is a possible cursor + # position. (When inserting after the input.) We should do this on + # all the lines, not just the line containing the cursor. (Because + # otherwise, line wrapping/scrolling could change when moving the + # cursor around.) + fragments = fragments + [("", " ")] + return fragments + + content = UIContent( + get_line=get_line, + line_count=document.line_count, + cursor_position=translate_rowcol( + document.cursor_position_row, document.cursor_position_col + ), + ) + + # If there is an auto completion going on, use that start point for a + # pop-up menu position. (But only when this buffer has the focus -- + # there is only one place for a menu, determined by the focused buffer.) + if get_app().layout.current_control == self: + menu_position = self.menu_position() if self.menu_position else None + if menu_position is not None: + assert isinstance(menu_position, int) + menu_row, menu_col = buffer.document.translate_index_to_position( + menu_position + ) + content.menu_position = translate_rowcol(menu_row, menu_col) + elif buffer.complete_state: + # Position for completion menu. + # Note: We use 'min', because the original cursor position could be + # behind the input string when the actual completion is for + # some reason shorter than the text we had before. (A completion + # can change and shorten the input.) + menu_row, menu_col = buffer.document.translate_index_to_position( + min( + buffer.cursor_position, + buffer.complete_state.original_document.cursor_position, + ) + ) + content.menu_position = translate_rowcol(menu_row, menu_col) + else: + content.menu_position = None + + return content + + def mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrNone: + """ + Mouse handler for this control. + """ + buffer = self.buffer + position = mouse_event.position + + # Focus buffer when clicked. + if get_app().layout.current_control == self: + if self._last_get_processed_line: + processed_line = self._last_get_processed_line(position.y) + + # Translate coordinates back to the cursor position of the + # original input. + xpos = processed_line.display_to_source(position.x) + index = buffer.document.translate_row_col_to_index(position.y, xpos) + + # Set the cursor position. + if mouse_event.event_type == MouseEventType.MOUSE_DOWN: + buffer.exit_selection() + buffer.cursor_position = index + + elif ( + mouse_event.event_type == MouseEventType.MOUSE_MOVE + and mouse_event.button != MouseButton.NONE + ): + # Click and drag to highlight a selection + if ( + buffer.selection_state is None + and abs(buffer.cursor_position - index) > 0 + ): + buffer.start_selection(selection_type=SelectionType.CHARACTERS) + buffer.cursor_position = index + + elif mouse_event.event_type == MouseEventType.MOUSE_UP: + # When the cursor was moved to another place, select the text. + # (The >1 is actually a small but acceptable workaround for + # selecting text in Vi navigation mode. In navigation mode, + # the cursor can never be after the text, so the cursor + # will be repositioned automatically.) + if abs(buffer.cursor_position - index) > 1: + if buffer.selection_state is None: + buffer.start_selection( + selection_type=SelectionType.CHARACTERS + ) + buffer.cursor_position = index + + # Select word around cursor on double click. + # Two MOUSE_UP events in a short timespan are considered a double click. + double_click = ( + self._last_click_timestamp + and time.time() - self._last_click_timestamp < 0.3 + ) + self._last_click_timestamp = time.time() + + if double_click: + start, end = buffer.document.find_boundaries_of_current_word() + buffer.cursor_position += start + buffer.start_selection(selection_type=SelectionType.CHARACTERS) + buffer.cursor_position += end - start + else: + # Don't handle scroll events here. + return NotImplemented + + # Not focused, but focusing on click events. + else: + if ( + self.focus_on_click() + and mouse_event.event_type == MouseEventType.MOUSE_UP + ): + # Focus happens on mouseup. (If we did this on mousedown, the + # up event will be received at the point where this widget is + # focused and be handled anyway.) + get_app().layout.current_control = self + else: + return NotImplemented + + return None + + def move_cursor_down(self) -> None: + b = self.buffer + b.cursor_position += b.document.get_cursor_down_position() + + def move_cursor_up(self) -> None: + b = self.buffer + b.cursor_position += b.document.get_cursor_up_position() + + def get_key_bindings(self) -> KeyBindingsBase | None: + """ + When additional key bindings are given. Return these. + """ + return self.key_bindings + + def get_invalidate_events(self) -> Iterable[Event[object]]: + """ + Return the Window invalidate events. + """ + # Whenever the buffer changes, the UI has to be updated. + yield self.buffer.on_text_changed + yield self.buffer.on_cursor_position_changed + + yield self.buffer.on_completions_changed + yield self.buffer.on_suggestion_set + + +class SearchBufferControl(BufferControl): + """ + :class:`.BufferControl` which is used for searching another + :class:`.BufferControl`. + + :param ignore_case: Search case insensitive. + """ + + def __init__( + self, + buffer: Buffer | None = None, + input_processors: list[Processor] | None = None, + lexer: Lexer | None = None, + focus_on_click: FilterOrBool = False, + key_bindings: KeyBindingsBase | None = None, + ignore_case: FilterOrBool = False, + ): + super().__init__( + buffer=buffer, + input_processors=input_processors, + lexer=lexer, + focus_on_click=focus_on_click, + key_bindings=key_bindings, + ) + + # If this BufferControl is used as a search field for one or more other + # BufferControls, then represents the search state. + self.searcher_search_state = SearchState(ignore_case=ignore_case) diff --git a/shared/package-files/9d/9d40ba0fbc9311616b9806bdfacbab502541a49bcd2c5a88b036e3698e573a91/blob b/shared/package-files/9d/9d40ba0fbc9311616b9806bdfacbab502541a49bcd2c5a88b036e3698e573a91/blob new file mode 100644 index 0000000000000000000000000000000000000000..02fb1ef1c12c1e5775b3ee929278eb9d114e150b --- /dev/null +++ b/shared/package-files/9d/9d40ba0fbc9311616b9806bdfacbab502541a49bcd2c5a88b036e3698e573a91/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API transpose_copy_int { + using schema = at::Tensor (const at::Tensor &, int64_t, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::transpose_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "int") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "transpose_copy.int(Tensor self, int dim0, int dim1) -> Tensor") + static at::Tensor call(const at::Tensor & self, int64_t dim0, int64_t dim1); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t dim0, int64_t dim1); +}; + +struct TORCH_API transpose_copy_int_out { + using schema = at::Tensor & (const at::Tensor &, int64_t, int64_t, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::transpose_copy") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "int_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "transpose_copy.int_out(Tensor self, int dim0, int dim1, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, int64_t dim0, int64_t dim1, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t dim0, int64_t dim1, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9d/9d41435d46d5dec224babe79acbe2abef05da944dbcd246b4e220fc26b661bc2/blob b/shared/package-files/9d/9d41435d46d5dec224babe79acbe2abef05da944dbcd246b4e220fc26b661bc2/blob new file mode 100644 index 0000000000000000000000000000000000000000..ccc8e0cc7c43dc66ad7b3a8e4738c3322d3f79d8 --- /dev/null +++ b/shared/package-files/9d/9d41435d46d5dec224babe79acbe2abef05da944dbcd246b4e220fc26b661bc2/blob @@ -0,0 +1,10 @@ +@RELATION test1 + +@ATTRIBUTE attr0 REAL +@ATTRIBUTE attr1 REAL +@ATTRIBUTE attr2 REAL +@ATTRIBUTE attr3 REAL +@ATTRIBUTE class {class0, class1, class2, class3} + +@DATA +0.1, 0.2, 0.3, 0.4,class1 diff --git a/shared/package-files/9d/9d418e305a568f7a4c82a2f2e996d1ec0e06daaee22c8979cc414119ff9071fc/blob b/shared/package-files/9d/9d418e305a568f7a4c82a2f2e996d1ec0e06daaee22c8979cc414119ff9071fc/blob new file mode 100644 index 0000000000000000000000000000000000000000..f53fdf48824e055cbae4cafb579e62440898886e --- /dev/null +++ b/shared/package-files/9d/9d418e305a568f7a4c82a2f2e996d1ec0e06daaee22c8979cc414119ff9071fc/blob @@ -0,0 +1,56 @@ +import sys +from typing import Any + +import numpy as np + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + +f: float +f8: np.float64 +c8: np.complex64 + +i: int +i8: np.int64 +u4: np.uint32 + +finfo_f8: np.finfo[np.float64] +iinfo_i8: np.iinfo[np.int64] + +assert_type(np.finfo(f), np.finfo[np.double]) +assert_type(np.finfo(f8), np.finfo[np.float64]) +assert_type(np.finfo(c8), np.finfo[np.float32]) +assert_type(np.finfo('f2'), np.finfo[np.floating[Any]]) + +assert_type(finfo_f8.dtype, np.dtype[np.float64]) +assert_type(finfo_f8.bits, int) +assert_type(finfo_f8.eps, np.float64) +assert_type(finfo_f8.epsneg, np.float64) +assert_type(finfo_f8.iexp, int) +assert_type(finfo_f8.machep, int) +assert_type(finfo_f8.max, np.float64) +assert_type(finfo_f8.maxexp, int) +assert_type(finfo_f8.min, np.float64) +assert_type(finfo_f8.minexp, int) +assert_type(finfo_f8.negep, int) +assert_type(finfo_f8.nexp, int) +assert_type(finfo_f8.nmant, int) +assert_type(finfo_f8.precision, int) +assert_type(finfo_f8.resolution, np.float64) +assert_type(finfo_f8.tiny, np.float64) +assert_type(finfo_f8.smallest_normal, np.float64) +assert_type(finfo_f8.smallest_subnormal, np.float64) + +assert_type(np.iinfo(i), np.iinfo[np.int_]) +assert_type(np.iinfo(i8), np.iinfo[np.int64]) +assert_type(np.iinfo(u4), np.iinfo[np.uint32]) +assert_type(np.iinfo('i2'), np.iinfo[Any]) + +assert_type(iinfo_i8.dtype, np.dtype[np.int64]) +assert_type(iinfo_i8.kind, str) +assert_type(iinfo_i8.bits, int) +assert_type(iinfo_i8.key, str) +assert_type(iinfo_i8.min, int) +assert_type(iinfo_i8.max, int) diff --git a/shared/package-files/9d/9d43162db861ee5b7973788ec3979d02d732e23ac2ce90545f9259dbd156d139/blob b/shared/package-files/9d/9d43162db861ee5b7973788ec3979d02d732e23ac2ce90545f9259dbd156d139/blob new file mode 100644 index 0000000000000000000000000000000000000000..e13c1312a479f57047b54cd38de680fd3c5a2d0f --- /dev/null +++ b/shared/package-files/9d/9d43162db861ee5b7973788ec3979d02d732e23ac2ce90545f9259dbd156d139/blob @@ -0,0 +1,499 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +// This API is EXPERIMENTAL. + +#pragma once + +#include +#include +#include +#include +#include + +#include "arrow/buffer.h" +#include "arrow/dataset/dataset.h" +#include "arrow/dataset/partition.h" +#include "arrow/dataset/scanner.h" +#include "arrow/dataset/type_fwd.h" +#include "arrow/dataset/visibility.h" +#include "arrow/filesystem/filesystem.h" +#include "arrow/io/file.h" +#include "arrow/type_fwd.h" +#include "arrow/util/compression.h" + +namespace arrow { + +namespace dataset { + +/// \defgroup dataset-file-formats File formats for reading and writing datasets +/// \defgroup dataset-filesystem File system datasets +/// +/// @{ + +/// \brief The path and filesystem where an actual file is located or a buffer which can +/// be read like a file +class ARROW_DS_EXPORT FileSource : public util::EqualityComparable { + public: + FileSource(std::string path, std::shared_ptr filesystem, + Compression::type compression = Compression::UNCOMPRESSED) + : file_info_(std::move(path)), + filesystem_(std::move(filesystem)), + compression_(compression) {} + + FileSource(fs::FileInfo info, std::shared_ptr filesystem, + Compression::type compression = Compression::UNCOMPRESSED) + : file_info_(std::move(info)), + filesystem_(std::move(filesystem)), + compression_(compression) {} + + explicit FileSource(std::shared_ptr buffer, + Compression::type compression = Compression::UNCOMPRESSED) + : buffer_(std::move(buffer)), compression_(compression) {} + + using CustomOpen = std::function>()>; + FileSource(CustomOpen open, int64_t size) + : custom_open_(std::move(open)), custom_size_(size) {} + + using CustomOpenWithCompression = + std::function>(Compression::type)>; + FileSource(CustomOpenWithCompression open_with_compression, int64_t size, + Compression::type compression = Compression::UNCOMPRESSED) + : custom_open_(std::bind(std::move(open_with_compression), compression)), + custom_size_(size), + compression_(compression) {} + + FileSource(std::shared_ptr file, int64_t size, + Compression::type compression = Compression::UNCOMPRESSED) + : custom_open_([=] { return ToResult(file); }), + custom_size_(size), + compression_(compression) {} + + explicit FileSource(std::shared_ptr file, + Compression::type compression = Compression::UNCOMPRESSED); + + FileSource() : custom_open_(CustomOpen{&InvalidOpen}) {} + + static std::vector FromPaths(const std::shared_ptr& fs, + std::vector paths) { + std::vector sources; + for (auto&& path : paths) { + sources.emplace_back(std::move(path), fs); + } + return sources; + } + + /// \brief Return the type of raw compression on the file, if any. + Compression::type compression() const { return compression_; } + + /// \brief Return the file path, if any. Only valid when file source wraps a path. + const std::string& path() const { + static std::string buffer_path = ""; + static std::string custom_open_path = ""; + return filesystem_ ? file_info_.path() : buffer_ ? buffer_path : custom_open_path; + } + + /// \brief Return the filesystem, if any. Otherwise returns nullptr + const std::shared_ptr& filesystem() const { return filesystem_; } + + /// \brief Return the buffer containing the file, if any. Otherwise returns nullptr + const std::shared_ptr& buffer() const { return buffer_; } + + /// \brief Get a RandomAccessFile which views this file source + Result> Open() const; + Future> OpenAsync() const; + + /// \brief Get the size (in bytes) of the file or buffer + /// If the file is compressed this should be the compressed (on-disk) size. + int64_t Size() const; + + /// \brief Get an InputStream which views this file source (and decompresses if needed) + /// \param[in] compression If nullopt, guess the compression scheme from the + /// filename, else decompress with the given codec + Result> OpenCompressed( + std::optional compression = std::nullopt) const; + + /// \brief equality comparison with another FileSource + bool Equals(const FileSource& other) const; + + private: + static Result> InvalidOpen() { + return Status::Invalid("Called Open() on an uninitialized FileSource"); + } + + fs::FileInfo file_info_; + std::shared_ptr filesystem_; + std::shared_ptr buffer_; + CustomOpen custom_open_; + int64_t custom_size_ = 0; + Compression::type compression_ = Compression::UNCOMPRESSED; +}; + +/// \brief Base class for file format implementation +class ARROW_DS_EXPORT FileFormat : public std::enable_shared_from_this { + public: + /// Options affecting how this format is scanned. + /// + /// The options here can be overridden at scan time. + std::shared_ptr default_fragment_scan_options; + + virtual ~FileFormat() = default; + + /// \brief The name identifying the kind of file format + virtual std::string type_name() const = 0; + + virtual bool Equals(const FileFormat& other) const = 0; + + /// \brief Indicate if the FileSource is supported/readable by this format. + virtual Result IsSupported(const FileSource& source) const = 0; + + /// \brief Return the schema of the file if possible. + virtual Result> Inspect(const FileSource& source) const = 0; + + /// \brief Learn what we need about the file before we start scanning it + virtual Future> InspectFragment( + const FileSource& source, const FragmentScanOptions* format_options, + compute::ExecContext* exec_context) const; + + virtual Result ScanBatchesAsync( + const std::shared_ptr& options, + const std::shared_ptr& file) const = 0; + + virtual Future> CountRows( + const std::shared_ptr& file, compute::Expression predicate, + const std::shared_ptr& options); + + virtual Future> BeginScan( + const FragmentScanRequest& request, const InspectedFragment& inspected_fragment, + const FragmentScanOptions* format_options, + compute::ExecContext* exec_context) const; + + /// \brief Open a fragment + virtual Result> MakeFragment( + FileSource source, compute::Expression partition_expression, + std::shared_ptr physical_schema); + + /// \brief Create a FileFragment for a FileSource. + Result> MakeFragment( + FileSource source, compute::Expression partition_expression); + + /// \brief Create a FileFragment for a FileSource. + Result> MakeFragment( + FileSource source, std::shared_ptr physical_schema = NULLPTR); + + /// \brief Create a writer for this format. + virtual Result> MakeWriter( + std::shared_ptr destination, std::shared_ptr schema, + std::shared_ptr options, + fs::FileLocator destination_locator) const = 0; + + /// \brief Get default write options for this format. + /// + /// May return null shared_ptr if this file format does not yet support + /// writing datasets. + virtual std::shared_ptr DefaultWriteOptions() = 0; + + protected: + explicit FileFormat(std::shared_ptr default_fragment_scan_options) + : default_fragment_scan_options(std::move(default_fragment_scan_options)) {} +}; + +/// \brief A Fragment that is stored in a file with a known format +class ARROW_DS_EXPORT FileFragment : public Fragment, + public util::EqualityComparable { + public: + Result ScanBatchesAsync( + const std::shared_ptr& options) override; + Future> CountRows( + compute::Expression predicate, + const std::shared_ptr& options) override; + Future> BeginScan( + const FragmentScanRequest& request, const InspectedFragment& inspected_fragment, + const FragmentScanOptions* format_options, + compute::ExecContext* exec_context) override; + Future> InspectFragment( + const FragmentScanOptions* format_options, + compute::ExecContext* exec_context) override; + + std::string type_name() const override { return format_->type_name(); } + std::string ToString() const override { return source_.path(); }; + + const FileSource& source() const { return source_; } + const std::shared_ptr& format() const { return format_; } + + bool Equals(const FileFragment& other) const; + + protected: + FileFragment(FileSource source, std::shared_ptr format, + compute::Expression partition_expression, + std::shared_ptr physical_schema) + : Fragment(std::move(partition_expression), std::move(physical_schema)), + source_(std::move(source)), + format_(std::move(format)) {} + + Result> ReadPhysicalSchemaImpl() override; + + FileSource source_; + std::shared_ptr format_; + + friend class FileFormat; +}; + +/// \brief A Dataset of FileFragments. +/// +/// A FileSystemDataset is composed of one or more FileFragment. The fragments +/// are independent and don't need to share the same format and/or filesystem. +class ARROW_DS_EXPORT FileSystemDataset : public Dataset { + public: + /// \brief Create a FileSystemDataset. + /// + /// \param[in] schema the schema of the dataset + /// \param[in] root_partition the partition expression of the dataset + /// \param[in] format the format of each FileFragment. + /// \param[in] filesystem the filesystem of each FileFragment, or nullptr if the + /// fragments wrap buffers. + /// \param[in] fragments list of fragments to create the dataset from. + /// \param[in] partitioning the Partitioning object in case the dataset is created + /// with a known partitioning (e.g. from a discovered partitioning + /// through a DatasetFactory), or nullptr if not known. + /// + /// Note that fragments wrapping files resident in differing filesystems are not + /// permitted; to work with multiple filesystems use a UnionDataset. + /// + /// \return A constructed dataset. + static Result> Make( + std::shared_ptr schema, compute::Expression root_partition, + std::shared_ptr format, std::shared_ptr filesystem, + std::vector> fragments, + std::shared_ptr partitioning = NULLPTR); + + /// \brief Write a dataset. + static Status Write(const FileSystemDatasetWriteOptions& write_options, + std::shared_ptr scanner); + + /// \brief Return the type name of the dataset. + std::string type_name() const override { return "filesystem"; } + + /// \brief Replace the schema of the dataset. + Result> ReplaceSchema( + std::shared_ptr schema) const override; + + /// \brief Return the path of files. + std::vector files() const; + + /// \brief Return the format. + const std::shared_ptr& format() const { return format_; } + + /// \brief Return the filesystem. May be nullptr if the fragments wrap buffers. + const std::shared_ptr& filesystem() const { return filesystem_; } + + /// \brief Return the partitioning. May be nullptr if the dataset was not constructed + /// with a partitioning. + const std::shared_ptr& partitioning() const { return partitioning_; } + + std::string ToString() const; + + protected: + struct FragmentSubtrees; + + explicit FileSystemDataset(std::shared_ptr schema) + : Dataset(std::move(schema)) {} + + FileSystemDataset(std::shared_ptr schema, + compute::Expression partition_expression) + : Dataset(std::move(schema), partition_expression) {} + + Result GetFragmentsImpl(compute::Expression predicate) override; + + void SetupSubtreePruning(); + + std::shared_ptr format_; + std::shared_ptr filesystem_; + std::vector> fragments_; + std::shared_ptr partitioning_; + + std::shared_ptr subtrees_; +}; + +/// \brief Options for writing a file of this format. +class ARROW_DS_EXPORT FileWriteOptions { + public: + virtual ~FileWriteOptions() = default; + + const std::shared_ptr& format() const { return format_; } + + std::string type_name() const { return format_->type_name(); } + + protected: + explicit FileWriteOptions(std::shared_ptr format) + : format_(std::move(format)) {} + + std::shared_ptr format_; +}; + +/// \brief A writer for this format. +class ARROW_DS_EXPORT FileWriter { + public: + virtual ~FileWriter() = default; + + /// \brief Write the given batch. + virtual Status Write(const std::shared_ptr& batch) = 0; + + /// \brief Write all batches from the reader. + Status Write(RecordBatchReader* batches); + + /// \brief Indicate that writing is done. + virtual Future<> Finish(); + + const std::shared_ptr& format() const { return options_->format(); } + const std::shared_ptr& schema() const { return schema_; } + const std::shared_ptr& options() const { return options_; } + const fs::FileLocator& destination() const { return destination_locator_; } + + /// \brief After Finish() is called, provides number of bytes written to file. + Result GetBytesWritten() const; + + protected: + FileWriter(std::shared_ptr schema, std::shared_ptr options, + std::shared_ptr destination, + fs::FileLocator destination_locator) + : schema_(std::move(schema)), + options_(std::move(options)), + destination_(std::move(destination)), + destination_locator_(std::move(destination_locator)) {} + + virtual Future<> FinishInternal() = 0; + + std::shared_ptr schema_; + std::shared_ptr options_; + std::shared_ptr destination_; + fs::FileLocator destination_locator_; + std::optional bytes_written_; +}; + +/// \brief Options for writing a dataset. +struct ARROW_DS_EXPORT FileSystemDatasetWriteOptions { + /// Options for individual fragment writing. + std::shared_ptr file_write_options; + + /// FileSystem into which a dataset will be written. + std::shared_ptr filesystem; + + /// Root directory into which the dataset will be written. + std::string base_dir; + + /// Partitioning used to generate fragment paths. + std::shared_ptr partitioning; + + /// If true the order of rows in the dataset is preserved when writing with + /// multiple threads. This may cause notable performance degradation. + bool preserve_order = false; + + /// Maximum number of partitions any batch may be written into, default is 1K. + int max_partitions = 1024; + + /// Template string used to generate fragment basenames. + /// {i} will be replaced by an auto incremented integer. + std::string basename_template; + + /// A functor which will be applied on an incremented counter. The result will be + /// inserted into the basename_template in place of {i}. + /// + /// This can be used, for example, to left-pad the file counter. + std::function basename_template_functor; + + /// If greater than 0 then this will limit the maximum number of files that can be left + /// open. If an attempt is made to open too many files then the least recently used file + /// will be closed. If this setting is set too low you may end up fragmenting your data + /// into many small files. + /// + /// The default is 900 which also allows some # of files to be open by the scanner + /// before hitting the default Linux limit of 1024 + uint32_t max_open_files = 900; + + /// If greater than 0 then this will limit how many rows are placed in any single file. + /// Otherwise there will be no limit and one file will be created in each output + /// directory unless files need to be closed to respect max_open_files + uint64_t max_rows_per_file = 0; + + /// If greater than 0 then this will cause the dataset writer to batch incoming data + /// and only write the row groups to the disk when sufficient rows have accumulated. + /// The final row group size may be less than this value and other options such as + /// `max_open_files` or `max_rows_per_file` lead to smaller row group sizes. + uint64_t min_rows_per_group = 0; + + /// If greater than 0 then the dataset writer may split up large incoming batches into + /// multiple row groups. If this value is set then min_rows_per_group should also be + /// set or else you may end up with very small row groups (e.g. if the incoming row + /// group size is just barely larger than this value). + uint64_t max_rows_per_group = 1 << 20; + + /// Controls what happens if an output directory already exists. + ExistingDataBehavior existing_data_behavior = ExistingDataBehavior::kError; + + /// \brief If false the dataset writer will not create directories + /// This is mainly intended for filesystems that do not require directories such as S3. + bool create_dir = true; + + /// Callback to be invoked against all FileWriters before + /// they are finalized with FileWriter::Finish(). + std::function writer_pre_finish = [](FileWriter*) { + return Status::OK(); + }; + + /// Callback to be invoked against all FileWriters after they have + /// called FileWriter::Finish(). + std::function writer_post_finish = [](FileWriter*) { + return Status::OK(); + }; + + const std::shared_ptr& format() const { + return file_write_options->format(); + } +}; + +/// \brief Wraps FileSystemDatasetWriteOptions for consumption as compute::ExecNodeOptions +class ARROW_DS_EXPORT WriteNodeOptions : public acero::ExecNodeOptions { + public: + explicit WriteNodeOptions( + FileSystemDatasetWriteOptions options, + std::shared_ptr custom_metadata = NULLPTR) + : write_options(std::move(options)), custom_metadata(std::move(custom_metadata)) {} + + /// \brief Options to control how to write the dataset + FileSystemDatasetWriteOptions write_options; + /// \brief Optional schema to attach to all written batches + /// + /// By default, we will use the output schema of the input. + /// + /// This can be used to alter schema metadata, field nullability, or field metadata. + /// However, this cannot be used to change the type of data. If the custom schema does + /// not have the same number of fields and the same data types as the input then the + /// plan will fail. + std::shared_ptr custom_schema; + /// \brief Optional metadata to attach to written batches + std::shared_ptr custom_metadata; +}; + +/// @} + +namespace internal { +ARROW_DS_EXPORT void InitializeDatasetWriter(arrow::acero::ExecFactoryRegistry* registry); +} + +} // namespace dataset +} // namespace arrow diff --git a/shared/package-files/9d/9d44a6ef0f6cd87fc5d60f0507ce356682f4b2457de4f195e70e3fc7c6208774/blob b/shared/package-files/9d/9d44a6ef0f6cd87fc5d60f0507ce356682f4b2457de4f195e70e3fc7c6208774/blob new file mode 100644 index 0000000000000000000000000000000000000000..8ff9803b1efc72747a94e117e68fcd52320976c8 --- /dev/null +++ b/shared/package-files/9d/9d44a6ef0f6cd87fc5d60f0507ce356682f4b2457de4f195e70e3fc7c6208774/blob @@ -0,0 +1,1018 @@ +from sympy.core.expr import Expr +from sympy.core.function import (Derivative, Function, Lambda, expand) +from sympy.core.numbers import (E, I, Rational, comp, nan, oo, pi, zoo) +from sympy.core.relational import Eq +from sympy.core.singleton import S +from sympy.core.symbol import (Symbol, symbols) +from sympy.functions.elementary.complexes import (Abs, adjoint, arg, conjugate, im, re, sign, transpose) +from sympy.functions.elementary.exponential import (exp, exp_polar, log) +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.functions.elementary.piecewise import Piecewise +from sympy.functions.elementary.trigonometric import (acos, atan, atan2, cos, sin) +from sympy.functions.special.delta_functions import (DiracDelta, Heaviside) +from sympy.integrals.integrals import Integral +from sympy.matrices.dense import Matrix +from sympy.matrices.expressions.funcmatrix import FunctionMatrix +from sympy.matrices.expressions.matexpr import MatrixSymbol +from sympy.matrices.immutable import (ImmutableMatrix, ImmutableSparseMatrix) +from sympy.matrices import SparseMatrix +from sympy.sets.sets import Interval +from sympy.core.expr import unchanged +from sympy.core.function import ArgumentIndexError +from sympy.testing.pytest import XFAIL, raises, _both_exp_pow + + +def N_equals(a, b): + """Check whether two complex numbers are numerically close""" + return comp(a.n(), b.n(), 1.e-6) + + +def test_re(): + x, y = symbols('x,y') + a, b = symbols('a,b', real=True) + + r = Symbol('r', real=True) + i = Symbol('i', imaginary=True) + + assert re(nan) is nan + + assert re(oo) is oo + assert re(-oo) is -oo + + assert re(0) == 0 + + assert re(1) == 1 + assert re(-1) == -1 + + assert re(E) == E + assert re(-E) == -E + + assert unchanged(re, x) + assert re(x*I) == -im(x) + assert re(r*I) == 0 + assert re(r) == r + assert re(i*I) == I * i + assert re(i) == 0 + + assert re(x + y) == re(x) + re(y) + assert re(x + r) == re(x) + r + + assert re(re(x)) == re(x) + + assert re(2 + I) == 2 + assert re(x + I) == re(x) + + assert re(x + y*I) == re(x) - im(y) + assert re(x + r*I) == re(x) + + assert re(log(2*I)) == log(2) + + assert re((2 + I)**2).expand(complex=True) == 3 + + assert re(conjugate(x)) == re(x) + assert conjugate(re(x)) == re(x) + + assert re(x).as_real_imag() == (re(x), 0) + + assert re(i*r*x).diff(r) == re(i*x) + assert re(i*r*x).diff(i) == I*r*im(x) + + assert re( + sqrt(a + b*I)) == (a**2 + b**2)**Rational(1, 4)*cos(atan2(b, a)/2) + assert re(a * (2 + b*I)) == 2*a + + assert re((1 + sqrt(a + b*I))/2) == \ + (a**2 + b**2)**Rational(1, 4)*cos(atan2(b, a)/2)/2 + S.Half + + assert re(x).rewrite(im) == x - S.ImaginaryUnit*im(x) + assert (x + re(y)).rewrite(re, im) == x + y - S.ImaginaryUnit*im(y) + + a = Symbol('a', algebraic=True) + t = Symbol('t', transcendental=True) + x = Symbol('x') + assert re(a).is_algebraic + assert re(x).is_algebraic is None + assert re(t).is_algebraic is False + + assert re(S.ComplexInfinity) is S.NaN + + n, m, l = symbols('n m l') + A = MatrixSymbol('A',n,m) + assert re(A) == (S.Half) * (A + conjugate(A)) + + A = Matrix([[1 + 4*I,2],[0, -3*I]]) + assert re(A) == Matrix([[1, 2],[0, 0]]) + + A = ImmutableMatrix([[1 + 3*I, 3-2*I],[0, 2*I]]) + assert re(A) == ImmutableMatrix([[1, 3],[0, 0]]) + + X = SparseMatrix([[2*j + i*I for i in range(5)] for j in range(5)]) + assert re(X) - Matrix([[0, 0, 0, 0, 0], + [2, 2, 2, 2, 2], + [4, 4, 4, 4, 4], + [6, 6, 6, 6, 6], + [8, 8, 8, 8, 8]]) == Matrix.zeros(5) + + assert im(X) - Matrix([[0, 1, 2, 3, 4], + [0, 1, 2, 3, 4], + [0, 1, 2, 3, 4], + [0, 1, 2, 3, 4], + [0, 1, 2, 3, 4]]) == Matrix.zeros(5) + + X = FunctionMatrix(3, 3, Lambda((n, m), n + m*I)) + assert re(X) == Matrix([[0, 0, 0], [1, 1, 1], [2, 2, 2]]) + + +def test_im(): + x, y = symbols('x,y') + a, b = symbols('a,b', real=True) + + r = Symbol('r', real=True) + i = Symbol('i', imaginary=True) + + assert im(nan) is nan + + assert im(oo*I) is oo + assert im(-oo*I) is -oo + + assert im(0) == 0 + + assert im(1) == 0 + assert im(-1) == 0 + + assert im(E*I) == E + assert im(-E*I) == -E + + assert unchanged(im, x) + assert im(x*I) == re(x) + assert im(r*I) == r + assert im(r) == 0 + assert im(i*I) == 0 + assert im(i) == -I * i + + assert im(x + y) == im(x) + im(y) + assert im(x + r) == im(x) + assert im(x + r*I) == im(x) + r + + assert im(im(x)*I) == im(x) + + assert im(2 + I) == 1 + assert im(x + I) == im(x) + 1 + + assert im(x + y*I) == im(x) + re(y) + assert im(x + r*I) == im(x) + r + + assert im(log(2*I)) == pi/2 + + assert im((2 + I)**2).expand(complex=True) == 4 + + assert im(conjugate(x)) == -im(x) + assert conjugate(im(x)) == im(x) + + assert im(x).as_real_imag() == (im(x), 0) + + assert im(i*r*x).diff(r) == im(i*x) + assert im(i*r*x).diff(i) == -I * re(r*x) + + assert im( + sqrt(a + b*I)) == (a**2 + b**2)**Rational(1, 4)*sin(atan2(b, a)/2) + assert im(a * (2 + b*I)) == a*b + + assert im((1 + sqrt(a + b*I))/2) == \ + (a**2 + b**2)**Rational(1, 4)*sin(atan2(b, a)/2)/2 + + assert im(x).rewrite(re) == -S.ImaginaryUnit * (x - re(x)) + assert (x + im(y)).rewrite(im, re) == x - S.ImaginaryUnit * (y - re(y)) + + a = Symbol('a', algebraic=True) + t = Symbol('t', transcendental=True) + x = Symbol('x') + assert re(a).is_algebraic + assert re(x).is_algebraic is None + assert re(t).is_algebraic is False + + assert im(S.ComplexInfinity) is S.NaN + + n, m, l = symbols('n m l') + A = MatrixSymbol('A',n,m) + + assert im(A) == (S.One/(2*I)) * (A - conjugate(A)) + + A = Matrix([[1 + 4*I, 2],[0, -3*I]]) + assert im(A) == Matrix([[4, 0],[0, -3]]) + + A = ImmutableMatrix([[1 + 3*I, 3-2*I],[0, 2*I]]) + assert im(A) == ImmutableMatrix([[3, -2],[0, 2]]) + + X = ImmutableSparseMatrix( + [[i*I + i for i in range(5)] for i in range(5)]) + Y = SparseMatrix([list(range(5)) for i in range(5)]) + assert im(X).as_immutable() == Y + + X = FunctionMatrix(3, 3, Lambda((n, m), n + m*I)) + assert im(X) == Matrix([[0, 1, 2], [0, 1, 2], [0, 1, 2]]) + +def test_sign(): + assert sign(1.2) == 1 + assert sign(-1.2) == -1 + assert sign(3*I) == I + assert sign(-3*I) == -I + assert sign(0) == 0 + assert sign(0, evaluate=False).doit() == 0 + assert sign(oo, evaluate=False).doit() == 1 + assert sign(nan) is nan + assert sign(2 + 2*I).doit() == sqrt(2)*(2 + 2*I)/4 + assert sign(2 + 3*I).simplify() == sign(2 + 3*I) + assert sign(2 + 2*I).simplify() == sign(1 + I) + assert sign(im(sqrt(1 - sqrt(3)))) == 1 + assert sign(sqrt(1 - sqrt(3))) == I + + x = Symbol('x') + assert sign(x).is_finite is True + assert sign(x).is_complex is True + assert sign(x).is_imaginary is None + assert sign(x).is_integer is None + assert sign(x).is_real is None + assert sign(x).is_zero is None + assert sign(x).doit() == sign(x) + assert sign(1.2*x) == sign(x) + assert sign(2*x) == sign(x) + assert sign(I*x) == I*sign(x) + assert sign(-2*I*x) == -I*sign(x) + assert sign(conjugate(x)) == conjugate(sign(x)) + + p = Symbol('p', positive=True) + n = Symbol('n', negative=True) + m = Symbol('m', negative=True) + assert sign(2*p*x) == sign(x) + assert sign(n*x) == -sign(x) + assert sign(n*m*x) == sign(x) + + x = Symbol('x', imaginary=True) + assert sign(x).is_imaginary is True + assert sign(x).is_integer is False + assert sign(x).is_real is False + assert sign(x).is_zero is False + assert sign(x).diff(x) == 2*DiracDelta(-I*x) + assert sign(x).doit() == x / Abs(x) + assert conjugate(sign(x)) == -sign(x) + + x = Symbol('x', real=True) + assert sign(x).is_imaginary is False + assert sign(x).is_integer is True + assert sign(x).is_real is True + assert sign(x).is_zero is None + assert sign(x).diff(x) == 2*DiracDelta(x) + assert sign(x).doit() == sign(x) + assert conjugate(sign(x)) == sign(x) + + x = Symbol('x', nonzero=True) + assert sign(x).is_imaginary is False + assert sign(x).is_integer is True + assert sign(x).is_real is True + assert sign(x).is_zero is False + assert sign(x).doit() == x / Abs(x) + assert sign(Abs(x)) == 1 + assert Abs(sign(x)) == 1 + + x = Symbol('x', positive=True) + assert sign(x).is_imaginary is False + assert sign(x).is_integer is True + assert sign(x).is_real is True + assert sign(x).is_zero is False + assert sign(x).doit() == x / Abs(x) + assert sign(Abs(x)) == 1 + assert Abs(sign(x)) == 1 + + x = 0 + assert sign(x).is_imaginary is False + assert sign(x).is_integer is True + assert sign(x).is_real is True + assert sign(x).is_zero is True + assert sign(x).doit() == 0 + assert sign(Abs(x)) == 0 + assert Abs(sign(x)) == 0 + + nz = Symbol('nz', nonzero=True, integer=True) + assert sign(nz).is_imaginary is False + assert sign(nz).is_integer is True + assert sign(nz).is_real is True + assert sign(nz).is_zero is False + assert sign(nz)**2 == 1 + assert (sign(nz)**3).args == (sign(nz), 3) + + assert sign(Symbol('x', nonnegative=True)).is_nonnegative + assert sign(Symbol('x', nonnegative=True)).is_nonpositive is None + assert sign(Symbol('x', nonpositive=True)).is_nonnegative is None + assert sign(Symbol('x', nonpositive=True)).is_nonpositive + assert sign(Symbol('x', real=True)).is_nonnegative is None + assert sign(Symbol('x', real=True)).is_nonpositive is None + assert sign(Symbol('x', real=True, zero=False)).is_nonpositive is None + + x, y = Symbol('x', real=True), Symbol('y') + f = Function('f') + assert sign(x).rewrite(Piecewise) == \ + Piecewise((1, x > 0), (-1, x < 0), (0, True)) + assert sign(y).rewrite(Piecewise) == sign(y) + assert sign(x).rewrite(Heaviside) == 2*Heaviside(x, H0=S(1)/2) - 1 + assert sign(y).rewrite(Heaviside) == sign(y) + assert sign(y).rewrite(Abs) == Piecewise((0, Eq(y, 0)), (y/Abs(y), True)) + assert sign(f(y)).rewrite(Abs) == Piecewise((0, Eq(f(y), 0)), (f(y)/Abs(f(y)), True)) + + # evaluate what can be evaluated + assert sign(exp_polar(I*pi)*pi) is S.NegativeOne + + eq = -sqrt(10 + 6*sqrt(3)) + sqrt(1 + sqrt(3)) + sqrt(3 + 3*sqrt(3)) + # if there is a fast way to know when and when you cannot prove an + # expression like this is zero then the equality to zero is ok + assert sign(eq).func is sign or sign(eq) == 0 + # but sometimes it's hard to do this so it's better not to load + # abs down with tests that will be very slow + q = 1 + sqrt(2) - 2*sqrt(3) + 1331*sqrt(6) + p = expand(q**3)**Rational(1, 3) + d = p - q + assert sign(d).func is sign or sign(d) == 0 + + +def test_as_real_imag(): + n = pi**1000 + # the special code for working out the real + # and complex parts of a power with Integer exponent + # should not run if there is no imaginary part, hence + # this should not hang + assert n.as_real_imag() == (n, 0) + + # issue 6261 + x = Symbol('x') + assert sqrt(x).as_real_imag() == \ + ((re(x)**2 + im(x)**2)**Rational(1, 4)*cos(atan2(im(x), re(x))/2), + (re(x)**2 + im(x)**2)**Rational(1, 4)*sin(atan2(im(x), re(x))/2)) + + # issue 3853 + a, b = symbols('a,b', real=True) + assert ((1 + sqrt(a + b*I))/2).as_real_imag() == \ + ( + (a**2 + b**2)**Rational( + 1, 4)*cos(atan2(b, a)/2)/2 + S.Half, + (a**2 + b**2)**Rational(1, 4)*sin(atan2(b, a)/2)/2) + + assert sqrt(a**2).as_real_imag() == (sqrt(a**2), 0) + i = symbols('i', imaginary=True) + assert sqrt(i**2).as_real_imag() == (0, abs(i)) + + assert ((1 + I)/(1 - I)).as_real_imag() == (0, 1) + assert ((1 + I)**3/(1 - I)).as_real_imag() == (-2, 0) + + +@XFAIL +def test_sign_issue_3068(): + n = pi**1000 + i = int(n) + x = Symbol('x') + assert (n - i).round() == 1 # doesn't hang + assert sign(n - i) == 1 + # perhaps it's not possible to get the sign right when + # only 1 digit is being requested for this situation; + # 2 digits works + assert (n - x).n(1, subs={x: i}) > 0 + assert (n - x).n(2, subs={x: i}) > 0 + + +def test_Abs(): + raises(TypeError, lambda: Abs(Interval(2, 3))) # issue 8717 + + x, y = symbols('x,y') + assert sign(sign(x)) == sign(x) + assert sign(x*y).func is sign + assert Abs(0) == 0 + assert Abs(1) == 1 + assert Abs(-1) == 1 + assert Abs(I) == 1 + assert Abs(-I) == 1 + assert Abs(nan) is nan + assert Abs(zoo) is oo + assert Abs(I * pi) == pi + assert Abs(-I * pi) == pi + assert Abs(I * x) == Abs(x) + assert Abs(-I * x) == Abs(x) + assert Abs(-2*x) == 2*Abs(x) + assert Abs(-2.0*x) == 2.0*Abs(x) + assert Abs(2*pi*x*y) == 2*pi*Abs(x*y) + assert Abs(conjugate(x)) == Abs(x) + assert conjugate(Abs(x)) == Abs(x) + assert Abs(x).expand(complex=True) == sqrt(re(x)**2 + im(x)**2) + + a = Symbol('a', positive=True) + assert Abs(2*pi*x*a) == 2*pi*a*Abs(x) + assert Abs(2*pi*I*x*a) == 2*pi*a*Abs(x) + + x = Symbol('x', real=True) + n = Symbol('n', integer=True) + assert Abs((-1)**n) == 1 + assert x**(2*n) == Abs(x)**(2*n) + assert Abs(x).diff(x) == sign(x) + assert abs(x) == Abs(x) # Python built-in + assert Abs(x)**3 == x**2*Abs(x) + assert Abs(x)**4 == x**4 + assert ( + Abs(x)**(3*n)).args == (Abs(x), 3*n) # leave symbolic odd unchanged + assert (1/Abs(x)).args == (Abs(x), -1) + assert 1/Abs(x)**3 == 1/(x**2*Abs(x)) + assert Abs(x)**-3 == Abs(x)/(x**4) + assert Abs(x**3) == x**2*Abs(x) + assert Abs(I**I) == exp(-pi/2) + assert Abs((4 + 5*I)**(6 + 7*I)) == 68921*exp(-7*atan(Rational(5, 4))) + y = Symbol('y', real=True) + assert Abs(I**y) == 1 + y = Symbol('y') + assert Abs(I**y) == exp(-pi*im(y)/2) + + x = Symbol('x', imaginary=True) + assert Abs(x).diff(x) == -sign(x) + + eq = -sqrt(10 + 6*sqrt(3)) + sqrt(1 + sqrt(3)) + sqrt(3 + 3*sqrt(3)) + # if there is a fast way to know when you can and when you cannot prove an + # expression like this is zero then the equality to zero is ok + assert abs(eq).func is Abs or abs(eq) == 0 + # but sometimes it's hard to do this so it's better not to load + # abs down with tests that will be very slow + q = 1 + sqrt(2) - 2*sqrt(3) + 1331*sqrt(6) + p = expand(q**3)**Rational(1, 3) + d = p - q + assert abs(d).func is Abs or abs(d) == 0 + + assert Abs(4*exp(pi*I/4)) == 4 + assert Abs(3**(2 + I)) == 9 + assert Abs((-3)**(1 - I)) == 3*exp(pi) + + assert Abs(oo) is oo + assert Abs(-oo) is oo + assert Abs(oo + I) is oo + assert Abs(oo + I*oo) is oo + + a = Symbol('a', algebraic=True) + t = Symbol('t', transcendental=True) + x = Symbol('x') + assert re(a).is_algebraic + assert re(x).is_algebraic is None + assert re(t).is_algebraic is False + assert Abs(x).fdiff() == sign(x) + raises(ArgumentIndexError, lambda: Abs(x).fdiff(2)) + + # doesn't have recursion error + arg = sqrt(acos(1 - I)*acos(1 + I)) + assert abs(arg) == arg + + # special handling to put Abs in denom + assert abs(1/x) == 1/Abs(x) + e = abs(2/x**2) + assert e.is_Mul and e == 2/Abs(x**2) + assert unchanged(Abs, y/x) + assert unchanged(Abs, x/(x + 1)) + assert unchanged(Abs, x*y) + p = Symbol('p', positive=True) + assert abs(x/p) == abs(x)/p + + # coverage + assert unchanged(Abs, Symbol('x', real=True)**y) + # issue 19627 + f = Function('f', positive=True) + assert sqrt(f(x)**2) == f(x) + # issue 21625 + assert unchanged(Abs, S("im(acos(-i + acosh(-g + i)))")) + + +def test_Abs_rewrite(): + x = Symbol('x', real=True) + a = Abs(x).rewrite(Heaviside).expand() + assert a == x*Heaviside(x) - x*Heaviside(-x) + for i in [-2, -1, 0, 1, 2]: + assert a.subs(x, i) == abs(i) + y = Symbol('y') + assert Abs(y).rewrite(Heaviside) == Abs(y) + + x, y = Symbol('x', real=True), Symbol('y') + assert Abs(x).rewrite(Piecewise) == Piecewise((x, x >= 0), (-x, True)) + assert Abs(y).rewrite(Piecewise) == Abs(y) + assert Abs(y).rewrite(sign) == y/sign(y) + + i = Symbol('i', imaginary=True) + assert abs(i).rewrite(Piecewise) == Piecewise((I*i, I*i >= 0), (-I*i, True)) + + + assert Abs(y).rewrite(conjugate) == sqrt(y*conjugate(y)) + assert Abs(i).rewrite(conjugate) == sqrt(-i**2) # == -I*i + + y = Symbol('y', extended_real=True) + assert (Abs(exp(-I*x)-exp(-I*y))**2).rewrite(conjugate) == \ + -exp(I*x)*exp(-I*y) + 2 - exp(-I*x)*exp(I*y) + + +def test_Abs_real(): + # test some properties of abs that only apply + # to real numbers + x = Symbol('x', complex=True) + assert sqrt(x**2) != Abs(x) + assert Abs(x**2) != x**2 + + x = Symbol('x', real=True) + assert sqrt(x**2) == Abs(x) + assert Abs(x**2) == x**2 + + # if the symbol is zero, the following will still apply + nn = Symbol('nn', nonnegative=True, real=True) + np = Symbol('np', nonpositive=True, real=True) + assert Abs(nn) == nn + assert Abs(np) == -np + + +def test_Abs_properties(): + x = Symbol('x') + assert Abs(x).is_real is None + assert Abs(x).is_extended_real is True + assert Abs(x).is_rational is None + assert Abs(x).is_positive is None + assert Abs(x).is_nonnegative is None + assert Abs(x).is_extended_positive is None + assert Abs(x).is_extended_nonnegative is True + + f = Symbol('x', finite=True) + assert Abs(f).is_real is True + assert Abs(f).is_extended_real is True + assert Abs(f).is_rational is None + assert Abs(f).is_positive is None + assert Abs(f).is_nonnegative is True + assert Abs(f).is_extended_positive is None + assert Abs(f).is_extended_nonnegative is True + + z = Symbol('z', complex=True, zero=False) + assert Abs(z).is_real is True # since complex implies finite + assert Abs(z).is_extended_real is True + assert Abs(z).is_rational is None + assert Abs(z).is_positive is True + assert Abs(z).is_extended_positive is True + assert Abs(z).is_zero is False + + p = Symbol('p', positive=True) + assert Abs(p).is_real is True + assert Abs(p).is_extended_real is True + assert Abs(p).is_rational is None + assert Abs(p).is_positive is True + assert Abs(p).is_zero is False + + q = Symbol('q', rational=True) + assert Abs(q).is_real is True + assert Abs(q).is_rational is True + assert Abs(q).is_integer is None + assert Abs(q).is_positive is None + assert Abs(q).is_nonnegative is True + + i = Symbol('i', integer=True) + assert Abs(i).is_real is True + assert Abs(i).is_integer is True + assert Abs(i).is_positive is None + assert Abs(i).is_nonnegative is True + + e = Symbol('n', even=True) + ne = Symbol('ne', real=True, even=False) + assert Abs(e).is_even is True + assert Abs(ne).is_even is False + assert Abs(i).is_even is None + + o = Symbol('n', odd=True) + no = Symbol('no', real=True, odd=False) + assert Abs(o).is_odd is True + assert Abs(no).is_odd is False + assert Abs(i).is_odd is None + + +def test_abs(): + # this tests that abs calls Abs; don't rename to + # test_Abs since that test is already above + a = Symbol('a', positive=True) + assert abs(I*(1 + a)**2) == (1 + a)**2 + + +def test_arg(): + assert arg(0) is nan + assert arg(1) == 0 + assert arg(-1) == pi + assert arg(I) == pi/2 + assert arg(-I) == -pi/2 + assert arg(1 + I) == pi/4 + assert arg(-1 + I) == pi*Rational(3, 4) + assert arg(1 - I) == -pi/4 + assert arg(exp_polar(4*pi*I)) == 4*pi + assert arg(exp_polar(-7*pi*I)) == -7*pi + assert arg(exp_polar(5 - 3*pi*I/4)) == pi*Rational(-3, 4) + f = Function('f') + assert not arg(f(0) + I*f(1)).atoms(re) + + # check nesting + x = Symbol('x') + assert arg(arg(arg(x))) is not S.NaN + assert arg(arg(arg(arg(x)))) is S.NaN + r = Symbol('r', extended_real=True) + assert arg(arg(r)) is not S.NaN + assert arg(arg(arg(r))) is S.NaN + + p = Function('p', extended_positive=True) + assert arg(p(x)) == 0 + assert arg((3 + I)*p(x)) == arg(3 + I) + + p = Symbol('p', positive=True) + assert arg(p) == 0 + assert arg(p*I) == pi/2 + + n = Symbol('n', negative=True) + assert arg(n) == pi + assert arg(n*I) == -pi/2 + + x = Symbol('x') + assert conjugate(arg(x)) == arg(x) + + e = p + I*p**2 + assert arg(e) == arg(1 + p*I) + # make sure sign doesn't swap + e = -2*p + 4*I*p**2 + assert arg(e) == arg(-1 + 2*p*I) + # make sure sign isn't lost + x = symbols('x', real=True) # could be zero + e = x + I*x + assert arg(e) == arg(x*(1 + I)) + assert arg(e/p) == arg(x*(1 + I)) + e = p*cos(p) + I*log(p)*exp(p) + assert arg(e).args[0] == e + # keep it simple -- let the user do more advanced cancellation + e = (p + 1) + I*(p**2 - 1) + assert arg(e).args[0] == e + + f = Function('f') + e = 2*x*(f(0) - 1) - 2*x*f(0) + assert arg(e) == arg(-2*x) + assert arg(f(0)).func == arg and arg(f(0)).args == (f(0),) + + +def test_arg_rewrite(): + assert arg(1 + I) == atan2(1, 1) + + x = Symbol('x', real=True) + y = Symbol('y', real=True) + assert arg(x + I*y).rewrite(atan2) == atan2(y, x) + + +def test_adjoint(): + a = Symbol('a', antihermitian=True) + b = Symbol('b', hermitian=True) + assert adjoint(a) == -a + assert adjoint(I*a) == I*a + assert adjoint(b) == b + assert adjoint(I*b) == -I*b + assert adjoint(a*b) == -b*a + assert adjoint(I*a*b) == I*b*a + + x, y = symbols('x y') + assert adjoint(adjoint(x)) == x + assert adjoint(x + y) == adjoint(x) + adjoint(y) + assert adjoint(x - y) == adjoint(x) - adjoint(y) + assert adjoint(x * y) == adjoint(x) * adjoint(y) + assert adjoint(x / y) == adjoint(x) / adjoint(y) + assert adjoint(-x) == -adjoint(x) + + x, y = symbols('x y', commutative=False) + assert adjoint(adjoint(x)) == x + assert adjoint(x + y) == adjoint(x) + adjoint(y) + assert adjoint(x - y) == adjoint(x) - adjoint(y) + assert adjoint(x * y) == adjoint(y) * adjoint(x) + assert adjoint(x / y) == 1 / adjoint(y) * adjoint(x) + assert adjoint(-x) == -adjoint(x) + + +def test_conjugate(): + a = Symbol('a', real=True) + b = Symbol('b', imaginary=True) + assert conjugate(a) == a + assert conjugate(I*a) == -I*a + assert conjugate(b) == -b + assert conjugate(I*b) == I*b + assert conjugate(a*b) == -a*b + assert conjugate(I*a*b) == I*a*b + + x, y = symbols('x y') + assert conjugate(conjugate(x)) == x + assert conjugate(x).inverse() == conjugate + assert conjugate(x + y) == conjugate(x) + conjugate(y) + assert conjugate(x - y) == conjugate(x) - conjugate(y) + assert conjugate(x * y) == conjugate(x) * conjugate(y) + assert conjugate(x / y) == conjugate(x) / conjugate(y) + assert conjugate(-x) == -conjugate(x) + + a = Symbol('a', algebraic=True) + t = Symbol('t', transcendental=True) + assert re(a).is_algebraic + assert re(x).is_algebraic is None + assert re(t).is_algebraic is False + + +def test_conjugate_transpose(): + x = Symbol('x') + assert conjugate(transpose(x)) == adjoint(x) + assert transpose(conjugate(x)) == adjoint(x) + assert adjoint(transpose(x)) == conjugate(x) + assert transpose(adjoint(x)) == conjugate(x) + assert adjoint(conjugate(x)) == transpose(x) + assert conjugate(adjoint(x)) == transpose(x) + + class Symmetric(Expr): + def _eval_adjoint(self): + return None + + def _eval_conjugate(self): + return None + + def _eval_transpose(self): + return self + x = Symmetric() + assert conjugate(x) == adjoint(x) + assert transpose(x) == x + + +def test_transpose(): + a = Symbol('a', complex=True) + assert transpose(a) == a + assert transpose(I*a) == I*a + + x, y = symbols('x y') + assert transpose(transpose(x)) == x + assert transpose(x + y) == transpose(x) + transpose(y) + assert transpose(x - y) == transpose(x) - transpose(y) + assert transpose(x * y) == transpose(x) * transpose(y) + assert transpose(x / y) == transpose(x) / transpose(y) + assert transpose(-x) == -transpose(x) + + x, y = symbols('x y', commutative=False) + assert transpose(transpose(x)) == x + assert transpose(x + y) == transpose(x) + transpose(y) + assert transpose(x - y) == transpose(x) - transpose(y) + assert transpose(x * y) == transpose(y) * transpose(x) + assert transpose(x / y) == 1 / transpose(y) * transpose(x) + assert transpose(-x) == -transpose(x) + + +@_both_exp_pow +def test_polarify(): + from sympy.functions.elementary.complexes import (polar_lift, polarify) + x = Symbol('x') + z = Symbol('z', polar=True) + f = Function('f') + ES = {} + + assert polarify(-1) == (polar_lift(-1), ES) + assert polarify(1 + I) == (polar_lift(1 + I), ES) + + assert polarify(exp(x), subs=False) == exp(x) + assert polarify(1 + x, subs=False) == 1 + x + assert polarify(f(I) + x, subs=False) == f(polar_lift(I)) + x + + assert polarify(x, lift=True) == polar_lift(x) + assert polarify(z, lift=True) == z + assert polarify(f(x), lift=True) == f(polar_lift(x)) + assert polarify(1 + x, lift=True) == polar_lift(1 + x) + assert polarify(1 + f(x), lift=True) == polar_lift(1 + f(polar_lift(x))) + + newex, subs = polarify(f(x) + z) + assert newex.subs(subs) == f(x) + z + + mu = Symbol("mu") + sigma = Symbol("sigma", positive=True) + + # Make sure polarify(lift=True) doesn't try to lift the integration + # variable + assert polarify( + Integral(sqrt(2)*x*exp(-(-mu + x)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), + (x, -oo, oo)), lift=True) == Integral(sqrt(2)*(sigma*exp_polar(0))**exp_polar(I*pi)* + exp((sigma*exp_polar(0))**(2*exp_polar(I*pi))*exp_polar(I*pi)*polar_lift(-mu + x)** + (2*exp_polar(0))/2)*exp_polar(0)*polar_lift(x)/(2*sqrt(pi)), (x, -oo, oo)) + + +def test_unpolarify(): + from sympy.functions.elementary.complexes import (polar_lift, principal_branch, unpolarify) + from sympy.core.relational import Ne + from sympy.functions.elementary.hyperbolic import tanh + from sympy.functions.special.error_functions import erf + from sympy.functions.special.gamma_functions import (gamma, uppergamma) + from sympy.abc import x + p = exp_polar(7*I) + 1 + u = exp(7*I) + 1 + + assert unpolarify(1) == 1 + assert unpolarify(p) == u + assert unpolarify(p**2) == u**2 + assert unpolarify(p**x) == p**x + assert unpolarify(p*x) == u*x + assert unpolarify(p + x) == u + x + assert unpolarify(sqrt(sin(p))) == sqrt(sin(u)) + + # Test reduction to principal branch 2*pi. + t = principal_branch(x, 2*pi) + assert unpolarify(t) == x + assert unpolarify(sqrt(t)) == sqrt(t) + + # Test exponents_only. + assert unpolarify(p**p, exponents_only=True) == p**u + assert unpolarify(uppergamma(x, p**p)) == uppergamma(x, p**u) + + # Test functions. + assert unpolarify(sin(p)) == sin(u) + assert unpolarify(tanh(p)) == tanh(u) + assert unpolarify(gamma(p)) == gamma(u) + assert unpolarify(erf(p)) == erf(u) + assert unpolarify(uppergamma(x, p)) == uppergamma(x, p) + + assert unpolarify(uppergamma(sin(p), sin(p + exp_polar(0)))) == \ + uppergamma(sin(u), sin(u + 1)) + assert unpolarify(uppergamma(polar_lift(0), 2*exp_polar(0))) == \ + uppergamma(0, 2) + + assert unpolarify(Eq(p, 0)) == Eq(u, 0) + assert unpolarify(Ne(p, 0)) == Ne(u, 0) + assert unpolarify(polar_lift(x) > 0) == (x > 0) + + # Test bools + assert unpolarify(True) is True + + +def test_issue_4035(): + x = Symbol('x') + assert Abs(x).expand(trig=True) == Abs(x) + assert sign(x).expand(trig=True) == sign(x) + assert arg(x).expand(trig=True) == arg(x) + + +def test_issue_3206(): + x = Symbol('x') + assert Abs(Abs(x)) == Abs(x) + + +def test_issue_4754_derivative_conjugate(): + x = Symbol('x', real=True) + y = Symbol('y', imaginary=True) + f = Function('f') + assert (f(x).conjugate()).diff(x) == (f(x).diff(x)).conjugate() + assert (f(y).conjugate()).diff(y) == -(f(y).diff(y)).conjugate() + + +def test_derivatives_issue_4757(): + x = Symbol('x', real=True) + y = Symbol('y', imaginary=True) + f = Function('f') + assert re(f(x)).diff(x) == re(f(x).diff(x)) + assert im(f(x)).diff(x) == im(f(x).diff(x)) + assert re(f(y)).diff(y) == -I*im(f(y).diff(y)) + assert im(f(y)).diff(y) == -I*re(f(y).diff(y)) + assert Abs(f(x)).diff(x).subs(f(x), 1 + I*x).doit() == x/sqrt(1 + x**2) + assert arg(f(x)).diff(x).subs(f(x), 1 + I*x**2).doit() == 2*x/(1 + x**4) + assert Abs(f(y)).diff(y).subs(f(y), 1 + y).doit() == -y/sqrt(1 - y**2) + assert arg(f(y)).diff(y).subs(f(y), I + y**2).doit() == 2*y/(1 + y**4) + + +def test_issue_11413(): + from sympy.simplify.simplify import simplify + v0 = Symbol('v0') + v1 = Symbol('v1') + v2 = Symbol('v2') + V = Matrix([[v0],[v1],[v2]]) + U = V.normalized() + assert U == Matrix([ + [v0/sqrt(Abs(v0)**2 + Abs(v1)**2 + Abs(v2)**2)], + [v1/sqrt(Abs(v0)**2 + Abs(v1)**2 + Abs(v2)**2)], + [v2/sqrt(Abs(v0)**2 + Abs(v1)**2 + Abs(v2)**2)]]) + U.norm = sqrt(v0**2/(v0**2 + v1**2 + v2**2) + v1**2/(v0**2 + v1**2 + v2**2) + v2**2/(v0**2 + v1**2 + v2**2)) + assert simplify(U.norm) == 1 + + +def test_periodic_argument(): + from sympy.functions.elementary.complexes import (periodic_argument, polar_lift, principal_branch, unbranched_argument) + x = Symbol('x') + p = Symbol('p', positive=True) + + assert unbranched_argument(2 + I) == periodic_argument(2 + I, oo) + assert unbranched_argument(1 + x) == periodic_argument(1 + x, oo) + assert N_equals(unbranched_argument((1 + I)**2), pi/2) + assert N_equals(unbranched_argument((1 - I)**2), -pi/2) + assert N_equals(periodic_argument((1 + I)**2, 3*pi), pi/2) + assert N_equals(periodic_argument((1 - I)**2, 3*pi), -pi/2) + + assert unbranched_argument(principal_branch(x, pi)) == \ + periodic_argument(x, pi) + + assert unbranched_argument(polar_lift(2 + I)) == unbranched_argument(2 + I) + assert periodic_argument(polar_lift(2 + I), 2*pi) == \ + periodic_argument(2 + I, 2*pi) + assert periodic_argument(polar_lift(2 + I), 3*pi) == \ + periodic_argument(2 + I, 3*pi) + assert periodic_argument(polar_lift(2 + I), pi) == \ + periodic_argument(polar_lift(2 + I), pi) + + assert unbranched_argument(polar_lift(1 + I)) == pi/4 + assert periodic_argument(2*p, p) == periodic_argument(p, p) + assert periodic_argument(pi*p, p) == periodic_argument(p, p) + + assert Abs(polar_lift(1 + I)) == Abs(1 + I) + + +@XFAIL +def test_principal_branch_fail(): + # TODO XXX why does abs(x)._eval_evalf() not fall back to global evalf? + from sympy.functions.elementary.complexes import principal_branch + assert N_equals(principal_branch((1 + I)**2, pi/2), 0) + + +def test_principal_branch(): + from sympy.functions.elementary.complexes import (polar_lift, principal_branch) + p = Symbol('p', positive=True) + x = Symbol('x') + neg = Symbol('x', negative=True) + + assert principal_branch(polar_lift(x), p) == principal_branch(x, p) + assert principal_branch(polar_lift(2 + I), p) == principal_branch(2 + I, p) + assert principal_branch(2*x, p) == 2*principal_branch(x, p) + assert principal_branch(1, pi) == exp_polar(0) + assert principal_branch(-1, 2*pi) == exp_polar(I*pi) + assert principal_branch(-1, pi) == exp_polar(0) + assert principal_branch(exp_polar(3*pi*I)*x, 2*pi) == \ + principal_branch(exp_polar(I*pi)*x, 2*pi) + assert principal_branch(neg*exp_polar(pi*I), 2*pi) == neg*exp_polar(-I*pi) + # related to issue #14692 + assert principal_branch(exp_polar(-I*pi/2)/polar_lift(neg), 2*pi) == \ + exp_polar(-I*pi/2)/neg + + assert N_equals(principal_branch((1 + I)**2, 2*pi), 2*I) + assert N_equals(principal_branch((1 + I)**2, 3*pi), 2*I) + assert N_equals(principal_branch((1 + I)**2, 1*pi), 2*I) + + # test argument sanitization + assert principal_branch(x, I).func is principal_branch + assert principal_branch(x, -4).func is principal_branch + assert principal_branch(x, -oo).func is principal_branch + assert principal_branch(x, zoo).func is principal_branch + + +@XFAIL +def test_issue_6167_6151(): + n = pi**1000 + i = int(n) + assert sign(n - i) == 1 + assert abs(n - i) == n - i + x = Symbol('x') + eps = pi**-1500 + big = pi**1000 + one = cos(x)**2 + sin(x)**2 + e = big*one - big + eps + from sympy.simplify.simplify import simplify + assert sign(simplify(e)) == 1 + for xi in (111, 11, 1, Rational(1, 10)): + assert sign(e.subs(x, xi)) == 1 + + +def test_issue_14216(): + from sympy.functions.elementary.complexes import unpolarify + A = MatrixSymbol("A", 2, 2) + assert unpolarify(A[0, 0]) == A[0, 0] + assert unpolarify(A[0, 0]*A[1, 0]) == A[0, 0]*A[1, 0] + + +def test_issue_14238(): + # doesn't cause recursion error + r = Symbol('r', real=True) + assert Abs(r + Piecewise((0, r > 0), (1 - r, True))) + + +def test_issue_22189(): + x = Symbol('x') + for a in (sqrt(7 - 2*x) - 2, 1 - x): + assert Abs(a) - Abs(-a) == 0, a + + +def test_zero_assumptions(): + nr = Symbol('nonreal', real=False, finite=True) + ni = Symbol('nonimaginary', imaginary=False) + # imaginary implies not zero + nzni = Symbol('nonzerononimaginary', zero=False, imaginary=False) + + assert re(nr).is_zero is None + assert im(nr).is_zero is False + + assert re(ni).is_zero is None + assert im(ni).is_zero is None + + assert re(nzni).is_zero is False + assert im(nzni).is_zero is None + + +@_both_exp_pow +def test_issue_15893(): + f = Function('f', real=True) + x = Symbol('x', real=True) + eq = Derivative(Abs(f(x)), f(x)) + assert eq.doit() == sign(f(x)) diff --git a/shared/package-files/9d/9d45d7a1d2f842b3061dbd3157d4290e3109b06ebb803e861e8b087cd9eb7f10/blob b/shared/package-files/9d/9d45d7a1d2f842b3061dbd3157d4290e3109b06ebb803e861e8b087cd9eb7f10/blob new file mode 100644 index 0000000000000000000000000000000000000000..8db6be6a643c8cb60cab8487478f9a2f0c817d8b --- /dev/null +++ b/shared/package-files/9d/9d45d7a1d2f842b3061dbd3157d4290e3109b06ebb803e861e8b087cd9eb7f10/blob @@ -0,0 +1,30 @@ +#include + +// Broadcasting utilities for working with TensorBase +namespace at { +namespace internal { +TORCH_API TensorBase expand_slow_path(const TensorBase& self, IntArrayRef size); +} // namespace internal + +inline c10::MaybeOwned expand_size( + const TensorBase& self, + IntArrayRef size) { + if (size.equals(self.sizes())) { + return c10::MaybeOwned::borrowed(self); + } + return c10::MaybeOwned::owned( + at::internal::expand_slow_path(self, size)); +} +c10::MaybeOwned expand_size(TensorBase&& self, IntArrayRef size) = + delete; + +inline c10::MaybeOwned expand_inplace( + const TensorBase& tensor, + const TensorBase& to_expand) { + return expand_size(to_expand, tensor.sizes()); +} +c10::MaybeOwned expand_inplace( + const TensorBase& tensor, + TensorBase&& to_expand) = delete; + +} // namespace at diff --git a/shared/package-files/9d/9d48466f7b3abe518569612b78074ad7d4e933c76a5caa1fedb3bc7ad5a1315c/blob b/shared/package-files/9d/9d48466f7b3abe518569612b78074ad7d4e933c76a5caa1fedb3bc7ad5a1315c/blob new file mode 100644 index 0000000000000000000000000000000000000000..dfb46f303d30bea5707ea5b3d5d8a10702761f99 --- /dev/null +++ b/shared/package-files/9d/9d48466f7b3abe518569612b78074ad7d4e933c76a5caa1fedb3bc7ad5a1315c/blob @@ -0,0 +1,24 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor angle(const at::Tensor & self); +TORCH_API at::Tensor & angle_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor angle_sparse_csr(const at::Tensor & self); +TORCH_API at::Tensor & angle_sparse_csr_out(const at::Tensor & self, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9d4907413a4c4df7e4a4347bc3711c42f4007af11f7e50fab479b7a53071a532/blob b/shared/package-files/9d/9d4907413a4c4df7e4a4347bc3711c42f4007af11f7e50fab479b7a53071a532/blob new file mode 100644 index 0000000000000000000000000000000000000000..0eadf696b34cc034d2be76ce5daba2cff679da74 --- /dev/null +++ b/shared/package-files/9d/9d4907413a4c4df7e4a4347bc3711c42f4007af11f7e50fab479b7a53071a532/blob @@ -0,0 +1,63 @@ +import pytest + +from pandas import ( + DataFrame, + Index, + Series, +) +import pandas._testing as tm + + +class TestToFrame: + def test_to_frame_respects_name_none(self): + # GH#44212 if we explicitly pass name=None, then that should be respected, + # not changed to 0 + # GH-45448 this is first deprecated & enforced in 2.0 + ser = Series(range(3)) + result = ser.to_frame(None) + + exp_index = Index([None], dtype=object) + tm.assert_index_equal(result.columns, exp_index) + + result = ser.rename("foo").to_frame(None) + exp_index = Index([None], dtype=object) + tm.assert_index_equal(result.columns, exp_index) + + def test_to_frame(self, datetime_series): + datetime_series.name = None + rs = datetime_series.to_frame() + xp = DataFrame(datetime_series.values, index=datetime_series.index) + tm.assert_frame_equal(rs, xp) + + datetime_series.name = "testname" + rs = datetime_series.to_frame() + xp = DataFrame( + {"testname": datetime_series.values}, index=datetime_series.index + ) + tm.assert_frame_equal(rs, xp) + + rs = datetime_series.to_frame(name="testdifferent") + xp = DataFrame( + {"testdifferent": datetime_series.values}, index=datetime_series.index + ) + tm.assert_frame_equal(rs, xp) + + @pytest.mark.filterwarnings( + "ignore:Passing a BlockManager|Passing a SingleBlockManager:DeprecationWarning" + ) + def test_to_frame_expanddim(self): + # GH#9762 + + class SubclassedSeries(Series): + @property + def _constructor_expanddim(self): + return SubclassedFrame + + class SubclassedFrame(DataFrame): + pass + + ser = SubclassedSeries([1, 2, 3], name="X") + result = ser.to_frame() + assert isinstance(result, SubclassedFrame) + expected = SubclassedFrame({"X": [1, 2, 3]}) + tm.assert_frame_equal(result, expected) diff --git a/shared/package-files/9d/9d499dbf43a808d48516177d9bb43d310dd44b25e1f99fe81b73726e51651cc0/blob b/shared/package-files/9d/9d499dbf43a808d48516177d9bb43d310dd44b25e1f99fe81b73726e51651cc0/blob new file mode 100644 index 0000000000000000000000000000000000000000..16d1eaa33130d680e5770eccd8ed7fc6d160e8cc --- /dev/null +++ b/shared/package-files/9d/9d499dbf43a808d48516177d9bb43d310dd44b25e1f99fe81b73726e51651cc0/blob @@ -0,0 +1,30 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API void _foreach_add_out(at::TensorList out, at::TensorList self, const at::Scalar & scalar); +TORCH_API void _foreach_add_outf(at::TensorList self, const at::Scalar & scalar, at::TensorList out); +TORCH_API void _foreach_add_out(at::TensorList out, at::TensorList self, at::TensorList other, const at::Scalar & alpha=1); +TORCH_API void _foreach_add_outf(at::TensorList self, at::TensorList other, const at::Scalar & alpha, at::TensorList out); +TORCH_API void _foreach_add_out(at::TensorList out, at::TensorList self, at::ArrayRef scalars); +TORCH_API void _foreach_add_outf(at::TensorList self, at::ArrayRef scalars, at::TensorList out); +TORCH_API void _foreach_add_out(at::TensorList out, at::TensorList self, const at::Tensor & other, const at::Scalar & alpha=1); +TORCH_API void _foreach_add_outf(at::TensorList self, const at::Tensor & other, const at::Scalar & alpha, at::TensorList out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9d/9d4a17bb34c72c6e59146cb47d67215822f753dc74c79655b63ed3f4edd1632e/blob b/shared/package-files/9d/9d4a17bb34c72c6e59146cb47d67215822f753dc74c79655b63ed3f4edd1632e/blob new file mode 100644 index 0000000000000000000000000000000000000000..e1e5b64f7c9aea91ac3519f0812560ae3a90dee4 --- /dev/null +++ b/shared/package-files/9d/9d4a17bb34c72c6e59146cb47d67215822f753dc74c79655b63ed3f4edd1632e/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor poisson(const at::Tensor & self, c10::optional generator=c10::nullopt); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/9d/9d4d30a91e183514c655373ef4982942fc0c5bd2056f817ed064b5eefbdf7624/blob b/shared/package-files/9d/9d4d30a91e183514c655373ef4982942fc0c5bd2056f817ed064b5eefbdf7624/blob new file mode 100644 index 0000000000000000000000000000000000000000..73e2f6f855d071bfd54770963dfb741eb700bcd9 --- /dev/null +++ b/shared/package-files/9d/9d4d30a91e183514c655373ef4982942fc0c5bd2056f817ed064b5eefbdf7624/blob @@ -0,0 +1,144 @@ + + + + + + + + + + + {% for func_key in func_data.keys() %} + + {% set loop1 = loop %} + + + +
+ + + {%- for num, line in func_data[func_key]['python_lines'] -%} + {%- if func_data[func_key]['ir_lines'][num] %} + + {% else -%} + + {%- endif -%} + {%- endfor -%} +
+
+ + + {{num}}: + {{func_data[func_key]['python_indent'][num]}}{{line|e}} + + + + + {%- for ir_line, ir_line_type in func_data[func_key]['ir_lines'][num] %} + + + + {%- endfor -%} + +
  + {{- func_data[func_key]['python_indent'][num]}} + {{func_data[func_key]['ir_indent'][num][loop.index0]}}{{ir_line|e -}} + {{ir_line_type}} + +
+
+
+ + {{num}}: + {{func_data[func_key]['python_indent'][num]}}{{line|e}} + +
+
+ +


+ + {% endfor %} + + + + diff --git a/shared/package-files/9d/9d5434d1a3713c7a9fe19705b377bd0150caeb84c2aa53b44f37e87130000994/blob b/shared/package-files/9d/9d5434d1a3713c7a9fe19705b377bd0150caeb84c2aa53b44f37e87130000994/blob new file mode 100644 index 0000000000000000000000000000000000000000..9f639c4c1543821075666bc159eb329f49483ac8 --- /dev/null +++ b/shared/package-files/9d/9d5434d1a3713c7a9fe19705b377bd0150caeb84c2aa53b44f37e87130000994/blob @@ -0,0 +1,3348 @@ +import sys +import pytest + +import textwrap +import subprocess + +import numpy as np +import numpy.core._multiarray_tests as _multiarray_tests +from numpy import array, arange, nditer, all +from numpy.testing import ( + assert_, assert_equal, assert_array_equal, assert_raises, + IS_WASM, HAS_REFCOUNT, suppress_warnings, break_cycles + ) + + +def iter_multi_index(i): + ret = [] + while not i.finished: + ret.append(i.multi_index) + i.iternext() + return ret + +def iter_indices(i): + ret = [] + while not i.finished: + ret.append(i.index) + i.iternext() + return ret + +def iter_iterindices(i): + ret = [] + while not i.finished: + ret.append(i.iterindex) + i.iternext() + return ret + +@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts") +def test_iter_refcount(): + # Make sure the iterator doesn't leak + + # Basic + a = arange(6) + dt = np.dtype('f4').newbyteorder() + rc_a = sys.getrefcount(a) + rc_dt = sys.getrefcount(dt) + with nditer(a, [], + [['readwrite', 'updateifcopy']], + casting='unsafe', + op_dtypes=[dt]) as it: + assert_(not it.iterationneedsapi) + assert_(sys.getrefcount(a) > rc_a) + assert_(sys.getrefcount(dt) > rc_dt) + # del 'it' + it = None + assert_equal(sys.getrefcount(a), rc_a) + assert_equal(sys.getrefcount(dt), rc_dt) + + # With a copy + a = arange(6, dtype='f4') + dt = np.dtype('f4') + rc_a = sys.getrefcount(a) + rc_dt = sys.getrefcount(dt) + it = nditer(a, [], + [['readwrite']], + op_dtypes=[dt]) + rc2_a = sys.getrefcount(a) + rc2_dt = sys.getrefcount(dt) + it2 = it.copy() + assert_(sys.getrefcount(a) > rc2_a) + assert_(sys.getrefcount(dt) > rc2_dt) + it = None + assert_equal(sys.getrefcount(a), rc2_a) + assert_equal(sys.getrefcount(dt), rc2_dt) + it2 = None + assert_equal(sys.getrefcount(a), rc_a) + assert_equal(sys.getrefcount(dt), rc_dt) + + del it2 # avoid pyflakes unused variable warning + +def test_iter_best_order(): + # The iterator should always find the iteration order + # with increasing memory addresses + + # Test the ordering for 1-D to 5-D shapes + for shape in [(5,), (3, 4), (2, 3, 4), (2, 3, 4, 3), (2, 3, 2, 2, 3)]: + a = arange(np.prod(shape)) + # Test each combination of positive and negative strides + for dirs in range(2**len(shape)): + dirs_index = [slice(None)]*len(shape) + for bit in range(len(shape)): + if ((2**bit) & dirs): + dirs_index[bit] = slice(None, None, -1) + dirs_index = tuple(dirs_index) + + aview = a.reshape(shape)[dirs_index] + # C-order + i = nditer(aview, [], [['readonly']]) + assert_equal([x for x in i], a) + # Fortran-order + i = nditer(aview.T, [], [['readonly']]) + assert_equal([x for x in i], a) + # Other order + if len(shape) > 2: + i = nditer(aview.swapaxes(0, 1), [], [['readonly']]) + assert_equal([x for x in i], a) + +def test_iter_c_order(): + # Test forcing C order + + # Test the ordering for 1-D to 5-D shapes + for shape in [(5,), (3, 4), (2, 3, 4), (2, 3, 4, 3), (2, 3, 2, 2, 3)]: + a = arange(np.prod(shape)) + # Test each combination of positive and negative strides + for dirs in range(2**len(shape)): + dirs_index = [slice(None)]*len(shape) + for bit in range(len(shape)): + if ((2**bit) & dirs): + dirs_index[bit] = slice(None, None, -1) + dirs_index = tuple(dirs_index) + + aview = a.reshape(shape)[dirs_index] + # C-order + i = nditer(aview, order='C') + assert_equal([x for x in i], aview.ravel(order='C')) + # Fortran-order + i = nditer(aview.T, order='C') + assert_equal([x for x in i], aview.T.ravel(order='C')) + # Other order + if len(shape) > 2: + i = nditer(aview.swapaxes(0, 1), order='C') + assert_equal([x for x in i], + aview.swapaxes(0, 1).ravel(order='C')) + +def test_iter_f_order(): + # Test forcing F order + + # Test the ordering for 1-D to 5-D shapes + for shape in [(5,), (3, 4), (2, 3, 4), (2, 3, 4, 3), (2, 3, 2, 2, 3)]: + a = arange(np.prod(shape)) + # Test each combination of positive and negative strides + for dirs in range(2**len(shape)): + dirs_index = [slice(None)]*len(shape) + for bit in range(len(shape)): + if ((2**bit) & dirs): + dirs_index[bit] = slice(None, None, -1) + dirs_index = tuple(dirs_index) + + aview = a.reshape(shape)[dirs_index] + # C-order + i = nditer(aview, order='F') + assert_equal([x for x in i], aview.ravel(order='F')) + # Fortran-order + i = nditer(aview.T, order='F') + assert_equal([x for x in i], aview.T.ravel(order='F')) + # Other order + if len(shape) > 2: + i = nditer(aview.swapaxes(0, 1), order='F') + assert_equal([x for x in i], + aview.swapaxes(0, 1).ravel(order='F')) + +def test_iter_c_or_f_order(): + # Test forcing any contiguous (C or F) order + + # Test the ordering for 1-D to 5-D shapes + for shape in [(5,), (3, 4), (2, 3, 4), (2, 3, 4, 3), (2, 3, 2, 2, 3)]: + a = arange(np.prod(shape)) + # Test each combination of positive and negative strides + for dirs in range(2**len(shape)): + dirs_index = [slice(None)]*len(shape) + for bit in range(len(shape)): + if ((2**bit) & dirs): + dirs_index[bit] = slice(None, None, -1) + dirs_index = tuple(dirs_index) + + aview = a.reshape(shape)[dirs_index] + # C-order + i = nditer(aview, order='A') + assert_equal([x for x in i], aview.ravel(order='A')) + # Fortran-order + i = nditer(aview.T, order='A') + assert_equal([x for x in i], aview.T.ravel(order='A')) + # Other order + if len(shape) > 2: + i = nditer(aview.swapaxes(0, 1), order='A') + assert_equal([x for x in i], + aview.swapaxes(0, 1).ravel(order='A')) + +def test_nditer_multi_index_set(): + # Test the multi_index set + a = np.arange(6).reshape(2, 3) + it = np.nditer(a, flags=['multi_index']) + + # Removes the iteration on two first elements of a[0] + it.multi_index = (0, 2,) + + assert_equal([i for i in it], [2, 3, 4, 5]) + +@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts") +def test_nditer_multi_index_set_refcount(): + # Test if the reference count on index variable is decreased + + index = 0 + i = np.nditer(np.array([111, 222, 333, 444]), flags=['multi_index']) + + start_count = sys.getrefcount(index) + i.multi_index = (index,) + end_count = sys.getrefcount(index) + + assert_equal(start_count, end_count) + +def test_iter_best_order_multi_index_1d(): + # The multi-indices should be correct with any reordering + + a = arange(4) + # 1D order + i = nditer(a, ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(0,), (1,), (2,), (3,)]) + # 1D reversed order + i = nditer(a[::-1], ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(3,), (2,), (1,), (0,)]) + +def test_iter_best_order_multi_index_2d(): + # The multi-indices should be correct with any reordering + + a = arange(6) + # 2D C-order + i = nditer(a.reshape(2, 3), ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]) + # 2D Fortran-order + i = nditer(a.reshape(2, 3).copy(order='F'), ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(0, 0), (1, 0), (0, 1), (1, 1), (0, 2), (1, 2)]) + # 2D reversed C-order + i = nditer(a.reshape(2, 3)[::-1], ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(1, 0), (1, 1), (1, 2), (0, 0), (0, 1), (0, 2)]) + i = nditer(a.reshape(2, 3)[:, ::-1], ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(0, 2), (0, 1), (0, 0), (1, 2), (1, 1), (1, 0)]) + i = nditer(a.reshape(2, 3)[::-1, ::-1], ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(1, 2), (1, 1), (1, 0), (0, 2), (0, 1), (0, 0)]) + # 2D reversed Fortran-order + i = nditer(a.reshape(2, 3).copy(order='F')[::-1], ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(1, 0), (0, 0), (1, 1), (0, 1), (1, 2), (0, 2)]) + i = nditer(a.reshape(2, 3).copy(order='F')[:, ::-1], + ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(0, 2), (1, 2), (0, 1), (1, 1), (0, 0), (1, 0)]) + i = nditer(a.reshape(2, 3).copy(order='F')[::-1, ::-1], + ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), [(1, 2), (0, 2), (1, 1), (0, 1), (1, 0), (0, 0)]) + +def test_iter_best_order_multi_index_3d(): + # The multi-indices should be correct with any reordering + + a = arange(12) + # 3D C-order + i = nditer(a.reshape(2, 3, 2), ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), + [(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (0, 2, 0), (0, 2, 1), + (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1), (1, 2, 0), (1, 2, 1)]) + # 3D Fortran-order + i = nditer(a.reshape(2, 3, 2).copy(order='F'), ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), + [(0, 0, 0), (1, 0, 0), (0, 1, 0), (1, 1, 0), (0, 2, 0), (1, 2, 0), + (0, 0, 1), (1, 0, 1), (0, 1, 1), (1, 1, 1), (0, 2, 1), (1, 2, 1)]) + # 3D reversed C-order + i = nditer(a.reshape(2, 3, 2)[::-1], ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), + [(1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1), (1, 2, 0), (1, 2, 1), + (0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (0, 2, 0), (0, 2, 1)]) + i = nditer(a.reshape(2, 3, 2)[:, ::-1], ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), + [(0, 2, 0), (0, 2, 1), (0, 1, 0), (0, 1, 1), (0, 0, 0), (0, 0, 1), + (1, 2, 0), (1, 2, 1), (1, 1, 0), (1, 1, 1), (1, 0, 0), (1, 0, 1)]) + i = nditer(a.reshape(2, 3, 2)[:,:, ::-1], ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), + [(0, 0, 1), (0, 0, 0), (0, 1, 1), (0, 1, 0), (0, 2, 1), (0, 2, 0), + (1, 0, 1), (1, 0, 0), (1, 1, 1), (1, 1, 0), (1, 2, 1), (1, 2, 0)]) + # 3D reversed Fortran-order + i = nditer(a.reshape(2, 3, 2).copy(order='F')[::-1], + ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), + [(1, 0, 0), (0, 0, 0), (1, 1, 0), (0, 1, 0), (1, 2, 0), (0, 2, 0), + (1, 0, 1), (0, 0, 1), (1, 1, 1), (0, 1, 1), (1, 2, 1), (0, 2, 1)]) + i = nditer(a.reshape(2, 3, 2).copy(order='F')[:, ::-1], + ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), + [(0, 2, 0), (1, 2, 0), (0, 1, 0), (1, 1, 0), (0, 0, 0), (1, 0, 0), + (0, 2, 1), (1, 2, 1), (0, 1, 1), (1, 1, 1), (0, 0, 1), (1, 0, 1)]) + i = nditer(a.reshape(2, 3, 2).copy(order='F')[:,:, ::-1], + ['multi_index'], [['readonly']]) + assert_equal(iter_multi_index(i), + [(0, 0, 1), (1, 0, 1), (0, 1, 1), (1, 1, 1), (0, 2, 1), (1, 2, 1), + (0, 0, 0), (1, 0, 0), (0, 1, 0), (1, 1, 0), (0, 2, 0), (1, 2, 0)]) + +def test_iter_best_order_c_index_1d(): + # The C index should be correct with any reordering + + a = arange(4) + # 1D order + i = nditer(a, ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [0, 1, 2, 3]) + # 1D reversed order + i = nditer(a[::-1], ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [3, 2, 1, 0]) + +def test_iter_best_order_c_index_2d(): + # The C index should be correct with any reordering + + a = arange(6) + # 2D C-order + i = nditer(a.reshape(2, 3), ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [0, 1, 2, 3, 4, 5]) + # 2D Fortran-order + i = nditer(a.reshape(2, 3).copy(order='F'), + ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [0, 3, 1, 4, 2, 5]) + # 2D reversed C-order + i = nditer(a.reshape(2, 3)[::-1], ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [3, 4, 5, 0, 1, 2]) + i = nditer(a.reshape(2, 3)[:, ::-1], ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [2, 1, 0, 5, 4, 3]) + i = nditer(a.reshape(2, 3)[::-1, ::-1], ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [5, 4, 3, 2, 1, 0]) + # 2D reversed Fortran-order + i = nditer(a.reshape(2, 3).copy(order='F')[::-1], + ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [3, 0, 4, 1, 5, 2]) + i = nditer(a.reshape(2, 3).copy(order='F')[:, ::-1], + ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [2, 5, 1, 4, 0, 3]) + i = nditer(a.reshape(2, 3).copy(order='F')[::-1, ::-1], + ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), [5, 2, 4, 1, 3, 0]) + +def test_iter_best_order_c_index_3d(): + # The C index should be correct with any reordering + + a = arange(12) + # 3D C-order + i = nditer(a.reshape(2, 3, 2), ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) + # 3D Fortran-order + i = nditer(a.reshape(2, 3, 2).copy(order='F'), + ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), + [0, 6, 2, 8, 4, 10, 1, 7, 3, 9, 5, 11]) + # 3D reversed C-order + i = nditer(a.reshape(2, 3, 2)[::-1], ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), + [6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5]) + i = nditer(a.reshape(2, 3, 2)[:, ::-1], ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), + [4, 5, 2, 3, 0, 1, 10, 11, 8, 9, 6, 7]) + i = nditer(a.reshape(2, 3, 2)[:,:, ::-1], ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), + [1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10]) + # 3D reversed Fortran-order + i = nditer(a.reshape(2, 3, 2).copy(order='F')[::-1], + ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), + [6, 0, 8, 2, 10, 4, 7, 1, 9, 3, 11, 5]) + i = nditer(a.reshape(2, 3, 2).copy(order='F')[:, ::-1], + ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), + [4, 10, 2, 8, 0, 6, 5, 11, 3, 9, 1, 7]) + i = nditer(a.reshape(2, 3, 2).copy(order='F')[:,:, ::-1], + ['c_index'], [['readonly']]) + assert_equal(iter_indices(i), + [1, 7, 3, 9, 5, 11, 0, 6, 2, 8, 4, 10]) + +def test_iter_best_order_f_index_1d(): + # The Fortran index should be correct with any reordering + + a = arange(4) + # 1D order + i = nditer(a, ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [0, 1, 2, 3]) + # 1D reversed order + i = nditer(a[::-1], ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [3, 2, 1, 0]) + +def test_iter_best_order_f_index_2d(): + # The Fortran index should be correct with any reordering + + a = arange(6) + # 2D C-order + i = nditer(a.reshape(2, 3), ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [0, 2, 4, 1, 3, 5]) + # 2D Fortran-order + i = nditer(a.reshape(2, 3).copy(order='F'), + ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [0, 1, 2, 3, 4, 5]) + # 2D reversed C-order + i = nditer(a.reshape(2, 3)[::-1], ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [1, 3, 5, 0, 2, 4]) + i = nditer(a.reshape(2, 3)[:, ::-1], ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [4, 2, 0, 5, 3, 1]) + i = nditer(a.reshape(2, 3)[::-1, ::-1], ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [5, 3, 1, 4, 2, 0]) + # 2D reversed Fortran-order + i = nditer(a.reshape(2, 3).copy(order='F')[::-1], + ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [1, 0, 3, 2, 5, 4]) + i = nditer(a.reshape(2, 3).copy(order='F')[:, ::-1], + ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [4, 5, 2, 3, 0, 1]) + i = nditer(a.reshape(2, 3).copy(order='F')[::-1, ::-1], + ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), [5, 4, 3, 2, 1, 0]) + +def test_iter_best_order_f_index_3d(): + # The Fortran index should be correct with any reordering + + a = arange(12) + # 3D C-order + i = nditer(a.reshape(2, 3, 2), ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), + [0, 6, 2, 8, 4, 10, 1, 7, 3, 9, 5, 11]) + # 3D Fortran-order + i = nditer(a.reshape(2, 3, 2).copy(order='F'), + ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) + # 3D reversed C-order + i = nditer(a.reshape(2, 3, 2)[::-1], ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), + [1, 7, 3, 9, 5, 11, 0, 6, 2, 8, 4, 10]) + i = nditer(a.reshape(2, 3, 2)[:, ::-1], ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), + [4, 10, 2, 8, 0, 6, 5, 11, 3, 9, 1, 7]) + i = nditer(a.reshape(2, 3, 2)[:,:, ::-1], ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), + [6, 0, 8, 2, 10, 4, 7, 1, 9, 3, 11, 5]) + # 3D reversed Fortran-order + i = nditer(a.reshape(2, 3, 2).copy(order='F')[::-1], + ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), + [1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10]) + i = nditer(a.reshape(2, 3, 2).copy(order='F')[:, ::-1], + ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), + [4, 5, 2, 3, 0, 1, 10, 11, 8, 9, 6, 7]) + i = nditer(a.reshape(2, 3, 2).copy(order='F')[:,:, ::-1], + ['f_index'], [['readonly']]) + assert_equal(iter_indices(i), + [6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5]) + +def test_iter_no_inner_full_coalesce(): + # Check no_inner iterators which coalesce into a single inner loop + + for shape in [(5,), (3, 4), (2, 3, 4), (2, 3, 4, 3), (2, 3, 2, 2, 3)]: + size = np.prod(shape) + a = arange(size) + # Test each combination of forward and backwards indexing + for dirs in range(2**len(shape)): + dirs_index = [slice(None)]*len(shape) + for bit in range(len(shape)): + if ((2**bit) & dirs): + dirs_index[bit] = slice(None, None, -1) + dirs_index = tuple(dirs_index) + + aview = a.reshape(shape)[dirs_index] + # C-order + i = nditer(aview, ['external_loop'], [['readonly']]) + assert_equal(i.ndim, 1) + assert_equal(i[0].shape, (size,)) + # Fortran-order + i = nditer(aview.T, ['external_loop'], [['readonly']]) + assert_equal(i.ndim, 1) + assert_equal(i[0].shape, (size,)) + # Other order + if len(shape) > 2: + i = nditer(aview.swapaxes(0, 1), + ['external_loop'], [['readonly']]) + assert_equal(i.ndim, 1) + assert_equal(i[0].shape, (size,)) + +def test_iter_no_inner_dim_coalescing(): + # Check no_inner iterators whose dimensions may not coalesce completely + + # Skipping the last element in a dimension prevents coalescing + # with the next-bigger dimension + a = arange(24).reshape(2, 3, 4)[:,:, :-1] + i = nditer(a, ['external_loop'], [['readonly']]) + assert_equal(i.ndim, 2) + assert_equal(i[0].shape, (3,)) + a = arange(24).reshape(2, 3, 4)[:, :-1,:] + i = nditer(a, ['external_loop'], [['readonly']]) + assert_equal(i.ndim, 2) + assert_equal(i[0].shape, (8,)) + a = arange(24).reshape(2, 3, 4)[:-1,:,:] + i = nditer(a, ['external_loop'], [['readonly']]) + assert_equal(i.ndim, 1) + assert_equal(i[0].shape, (12,)) + + # Even with lots of 1-sized dimensions, should still coalesce + a = arange(24).reshape(1, 1, 2, 1, 1, 3, 1, 1, 4, 1, 1) + i = nditer(a, ['external_loop'], [['readonly']]) + assert_equal(i.ndim, 1) + assert_equal(i[0].shape, (24,)) + +def test_iter_dim_coalescing(): + # Check that the correct number of dimensions are coalesced + + # Tracking a multi-index disables coalescing + a = arange(24).reshape(2, 3, 4) + i = nditer(a, ['multi_index'], [['readonly']]) + assert_equal(i.ndim, 3) + + # A tracked index can allow coalescing if it's compatible with the array + a3d = arange(24).reshape(2, 3, 4) + i = nditer(a3d, ['c_index'], [['readonly']]) + assert_equal(i.ndim, 1) + i = nditer(a3d.swapaxes(0, 1), ['c_index'], [['readonly']]) + assert_equal(i.ndim, 3) + i = nditer(a3d.T, ['c_index'], [['readonly']]) + assert_equal(i.ndim, 3) + i = nditer(a3d.T, ['f_index'], [['readonly']]) + assert_equal(i.ndim, 1) + i = nditer(a3d.T.swapaxes(0, 1), ['f_index'], [['readonly']]) + assert_equal(i.ndim, 3) + + # When C or F order is forced, coalescing may still occur + a3d = arange(24).reshape(2, 3, 4) + i = nditer(a3d, order='C') + assert_equal(i.ndim, 1) + i = nditer(a3d.T, order='C') + assert_equal(i.ndim, 3) + i = nditer(a3d, order='F') + assert_equal(i.ndim, 3) + i = nditer(a3d.T, order='F') + assert_equal(i.ndim, 1) + i = nditer(a3d, order='A') + assert_equal(i.ndim, 1) + i = nditer(a3d.T, order='A') + assert_equal(i.ndim, 1) + +def test_iter_broadcasting(): + # Standard NumPy broadcasting rules + + # 1D with scalar + i = nditer([arange(6), np.int32(2)], ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 6) + assert_equal(i.shape, (6,)) + + # 2D with scalar + i = nditer([arange(6).reshape(2, 3), np.int32(2)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 6) + assert_equal(i.shape, (2, 3)) + # 2D with 1D + i = nditer([arange(6).reshape(2, 3), arange(3)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 6) + assert_equal(i.shape, (2, 3)) + i = nditer([arange(2).reshape(2, 1), arange(3)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 6) + assert_equal(i.shape, (2, 3)) + # 2D with 2D + i = nditer([arange(2).reshape(2, 1), arange(3).reshape(1, 3)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 6) + assert_equal(i.shape, (2, 3)) + + # 3D with scalar + i = nditer([np.int32(2), arange(24).reshape(4, 2, 3)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 24) + assert_equal(i.shape, (4, 2, 3)) + # 3D with 1D + i = nditer([arange(3), arange(24).reshape(4, 2, 3)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 24) + assert_equal(i.shape, (4, 2, 3)) + i = nditer([arange(3), arange(8).reshape(4, 2, 1)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 24) + assert_equal(i.shape, (4, 2, 3)) + # 3D with 2D + i = nditer([arange(6).reshape(2, 3), arange(24).reshape(4, 2, 3)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 24) + assert_equal(i.shape, (4, 2, 3)) + i = nditer([arange(2).reshape(2, 1), arange(24).reshape(4, 2, 3)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 24) + assert_equal(i.shape, (4, 2, 3)) + i = nditer([arange(3).reshape(1, 3), arange(8).reshape(4, 2, 1)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 24) + assert_equal(i.shape, (4, 2, 3)) + # 3D with 3D + i = nditer([arange(2).reshape(1, 2, 1), arange(3).reshape(1, 1, 3), + arange(4).reshape(4, 1, 1)], + ['multi_index'], [['readonly']]*3) + assert_equal(i.itersize, 24) + assert_equal(i.shape, (4, 2, 3)) + i = nditer([arange(6).reshape(1, 2, 3), arange(4).reshape(4, 1, 1)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 24) + assert_equal(i.shape, (4, 2, 3)) + i = nditer([arange(24).reshape(4, 2, 3), arange(12).reshape(4, 1, 3)], + ['multi_index'], [['readonly']]*2) + assert_equal(i.itersize, 24) + assert_equal(i.shape, (4, 2, 3)) + +def test_iter_itershape(): + # Check that allocated outputs work with a specified shape + a = np.arange(6, dtype='i2').reshape(2, 3) + i = nditer([a, None], [], [['readonly'], ['writeonly', 'allocate']], + op_axes=[[0, 1, None], None], + itershape=(-1, -1, 4)) + assert_equal(i.operands[1].shape, (2, 3, 4)) + assert_equal(i.operands[1].strides, (24, 8, 2)) + + i = nditer([a.T, None], [], [['readonly'], ['writeonly', 'allocate']], + op_axes=[[0, 1, None], None], + itershape=(-1, -1, 4)) + assert_equal(i.operands[1].shape, (3, 2, 4)) + assert_equal(i.operands[1].strides, (8, 24, 2)) + + i = nditer([a.T, None], [], [['readonly'], ['writeonly', 'allocate']], + order='F', + op_axes=[[0, 1, None], None], + itershape=(-1, -1, 4)) + assert_equal(i.operands[1].shape, (3, 2, 4)) + assert_equal(i.operands[1].strides, (2, 6, 12)) + + # If we specify 1 in the itershape, it shouldn't allow broadcasting + # of that dimension to a bigger value + assert_raises(ValueError, nditer, [a, None], [], + [['readonly'], ['writeonly', 'allocate']], + op_axes=[[0, 1, None], None], + itershape=(-1, 1, 4)) + # Test bug that for no op_axes but itershape, they are NULLed correctly + i = np.nditer([np.ones(2), None, None], itershape=(2,)) + +def test_iter_broadcasting_errors(): + # Check that errors are thrown for bad broadcasting shapes + + # 1D with 1D + assert_raises(ValueError, nditer, [arange(2), arange(3)], + [], [['readonly']]*2) + # 2D with 1D + assert_raises(ValueError, nditer, + [arange(6).reshape(2, 3), arange(2)], + [], [['readonly']]*2) + # 2D with 2D + assert_raises(ValueError, nditer, + [arange(6).reshape(2, 3), arange(9).reshape(3, 3)], + [], [['readonly']]*2) + assert_raises(ValueError, nditer, + [arange(6).reshape(2, 3), arange(4).reshape(2, 2)], + [], [['readonly']]*2) + # 3D with 3D + assert_raises(ValueError, nditer, + [arange(36).reshape(3, 3, 4), arange(24).reshape(2, 3, 4)], + [], [['readonly']]*2) + assert_raises(ValueError, nditer, + [arange(8).reshape(2, 4, 1), arange(24).reshape(2, 3, 4)], + [], [['readonly']]*2) + + # Verify that the error message mentions the right shapes + try: + nditer([arange(2).reshape(1, 2, 1), + arange(3).reshape(1, 3), + arange(6).reshape(2, 3)], + [], + [['readonly'], ['readonly'], ['writeonly', 'no_broadcast']]) + raise AssertionError('Should have raised a broadcast error') + except ValueError as e: + msg = str(e) + # The message should contain the shape of the 3rd operand + assert_(msg.find('(2,3)') >= 0, + 'Message "%s" doesn\'t contain operand shape (2,3)' % msg) + # The message should contain the broadcast shape + assert_(msg.find('(1,2,3)') >= 0, + 'Message "%s" doesn\'t contain broadcast shape (1,2,3)' % msg) + + try: + nditer([arange(6).reshape(2, 3), arange(2)], + [], + [['readonly'], ['readonly']], + op_axes=[[0, 1], [0, np.newaxis]], + itershape=(4, 3)) + raise AssertionError('Should have raised a broadcast error') + except ValueError as e: + msg = str(e) + # The message should contain "shape->remappedshape" for each operand + assert_(msg.find('(2,3)->(2,3)') >= 0, + 'Message "%s" doesn\'t contain operand shape (2,3)->(2,3)' % msg) + assert_(msg.find('(2,)->(2,newaxis)') >= 0, + ('Message "%s" doesn\'t contain remapped operand shape' + + '(2,)->(2,newaxis)') % msg) + # The message should contain the itershape parameter + assert_(msg.find('(4,3)') >= 0, + 'Message "%s" doesn\'t contain itershape parameter (4,3)' % msg) + + try: + nditer([np.zeros((2, 1, 1)), np.zeros((2,))], + [], + [['writeonly', 'no_broadcast'], ['readonly']]) + raise AssertionError('Should have raised a broadcast error') + except ValueError as e: + msg = str(e) + # The message should contain the shape of the bad operand + assert_(msg.find('(2,1,1)') >= 0, + 'Message "%s" doesn\'t contain operand shape (2,1,1)' % msg) + # The message should contain the broadcast shape + assert_(msg.find('(2,1,2)') >= 0, + 'Message "%s" doesn\'t contain the broadcast shape (2,1,2)' % msg) + +def test_iter_flags_errors(): + # Check that bad combinations of flags produce errors + + a = arange(6) + + # Not enough operands + assert_raises(ValueError, nditer, [], [], []) + # Too many operands + assert_raises(ValueError, nditer, [a]*100, [], [['readonly']]*100) + # Bad global flag + assert_raises(ValueError, nditer, [a], ['bad flag'], [['readonly']]) + # Bad op flag + assert_raises(ValueError, nditer, [a], [], [['readonly', 'bad flag']]) + # Bad order parameter + assert_raises(ValueError, nditer, [a], [], [['readonly']], order='G') + # Bad casting parameter + assert_raises(ValueError, nditer, [a], [], [['readonly']], casting='noon') + # op_flags must match ops + assert_raises(ValueError, nditer, [a]*3, [], [['readonly']]*2) + # Cannot track both a C and an F index + assert_raises(ValueError, nditer, a, + ['c_index', 'f_index'], [['readonly']]) + # Inner iteration and multi-indices/indices are incompatible + assert_raises(ValueError, nditer, a, + ['external_loop', 'multi_index'], [['readonly']]) + assert_raises(ValueError, nditer, a, + ['external_loop', 'c_index'], [['readonly']]) + assert_raises(ValueError, nditer, a, + ['external_loop', 'f_index'], [['readonly']]) + # Must specify exactly one of readwrite/readonly/writeonly per operand + assert_raises(ValueError, nditer, a, [], [[]]) + assert_raises(ValueError, nditer, a, [], [['readonly', 'writeonly']]) + assert_raises(ValueError, nditer, a, [], [['readonly', 'readwrite']]) + assert_raises(ValueError, nditer, a, [], [['writeonly', 'readwrite']]) + assert_raises(ValueError, nditer, a, + [], [['readonly', 'writeonly', 'readwrite']]) + # Python scalars are always readonly + assert_raises(TypeError, nditer, 1.5, [], [['writeonly']]) + assert_raises(TypeError, nditer, 1.5, [], [['readwrite']]) + # Array scalars are always readonly + assert_raises(TypeError, nditer, np.int32(1), [], [['writeonly']]) + assert_raises(TypeError, nditer, np.int32(1), [], [['readwrite']]) + # Check readonly array + a.flags.writeable = False + assert_raises(ValueError, nditer, a, [], [['writeonly']]) + assert_raises(ValueError, nditer, a, [], [['readwrite']]) + a.flags.writeable = True + # Multi-indices available only with the multi_index flag + i = nditer(arange(6), [], [['readonly']]) + assert_raises(ValueError, lambda i:i.multi_index, i) + # Index available only with an index flag + assert_raises(ValueError, lambda i:i.index, i) + # GotoCoords and GotoIndex incompatible with buffering or no_inner + + def assign_multi_index(i): + i.multi_index = (0,) + + def assign_index(i): + i.index = 0 + + def assign_iterindex(i): + i.iterindex = 0 + + def assign_iterrange(i): + i.iterrange = (0, 1) + i = nditer(arange(6), ['external_loop']) + assert_raises(ValueError, assign_multi_index, i) + assert_raises(ValueError, assign_index, i) + assert_raises(ValueError, assign_iterindex, i) + assert_raises(ValueError, assign_iterrange, i) + i = nditer(arange(6), ['buffered']) + assert_raises(ValueError, assign_multi_index, i) + assert_raises(ValueError, assign_index, i) + assert_raises(ValueError, assign_iterrange, i) + # Can't iterate if size is zero + assert_raises(ValueError, nditer, np.array([])) + +def test_iter_slice(): + a, b, c = np.arange(3), np.arange(3), np.arange(3.) + i = nditer([a, b, c], [], ['readwrite']) + with i: + i[0:2] = (3, 3) + assert_equal(a, [3, 1, 2]) + assert_equal(b, [3, 1, 2]) + assert_equal(c, [0, 1, 2]) + i[1] = 12 + assert_equal(i[0:2], [3, 12]) + +def test_iter_assign_mapping(): + a = np.arange(24, dtype='f8').reshape(2, 3, 4).T + it = np.nditer(a, [], [['readwrite', 'updateifcopy']], + casting='same_kind', op_dtypes=[np.dtype('f4')]) + with it: + it.operands[0][...] = 3 + it.operands[0][...] = 14 + assert_equal(a, 14) + it = np.nditer(a, [], [['readwrite', 'updateifcopy']], + casting='same_kind', op_dtypes=[np.dtype('f4')]) + with it: + x = it.operands[0][-1:1] + x[...] = 14 + it.operands[0][...] = -1234 + assert_equal(a, -1234) + # check for no warnings on dealloc + x = None + it = None + +def test_iter_nbo_align_contig(): + # Check that byte order, alignment, and contig changes work + + # Byte order change by requesting a specific dtype + a = np.arange(6, dtype='f4') + au = a.byteswap().newbyteorder() + assert_(a.dtype.byteorder != au.dtype.byteorder) + i = nditer(au, [], [['readwrite', 'updateifcopy']], + casting='equiv', + op_dtypes=[np.dtype('f4')]) + with i: + # context manager triggers WRITEBACKIFCOPY on i at exit + assert_equal(i.dtypes[0].byteorder, a.dtype.byteorder) + assert_equal(i.operands[0].dtype.byteorder, a.dtype.byteorder) + assert_equal(i.operands[0], a) + i.operands[0][:] = 2 + assert_equal(au, [2]*6) + del i # should not raise a warning + # Byte order change by requesting NBO + a = np.arange(6, dtype='f4') + au = a.byteswap().newbyteorder() + assert_(a.dtype.byteorder != au.dtype.byteorder) + with nditer(au, [], [['readwrite', 'updateifcopy', 'nbo']], + casting='equiv') as i: + # context manager triggers UPDATEIFCOPY on i at exit + assert_equal(i.dtypes[0].byteorder, a.dtype.byteorder) + assert_equal(i.operands[0].dtype.byteorder, a.dtype.byteorder) + assert_equal(i.operands[0], a) + i.operands[0][:] = 12345 + i.operands[0][:] = 2 + assert_equal(au, [2]*6) + + # Unaligned input + a = np.zeros((6*4+1,), dtype='i1')[1:] + a.dtype = 'f4' + a[:] = np.arange(6, dtype='f4') + assert_(not a.flags.aligned) + # Without 'aligned', shouldn't copy + i = nditer(a, [], [['readonly']]) + assert_(not i.operands[0].flags.aligned) + assert_equal(i.operands[0], a) + # With 'aligned', should make a copy + with nditer(a, [], [['readwrite', 'updateifcopy', 'aligned']]) as i: + assert_(i.operands[0].flags.aligned) + # context manager triggers UPDATEIFCOPY on i at exit + assert_equal(i.operands[0], a) + i.operands[0][:] = 3 + assert_equal(a, [3]*6) + + # Discontiguous input + a = arange(12) + # If it is contiguous, shouldn't copy + i = nditer(a[:6], [], [['readonly']]) + assert_(i.operands[0].flags.contiguous) + assert_equal(i.operands[0], a[:6]) + # If it isn't contiguous, should buffer + i = nditer(a[::2], ['buffered', 'external_loop'], + [['readonly', 'contig']], + buffersize=10) + assert_(i[0].flags.contiguous) + assert_equal(i[0], a[::2]) + +def test_iter_array_cast(): + # Check that arrays are cast as requested + + # No cast 'f4' -> 'f4' + a = np.arange(6, dtype='f4').reshape(2, 3) + i = nditer(a, [], [['readwrite']], op_dtypes=[np.dtype('f4')]) + with i: + assert_equal(i.operands[0], a) + assert_equal(i.operands[0].dtype, np.dtype('f4')) + + # Byte-order cast ' '>f4' + a = np.arange(6, dtype='f4')]) as i: + assert_equal(i.operands[0], a) + assert_equal(i.operands[0].dtype, np.dtype('>f4')) + + # Safe case 'f4' -> 'f8' + a = np.arange(24, dtype='f4').reshape(2, 3, 4).swapaxes(1, 2) + i = nditer(a, [], [['readonly', 'copy']], + casting='safe', + op_dtypes=[np.dtype('f8')]) + assert_equal(i.operands[0], a) + assert_equal(i.operands[0].dtype, np.dtype('f8')) + # The memory layout of the temporary should match a (a is (48,4,16)) + # except negative strides get flipped to positive strides. + assert_equal(i.operands[0].strides, (96, 8, 32)) + a = a[::-1,:, ::-1] + i = nditer(a, [], [['readonly', 'copy']], + casting='safe', + op_dtypes=[np.dtype('f8')]) + assert_equal(i.operands[0], a) + assert_equal(i.operands[0].dtype, np.dtype('f8')) + assert_equal(i.operands[0].strides, (96, 8, 32)) + + # Same-kind cast 'f8' -> 'f4' -> 'f8' + a = np.arange(24, dtype='f8').reshape(2, 3, 4).T + with nditer(a, [], + [['readwrite', 'updateifcopy']], + casting='same_kind', + op_dtypes=[np.dtype('f4')]) as i: + assert_equal(i.operands[0], a) + assert_equal(i.operands[0].dtype, np.dtype('f4')) + assert_equal(i.operands[0].strides, (4, 16, 48)) + # Check that WRITEBACKIFCOPY is activated at exit + i.operands[0][2, 1, 1] = -12.5 + assert_(a[2, 1, 1] != -12.5) + assert_equal(a[2, 1, 1], -12.5) + + a = np.arange(6, dtype='i4')[::-2] + with nditer(a, [], + [['writeonly', 'updateifcopy']], + casting='unsafe', + op_dtypes=[np.dtype('f4')]) as i: + assert_equal(i.operands[0].dtype, np.dtype('f4')) + # Even though the stride was negative in 'a', it + # becomes positive in the temporary + assert_equal(i.operands[0].strides, (4,)) + i.operands[0][:] = [1, 2, 3] + assert_equal(a, [1, 2, 3]) + +def test_iter_array_cast_errors(): + # Check that invalid casts are caught + + # Need to enable copying for casts to occur + assert_raises(TypeError, nditer, arange(2, dtype='f4'), [], + [['readonly']], op_dtypes=[np.dtype('f8')]) + # Also need to allow casting for casts to occur + assert_raises(TypeError, nditer, arange(2, dtype='f4'), [], + [['readonly', 'copy']], casting='no', + op_dtypes=[np.dtype('f8')]) + assert_raises(TypeError, nditer, arange(2, dtype='f4'), [], + [['readonly', 'copy']], casting='equiv', + op_dtypes=[np.dtype('f8')]) + assert_raises(TypeError, nditer, arange(2, dtype='f8'), [], + [['writeonly', 'updateifcopy']], + casting='no', + op_dtypes=[np.dtype('f4')]) + assert_raises(TypeError, nditer, arange(2, dtype='f8'), [], + [['writeonly', 'updateifcopy']], + casting='equiv', + op_dtypes=[np.dtype('f4')]) + # ' '>f4' should not work with casting='no' + assert_raises(TypeError, nditer, arange(2, dtype='f4')]) + # 'f4' -> 'f8' is a safe cast, but 'f8' -> 'f4' isn't + assert_raises(TypeError, nditer, arange(2, dtype='f4'), [], + [['readwrite', 'updateifcopy']], + casting='safe', + op_dtypes=[np.dtype('f8')]) + assert_raises(TypeError, nditer, arange(2, dtype='f8'), [], + [['readwrite', 'updateifcopy']], + casting='safe', + op_dtypes=[np.dtype('f4')]) + # 'f4' -> 'i4' is neither a safe nor a same-kind cast + assert_raises(TypeError, nditer, arange(2, dtype='f4'), [], + [['readonly', 'copy']], + casting='same_kind', + op_dtypes=[np.dtype('i4')]) + assert_raises(TypeError, nditer, arange(2, dtype='i4'), [], + [['writeonly', 'updateifcopy']], + casting='same_kind', + op_dtypes=[np.dtype('f4')]) + +def test_iter_scalar_cast(): + # Check that scalars are cast as requested + + # No cast 'f4' -> 'f4' + i = nditer(np.float32(2.5), [], [['readonly']], + op_dtypes=[np.dtype('f4')]) + assert_equal(i.dtypes[0], np.dtype('f4')) + assert_equal(i.value.dtype, np.dtype('f4')) + assert_equal(i.value, 2.5) + # Safe cast 'f4' -> 'f8' + i = nditer(np.float32(2.5), [], + [['readonly', 'copy']], + casting='safe', + op_dtypes=[np.dtype('f8')]) + assert_equal(i.dtypes[0], np.dtype('f8')) + assert_equal(i.value.dtype, np.dtype('f8')) + assert_equal(i.value, 2.5) + # Same-kind cast 'f8' -> 'f4' + i = nditer(np.float64(2.5), [], + [['readonly', 'copy']], + casting='same_kind', + op_dtypes=[np.dtype('f4')]) + assert_equal(i.dtypes[0], np.dtype('f4')) + assert_equal(i.value.dtype, np.dtype('f4')) + assert_equal(i.value, 2.5) + # Unsafe cast 'f8' -> 'i4' + i = nditer(np.float64(3.0), [], + [['readonly', 'copy']], + casting='unsafe', + op_dtypes=[np.dtype('i4')]) + assert_equal(i.dtypes[0], np.dtype('i4')) + assert_equal(i.value.dtype, np.dtype('i4')) + assert_equal(i.value, 3) + # Readonly scalars may be cast even without setting COPY or BUFFERED + i = nditer(3, [], [['readonly']], op_dtypes=[np.dtype('f8')]) + assert_equal(i[0].dtype, np.dtype('f8')) + assert_equal(i[0], 3.) + +def test_iter_scalar_cast_errors(): + # Check that invalid casts are caught + + # Need to allow copying/buffering for write casts of scalars to occur + assert_raises(TypeError, nditer, np.float32(2), [], + [['readwrite']], op_dtypes=[np.dtype('f8')]) + assert_raises(TypeError, nditer, 2.5, [], + [['readwrite']], op_dtypes=[np.dtype('f4')]) + # 'f8' -> 'f4' isn't a safe cast if the value would overflow + assert_raises(TypeError, nditer, np.float64(1e60), [], + [['readonly']], + casting='safe', + op_dtypes=[np.dtype('f4')]) + # 'f4' -> 'i4' is neither a safe nor a same-kind cast + assert_raises(TypeError, nditer, np.float32(2), [], + [['readonly']], + casting='same_kind', + op_dtypes=[np.dtype('i4')]) + +def test_iter_object_arrays_basic(): + # Check that object arrays work + + obj = {'a':3,'b':'d'} + a = np.array([[1, 2, 3], None, obj, None], dtype='O') + if HAS_REFCOUNT: + rc = sys.getrefcount(obj) + + # Need to allow references for object arrays + assert_raises(TypeError, nditer, a) + if HAS_REFCOUNT: + assert_equal(sys.getrefcount(obj), rc) + + i = nditer(a, ['refs_ok'], ['readonly']) + vals = [x_[()] for x_ in i] + assert_equal(np.array(vals, dtype='O'), a) + vals, i, x = [None]*3 + if HAS_REFCOUNT: + assert_equal(sys.getrefcount(obj), rc) + + i = nditer(a.reshape(2, 2).T, ['refs_ok', 'buffered'], + ['readonly'], order='C') + assert_(i.iterationneedsapi) + vals = [x_[()] for x_ in i] + assert_equal(np.array(vals, dtype='O'), a.reshape(2, 2).ravel(order='F')) + vals, i, x = [None]*3 + if HAS_REFCOUNT: + assert_equal(sys.getrefcount(obj), rc) + + i = nditer(a.reshape(2, 2).T, ['refs_ok', 'buffered'], + ['readwrite'], order='C') + with i: + for x in i: + x[...] = None + vals, i, x = [None]*3 + if HAS_REFCOUNT: + assert_(sys.getrefcount(obj) == rc-1) + assert_equal(a, np.array([None]*4, dtype='O')) + +def test_iter_object_arrays_conversions(): + # Conversions to/from objects + a = np.arange(6, dtype='O') + i = nditer(a, ['refs_ok', 'buffered'], ['readwrite'], + casting='unsafe', op_dtypes='i4') + with i: + for x in i: + x[...] += 1 + assert_equal(a, np.arange(6)+1) + + a = np.arange(6, dtype='i4') + i = nditer(a, ['refs_ok', 'buffered'], ['readwrite'], + casting='unsafe', op_dtypes='O') + with i: + for x in i: + x[...] += 1 + assert_equal(a, np.arange(6)+1) + + # Non-contiguous object array + a = np.zeros((6,), dtype=[('p', 'i1'), ('a', 'O')]) + a = a['a'] + a[:] = np.arange(6) + i = nditer(a, ['refs_ok', 'buffered'], ['readwrite'], + casting='unsafe', op_dtypes='i4') + with i: + for x in i: + x[...] += 1 + assert_equal(a, np.arange(6)+1) + + #Non-contiguous value array + a = np.zeros((6,), dtype=[('p', 'i1'), ('a', 'i4')]) + a = a['a'] + a[:] = np.arange(6) + 98172488 + i = nditer(a, ['refs_ok', 'buffered'], ['readwrite'], + casting='unsafe', op_dtypes='O') + with i: + ob = i[0][()] + if HAS_REFCOUNT: + rc = sys.getrefcount(ob) + for x in i: + x[...] += 1 + if HAS_REFCOUNT: + assert_(sys.getrefcount(ob) == rc-1) + assert_equal(a, np.arange(6)+98172489) + +def test_iter_common_dtype(): + # Check that the iterator finds a common data type correctly + + i = nditer([array([3], dtype='f4'), array([0], dtype='f8')], + ['common_dtype'], + [['readonly', 'copy']]*2, + casting='safe') + assert_equal(i.dtypes[0], np.dtype('f8')) + assert_equal(i.dtypes[1], np.dtype('f8')) + i = nditer([array([3], dtype='i4'), array([0], dtype='f4')], + ['common_dtype'], + [['readonly', 'copy']]*2, + casting='safe') + assert_equal(i.dtypes[0], np.dtype('f8')) + assert_equal(i.dtypes[1], np.dtype('f8')) + i = nditer([array([3], dtype='f4'), array(0, dtype='f8')], + ['common_dtype'], + [['readonly', 'copy']]*2, + casting='same_kind') + assert_equal(i.dtypes[0], np.dtype('f4')) + assert_equal(i.dtypes[1], np.dtype('f4')) + i = nditer([array([3], dtype='u4'), array(0, dtype='i4')], + ['common_dtype'], + [['readonly', 'copy']]*2, + casting='safe') + assert_equal(i.dtypes[0], np.dtype('u4')) + assert_equal(i.dtypes[1], np.dtype('u4')) + i = nditer([array([3], dtype='u4'), array(-12, dtype='i4')], + ['common_dtype'], + [['readonly', 'copy']]*2, + casting='safe') + assert_equal(i.dtypes[0], np.dtype('i8')) + assert_equal(i.dtypes[1], np.dtype('i8')) + i = nditer([array([3], dtype='u4'), array(-12, dtype='i4'), + array([2j], dtype='c8'), array([9], dtype='f8')], + ['common_dtype'], + [['readonly', 'copy']]*4, + casting='safe') + assert_equal(i.dtypes[0], np.dtype('c16')) + assert_equal(i.dtypes[1], np.dtype('c16')) + assert_equal(i.dtypes[2], np.dtype('c16')) + assert_equal(i.dtypes[3], np.dtype('c16')) + assert_equal(i.value, (3, -12, 2j, 9)) + + # When allocating outputs, other outputs aren't factored in + i = nditer([array([3], dtype='i4'), None, array([2j], dtype='c16')], [], + [['readonly', 'copy'], + ['writeonly', 'allocate'], + ['writeonly']], + casting='safe') + assert_equal(i.dtypes[0], np.dtype('i4')) + assert_equal(i.dtypes[1], np.dtype('i4')) + assert_equal(i.dtypes[2], np.dtype('c16')) + # But, if common data types are requested, they are + i = nditer([array([3], dtype='i4'), None, array([2j], dtype='c16')], + ['common_dtype'], + [['readonly', 'copy'], + ['writeonly', 'allocate'], + ['writeonly']], + casting='safe') + assert_equal(i.dtypes[0], np.dtype('c16')) + assert_equal(i.dtypes[1], np.dtype('c16')) + assert_equal(i.dtypes[2], np.dtype('c16')) + +def test_iter_copy_if_overlap(): + # Ensure the iterator makes copies on read/write overlap, if requested + + # Copy not needed, 1 op + for flag in ['readonly', 'writeonly', 'readwrite']: + a = arange(10) + i = nditer([a], ['copy_if_overlap'], [[flag]]) + with i: + assert_(i.operands[0] is a) + + # Copy needed, 2 ops, read-write overlap + x = arange(10) + a = x[1:] + b = x[:-1] + with nditer([a, b], ['copy_if_overlap'], [['readonly'], ['readwrite']]) as i: + assert_(not np.shares_memory(*i.operands)) + + # Copy not needed with elementwise, 2 ops, exactly same arrays + x = arange(10) + a = x + b = x + i = nditer([a, b], ['copy_if_overlap'], [['readonly', 'overlap_assume_elementwise'], + ['readwrite', 'overlap_assume_elementwise']]) + with i: + assert_(i.operands[0] is a and i.operands[1] is b) + with nditer([a, b], ['copy_if_overlap'], [['readonly'], ['readwrite']]) as i: + assert_(i.operands[0] is a and not np.shares_memory(i.operands[1], b)) + + # Copy not needed, 2 ops, no overlap + x = arange(10) + a = x[::2] + b = x[1::2] + i = nditer([a, b], ['copy_if_overlap'], [['readonly'], ['writeonly']]) + assert_(i.operands[0] is a and i.operands[1] is b) + + # Copy needed, 2 ops, read-write overlap + x = arange(4, dtype=np.int8) + a = x[3:] + b = x.view(np.int32)[:1] + with nditer([a, b], ['copy_if_overlap'], [['readonly'], ['writeonly']]) as i: + assert_(not np.shares_memory(*i.operands)) + + # Copy needed, 3 ops, read-write overlap + for flag in ['writeonly', 'readwrite']: + x = np.ones([10, 10]) + a = x + b = x.T + c = x + with nditer([a, b, c], ['copy_if_overlap'], + [['readonly'], ['readonly'], [flag]]) as i: + a2, b2, c2 = i.operands + assert_(not np.shares_memory(a2, c2)) + assert_(not np.shares_memory(b2, c2)) + + # Copy not needed, 3 ops, read-only overlap + x = np.ones([10, 10]) + a = x + b = x.T + c = x + i = nditer([a, b, c], ['copy_if_overlap'], + [['readonly'], ['readonly'], ['readonly']]) + a2, b2, c2 = i.operands + assert_(a is a2) + assert_(b is b2) + assert_(c is c2) + + # Copy not needed, 3 ops, read-only overlap + x = np.ones([10, 10]) + a = x + b = np.ones([10, 10]) + c = x.T + i = nditer([a, b, c], ['copy_if_overlap'], + [['readonly'], ['writeonly'], ['readonly']]) + a2, b2, c2 = i.operands + assert_(a is a2) + assert_(b is b2) + assert_(c is c2) + + # Copy not needed, 3 ops, write-only overlap + x = np.arange(7) + a = x[:3] + b = x[3:6] + c = x[4:7] + i = nditer([a, b, c], ['copy_if_overlap'], + [['readonly'], ['writeonly'], ['writeonly']]) + a2, b2, c2 = i.operands + assert_(a is a2) + assert_(b is b2) + assert_(c is c2) + +def test_iter_op_axes(): + # Check that custom axes work + + # Reverse the axes + a = arange(6).reshape(2, 3) + i = nditer([a, a.T], [], [['readonly']]*2, op_axes=[[0, 1], [1, 0]]) + assert_(all([x == y for (x, y) in i])) + a = arange(24).reshape(2, 3, 4) + i = nditer([a.T, a], [], [['readonly']]*2, op_axes=[[2, 1, 0], None]) + assert_(all([x == y for (x, y) in i])) + + # Broadcast 1D to any dimension + a = arange(1, 31).reshape(2, 3, 5) + b = arange(1, 3) + i = nditer([a, b], [], [['readonly']]*2, op_axes=[None, [0, -1, -1]]) + assert_equal([x*y for (x, y) in i], (a*b.reshape(2, 1, 1)).ravel()) + b = arange(1, 4) + i = nditer([a, b], [], [['readonly']]*2, op_axes=[None, [-1, 0, -1]]) + assert_equal([x*y for (x, y) in i], (a*b.reshape(1, 3, 1)).ravel()) + b = arange(1, 6) + i = nditer([a, b], [], [['readonly']]*2, + op_axes=[None, [np.newaxis, np.newaxis, 0]]) + assert_equal([x*y for (x, y) in i], (a*b.reshape(1, 1, 5)).ravel()) + + # Inner product-style broadcasting + a = arange(24).reshape(2, 3, 4) + b = arange(40).reshape(5, 2, 4) + i = nditer([a, b], ['multi_index'], [['readonly']]*2, + op_axes=[[0, 1, -1, -1], [-1, -1, 0, 1]]) + assert_equal(i.shape, (2, 3, 5, 2)) + + # Matrix product-style broadcasting + a = arange(12).reshape(3, 4) + b = arange(20).reshape(4, 5) + i = nditer([a, b], ['multi_index'], [['readonly']]*2, + op_axes=[[0, -1], [-1, 1]]) + assert_equal(i.shape, (3, 5)) + +def test_iter_op_axes_errors(): + # Check that custom axes throws errors for bad inputs + + # Wrong number of items in op_axes + a = arange(6).reshape(2, 3) + assert_raises(ValueError, nditer, [a, a], [], [['readonly']]*2, + op_axes=[[0], [1], [0]]) + # Out of bounds items in op_axes + assert_raises(ValueError, nditer, [a, a], [], [['readonly']]*2, + op_axes=[[2, 1], [0, 1]]) + assert_raises(ValueError, nditer, [a, a], [], [['readonly']]*2, + op_axes=[[0, 1], [2, -1]]) + # Duplicate items in op_axes + assert_raises(ValueError, nditer, [a, a], [], [['readonly']]*2, + op_axes=[[0, 0], [0, 1]]) + assert_raises(ValueError, nditer, [a, a], [], [['readonly']]*2, + op_axes=[[0, 1], [1, 1]]) + + # Different sized arrays in op_axes + assert_raises(ValueError, nditer, [a, a], [], [['readonly']]*2, + op_axes=[[0, 1], [0, 1, 0]]) + + # Non-broadcastable dimensions in the result + assert_raises(ValueError, nditer, [a, a], [], [['readonly']]*2, + op_axes=[[0, 1], [1, 0]]) + +def test_iter_copy(): + # Check that copying the iterator works correctly + a = arange(24).reshape(2, 3, 4) + + # Simple iterator + i = nditer(a) + j = i.copy() + assert_equal([x[()] for x in i], [x[()] for x in j]) + + i.iterindex = 3 + j = i.copy() + assert_equal([x[()] for x in i], [x[()] for x in j]) + + # Buffered iterator + i = nditer(a, ['buffered', 'ranged'], order='F', buffersize=3) + j = i.copy() + assert_equal([x[()] for x in i], [x[()] for x in j]) + + i.iterindex = 3 + j = i.copy() + assert_equal([x[()] for x in i], [x[()] for x in j]) + + i.iterrange = (3, 9) + j = i.copy() + assert_equal([x[()] for x in i], [x[()] for x in j]) + + i.iterrange = (2, 18) + next(i) + next(i) + j = i.copy() + assert_equal([x[()] for x in i], [x[()] for x in j]) + + # Casting iterator + with nditer(a, ['buffered'], order='F', casting='unsafe', + op_dtypes='f8', buffersize=5) as i: + j = i.copy() + assert_equal([x[()] for x in j], a.ravel(order='F')) + + a = arange(24, dtype=' unstructured (any to object), and many other + # casts, which cause this to require all steps in the casting machinery + # one level down as well as the iterator copy (which uses NpyAuxData clone) + in_dtype = np.dtype([("a", np.dtype("i,")), + ("b", np.dtype(">i,d,S17,>d,(3)f,O,i1"))]) + out_dtype = np.dtype([("a", np.dtype("O")), + ("b", np.dtype(">i,>i,S17,>d,>U3,(3)d,i1,O"))]) + arr = np.ones(1000, dtype=in_dtype) + + it = np.nditer((arr,), ["buffered", "external_loop", "refs_ok"], + op_dtypes=[out_dtype], casting="unsafe") + it_copy = it.copy() + + res1 = next(it) + del it + res2 = next(it_copy) + del it_copy + + expected = arr["a"].astype(out_dtype["a"]) + assert_array_equal(res1["a"], expected) + assert_array_equal(res2["a"], expected) + + for field in in_dtype["b"].names: + # Note that the .base avoids the subarray field + expected = arr["b"][field].astype(out_dtype["b"][field].base) + assert_array_equal(res1["b"][field], expected) + assert_array_equal(res2["b"][field], expected) + + +def test_iter_copy_casts_structured2(): + # Similar to the above, this is a fairly arcane test to cover internals + in_dtype = np.dtype([("a", np.dtype("O,O")), + ("b", np.dtype("(5)O,(3)O,(1,)O,(1,)i,(1,)O"))]) + out_dtype = np.dtype([("a", np.dtype("O")), + ("b", np.dtype("O,(3)i,(4)O,(4)O,(4)i"))]) + + arr = np.ones(1, dtype=in_dtype) + it = np.nditer((arr,), ["buffered", "external_loop", "refs_ok"], + op_dtypes=[out_dtype], casting="unsafe") + it_copy = it.copy() + + res1 = next(it) + del it + res2 = next(it_copy) + del it_copy + + # Array of two structured scalars: + for res in res1, res2: + # Cast to tuple by getitem, which may be weird and changable?: + assert type(res["a"][0]) == tuple + assert res["a"][0] == (1, 1) + + for res in res1, res2: + assert_array_equal(res["b"]["f0"][0], np.ones(5, dtype=object)) + assert_array_equal(res["b"]["f1"], np.ones((1, 3), dtype="i")) + assert res["b"]["f2"].shape == (1, 4) + assert_array_equal(res["b"]["f2"][0], np.ones(4, dtype=object)) + assert_array_equal(res["b"]["f3"][0], np.ones(4, dtype=object)) + assert_array_equal(res["b"]["f3"][0], np.ones(4, dtype="i")) + + +def test_iter_allocate_output_simple(): + # Check that the iterator will properly allocate outputs + + # Simple case + a = arange(6) + i = nditer([a, None], [], [['readonly'], ['writeonly', 'allocate']], + op_dtypes=[None, np.dtype('f4')]) + assert_equal(i.operands[1].shape, a.shape) + assert_equal(i.operands[1].dtype, np.dtype('f4')) + +def test_iter_allocate_output_buffered_readwrite(): + # Allocated output with buffering + delay_bufalloc + + a = arange(6) + i = nditer([a, None], ['buffered', 'delay_bufalloc'], + [['readonly'], ['allocate', 'readwrite']]) + with i: + i.operands[1][:] = 1 + i.reset() + for x in i: + x[1][...] += x[0][...] + assert_equal(i.operands[1], a+1) + +def test_iter_allocate_output_itorder(): + # The allocated output should match the iteration order + + # C-order input, best iteration order + a = arange(6, dtype='i4').reshape(2, 3) + i = nditer([a, None], [], [['readonly'], ['writeonly', 'allocate']], + op_dtypes=[None, np.dtype('f4')]) + assert_equal(i.operands[1].shape, a.shape) + assert_equal(i.operands[1].strides, a.strides) + assert_equal(i.operands[1].dtype, np.dtype('f4')) + # F-order input, best iteration order + a = arange(24, dtype='i4').reshape(2, 3, 4).T + i = nditer([a, None], [], [['readonly'], ['writeonly', 'allocate']], + op_dtypes=[None, np.dtype('f4')]) + assert_equal(i.operands[1].shape, a.shape) + assert_equal(i.operands[1].strides, a.strides) + assert_equal(i.operands[1].dtype, np.dtype('f4')) + # Non-contiguous input, C iteration order + a = arange(24, dtype='i4').reshape(2, 3, 4).swapaxes(0, 1) + i = nditer([a, None], [], + [['readonly'], ['writeonly', 'allocate']], + order='C', + op_dtypes=[None, np.dtype('f4')]) + assert_equal(i.operands[1].shape, a.shape) + assert_equal(i.operands[1].strides, (32, 16, 4)) + assert_equal(i.operands[1].dtype, np.dtype('f4')) + +def test_iter_allocate_output_opaxes(): + # Specifying op_axes should work + + a = arange(24, dtype='i4').reshape(2, 3, 4) + i = nditer([None, a], [], [['writeonly', 'allocate'], ['readonly']], + op_dtypes=[np.dtype('u4'), None], + op_axes=[[1, 2, 0], None]) + assert_equal(i.operands[0].shape, (4, 2, 3)) + assert_equal(i.operands[0].strides, (4, 48, 16)) + assert_equal(i.operands[0].dtype, np.dtype('u4')) + +def test_iter_allocate_output_types_promotion(): + # Check type promotion of automatic outputs + + i = nditer([array([3], dtype='f4'), array([0], dtype='f8'), None], [], + [['readonly']]*2+[['writeonly', 'allocate']]) + assert_equal(i.dtypes[2], np.dtype('f8')) + i = nditer([array([3], dtype='i4'), array([0], dtype='f4'), None], [], + [['readonly']]*2+[['writeonly', 'allocate']]) + assert_equal(i.dtypes[2], np.dtype('f8')) + i = nditer([array([3], dtype='f4'), array(0, dtype='f8'), None], [], + [['readonly']]*2+[['writeonly', 'allocate']]) + assert_equal(i.dtypes[2], np.dtype('f4')) + i = nditer([array([3], dtype='u4'), array(0, dtype='i4'), None], [], + [['readonly']]*2+[['writeonly', 'allocate']]) + assert_equal(i.dtypes[2], np.dtype('u4')) + i = nditer([array([3], dtype='u4'), array(-12, dtype='i4'), None], [], + [['readonly']]*2+[['writeonly', 'allocate']]) + assert_equal(i.dtypes[2], np.dtype('i8')) + +def test_iter_allocate_output_types_byte_order(): + # Verify the rules for byte order changes + + # When there's just one input, the output type exactly matches + a = array([3], dtype='u4').newbyteorder() + i = nditer([a, None], [], + [['readonly'], ['writeonly', 'allocate']]) + assert_equal(i.dtypes[0], i.dtypes[1]) + # With two or more inputs, the output type is in native byte order + i = nditer([a, a, None], [], + [['readonly'], ['readonly'], ['writeonly', 'allocate']]) + assert_(i.dtypes[0] != i.dtypes[2]) + assert_equal(i.dtypes[0].newbyteorder('='), i.dtypes[2]) + +def test_iter_allocate_output_types_scalar(): + # If the inputs are all scalars, the output should be a scalar + + i = nditer([None, 1, 2.3, np.float32(12), np.complex128(3)], [], + [['writeonly', 'allocate']] + [['readonly']]*4) + assert_equal(i.operands[0].dtype, np.dtype('complex128')) + assert_equal(i.operands[0].ndim, 0) + +def test_iter_allocate_output_subtype(): + # Make sure that the subtype with priority wins + class MyNDArray(np.ndarray): + __array_priority__ = 15 + + # subclass vs ndarray + a = np.array([[1, 2], [3, 4]]).view(MyNDArray) + b = np.arange(4).reshape(2, 2).T + i = nditer([a, b, None], [], + [['readonly'], ['readonly'], ['writeonly', 'allocate']]) + assert_equal(type(a), type(i.operands[2])) + assert_(type(b) is not type(i.operands[2])) + assert_equal(i.operands[2].shape, (2, 2)) + + # If subtypes are disabled, we should get back an ndarray. + i = nditer([a, b, None], [], + [['readonly'], ['readonly'], + ['writeonly', 'allocate', 'no_subtype']]) + assert_equal(type(b), type(i.operands[2])) + assert_(type(a) is not type(i.operands[2])) + assert_equal(i.operands[2].shape, (2, 2)) + +def test_iter_allocate_output_errors(): + # Check that the iterator will throw errors for bad output allocations + + # Need an input if no output data type is specified + a = arange(6) + assert_raises(TypeError, nditer, [a, None], [], + [['writeonly'], ['writeonly', 'allocate']]) + # Allocated output should be flagged for writing + assert_raises(ValueError, nditer, [a, None], [], + [['readonly'], ['allocate', 'readonly']]) + # Allocated output can't have buffering without delayed bufalloc + assert_raises(ValueError, nditer, [a, None], ['buffered'], + ['allocate', 'readwrite']) + # Must specify dtype if there are no inputs (cannot promote existing ones; + # maybe this should use the 'f4' here, but it does not historically.) + assert_raises(TypeError, nditer, [None, None], [], + [['writeonly', 'allocate'], + ['writeonly', 'allocate']], + op_dtypes=[None, np.dtype('f4')]) + # If using op_axes, must specify all the axes + a = arange(24, dtype='i4').reshape(2, 3, 4) + assert_raises(ValueError, nditer, [a, None], [], + [['readonly'], ['writeonly', 'allocate']], + op_dtypes=[None, np.dtype('f4')], + op_axes=[None, [0, np.newaxis, 1]]) + # If using op_axes, the axes must be within bounds + assert_raises(ValueError, nditer, [a, None], [], + [['readonly'], ['writeonly', 'allocate']], + op_dtypes=[None, np.dtype('f4')], + op_axes=[None, [0, 3, 1]]) + # If using op_axes, there can't be duplicates + assert_raises(ValueError, nditer, [a, None], [], + [['readonly'], ['writeonly', 'allocate']], + op_dtypes=[None, np.dtype('f4')], + op_axes=[None, [0, 2, 1, 0]]) + # Not all axes may be specified if a reduction. If there is a hole + # in op_axes, this is an error. + a = arange(24, dtype='i4').reshape(2, 3, 4) + assert_raises(ValueError, nditer, [a, None], ["reduce_ok"], + [['readonly'], ['readwrite', 'allocate']], + op_dtypes=[None, np.dtype('f4')], + op_axes=[None, [0, np.newaxis, 2]]) + +def test_all_allocated(): + # When no output and no shape is given, `()` is used as shape. + i = np.nditer([None], op_dtypes=["int64"]) + assert i.operands[0].shape == () + assert i.dtypes == (np.dtype("int64"),) + + i = np.nditer([None], op_dtypes=["int64"], itershape=(2, 3, 4)) + assert i.operands[0].shape == (2, 3, 4) + +def test_iter_remove_axis(): + a = arange(24).reshape(2, 3, 4) + + i = nditer(a, ['multi_index']) + i.remove_axis(1) + assert_equal([x for x in i], a[:, 0,:].ravel()) + + a = a[::-1,:,:] + i = nditer(a, ['multi_index']) + i.remove_axis(0) + assert_equal([x for x in i], a[0,:,:].ravel()) + +def test_iter_remove_multi_index_inner_loop(): + # Check that removing multi-index support works + + a = arange(24).reshape(2, 3, 4) + + i = nditer(a, ['multi_index']) + assert_equal(i.ndim, 3) + assert_equal(i.shape, (2, 3, 4)) + assert_equal(i.itviews[0].shape, (2, 3, 4)) + + # Removing the multi-index tracking causes all dimensions to coalesce + before = [x for x in i] + i.remove_multi_index() + after = [x for x in i] + + assert_equal(before, after) + assert_equal(i.ndim, 1) + assert_raises(ValueError, lambda i:i.shape, i) + assert_equal(i.itviews[0].shape, (24,)) + + # Removing the inner loop means there's just one iteration + i.reset() + assert_equal(i.itersize, 24) + assert_equal(i[0].shape, tuple()) + i.enable_external_loop() + assert_equal(i.itersize, 24) + assert_equal(i[0].shape, (24,)) + assert_equal(i.value, arange(24)) + +def test_iter_iterindex(): + # Make sure iterindex works + + buffersize = 5 + a = arange(24).reshape(4, 3, 2) + for flags in ([], ['buffered']): + i = nditer(a, flags, buffersize=buffersize) + assert_equal(iter_iterindices(i), list(range(24))) + i.iterindex = 2 + assert_equal(iter_iterindices(i), list(range(2, 24))) + + i = nditer(a, flags, order='F', buffersize=buffersize) + assert_equal(iter_iterindices(i), list(range(24))) + i.iterindex = 5 + assert_equal(iter_iterindices(i), list(range(5, 24))) + + i = nditer(a[::-1], flags, order='F', buffersize=buffersize) + assert_equal(iter_iterindices(i), list(range(24))) + i.iterindex = 9 + assert_equal(iter_iterindices(i), list(range(9, 24))) + + i = nditer(a[::-1, ::-1], flags, order='C', buffersize=buffersize) + assert_equal(iter_iterindices(i), list(range(24))) + i.iterindex = 13 + assert_equal(iter_iterindices(i), list(range(13, 24))) + + i = nditer(a[::1, ::-1], flags, buffersize=buffersize) + assert_equal(iter_iterindices(i), list(range(24))) + i.iterindex = 23 + assert_equal(iter_iterindices(i), list(range(23, 24))) + i.reset() + i.iterindex = 2 + assert_equal(iter_iterindices(i), list(range(2, 24))) + +def test_iter_iterrange(): + # Make sure getting and resetting the iterrange works + + buffersize = 5 + a = arange(24, dtype='i4').reshape(4, 3, 2) + a_fort = a.ravel(order='F') + + i = nditer(a, ['ranged'], ['readonly'], order='F', + buffersize=buffersize) + assert_equal(i.iterrange, (0, 24)) + assert_equal([x[()] for x in i], a_fort) + for r in [(0, 24), (1, 2), (3, 24), (5, 5), (0, 20), (23, 24)]: + i.iterrange = r + assert_equal(i.iterrange, r) + assert_equal([x[()] for x in i], a_fort[r[0]:r[1]]) + + i = nditer(a, ['ranged', 'buffered'], ['readonly'], order='F', + op_dtypes='f8', buffersize=buffersize) + assert_equal(i.iterrange, (0, 24)) + assert_equal([x[()] for x in i], a_fort) + for r in [(0, 24), (1, 2), (3, 24), (5, 5), (0, 20), (23, 24)]: + i.iterrange = r + assert_equal(i.iterrange, r) + assert_equal([x[()] for x in i], a_fort[r[0]:r[1]]) + + def get_array(i): + val = np.array([], dtype='f8') + for x in i: + val = np.concatenate((val, x)) + return val + + i = nditer(a, ['ranged', 'buffered', 'external_loop'], + ['readonly'], order='F', + op_dtypes='f8', buffersize=buffersize) + assert_equal(i.iterrange, (0, 24)) + assert_equal(get_array(i), a_fort) + for r in [(0, 24), (1, 2), (3, 24), (5, 5), (0, 20), (23, 24)]: + i.iterrange = r + assert_equal(i.iterrange, r) + assert_equal(get_array(i), a_fort[r[0]:r[1]]) + +def test_iter_buffering(): + # Test buffering with several buffer sizes and types + arrays = [] + # F-order swapped array + arrays.append(np.arange(24, + dtype='c16').reshape(2, 3, 4).T.newbyteorder().byteswap()) + # Contiguous 1-dimensional array + arrays.append(np.arange(10, dtype='f4')) + # Unaligned array + a = np.zeros((4*16+1,), dtype='i1')[1:] + a.dtype = 'i4' + a[:] = np.arange(16, dtype='i4') + arrays.append(a) + # 4-D F-order array + arrays.append(np.arange(120, dtype='i4').reshape(5, 3, 2, 4).T) + for a in arrays: + for buffersize in (1, 2, 3, 5, 8, 11, 16, 1024): + vals = [] + i = nditer(a, ['buffered', 'external_loop'], + [['readonly', 'nbo', 'aligned']], + order='C', + casting='equiv', + buffersize=buffersize) + while not i.finished: + assert_(i[0].size <= buffersize) + vals.append(i[0].copy()) + i.iternext() + assert_equal(np.concatenate(vals), a.ravel(order='C')) + +def test_iter_write_buffering(): + # Test that buffering of writes is working + + # F-order swapped array + a = np.arange(24).reshape(2, 3, 4).T.newbyteorder().byteswap() + i = nditer(a, ['buffered'], + [['readwrite', 'nbo', 'aligned']], + casting='equiv', + order='C', + buffersize=16) + x = 0 + with i: + while not i.finished: + i[0] = x + x += 1 + i.iternext() + assert_equal(a.ravel(order='C'), np.arange(24)) + +def test_iter_buffering_delayed_alloc(): + # Test that delaying buffer allocation works + + a = np.arange(6) + b = np.arange(1, dtype='f4') + i = nditer([a, b], ['buffered', 'delay_bufalloc', 'multi_index', 'reduce_ok'], + ['readwrite'], + casting='unsafe', + op_dtypes='f4') + assert_(i.has_delayed_bufalloc) + assert_raises(ValueError, lambda i:i.multi_index, i) + assert_raises(ValueError, lambda i:i[0], i) + assert_raises(ValueError, lambda i:i[0:2], i) + + def assign_iter(i): + i[0] = 0 + assert_raises(ValueError, assign_iter, i) + + i.reset() + assert_(not i.has_delayed_bufalloc) + assert_equal(i.multi_index, (0,)) + with i: + assert_equal(i[0], 0) + i[1] = 1 + assert_equal(i[0:2], [0, 1]) + assert_equal([[x[0][()], x[1][()]] for x in i], list(zip(range(6), [1]*6))) + +def test_iter_buffered_cast_simple(): + # Test that buffering can handle a simple cast + + a = np.arange(10, dtype='f4') + i = nditer(a, ['buffered', 'external_loop'], + [['readwrite', 'nbo', 'aligned']], + casting='same_kind', + op_dtypes=[np.dtype('f8')], + buffersize=3) + with i: + for v in i: + v[...] *= 2 + + assert_equal(a, 2*np.arange(10, dtype='f4')) + +def test_iter_buffered_cast_byteswapped(): + # Test that buffering can handle a cast which requires swap->cast->swap + + a = np.arange(10, dtype='f4').newbyteorder().byteswap() + i = nditer(a, ['buffered', 'external_loop'], + [['readwrite', 'nbo', 'aligned']], + casting='same_kind', + op_dtypes=[np.dtype('f8').newbyteorder()], + buffersize=3) + with i: + for v in i: + v[...] *= 2 + + assert_equal(a, 2*np.arange(10, dtype='f4')) + + with suppress_warnings() as sup: + sup.filter(np.ComplexWarning) + + a = np.arange(10, dtype='f8').newbyteorder().byteswap() + i = nditer(a, ['buffered', 'external_loop'], + [['readwrite', 'nbo', 'aligned']], + casting='unsafe', + op_dtypes=[np.dtype('c8').newbyteorder()], + buffersize=3) + with i: + for v in i: + v[...] *= 2 + + assert_equal(a, 2*np.arange(10, dtype='f8')) + +def test_iter_buffered_cast_byteswapped_complex(): + # Test that buffering can handle a cast which requires swap->cast->copy + + a = np.arange(10, dtype='c8').newbyteorder().byteswap() + a += 2j + i = nditer(a, ['buffered', 'external_loop'], + [['readwrite', 'nbo', 'aligned']], + casting='same_kind', + op_dtypes=[np.dtype('c16')], + buffersize=3) + with i: + for v in i: + v[...] *= 2 + assert_equal(a, 2*np.arange(10, dtype='c8') + 4j) + + a = np.arange(10, dtype='c8') + a += 2j + i = nditer(a, ['buffered', 'external_loop'], + [['readwrite', 'nbo', 'aligned']], + casting='same_kind', + op_dtypes=[np.dtype('c16').newbyteorder()], + buffersize=3) + with i: + for v in i: + v[...] *= 2 + assert_equal(a, 2*np.arange(10, dtype='c8') + 4j) + + a = np.arange(10, dtype=np.clongdouble).newbyteorder().byteswap() + a += 2j + i = nditer(a, ['buffered', 'external_loop'], + [['readwrite', 'nbo', 'aligned']], + casting='same_kind', + op_dtypes=[np.dtype('c16')], + buffersize=3) + with i: + for v in i: + v[...] *= 2 + assert_equal(a, 2*np.arange(10, dtype=np.clongdouble) + 4j) + + a = np.arange(10, dtype=np.longdouble).newbyteorder().byteswap() + i = nditer(a, ['buffered', 'external_loop'], + [['readwrite', 'nbo', 'aligned']], + casting='same_kind', + op_dtypes=[np.dtype('f4')], + buffersize=7) + with i: + for v in i: + v[...] *= 2 + assert_equal(a, 2*np.arange(10, dtype=np.longdouble)) + +def test_iter_buffered_cast_structured_type(): + # Tests buffering of structured types + + # simple -> struct type (duplicates the value) + sdt = [('a', 'f4'), ('b', 'i8'), ('c', 'c8', (2, 3)), ('d', 'O')] + a = np.arange(3, dtype='f4') + 0.5 + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt) + vals = [np.array(x) for x in i] + assert_equal(vals[0]['a'], 0.5) + assert_equal(vals[0]['b'], 0) + assert_equal(vals[0]['c'], [[(0.5)]*3]*2) + assert_equal(vals[0]['d'], 0.5) + assert_equal(vals[1]['a'], 1.5) + assert_equal(vals[1]['b'], 1) + assert_equal(vals[1]['c'], [[(1.5)]*3]*2) + assert_equal(vals[1]['d'], 1.5) + assert_equal(vals[0].dtype, np.dtype(sdt)) + + # object -> struct type + sdt = [('a', 'f4'), ('b', 'i8'), ('c', 'c8', (2, 3)), ('d', 'O')] + a = np.zeros((3,), dtype='O') + a[0] = (0.5, 0.5, [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]], 0.5) + a[1] = (1.5, 1.5, [[1.5, 1.5, 1.5], [1.5, 1.5, 1.5]], 1.5) + a[2] = (2.5, 2.5, [[2.5, 2.5, 2.5], [2.5, 2.5, 2.5]], 2.5) + if HAS_REFCOUNT: + rc = sys.getrefcount(a[0]) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt) + vals = [x.copy() for x in i] + assert_equal(vals[0]['a'], 0.5) + assert_equal(vals[0]['b'], 0) + assert_equal(vals[0]['c'], [[(0.5)]*3]*2) + assert_equal(vals[0]['d'], 0.5) + assert_equal(vals[1]['a'], 1.5) + assert_equal(vals[1]['b'], 1) + assert_equal(vals[1]['c'], [[(1.5)]*3]*2) + assert_equal(vals[1]['d'], 1.5) + assert_equal(vals[0].dtype, np.dtype(sdt)) + vals, i, x = [None]*3 + if HAS_REFCOUNT: + assert_equal(sys.getrefcount(a[0]), rc) + + # single-field struct type -> simple + sdt = [('a', 'f4')] + a = np.array([(5.5,), (8,)], dtype=sdt) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes='i4') + assert_equal([x_[()] for x_ in i], [5, 8]) + + # make sure multi-field struct type -> simple doesn't work + sdt = [('a', 'f4'), ('b', 'i8'), ('d', 'O')] + a = np.array([(5.5, 7, 'test'), (8, 10, 11)], dtype=sdt) + assert_raises(TypeError, lambda: ( + nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes='i4'))) + + # struct type -> struct type (field-wise copy) + sdt1 = [('a', 'f4'), ('b', 'i8'), ('d', 'O')] + sdt2 = [('d', 'u2'), ('a', 'O'), ('b', 'f8')] + a = np.array([(1, 2, 3), (4, 5, 6)], dtype=sdt1) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + assert_equal([np.array(x_) for x_ in i], + [np.array((1, 2, 3), dtype=sdt2), + np.array((4, 5, 6), dtype=sdt2)]) + + +def test_iter_buffered_cast_structured_type_failure_with_cleanup(): + # make sure struct type -> struct type with different + # number of fields fails + sdt1 = [('a', 'f4'), ('b', 'i8'), ('d', 'O')] + sdt2 = [('b', 'O'), ('a', 'f8')] + a = np.array([(1, 2, 3), (4, 5, 6)], dtype=sdt1) + + for intent in ["readwrite", "readonly", "writeonly"]: + # This test was initially designed to test an error at a different + # place, but will now raise earlier to to the cast not being possible: + # `assert np.can_cast(a.dtype, sdt2, casting="unsafe")` fails. + # Without a faulty DType, there is probably no reliable + # way to get the initial tested behaviour. + simple_arr = np.array([1, 2], dtype="i,i") # requires clean up + with pytest.raises(TypeError): + nditer((simple_arr, a), ['buffered', 'refs_ok'], [intent, intent], + casting='unsafe', op_dtypes=["f,f", sdt2]) + + +def test_buffered_cast_error_paths(): + with pytest.raises(ValueError): + # The input is cast into an `S3` buffer + np.nditer((np.array("a", dtype="S1"),), op_dtypes=["i"], + casting="unsafe", flags=["buffered"]) + + # The `M8[ns]` is cast into the `S3` output + it = np.nditer((np.array(1, dtype="i"),), op_dtypes=["S1"], + op_flags=["writeonly"], casting="unsafe", flags=["buffered"]) + with pytest.raises(ValueError): + with it: + buf = next(it) + buf[...] = "a" # cannot be converted to int. + +@pytest.mark.skipif(IS_WASM, reason="Cannot start subprocess") +@pytest.mark.skipif(not HAS_REFCOUNT, reason="PyPy seems to not hit this.") +def test_buffered_cast_error_paths_unraisable(): + # The following gives an unraisable error. Pytest sometimes captures that + # (depending python and/or pytest version). So with Python>=3.8 this can + # probably be cleaned out in the future to check for + # pytest.PytestUnraisableExceptionWarning: + code = textwrap.dedent(""" + import numpy as np + + it = np.nditer((np.array(1, dtype="i"),), op_dtypes=["S1"], + op_flags=["writeonly"], casting="unsafe", flags=["buffered"]) + buf = next(it) + buf[...] = "a" + del buf, it # Flushing only happens during deallocate right now. + """) + res = subprocess.check_output([sys.executable, "-c", code], + stderr=subprocess.STDOUT, text=True) + assert "ValueError" in res + + +def test_iter_buffered_cast_subarray(): + # Tests buffering of subarrays + + # one element -> many (copies it to all) + sdt1 = [('a', 'f4')] + sdt2 = [('a', 'f8', (3, 2, 2))] + a = np.zeros((6,), dtype=sdt1) + a['a'] = np.arange(6) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + for x, count in zip(i, list(range(6))): + assert_(np.all(x['a'] == count)) + + # one element -> many -> back (copies it to all) + sdt1 = [('a', 'O', (1, 1))] + sdt2 = [('a', 'O', (3, 2, 2))] + a = np.zeros((6,), dtype=sdt1) + a['a'][:, 0, 0] = np.arange(6) + i = nditer(a, ['buffered', 'refs_ok'], ['readwrite'], + casting='unsafe', + op_dtypes=sdt2) + with i: + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_(np.all(x['a'] == count)) + x['a'][0] += 2 + count += 1 + assert_equal(a['a'], np.arange(6).reshape(6, 1, 1)+2) + + # many -> one element -> back (copies just element 0) + sdt1 = [('a', 'O', (3, 2, 2))] + sdt2 = [('a', 'O', (1,))] + a = np.zeros((6,), dtype=sdt1) + a['a'][:, 0, 0, 0] = np.arange(6) + i = nditer(a, ['buffered', 'refs_ok'], ['readwrite'], + casting='unsafe', + op_dtypes=sdt2) + with i: + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_equal(x['a'], count) + x['a'] += 2 + count += 1 + assert_equal(a['a'], np.arange(6).reshape(6, 1, 1, 1)*np.ones((1, 3, 2, 2))+2) + + # many -> one element -> back (copies just element 0) + sdt1 = [('a', 'f8', (3, 2, 2))] + sdt2 = [('a', 'O', (1,))] + a = np.zeros((6,), dtype=sdt1) + a['a'][:, 0, 0, 0] = np.arange(6) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_equal(x['a'], count) + count += 1 + + # many -> one element (copies just element 0) + sdt1 = [('a', 'O', (3, 2, 2))] + sdt2 = [('a', 'f4', (1,))] + a = np.zeros((6,), dtype=sdt1) + a['a'][:, 0, 0, 0] = np.arange(6) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_equal(x['a'], count) + count += 1 + + # many -> matching shape (straightforward copy) + sdt1 = [('a', 'O', (3, 2, 2))] + sdt2 = [('a', 'f4', (3, 2, 2))] + a = np.zeros((6,), dtype=sdt1) + a['a'] = np.arange(6*3*2*2).reshape(6, 3, 2, 2) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_equal(x['a'], a[count]['a']) + count += 1 + + # vector -> smaller vector (truncates) + sdt1 = [('a', 'f8', (6,))] + sdt2 = [('a', 'f4', (2,))] + a = np.zeros((6,), dtype=sdt1) + a['a'] = np.arange(6*6).reshape(6, 6) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_equal(x['a'], a[count]['a'][:2]) + count += 1 + + # vector -> bigger vector (pads with zeros) + sdt1 = [('a', 'f8', (2,))] + sdt2 = [('a', 'f4', (6,))] + a = np.zeros((6,), dtype=sdt1) + a['a'] = np.arange(6*2).reshape(6, 2) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_equal(x['a'][:2], a[count]['a']) + assert_equal(x['a'][2:], [0, 0, 0, 0]) + count += 1 + + # vector -> matrix (broadcasts) + sdt1 = [('a', 'f8', (2,))] + sdt2 = [('a', 'f4', (2, 2))] + a = np.zeros((6,), dtype=sdt1) + a['a'] = np.arange(6*2).reshape(6, 2) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_equal(x['a'][0], a[count]['a']) + assert_equal(x['a'][1], a[count]['a']) + count += 1 + + # vector -> matrix (broadcasts and zero-pads) + sdt1 = [('a', 'f8', (2, 1))] + sdt2 = [('a', 'f4', (3, 2))] + a = np.zeros((6,), dtype=sdt1) + a['a'] = np.arange(6*2).reshape(6, 2, 1) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_equal(x['a'][:2, 0], a[count]['a'][:, 0]) + assert_equal(x['a'][:2, 1], a[count]['a'][:, 0]) + assert_equal(x['a'][2,:], [0, 0]) + count += 1 + + # matrix -> matrix (truncates and zero-pads) + sdt1 = [('a', 'f8', (2, 3))] + sdt2 = [('a', 'f4', (3, 2))] + a = np.zeros((6,), dtype=sdt1) + a['a'] = np.arange(6*2*3).reshape(6, 2, 3) + i = nditer(a, ['buffered', 'refs_ok'], ['readonly'], + casting='unsafe', + op_dtypes=sdt2) + assert_equal(i[0].dtype, np.dtype(sdt2)) + count = 0 + for x in i: + assert_equal(x['a'][:2, 0], a[count]['a'][:, 0]) + assert_equal(x['a'][:2, 1], a[count]['a'][:, 1]) + assert_equal(x['a'][2,:], [0, 0]) + count += 1 + +def test_iter_buffering_badwriteback(): + # Writing back from a buffer cannot combine elements + + # a needs write buffering, but had a broadcast dimension + a = np.arange(6).reshape(2, 3, 1) + b = np.arange(12).reshape(2, 3, 2) + assert_raises(ValueError, nditer, [a, b], + ['buffered', 'external_loop'], + [['readwrite'], ['writeonly']], + order='C') + + # But if a is readonly, it's fine + nditer([a, b], ['buffered', 'external_loop'], + [['readonly'], ['writeonly']], + order='C') + + # If a has just one element, it's fine too (constant 0 stride, a reduction) + a = np.arange(1).reshape(1, 1, 1) + nditer([a, b], ['buffered', 'external_loop', 'reduce_ok'], + [['readwrite'], ['writeonly']], + order='C') + + # check that it fails on other dimensions too + a = np.arange(6).reshape(1, 3, 2) + assert_raises(ValueError, nditer, [a, b], + ['buffered', 'external_loop'], + [['readwrite'], ['writeonly']], + order='C') + a = np.arange(4).reshape(2, 1, 2) + assert_raises(ValueError, nditer, [a, b], + ['buffered', 'external_loop'], + [['readwrite'], ['writeonly']], + order='C') + +def test_iter_buffering_string(): + # Safe casting disallows shrinking strings + a = np.array(['abc', 'a', 'abcd'], dtype=np.bytes_) + assert_equal(a.dtype, np.dtype('S4')) + assert_raises(TypeError, nditer, a, ['buffered'], ['readonly'], + op_dtypes='S2') + i = nditer(a, ['buffered'], ['readonly'], op_dtypes='S6') + assert_equal(i[0], b'abc') + assert_equal(i[0].dtype, np.dtype('S6')) + + a = np.array(['abc', 'a', 'abcd'], dtype=np.str_) + assert_equal(a.dtype, np.dtype('U4')) + assert_raises(TypeError, nditer, a, ['buffered'], ['readonly'], + op_dtypes='U2') + i = nditer(a, ['buffered'], ['readonly'], op_dtypes='U6') + assert_equal(i[0], 'abc') + assert_equal(i[0].dtype, np.dtype('U6')) + +def test_iter_buffering_growinner(): + # Test that the inner loop grows when no buffering is needed + a = np.arange(30) + i = nditer(a, ['buffered', 'growinner', 'external_loop'], + buffersize=5) + # Should end up with just one inner loop here + assert_equal(i[0].size, a.size) + + +@pytest.mark.slow +def test_iter_buffered_reduce_reuse(): + # large enough array for all views, including negative strides. + a = np.arange(2*3**5)[3**5:3**5+1] + flags = ['buffered', 'delay_bufalloc', 'multi_index', 'reduce_ok', 'refs_ok'] + op_flags = [('readonly',), ('readwrite', 'allocate')] + op_axes_list = [[(0, 1, 2), (0, 1, -1)], [(0, 1, 2), (0, -1, -1)]] + # wrong dtype to force buffering + op_dtypes = [float, a.dtype] + + def get_params(): + for xs in range(-3**2, 3**2 + 1): + for ys in range(xs, 3**2 + 1): + for op_axes in op_axes_list: + # last stride is reduced and because of that not + # important for this test, as it is the inner stride. + strides = (xs * a.itemsize, ys * a.itemsize, a.itemsize) + arr = np.lib.stride_tricks.as_strided(a, (3, 3, 3), strides) + + for skip in [0, 1]: + yield arr, op_axes, skip + + for arr, op_axes, skip in get_params(): + nditer2 = np.nditer([arr.copy(), None], + op_axes=op_axes, flags=flags, op_flags=op_flags, + op_dtypes=op_dtypes) + with nditer2: + nditer2.operands[-1][...] = 0 + nditer2.reset() + nditer2.iterindex = skip + + for (a2_in, b2_in) in nditer2: + b2_in += a2_in.astype(np.int_) + + comp_res = nditer2.operands[-1] + + for bufsize in range(0, 3**3): + nditer1 = np.nditer([arr, None], + op_axes=op_axes, flags=flags, op_flags=op_flags, + buffersize=bufsize, op_dtypes=op_dtypes) + with nditer1: + nditer1.operands[-1][...] = 0 + nditer1.reset() + nditer1.iterindex = skip + + for (a1_in, b1_in) in nditer1: + b1_in += a1_in.astype(np.int_) + + res = nditer1.operands[-1] + assert_array_equal(res, comp_res) + + +def test_iter_no_broadcast(): + # Test that the no_broadcast flag works + a = np.arange(24).reshape(2, 3, 4) + b = np.arange(6).reshape(2, 3, 1) + c = np.arange(12).reshape(3, 4) + + nditer([a, b, c], [], + [['readonly', 'no_broadcast'], + ['readonly'], ['readonly']]) + assert_raises(ValueError, nditer, [a, b, c], [], + [['readonly'], ['readonly', 'no_broadcast'], ['readonly']]) + assert_raises(ValueError, nditer, [a, b, c], [], + [['readonly'], ['readonly'], ['readonly', 'no_broadcast']]) + + +class TestIterNested: + + def test_basic(self): + # Test nested iteration basic usage + a = arange(12).reshape(2, 3, 2) + + i, j = np.nested_iters(a, [[0], [1, 2]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 1, 2, 3, 4, 5], [6, 7, 8, 9, 10, 11]]) + + i, j = np.nested_iters(a, [[0, 1], [2]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]) + + i, j = np.nested_iters(a, [[0, 2], [1]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 2, 4], [1, 3, 5], [6, 8, 10], [7, 9, 11]]) + + def test_reorder(self): + # Test nested iteration basic usage + a = arange(12).reshape(2, 3, 2) + + # In 'K' order (default), it gets reordered + i, j = np.nested_iters(a, [[0], [2, 1]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 1, 2, 3, 4, 5], [6, 7, 8, 9, 10, 11]]) + + i, j = np.nested_iters(a, [[1, 0], [2]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]) + + i, j = np.nested_iters(a, [[2, 0], [1]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 2, 4], [1, 3, 5], [6, 8, 10], [7, 9, 11]]) + + # In 'C' order, it doesn't + i, j = np.nested_iters(a, [[0], [2, 1]], order='C') + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 2, 4, 1, 3, 5], [6, 8, 10, 7, 9, 11]]) + + i, j = np.nested_iters(a, [[1, 0], [2]], order='C') + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 1], [6, 7], [2, 3], [8, 9], [4, 5], [10, 11]]) + + i, j = np.nested_iters(a, [[2, 0], [1]], order='C') + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 2, 4], [6, 8, 10], [1, 3, 5], [7, 9, 11]]) + + def test_flip_axes(self): + # Test nested iteration with negative axes + a = arange(12).reshape(2, 3, 2)[::-1, ::-1, ::-1] + + # In 'K' order (default), the axes all get flipped + i, j = np.nested_iters(a, [[0], [1, 2]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 1, 2, 3, 4, 5], [6, 7, 8, 9, 10, 11]]) + + i, j = np.nested_iters(a, [[0, 1], [2]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]) + + i, j = np.nested_iters(a, [[0, 2], [1]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 2, 4], [1, 3, 5], [6, 8, 10], [7, 9, 11]]) + + # In 'C' order, flipping axes is disabled + i, j = np.nested_iters(a, [[0], [1, 2]], order='C') + vals = [list(j) for _ in i] + assert_equal(vals, [[11, 10, 9, 8, 7, 6], [5, 4, 3, 2, 1, 0]]) + + i, j = np.nested_iters(a, [[0, 1], [2]], order='C') + vals = [list(j) for _ in i] + assert_equal(vals, [[11, 10], [9, 8], [7, 6], [5, 4], [3, 2], [1, 0]]) + + i, j = np.nested_iters(a, [[0, 2], [1]], order='C') + vals = [list(j) for _ in i] + assert_equal(vals, [[11, 9, 7], [10, 8, 6], [5, 3, 1], [4, 2, 0]]) + + def test_broadcast(self): + # Test nested iteration with broadcasting + a = arange(2).reshape(2, 1) + b = arange(3).reshape(1, 3) + + i, j = np.nested_iters([a, b], [[0], [1]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[[0, 0], [0, 1], [0, 2]], [[1, 0], [1, 1], [1, 2]]]) + + i, j = np.nested_iters([a, b], [[1], [0]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[[0, 0], [1, 0]], [[0, 1], [1, 1]], [[0, 2], [1, 2]]]) + + def test_dtype_copy(self): + # Test nested iteration with a copy to change dtype + + # copy + a = arange(6, dtype='i4').reshape(2, 3) + i, j = np.nested_iters(a, [[0], [1]], + op_flags=['readonly', 'copy'], + op_dtypes='f8') + assert_equal(j[0].dtype, np.dtype('f8')) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 1, 2], [3, 4, 5]]) + vals = None + + # writebackifcopy - using context manager + a = arange(6, dtype='f4').reshape(2, 3) + i, j = np.nested_iters(a, [[0], [1]], + op_flags=['readwrite', 'updateifcopy'], + casting='same_kind', + op_dtypes='f8') + with i, j: + assert_equal(j[0].dtype, np.dtype('f8')) + for x in i: + for y in j: + y[...] += 1 + assert_equal(a, [[0, 1, 2], [3, 4, 5]]) + assert_equal(a, [[1, 2, 3], [4, 5, 6]]) + + # writebackifcopy - using close() + a = arange(6, dtype='f4').reshape(2, 3) + i, j = np.nested_iters(a, [[0], [1]], + op_flags=['readwrite', 'updateifcopy'], + casting='same_kind', + op_dtypes='f8') + assert_equal(j[0].dtype, np.dtype('f8')) + for x in i: + for y in j: + y[...] += 1 + assert_equal(a, [[0, 1, 2], [3, 4, 5]]) + i.close() + j.close() + assert_equal(a, [[1, 2, 3], [4, 5, 6]]) + + def test_dtype_buffered(self): + # Test nested iteration with buffering to change dtype + + a = arange(6, dtype='f4').reshape(2, 3) + i, j = np.nested_iters(a, [[0], [1]], + flags=['buffered'], + op_flags=['readwrite'], + casting='same_kind', + op_dtypes='f8') + assert_equal(j[0].dtype, np.dtype('f8')) + for x in i: + for y in j: + y[...] += 1 + assert_equal(a, [[1, 2, 3], [4, 5, 6]]) + + def test_0d(self): + a = np.arange(12).reshape(2, 3, 2) + i, j = np.nested_iters(a, [[], [1, 0, 2]]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]]) + + i, j = np.nested_iters(a, [[1, 0, 2], []]) + vals = [list(j) for _ in i] + assert_equal(vals, [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11]]) + + i, j, k = np.nested_iters(a, [[2, 0], [], [1]]) + vals = [] + for x in i: + for y in j: + vals.append([z for z in k]) + assert_equal(vals, [[0, 2, 4], [1, 3, 5], [6, 8, 10], [7, 9, 11]]) + + def test_iter_nested_iters_dtype_buffered(self): + # Test nested iteration with buffering to change dtype + + a = arange(6, dtype='f4').reshape(2, 3) + i, j = np.nested_iters(a, [[0], [1]], + flags=['buffered'], + op_flags=['readwrite'], + casting='same_kind', + op_dtypes='f8') + with i, j: + assert_equal(j[0].dtype, np.dtype('f8')) + for x in i: + for y in j: + y[...] += 1 + assert_equal(a, [[1, 2, 3], [4, 5, 6]]) + +def test_iter_reduction_error(): + + a = np.arange(6) + assert_raises(ValueError, nditer, [a, None], [], + [['readonly'], ['readwrite', 'allocate']], + op_axes=[[0], [-1]]) + + a = np.arange(6).reshape(2, 3) + assert_raises(ValueError, nditer, [a, None], ['external_loop'], + [['readonly'], ['readwrite', 'allocate']], + op_axes=[[0, 1], [-1, -1]]) + +def test_iter_reduction(): + # Test doing reductions with the iterator + + a = np.arange(6) + i = nditer([a, None], ['reduce_ok'], + [['readonly'], ['readwrite', 'allocate']], + op_axes=[[0], [-1]]) + # Need to initialize the output operand to the addition unit + with i: + i.operands[1][...] = 0 + # Do the reduction + for x, y in i: + y[...] += x + # Since no axes were specified, should have allocated a scalar + assert_equal(i.operands[1].ndim, 0) + assert_equal(i.operands[1], np.sum(a)) + + a = np.arange(6).reshape(2, 3) + i = nditer([a, None], ['reduce_ok', 'external_loop'], + [['readonly'], ['readwrite', 'allocate']], + op_axes=[[0, 1], [-1, -1]]) + # Need to initialize the output operand to the addition unit + with i: + i.operands[1][...] = 0 + # Reduction shape/strides for the output + assert_equal(i[1].shape, (6,)) + assert_equal(i[1].strides, (0,)) + # Do the reduction + for x, y in i: + # Use a for loop instead of ``y[...] += x`` + # (equivalent to ``y[...] = y[...].copy() + x``), + # because y has zero strides we use for the reduction + for j in range(len(y)): + y[j] += x[j] + # Since no axes were specified, should have allocated a scalar + assert_equal(i.operands[1].ndim, 0) + assert_equal(i.operands[1], np.sum(a)) + + # This is a tricky reduction case for the buffering double loop + # to handle + a = np.ones((2, 3, 5)) + it1 = nditer([a, None], ['reduce_ok', 'external_loop'], + [['readonly'], ['readwrite', 'allocate']], + op_axes=[None, [0, -1, 1]]) + it2 = nditer([a, None], ['reduce_ok', 'external_loop', + 'buffered', 'delay_bufalloc'], + [['readonly'], ['readwrite', 'allocate']], + op_axes=[None, [0, -1, 1]], buffersize=10) + with it1, it2: + it1.operands[1].fill(0) + it2.operands[1].fill(0) + it2.reset() + for x in it1: + x[1][...] += x[0] + for x in it2: + x[1][...] += x[0] + assert_equal(it1.operands[1], it2.operands[1]) + assert_equal(it2.operands[1].sum(), a.size) + +def test_iter_buffering_reduction(): + # Test doing buffered reductions with the iterator + + a = np.arange(6) + b = np.array(0., dtype='f8').byteswap().newbyteorder() + i = nditer([a, b], ['reduce_ok', 'buffered'], + [['readonly'], ['readwrite', 'nbo']], + op_axes=[[0], [-1]]) + with i: + assert_equal(i[1].dtype, np.dtype('f8')) + assert_(i[1].dtype != b.dtype) + # Do the reduction + for x, y in i: + y[...] += x + # Since no axes were specified, should have allocated a scalar + assert_equal(b, np.sum(a)) + + a = np.arange(6).reshape(2, 3) + b = np.array([0, 0], dtype='f8').byteswap().newbyteorder() + i = nditer([a, b], ['reduce_ok', 'external_loop', 'buffered'], + [['readonly'], ['readwrite', 'nbo']], + op_axes=[[0, 1], [0, -1]]) + # Reduction shape/strides for the output + with i: + assert_equal(i[1].shape, (3,)) + assert_equal(i[1].strides, (0,)) + # Do the reduction + for x, y in i: + # Use a for loop instead of ``y[...] += x`` + # (equivalent to ``y[...] = y[...].copy() + x``), + # because y has zero strides we use for the reduction + for j in range(len(y)): + y[j] += x[j] + assert_equal(b, np.sum(a, axis=1)) + + # Iterator inner double loop was wrong on this one + p = np.arange(2) + 1 + it = np.nditer([p, None], + ['delay_bufalloc', 'reduce_ok', 'buffered', 'external_loop'], + [['readonly'], ['readwrite', 'allocate']], + op_axes=[[-1, 0], [-1, -1]], + itershape=(2, 2)) + with it: + it.operands[1].fill(0) + it.reset() + assert_equal(it[0], [1, 2, 1, 2]) + + # Iterator inner loop should take argument contiguity into account + x = np.ones((7, 13, 8), np.int8)[4:6,1:11:6,1:5].transpose(1, 2, 0) + x[...] = np.arange(x.size).reshape(x.shape) + y_base = np.arange(4*4, dtype=np.int8).reshape(4, 4) + y_base_copy = y_base.copy() + y = y_base[::2,:,None] + + it = np.nditer([y, x], + ['buffered', 'external_loop', 'reduce_ok'], + [['readwrite'], ['readonly']]) + with it: + for a, b in it: + a.fill(2) + + assert_equal(y_base[1::2], y_base_copy[1::2]) + assert_equal(y_base[::2], 2) + +def test_iter_buffering_reduction_reuse_reduce_loops(): + # There was a bug triggering reuse of the reduce loop inappropriately, + # which caused processing to happen in unnecessarily small chunks + # and overran the buffer. + + a = np.zeros((2, 7)) + b = np.zeros((1, 7)) + it = np.nditer([a, b], flags=['reduce_ok', 'external_loop', 'buffered'], + op_flags=[['readonly'], ['readwrite']], + buffersize=5) + + with it: + bufsizes = [x.shape[0] for x, y in it] + assert_equal(bufsizes, [5, 2, 5, 2]) + assert_equal(sum(bufsizes), a.size) + +def test_iter_writemasked_badinput(): + a = np.zeros((2, 3)) + b = np.zeros((3,)) + m = np.array([[True, True, False], [False, True, False]]) + m2 = np.array([True, True, False]) + m3 = np.array([0, 1, 1], dtype='u1') + mbad1 = np.array([0, 1, 1], dtype='i1') + mbad2 = np.array([0, 1, 1], dtype='f4') + + # Need an 'arraymask' if any operand is 'writemasked' + assert_raises(ValueError, nditer, [a, m], [], + [['readwrite', 'writemasked'], ['readonly']]) + + # A 'writemasked' operand must not be readonly + assert_raises(ValueError, nditer, [a, m], [], + [['readonly', 'writemasked'], ['readonly', 'arraymask']]) + + # 'writemasked' and 'arraymask' may not be used together + assert_raises(ValueError, nditer, [a, m], [], + [['readonly'], ['readwrite', 'arraymask', 'writemasked']]) + + # 'arraymask' may only be specified once + assert_raises(ValueError, nditer, [a, m, m2], [], + [['readwrite', 'writemasked'], + ['readonly', 'arraymask'], + ['readonly', 'arraymask']]) + + # An 'arraymask' with nothing 'writemasked' also doesn't make sense + assert_raises(ValueError, nditer, [a, m], [], + [['readwrite'], ['readonly', 'arraymask']]) + + # A writemasked reduction requires a similarly smaller mask + assert_raises(ValueError, nditer, [a, b, m], ['reduce_ok'], + [['readonly'], + ['readwrite', 'writemasked'], + ['readonly', 'arraymask']]) + # But this should work with a smaller/equal mask to the reduction operand + np.nditer([a, b, m2], ['reduce_ok'], + [['readonly'], + ['readwrite', 'writemasked'], + ['readonly', 'arraymask']]) + # The arraymask itself cannot be a reduction + assert_raises(ValueError, nditer, [a, b, m2], ['reduce_ok'], + [['readonly'], + ['readwrite', 'writemasked'], + ['readwrite', 'arraymask']]) + + # A uint8 mask is ok too + np.nditer([a, m3], ['buffered'], + [['readwrite', 'writemasked'], + ['readonly', 'arraymask']], + op_dtypes=['f4', None], + casting='same_kind') + # An int8 mask isn't ok + assert_raises(TypeError, np.nditer, [a, mbad1], ['buffered'], + [['readwrite', 'writemasked'], + ['readonly', 'arraymask']], + op_dtypes=['f4', None], + casting='same_kind') + # A float32 mask isn't ok + assert_raises(TypeError, np.nditer, [a, mbad2], ['buffered'], + [['readwrite', 'writemasked'], + ['readonly', 'arraymask']], + op_dtypes=['f4', None], + casting='same_kind') + + +def _is_buffered(iterator): + try: + iterator.itviews + except ValueError: + return True + return False + +@pytest.mark.parametrize("a", + [np.zeros((3,), dtype='f8'), + np.zeros((9876, 3*5), dtype='f8')[::2, :], + np.zeros((4, 312, 124, 3), dtype='f8')[::2, :, ::2, :], + # Also test with the last dimension strided (so it does not fit if + # there is repeated access) + np.zeros((9,), dtype='f8')[::3], + np.zeros((9876, 3*10), dtype='f8')[::2, ::5], + np.zeros((4, 312, 124, 3), dtype='f8')[::2, :, ::2, ::-1]]) +def test_iter_writemasked(a): + # Note, the slicing above is to ensure that nditer cannot combine multiple + # axes into one. The repetition is just to make things a bit more + # interesting. + shape = a.shape + reps = shape[-1] // 3 + msk = np.empty(shape, dtype=bool) + msk[...] = [True, True, False] * reps + + # When buffering is unused, 'writemasked' effectively does nothing. + # It's up to the user of the iterator to obey the requested semantics. + it = np.nditer([a, msk], [], + [['readwrite', 'writemasked'], + ['readonly', 'arraymask']]) + with it: + for x, m in it: + x[...] = 1 + # Because we violated the semantics, all the values became 1 + assert_equal(a, np.broadcast_to([1, 1, 1] * reps, shape)) + + # Even if buffering is enabled, we still may be accessing the array + # directly. + it = np.nditer([a, msk], ['buffered'], + [['readwrite', 'writemasked'], + ['readonly', 'arraymask']]) + # @seberg: I honestly don't currently understand why a "buffered" iterator + # would end up not using a buffer for the small array here at least when + # "writemasked" is used, that seems confusing... Check by testing for + # actual memory overlap! + is_buffered = True + with it: + for x, m in it: + x[...] = 2.5 + if np.may_share_memory(x, a): + is_buffered = False + + if not is_buffered: + # Because we violated the semantics, all the values became 2.5 + assert_equal(a, np.broadcast_to([2.5, 2.5, 2.5] * reps, shape)) + else: + # For large sizes, the iterator may be buffered: + assert_equal(a, np.broadcast_to([2.5, 2.5, 1] * reps, shape)) + a[...] = 2.5 + + # If buffering will definitely happening, for instance because of + # a cast, only the items selected by the mask will be copied back from + # the buffer. + it = np.nditer([a, msk], ['buffered'], + [['readwrite', 'writemasked'], + ['readonly', 'arraymask']], + op_dtypes=['i8', None], + casting='unsafe') + with it: + for x, m in it: + x[...] = 3 + # Even though we violated the semantics, only the selected values + # were copied back + assert_equal(a, np.broadcast_to([3, 3, 2.5] * reps, shape)) + + +@pytest.mark.parametrize(["mask", "mask_axes"], [ + # Allocated operand (only broadcasts with -1) + (None, [-1, 0]), + # Reduction along the first dimension (with and without op_axes) + (np.zeros((1, 4), dtype="bool"), [0, 1]), + (np.zeros((1, 4), dtype="bool"), None), + # Test 0-D and -1 op_axes + (np.zeros(4, dtype="bool"), [-1, 0]), + (np.zeros((), dtype="bool"), [-1, -1]), + (np.zeros((), dtype="bool"), None)]) +def test_iter_writemasked_broadcast_error(mask, mask_axes): + # This assumes that a readwrite mask makes sense. This is likely not the + # case and should simply be deprecated. + arr = np.zeros((3, 4)) + itflags = ["reduce_ok"] + mask_flags = ["arraymask", "readwrite", "allocate"] + a_flags = ["writeonly", "writemasked"] + if mask_axes is None: + op_axes = None + else: + op_axes = [mask_axes, [0, 1]] + + with assert_raises(ValueError): + np.nditer((mask, arr), flags=itflags, op_flags=[mask_flags, a_flags], + op_axes=op_axes) + + +def test_iter_writemasked_decref(): + # force casting (to make it interesting) by using a structured dtype. + arr = np.arange(10000).astype(">i,O") + original = arr.copy() + mask = np.random.randint(0, 2, size=10000).astype(bool) + + it = np.nditer([arr, mask], ['buffered', "refs_ok"], + [['readwrite', 'writemasked'], + ['readonly', 'arraymask']], + op_dtypes=["= (3, 8): + def fmean(data: Iterable[SupportsFloat]) -> float: ... + def geometric_mean(data: Iterable[SupportsFloat]) -> float: ... + +def mean(data: Iterable[_Number]) -> _Number: ... +def harmonic_mean(data: Iterable[_Number]) -> _Number: ... +def median(data: Iterable[_Number]) -> _Number: ... +def median_low(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ... +def median_high(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ... +def median_grouped(data: Iterable[_Number], interval: _Number = ...) -> _Number: ... +def mode(data: Iterable[_HashableT]) -> _HashableT: ... + +if sys.version_info >= (3, 8): + def multimode(data: Iterable[_HashableT]) -> List[_HashableT]: ... + +def pstdev(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... +def pvariance(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... + +if sys.version_info >= (3, 8): + def quantiles(data: Iterable[_Number], *, n: int = ..., method: str = ...) -> List[_Number]: ... + +def stdev(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... +def variance(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... + +if sys.version_info >= (3, 8): + class NormalDist: + def __init__(self, mu: float = ..., sigma: float = ...) -> None: ... + @property + def mean(self) -> float: ... + @property + def median(self) -> float: ... + @property + def mode(self) -> float: ... + @property + def stdev(self) -> float: ... + @property + def variance(self) -> float: ... + @classmethod + def from_samples(cls: Type[_T], data: Iterable[SupportsFloat]) -> _T: ... + def samples(self, n: int, *, seed: Optional[Any] = ...) -> List[float]: ... + def pdf(self, x: float) -> float: ... + def cdf(self, x: float) -> float: ... + def inv_cdf(self, p: float) -> float: ... + def overlap(self, other: NormalDist) -> float: ... + def quantiles(self, n: int = ...) -> List[float]: ... + if sys.version_info >= (3, 9): + def zscore(self, x: float) -> float: ... + def __add__(self, x2: Union[float, NormalDist]) -> NormalDist: ... + def __sub__(self, x2: Union[float, NormalDist]) -> NormalDist: ... + def __mul__(self, x2: float) -> NormalDist: ... + def __truediv__(self, x2: float) -> NormalDist: ... + def __pos__(self) -> NormalDist: ... + def __neg__(self) -> NormalDist: ... + __radd__ = __add__ + def __rsub__(self, x2: Union[float, NormalDist]) -> NormalDist: ... + __rmul__ = __mul__ + def __hash__(self) -> int: ... diff --git a/shared/package-files/9d/9d56ebad0263a48ac94e0b2b7a3723625f2ff4dc7707d1156580e008d40bc790/blob b/shared/package-files/9d/9d56ebad0263a48ac94e0b2b7a3723625f2ff4dc7707d1156580e008d40bc790/blob new file mode 100644 index 0000000000000000000000000000000000000000..21a73f3bf6cb629625715cfd69e82ea45c74f93a --- /dev/null +++ b/shared/package-files/9d/9d56ebad0263a48ac94e0b2b7a3723625f2ff4dc7707d1156580e008d40bc790/blob @@ -0,0 +1,269 @@ +#. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) +# Licensed to PSF under a Contributor Agreement. +# + +__doc__ = """hashlib module - A common interface to many hash functions. + +new(name, data=b'', **kwargs) - returns a new hash object implementing the + given hash function; initializing the hash + using the given binary data. + +Named constructor functions are also available, these are faster +than using new(name): + +md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(), +sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256. + +More algorithms may be available on your platform but the above are guaranteed +to exist. See the algorithms_guaranteed and algorithms_available attributes +to find out what algorithm names can be passed to new(). + +NOTE: If you want the adler32 or crc32 hash functions they are available in +the zlib module. + +Choose your hash function wisely. Some have known collision weaknesses. +sha384 and sha512 will be slow on 32 bit platforms. + +Hash objects have these methods: + - update(data): Update the hash object with the bytes in data. Repeated calls + are equivalent to a single call with the concatenation of all + the arguments. + - digest(): Return the digest of the bytes passed to the update() method + so far as a bytes object. + - hexdigest(): Like digest() except the digest is returned as a string + of double length, containing only hexadecimal digits. + - copy(): Return a copy (clone) of the hash object. This can be used to + efficiently compute the digests of datas that share a common + initial substring. + +For example, to obtain the digest of the byte string 'Nobody inspects the +spammish repetition': + + >>> import hashlib + >>> m = hashlib.md5() + >>> m.update(b"Nobody inspects") + >>> m.update(b" the spammish repetition") + >>> m.digest() + b'\\xbbd\\x9c\\x83\\xdd\\x1e\\xa5\\xc9\\xd9\\xde\\xc9\\xa1\\x8d\\xf0\\xff\\xe9' + +More condensed: + + >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest() + 'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2' + +""" + +# This tuple and __get_builtin_constructor() must be modified if a new +# always available algorithm is added. +__always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', + 'blake2b', 'blake2s', + 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', + 'shake_128', 'shake_256') + + +algorithms_guaranteed = set(__always_supported) +algorithms_available = set(__always_supported) + +__all__ = __always_supported + ('new', 'algorithms_guaranteed', + 'algorithms_available', 'pbkdf2_hmac') + + +__builtin_constructor_cache = {} + +# Prefer our blake2 implementation +# OpenSSL 1.1.0 comes with a limited implementation of blake2b/s. The OpenSSL +# implementations neither support keyed blake2 (blake2 MAC) nor advanced +# features like salt, personalization, or tree hashing. OpenSSL hash-only +# variants are available as 'blake2b512' and 'blake2s256', though. +__block_openssl_constructor = { + 'blake2b', 'blake2s', +} + +def __get_builtin_constructor(name): + cache = __builtin_constructor_cache + constructor = cache.get(name) + if constructor is not None: + return constructor + try: + if name in {'SHA1', 'sha1'}: + import _sha1 + cache['SHA1'] = cache['sha1'] = _sha1.sha1 + elif name in {'MD5', 'md5'}: + import _md5 + cache['MD5'] = cache['md5'] = _md5.md5 + elif name in {'SHA256', 'sha256', 'SHA224', 'sha224'}: + import _sha256 + cache['SHA224'] = cache['sha224'] = _sha256.sha224 + cache['SHA256'] = cache['sha256'] = _sha256.sha256 + elif name in {'SHA512', 'sha512', 'SHA384', 'sha384'}: + import _sha512 + cache['SHA384'] = cache['sha384'] = _sha512.sha384 + cache['SHA512'] = cache['sha512'] = _sha512.sha512 + elif name in {'blake2b', 'blake2s'}: + import _blake2 + cache['blake2b'] = _blake2.blake2b + cache['blake2s'] = _blake2.blake2s + elif name in {'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512'}: + import _sha3 + cache['sha3_224'] = _sha3.sha3_224 + cache['sha3_256'] = _sha3.sha3_256 + cache['sha3_384'] = _sha3.sha3_384 + cache['sha3_512'] = _sha3.sha3_512 + elif name in {'shake_128', 'shake_256'}: + import _sha3 + cache['shake_128'] = _sha3.shake_128 + cache['shake_256'] = _sha3.shake_256 + except ImportError: + pass # no extension module, this hash is unsupported. + + constructor = cache.get(name) + if constructor is not None: + return constructor + + raise ValueError('unsupported hash type ' + name) + + +def __get_openssl_constructor(name): + if name in __block_openssl_constructor: + # Prefer our builtin blake2 implementation. + return __get_builtin_constructor(name) + try: + # MD5, SHA1, and SHA2 are in all supported OpenSSL versions + # SHA3/shake are available in OpenSSL 1.1.1+ + f = getattr(_hashlib, 'openssl_' + name) + # Allow the C module to raise ValueError. The function will be + # defined but the hash not actually available. Don't fall back to + # builtin if the current security policy blocks a digest, bpo#40695. + f(usedforsecurity=False) + # Use the C function directly (very fast) + return f + except (AttributeError, ValueError): + return __get_builtin_constructor(name) + + +def __py_new(name, data=b'', **kwargs): + """new(name, data=b'', **kwargs) - Return a new hashing object using the + named algorithm; optionally initialized with data (which must be + a bytes-like object). + """ + return __get_builtin_constructor(name)(data, **kwargs) + + +def __hash_new(name, data=b'', **kwargs): + """new(name, data=b'') - Return a new hashing object using the named algorithm; + optionally initialized with data (which must be a bytes-like object). + """ + if name in __block_openssl_constructor: + # Prefer our builtin blake2 implementation. + return __get_builtin_constructor(name)(data, **kwargs) + try: + return _hashlib.new(name, data, **kwargs) + except ValueError: + # If the _hashlib module (OpenSSL) doesn't support the named + # hash, try using our builtin implementations. + # This allows for SHA224/256 and SHA384/512 support even though + # the OpenSSL library prior to 0.9.8 doesn't provide them. + return __get_builtin_constructor(name)(data) + + +try: + import _hashlib + new = __hash_new + __get_hash = __get_openssl_constructor + algorithms_available = algorithms_available.union( + _hashlib.openssl_md_meth_names) +except ImportError: + _hashlib = None + new = __py_new + __get_hash = __get_builtin_constructor + +try: + # OpenSSL's PKCS5_PBKDF2_HMAC requires OpenSSL 1.0+ with HMAC and SHA + from _hashlib import pbkdf2_hmac +except ImportError: + from warnings import warn as _warn + _trans_5C = bytes((x ^ 0x5C) for x in range(256)) + _trans_36 = bytes((x ^ 0x36) for x in range(256)) + + def pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None): + """Password based key derivation function 2 (PKCS #5 v2.0) + + This Python implementations based on the hmac module about as fast + as OpenSSL's PKCS5_PBKDF2_HMAC for short passwords and much faster + for long passwords. + """ + _warn( + "Python implementation of pbkdf2_hmac() is deprecated.", + category=DeprecationWarning, + stacklevel=2 + ) + if not isinstance(hash_name, str): + raise TypeError(hash_name) + + if not isinstance(password, (bytes, bytearray)): + password = bytes(memoryview(password)) + if not isinstance(salt, (bytes, bytearray)): + salt = bytes(memoryview(salt)) + + # Fast inline HMAC implementation + inner = new(hash_name) + outer = new(hash_name) + blocksize = getattr(inner, 'block_size', 64) + if len(password) > blocksize: + password = new(hash_name, password).digest() + password = password + b'\x00' * (blocksize - len(password)) + inner.update(password.translate(_trans_36)) + outer.update(password.translate(_trans_5C)) + + def prf(msg, inner=inner, outer=outer): + # PBKDF2_HMAC uses the password as key. We can re-use the same + # digest objects and just update copies to skip initialization. + icpy = inner.copy() + ocpy = outer.copy() + icpy.update(msg) + ocpy.update(icpy.digest()) + return ocpy.digest() + + if iterations < 1: + raise ValueError(iterations) + if dklen is None: + dklen = outer.digest_size + if dklen < 1: + raise ValueError(dklen) + + dkey = b'' + loop = 1 + from_bytes = int.from_bytes + while len(dkey) < dklen: + prev = prf(salt + loop.to_bytes(4, 'big')) + # endianness doesn't matter here as long to / from use the same + rkey = int.from_bytes(prev, 'big') + for i in range(iterations - 1): + prev = prf(prev) + # rkey = rkey ^ prev + rkey ^= from_bytes(prev, 'big') + loop += 1 + dkey += rkey.to_bytes(inner.digest_size, 'big') + + return dkey[:dklen] + +try: + # OpenSSL's scrypt requires OpenSSL 1.1+ + from _hashlib import scrypt +except ImportError: + pass + + +for __func_name in __always_supported: + # try them all, some may not work due to the OpenSSL + # version not supporting that algorithm. + try: + globals()[__func_name] = __get_hash(__func_name) + except ValueError: + import logging + logging.exception('code for hash %s was not found.', __func_name) + + +# Cleanup locals() +del __always_supported, __func_name, __get_hash +del __py_new, __hash_new, __get_openssl_constructor diff --git a/shared/package-files/9d/9d573587f4859e8c7b8acfbda46bd1a0d2dd20f0986353090c7e7fd2080b96f5/blob b/shared/package-files/9d/9d573587f4859e8c7b8acfbda46bd1a0d2dd20f0986353090c7e7fd2080b96f5/blob new file mode 100644 index 0000000000000000000000000000000000000000..c36c35bcf5241a21f542cb52fd5134ce869c7a74 --- /dev/null +++ b/shared/package-files/9d/9d573587f4859e8c7b8acfbda46bd1a0d2dd20f0986353090c7e7fd2080b96f5/blob @@ -0,0 +1,165 @@ +from collections import defaultdict +from copy import deepcopy +import torch +from typing import Any, Optional, Dict +import pytorch_lightning as pl # type: ignore[import] + +from ._data_sparstity_utils import ( + _attach_model_to_data_sparsifier, + _log_sparsified_level, + _get_valid_name +) + + +class PostTrainingDataSparsity(pl.callbacks.Callback): + """Lightning callback that enables post-training sparsity. + + This callback aims to sparsify the model inside lightning module after training. + **Note that the model is copied and then sparsified, so the existing model is not modified** + + The sparsified model can be used for comparison and can be accessed using + .sparsified + + Args: + data_sparsifier_class (some implemented class of BaseDataSparsifier) + The data sparsifier object of this class is created when the + training starts. + Note: Objects should not be passed in here as they are created + once the training completes. + + data_sparsifier_args (Dict) + Dictionary of args to be passed to the data sparsifier. + Note: data_list arg should be ignored + + Hooks implemented: + on_fit_end() + 1. copies the model and attaches it to the sparsifier + 2. sparsier step() is called + 3. squashes the mask() + """ + def __init__(self, data_sparsifier_class, data_sparsifier_args): + super().__init__() + self.data_sparsifier_class = data_sparsifier_class + self.data_sparsifier_args = data_sparsifier_args + self.data_sparsifier: Any = None + self.sparsified: Optional[torch.nn.Module] = None + + def on_fit_end(self, trainer, pl_module) -> None: + self.sparsified = deepcopy(pl_module.model).eval() + self.data_sparsifier = self.data_sparsifier_class(**self.data_sparsifier_args) + + _attach_model_to_data_sparsifier(self.sparsified, self.data_sparsifier) + + self.data_sparsifier.step() + + self.data_sparsifier.squash_mask() # currently squashes params for all mask + + _log_sparsified_level(self.sparsified, self.data_sparsifier) + + +class TrainingAwareDataSparsity(pl.callbacks.Callback): + """Lightning callback that enables in-training sparsity. + + This callback aims to sparsify the model inside lightning module during training. + **Note that the model is copied and then sparsified, so the existing model is not modified** + + The sparsified model can be used for comparison and can be accessed using + .sparsified + + Args: + data_sparsifier_class (some implemented class of BaseDataSparsifier) + The data sparsifier object of this class is created when the + training starts. + Note: Objects should not be passed in here as they are created + when the training starts. + + data_sparsifier_args (Dict) + Dictionary of args to be passed to the data sparsifier. + Note: data_list arg should be ignored + + data_scheduler_class (some implemented class of BaseDataScheduler) + The data scheduler of this class is created when the training starts + Note: Objects should not be passed in here as they are created + when the training starts. + + data_scheduler_args(Dict) + Dictionary of args to be passed to the data scheduler. + **Note: data_sparsifier arg should be ignored as the recipe + creates and pass sparsifier object into the class** + + Hooks implemented: + on_train_start() + Data sparsifier and scheduler objects are created. + Pytorch model attached to the sparsifier + + on_train_epoch_start() + Loads the state_dict of the data sparsifier + + on_train_epoch_end() + 1. Copies the model and attaches it to the sparsifier + 2. sparsifier step() and scheduler step() + 3. Dump state_dict of the current sparsifier + + on_train_end() + squash mask + """ + def __init__(self, data_sparsifier_class, data_sparsifier_args, + data_scheduler_class, data_scheduler_args): + super().__init__() + # data sparsifier objects + self.data_sparsifier_class = data_sparsifier_class + self.data_sparsifier_args = data_sparsifier_args + + # scheduler objects + self.data_scheduler_class = data_scheduler_class + self.data_scheduler_args = data_scheduler_args + + # fields + self.data_sparsifier: Any = None + self.data_scheduler: Any = None + self.sparsified: Optional[torch.nn.Module] = None + + self.data_sparsifier_state_dict: Any = None + + def on_train_start(self, trainer, pl_module) -> None: + # create sparsifier + self.data_sparsifier = self.data_sparsifier_class(**self.data_sparsifier_args) + self.sparsified = deepcopy(pl_module.model) + + _attach_model_to_data_sparsifier(self.sparsified, self.data_sparsifier) # just to populate the base_sl in the scheduler + + # create scheduler + args = deepcopy(self.data_scheduler_args) + args['data_sparsifier'] = self.data_sparsifier + self.data_scheduler = self.data_scheduler_class(**args) + + def on_train_epoch_start(self, trainer, pl_module): + if self.data_sparsifier_state_dict is None: + return # probably first epoch + + # load the existing config for each data + self.data_sparsifier.load_state_dict(self.data_sparsifier_state_dict) + + def __create_config_based_on_state(self, pl_module): + config: Dict = defaultdict() + if self.data_sparsifier_state_dict is None: + return config + for name, _ in pl_module.model.named_parameters(): + valid_name = _get_valid_name(name) + config[valid_name] = self.data_sparsifier.data_groups[valid_name] + + return config + + def on_train_epoch_end(self, trainer, pl_module): + self.sparsified = deepcopy(pl_module.model) + config = self.__create_config_based_on_state(pl_module) + + # attach model to the data sparsifier + _attach_model_to_data_sparsifier(self.sparsified, self.data_sparsifier, config=config) + self.data_sparsifier.step() + self.data_scheduler.step() + + self.data_sparsifier_state_dict = self.data_sparsifier.state_dict() + + def on_train_end(self, trainer, pl_module): + self.data_sparsifier.squash_mask() diff --git a/shared/package-files/9d/9d58ad64056a89f12258a62596c2073cd9e52b459dde152f710edc0cffcd865b/blob b/shared/package-files/9d/9d58ad64056a89f12258a62596c2073cd9e52b459dde152f710edc0cffcd865b/blob new file mode 100644 index 0000000000000000000000000000000000000000..ce36451a3af01cba7628ad7893183dd19283761d --- /dev/null +++ b/shared/package-files/9d/9d58ad64056a89f12258a62596c2073cd9e52b459dde152f710edc0cffcd865b/blob @@ -0,0 +1,155 @@ +""" +Path operations common to more than one OS +Do not use directly. The OS specific modules import the appropriate +functions from this module themselves. +""" +import os +import stat + +__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime', + 'getsize', 'isdir', 'isfile', 'samefile', 'sameopenfile', + 'samestat'] + + +# Does a path exist? +# This is false for dangling symbolic links on systems that support them. +def exists(path): + """Test whether a path exists. Returns False for broken symbolic links""" + try: + os.stat(path) + except (OSError, ValueError): + return False + return True + + +# This follows symbolic links, so both islink() and isdir() can be true +# for the same path on systems that support symlinks +def isfile(path): + """Test whether a path is a regular file""" + try: + st = os.stat(path) + except (OSError, ValueError): + return False + return stat.S_ISREG(st.st_mode) + + +# Is a path a directory? +# This follows symbolic links, so both islink() and isdir() +# can be true for the same path on systems that support symlinks +def isdir(s): + """Return true if the pathname refers to an existing directory.""" + try: + st = os.stat(s) + except (OSError, ValueError): + return False + return stat.S_ISDIR(st.st_mode) + + +def getsize(filename): + """Return the size of a file, reported by os.stat().""" + return os.stat(filename).st_size + + +def getmtime(filename): + """Return the last modification time of a file, reported by os.stat().""" + return os.stat(filename).st_mtime + + +def getatime(filename): + """Return the last access time of a file, reported by os.stat().""" + return os.stat(filename).st_atime + + +def getctime(filename): + """Return the metadata change time of a file, reported by os.stat().""" + return os.stat(filename).st_ctime + + +# Return the longest prefix of all list elements. +def commonprefix(m): + "Given a list of pathnames, returns the longest common leading component" + if not m: return '' + # Some people pass in a list of pathname parts to operate in an OS-agnostic + # fashion; don't try to translate in that case as that's an abuse of the + # API and they are already doing what they need to be OS-agnostic and so + # they most likely won't be using an os.PathLike object in the sublists. + if not isinstance(m[0], (list, tuple)): + m = tuple(map(os.fspath, m)) + s1 = min(m) + s2 = max(m) + for i, c in enumerate(s1): + if c != s2[i]: + return s1[:i] + return s1 + +# Are two stat buffers (obtained from stat, fstat or lstat) +# describing the same file? +def samestat(s1, s2): + """Test whether two stat buffers reference the same file""" + return (s1.st_ino == s2.st_ino and + s1.st_dev == s2.st_dev) + + +# Are two filenames really pointing to the same file? +def samefile(f1, f2): + """Test whether two pathnames reference the same actual file or directory + + This is determined by the device number and i-node number and + raises an exception if an os.stat() call on either pathname fails. + """ + s1 = os.stat(f1) + s2 = os.stat(f2) + return samestat(s1, s2) + + +# Are two open files really referencing the same file? +# (Not necessarily the same file descriptor!) +def sameopenfile(fp1, fp2): + """Test whether two open file objects reference the same file""" + s1 = os.fstat(fp1) + s2 = os.fstat(fp2) + return samestat(s1, s2) + + +# Split a path in root and extension. +# The extension is everything starting at the last dot in the last +# pathname component; the root is everything before that. +# It is always true that root + ext == p. + +# Generic implementation of splitext, to be parametrized with +# the separators +def _splitext(p, sep, altsep, extsep): + """Split the extension from a pathname. + + Extension is everything from the last dot to the end, ignoring + leading dots. Returns "(root, ext)"; ext may be empty.""" + # NOTE: This code must work for text and bytes strings. + + sepIndex = p.rfind(sep) + if altsep: + altsepIndex = p.rfind(altsep) + sepIndex = max(sepIndex, altsepIndex) + + dotIndex = p.rfind(extsep) + if dotIndex > sepIndex: + # skip all leading dots + filenameIndex = sepIndex + 1 + while filenameIndex < dotIndex: + if p[filenameIndex:filenameIndex+1] != extsep: + return p[:dotIndex], p[dotIndex:] + filenameIndex += 1 + + return p, p[:0] + +def _check_arg_types(funcname, *args): + hasstr = hasbytes = False + for s in args: + if isinstance(s, str): + hasstr = True + elif isinstance(s, bytes): + hasbytes = True + else: + raise TypeError(f'{funcname}() argument must be str, bytes, or ' + f'os.PathLike object, not {s.__class__.__name__!r}') from None + if hasstr and hasbytes: + raise TypeError("Can't mix strings and bytes in path components") from None diff --git a/shared/package-files/9d/9d5b42d6b5f7c0842d8db8945107c9aa72b9c34ded1debdfb61eb64a822d037e/blob b/shared/package-files/9d/9d5b42d6b5f7c0842d8db8945107c9aa72b9c34ded1debdfb61eb64a822d037e/blob new file mode 100644 index 0000000000000000000000000000000000000000..53ebe877957183a540ca9b833f0a27e460f3b903 --- /dev/null +++ b/shared/package-files/9d/9d5b42d6b5f7c0842d8db8945107c9aa72b9c34ded1debdfb61eb64a822d037e/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor copysign(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & copysign_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & copysign_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +TORCH_API at::Tensor & copysign_(at::Tensor & self, const at::Tensor & other); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/9d/9d5bfea5058b0366eaf0ba948cb93a228e6a00786df499f0d7134cbb7a8db59f/blob b/shared/package-files/9d/9d5bfea5058b0366eaf0ba948cb93a228e6a00786df499f0d7134cbb7a8db59f/blob new file mode 100644 index 0000000000000000000000000000000000000000..808322343f606b25ba115cc5fe27051f14c4e5dd --- /dev/null +++ b/shared/package-files/9d/9d5bfea5058b0366eaf0ba948cb93a228e6a00786df499f0d7134cbb7a8db59f/blob @@ -0,0 +1,17 @@ +../../../bin/distro,sha256=4t5j5Py2gU-aI2Z8XZfBiMrLFb-HvJ0ae1Y4DgtPnKQ,495 +distro-1.8.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +distro-1.8.0.dist-info/LICENSE,sha256=y16Ofl9KOYjhBjwULGDcLfdWBfTEZRXnduOspt-XbhQ,11325 +distro-1.8.0.dist-info/METADATA,sha256=NhYw94UPXb78_Z3_VtLxTJ1zQgUUKoTndg10uKJX800,6915 +distro-1.8.0.dist-info/RECORD,, +distro-1.8.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +distro-1.8.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92 +distro-1.8.0.dist-info/direct_url.json,sha256=yvL-4nt3l1V-ztbMYQu311R4KS6vdJvTnpCLbwgP8J0,66 +distro-1.8.0.dist-info/entry_points.txt,sha256=3ObjqQMbh1xeQQwsWtgbfDNDMDD-EbggR1Oj_z8s9hc,46 +distro-1.8.0.dist-info/top_level.txt,sha256=ikde_V_XEdSBqaGd5tEriN_wzYHLgTX_zVtlsGLHvwQ,7 +distro/__init__.py,sha256=2fHjF-SfgPvjyNZ1iHh_wjqWdR_Yo5ODHwZC0jLBPhc,981 +distro/__main__.py,sha256=bu9d3TifoKciZFcqRBuygV3GSuThnVD_m2IK4cz96Vs,64 +distro/__pycache__/__init__.cpython-310.pyc,, +distro/__pycache__/__main__.cpython-310.pyc,, +distro/__pycache__/distro.cpython-310.pyc,, +distro/distro.py,sha256=UZO1LjIhtFCMdlbiz39gj3raV-Amf3SBwzGzfApiMHw,49330 +distro/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/shared/package-files/9d/9d5d9970d4ef318ef1e284369e248d5755d31fd6e45db700b76f80e8e0ece799/blob b/shared/package-files/9d/9d5d9970d4ef318ef1e284369e248d5755d31fd6e45db700b76f80e8e0ece799/blob new file mode 100644 index 0000000000000000000000000000000000000000..02d3e779dd936263a56b8290a859ead58c023933 --- /dev/null +++ b/shared/package-files/9d/9d5d9970d4ef318ef1e284369e248d5755d31fd6e45db700b76f80e8e0ece799/blob @@ -0,0 +1,1151 @@ +""" + pygments.lexers._sourcemod_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file contains the names of SourceMod functions. + + Do not edit the FUNCTIONS list by hand. + + Run with `python -I` to regenerate. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +FUNCTIONS = ( + 'OnEntityCreated', + 'OnEntityDestroyed', + 'OnGetGameDescription', + 'OnLevelInit', + 'SDKHook', + 'SDKHookEx', + 'SDKUnhook', + 'SDKHooks_TakeDamage', + 'SDKHooks_DropWeapon', + 'TopMenuHandler', + 'CreateTopMenu', + 'LoadTopMenuConfig', + 'AddToTopMenu', + 'GetTopMenuInfoString', + 'GetTopMenuObjName', + 'RemoveFromTopMenu', + 'DisplayTopMenu', + 'DisplayTopMenuCategory', + 'FindTopMenuCategory', + 'SetTopMenuTitleCaching', + 'OnAdminMenuCreated', + 'OnAdminMenuReady', + 'GetAdminTopMenu', + 'AddTargetsToMenu', + 'AddTargetsToMenu2', + 'RedisplayAdminMenu', + 'TEHook', + 'AddTempEntHook', + 'RemoveTempEntHook', + 'TE_Start', + 'TE_IsValidProp', + 'TE_WriteNum', + 'TE_ReadNum', + 'TE_WriteFloat', + 'TE_ReadFloat', + 'TE_WriteVector', + 'TE_ReadVector', + 'TE_WriteAngles', + 'TE_WriteFloatArray', + 'TE_Send', + 'TE_WriteEncodedEnt', + 'TE_SendToAll', + 'TE_SendToClient', + 'CreateKeyValues', + 'KvSetString', + 'KvSetNum', + 'KvSetUInt64', + 'KvSetFloat', + 'KvSetColor', + 'KvSetVector', + 'KvGetString', + 'KvGetNum', + 'KvGetFloat', + 'KvGetColor', + 'KvGetUInt64', + 'KvGetVector', + 'KvJumpToKey', + 'KvJumpToKeySymbol', + 'KvGotoFirstSubKey', + 'KvGotoNextKey', + 'KvSavePosition', + 'KvDeleteKey', + 'KvDeleteThis', + 'KvGoBack', + 'KvRewind', + 'KvGetSectionName', + 'KvSetSectionName', + 'KvGetDataType', + 'KeyValuesToFile', + 'FileToKeyValues', + 'StringToKeyValues', + 'KvSetEscapeSequences', + 'KvNodesInStack', + 'KvCopySubkeys', + 'KvFindKeyById', + 'KvGetNameSymbol', + 'KvGetSectionSymbol', + 'TE_SetupSparks', + 'TE_SetupSmoke', + 'TE_SetupDust', + 'TE_SetupMuzzleFlash', + 'TE_SetupMetalSparks', + 'TE_SetupEnergySplash', + 'TE_SetupArmorRicochet', + 'TE_SetupGlowSprite', + 'TE_SetupExplosion', + 'TE_SetupBloodSprite', + 'TE_SetupBeamRingPoint', + 'TE_SetupBeamPoints', + 'TE_SetupBeamLaser', + 'TE_SetupBeamRing', + 'TE_SetupBeamFollow', + 'HookEvent', + 'HookEventEx', + 'UnhookEvent', + 'CreateEvent', + 'FireEvent', + 'CancelCreatedEvent', + 'GetEventBool', + 'SetEventBool', + 'GetEventInt', + 'SetEventInt', + 'GetEventFloat', + 'SetEventFloat', + 'GetEventString', + 'SetEventString', + 'GetEventName', + 'SetEventBroadcast', + 'GetUserMessageType', + 'GetUserMessageId', + 'GetUserMessageName', + 'StartMessage', + 'StartMessageEx', + 'EndMessage', + 'MsgHook', + 'MsgPostHook', + 'HookUserMessage', + 'UnhookUserMessage', + 'StartMessageAll', + 'StartMessageOne', + 'InactivateClient', + 'ReconnectClient', + 'GetMaxEntities', + 'GetEntityCount', + 'IsValidEntity', + 'IsValidEdict', + 'IsEntNetworkable', + 'CreateEdict', + 'RemoveEdict', + 'GetEdictFlags', + 'SetEdictFlags', + 'GetEdictClassname', + 'GetEntityNetClass', + 'ChangeEdictState', + 'GetEntData', + 'SetEntData', + 'GetEntDataFloat', + 'SetEntDataFloat', + 'GetEntDataEnt2', + 'SetEntDataEnt2', + 'GetEntDataVector', + 'SetEntDataVector', + 'GetEntDataString', + 'SetEntDataString', + 'FindSendPropOffs', + 'FindSendPropInfo', + 'FindDataMapOffs', + 'FindDataMapInfo', + 'GetEntSendPropOffs', + 'GetEntProp', + 'SetEntProp', + 'GetEntPropFloat', + 'SetEntPropFloat', + 'GetEntPropEnt', + 'SetEntPropEnt', + 'GetEntPropVector', + 'SetEntPropVector', + 'GetEntPropString', + 'SetEntPropString', + 'GetEntPropArraySize', + 'GetEntDataArray', + 'SetEntDataArray', + 'GetEntityAddress', + 'GetEntityClassname', + 'float', + 'FloatMul', + 'FloatDiv', + 'FloatAdd', + 'FloatSub', + 'FloatFraction', + 'RoundToZero', + 'RoundToCeil', + 'RoundToFloor', + 'RoundToNearest', + 'FloatCompare', + 'SquareRoot', + 'Pow', + 'Exponential', + 'Logarithm', + 'Sine', + 'Cosine', + 'Tangent', + 'FloatAbs', + 'ArcTangent', + 'ArcCosine', + 'ArcSine', + 'ArcTangent2', + 'RoundFloat', + 'operator%', + 'DegToRad', + 'RadToDeg', + 'GetURandomInt', + 'GetURandomFloat', + 'SetURandomSeed', + 'SetURandomSeedSimple', + 'RemovePlayerItem', + 'GivePlayerItem', + 'GetPlayerWeaponSlot', + 'IgniteEntity', + 'ExtinguishEntity', + 'TeleportEntity', + 'ForcePlayerSuicide', + 'SlapPlayer', + 'FindEntityByClassname', + 'GetClientEyeAngles', + 'CreateEntityByName', + 'DispatchSpawn', + 'DispatchKeyValue', + 'DispatchKeyValueFloat', + 'DispatchKeyValueVector', + 'GetClientAimTarget', + 'GetTeamCount', + 'GetTeamName', + 'GetTeamScore', + 'SetTeamScore', + 'GetTeamClientCount', + 'SetEntityModel', + 'GetPlayerDecalFile', + 'GetPlayerJingleFile', + 'GetServerNetStats', + 'EquipPlayerWeapon', + 'ActivateEntity', + 'SetClientInfo', + 'GivePlayerAmmo', + 'SetClientListeningFlags', + 'GetClientListeningFlags', + 'SetListenOverride', + 'GetListenOverride', + 'IsClientMuted', + 'TR_GetPointContents', + 'TR_GetPointContentsEnt', + 'TR_TraceRay', + 'TR_TraceHull', + 'TR_TraceRayFilter', + 'TR_TraceHullFilter', + 'TR_TraceRayEx', + 'TR_TraceHullEx', + 'TR_TraceRayFilterEx', + 'TR_TraceHullFilterEx', + 'TR_GetFraction', + 'TR_GetEndPosition', + 'TR_GetEntityIndex', + 'TR_DidHit', + 'TR_GetHitGroup', + 'TR_GetPlaneNormal', + 'TR_PointOutsideWorld', + 'SortIntegers', + 'SortFloats', + 'SortStrings', + 'SortFunc1D', + 'SortCustom1D', + 'SortCustom2D', + 'SortADTArray', + 'SortFuncADTArray', + 'SortADTArrayCustom', + 'CompileRegex', + 'MatchRegex', + 'GetRegexSubString', + 'SimpleRegexMatch', + 'TF2_GetPlayerClass', + 'TF2_SetPlayerClass', + 'TF2_RemoveWeaponSlot', + 'TF2_RemoveAllWeapons', + 'TF2_IsPlayerInCondition', + 'TF2_GetObjectType', + 'TF2_GetObjectMode', + 'NominateMap', + 'RemoveNominationByMap', + 'RemoveNominationByOwner', + 'GetExcludeMapList', + 'GetNominatedMapList', + 'CanMapChooserStartVote', + 'InitiateMapChooserVote', + 'HasEndOfMapVoteFinished', + 'EndOfMapVoteEnabled', + 'OnNominationRemoved', + 'OnMapVoteStarted', + 'CreateTimer', + 'KillTimer', + 'TriggerTimer', + 'GetTickedTime', + 'GetMapTimeLeft', + 'GetMapTimeLimit', + 'ExtendMapTimeLimit', + 'GetTickInterval', + 'OnMapTimeLeftChanged', + 'IsServerProcessing', + 'CreateDataTimer', + 'ByteCountToCells', + 'CreateArray', + 'ClearArray', + 'CloneArray', + 'ResizeArray', + 'GetArraySize', + 'PushArrayCell', + 'PushArrayString', + 'PushArrayArray', + 'GetArrayCell', + 'GetArrayString', + 'GetArrayArray', + 'SetArrayCell', + 'SetArrayString', + 'SetArrayArray', + 'ShiftArrayUp', + 'RemoveFromArray', + 'SwapArrayItems', + 'FindStringInArray', + 'FindValueInArray', + 'ProcessTargetString', + 'ReplyToTargetError', + 'MultiTargetFilter', + 'AddMultiTargetFilter', + 'RemoveMultiTargetFilter', + 'OnBanClient', + 'OnBanIdentity', + 'OnRemoveBan', + 'BanClient', + 'BanIdentity', + 'RemoveBan', + 'CreateTrie', + 'SetTrieValue', + 'SetTrieArray', + 'SetTrieString', + 'GetTrieValue', + 'GetTrieArray', + 'GetTrieString', + 'RemoveFromTrie', + 'ClearTrie', + 'GetTrieSize', + 'GetFunctionByName', + 'CreateGlobalForward', + 'CreateForward', + 'GetForwardFunctionCount', + 'AddToForward', + 'RemoveFromForward', + 'RemoveAllFromForward', + 'Call_StartForward', + 'Call_StartFunction', + 'Call_PushCell', + 'Call_PushCellRef', + 'Call_PushFloat', + 'Call_PushFloatRef', + 'Call_PushArray', + 'Call_PushArrayEx', + 'Call_PushString', + 'Call_PushStringEx', + 'Call_Finish', + 'Call_Cancel', + 'NativeCall', + 'CreateNative', + 'ThrowNativeError', + 'GetNativeStringLength', + 'GetNativeString', + 'SetNativeString', + 'GetNativeCell', + 'GetNativeCellRef', + 'SetNativeCellRef', + 'GetNativeArray', + 'SetNativeArray', + 'FormatNativeString', + 'RequestFrameCallback', + 'RequestFrame', + 'OnRebuildAdminCache', + 'DumpAdminCache', + 'AddCommandOverride', + 'GetCommandOverride', + 'UnsetCommandOverride', + 'CreateAdmGroup', + 'FindAdmGroup', + 'SetAdmGroupAddFlag', + 'GetAdmGroupAddFlag', + 'GetAdmGroupAddFlags', + 'SetAdmGroupImmuneFrom', + 'GetAdmGroupImmuneCount', + 'GetAdmGroupImmuneFrom', + 'AddAdmGroupCmdOverride', + 'GetAdmGroupCmdOverride', + 'RegisterAuthIdentType', + 'CreateAdmin', + 'GetAdminUsername', + 'BindAdminIdentity', + 'SetAdminFlag', + 'GetAdminFlag', + 'GetAdminFlags', + 'AdminInheritGroup', + 'GetAdminGroupCount', + 'GetAdminGroup', + 'SetAdminPassword', + 'GetAdminPassword', + 'FindAdminByIdentity', + 'RemoveAdmin', + 'FlagBitsToBitArray', + 'FlagBitArrayToBits', + 'FlagArrayToBits', + 'FlagBitsToArray', + 'FindFlagByName', + 'FindFlagByChar', + 'FindFlagChar', + 'ReadFlagString', + 'CanAdminTarget', + 'CreateAuthMethod', + 'SetAdmGroupImmunityLevel', + 'GetAdmGroupImmunityLevel', + 'SetAdminImmunityLevel', + 'GetAdminImmunityLevel', + 'FlagToBit', + 'BitToFlag', + 'ServerCommand', + 'ServerCommandEx', + 'InsertServerCommand', + 'ServerExecute', + 'ClientCommand', + 'FakeClientCommand', + 'FakeClientCommandEx', + 'PrintToServer', + 'PrintToConsole', + 'ReplyToCommand', + 'GetCmdReplySource', + 'SetCmdReplySource', + 'IsChatTrigger', + 'ShowActivity2', + 'ShowActivity', + 'ShowActivityEx', + 'FormatActivitySource', + 'SrvCmd', + 'RegServerCmd', + 'ConCmd', + 'RegConsoleCmd', + 'RegAdminCmd', + 'GetCmdArgs', + 'GetCmdArg', + 'GetCmdArgString', + 'CreateConVar', + 'FindConVar', + 'ConVarChanged', + 'HookConVarChange', + 'UnhookConVarChange', + 'GetConVarBool', + 'SetConVarBool', + 'GetConVarInt', + 'SetConVarInt', + 'GetConVarFloat', + 'SetConVarFloat', + 'GetConVarString', + 'SetConVarString', + 'ResetConVar', + 'GetConVarDefault', + 'GetConVarFlags', + 'SetConVarFlags', + 'GetConVarBounds', + 'SetConVarBounds', + 'GetConVarName', + 'QueryClientConVar', + 'GetCommandIterator', + 'ReadCommandIterator', + 'CheckCommandAccess', + 'CheckAccess', + 'IsValidConVarChar', + 'GetCommandFlags', + 'SetCommandFlags', + 'FindFirstConCommand', + 'FindNextConCommand', + 'SendConVarValue', + 'AddServerTag', + 'RemoveServerTag', + 'CommandListener', + 'AddCommandListener', + 'RemoveCommandListener', + 'CommandExists', + 'OnClientSayCommand', + 'OnClientSayCommand_Post', + 'TF2_IgnitePlayer', + 'TF2_RespawnPlayer', + 'TF2_RegeneratePlayer', + 'TF2_AddCondition', + 'TF2_RemoveCondition', + 'TF2_SetPlayerPowerPlay', + 'TF2_DisguisePlayer', + 'TF2_RemovePlayerDisguise', + 'TF2_StunPlayer', + 'TF2_MakeBleed', + 'TF2_GetClass', + 'TF2_CalcIsAttackCritical', + 'TF2_OnIsHolidayActive', + 'TF2_IsHolidayActive', + 'TF2_IsPlayerInDuel', + 'TF2_RemoveWearable', + 'TF2_OnConditionAdded', + 'TF2_OnConditionRemoved', + 'TF2_OnWaitingForPlayersStart', + 'TF2_OnWaitingForPlayersEnd', + 'TF2_OnPlayerTeleport', + 'SQL_Connect', + 'SQL_DefConnect', + 'SQL_ConnectCustom', + 'SQLite_UseDatabase', + 'SQL_CheckConfig', + 'SQL_GetDriver', + 'SQL_ReadDriver', + 'SQL_GetDriverIdent', + 'SQL_GetDriverProduct', + 'SQL_SetCharset', + 'SQL_GetAffectedRows', + 'SQL_GetInsertId', + 'SQL_GetError', + 'SQL_EscapeString', + 'SQL_QuoteString', + 'SQL_FastQuery', + 'SQL_Query', + 'SQL_PrepareQuery', + 'SQL_FetchMoreResults', + 'SQL_HasResultSet', + 'SQL_GetRowCount', + 'SQL_GetFieldCount', + 'SQL_FieldNumToName', + 'SQL_FieldNameToNum', + 'SQL_FetchRow', + 'SQL_MoreRows', + 'SQL_Rewind', + 'SQL_FetchString', + 'SQL_FetchFloat', + 'SQL_FetchInt', + 'SQL_IsFieldNull', + 'SQL_FetchSize', + 'SQL_BindParamInt', + 'SQL_BindParamFloat', + 'SQL_BindParamString', + 'SQL_Execute', + 'SQL_LockDatabase', + 'SQL_UnlockDatabase', + 'SQLTCallback', + 'SQL_IsSameConnection', + 'SQL_TConnect', + 'SQL_TQuery', + 'SQL_CreateTransaction', + 'SQL_AddQuery', + 'SQLTxnSuccess', + 'SQLTxnFailure', + 'SQL_ExecuteTransaction', + 'CloseHandle', + 'CloneHandle', + 'MenuHandler', + 'CreateMenu', + 'DisplayMenu', + 'DisplayMenuAtItem', + 'AddMenuItem', + 'InsertMenuItem', + 'RemoveMenuItem', + 'RemoveAllMenuItems', + 'GetMenuItem', + 'GetMenuSelectionPosition', + 'GetMenuItemCount', + 'SetMenuPagination', + 'GetMenuPagination', + 'GetMenuStyle', + 'SetMenuTitle', + 'GetMenuTitle', + 'CreatePanelFromMenu', + 'GetMenuExitButton', + 'SetMenuExitButton', + 'GetMenuExitBackButton', + 'SetMenuExitBackButton', + 'SetMenuNoVoteButton', + 'CancelMenu', + 'GetMenuOptionFlags', + 'SetMenuOptionFlags', + 'IsVoteInProgress', + 'CancelVote', + 'VoteMenu', + 'VoteMenuToAll', + 'VoteHandler', + 'SetVoteResultCallback', + 'CheckVoteDelay', + 'IsClientInVotePool', + 'RedrawClientVoteMenu', + 'GetMenuStyleHandle', + 'CreatePanel', + 'CreateMenuEx', + 'GetClientMenu', + 'CancelClientMenu', + 'GetMaxPageItems', + 'GetPanelStyle', + 'SetPanelTitle', + 'DrawPanelItem', + 'DrawPanelText', + 'CanPanelDrawFlags', + 'SetPanelKeys', + 'SendPanelToClient', + 'GetPanelTextRemaining', + 'GetPanelCurrentKey', + 'SetPanelCurrentKey', + 'RedrawMenuItem', + 'InternalShowMenu', + 'GetMenuVoteInfo', + 'IsNewVoteAllowed', + 'PrefetchSound', + 'EmitAmbientSound', + 'FadeClientVolume', + 'StopSound', + 'EmitSound', + 'EmitSentence', + 'GetDistGainFromSoundLevel', + 'AmbientSHook', + 'NormalSHook', + 'AddAmbientSoundHook', + 'AddNormalSoundHook', + 'RemoveAmbientSoundHook', + 'RemoveNormalSoundHook', + 'EmitSoundToClient', + 'EmitSoundToAll', + 'ATTN_TO_SNDLEVEL', + 'GetGameSoundParams', + 'EmitGameSound', + 'EmitAmbientGameSound', + 'EmitGameSoundToClient', + 'EmitGameSoundToAll', + 'PrecacheScriptSound', + 'strlen', + 'StrContains', + 'strcmp', + 'strncmp', + 'StrEqual', + 'strcopy', + 'Format', + 'FormatEx', + 'VFormat', + 'StringToInt', + 'StringToIntEx', + 'IntToString', + 'StringToFloat', + 'StringToFloatEx', + 'FloatToString', + 'BreakString', + 'TrimString', + 'SplitString', + 'ReplaceString', + 'ReplaceStringEx', + 'GetCharBytes', + 'IsCharAlpha', + 'IsCharNumeric', + 'IsCharSpace', + 'IsCharMB', + 'IsCharUpper', + 'IsCharLower', + 'StripQuotes', + 'CharToUpper', + 'CharToLower', + 'FindCharInString', + 'StrCat', + 'ExplodeString', + 'ImplodeStrings', + 'GetVectorLength', + 'GetVectorDistance', + 'GetVectorDotProduct', + 'GetVectorCrossProduct', + 'NormalizeVector', + 'GetAngleVectors', + 'GetVectorAngles', + 'GetVectorVectors', + 'AddVectors', + 'SubtractVectors', + 'ScaleVector', + 'NegateVector', + 'MakeVectorFromPoints', + 'BaseComm_IsClientGagged', + 'BaseComm_IsClientMuted', + 'BaseComm_SetClientGag', + 'BaseComm_SetClientMute', + 'FormatUserLogText', + 'FindPluginByFile', + 'FindTarget', + 'AcceptEntityInput', + 'SetVariantBool', + 'SetVariantString', + 'SetVariantInt', + 'SetVariantFloat', + 'SetVariantVector3D', + 'SetVariantPosVector3D', + 'SetVariantColor', + 'SetVariantEntity', + 'GameRules_GetProp', + 'GameRules_SetProp', + 'GameRules_GetPropFloat', + 'GameRules_SetPropFloat', + 'GameRules_GetPropEnt', + 'GameRules_SetPropEnt', + 'GameRules_GetPropVector', + 'GameRules_SetPropVector', + 'GameRules_GetPropString', + 'GameRules_SetPropString', + 'GameRules_GetRoundState', + 'OnClientConnect', + 'OnClientConnected', + 'OnClientPutInServer', + 'OnClientDisconnect', + 'OnClientDisconnect_Post', + 'OnClientCommand', + 'OnClientSettingsChanged', + 'OnClientAuthorized', + 'OnClientPreAdminCheck', + 'OnClientPostAdminFilter', + 'OnClientPostAdminCheck', + 'GetMaxClients', + 'GetMaxHumanPlayers', + 'GetClientCount', + 'GetClientName', + 'GetClientIP', + 'GetClientAuthString', + 'GetClientAuthId', + 'GetSteamAccountID', + 'GetClientUserId', + 'IsClientConnected', + 'IsClientInGame', + 'IsClientInKickQueue', + 'IsClientAuthorized', + 'IsFakeClient', + 'IsClientSourceTV', + 'IsClientReplay', + 'IsClientObserver', + 'IsPlayerAlive', + 'GetClientInfo', + 'GetClientTeam', + 'SetUserAdmin', + 'GetUserAdmin', + 'AddUserFlags', + 'RemoveUserFlags', + 'SetUserFlagBits', + 'GetUserFlagBits', + 'CanUserTarget', + 'RunAdminCacheChecks', + 'NotifyPostAdminCheck', + 'CreateFakeClient', + 'SetFakeClientConVar', + 'GetClientHealth', + 'GetClientModel', + 'GetClientWeapon', + 'GetClientMaxs', + 'GetClientMins', + 'GetClientAbsAngles', + 'GetClientAbsOrigin', + 'GetClientArmor', + 'GetClientDeaths', + 'GetClientFrags', + 'GetClientDataRate', + 'IsClientTimingOut', + 'GetClientTime', + 'GetClientLatency', + 'GetClientAvgLatency', + 'GetClientAvgLoss', + 'GetClientAvgChoke', + 'GetClientAvgData', + 'GetClientAvgPackets', + 'GetClientOfUserId', + 'KickClient', + 'KickClientEx', + 'ChangeClientTeam', + 'GetClientSerial', + 'GetClientFromSerial', + 'FindStringTable', + 'GetNumStringTables', + 'GetStringTableNumStrings', + 'GetStringTableMaxStrings', + 'GetStringTableName', + 'FindStringIndex', + 'ReadStringTable', + 'GetStringTableDataLength', + 'GetStringTableData', + 'SetStringTableData', + 'AddToStringTable', + 'LockStringTables', + 'AddFileToDownloadsTable', + 'GetEntityFlags', + 'SetEntityFlags', + 'GetEntityMoveType', + 'SetEntityMoveType', + 'GetEntityRenderMode', + 'SetEntityRenderMode', + 'GetEntityRenderFx', + 'SetEntityRenderFx', + 'SetEntityRenderColor', + 'GetEntityGravity', + 'SetEntityGravity', + 'SetEntityHealth', + 'GetClientButtons', + 'EntityOutput', + 'HookEntityOutput', + 'UnhookEntityOutput', + 'HookSingleEntityOutput', + 'UnhookSingleEntityOutput', + 'SMC_CreateParser', + 'SMC_ParseFile', + 'SMC_GetErrorString', + 'SMC_ParseStart', + 'SMC_SetParseStart', + 'SMC_ParseEnd', + 'SMC_SetParseEnd', + 'SMC_NewSection', + 'SMC_KeyValue', + 'SMC_EndSection', + 'SMC_SetReaders', + 'SMC_RawLine', + 'SMC_SetRawLine', + 'BfWriteBool', + 'BfWriteByte', + 'BfWriteChar', + 'BfWriteShort', + 'BfWriteWord', + 'BfWriteNum', + 'BfWriteFloat', + 'BfWriteString', + 'BfWriteEntity', + 'BfWriteAngle', + 'BfWriteCoord', + 'BfWriteVecCoord', + 'BfWriteVecNormal', + 'BfWriteAngles', + 'BfReadBool', + 'BfReadByte', + 'BfReadChar', + 'BfReadShort', + 'BfReadWord', + 'BfReadNum', + 'BfReadFloat', + 'BfReadString', + 'BfReadEntity', + 'BfReadAngle', + 'BfReadCoord', + 'BfReadVecCoord', + 'BfReadVecNormal', + 'BfReadAngles', + 'BfGetNumBytesLeft', + 'CreateProfiler', + 'StartProfiling', + 'StopProfiling', + 'GetProfilerTime', + 'OnPluginStart', + 'AskPluginLoad2', + 'OnPluginEnd', + 'OnPluginPauseChange', + 'OnGameFrame', + 'OnMapStart', + 'OnMapEnd', + 'OnConfigsExecuted', + 'OnAutoConfigsBuffered', + 'OnAllPluginsLoaded', + 'GetMyHandle', + 'GetPluginIterator', + 'MorePlugins', + 'ReadPlugin', + 'GetPluginStatus', + 'GetPluginFilename', + 'IsPluginDebugging', + 'GetPluginInfo', + 'FindPluginByNumber', + 'SetFailState', + 'ThrowError', + 'GetTime', + 'FormatTime', + 'LoadGameConfigFile', + 'GameConfGetOffset', + 'GameConfGetKeyValue', + 'GameConfGetAddress', + 'GetSysTickCount', + 'AutoExecConfig', + 'RegPluginLibrary', + 'LibraryExists', + 'GetExtensionFileStatus', + 'OnLibraryAdded', + 'OnLibraryRemoved', + 'ReadMapList', + 'SetMapListCompatBind', + 'OnClientFloodCheck', + 'OnClientFloodResult', + 'CanTestFeatures', + 'GetFeatureStatus', + 'RequireFeature', + 'LoadFromAddress', + 'StoreToAddress', + 'CreateStack', + 'PushStackCell', + 'PushStackString', + 'PushStackArray', + 'PopStackCell', + 'PopStackString', + 'PopStackArray', + 'IsStackEmpty', + 'PopStack', + 'OnPlayerRunCmd', + 'BuildPath', + 'OpenDirectory', + 'ReadDirEntry', + 'OpenFile', + 'DeleteFile', + 'ReadFileLine', + 'ReadFile', + 'ReadFileString', + 'WriteFile', + 'WriteFileString', + 'WriteFileLine', + 'ReadFileCell', + 'WriteFileCell', + 'IsEndOfFile', + 'FileSeek', + 'FilePosition', + 'FileExists', + 'RenameFile', + 'DirExists', + 'FileSize', + 'FlushFile', + 'RemoveDir', + 'CreateDirectory', + 'GetFileTime', + 'LogToOpenFile', + 'LogToOpenFileEx', + 'PbReadInt', + 'PbReadFloat', + 'PbReadBool', + 'PbReadString', + 'PbReadColor', + 'PbReadAngle', + 'PbReadVector', + 'PbReadVector2D', + 'PbGetRepeatedFieldCount', + 'PbSetInt', + 'PbSetFloat', + 'PbSetBool', + 'PbSetString', + 'PbSetColor', + 'PbSetAngle', + 'PbSetVector', + 'PbSetVector2D', + 'PbAddInt', + 'PbAddFloat', + 'PbAddBool', + 'PbAddString', + 'PbAddColor', + 'PbAddAngle', + 'PbAddVector', + 'PbAddVector2D', + 'PbRemoveRepeatedFieldValue', + 'PbReadMessage', + 'PbReadRepeatedMessage', + 'PbAddMessage', + 'SetNextMap', + 'GetNextMap', + 'ForceChangeLevel', + 'GetMapHistorySize', + 'GetMapHistory', + 'GeoipCode2', + 'GeoipCode3', + 'GeoipCountry', + 'MarkNativeAsOptional', + 'RegClientCookie', + 'FindClientCookie', + 'SetClientCookie', + 'GetClientCookie', + 'SetAuthIdCookie', + 'AreClientCookiesCached', + 'OnClientCookiesCached', + 'CookieMenuHandler', + 'SetCookiePrefabMenu', + 'SetCookieMenuItem', + 'ShowCookieMenu', + 'GetCookieIterator', + 'ReadCookieIterator', + 'GetCookieAccess', + 'GetClientCookieTime', + 'LoadTranslations', + 'SetGlobalTransTarget', + 'GetClientLanguage', + 'GetServerLanguage', + 'GetLanguageCount', + 'GetLanguageInfo', + 'SetClientLanguage', + 'GetLanguageByCode', + 'GetLanguageByName', + 'CS_OnBuyCommand', + 'CS_OnCSWeaponDrop', + 'CS_OnGetWeaponPrice', + 'CS_OnTerminateRound', + 'CS_RespawnPlayer', + 'CS_SwitchTeam', + 'CS_DropWeapon', + 'CS_TerminateRound', + 'CS_GetTranslatedWeaponAlias', + 'CS_GetWeaponPrice', + 'CS_GetClientClanTag', + 'CS_SetClientClanTag', + 'CS_GetTeamScore', + 'CS_SetTeamScore', + 'CS_GetMVPCount', + 'CS_SetMVPCount', + 'CS_GetClientContributionScore', + 'CS_SetClientContributionScore', + 'CS_GetClientAssists', + 'CS_SetClientAssists', + 'CS_AliasToWeaponID', + 'CS_WeaponIDToAlias', + 'CS_IsValidWeaponID', + 'CS_UpdateClientModel', + 'LogToGame', + 'SetRandomSeed', + 'GetRandomFloat', + 'GetRandomInt', + 'IsMapValid', + 'IsDedicatedServer', + 'GetEngineTime', + 'GetGameTime', + 'GetGameTickCount', + 'GetGameDescription', + 'GetGameFolderName', + 'GetCurrentMap', + 'PrecacheModel', + 'PrecacheSentenceFile', + 'PrecacheDecal', + 'PrecacheGeneric', + 'IsModelPrecached', + 'IsDecalPrecached', + 'IsGenericPrecached', + 'PrecacheSound', + 'IsSoundPrecached', + 'CreateDialog', + 'GetEngineVersion', + 'PrintToChat', + 'PrintToChatAll', + 'PrintCenterText', + 'PrintCenterTextAll', + 'PrintHintText', + 'PrintHintTextToAll', + 'ShowVGUIPanel', + 'CreateHudSynchronizer', + 'SetHudTextParams', + 'SetHudTextParamsEx', + 'ShowSyncHudText', + 'ClearSyncHud', + 'ShowHudText', + 'ShowMOTDPanel', + 'DisplayAskConnectBox', + 'EntIndexToEntRef', + 'EntRefToEntIndex', + 'MakeCompatEntRef', + 'SetClientViewEntity', + 'SetLightStyle', + 'GetClientEyePosition', + 'CreateDataPack', + 'WritePackCell', + 'WritePackFloat', + 'WritePackString', + 'ReadPackCell', + 'ReadPackFloat', + 'ReadPackString', + 'ResetPack', + 'GetPackPosition', + 'SetPackPosition', + 'IsPackReadable', + 'LogMessage', + 'LogToFile', + 'LogToFileEx', + 'LogAction', + 'LogError', + 'OnLogAction', + 'GameLogHook', + 'AddGameLogHook', + 'RemoveGameLogHook', + 'FindTeamByName', + 'StartPrepSDKCall', + 'PrepSDKCall_SetVirtual', + 'PrepSDKCall_SetSignature', + 'PrepSDKCall_SetAddress', + 'PrepSDKCall_SetFromConf', + 'PrepSDKCall_SetReturnInfo', + 'PrepSDKCall_AddParameter', + 'EndPrepSDKCall', + 'SDKCall', + 'GetPlayerResourceEntity', +) + + +if __name__ == '__main__': # pragma: no cover + import re + from urllib.request import FancyURLopener + + from pygments.util import format_lines + + class Opener(FancyURLopener): + version = 'Mozilla/5.0 (Pygments Sourcemod Builtins Update)' + + opener = Opener() + + def get_version(): + f = opener.open('http://docs.sourcemod.net/api/index.php') + r = re.compile(r'SourceMod v\.([\d\.]+(?:-\w+)?)') + for line in f: + m = r.search(line.decode()) + if m is not None: + return m.groups()[0] + raise ValueError('No version in api docs') + + def get_sm_functions(): + f = opener.open('http://docs.sourcemod.net/api/SMfuncs.js') + r = re.compile(r'SMfunctions\[\d+\] = Array \("(?:public )?([^,]+)",".+"\);') + functions = [] + for line in f: + m = r.match(line.decode()) + if m is not None: + functions.append(m.groups()[0]) + return functions + + def regenerate(filename, natives): + with open(filename, encoding='utf-8') as fp: + content = fp.read() + + header = content[:content.find('FUNCTIONS = (')] + footer = content[content.find("if __name__ == '__main__':")-1:] + + + with open(filename, 'w', encoding='utf-8') as fp: + fp.write(header) + fp.write(format_lines('FUNCTIONS', natives)) + fp.write('\n\n' + footer) + + def run(): + version = get_version() + print('> Downloading function index for SourceMod %s' % version) + functions = get_sm_functions() + print('> %d functions found:' % len(functions)) + + functionlist = [] + for full_function_name in functions: + print('>> %s' % full_function_name) + functionlist.append(full_function_name) + + regenerate(__file__, functionlist) + + + run() diff --git a/shared/package-files/9d/9d65ae7f9c036ef8beafd6726075d418b98c5618e6e145ea61e2cdd976e39f3a/blob b/shared/package-files/9d/9d65ae7f9c036ef8beafd6726075d418b98c5618e6e145ea61e2cdd976e39f3a/blob new file mode 100644 index 0000000000000000000000000000000000000000..d936fc1c4f3c022f19f7301d9cedbaf5fa4b5a51 --- /dev/null +++ b/shared/package-files/9d/9d65ae7f9c036ef8beafd6726075d418b98c5618e6e145ea61e2cdd976e39f3a/blob @@ -0,0 +1,1158 @@ +""" +Metadata Routing Utility Tests +""" + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +import re + +import numpy as np +import pytest + +from sklearn import config_context +from sklearn.base import ( + BaseEstimator, + clone, +) +from sklearn.exceptions import UnsetMetadataPassedError +from sklearn.linear_model import LinearRegression +from sklearn.pipeline import Pipeline +from sklearn.tests.metadata_routing_common import ( + ConsumingClassifier, + ConsumingRegressor, + ConsumingTransformer, + MetaRegressor, + MetaTransformer, + NonConsumingClassifier, + WeightedMetaClassifier, + WeightedMetaRegressor, + _Registry, + assert_request_equal, + assert_request_is_empty, + check_recorded_metadata, +) +from sklearn.utils import metadata_routing +from sklearn.utils._metadata_requests import ( + COMPOSITE_METHODS, + METHODS, + SIMPLE_METHODS, + MethodMetadataRequest, + MethodPair, + _MetadataRequester, + request_is_alias, + request_is_valid, +) +from sklearn.utils.metadata_routing import ( + MetadataRequest, + MetadataRouter, + MethodMapping, + _RoutingNotSupportedMixin, + get_routing_for_object, + process_routing, +) +from sklearn.utils.validation import check_is_fitted + +rng = np.random.RandomState(42) +N, M = 100, 4 +X = rng.rand(N, M) +y = rng.randint(0, 2, size=N) +my_groups = rng.randint(0, 10, size=N) +my_weights = rng.rand(N) +my_other_weights = rng.rand(N) + + +class SimplePipeline(BaseEstimator): + """A very simple pipeline, assuming the last step is always a predictor. + + Parameters + ---------- + steps : iterable of objects + An iterable of transformers with the last step being a predictor. + """ + + def __init__(self, steps): + self.steps = steps + + def fit(self, X, y, **fit_params): + self.steps_ = [] + params = process_routing(self, "fit", **fit_params) + X_transformed = X + for i, step in enumerate(self.steps[:-1]): + transformer = clone(step).fit( + X_transformed, y, **params.get(f"step_{i}").fit + ) + self.steps_.append(transformer) + X_transformed = transformer.transform( + X_transformed, **params.get(f"step_{i}").transform + ) + + self.steps_.append( + clone(self.steps[-1]).fit(X_transformed, y, **params.predictor.fit) + ) + return self + + def predict(self, X, **predict_params): + check_is_fitted(self) + X_transformed = X + params = process_routing(self, "predict", **predict_params) + for i, step in enumerate(self.steps_[:-1]): + X_transformed = step.transform(X, **params.get(f"step_{i}").transform) + + return self.steps_[-1].predict(X_transformed, **params.predictor.predict) + + def get_metadata_routing(self): + router = MetadataRouter(owner=self.__class__.__name__) + for i, step in enumerate(self.steps[:-1]): + router.add( + **{f"step_{i}": step}, + method_mapping=MethodMapping() + .add(caller="fit", callee="fit") + .add(caller="fit", callee="transform") + .add(caller="predict", callee="transform"), + ) + router.add( + predictor=self.steps[-1], + method_mapping=MethodMapping() + .add(caller="fit", callee="fit") + .add(caller="predict", callee="predict"), + ) + return router + + +@config_context(enable_metadata_routing=True) +def test_assert_request_is_empty(): + requests = MetadataRequest(owner="test") + assert_request_is_empty(requests) + + requests.fit.add_request(param="foo", alias=None) + # this should still work, since None is the default value + assert_request_is_empty(requests) + + requests.fit.add_request(param="bar", alias="value") + with pytest.raises(AssertionError): + # now requests is no more empty + assert_request_is_empty(requests) + + # but one can exclude a method + assert_request_is_empty(requests, exclude="fit") + + requests.score.add_request(param="carrot", alias=True) + with pytest.raises(AssertionError): + # excluding `fit` is not enough + assert_request_is_empty(requests, exclude="fit") + + # and excluding both fit and score would avoid an exception + assert_request_is_empty(requests, exclude=["fit", "score"]) + + # test if a router is empty + assert_request_is_empty( + MetadataRouter(owner="test") + .add_self_request(WeightedMetaRegressor(estimator=None)) + .add( + estimator=ConsumingRegressor(), + method_mapping=MethodMapping().add(caller="fit", callee="fit"), + ) + ) + + +@pytest.mark.parametrize( + "estimator", + [ + ConsumingClassifier(registry=_Registry()), + ConsumingRegressor(registry=_Registry()), + ConsumingTransformer(registry=_Registry()), + WeightedMetaClassifier(estimator=ConsumingClassifier(), registry=_Registry()), + WeightedMetaRegressor(estimator=ConsumingRegressor(), registry=_Registry()), + ], +) +@config_context(enable_metadata_routing=True) +def test_estimator_puts_self_in_registry(estimator): + """Check that an estimator puts itself in the registry upon fit.""" + estimator.fit(X, y) + assert estimator in estimator.registry + + +@pytest.mark.parametrize( + "val, res", + [ + (False, False), + (True, False), + (None, False), + ("$UNUSED$", False), + ("$WARN$", False), + ("invalid-input", False), + ("valid_arg", True), + ], +) +@config_context(enable_metadata_routing=True) +def test_request_type_is_alias(val, res): + # Test request_is_alias + assert request_is_alias(val) == res + + +@pytest.mark.parametrize( + "val, res", + [ + (False, True), + (True, True), + (None, True), + ("$UNUSED$", True), + ("$WARN$", True), + ("invalid-input", False), + ("alias_arg", False), + ], +) +@config_context(enable_metadata_routing=True) +def test_request_type_is_valid(val, res): + # Test request_is_valid + assert request_is_valid(val) == res + + +@config_context(enable_metadata_routing=True) +def test_default_requests(): + class OddEstimator(BaseEstimator): + __metadata_request__fit = { + # set a different default request + "sample_weight": True + } # type: ignore[var-annotated] + + odd_request = get_routing_for_object(OddEstimator()) + assert odd_request.fit.requests == {"sample_weight": True} + + # check other test estimators + assert not len(get_routing_for_object(NonConsumingClassifier()).fit.requests) + assert_request_is_empty(NonConsumingClassifier().get_metadata_routing()) + + trs_request = get_routing_for_object(ConsumingTransformer()) + assert trs_request.fit.requests == { + "sample_weight": None, + "metadata": None, + } + assert trs_request.transform.requests == {"metadata": None, "sample_weight": None} + assert_request_is_empty(trs_request) + + est_request = get_routing_for_object(ConsumingClassifier()) + assert est_request.fit.requests == { + "sample_weight": None, + "metadata": None, + } + assert_request_is_empty(est_request) + + +@config_context(enable_metadata_routing=True) +def test_default_request_override(): + """Test that default requests are correctly overridden regardless of the ASCII order + of the class names, hence testing small and capital letter class name starts. + Non-regression test for https://github.com/scikit-learn/scikit-learn/issues/28430 + """ + + class Base(BaseEstimator): + __metadata_request__split = {"groups": True} + + class class_1(Base): + __metadata_request__split = {"groups": "sample_domain"} + + class Class_1(Base): + __metadata_request__split = {"groups": "sample_domain"} + + assert_request_equal( + class_1()._get_metadata_request(), {"split": {"groups": "sample_domain"}} + ) + assert_request_equal( + Class_1()._get_metadata_request(), {"split": {"groups": "sample_domain"}} + ) + + +@config_context(enable_metadata_routing=True) +def test_process_routing_invalid_method(): + with pytest.raises(TypeError, match="Can only route and process input"): + process_routing(ConsumingClassifier(), "invalid_method", groups=my_groups) + + +@config_context(enable_metadata_routing=True) +def test_process_routing_invalid_object(): + class InvalidObject: + pass + + with pytest.raises(AttributeError, match="either implement the routing method"): + process_routing(InvalidObject(), "fit", groups=my_groups) + + +@pytest.mark.parametrize("method", METHODS) +@pytest.mark.parametrize("default", [None, "default", []]) +@config_context(enable_metadata_routing=True) +def test_process_routing_empty_params_get_with_default(method, default): + empty_params = {} + routed_params = process_routing(ConsumingClassifier(), "fit", **empty_params) + + # Behaviour should be an empty dictionary returned for each method when retrieved. + params_for_method = routed_params[method] + assert isinstance(params_for_method, dict) + assert set(params_for_method.keys()) == set(METHODS) + + # No default to `get` should be equivalent to the default + default_params_for_method = routed_params.get(method, default=default) + assert default_params_for_method == params_for_method + + +@config_context(enable_metadata_routing=True) +def test_simple_metadata_routing(): + # Tests that metadata is properly routed + + # The underlying estimator doesn't accept or request metadata + clf = WeightedMetaClassifier(estimator=NonConsumingClassifier()) + clf.fit(X, y) + + # Meta-estimator consumes sample_weight, but doesn't forward it to the underlying + # estimator + clf = WeightedMetaClassifier(estimator=NonConsumingClassifier()) + clf.fit(X, y, sample_weight=my_weights) + + # If the estimator accepts the metadata but doesn't explicitly say it doesn't + # need it, there's an error + clf = WeightedMetaClassifier(estimator=ConsumingClassifier()) + err_message = ( + "[sample_weight] are passed but are not explicitly set as requested or" + " not requested for ConsumingClassifier.fit" + ) + with pytest.raises(ValueError, match=re.escape(err_message)): + clf.fit(X, y, sample_weight=my_weights) + + # Explicitly saying the estimator doesn't need it, makes the error go away, + # because in this case `WeightedMetaClassifier` consumes `sample_weight`. If + # there was no consumer of sample_weight, passing it would result in an + # error. + clf = WeightedMetaClassifier( + estimator=ConsumingClassifier().set_fit_request(sample_weight=False) + ) + # this doesn't raise since WeightedMetaClassifier itself is a consumer, + # and passing metadata to the consumer directly is fine regardless of its + # metadata_request values. + clf.fit(X, y, sample_weight=my_weights) + check_recorded_metadata(clf.estimator_, method="fit", parent="fit") + + # Requesting a metadata will make the meta-estimator forward it correctly + clf = WeightedMetaClassifier( + estimator=ConsumingClassifier().set_fit_request(sample_weight=True) + ) + clf.fit(X, y, sample_weight=my_weights) + check_recorded_metadata( + clf.estimator_, method="fit", parent="fit", sample_weight=my_weights + ) + + # And requesting it with an alias + clf = WeightedMetaClassifier( + estimator=ConsumingClassifier().set_fit_request( + sample_weight="alternative_weight" + ) + ) + clf.fit(X, y, alternative_weight=my_weights) + check_recorded_metadata( + clf.estimator_, method="fit", parent="fit", sample_weight=my_weights + ) + + +@config_context(enable_metadata_routing=True) +def test_nested_routing(): + # check if metadata is routed in a nested routing situation. + pipeline = SimplePipeline( + [ + MetaTransformer( + transformer=ConsumingTransformer() + .set_fit_request(metadata=True, sample_weight=False) + .set_transform_request(sample_weight=True, metadata=False) + ), + WeightedMetaRegressor( + estimator=ConsumingRegressor() + .set_fit_request(sample_weight="inner_weights", metadata=False) + .set_predict_request(sample_weight=False) + ).set_fit_request(sample_weight="outer_weights"), + ] + ) + w1, w2, w3 = [1], [2], [3] + pipeline.fit( + X, y, metadata=my_groups, sample_weight=w1, outer_weights=w2, inner_weights=w3 + ) + check_recorded_metadata( + pipeline.steps_[0].transformer_, + method="fit", + parent="fit", + metadata=my_groups, + ) + check_recorded_metadata( + pipeline.steps_[0].transformer_, + method="transform", + parent="fit", + sample_weight=w1, + ) + check_recorded_metadata( + pipeline.steps_[1], method="fit", parent="fit", sample_weight=w2 + ) + check_recorded_metadata( + pipeline.steps_[1].estimator_, method="fit", parent="fit", sample_weight=w3 + ) + + pipeline.predict(X, sample_weight=w3) + check_recorded_metadata( + pipeline.steps_[0].transformer_, + method="transform", + parent="fit", + sample_weight=w3, + ) + + +@config_context(enable_metadata_routing=True) +def test_nested_routing_conflict(): + # check if an error is raised if there's a conflict between keys + pipeline = SimplePipeline( + [ + MetaTransformer( + transformer=ConsumingTransformer() + .set_fit_request(metadata=True, sample_weight=False) + .set_transform_request(sample_weight=True) + ), + WeightedMetaRegressor( + estimator=ConsumingRegressor().set_fit_request(sample_weight=True) + ).set_fit_request(sample_weight="outer_weights"), + ] + ) + w1, w2 = [1], [2] + with pytest.raises( + ValueError, + match=( + re.escape( + "In WeightedMetaRegressor, there is a conflict on sample_weight between" + " what is requested for this estimator and what is requested by its" + " children. You can resolve this conflict by using an alias for the" + " child estimators' requested metadata." + ) + ), + ): + pipeline.fit(X, y, metadata=my_groups, sample_weight=w1, outer_weights=w2) + + +@config_context(enable_metadata_routing=True) +def test_invalid_metadata(): + # check that passing wrong metadata raises an error + trs = MetaTransformer( + transformer=ConsumingTransformer().set_transform_request(sample_weight=True) + ) + with pytest.raises( + TypeError, + match=(re.escape("transform got unexpected argument(s) {'other_param'}")), + ): + trs.fit(X, y).transform(X, other_param=my_weights) + + # passing a metadata which is not requested by any estimator should also raise + trs = MetaTransformer( + transformer=ConsumingTransformer().set_transform_request(sample_weight=False) + ) + with pytest.raises( + TypeError, + match=(re.escape("transform got unexpected argument(s) {'sample_weight'}")), + ): + trs.fit(X, y).transform(X, sample_weight=my_weights) + + +@config_context(enable_metadata_routing=True) +def test_get_metadata_routing(): + class TestDefaultsBadMethodName(_MetadataRequester): + __metadata_request__fit = { + "sample_weight": None, + "my_param": None, + } + __metadata_request__score = { + "sample_weight": None, + "my_param": True, + "my_other_param": None, + } + # this will raise an error since we don't understand "other_method" as a method + __metadata_request__other_method = {"my_param": True} + + class TestDefaults(_MetadataRequester): + __metadata_request__fit = { + "sample_weight": None, + "my_other_param": None, + } + __metadata_request__score = { + "sample_weight": None, + "my_param": True, + "my_other_param": None, + } + __metadata_request__predict = {"my_param": True} + + with pytest.raises( + AttributeError, match="'MetadataRequest' object has no attribute 'other_method'" + ): + TestDefaultsBadMethodName().get_metadata_routing() + + expected = { + "score": { + "my_param": True, + "my_other_param": None, + "sample_weight": None, + }, + "fit": { + "my_other_param": None, + "sample_weight": None, + }, + "predict": {"my_param": True}, + } + assert_request_equal(TestDefaults().get_metadata_routing(), expected) + + est = TestDefaults().set_score_request(my_param="other_param") + expected = { + "score": { + "my_param": "other_param", + "my_other_param": None, + "sample_weight": None, + }, + "fit": { + "my_other_param": None, + "sample_weight": None, + }, + "predict": {"my_param": True}, + } + assert_request_equal(est.get_metadata_routing(), expected) + + est = TestDefaults().set_fit_request(sample_weight=True) + expected = { + "score": { + "my_param": True, + "my_other_param": None, + "sample_weight": None, + }, + "fit": { + "my_other_param": None, + "sample_weight": True, + }, + "predict": {"my_param": True}, + } + assert_request_equal(est.get_metadata_routing(), expected) + + +@config_context(enable_metadata_routing=True) +def test_setting_default_requests(): + # Test _get_default_requests method + test_cases = dict() + + class ExplicitRequest(BaseEstimator): + # `fit` doesn't accept `props` explicitly, but we want to request it + __metadata_request__fit = {"prop": None} + + def fit(self, X, y, **kwargs): + return self + + test_cases[ExplicitRequest] = {"prop": None} + + class ExplicitRequestOverwrite(BaseEstimator): + # `fit` explicitly accepts `props`, but we want to change the default + # request value from None to True + __metadata_request__fit = {"prop": True} + + def fit(self, X, y, prop=None, **kwargs): + return self + + test_cases[ExplicitRequestOverwrite] = {"prop": True} + + class ImplicitRequest(BaseEstimator): + # `fit` requests `prop` and the default None should be used + def fit(self, X, y, prop=None, **kwargs): + return self + + test_cases[ImplicitRequest] = {"prop": None} + + class ImplicitRequestRemoval(BaseEstimator): + # `fit` (in this class or a parent) requests `prop`, but we don't want + # it requested at all. + __metadata_request__fit = {"prop": metadata_routing.UNUSED} + + def fit(self, X, y, prop=None, **kwargs): + return self + + test_cases[ImplicitRequestRemoval] = {} + + for Klass, requests in test_cases.items(): + assert get_routing_for_object(Klass()).fit.requests == requests + assert_request_is_empty(Klass().get_metadata_routing(), exclude="fit") + Klass().fit(None, None) # for coverage + + +@config_context(enable_metadata_routing=True) +def test_removing_non_existing_param_raises(): + """Test that removing a metadata using UNUSED which doesn't exist raises.""" + + class InvalidRequestRemoval(BaseEstimator): + # `fit` (in this class or a parent) requests `prop`, but we don't want + # it requested at all. + __metadata_request__fit = {"prop": metadata_routing.UNUSED} + + def fit(self, X, y, **kwargs): + return self + + with pytest.raises(ValueError, match="Trying to remove parameter"): + InvalidRequestRemoval().get_metadata_routing() + + +@config_context(enable_metadata_routing=True) +def test_method_metadata_request(): + mmr = MethodMetadataRequest(owner="test", method="fit") + + with pytest.raises(ValueError, match="The alias you're setting for"): + mmr.add_request(param="foo", alias=1.4) + + mmr.add_request(param="foo", alias=None) + assert mmr.requests == {"foo": None} + mmr.add_request(param="foo", alias=False) + assert mmr.requests == {"foo": False} + mmr.add_request(param="foo", alias=True) + assert mmr.requests == {"foo": True} + mmr.add_request(param="foo", alias="foo") + assert mmr.requests == {"foo": True} + mmr.add_request(param="foo", alias="bar") + assert mmr.requests == {"foo": "bar"} + assert mmr._get_param_names(return_alias=False) == {"foo"} + assert mmr._get_param_names(return_alias=True) == {"bar"} + + +@config_context(enable_metadata_routing=True) +def test_get_routing_for_object(): + class Consumer(BaseEstimator): + __metadata_request__fit = {"prop": None} + + assert_request_is_empty(get_routing_for_object(None)) + assert_request_is_empty(get_routing_for_object(object())) + + mr = MetadataRequest(owner="test") + mr.fit.add_request(param="foo", alias="bar") + mr_factory = get_routing_for_object(mr) + assert_request_is_empty(mr_factory, exclude="fit") + assert mr_factory.fit.requests == {"foo": "bar"} + + mr = get_routing_for_object(Consumer()) + assert_request_is_empty(mr, exclude="fit") + assert mr.fit.requests == {"prop": None} + + +@config_context(enable_metadata_routing=True) +def test_metadata_request_consumes_method(): + """Test that MetadataRequest().consumes() method works as expected.""" + request = MetadataRouter(owner="test") + assert request.consumes(method="fit", params={"foo"}) == set() + + request = MetadataRequest(owner="test") + request.fit.add_request(param="foo", alias=True) + assert request.consumes(method="fit", params={"foo"}) == {"foo"} + + request = MetadataRequest(owner="test") + request.fit.add_request(param="foo", alias="bar") + assert request.consumes(method="fit", params={"bar", "foo"}) == {"bar"} + + +@config_context(enable_metadata_routing=True) +def test_metadata_router_consumes_method(): + """Test that MetadataRouter().consumes method works as expected.""" + # having it here instead of parametrizing the test since `set_fit_request` + # is not available while collecting the tests. + cases = [ + ( + WeightedMetaRegressor( + estimator=ConsumingRegressor().set_fit_request(sample_weight=True) + ), + {"sample_weight"}, + {"sample_weight"}, + ), + ( + WeightedMetaRegressor( + estimator=ConsumingRegressor().set_fit_request( + sample_weight="my_weights" + ) + ), + {"my_weights", "sample_weight"}, + {"my_weights"}, + ), + ] + + for obj, input, output in cases: + assert obj.get_metadata_routing().consumes(method="fit", params=input) == output + + +@config_context(enable_metadata_routing=True) +def test_metaestimator_warnings(): + class WeightedMetaRegressorWarn(WeightedMetaRegressor): + __metadata_request__fit = {"sample_weight": metadata_routing.WARN} + + with pytest.warns( + UserWarning, match="Support for .* has recently been added to this class" + ): + WeightedMetaRegressorWarn( + estimator=LinearRegression().set_fit_request(sample_weight=False) + ).fit(X, y, sample_weight=my_weights) + + +@config_context(enable_metadata_routing=True) +def test_estimator_warnings(): + class ConsumingRegressorWarn(ConsumingRegressor): + __metadata_request__fit = {"sample_weight": metadata_routing.WARN} + + with pytest.warns( + UserWarning, match="Support for .* has recently been added to this class" + ): + MetaRegressor(estimator=ConsumingRegressorWarn()).fit( + X, y, sample_weight=my_weights + ) + + +@config_context(enable_metadata_routing=True) +@pytest.mark.parametrize( + "obj, string", + [ + ( + MethodMetadataRequest(owner="test", method="fit").add_request( + param="foo", alias="bar" + ), + "{'foo': 'bar'}", + ), + ( + MetadataRequest(owner="test"), + "{}", + ), + ( + MetadataRouter(owner="test").add( + estimator=ConsumingRegressor(), + method_mapping=MethodMapping().add(caller="predict", callee="predict"), + ), + ( + "{'estimator': {'mapping': [{'caller': 'predict', 'callee':" + " 'predict'}], 'router': {'fit': {'sample_weight': None, 'metadata':" + " None}, 'partial_fit': {'sample_weight': None, 'metadata': None}," + " 'predict': {'sample_weight': None, 'metadata': None}, 'score':" + " {'sample_weight': None, 'metadata': None}}}}" + ), + ), + ], +) +@config_context(enable_metadata_routing=True) +def test_string_representations(obj, string): + assert str(obj) == string + + +@pytest.mark.parametrize( + "obj, method, inputs, err_cls, err_msg", + [ + ( + MethodMapping(), + "add", + {"caller": "fit", "callee": "invalid"}, + ValueError, + "Given callee", + ), + ( + MethodMapping(), + "add", + {"caller": "invalid", "callee": "fit"}, + ValueError, + "Given caller", + ), + ( + MetadataRouter(owner="test"), + "add_self_request", + {"obj": MetadataRouter(owner="test")}, + ValueError, + "Given `obj` is neither a `MetadataRequest` nor does it implement", + ), + ( + ConsumingClassifier(), + "set_fit_request", + {"invalid": True}, + TypeError, + "Unexpected args", + ), + ], +) +@config_context(enable_metadata_routing=True) +def test_validations(obj, method, inputs, err_cls, err_msg): + with pytest.raises(err_cls, match=err_msg): + getattr(obj, method)(**inputs) + + +@config_context(enable_metadata_routing=True) +def test_methodmapping(): + mm = ( + MethodMapping() + .add(caller="fit", callee="transform") + .add(caller="fit", callee="fit") + ) + + mm_list = list(mm) + assert mm_list[0] == ("fit", "transform") + assert mm_list[1] == ("fit", "fit") + + mm = MethodMapping() + for method in METHODS: + mm.add(caller=method, callee=method) + assert MethodPair(method, method) in mm._routes + assert len(mm._routes) == len(METHODS) + + mm = MethodMapping().add(caller="score", callee="score") + assert repr(mm) == "[{'caller': 'score', 'callee': 'score'}]" + + +@config_context(enable_metadata_routing=True) +def test_metadatarouter_add_self_request(): + # adding a MetadataRequest as `self` adds a copy + request = MetadataRequest(owner="nested") + request.fit.add_request(param="param", alias=True) + router = MetadataRouter(owner="test").add_self_request(request) + assert str(router._self_request) == str(request) + # should be a copy, not the same object + assert router._self_request is not request + + # one can add an estimator as self + est = ConsumingRegressor().set_fit_request(sample_weight="my_weights") + router = MetadataRouter(owner="test").add_self_request(obj=est) + assert str(router._self_request) == str(est.get_metadata_routing()) + assert router._self_request is not est.get_metadata_routing() + + # adding a consumer+router as self should only add the consumer part + est = WeightedMetaRegressor( + estimator=ConsumingRegressor().set_fit_request(sample_weight="nested_weights") + ) + router = MetadataRouter(owner="test").add_self_request(obj=est) + # _get_metadata_request() returns the consumer part of the requests + assert str(router._self_request) == str(est._get_metadata_request()) + # get_metadata_routing() returns the complete request set, consumer and + # router included. + assert str(router._self_request) != str(est.get_metadata_routing()) + # it should be a copy, not the same object + assert router._self_request is not est._get_metadata_request() + + +@config_context(enable_metadata_routing=True) +def test_metadata_routing_add(): + # adding one with a string `method_mapping` + router = MetadataRouter(owner="test").add( + est=ConsumingRegressor().set_fit_request(sample_weight="weights"), + method_mapping=MethodMapping().add(caller="fit", callee="fit"), + ) + assert ( + str(router) + == "{'est': {'mapping': [{'caller': 'fit', 'callee': 'fit'}], 'router': {'fit':" + " {'sample_weight': 'weights', 'metadata': None}, 'partial_fit':" + " {'sample_weight': None, 'metadata': None}, 'predict': {'sample_weight':" + " None, 'metadata': None}, 'score': {'sample_weight': None, 'metadata':" + " None}}}}" + ) + + # adding one with an instance of MethodMapping + router = MetadataRouter(owner="test").add( + method_mapping=MethodMapping().add(caller="fit", callee="score"), + est=ConsumingRegressor().set_score_request(sample_weight=True), + ) + assert ( + str(router) + == "{'est': {'mapping': [{'caller': 'fit', 'callee': 'score'}], 'router':" + " {'fit': {'sample_weight': None, 'metadata': None}, 'partial_fit':" + " {'sample_weight': None, 'metadata': None}, 'predict': {'sample_weight':" + " None, 'metadata': None}, 'score': {'sample_weight': True, 'metadata':" + " None}}}}" + ) + + +@config_context(enable_metadata_routing=True) +def test_metadata_routing_get_param_names(): + router = ( + MetadataRouter(owner="test") + .add_self_request( + WeightedMetaRegressor(estimator=ConsumingRegressor()).set_fit_request( + sample_weight="self_weights" + ) + ) + .add( + trs=ConsumingTransformer().set_fit_request( + sample_weight="transform_weights" + ), + method_mapping=MethodMapping().add(caller="fit", callee="fit"), + ) + ) + + assert ( + str(router) + == "{'$self_request': {'fit': {'sample_weight': 'self_weights'}, 'score':" + " {'sample_weight': None}}, 'trs': {'mapping': [{'caller': 'fit', 'callee':" + " 'fit'}], 'router': {'fit': {'sample_weight': 'transform_weights'," + " 'metadata': None}, 'transform': {'sample_weight': None, 'metadata': None}," + " 'inverse_transform': {'sample_weight': None, 'metadata': None}}}}" + ) + + assert router._get_param_names( + method="fit", return_alias=True, ignore_self_request=False + ) == {"transform_weights", "metadata", "self_weights"} + # return_alias=False will return original names for "self" + assert router._get_param_names( + method="fit", return_alias=False, ignore_self_request=False + ) == {"sample_weight", "metadata", "transform_weights"} + # ignoring self would remove "sample_weight" + assert router._get_param_names( + method="fit", return_alias=False, ignore_self_request=True + ) == {"metadata", "transform_weights"} + # return_alias is ignored when ignore_self_request=True + assert router._get_param_names( + method="fit", return_alias=True, ignore_self_request=True + ) == router._get_param_names( + method="fit", return_alias=False, ignore_self_request=True + ) + + +@config_context(enable_metadata_routing=True) +def test_method_generation(): + # Test if all required request methods are generated. + + # TODO: these test classes can be moved to sklearn.utils._testing once we + # have a better idea of what the commonly used classes are. + class SimpleEstimator(BaseEstimator): + # This class should have no set_{method}_request + def fit(self, X, y): + pass # pragma: no cover + + def fit_transform(self, X, y): + pass # pragma: no cover + + def fit_predict(self, X, y): + pass # pragma: no cover + + def partial_fit(self, X, y): + pass # pragma: no cover + + def predict(self, X): + pass # pragma: no cover + + def predict_proba(self, X): + pass # pragma: no cover + + def predict_log_proba(self, X): + pass # pragma: no cover + + def decision_function(self, X): + pass # pragma: no cover + + def score(self, X, y): + pass # pragma: no cover + + def split(self, X, y=None): + pass # pragma: no cover + + def transform(self, X): + pass # pragma: no cover + + def inverse_transform(self, X): + pass # pragma: no cover + + for method in METHODS: + assert not hasattr(SimpleEstimator(), f"set_{method}_request") + + class SimpleEstimator(BaseEstimator): + # This class should have every set_{method}_request + def fit(self, X, y, sample_weight=None): + pass # pragma: no cover + + def fit_transform(self, X, y, sample_weight=None): + pass # pragma: no cover + + def fit_predict(self, X, y, sample_weight=None): + pass # pragma: no cover + + def partial_fit(self, X, y, sample_weight=None): + pass # pragma: no cover + + def predict(self, X, sample_weight=None): + pass # pragma: no cover + + def predict_proba(self, X, sample_weight=None): + pass # pragma: no cover + + def predict_log_proba(self, X, sample_weight=None): + pass # pragma: no cover + + def decision_function(self, X, sample_weight=None): + pass # pragma: no cover + + def score(self, X, y, sample_weight=None): + pass # pragma: no cover + + def split(self, X, y=None, sample_weight=None): + pass # pragma: no cover + + def transform(self, X, sample_weight=None): + pass # pragma: no cover + + def inverse_transform(self, X, sample_weight=None): + pass # pragma: no cover + + # composite methods shouldn't have a corresponding set method. + for method in COMPOSITE_METHODS: + assert not hasattr(SimpleEstimator(), f"set_{method}_request") + + # simple methods should have a corresponding set method. + for method in SIMPLE_METHODS: + assert hasattr(SimpleEstimator(), f"set_{method}_request") + + +@config_context(enable_metadata_routing=True) +def test_composite_methods(): + # Test the behavior and the values of methods (composite methods) whose + # request values are a union of requests by other methods (simple methods). + # fit_transform and fit_predict are the only composite methods we have in + # scikit-learn. + class SimpleEstimator(BaseEstimator): + # This class should have every set_{method}_request + def fit(self, X, y, foo=None, bar=None): + pass # pragma: no cover + + def predict(self, X, foo=None, bar=None): + pass # pragma: no cover + + def transform(self, X, other_param=None): + pass # pragma: no cover + + est = SimpleEstimator() + # Since no request is set for fit or predict or transform, the request for + # fit_transform and fit_predict should also be empty. + assert est.get_metadata_routing().fit_transform.requests == { + "bar": None, + "foo": None, + "other_param": None, + } + assert est.get_metadata_routing().fit_predict.requests == {"bar": None, "foo": None} + + # setting the request on only one of them should raise an error + est.set_fit_request(foo=True, bar="test") + with pytest.raises(ValueError, match="Conflicting metadata requests for"): + est.get_metadata_routing().fit_predict + + # setting the request on the other one should fail if not the same as the + # first method + est.set_predict_request(bar=True) + with pytest.raises(ValueError, match="Conflicting metadata requests for"): + est.get_metadata_routing().fit_predict + + # now the requests are consistent and getting the requests for fit_predict + # shouldn't raise. + est.set_predict_request(foo=True, bar="test") + est.get_metadata_routing().fit_predict + + # setting the request for a none-overlapping parameter would merge them + # together. + est.set_transform_request(other_param=True) + assert est.get_metadata_routing().fit_transform.requests == { + "bar": "test", + "foo": True, + "other_param": True, + } + + +@config_context(enable_metadata_routing=True) +def test_no_feature_flag_raises_error(): + """Test that when feature flag disabled, set_{method}_requests raises.""" + with config_context(enable_metadata_routing=False): + with pytest.raises(RuntimeError, match="This method is only available"): + ConsumingClassifier().set_fit_request(sample_weight=True) + + +@config_context(enable_metadata_routing=True) +def test_none_metadata_passed(): + """Test that passing None as metadata when not requested doesn't raise""" + MetaRegressor(estimator=ConsumingRegressor()).fit(X, y, sample_weight=None) + + +@config_context(enable_metadata_routing=True) +def test_no_metadata_always_works(): + """Test that when no metadata is passed, having a meta-estimator which does + not yet support metadata routing works. + + Non-regression test for https://github.com/scikit-learn/scikit-learn/issues/28246 + """ + + class Estimator(_RoutingNotSupportedMixin, BaseEstimator): + def fit(self, X, y, metadata=None): + return self + + # This passes since no metadata is passed. + MetaRegressor(estimator=Estimator()).fit(X, y) + # This fails since metadata is passed but Estimator() does not support it. + with pytest.raises( + NotImplementedError, match="Estimator has not implemented metadata routing yet." + ): + MetaRegressor(estimator=Estimator()).fit(X, y, metadata=my_groups) + + +@config_context(enable_metadata_routing=True) +def test_unsetmetadatapassederror_correct(): + """Test that UnsetMetadataPassedError raises the correct error message when + set_{method}_request is not set in nested cases.""" + weighted_meta = WeightedMetaClassifier(estimator=ConsumingClassifier()) + pipe = SimplePipeline([weighted_meta]) + msg = re.escape( + "[metadata] are passed but are not explicitly set as requested or not requested" + " for ConsumingClassifier.fit, which is used within WeightedMetaClassifier.fit." + " Call `ConsumingClassifier.set_fit_request({metadata}=True/False)` for each" + " metadata you want to request/ignore." + ) + + with pytest.raises(UnsetMetadataPassedError, match=msg): + pipe.fit(X, y, metadata="blah") + + +@config_context(enable_metadata_routing=True) +def test_unsetmetadatapassederror_correct_for_composite_methods(): + """Test that UnsetMetadataPassedError raises the correct error message when + composite metadata request methods are not set in nested cases.""" + consuming_transformer = ConsumingTransformer() + pipe = Pipeline([("consuming_transformer", consuming_transformer)]) + + msg = re.escape( + "[metadata] are passed but are not explicitly set as requested or not requested" + " for ConsumingTransformer.fit_transform, which is used within" + " Pipeline.fit_transform. Call" + " `ConsumingTransformer.set_fit_request({metadata}=True/False)" + ".set_transform_request({metadata}=True/False)`" + " for each metadata you want to request/ignore." + ) + with pytest.raises(UnsetMetadataPassedError, match=msg): + pipe.fit_transform(X, y, metadata="blah") + + +@config_context(enable_metadata_routing=True) +def test_unbound_set_methods_work(): + """Tests that if the set_{method}_request is unbound, it still works. + + Also test that passing positional arguments to the set_{method}_request fails + with the right TypeError message. + + Non-regression test for https://github.com/scikit-learn/scikit-learn/issues/28632 + """ + + class A(BaseEstimator): + def fit(self, X, y, sample_weight=None): + return self + + error_message = re.escape( + "set_fit_request() takes 0 positional argument but 1 were given" + ) + + # Test positional arguments error before making the descriptor method unbound. + with pytest.raises(TypeError, match=error_message): + A().set_fit_request(True) + + # This somehow makes the descriptor method unbound, which results in the `instance` + # argument being None, and instead `self` being passed as a positional argument + # to the descriptor method. + A.set_fit_request = A.set_fit_request + + # This should pass as usual + A().set_fit_request(sample_weight=True) + + # Test positional arguments error after making the descriptor method unbound. + with pytest.raises(TypeError, match=error_message): + A().set_fit_request(True) diff --git a/shared/package-files/9d/9d6768e42020d043cb7b14d9e897a1cb2f391834230bc93b1ac27ab42539ce80/blob b/shared/package-files/9d/9d6768e42020d043cb7b14d9e897a1cb2f391834230bc93b1ac27ab42539ce80/blob new file mode 100644 index 0000000000000000000000000000000000000000..83cc81bb6b002c5df4110f52c0b6cb9a8e04e3c5 --- /dev/null +++ b/shared/package-files/9d/9d6768e42020d043cb7b14d9e897a1cb2f391834230bc93b1ac27ab42539ce80/blob @@ -0,0 +1,144 @@ +import torch +import torch.nn as nn +import torch.ao.nn.quantized as nnq + +import torch.ao.quantization +import torch.ao.ns._numeric_suite as ns + +__all__ = [ + "get_module", + "parent_child_names", + "get_param", + "MeanShadowLogger", + "bias_correction", +] + +_supported_modules = {nn.Linear, nn.Conv2d} +_supported_modules_quantized = {nnq.Linear, nnq.Conv2d} + +def get_module(model, name): + """Given name of submodule, this function grabs the submodule from given model.""" + return dict(model.named_modules())[name] + +def parent_child_names(name): + """Split full name of submodule into parent submodule's full name and submodule's name.""" + split_name = name.rsplit('.', 1) + if len(split_name) == 1: + return '', split_name[0] + else: + return split_name[0], split_name[1] + +def get_param(module, attr): + """Get the parameter given a module and attribute. + + Sometimes the weights/bias attribute gives you the raw tensor, but sometimes + gives a function that will give you the raw tensor, this function takes care of that logic + """ + param = getattr(module, attr, None) + if callable(param): + return param() + else: + return param + +class MeanShadowLogger(ns.Logger): + """Mean Logger for a Shadow module. + + A logger for a Shadow module whose purpose is to record the rolling mean + of the data passed to the floating point and quantized models + """ + + def __init__(self): + """Set up initial values for float and quantized stats, count, float sum, and quant sum.""" + super().__init__() + self.stats["float"] = None + self.stats["quantized"] = None + self.count = 0 + self.float_sum = None + self.quant_sum = None + + def forward(self, x, y): + """Compute the average of quantized and floating-point data from modules. + + The inputs x,y are output data from the quantized and floating-point modules. + x is for the quantized module, y is for the floating point module + """ + if x.is_quantized: + x = x.dequantize() + + self.count += 1 + if self.stats["quantized"] is None: + self.stats["quantized"] = x + self.quant_sum = x + else: + self.quant_sum += x + self.stats["quantized"] = self.quant_sum / self.count + + if self.stats["float"] is None: + self.stats["float"] = y + self.float_sum = y + else: + self.float_sum += y + self.stats["float"] = self.float_sum / self.count + + def clear(self): + self.stats["float"] = None + self.stats["quantized"] = None + self.count = 0 + self.float_sum = None + self.quant_sum = None + +def bias_correction(float_model, quantized_model, img_data, target_modules=_supported_modules_quantized, neval_batches=None): + """Perform bias correction on a module. + + Using numeric suite shadow module, the expected output of the floating point and quantized modules + is recorded. Using that data the bias of supported modules is shifted to compensate for the drift caused + by quantization + Paper reference: https://arxiv.org/pdf/1906.04721.pdf (Section 4.2) + + Args: + float_model: a trained model that serves as a reference to what bias correction should aim for + quantized_model: quantized form of float_model that bias correction is to applied to + img_data: calibration data to estimate the expected output (used to find quantization error) + target_modules: specifies what submodules in quantized_model need bias correction (can be extended to + unquantized submodules) + neval_batches: a cap to the number of batches you want to be used for estimating the expected output + """ + ns.prepare_model_with_stubs(float_model, quantized_model, _supported_modules, MeanShadowLogger) + + uncorrected_modules = {} + for name, submodule in quantized_model.named_modules(): + if type(submodule) in target_modules: + uncorrected_modules[name] = submodule + + for uncorrected_module in uncorrected_modules: + quantized_submodule = get_module(quantized_model, uncorrected_module) + bias = get_param(quantized_submodule, 'bias') + if bias is not None: + + count = 0 + for data in img_data: + quantized_model(data[0]) + count += 1 + if count == neval_batches: + break + ob_dict = ns.get_logger_dict(quantized_model) + parent_name, _ = parent_child_names(uncorrected_module) + + float_data = ob_dict[parent_name + '.stats']['float'] + quant_data = ob_dict[parent_name + '.stats']['quantized'] + + # math for expected_error + quantization_error = quant_data - float_data + dims = list(range(quantization_error.dim())) + # Note: we don't want to take the mean over the output channel dimension + dims.remove(1) + expected_error = torch.mean(quantization_error, dims) + + updated_bias = bias.data - expected_error + + bias.data = updated_bias + + # Resets the data contained in the loggers + for name, submodule in quantized_model.named_modules(): + if isinstance(submodule, MeanShadowLogger): + submodule.clear() diff --git a/shared/package-files/9d/9d6b0609ddd2a4d77145cb4f41c95e4ea1ae50951a0b947ae8eba4b902c78948/blob b/shared/package-files/9d/9d6b0609ddd2a4d77145cb4f41c95e4ea1ae50951a0b947ae8eba4b902c78948/blob new file mode 100644 index 0000000000000000000000000000000000000000..5b83185fdc28bcea9ad52d8e3ca93a093f577057 --- /dev/null +++ b/shared/package-files/9d/9d6b0609ddd2a4d77145cb4f41c95e4ea1ae50951a0b947ae8eba4b902c78948/blob @@ -0,0 +1,181 @@ +# Copyright (C) 2014 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +import shutil +import sys +from os.path import abspath, exists, expanduser, isdir, join + +from .os_utils.external import find_executable +from .post import mk_relative_osx +from .utils import check_call_env, get_site_packages, on_mac, rec_glob + + +def relink_sharedobjects(pkg_path, build_prefix): + """ + invokes functions in post module to relink to libraries in conda env + + :param pkg_path: look for shared objects to relink in pkg_path + :param build_prefix: path to conda environment which contains lib/. to find + runtime libraries. + + .. note:: develop mode builds the extensions in place and makes a link to + package in site-packages/. The build_prefix points to conda environment + since runtime libraries should be loaded from environment's lib/. first + """ + # find binaries in package dir and make them relocatable + bin_files = rec_glob(pkg_path, [".so"]) + for b_file in bin_files: + if on_mac: + mk_relative_osx(b_file, build_prefix) + else: + print("Nothing to do on Linux or Windows.") + + +def write_to_conda_pth(sp_dir, pkg_path): + """ + Append pkg_path to conda.pth in site-packages directory for current + environment. Only add path if it doens't already exist. + + :param sp_dir: path to site-packages/. directory + :param pkg_path: the package path to append to site-packes/. dir. + """ + c_file = join(sp_dir, "conda.pth") + with open(c_file, "a") as f: + with open(c_file) as cf: + # make sure file exists, before we try to read from it hence nested + # in append with block + # expect conda.pth to be small so read it all in at once + pkgs_in_dev_mode = cf.readlines() + + # only append pkg_path if it doesn't already exist in conda.pth + if pkg_path + "\n" in pkgs_in_dev_mode: + print("path exists, skipping " + pkg_path) + else: + f.write(pkg_path + "\n") + print("added " + pkg_path) + + +def get_setup_py(path_): + """Return full path to setup.py or exit if not found""" + # build path points to source dir, builds are placed in the + setup_py = join(path_, "setup.py") + + if not exists(setup_py): + sys.exit(f"No setup.py found in {path_}. Exiting.") + + return setup_py + + +def _clean(setup_py): + """ + This invokes: + $ python setup.py clean + + :param setup_py: path to setup.py + """ + # first call setup.py clean + cmd = ["python", setup_py, "clean"] + check_call_env(cmd) + print("Completed: " + " ".join(cmd)) + print("===============================================") + + +def _build_ext(setup_py): + """ + Define a develop function - similar to build function + todo: need to test on win32 and linux + + It invokes: + $ python setup.py build_ext --inplace + + :param setup_py: path to setup.py + """ + + # next call setup.py develop + cmd = ["python", setup_py, "build_ext", "--inplace"] + check_call_env(cmd) + print("Completed: " + " ".join(cmd)) + print("===============================================") + + +def _uninstall(sp_dir, pkg_path): + """ + Look for pkg_path in conda.pth file in site-packages directory and remove + it. If pkg_path is not found in conda.pth, it means package is not + installed in 'development mode' via conda develop. + + :param sp_dir: path to site-packages/. directory + :param pkg_path: the package path to be uninstalled. + """ + o_c_pth = join(sp_dir, "conda.pth") + n_c_pth = join(sp_dir, "conda.pth.temp") + found = False + with open(n_c_pth, "w") as new_c: + with open(o_c_pth) as orig_c: + for line in orig_c: + if line != pkg_path + "\n": + new_c.write(line) + else: + print("uninstalled: " + pkg_path) + found = True + + if not found: + print("conda.pth does not contain path: " + pkg_path) + print("package not installed via conda develop") + + shutil.move(n_c_pth, o_c_pth) + + +def execute( + recipe_dirs, + prefix=sys.prefix, + no_pth_file=False, + build_ext=False, + clean=False, + uninstall=False, +): + if not isdir(prefix): + sys.exit( + """\ +Error: environment does not exist: %s +# +# Use 'conda create' to create the environment first. +#""" + % prefix + ) + + assert find_executable("python", prefix=prefix) + + # current environment's site-packages directory + sp_dir = get_site_packages( + prefix, ".".join((str(sys.version_info.major), str(sys.version_info.minor))) + ) + + if isinstance(recipe_dirs, str): + recipe_dirs = [recipe_dirs] + + for path in recipe_dirs: + pkg_path = abspath(expanduser(path)) + + if uninstall: + # uninstall then exit - does not do any other operations + _uninstall(sp_dir, pkg_path) + return + + if clean or build_ext: + setup_py = get_setup_py(pkg_path) + if clean: + _clean(setup_py) + if not build_ext: + return + + # build extensions before adding to conda.pth + if build_ext: + _build_ext(setup_py) + + if not no_pth_file: + write_to_conda_pth(sp_dir, pkg_path) + + # go through the source looking for compiled extensions and make sure + # they use the conda environment for loading libraries at runtime + relink_sharedobjects(pkg_path, prefix) + print("completed operation for: " + pkg_path) diff --git a/shared/package-files/9d/9d70c5a837efa62df7ee37df1c70ddffc0bb38e38df29ddfdcfa01462407cdfb/blob b/shared/package-files/9d/9d70c5a837efa62df7ee37df1c70ddffc0bb38e38df29ddfdcfa01462407cdfb/blob new file mode 100644 index 0000000000000000000000000000000000000000..4164e98de77169c98f258c4ac8eff4daf9f78f4e --- /dev/null +++ b/shared/package-files/9d/9d70c5a837efa62df7ee37df1c70ddffc0bb38e38df29ddfdcfa01462407cdfb/blob @@ -0,0 +1,22 @@ +Intellectual Property Notice +------------------------------ + +Archspec is licensed under the Apache License, Version 2.0 (LICENSE-APACHE +or http://www.apache.org/licenses/LICENSE-2.0) or the MIT license, +(LICENSE-MIT or http://opensource.org/licenses/MIT), at your option. + +Copyrights and patents in the Archspec project are retained by contributors. +No copyright assignment is required to contribute to Archspec. + + +SPDX usage +------------ + +Individual files contain SPDX tags instead of the full license text. +This enables machine processing of license information based on the SPDX +License Identifiers that are available here: https://spdx.org/licenses/ + +Files that are dual-licensed as Apache-2.0 OR MIT contain the following +text in the license header: + + SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/shared/package-files/9d/9d72f42316d3eaabb5d0236e6831f1c785b539a02769a293b4827d37d5113285/blob b/shared/package-files/9d/9d72f42316d3eaabb5d0236e6831f1c785b539a02769a293b4827d37d5113285/blob new file mode 100644 index 0000000000000000000000000000000000000000..d0ea2f25e9b4acaf3167a09a1c647943425e51b1 Binary files /dev/null and b/shared/package-files/9d/9d72f42316d3eaabb5d0236e6831f1c785b539a02769a293b4827d37d5113285/blob differ diff --git a/shared/package-files/9d/9d746781dafe93787f04d190b895319a9f3dc86356c6a10325e769c033c4678e/blob b/shared/package-files/9d/9d746781dafe93787f04d190b895319a9f3dc86356c6a10325e769c033c4678e/blob new file mode 100644 index 0000000000000000000000000000000000000000..38e1b890e660dbe9f79ffce1b1a31766be60068b --- /dev/null +++ b/shared/package-files/9d/9d746781dafe93787f04d190b895319a9f3dc86356c6a10325e769c033c4678e/blob @@ -0,0 +1,452 @@ +from collections import namedtuple +import itertools +import functools +import operator +import ctypes + +import numpy as np + +from numba import _helperlib + +Extent = namedtuple("Extent", ["begin", "end"]) + +attempt_nocopy_reshape = ctypes.CFUNCTYPE( + ctypes.c_int, + ctypes.c_long, # nd + np.ctypeslib.ndpointer(np.ctypeslib.c_intp, ndim=1), # dims + np.ctypeslib.ndpointer(np.ctypeslib.c_intp, ndim=1), # strides + ctypes.c_long, # newnd + np.ctypeslib.ndpointer(np.ctypeslib.c_intp, ndim=1), # newdims + np.ctypeslib.ndpointer(np.ctypeslib.c_intp, ndim=1), # newstrides + ctypes.c_long, # itemsize + ctypes.c_int, # is_f_order +)(_helperlib.c_helpers['attempt_nocopy_reshape']) + + +class Dim(object): + """A single dimension of the array + + Attributes + ---------- + start: + start offset + stop: + stop offset + size: + number of items + stride: + item stride + """ + __slots__ = 'start', 'stop', 'size', 'stride', 'single' + + def __init__(self, start, stop, size, stride, single): + self.start = start + self.stop = stop + self.size = size + self.stride = stride + self.single = single + assert not single or size == 1 + + def __getitem__(self, item): + if isinstance(item, slice): + start, stop, step = item.indices(self.size) + stride = step * self.stride + start = self.start + start * abs(self.stride) + stop = self.start + stop * abs(self.stride) + if stride == 0: + size = 1 + else: + size = _compute_size(start, stop, stride) + ret = Dim( + start=start, + stop=stop, + size=size, + stride=stride, + single=False + ) + return ret + else: + sliced = self[item:item + 1] if item != -1 else self[-1:] + if sliced.size != 1: + raise IndexError + return Dim( + start=sliced.start, + stop=sliced.stop, + size=sliced.size, + stride=sliced.stride, + single=True, + ) + + def get_offset(self, idx): + return self.start + idx * self.stride + + def __repr__(self): + strfmt = "Dim(start=%s, stop=%s, size=%s, stride=%s)" + return strfmt % (self.start, self.stop, self.size, self.stride) + + def normalize(self, base): + return Dim(start=self.start - base, stop=self.stop - base, + size=self.size, stride=self.stride, single=self.single) + + def copy(self, start=None, stop=None, size=None, stride=None, single=None): + if start is None: + start = self.start + if stop is None: + stop = self.stop + if size is None: + size = self.size + if stride is None: + stride = self.stride + if single is None: + single = self.single + return Dim(start, stop, size, stride, single) + + def is_contiguous(self, itemsize): + return self.stride == itemsize + + +def compute_index(indices, dims): + return sum(d.get_offset(i) for i, d in zip(indices, dims)) + + +class Element(object): + is_array = False + + def __init__(self, extent): + self.extent = extent + + def iter_contiguous_extent(self): + yield self.extent + + +class Array(object): + """A dummy numpy array-like object. Consider it an array without the + actual data, but offset from the base data pointer. + + Attributes + ---------- + dims: tuple of Dim + describing each dimension of the array + + ndim: int + number of dimension + + shape: tuple of int + size of each dimension + + strides: tuple of int + stride of each dimension + + itemsize: int + itemsize + + extent: (start, end) + start and end offset containing the memory region + """ + is_array = True + + @classmethod + def from_desc(cls, offset, shape, strides, itemsize): + dims = [] + for ashape, astride in zip(shape, strides): + dim = Dim(offset, offset + ashape * astride, ashape, astride, + single=False) + dims.append(dim) + offset = 0 # offset only applies to first dimension + return cls(dims, itemsize) + + def __init__(self, dims, itemsize): + self.dims = tuple(dims) + self.ndim = len(self.dims) + self.shape = tuple(dim.size for dim in self.dims) + self.strides = tuple(dim.stride for dim in self.dims) + self.itemsize = itemsize + self.size = functools.reduce(operator.mul, self.shape, 1) + self.extent = self._compute_extent() + self.flags = self._compute_layout() + + def _compute_layout(self): + # The logic here is based on that in _UpdateContiguousFlags from + # numpy/core/src/multiarray/flagsobject.c in NumPy v1.19.1 (commit + # 13661ac70). + # https://github.com/numpy/numpy/blob/maintenance/1.19.x/numpy/core/src/multiarray/flagsobject.c#L123-L191 + + # Records have no dims, and we can treat them as contiguous + if not self.dims: + return {'C_CONTIGUOUS': True, 'F_CONTIGUOUS': True} + + # If this is a broadcast array then it is not contiguous + if any([dim.stride == 0 for dim in self.dims]): + return {'C_CONTIGUOUS': False, 'F_CONTIGUOUS': False} + + flags = {'C_CONTIGUOUS': True, 'F_CONTIGUOUS': True} + + # Check C contiguity + sd = self.itemsize + for dim in reversed(self.dims): + if dim.size == 0: + # Contiguous by definition + return {'C_CONTIGUOUS': True, 'F_CONTIGUOUS': True} + if dim.size != 1: + if dim.stride != sd: + flags['C_CONTIGUOUS'] = False + sd *= dim.size + + # Check F contiguity + sd = self.itemsize + for dim in self.dims: + if dim.size != 1: + if dim.stride != sd: + flags['F_CONTIGUOUS'] = False + return flags + sd *= dim.size + + return flags + + def _compute_extent(self): + firstidx = [0] * self.ndim + lastidx = [s - 1 for s in self.shape] + start = compute_index(firstidx, self.dims) + stop = compute_index(lastidx, self.dims) + self.itemsize + stop = max(stop, start) # ensure positive extent + return Extent(start, stop) + + def __repr__(self): + return '' % (self.dims, self.itemsize) + + def __getitem__(self, item): + if not isinstance(item, tuple): + item = [item] + else: + item = list(item) + + nitem = len(item) + ndim = len(self.dims) + if nitem > ndim: + raise IndexError("%d extra indices given" % (nitem - ndim,)) + + # Add empty slices for missing indices + while len(item) < ndim: + item.append(slice(None, None)) + + dims = [dim.__getitem__(it) for dim, it in zip(self.dims, item)] + newshape = [d.size for d in dims if not d.single] + + arr = Array(dims, self.itemsize) + if newshape: + return arr.reshape(*newshape)[0] + else: + return Element(arr.extent) + + @property + def is_c_contig(self): + return self.flags['C_CONTIGUOUS'] + + @property + def is_f_contig(self): + return self.flags['F_CONTIGUOUS'] + + def iter_contiguous_extent(self): + """ Generates extents + """ + if self.is_c_contig or self.is_f_contig: + yield self.extent + else: + if self.dims[0].stride < self.dims[-1].stride: + innerdim = self.dims[0] + outerdims = self.dims[1:] + outershape = self.shape[1:] + else: + innerdim = self.dims[-1] + outerdims = self.dims[:-1] + outershape = self.shape[:-1] + + if innerdim.is_contiguous(self.itemsize): + oslen = [range(s) for s in outershape] + for indices in itertools.product(*oslen): + base = compute_index(indices, outerdims) + yield base + innerdim.start, base + innerdim.stop + else: + oslen = [range(s) for s in self.shape] + for indices in itertools.product(*oslen): + offset = compute_index(indices, self.dims) + yield offset, offset + self.itemsize + + def reshape(self, *newdims, **kws): + oldnd = self.ndim + newnd = len(newdims) + + if newdims == self.shape: + return self, None + + order = kws.pop('order', 'C') + if kws: + raise TypeError('unknown keyword arguments %s' % kws.keys()) + if order not in 'CFA': + raise ValueError('order not C|F|A') + + # check for exactly one instance of -1 in newdims + # https://github.com/numpy/numpy/blob/623bc1fae1d47df24e7f1e29321d0c0ba2771ce0/numpy/core/src/multiarray/shape.c#L470-L515 # noqa: E501 + unknownidx = -1 + knownsize = 1 + for i, dim in enumerate(newdims): + if dim < 0: + if unknownidx == -1: + unknownidx = i + else: + raise ValueError("can only specify one unknown dimension") + else: + knownsize *= dim + + # compute the missing dimension + if unknownidx >= 0: + if knownsize == 0 or self.size % knownsize != 0: + raise ValueError("cannot infer valid shape " + "for unknown dimension") + else: + newdims = newdims[0:unknownidx] \ + + (self.size // knownsize,) \ + + newdims[unknownidx + 1:] + + newsize = functools.reduce(operator.mul, newdims, 1) + + if order == 'A': + order = 'F' if self.is_f_contig else 'C' + + if newsize != self.size: + raise ValueError("reshape changes the size of the array") + + if self.is_c_contig or self.is_f_contig: + if order == 'C': + newstrides = list(iter_strides_c_contig(self, newdims)) + elif order == 'F': + newstrides = list(iter_strides_f_contig(self, newdims)) + else: + raise AssertionError("unreachable") + else: + newstrides = np.empty(newnd, np.ctypeslib.c_intp) + + # need to keep these around in variables, not temporaries, so they + # don't get GC'ed before we call into the C code + olddims = np.array(self.shape, dtype=np.ctypeslib.c_intp) + oldstrides = np.array(self.strides, dtype=np.ctypeslib.c_intp) + newdims = np.array(newdims, dtype=np.ctypeslib.c_intp) + + if not attempt_nocopy_reshape( + oldnd, + olddims, + oldstrides, + newnd, + newdims, + newstrides, + self.itemsize, + order == 'F', + ): + raise NotImplementedError('reshape would require copy') + + ret = self.from_desc(self.extent.begin, shape=newdims, + strides=newstrides, itemsize=self.itemsize) + + return ret, list(self.iter_contiguous_extent()) + + def squeeze(self, axis=None): + newshape, newstrides = [], [] + if axis is None: + for length, stride in zip(self.shape, self.strides): + if length != 1: + newshape.append(length) + newstrides.append(stride) + else: + if not isinstance(axis, tuple): + axis = (axis,) + for ax in axis: + if self.shape[ax] != 1: + raise ValueError( + "cannot select an axis to squeeze out which has size " + "not equal to one" + ) + for i, (length, stride) in enumerate(zip(self.shape, self.strides)): + if i not in axis: + newshape.append(length) + newstrides.append(stride) + newarr = self.from_desc( + self.extent.begin, + shape=newshape, + strides=newstrides, + itemsize=self.itemsize, + ) + return newarr, list(self.iter_contiguous_extent()) + + def ravel(self, order='C'): + if order not in 'CFA': + raise ValueError('order not C|F|A') + + if (order in 'CA' and self.is_c_contig + or order in 'FA' and self.is_f_contig): + newshape = (self.size,) + newstrides = (self.itemsize,) + arr = self.from_desc(self.extent.begin, newshape, newstrides, + self.itemsize) + return arr, list(self.iter_contiguous_extent()) + + else: + raise NotImplementedError("ravel on non-contiguous array") + + +def iter_strides_f_contig(arr, shape=None): + """yields the f-contiguous strides + """ + shape = arr.shape if shape is None else shape + itemsize = arr.itemsize + yield itemsize + sum = 1 + for s in shape[:-1]: + sum *= s + yield sum * itemsize + + +def iter_strides_c_contig(arr, shape=None): + """yields the c-contiguous strides + """ + shape = arr.shape if shape is None else shape + itemsize = arr.itemsize + + def gen(): + yield itemsize + sum = 1 + for s in reversed(shape[1:]): + sum *= s + yield sum * itemsize + + for i in reversed(list(gen())): + yield i + + +def is_element_indexing(item, ndim): + if isinstance(item, slice): + return False + + elif isinstance(item, tuple): + if len(item) == ndim: + if not any(isinstance(it, slice) for it in item): + return True + + else: + return True + + return False + + +def _compute_size(start, stop, step): + """Algorithm adapted from cpython rangeobject.c + """ + if step > 0: + lo = start + hi = stop + else: + lo = stop + hi = start + step = -step + if lo >= hi: + return 0 + return (hi - lo - 1) // step + 1 diff --git a/shared/package-files/9d/9d752c4cbad296144bf94cc333ccccaa7d6ea899d1ed3465262dc8c6ac39dfdc/blob b/shared/package-files/9d/9d752c4cbad296144bf94cc333ccccaa7d6ea899d1ed3465262dc8c6ac39dfdc/blob new file mode 100644 index 0000000000000000000000000000000000000000..6bc9022a58d3cd087d167d354224ded89be91884 --- /dev/null +++ b/shared/package-files/9d/9d752c4cbad296144bf94cc333ccccaa7d6ea899d1ed3465262dc8c6ac39dfdc/blob @@ -0,0 +1,27 @@ +#ifdef _MSC_VER + #include +#endif +#include + +int main(int argc, char **argv) +{ + float *src = (float*)argv[argc-1]; + float32x4_t v1 = vdupq_n_f32(src[0]), v2 = vdupq_n_f32(src[1]); + /* MAXMIN */ + int ret = (int)vgetq_lane_f32(vmaxnmq_f32(v1, v2), 0); + ret += (int)vgetq_lane_f32(vminnmq_f32(v1, v2), 0); + /* ROUNDING */ + ret += (int)vgetq_lane_f32(vrndq_f32(v1), 0); +#ifdef __aarch64__ + { + double *src2 = (double*)argv[argc-1]; + float64x2_t vd1 = vdupq_n_f64(src2[0]), vd2 = vdupq_n_f64(src2[1]); + /* MAXMIN */ + ret += (int)vgetq_lane_f64(vmaxnmq_f64(vd1, vd2), 0); + ret += (int)vgetq_lane_f64(vminnmq_f64(vd1, vd2), 0); + /* ROUNDING */ + ret += (int)vgetq_lane_f64(vrndq_f64(vd1), 0); + } +#endif + return ret; +} diff --git a/shared/package-files/9d/9d75321ee95050c17ee5243dd85bb792a35ef9e24d33e9f0a8e87453afe397fb/blob b/shared/package-files/9d/9d75321ee95050c17ee5243dd85bb792a35ef9e24d33e9f0a8e87453afe397fb/blob new file mode 100644 index 0000000000000000000000000000000000000000..4a6e2120c10810100dce13e76516d2ffc14d3fa5 --- /dev/null +++ b/shared/package-files/9d/9d75321ee95050c17ee5243dd85bb792a35ef9e24d33e9f0a8e87453afe397fb/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d75321ee95050c17ee5243dd85bb792a35ef9e24d33e9f0a8e87453afe397fb +size 828890 diff --git a/shared/package-files/9d/9d75eff43edebf3330052fc282fa3adddc66e7079abde396824ce4102b451a18/blob b/shared/package-files/9d/9d75eff43edebf3330052fc282fa3adddc66e7079abde396824ce4102b451a18/blob new file mode 100644 index 0000000000000000000000000000000000000000..8f3989834b90c6271b7110c11284c892a2f02870 --- /dev/null +++ b/shared/package-files/9d/9d75eff43edebf3330052fc282fa3adddc66e7079abde396824ce4102b451a18/blob @@ -0,0 +1,401 @@ +"","y","x0","x2","f","f0","f2","s(x0)","s(x2)","y_est" +"1",7.12834119189363,0.18488225992769,0.415244054514915,8.3864294832725,1.09742724507315,3.85308359377173,-0.227044191415553,0.674474485272424,8.28070979061934 +"2",2.96831168814625,0.702374035958201,0.531438757665455,7.5170006011403,1.60922136489573,2.78685791023355,0.255586357247631,-0.546809755954686,7.54205609805542 +"3",3.97799386611165,0.573326334822923,0.00324621424078941,3.30811955616867,1.94716784653429,0.000331139107656992,0.440904418692589,-3.26552447997573,5.00865943547933 +"4",10.434571523234,0.168051920365542,0.252099723322317,10.8619475362468,1.00752822352788,8.78226882747801,-0.2914439516815,5.05254717714343,12.5943827222244 +"5",14.5701431124503,0.943839338840917,0.155228920048103,14.633227915587,0.351039955408613,6.92331409450211,-0.387243895292977,3.40087054502693,10.8469061464964 +"6",4.43222337124671,0.943474958650768,0.878839791286737,5.82439046032278,0.353293651164888,0.152830508081872,-0.386402747045483,-2.93309471949142,4.51378203022557 +"7",14.6204982526083,0.129158976720646,0.203511162893847,12.6836562466463,0.789443318976297,8.66213887096385,-0.415971510965674,4.97405136137178,12.3913593471686 +"8",10.8619407133103,0.833448815625161,0.583528404124081,6.06924346948678,0.999371549079984,3.09947825772663,-0.0693035351092078,-0.0357121494960873,7.72826381215717 +"9",7.35948772806806,0.468018515501171,0.804473386378959,4.40724629164454,1.98991370630921,1.02111497118379,0.488534666504273,-2.62696428099709,5.69484988226965 +"10",14.6503664798744,0.54998374171555,0.264716582372785,15.5847448140098,1.97539265899078,8.58236765178851,0.461156042313852,4.87735106608389,13.1717866051602 +"11",8.55978117165571,0.55267406697385,0.405742728384212,9.73867187952596,1.97267864903617,4.10072468921772,0.45907213146249,0.926732922735185,9.21908455096015 +"12",8.35466583847241,0.23889475944452,0.380358448717743,10.3297099823746,1.36402369645126,4.86471238772196,0.000590560790525739,1.66376630647815,9.49763636403114 +"13",13.0426397323725,0.760513313114643,0.240951270796359,12.7212252447601,1.36674133286988,8.88753695162683,0.133581590581301,5.14871550313379,13.1155765904776 +"14",-0.691359790313367,0.180820100707933,0.842069704318419,2.69988170895038,1.07600071904564,0.468494599643343,-0.243052271536763,-2.92529904209468,4.66492818313103 +"15",3.67339912901921,0.405282181221992,0.00709935487248003,3.98208631548489,1.91210661097774,0.00333207359919532,0.450863140055415,-3.20577521515017,5.07836742166771 +"16",6.26398380113838,0.853548452956602,0.476415365468711,7.39247205280711,0.888059478714279,2.85675522996195,-0.132044059288684,-0.435344215558095,7.26589122191569 +"17",0.821827261733445,0.976398489437997,0.874515716219321,4.59477726781584,0.148156824168708,0.178659271005004,-0.453272850724276,-2.93477125481843,4.44523539121976 +"18",5.91515263392194,0.225825461093336,0.566878651967272,6.61882693003148,1.30283558925834,2.98816859162351,-0.0553401870834273,-0.243767560923847,7.5341717487552 +"19",8.58747748043002,0.444809229113162,0.500824617221951,7.97897991952371,1.97001221586527,2.74514826424787,0.481364385464492,-0.58150361708599,7.73314026514097 +"20",2.93507113356496,0.0749794247094542,0.874521149788052,5.57765902948977,0.46676502034473,0.178625065833263,-0.509354310163179,-2.93476865361885,4.38915653298044 +"21",7.04267669630848,0.661898758495227,0.524293957278132,9.95714151688145,1.74683477040237,2.76243807096948,0.32520024805337,-0.575157940172633,7.58332180464321 +"22",8.17450810256642,0.387549542589113,0.0925511021632701,5.87951317694955,1.87649039025807,3.00169546388112,0.428976494916497,0.12399981451995,8.38625580619892 +"23",10.9711677544227,0.836889176862314,0.134571503615007,8.54609745347932,0.980589247123112,5.74345064624302,-0.0799823561431264,2.38292940767438,10.1362265482937 +"24",5.74682142317176,0.150501440744847,0.0430209250189364,5.42964575108459,0.910787117034434,0.51293655414988,-0.352396960858087,-2.19509543975371,5.28578709615067 +"25",8.19506298090425,0.34727224893868,0.579527264460921,11.7199071712819,1.77416678456263,3.07316926538295,0.358203882062032,-0.0872800457941511,8.10420333303035 +"26",5.74550125256406,0.488773231394589,0.0749190652277321,5.22515168967992,1.99875616072095,1.9300758088639,0.488882126296113,-0.782337171844845,7.53982445121373 +"27",6.4912475835067,0.149246862856671,0.109240429243073,6.16709110469951,0.903762129706801,4.09973180296336,-0.35647497920724,1.02215954430674,8.49896406186197 +"28",2.02564241541326,0.357062590075657,0.0269805011339486,5.06258487711001,1.80171885669055,0.149405116356797,0.378248880337533,-2.73928381138134,5.47224456571866 +"29",6.05624393356524,0.962644048267975,0.44965722411871,6.43108327136691,0.234175962529181,3.16163281863248,-0.427691149470868,-0.0778081992291847,7.32778014806242 +"30",7.35648519220135,0.132372003281489,0.802779154153541,2.98981683298994,0.807951573832067,1.05073758168675,-0.407231394697638,-2.60055202413871,4.82549607792612 +"31",7.73841587934375,0.0104145254008472,0.0946207772940397,7.05166719048879,0.0654247188755601,3.13519714453325,-0.489506740298803,0.233914285839761,7.57768704230343 +"32",11.16031183532,0.164642242016271,0.0217266413383186,7.29294602620088,0.988964149622058,0.0823341584224072,-0.303823936824518,-2.8867538803087,4.64270167962925 +"33",6.14291646383901,0.810192144475877,0.865996729349717,7.26459770094121,1.12316803365629,0.237915803430657,0.00122136530161028,-2.93924296613439,4.89525789592969 +"34",6.84569343399892,0.868861036840826,0.582203940721229,5.80647637281992,0.800858425140461,3.09083152246907,-0.179759900158571,-0.0528355864977668,7.60068401010613 +"35",12.1670478736339,0.514281762996688,0.156790239037946,10.2051907798347,1.99798724677353,7.0035719476132,0.482181868158047,3.47189407595649,11.787355440877 +"36",9.07687568397104,0.627196286572143,0.514403509441763,9.85580121169106,1.84243421606922,2.74230822364921,0.377092094877167,-0.594465088452681,7.61590650318696 +"37",4.52506817763415,0.844429003074765,0.942464028950781,2.23255052786033,0.939028788913965,0.00378076495941939,-0.10350114369795,-3.25052927879017,4.47924907427435 +"38",5.90894052971257,0.284870574250817,0.859073282685131,7.53752029668025,1.56035223460714,0.294680379714631,0.182649695446557,-2.94144316307794,5.07448602913109 +"39",12.5600956886201,0.667225647717714,0.614471670007333,11.7226370556387,1.73029204701211,3.26491664932042,0.316593330958169,0.343018513498667,8.49289134121931 +"40",7.78666657790817,0.150469752028584,0.621229486307129,6.91089641032163,0.910609850325356,3.2866595828649,-0.352500453560122,0.40993211012494,7.89071115332729 +"41",9.46545246159186,0.981727862264961,0.770207359222695,5.4870728963481,0.114744186086783,1.66809061900321,-0.462191460324963,-1.89195408360505,5.47913395283246 +"42",7.98476818990058,0.297010735142976,0.559223463525996,6.01791431289043,1.60692295848185,2.93757237908054,0.223664683278722,-0.329720741751714,7.72722343828948 +"43",11.1200064496787,0.115084075368941,0.104635148309171,9.09930032317762,0.707443821606678,3.79344153155655,-0.450412246730918,0.772236667231655,8.15510391726321 +"44",7.30261009433391,0.163200871786103,0.160728369606659,11.169407228114,0.981082328019653,7.19964107180246,-0.308983147019698,3.64646501351835,11.1707613632611 +"45",2.87897797947591,0.944041808135808,0.921017819782719,1.90309896512445,0.349787481435473,0.0196405975699546,-0.387710386242896,-3.06511975416904,4.38044935635053 +"46",4.56230671587923,0.794863823568448,0.858829384669662,5.48732308540155,1.20152456833077,0.296825240600543,0.045185436985577,-2.94146379939242,4.93700113435563 +"47",8.53881970579713,0.974687897600234,0.768369293771684,8.86136639419322,0.158873067826235,1.70447635553069,-0.450289403883873,-1.84339620377278,5.53959388910582 +"48",4.93052811071351,0.349088410614058,0.0215932258870453,4.90165802072237,1.77940542967064,0.0809369981820827,0.362066133809751,-2.89028396311736,5.30506166745486 +"49",0.270686793170807,0.501969880890101,0.900029808748513,4.93793383795017,1.99996170180611,0.0626735071088702,0.486348894722708,-2.95308264891301,5.36654574257217 +"50",5.71210355748669,0.810397262685001,0.422055596718565,6.35430171593611,1.12210142554194,3.69003414925473,0.000616726730590114,0.503921781101617,8.33781800459468 +"51",2.53128215708563,0.00710903806611896,0.815620528068393,4.78048853310418,0.0446636903106026,0.835224352119575,-0.485428354525846,-2.76874325841101,4.57910788382561 +"52",11.4926312964725,0.0146939109545201,0.165990423876792,11.9852222949765,0.0922917789715572,7.4468022408786,-0.494406760805011,3.86869288188452,11.207565617842 +"53",8.68476179911405,0.683403422823176,0.702329544350505,7.08010363495876,1.67710124423092,2.87253314956795,0.289476396635597,-0.0452516285740291,8.07750426482404 +"54",6.73659637293068,0.929720221785828,0.146583809517324,8.20893089692994,0.438001876525029,6.45461407451929,-0.353194874814998,2.99091995100899,10.4710045729565 +"55",9.21770380421483,0.27540119853802,0.783650883939117,8.02488924068983,1.52244785450626,1.40489550117418,0.148222545756795,-2.22409900987289,5.75740303264638 +"56",14.4557299443291,0.811859695473686,0.222305322065949,15.2902765975517,1.1144833443304,8.89369973773696,-0.00370510835045028,5.16649982016122,12.9960742085732 +"57",12.2572130653199,0.785878912778571,0.117966502672061,7.95608146922934,1.24617072429099,4.67872413075527,0.0696626502002105,1.49652497285633,9.39946711981901 +"58",6.22584451710024,0.988902155542746,0.950626030098647,7.15273358679738,0.069715687278549,0.00166006540399627,-0.473269741513118,-3.31713835361983,4.04287140162952 +"59",9.69148685885844,0.613952909596264,0.635327411815524,12.3962109076492,1.87320346829871,3.30867225411244,0.394805010871761,0.515426234498925,8.74351074213316 +"60",9.42944806845091,0.710185730131343,0.470433705253527,8.04556742347047,1.5795945074448,2.9075480190875,0.24088726327446,-0.373996306382343,7.70017045365459 +"61",14.5117548482216,0.770027856575325,0.120422721607611,12.7444990900551,1.32249243512379,4.84022974292302,0.110466490755785,1.62959074547729,9.57333673299555 +"62",3.77016047504039,0.886984157143161,0.480194857809693,4.55330602030726,0.695274009794026,2.82962097733328,-0.234923173511836,-0.468788017438374,7.12956830581226 +"63",9.88206417488313,0.625121729681268,0.368039822205901,8.1782611130773,1.84746623443466,5.27882636887808,0.379947621064081,2.04327864431639,10.2565057621429 +"64",7.1766677724709,0.260300035355613,0.909002645174041,4.14389561448924,1.45922709994699,0.0397578064966064,0.0894699429639232,-2.98704272485729,4.9357067148691 +"65",7.42248797588892,0.859073117841035,0.152872634120286,9.36504424256162,0.85682447224995,6.79956912585794,-0.149319816588541,3.29184820858167,10.9758078887556 +"66",10.1485902164303,0.437488002004102,0.855542484438047,6.89794340627103,1.96155585240588,0.326709056578361,0.47751685015887,-2.94121645096222,5.36957989595912 +"67",3.62016622162486,0.388144757598639,0.907381367171183,4.5752315755478,1.87778098726909,0.043342314038314,0.429798725561298,-2.97936907507379,5.28370914724998 +"68",4.30892699558775,0.461501105222851,0.899858920136467,6.50254130890964,1.98538944255742,0.0631869486821995,0.487270128657175,-2.9526231116384,5.36792651378125 +"69",5.09544681637421,0.218675193376839,0.514945505419746,5.10024259506228,1.2684231999236,2.74295924966819,-0.0860525761696088,-0.594021648245105,7.15320527234776 +"70",3.5585406469164,0.0659355104435235,0.416780355619267,6.64055771241882,0.411328688272775,3.81522773836023,-0.514380177571105,0.635210800809181,7.95411012000055 +"71",4.33368716400954,0.275701026665047,0.469175448641181,5.78242614908194,1.52366885180659,2.91947792487642,0.149344060225429,-0.359760168387252,7.62286338860065 +"72",14.5356060977966,0.310381097486243,0.197256424231455,12.6050234663958,1.65550587476979,8.52922947243198,0.264867346541892,4.85732076542652,12.9554676087309 +"73",8.50725572418713,0.0421755260322243,0.329779473599046,8.67946607315439,0.264221954221749,6.65010684790565,-0.514669351070528,3.23759786240691,10.5562080080989 +"74",3.05193726872436,0.184673463227227,0.955389225622639,2.25592630331203,1.09633024004265,0.000954228587224394,-0.227873637685364,-3.35090833135085,4.25449752772626 +"75",7.27353502907227,0.183373228181154,0.584825026104227,8.13547386477907,1.08948828827588,3.10787346487156,-0.233022893958094,-0.0189162731246036,7.58134032967977 +"76",9.51125705038021,0.755462416447699,0.618567775702104,9.57059611408074,1.38973764647855,3.27888967600212,0.145454486921361,0.384650814898765,8.36338479858259 +"77",7.98044425341438,0.288059732178226,0.495288227219135,7.26470411849091,1.57280872445203,2.75774190950887,0.193763000211852,-0.5625576127922,7.46448488418212 +"78",3.8613617638211,0.867844662396237,0.518186261644587,4.60509218830614,0.806706064506162,2.7479812808865,-0.176613732071042,-0.589869682870235,7.06679608182119 +"79",9.04195840674055,0.402642735978588,0.325241371290758,10.4646404809475,1.90717858318917,6.8126620880265,0.447941978215536,3.37533116190207,11.6565526368801 +"80",11.3176550783191,0.57268500351347,0.552817386575043,10.2209400350733,1.9480839709215,2.89713257519834,0.441524826261918,-0.394069307438176,7.88073501558621 +"81",5.57746907153493,0.350642574951053,0.0177831065375358,4.37760140563906,1.78384236530111,0.0469998947374887,0.365318857381645,-2.98645502517672,5.2121433289674 +"82",10.7089342379867,0.671998928301036,0.0569726510439068,7.31780529358022,1.71505677645042,1.02858968922083,0.308747295015251,-1.62299584132185,6.51903095045587 +"83",13.6571243065725,0.0250503565184772,0.388734344625846,12.1155012617111,0.157233613474221,4.5977655364454,-0.504403092589657,1.4123604064242,8.74123681059701 +"84",10.9298527278191,0.401101037859917,0.110059214755893,10.7966901796164,1.90423943643175,4.15423091781406,0.446182044855503,1.06667413179352,9.34613567341149 +"85",5.26730746401318,0.199976529926062,0.0580943147651851,8.06050154575457,1.17545119822299,1.07764342728173,-0.165426765196352,-1.57359258295257,6.09426014861355 +"86",13.0282305387151,0.856525000883266,0.192604857496917,11.9666222575096,0.871263497384077,8.41204789943322,-0.141356728813058,4.75216503834802,12.4440878062974 +"87",6.25704041344159,0.971515428507701,0.616521884920076,7.57746873617257,0.178735069001125,3.27220766816418,-0.444604358141298,0.364249284308461,7.75292442292963 +"88",8.68443629833225,0.323722436791286,0.593625131761655,7.51507864331743,1.70107242202133,3.16245936494946,0.30198079092488,0.0948660699372665,8.23012635762462 +"89",13.6483049073844,0.733191433362663,0.597685679094866,9.45100652107302,1.48688608926549,3.1858347759718,0.194732642330126,0.146473703935412,8.17448584302801 +"90",6.21937364251209,0.340068240184337,0.906595766311511,7.99224105280809,1.75281987927375,0.0451630788196472,0.342226940013073,-2.97590980322301,5.19959663355253 +"91",5.13014510798447,0.976755184587091,0.445523936068639,5.14460379671451,0.145921707720964,3.22690244770683,-0.45388764674917,-0.00337218761908523,7.37601966239422 +"92",8.05861485185061,0.397016411880031,0.721286036539823,7.86032344855436,1.8962365932119,2.58791568484136,0.441326163668435,-0.518341415005878,7.75626424542503 +"93",11.5725567304553,0.379998879274353,0.237508250167593,13.7154100193651,1.85955037953241,8.90528267393742,0.418001888234871,5.16613031120149,13.4174116961988 +"94",13.9766053111115,0.560387630248442,0.142295781057328,15.5089339950817,1.96411666779555,6.20803608251261,0.452730378336641,2.77834144029124,11.0643513153904 +"95",6.4797647181746,0.463808179134503,0.856655673589557,5.69638525391661,1.98708624050246,0.316383557218597,0.487783019051646,-2.94141691107098,5.37964560474314 +"96",3.62657709003994,0.19677682663314,0.0750631871633232,4.62049469182669,1.15912647046669,1.93821371435813,-0.178730121268437,-0.775201471673765,6.87934790382027 +"97",4.57665512063523,0.426943402737379,0.0216751468833536,3.916732640639,1.94755412266648,0.0817931645635993,0.470571273038917,-2.88811767397721,5.41573309582418 +"98",13.3001958677107,0.0930251874960959,0.122391620650887,11.6661170174252,0.576209821230247,4.96893603267958,-0.490424619199982,1.73593235344691,9.0787872310094 +"99",6.20591413655337,0.11530912690796,0.693578774109483,5.60081186648355,0.708766268379784,2.98233938411781,-0.449913138178701,0.139131614481954,7.52249797306572 +"100",7.745920462763,0.440031654201448,0.460468353936449,8.04916041660353,1.96461175986552,3.01413521413869,0.478942802916956,-0.248314501889865,8.06390779778956 +"101",14.1021991423141,0.200934729538858,0.270201246719807,13.6427330954648,1.18031684977566,8.47153889922809,-0.161422052683049,4.7816970703382,12.4535545144176 +"102",10.2813460846881,0.42763907276094,0.455095182172954,8.09638876999082,1.94854389761995,3.08325474062275,0.471081593583821,-0.168055742093356,8.13630534825294 +"103",4.85137979029549,0.980599981732666,0.510476477444172,4.84561910645056,0.121818460626604,2.73927004280688,-0.460352121991785,-0.595505461800383,6.7774219129703 +"104",11.2331632022045,0.828922125510871,0.219658464426175,11.498307953323,1.02390634597027,8.87601460017627,-0.0553240074792956,5.15295110754734,12.9309065968305 +"105",8.05260375002677,0.286973854992539,0.400094258133322,8.18838612588441,1.56858507506298,4.2585171091223,0.190006383687947,1.08366123695617,9.10694711740658 +"106",9.33894930857719,0.595916896825656,0.729184883181006,8.72718022643302,1.90988412545435,2.45324261987448,0.416872339493148,-0.735929861084577,7.51422197517104 +"107",11.3182047318057,0.898971946211532,0.163844325579703,10.0878180746118,0.624174059028064,7.34809659955898,-0.270044879831358,3.77965547591613,11.3428900928472 +"108",4.73874157490368,0.453377000289038,0.963441944448277,4.63632861429927,1.97858472775457,0.00031696377230766,0.484883845375713,-3.39525878136241,4.92290456077577 +"109",3.9649347048795,0.1474177793134,0.943138560513034,5.85514936702963,0.893495082777238,0.00355032388601139,-0.362348626504584,-3.25633286066963,4.21459800958825 +"110",9.18786398409187,0.128676982596517,0.358087731990963,10.3344495888554,0.786659865149204,5.62781222563495,-0.417255542619866,2.35488723041407,9.77091118455668 +"111",12.8837794672158,0.024656337685883,0.393948743119836,8.53408723261004,0.154765462799114,4.43857421193184,-0.50407279973324,1.25950410532075,8.58871080234998 +"112",11.8118264742873,0.736311374930665,0.256241421215236,11.4076998289433,1.47370429027262,8.72559668283347,0.188116925312551,5.00234672675146,13.0237431488265 +"113",13.9516122652434,0.373358564451337,0.306597534567118,11.440633437613,1.84378773092434,7.45561833792291,0.407502072678857,3.91851330628709,12.1592948757284 +"114",11.892123844867,0.574376940494403,0.131582422880456,9.75996429141057,1.94565000618449,5.55752034172672,0.439880506739928,2.22635457816025,10.4995145816626 +"115",5.27839621078377,0.825328013394028,0.98111131368205,3.21507751051791,1.04323931000869,7.36447253930748e-06,-0.0442948419401687,-3.40965154966564,4.37933310515666 +"116",13.5799585768086,0.813695673830807,0.598525822162628,7.56232500196031,1.10488610960234,3.19049811073118,-0.00915722605510878,0.157022284511709,7.98114455521907 +"117",7.66339524998881,0.872696340316907,0.748547380324453,8.20193400251302,0.778719233086051,2.09439709653888,-0.191591760850198,-1.29020547052064,6.35148226539163 +"118",7.36159546628271,0.1105548995547,0.0719438814558089,5.27780046174909,0.680755224768617,1.76491577989765,-0.460083020837121,-0.928427780340491,6.44476869558486 +"119",6.93045136830125,0.952700236812234,0.580856277374551,5.75063536937142,0.296100666220448,3.08196751037115,-0.40704475599005,-0.0702097568303019,7.35602498394212 +"120",9.65305775209362,0.569002080941573,0.614933087024838,11.0874771954474,1.95319171197669,3.266608330069,0.445019197992293,0.347862514566768,8.62616120932153 +"121",10.4972108152365,0.0368684707209468,0.485181445255876,9.20705647567851,0.231133823823045,2.79954299149337,-0.512367398668583,-0.506727583359819,6.81418451473407 +"122",5.88180565263779,0.245290916413069,0.783235180657357,3.91907345984506,1.39313766165549,1.41291232764871,0.0276342883159553,-2.21453385886434,5.64637992621408 +"123",5.62261933806897,0.978884799173102,0.546176499687135,5.50408502375625,0.132573440736761,2.85808328683254,-0.457505203451883,-0.452029192013686,6.9237451012969 +"124",8.20873583575179,0.885737232398242,0.616609779186547,8.17332250915743,0.702614661615158,3.27250708540437,-0.231198736731536,0.365142255127408,7.96722301515834 +"125",8.50540594354726,0.240982897812501,0.398970876354724,7.77600541513004,1.37358959037599,4.29079433572698,0.00945278288661558,1.1154269842921,8.95815926394118 +"126",9.059700233597,0.757211570162326,0.220897037768736,11.3283423100923,1.38181320875141,8.88488593673442,0.141373358145332,5.15981840978197,13.1344712646898 +"127",11.5306589685846,0.562836518744007,0.249966160627082,11.8261135460404,1.96115696382214,8.80785969755125,0.45060494444639,5.07545054098153,13.3593349821904 +"128",15.0286717097366,0.305103095248342,0.248722158139572,14.5050208984474,1.63667181818745,8.82162057802707,0.249090234183014,5.0878497150051,13.1702194459506 +"129",3.62599095487477,0.693654086906463,0.826910610077903,3.9840971462186,1.64114739470629,0.664945478875193,0.271467509995178,-2.86185442728347,5.24289257947418 +"130",11.9655639418966,0.335945603903383,0.588559790281579,10.8097380264364,1.74019907920462,3.13160187550166,0.332605283203761,0.0295168991688044,8.19540167913504 +"131",4.54850901081974,0.206109444377944,0.689006573520601,5.4156116883568,1.2064076228614,3.03371767250592,-0.139649672543402,0.224507538278963,7.91813736249803 +"132",5.21002469426818,0.919276255881414,0.934218391077593,7.27116841996101,0.501783037770287,0.00766637720423495,-0.326221325865849,-3.17756831421467,4.32948985668195 +"133",10.8243173721166,0.0228124498389661,0.671412567840889,10.3384643615193,0.14321218127411,3.19085232499221,-0.502473462659871,0.468018716752612,7.79882475085521 +"134",1.10200948383847,0.963759744539857,0.840596231399104,2.03665140182798,0.227212630716121,0.485891795242692,-0.429898406048996,-2.92161515210041,4.48176593861306 +"135",11.4013261007861,0.315865243552253,0.472115368815139,8.44601102722776,1.67459329804481,2.89228376498971,0.280598380383811,-0.392296502812339,7.72158137433394 +"136",4.18231613472072,0.665608417475596,0.546338079730049,9.46095265896809,1.7353658172588,2.85899090647145,0.319223187856843,-0.45072861214397,7.70177407247534 +"137",8.05510835905159,0.533543303376064,0.90352713316679,6.10549770071501,1.98890545562197,0.0528224483199729,0.472407875138575,-2.96393893890645,5.3417484329946 +"138",4.44169081984614,0.817796719493344,0.969267520820722,2.80615465116428,1.08331637919386,0.000119535212859179,-0.0214349252535394,-3.41444527442225,4.39739929708668 +"139",2.08529132785908,0.185263509862125,0.0870215415488929,6.3907665868345,1.09942909019544,2.65146356601602,-0.225527864995526,-0.16658714023421,7.44116449153273 +"140",11.1475163475674,0.399517551530153,0.597765780985355,10.8666863382026,1.90117412089356,3.18628208553969,0.444332944602727,0.147481612526283,8.42509405389148 +"141",2.7861019783759,0.178453260334209,0.939952106913552,2.07472599924968,1.06343540992362,0.00474438675210804,-0.252250066404976,-3.22860877961948,4.35242065073802 +"142",13.6881095743828,0.285434210672975,0.126566371880472,13.5970357084397,1.56256516526625,5.23908039075362,0.184631556302796,1.96011825285023,9.97802930591549 +"143",5.31741296198959,0.629469827050343,0.926261703018099,4.46868024445987,1.83682967381885,0.0138439680907987,0.373929012658608,-3.10783953125918,5.0993689781619 +"144",6.11495952698483,0.300100281601772,0.0245150162372738,8.55639281422205,1.61840426481419,0.114948270131787,0.233549998597184,-2.8105190084651,5.25631048689456 +"145",7.74137768871564,0.443673961563036,0.823366520227864,5.41364065690061,1.96876909094297,0.71629751316949,0.480819080842048,-2.83746760408892,5.47663097351561 +"146",3.34624228524107,0.730200940044597,0.820631313370541,3.30236990954456,1.49938690537335,0.757265140979666,0.200990399418338,-2.81572236395642,5.21854753222438 +"147",2.96534961203185,0.668163536582142,0.0955632287077606,6.17033249098786,1.72732911809592,3.19635231610587,0.315061546186712,0.284145861294429,8.43248690424361 +"148",8.19157942756263,0.311657001264393,0.0596761875785887,7.26853999010067,1.6599906978363,1.14862312236188,0.268587098443486,-1.50313619843394,6.59873039677201 +"149",8.6488380863824,0.478578082984313,0.608956641051918,8.55190545777144,1.99547256223515,3.24252520365169,0.489395213158231,0.282420388326986,8.60509509824768 +"150",10.6969390116775,0.291410150937736,0.358118778094649,11.9753458164291,1.58572500284194,5.62670823337117,0.205176851504398,2.35391170909561,10.3923680573625 +"151",14.2533401492178,0.182174213463441,0.212094453861937,16.5115672005491,1.08316285306962,8.79876647416693,-0.237746600222372,5.09030361758766,12.6858365141278 +"152",6.58979339672035,0.360762583091855,0.618435505079105,7.13597241997315,1.81168901028829,3.27847603033119,0.385334914436177,0.383356557386064,8.60197096858471 +"153",6.53607102012508,0.903800030937418,0.353117618011311,9.0431309623322,0.595282778407846,5.80550735431394,-0.283807682599684,2.51114406601438,10.0606158801772 +"154",8.56593417417295,0.394047617446631,0.844442341709509,5.19732618772515,1.8902239305916,0.441263053589911,0.437619324082108,-2.9303023711868,5.34059644965778 +"155",15.2737689196621,0.779880527406931,0.272385245654732,15.1551468649212,1.27542628966122,8.42371604188693,0.0854521486764344,4.7406087912599,12.6593404366988 +"156",5.43145610533808,0.284158946480602,0.962502768728882,4.28251879575274,1.55755127820775,0.000365129669804719,0.180136544779559,-3.39106461623576,4.62235142530627 +"157",2.61121151427066,0.853720766957849,0.00760855153203011,2.88314156925264,0.88708925359705,0.00408071337812991,-0.132583392029956,-3.19708693150915,4.50360917322336 +"158",8.28147378025705,0.172242468455806,0.496044375933707,6.99427372699582,1.03018518870647,2.75560543336061,-0.275903464871997,-0.565623805785619,6.99175222610485 +"159",8.75048134065555,0.0792641821317375,0.303963934537023,10.9026422964851,0.492900418224209,7.54175049482366,-0.505958629322393,3.99131902055102,11.3186398879911 +"160",11.0564308880546,0.292064977344126,0.099967755144462,11.2078166271679,1.58822896068526,3.48466184699652,0.20737655375115,0.520207853271719,8.56086390378534 +"161",13.3973803516144,0.840371177764609,0.141885310411453,14.232221021184,0.961462989841532,6.18398318265752,-0.0908276699054969,2.75771104767193,10.5001628745289 +"162",0.326869956383643,0.945268080569804,0.903049586340785,1.42606791665275,0.34219876075771,0.0540953469022428,-0.390521975298194,-2.96228776866584,4.48046975279843 +"163",8.12826219720991,0.0449652001261711,0.554629281163216,7.60046034441429,0.281585989503259,2.90833534562543,-0.515548132405514,-0.376674666517189,6.94105669783977 +"164",5.4595139137365,0.758382907602936,0.594052111497149,7.13991744589642,1.37648319194753,3.16497893029053,0.138622383578556,0.100334249275609,8.07223612961664 +"165",13.893864878667,0.296887998003513,0.185394271044061,15.8510044894815,1.60646371170786,8.1995696278457,0.223267393407552,4.55783569224712,12.6143825824171 +"166",2.08915952657456,0.651054438902065,0.883408362045884,3.77430843990287,1.77899548272853,0.128475938489171,0.342216729913258,-2.93261962655374,5.24287660012199 +"167",5.66666497840968,0.0849897842854261,0.468688981607556,5.15060890834275,0.527684187392306,2.92420754367395,-0.500367666207089,-0.354130957317424,6.97878087323796 +"168",3.04666032250377,0.975481075001881,0.959689968731254,3.16993043771862,0.153904647930889,0.000545694270617269,-0.451679986276266,-3.37686992735652,4.00472958312969 +"169",10.0511534416103,0.0136249314527959,0.944737322861329,6.27959216455776,0.0855818299598157,0.00304820125413386,-0.493223644787989,-3.26991478465147,4.07014106732301 +"170",12.6702503357949,0.538869451731443,0.314743722556159,10.4056809507583,1.9851071831509,7.18089618658806,0.469046105849371,3.68643205604863,11.9887576586605 +"171",14.4373546383548,0.965781801613048,0.114289686316624,11.3734306366335,0.214585425738929,4.4354588223243,-0.433840773586416,1.29677966236399,8.69621838554004 +"172",7.16735439519954,0.101073444122449,0.525504657998681,6.5861100111428,0.624445004029644,2.76603287257728,-0.477939402941023,-0.571189916886432,6.78415017693501 +"173",6.52685011943089,0.25675134267658,0.0482292044907808,7.93538417530203,1.44388864955276,0.684311820971795,0.0751063239466202,-1.99120483118816,5.91718098952093 +"174",4.93163094078534,0.895147221162915,0.772821844788268,7.28421915395359,0.646959621294471,1.61643039190016,-0.258980406417279,-1.95987487650635,5.61442421383884 +"175",5.05962355294375,0.387944190762937,0.527643352048472,7.38200161367967,1.87734683404011,2.77293861708998,0.429522355885178,-0.563342340405588,7.69945951224206 +"176",6.53449415592656,0.794285444775596,0.674511657562107,9.69545012353198,1.20442775245838,3.16794789687646,0.046791606726168,0.435972033681172,8.31604313716981 +"177",11.4786453657618,0.349396759876981,0.171516932779923,15.5674979293421,1.78028910299169,7.68725307593958,0.362715312208873,4.08713995250321,12.2831347614746 +"178",2.3091523517772,0.138744306750596,0.953361469553784,1.85066747472213,0.844413113364136,0.00121711844856771,-0.388994919282086,-3.33710861998887,4.10717595749151 +"179",12.5992516537477,0.650508983526379,0.170753609389067,11.9599739602034,1.78055889203007,7.65524071534082,0.343054185312439,4.05793622068072,12.2342699027556 +"180",6.22620891613972,0.544004307826981,0.659396967152134,6.71459904493879,1.98091912165929,3.26015343679889,0.465546161299171,0.546000342176968,8.84482600023861 +"181",4.36901379075179,0.945244047325104,0.807319219456986,2.61011589499358,0.342347538353665,0.97213015586613,-0.390467099734588,-2.66841547978755,4.77439691724034 +"182",7.42191369497547,0.57174574653618,0.163384499261156,10.5797286365228,1.94941140115977,7.32656870071277,0.442427085723668,3.76028708242595,12.0359936649121 +"183",6.37170117305054,0.953633589204401,0.562986994627863,7.48602414055685,0.290299602565009,2.96222527374666,-0.409055292132974,-0.288540937608602,7.13568326702089 +"184",7.94842561601129,0.780252998694777,0.412214461248368,8.44720956110706,1.27362274005704,3.92954529266579,0.0844842591027986,0.75319246204363,8.6709562179089 +"185",2.41185545359076,0.11828445433639,0.902525570942089,3.70017161427447,0.726216315289157,0.0555179369014958,-0.443152498574207,-2.96053895223334,4.42958804595492 +"186",8.71812869875712,0.837111808825284,0.455087962327525,8.60796246097465,0.97936984077061,3.08335316878082,-0.0806747618017936,-0.167941903638852,7.58466283132183 +"187",5.97892970420108,0.0871593176852912,0.139089935924858,8.81998720581041,0.540820386270328,6.01820786231399,-0.497927612877658,2.6160115632436,9.95136344712841 +"188",4.30592310037202,0.748599962564185,0.798090466298163,3.7454596995814,1.42042006547072,1.13439292669776,0.161160527811972,-2.52104625492308,5.47339376965136 +"189",8.26358127802459,0.0651816572062671,0.652757127070799,10.136228843188,0.406692195705059,3.28527548504198,-0.514671246137407,0.560205319733544,7.87881357035861 +"190",6.85569057187856,0.0776955692563206,0.477963302284479,7.57616883602097,0.483342586883615,2.84518360180612,-0.507279063198547,-0.449534830788217,6.87646560277571 +"191",4.62001211044272,0.105083768488839,0.489614740246907,5.48761255379662,0.64833276984391,2.77811965022388,-0.47079085561609,-0.534647752128714,6.82784088901767 +"192",5.40422970604856,0.406686355127022,0.91844050004147,4.34281772998051,1.91467474643983,0.0230908813698341,0.452370175341988,-3.04568089528164,5.23996877682282 +"193",8.98132042472625,0.97496451321058,0.104550529969856,7.7053699983863,0.157140473211627,3.78782360598003,-0.450775770053864,0.767654119975814,8.15015784668442 +"194",12.2384527455073,0.164833495859057,0.391365415183827,6.57289586550156,0.990008459571895,4.51673239182975,-0.303136010895734,1.33484345205443,8.86498693792116 +"195",11.5427692520761,0.503050235565752,0.17471737228334,10.8537234487563,1.99990817452504,7.81720604799617,0.486051415192036,4.20603413382003,12.5253650457745 +"196",15.7304683213593,0.201554203871638,0.216759763890877,14.4197968511661,1.18345679497451,8.85112281472613,-0.158828232733632,5.13319694854361,12.8076482125725 +"197",2.69095766660161,0.199721848359331,0.422036694828421,6.05056707020632,1.17415615448825,3.69046932007962,-0.166489634216466,0.504382095315542,8.17117195786155 +"198",1.97530240184256,0.178135111229494,0.984907931415364,2.64624420730127,1.06174189130067,1.99928450818809e-06,-0.25347891207616,-3.39321995995157,4.18658062473474 +"199",5.73374681651016,0.273866681847721,0.556566108483821,6.0750436823378,1.51617768079247,2.92052697255126,0.142452543921734,-0.357358449682531,7.61837359100167 +"200",6.82432256895498,0.1306202406995,0.179121345514432,9.83789030675655,0.797870840957214,7.98457724518093,-0.412035288484381,4.3598306389895,11.7810748472676 +"201",10.8074379627438,0.858691586414352,0.322833693120629,9.87503709813119,0.858989955865624,6.89821278397541,-0.148128195079056,3.44767934215794,11.1328306438414 +"202",5.46362107008324,0.645160361891612,0.044683248270303,3.55428825787334,1.79561164817481,0.564817499068695,0.351169653630295,-2.13135274536282,6.05309640502994 +"203",4.53318490548806,0.602798665873706,0.731687974883243,6.42759760606631,1.89660566206702,2.40892741716279,0.408742082474463,-0.806453120234473,7.43556845900246 +"204",4.58772409871542,0.971980711910874,0.492423130199313,4.5105979183097,0.175823114846668,2.76706374789028,-0.44545037537573,-0.549550130352234,6.83827899103451 +"205",14.1725310564882,0.376657233573496,0.235632494091988,15.834295668001,1.85171877423164,8.91188255652009,0.412818512474133,5.17303801546442,13.419136024701 +"206",8.72285353306887,0.819114487152547,0.126034506596625,7.60851002374118,1.07634714368671,5.20489775482967,-0.0254072135026907,1.93167160997748,9.73954389323726 +"207",10.3915970101457,0.226738759549335,0.279774357099086,10.6158024277055,1.30718407273612,8.24744739134144,-0.0514167728063648,4.58983869143039,12.3717014153865 +"208",0.87957356103756,0.206508502364159,0.921807960607111,2.79484893692627,1.20840650846888,0.0186660228420888,-0.137961501792496,-3.07130773255908,4.62401026241089 +"209",7.96896572430282,0.194289194187149,0.585632596397772,8.90511224634814,1.14635368121029,3.11306404783769,-0.188992387477943,-0.00844523409785983,7.63584187518667 +"210",12.929587623183,0.240568205481395,0.350823562359437,10.8400741866654,1.37169454948087,5.88807438938653,0.00769513712246455,2.58326377950425,10.4242384133892 +"211",5.02919781715535,0.979721972020343,0.893432515673339,5.022586026664,0.127324445139109,0.0848133998552822,-0.458902247840251,-2.93961744574377,4.43475980317845 +"212",14.4590892898578,0.524250150891021,0.275044727604836,12.3057985750046,1.99419879020799,8.3627821388182,0.477601319499593,4.68838227872661,12.9992630949887 +"213",14.2137121239123,0.826370720751584,0.221272713737562,13.0974251264342,1.03764410604689,8.88736928076497,-0.0474874546898129,5.16171749104071,12.9475095331134 +"214",12.3958031866074,0.670885495841503,0.301245874259621,11.0118680219912,1.71864522530054,7.62906376020643,0.310588649711286,4.06515237441442,12.2090205208882 +"215",6.73566510246716,0.977714836830273,0.887447157641873,5.42011697158716,0.13990745105069,0.109331519964973,-0.455529075197889,-2.93385676122078,4.4438936603438 +"216",9.08101831359865,0.0576484517659992,0.170867978129536,9.73509333705071,0.360239030910237,7.66006188733789,-0.516534046624789,4.0623321436327,11.3790775937704 +"217",12.3148056055373,0.336741157341748,0.126242727739736,12.9238805929127,1.74265733648833,5.21828872551759,0.334489413898475,1.94281264485916,10.1105815555201 +"218",7.13223414369336,0.0126070096157491,0.145286483457312,10.2420519641754,0.079191469947688,6.380938918842,-0.492071573097732,2.92719170009736,10.2683996237621 +"219",6.41075849320638,0.362856285646558,0.929243098711595,3.47016962791091,1.8172224250418,0.0111960955017092,0.389227723652498,-3.13350994217255,5.08899727824242 +"220",9.55103223699052,0.209694300312549,0.0527124027721584,9.22636333661413,1.2242958379397,0.852230261043079,-0.124444350372387,-1.80626020240226,5.90257494398782 +"221",5.8386379137539,0.152120635611936,0.0664937521796674,6.42693311027864,0.919832841244605,1.47745688235836,-0.347075464055508,-1.18959683628213,6.29660719642483 +"222",7.18901871095922,0.935812409734353,0.790176905458793,5.47679632782623,0.40057481186847,1.28054316551605,-0.368244929309371,-2.36724556102801,5.09778900642509 +"223",5.57387933995365,0.40109295793809,0.556372927967459,6.71931175619072,1.90422391485752,2.91930162827978,0.446172716433532,-0.359317394516294,7.92013481867971 +"224",12.3550717320897,0.485836445586756,0.257445320487022,12.6966959994063,1.99802042208597,8.7074369951596,0.489161994939105,4.9863743007274,13.308815792429 +"225",3.87687877982444,0.681486446177587,0.0598067208193243,4.68902312077722,1.68363303994669,1.15457300265338,0.292769818564488,-1.49728202298466,6.62876729234229 +"226",6.42869502211201,0.854035486467183,0.761961632408202,3.76747483298873,0.885316534272504,1.83142471343986,-0.133568391129214,-1.66961227463528,6.03009883099798 +"227",-1.13918576053869,0.912917171837762,0.985238047782332,1.58993165020225,0.540357677387787,1.75729912762741e-06,-0.309125627072593,-3.3914074158149,4.13274645387498 +"228",18.8322988713763,0.475857608020306,0.232479837723076,15.9701571477866,1.99425020795669,8.91799710457917,0.489311365012519,5.18043408266546,13.5030249444404 +"229",8.81647643769406,0.713680299697444,0.616073642158881,6.60328988693828,1.56603184808883,3.270663713188,0.234159450075965,0.359672909002709,8.42711185584115 +"230",5.8062295392422,0.829753480385989,0.82774131372571,3.24395686062539,1.01941575383214,0.65319745479785,-0.0578845427561793,-2.86698321283146,4.90841174117483 +"231",8.84594598394241,0.675797854550183,0.671669385163113,8.80916843747609,1.70265565373256,3.18903268172789,0.302412484125335,0.465554836245395,8.6012468171332 +"232",10.6776680116934,0.339701652759686,0.362262127455324,9.37010285416872,1.75170950891593,5.48015873664833,0.341385597209767,2.22386259003137,10.3985276840036 +"233",9.3717279082331,0.890829901676625,0.965483136475086,6.58180895158583,0.672567390294698,0.00022983152974154,-0.246329017519648,-3.40336462755103,4.18358585169179 +"234",6.52117574471329,0.528829259332269,0.85786680271849,5.94408039436927,1.99180271900758,0.305387911948684,0.475150886308581,-2.94149595264921,5.36693443042184 +"235",8.10148931936547,0.874337470624596,0.737517719622701,6.05751736791144,0.769211125034952,2.30304769716669,-0.196632993057873,-0.97266395428947,6.66398254941513 +"236",7.12501720883781,0.258656927850097,0.723582489416003,7.78386579871968,1.45214755761603,2.54962058915527,0.0828420155300557,-0.580696953386995,7.33542455890553 +"237",3.54104016479785,0.542446065926924,0.495109336683527,7.65710058096658,1.98224457814079,2.75826697781929,0.466634866091414,-0.561809889301307,7.73810447355258 +"238",5.03956946532766,0.216001205379143,0.0090853429865092,2.68076337351045,1.25538861835046,0.00684520572100872,-0.0975164011298739,-3.17086160641084,4.56490148922176 +"239",6.99742107447999,0.216720590135083,0.791309111984447,4.83687633212272,1.25890406975064,1.25929240820688,-0.0944343389094837,-2.39065155180472,5.34819360604827 +"240",10.1650844114559,0.474040792323649,0.0774376934859902,6.74250949323308,1.99335275184075,2.07402652826779,0.489202515268521,-0.656889163874119,7.66559284815687 +"241",4.28489871365194,0.892734028398991,0.559645003871992,5.45694350211064,0.661288216335102,2.9403063566687,-0.251929369225411,-0.325222586999913,7.25612754053715 +"242",7.84049237582303,0.301716960035264,0.697106800973415,10.7324401428901,1.62435143402318,2.93984649145967,0.238634729062914,0.0679267078934939,8.13984093371888 +"243",7.1734373095085,0.555218979716301,0.793073002481833,8.8040799853763,1.96998163055392,1.226399840127,0.457039581681751,-2.42621536442421,5.86410371402002 +"244",5.32696120831095,0.755216216668487,0.756172250024974,5.07810418917611,1.39084967648058,1.94569281380158,0.146026349880404,-1.50779290343045,6.47151294321243 +"245",6.91716640328169,0.956425424199551,0.65849306806922,8.70915194617363,0.2729328137397,3.2641191099443,-0.414980810558252,0.549073459540706,7.96737214574492 +"246",5.44079901899838,0.954311485867947,0.513834197074175,6.4791852088871,0.286084704904952,2.74168394536224,-0.410506319285199,-0.59485293997376,6.82792023750351 +"247",7.14307771464797,0.333364723483101,0.556701492983848,8.26659721679399,1.73214941421058,2.92138689669352,0.326402021896526,-0.355981411013795,7.8037001076452 +"248",5.70610230660257,0.516684105619788,0.900188666302711,6.5255747423841,1.99725333194724,0.0621989558434371,0.481174391815377,-2.95351554746011,5.36093834111774 +"249",9.90199057263109,0.148189591243863,0.458727905293927,7.36194093377736,0.897831049951195,3.03562205703395,-0.359880615359307,-0.223289286155917,7.25010959524724 +"250",4.27827087775049,0.356819598935544,0.998233716702089,3.26301155901195,1.80105554930515,5.95589112848e-12,0.377774218538031,-3.26552447997573,4.94552923532477 +"251",6.472824321144,0.704566315049306,0.758639414561912,7.56894900894284,1.60100393084033,1.89709311005718,0.251507540822785,-1.57721227524916,6.5075747623361 +"252",8.08057244464118,0.0804056408815086,0.366009632823989,8.18940214751478,0.49984801399267,5.34912725153394,-0.504941098566659,2.10660087018085,9.43493926837666 +"253",5.14061367254469,0.251560875913128,0.851000521797687,7.09026710440528,1.42113132073685,0.37102696901751,0.0537914383370045,-2.93891477769418,4.9481561574053 +"254",1.92544398805179,0.0514353215694427,0.712846649345011,4.95001546181278,0.321773079175641,2.72194446733634,-0.516679541840939,-0.297378031940311,7.01922192298122 +"255",8.40782260573999,0.738525302615017,0.519592084456235,11.1994655813435,1.4642644602621,2.75074568483983,0.183367475825336,-0.587275153420467,7.42937181916734 +"256",1.59884952075254,0.0137585073243827,0.0423618387430906,3.11855265334653,0.0864203356126549,0.493104367427008,-0.493372985182009,-2.22001254356646,5.119893968014 +"257",6.20596302846305,0.0423548372928053,0.96031067497097,6.73539667879503,0.265338682989319,0.000500727763105523,-0.514732783427805,-3.38020463215118,3.93834208118348 +"258",6.50561237786139,0.281820128671825,0.452528855297714,8.20708935569012,1.54829096453746,3.11918401062094,0.171790751076687,-0.12657985252594,7.87849039531322 +"259",5.57483796116179,0.0407166101504117,0.520820441655815,5.1365511800249,0.255132918190697,2.75344226741269,-0.51411810548524,-0.584618561861894,6.73454282941533 +"260",9.56301445362816,0.632280522491783,0.186955406796187,11.359977622908,1.82977148176593,8.24873619626202,0.369970489737104,4.60303485806876,12.8062848445683 +"261",3.37896227063795,0.754841333255172,0.0193997251335531,6.69549052194795,1.3925413437308,0.0600214988489152,0.146895900937449,-2.94675472013366,5.03342067756626 +"262",11.2330160325874,0.0509465073700994,0.192370351636782,11.509843660228,0.318741401003438,8.40572621069008,-0.51663914143435,4.74643851896405,12.0630788742922 +"263",12.6061546378687,0.629663853673264,0.355459752492607,10.0927476474301,1.83634703173424,5.72154478132995,0.373657452647653,2.43749578002697,10.6444327294371 +"264",15.0836129660705,0.357108945958316,0.288275173632428,16.1635257505863,1.80184527785969,8.01963000751201,0.378339301790944,4.39601862970506,12.6076374282585 +"265",2.48049263545751,0.808141406625509,0.954780137864873,3.46605036599236,1.1338060907639,0.00102788059067684,0.00724504382643922,-3.34686001220544,4.49366452838347 +"266",8.03067457672127,0.671664241468534,0.594576227013022,5.93069128367273,1.7161376367233,3.168052729271,0.309301507792227,0.107034703151562,8.24961570770626 +"267",6.73935473200106,0.0218871515244246,0.874991813441738,4.95045334563237,0.137412687727305,0.1756790793054,-0.501637821063214,-2.9345470049151,4.39709467078416 +"268",6.13006704536398,0.689538966864347,0.723769654985517,5.26389902165093,1.6557876316788,2.54646727272172,0.27877970205749,-0.585814834789614,7.52624436403035 +"269",9.34139147718244,0.887354608625174,0.458341122372076,9.18701253254345,0.693091099355307,3.04051425615968,-0.236027243576296,-0.21760191233687,7.3796503408493 +"270",8.15995320950429,0.537209264701232,0.636479692999274,6.51645759469446,1.98635079612157,3.30893615068879,0.470123542639561,0.521607868913853,8.82501090831588 +"271",12.3472646009314,0.885026358533651,0.303035995922983,10.4140356639189,0.706794761055944,7.57174584312406,-0.229069891232703,4.01667986632189,11.6208894718517 +"272",3.20085965764582,0.914174510864541,0.957928294083104,2.75458503427534,0.532747190781068,0.000691247917793388,-0.312544012665126,-3.36681848175339,4.15391700234395 +"273",7.87514728636197,0.848979947157204,0.936205095611513,5.66084514201858,0.913686949615122,0.00652871268880538,-0.117741309621664,-3.19532162854388,4.52021655859693 +"274",11.1796241165567,0.293509235838428,0.156131871277466,9.61709986805311,1.59372781266028,6.96990069302852,0.21219236453495,3.44206655505387,11.4875384163513 +"275",7.38820620245059,0.784186411648989,0.372258520917967,9.06108931047183,1.25447072643382,5.13446134811604,0.0741617792429998,1.91228898145548,9.81973025746096 +"276",8.68678546048597,0.493701990693808,0.825098739005625,8.10250256661586,1.99960853568997,0.690951213266945,0.488177355185186,-2.84990426699444,5.47155258495322 +"277",9.26725950564213,0.982573993271217,0.894503128482029,6.64263863571846,0.109436145864132,0.0808862210023331,-0.463554126875457,-2.94124450973865,4.42848086014837 +"278",7.21038670565318,0.243201080709696,0.014919285196811,7.05295130766498,1.3836864688088,0.028573419445755,0.0188329415627727,-3.05269160450866,4.79942083381658 +"279",9.68972359166115,0.0729995195288211,0.742581224767491,6.50364181744077,0.454659491445404,2.20843666531387,-0.510700218329055,-1.11834615242855,6.20423312600487 +"280",2.7748705837562,0.231656596530229,0.0647113677114248,4.2082336486962,1.33041346695367,1.38802823026449,-0.030314330407329,-1.27305224071158,6.52991292564356 +"281",10.1168855574145,0.279911691555753,0.536692324560136,7.47336870979724,1.54067274624838,2.80935838619472,0.16488299301476,-0.518520952523865,7.47964153725337 +"282",9.4560483107348,0.970960318809375,0.498718291521072,4.3254736208973,0.18220869664425,2.74911419904201,-0.443589556793924,-0.575248701263245,6.8144412387053 +"283",11.0411449288406,0.658995781559497,0.474551951512694,8.30170106208409,1.75564434973466,2.87153724521707,0.329822913203354,-0.417347208944345,7.74575520102148 +"284",14.5298084469058,0.670112134423107,0.268144310917705,12.2197325702919,1.72112529628376,8.5146882215885,0.311863600019614,4.81885848999269,12.9640015867748 +"285",11.3269868976982,0.209838527487591,0.201564811402932,11.0670936912564,1.22501228859216,8.62380779075567,-0.123830846980555,4.9406952691221,12.650143918904 +"286",0.222530958634096,0.990622452227399,0.773453313857317,3.19199738319178,0.0589123476788253,1.6039757294036,-0.475763143223457,-1.97606454506951,5.3814518084695 +"287",3.7282799595256,0.53408810053952,0.958072581328452,5.25363035975645,1.98854248980706,0.000678268061507344,0.472076702506604,-3.36767335656366,4.93768284270541 +"288",5.24190162641436,0.574372727656737,0.577234108000994,7.81816900433835,1.94565613492948,3.05787904752128,0.439884631303496,-0.116542987945313,8.15662114012065 +"289",11.541540366177,0.772239736514166,0.166751269018278,13.4046804451625,1.31203500357017,7.48108903359492,0.104948275209519,3.89970997553638,11.8379377475084 +"290",8.5070423653765,0.357089430792257,0.0817670363467187,7.95460697265631,1.80179206100625,2.329504694098,0.378301240749401,-0.437770694402286,7.77381004310959 +"291",6.23206438116776,0.256661231862381,0.714425090467557,6.37005408737076,1.44349682076259,2.69771964869145,0.0747392636606038,-0.337604341847598,7.57041441857548 +"292",8.23269497869425,0.316445876378566,0.145573613466695,9.20912525911611,1.67658517306868,6.39731583279522,0.282224808743312,2.94134164793593,11.0568459534417 +"293",8.32416981575189,0.744443612871692,0.326131327776238,10.3360188052407,1.43868323021077,6.7809078443354,0.170442123009243,3.34845603905424,11.352177658826 +"294",2.12291314729107,0.499665975570679,0.973094961140305,3.1302720681181,1.99999889882545,5.62003748775168e-05,0.486938481984836,-3.41989105409335,4.90032692465396 +"295",15.3600263758104,0.708809185307473,0.136128195794299,12.7606106604918,1.58488479307572,5.83900837630844,0.243511170420181,2.46375331450277,10.5405439816854 +"296",8.73711950018368,0.414896452100947,0.313534565735608,10.9244711325662,1.92894305623237,7.2223830864732,0.460536606184212,3.72146909706361,12.0152852000103 +"297",7.46108795809948,0.209911216050386,0.104810514487326,9.94631549978665,1.22537327480956,3.80508603374259,-0.123521602169258,0.781735032474336,8.49149292706755 +"298",6.55471175942686,0.0808626485522836,0.115289124427363,8.47526038571055,0.502627837144231,4.50172669788554,-0.504520251352286,1.35111910133183,8.67987834674201 +"299",4.02957526685521,0.159290118375793,0.984484651824459,4.62203064382356,0.959596349114719,2.34907888346997e-06,-0.322751197872463,-3.39545210043705,4.11507619845295 +"300",9.53277579679209,0.504089607624337,0.616871093399823,8.12513136570764,1.99983493421752,3.27339078636087,0.485752646087798,0.36778851959531,8.68682066244558 +"301",11.542534041277,0.835440672235563,0.633147458313033,10.6846093146396,0.988511299110681,3.30750987952256,-0.0754812305404021,0.502632274727595,8.26043054094966 +"302",14.4608417672839,0.487449982902035,0.258377277292311,16.7314227552739,1.9984457097571,8.69286976984052,0.489021291877959,4.97359354483064,13.2958943334711 +"303",6.70026971004241,0.432731891516596,0.7043740414083,9.25911504175948,1.95550601767579,2.84479329271969,0.474592158756963,-0.091884994743642,8.21598666077579 +"304",12.5568104719267,0.880691584665328,0.200170952128246,12.3621294074104,0.732207162269688,8.59467766254003,-0.216006726622601,4.91517127569242,12.5324440458323 +"305",2.73168599938694,0.764911714009941,0.831070266198367,3.99046818404331,1.34643526135726,0.607238745843816,0.123019712631393,-2.88542858886323,5.07087062053064 +"306",13.2645599223941,0.0548609865363687,0.23954917746596,10.3551021048998,0.342997726662006,8.89563460933786,-0.516751650956163,5.15653770257067,12.473065548377 +"307",9.54394320548957,0.199217760702595,0.922454906394705,7.73276404636173,1.17159067715478,0.0178959203129144,-0.168591389993599,-3.07644690685908,4.58824119990979 +"308",2.70050439926388,0.686824688687921,0.994719476671889,3.94889549661313,1.66529282385626,4.09070937468749e-09,0.283541508062765,-3.31068936766307,4.80613163716217 +"309",11.8812052557076,0.89925071503967,0.433975759893656,11.3016759265832,0.622509747740396,3.43530104147865,-0.270845845372482,0.229371708569794,7.79180535995978 +"310",6.94072161295675,0.045738689834252,0.462063670158386,4.29630553272924,0.286396722596249,2.99519573618147,-0.515750584492709,-0.270441696500946,7.04708721576881 +"311",6.23259848215608,0.0896180924028158,0.784722708631307,8.225884392865,0.555677493937109,1.38427372788695,-0.49494483277248,-2.24852506038126,5.08980960360873 +"312",2.16700291450075,0.440876809414476,0.849485129583627,3.72765408454448,1.9655993597548,0.386599364532103,0.479395473822704,-2.93753635207994,5.37513861850524 +"313",11.016370179835,0.777965647634119,0.265573306940496,11.2648493095108,1.28467074047118,8.56595749591678,0.0904021597726747,4.86314251307111,12.7868241696063 +"314",9.26462786481945,0.140085093677044,0.184626432834193,10.8428615070658,0.852042326931896,8.17474942059793,-0.385009938831674,4.53499306751149,11.9832626254423 +"315",3.80153478029074,0.678748692618683,0.977755479281768,6.62280518931047,1.69285556768796,1.89191300009103e-05,0.297434553776974,-3.41776051221573,4.71295353832372 +"316",8.76498835038717,0.0475980096962303,0.315603911876678,8.97265895589493,0.29795382293296,7.15124857434082,-0.516163194935848,3.6613955954706,10.9785118972972 +"317",8.92749709070548,0.605647755786777,0.930730486288667,6.55424834451734,1.89084846661384,0.0100310651580178,0.405270255901894,-3.1465663671431,5.09198338552126 +"318",7.96500953471343,0.45014444203116,0.460302937077358,7.91040351389034,1.97551845085091,3.0161403380213,0.483678627852441,-0.245975837833414,8.0709822867815 +"319",7.05208268426177,0.747780841076747,0.565429175272584,7.40086423902934,1.4240385773831,2.97846509293818,0.163003301516748,-0.260681268815337,7.73560152946388 +"320",4.30235663945495,0.177149523049593,0.75580653292127,4.72580541283348,1.05648884658104,1.95288111696478,-0.257274219206108,-1.49745237111403,6.07855290644233 +"321",8.65056519115086,0.65485711558722,0.771063379244879,9.9735384680668,1.76795117508193,1.65116169845594,0.336328627352713,-1.9143458219711,6.25526230214408 +"322",14.7048139220631,0.164108450291678,0.386776611208916,11.5639116293058,0.986047580654626,4.65896601352642,-0.305739801835251,1.47052055546265,8.99806025038987 +"323",20.5189874796727,0.26171372202225,0.222294196952134,16.6891656188729,1.46528704180864,8.89363539772071,0.0951396310506607,5.16645170256358,13.0948708303767 +"324",5.06817851911331,0.0950373853556812,0.0975954020395875,5.7462157206943,0.58830516134369,3.3289032636942,-0.487541093223971,0.392809401036763,7.73854780457526 +"325",2.48119280283383,0.394460162613541,0.928054177900776,3.957244236848,1.89106930205907,0.0122003183136223,0.438143427932233,-3.12318199497887,5.14824092971583 +"326",11.2157268575794,0.21321823168546,0.337013771524653,12.4440696309992,1.24172870833666,6.38859882066985,-0.109421510636378,3.01495686227369,10.7388148483998 +"327",7.14048691257929,0.640531400451437,0.0878528200555593,6.36811570970996,1.80822995464351,2.70343768063937,0.358049294208538,-0.123216956283674,8.06811183468733 +"328",10.4982609351169,0.257619656389579,0.113426668802276,13.2041028116113,1.44765840306116,4.3781692911241,0.0786375847630841,1.24984210926218,9.16175919078773 +"329",7.87218705445584,0.0946140429005027,0.111639449838549,5.90637202799481,0.585762382462738,4.25937662520525,-0.48816105562963,1.15262112236926,8.4977395635021 +"330",15.2843938236953,0.0703983413986862,0.240447912365198,11.1713092577127,0.438728716551512,8.8905806928503,-0.512257458104173,5.15163804667074,12.472660085329 +"331",4.73855442219677,0.188356303144246,0.924856626195833,2.42059912544313,1.11561000539805,0.0152473358721698,-0.213142424466796,-3.09604314734401,4.52409392495167 +"332",3.67770784239227,0.87313848733902,0.854288979200646,4.46597023637895,0.776159621811344,0.338588142783452,-0.192951311488243,-2.94083124023992,4.69949694503431 +"333",2.10717516648587,0.98110359441489,0.996416725683957,2.03011697295836,0.118659892783298,4.06969098180299e-10,-0.461176636230708,-3.28997266379868,4.08213019673309 +"334",11.1912731594065,0.390919700963423,0.573269640561193,11.4947658626437,1.8837111289444,3.03122727084691,0.433550385054397,-0.166366586251665,8.1004632955652 +"335",7.19261901868387,0.0178985111415386,0.917751843109727,5.94507704845664,0.112400409213839,0.024086125039065,-0.497787016448046,-3.0406976713101,4.29479480900433 +"336",0.67705801052742,0.0445446039084345,0.971780526917428,2.15509220897317,0.27896938409911,7.37179973840205e-05,-0.515430498886618,-3.41871426630419,3.89913473157166 +"337",2.55646633510642,0.107764253392816,0.864752684952691,3.02629374812329,0.66424211167465,0.247534794029359,-0.465680319454897,-2.93981715900817,4.4277820182994 +"338",9.48906261327111,0.570300949504599,0.373710860963911,9.78083716765727,1.95142015982445,5.08534085198668,0.443800174453274,1.86741189967839,10.1444915708941 +"339",8.28881657449457,0.839018759317696,0.392924327170476,8.24846184951609,0.968905470154243,4.46939804848487,-0.0866114736490088,1.28928500517763,9.03595302829109 +"340",10.7893906712738,0.815029826015234,0.302610285114497,10.1755378171189,1.0978889988868,7.58544284347045,-0.0131368005635263,4.02826180363411,11.8484044998331 +"341",1.6963359468318,0.861848484026268,0.875388256739825,3.3762892488831,0.841035289449185,0.173223531535946,-0.157978859085551,-2.93436630587618,4.74093433180074 +"342",4.14689981752418,0.853166818618774,0.919808819657192,3.08946466091853,0.890207368637173,0.0212062876830797,-0.130849497805724,-3.05585266344084,4.64657733551591 +"343",11.8290712858121,0.799504384864122,0.764340559253469,10.1882951383768,1.17808839127995,1.78430685178675,0.0321500133039288,-1.73488012752185,6.13054938254455 +"344",4.55107822733008,0.0197318226564676,0.954289121553302,4.0804024100254,0.123899311721726,0.00109050394761665,-0.499606708742526,-3.34353499335083,3.99013779466912 +"345",8.90918225279318,0.522671096259728,0.525734692113474,6.28610342396377,1.99492937854185,2.76674191232862,0.478396485633299,-0.57039709986884,7.74127888252693 +"346",-2.99209781772629,0.363511834526435,0.812384461518377,5.15835268156129,1.81893881439134,0.887487624882357,0.39042933035339,-2.73313475365665,5.49057407345921 +"347",12.3583899287022,0.62698481651023,0.472212609136477,10.6733720809027,1.8429507408737,2.89142482393211,0.377384520007013,-0.393329369111955,7.81733464765753 +"348",5.95216500366717,0.915917906211689,0.909895022865385,4.05936101667041,0.52218094919525,0.0378817392953617,-0.317253118727984,-2.99158275533727,4.52444362269722 +"349",6.2532527839311,0.182820469839498,0.883916945196688,3.85712618336687,1.08657411155479,0.125944614952093,-0.235203544371285,-2.93267871538795,4.66539723700323 +"350",3.99769160795537,0.448590318439528,0.78543156106025,5.13109132796412,1.97397172882372,1.37067521883066,0.483046534822376,-2.26448887463652,6.05183715694832 +"351",5.16868333165862,0.257141285808757,0.128273353679106,8.45530379460297,1.44558290478716,5.34827419715244,0.0766934423421626,2.05115436190663,9.96112730101127 +"352",11.3539344135632,0.594118564389646,0.289729104842991,12.0781801064986,1.9132071594925,7.97825326826469,0.418936364530937,4.36090071441785,12.6131165757113 +"353",6.10323527474453,0.396485476987436,0.856526208575815,4.44474369981153,1.8951733942534,0.317573625898808,0.440674260411422,-2.94140009658805,5.33255366058584 +"354",13.1525210817664,0.873604407999665,0.336089336080477,14.2301021331575,0.773460763340278,6.42211913909141,-0.194382888574732,3.0435853547853,10.682481962973 +"355",10.1481128350808,0.174981040414423,0.520393417216837,11.1033612547998,1.04489555546337,2.75247546350466,-0.265562315522801,-0.585583159416735,6.98213402182293 +"356",10.0707639831157,0.809510399354622,0.181294560898095,11.4580848297116,1.12670973283162,8.06220139351525,0.00322821857911707,4.43132077075027,12.2678284860919 +"357",8.97057793320988,0.794222777010873,0.790394956246018,5.56336468497716,1.20474207597796,1.27644239114434,0.0469653821112755,-2.37178780038999,5.50845707848375 +"358",5.13059582801211,0.604884260566905,0.563907021889463,5.9249940043965,1.89240614930097,2.96832464793104,0.406206634982338,-0.278143846503855,7.96134228524095 +"359",2.85431850570938,0.0521602521184832,0.910183421568945,5.06548493120066,0.326267777042636,0.0372898094740192,-0.516725687584048,-2.99309918574284,4.32345462343558 +"360",10.0474131916676,0.691322281723842,0.923455620184541,8.83550002093998,1.64947702163543,0.0167528065445691,0.275624830032734,-3.08451734844576,5.02438697834944 +"361",13.8188887475339,0.151410281192511,0.290930409217253,10.8114352837385,0.915867322566933,7.94357268495259,-0.349418075576005,4.33148132936913,11.8153427505556 +"362",9.07366725683079,0.200573988491669,0.437914396636188,7.04254670946449,1.1784862921423,3.35993054485642,-0.162930807756803,0.146072165578875,7.81642085458454 +"363",7.08368270204269,0.103487114887685,0.736869905376807,4.53798760562394,0.638834313969767,2.31498451984535,-0.473709108858096,-0.954090466531904,6.40547992137247 +"364",4.14852869979833,0.012661857996136,0.94318240811117,6.39272188991572,0.0795358210487005,0.00353573661059901,-0.492134279585221,-3.25670870974633,4.08443650743092 +"365",9.03094416481812,0.652539103291929,0.372655788203701,9.94290167735445,1.77471362244393,5.12099440784944,0.33992817405249,1.90000140994179,10.0732090807567 +"366",7.06883748067444,0.242039749631658,0.0196202660445124,4.84682786832394,1.37840859126441,0.0619523702674271,0.0139265902547422,-2.9412116538909,4.90599443312632 +"367",3.41631725252482,0.12893533706665,0.801264123991132,3.47302183784076,0.788152053555392,1.077505847357,-0.41656817434859,-2.57587283795151,4.84083848446237 +"368",3.73212320453537,0.0583229728508741,0.00805668556131423,2.91979425873501,0.364407044012538,0.00482322797116981,-0.516443619505929,-3.18928979417868,4.12754608307786 +"369",9.0446792531361,0.706828978611156,0.506798200309277,10.4542573147313,1.5924430370064,2.73920163479908,0.247260179012749,-0.592975713855334,7.48756396191989 +"370",6.42608920331631,0.0305523870047182,0.103799587115645,7.14673610599508,0.191671688094093,3.73799276194507,-0.508585260527664,0.72700537816044,8.05169961439525 +"371",7.47148146766214,0.880324190948159,0.372392780147493,6.98661343819704,0.734354813955167,5.12990754440694,-0.214893443147804,1.90813531827761,9.52652137189228 +"372",5.91644821822456,0.0163111232686788,0.797900030622259,2.68295630983188,0.10244096414375,1.1378401039845,-0.496144051685501,-2.51762550883321,4.81950993624376 +"373",12.8787113505281,0.51006367104128,0.187864230014384,13.0957856694255,1.99900051464739,8.27655601358158,0.483799224851068,4.62856877172451,12.945647493338 +"374",6.65999818282765,0.644336043624207,0.707357286475599,6.80171915520363,1.79788656401295,2.80296045007815,0.352404643133802,-0.162091971759404,8.02359216813687 +"375",8.18094130999271,0.696770017966628,0.370172306196764,9.49251078305828,1.62987933460597,5.20554971894659,0.265854188741919,1.97695594228514,10.0760896277895 +"376",10.7948002641182,0.65793322189711,0.352191052399576,8.95147554901468,1.75883240132155,5.83882026747036,0.331502750728794,2.5402772277424,10.7050594752337 +"377",9.10070137198408,0.256520541151986,0.495802453253418,10.5107145864981,1.44288482414954,2.75627441871513,0.0741659475039619,-0.564659390547165,7.34278605371927 +"378",13.077059128373,0.997772415168583,0.316260900115594,11.334371066422,0.0139962140401328,7.12853230760339,-0.485428354525846,3.64221347810444,10.9900646203411 +"379",7.31720786869268,0.692743511404842,0.924121809890494,6.57893993480074,1.64441063953705,0.0160233953675375,0.273095324563216,-3.08996649486964,5.01640832645605 +"380",4.14553841390247,0.050650333520025,0.407308240653947,6.46833798244935,0.31690413281956,4.05835588250739,-0.516611035649378,0.884112068503304,8.2007805296164 +"381",8.32318567748431,0.101665382971987,0.225301343249157,12.6799060793339,0.627977254156651,8.90798431540568,-0.476922300090175,5.17678850651178,12.5331457031841 +"382",11.6756987683142,0.480166190303862,0.157511479454115,11.2143768971667,1.99611875094223,7.04016900102137,0.489400655289477,3.50436356194584,11.8270437139978 +"383",9.80250157892355,0.469402798917145,0.690121093066409,11.1818063327483,1.99076730006703,3.02158349185024,0.488730296931828,0.204447710518312,8.52645750421261 +"384",10.038256935945,0.26619590446353,0.408082694979385,9.13836495800216,1.48430881405787,4.03762029330971,0.112901152295095,0.863175151548687,8.80935580060626 +"385",16.7105577697823,0.0892610601149499,0.192707575159147,14.8436668046374,0.553522168635201,8.41480440519495,-0.495392394394994,4.75466039273355,12.092547495101 +"386",1.66428590292769,0.611460734857246,0.813842216739431,3.89049735988072,1.87863277503279,0.863763864813255,0.397998628591906,-2.74970858126348,5.4815695440909 +"387",9.85936743040148,0.394997322699055,0.455590084893629,10.0051608460246,1.89216526865649,3.07654334933646,0.438821481707866,-0.175820512673775,8.09628046579656 +"388",4.59240497619319,0.539619093062356,0.806352156447247,4.11768905422987,1.9845279430074,0.988664791891066,0.468550885257808,-2.65474706470892,5.64708331731135 +"389",9.08033949289069,0.861605958081782,0.579053814290091,6.39009971718011,0.842417597269501,3.07002284892736,-0.157222895324708,-0.0933431801013843,7.58271342133638 +"390",4.39891903743915,0.752407587366179,0.970640147803351,2.83720196433787,1.40347658289949,9.22983555974524e-05,0.152505623225775,-3.41709820169755,4.5686869182907 +"391",7.76090244771684,0.758213603869081,0.0499366230797023,5.67803757389467,1.37725474036515,0.746076366821831,0.139020903798343,-1.92176231917206,6.05053808138875 +"392",14.7597132904136,0.923896053107455,0.247958487831056,13.9051981612286,0.473632558589555,8.82963897169049,-0.33832855877902,5.09510746436654,12.59005840235 +"393",3.23626506699794,0.328969847410917,0.784063768573105,4.4983137376703,1.71818020292517,1.3969432853694,0.31551644745982,-2.23354890675938,5.91524703746291 +"394",3.13757948066646,0.156375913182274,0.570472833700478,5.32353590208016,0.943491119407611,3.01235870732311,-0.332785101530236,-0.200752607386964,7.29974178784527 +"395",10.6479686896438,0.215196318458766,0.439226890914142,10.287771317249,1.25144773978732,3.33579890875881,-0.100962685736203,0.119192859627258,7.85150967065353 +"396",4.52433799093305,0.112823529634625,0.548878187779337,5.11642453061976,0.694140908466676,2.87355309963357,-0.455328588185517,-0.429559314302916,6.94839159427404 +"397",6.75206990082609,0.195784424664453,0.0590249181259423,5.53334624690233,1.15403941067906,1.11914771196659,-0.182832972774027,-1.53225328771972,6.11819323626873 +"398",6.81152672037255,0.857661027694121,0.429245780454949,8.45848009643978,0.864832989903012,3.53163058776979,-0.144908203141127,0.334427477860584,8.02279877148193 +"399",13.874912682093,0.22770716319792,0.142380580073223,12.688615108893,1.3117831727608,6.21299568220015,-0.0472576520888378,2.7825976145943,10.5686194592679 +"400",9.80836313459695,0.767020934959874,0.093200899893418,8.57815770718647,1.33660619337118,3.04348520440322,0.117879721834851,0.158447553942182,8.1096067725395 diff --git a/shared/package-files/9d/9d7713d547a9a9e3f8a26873d8fcd9def37da11fe59086a5529dcf71631d2483/blob b/shared/package-files/9d/9d7713d547a9a9e3f8a26873d8fcd9def37da11fe59086a5529dcf71631d2483/blob new file mode 100644 index 0000000000000000000000000000000000000000..0b10747160dd6f4a1056c0516dd64b38b7bb3030 --- /dev/null +++ b/shared/package-files/9d/9d7713d547a9a9e3f8a26873d8fcd9def37da11fe59086a5529dcf71631d2483/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::batch_norm_elemt(Tensor input, Tensor? weight, Tensor? bias, Tensor mean, Tensor invstd, float eps) -> Tensor +inline at::Tensor batch_norm_elemt(const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, const at::Tensor & mean, const at::Tensor & invstd, double eps) { + return at::_ops::batch_norm_elemt::call(input, weight, bias, mean, invstd, eps); +} + +// aten::batch_norm_elemt.out(Tensor input, Tensor? weight, Tensor? bias, Tensor mean, Tensor invstd, float eps, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & batch_norm_elemt_out(at::Tensor & out, const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, const at::Tensor & mean, const at::Tensor & invstd, double eps) { + return at::_ops::batch_norm_elemt_out::call(input, weight, bias, mean, invstd, eps, out); +} +// aten::batch_norm_elemt.out(Tensor input, Tensor? weight, Tensor? bias, Tensor mean, Tensor invstd, float eps, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & batch_norm_elemt_outf(const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, const at::Tensor & mean, const at::Tensor & invstd, double eps, at::Tensor & out) { + return at::_ops::batch_norm_elemt_out::call(input, weight, bias, mean, invstd, eps, out); +} + +} diff --git a/shared/package-files/9d/9d782a8cbdced815747a6f9793ca9545165bfd7d324261c4eaf9924af23d2b37/blob b/shared/package-files/9d/9d782a8cbdced815747a6f9793ca9545165bfd7d324261c4eaf9924af23d2b37/blob new file mode 100644 index 0000000000000000000000000000000000000000..e2714921a8f3c05189d20a9151931fb6eadf493b Binary files /dev/null and b/shared/package-files/9d/9d782a8cbdced815747a6f9793ca9545165bfd7d324261c4eaf9924af23d2b37/blob differ diff --git a/shared/package-files/9d/9d787ff70a4acfd5eea9784730c3a4275a8fa71c07a2f766a3e94dc74b359e3f/blob b/shared/package-files/9d/9d787ff70a4acfd5eea9784730c3a4275a8fa71c07a2f766a3e94dc74b359e3f/blob new file mode 100644 index 0000000000000000000000000000000000000000..cbc9de2de091d03295a0aca0011036e0a67a97eb --- /dev/null +++ b/shared/package-files/9d/9d787ff70a4acfd5eea9784730c3a4275a8fa71c07a2f766a3e94dc74b359e3f/blob @@ -0,0 +1,157 @@ +from collections import OrderedDict + +""" +This file contains helper functions that implement experimental functionality +for named tensors in python. All of these are experimental, unstable, and +subject to change or deletion. +""" + + +def check_serializing_named_tensor(tensor): + if tensor.has_names(): + raise RuntimeError( + "NYI: Named tensors don't support serialization. Please drop " + "names via `tensor = tensor.rename(None)` before serialization." + ) + + +def build_dim_map(tensor): + """Returns a map of { dim: dim_name } where dim is a name if the dim is named + and the dim index otherwise.""" + return OrderedDict( + [(idx if name is None else name, name) for idx, name in enumerate(tensor.names)] + ) + + +def unzip_namedshape(namedshape): + if isinstance(namedshape, OrderedDict): + namedshape = namedshape.items() + if not hasattr(namedshape, "__iter__") and not isinstance(namedshape, tuple): + raise RuntimeError( + f"Expected namedshape to be OrderedDict or iterable of tuples, got: {type(namedshape)}" + ) + if len(namedshape) == 0: + raise RuntimeError("Expected namedshape to non-empty.") + return zip(*namedshape) + + +def namer_api_name(inplace): + if inplace: + return "rename_" + else: + return "rename" + + +def is_ellipsis(item): + return item == Ellipsis or item == "..." + + +def single_ellipsis_index(names, fn_name): + ellipsis_indices = [i for i, name in enumerate(names) if is_ellipsis(name)] + if len(ellipsis_indices) >= 2: + raise RuntimeError( + f"{fn_name}: More than one Ellipsis ('...') found in names (" + f"{names}). This function supports up to one Ellipsis." + ) + if len(ellipsis_indices) == 1: + return ellipsis_indices[0] + return None + + +def expand_single_ellipsis(numel_pre_glob, numel_post_glob, names): + return names[numel_pre_glob : len(names) - numel_post_glob] + + +def replace_ellipsis_by_position(ellipsis_idx, names, tensor_names): + globbed_names = expand_single_ellipsis( + ellipsis_idx, len(names) - ellipsis_idx - 1, tensor_names + ) + return names[:ellipsis_idx] + globbed_names + names[ellipsis_idx + 1 :] + + +def resolve_ellipsis(names, tensor_names, fn_name): + """ + Expands ... inside `names` to be equal to a list of names from `tensor_names`. + """ + ellipsis_idx = single_ellipsis_index(names, fn_name) + if ellipsis_idx is None: + return names + return replace_ellipsis_by_position(ellipsis_idx, names, tensor_names) + + +def update_names_with_list(tensor, names, inplace): + # Special case for tensor.rename(None) + if len(names) == 1 and names[0] is None: + return tensor._update_names(None, inplace) + + return tensor._update_names( + resolve_ellipsis(names, tensor.names, namer_api_name(inplace)), inplace + ) + + +def update_names_with_mapping(tensor, rename_map, inplace): + dim_map = build_dim_map(tensor) + for old_dim in rename_map.keys(): + new_dim = rename_map[old_dim] + if old_dim in dim_map.keys(): + dim_map[old_dim] = new_dim + else: + raise RuntimeError( + f"{namer_api_name(inplace)}: Tried to rename dim '{old_dim}' to dim " + f"{new_dim} in Tensor[{tensor.names}] but dim '{old_dim}' does not exist" + ) + return tensor._update_names(tuple(dim_map.values()), inplace) + + +def update_names(tensor, names, rename_map, inplace): + """There are two usages: + + tensor.rename(*names) returns a view on tensor with named dims `names`. + `names` must be of length `tensor.dim()`; otherwise, if '...' is in `names`, + then it is expanded greedily to be equal to the corresponding names from + `tensor.names`. + + For example, + ``` + >>> # xdoctest: +SKIP + >>> x = torch.empty(2, 3, 5, 7, names=('N', 'C', 'H', 'W')) + >>> x.rename('...', 'height', 'width').names + ('N', 'C', 'height', 'width') + + >>> # xdoctest: +SKIP + >>> x.rename('batch', '...', 'width').names + ('batch', 'C', 'H', 'width') + + ``` + + tensor.rename(**rename_map) returns a view on tensor that has rename dims + as specified in the mapping `rename_map`. + + For example, + ``` + >>> # xdoctest: +SKIP + >>> x = torch.empty(2, 3, 5, 7, names=('N', 'C', 'H', 'W')) + >>> x.rename(W='width', H='height').names + ('N', 'C', 'height', 'width') + + ``` + + Finally, tensor.rename has an in-place version called tensor.rename_. + """ + has_names = len(names) > 0 + has_rename_pairs = bool(rename_map) + if has_names and has_rename_pairs: + raise RuntimeError( + f"{namer_api_name(inplace)}: This function takes either positional " + f"args or keyword args, but not both. Use tensor.{namer_api_name(inplace)}(*names) " + f"to name dims and tensor.{namer_api_name(inplace)}(**rename_map) to rename " + "dims." + ) + + # Special case for tensor.rename(*[]), which is valid for a 0 dim tensor. + if not has_names and not has_rename_pairs: + return update_names_with_list(tensor, names, inplace) + + if has_names: + return update_names_with_list(tensor, names, inplace) + return update_names_with_mapping(tensor, rename_map, inplace) diff --git a/shared/package-files/9d/9d788dfd745230bb1b2322e8d8768caf8e3e46433973990830a406f0f880f3ac/blob b/shared/package-files/9d/9d788dfd745230bb1b2322e8d8768caf8e3e46433973990830a406f0f880f3ac/blob new file mode 100644 index 0000000000000000000000000000000000000000..bd5d7e93fdf0e2c179c04ff93d80f88d33b691c4 --- /dev/null +++ b/shared/package-files/9d/9d788dfd745230bb1b2322e8d8768caf8e3e46433973990830a406f0f880f3ac/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & fill_diagonal_(at::Tensor & self, const at::Scalar & fill_value, bool wrap=false); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9d78e0e95f442cd086d18adfbffd8f69b07ce9223b4c0e65e9f9f8f97ac7d6b2/blob b/shared/package-files/9d/9d78e0e95f442cd086d18adfbffd8f69b07ce9223b4c0e65e9f9f8f97ac7d6b2/blob new file mode 100644 index 0000000000000000000000000000000000000000..077af16966037a3edb15f29ad91753669e32e6b9 --- /dev/null +++ b/shared/package-files/9d/9d78e0e95f442cd086d18adfbffd8f69b07ce9223b4c0e65e9f9f8f97ac7d6b2/blob @@ -0,0 +1,601 @@ +""" +Tests for the typeof() machinery. +""" +import array +from collections import namedtuple +import enum +import mmap +import typing as py_typing +import random +import string + +import numpy as np + +import unittest +from numba import jit, _dispatcher +from numba.core import types +from numba.core.errors import NumbaValueError, NumbaTypeError +from numba.misc.special import typeof +from numba.core.dispatcher import OmittedArg +from numba._dispatcher import compute_fingerprint + +from numba.tests.support import TestCase, skip_unless_cffi, tag +from numba.tests.test_numpy_support import ValueTypingTestBase +from numba.tests.ctypes_usecases import * +from numba.tests.enum_usecases import * +from numba.np import numpy_support + + +recordtype = np.dtype([('a', np.float64), + ('b', np.int32), + ('c', np.complex64), + ('d', (np.str_, 5))]) + +recordtype2 = np.dtype([('e', np.int8), + ('f', np.float64)]) + +recordtype3 = np.dtype([('e', np.int8), + ('f', np.float64)], align=True) + +Point = namedtuple('Point', ('x', 'y')) + +Rect = namedtuple('Rect', ('width', 'height')) + + +class Custom(object): + + @property + def _numba_type_(self): + """ + Magic attribute expected by Numba to get the numba type that + represents this object. + """ + return types.UniTuple(types.boolean, 42) + + +class TestTypeof(ValueTypingTestBase, TestCase): + """ + Test typeof() and, implicitly, typing.Context.get_argument_type(). + """ + + def test_number_values(self): + """ + Test special.typeof() with scalar number values. + """ + self.check_number_values(typeof) + # These values mirror Dispatcher semantics + self.assertEqual(typeof(1), types.intp) + self.assertEqual(typeof(-1), types.intp) + self.assertEqual(typeof(2**40), types.int64) + self.assertEqual(typeof(2**63), types.uint64) + self.assertEqual(typeof(2**63 - 1), types.int64) + self.assertEqual(typeof(-2**63), types.int64) + + def test_datetime_values(self): + """ + Test special.typeof() with np.timedelta64 values. + """ + self.check_datetime_values(typeof) + + def test_timedelta_values(self): + """ + Test special.typeof() with np.timedelta64 values. + """ + self.check_timedelta_values(typeof) + + def test_array_values(self): + """ + Test special.typeof() with ndarray values. + """ + def check(arr, ndim, layout, mutable, aligned): + ty = typeof(arr) + self.assertIsInstance(ty, types.Array) + self.assertEqual(ty.ndim, ndim) + self.assertEqual(ty.layout, layout) + self.assertEqual(ty.mutable, mutable) + self.assertEqual(ty.aligned, aligned) + + a1 = np.arange(10) + check(a1, 1, 'C', True, True) + a2 = np.arange(10).reshape(2, 5) + check(a2, 2, 'C', True, True) + check(a2.T, 2, 'F', True, True) + a3 = (np.arange(60))[::2].reshape((2, 5, 3)) + check(a3, 3, 'A', True, True) + a4 = np.arange(1).reshape(()) + check(a4, 0, 'C', True, True) + a4.flags.writeable = False + check(a4, 0, 'C', False, True) + + # Unsupported dtype + a5 = a1.astype(a1.dtype.newbyteorder()) + with self.assertRaises(NumbaValueError) as raises: + typeof(a5) + self.assertIn("Unsupported array dtype: %s" % (a5.dtype,), + str(raises.exception)) + + # Unsupported array type (masked array) + with self.assertRaises(NumbaTypeError) as raises: + masked_arr = np.ma.MaskedArray([1]) + typeof(masked_arr) + self.assertIn(f"Unsupported array type: numpy.ma.MaskedArray", + str(raises.exception)) + + def test_structured_arrays(self): + def check(arr, dtype, ndim, layout, aligned): + ty = typeof(arr) + self.assertIsInstance(ty, types.Array) + self.assertEqual(ty.dtype, dtype) + self.assertEqual(ty.ndim, ndim) + self.assertEqual(ty.layout, layout) + self.assertEqual(ty.aligned, aligned) + + dtype = np.dtype([('m', np.int32), ('n', 'S5')]) + rec_ty = numpy_support.from_struct_dtype(dtype) + + arr = np.empty(4, dtype=dtype) + check(arr, rec_ty, 1, "C", False) + arr = np.recarray(4, dtype=dtype) + check(arr, rec_ty, 1, "C", False) + + dtype = np.dtype([('m', np.int32), ('n', 'S5')], align=True) + rec_ty = numpy_support.from_struct_dtype(dtype) + + arr = np.empty(4, dtype=dtype) + check(arr, rec_ty, 1, "C", True) + arr = np.recarray(4, dtype=dtype) + check(arr, rec_ty, 1, "C", True) + + def test_buffers(self): + b = b"xx" + ty = typeof(b) + self.assertEqual(ty, types.Bytes(types.uint8, 1, "C")) + self.assertFalse(ty.mutable) + ty = typeof(memoryview(b)) + self.assertEqual(ty, types.MemoryView(types.uint8, 1, "C", + readonly=True)) + self.assertFalse(ty.mutable) + ty = typeof(array.array('i', [0, 1, 2])) + self.assertEqual(ty, types.PyArray(types.int32, 1, "C")) + self.assertTrue(ty.mutable) + + b = bytearray(10) + ty = typeof(b) + self.assertEqual(ty, types.ByteArray(types.uint8, 1, "C")) + self.assertTrue(ty.mutable) + + def test_none(self): + ty = typeof(None) + self.assertEqual(ty, types.none) + + def test_ellipsis(self): + ty = typeof(Ellipsis) + self.assertEqual(ty, types.ellipsis) + + def test_str(self): + ty = typeof("abc") + self.assertEqual(ty, types.string) + + def test_slices(self): + for args in [(1,), (1, 2), (1, 2, 1), (1, 2, None)]: + v = slice(*args) + self.assertIs(typeof(v), types.slice2_type) + for args in [(1, 2, 2), (1, 2, -1), (None, None, -2)]: + v = slice(*args) + self.assertIs(typeof(v), types.slice3_type) + + def test_tuples(self): + v = (1, 2) + self.assertEqual(typeof(v), types.UniTuple(types.intp, 2)) + v = (1, (2.0, 3)) + self.assertEqual(typeof(v), + types.Tuple((types.intp, + types.Tuple((types.float64, types.intp)))) + ) + + def test_lists(self): + v = [1.0] * 100 + self.assertEqual(typeof(v), types.List(types.float64, reflected=True)) + + bad_v = [{1: 3}] + with self.assertRaises(ValueError) as raises: + typeof(bad_v) + self.assertIn("Cannot type list element type", str(raises.exception)) + + def test_sets(self): + v = set([1.0, 2.0, 3.0]) + self.assertEqual(typeof(v), types.Set(types.float64, reflected=True)) + v = frozenset(v) + with self.assertRaises(ValueError) as raises: + typeof(v) + self.assertIn("Cannot determine Numba type of", str(raises.exception)) + + def test_namedtuple(self): + v = Point(1, 2) + tp_point = typeof(v) + self.assertEqual(tp_point, + types.NamedUniTuple(types.intp, 2, Point)) + v = Point(1, 2.0) + self.assertEqual(typeof(v), + types.NamedTuple([types.intp, types.float64], Point)) + w = Rect(3, 4) + tp_rect = typeof(w) + self.assertEqual(tp_rect, + types.NamedUniTuple(types.intp, 2, Rect)) + self.assertNotEqual(tp_rect, tp_point) + self.assertNotEqual(tp_rect, types.UniTuple(tp_rect.dtype, tp_rect.count)) + + def test_enum(self): + tp_red = typeof(Color.red) + self.assertEqual(tp_red, types.EnumMember(Color, types.intp)) + self.assertEqual(tp_red, typeof(Color.blue)) + tp_choc = typeof(Shake.chocolate) + self.assertEqual(tp_choc, types.EnumMember(Shake, types.intp)) + self.assertEqual(tp_choc, typeof(Shake.mint)) + self.assertNotEqual(tp_choc, tp_red) + tp_404 = typeof(RequestError.not_found) + self.assertEqual(tp_404, types.IntEnumMember(RequestError, types.intp)) + self.assertEqual(tp_404, typeof(RequestError.internal_error)) + + with self.assertRaises(ValueError) as raises: + typeof(HeterogeneousEnum.red) + self.assertEqual(str(raises.exception), + "Cannot type heterogeneous enum: got value types complex128, float64") + + def test_enum_class(self): + tp_color = typeof(Color) + self.assertEqual(tp_color, types.EnumClass(Color, types.intp)) + tp_shake = typeof(Shake) + self.assertEqual(tp_shake, types.EnumClass(Shake, types.intp)) + self.assertNotEqual(tp_shake, tp_color) + tp_shape = typeof(Shape) + self.assertEqual(tp_shape, types.IntEnumClass(Shape, types.intp)) + tp_error = typeof(RequestError) + self.assertEqual(tp_error, + types.IntEnumClass(RequestError, types.intp)) + self.assertNotEqual(tp_error, tp_shape) + + with self.assertRaises(ValueError) as raises: + typeof(HeterogeneousEnum) + self.assertEqual(str(raises.exception), + "Cannot type heterogeneous enum: got value types complex128, float64") + + def test_dtype(self): + dtype = np.dtype('int64') + self.assertEqual(typeof(dtype), types.DType(types.int64)) + + dtype = np.dtype([('m', np.int32), ('n', 'S5')]) + rec_ty = numpy_support.from_struct_dtype(dtype) + self.assertEqual(typeof(dtype), types.DType(rec_ty)) + + def test_dtype_values(self): + self.assertEqual(typeof(np.int64), types.NumberClass(types.int64)) + self.assertEqual(typeof(np.float64), types.NumberClass(types.float64)) + self.assertEqual(typeof(np.int32), types.NumberClass(types.int32)) + self.assertEqual(typeof(np.int8), types.NumberClass(types.int8)) + + def test_ctypes(self): + ty_cos = typeof(c_cos) + ty_sin = typeof(c_sin) + self.assertIsInstance(ty_cos, types.ExternalFunctionPointer) + self.assertEqual(ty_cos.sig.args, (types.float64,)) + self.assertEqual(ty_cos.sig.return_type, types.float64) + self.assertEqual(ty_cos, ty_sin) + self.assertNotEqual(ty_cos.get_pointer(c_cos), + ty_sin.get_pointer(c_sin)) + + @skip_unless_cffi + def test_cffi(self): + from numba.tests import cffi_usecases as mod + mod.init() + ty_cffi_cos = typeof(mod.cffi_cos) + ty_cffi_sin = typeof(mod.cffi_sin) + ty_cffi_boolean = typeof(mod.cffi_bool) + self.assertIsInstance(ty_cffi_cos, types.ExternalFunctionPointer) + self.assertEqual(ty_cffi_boolean.sig.return_type, types.boolean) + self.assertEqual(ty_cffi_cos.sig.args, (types.float64,)) + self.assertEqual(ty_cffi_cos.sig.return_type, types.float64) + self.assertEqual(ty_cffi_cos, ty_cffi_sin) + ty_ctypes_cos = typeof(c_cos) + self.assertNotEqual(ty_cffi_cos, ty_ctypes_cos) + self.assertNotEqual(ty_cffi_cos.get_pointer(mod.cffi_cos), + ty_cffi_sin.get_pointer(mod.cffi_sin)) + self.assertEqual(ty_cffi_cos.get_pointer(mod.cffi_cos), + ty_ctypes_cos.get_pointer(c_cos)) + + def test_custom(self): + ty = typeof(Custom()) + self.assertEqual(ty, types.UniTuple(types.boolean, 42)) + + def test_omitted_args(self): + ty0 = typeof(OmittedArg(0.0)) + ty1 = typeof(OmittedArg(1)) + ty2 = typeof(OmittedArg(1.0)) + ty3 = typeof(OmittedArg(1.0)) + self.assertEqual(ty0, types.Omitted(0.0)) + self.assertEqual(ty1, types.Omitted(1)) + self.assertEqual(ty2, types.Omitted(1.0)) + self.assertEqual(len({ty0, ty1, ty2}), 3) + self.assertEqual(ty3, ty2) + + def test_np_random(self): + rng = np.random.default_rng() + ty_rng = typeof(rng) + ty_bitgen = typeof(rng.bit_generator) + + self.assertEqual(ty_rng, types.npy_rng) + self.assertEqual(ty_bitgen, types.npy_bitgen) + + +class DistinctChecker(object): + + def __init__(self): + self._distinct = set() + + def add(self, obj): + if obj in self._distinct: + raise AssertionError("%r already in %r" % (obj, self._distinct)) + self._distinct.add(obj) + + +class TestFingerprint(TestCase): + """ + Tests for _dispatcher.compute_fingerprint() + + Each fingerprint must denote values of only one Numba type (this is + the condition for correctness), but values of a Numba type may be + denoted by several distinct fingerprints (it only makes the cache + less efficient). + """ + + def test_floats(self): + s = compute_fingerprint(1.0) + self.assertEqual(compute_fingerprint(2.0), s) + s = compute_fingerprint(np.float32()) + self.assertEqual(compute_fingerprint(np.float32(2.0)), s) + self.assertNotEqual(compute_fingerprint(np.float64()), s) + + def test_ints(self): + s = compute_fingerprint(1) + for v in (-1, 2**60): + self.assertEqual(compute_fingerprint(v), s) + # Different int widths resolve to different fingerprints + distinct = set() + for tp in ('int8', 'int16', 'int32', 'int64', + 'uint8', 'uint16', 'uint32', 'uint64'): + tp = getattr(np, tp) + distinct.add(compute_fingerprint(tp())) + self.assertEqual(len(distinct), 8, distinct) + + def test_bool(self): + s = compute_fingerprint(True) + self.assertEqual(compute_fingerprint(False), s) + self.assertNotEqual(compute_fingerprint(1), s) + + def test_complex(self): + s = compute_fingerprint(1j) + self.assertEqual(s, compute_fingerprint(1+0j)) + s = compute_fingerprint(np.complex64()) + self.assertEqual(compute_fingerprint(np.complex64(2.0)), s) + self.assertNotEqual(compute_fingerprint(np.complex128()), s) + + def test_none(self): + compute_fingerprint(None) + + def test_enums(self): + # Enums should fail fingerprinting, even IntEnums + with self.assertRaises(NotImplementedError): + compute_fingerprint(Color.red) + with self.assertRaises(NotImplementedError): + compute_fingerprint(RequestError.not_found) + + def test_records(self): + d1 = np.dtype([('m', np.int32), ('n', np.int64)]) + d2 = np.dtype([('m', np.int32), ('n', np.int16)]) + v1 = np.empty(1, dtype=d1)[0] + v2 = np.empty(1, dtype=d2)[0] + self.assertNotEqual(compute_fingerprint(v1), + compute_fingerprint(v2)) + + def test_datetime(self): + a = np.datetime64(1, 'Y') + b = np.datetime64(2, 'Y') + c = np.datetime64(2, 's') + d = np.timedelta64(2, 's') + self.assertEqual(compute_fingerprint(a), + compute_fingerprint(b)) + distinct = set(compute_fingerprint(x) for x in (a, c, d)) + self.assertEqual(len(distinct), 3, distinct) + + def test_arrays(self): + distinct = DistinctChecker() + + # 1D + arr = np.empty(4, dtype=np.float64) + s = compute_fingerprint(arr) + distinct.add(s) + self.assertEqual(compute_fingerprint(arr[:1]), s) + # Non-contiguous + distinct.add(compute_fingerprint(arr[::2])) + # Other type + distinct.add(compute_fingerprint(arr.astype(np.complex64))) + # Readonly + arr.setflags(write=False) + distinct.add(compute_fingerprint(arr)) + + # 2D + arr = np.empty((4, 4), dtype=np.float64) + distinct.add(compute_fingerprint(arr)) + # F-contiguous + distinct.add(compute_fingerprint(arr.T)) + # Non-contiguous + distinct.add(compute_fingerprint(arr[::2])) + + # 0D + arr = np.empty((), dtype=np.float64) + distinct.add(compute_fingerprint(arr)) + + # Structured arrays + arr = np.empty(5, dtype=recordtype) + s = compute_fingerprint(arr) + distinct.add(s) + self.assertEqual(compute_fingerprint(arr[:1]), s) + arr = np.empty(5, dtype=recordtype2) + distinct.add(compute_fingerprint(arr)) + arr = np.empty(5, dtype=recordtype3) + distinct.add(compute_fingerprint(arr)) + + # np.recarray() is peculiar: it creates a new dtype instance in + # its constructor; check that the fingerprint remains efficient + a = np.recarray(1, dtype=recordtype) + b = np.recarray(1, dtype=recordtype) + self.assertEqual(compute_fingerprint(a), + compute_fingerprint(b)) + + def test_buffers(self): + distinct = DistinctChecker() + + s = compute_fingerprint(b'') + self.assertEqual(compute_fingerprint(b'xx'), s) + distinct.add(s) + distinct.add(compute_fingerprint(bytearray())) + distinct.add(compute_fingerprint(memoryview(b''))) + m_uint8_1d = compute_fingerprint(memoryview(bytearray())) + distinct.add(m_uint8_1d) + + arr = array.array('B', [42]) + distinct.add(compute_fingerprint(arr)) + self.assertEqual(compute_fingerprint(memoryview(arr)), m_uint8_1d) + for array_code in 'bi': + arr = array.array(array_code, [0, 1, 2]) + distinct.add(compute_fingerprint(arr)) + distinct.add(compute_fingerprint(memoryview(arr))) + + arr = np.empty(16, dtype=np.uint8) + distinct.add(compute_fingerprint(arr)) + self.assertEqual(compute_fingerprint(memoryview(arr)), m_uint8_1d) + arr = arr.reshape((4, 4)) + distinct.add(compute_fingerprint(arr)) + distinct.add(compute_fingerprint(memoryview(arr))) + arr = arr.T + distinct.add(compute_fingerprint(arr)) + distinct.add(compute_fingerprint(memoryview(arr))) + arr = arr[::2] + distinct.add(compute_fingerprint(arr)) + distinct.add(compute_fingerprint(memoryview(arr))) + + m = mmap.mmap(-1, 16384) + distinct.add(compute_fingerprint(m)) + self.assertEqual(compute_fingerprint(memoryview(m)), m_uint8_1d) + + def test_dtype(self): + distinct = DistinctChecker() + + s = compute_fingerprint(np.dtype('int64')) + self.assertEqual(compute_fingerprint(np.dtype('int64')), s) + distinct.add(s) + + for descr in ('int32', 'm8[s]', 'm8[W]', 'M8[s]'): + distinct.add(np.dtype(descr)) + + distinct.add(recordtype) + distinct.add(recordtype2) + + # np.recarray() is peculiar: it creates a new dtype instance in + # its constructor; check that the fingerprint remains efficient + a = np.recarray(1, dtype=recordtype) + b = np.recarray(1, dtype=recordtype) + self.assertEqual(compute_fingerprint(a.dtype), + compute_fingerprint(b.dtype)) + + def test_tuples(self): + distinct = DistinctChecker() + + s = compute_fingerprint((1,)) + self.assertEqual(compute_fingerprint((2,)), s) + distinct.add(s) + + distinct.add(compute_fingerprint(())) + distinct.add(compute_fingerprint((1, 2, 3))) + distinct.add(compute_fingerprint((1j, 2, 3))) + distinct.add(compute_fingerprint((1, (), np.empty(5)))) + distinct.add(compute_fingerprint((1, (), np.empty((5, 1))))) + + def test_lists(self): + distinct = DistinctChecker() + + s = compute_fingerprint([1]) + self.assertEqual(compute_fingerprint([2, 3]), s) + distinct.add(s) + + distinct.add(compute_fingerprint([1j])) + distinct.add(compute_fingerprint([4.5, 6.7])) + distinct.add(compute_fingerprint([(1,)])) + + with self.assertRaises(ValueError): + compute_fingerprint([]) + + def test_sets(self): + distinct = DistinctChecker() + + s = compute_fingerprint(set([1])) + self.assertEqual(compute_fingerprint(set([2, 3])), s) + distinct.add(s) + + distinct.add(compute_fingerprint([1])) + distinct.add(compute_fingerprint(set([1j]))) + distinct.add(compute_fingerprint(set([4.5, 6.7]))) + distinct.add(compute_fingerprint(set([(1,)]))) + + with self.assertRaises(ValueError): + compute_fingerprint(set()) + with self.assertRaises(NotImplementedError): + compute_fingerprint(frozenset([2, 3])) + + def test_omitted_args(self): + distinct = DistinctChecker() + + v0 = OmittedArg(0.0) + v1 = OmittedArg(1.0) + v2 = OmittedArg(1) + + s = compute_fingerprint(v0) + self.assertEqual(compute_fingerprint(v1), s) + distinct.add(s) + distinct.add(compute_fingerprint(v2)) + distinct.add(compute_fingerprint(0.0)) + distinct.add(compute_fingerprint(1)) + + def test_complicated_type(self): + # Generating a large fingerprint + t = None + for i in range(1000): + t = (t,) + s = compute_fingerprint(t) + + +class TestTypeOfMemCpy(TestCase): + + def test_memcpy_typeof_buffer(self): + # https://github.com/numba/numba/issues/9097 + # bug is fixed if the code below compiles + random.seed(0) + chars = string.ascii_letters + n = 256 + field = "".join([chars[random.randint(0, len(chars) - 1)] for x in range(n)]) + for i in range(1, n): + lfield = field[:i] + nt_ty = namedtuple("tuplename", lfield) + nt = nt_ty(1) + fp = _dispatcher.compute_fingerprint(nt) + nt_name = nt.__class__.__name__ + expected = f"{nt_name}({lfield}i)" + self.assertEqual( + expected, + fp.decode(), + f"iteration {i} failed, {expected} != {fp.decode()}" + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/9d/9d7e4a2f908c9cd157395edbd829795075d6557e9ca885f90dab4ddd18d88438/blob b/shared/package-files/9d/9d7e4a2f908c9cd157395edbd829795075d6557e9ca885f90dab4ddd18d88438/blob new file mode 100644 index 0000000000000000000000000000000000000000..f9f294d25dd5370bda77bbe28781f2e2057fcace --- /dev/null +++ b/shared/package-files/9d/9d7e4a2f908c9cd157395edbd829795075d6557e9ca885f90dab4ddd18d88438/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor & _add_relu_(at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1); +TORCH_API at::Tensor & _add_relu_(at::Tensor & self, const at::Scalar & other, const at::Scalar & alpha=1); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/9d/9d7ecadc5f0b574cc535adc2a070b9741325e5d00ee6e1f5ea502c92a6730113/blob b/shared/package-files/9d/9d7ecadc5f0b574cc535adc2a070b9741325e5d00ee6e1f5ea502c92a6730113/blob new file mode 100644 index 0000000000000000000000000000000000000000..e5dc871bd003937a483a39001d796b1bacc26d01 --- /dev/null +++ b/shared/package-files/9d/9d7ecadc5f0b574cc535adc2a070b9741325e5d00ee6e1f5ea502c92a6730113/blob @@ -0,0 +1,173 @@ +// Numerically stable computation of iv(v+1, x) / iv(v, x) + +#pragma once + +#include "config.h" +#include "tools.h" +#include "error.h" +#include "cephes/dd_real.h" + +namespace xsf { + +/* Generates the "tail" of Perron's continued fraction for iv(v,x)/iv(v-1,x). + * + * The Perron continued fraction is studied in [1]. It is given by + * + * iv(v, x) x -(2v+1)x -(2v+3)x -(2v+5)x + * R := --------- = ------ ---------- ---------- ---------- ... + * iv(v-1,x) x+2v + 2(v+x)+1 + 2(v+x)+2 + 2(v+x)+3 + + * + * Given a suitable constant c, the continued fraction may be rearranged + * into the following form to avoid premature floating point overflow: + * + * xc -(2vc+c)(xc) -(2vc+3c)(xc) -(2vc+5c)(xc) + * R = -----, fc = 2vc + ------------ ------------- ------------- ... + * xc+fc 2(vc+xc)+c + 2(vc+xc)+2c + 2(vc+xc)+3c + + * + * This class generates the fractions of fc after 2vc. + * + * [1] Gautschi, W. and Slavik, J. (1978). "On the computation of modified + * Bessel function ratios." Mathematics of Computation, 32(143):865-875. + */ +template +struct IvRatioCFTailGenerator { + + XSF_HOST_DEVICE IvRatioCFTailGenerator(T vc, T xc, T c) noexcept { + a0_ = -(2*vc-c)*xc; + as_ = -2*c*xc; + b0_ = 2*(vc+xc); + bs_ = c; + k_ = 0; + } + + XSF_HOST_DEVICE std::pair operator()() noexcept { + using std::fma; + ++k_; + return {fma(static_cast(k_), as_, a0_), + fma(static_cast(k_), bs_, b0_)}; + } + +private: + T a0_, as_; // a[k] == a0 + as*k, k >= 1 + T b0_, bs_; // b[k] == b0 + bs*k, k >= 1 + std::uint64_t k_; // current index +}; + +// Computes f(v, x) using Perron's continued fraction. +// +// T specifies the working type. This allows the function to perform +// calculations in a higher precision, such as double-double, even if +// the return type is hardcoded to be double. +template +XSF_HOST_DEVICE inline std::pair +_iv_ratio_cf(double v, double x, bool complement) { + + int e; + std::frexp(std::fmax(v, x), &e); + T c = T(std::ldexp(1, 2-e)); // rescaling multiplier + T vc = v * c; + T xc = x * c; + + IvRatioCFTailGenerator cf(vc, xc, c); + auto [fc, terms] = detail::series_eval_kahan( + detail::continued_fraction_series(cf), + T(std::numeric_limits::epsilon()), + 1000, + 2*vc); + + T ret = (complement ? fc : xc) / (xc + fc); + return {static_cast(ret), terms}; +} + +XSF_HOST_DEVICE inline double iv_ratio(double v, double x) { + + if (std::isnan(v) || std::isnan(x)) { + return std::numeric_limits::quiet_NaN(); + } + if (v < 0.5 || x < 0) { + set_error("iv_ratio", SF_ERROR_DOMAIN, NULL); + return std::numeric_limits::quiet_NaN(); + } + if (std::isinf(v) && std::isinf(x)) { + // There is not a unique limit as both v and x tends to infinity. + set_error("iv_ratio", SF_ERROR_DOMAIN, NULL); + return std::numeric_limits::quiet_NaN(); + } + if (x == 0.0) { + return x; // keep sign of x because iv_ratio is an odd function + } + if (std::isinf(v)) { + return 0.0; + } + if (std::isinf(x)) { + return 1.0; + } + + auto [ret, terms] = _iv_ratio_cf(v, x, false); + if (terms == 0) { // failed to converge; should not happen + set_error("iv_ratio", SF_ERROR_NO_RESULT, NULL); + return std::numeric_limits::quiet_NaN(); + } + return ret; +} + +XSF_HOST_DEVICE inline float iv_ratio(float v, float x) { + return iv_ratio(static_cast(v), static_cast(x)); +} + +XSF_HOST_DEVICE inline double iv_ratio_c(double v, double x) { + + if (std::isnan(v) || std::isnan(x)) { + return std::numeric_limits::quiet_NaN(); + } + if (v < 0.5 || x < 0) { + set_error("iv_ratio_c", SF_ERROR_DOMAIN, NULL); + return std::numeric_limits::quiet_NaN(); + } + if (std::isinf(v) && std::isinf(x)) { + // There is not a unique limit as both v and x tends to infinity. + set_error("iv_ratio_c", SF_ERROR_DOMAIN, NULL); + return std::numeric_limits::quiet_NaN(); + } + if (x == 0.0) { + return 1.0; + } + if (std::isinf(v)) { + return 1.0; + } + if (std::isinf(x)) { + return 0.0; + } + + if (v >= 1) { + // Numerical experiments show that evaluating the Perron c.f. + // in double precision is sufficiently accurate if v >= 1. + auto [ret, terms] = _iv_ratio_cf(v, x, true); + if (terms == 0) { // failed to converge; should not happen + set_error("iv_ratio_c", SF_ERROR_NO_RESULT, NULL); + return std::numeric_limits::quiet_NaN(); + } + return ret; + } else if (v > 0.5) { + // double-double arithmetic is needed for 0.5 < v < 1 to + // achieve relative error on the scale of machine precision. + using cephes::detail::double_double; + auto [ret, terms] = _iv_ratio_cf(v, x, true); + if (terms == 0) { // failed to converge; should not happen + set_error("iv_ratio_c", SF_ERROR_NO_RESULT, NULL); + return std::numeric_limits::quiet_NaN(); + } + return ret; + } else { + // The previous branch (v > 0.5) also works for v == 0.5, but + // the closed-form formula "1 - tanh(x)" is more efficient. + double t = std::exp(-2*x); + return (2 * t) / (1 + t); + } +} + +XSF_HOST_DEVICE inline float iv_ratio_c(float v, float x) { + return iv_ratio_c(static_cast(v), static_cast(x)); +} + +} // namespace xsf diff --git a/shared/package-files/9d/9d83c7f4b2a5a82d2afd114c8ad0f85c4b0ff45d297e733e07526726d2f0002c/blob b/shared/package-files/9d/9d83c7f4b2a5a82d2afd114c8ad0f85c4b0ff45d297e733e07526726d2f0002c/blob new file mode 100644 index 0000000000000000000000000000000000000000..138c56d76a09591533268db35a9bd613f2a034f8 --- /dev/null +++ b/shared/package-files/9d/9d83c7f4b2a5a82d2afd114c8ad0f85c4b0ff45d297e733e07526726d2f0002c/blob @@ -0,0 +1,2091 @@ +# +# Author: Travis Oliphant 2002-2011 with contributions from +# SciPy Developers 2004-2011 +# +from functools import partial + +from scipy import special +from scipy.special import entr, logsumexp, betaln, gammaln as gamln, zeta +from scipy._lib._util import _lazywhere, rng_integers +from scipy.interpolate import interp1d + +from numpy import floor, ceil, log, exp, sqrt, log1p, expm1, tanh, cosh, sinh + +import numpy as np + +from ._distn_infrastructure import (rv_discrete, get_distribution_names, + _vectorize_rvs_over_shapes, + _ShapeInfo, _isintegral, + rv_discrete_frozen) +from ._biasedurn import (_PyFishersNCHypergeometric, + _PyWalleniusNCHypergeometric, + _PyStochasticLib3) +from ._stats_pythran import _poisson_binom + +import scipy.special._ufuncs as scu + + + +class binom_gen(rv_discrete): + r"""A binomial discrete random variable. + + %(before_notes)s + + Notes + ----- + The probability mass function for `binom` is: + + .. math:: + + f(k) = \binom{n}{k} p^k (1-p)^{n-k} + + for :math:`k \in \{0, 1, \dots, n\}`, :math:`0 \leq p \leq 1` + + `binom` takes :math:`n` and :math:`p` as shape parameters, + where :math:`p` is the probability of a single success + and :math:`1-p` is the probability of a single failure. + + This distribution uses routines from the Boost Math C++ library for + the computation of the ``pmf``, ``cdf``, ``sf``, ``ppf`` and ``isf`` + methods. [1]_ + + %(after_notes)s + + References + ---------- + .. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/. + + %(example)s + + See Also + -------- + hypergeom, nbinom, nhypergeom + + """ + def _shape_info(self): + return [_ShapeInfo("n", True, (0, np.inf), (True, False)), + _ShapeInfo("p", False, (0, 1), (True, True))] + + def _rvs(self, n, p, size=None, random_state=None): + return random_state.binomial(n, p, size) + + def _argcheck(self, n, p): + return (n >= 0) & _isintegral(n) & (p >= 0) & (p <= 1) + + def _get_support(self, n, p): + return self.a, n + + def _logpmf(self, x, n, p): + k = floor(x) + combiln = (gamln(n+1) - (gamln(k+1) + gamln(n-k+1))) + return combiln + special.xlogy(k, p) + special.xlog1py(n-k, -p) + + def _pmf(self, x, n, p): + # binom.pmf(k) = choose(n, k) * p**k * (1-p)**(n-k) + return scu._binom_pmf(x, n, p) + + def _cdf(self, x, n, p): + k = floor(x) + return scu._binom_cdf(k, n, p) + + def _sf(self, x, n, p): + k = floor(x) + return scu._binom_sf(k, n, p) + + def _isf(self, x, n, p): + return scu._binom_isf(x, n, p) + + def _ppf(self, q, n, p): + return scu._binom_ppf(q, n, p) + + def _stats(self, n, p, moments='mv'): + mu = n * p + var = mu - n * np.square(p) + g1, g2 = None, None + if 's' in moments: + pq = p - np.square(p) + npq_sqrt = np.sqrt(n * pq) + t1 = np.reciprocal(npq_sqrt) + t2 = (2.0 * p) / npq_sqrt + g1 = t1 - t2 + if 'k' in moments: + pq = p - np.square(p) + npq = n * pq + t1 = np.reciprocal(npq) + t2 = 6.0/n + g2 = t1 - t2 + return mu, var, g1, g2 + + def _entropy(self, n, p): + k = np.r_[0:n + 1] + vals = self._pmf(k, n, p) + return np.sum(entr(vals), axis=0) + + +binom = binom_gen(name='binom') + + +class bernoulli_gen(binom_gen): + r"""A Bernoulli discrete random variable. + + %(before_notes)s + + Notes + ----- + The probability mass function for `bernoulli` is: + + .. math:: + + f(k) = \begin{cases}1-p &\text{if } k = 0\\ + p &\text{if } k = 1\end{cases} + + for :math:`k` in :math:`\{0, 1\}`, :math:`0 \leq p \leq 1` + + `bernoulli` takes :math:`p` as shape parameter, + where :math:`p` is the probability of a single success + and :math:`1-p` is the probability of a single failure. + + %(after_notes)s + + %(example)s + + """ + def _shape_info(self): + return [_ShapeInfo("p", False, (0, 1), (True, True))] + + def _rvs(self, p, size=None, random_state=None): + return binom_gen._rvs(self, 1, p, size=size, random_state=random_state) + + def _argcheck(self, p): + return (p >= 0) & (p <= 1) + + def _get_support(self, p): + # Overrides binom_gen._get_support!x + return self.a, self.b + + def _logpmf(self, x, p): + return binom._logpmf(x, 1, p) + + def _pmf(self, x, p): + # bernoulli.pmf(k) = 1-p if k = 0 + # = p if k = 1 + return binom._pmf(x, 1, p) + + def _cdf(self, x, p): + return binom._cdf(x, 1, p) + + def _sf(self, x, p): + return binom._sf(x, 1, p) + + def _isf(self, x, p): + return binom._isf(x, 1, p) + + def _ppf(self, q, p): + return binom._ppf(q, 1, p) + + def _stats(self, p): + return binom._stats(1, p) + + def _entropy(self, p): + return entr(p) + entr(1-p) + + +bernoulli = bernoulli_gen(b=1, name='bernoulli') + + +class betabinom_gen(rv_discrete): + r"""A beta-binomial discrete random variable. + + %(before_notes)s + + Notes + ----- + The beta-binomial distribution is a binomial distribution with a + probability of success `p` that follows a beta distribution. + + The probability mass function for `betabinom` is: + + .. math:: + + f(k) = \binom{n}{k} \frac{B(k + a, n - k + b)}{B(a, b)} + + for :math:`k \in \{0, 1, \dots, n\}`, :math:`n \geq 0`, :math:`a > 0`, + :math:`b > 0`, where :math:`B(a, b)` is the beta function. + + `betabinom` takes :math:`n`, :math:`a`, and :math:`b` as shape parameters. + + References + ---------- + .. [1] https://en.wikipedia.org/wiki/Beta-binomial_distribution + + %(after_notes)s + + .. versionadded:: 1.4.0 + + See Also + -------- + beta, binom + + %(example)s + + """ + def _shape_info(self): + return [_ShapeInfo("n", True, (0, np.inf), (True, False)), + _ShapeInfo("a", False, (0, np.inf), (False, False)), + _ShapeInfo("b", False, (0, np.inf), (False, False))] + + def _rvs(self, n, a, b, size=None, random_state=None): + p = random_state.beta(a, b, size) + return random_state.binomial(n, p, size) + + def _get_support(self, n, a, b): + return 0, n + + def _argcheck(self, n, a, b): + return (n >= 0) & _isintegral(n) & (a > 0) & (b > 0) + + def _logpmf(self, x, n, a, b): + k = floor(x) + combiln = -log(n + 1) - betaln(n - k + 1, k + 1) + return combiln + betaln(k + a, n - k + b) - betaln(a, b) + + def _pmf(self, x, n, a, b): + return exp(self._logpmf(x, n, a, b)) + + def _stats(self, n, a, b, moments='mv'): + e_p = a / (a + b) + e_q = 1 - e_p + mu = n * e_p + var = n * (a + b + n) * e_p * e_q / (a + b + 1) + g1, g2 = None, None + if 's' in moments: + g1 = 1.0 / sqrt(var) + g1 *= (a + b + 2 * n) * (b - a) + g1 /= (a + b + 2) * (a + b) + if 'k' in moments: + g2 = (a + b).astype(e_p.dtype) + g2 *= (a + b - 1 + 6 * n) + g2 += 3 * a * b * (n - 2) + g2 += 6 * n ** 2 + g2 -= 3 * e_p * b * n * (6 - n) + g2 -= 18 * e_p * e_q * n ** 2 + g2 *= (a + b) ** 2 * (1 + a + b) + g2 /= (n * a * b * (a + b + 2) * (a + b + 3) * (a + b + n)) + g2 -= 3 + return mu, var, g1, g2 + + +betabinom = betabinom_gen(name='betabinom') + + +class nbinom_gen(rv_discrete): + r"""A negative binomial discrete random variable. + + %(before_notes)s + + Notes + ----- + Negative binomial distribution describes a sequence of i.i.d. Bernoulli + trials, repeated until a predefined, non-random number of successes occurs. + + The probability mass function of the number of failures for `nbinom` is: + + .. math:: + + f(k) = \binom{k+n-1}{n-1} p^n (1-p)^k + + for :math:`k \ge 0`, :math:`0 < p \leq 1` + + `nbinom` takes :math:`n` and :math:`p` as shape parameters where :math:`n` + is the number of successes, :math:`p` is the probability of a single + success, and :math:`1-p` is the probability of a single failure. + + Another common parameterization of the negative binomial distribution is + in terms of the mean number of failures :math:`\mu` to achieve :math:`n` + successes. The mean :math:`\mu` is related to the probability of success + as + + .. math:: + + p = \frac{n}{n + \mu} + + The number of successes :math:`n` may also be specified in terms of a + "dispersion", "heterogeneity", or "aggregation" parameter :math:`\alpha`, + which relates the mean :math:`\mu` to the variance :math:`\sigma^2`, + e.g. :math:`\sigma^2 = \mu + \alpha \mu^2`. Regardless of the convention + used for :math:`\alpha`, + + .. math:: + + p &= \frac{\mu}{\sigma^2} \\ + n &= \frac{\mu^2}{\sigma^2 - \mu} + + This distribution uses routines from the Boost Math C++ library for + the computation of the ``pmf``, ``cdf``, ``sf``, ``ppf``, ``isf`` + and ``stats`` methods. [1]_ + + %(after_notes)s + + References + ---------- + .. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/. + + %(example)s + + See Also + -------- + hypergeom, binom, nhypergeom + + """ + def _shape_info(self): + return [_ShapeInfo("n", True, (0, np.inf), (True, False)), + _ShapeInfo("p", False, (0, 1), (True, True))] + + def _rvs(self, n, p, size=None, random_state=None): + return random_state.negative_binomial(n, p, size) + + def _argcheck(self, n, p): + return (n > 0) & (p > 0) & (p <= 1) + + def _pmf(self, x, n, p): + # nbinom.pmf(k) = choose(k+n-1, n-1) * p**n * (1-p)**k + return scu._nbinom_pmf(x, n, p) + + def _logpmf(self, x, n, p): + coeff = gamln(n+x) - gamln(x+1) - gamln(n) + return coeff + n*log(p) + special.xlog1py(x, -p) + + def _cdf(self, x, n, p): + k = floor(x) + return scu._nbinom_cdf(k, n, p) + + def _logcdf(self, x, n, p): + k = floor(x) + k, n, p = np.broadcast_arrays(k, n, p) + cdf = self._cdf(k, n, p) + cond = cdf > 0.5 + def f1(k, n, p): + return np.log1p(-special.betainc(k + 1, n, 1 - p)) + + # do calc in place + logcdf = cdf + with np.errstate(divide='ignore'): + logcdf[cond] = f1(k[cond], n[cond], p[cond]) + logcdf[~cond] = np.log(cdf[~cond]) + return logcdf + + def _sf(self, x, n, p): + k = floor(x) + return scu._nbinom_sf(k, n, p) + + def _isf(self, x, n, p): + with np.errstate(over='ignore'): # see gh-17432 + return scu._nbinom_isf(x, n, p) + + def _ppf(self, q, n, p): + with np.errstate(over='ignore'): # see gh-17432 + return scu._nbinom_ppf(q, n, p) + + def _stats(self, n, p): + return ( + scu._nbinom_mean(n, p), + scu._nbinom_variance(n, p), + scu._nbinom_skewness(n, p), + scu._nbinom_kurtosis_excess(n, p), + ) + + +nbinom = nbinom_gen(name='nbinom') + + +class betanbinom_gen(rv_discrete): + r"""A beta-negative-binomial discrete random variable. + + %(before_notes)s + + Notes + ----- + The beta-negative-binomial distribution is a negative binomial + distribution with a probability of success `p` that follows a + beta distribution. + + The probability mass function for `betanbinom` is: + + .. math:: + + f(k) = \binom{n + k - 1}{k} \frac{B(a + n, b + k)}{B(a, b)} + + for :math:`k \ge 0`, :math:`n \geq 0`, :math:`a > 0`, + :math:`b > 0`, where :math:`B(a, b)` is the beta function. + + `betanbinom` takes :math:`n`, :math:`a`, and :math:`b` as shape parameters. + + References + ---------- + .. [1] https://en.wikipedia.org/wiki/Beta_negative_binomial_distribution + + %(after_notes)s + + .. versionadded:: 1.12.0 + + See Also + -------- + betabinom : Beta binomial distribution + + %(example)s + + """ + def _shape_info(self): + return [_ShapeInfo("n", True, (0, np.inf), (True, False)), + _ShapeInfo("a", False, (0, np.inf), (False, False)), + _ShapeInfo("b", False, (0, np.inf), (False, False))] + + def _rvs(self, n, a, b, size=None, random_state=None): + p = random_state.beta(a, b, size) + return random_state.negative_binomial(n, p, size) + + def _argcheck(self, n, a, b): + return (n >= 0) & _isintegral(n) & (a > 0) & (b > 0) + + def _logpmf(self, x, n, a, b): + k = floor(x) + combiln = -np.log(n + k) - betaln(n, k + 1) + return combiln + betaln(a + n, b + k) - betaln(a, b) + + def _pmf(self, x, n, a, b): + return exp(self._logpmf(x, n, a, b)) + + def _stats(self, n, a, b, moments='mv'): + # reference: Wolfram Alpha input + # BetaNegativeBinomialDistribution[a, b, n] + def mean(n, a, b): + return n * b / (a - 1.) + mu = _lazywhere(a > 1, (n, a, b), f=mean, fillvalue=np.inf) + def var(n, a, b): + return (n * b * (n + a - 1.) * (a + b - 1.) + / ((a - 2.) * (a - 1.)**2.)) + var = _lazywhere(a > 2, (n, a, b), f=var, fillvalue=np.inf) + g1, g2 = None, None + def skew(n, a, b): + return ((2 * n + a - 1.) * (2 * b + a - 1.) + / (a - 3.) / sqrt(n * b * (n + a - 1.) * (b + a - 1.) + / (a - 2.))) + if 's' in moments: + g1 = _lazywhere(a > 3, (n, a, b), f=skew, fillvalue=np.inf) + def kurtosis(n, a, b): + term = (a - 2.) + term_2 = ((a - 1.)**2. * (a**2. + a * (6 * b - 1.) + + 6. * (b - 1.) * b) + + 3. * n**2. * ((a + 5.) * b**2. + (a + 5.) + * (a - 1.) * b + 2. * (a - 1.)**2) + + 3 * (a - 1.) * n + * ((a + 5.) * b**2. + (a + 5.) * (a - 1.) * b + + 2. * (a - 1.)**2.)) + denominator = ((a - 4.) * (a - 3.) * b * n + * (a + b - 1.) * (a + n - 1.)) + # Wolfram Alpha uses Pearson kurtosis, so we subtract 3 to get + # scipy's Fisher kurtosis + return term * term_2 / denominator - 3. + if 'k' in moments: + g2 = _lazywhere(a > 4, (n, a, b), f=kurtosis, fillvalue=np.inf) + return mu, var, g1, g2 + + +betanbinom = betanbinom_gen(name='betanbinom') + + +class geom_gen(rv_discrete): + r"""A geometric discrete random variable. + + %(before_notes)s + + Notes + ----- + The probability mass function for `geom` is: + + .. math:: + + f(k) = (1-p)^{k-1} p + + for :math:`k \ge 1`, :math:`0 < p \leq 1` + + `geom` takes :math:`p` as shape parameter, + where :math:`p` is the probability of a single success + and :math:`1-p` is the probability of a single failure. + + Note that when drawing random samples, the probability of observations that exceed + ``np.iinfo(np.int64).max`` increases rapidly as $p$ decreases below $10^{-17}$. For + $p < 10^{-20}$, almost all observations would exceed the maximum ``int64``; however, + the output dtype is always ``int64``, so these values are clipped to the maximum. + + %(after_notes)s + + See Also + -------- + planck + + %(example)s + + """ + + def _shape_info(self): + return [_ShapeInfo("p", False, (0, 1), (True, True))] + + def _rvs(self, p, size=None, random_state=None): + res = random_state.geometric(p, size=size) + # RandomState.geometric can wrap around to negative values; make behavior + # consistent with Generator.geometric by replacing with maximum integer. + max_int = np.iinfo(res.dtype).max + return np.where(res < 0, max_int, res) + + def _argcheck(self, p): + return (p <= 1) & (p > 0) + + def _pmf(self, k, p): + return np.power(1-p, k-1) * p + + def _logpmf(self, k, p): + return special.xlog1py(k - 1, -p) + log(p) + + def _cdf(self, x, p): + k = floor(x) + return -expm1(log1p(-p)*k) + + def _sf(self, x, p): + return np.exp(self._logsf(x, p)) + + def _logsf(self, x, p): + k = floor(x) + return k*log1p(-p) + + def _ppf(self, q, p): + vals = ceil(log1p(-q) / log1p(-p)) + temp = self._cdf(vals-1, p) + return np.where((temp >= q) & (vals > 0), vals-1, vals) + + def _stats(self, p): + mu = 1.0/p + qr = 1.0-p + var = qr / p / p + g1 = (2.0-p) / sqrt(qr) + g2 = np.polyval([1, -6, 6], p)/(1.0-p) + return mu, var, g1, g2 + + def _entropy(self, p): + return -np.log(p) - np.log1p(-p) * (1.0-p) / p + + +geom = geom_gen(a=1, name='geom', longname="A geometric") + + +class hypergeom_gen(rv_discrete): + r"""A hypergeometric discrete random variable. + + The hypergeometric distribution models drawing objects from a bin. + `M` is the total number of objects, `n` is total number of Type I objects. + The random variate represents the number of Type I objects in `N` drawn + without replacement from the total population. + + %(before_notes)s + + Notes + ----- + The symbols used to denote the shape parameters (`M`, `n`, and `N`) are not + universally accepted. See the Examples for a clarification of the + definitions used here. + + The probability mass function is defined as, + + .. math:: p(k, M, n, N) = \frac{\binom{n}{k} \binom{M - n}{N - k}} + {\binom{M}{N}} + + for :math:`k \in [\max(0, N - M + n), \min(n, N)]`, where the binomial + coefficients are defined as, + + .. math:: \binom{n}{k} \equiv \frac{n!}{k! (n - k)!}. + + This distribution uses routines from the Boost Math C++ library for + the computation of the ``pmf``, ``cdf``, ``sf`` and ``stats`` methods. [1]_ + + %(after_notes)s + + References + ---------- + .. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/. + + Examples + -------- + >>> import numpy as np + >>> from scipy.stats import hypergeom + >>> import matplotlib.pyplot as plt + + Suppose we have a collection of 20 animals, of which 7 are dogs. Then if + we want to know the probability of finding a given number of dogs if we + choose at random 12 of the 20 animals, we can initialize a frozen + distribution and plot the probability mass function: + + >>> [M, n, N] = [20, 7, 12] + >>> rv = hypergeom(M, n, N) + >>> x = np.arange(0, n+1) + >>> pmf_dogs = rv.pmf(x) + + >>> fig = plt.figure() + >>> ax = fig.add_subplot(111) + >>> ax.plot(x, pmf_dogs, 'bo') + >>> ax.vlines(x, 0, pmf_dogs, lw=2) + >>> ax.set_xlabel('# of dogs in our group of chosen animals') + >>> ax.set_ylabel('hypergeom PMF') + >>> plt.show() + + Instead of using a frozen distribution we can also use `hypergeom` + methods directly. To for example obtain the cumulative distribution + function, use: + + >>> prb = hypergeom.cdf(x, M, n, N) + + And to generate random numbers: + + >>> R = hypergeom.rvs(M, n, N, size=10) + + See Also + -------- + nhypergeom, binom, nbinom + + """ + def _shape_info(self): + return [_ShapeInfo("M", True, (0, np.inf), (True, False)), + _ShapeInfo("n", True, (0, np.inf), (True, False)), + _ShapeInfo("N", True, (0, np.inf), (True, False))] + + def _rvs(self, M, n, N, size=None, random_state=None): + return random_state.hypergeometric(n, M-n, N, size=size) + + def _get_support(self, M, n, N): + return np.maximum(N-(M-n), 0), np.minimum(n, N) + + def _argcheck(self, M, n, N): + cond = (M > 0) & (n >= 0) & (N >= 0) + cond &= (n <= M) & (N <= M) + cond &= _isintegral(M) & _isintegral(n) & _isintegral(N) + return cond + + def _logpmf(self, k, M, n, N): + tot, good = M, n + bad = tot - good + result = (betaln(good+1, 1) + betaln(bad+1, 1) + betaln(tot-N+1, N+1) - + betaln(k+1, good-k+1) - betaln(N-k+1, bad-N+k+1) - + betaln(tot+1, 1)) + return result + + def _pmf(self, k, M, n, N): + return scu._hypergeom_pmf(k, n, N, M) + + def _cdf(self, k, M, n, N): + return scu._hypergeom_cdf(k, n, N, M) + + def _stats(self, M, n, N): + M, n, N = 1. * M, 1. * n, 1. * N + m = M - n + + # Boost kurtosis_excess doesn't return the same as the value + # computed here. + g2 = M * (M + 1) - 6. * N * (M - N) - 6. * n * m + g2 *= (M - 1) * M * M + g2 += 6. * n * N * (M - N) * m * (5. * M - 6) + g2 /= n * N * (M - N) * m * (M - 2.) * (M - 3.) + return ( + scu._hypergeom_mean(n, N, M), + scu._hypergeom_variance(n, N, M), + scu._hypergeom_skewness(n, N, M), + g2, + ) + + def _entropy(self, M, n, N): + k = np.r_[N - (M - n):min(n, N) + 1] + vals = self.pmf(k, M, n, N) + return np.sum(entr(vals), axis=0) + + def _sf(self, k, M, n, N): + return scu._hypergeom_sf(k, n, N, M) + + def _logsf(self, k, M, n, N): + res = [] + for quant, tot, good, draw in zip(*np.broadcast_arrays(k, M, n, N)): + if (quant + 0.5) * (tot + 0.5) < (good - 0.5) * (draw - 0.5): + # Less terms to sum if we calculate log(1-cdf) + res.append(log1p(-exp(self.logcdf(quant, tot, good, draw)))) + else: + # Integration over probability mass function using logsumexp + k2 = np.arange(quant + 1, draw + 1) + res.append(logsumexp(self._logpmf(k2, tot, good, draw))) + return np.asarray(res) + + def _logcdf(self, k, M, n, N): + res = [] + for quant, tot, good, draw in zip(*np.broadcast_arrays(k, M, n, N)): + if (quant + 0.5) * (tot + 0.5) > (good - 0.5) * (draw - 0.5): + # Less terms to sum if we calculate log(1-sf) + res.append(log1p(-exp(self.logsf(quant, tot, good, draw)))) + else: + # Integration over probability mass function using logsumexp + k2 = np.arange(0, quant + 1) + res.append(logsumexp(self._logpmf(k2, tot, good, draw))) + return np.asarray(res) + + +hypergeom = hypergeom_gen(name='hypergeom') + + +class nhypergeom_gen(rv_discrete): + r"""A negative hypergeometric discrete random variable. + + Consider a box containing :math:`M` balls:, :math:`n` red and + :math:`M-n` blue. We randomly sample balls from the box, one + at a time and *without* replacement, until we have picked :math:`r` + blue balls. `nhypergeom` is the distribution of the number of + red balls :math:`k` we have picked. + + %(before_notes)s + + Notes + ----- + The symbols used to denote the shape parameters (`M`, `n`, and `r`) are not + universally accepted. See the Examples for a clarification of the + definitions used here. + + The probability mass function is defined as, + + .. math:: f(k; M, n, r) = \frac{{{k+r-1}\choose{k}}{{M-r-k}\choose{n-k}}} + {{M \choose n}} + + for :math:`k \in [0, n]`, :math:`n \in [0, M]`, :math:`r \in [0, M-n]`, + and the binomial coefficient is: + + .. math:: \binom{n}{k} \equiv \frac{n!}{k! (n - k)!}. + + It is equivalent to observing :math:`k` successes in :math:`k+r-1` + samples with :math:`k+r`'th sample being a failure. The former + can be modelled as a hypergeometric distribution. The probability + of the latter is simply the number of failures remaining + :math:`M-n-(r-1)` divided by the size of the remaining population + :math:`M-(k+r-1)`. This relationship can be shown as: + + .. math:: NHG(k;M,n,r) = HG(k;M,n,k+r-1)\frac{(M-n-(r-1))}{(M-(k+r-1))} + + where :math:`NHG` is probability mass function (PMF) of the + negative hypergeometric distribution and :math:`HG` is the + PMF of the hypergeometric distribution. + + %(after_notes)s + + Examples + -------- + >>> import numpy as np + >>> from scipy.stats import nhypergeom + >>> import matplotlib.pyplot as plt + + Suppose we have a collection of 20 animals, of which 7 are dogs. + Then if we want to know the probability of finding a given number + of dogs (successes) in a sample with exactly 12 animals that + aren't dogs (failures), we can initialize a frozen distribution + and plot the probability mass function: + + >>> M, n, r = [20, 7, 12] + >>> rv = nhypergeom(M, n, r) + >>> x = np.arange(0, n+2) + >>> pmf_dogs = rv.pmf(x) + + >>> fig = plt.figure() + >>> ax = fig.add_subplot(111) + >>> ax.plot(x, pmf_dogs, 'bo') + >>> ax.vlines(x, 0, pmf_dogs, lw=2) + >>> ax.set_xlabel('# of dogs in our group with given 12 failures') + >>> ax.set_ylabel('nhypergeom PMF') + >>> plt.show() + + Instead of using a frozen distribution we can also use `nhypergeom` + methods directly. To for example obtain the probability mass + function, use: + + >>> prb = nhypergeom.pmf(x, M, n, r) + + And to generate random numbers: + + >>> R = nhypergeom.rvs(M, n, r, size=10) + + To verify the relationship between `hypergeom` and `nhypergeom`, use: + + >>> from scipy.stats import hypergeom, nhypergeom + >>> M, n, r = 45, 13, 8 + >>> k = 6 + >>> nhypergeom.pmf(k, M, n, r) + 0.06180776620271643 + >>> hypergeom.pmf(k, M, n, k+r-1) * (M - n - (r-1)) / (M - (k+r-1)) + 0.06180776620271644 + + See Also + -------- + hypergeom, binom, nbinom + + References + ---------- + .. [1] Negative Hypergeometric Distribution on Wikipedia + https://en.wikipedia.org/wiki/Negative_hypergeometric_distribution + + .. [2] Negative Hypergeometric Distribution from + http://www.math.wm.edu/~leemis/chart/UDR/PDFs/Negativehypergeometric.pdf + + """ + + def _shape_info(self): + return [_ShapeInfo("M", True, (0, np.inf), (True, False)), + _ShapeInfo("n", True, (0, np.inf), (True, False)), + _ShapeInfo("r", True, (0, np.inf), (True, False))] + + def _get_support(self, M, n, r): + return 0, n + + def _argcheck(self, M, n, r): + cond = (n >= 0) & (n <= M) & (r >= 0) & (r <= M-n) + cond &= _isintegral(M) & _isintegral(n) & _isintegral(r) + return cond + + def _rvs(self, M, n, r, size=None, random_state=None): + + @_vectorize_rvs_over_shapes + def _rvs1(M, n, r, size, random_state): + # invert cdf by calculating all values in support, scalar M, n, r + a, b = self.support(M, n, r) + ks = np.arange(a, b+1) + cdf = self.cdf(ks, M, n, r) + ppf = interp1d(cdf, ks, kind='next', fill_value='extrapolate') + rvs = ppf(random_state.uniform(size=size)).astype(int) + if size is None: + return rvs.item() + return rvs + + return _rvs1(M, n, r, size=size, random_state=random_state) + + def _logpmf(self, k, M, n, r): + cond = ((r == 0) & (k == 0)) + result = _lazywhere(~cond, (k, M, n, r), + lambda k, M, n, r: + (-betaln(k+1, r) + betaln(k+r, 1) - + betaln(n-k+1, M-r-n+1) + betaln(M-r-k+1, 1) + + betaln(n+1, M-n+1) - betaln(M+1, 1)), + fillvalue=0.0) + return result + + def _pmf(self, k, M, n, r): + # same as the following but numerically more precise + # return comb(k+r-1, k) * comb(M-r-k, n-k) / comb(M, n) + return exp(self._logpmf(k, M, n, r)) + + def _stats(self, M, n, r): + # Promote the datatype to at least float + # mu = rn / (M-n+1) + M, n, r = 1.*M, 1.*n, 1.*r + mu = r*n / (M-n+1) + + var = r*(M+1)*n / ((M-n+1)*(M-n+2)) * (1 - r / (M-n+1)) + + # The skew and kurtosis are mathematically + # intractable so return `None`. See [2]_. + g1, g2 = None, None + return mu, var, g1, g2 + + +nhypergeom = nhypergeom_gen(name='nhypergeom') + + +# FIXME: Fails _cdfvec +class logser_gen(rv_discrete): + r"""A Logarithmic (Log-Series, Series) discrete random variable. + + %(before_notes)s + + Notes + ----- + The probability mass function for `logser` is: + + .. math:: + + f(k) = - \frac{p^k}{k \log(1-p)} + + for :math:`k \ge 1`, :math:`0 < p < 1` + + `logser` takes :math:`p` as shape parameter, + where :math:`p` is the probability of a single success + and :math:`1-p` is the probability of a single failure. + + %(after_notes)s + + %(example)s + + """ + + def _shape_info(self): + return [_ShapeInfo("p", False, (0, 1), (True, True))] + + def _rvs(self, p, size=None, random_state=None): + # looks wrong for p>0.5, too few k=1 + # trying to use generic is worse, no k=1 at all + return random_state.logseries(p, size=size) + + def _argcheck(self, p): + return (p > 0) & (p < 1) + + def _pmf(self, k, p): + # logser.pmf(k) = - p**k / (k*log(1-p)) + return -np.power(p, k) * 1.0 / k / special.log1p(-p) + + def _stats(self, p): + r = special.log1p(-p) + mu = p / (p - 1.0) / r + mu2p = -p / r / (p - 1.0)**2 + var = mu2p - mu*mu + mu3p = -p / r * (1.0+p) / (1.0 - p)**3 + mu3 = mu3p - 3*mu*mu2p + 2*mu**3 + g1 = mu3 / np.power(var, 1.5) + + mu4p = -p / r * ( + 1.0 / (p-1)**2 - 6*p / (p - 1)**3 + 6*p*p / (p-1)**4) + mu4 = mu4p - 4*mu3p*mu + 6*mu2p*mu*mu - 3*mu**4 + g2 = mu4 / var**2 - 3.0 + return mu, var, g1, g2 + + +logser = logser_gen(a=1, name='logser', longname='A logarithmic') + + +class poisson_gen(rv_discrete): + r"""A Poisson discrete random variable. + + %(before_notes)s + + Notes + ----- + The probability mass function for `poisson` is: + + .. math:: + + f(k) = \exp(-\mu) \frac{\mu^k}{k!} + + for :math:`k \ge 0`. + + `poisson` takes :math:`\mu \geq 0` as shape parameter. + When :math:`\mu = 0`, the ``pmf`` method + returns ``1.0`` at quantile :math:`k = 0`. + + %(after_notes)s + + %(example)s + + """ + + def _shape_info(self): + return [_ShapeInfo("mu", False, (0, np.inf), (True, False))] + + # Override rv_discrete._argcheck to allow mu=0. + def _argcheck(self, mu): + return mu >= 0 + + def _rvs(self, mu, size=None, random_state=None): + return random_state.poisson(mu, size) + + def _logpmf(self, k, mu): + Pk = special.xlogy(k, mu) - gamln(k + 1) - mu + return Pk + + def _pmf(self, k, mu): + # poisson.pmf(k) = exp(-mu) * mu**k / k! + return exp(self._logpmf(k, mu)) + + def _cdf(self, x, mu): + k = floor(x) + return special.pdtr(k, mu) + + def _sf(self, x, mu): + k = floor(x) + return special.pdtrc(k, mu) + + def _ppf(self, q, mu): + vals = ceil(special.pdtrik(q, mu)) + vals1 = np.maximum(vals - 1, 0) + temp = special.pdtr(vals1, mu) + return np.where(temp >= q, vals1, vals) + + def _stats(self, mu): + var = mu + tmp = np.asarray(mu) + mu_nonzero = tmp > 0 + g1 = _lazywhere(mu_nonzero, (tmp,), lambda x: sqrt(1.0/x), np.inf) + g2 = _lazywhere(mu_nonzero, (tmp,), lambda x: 1.0/x, np.inf) + return mu, var, g1, g2 + + +poisson = poisson_gen(name="poisson", longname='A Poisson') + + +class planck_gen(rv_discrete): + r"""A Planck discrete exponential random variable. + + %(before_notes)s + + Notes + ----- + The probability mass function for `planck` is: + + .. math:: + + f(k) = (1-\exp(-\lambda)) \exp(-\lambda k) + + for :math:`k \ge 0` and :math:`\lambda > 0`. + + `planck` takes :math:`\lambda` as shape parameter. The Planck distribution + can be written as a geometric distribution (`geom`) with + :math:`p = 1 - \exp(-\lambda)` shifted by ``loc = -1``. + + %(after_notes)s + + See Also + -------- + geom + + %(example)s + + """ + def _shape_info(self): + return [_ShapeInfo("lambda", False, (0, np.inf), (False, False))] + + def _argcheck(self, lambda_): + return lambda_ > 0 + + def _pmf(self, k, lambda_): + return -expm1(-lambda_)*exp(-lambda_*k) + + def _cdf(self, x, lambda_): + k = floor(x) + return -expm1(-lambda_*(k+1)) + + def _sf(self, x, lambda_): + return exp(self._logsf(x, lambda_)) + + def _logsf(self, x, lambda_): + k = floor(x) + return -lambda_*(k+1) + + def _ppf(self, q, lambda_): + vals = ceil(-1.0/lambda_ * log1p(-q)-1) + vals1 = (vals-1).clip(*(self._get_support(lambda_))) + temp = self._cdf(vals1, lambda_) + return np.where(temp >= q, vals1, vals) + + def _rvs(self, lambda_, size=None, random_state=None): + # use relation to geometric distribution for sampling + p = -expm1(-lambda_) + return random_state.geometric(p, size=size) - 1.0 + + def _stats(self, lambda_): + mu = 1/expm1(lambda_) + var = exp(-lambda_)/(expm1(-lambda_))**2 + g1 = 2*cosh(lambda_/2.0) + g2 = 4+2*cosh(lambda_) + return mu, var, g1, g2 + + def _entropy(self, lambda_): + C = -expm1(-lambda_) + return lambda_*exp(-lambda_)/C - log(C) + + +planck = planck_gen(a=0, name='planck', longname='A discrete exponential ') + + +class boltzmann_gen(rv_discrete): + r"""A Boltzmann (Truncated Discrete Exponential) random variable. + + %(before_notes)s + + Notes + ----- + The probability mass function for `boltzmann` is: + + .. math:: + + f(k) = (1-\exp(-\lambda)) \exp(-\lambda k) / (1-\exp(-\lambda N)) + + for :math:`k = 0,..., N-1`. + + `boltzmann` takes :math:`\lambda > 0` and :math:`N > 0` as shape parameters. + + %(after_notes)s + + %(example)s + + """ + def _shape_info(self): + return [_ShapeInfo("lambda_", False, (0, np.inf), (False, False)), + _ShapeInfo("N", True, (0, np.inf), (False, False))] + + def _argcheck(self, lambda_, N): + return (lambda_ > 0) & (N > 0) & _isintegral(N) + + def _get_support(self, lambda_, N): + return self.a, N - 1 + + def _pmf(self, k, lambda_, N): + # boltzmann.pmf(k) = + # (1-exp(-lambda_)*exp(-lambda_*k)/(1-exp(-lambda_*N)) + fact = (1-exp(-lambda_))/(1-exp(-lambda_*N)) + return fact*exp(-lambda_*k) + + def _cdf(self, x, lambda_, N): + k = floor(x) + return (1-exp(-lambda_*(k+1)))/(1-exp(-lambda_*N)) + + def _ppf(self, q, lambda_, N): + qnew = q*(1-exp(-lambda_*N)) + vals = ceil(-1.0/lambda_ * log(1-qnew)-1) + vals1 = (vals-1).clip(0.0, np.inf) + temp = self._cdf(vals1, lambda_, N) + return np.where(temp >= q, vals1, vals) + + def _stats(self, lambda_, N): + z = exp(-lambda_) + zN = exp(-lambda_*N) + mu = z/(1.0-z)-N*zN/(1-zN) + var = z/(1.0-z)**2 - N*N*zN/(1-zN)**2 + trm = (1-zN)/(1-z) + trm2 = (z*trm**2 - N*N*zN) + g1 = z*(1+z)*trm**3 - N**3*zN*(1+zN) + g1 = g1 / trm2**(1.5) + g2 = z*(1+4*z+z*z)*trm**4 - N**4 * zN*(1+4*zN+zN*zN) + g2 = g2 / trm2 / trm2 + return mu, var, g1, g2 + + +boltzmann = boltzmann_gen(name='boltzmann', a=0, + longname='A truncated discrete exponential ') + + +class randint_gen(rv_discrete): + r"""A uniform discrete random variable. + + %(before_notes)s + + Notes + ----- + The probability mass function for `randint` is: + + .. math:: + + f(k) = \frac{1}{\texttt{high} - \texttt{low}} + + for :math:`k \in \{\texttt{low}, \dots, \texttt{high} - 1\}`. + + `randint` takes :math:`\texttt{low}` and :math:`\texttt{high}` as shape + parameters. + + %(after_notes)s + + Examples + -------- + >>> import numpy as np + >>> from scipy.stats import randint + >>> import matplotlib.pyplot as plt + >>> fig, ax = plt.subplots(1, 1) + + Calculate the first four moments: + + >>> low, high = 7, 31 + >>> mean, var, skew, kurt = randint.stats(low, high, moments='mvsk') + + Display the probability mass function (``pmf``): + + >>> x = np.arange(low - 5, high + 5) + >>> ax.plot(x, randint.pmf(x, low, high), 'bo', ms=8, label='randint pmf') + >>> ax.vlines(x, 0, randint.pmf(x, low, high), colors='b', lw=5, alpha=0.5) + + Alternatively, the distribution object can be called (as a function) to + fix the shape and location. This returns a "frozen" RV object holding the + given parameters fixed. + + Freeze the distribution and display the frozen ``pmf``: + + >>> rv = randint(low, high) + >>> ax.vlines(x, 0, rv.pmf(x), colors='k', linestyles='-', + ... lw=1, label='frozen pmf') + >>> ax.legend(loc='lower center') + >>> plt.show() + + Check the relationship between the cumulative distribution function + (``cdf``) and its inverse, the percent point function (``ppf``): + + >>> q = np.arange(low, high) + >>> p = randint.cdf(q, low, high) + >>> np.allclose(q, randint.ppf(p, low, high)) + True + + Generate random numbers: + + >>> r = randint.rvs(low, high, size=1000) + + """ + + def _shape_info(self): + return [_ShapeInfo("low", True, (-np.inf, np.inf), (False, False)), + _ShapeInfo("high", True, (-np.inf, np.inf), (False, False))] + + def _argcheck(self, low, high): + return (high > low) & _isintegral(low) & _isintegral(high) + + def _get_support(self, low, high): + return low, high-1 + + def _pmf(self, k, low, high): + # randint.pmf(k) = 1./(high - low) + p = np.ones_like(k) / (np.asarray(high, dtype=np.int64) - low) + return np.where((k >= low) & (k < high), p, 0.) + + def _cdf(self, x, low, high): + k = floor(x) + return (k - low + 1.) / (high - low) + + def _ppf(self, q, low, high): + vals = ceil(q * (high - low) + low) - 1 + vals1 = (vals - 1).clip(low, high) + temp = self._cdf(vals1, low, high) + return np.where(temp >= q, vals1, vals) + + def _stats(self, low, high): + m2, m1 = np.asarray(high), np.asarray(low) + mu = (m2 + m1 - 1.0) / 2 + d = m2 - m1 + var = (d*d - 1) / 12.0 + g1 = 0.0 + g2 = -6.0/5.0 * (d*d + 1.0) / (d*d - 1.0) + return mu, var, g1, g2 + + def _rvs(self, low, high, size=None, random_state=None): + """An array of *size* random integers >= ``low`` and < ``high``.""" + if np.asarray(low).size == 1 and np.asarray(high).size == 1: + # no need to vectorize in that case + return rng_integers(random_state, low, high, size=size) + + if size is not None: + # NumPy's RandomState.randint() doesn't broadcast its arguments. + # Use `broadcast_to()` to extend the shapes of low and high + # up to size. Then we can use the numpy.vectorize'd + # randint without needing to pass it a `size` argument. + low = np.broadcast_to(low, size) + high = np.broadcast_to(high, size) + randint = np.vectorize(partial(rng_integers, random_state), + otypes=[np.dtype(int)]) + return randint(low, high) + + def _entropy(self, low, high): + return log(high - low) + + +randint = randint_gen(name='randint', longname='A discrete uniform ' + '(random integer)') + + +# FIXME: problems sampling. +class zipf_gen(rv_discrete): + r"""A Zipf (Zeta) discrete random variable. + + %(before_notes)s + + See Also + -------- + zipfian + + Notes + ----- + The probability mass function for `zipf` is: + + .. math:: + + f(k, a) = \frac{1}{\zeta(a) k^a} + + for :math:`k \ge 1`, :math:`a > 1`. + + `zipf` takes :math:`a > 1` as shape parameter. :math:`\zeta` is the + Riemann zeta function (`scipy.special.zeta`) + + The Zipf distribution is also known as the zeta distribution, which is + a special case of the Zipfian distribution (`zipfian`). + + %(after_notes)s + + References + ---------- + .. [1] "Zeta Distribution", Wikipedia, + https://en.wikipedia.org/wiki/Zeta_distribution + + %(example)s + + Confirm that `zipf` is the large `n` limit of `zipfian`. + + >>> import numpy as np + >>> from scipy.stats import zipf, zipfian + >>> k = np.arange(11) + >>> np.allclose(zipf.pmf(k, a), zipfian.pmf(k, a, n=10000000)) + True + + """ + + def _shape_info(self): + return [_ShapeInfo("a", False, (1, np.inf), (False, False))] + + def _rvs(self, a, size=None, random_state=None): + return random_state.zipf(a, size=size) + + def _argcheck(self, a): + return a > 1 + + def _pmf(self, k, a): + k = k.astype(np.float64) + # zipf.pmf(k, a) = 1/(zeta(a) * k**a) + Pk = 1.0 / special.zeta(a, 1) * k**-a + return Pk + + def _munp(self, n, a): + return _lazywhere( + a > n + 1, (a, n), + lambda a, n: special.zeta(a - n, 1) / special.zeta(a, 1), + np.inf) + + +zipf = zipf_gen(a=1, name='zipf', longname='A Zipf') + + +def _gen_harmonic_gt1(n, a): + """Generalized harmonic number, a > 1""" + # See https://en.wikipedia.org/wiki/Harmonic_number; search for "hurwitz" + return zeta(a, 1) - zeta(a, n+1) + + +def _gen_harmonic_leq1(n, a): + """Generalized harmonic number, a <= 1""" + if not np.size(n): + return n + n_max = np.max(n) # loop starts at maximum of all n + out = np.zeros_like(a, dtype=float) + # add terms of harmonic series; starting from smallest to avoid roundoff + for i in np.arange(n_max, 0, -1, dtype=float): + mask = i <= n # don't add terms after nth + out[mask] += 1/i**a[mask] + return out + + +def _gen_harmonic(n, a): + """Generalized harmonic number""" + n, a = np.broadcast_arrays(n, a) + return _lazywhere(a > 1, (n, a), + f=_gen_harmonic_gt1, f2=_gen_harmonic_leq1) + + +class zipfian_gen(rv_discrete): + r"""A Zipfian discrete random variable. + + %(before_notes)s + + See Also + -------- + zipf + + Notes + ----- + The probability mass function for `zipfian` is: + + .. math:: + + f(k, a, n) = \frac{1}{H_{n,a} k^a} + + for :math:`k \in \{1, 2, \dots, n-1, n\}`, :math:`a \ge 0`, + :math:`n \in \{1, 2, 3, \dots\}`. + + `zipfian` takes :math:`a` and :math:`n` as shape parameters. + :math:`H_{n,a}` is the :math:`n`:sup:`th` generalized harmonic + number of order :math:`a`. + + The Zipfian distribution reduces to the Zipf (zeta) distribution as + :math:`n \rightarrow \infty`. + + %(after_notes)s + + References + ---------- + .. [1] "Zipf's Law", Wikipedia, https://en.wikipedia.org/wiki/Zipf's_law + .. [2] Larry Leemis, "Zipf Distribution", Univariate Distribution + Relationships. http://www.math.wm.edu/~leemis/chart/UDR/PDFs/Zipf.pdf + + %(example)s + + Confirm that `zipfian` reduces to `zipf` for large `n`, ``a > 1``. + + >>> import numpy as np + >>> from scipy.stats import zipf, zipfian + >>> k = np.arange(11) + >>> np.allclose(zipfian.pmf(k, a=3.5, n=10000000), zipf.pmf(k, a=3.5)) + True + + """ + + def _shape_info(self): + return [_ShapeInfo("a", False, (0, np.inf), (True, False)), + _ShapeInfo("n", True, (0, np.inf), (False, False))] + + def _argcheck(self, a, n): + # we need np.asarray here because moment (maybe others) don't convert + return (a >= 0) & (n > 0) & (n == np.asarray(n, dtype=int)) + + def _get_support(self, a, n): + return 1, n + + def _pmf(self, k, a, n): + k = k.astype(np.float64) + return 1.0 / _gen_harmonic(n, a) * k**-a + + def _cdf(self, k, a, n): + return _gen_harmonic(k, a) / _gen_harmonic(n, a) + + def _sf(self, k, a, n): + k = k + 1 # # to match SciPy convention + # see http://www.math.wm.edu/~leemis/chart/UDR/PDFs/Zipf.pdf + return ((k**a*(_gen_harmonic(n, a) - _gen_harmonic(k, a)) + 1) + / (k**a*_gen_harmonic(n, a))) + + def _stats(self, a, n): + # see # see http://www.math.wm.edu/~leemis/chart/UDR/PDFs/Zipf.pdf + Hna = _gen_harmonic(n, a) + Hna1 = _gen_harmonic(n, a-1) + Hna2 = _gen_harmonic(n, a-2) + Hna3 = _gen_harmonic(n, a-3) + Hna4 = _gen_harmonic(n, a-4) + mu1 = Hna1/Hna + mu2n = (Hna2*Hna - Hna1**2) + mu2d = Hna**2 + mu2 = mu2n / mu2d + g1 = (Hna3/Hna - 3*Hna1*Hna2/Hna**2 + 2*Hna1**3/Hna**3)/mu2**(3/2) + g2 = (Hna**3*Hna4 - 4*Hna**2*Hna1*Hna3 + 6*Hna*Hna1**2*Hna2 + - 3*Hna1**4) / mu2n**2 + g2 -= 3 + return mu1, mu2, g1, g2 + + +zipfian = zipfian_gen(a=1, name='zipfian', longname='A Zipfian') + + +class dlaplace_gen(rv_discrete): + r"""A Laplacian discrete random variable. + + %(before_notes)s + + Notes + ----- + The probability mass function for `dlaplace` is: + + .. math:: + + f(k) = \tanh(a/2) \exp(-a |k|) + + for integers :math:`k` and :math:`a > 0`. + + `dlaplace` takes :math:`a` as shape parameter. + + %(after_notes)s + + %(example)s + + """ + + def _shape_info(self): + return [_ShapeInfo("a", False, (0, np.inf), (False, False))] + + def _pmf(self, k, a): + # dlaplace.pmf(k) = tanh(a/2) * exp(-a*abs(k)) + return tanh(a/2.0) * exp(-a * abs(k)) + + def _cdf(self, x, a): + k = floor(x) + + def f(k, a): + return 1.0 - exp(-a * k) / (exp(a) + 1) + + def f2(k, a): + return exp(a * (k + 1)) / (exp(a) + 1) + + return _lazywhere(k >= 0, (k, a), f=f, f2=f2) + + def _ppf(self, q, a): + const = 1 + exp(a) + vals = ceil(np.where(q < 1.0 / (1 + exp(-a)), + log(q*const) / a - 1, + -log((1-q) * const) / a)) + vals1 = vals - 1 + return np.where(self._cdf(vals1, a) >= q, vals1, vals) + + def _stats(self, a): + ea = exp(a) + mu2 = 2.*ea/(ea-1.)**2 + mu4 = 2.*ea*(ea**2+10.*ea+1.) / (ea-1.)**4 + return 0., mu2, 0., mu4/mu2**2 - 3. + + def _entropy(self, a): + return a / sinh(a) - log(tanh(a/2.0)) + + def _rvs(self, a, size=None, random_state=None): + # The discrete Laplace is equivalent to the two-sided geometric + # distribution with PMF: + # f(k) = (1 - alpha)/(1 + alpha) * alpha^abs(k) + # Reference: + # https://www.sciencedirect.com/science/ + # article/abs/pii/S0378375804003519 + # Furthermore, the two-sided geometric distribution is + # equivalent to the difference between two iid geometric + # distributions. + # Reference (page 179): + # https://pdfs.semanticscholar.org/61b3/ + # b99f466815808fd0d03f5d2791eea8b541a1.pdf + # Thus, we can leverage the following: + # 1) alpha = e^-a + # 2) probability_of_success = 1 - alpha (Bernoulli trial) + probOfSuccess = -np.expm1(-np.asarray(a)) + x = random_state.geometric(probOfSuccess, size=size) + y = random_state.geometric(probOfSuccess, size=size) + return x - y + + +dlaplace = dlaplace_gen(a=-np.inf, + name='dlaplace', longname='A discrete Laplacian') + + +class poisson_binom_gen(rv_discrete): + r"""A Poisson Binomial discrete random variable. + + %(before_notes)s + + See Also + -------- + binom + + Notes + ----- + The probability mass function for `poisson_binom` is: + + .. math:: + + f(k; p_1, p_2, ..., p_n) = \sum_{A \in F_k} \prod_{i \in A} p_i \prod_{j \in A^C} 1 - p_j + + where :math:`k \in \{0, 1, \dots, n-1, n\}`, :math:`F_k` is the set of all + subsets of :math:`k` integers that can be selected :math:`\{0, 1, \dots, n-1, n\}`, + and :math:`A^C` is the complement of a set :math:`A`. + + `poisson_binom` accepts a single array argument ``p`` for shape parameters + :math:`0 ≤ p_i ≤ 1`, where the last axis corresponds with the index :math:`i` and + any others are for batch dimensions. Broadcasting behaves according to the usual + rules except that the last axis of ``p`` is ignored. Instances of this class do + not support serialization/unserialization. + + %(after_notes)s + + References + ---------- + .. [1] "Poisson binomial distribution", Wikipedia, + https://en.wikipedia.org/wiki/Poisson_binomial_distribution + .. [2] Biscarri, William, Sihai Dave Zhao, and Robert J. Brunner. "A simple and + fast method for computing the Poisson binomial distribution function". + Computational Statistics & Data Analysis 122 (2018) 92-100. + :doi:`10.1016/j.csda.2018.01.007` + + %(example)s + + """ # noqa: E501 + def _shape_info(self): + # message = 'Fitting is not implemented for this distribution." + # raise NotImplementedError(message) + return [] + + def _argcheck(self, *args): + p = np.stack(args, axis=0) + conds = (0 <= p) & (p <= 1) + return np.all(conds, axis=0) + + def _rvs(self, *args, size=None, random_state=None): + # convenient to work along the last axis here to avoid interference with `size` + p = np.stack(args, axis=-1) + # Size passed by the user is the *shape of the returned array*, so it won't + # contain the length of the last axis of p. + size = (p.shape if size is None else + (size, 1) if np.isscalar(size) else tuple(size) + (1,)) + size = np.broadcast_shapes(p.shape, size) + return bernoulli._rvs(p, size=size, random_state=random_state).sum(axis=-1) + + def _get_support(self, *args): + return 0, len(args) + + def _pmf(self, k, *args): + k = np.atleast_1d(k).astype(np.int64) + k, *args = np.broadcast_arrays(k, *args) + args = np.asarray(args, dtype=np.float64) + return _poisson_binom(k, args, 'pmf') + + def _cdf(self, k, *args): + k = np.atleast_1d(k).astype(np.int64) + k, *args = np.broadcast_arrays(k, *args) + args = np.asarray(args, dtype=np.float64) + return _poisson_binom(k, args, 'cdf') + + def _stats(self, *args, **kwds): + p = np.stack(args, axis=0) + mean = np.sum(p, axis=0) + var = np.sum(p * (1-p), axis=0) + return (mean, var, None, None) + + def __call__(self, *args, **kwds): + return poisson_binomial_frozen(self, *args, **kwds) + + +poisson_binom = poisson_binom_gen(name='poisson_binom', longname='A Poisson binomial', + shapes='p') + +# The _parse_args methods don't work with vector-valued shape parameters, so we rewrite +# them. Note that `p` is accepted as an array with the index `i` of `p_i` corresponding +# with the last axis; we return it as a tuple (p_1, p_2, ..., p_n) so that it looks +# like `n` scalar (or arrays of scalar-valued) shape parameters to the infrastructure. + +def _parse_args_rvs(self, p, loc=0, size=None): + return tuple(np.moveaxis(p, -1, 0)), loc, 1.0, size + +def _parse_args_stats(self, p, loc=0, moments='mv'): + return tuple(np.moveaxis(p, -1, 0)), loc, 1.0, moments + +def _parse_args(self, p, loc=0): + return tuple(np.moveaxis(p, -1, 0)), loc, 1.0 + +# The infrastructure manually binds these methods to the instance, so +# we can only override them by manually binding them, too. +_pb_obj, _pb_cls = poisson_binom, poisson_binom_gen # shorter names (for PEP8) +poisson_binom._parse_args_rvs = _parse_args_rvs.__get__(_pb_obj, _pb_cls) +poisson_binom._parse_args_stats = _parse_args_stats.__get__(_pb_obj, _pb_cls) +poisson_binom._parse_args = _parse_args.__get__(_pb_obj, _pb_cls) + +class poisson_binomial_frozen(rv_discrete_frozen): + # copied from rv_frozen; we just need to bind the `_parse_args` methods + def __init__(self, dist, *args, **kwds): # verbatim + self.args = args # verbatim + self.kwds = kwds # verbatim + + # create a new instance # verbatim + self.dist = dist.__class__(**dist._updated_ctor_param()) # verbatim + + # Here is the only modification + self.dist._parse_args_rvs = _parse_args_rvs.__get__(_pb_obj, _pb_cls) + self.dist._parse_args_stats = _parse_args_stats.__get__(_pb_obj, _pb_cls) + self.dist._parse_args = _parse_args.__get__(_pb_obj, _pb_cls) + + shapes, _, _ = self.dist._parse_args(*args, **kwds) # verbatim + self.a, self.b = self.dist._get_support(*shapes) # verbatim + + def expect(self, func=None, lb=None, ub=None, conditional=False, **kwds): + a, loc, scale = self.dist._parse_args(*self.args, **self.kwds) + # Here's the modification: we pass all args (including `loc`) into the `args` + # parameter of `expect` so the shape only goes through `_parse_args` once. + return self.dist.expect(func, self.args, loc, lb, ub, conditional, **kwds) + + +class skellam_gen(rv_discrete): + r"""A Skellam discrete random variable. + + %(before_notes)s + + Notes + ----- + Probability distribution of the difference of two correlated or + uncorrelated Poisson random variables. + + Let :math:`k_1` and :math:`k_2` be two Poisson-distributed r.v. with + expected values :math:`\lambda_1` and :math:`\lambda_2`. Then, + :math:`k_1 - k_2` follows a Skellam distribution with parameters + :math:`\mu_1 = \lambda_1 - \rho \sqrt{\lambda_1 \lambda_2}` and + :math:`\mu_2 = \lambda_2 - \rho \sqrt{\lambda_1 \lambda_2}`, where + :math:`\rho` is the correlation coefficient between :math:`k_1` and + :math:`k_2`. If the two Poisson-distributed r.v. are independent then + :math:`\rho = 0`. + + Parameters :math:`\mu_1` and :math:`\mu_2` must be strictly positive. + + For details see: https://en.wikipedia.org/wiki/Skellam_distribution + + `skellam` takes :math:`\mu_1` and :math:`\mu_2` as shape parameters. + + %(after_notes)s + + %(example)s + + """ + def _shape_info(self): + return [_ShapeInfo("mu1", False, (0, np.inf), (False, False)), + _ShapeInfo("mu2", False, (0, np.inf), (False, False))] + + def _rvs(self, mu1, mu2, size=None, random_state=None): + n = size + return (random_state.poisson(mu1, n) - + random_state.poisson(mu2, n)) + + def _pmf(self, x, mu1, mu2): + with np.errstate(over='ignore'): # see gh-17432 + px = np.where(x < 0, + scu._ncx2_pdf(2*mu2, 2*(1-x), 2*mu1)*2, + scu._ncx2_pdf(2*mu1, 2*(1+x), 2*mu2)*2) + # ncx2.pdf() returns nan's for extremely low probabilities + return px + + def _cdf(self, x, mu1, mu2): + x = floor(x) + with np.errstate(over='ignore'): # see gh-17432 + px = np.where(x < 0, + scu._ncx2_cdf(2*mu2, -2*x, 2*mu1), + 1 - scu._ncx2_cdf(2*mu1, 2*(x+1), 2*mu2)) + return px + + def _stats(self, mu1, mu2): + mean = mu1 - mu2 + var = mu1 + mu2 + g1 = mean / sqrt((var)**3) + g2 = 1 / var + return mean, var, g1, g2 + + +skellam = skellam_gen(a=-np.inf, name="skellam", longname='A Skellam') + + +class yulesimon_gen(rv_discrete): + r"""A Yule-Simon discrete random variable. + + %(before_notes)s + + Notes + ----- + + The probability mass function for the `yulesimon` is: + + .. math:: + + f(k) = \alpha B(k, \alpha+1) + + for :math:`k=1,2,3,...`, where :math:`\alpha>0`. + Here :math:`B` refers to the `scipy.special.beta` function. + + The sampling of random variates is based on pg 553, Section 6.3 of [1]_. + Our notation maps to the referenced logic via :math:`\alpha=a-1`. + + For details see the wikipedia entry [2]_. + + References + ---------- + .. [1] Devroye, Luc. "Non-uniform Random Variate Generation", + (1986) Springer, New York. + + .. [2] https://en.wikipedia.org/wiki/Yule-Simon_distribution + + %(after_notes)s + + %(example)s + + """ + def _shape_info(self): + return [_ShapeInfo("alpha", False, (0, np.inf), (False, False))] + + def _rvs(self, alpha, size=None, random_state=None): + E1 = random_state.standard_exponential(size) + E2 = random_state.standard_exponential(size) + ans = ceil(-E1 / log1p(-exp(-E2 / alpha))) + return ans + + def _pmf(self, x, alpha): + return alpha * special.beta(x, alpha + 1) + + def _argcheck(self, alpha): + return (alpha > 0) + + def _logpmf(self, x, alpha): + return log(alpha) + special.betaln(x, alpha + 1) + + def _cdf(self, x, alpha): + return 1 - x * special.beta(x, alpha + 1) + + def _sf(self, x, alpha): + return x * special.beta(x, alpha + 1) + + def _logsf(self, x, alpha): + return log(x) + special.betaln(x, alpha + 1) + + def _stats(self, alpha): + mu = np.where(alpha <= 1, np.inf, alpha / (alpha - 1)) + mu2 = np.where(alpha > 2, + alpha**2 / ((alpha - 2.0) * (alpha - 1)**2), + np.inf) + mu2 = np.where(alpha <= 1, np.nan, mu2) + g1 = np.where(alpha > 3, + sqrt(alpha - 2) * (alpha + 1)**2 / (alpha * (alpha - 3)), + np.inf) + g1 = np.where(alpha <= 2, np.nan, g1) + g2 = np.where(alpha > 4, + alpha + 3 + ((11 * alpha**3 - 49 * alpha - 22) / + (alpha * (alpha - 4) * (alpha - 3))), + np.inf) + g2 = np.where(alpha <= 2, np.nan, g2) + return mu, mu2, g1, g2 + + +yulesimon = yulesimon_gen(name='yulesimon', a=1) + + +class _nchypergeom_gen(rv_discrete): + r"""A noncentral hypergeometric discrete random variable. + + For subclassing by nchypergeom_fisher_gen and nchypergeom_wallenius_gen. + + """ + + rvs_name = None + dist = None + + def _shape_info(self): + return [_ShapeInfo("M", True, (0, np.inf), (True, False)), + _ShapeInfo("n", True, (0, np.inf), (True, False)), + _ShapeInfo("N", True, (0, np.inf), (True, False)), + _ShapeInfo("odds", False, (0, np.inf), (False, False))] + + def _get_support(self, M, n, N, odds): + N, m1, n = M, n, N # follow Wikipedia notation + m2 = N - m1 + x_min = np.maximum(0, n - m2) + x_max = np.minimum(n, m1) + return x_min, x_max + + def _argcheck(self, M, n, N, odds): + M, n = np.asarray(M), np.asarray(n), + N, odds = np.asarray(N), np.asarray(odds) + cond1 = (M.astype(int) == M) & (M >= 0) + cond2 = (n.astype(int) == n) & (n >= 0) + cond3 = (N.astype(int) == N) & (N >= 0) + cond4 = odds > 0 + cond5 = N <= M + cond6 = n <= M + return cond1 & cond2 & cond3 & cond4 & cond5 & cond6 + + def _rvs(self, M, n, N, odds, size=None, random_state=None): + + @_vectorize_rvs_over_shapes + def _rvs1(M, n, N, odds, size, random_state): + length = np.prod(size) + urn = _PyStochasticLib3() + rv_gen = getattr(urn, self.rvs_name) + rvs = rv_gen(N, n, M, odds, length, random_state) + rvs = rvs.reshape(size) + return rvs + + return _rvs1(M, n, N, odds, size=size, random_state=random_state) + + def _pmf(self, x, M, n, N, odds): + + x, M, n, N, odds = np.broadcast_arrays(x, M, n, N, odds) + if x.size == 0: # np.vectorize doesn't work with zero size input + return np.empty_like(x) + + @np.vectorize + def _pmf1(x, M, n, N, odds): + urn = self.dist(N, n, M, odds, 1e-12) + return urn.probability(x) + + return _pmf1(x, M, n, N, odds) + + def _stats(self, M, n, N, odds, moments): + + @np.vectorize + def _moments1(M, n, N, odds): + urn = self.dist(N, n, M, odds, 1e-12) + return urn.moments() + + m, v = (_moments1(M, n, N, odds) if ("m" in moments or "v" in moments) + else (None, None)) + s, k = None, None + return m, v, s, k + + +class nchypergeom_fisher_gen(_nchypergeom_gen): + r"""A Fisher's noncentral hypergeometric discrete random variable. + + Fisher's noncentral hypergeometric distribution models drawing objects of + two types from a bin. `M` is the total number of objects, `n` is the + number of Type I objects, and `odds` is the odds ratio: the odds of + selecting a Type I object rather than a Type II object when there is only + one object of each type. + The random variate represents the number of Type I objects drawn if we + take a handful of objects from the bin at once and find out afterwards + that we took `N` objects. + + %(before_notes)s + + See Also + -------- + nchypergeom_wallenius, hypergeom, nhypergeom + + Notes + ----- + Let mathematical symbols :math:`N`, :math:`n`, and :math:`M` correspond + with parameters `N`, `n`, and `M` (respectively) as defined above. + + The probability mass function is defined as + + .. math:: + + p(x; M, n, N, \omega) = + \frac{\binom{n}{x}\binom{M - n}{N-x}\omega^x}{P_0}, + + for + :math:`x \in [x_l, x_u]`, + :math:`M \in {\mathbb N}`, + :math:`n \in [0, M]`, + :math:`N \in [0, M]`, + :math:`\omega > 0`, + where + :math:`x_l = \max(0, N - (M - n))`, + :math:`x_u = \min(N, n)`, + + .. math:: + + P_0 = \sum_{y=x_l}^{x_u} \binom{n}{y}\binom{M - n}{N-y}\omega^y, + + and the binomial coefficients are defined as + + .. math:: \binom{n}{k} \equiv \frac{n!}{k! (n - k)!}. + + `nchypergeom_fisher` uses the BiasedUrn package by Agner Fog with + permission for it to be distributed under SciPy's license. + + The symbols used to denote the shape parameters (`N`, `n`, and `M`) are not + universally accepted; they are chosen for consistency with `hypergeom`. + + Note that Fisher's noncentral hypergeometric distribution is distinct + from Wallenius' noncentral hypergeometric distribution, which models + drawing a pre-determined `N` objects from a bin one by one. + When the odds ratio is unity, however, both distributions reduce to the + ordinary hypergeometric distribution. + + %(after_notes)s + + References + ---------- + .. [1] Agner Fog, "Biased Urn Theory". + https://cran.r-project.org/web/packages/BiasedUrn/vignettes/UrnTheory.pdf + + .. [2] "Fisher's noncentral hypergeometric distribution", Wikipedia, + https://en.wikipedia.org/wiki/Fisher's_noncentral_hypergeometric_distribution + + %(example)s + + """ + + rvs_name = "rvs_fisher" + dist = _PyFishersNCHypergeometric + + +nchypergeom_fisher = nchypergeom_fisher_gen( + name='nchypergeom_fisher', + longname="A Fisher's noncentral hypergeometric") + + +class nchypergeom_wallenius_gen(_nchypergeom_gen): + r"""A Wallenius' noncentral hypergeometric discrete random variable. + + Wallenius' noncentral hypergeometric distribution models drawing objects of + two types from a bin. `M` is the total number of objects, `n` is the + number of Type I objects, and `odds` is the odds ratio: the odds of + selecting a Type I object rather than a Type II object when there is only + one object of each type. + The random variate represents the number of Type I objects drawn if we + draw a pre-determined `N` objects from a bin one by one. + + %(before_notes)s + + See Also + -------- + nchypergeom_fisher, hypergeom, nhypergeom + + Notes + ----- + Let mathematical symbols :math:`N`, :math:`n`, and :math:`M` correspond + with parameters `N`, `n`, and `M` (respectively) as defined above. + + The probability mass function is defined as + + .. math:: + + p(x; N, n, M) = \binom{n}{x} \binom{M - n}{N-x} + \int_0^1 \left(1-t^{\omega/D}\right)^x\left(1-t^{1/D}\right)^{N-x} dt + + for + :math:`x \in [x_l, x_u]`, + :math:`M \in {\mathbb N}`, + :math:`n \in [0, M]`, + :math:`N \in [0, M]`, + :math:`\omega > 0`, + where + :math:`x_l = \max(0, N - (M - n))`, + :math:`x_u = \min(N, n)`, + + .. math:: + + D = \omega(n - x) + ((M - n)-(N-x)), + + and the binomial coefficients are defined as + + .. math:: \binom{n}{k} \equiv \frac{n!}{k! (n - k)!}. + + `nchypergeom_wallenius` uses the BiasedUrn package by Agner Fog with + permission for it to be distributed under SciPy's license. + + The symbols used to denote the shape parameters (`N`, `n`, and `M`) are not + universally accepted; they are chosen for consistency with `hypergeom`. + + Note that Wallenius' noncentral hypergeometric distribution is distinct + from Fisher's noncentral hypergeometric distribution, which models + take a handful of objects from the bin at once, finding out afterwards + that `N` objects were taken. + When the odds ratio is unity, however, both distributions reduce to the + ordinary hypergeometric distribution. + + %(after_notes)s + + References + ---------- + .. [1] Agner Fog, "Biased Urn Theory". + https://cran.r-project.org/web/packages/BiasedUrn/vignettes/UrnTheory.pdf + + .. [2] "Wallenius' noncentral hypergeometric distribution", Wikipedia, + https://en.wikipedia.org/wiki/Wallenius'_noncentral_hypergeometric_distribution + + %(example)s + + """ + + rvs_name = "rvs_wallenius" + dist = _PyWalleniusNCHypergeometric + + +nchypergeom_wallenius = nchypergeom_wallenius_gen( + name='nchypergeom_wallenius', + longname="A Wallenius' noncentral hypergeometric") + + +# Collect names of classes and objects in this module. +pairs = list(globals().copy().items()) +_distn_names, _distn_gen_names = get_distribution_names(pairs, rv_discrete) + +__all__ = _distn_names + _distn_gen_names diff --git a/shared/package-files/9d/9d842be5f2e8396cde7966cff007909d68a3f6702800c9051be07a82327b77b1/blob b/shared/package-files/9d/9d842be5f2e8396cde7966cff007909d68a3f6702800c9051be07a82327b77b1/blob new file mode 100644 index 0000000000000000000000000000000000000000..61f55a8ecde8df1f3f8fef4533a9fdff6762b45c --- /dev/null +++ b/shared/package-files/9d/9d842be5f2e8396cde7966cff007909d68a3f6702800c9051be07a82327b77b1/blob @@ -0,0 +1,8 @@ +""" +A subpackage hosting Numba IR rewrite passes. +""" + +from .registry import register_rewrite, rewrite_registry, Rewrite +# Register various built-in rewrite passes +from numba.core.rewrites import (static_getitem, static_raise, static_binop, + ir_print) diff --git a/shared/package-files/9d/9d85f6516af448e6a0bfc04f0e174e168a158151a4d7c73d75eee742be28ff9b/blob b/shared/package-files/9d/9d85f6516af448e6a0bfc04f0e174e168a158151a4d7c73d75eee742be28ff9b/blob new file mode 100644 index 0000000000000000000000000000000000000000..4a1a2bce60808a67629bcd53492413017cd1d429 --- /dev/null +++ b/shared/package-files/9d/9d85f6516af448e6a0bfc04f0e174e168a158151a4d7c73d75eee742be28ff9b/blob @@ -0,0 +1,1002 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace at { +class Tensor; +class OptionalTensorRef; +using NameVector = SmallVector; +} // namespace at + +// TensorIterator is a helper class for element-wise operations, such as +// arithmetic, comparisons, and trigonometric functions. It handles +// broadcasting and type conversions of operands. +// +// This is inspired by NumPy's Array Iterator API (NpyIter). +// +// The files Loops.h and Loops.cuh provide functions to build kernels that +// use TensorIterator. +// +// Example: +// +// auto iter = TensorIteratorConfig() +// .add_output(output) +// .add_input(input) +// .build() +// +// [MyKernel.cpp / MyKernel.cu] +// cpu_kernel(iter, [](float a, float b) { +// return a + b; +// }); +// +// gpu_kernel(iter, []GPU_LAMBDA(float a, float b) -> float { +// return a + b; +// }); +// +// Note [Order of Construction] +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// When setting up the tensor iterator configuration, the output Tensors +// have to be added first via +// TensorIteratorConfig::add_owned_output(at::Tensor). After adding all outputs, +// the inputs can be added via +// TensorIteratorConfig::add_owned_input(at::Tensor). +// Adding another output after inputs have been added will rise an exception. +// +// Note [Common Dtype Computation] +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Some operations have a natural notion of a "common dtype" or +// "computation dtype" where all inputs are cast to one dtype, the +// operation is performed, and then the results are cast to all outputs. +// +// TensorIterator infers a common dtype if all inputs have the same dtype, +// and it computes one using type promotion rules on its inputs if +// promote_inputs_to_common_dtype_ is true. Attempting to query +// a common dtype otherwise will throw an exception. +// +// Note that the outputs are not considered when computing a common dtype. + +namespace at { + +namespace internal { +// This parameter is heuristically chosen to determine the minimum number of +// work that warrants parallelism. For example, when summing an array, it is +// deemed inefficient to parallelise over arrays shorter than 32768. Further, +// no parallel algorithm (such as parallel_reduce) should split work into +// smaller than GRAIN_SIZE chunks. +constexpr int64_t GRAIN_SIZE = 32768; + +// Storage for a non-owning Tensor, without needing to include Tensor.h +class TORCH_API OpaqueOptionalTensorRef { + alignas(alignof(TensorBase)) std::array data_{}; + + public: + OpaqueOptionalTensorRef(); + OpaqueOptionalTensorRef(const OpaqueOptionalTensorRef&) = default; + OpaqueOptionalTensorRef& operator=(const OpaqueOptionalTensorRef&) = default; + OpaqueOptionalTensorRef(OpaqueOptionalTensorRef&&) noexcept = default; + OpaqueOptionalTensorRef& operator=(OpaqueOptionalTensorRef&&) noexcept = + default; + ~OpaqueOptionalTensorRef(); + + OptionalTensorRef* get() { + return reinterpret_cast(data_.data()); + } + const OptionalTensorRef* get() const { + return reinterpret_cast(data_.data()); + } + + OptionalTensorRef& operator*() { + return *get(); + } + const OptionalTensorRef& operator*() const { + return *get(); + } + OptionalTensorRef* operator->() { + return get(); + } + const OptionalTensorRef* operator->() const { + return get(); + } + + const Tensor& getTensor() const; +}; +} // namespace internal + +struct TORCH_API OperandInfo { + using StrideVector = SmallVector; + OperandInfo() = default; + C10_ALWAYS_INLINE explicit OperandInfo(c10::MaybeOwned&& t) { + if (t->defined()) { + device = t->device(); + target_dtype = t->scalar_type(); + current_dtype = target_dtype; + } + tensor(std::move(t)); + validate(); + } + + C10_ALWAYS_INLINE OperandInfo(const OperandInfo&) = default; + C10_ALWAYS_INLINE OperandInfo& operator=(const OperandInfo&) = default; + C10_ALWAYS_INLINE OperandInfo(OperandInfo&&) noexcept = default; + C10_ALWAYS_INLINE OperandInfo& operator=(OperandInfo&&) noexcept = default; + C10_ALWAYS_INLINE ~OperandInfo() = default; + + /// The data pointer. This may be different from tensor->data_ptr() if the + /// iterator is split. + void* data = nullptr; + + /// Stride after broadcasting. The stride is in bytes, not number of elements. + StrideVector stride_bytes; + + /// The desired device and type for the operand. For inputs, this specifies + /// that the input should be converted to this type if necessary. For outputs, + /// this specifies which type to allocate. target_dtype and device are + /// initialized with the dtype and device of the tensor but during type + /// promotion target_dtype value can become different from tensor's dtype + /// also, during type promotion target_dtype and device can be set for an + /// undefined tensor so that tensor can be properly constructed later. + c10::optional device = c10::nullopt; + ScalarType target_dtype = ScalarType::Undefined; + // Caches dtype of the tensor, because scalar_type is an expensive operation + // If dtype of the tensor is changed (e.g. as a result of type promotion or in + // allocate_outputs), this + // value should be changed too. + ScalarType current_dtype = ScalarType::Undefined; + + bool is_device_defined() const { + return device.has_value(); + } + bool is_type_defined() const { + return target_dtype != ScalarType::Undefined; + } + TensorOptions options() const { + return TensorOptions(target_dtype).device(device); + } + + bool is_output = false; + + bool will_resize = false; + + bool is_read_write = false; + + bool is_const = false; + + void validate() { + TORCH_CHECK( + !tensor_base_->defined() || tensor_base_->layout() == kStrided, + "unsupported tensor layout: ", + tensor_base_->layout()); + } + + /// The tensor operand. Note that the strides, data pointer, and + /// other attributes may differ due to dimension reordering and + /// coalescing. + const Tensor& tensor() const { + return tensor_storage_.getTensor(); + } + const TensorBase& tensor_base() const { + return *tensor_base_; + } + void tensor(c10::MaybeOwned&& tensor); + + // Save the original tensor operand in cases when an output is modified + // (e.g. if dtype is changed) + const Tensor& original_tensor() const { + return original_tensor_storage_.getTensor(); + } + const TensorBase& original_tensor_base() const { + return *original_tensor_base_; + } + + // Set tensor to a new value, and store the old tensor value in + // original_tensor Should only ever be called once for the lifetime of an + // operand + void exchange_tensor(c10::MaybeOwned&& new_tensor); + + // Move original_tensor back into tensor, exchange_tensor must have been + // called before + void restore_original_tensor(); + + private: + c10::MaybeOwned tensor_base_; + c10::MaybeOwned original_tensor_base_ = + c10::MaybeOwned::owned(std::in_place); + + // We store TensorBase visibly in the header to allow inline access. + // However, we sometimes need a genuine `const Tensor &` for the + // TensorIterator API. So, we also store a non-owning `Tensor` + // object in these `_storage_` variables. + internal::OpaqueOptionalTensorRef tensor_storage_; + internal::OpaqueOptionalTensorRef original_tensor_storage_; +}; + +struct SplitUntil32Bit; + +enum class FastSetupType : uint8_t { + NONE, + CONTIGUOUS, + CHANNELS_LAST, + NON_OVERLAPPING_DENSE +}; + +class TensorIteratorConfig; +struct TensorIterator; + +struct TORCH_API TensorIteratorBase : public impl::MetaBase { + using DimMask = std::bitset<64>; + using PtrVector = SmallVector; + using StrideVector = SmallVector; + + TensorIteratorBase(); + void build(TensorIteratorConfig&); + + // The inner-loop function operates on the fastest moving dimension. It + // implements element-wise operations in terms of 1-d strided tensors. + // + // Arguments: + // data: data pointers for each operand (length `ntensors`) + // strides: stride for each operand (length `ntensors`) + // size: size of inner loop + // + // The `size` often matches shape[0], but may be smaller due to + // parallelization of the inner loop. + using loop2d_t = c10::function_ref< + void(char** data, const int64_t* strides, int64_t size0, int64_t size1)>; + + using loop_subiter_t = c10::function_ref; + + void foreach_reduced_elt(loop_subiter_t loop, bool parallelize = true); + + int ndim() const { + return static_cast(shape_.size()); + } + IntArrayRef shape() const { + return shape_; + } + int64_t numel() const; + int ntensors() const { + return static_cast(operands_.size()); + } + int noutputs() const { + return num_outputs_; + } + int ninputs() const { + return ntensors() - noutputs(); + } + IntArrayRef view_offsets() const { + return view_offsets_; + } + + /// number of elements in the output operand. this is the same as numel() for + /// operations that are not reductions. + int64_t num_output_elements() const; + + /// number of reduced dimensions in a reduction operation + int num_reduce_dims() const; + + /// 1-dimensional iteration and no buffering or type conversion + bool is_trivial_1d() const; + /// Reducible to 1-dimensional and all operands are contiguous + bool is_contiguous() const; + bool is_dim_reduced(int dim) const; + + /// Accessors for each operand + IntArrayRef strides(int64_t arg) const { + return operands_[arg].stride_bytes; + } + void* data_ptr(int64_t arg) const; + ScalarType dtype(int64_t arg = 0) const { + return operands_[arg].current_dtype; + } + ScalarType common_dtype() const { + TORCH_INTERNAL_ASSERT( + common_dtype_ != ScalarType::Undefined, + "Queried for invalid common dtype!"); + return common_dtype_; + } + ScalarType input_dtype(int64_t arg = 0) const { + return operands_[num_outputs_ + arg].current_dtype; + } + Device device(int64_t arg = 0) const { + return operands_[arg].device.value(); + } + c10::DeviceType device_type(int64_t arg = 0) const { + return device(arg).type(); + } + int64_t element_size(int64_t arg) const { + return static_cast(elementSize(dtype(arg))); + } + bool is_scalar(int64_t arg) const; + bool is_cpu_scalar(int64_t arg) const; + + const TensorBase& tensor_base(int64_t arg) const { + return operands_[arg].tensor_base(); + } + const Tensor& tensor(int64_t arg) const { + return operands_[arg].tensor(); + } + + const TensorBase& output_base(int64_t arg = 0) const { + AT_ASSERT(arg < num_outputs_); + return tensor_base(arg); + } + + const Tensor& output(int64_t arg = 0) const { + AT_ASSERT(arg < num_outputs_); + return tensor(arg); + } + + const TensorBase& input_base(int64_t arg = 0) const { + AT_ASSERT(arg >= 0 && arg < ntensors() - num_outputs_); + return tensor_base(num_outputs_ + arg); + } + const Tensor& input(int64_t arg = 0) const { + AT_ASSERT(arg >= 0 && arg < ntensors() - num_outputs_); + return tensor(num_outputs_ + arg); + } + + // Copies from temporary outputs back to the original outputs + // NOTE: only used on CPU + void cast_outputs(); + + /// Removes an operand from this iterator + void remove_operand(int64_t arg); + /// Shrinks an iterated dimension + void narrow(int dim, int64_t start, int64_t size); + /// Narrows every dim after and including `start_dim` to size one. + void select_all_keeping_dim(int start_dim, IntArrayRef starts); + /// Replaces the data pointer for the operand at index `arg`. + /// The new pointer should have the same sizes, strides and dtype as the + /// original + void unsafe_replace_operand(int64_t arg, void* data); + + /// Splits this TensorIterator into two iterators. Together they iterate over + /// the entire operation. Used by `with_32bit_indexing()`. + std::unique_ptr split(int dim); + + /// Returns the dimension with the largest extent: (size[dim]-1) * stride[dim] + int get_dim_to_split() const; + + template + T scalar_value(int64_t arg) { + auto& op = operands_[arg]; + return c10::fetch_and_cast(op.tensor_base().scalar_type(), op.data); + } + + /// Return scalar value from original_tensor_base if it is defined. When + /// common_dtype is Half, casting scalar input to common_dtype might overflow. + /// If the scalar is aleady given in the type of Half, then return scalar + /// value from tensor_base. + template + T original_scalar_value(int64_t arg) { + auto& original_tensor_base = operands_[arg].original_tensor_base(); + if (original_tensor_base.defined()) { + TORCH_INTERNAL_ASSERT( + original_tensor_base.scalar_type() != common_dtype()); + return c10::fetch_and_cast( + original_tensor_base.scalar_type(), + original_tensor_base.const_data_ptr()); + } else { + return scalar_value(arg); + } + } + + private: + template + auto loop_2d_from_1d(const loop1d_t& loop) { + return + [loop, ntensor = ntensors()]( + char** base, const int64_t* strides, int64_t size0, int64_t size1) { + PtrVector data(base, base + ntensor); + const int64_t* outer_strides = &strides[ntensor]; + for (const auto i : c10::irange(size1)) { + if (i > 0) { + for (const auto arg : c10::irange(ntensor)) { + data[arg] += outer_strides[arg]; + } + } + loop(data.data(), strides, size0); + } + }; + } + + public: + template < + typename loop1d_t, + std::enable_if_t< + std::is_convertible_v< + loop1d_t, + c10::function_ref< + void(char**, const int64_t* strides, int64_t size)>>, + int> = 0> + void for_each(loop1d_t loop, int64_t grain_size = at::internal::GRAIN_SIZE) { + for_each(loop_2d_from_1d(loop), grain_size); + } + + void for_each(loop2d_t loop, int64_t grain_size = at::internal::GRAIN_SIZE); + + void parallel_reduce(loop2d_t loop); + + template < + typename loop1d_t, + std::enable_if_t< + std::is_convertible_v< + loop1d_t, + c10::function_ref< + void(char**, const int64_t* strides, int64_t size)>>, + int> = 0> + void serial_for_each(loop1d_t loop, Range range) { + serial_for_each(loop_2d_from_1d(loop), range); + } + + void serial_for_each(loop2d_t loop, Range range) const; + + /// Create a strides array for a Tensor with shape of this iterator. The + /// parameter `element_size` specifies the size of Tensor's data type in + /// bytes (e.g. `4` for `float`) + StrideVector compatible_stride(int64_t element_size) const; + + /// Inverts the re-ordering done by reorder_dimensions. This can only be + /// called *before* coalesce_dimensions() is called. + DimVector invert_perm(IntArrayRef input) const; + + /// Reapply same re-ordering as it is done by reorder_dimensions. This can + /// only be called *before* coalesce_dimensions() is called. + DimVector apply_perm_and_mul(IntArrayRef input, int mul) const; + + /// Helper functions for CPU iteration + StrideVector get_dim_strides(int dim) const; + StrideVector get_strides() const; + StrideVector get_inner_strides() const { + return get_dim_strides(0); + } + PtrVector get_base_ptrs() const; + + // Helper functions for advanced stride manipulations (e.g. torch.flip) + void _unsafe_set_arg_strides(const int64_t arg, IntArrayRef strides) { + operands_[arg].stride_bytes = strides; + } + void _unsafe_set_arg_data(const int64_t arg, void* data) { + operands_[arg].data = data; + } + + /// true if the stride computation can use 32-bit arithmetic. Used by GPU + /// kernels + bool can_use_32bit_indexing() const; + + /// An "iteratable" object that recursively splits this iterator into + /// sub-iterators that can use 32-bit indexing. + SplitUntil32Bit with_32bit_indexing() const; + + /// If the kernel should accumulate into the output. Only relevant for CUDA + /// reductions. + bool should_accumulate() const { + return accumulate_; + } + + /// Whether this iterator produces the actual output, + /// as opposed to something that will be accumulated further. Only relevant + /// for CUDA reductions. + bool is_final_output() const { + return final_output_; + } + + bool has_contiguous_first_dim() const { + if (ndim() == 0) { + return true; + } + + int num_tensors = ntensors(); + for (const auto i : c10::irange(num_tensors)) { + if (strides(i)[0] != element_size(i)) { + return false; + } + } + return true; + } + + void set_output_raw_strided( + int64_t output_idx, + IntArrayRef sizes, + IntArrayRef strides, + TensorOptions options, + DimnameList names) override; + +#define TORCH_DISALLOW_TEMPORARIES_IMPL(methodname, maybestatic) \ + maybestatic void methodname( \ + TensorBase&& out, const TensorBase& a, const TensorBase& b) = delete; \ + maybestatic void methodname( \ + const TensorBase& out, TensorBase&& a, const TensorBase& b) = delete; \ + maybestatic void methodname( \ + const TensorBase& out, const TensorBase& a, TensorBase&& b) = delete; \ + maybestatic void methodname( \ + TensorBase&& out, TensorBase&& a, const TensorBase& b) = delete; \ + maybestatic void methodname( \ + TensorBase&& out, const TensorBase& a, TensorBase&& b) = delete; \ + maybestatic void methodname( \ + const TensorBase& out, TensorBase&& a, TensorBase&& b) = delete; \ + maybestatic void methodname( \ + TensorBase&& out, TensorBase&& a, TensorBase&& b) = delete; + +#define TORCH_DISALLOW_TEMPORARIES(methodname) \ + TORCH_DISALLOW_TEMPORARIES_IMPL(methodname, ) + + void build_binary_float_op( + const TensorBase& out, + const TensorBase& a, + const TensorBase& b); + void build_borrowing_binary_float_op( + const TensorBase& out, + const TensorBase& a, + const TensorBase& b); + TORCH_DISALLOW_TEMPORARIES(build_borrowing_binary_float_op) + void build_binary_op( + const TensorBase& out, + const TensorBase& a, + const TensorBase& b); + void build_borrowing_binary_op( + const TensorBase& out, + const TensorBase& a, + const TensorBase& b); + TORCH_DISALLOW_TEMPORARIES(build_borrowing_binary_op) + void build_unary_float_op(const TensorBase& out, const TensorBase& a); + void build_borrowing_unary_float_op( + const TensorBase& out, + const TensorBase& a); + TORCH_DISALLOW_TEMPORARIES(build_borrowing_unary_float_op) + void build_unary_op(const TensorBase& out, const TensorBase& a); + // Odd special case needed for pow. Has to borrow the output because + // it's a structured kernel, but the argument is potentially a copy. + void build_output_borrowing_argument_owning_unary_op( + const TensorBase& out, + const TensorBase& a); + void build_borrowing_unary_op(const TensorBase& out, const TensorBase& a); + TORCH_DISALLOW_TEMPORARIES(build_borrowing_unary_op) + void build_borrowing_unary_force_boolean_op( + const TensorBase& out, + const TensorBase& a); + TORCH_DISALLOW_TEMPORARIES(build_borrowing_unary_force_boolean_op) + void build_comparison_op( + const TensorBase& out, + const TensorBase& a, + const TensorBase& b); + void build_borrowing_comparison_op( + const TensorBase& out, + const TensorBase& a, + const TensorBase& b); + TORCH_DISALLOW_TEMPORARIES(build_borrowing_comparison_op) + // Another special case: we need to own the second argument for comparison + // ops. + void build_borrowing_except_last_argument_comparison_op( + const TensorBase& out, + const TensorBase& a, + const TensorBase& b); + void build_ternary_op( + const TensorBase& out, + const TensorBase& a, + const TensorBase& b, + const TensorBase& c); + +#undef TORCH_DISALLOW_TEMPORARIES + protected: + // Mutable reference as it moves tensors out of TensorIteratorConfig + void populate_operands(TensorIteratorConfig&); + void mark_outputs(); + void mark_resize_outputs(const TensorIteratorConfig&); + void compute_mem_overlaps(const TensorIteratorConfig&); + void compute_shape(const TensorIteratorConfig&); + void compute_strides(const TensorIteratorConfig&); + void reorder_dimensions(); + void permute_dimensions(IntArrayRef perm); + void compute_types(const TensorIteratorConfig&); + ScalarType compute_common_dtype(); + void allocate_or_resize_outputs(); + bool fast_set_up(const TensorIteratorConfig&); + FastSetupType compute_fast_setup_type(const TensorIteratorConfig&); + void compute_names(const TensorIteratorConfig&); + void propagate_names_to_outputs(); + void coalesce_dimensions(); + + protected: + /// Records the "computation" shape of the output tensor. The computation + /// shape is different from the regular shape in a few ways: + /// + /// - The shape may be permuted (via permute_dimensions) so that we + /// process the dimensions in the most computationally efficient order + /// (rather than the logical order given to us by the users.) + /// - The shape may have adjacent dimensions collapsed (via + /// coalesce_dimensions) so that we minimize the number of + /// dimensions we have to explicitly iterate over. For example, + /// a pointwise operation on a contiguous tensor "computationally" + /// consists of only a single dimension. + /// + /// In other words, the computation shape is the output shape as it + /// actually matters for implementing the kernel, but not necessarily the + /// output shape that the user will see in the end. + /// + /// The lifecycle of mutations to shape_ in TensorIterator: + /// - declare_static_shape() sets an initial shape explicitly + /// provided by user, otherwise + /// - compute_shape() computes the true (non-computational) shape + /// specified by the user. + /// - reorder_dimensions() reorders dimensions to improve coalescing. + /// - coalesce_dimensions() then coalesces adjacent dimensions when + /// possible. + /// + /// The shape may also be further modified if we create sub-TensorIterators, + /// e.g., via narrow or select_all_keeping_dim. + DimVector shape_; + + /// Temporarily records the permutation computed by reorder_dimensions. + /// This permutation maps the computation output dimension (dim) to + /// the original true output dimension (perm_[dim]). It is used by + /// invert_perm to undo the permutation. After coalesce_dimensions is + /// called, the permutation is no longer valid (as, in general, there + /// is no permutation that will make computation dimensions to + /// output dimensions); methods that manipulate perm_ are obligated + /// to test that !has_coalesced_dimensions + DimVector perm_; + + /// Has coalesce_dimensions() (or any moral equivalent, e.g., fast_build()) + /// been called? This is SOLELY used to check validity of perm_. + bool has_coalesced_dimensions_ = false; + + /// Whether iteration must be fixed. This disables dimension permuting and + /// also changes how for_each divides work among threads. + bool enforce_linear_iteration_ = false; + + /// The index offsets into the original tensors for each dimension. + /// This is only non-zero when you narrow() a TensorIterator (e.g., + /// when you make sub-TensorIterators). + DimVector view_offsets_; + + /// The computed names of the output tensor. Computed by compute_names() + NameVector names_; + + /// The operands of the TensorIterator: both the inputs and outputs. The + /// outputs MUST come first in the operands_ list. There is always an + /// operand for each output of the TensorIterator, even if TensorIterator + /// will ultimately be responsible for allocating the output; in those + /// cases, tensor is simply undefined (and will be populated later + /// during build()). + /// + /// This list is initially populated prior to build(), but build() mutates + /// OperandInfo to populate more information. + SmallVector operands_; + + /// Number of outputs in operands_ (the length of the outputs prefix + /// in operands_). + int num_outputs_ = 0; + + /// Whether or not all operands have the same shape and are 1d+. Having all + /// the same shape affects whether or not the iterator is eligible for fast + /// setup. + bool all_ops_same_shape_ = false; + /// Whether or not all operands are 0d, this affects type promotion + bool all_ops_are_scalars_ = false; + + /// The "computation" dtype of TensorIterator, specifying what the dtype + /// we will do the internal computation in TensorIterator. Typically, + /// this matches the dtype of the output tensors, but not always! + ScalarType common_dtype_ = ScalarType::Undefined; + + /// This is currently defined as kCPU, or the device of the first non-CPU + /// tensor argument. See TensorIteratorBase::compute_types for details. + Device common_device_ = kCPU; + + /// Set by split(), see should_accumulate() and is_final_output() + bool accumulate_ = false; + bool final_output_ = true; + + // From TensorIteratorConfig + bool is_reduction_ = false; + + /// Set by populate_operands(), says if we're handling meta tensors + bool is_meta_ = false; +}; + +struct TORCH_API TensorIterator final : public TensorIteratorBase { + TensorIterator() : TensorIteratorBase() {} + // Slicing is OK, TensorIterator guaranteed NOT to have any fields + TensorIterator(const TensorIteratorBase& iter) : TensorIteratorBase(iter) {} + +#define TORCH_DISALLOW_TEMPORARIES(methodname) \ + TORCH_DISALLOW_TEMPORARIES_IMPL(methodname, static) + + static TensorIterator binary_float_op( + TensorBase& out, + const TensorBase& a, + const TensorBase& b); + static TensorIterator binary_op( + TensorBase& out, + const TensorBase& a, + const TensorBase& b); + static TensorIterator borrowing_binary_op( + const TensorBase& out, + const TensorBase& a, + const TensorBase& b); + TORCH_DISALLOW_TEMPORARIES(borrowing_binary_op) + static TensorIterator comparison_op( + TensorBase& out, + const TensorBase& a, + const TensorBase& b); + static TensorIterator unary_op(TensorBase& out, const TensorBase& a); + static TensorIterator unary_float_op(TensorBase& out, const TensorBase& a); + static TensorIterator nullary_op(TensorBase& out); + static TensorIterator borrowing_nullary_op(const TensorBase& out); + static TensorIterator borrowing_nullary_op(TensorBase&& out) = delete; + static TensorIterator reduce_op(TensorBase& out, const TensorBase& a); + static TensorIterator reduce_op( + TensorBase& out1, + TensorBase& out2, + const TensorBase& a); +#undef TORCH_DISALLOW_TEMPORARIES +#undef TORCH_DISALLOW_TEMPORARIES_IMPL + + const Tensor& maybe_get_output(int64_t output_idx) override; + void set_output_raw_strided( + int64_t output_idx, + IntArrayRef sizes, + IntArrayRef strides, + TensorOptions options, + DimnameList names) override; +}; + +class TORCH_API TensorIteratorConfig final { + public: + friend struct TensorIteratorBase; + friend struct TensorIterator; + + TensorIteratorConfig() = default; + + C10_DISABLE_COPY_AND_ASSIGN(TensorIteratorConfig); + + /// Construction + // Stores input/output Tensors without incrementing the reference count. + // Important: the outputs have to be added before the inputs. + TensorIteratorConfig& add_output(const TensorBase& output) { + return add_borrowed_output(output); + } + TensorIteratorConfig& add_input(const TensorBase& input) { + return add_borrowed_input(input); + } + TensorIteratorConfig& add_const_input(const TensorBase& input) { + return add_borrowed_const_input(input); + } + + // Borrowing from temporaries is unlikely to go well. + TensorIteratorConfig& add_output(TensorBase&& output) = delete; + TensorIteratorConfig& add_input(TensorBase&& input) = delete; + TensorIteratorConfig& add_const_input(TensorBase&& input) = delete; + + // Stores input/output Tensors while incrementing the reference count. + // Note that add_{in,out}put are nearly always what you + // want, and the exception (adding an unnamed temporary) won't + // compile. + TensorIteratorConfig& add_owned_output(const TensorBase& output); + TensorIteratorConfig& add_owned_input(const TensorBase& input); + TensorIteratorConfig& add_owned_const_input(const TensorBase& input); + + // Advanced API: stores input/output Tensors without incrementing + // the reference count. The caller must ensure that these Tensors + // live at least as long as this TensorIteratorConfig and any + // TensorIteratorBase built from this TensorIteratorConfig. + // Important: the outputs have to be added before the inputs. + TensorIteratorConfig& add_borrowed_output(const TensorBase& output); + TensorIteratorConfig& add_borrowed_input(const TensorBase& input); + TensorIteratorConfig& add_borrowed_const_input(const TensorBase& input); + + // Borrowing from temporaries is unlikely to go well. + TensorIteratorConfig& add_borrowed_output(TensorBase&& output) = delete; + TensorIteratorConfig& add_borrowed_input(TensorBase&& input) = delete; + TensorIteratorConfig& add_borrowed_const_input(TensorBase&& input) = delete; + + // Sets the check_mem_overlap_ flag, which is true by default. + // If true, inputs are checked for partial overlap with the outputs and + // outputs are checked for internal overlap (e.g. broadcasted views). An error + // is raised if unacceptable overlap is detected. + // If you're migrating an existing operator to using TensorIterator, please + // consider if the previous implementation checked memory overlap. If it did + // not, and if the operator is idempotent (for example, Tensor.fill_(0)), then + // checking memory overlap is BC-breaking. Please don't check memory overlap + // in that case. + TensorIteratorConfig& set_check_mem_overlap(bool check_mem_overlap) { + check_mem_overlap_ = check_mem_overlap; + return *this; + } + + // Sets the check_all_same_dtype_ flag, which is true by default + // If true, checks that all inputs and defined outputs have the same dtype + // Setting either of promote_inputs_to_common_dtype_ + // or cast_common_dtype_to_outputs_ to true will set + // check_all_same_dtype_ to false. + TensorIteratorConfig& check_all_same_dtype(const bool _check_all_same_dtype) { + check_all_same_dtype_ = _check_all_same_dtype; + return *this; + } + + // Sets the check_all_same_device_ flag, which is true by default + // If true, all operands must be on the same device, with the possible + // exception of CPU scalars, which can be passed to some CUDA kernels + // as kernel arguments. + TensorIteratorConfig& check_all_same_device( + const bool _check_all_same_device) { + check_all_same_device_ = _check_all_same_device; + return *this; + } + + // Sets the enforce_safe_casting_to_output_ flag, which is false by default + // If true, the iterator's "common dtype" must be computable + // (see the [Common Dtype Computation] note) and + // canCast(common dtype, output dtype) must be true for all outputs. + TensorIteratorConfig& enforce_safe_casting_to_output( + const bool _enforce_safe_casting_to_output) { + enforce_safe_casting_to_output_ = _enforce_safe_casting_to_output; + return *this; + } + + // Sets the enforce_linear_iteration_ flag, which is false by default. + // If true, iteration goes in the same order as a C-contiguous tensor + // is layed out in memory. i.e. last dimension iterates fastest. + // + // This iteration order can be less efficient and may even prevent + // vectorization. So only use if the correctness of your kernel depends on it. + TensorIteratorConfig& enforce_linear_iteration( + const bool _enforce_linear_iteration = true) { + enforce_linear_iteration_ = _enforce_linear_iteration; + return *this; + } + + // Sets the promote_inputs_to_common_dtype_ flag, which is false by default + // If true, the iterator's "common dtype" is always computed (see the + // [Common Dtype Computation] note) and, on the CPU, temporary copies of + // the inputs in the common dtype are passed as the actual inputs to + // the operation. + // Setting this flag to true sets check_all_same_dtype_ to false. + TensorIteratorConfig& promote_inputs_to_common_dtype( + const bool _promote_inputs_to_common_dtype) { + promote_inputs_to_common_dtype_ = _promote_inputs_to_common_dtype; + if (_promote_inputs_to_common_dtype) { + check_all_same_dtype_ = false; + } + return *this; + } + + // Sets the promote_integer_inputs_to_float_ flag, which is false by default + // NOTE: If set to true, the promote_inputs_to_common_dtype_ must also be + // true. If true, if the iterator's "common dtype" is an integral type + // (including bool) + // then it is changed to the default float scalar type. + TensorIteratorConfig& promote_integer_inputs_to_float( + const bool _promote_integer_inputs_to_float) { + promote_integer_inputs_to_float_ = _promote_integer_inputs_to_float; + TORCH_INTERNAL_ASSERT( + !promote_integer_inputs_to_float_ || promote_inputs_to_common_dtype_); + return *this; + } + + TensorIteratorConfig& is_reduction(const bool _is_reduction) { + is_reduction_ = _is_reduction; + return *this; + } + + TensorIteratorConfig& allow_cpu_scalars(const bool _allow_cpu_scalars) { + allow_cpu_scalars_ = _allow_cpu_scalars; + return *this; + } + + // Sets the cast_common_dtype_to_outputs_ flag, which is false by default + // If true, the iterator's "common dtype" must be computatable + // (see the [Common Dtype Computation] note) and, on the CPU, temporary + // copies of the outputs are passed as the actual output to the operation. + // These temporaries are then copied to the original outputs after + // the operation is performed (see cast_outputs()). + // Setting this flag to true sets check_all_same_dtype_ to false. + TensorIteratorConfig& cast_common_dtype_to_outputs( + const bool _cast_common_dtype_to_outputs) { + cast_common_dtype_to_outputs_ = _cast_common_dtype_to_outputs; + if (_cast_common_dtype_to_outputs) { + check_all_same_dtype_ = false; + } + return *this; + } + + TensorIteratorConfig& resize_outputs(bool resize_outputs) { + resize_outputs_ = resize_outputs; + return *this; + } + + // Bypass output dtype/device computation and fix the dtype/device as + // specified here. + TensorIteratorConfig& declare_static_dtype_and_device( + ScalarType dtype, + Device device); + TensorIteratorConfig& declare_static_dtype(ScalarType dtype); + TensorIteratorConfig& declare_static_device(Device device); + TensorIteratorConfig& declare_static_shape(IntArrayRef shape); + TensorIteratorConfig& declare_static_shape( + IntArrayRef shape, + IntArrayRef squash_dims); + + // It would be better if this was && qualified, but this would be at the cost + // of a lot of boilerplate above + TensorIterator build() { + TensorIterator iter; + iter.build(*this); + return iter; + } + + private: + bool is_tensor_const(size_t idx); + + SmallVector, 4> tensors_; + int num_outputs_ = 0; + int num_inputs_ = 0; + + c10::optional static_shape_ = c10::nullopt; + c10::optional static_dtype_ = c10::nullopt; + c10::optional static_device_ = c10::nullopt; + bool check_mem_overlap_ = true; + bool allow_cpu_scalars_ = false; + bool is_reduction_ = false; + bool resize_outputs_ = true; + bool check_all_same_dtype_ = true; + bool check_all_same_device_ = true; + bool enforce_safe_casting_to_output_ = false; + bool enforce_linear_iteration_ = false; + bool promote_inputs_to_common_dtype_ = false; + bool promote_integer_inputs_to_float_ = false; + bool cast_common_dtype_to_outputs_ = false; + + SmallVector const_tensor_indices_; +}; + +/// A container-like struct that acts as if it contains splits of a +/// TensorIterator that can use 32-bit indexing. Taken together the splits cover +/// the original TensorIterator. +struct TORCH_API SplitUntil32Bit { + struct TORCH_API iterator { + iterator() = default; + iterator(const TensorIteratorBase& iter); + iterator(iterator&&) = default; + + // Guaranteed to be a TensorIterator proper! + TensorIterator& operator*() const; + iterator& operator++(); + bool operator==(const iterator& other) const { + // two iterators are equal if they are the same object or they're both + // empty + return this == &other || (vec.empty() && other.vec.empty()); + } + // needed for C++11 range-based for loop + bool operator!=(const iterator& other) const { + return !(*this == other); + } + + /// stack of TensorIterators to be split + std::vector> vec; + }; + + SplitUntil32Bit(const TensorIteratorBase& iter) : iter(iter) {} + + iterator begin() const; + iterator end() const; + + private: + // NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members) + const TensorIteratorBase& iter; +}; + +} // namespace at diff --git a/shared/package-files/9d/9d8601eb622939f60ec4571e10e6e8206380c6d01d0d0a0492b482980a771758/blob b/shared/package-files/9d/9d8601eb622939f60ec4571e10e6e8206380c6d01d0d0a0492b482980a771758/blob new file mode 100644 index 0000000000000000000000000000000000000000..db040830a3115213a90740eafdb92bccce28d06a --- /dev/null +++ b/shared/package-files/9d/9d8601eb622939f60ec4571e10e6e8206380c6d01d0d0a0492b482980a771758/blob @@ -0,0 +1,452 @@ +""" Transformation Classes as generators for Archimedean copulas + + +Created on Wed Jan 27 14:33:40 2021 + +Author: Josef Perktold +License: BSD-3 + +""" +import warnings + +import numpy as np +from scipy.special import expm1, gamma + + +class Transforms: + """Base class for transformation (generator) functions of Archimedean + copulas. + + Subclasses implement ``evaluate`` (the generator function) and + ``inverse`` (its inverse), and may override ``deriv``, ``deriv2`` and + the higher order derivatives of the inverse with closed-form + expressions. + """ + + def __init__(self): + pass + + def deriv2_inverse(self, phi, args): + """Second derivative of the inverse transformation function. + + Generic implementation based on the derivatives of the direct + transformation function evaluated at the inverse. + + Parameters + ---------- + phi : array_like + Value(s) at which the derivative is evaluated. + args : tuple or float + Copula parameter(s), passed through to `inverse`, `deriv` and + `deriv2`. + + Returns + ------- + ndarray or float + Value(s) of the second derivative of the inverse transformation + function. + """ + t = self.inverse(phi, args) + phi_d1 = self.deriv(t, args) + phi_d2 = self.deriv2(t, args) + return np.abs(phi_d2 / phi_d1**3) + + def derivk_inverse(self, k, phi, theta): + """k-th derivative of the inverse transformation function. + + Not implemented in the base class. + + Parameters + ---------- + k : int + Order of the derivative. + phi : array_like + Value(s) at which the derivative is evaluated. + theta : array_like + Copula parameter. + """ + raise NotImplementedError("not yet implemented") + + +class TransfFrank(Transforms): + """Transformation (generator) function of the Frank copula. + """ + + def evaluate(self, t, theta): + """Evaluate the Frank copula generator function. + + Parameters + ---------- + t : array_like + Value(s) in [0, 1] at which the generator function is + evaluated. + theta : float + Copula dependence parameter. + + Returns + ------- + ndarray + Value(s) of the generator function at `t`. + """ + t = np.asarray(t) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RuntimeWarning) + val = -(np.log(-expm1(-theta*t)) - np.log(-expm1(-theta))) + return val + # return - np.log(expm1(-theta*t) / expm1(-theta)) + + def inverse(self, phi, theta): + """Evaluate the inverse of the Frank copula generator function. + + Parameters + ---------- + phi : array_like + Value(s) at which the inverse generator function is evaluated. + theta : float + Copula dependence parameter. + + Returns + ------- + ndarray + Value(s) of the inverse generator function at `phi`. + """ + phi = np.asarray(phi) + return -np.log1p(np.exp(-phi) * expm1(-theta)) / theta + + def deriv(self, t, theta): + t = np.asarray(t) + tmp = np.exp(-t*theta) + return -theta * tmp/(tmp - 1) + + def deriv2(self, t, theta): + t = np.asarray(t) + tmp = np.exp(theta * t) + d2 = - theta**2 * tmp / (tmp - 1)**2 + return d2 + + def deriv2_inverse(self, phi, theta): + + et = np.exp(theta) + ept = np.exp(phi + theta) + d2 = (et - 1) * ept / (theta * (ept - et + 1)**2) + return d2 + + def deriv3_inverse(self, phi, theta): + et = np.exp(theta) + ept = np.exp(phi + theta) + d3 = -(((et - 1) * ept * (ept + et - 1)) / + (theta * (ept - et + 1)**3)) + return d3 + + def deriv4_inverse(self, phi, theta): + et = np.exp(theta) + ept = np.exp(phi + theta) + p = phi + b = theta + d4 = ((et - 1) * ept * + (-4 * ept + np.exp(2 * (p + b)) + 4 * np.exp(p + 2 * b) - + 2 * et + np.exp(2 * b) + 1) + ) / (b * (ept - et + 1)**4) + + return d4 + + def is_completly_monotonic(self, theta): + # range of theta for which it is copula for d>2 (more than 2 rvs) + return theta > 0 & theta < 1 + + +class TransfClayton(Transforms): + """Transformation (generator) function of the Clayton copula. + """ + + def _checkargs(self, theta): + return theta > 0 + + def evaluate(self, t, theta): + """Evaluate the Clayton copula generator function. + + Parameters + ---------- + t : array_like + Value(s) in [0, 1] at which the generator function is + evaluated. + theta : float + Copula dependence parameter, restricted to > 0. + + Returns + ------- + ndarray + Value(s) of the generator function at `t`. + """ + return np.power(t, -theta) - 1. + + def inverse(self, phi, theta): + """Evaluate the inverse of the Clayton copula generator function. + + Parameters + ---------- + phi : array_like + Value(s) at which the inverse generator function is evaluated. + theta : float + Copula dependence parameter, restricted to > 0. + + Returns + ------- + ndarray + Value(s) of the inverse generator function at `phi`. + """ + return np.power(1 + phi, -1/theta) + + def deriv(self, t, theta): + return -theta * np.power(t, -theta-1) + + def deriv2(self, t, theta): + return theta * (theta + 1) * np.power(t, -theta-2) + + def deriv_inverse(self, phi, theta): + return -(1 + phi)**(-(theta + 1) / theta) / theta + + def deriv2_inverse(self, phi, theta): + return ((theta + 1) * (1 + phi)**(-1 / theta - 2)) / theta**2 + + def deriv3_inverse(self, phi, theta): + th = theta # shorthand + d3 = -((1 + th) * (1 + 2 * th) / th**3 * (1 + phi)**(-1 / th - 3)) + return d3 + + def deriv4_inverse(self, phi, theta): + th = theta # shorthand + d4 = ((1 + th) * (1 + 2 * th) * (1 + 3 * th) / th**4 + ) * (1 + phi)**(-1 / th - 4) + return d4 + + def derivk_inverse(self, k, phi, theta): + thi = 1 / theta # shorthand + d4 = (-1)**k * gamma(k + thi) / gamma(thi) * (1 + phi)**(-(k + thi)) + return d4 + + def is_completly_monotonic(self, theta): + return theta > 0 + + +class TransfGumbel(Transforms): + """Transformation (generator) function of the Gumbel copula. + + Requires theta >= 1. + """ + + def _checkargs(self, theta): + return theta >= 1 + + def evaluate(self, t, theta): + """Evaluate the Gumbel copula generator function. + + Parameters + ---------- + t : array_like + Value(s) in [0, 1] at which the generator function is + evaluated. + theta : float + Copula dependence parameter, restricted to >= 1. + + Returns + ------- + ndarray + Value(s) of the generator function at `t`. + """ + return np.power(-np.log(t), theta) + + def inverse(self, phi, theta): + """Evaluate the inverse of the Gumbel copula generator function. + + Parameters + ---------- + phi : array_like + Value(s) at which the inverse generator function is evaluated. + theta : float + Copula dependence parameter, restricted to >= 1. + + Returns + ------- + ndarray + Value(s) of the inverse generator function at `phi`. + """ + return np.exp(-np.power(phi, 1. / theta)) + + def deriv(self, t, theta): + return - theta * (-np.log(t))**(theta - 1) / t + + def deriv2(self, t, theta): + tmp1 = np.log(t) + d2 = (theta*(-1)**(1 + theta) * tmp1**(theta-1) * (1 - theta) + + theta*(-1)**(1 + theta)*tmp1**theta)/(t**2*tmp1) + # d2 = (theta * tmp1**(-1 + theta) * (1 - theta) + theta * tmp1**theta + # ) / (t**2 * tmp1) + + return d2 + + def deriv2_inverse(self, phi, theta): + th = theta # shorthand + d2 = (phi**(2 / th) + (th - 1) * phi**(1 / th)) / (phi**2 * th**2) + d2 *= np.exp(-phi**(1 / th)) + return d2 + + def deriv3_inverse(self, phi, theta): + p = phi # shorthand + b = theta + d3 = (-p**(3 / b) + (3 - 3 * b) * p**(2 / b) + + ((3 - 2 * b) * b - 1) * p**(1 / b) + ) / (p * b)**3 + d3 *= np.exp(-p**(1 / b)) + return d3 + + def deriv4_inverse(self, phi, theta): + p = phi # shorthand + b = theta + d4 = ((6 * b**3 - 11 * b**2 + 6. * b - 1) * p**(1 / b) + + (11 * b**2 - 18 * b + 7) * p**(2 / b) + + (6 * (b - 1)) * p**(3 / b) + + p**(4 / b) + ) / (p * b)**4 + + d4 *= np.exp(-p**(1 / b)) + return d4 + + def is_completly_monotonic(self, theta): + return theta > 1 + + +class TransfIndep(Transforms): + """Transformation (generator) function of the independence copula. + """ + + def evaluate(self, t, *args): + """Evaluate the independence copula generator function. + + Parameters + ---------- + t : array_like + Value(s) in [0, 1] at which the generator function is + evaluated. + *args + Not used. Present for a consistent interface across + transforms. + + Returns + ------- + ndarray + Value(s) of the generator function at `t`. + """ + t = np.asarray(t) + return -np.log(t) + + def inverse(self, phi, *args): + """Evaluate the inverse of the independence copula generator + function. + + Parameters + ---------- + phi : array_like + Value(s) at which the inverse generator function is evaluated. + *args + Not used. Present for a consistent interface across + transforms. + + Returns + ------- + ndarray + Value(s) of the inverse generator function at `phi`. + """ + phi = np.asarray(phi) + return np.exp(-phi) + + def deriv(self, t, *args): + t = np.asarray(t) + return - 1./t + + def deriv2(self, t, *args): + t = np.asarray(t) + return 1. / t**2 + + def deriv2_inverse(self, phi, *args): + return np.exp(-phi) + + def deriv3_inverse(self, phi, *args): + return -np.exp(-phi) + + def deriv4_inverse(self, phi, *args): + return np.exp(-phi) + + +class _TransfPower(Transforms): + """generic multivariate Archimedean copula with additional power transforms + + Nelson p.144, equ. 4.5.2 + + experimental, not yet tested and used + + Parameters + ---------- + transform : instance of transformation class + The base transformation (generator) function to which the power + transform is applied. + """ + + def __init__(self, transform): + self.transform = transform + + def evaluate(self, t, alpha, beta, *tr_args): + """Evaluate the power-transformed generator function. + + Parameters + ---------- + t : array_like + Value(s) in [0, 1] at which the generator function is + evaluated. + alpha : float + Power parameter applied to `t` before evaluating the base + transform. + beta : float + Power parameter applied to the output of the base transform. + *tr_args + Additional arguments passed to the base transform's + ``evaluate`` method. + + Returns + ------- + ndarray + Value(s) of the power-transformed generator function at `t`. + """ + t = np.asarray(t) + + phi = np.power(self.transform.evaluate(np.power(t, alpha), *tr_args), + beta) + return phi + + def inverse(self, phi, alpha, beta, *tr_args): + """Evaluate the inverse of the power-transformed generator function. + + Parameters + ---------- + phi : array_like + Value(s) at which the inverse generator function is evaluated. + alpha : float + Power parameter applied to the output of the base transform. + beta : float + Power parameter applied to `phi` before evaluating the base + transform. + *tr_args + Additional arguments passed to the base transform's + ``evaluate`` method. + + Returns + ------- + ndarray + Value(s) of the inverse power-transformed generator function at + `phi`. + """ + phi = np.asarray(phi) + transf = self.transform + phi_inv = np.power(transf.evaluate(np.power(phi, 1. / beta), *tr_args), + 1. / alpha) + return phi_inv diff --git a/shared/package-files/9d/9d87b2ec0bb52d75f3e33eb86104743d5817c0cdd8c7a9444b6e4199da0a9da3/blob b/shared/package-files/9d/9d87b2ec0bb52d75f3e33eb86104743d5817c0cdd8c7a9444b6e4199da0a9da3/blob new file mode 100644 index 0000000000000000000000000000000000000000..0c4db2dc0bd03c7616cfbf89e8a7a75cafb0e1d8 --- /dev/null +++ b/shared/package-files/9d/9d87b2ec0bb52d75f3e33eb86104743d5817c0cdd8c7a9444b6e4199da0a9da3/blob @@ -0,0 +1,777 @@ +""" +The API basically only provides one class. You can create a :class:`Script` and +use its methods. + +Additionally you can add a debug function with :func:`set_debug_function`. +Alternatively, if you don't need a custom function and are happy with printing +debug messages to stdout, simply call :func:`set_debug_function` without +arguments. +""" +import sys +from pathlib import Path + +import parso +from parso.python import tree + +from jedi.parser_utils import get_executable_nodes +from jedi import debug +from jedi import settings +from jedi import cache +from jedi.file_io import KnownContentFileIO +from jedi.api import classes +from jedi.api import interpreter +from jedi.api import helpers +from jedi.api.helpers import validate_line_column +from jedi.api.completion import Completion, search_in_module +from jedi.api.keywords import KeywordName +from jedi.api.environment import InterpreterEnvironment +from jedi.api.project import get_default_project, Project +from jedi.api.errors import parso_to_jedi_errors +from jedi.api import refactoring +from jedi.api.refactoring.extract import extract_function, extract_variable +from jedi.inference import InferenceState +from jedi.inference import imports +from jedi.inference.references import find_references +from jedi.inference.arguments import try_iter_content +from jedi.inference.helpers import infer_call_of_leaf +from jedi.inference.sys_path import transform_path_to_dotted +from jedi.inference.syntax_tree import tree_name_to_values +from jedi.inference.value import ModuleValue +from jedi.inference.base_value import ValueSet +from jedi.inference.value.iterable import unpack_tuple_to_dict +from jedi.inference.gradual.conversion import convert_names, convert_values +from jedi.inference.gradual.utils import load_proper_stub_module +from jedi.inference.utils import to_list + +# Jedi uses lots and lots of recursion. By setting this a little bit higher, we +# can remove some "maximum recursion depth" errors. +sys.setrecursionlimit(3000) + + +class Script: + """ + A Script is the base for completions, goto or whatever you want to do with + Jedi. The counter part of this class is :class:`Interpreter`, which works + with actual dictionaries and can work with a REPL. This class + should be used when a user edits code in an editor. + + You can either use the ``code`` parameter or ``path`` to read a file. + Usually you're going to want to use both of them (in an editor). + + The Script's ``sys.path`` is very customizable: + + - If `project` is provided with a ``sys_path``, that is going to be used. + - If `environment` is provided, its ``sys.path`` will be used + (see :func:`Environment.get_sys_path `); + - Otherwise ``sys.path`` will match that of the default environment of + Jedi, which typically matches the sys path that was used at the time + when Jedi was imported. + + Most methods have a ``line`` and a ``column`` parameter. Lines in Jedi are + always 1-based and columns are always zero based. To avoid repetition they + are not always documented. You can omit both line and column. Jedi will + then just do whatever action you are calling at the end of the file. If you + provide only the line, just will complete at the end of that line. + + .. warning:: By default :attr:`jedi.settings.fast_parser` is enabled, which means + that parso reuses modules (i.e. they are not immutable). With this setting + Jedi is **not thread safe** and it is also not safe to use multiple + :class:`.Script` instances and its definitions at the same time. + + If you are a normal plugin developer this should not be an issue. It is + an issue for people that do more complex stuff with Jedi. + + This is purely a performance optimization and works pretty well for all + typical usages, however consider to turn the setting off if it causes + you problems. See also + `this discussion `_. + + :param code: The source code of the current file, separated by newlines. + :type code: str + :param path: The path of the file in the file system, or ``''`` if + it hasn't been saved yet. + :type path: str or pathlib.Path or None + :param Environment environment: Provide a predefined :ref:`Environment ` + to work with a specific Python version or virtualenv. + :param Project project: Provide a :class:`.Project` to make sure finding + references works well, because the right folder is searched. There are + also ways to modify the sys path and other things. + """ + def __init__(self, code=None, *, path=None, environment=None, project=None): + self._orig_path = path + if isinstance(path, str): + path = Path(path) + + self.path = path.absolute() if path else None + + if code is None: + if path is None: + raise ValueError("Must provide at least one of code or path") + + # TODO add a better warning than the traceback! + with open(path, 'rb') as f: + code = f.read() + + if project is None: + # Load the Python grammar of the current interpreter. + project = get_default_project(None if self.path is None else self.path.parent) + + self._inference_state = InferenceState( + project, environment=environment, script_path=self.path + ) + debug.speed('init') + self._module_node, code = self._inference_state.parse_and_get_code( + code=code, + path=self.path, + use_latest_grammar=path and path.suffix == '.pyi', + cache=False, # No disk cache, because the current script often changes. + diff_cache=settings.fast_parser, + cache_path=settings.cache_directory, + ) + debug.speed('parsed') + self._code_lines = parso.split_lines(code, keepends=True) + self._code = code + + cache.clear_time_caches() + debug.reset_time() + + # Cache the module, this is mostly useful for testing, since this shouldn't + # be called multiple times. + @cache.memoize_method + def _get_module(self): + names = None + is_package = False + if self.path is not None: + import_names, is_p = transform_path_to_dotted( + self._inference_state.get_sys_path(add_parent_paths=False), + self.path + ) + if import_names is not None: + names = import_names + is_package = is_p + + if self.path is None: + file_io = None + else: + file_io = KnownContentFileIO(self.path, self._code) + if self.path is not None and self.path.suffix == '.pyi': + # We are in a stub file. Try to load the stub properly. + stub_module = load_proper_stub_module( + self._inference_state, + self._inference_state.latest_grammar, + file_io, + names, + self._module_node + ) + if stub_module is not None: + return stub_module + + if names is None: + names = ('__main__',) + + module = ModuleValue( + self._inference_state, self._module_node, + file_io=file_io, + string_names=names, + code_lines=self._code_lines, + is_package=is_package, + ) + if names[0] not in ('builtins', 'typing'): + # These modules are essential for Jedi, so don't overwrite them. + self._inference_state.module_cache.add(names, ValueSet([module])) + return module + + def _get_module_context(self): + return self._get_module().as_context() + + def __repr__(self): + return '<%s: %s %r>' % ( + self.__class__.__name__, + repr(self._orig_path), + self._inference_state.environment, + ) + + @validate_line_column + def complete(self, line=None, column=None, *, fuzzy=False): + """ + Completes objects under the cursor. + + Those objects contain information about the completions, more than just + names. + + :param fuzzy: Default False. Will return fuzzy completions, which means + that e.g. ``ooa`` will match ``foobar``. + :return: Completion objects, sorted by name. Normal names appear + before "private" names that start with ``_`` and those appear + before magic methods and name mangled names that start with ``__``. + :rtype: list of :class:`.Completion` + """ + with debug.increase_indent_cm('complete'): + completion = Completion( + self._inference_state, self._get_module_context(), self._code_lines, + (line, column), self.get_signatures, fuzzy=fuzzy, + ) + return completion.complete() + + @validate_line_column + def infer(self, line=None, column=None, *, only_stubs=False, prefer_stubs=False): + """ + Return the definitions of under the cursor. It is basically a wrapper + around Jedi's type inference. + + This method follows complicated paths and returns the end, not the + first definition. The big difference between :meth:`goto` and + :meth:`infer` is that :meth:`goto` doesn't + follow imports and statements. Multiple objects may be returned, + because depending on an option you can have two different versions of a + function. + + :param only_stubs: Only return stubs for this method. + :param prefer_stubs: Prefer stubs to Python objects for this method. + :rtype: list of :class:`.Name` + """ + pos = line, column + leaf = self._module_node.get_name_of_position(pos) + if leaf is None: + leaf = self._module_node.get_leaf_for_position(pos) + if leaf is None or leaf.type == 'string': + return [] + if leaf.end_pos == (line, column) and leaf.type == 'operator': + next_ = leaf.get_next_leaf() + if next_.start_pos == leaf.end_pos \ + and next_.type in ('number', 'string', 'keyword'): + leaf = next_ + + context = self._get_module_context().create_context(leaf) + + values = helpers.infer(self._inference_state, context, leaf) + values = convert_values( + values, + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + + defs = [classes.Name(self._inference_state, c.name) for c in values] + # The additional set here allows the definitions to become unique in an + # API sense. In the internals we want to separate more things than in + # the API. + return helpers.sorted_definitions(set(defs)) + + @validate_line_column + def goto(self, line=None, column=None, *, follow_imports=False, follow_builtin_imports=False, + only_stubs=False, prefer_stubs=False): + """ + Goes to the name that defined the object under the cursor. Optionally + you can follow imports. + Multiple objects may be returned, depending on an if you can have two + different versions of a function. + + :param follow_imports: The method will follow imports. + :param follow_builtin_imports: If ``follow_imports`` is True will try + to look up names in builtins (i.e. compiled or extension modules). + :param only_stubs: Only return stubs for this method. + :param prefer_stubs: Prefer stubs to Python objects for this method. + :rtype: list of :class:`.Name` + """ + tree_name = self._module_node.get_name_of_position((line, column)) + if tree_name is None: + # Without a name we really just want to jump to the result e.g. + # executed by `foo()`, if we the cursor is after `)`. + return self.infer(line, column, only_stubs=only_stubs, prefer_stubs=prefer_stubs) + name = self._get_module_context().create_name(tree_name) + + # Make it possible to goto the super class function/attribute + # definitions, when they are overwritten. + names = [] + if name.tree_name.is_definition() and name.parent_context.is_class(): + class_node = name.parent_context.tree_node + class_value = self._get_module_context().create_value(class_node) + mro = class_value.py__mro__() + next(mro) # Ignore the first entry, because it's the class itself. + for cls in mro: + names = cls.goto(tree_name.value) + if names: + break + + if not names: + names = list(name.goto()) + + if follow_imports: + names = helpers.filter_follow_imports(names, follow_builtin_imports) + names = convert_names( + names, + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + + defs = [classes.Name(self._inference_state, d) for d in set(names)] + # Avoid duplicates + return list(set(helpers.sorted_definitions(defs))) + + def search(self, string, *, all_scopes=False): + """ + Searches a name in the current file. For a description of how the + search string should look like, please have a look at + :meth:`.Project.search`. + + :param bool all_scopes: Default False; searches not only for + definitions on the top level of a module level, but also in + functions and classes. + :yields: :class:`.Name` + """ + return self._search_func(string, all_scopes=all_scopes) + + @to_list + def _search_func(self, string, all_scopes=False, complete=False, fuzzy=False): + names = self._names(all_scopes=all_scopes) + wanted_type, wanted_names = helpers.split_search_string(string) + return search_in_module( + self._inference_state, + self._get_module_context(), + names=names, + wanted_type=wanted_type, + wanted_names=wanted_names, + complete=complete, + fuzzy=fuzzy, + ) + + def complete_search(self, string, **kwargs): + """ + Like :meth:`.Script.search`, but completes that string. If you want to + have all possible definitions in a file you can also provide an empty + string. + + :param bool all_scopes: Default False; searches not only for + definitions on the top level of a module level, but also in + functions and classes. + :param fuzzy: Default False. Will return fuzzy completions, which means + that e.g. ``ooa`` will match ``foobar``. + :yields: :class:`.Completion` + """ + return self._search_func(string, complete=True, **kwargs) + + @validate_line_column + def help(self, line=None, column=None): + """ + Used to display a help window to users. Uses :meth:`.Script.goto` and + returns additional definitions for keywords and operators. + + Typically you will want to display :meth:`.BaseName.docstring` to the + user for all the returned definitions. + + The additional definitions are ``Name(...).type == 'keyword'``. + These definitions do not have a lot of value apart from their docstring + attribute, which contains the output of Python's :func:`help` function. + + :rtype: list of :class:`.Name` + """ + definitions = self.goto(line, column, follow_imports=True) + if definitions: + return definitions + leaf = self._module_node.get_leaf_for_position((line, column)) + if leaf is not None and leaf.type in ('keyword', 'operator', 'error_leaf'): + def need_pydoc(): + if leaf.value in ('(', ')', '[', ']'): + if leaf.parent.type == 'trailer': + return False + if leaf.parent.type == 'atom': + return False + grammar = self._inference_state.grammar + # This parso stuff is not public, but since I control it, this + # is fine :-) ~dave + reserved = grammar._pgen_grammar.reserved_syntax_strings.keys() + return leaf.value in reserved + + if need_pydoc(): + name = KeywordName(self._inference_state, leaf.value) + return [classes.Name(self._inference_state, name)] + return [] + + @validate_line_column + def get_references(self, line=None, column=None, **kwargs): + """ + Lists all references of a variable in a project. Since this can be + quite hard to do for Jedi, if it is too complicated, Jedi will stop + searching. + + :param include_builtins: Default ``True``. If ``False``, checks if a definition + is a builtin (e.g. ``sys``) and in that case does not return it. + :param scope: Default ``'project'``. If ``'file'``, include references in + the current module only. + :rtype: list of :class:`.Name` + """ + + def _references(include_builtins=True, scope='project'): + if scope not in ('project', 'file'): + raise ValueError('Only the scopes "file" and "project" are allowed') + tree_name = self._module_node.get_name_of_position((line, column)) + if tree_name is None: + # Must be syntax + return [] + + names = find_references(self._get_module_context(), tree_name, scope == 'file') + + definitions = [classes.Name(self._inference_state, n) for n in names] + if not include_builtins or scope == 'file': + definitions = [d for d in definitions if not d.in_builtin_module()] + return helpers.sorted_definitions(definitions) + return _references(**kwargs) + + @validate_line_column + def get_signatures(self, line=None, column=None): + """ + Return the function object of the call under the cursor. + + E.g. if the cursor is here:: + + abs(# <-- cursor is here + + This would return the ``abs`` function. On the other hand:: + + abs()# <-- cursor is here + + This would return an empty list.. + + :rtype: list of :class:`.Signature` + """ + pos = line, column + call_details = helpers.get_signature_details(self._module_node, pos) + if call_details is None: + return [] + + context = self._get_module_context().create_context(call_details.bracket_leaf) + definitions = helpers.cache_signatures( + self._inference_state, + context, + call_details.bracket_leaf, + self._code_lines, + pos + ) + debug.speed('func_call followed') + + # TODO here we use stubs instead of the actual values. We should use + # the signatures from stubs, but the actual values, probably?! + return [classes.Signature(self._inference_state, signature, call_details) + for signature in definitions.get_signatures()] + + @validate_line_column + def get_context(self, line=None, column=None): + """ + Returns the scope context under the cursor. This basically means the + function, class or module where the cursor is at. + + :rtype: :class:`.Name` + """ + pos = (line, column) + leaf = self._module_node.get_leaf_for_position(pos, include_prefixes=True) + if leaf.start_pos > pos or leaf.type == 'endmarker': + previous_leaf = leaf.get_previous_leaf() + if previous_leaf is not None: + leaf = previous_leaf + + module_context = self._get_module_context() + + n = tree.search_ancestor(leaf, 'funcdef', 'classdef') + if n is not None and n.start_pos < pos <= n.children[-1].start_pos: + # This is a bit of a special case. The context of a function/class + # name/param/keyword is always it's parent context, not the + # function itself. Catch all the cases here where we are before the + # suite object, but still in the function. + context = module_context.create_value(n).as_context() + else: + context = module_context.create_context(leaf) + + while context.name is None: + context = context.parent_context # comprehensions + + definition = classes.Name(self._inference_state, context.name) + while definition.type != 'module': + name = definition._name # TODO private access + tree_name = name.tree_name + if tree_name is not None: # Happens with lambdas. + scope = tree_name.get_definition() + if scope.start_pos[1] < column: + break + definition = definition.parent() + return definition + + def _analysis(self): + self._inference_state.is_analysis = True + self._inference_state.analysis_modules = [self._module_node] + module = self._get_module_context() + try: + for node in get_executable_nodes(self._module_node): + context = module.create_context(node) + if node.type in ('funcdef', 'classdef'): + # Resolve the decorators. + tree_name_to_values(self._inference_state, context, node.children[1]) + elif isinstance(node, tree.Import): + import_names = set(node.get_defined_names()) + if node.is_nested(): + import_names |= set(path[-1] for path in node.get_paths()) + for n in import_names: + imports.infer_import(context, n) + elif node.type == 'expr_stmt': + types = context.infer_node(node) + for testlist in node.children[:-1:2]: + # Iterate tuples. + unpack_tuple_to_dict(context, types, testlist) + else: + if node.type == 'name': + defs = self._inference_state.infer(context, node) + else: + defs = infer_call_of_leaf(context, node) + try_iter_content(defs) + self._inference_state.reset_recursion_limitations() + + ana = [a for a in self._inference_state.analysis if self.path == a.path] + return sorted(set(ana), key=lambda x: x.line) + finally: + self._inference_state.is_analysis = False + + def get_names(self, **kwargs): + """ + Returns names defined in the current file. + + :param all_scopes: If True lists the names of all scopes instead of + only the module namespace. + :param definitions: If True lists the names that have been defined by a + class, function or a statement (``a = b`` returns ``a``). + :param references: If True lists all the names that are not listed by + ``definitions=True``. E.g. ``a = b`` returns ``b``. + :rtype: list of :class:`.Name` + """ + names = self._names(**kwargs) + return [classes.Name(self._inference_state, n) for n in names] + + def get_syntax_errors(self): + """ + Lists all syntax errors in the current file. + + :rtype: list of :class:`.SyntaxError` + """ + return parso_to_jedi_errors(self._inference_state.grammar, self._module_node) + + def _names(self, all_scopes=False, definitions=True, references=False): + # Set line/column to a random position, because they don't matter. + module_context = self._get_module_context() + defs = [ + module_context.create_name(name) + for name in helpers.get_module_names( + self._module_node, + all_scopes=all_scopes, + definitions=definitions, + references=references, + ) + ] + return sorted(defs, key=lambda x: x.start_pos) + + def rename(self, line=None, column=None, *, new_name): + """ + Renames all references of the variable under the cursor. + + :param new_name: The variable under the cursor will be renamed to this + string. + :raises: :exc:`.RefactoringError` + :rtype: :class:`.Refactoring` + """ + definitions = self.get_references(line, column, include_builtins=False) + return refactoring.rename(self._inference_state, definitions, new_name) + + @validate_line_column + def extract_variable(self, line, column, *, new_name, until_line=None, until_column=None): + """ + Moves an expression to a new statemenet. + + For example if you have the cursor on ``foo`` and provide a + ``new_name`` called ``bar``:: + + foo = 3.1 + x = int(foo + 1) + + the code above will become:: + + foo = 3.1 + bar = foo + 1 + x = int(bar) + + :param new_name: The expression under the cursor will be renamed to + this string. + :param int until_line: The the selection range ends at this line, when + omitted, Jedi will be clever and try to define the range itself. + :param int until_column: The the selection range ends at this column, when + omitted, Jedi will be clever and try to define the range itself. + :raises: :exc:`.RefactoringError` + :rtype: :class:`.Refactoring` + """ + if until_line is None and until_column is None: + until_pos = None + else: + if until_line is None: + until_line = line + if until_column is None: + until_column = len(self._code_lines[until_line - 1]) + until_pos = until_line, until_column + return extract_variable( + self._inference_state, self.path, self._module_node, + new_name, (line, column), until_pos + ) + + @validate_line_column + def extract_function(self, line, column, *, new_name, until_line=None, until_column=None): + """ + Moves an expression to a new function. + + For example if you have the cursor on ``foo`` and provide a + ``new_name`` called ``bar``:: + + global_var = 3 + + def x(): + foo = 3.1 + x = int(foo + 1 + global_var) + + the code above will become:: + + global_var = 3 + + def bar(foo): + return int(foo + 1 + global_var) + + def x(): + foo = 3.1 + x = bar(foo) + + :param new_name: The expression under the cursor will be replaced with + a function with this name. + :param int until_line: The the selection range ends at this line, when + omitted, Jedi will be clever and try to define the range itself. + :param int until_column: The the selection range ends at this column, when + omitted, Jedi will be clever and try to define the range itself. + :raises: :exc:`.RefactoringError` + :rtype: :class:`.Refactoring` + """ + if until_line is None and until_column is None: + until_pos = None + else: + if until_line is None: + until_line = line + if until_column is None: + until_column = len(self._code_lines[until_line - 1]) + until_pos = until_line, until_column + return extract_function( + self._inference_state, self.path, self._get_module_context(), + new_name, (line, column), until_pos + ) + + def inline(self, line=None, column=None): + """ + Inlines a variable under the cursor. This is basically the opposite of + extracting a variable. For example with the cursor on bar:: + + foo = 3.1 + bar = foo + 1 + x = int(bar) + + the code above will become:: + + foo = 3.1 + x = int(foo + 1) + + :raises: :exc:`.RefactoringError` + :rtype: :class:`.Refactoring` + """ + names = [d._name for d in self.get_references(line, column, include_builtins=True)] + return refactoring.inline(self._inference_state, names) + + +class Interpreter(Script): + """ + Jedi's API for Python REPLs. + + Implements all of the methods that are present in :class:`.Script` as well. + + In addition to completions that normal REPL completion does like + ``str.upper``, Jedi also supports code completion based on static code + analysis. For example Jedi will complete ``str().upper``. + + >>> from os.path import join + >>> namespace = locals() + >>> script = Interpreter('join("").up', [namespace]) + >>> print(script.complete()[0].name) + upper + + All keyword arguments are same as the arguments for :class:`.Script`. + + :param str code: Code to parse. + :type namespaces: typing.List[dict] + :param namespaces: A list of namespace dictionaries such as the one + returned by :func:`globals` and :func:`locals`. + """ + _allow_descriptor_getattr_default = True + + def __init__(self, code, namespaces, *, project=None, **kwds): + try: + namespaces = [dict(n) for n in namespaces] + except Exception: + raise TypeError("namespaces must be a non-empty list of dicts.") + + environment = kwds.get('environment', None) + if environment is None: + environment = InterpreterEnvironment() + else: + if not isinstance(environment, InterpreterEnvironment): + raise TypeError("The environment needs to be an InterpreterEnvironment subclass.") + + if project is None: + project = Project(Path.cwd()) + + super().__init__(code, environment=environment, project=project, **kwds) + + self.namespaces = namespaces + self._inference_state.allow_descriptor_getattr = self._allow_descriptor_getattr_default + + @cache.memoize_method + def _get_module_context(self): + if self.path is None: + file_io = None + else: + file_io = KnownContentFileIO(self.path, self._code) + tree_module_value = ModuleValue( + self._inference_state, self._module_node, + file_io=file_io, + string_names=('__main__',), + code_lines=self._code_lines, + ) + return interpreter.MixedModuleContext( + tree_module_value, + self.namespaces, + ) + + +def preload_module(*modules): + """ + Preloading modules tells Jedi to load a module now, instead of lazy parsing + of modules. This can be useful for IDEs, to control which modules to load + on startup. + + :param modules: different module names, list of string. + """ + for m in modules: + s = "import %s as x; x." % m + Script(s).complete(1, len(s)) + + +def set_debug_function(func_cb=debug.print_to_stdout, warnings=True, + notices=True, speed=True): + """ + Define a callback debug function to get all the debug messages. + + If you don't specify any arguments, debug messages will be printed to stdout. + + :param func_cb: The callback function for debug messages. + """ + debug.debug_function = func_cb + debug.enable_warning = warnings + debug.enable_notice = notices + debug.enable_speed = speed diff --git a/shared/package-files/9d/9d8a684fe2835f534f311c3a437cea595358547e64d221d69277069ad34d52ac/blob b/shared/package-files/9d/9d8a684fe2835f534f311c3a437cea595358547e64d221d69277069ad34d52ac/blob new file mode 100644 index 0000000000000000000000000000000000000000..a091a64cbf1bbf0c8a25c0492c5b41b3479db053 --- /dev/null +++ b/shared/package-files/9d/9d8a684fe2835f534f311c3a437cea595358547e64d221d69277069ad34d52ac/blob @@ -0,0 +1,31 @@ +error(0.009983528262938363984) D0 +error(0.00615483138465494628) D0 D1 +error(0.02658450002921702859) D0 D4 +error(0.006155551389602498258) D0 D5 +error(0.003148382234498092735) D0 D6 +error(0.01443617149199150074) D1 D2 +error(0.03297825933810777377) D1 D5 +error(0.002913474478998201445) D1 D6 +error(0.004899170776926753401) D1 D7 +error(0.02387969596171365255) D1 L0 +error(0.01236995607004921435) D2 +error(0.0126276664829785279) D2 D3 +error(0.01774458980027965316) D2 D6 +error(0.01910316689393931622) D2 D7 +error(0.02550305296574501002) D3 D7 +error(0.01037090957356327781) D3 L0 +error(0.01373797278395086884) D4 +error(0.01117265808121870041) D4 D5 +error(0.01632474558281776789) D5 D6 +error(0.03869550234566459385) D5 L0 +error(0.03858806947286268219) D6 +error(0.01625080343145679507) D6 D7 +error(0.02105301869064503048) D7 L0 +detector(3, 2, 0) D0 +detector(5, 2, 0) D1 +detector(5, 4, 0) D2 +detector(7, 4, 0) D3 +detector(3, 2, 1) D4 +detector(5, 2, 1) D5 +detector(5, 4, 1) D6 +detector(7, 4, 1) D7 diff --git a/shared/package-files/9d/9d8b1562150618e2fcd201e3dfbb22fef5f4761f10848312794e2c1e336275e3/blob b/shared/package-files/9d/9d8b1562150618e2fcd201e3dfbb22fef5f4761f10848312794e2c1e336275e3/blob new file mode 100644 index 0000000000000000000000000000000000000000..f51ffdbd03a43fadbedce302ffa8e5967a30ad59 Binary files /dev/null and b/shared/package-files/9d/9d8b1562150618e2fcd201e3dfbb22fef5f4761f10848312794e2c1e336275e3/blob differ diff --git a/shared/package-files/9d/9d8cf0ac3f2ab0e6b5607e3c87c247b3b16ccbc0917f1fd23b23ddc7ef4b6cb1/blob b/shared/package-files/9d/9d8cf0ac3f2ab0e6b5607e3c87c247b3b16ccbc0917f1fd23b23ddc7ef4b6cb1/blob new file mode 100644 index 0000000000000000000000000000000000000000..6013337aa4ef0ac37917548828bee4e30210c5f7 --- /dev/null +++ b/shared/package-files/9d/9d8cf0ac3f2ab0e6b5607e3c87c247b3b16ccbc0917f1fd23b23ddc7ef4b6cb1/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & _mps_convolution_transpose_out_symint(const at::Tensor & self, const at::Tensor & weight, c10::SymIntArrayRef padding, c10::SymIntArrayRef output_padding, c10::SymIntArrayRef stride, c10::SymIntArrayRef dilation, c10::SymInt groups, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9d919ed3536cb99992f3c70caaaf1f1856ca97eba6be65a35ddf011a64778d3a/blob b/shared/package-files/9d/9d919ed3536cb99992f3c70caaaf1f1856ca97eba6be65a35ddf011a64778d3a/blob new file mode 100644 index 0000000000000000000000000000000000000000..49b2e621b7adc97947ec9d6c376a9d0f10e672fb --- /dev/null +++ b/shared/package-files/9d/9d919ed3536cb99992f3c70caaaf1f1856ca97eba6be65a35ddf011a64778d3a/blob @@ -0,0 +1,65 @@ +import numpy as np +import pytest + +from pandas._libs import lib +import pandas.util._test_decorators as td + +import pandas as pd +import pandas._testing as tm + + +def assert_block_lengths(x): + assert len(x) == len(x._mgr.blocks[0].mgr_locs) + return 0 + + +def cumsum_max(x): + x.cumsum().max() + return 0 + + +@pytest.mark.parametrize( + "func", + [ + cumsum_max, + pytest.param(assert_block_lengths, marks=td.skip_array_manager_invalid_test), + ], +) +def test_mgr_locs_updated(func): + # https://github.com/pandas-dev/pandas/issues/31802 + # Some operations may require creating new blocks, which requires + # valid mgr_locs + df = pd.DataFrame({"A": ["a", "a", "a"], "B": ["a", "b", "b"], "C": [1, 1, 1]}) + result = df.groupby(["A", "B"]).agg(func) + expected = pd.DataFrame( + {"C": [0, 0]}, + index=pd.MultiIndex.from_product([["a"], ["a", "b"]], names=["A", "B"]), + ) + tm.assert_frame_equal(result, expected) + + +@pytest.mark.parametrize( + "binner,closed,expected", + [ + ( + np.array([0, 3, 6, 9], dtype=np.int64), + "left", + np.array([2, 5, 6], dtype=np.int64), + ), + ( + np.array([0, 3, 6, 9], dtype=np.int64), + "right", + np.array([3, 6, 6], dtype=np.int64), + ), + (np.array([0, 3, 6], dtype=np.int64), "left", np.array([2, 5], dtype=np.int64)), + ( + np.array([0, 3, 6], dtype=np.int64), + "right", + np.array([3, 6], dtype=np.int64), + ), + ], +) +def test_generate_bins(binner, closed, expected): + values = np.array([1, 2, 3, 4, 5, 6], dtype=np.int64) + result = lib.generate_bins_dt64(values, binner, closed=closed) + tm.assert_numpy_array_equal(result, expected) diff --git a/shared/package-files/9d/9d94dd976000416c65c3b799acd419a257369d37a2428807f31035df7c4200f4/blob b/shared/package-files/9d/9d94dd976000416c65c3b799acd419a257369d37a2428807f31035df7c4200f4/blob new file mode 100644 index 0000000000000000000000000000000000000000..38112daf79c4d30cac50e799c1abd2f710175e5f --- /dev/null +++ b/shared/package-files/9d/9d94dd976000416c65c3b799acd419a257369d37a2428807f31035df7c4200f4/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor special_shifted_chebyshev_polynomial_t(const at::Tensor & x, const at::Tensor & n); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9d/9d96e5bb4ccbc5076d821295a2beeec78098b3297f466a894f38cab36f8659b8/blob b/shared/package-files/9d/9d96e5bb4ccbc5076d821295a2beeec78098b3297f466a894f38cab36f8659b8/blob new file mode 100644 index 0000000000000000000000000000000000000000..ebf66a84e4397e46f86323043c666030785863fc --- /dev/null +++ b/shared/package-files/9d/9d96e5bb4ccbc5076d821295a2beeec78098b3297f466a894f38cab36f8659b8/blob @@ -0,0 +1,731 @@ +import numpy as np + +from statsmodels.base.elastic_net import RegularizedResults +from statsmodels.base.model import LikelihoodModelResults +from statsmodels.regression.linear_model import OLS +from statsmodels.stats.regularized_covariance import ( + _calc_approx_inv_cov, + _calc_nodewise_row, + _calc_nodewise_weight, +) +from statsmodels.tools.validation import string_like + +""" +Distributed estimation routines. Currently, we support several +methods of distribution + +- sequential, has no extra dependencies +- parallel + - with joblib + A variety of backends are supported through joblib + This allows for different types of clusters besides + standard local clusters. Some examples of + backends supported by joblib are + - dask.distributed + - yarn + - ipyparallel + +The framework is very general and allows for a variety of +estimation methods. Currently, these include + +- debiased regularized estimation +- simple coefficient averaging (naive) + - regularized + - unregularized + +Currently, the default is regularized estimation with debiasing +which follows the methods outlined in + +Jason D. Lee, Qiang Liu, Yuekai Sun and Jonathan E. Taylor. +"Communication-Efficient Sparse Regression: A One-Shot Approach." +arXiv:1503.04337. 2015. https://arxiv.org/abs/1503.04337. + +There are several variables that are taken from the source paper +for which the interpretation may not be directly clear from the +code, these are mostly used to help form the estimate of the +approximate inverse covariance matrix as part of the +debiasing procedure. + + wexog + + A weighted design matrix used to perform the node-wise + regression procedure. + + nodewise_row + + nodewise_row is produced as part of the node-wise regression + procedure used to produce the approximate inverse covariance + matrix. One is produced for each variable using the + LASSO. + + nodewise_weight + + nodewise_weight is produced using the gamma_hat values for + each p to produce weights to reweight the gamma_hat values which + are ultimately used to form approx_inv_cov. + + approx_inv_cov + + This is the estimate of the approximate inverse covariance + matrix. This is used to debias the coefficient average + along with the average gradient. For the OLS case, + approx_inv_cov is an approximation for + + n * (X^T X)^{-1} + + formed by node-wise regression. +""" + + +def _est_regularized_naive(mod, pnum, partitions, fit_kwds=None): + """ + Estimate the regularized fitted parameters + + Parameters + ---------- + mod : statsmodels model class instance + The model for the current partition. + pnum : scalar + Index of current partition + partitions : scalar + Total number of partitions + fit_kwds : dict-like or None, optional + Keyword arguments to be given to fit_regularized + + Returns + ------- + ndarray + An array of the parameters for the regularized fit. + """ + + if fit_kwds is None: + raise ValueError( + "_est_regularized_naive currently " + "requires that fit_kwds not be None." + ) + + return mod.fit_regularized(**fit_kwds).params + + +def _est_unregularized_naive(mod, pnum, partitions, fit_kwds=None): + """ + Estimate the unregularized fitted parameters + + Parameters + ---------- + mod : statsmodels model class instance + The model for the current partition. + pnum : scalar + Index of current partition + partitions : scalar + Total number of partitions + fit_kwds : dict-like or None, optional + Keyword arguments to be given to fit + + Returns + ------- + ndarray + An array of the parameters for the fit. + """ + + if fit_kwds is None: + raise ValueError( + "_est_unregularized_naive currently requires that fit_kwds not be None." + ) + + return mod.fit(**fit_kwds).params + + +def _join_naive(params_l, threshold=0): + """ + Join the results from each run of _est__naive and return + the mean estimate of the coefficients + + Parameters + ---------- + params_l : list + A list of arrays of coefficients. + threshold : scalar, optional + The threshold at which the coefficients will be cut. + + Returns + ------- + ndarray + The mean estimate of the coefficients. + """ + + p = len(params_l[0]) + partitions = len(params_l) + + params_mn = np.zeros(p) + for params in params_l: + params_mn += params + params_mn /= partitions + + params_mn[np.abs(params_mn) < threshold] = 0 + + return params_mn + + +def _calc_grad(mod, params, alpha, L1_wt, score_kwds): + """ + Calculate the log-likelihood gradient for the debiasing + + Parameters + ---------- + mod : statsmodels model class instance + The model for the current partition. + params : array_like + The estimated coefficients for the current partition. + alpha : scalar or array_like + The penalty weight. If a scalar, the same penalty weight + applies to all variables in the model. If a vector, it + must have the same length as `params`, and contains a + penalty weight for each coefficient. + L1_wt : scalar + The fraction of the penalty given to the L1 penalty term. + Must be between 0 and 1 (inclusive). If 0, the fit is + a ridge fit, if 1 it is a lasso fit. + score_kwds : dict-like or None + Keyword arguments for the score function. + + Returns + ------- + ndarray + An array-like object of the same dimension as params. + + Notes + ----- + In general: + + gradient l_k(params) + + where k corresponds to the index of the partition + + For OLS: + + X^T(y - X^T params) + """ + + grad = -mod.score(np.asarray(params), **score_kwds) + grad += alpha * (1 - L1_wt) + return grad + + +def _calc_wdesign_mat(mod, params, hess_kwds): + """ + Calculate the weighted design matrix necessary to generate + the approximate inverse covariance matrix + + Parameters + ---------- + mod : statsmodels model class instance + The model for the current partition. + params : array_like + The estimated coefficients for the current partition. + hess_kwds : dict-like or None + Keyword arguments for the hessian function. + + Returns + ------- + ndarray + An array-like object, updated design matrix, same dimension + as mod.exog. + """ + + rhess = np.sqrt(mod.hessian_factor(np.asarray(params), **hess_kwds)) + return rhess[:, None] * mod.exog + + +def _est_regularized_debiased( + mod, mnum, partitions, fit_kwds=None, score_kwds=None, hess_kwds=None +): + """ + Estimate the regularized fitted parameters, the default + estimation_method for class DistributedModel + + Parameters + ---------- + mod : statsmodels model class instance + The model for the current partition. + mnum : scalar + Index of current partition. + partitions : scalar + Total number of partitions. + fit_kwds : dict-like or None, optional + Keyword arguments to be given to fit_regularized + score_kwds : dict-like, optional + Keyword arguments for the score function. + hess_kwds : dict-like, optional + Keyword arguments for the Hessian function. + + Returns + ------- + tuple + A tuple of parameters for regularized fit containing an + array-like object of the fitted parameters (params), an + array-like object for the gradient, a list of array-like + objects for nodewise_row, and a list of array-like objects + for nodewise_weight. + """ + + score_kwds = {} if score_kwds is None else score_kwds + hess_kwds = {} if hess_kwds is None else hess_kwds + + if fit_kwds is None: + raise ValueError( + "_est_regularized_debiased currently requires that fit_kwds not be None." + ) + else: + alpha = fit_kwds["alpha"] + + if "L1_wt" in fit_kwds: + L1_wt = fit_kwds["L1_wt"] + else: + L1_wt = 1 + + nobs, p = mod.exog.shape + p_part = int(np.ceil((1.0 * p) / partitions)) + + params = mod.fit_regularized(**fit_kwds).params + grad = _calc_grad(mod, params, alpha, L1_wt, score_kwds) / nobs + + wexog = _calc_wdesign_mat(mod, params, hess_kwds) + + nodewise_row_l = [] + nodewise_weight_l = [] + for idx in range(mnum * p_part, min((mnum + 1) * p_part, p)): + + nodewise_row = _calc_nodewise_row(wexog, idx, alpha) + nodewise_row_l.append(nodewise_row) + + nodewise_weight = _calc_nodewise_weight(wexog, nodewise_row, idx, alpha) + nodewise_weight_l.append(nodewise_weight) + + return params, grad, nodewise_row_l, nodewise_weight_l + + +def _join_debiased(results_l, threshold=0): + """ + Join the results from each run of _est_regularized_debiased and + return the debiased estimate of the coefficients + + Parameters + ---------- + results_l : list + A list of tuples each one containing the params, grad, + nodewise_row and nodewise_weight values for each partition. + threshold : scalar, optional + The threshold at which the coefficients will be cut. + + Returns + ------- + ndarray + The debiased estimate of the coefficients. + """ + + p = len(results_l[0][0]) + partitions = len(results_l) + + params_mn = np.zeros(p) + grad_mn = np.zeros(p) + + nodewise_row_l = [] + nodewise_weight_l = [] + + for r in results_l: + + params_mn += r[0] + grad_mn += r[1] + + nodewise_row_l.extend(r[2]) + nodewise_weight_l.extend(r[3]) + + nodewise_row_l = np.array(nodewise_row_l) + nodewise_weight_l = np.array(nodewise_weight_l) + + params_mn /= partitions + grad_mn *= -1.0 / partitions + + approx_inv_cov = _calc_approx_inv_cov(nodewise_row_l, nodewise_weight_l) + + debiased_params = params_mn + approx_inv_cov.dot(grad_mn) + + debiased_params[np.abs(debiased_params) < threshold] = 0 + + return debiased_params + + +def _helper_fit_partition(self, pnum, endog, exog, fit_kwds, init_kwds_e=None): + """ + Handle the model fitting for each machine + + NOTE: this is primarily handled outside of DistributedModel + because joblib cannot handle class methods. + + Parameters + ---------- + self : DistributedModel class instance + An instance of DistributedModel. + pnum : scalar + index of current partition. + endog : array_like + endogenous data for current partition. + exog : array_like + exogenous data for current partition. + fit_kwds : dict-like + Keywords needed for the model fitting. + init_kwds_e : dict-like, optional + Additional init_kwds to add for each partition. + + Returns + ------- + object + The estimation_method result. For the default, + _est_regularized_debiased, a tuple. + """ + init_kwds_e = {} if init_kwds_e is None else init_kwds_e + temp_init_kwds = self.init_kwds.copy() + temp_init_kwds.update(init_kwds_e) + + model = self.model_class(endog, exog, **temp_init_kwds) + results = self.estimation_method( + model, pnum, self.partitions, fit_kwds=fit_kwds, **self.estimation_kwds + ) + return results + + +class DistributedModel: + __doc__ = """ + Distributed model class + + Parameters + ---------- + partitions : scalar + The number of partitions that the data will be split into. + model_class : statsmodels model class, optional + The model class which will be used for estimation. If None + this defaults to OLS. + init_kwds : dict-like, optional + Keywords needed for initializing the model, in addition to + endog and exog. + estimation_method : callable, optional + The method that performs the estimation for each partition. + If None this defaults to _est_regularized_debiased. + estimation_kwds : dict-like, optional + Keywords to be passed to estimation_method. + join_method : callable, optional + The method used to recombine the results from each partition. + If None this defaults to _join_debiased. + join_kwds : dict-like, optional + Keywords to be passed to join_method. + results_class : results class, optional + The class of results that should be returned. If None this + defaults to RegularizedResults. + results_kwds : dict-like, optional + Keywords to be passed to results class. + + Attributes + ---------- + partitions : scalar + See Parameters. + model_class : statsmodels model class + See Parameters. + init_kwds : dict-like + See Parameters. + estimation_method : callable + See Parameters. + estimation_kwds : dict-like + See Parameters. + join_method : callable + See Parameters. + join_kwds : dict-like + See Parameters. + results_class : results class + See Parameters. + results_kwds : dict-like + See Parameters. + + Notes + ----- + + Examples + -------- + """ + + def __init__( + self, + partitions, + model_class=None, + init_kwds=None, + estimation_method=None, + estimation_kwds=None, + join_method=None, + join_kwds=None, + results_class=None, + results_kwds=None, + ): + + self.partitions = partitions + + if model_class is None: + self.model_class = OLS + else: + self.model_class = model_class + + if init_kwds is None: + self.init_kwds = {} + else: + self.init_kwds = init_kwds + + if estimation_method is None: + self.estimation_method = _est_regularized_debiased + else: + self.estimation_method = estimation_method + + if estimation_kwds is None: + self.estimation_kwds = {} + else: + self.estimation_kwds = estimation_kwds + + if join_method is None: + self.join_method = _join_debiased + else: + self.join_method = join_method + + if join_kwds is None: + self.join_kwds = {} + else: + self.join_kwds = join_kwds + + if results_class is None: + self.results_class = RegularizedResults + else: + self.results_class = results_class + + if results_kwds is None: + self.results_kwds = {} + else: + self.results_kwds = results_kwds + + def fit( + self, + data_generator, + fit_kwds=None, + parallel_method="sequential", + parallel_backend=None, + init_kwds_generator=None, + ): + """Performs the distributed estimation using the corresponding + DistributedModel + + Parameters + ---------- + data_generator : generator + A generator that produces a sequence of tuples where the first + element in the tuple corresponds to an endog array and the + element corresponds to an exog array. + fit_kwds : dict-like, optional + Keywords needed for the model fitting. + parallel_method : {"sequential", "joblib"}, optional + Type of distributed estimation to be used, currently + "sequential" and "joblib" are supported. + parallel_backend : None or joblib parallel_backend object, optional + used to allow support for more complicated backends, + ex: dask.distributed + init_kwds_generator : generator or None, optional + Additional keyword generator that produces model init_kwds + that may vary based on data partition. The current usecase + is for WLS and GLS + + Returns + ------- + Results + An instance of results_class (RegularizedResults by + default), initialized using the dummy result model and + the join_method result as params. + """ + + if fit_kwds is None: + fit_kwds = {} + + parallel_method = string_like( + parallel_method, + "parallel_method", + options=("sequential", "joblib"), + lower=False, + ) + if parallel_method == "sequential": + results_l = self.fit_sequential( + data_generator, fit_kwds, init_kwds_generator + ) + + else: # parallel_method == "joblib" + results_l = self.fit_joblib( + data_generator, fit_kwds, parallel_backend, init_kwds_generator + ) + + params = self.join_method(results_l, **self.join_kwds) + + # NOTE that currently, the dummy result model that is initialized + # here does not use any init_kwds from the init_kwds_generator event + # if it is provided. It is possible to imagine an edge case where + # this might be a problem but given that the results model instance + # does not correspond to any data partition this seems reasonable. + res_mod = self.model_class([0], [0], **self.init_kwds) + + return self.results_class(res_mod, params, **self.results_kwds) + + def fit_sequential(self, data_generator, fit_kwds, init_kwds_generator=None): + """Sequentially performs the distributed estimation using + the corresponding DistributedModel + + Parameters + ---------- + data_generator : generator + A generator that produces a sequence of tuples where the first + element in the tuple corresponds to an endog array and the + element corresponds to an exog array. + fit_kwds : dict-like + Keywords needed for the model fitting. + init_kwds_generator : generator or None, optional + Additional keyword generator that produces model init_kwds + that may vary based on data partition. The current usecase + is for WLS and GLS + + Returns + ------- + list + A list of the estimation_method result for each partition. + For the default, _est_regularized_debiased, a list of + tuples. + """ + + results_l = [] + + if init_kwds_generator is None: + + for pnum, (endog, exog) in enumerate(data_generator): + + results = _helper_fit_partition(self, pnum, endog, exog, fit_kwds) + results_l.append(results) + + else: + + tup_gen = enumerate(zip(data_generator, init_kwds_generator, strict=True)) + + for pnum, ((endog, exog), init_kwds_e) in tup_gen: + + results = _helper_fit_partition( + self, pnum, endog, exog, fit_kwds, init_kwds_e + ) + results_l.append(results) + + return results_l + + def fit_joblib( + self, data_generator, fit_kwds, parallel_backend, init_kwds_generator=None + ): + """Performs the distributed estimation in parallel using joblib + + Parameters + ---------- + data_generator : generator + A generator that produces a sequence of tuples where the first + element in the tuple corresponds to an endog array and the + element corresponds to an exog array. + fit_kwds : dict-like + Keywords needed for the model fitting. + parallel_backend : None or joblib parallel_backend object + used to allow support for more complicated backends, + ex: dask.distributed + init_kwds_generator : generator or None, optional + Additional keyword generator that produces model init_kwds + that may vary based on data partition. The current usecase + is for WLS and GLS + + Returns + ------- + list + A list of the estimation_method result for each partition. + For the default, _est_regularized_debiased, a list of + tuples. + """ + + from statsmodels.tools.parallel import parallel_func + + par, f, n_jobs = parallel_func(_helper_fit_partition, self.partitions) + + if parallel_backend is None and init_kwds_generator is None: + results_l = par( + f(self, pnum, endog, exog, fit_kwds) + for pnum, (endog, exog) in enumerate(data_generator) + ) + + elif parallel_backend is not None and init_kwds_generator is None: + with parallel_backend: + results_l = par( + f(self, pnum, endog, exog, fit_kwds) + for pnum, (endog, exog) in enumerate(data_generator) + ) + + elif parallel_backend is None and init_kwds_generator is not None: + tup_gen = enumerate(zip(data_generator, init_kwds_generator, strict=True)) + results_l = par( + f(self, pnum, endog, exog, fit_kwds, init_kwds) + for pnum, ((endog, exog), init_kwds) in tup_gen + ) + + elif parallel_backend is not None and init_kwds_generator is not None: + tup_gen = enumerate(zip(data_generator, init_kwds_generator, strict=True)) + with parallel_backend: + results_l = par( + f(self, pnum, endog, exog, fit_kwds, init_kwds) + for pnum, ((endog, exog), init_kwds) in tup_gen + ) + + return results_l + + +class DistributedResults(LikelihoodModelResults): + """ + Class to contain model results + + Parameters + ---------- + model : class instance + Class instance for model used for distributed data, + this particular instance uses fake data and is really + only to allow use of methods like predict. + params : ndarray + Parameter estimates from the fit model. + """ + + def __init__(self, model, params): + super().__init__(model, params) + + def predict(self, exog, *args, **kwargs): + """ + Call self.model.predict for the provided exog + + See Results.predict. + + Parameters + ---------- + exog : array_like + The values for which we want to predict, unlike standard + predict this is NOT optional since the data in self.model + is fake. + *args : + Some models can take additional arguments. See the + predict method of the model for the details. + **kwargs : + Some models can take additional keywords arguments. See the + predict method of the model for the details. + + Returns + ------- + ndarray, pandas.Series or pandas.DataFrame + See self.model.predict. + """ + + return self.model.predict(self.params, exog, *args, **kwargs) diff --git a/shared/package-files/9d/9d990051b1694c524c43e5ea216902a1e8672d513dc5f0b0e0ddeeb4af78b145/blob b/shared/package-files/9d/9d990051b1694c524c43e5ea216902a1e8672d513dc5f0b0e0ddeeb4af78b145/blob new file mode 100644 index 0000000000000000000000000000000000000000..f82c676daf88f5802d40a5536f236f91377a9bc6 --- /dev/null +++ b/shared/package-files/9d/9d990051b1694c524c43e5ea216902a1e8672d513dc5f0b0e0ddeeb4af78b145/blob @@ -0,0 +1,132 @@ +#pragma once +#include + +#include + +namespace at::xpu { + +/* + * XPUEvent are movable not copyable wrappers around SYCL event. XPUEvent are + * constructed lazily when first recorded. It has a device, and this device is + * acquired from the first recording stream. Later streams that record the event + * must match the same device. + * + * Currently, XPUEvent does NOT support to export an inter-process event from + * another process via inter-process comunication(IPC). So it means that + * inter-process communication for event handles between different processes is + * not available. This could impact some applications that rely on cross-process + * synchronization and communication. + */ +struct TORCH_XPU_API XPUEvent { + // Constructors + XPUEvent(bool enable_timing = false) noexcept + : enable_timing_{enable_timing} {} + + ~XPUEvent() = default; + + XPUEvent(const XPUEvent&) = delete; + XPUEvent& operator=(const XPUEvent&) = delete; + + XPUEvent(XPUEvent&& other) = default; + XPUEvent& operator=(XPUEvent&& other) = default; + + operator sycl::event&() const { + return event(); + } + + std::optional device() const { + if (isCreated()) { + return at::Device(at::kXPU, device_index_); + } else { + return std::nullopt; + } + } + + inline bool isCreated() const { + return (event_.get() != nullptr); + } + + DeviceIndex device_index() const { + return device_index_; + } + + sycl::event& event() const { + return *event_; + } + + bool query() const { + using namespace sycl::info; + if (!isCreated()) { + return true; + } + + return event().get_info() == + event_command_status::complete; + } + + void record() { + record(getCurrentXPUStream()); + } + + void recordOnce(const XPUStream& stream) { + if (!isCreated()) { + record(stream); + } + } + + void record(const XPUStream& stream) { + if (!isCreated()) { + device_index_ = stream.device_index(); + } else { + TORCH_CHECK( + device_index_ == stream.device_index(), + "Event device ", + device_index_, + " does not match recording stream's device ", + stream.device_index(), + "."); + event_.reset(); + } + event_ = std::make_unique( + stream.queue().ext_oneapi_submit_barrier()); + } + + void block(const XPUStream& stream) { + if (isCreated()) { + std::vector event_list{event()}; + // Make this stream wait until event_ is completed. + stream.queue().ext_oneapi_submit_barrier(event_list); + } + } + + float elapsed_time(const XPUEvent& other) const { + TORCH_CHECK( + isCreated() && other.isCreated(), + "Both events must be recorded before calculating elapsed time."); + TORCH_CHECK( + query() && other.query(), + "Both events must be completed before calculating elapsed time."); + TORCH_CHECK( + enable_timing_ && other.enable_timing_, + "Both events must be created with argument 'enable_timing=True'."); + // TODO: provides the ability to time the execution of commands in a SYCL + // queue without enabling profiling on the entire queue + TORCH_CHECK_NOT_IMPLEMENTED( + false, "elapsed_time is not supported by XPUEvent."); + } + + void synchronize() const { + if (isCreated()) { + event().wait_and_throw(); + } + } + + private: + bool enable_timing_ = false; + DeviceIndex device_index_ = -1; + // Only need to track the last event, as events in an in-order queue are + // executed sequentially. + std::unique_ptr event_; +}; + +} // namespace at::xpu diff --git a/shared/package-files/9d/9d99696fc873955fa086d23d5c02cb5121d0c7c22ec0b6c2f21bfbd69c1b4b08/blob b/shared/package-files/9d/9d99696fc873955fa086d23d5c02cb5121d0c7c22ec0b6c2f21bfbd69c1b4b08/blob new file mode 100644 index 0000000000000000000000000000000000000000..23a407c86f1aa25039392eba4288aa348f856471 --- /dev/null +++ b/shared/package-files/9d/9d99696fc873955fa086d23d5c02cb5121d0c7c22ec0b6c2f21bfbd69c1b4b08/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & _trilinear_out(const at::Tensor & i1, const at::Tensor & i2, const at::Tensor & i3, at::IntArrayRef expand1, at::IntArrayRef expand2, at::IntArrayRef expand3, at::IntArrayRef sumdim, int64_t unroll_dim, at::Tensor & out); +TORCH_API at::Tensor _trilinear(const at::Tensor & i1, const at::Tensor & i2, const at::Tensor & i3, at::IntArrayRef expand1, at::IntArrayRef expand2, at::IntArrayRef expand3, at::IntArrayRef sumdim, int64_t unroll_dim=1); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9d9a0926a1d74122fe2d7604e7cfd61c0f7b5e56d39046d891d1f718bdf64a64/blob b/shared/package-files/9d/9d9a0926a1d74122fe2d7604e7cfd61c0f7b5e56d39046d891d1f718bdf64a64/blob new file mode 100644 index 0000000000000000000000000000000000000000..3930d8931da14db0815d885028304d3905c0d680 --- /dev/null +++ b/shared/package-files/9d/9d9a0926a1d74122fe2d7604e7cfd61c0f7b5e56d39046d891d1f718bdf64a64/blob @@ -0,0 +1,107 @@ +"""This module contains miscellaneous helpers. + +It is not considered part of the public ufoLib API. It does, however, +define the :py:obj:`.deprecated` decorator that is used elsewhere in +the module. +""" + +from __future__ import annotations + +from typing import Optional, Type, TypeVar, Union, cast +from collections.abc import Callable +import enum +import functools +import warnings + +F = TypeVar("F", bound=Callable[..., object]) +FormatVersion = TypeVar("FormatVersion", bound="BaseFormatVersion") +FormatVersionInput = Optional[Union[int, tuple[int, int], FormatVersion]] + +numberTypes = (int, float) + + +def deprecated(msg: str = "") -> Callable[[F], F]: + """Decorator factory to mark functions as deprecated with given message. + + >>> @deprecated("Enough!") + ... def some_function(): + ... "I just print 'hello world'." + ... print("hello world") + >>> some_function() + hello world + >>> some_function.__doc__ == "I just print 'hello world'." + True + """ + + def deprecated_decorator(func: F) -> F: + @functools.wraps(func) + def wrapper(*args, **kwargs): + warnings.warn( + f"{func.__name__} function is a deprecated. {msg}", + category=DeprecationWarning, + stacklevel=2, + ) + return func(*args, **kwargs) + + return cast(F, wrapper) + + return deprecated_decorator + + +def normalizeFormatVersion( + value: FormatVersionInput, cls: Type[FormatVersion] +) -> FormatVersion: + # Needed for type safety of UFOFormatVersion and GLIFFormatVersion input + if value is None: + return cls.default() + if isinstance(value, cls): + return value + if isinstance(value, int): + return cls((value, 0)) + if isinstance(value, tuple) and len(value) == 2: + return cls(value) + raise ValueError(f"Unsupported format version: {value!r}") + + +# Base class for UFOFormatVersion and GLIFFormatVersion +class BaseFormatVersion(tuple[int, int], enum.Enum): + value: tuple[int, int] + + def __new__(cls: Type[FormatVersion], value: tuple[int, int]) -> BaseFormatVersion: + return super().__new__(cls, value) + + @property + def major(self) -> int: + return self.value[0] + + @property + def minor(self) -> int: + return self.value[1] + + @classmethod + def _missing_(cls, value: object) -> BaseFormatVersion: + # allow to initialize a version enum from a single (major) integer + if isinstance(value, int): + return cls((value, 0)) + # or from None to obtain the current default version + if value is None: + return cls.default() + raise ValueError(f"{value!r} is not a valid {cls.__name__}") + + def __str__(self) -> str: + return f"{self.major}.{self.minor}" + + @classmethod + def default(cls: Type[FormatVersion]) -> FormatVersion: + # get the latest defined version (i.e. the max of all versions) + return max(cls.__members__.values()) + + @classmethod + def supported_versions(cls: Type[FormatVersion]) -> frozenset[FormatVersion]: + return frozenset(cls.__members__.values()) + + +if __name__ == "__main__": + import doctest + + doctest.testmod() diff --git a/shared/package-files/9d/9d9be488296960e453642454f55909f76e4f2c2db1d4214c2b2b364896a61113/blob b/shared/package-files/9d/9d9be488296960e453642454f55909f76e4f2c2db1d4214c2b2b364896a61113/blob new file mode 100644 index 0000000000000000000000000000000000000000..0c27cd1c362657ab3db6eed3f2e3a1912ac60eb7 Binary files /dev/null and b/shared/package-files/9d/9d9be488296960e453642454f55909f76e4f2c2db1d4214c2b2b364896a61113/blob differ diff --git a/shared/package-files/9d/9d9c174f4def27bebd1989e860c1f95d1736c98d8d0ec6f75f6e1cc2cc50a127/blob b/shared/package-files/9d/9d9c174f4def27bebd1989e860c1f95d1736c98d8d0ec6f75f6e1cc2cc50a127/blob new file mode 100644 index 0000000000000000000000000000000000000000..d6f4ca9a6b77d7f5f9178fa3e05f842ee324edf2 --- /dev/null +++ b/shared/package-files/9d/9d9c174f4def27bebd1989e860c1f95d1736c98d8d0ec6f75f6e1cc2cc50a127/blob @@ -0,0 +1,782 @@ +from __future__ import annotations + +import dataclasses +import itertools +import sympy +from sympy.logic.boolalg import BooleanAtom, Boolean as SympyBoolean +import operator +import math +import logging +import torch +from typing import Dict, Optional, SupportsFloat, TypeVar, Generic, Union, overload, Callable, TYPE_CHECKING +from typing_extensions import TypeGuard + +from torch._prims_common import dtype_to_type +from .interp import sympy_interp +from .functions import Round, RoundDecimal + +log = logging.getLogger(__name__) + +__all__ = ["ValueRanges", "ValueRangeAnalysis", "bound_sympy"] + +_T = TypeVar('_T', sympy.Expr, SympyBoolean) + +class ValueRangeError(RuntimeError): + pass + + +# Like sympify, but supports less stuff, and also ensures that direct +# sympy expressions don't have free variables +def simple_sympify(e): + if isinstance(e, bool): + return sympy.true if e else sympy.false + elif isinstance(e, int): + return sympy.Integer(e) + elif isinstance(e, float): + # infinity is special; we use it to bracket integers as well + if math.isinf(e): + return sympy.oo if e > 0 else -sympy.oo + return sympy.Float(e) + elif isinstance(e, sympy.Expr): + assert e.is_number, e + # NaNs can occur when doing things like 0 * sympy.oo, but it is better + # if the operator notices this and takes care of it, because sometimes + # the NaN is inappropriate (for example, for ints, the [-oo, oo] range + # should go to zero when multiplied with [0, 0]) + assert e != sympy.nan + return e + elif isinstance(e, BooleanAtom): + return e + else: + raise AssertionError(f"not simple sympy type {type(e)}: {e}") + + +# Sympy atomics only. Unlike <=, it also works on Sympy bools. +def sympy_generic_le(lower, upper): + if isinstance(lower, sympy.Expr): + assert isinstance(upper, sympy.Expr) + return lower <= upper + else: + # only negative condition is True > False + assert isinstance(lower, SympyBoolean) and isinstance(upper, SympyBoolean) + return not (lower and not upper) + + +def vr_is_bool(vr: ValueRanges[_T]) -> TypeGuard[ValueRanges[SympyBoolean]]: + return vr.is_bool + + +def vr_is_expr(vr: ValueRanges[_T]) -> TypeGuard[ValueRanges[sympy.Expr]]: + return not vr.is_bool + + +ExprIn = Union[int, float, sympy.Expr] +BoolIn = Union[bool, SympyBoolean] +AllIn = Union[ExprIn, BoolIn] +ExprFn = Callable[[sympy.Expr], sympy.Expr] +ExprFn2 = Callable[[sympy.Expr, sympy.Expr], sympy.Expr] +BoolFn = Callable[[SympyBoolean], SympyBoolean] +BoolFn2 = Callable[[SympyBoolean, SympyBoolean], SympyBoolean] +AllFn = Union[ExprFn, BoolFn] +AllFn2 = Union[ExprFn2, BoolFn2] + + +@dataclasses.dataclass(frozen=True) +class ValueRanges(Generic[_T]): + if TYPE_CHECKING: + # ruff doesn't understand circular references but mypy does + ExprVR = ValueRanges[sympy.Expr] # noqa: F821 + BoolVR = ValueRanges[SympyBoolean] # noqa: F821 + AllVR = Union[ExprVR, BoolVR] + + # Although the type signature here suggests you can pass any + # sympy expression, in practice the analysis here only works + # with constant sympy expressions + lower: _T + upper: _T + is_bool: bool + + @overload + def __init__(self: ValueRanges[sympy.Expr], lower: ExprIn, upper: ExprIn) -> None: + ... + + @overload + def __init__(self: ValueRanges[SympyBoolean], lower: BoolIn, upper: BoolIn) -> None: + ... + + def __init__(self, lower: AllIn, upper: AllIn) -> None: + lower = simple_sympify(lower) + upper = simple_sympify(upper) + # TODO: when the bounds have free variables, this may be + # nontrivial to actually verify + if not sympy_generic_le(lower, upper): + raise ValueRangeError(f"Invalid ranges [{lower}:{upper}]") + # Because this is a frozen class + object.__setattr__(self, "lower", lower) + object.__setattr__(self, "upper", upper) + object.__setattr__(self, "is_bool", isinstance(lower, SympyBoolean)) + assert isinstance(upper, SympyBoolean) == self.is_bool + + def boolify(self) -> ValueRanges[SympyBoolean]: + if vr_is_bool(self): + return self + elif self == ValueRanges.unknown(): + return ValueRanges.unknown_bool() + else: + raise AssertionError(f"not bool like {self}") + + def __contains__(self, x: AllIn) -> bool: + x = simple_sympify(x) + return sympy_generic_le(self.lower, x) and sympy_generic_le(x, self.upper) + + def issubset(self, other): + return sympy_generic_le(other.lower, self.lower) and sympy_generic_le(self.upper, other.upper) + + def tighten(self, other) -> ValueRanges: + """Given two ValueRanges, returns their intersection""" + return self & other + + # Intersection + @overload + def __and__(self: ValueRanges[sympy.Expr], other: ValueRanges[sympy.Expr]) -> ValueRanges[sympy.Expr]: + ... + + @overload + def __and__(self: ValueRanges[SympyBoolean], other: ValueRanges[SympyBoolean]) -> ValueRanges[SympyBoolean]: + ... + + def __and__(self: AllVR, other: AllVR) -> AllVR: + if other == ValueRanges.unknown(): + return self + if self == ValueRanges.unknown(): + return other + assert self.is_bool == other.is_bool, (self, other) + if self.is_bool: + return ValueRanges(sympy.Or(self.lower, other.lower), sympy.And(self.upper, other.upper)) + else: + return ValueRanges(sympy.Max(self.lower, other.lower), sympy.Min(self.upper, other.upper)) + + # Union + @overload + def __or__(self: ValueRanges[sympy.Expr], other: ValueRanges[sympy.Expr]) -> ValueRanges[sympy.Expr]: + ... + + @overload + def __or__(self: ValueRanges[SympyBoolean], other: ValueRanges[SympyBoolean]) -> ValueRanges[SympyBoolean]: + ... + + def __or__(self: AllVR, other: AllVR) -> AllVR: + if ValueRanges.unknown() in (self, other): + return ValueRanges.unknown() + assert self.is_bool == other.is_bool, (self, other) + if self.is_bool: + return ValueRanges(sympy.And(self.lower, other.lower), sympy.Or(self.upper, other.upper)) + else: + return ValueRanges(sympy.Min(self.lower, other.lower), sympy.Max(self.upper, other.upper)) + + def is_singleton(self) -> bool: + return self.lower == self.upper + + # TODO: this doesn't work with bools but arguably it should + @staticmethod + def unknown() -> ValueRanges[sympy.Expr]: + return ValueRanges(-sympy.oo, sympy.oo) + + @staticmethod + def unknown_bool() -> ValueRanges[SympyBoolean]: + return ValueRanges(sympy.false, sympy.true) + + @overload + @staticmethod + # work around the fact that bool and int overlap + def wrap(arg: Union[ExprIn, ExprVR]) -> ExprVR: # type: ignore[overload-overlap] + ... + + @overload + @staticmethod + def wrap(arg: Union[BoolIn, BoolVR]) -> BoolVR: + ... + + @staticmethod + def wrap(arg: Union[AllIn, AllVR]) -> AllVR: + if isinstance(arg, ValueRanges): + return arg + # arg is either ExprIn or BoolIn, but we don't know it here + return ValueRanges(arg, arg) # type: ignore[arg-type] + + @staticmethod + def increasing_map(x: Union[ExprIn, ExprVR], fn: ExprFn) -> ExprVR: + """Increasing: x <= y => f(x) <= f(y).""" + x = ValueRanges.wrap(x) + return ValueRanges(fn(x.lower), fn(x.upper)) + + @overload + @staticmethod + def decreasing_map(x: Union[ExprIn, ExprVR], fn: ExprFn) -> ExprVR: + ... + + @overload + @staticmethod + def decreasing_map(x: Union[BoolIn, BoolVR], fn: BoolFn) -> BoolVR: + ... + + @staticmethod + def decreasing_map(x: Union[AllIn, AllVR], fn: AllFn) -> AllVR: + """Decreasing: x <= y => f(x) >= f(y).""" + x = ValueRanges.wrap(x) + # consistently either Expr or Bool, but we don't know it here + return ValueRanges(fn(x.upper), fn(x.lower)) # type: ignore[arg-type] + + @staticmethod + def monotone_map(x: Union[ExprIn, ExprVR], fn: ExprFn) -> ExprVR: + """It's increasing or decreasing.""" + x = ValueRanges.wrap(x) + l = fn(x.lower) + u = fn(x.upper) + return ValueRanges(min(l, u), max(l, u)) + + @staticmethod + def convex_min_zero_map(x: Union[ExprIn, ExprVR], fn: ExprFn) -> ExprVR: + """Fn is convex and has a minimum at 0.""" + x = ValueRanges.wrap(x) + if 0 in x: + return ValueRanges(0, max(fn(x.lower), fn(x.upper))) + else: + return ValueRanges.monotone_map(x, fn) + + @overload + @staticmethod + def coordinatewise_increasing_map(x: Union[ExprIn, ExprVR], y: Union[ExprIn, ExprVR], fn: ExprFn2) -> ExprVR: + ... + + @overload + @staticmethod + def coordinatewise_increasing_map(x: Union[BoolIn, BoolVR], y: Union[BoolIn, BoolVR], fn: BoolFn2) -> BoolVR: + ... + + @staticmethod + def coordinatewise_increasing_map(x: Union[AllIn, AllVR], y: Union[AllIn, AllVR], fn: AllFn2) -> AllVR: + """ + It's increasing on each coordinate. + + Mathematically: + For every 1 <= i <= n and x_i <= y_i we have that + f(x1, .., xn) <= f(x1, , yi, ..., xn) + """ + x, y = ValueRanges.wrap(x), ValueRanges.wrap(y) + return ValueRanges( + fn(x.lower, y.lower), # type: ignore[arg-type] + fn(x.upper, y.upper), # type: ignore[arg-type] + ) + + @classmethod + def coordinatewise_monotone_map(cls, x, y, fn): + """It's increasing or decreasing on each coordinate.""" + x, y = cls.wrap(x), cls.wrap(y) + products = [ + fn(a, b) + for a, b in itertools.product([x.lower, x.upper], [y.lower, y.upper]) + ] + return ValueRanges(min(products), max(products)) + +class SymPyValueRangeAnalysis: + """ + It gives bounds on a SymPy operator given bounds on its arguments + See the function `bound_sympy` for a function that applies this logic to a full SymPy expression + """ + + @staticmethod + def constant(value, dtype): + # NB: value is NOT a sympy expression, it's a constant! + is_python = isinstance(value, (int, float, bool)) + assert is_python or isinstance(value, (BooleanAtom, sympy.Integer, sympy.Number)) + + # using nan makes subsequent computation throw, and for the purposes of optimization + # returning -math.inf - math.inf is equivalent to giving up + if isinstance(value, SupportsFloat) and math.isnan(value): + return ValueRanges.unknown() + + if is_python: + type_ = dtype_to_type(dtype) + value = type_(value) + else: + # We do a type check on a best-effort basis + # We don't want to force a cast to sympy.Float if the value is Rational to avoid losing precision + if dtype == torch.bool: + assert isinstance(value, BooleanAtom) + elif dtype.is_floating_point: + assert not value.is_finite or value.is_real + else: + # dtype is intXX + assert value.is_integer + + return ValueRanges.wrap(value) + + @staticmethod + def not_(a): + a = ValueRanges.wrap(a) + a = a.boolify() + assert a.is_bool + return ValueRanges.decreasing_map(a, sympy.Not) + + @staticmethod + def or_(a, b): + return ValueRanges.coordinatewise_increasing_map(a, b, sympy.Or) + + @staticmethod + def and_(a, b): + return ValueRanges.coordinatewise_increasing_map(a, b, sympy.And) + + @staticmethod + def eq(a, b): + a = ValueRanges.wrap(a) + b = ValueRanges.wrap(b) + if a.is_singleton() and b.is_singleton() and a.lower == b.lower: + return ValueRanges.wrap(sympy.true) + elif a.lower > b.upper or b.lower > a.upper: # ranges disjoint + return ValueRanges.wrap(sympy.false) + return ValueRanges(sympy.false, sympy.true) + + @classmethod + def ne(cls, a, b): + return cls.not_(cls.eq(a, b)) + + @classmethod + def lt(cls, a, b): + a = ValueRanges.wrap(a) + b = ValueRanges.wrap(b) + assert a.is_bool == b.is_bool + if a.is_bool: + return cls.and_(cls.not_(a), b) + else: + if a.upper < b.lower: + return ValueRanges.wrap(sympy.true) + elif a.lower >= b.upper: + return ValueRanges.wrap(sympy.false) + return ValueRanges(sympy.false, sympy.true) + + @classmethod + def gt(cls, a, b): + return cls.lt(b, a) + + @classmethod + def le(cls, a, b): + return cls.not_(cls.gt(a, b)) + + @classmethod + def ge(cls, a, b): + return cls.not_(cls.lt(a, b)) + + @staticmethod + def add(a, b): + return ValueRanges.coordinatewise_increasing_map(a, b, operator.add) + + @classmethod + def mul(cls, a, b): + a = ValueRanges.wrap(a) + b = ValueRanges.wrap(b) + + assert a.is_bool == b.is_bool + if a.is_bool: + return cls.and_(a, b) + + def safe_mul(a, b): + # Make unknown() * wrap(0) == wrap(0) + if a == 0: + return a + elif b == 0: + return b + else: + return a * b + + return ValueRanges.coordinatewise_monotone_map(a, b, safe_mul) + + @classmethod + def div(cls, a, b): + return cls.truediv(a, b) + + @staticmethod + def truediv(a, b): + a = ValueRanges.wrap(a) + b = ValueRanges.wrap(b) + if 0 in b or ((-sympy.oo in a or sympy.oo in a) and (-sympy.oo in b or sympy.oo in b)): + return ValueRanges.unknown() + else: + return ValueRanges.coordinatewise_monotone_map(a, b, operator.truediv) + + @staticmethod + def floordiv(a, b): + a = ValueRanges.wrap(a) + b = ValueRanges.wrap(b) + if 0 in b or ((-sympy.oo in a or sympy.oo in a) and (-sympy.oo in b or sympy.oo in b)): + return ValueRanges.unknown() + else: + return ValueRanges.coordinatewise_monotone_map(a, b, operator.floordiv) + + @staticmethod + def mod(x, y): + x = ValueRanges.wrap(x) + y = ValueRanges.wrap(y) + if x.is_singleton() and y.is_singleton() and y.lower != 0: + return ValueRanges.wrap(x.lower % y.lower) + if y.lower <= 0: + return ValueRanges.unknown() + return ValueRanges(0, y.upper) + + @classmethod + def modular_indexing(cls, a, b, c): + return cls.mod(cls.floordiv(a, b), c) + + @classmethod + def is_non_overlapping_and_dense_indicator(cls, *args): + return ValueRanges.unknown() + + @classmethod + def pow(cls, a, b): + def is_integer(val): + return isinstance(val, int) or ( + hasattr(val, "is_integer") and val.is_integer + ) + + a = ValueRanges.wrap(a) + b = ValueRanges.wrap(b) + # Not implemented yet. It's a bit tricky + # If you want to implement it, compute the partial derivatives of a ** b + # and check the ranges where the function is increasing / decreasing + # Another non-tight way of doing this is defaulting to doing noting that for a > 0, a ** b == exp(b * log(a)) + # If this second option is implemented, by carefult about the types and possible infinities here and there. + if not b.is_singleton(): + return ValueRanges.unknown() + + b = b.lower + if a.is_singleton(): + a = a.lower + r = a ** b + if not r.is_finite: + return ValueRanges.unknown() + return ValueRanges.wrap(r) + + if b == 0: + if not a.lower.is_finite: + return ValueRanges.unknown() + type_ = sympy.Float if a.lower.is_real else sympy.Integer + return ValueRanges.wrap(type_(1)) + + if b < 0: + a = cls.reciprocal(a) + b = -b + + if a == ValueRanges.unknown(): + return ValueRanges.unknown() + + # Here b > 0 + if not is_integer(b): + # If the base is positive, then we're good, otherwise nothing's defined + if a.lower >= 0: + return ValueRanges.increasing_map(a, lambda x: x ** b) + else: + return ValueRanges.unknown() + else: + # b > 0 integer + if b % 2 == 0: + # x^n where n is even + return ValueRanges.convex_min_zero_map(a, lambda x: x ** b) + else: + # x^n where n is odd + return ValueRanges.increasing_map(a, lambda x: x ** b) + + @staticmethod + def reciprocal(x): + """ Needed as it's used in pow, but it won't appear on a SymPy expression """ + x = ValueRanges.wrap(x) + if 0 in x: + return ValueRanges.unknown() + else: + return ValueRanges.decreasing_map(x, lambda y: 1 / y) + + @staticmethod + def abs(x): + return ValueRanges.convex_min_zero_map(x, abs) + + @staticmethod + def exp(x): + return ValueRanges.increasing_map(x, sympy.functions.elementary.exponential.exp) + + @staticmethod + def log(x): + x = ValueRanges.wrap(x) + if x.lower <= 0: + return ValueRanges.unknown() + return ValueRanges.increasing_map(x, sympy.log) + + @classmethod + def minimum(cls, a, b): + return cls.min_or_max(a, b, sympy.Min) + + @classmethod + def maximum(cls, a, b): + return cls.min_or_max(a, b, sympy.Max) + + @staticmethod + def min_or_max(a, b, fn): + a = ValueRanges.wrap(a) + b = ValueRanges.wrap(b) + + # Performs upcasting first + def fn_(x: sympy.Expr, y: sympy.Expr) -> sympy.Expr: + # Poorman's version of upcasting in Sympy + # Inf is not a float... + if x.is_Integer and y.is_Integer: + result_type = sympy.Integer + elif x.is_rational and y.is_rational: + result_type = sympy.Rational + else: + assert x.is_real or not x.is_finite or y.is_real or not y.is_finite + result_type = sympy.Float + return fn(result_type(x), result_type(y)) + + return ValueRanges.coordinatewise_increasing_map(a, b, fn_) + + @classmethod + def floor(cls, x): + return ValueRanges.increasing_map(x, sympy.functions.elementary.integers.floor) + + @classmethod + def ceil(cls, x): + return ValueRanges.increasing_map(x, sympy.functions.elementary.integers.ceiling) + + @classmethod + def round(cls, number, ndigits=None): + if ndigits is None: + fn = Round + else: + assert ndigits.is_singleton() + ndigits = ndigits.lower + # We can't use functools.partial here since sympy doesn't support keyword arguments, but we have to bind + # the second parameter. + fn = lambda number: RoundDecimal(number, ndigits) # type: ignore[misc, assignment] # noqa: E731 + + return ValueRanges.increasing_map(number, fn) + + # It's used in some models on symints + @staticmethod + def sqrt(x): + x = ValueRanges.wrap(x) + if x.lower < 0: + return ValueRanges.unknown() + return ValueRanges.increasing_map(x, sympy.sqrt) + + @staticmethod + def where(a, b, c): + b = ValueRanges.wrap(b) + c = ValueRanges.wrap(c) + a = a.boolify() + assert b.is_bool == c.is_bool + if b.is_bool: + return ValueRanges(sympy.And(b.lower, c.lower), sympy.Or(b.upper, c.upper)) + else: + return ValueRanges(sympy.Min(b.lower, c.lower), sympy.Max(b.upper, c.upper)) + + # expr_cond_pair is used to represent a single (expr, condition) pair in piecewise. + # We just return the value range of the expression and its corresponding condition as a tuple + # and defer the analysis to piecewise + @staticmethod + def expr_cond_pair(a, b): + b = b.boolify() + return (a, b) + + # piecewise function can be used to convert a SymBool to SymInt: + # int_expr = Piecewise((1, bool_expr), (0, True)), it evalutes to 1 when sym_bool is True and 0 otherwise. + # + # ranges is a sequence of (expr_range, condition_range) pairs. The range pair is constructed in expr_cond_pair. + # The ValueRange of Piecewise is just the union of all expr ranges whose condition expr can be True. + @staticmethod + def piecewise(*ranges): + init_range = None + for expr_range, cond_range in ranges: + if sympy.true in cond_range: + if init_range is None: + init_range = expr_range + else: + init_range = init_range | expr_range + return init_range + + @staticmethod + def cos(x): + # TODO: We should tighten value ranges + # If input range span is pi + 2*pi*k, then output range is (-1, 1) + # otherwise the minimum of the value of the function on the extremes + return ValueRanges(-1.0, 1.0) + + @staticmethod + def cosh(x): + x = ValueRanges.wrap(x) + if x.lower > 0: + return ValueRanges.increasing_map(x, sympy.cosh) + elif x.upper < 0: + return ValueRanges.decreasing_map(x, sympy.cosh) + return ValueRanges(0.0, sympy.oo) + + @staticmethod + def sin(x): + # TODO: We should tighten value ranges + # See details on cos + return ValueRanges(-1.0, 1.0) + + @staticmethod + def sinh(x): + return ValueRanges.increasing_map(x, sympy.sinh) + + @staticmethod + def tan(x): + return ValueRanges(-sympy.oo, sympy.oo) + + @staticmethod + def tanh(x): + return ValueRanges.increasing_map(x, sympy.tanh) + + @staticmethod + def asin(x): + x = ValueRanges.wrap(x) + if -1 <= x.lower and x.upper <= 1: + return ValueRanges.increasing_map(x, sympy.asin) + return ValueRanges.unknown() + + @staticmethod + def acos(x): + x = ValueRanges.wrap(x) + if -1 <= x.lower and x.upper <= 1: + return ValueRanges.decreasing_map(x, sympy.acos) + return ValueRanges.unknown() + + @staticmethod + def atan(x): + return ValueRanges.increasing_map(x, sympy.atan) + + +class ValueRangeAnalysis(SymPyValueRangeAnalysis): + def __init__(self): + self.name = "ValueRangeAnalysis" + boolean_operators = ( + "xor", + "logical_and", + "logical_or", + "logical_not", + ) + for op in boolean_operators: + setattr(self, op, self.bool_handler) + + @staticmethod + def bool_handler(*args, **kwargs): + # just assuming bools can have both values + return ValueRanges(sympy.false, sympy.true) # type: ignore[arg-type] + + @staticmethod + def default_handler(*args, **kwargs): + # many ops are unlikely to show up in optimizable indexing compute, + # so we dont have full coverage + return ValueRanges.unknown() + + def load(self, name: str, index: sympy.Expr): + return ValueRanges.unknown() + + def store(self, name, index, value, mode=None): + return + + def reduction(self, name, dtype, src_dtype, reduction_type, index, value): + return ValueRanges.unknown() + + def index_expr(self, index, dtype): + assert isinstance(index, ValueRanges) + return index + + @staticmethod + def to_dtype(x, dtype: torch.dtype, src_dtype: Optional[torch.dtype] = None): + x = ValueRanges.wrap(x) + + if dtype == torch.bool: + if x.is_singleton(): + return ValueRanges.wrap(x.lower != 0) + elif 0 not in x: + return ValueRanges.wrap(sympy.true) + else: + return ValueRanges(sympy.false, sympy.true) + + def cast(x, dtype): + # dtype is int or float + if dtype.is_floating_point: + return sympy.Float(x) + else: + try: + return sympy.Integer(x) + except TypeError: + # inf cannot be cast to Integer + return x + + if x.is_bool: + if x.is_singleton(): + val = 1 if x.lower else 0 + return ValueRanges.wrap(cast(val, dtype)) + else: + return ValueRanges(cast(0, dtype), cast(1, dtype)) + else: + # int to float or float to int + return ValueRanges(cast(x.lower, dtype), cast(x.upper, dtype)) + + @staticmethod + def square(x): + return ValueRanges.convex_min_zero_map(x, lambda y: y * y) + + @staticmethod + def neg(x): + return ValueRanges.decreasing_map(x, operator.neg) + + @classmethod + def truncdiv(cls, a, b): + x = cls.truediv(a, b) + if x == ValueRanges.unknown(): + return x + + def trunc(x): + return sympy.Integer(x) if x.is_finite else x + + return ValueRanges.increasing_map(x, trunc) + + @classmethod + def sub(cls, a, b): + return cls.add(a, cls.neg(b)) + + def __getattr__(self, name): + log.debug("unhandled ValueRange op %s", name) + return self.default_handler + + +def bound_sympy(expr: sympy.Expr, ranges: Optional[Dict[sympy.Symbol, ValueRanges]] = None) -> ValueRanges: + if isinstance(expr, sympy.Number): + return ValueRanges.wrap(expr) + + ranges = ranges or {} + + # If there's a tracing context, augment available constrained ranges. + context = torch._guards.TracingContext.try_get() + if context and context.fake_mode.shape_env: + ranges = {**context.fake_mode.shape_env.var_to_range, **ranges} + + unbounded_vars = expr.free_symbols - ranges.keys() + if unbounded_vars: + # Give some bounds to the free variables via their SymPy assumptions + # TODO A better way of doing this would be to assign them a range upon creation, as + # size variables can come with a lower bound of 2, as we specialise on 0 and 1 + unbounded_ranges: Dict[sympy.Symbol, ValueRanges] = {} + for s in unbounded_vars: + assert s.is_integer # type: ignore[attr-defined] + if s.is_positive: # type: ignore[attr-defined] + lower = 1 + elif s.is_nonnegative: # type: ignore[attr-defined] + lower = 0 + else: + lower = -math.inf # type: ignore[assignment] + unbounded_ranges[s] = ValueRanges(lower, math.inf) # type: ignore[index] + ranges = {**ranges, **unbounded_ranges} + + return sympy_interp(SymPyValueRangeAnalysis, ranges, expr) diff --git a/shared/package-files/9d/9d9d5bc228abc0e89adbf99e6bd82c2a644d03fe8405fe65acbbdb4d83bd16c8/blob b/shared/package-files/9d/9d9d5bc228abc0e89adbf99e6bd82c2a644d03fe8405fe65acbbdb4d83bd16c8/blob new file mode 100644 index 0000000000000000000000000000000000000000..0978fea93dcddcfe080c5a0f552ae92bb4547976 --- /dev/null +++ b/shared/package-files/9d/9d9d5bc228abc0e89adbf99e6bd82c2a644d03fe8405fe65acbbdb4d83bd16c8/blob @@ -0,0 +1,43 @@ +% +% BDS test for IID time series +% +% Calculates and outputs BDS test statistics and p-values for several +% datasets. +% +% Requires bds function, from Kanzler. +% +% References +% ---------- +% +% Kanzler, Ludwig. 1998. +% BDS: MATLAB Module to Calculate Brock, Dechert & Scheinkman Test for +% Independence. +% Statistical Software Components. Boston College Department of Economics. +% http://ideas.repec.org/c/boc/bocode/t871803.html. +% +% + +in = csvread('bds_data.csv'); + +sequence = in(1:25,1); +normal = in(1:25,2); +combined = in(1:50,3); +gdpc1 = in(1:end,4); + +[w_s, sig_s, c_s, c1_s, k_s] = bds(sequence, 5); +[w_n, sig_n, c_n, c1_n, k_n] = bds(normal, 5); +[w_c, sig_c, c_c, c1_c, k_c] = bds(combined, 5); +[w_g, sig_g, c_g, c1_g, k_g] = bds(gdpc1, 5); + +out_s = [repmat(1,1,5); 1:5; ... + NaN w_s; NaN sig_s; NaN c_s; c1_s; repmat(k_s,1,5)]'; +out_n = [repmat(2,1,5); 1:5; ... + NaN w_n; NaN sig_n; NaN c_n; c1_n; repmat(k_n,1,5)]'; +out_c = [repmat(3,1,5); 1:5; ... + NaN w_c; NaN sig_c; NaN c_c; c1_c; repmat(k_c,1,5)]'; +out_g = [repmat(4,1,5); 1:5; ... + NaN w_g; NaN sig_g; NaN c_g; c1_g; repmat(k_g,1,5)]'; + +out = [out_s; out_n; out_c; out_g]; + +dlmwrite('bds_results.csv', out, 'precision', '%.8f'); diff --git a/shared/package-files/9d/9d9d8bcf30e8bfdb4cacd254d8ab78ad4161673de79c08701b2b97b2a62607de/blob b/shared/package-files/9d/9d9d8bcf30e8bfdb4cacd254d8ab78ad4161673de79c08701b2b97b2a62607de/blob new file mode 100644 index 0000000000000000000000000000000000000000..a1a432e2b3d811f6447ff0d4d8a585aa2c942bdb --- /dev/null +++ b/shared/package-files/9d/9d9d8bcf30e8bfdb4cacd254d8ab78ad4161673de79c08701b2b97b2a62607de/blob @@ -0,0 +1,912 @@ +# Generates C++ autograd functions for the derivatives of ATen operations +# +# This writes two files: +# Functions.h/cpp: subclasses of autograd::Node +# python_functions.h/cpp: Python bindings for the above classes +# +from typing import Dict, List, Sequence, Tuple + +from torchgen.api.autograd import ( + Derivative, + DifferentiabilityInfo, + SavedAttribute, + uses_retain_variables, + uses_single_grad, +) +from torchgen.api.types import ( + ArrayRefCType, + BaseCppType, + BaseCType, + Binding, + boolT, + doubleT, + intArrayRefT, + iTensorListRefT, + ListCType, + longT, + MutRefCType, + OptionalCType, + optionalIntArrayRefT, + optionalSymIntArrayRefT, + scalarT, + stringT, + symIntArrayRefT, + SymIntT, + TENSOR_LIST_LIKE_CTYPES, + tensorListT, + tensorT, + VectorCType, +) +from torchgen.code_template import CodeTemplate +from torchgen.model import Argument, FunctionSchema +from torchgen.utils import FileManager + +from .gen_inplace_or_view_type import VIEW_FUNCTIONS + +FUNCTION_DECLARATION = CodeTemplate( + """\ +#ifdef _WIN32 +struct ${op} : public ${superclass} { + TORCH_API ${op}() = default; +#else +struct TORCH_API ${op} : public ${superclass} { +#endif + using ${superclass}::${superclass}; + variable_list apply(variable_list&& grads) override; + std::string name() const override { return "${op}"; } + void release_variables() override { + ${thread_lock} + ${release_variables} + } + ${will_release_variables} + void compiled_args(CompiledNodeArgs& args) override; + variable_list apply_with_saved(const variable_list& inputs, SwapSavedVariables& saved) override; + ${saved_variables} + ${saved_list_sizes} +}; +""" +) + +WILL_RELEASE_VARIABLES = CodeTemplate( + """\ +bool retain_variables = true; +void will_release_variables() override { + retain_variables = false; +} +""" +) + +FUNCTION_DEFINITION = CodeTemplate( + """\ +variable_list ${op}::apply(variable_list&& grads) { + ${thread_lock} + ${asserts} + IndexRangeGenerator gen; + ${compute_index_ranges} + variable_list grad_inputs(gen.size()); + ${body} + return grad_inputs; +} +void ${op}::compiled_args(CompiledNodeArgs& args) { + ${compiled_args} +} +variable_list ${op}::apply_with_saved(const variable_list& grads, SwapSavedVariables& saved) { + ${apply_with_saved_before} + variable_list result = apply(variable_list(grads)); + ${apply_with_saved_after} + return result; +} +""" +) + +GRAD_INPUT_MASK = CodeTemplate( + """\ + auto grad_input_mask = std::array{ + ${masks} + };\ +""" +) + +DERIVATIVE_SINGLE = CodeTemplate( + """\ +if (task_should_compute_output({ ${name}_ix })) { + auto grad_result = ${derivative}; + copy_range(grad_inputs, ${name}_ix, grad_result); +} +""" +) + +# note(crcrpar): `self` argument and other optional positional argument +# of foreach functions are basically a list of n `Tensor`s thus iterating over +# `grads` in order to utilize and apply the existing derivative definitions +# to each `Tensor`(s) of `self`, and the others. +DERIVATIVE_SINGLE_FOREACH = CodeTemplate( + """\ +if (task_should_compute_output({ ${name}_ix })) { + std::vector grad_result; + grad_result.reserve(grads.size()); + for (const auto & i : c10::irange(grads.size())) { + if (grads[i].defined()) { + grad_result.emplace_back(${derivative}); + } else { + grad_result.emplace_back(Tensor()); + } + } + copy_range(grad_inputs, ${name}_ix, grad_result); +} +""" +) + +DERIVATIVE_MULTI_COPY_RANGE = CodeTemplate( + """\ + if (task_should_compute_output({ ${name}_ix })) { + copy_range(grad_inputs, ${name}_ix, std::get<${i}>(grad_result)); + } +""" +) + +DERIVATIVE_MULTI = CodeTemplate( + """\ +if (task_should_compute_output({ ${idx_ranges} })) { + ${grad_input_mask} + auto grad_result = ${derivative}; + ${copy_ranges} +} +""" +) + +# Generates python bindings +# +# This generates the definitions for: +# (1) The PyTypeObject for each backward grad_fn subclassing Node +# (2) The entry for PyTypeObject's tp_getset slot (an array of PyGetSetDef structs) +# We generate one PyGetSetDef struct for each of grad_fn's saved inputs and outputs +# Each PyGetSetDef has a function ptr to a getter, also defined here (3). +# (3) Getters for each of grad_fn's saved inputs and outputs. +# +PY_FUNCTION_DEFINITION = CodeTemplate( + """\ +static PyTypeObject ${op}Class; +addClass<${op}>(module, ${op}Class, "${op}", ${op}_properties); +""" +) + +PY_FUNCTION_PROPS_AND_GETTERS = CodeTemplate( + """\ +${all_getter_definitions} + +static struct PyGetSetDef ${op}_properties[] = { + THP_FUNCTION_DEFAULT_PROPERTIES, + ${all_getsetdef_structs} + {nullptr} /* sentinel */ +}; + +""" +) + +PY_GETSETDEF_STRUCT = CodeTemplate( + """\ +{(char*)"_saved_${name}", (getter)THP${op}_${name}_getter, nullptr, nullptr, nullptr}""" +) + +PY_RAW_GETSETDEF_STRUCT = CodeTemplate( + """\ +{(char*)"_raw_saved_${name}", (getter)THP${op}_${name}_raw_getter, nullptr, nullptr, nullptr}""" +) + +# Getter templates +GETTER_DEFINITION = CodeTemplate( + """\ +PyObject* THP${op}_${name}_getter(THPCppFunction *self, void *_unused) { + HANDLE_TH_ERRORS + auto prop = static_cast<${op}*>(self->cdata.get())->${name}; + ${body} + END_HANDLE_TH_ERRORS +} +""" +) + +GETTER_DEFINITION_SAVEDVAR = CodeTemplate( + """\ +PyObject* THP${op}_${name}_getter(THPCppFunction *self, void *_unused) { + HANDLE_TH_ERRORS + const auto& prop = static_cast<${op}*>(self->cdata.get())->${name}_; + ${body} + END_HANDLE_TH_ERRORS +} +""" +) + +GETTER_DEFINITION_RAW_SAVEDVAR = CodeTemplate( + """\ +PyObject* THP${op}_${name}_raw_getter(THPCppFunction *self, void *_unused) { + HANDLE_TH_ERRORS + const auto& prop = static_cast<${op}*>(self->cdata.get())->${name}_; + ${body} + END_HANDLE_TH_ERRORS +} +""" +) + +GETTER_DEFINITION_VEC_SAVEDVAR = CodeTemplate( + """\ +PyObject* THP${op}_${name}_getter(THPCppFunction *self, void *_unused) { + HANDLE_TH_ERRORS + const auto *node = static_cast<${op}*>(self->cdata.get()); + const auto& prop = node->${name}_; + if (node->${name}_released_) { + PyErr_SetString(PyExc_RuntimeError, ERR_BACKWARD_TWICE); + return nullptr; + } + ${body} + END_HANDLE_TH_ERRORS +} +""" +) + +GETTER_DEFINITION_RAW_VEC_SAVEDVAR = CodeTemplate( + """\ +PyObject* THP${op}_${name}_raw_getter(THPCppFunction *self, void *_unused) { + HANDLE_TH_ERRORS + const auto *node = static_cast<${op}*>(self->cdata.get()); + const auto& prop = node->${name}_; + if (node->${name}_released_) { + PyErr_SetString(PyExc_RuntimeError, ERR_BACKWARD_TWICE); + return nullptr; + } + ${body} + END_HANDLE_TH_ERRORS +} +""" +) + +GETTER_DEFINITION_OPT = CodeTemplate( + """\ +PyObject* THP${op}_${name}_getter(THPCppFunction *self, void *_unused) { + HANDLE_TH_ERRORS + auto opt_prop = static_cast<${op}*>(self->cdata.get())->${name}; + if (!opt_prop.has_value()) { + Py_RETURN_NONE; + } + auto prop = opt_prop.value(); + ${body} + END_HANDLE_TH_ERRORS +} +""" +) + +GETTER_DEFINITION_OPT_ARRAYREF = CodeTemplate( + """\ +PyObject* THP${op}_${name}_getter(THPCppFunction *self, void *_unused) { + HANDLE_TH_ERRORS + auto opt_prop = static_cast<${op}*>(self->cdata.get())->${name}; + if (!opt_prop.list.has_value()) { + Py_RETURN_NONE; + } + auto prop = opt_prop.list.value(); + ${body} + END_HANDLE_TH_ERRORS +} +""" +) + +# Getter body +GETTER_BODY_SAVEDVAR = """\ +return THPVariable_Wrap(prop.unpack(self->cdata)); +""" + +GETTER_BODY_RAW_SAVEDVAR = """\ +pybind11::object obj = pybind11::cast(prop, pybind11::return_value_policy::reference); +return obj.release().ptr(); +""" + +GETTER_BODY_VEC_SAVEDVAR = """\ +PyObject* tup = PyTuple_New((Py_ssize_t) prop.size()); +for (auto i: c10::irange(prop.size())) { + PyTuple_SetItem(tup, (Py_ssize_t) i, THPVariable_Wrap(prop[i].unpack(self->cdata))); +} +return tup; +""" + +GETTER_BODY_RAW_VEC_SAVEDVAR = """\ +PyObject* tup = PyTuple_New((Py_ssize_t) prop.size()); +for (auto i : c10::irange(prop.size())) { + pybind11::object obj = pybind11::cast(prop[i], pybind11::return_value_policy::reference); + PyTuple_SetItem(tup, (Py_ssize_t) i, obj.release().ptr()); +} +return tup; +""" + +GETTER_BODY_ARRAYREF_LONG = """\ +PyObject* tup = PyTuple_New((Py_ssize_t) prop.size()); +for (auto i : c10::irange(prop.size())) { + PyTuple_SetItem(tup, (Py_ssize_t) i, PyLong_FromUnsignedLong((uint64_t) prop[i])); +} +return tup; +""" + +GETTER_BODY_ARRAYREF_SYMINT = """\ +PyObject* tup = PyTuple_New((Py_ssize_t) prop.size()); +for (auto i : c10::irange(prop.size())) { + auto si = prop[i]; + if (auto m = si.maybe_as_int()) { + PyTuple_SetItem(tup, (Py_ssize_t) i, PyLong_FromUnsignedLong(*m)); + } else { + auto py_symint = py::cast(si).release().ptr(); + PyTuple_SetItem(tup, (Py_ssize_t) i, py_symint); + } +} +return tup; +""" + +GETTER_BODY_ARRAYREF_DOUBLE = """\ +PyObject* tup = PyTuple_New((Py_ssize_t) prop.size()); +for (auto i : c10::irange(prop.size())) { + PyTuple_SetItem(tup, (Py_ssize_t) i, PyFloat_FromDouble((double) prop[i])); +} +return tup; +""" + +GETTER_BODY_INT64_T = """\ +return PyLong_FromUnsignedLong((int64_t) prop); +""" + +GETTER_BODY_SYMINT = """\ +if (auto m = prop.maybe_as_int()) { + return PyLong_FromUnsignedLong(*m); +} else { + return py::cast(prop).release().ptr(); +} +""" + +GETTER_BODY_DOUBLE = """\ +return PyFloat_FromDouble((double) prop); +""" + +GETTER_BODY_BOOL = """\ +if (prop) { + Py_RETURN_TRUE; +} else { + Py_RETURN_FALSE; +} +""" + +GETTER_BODY_STRING = """\ +return PyUnicode_FromStringAndSize(prop.data(), prop.size()); +""" + +GETTER_BODY_SCALAR = """\ +if (prop.isComplex()) { + auto cprop = prop.to>(); + return PyComplex_FromDoubles(cprop.real(), cprop.imag()); +} else if (prop.isFloatingPoint()) { + return PyFloat_FromDouble(prop.to()); +} else if (prop.isIntegral(/*includeBool=*/false)) { + return PyLong_FromLong(prop.to()); +} else if (prop.isBoolean()) { + if (prop.to()) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } +} else { + PyErr_SetString(PyExc_RuntimeError, "Unknown scalar type"); + return nullptr; +} +""" + + +GETTER_BODY_VEC_SCALAR = """\ +PyObject* tup = PyTuple_New((Py_ssize_t) prop.size()); +for (auto i: c10::irange(prop.size())) { + if (prop[i].isComplex()) { + auto cprop = prop[i].to>(); + PyTuple_SetItem(tup, (Py_ssize_t) i, PyComplex_FromDoubles(cprop.real(), cprop.imag())); + } else if (prop[i].isFloatingPoint()) { + auto double_prop = prop[i].to(); + PyTuple_SetItem(tup, (Py_ssize_t) i, PyFloat_FromDouble(double_prop)); + } else if (prop[i].isIntegral(/*includeBool=*/false)) { + auto long_prop = prop[i].to(); + PyTuple_SetItem(tup, (Py_ssize_t) i, PyLong_FromLong(long_prop)); + } else if (prop[i].isBoolean()) { + if (prop[i].to()) { + PyTuple_SetItem(tup, (Py_ssize_t) i, Py_True); + } else { + PyTuple_SetItem(tup, (Py_ssize_t) i, Py_False); + } + } else { + PyErr_SetString(PyExc_RuntimeError, "Unknown scalar type"); + return nullptr; + } +} +return tup; +""" + + +MISC_GETTER_DEFS = { + OptionalCType(BaseCType(longT)): (GETTER_DEFINITION_OPT, GETTER_BODY_INT64_T), + OptionalCType(BaseCType(SymIntT)): (GETTER_DEFINITION_OPT, GETTER_BODY_SYMINT), + BaseCType(doubleT): (GETTER_DEFINITION, GETTER_BODY_DOUBLE), + OptionalCType(BaseCType(doubleT)): (GETTER_DEFINITION_OPT, GETTER_BODY_DOUBLE), + BaseCType(boolT): (GETTER_DEFINITION, GETTER_BODY_BOOL), + BaseCType(scalarT): (GETTER_DEFINITION, GETTER_BODY_SCALAR), + OptionalCType(BaseCType(scalarT)): (GETTER_DEFINITION_OPT, GETTER_BODY_SCALAR), +} + +# These functions have backwards which cannot be traced, and so must have +# their backward functions traced opaquely. +# VIEW_FUNCTIONS are not traceable because they use as_strided, which +# has an untraceable backwards, see +# https://github.com/pytorch/pytorch/issues/4250 +# TODO: This is probably not exhaustive, but it's a start +UNTRACEABLE_FUNCTIONS = VIEW_FUNCTIONS + + +def get_infos_with_derivatives_list( + differentiability_infos: Dict[FunctionSchema, Dict[str, DifferentiabilityInfo]] +) -> List[DifferentiabilityInfo]: + diff_info_list = [ + info + for diffinfo_dict in differentiability_infos.values() + for info in diffinfo_dict.values() + ] + + return list(filter(lambda info: info.args_with_derivatives, diff_info_list)) + + +def gen_autograd_functions_lib( + out: str, + differentiability_infos: Dict[FunctionSchema, Dict[str, DifferentiabilityInfo]], + template_path: str, +) -> None: + """Functions.h and Functions.cpp body + + These contain the auto-generated subclasses of torch::autograd::Node + for each every differentiable torch function. + """ + + # get a 1D list of diffinfos, we do not need them to be per FunctionSchema/DispatchKey here + # infos with the diff dispatchkeys but the same name will still be in the same shard. + infos = get_infos_with_derivatives_list(differentiability_infos) + declarations = [process_function(f, FUNCTION_DECLARATION) for f in infos] + definitions = [process_function(f, FUNCTION_DEFINITION) for f in infos] + + file_basename = "Functions" + fm = FileManager(install_dir=out, template_dir=template_path, dry_run=False) + for suffix in [".h", ".cpp"]: + fname = file_basename + suffix + fm.write_with_template( + fname, + fname, + lambda: { + "generated_comment": "@" + + f"generated from {fm.template_dir_for_comments()}/" + + fname, + "autograd_function_declarations": declarations, + "autograd_function_definitions": definitions, + }, + ) + + +def gen_autograd_functions_python( + out: str, + differentiability_infos: Dict[FunctionSchema, Dict[str, DifferentiabilityInfo]], + template_path: str, +) -> None: + fm = FileManager(install_dir=out, template_dir=template_path, dry_run=False) + num_shards = 5 + fm.write( + "python_functions.h", + lambda: { + "generated_comment": "@" + + f"generated from {fm.template_dir_for_comments()}/python_functions.h", + "shard_forward_declare": [ + f"void initialize_autogenerated_functions_{i}(PyObject* module);" + for i in range(num_shards) + ], + "shard_call": [ + f"initialize_autogenerated_functions_{i}(module);" + for i in range(num_shards) + ], + }, + ) + + # get a 1D list of diffinfos, we do not need them to be per FunctionSchema/DispatchKey here + # infos with the diff dispatchkeys but the same name will still be in the same shard. + infos = get_infos_with_derivatives_list(differentiability_infos) + fm.write_sharded( + "python_functions.cpp", + infos, + key_fn=lambda info: info.name, + base_env={ + "generated_comment": "@" + + f"generated from {fm.template_dir_for_comments()}/python_functions.cpp", + }, + env_callable=lambda info: { + "py_function_initializers": [ + process_function(info, PY_FUNCTION_DEFINITION) + ], + "py_function_props_and_getters": [ + process_function(info, PY_FUNCTION_PROPS_AND_GETTERS) + ], + }, + num_shards=num_shards, + sharded_keys={"py_function_initializers", "py_function_props_and_getters"}, + ) + + +def process_function(info: DifferentiabilityInfo, template: CodeTemplate) -> str: + saved_variables: List[str] = [] + release_variables: List[str] = [] + saved_list_sizes: List[str] = [] + unpack: List[str] = [] + asserts: List[str] = [] + compute_index_ranges: List[str] = [] + getter_definitions: List[str] = [] + py_getsetdef_structs: List[str] = [] + compiled_args: List[str] = [] + apply_with_saved_before: List[str] = [] + apply_with_saved_after: List[str] = [] + + for arg in info.args_with_derivatives: + if arg.type in TENSOR_LIST_LIKE_CTYPES: + size = f"{arg.name}_size_" + saved_list_sizes.append(f"size_t {arg.name}_size_;") + else: + size = "1" + compute_index_ranges.append(f"auto {arg.name}_ix = gen.range({size});") + + def save_var(var: SavedAttribute, is_output: bool) -> None: + name = var.nctype.name + type = var.nctype.type + should_append_getsetdef = True + should_append_raw_getsetdef = False + visit_name = name + + if ( + type == BaseCType(tensorT) + or type == OptionalCType(BaseCType(tensorT)) + or type == MutRefCType(OptionalCType(BaseCType(tensorT))) + or (type == BaseCType(scalarT) and is_output) + ): + saved_variables.append(f"SavedVariable {name}_;") + release_variables.append(f"{name}_.reset_data();") + ptr = "shared_from_this()" if is_output else "" + unpack.append(f"auto {name} = {name}_.unpack({ptr});") + getter_definitions.append( + GETTER_DEFINITION_SAVEDVAR.substitute( + op=info.op, name=name, body=GETTER_BODY_SAVEDVAR + ) + ) + getter_definitions.append( + GETTER_DEFINITION_RAW_SAVEDVAR.substitute( + op=info.op, name=name, body=GETTER_BODY_RAW_SAVEDVAR + ) + ) + should_append_raw_getsetdef = True + visit_name = f"{name}_" + elif ( + type == BaseCType(tensorListT) + or type == BaseCType(iTensorListRefT) + or type == VectorCType(BaseCType(tensorT)) + ): + # note(crcrpar): [nuanced return type of out-of-place foreach functions] + # When an out-of-place foreach function whose return signature is `Tensor[]` + # spells out its backward definitions in `derivatives.yaml`, and some of them depend on + # `result`, `result`'s type is interpreted and treated as `std::vector`. + # An out-of-place foreach whose backwards rely on their output doesn't suffer from this + # difference if the definitions are codegen'ed. + # This special case is needed for `_foreach_pow.List` and `_foreach_pow.ScalarAndTensor` + # as of https://github.com/pytorch/pytorch/pull/105504. + if type == VectorCType(BaseCType(tensorT)): + assert ( + info.func.func.name.name.base.startswith("_foreach") and is_output + ) + saved_variables.append(f"std::vector {name}_;") + saved_variables.append(f"bool {name}_released_ = false;") + # Just clear() is sufficient, we don't need to loop and clear each variable. + # Because the SavedVariable owns a tensor and a grad_fn, removing the SavedVariable makes them go away as well. + release_variables.append(f"{name}_.clear();") + release_variables.append(f"{name}_released_ = true;") + ptr = "shared_from_this()" if is_output else "nullptr" + unpack.append(f"auto {name} = unpack_list({name}_, {ptr});") + asserts.append(f"TORCH_CHECK(!{name}_released_, ERR_BACKWARD_TWICE);") + getter_definitions.append( + GETTER_DEFINITION_VEC_SAVEDVAR.substitute( + op=info.op, name=name, body=GETTER_BODY_VEC_SAVEDVAR + ) + ) + getter_definitions.append( + GETTER_DEFINITION_RAW_VEC_SAVEDVAR.substitute( + op=info.op, name=name, body=GETTER_BODY_RAW_VEC_SAVEDVAR + ) + ) + should_append_raw_getsetdef = True + visit_name = f"{name}_" + elif type == ListCType(OptionalCType(BaseCType(tensorT))): + saved_variables.append(f"std::vector {name}_;") + saved_variables.append(f"bool {name}_released_ = false;") + # Just clear() is sufficient, we don't need to loop and clear each variable. + # Because the SavedVariable owns a tensor and a grad_fn, removing the SavedVariable makes them go away as well. + release_variables.append(f"{name}_.clear();") + release_variables.append(f"{name}_released_ = true;") + unpack.append(f"auto {name} = unpack_opt_list({name}_);") + asserts.append(f"TORCH_CHECK(!{name}_released_, ERR_BACKWARD_TWICE);") + getter_definitions.append( + GETTER_DEFINITION_VEC_SAVEDVAR.substitute( + op=info.op, name=name, body=GETTER_BODY_VEC_SAVEDVAR + ) + ) + getter_definitions.append( + GETTER_DEFINITION_RAW_VEC_SAVEDVAR.substitute( + op=info.op, name=name, body=GETTER_BODY_RAW_VEC_SAVEDVAR + ) + ) + should_append_raw_getsetdef = True + visit_name = f"{name}_" + elif type == BaseCType(intArrayRefT): + saved_variables.append(f"std::vector {name};") + getter_definitions.append( + GETTER_DEFINITION.substitute( + op=info.op, name=name, body=GETTER_BODY_ARRAYREF_LONG + ) + ) + elif type == BaseCType(symIntArrayRefT): + saved_variables.append(f"std::vector {name};") + getter_definitions.append( + GETTER_DEFINITION.substitute( + op=info.op, name=name, body=GETTER_BODY_ARRAYREF_SYMINT + ) + ) + elif type == BaseCType(optionalIntArrayRefT): + saved_variables.append(f"c10::OptionalArray {name};") + getter_definitions.append( + GETTER_DEFINITION_OPT_ARRAYREF.substitute( + op=info.op, name=name, body=GETTER_BODY_ARRAYREF_LONG + ) + ) + elif type == BaseCType(optionalSymIntArrayRefT): + saved_variables.append(f"c10::OptionalArray {name};") + getter_definitions.append( + GETTER_DEFINITION_OPT_ARRAYREF.substitute( + op=info.op, name=name, body=GETTER_BODY_ARRAYREF_SYMINT + ) + ) + elif type == OptionalCType(BaseCType(intArrayRefT)): + saved_variables.append(f"c10::OptionalArray {name};") + getter_definitions.append( + GETTER_DEFINITION_OPT_ARRAYREF.substitute( + op=info.op, name=name, body=GETTER_BODY_ARRAYREF_LONG + ) + ) + elif type == OptionalCType(BaseCType(symIntArrayRefT)): + saved_variables.append(f"c10::OptionalArray {name};") + getter_definitions.append( + GETTER_DEFINITION_OPT_ARRAYREF.substitute( + op=info.op, name=name, body=GETTER_BODY_ARRAYREF_SYMINT + ) + ) + elif type == OptionalCType(ArrayRefCType(BaseCType(doubleT))): + saved_variables.append(f"c10::OptionalArray {name};") + getter_definitions.append( + GETTER_DEFINITION_OPT_ARRAYREF.substitute( + op=info.op, name=name, body=GETTER_BODY_ARRAYREF_DOUBLE + ) + ) + elif type == BaseCType(longT): + saved_variables.append(f"{type.cpp_type()} {name} = 0;") + getter_definitions.append( + GETTER_DEFINITION.substitute( + op=info.op, name=name, body=GETTER_BODY_INT64_T + ) + ) + elif type == BaseCType(SymIntT): + saved_variables.append(f"c10::SymInt {name};") + getter_definitions.append( + GETTER_DEFINITION.substitute( + op=info.op, name=name, body=GETTER_BODY_SYMINT + ) + ) + elif type == BaseCType(stringT): + saved_variables.append(f"std::string {name};") + getter_definitions.append( + GETTER_DEFINITION.substitute( + op=info.op, name=name, body=GETTER_BODY_STRING + ) + ) + elif type == OptionalCType(BaseCType(stringT)): + saved_variables.append(f"c10::optional {name};") + getter_definitions.append( + GETTER_DEFINITION_OPT.substitute( + op=info.op, name=name, body=GETTER_BODY_STRING + ) + ) + elif type == ArrayRefCType( + elem=BaseCType(type=BaseCppType(ns="at", name="Scalar")) + ): + saved_variables.append(f"std::vector {name};") + saved_variables.append(f"bool {name}_released_ = false;") + # Just clear() is sufficient, we don't need to loop and clear each variable. + # Because the SavedVariable owns a tensor and a grad_fn, removing the SavedVariable makes them go away as well. + release_variables.append(f"{name}.clear();") + # release_variables.append(f"{name}_released_ = true;") + # unpack.append(f"auto {name} = unpack_list({name}_);") + # asserts.append(f"TORCH_CHECK(!{name}_released_, ERR_BACKWARD_TWICE);") + getter_definitions.append( + CodeTemplate( + """\ +PyObject* THP${op}_${name}_getter(THPCppFunction *self, void *_unused) { + HANDLE_TH_ERRORS + const auto *node = static_cast<${op}*>(self->cdata.get()); + const auto& prop = node->${name}; + if (node->${name}_released_) { + PyErr_SetString(PyExc_RuntimeError, ERR_BACKWARD_TWICE); + return nullptr; + } + ${body} + END_HANDLE_TH_ERRORS +} + """ + ).substitute( + op=info.op, + name=name, + body=GETTER_BODY_VEC_SCALAR, + ) + ) + else: + # Check for indicators that you're putting a non-owning reference + # into the saved variable field. If this is spuriously firing, + # edit this field. Otherwise, you probably need to add a case + # above. + assert ( + "ref" not in type.cpp_type().lower() + and "view" not in type.cpp_type().lower() + and "*" not in type.cpp_type() + and "&" not in type.cpp_type() + ), f"{type.cpp_type()} looks like it contains a non-owning reference" + saved_variables.append(f"{type.cpp_type()} {name};") + + if type in MISC_GETTER_DEFS: + getter_def, body = MISC_GETTER_DEFS[type] + getter_definitions.append( + getter_def.substitute(op=info.op, name=name, body=body) + ) + else: + # Types we don't expose python bindings to yet: + # TypeAndSize, at::ScalarType, TensorOptions, TensorGeometry, + # std::vector>, std::vector + should_append_getsetdef = False + + if should_append_getsetdef: + py_getsetdef_structs.append( + PY_GETSETDEF_STRUCT.substitute(op=info.op, name=name) + ) + if should_append_raw_getsetdef: + py_getsetdef_structs.append( + PY_RAW_GETSETDEF_STRUCT.substitute(op=info.op, name=name) + ) + + compiled_args.append(f"args.collect({visit_name});") + apply_with_saved_before.append(f"saved.before({visit_name});") + apply_with_saved_after.append(f"saved.after({visit_name});") + + for var in sorted(info.all_saved_inputs, key=lambda sa: str(sa.nctype.name)): + save_var(var, is_output=False) + for var in sorted(info.all_saved_outputs, key=lambda sa: str(sa.nctype.name)): + save_var(var, is_output=True) + + # lock the mutex when we release variables and in Node::apply to protect thread safety + # see Note [Thread Safety on Autograd Node] + if len(release_variables) > 0: + thread_lock = "std::lock_guard lock(mutex_);" + else: + thread_lock = "" + + if uses_retain_variables(info): + will_release_variables = WILL_RELEASE_VARIABLES.substitute() + else: + will_release_variables = "" + + body: List[str] = [] + + if uses_single_grad(info): + body.append("const auto& grad = grads[0];") + else: + # Generate aliases for gradients named for returned values. + body.extend( + f"const auto& {name} = grads[{info.available_named_gradients.index(name)}];" + for name in sorted(info.used_named_gradients) + ) + + def emit_derivative( + derivative: Derivative, + args_with_derivatives: Sequence[Binding], + ) -> Tuple[bool, str]: + formula = derivative.formula + var_names = derivative.var_names + if len(var_names) == 1: + checks_any_grad_defined = False + if "not_implemented" not in formula: + matching_args = [ + arg for arg in args_with_derivatives if arg.name == var_names[0] + ] + if len(matching_args) == 1: + # We can add undefined grad support if the input variable is a Tensor + arg = matching_args[0] + if isinstance(arg.argument, Argument) and str( + arg.argument.type + ) in ("Tensor", "Tensor?"): + formula = "any_grad_defined ? (" + formula + ") : Tensor()" + checks_any_grad_defined = True + if info.name.startswith("_foreach_"): + derivative_template = DERIVATIVE_SINGLE_FOREACH + else: + derivative_template = DERIVATIVE_SINGLE + return ( + checks_any_grad_defined, + derivative_template.substitute(name=var_names[0], derivative=formula), + ) + else: + if "grad_input_mask" in formula: + masks = [ + f"task_should_compute_output({{ {n}_ix }})," for n in var_names + ] + grad_input_mask = GRAD_INPUT_MASK.substitute( + masks=masks, n=len(var_names) + ) + else: + grad_input_mask = "" + idx_ranges = ", ".join(f"{n}_ix" for n in var_names) + copy_ranges: List[str] = [] + for i, n in enumerate(var_names): + copy_ranges.append(DERIVATIVE_MULTI_COPY_RANGE.substitute(name=n, i=i)) + return False, DERIVATIVE_MULTI.substitute( + idx_ranges=idx_ranges, + copy_ranges=copy_ranges, + derivative=formula, + grad_input_mask=grad_input_mask, + ) + + body.extend(unpack) + need_any_grad_defined_var = False + for derivative in info.derivatives: + checks_any_grad_defined, derivative_text = emit_derivative( + derivative, info.args_with_derivatives + ) + body.append(derivative_text) + need_any_grad_defined_var |= checks_any_grad_defined + # Since single-output derivative formulas need to check if grads are + # defined, only perform the check once, before all the formulas + if need_any_grad_defined_var: + body.insert( + -len(info.derivatives), + "bool any_grad_defined = any_variable_defined(grads);", + ) + + if info.name in UNTRACEABLE_FUNCTIONS: + superclass = "Node" + else: + superclass = "TraceableFunction" + + all_getsetdef_structs = ( + ",\n".join(py_getsetdef_structs) + "," if len(py_getsetdef_structs) != 0 else "" + ) + all_getter_definitions = "\n".join(getter_definitions) + + return template.substitute( + op=info.op, + compute_index_ranges=compute_index_ranges, + saved_variables=saved_variables, + release_variables=release_variables, + saved_list_sizes=saved_list_sizes, + asserts=asserts, + thread_lock=thread_lock, + will_release_variables=will_release_variables, + body=body, + superclass=superclass, + all_getter_definitions=all_getter_definitions, + all_getsetdef_structs=all_getsetdef_structs, + compiled_args=compiled_args, + apply_with_saved_before=apply_with_saved_before, + apply_with_saved_after=apply_with_saved_after, + ) diff --git a/shared/package-files/9d/9d9dd2b4a8be434abf1e6770a73644704ed6405715b67076f1006f61efcedb6d/blob b/shared/package-files/9d/9d9dd2b4a8be434abf1e6770a73644704ed6405715b67076f1006f61efcedb6d/blob new file mode 100644 index 0000000000000000000000000000000000000000..eb928ea714ca2f4ec5440f3374a2a687881c3a3b --- /dev/null +++ b/shared/package-files/9d/9d9dd2b4a8be434abf1e6770a73644704ed6405715b67076f1006f61efcedb6d/blob @@ -0,0 +1,167 @@ +""" +Functions and wrapper object to call assumption property and predicate +query with same syntax. + +In SymPy, there are two assumption systems. Old assumption system is +defined in sympy/core/assumptions, and it can be accessed by attribute +such as ``x.is_even``. New assumption system is defined in +sympy/assumptions, and it can be accessed by predicates such as +``Q.even(x)``. + +Old assumption is fast, while new assumptions can freely take local facts. +In general, old assumption is used in evaluation method and new assumption +is used in refinement method. + +In most cases, both evaluation and refinement follow the same process, and +the only difference is which assumption system is used. This module provides +``is_[...]()`` functions and ``AssumptionsWrapper()`` class which allows +using two systems with same syntax so that parallel code implementation can be +avoided. + +Examples +======== + +For multiple use, use ``AssumptionsWrapper()``. + +>>> from sympy import Q, Symbol +>>> from sympy.assumptions.wrapper import AssumptionsWrapper +>>> x = Symbol('x') +>>> _x = AssumptionsWrapper(x, Q.even(x)) +>>> _x.is_integer +True +>>> _x.is_odd +False + +For single use, use ``is_[...]()`` functions. + +>>> from sympy.assumptions.wrapper import is_infinite +>>> a = Symbol('a') +>>> print(is_infinite(a)) +None +>>> is_infinite(a, Q.finite(a)) +False + +""" + +from sympy.assumptions import ask, Q +from sympy.core.basic import Basic +from sympy.core.sympify import _sympify + + +def make_eval_method(fact): + def getit(self): + try: + pred = getattr(Q, fact) + ret = ask(pred(self.expr), self.assumptions) + return ret + except AttributeError: + return None + return getit + + +# we subclass Basic to use the fact deduction and caching +class AssumptionsWrapper(Basic): + """ + Wrapper over ``Basic`` instances to call predicate query by + ``.is_[...]`` property + + Parameters + ========== + + expr : Basic + + assumptions : Boolean, optional + + Examples + ======== + + >>> from sympy import Q, Symbol + >>> from sympy.assumptions.wrapper import AssumptionsWrapper + >>> x = Symbol('x', even=True) + >>> AssumptionsWrapper(x).is_integer + True + >>> y = Symbol('y') + >>> AssumptionsWrapper(y, Q.even(y)).is_integer + True + + With ``AssumptionsWrapper``, both evaluation and refinement can be supported + by single implementation. + + >>> from sympy import Function + >>> class MyAbs(Function): + ... @classmethod + ... def eval(cls, x, assumptions=True): + ... _x = AssumptionsWrapper(x, assumptions) + ... if _x.is_nonnegative: + ... return x + ... if _x.is_negative: + ... return -x + ... def _eval_refine(self, assumptions): + ... return MyAbs.eval(self.args[0], assumptions) + >>> MyAbs(x) + MyAbs(x) + >>> MyAbs(x).refine(Q.positive(x)) + x + >>> MyAbs(Symbol('y', negative=True)) + -y + + """ + def __new__(cls, expr, assumptions=None): + if assumptions is None: + return expr + obj = super().__new__(cls, expr, _sympify(assumptions)) + obj.expr = expr + obj.assumptions = assumptions + return obj + + _eval_is_algebraic = make_eval_method("algebraic") + _eval_is_antihermitian = make_eval_method("antihermitian") + _eval_is_commutative = make_eval_method("commutative") + _eval_is_complex = make_eval_method("complex") + _eval_is_composite = make_eval_method("composite") + _eval_is_even = make_eval_method("even") + _eval_is_extended_negative = make_eval_method("extended_negative") + _eval_is_extended_nonnegative = make_eval_method("extended_nonnegative") + _eval_is_extended_nonpositive = make_eval_method("extended_nonpositive") + _eval_is_extended_nonzero = make_eval_method("extended_nonzero") + _eval_is_extended_positive = make_eval_method("extended_positive") + _eval_is_extended_real = make_eval_method("extended_real") + _eval_is_finite = make_eval_method("finite") + _eval_is_hermitian = make_eval_method("hermitian") + _eval_is_imaginary = make_eval_method("imaginary") + _eval_is_infinite = make_eval_method("infinite") + _eval_is_integer = make_eval_method("integer") + _eval_is_irrational = make_eval_method("irrational") + _eval_is_negative = make_eval_method("negative") + _eval_is_noninteger = make_eval_method("noninteger") + _eval_is_nonnegative = make_eval_method("nonnegative") + _eval_is_nonpositive = make_eval_method("nonpositive") + _eval_is_nonzero = make_eval_method("nonzero") + _eval_is_odd = make_eval_method("odd") + _eval_is_polar = make_eval_method("polar") + _eval_is_positive = make_eval_method("positive") + _eval_is_prime = make_eval_method("prime") + _eval_is_rational = make_eval_method("rational") + _eval_is_real = make_eval_method("real") + _eval_is_transcendental = make_eval_method("transcendental") + _eval_is_zero = make_eval_method("zero") + + +# one shot functions which are faster than AssumptionsWrapper + +def is_infinite(obj, assumptions=None): + if assumptions is None: + return obj.is_infinite + return ask(Q.infinite(obj), assumptions) + + +def is_extended_real(obj, assumptions=None): + if assumptions is None: + return obj.is_extended_real + return ask(Q.extended_real(obj), assumptions) + + +def is_extended_nonnegative(obj, assumptions=None): + if assumptions is None: + return obj.is_extended_nonnegative + return ask(Q.extended_nonnegative(obj), assumptions) diff --git a/shared/package-files/9d/9d9de29835ad7f543322613ec6cad81c4e24b8e6bcb44b9cf7d1e5d33005ab32/blob b/shared/package-files/9d/9d9de29835ad7f543322613ec6cad81c4e24b8e6bcb44b9cf7d1e5d33005ab32/blob new file mode 100644 index 0000000000000000000000000000000000000000..c3a7ccc4b33f27dbae7958641a89106cf9580326 --- /dev/null +++ b/shared/package-files/9d/9d9de29835ad7f543322613ec6cad81c4e24b8e6bcb44b9cf7d1e5d33005ab32/blob @@ -0,0 +1,27 @@ +""" +============================================================== +Finite Difference Differentiation (:mod:`scipy.differentiate`) +============================================================== + +.. currentmodule:: scipy.differentiate + +SciPy ``differentiate`` provides functions for performing finite difference +numerical differentiation of black-box functions. + +.. autosummary:: + :toctree: generated/ + + derivative + jacobian + hessian + +""" + + +from ._differentiate import * + +__all__ = ['derivative', 'jacobian', 'hessian'] + +from scipy._lib._testutils import PytestTester +test = PytestTester(__name__) +del PytestTester diff --git a/shared/package-files/9d/9d9f2fa04f442fa7e3c46878febfacf7bd98f35e1787551990ff058f0e25196a/blob b/shared/package-files/9d/9d9f2fa04f442fa7e3c46878febfacf7bd98f35e1787551990ff058f0e25196a/blob new file mode 100644 index 0000000000000000000000000000000000000000..e100d0d5761d93f07217a343d05e86852013ce38 --- /dev/null +++ b/shared/package-files/9d/9d9f2fa04f442fa7e3c46878febfacf7bd98f35e1787551990ff058f0e25196a/blob @@ -0,0 +1,306 @@ +from __future__ import annotations + +import operator +from functools import lru_cache, partial +from typing import TYPE_CHECKING, Any, Literal, cast, overload + +import ibis +import ibis.expr.datatypes as ibis_dtypes + +from narwhals._utils import Version, isinstance_or_issubclass + +if TYPE_CHECKING: + from collections.abc import Callable, Mapping + from typing import TypeAlias + + import ibis.expr.types as ir + from ibis.common.temporal import TimestampUnit + from ibis.expr.datatypes import DataType as IbisDataType + from typing_extensions import TypeIs + + from narwhals._duration import IntervalUnit + from narwhals._ibis.dataframe import IbisLazyFrame + from narwhals._ibis.expr import IbisExpr + from narwhals.dtypes import DType + from narwhals.typing import IntoDType, PythonLiteral + +IntoColumn: TypeAlias = "str | ir.Value | ir.Column" +SortFn: TypeAlias = "Callable[[IntoColumn], ir.Column]" +Incomplete: TypeAlias = Any +"""Marker for upstream issues.""" + + +@overload +def lit(value: bool, dtype: None = ...) -> ir.BooleanScalar: ... # noqa: FBT001 +@overload +def lit(value: int, dtype: None = ...) -> ir.IntegerScalar: ... +@overload +def lit(value: float, dtype: None = ...) -> ir.FloatingScalar: ... +@overload +def lit(value: str, dtype: None = ...) -> ir.StringScalar: ... +@overload +def lit(value: PythonLiteral | ir.Value, dtype: None = ...) -> ir.Scalar: ... +@overload +def lit(value: Any, dtype: Any) -> Incomplete: ... +def lit(value: Any, dtype: Any | None = None) -> Incomplete: + """Alias for `ibis.literal`.""" + literal: Incomplete = ibis.literal + return literal(value, dtype) + + +asc_nulls_first = cast("SortFn", partial(ibis.asc, nulls_first=True)) +asc_nulls_last = cast("SortFn", partial(ibis.asc, nulls_first=False)) +desc_nulls_first = cast("SortFn", partial(ibis.desc, nulls_first=True)) +desc_nulls_last = cast("SortFn", partial(ibis.desc, nulls_first=False)) + + +BucketUnit: TypeAlias = Literal[ + "years", + "quarters", + "months", + "days", + "hours", + "minutes", + "seconds", + "milliseconds", + "microseconds", + "nanoseconds", +] +TruncateUnit: TypeAlias = Literal[ + "Y", "Q", "M", "W", "D", "h", "m", "s", "ms", "us", "ns" +] + +UNITS_DICT_BUCKET: Mapping[IntervalUnit, BucketUnit] = { + "y": "years", + "q": "quarters", + "mo": "months", + "d": "days", + "h": "hours", + "m": "minutes", + "s": "seconds", + "ms": "milliseconds", + "us": "microseconds", + "ns": "nanoseconds", +} + +UNITS_DICT_TRUNCATE: Mapping[IntervalUnit, TruncateUnit] = { + "y": "Y", + "q": "Q", + "mo": "M", + "d": "D", + "h": "h", + "m": "m", + "s": "s", + "ms": "ms", + "us": "us", + "ns": "ns", +} + +FUNCTION_REMAPPING = { + "starts_with": "startswith", + "ends_with": "endswith", + "regexp_matches": "re_search", + "str_split": "split", + "dayofyear": "day_of_year", + "to_date": "date", + "bool_and": "all", + "bool_or": "any", + "isnotnull": "notnull", +} + + +def evaluate_exprs(df: IbisLazyFrame, /, *exprs: IbisExpr) -> list[tuple[str, ir.Value]]: + native_results: list[tuple[str, ir.Value]] = [] + for expr in exprs: + native_series_list = expr(df) + output_names = expr._evaluate_output_names(df) + if expr._alias_output_names is not None: + output_names = expr._alias_output_names(output_names) + if len(output_names) != len(native_series_list): # pragma: no cover + msg = f"Internal error: got output names {output_names}, but only got {len(native_series_list)} results" + raise AssertionError(msg) + native_results.extend(zip(output_names, native_series_list, strict=False)) + return native_results + + +@lru_cache(maxsize=16) +def native_to_narwhals_dtype(ibis_dtype: IbisDataType, version: Version) -> DType: # noqa: C901, PLR0912 + dtypes = version.dtypes + if ibis_dtype.is_int64(): + return dtypes.Int64() + if ibis_dtype.is_int32(): + return dtypes.Int32() + if ibis_dtype.is_int16(): + return dtypes.Int16() + if ibis_dtype.is_int8(): + return dtypes.Int8() + if ibis_dtype.is_uint64(): + return dtypes.UInt64() + if ibis_dtype.is_uint32(): + return dtypes.UInt32() + if ibis_dtype.is_uint16(): + return dtypes.UInt16() + if ibis_dtype.is_uint8(): + return dtypes.UInt8() + if ibis_dtype.is_boolean(): + return dtypes.Boolean() + if ibis_dtype.is_float64(): + return dtypes.Float64() + if ibis_dtype.is_float32(): + return dtypes.Float32() + if ibis_dtype.is_float16(): + return dtypes.Float16() + if ibis_dtype.is_string(): + return dtypes.String() + if ibis_dtype.is_date(): + return dtypes.Date() + if is_timestamp(ibis_dtype): + _unit = cast("TimestampUnit", ibis_dtype.unit) + return dtypes.Datetime(time_unit=_unit.value, time_zone=ibis_dtype.timezone) + if is_interval(ibis_dtype): + _time_unit = ibis_dtype.unit.value + if _time_unit not in {"ns", "us", "ms", "s"}: # pragma: no cover + msg = f"Unsupported interval unit: {_time_unit}" + raise NotImplementedError(msg) + return dtypes.Duration(_time_unit) + if is_array(ibis_dtype): + if ibis_dtype.length: + return dtypes.Array( + native_to_narwhals_dtype(ibis_dtype.value_type, version), + ibis_dtype.length, + ) + return dtypes.List(native_to_narwhals_dtype(ibis_dtype.value_type, version)) + if is_struct(ibis_dtype): + return dtypes.Struct( + [ + dtypes.Field(name, native_to_narwhals_dtype(dtype, version)) + for name, dtype in ibis_dtype.items() + ] + ) + if is_decimal(ibis_dtype): + # Same default as in ibis.Decimal.{to_polars, to_pyarrow} + # https://github.com/ibis-project/ibis/blob/5028d8e5e1921d5de48f59fad48b86c0de541b0d/ibis/formats/polars.py#L82-L86 + # https://github.com/ibis-project/ibis/blob/5028d8e5e1921d5de48f59fad48b86c0de541b0d/ibis/formats/pyarrow.py#L165-L177 + # According to their own comment: + # > set default precision and scale to something; unclear how to choose this + # source: (see https://github.com/ibis-project/ibis/blob/5028d8e5e1921d5de48f59fad48b86c0de541b0d/ibis/formats/pyarrow.py#L166) + scale = 9 if ibis_dtype.scale is None else ibis_dtype.scale + return dtypes.Decimal(precision=ibis_dtype.precision, scale=scale) + if ibis_dtype.is_time(): + return dtypes.Time() + if ibis_dtype.is_binary(): + return dtypes.Binary() + return dtypes.Unknown() # pragma: no cover + + +def is_timestamp(obj: IbisDataType) -> TypeIs[ibis_dtypes.Timestamp]: + return obj.is_timestamp() + + +def is_interval(obj: IbisDataType) -> TypeIs[ibis_dtypes.Interval]: + return obj.is_interval() + + +def is_array(obj: IbisDataType) -> TypeIs[ibis_dtypes.Array[Any]]: + return obj.is_array() + + +def is_struct(obj: IbisDataType) -> TypeIs[ibis_dtypes.Struct]: + return obj.is_struct() + + +def is_floating(obj: IbisDataType) -> TypeIs[ibis_dtypes.Floating]: + return obj.is_floating() + + +def is_decimal(obj: IbisDataType) -> TypeIs[ibis_dtypes.Decimal]: + return obj.is_decimal() + + +dtypes = Version.MAIN.dtypes +NW_TO_IBIS_DTYPES: Mapping[type[DType], IbisDataType] = { + dtypes.Float64: ibis_dtypes.Float64(), + dtypes.Float32: ibis_dtypes.Float32(), + dtypes.Float16: ibis_dtypes.Float16(), + dtypes.Binary: ibis_dtypes.Binary(), + dtypes.String: ibis_dtypes.String(), + dtypes.Boolean: ibis_dtypes.Boolean(), + dtypes.Date: ibis_dtypes.Date(), + dtypes.Time: ibis_dtypes.Time(), + dtypes.Int8: ibis_dtypes.Int8(), + dtypes.Int16: ibis_dtypes.Int16(), + dtypes.Int32: ibis_dtypes.Int32(), + dtypes.Int64: ibis_dtypes.Int64(), + dtypes.UInt8: ibis_dtypes.UInt8(), + dtypes.UInt16: ibis_dtypes.UInt16(), + dtypes.UInt32: ibis_dtypes.UInt32(), + dtypes.UInt64: ibis_dtypes.UInt64(), +} +# Enum support: https://github.com/ibis-project/ibis/issues/10991 +UNSUPPORTED_DTYPES = (dtypes.Int128, dtypes.UInt128, dtypes.Categorical, dtypes.Enum) + + +def narwhals_to_native_dtype(dtype: IntoDType, version: Version) -> IbisDataType: + dtypes = version.dtypes + base_type = dtype.base_type() + if ibis_type := NW_TO_IBIS_DTYPES.get(base_type): + return ibis_type + if isinstance_or_issubclass(dtype, dtypes.Datetime): + return ibis_dtypes.Timestamp.from_unit(dtype.time_unit, timezone=dtype.time_zone) + if isinstance_or_issubclass(dtype, dtypes.Duration): + return ibis_dtypes.Interval(unit=dtype.time_unit) # pyright: ignore[reportArgumentType] + if isinstance_or_issubclass(dtype, dtypes.List): + inner = narwhals_to_native_dtype(dtype.inner, version) + return ibis_dtypes.Array(value_type=inner) + if isinstance_or_issubclass(dtype, dtypes.Struct): + fields = [ + (field.name, narwhals_to_native_dtype(field.dtype, version)) + for field in dtype.fields + ] + return ibis_dtypes.Struct.from_tuples(fields) + if isinstance_or_issubclass(dtype, dtypes.Array): + inner = narwhals_to_native_dtype(dtype.inner, version) + return ibis_dtypes.Array(value_type=inner, length=dtype.size) + if isinstance_or_issubclass(dtype, dtypes.Decimal): + return ibis_dtypes.Decimal(dtype.precision, dtype.scale) + if issubclass(base_type, UNSUPPORTED_DTYPES): + msg = f"Converting to {base_type.__name__} dtype is not supported for Ibis." + raise NotImplementedError(msg) + msg = f"Unknown dtype: {dtype}" # pragma: no cover + raise AssertionError(msg) + + +_BINARY_OPS = { + "add": operator.add, + "subtract": operator.sub, + "multiply": operator.mul, + "divide": operator.truediv, + "floordiv": operator.floordiv, + "and": operator.and_, + "or": operator.or_, +} + + +def function(name: str, *args: ir.Value | PythonLiteral) -> ir.Value: + # Workaround SQL vs Ibis differences. + if name in _BINARY_OPS: + return _BINARY_OPS[name](*args) + if name == "row_number": + return ibis.row_number() + lit(1) + if name == "least": + return ibis.least(*args) + if name == "greatest": + return ibis.greatest(*args) + expr = args[0] + if name == "var_pop": + return cast("ir.NumericColumn", expr).var(how="pop") + if name == "var_samp": + return cast("ir.NumericColumn", expr).var(how="sample") + if name == "stddev_pop": + return cast("ir.NumericColumn", expr).std(how="pop") + if name == "stddev_samp": + return cast("ir.NumericColumn", expr).std(how="sample") + if name == "substr": + # Ibis is 0-indexed here, SQL is 1-indexed + return cast("ir.StringColumn", expr).substr(args[1] - 1, *args[2:]) # type: ignore[operator] # pyright: ignore[reportArgumentType] + return getattr(expr, FUNCTION_REMAPPING.get(name, name))(*args[1:]) diff --git a/shared/package-files/9d/9da09e9a6031d060ec416f639a6bf34989e6c88ce641d10621eb906ba1d8c293/blob b/shared/package-files/9d/9da09e9a6031d060ec416f639a6bf34989e6c88ce641d10621eb906ba1d8c293/blob new file mode 100644 index 0000000000000000000000000000000000000000..0e2c4395f1c234118fd039f2d0598f2ab41ea61b Binary files /dev/null and b/shared/package-files/9d/9da09e9a6031d060ec416f639a6bf34989e6c88ce641d10621eb906ba1d8c293/blob differ diff --git a/shared/package-files/9d/9da119d4ee9a77be7cd567ffb0c4c1334d925e44f9fd9275d66d57c777ebaf78/blob b/shared/package-files/9d/9da119d4ee9a77be7cd567ffb0c4c1334d925e44f9fd9275d66d57c777ebaf78/blob new file mode 100644 index 0000000000000000000000000000000000000000..45cb49b288a17afcba22c8d10a92356f3f592a1a --- /dev/null +++ b/shared/package-files/9d/9da119d4ee9a77be7cd567ffb0c4c1334d925e44f9fd9275d66d57c777ebaf78/blob @@ -0,0 +1,23 @@ +*** Thu, 28 Jul 2016 16:42:33 *** +FORECASTING +Reference: Lütkepohl (1993), IMTSA, 2ed, ch. 5.2.6, ch. 10.5 +CI coverage: 0.95 +forecast horizon: 5 periods +using standard confidence intervals + + Dp +time forecast lower CI upper CI +/- +1999 Q1 -0.0224 -0.0318 -0.0129 0.0094 +1999 Q2 -0.0039 -0.0136 0.0058 0.0097 +1999 Q3 0.0033 -0.0066 0.0132 0.0099 +1999 Q4 0.0244 0.0143 0.0345 0.0101 +2000 Q1 -0.0249 -0.0359 -0.0139 0.0110 + + R +time forecast lower CI upper CI +/- +1999 Q1 0.0396 0.0296 0.0496 0.0100 +1999 Q2 0.0408 0.0253 0.0562 0.0154 +1999 Q3 0.0402 0.0210 0.0594 0.0192 +1999 Q4 0.0388 0.0158 0.0619 0.0231 +2000 Q1 0.0400 0.0134 0.0666 0.0266 + diff --git a/shared/package-files/9d/9da41971dbf15548d3e7a47453afd8a6034281f98d13d5e3cf1f6e41eb25f828/blob b/shared/package-files/9d/9da41971dbf15548d3e7a47453afd8a6034281f98d13d5e3cf1f6e41eb25f828/blob new file mode 100644 index 0000000000000000000000000000000000000000..4f9b59c350036abba7599eee397a1a4cf6452e30 --- /dev/null +++ b/shared/package-files/9d/9da41971dbf15548d3e7a47453afd8a6034281f98d13d5e3cf1f6e41eb25f828/blob @@ -0,0 +1,42 @@ +""" + pygments.lexers.procfile + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexer for Procfile file format. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, bygroups +from pygments.token import Name, Number, String, Text, Punctuation + +__all__ = ["ProcfileLexer"] + + +class ProcfileLexer(RegexLexer): + """ + Lexer for Procfile file format. + + The format is used to run processes on Heroku or is used by Foreman or + Honcho tools. + + .. versionadded:: 2.10 + """ + name = 'Procfile' + url = 'https://devcenter.heroku.com/articles/procfile#procfile-format' + aliases = ['procfile'] + filenames = ['Procfile'] + + tokens = { + 'root': [ + (r'^([a-z]+)(:)', bygroups(Name.Label, Punctuation)), + (r'\s+', Text.Whitespace), + (r'"[^"]*"', String), + (r"'[^']*'", String), + (r'[0-9]+', Number.Integer), + (r'\$[a-zA-Z_][\w]*', Name.Variable), + (r'(\w+)(=)(\w+)', bygroups(Name.Variable, Punctuation, String)), + (r'([\w\-\./]+)', Text), + ], + } diff --git a/shared/package-files/9d/9da470b34f044db419bcb317809fb3b98216a900b1d97912f0678cc0f4552105/blob b/shared/package-files/9d/9da470b34f044db419bcb317809fb3b98216a900b1d97912f0678cc0f4552105/blob new file mode 100644 index 0000000000000000000000000000000000000000..5f3faacc9623e608f408463f210408b19c94290d --- /dev/null +++ b/shared/package-files/9d/9da470b34f044db419bcb317809fb3b98216a900b1d97912f0678cc0f4552105/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::amin(Tensor self, int[1] dim=[], bool keepdim=False) -> Tensor +inline at::Tensor amin(const at::Tensor & self, at::IntArrayRef dim={}, bool keepdim=false) { + return at::_ops::amin::call(self, dim, keepdim); +} + +// aten::amin.out(Tensor self, int[1] dim=[], bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & amin_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef dim={}, bool keepdim=false) { + return at::_ops::amin_out::call(self, dim, keepdim, out); +} +// aten::amin.out(Tensor self, int[1] dim=[], bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & amin_outf(const at::Tensor & self, at::IntArrayRef dim, bool keepdim, at::Tensor & out) { + return at::_ops::amin_out::call(self, dim, keepdim, out); +} + +} diff --git a/shared/package-files/9d/9da8a3764db121e29d21ade67c9c3426598e76d88deae44cd7238983af8cef73/blob b/shared/package-files/9d/9da8a3764db121e29d21ade67c9c3426598e76d88deae44cd7238983af8cef73/blob new file mode 100644 index 0000000000000000000000000000000000000000..e2de76d6c8f7b4ad3d14b0f7d01feb91b2a3d34d Binary files /dev/null and b/shared/package-files/9d/9da8a3764db121e29d21ade67c9c3426598e76d88deae44cd7238983af8cef73/blob differ diff --git a/shared/package-files/9d/9daa832cd9158824f01bbccaf05916cb941f548fa6bedefc3257fca7ca81fd02/blob b/shared/package-files/9d/9daa832cd9158824f01bbccaf05916cb941f548fa6bedefc3257fca7ca81fd02/blob new file mode 100644 index 0000000000000000000000000000000000000000..f6edab6d58e5c0950defc8ce01de8389fee6f560 --- /dev/null +++ b/shared/package-files/9d/9daa832cd9158824f01bbccaf05916cb941f548fa6bedefc3257fca7ca81fd02/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9daa832cd9158824f01bbccaf05916cb941f548fa6bedefc3257fca7ca81fd02 +size 9564184 diff --git a/shared/package-files/9d/9daa90e4644bd2955c4d70fefd7417d725ddd84a4493452ef6f3514dfa355f0b/blob b/shared/package-files/9d/9daa90e4644bd2955c4d70fefd7417d725ddd84a4493452ef6f3514dfa355f0b/blob new file mode 100644 index 0000000000000000000000000000000000000000..b408c4182254f97b7bf99d44489876dea1d8261d --- /dev/null +++ b/shared/package-files/9d/9daa90e4644bd2955c4d70fefd7417d725ddd84a4493452ef6f3514dfa355f0b/blob @@ -0,0 +1,25 @@ +import sys +from _typeshed import ReadableBuffer as ReadableBuffer +from typing import Any, Callable, Optional + +from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey +from paramiko.message import Message +from paramiko.transport import Transport + +if sys.version_info < (3, 0): + from hashlib import _hash as _Hash +else: + from hashlib import _Hash + +c_MSG_KEXECDH_INIT: bytes +c_MSG_KEXECDH_REPLY: bytes + +class KexCurve25519: + hash_algo: Callable[[ReadableBuffer], _Hash] + transport: Transport + key: Optional[X25519PrivateKey] + def __init__(self, transport: Transport) -> None: ... + @classmethod + def is_available(cls) -> bool: ... + def start_kex(self) -> None: ... + def parse_next(self, ptype: int, m: Message) -> None: ... diff --git a/shared/package-files/9d/9dab2593d9404bdfa834f3aa80751f262433fc5ee0b8952a52c7d52081ff3a8a/blob b/shared/package-files/9d/9dab2593d9404bdfa834f3aa80751f262433fc5ee0b8952a52c7d52081ff3a8a/blob new file mode 100644 index 0000000000000000000000000000000000000000..304fca88751c3f37ec431d37394b097bdb5fc5a8 --- /dev/null +++ b/shared/package-files/9d/9dab2593d9404bdfa834f3aa80751f262433fc5ee0b8952a52c7d52081ff3a8a/blob @@ -0,0 +1,31 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_sgn_out : public at::meta::structured_sgn { +void impl(const at::Tensor & self, const at::Tensor & out); +}; +TORCH_API at::Tensor NestedTensor_sgn(const at::Tensor & self); +TORCH_API at::Tensor & NestedTensor_sgn_(at::Tensor & self); +TORCH_API at::Tensor sgn_sparse(const at::Tensor & self); +TORCH_API at::Tensor & sgn_sparse_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & sgn_sparse_(at::Tensor & self); +TORCH_API at::Tensor sgn_sparse_csr(const at::Tensor & self); +TORCH_API at::Tensor & sgn_sparse_csr_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & sgn_sparse_csr_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9dac30f158d9781c1c3c1649af0dd04a9e0447d516c096d79e34bfc5093e1e34/blob b/shared/package-files/9d/9dac30f158d9781c1c3c1649af0dd04a9e0447d516c096d79e34bfc5093e1e34/blob new file mode 100644 index 0000000000000000000000000000000000000000..1487ae16e964103da6b5d79f46c31333b79415da --- /dev/null +++ b/shared/package-files/9d/9dac30f158d9781c1c3c1649af0dd04a9e0447d516c096d79e34bfc5093e1e34/blob @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::col2im.out(Tensor self, SymInt[2] output_size, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & col2im_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride) { + return at::_ops::col2im_out::call(self, c10::fromIntArrayRefSlow(output_size), kernel_size, dilation, padding, stride, out); +} +namespace symint { + template ::value>> + at::Tensor & col2im_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride) { + return at::_ops::col2im_out::call(self, c10::fromIntArrayRefSlow(output_size), kernel_size, dilation, padding, stride, out); + } +} + +// aten::col2im.out(Tensor self, SymInt[2] output_size, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & col2im_outf(const at::Tensor & self, at::IntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride, at::Tensor & out) { + return at::_ops::col2im_out::call(self, c10::fromIntArrayRefSlow(output_size), kernel_size, dilation, padding, stride, out); +} +namespace symint { + template ::value>> + at::Tensor & col2im_outf(const at::Tensor & self, at::IntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride, at::Tensor & out) { + return at::_ops::col2im_out::call(self, c10::fromIntArrayRefSlow(output_size), kernel_size, dilation, padding, stride, out); + } +} + +// aten::col2im.out(Tensor self, SymInt[2] output_size, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & col2im_symint_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride) { + return at::_ops::col2im_out::call(self, output_size, kernel_size, dilation, padding, stride, out); +} +namespace symint { + template ::value>> + at::Tensor & col2im_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride) { + return at::_ops::col2im_out::call(self, output_size, kernel_size, dilation, padding, stride, out); + } +} + +// aten::col2im.out(Tensor self, SymInt[2] output_size, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & col2im_symint_outf(const at::Tensor & self, c10::SymIntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride, at::Tensor & out) { + return at::_ops::col2im_out::call(self, output_size, kernel_size, dilation, padding, stride, out); +} +namespace symint { + template ::value>> + at::Tensor & col2im_outf(const at::Tensor & self, c10::SymIntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride, at::Tensor & out) { + return at::_ops::col2im_out::call(self, output_size, kernel_size, dilation, padding, stride, out); + } +} + +// aten::col2im(Tensor self, SymInt[2] output_size, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride) -> Tensor +inline at::Tensor col2im(const at::Tensor & self, at::IntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride) { + return at::_ops::col2im::call(self, c10::fromIntArrayRefSlow(output_size), kernel_size, dilation, padding, stride); +} +namespace symint { + template ::value>> + at::Tensor col2im(const at::Tensor & self, at::IntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride) { + return at::_ops::col2im::call(self, c10::fromIntArrayRefSlow(output_size), kernel_size, dilation, padding, stride); + } +} + +// aten::col2im(Tensor self, SymInt[2] output_size, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride) -> Tensor +inline at::Tensor col2im_symint(const at::Tensor & self, c10::SymIntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride) { + return at::_ops::col2im::call(self, output_size, kernel_size, dilation, padding, stride); +} +namespace symint { + template ::value>> + at::Tensor col2im(const at::Tensor & self, c10::SymIntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride) { + return at::_ops::col2im::call(self, output_size, kernel_size, dilation, padding, stride); + } +} + +} diff --git a/shared/package-files/9d/9dae46d36bdfaaffea674e9986e9c85f81557763b36c604427c10a81c4589f1e/blob b/shared/package-files/9d/9dae46d36bdfaaffea674e9986e9c85f81557763b36c604427c10a81c4589f1e/blob new file mode 100644 index 0000000000000000000000000000000000000000..20f281fbfcf6a7223b75628baf6a9938d5cc192d --- /dev/null +++ b/shared/package-files/9d/9dae46d36bdfaaffea674e9986e9c85f81557763b36c604427c10a81c4589f1e/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor isneginf(const at::Tensor & self); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9d/9db1ebf034b2b0037cc5b7fdeac8ab49751b93f3c6ca7e6f0d7d58f92bf35140/blob b/shared/package-files/9d/9db1ebf034b2b0037cc5b7fdeac8ab49751b93f3c6ca7e6f0d7d58f92bf35140/blob new file mode 100644 index 0000000000000000000000000000000000000000..22a3007ef8a4b45829a5d9fb8bb1e117e32bea79 --- /dev/null +++ b/shared/package-files/9d/9db1ebf034b2b0037cc5b7fdeac8ab49751b93f3c6ca7e6f0d7d58f92bf35140/blob @@ -0,0 +1,286 @@ +""" +Lowess - wrapper for cythonized extension + +Author : Chris Jordan-Squire +Author : Carl Vogel +Author : Josef Perktold + +""" + +import numpy as np + +from ._smoothers_lowess import lowess as _lowess + + +def lowess( + endog, + exog, + frac=2.0 / 3.0, + it=3, + delta=0.0, + xvals=None, + is_sorted=False, + missing="drop", + return_sorted=True, +): + """ + LOWESS (Locally Weighted Scatterplot Smoothing) + + A lowess function that outputs smoothed estimates of endog + at the given exog values from points (exog, endog) + + Parameters + ---------- + endog : array_like + The 1-D y-values of the observed points. + exog : array_like + The 1-D x-values of the observed points. + frac : float, optional + Between 0 and 1. The fraction of the data used + when estimating each y-value. + it : int, optional + The number of residual-based reweightings + to perform. + delta : float, optional + Distance within which to use linear-interpolation + instead of weighted regression. + xvals : array_like, optional + Values of the exogenous variable at which to evaluate the regression. + If supplied, cannot use delta. + is_sorted : bool, optional + If False (default), then the data will be sorted by exog before + calculating lowess. If True, then it is assumed that the data is + already sorted by exog. If xvals is specified, then it too must be + sorted if is_sorted is True. + missing : str, optional + Available options are 'none', 'drop', and 'raise'. If 'none', no nan + checking is done. If 'drop', any observations with nans are dropped. + If 'raise', an error is raised. Default is 'drop'. + return_sorted : bool, optional + If True (default), then the returned array is sorted by exog and has + missing (nan or infinite) observations removed. + If False, then the returned array is in the same length and the same + sequence of observations as the input array. + + Returns + ------- + out : ndarray + The returned array is two-dimensional if return_sorted is True, and + one dimensional if return_sorted is False. + If return_sorted is True, then a numpy array with two columns. The + first column contains the sorted x (exog) values and the second column + the associated estimated y (endog) values. + If return_sorted is False, then only the fitted values are returned, + and the observations will be in the same order as the input arrays. + If xvals is provided, then return_sorted is ignored and the returned + array is always one dimensional, containing the y values fitted at + the x values provided by xvals. + + Notes + ----- + This lowess function implements the algorithm given in the + reference below using local linear estimates. + + Suppose the input data has N points. The algorithm works by + estimating the `smooth` y_i by taking the frac*N closest points + to (x_i,y_i) based on their x values and estimating y_i + using a weighted linear regression. The weight for (x_j,y_j) + is tricube function applied to abs(x_i-x_j). + + If it > 1, then further weighted local linear regressions + are performed, where the weights are the same as above + times the _lowess_bisquare function of the residuals. Each iteration + takes approximately the same amount of time as the original fit, + so these iterations are expensive. They are most useful when + the noise has extremely heavy tails, such as Cauchy noise. + Noise with less heavy-tails, such as t-distributions with df>2, + are less problematic. The weights downgrade the influence of + points with large residuals. In the extreme case, points whose + residuals are larger than 6 times the median absolute residual + are given weight 0. + + `delta` can be used to save computations. For each `x_i`, regressions + are skipped for points closer than `delta`. The next regression is + fit for the farthest point within delta of `x_i` and all points in + between are estimated by linearly interpolating between the two + regression fits. + + Judicious choice of delta can cut computation time considerably + for large data (N > 5000). A good choice is ``delta = 0.01 * range(exog)``. + + If `xvals` is provided, the regression is then computed at those points + and the fit values are returned. Otherwise, the regression is run + at points of `exog`. + + Some experimentation is likely required to find a good + choice of `frac` and `it` for a particular dataset. + + References + ---------- + Cleveland, W.S. (1979) "Robust Locally Weighted Regression + and Smoothing Scatterplots". Journal of the American Statistical + Association 74 (368): 829-836. + + Examples + -------- + The below allows a comparison between how different the fits from + lowess for different values of frac can be. + + >>> import numpy as np + >>> import statsmodels.api as sm + >>> lowess = sm.nonparametric.lowess + >>> x = np.random.uniform(low = -2*np.pi, high = 2*np.pi, size=500) + >>> y = np.sin(x) + np.random.normal(size=len(x)) + >>> z = lowess(y, x) + >>> w = lowess(y, x, frac=1./3) + + This gives a similar comparison for when it is 0 vs not. + + >>> import numpy as np + >>> from scipy import stats + >>> import statsmodels.api as sm + >>> lowess = sm.nonparametric.lowess + >>> x = np.random.uniform(low = -2*np.pi, high = 2*np.pi, size=500) + >>> y = np.sin(x) + stats.cauchy.rvs(size=len(x)) + >>> z = lowess(y, x, frac= 1./3, it=0) + >>> w = lowess(y, x, frac=1./3) + + """ + + endog = np.asarray(endog, float) + exog = np.asarray(exog, float) + + # Whether xvals argument was provided + + given_xvals = xvals is not None + + # Inputs should be vectors (1-D arrays) of the + # same length. + + if exog.ndim != 1: + raise ValueError("exog must be a vector") + if endog.ndim != 1: + raise ValueError("endog must be a vector") + if endog.shape[0] != exog.shape[0]: + raise ValueError("exog and endog must have same length") + if xvals is not None: + xvals = np.ascontiguousarray(xvals) + if xvals.ndim != 1: + raise ValueError("exog_predict must be a vector") + if missing in ["drop", "raise"]: + mask_valid = np.isfinite(exog) & np.isfinite(endog) + all_valid = np.all(mask_valid) + if all_valid: + y = endog + x = exog + elif missing == "drop": + x = exog[mask_valid] + y = endog[mask_valid] + else: + raise ValueError("nan or inf found in data") + elif missing == "none": + y = endog + x = exog + all_valid = True # we assume it's true if missing='none' + else: + raise ValueError("missing can only be 'none', 'drop' or 'raise'") + if not is_sorted: + # Sort both inputs according to the ascending order of x values + + sort_index = np.argsort(x) + x = np.array(x[sort_index]) + y = np.array(y[sort_index]) + if not given_xvals: + # If given no explicit x values, we use the x-values in the exog array + + xvals = exog + xvalues = x + + xvals_all_valid = all_valid + if missing == "drop": + xvals_mask_valid = mask_valid + else: + if delta != 0.0: + raise ValueError("Cannot have non-zero 'delta' and 'xvals' values") + # TODO: allow this again + mask_valid = np.isfinite(xvals) + if missing == "raise": + raise ValueError("NaN values in xvals with missing='raise'") + elif missing == "drop": + xvals_mask_valid = mask_valid + xvalues = xvals + xvals_all_valid = True if missing == "none" else np.all(mask_valid) + # With explicit xvals, we ignore 'return_sorted' and always + # use the order provided + + return_sorted = False + + if missing in ["drop", "raise"]: + xvals_mask_valid = np.isfinite(xvals) + xvals_all_valid = np.all(xvals_mask_valid) + if xvals_all_valid: + xvalues = xvals + elif missing == "drop": + xvalues = xvals[xvals_mask_valid] + else: + raise ValueError("nan or inf found in xvals") + if not is_sorted: + sort_index = np.argsort(xvalues) + xvalues = np.array(xvalues[sort_index]) + else: + xvals_all_valid = True + y = np.ascontiguousarray(y) + x = np.ascontiguousarray(x) + if not given_xvals: + # Run LOWESS on the data points + + res, _ = _lowess( + y, x, x, np.ones_like(x), frac=frac, it=it, delta=delta, given_xvals=False + ) + else: + # First run LOWESS on the data points to get the weights of the data points + # using it-1 iterations, last iter done next + + if it > 0: + _, weights = _lowess( + y, + x, + x, + np.ones_like(x), + frac=frac, + it=it - 1, + delta=delta, + given_xvals=False, + ) + else: + weights = np.ones_like(x) + xvalues = np.ascontiguousarray(xvalues, dtype=float) + # Then run once more using those supplied weights at the points provided by xvals + # No extra iterations are performed here since weights are fixed + + res, _ = _lowess( + y, x, xvalues, weights, frac=frac, it=0, delta=delta, given_xvals=True + ) + _, yfitted = res.T + + if return_sorted: + return res + else: + + # rebuild yfitted with original indices + # a bit messy: y might have been selected twice + + if not is_sorted: + yfitted_ = np.empty_like(xvalues) + yfitted_.fill(np.nan) + yfitted_[sort_index] = yfitted + yfitted = yfitted_ + # else (not needed) yfitted = yfitted + if not xvals_all_valid: + yfitted_ = np.empty_like(xvals) + yfitted_.fill(np.nan) + yfitted_[xvals_mask_valid] = yfitted + yfitted = yfitted_ + # we do not need to return exog anymore + + return yfitted diff --git a/shared/package-files/9d/9db421cc823c770e73778850276494cab88ae5d3aba9ff9b6e3cb5d172905cfc/blob b/shared/package-files/9d/9db421cc823c770e73778850276494cab88ae5d3aba9ff9b6e3cb5d172905cfc/blob new file mode 100644 index 0000000000000000000000000000000000000000..8f35da4a84396618a33a12c3c6b5cf58e9d4742c --- /dev/null +++ b/shared/package-files/9d/9db421cc823c770e73778850276494cab88ae5d3aba9ff9b6e3cb5d172905cfc/blob @@ -0,0 +1,30 @@ +"""This module contains some general purpose utilities that are used across +SymPy. +""" +from .iterables import (flatten, group, take, subsets, + variations, numbered_symbols, cartes, capture, dict_merge, + prefixes, postfixes, sift, topological_sort, unflatten, + has_dups, has_variety, reshape, rotations) + +from .misc import filldedent + +from .lambdify import lambdify + +from .decorator import threaded, xthreaded, public, memoize_property + +from .timeutils import timed + +__all__ = [ + 'flatten', 'group', 'take', 'subsets', 'variations', 'numbered_symbols', + 'cartes', 'capture', 'dict_merge', 'prefixes', 'postfixes', 'sift', + 'topological_sort', 'unflatten', 'has_dups', 'has_variety', 'reshape', + 'rotations', + + 'filldedent', + + 'lambdify', + + 'threaded', 'xthreaded', 'public', 'memoize_property', + + 'timed', +] diff --git a/shared/package-files/9d/9db565e69823e3b1765aa056e39c30c972cc23356d83d3027edc4e36ec5bfb35/blob b/shared/package-files/9d/9db565e69823e3b1765aa056e39c30c972cc23356d83d3027edc4e36ec5bfb35/blob new file mode 100644 index 0000000000000000000000000000000000000000..2b11d5a0e21e5ed83fe4cf8ca1e042325d47073b --- /dev/null +++ b/shared/package-files/9d/9db565e69823e3b1765aa056e39c30c972cc23356d83d3027edc4e36ec5bfb35/blob @@ -0,0 +1,28 @@ +#pragma once + +#include +#include +#include + +namespace torch { +namespace profiler { +namespace impl { +namespace vulkan { + +// Using function pointer i.e. [std::tuple (*)(int64_t)] +// doesn't work because we need to capture the QueryPool in the lambda context +// https://stackoverflow.com/a/28746827 +using GetShaderNameAndDurationNsFn = + std::function(int64_t)>; +TORCH_API void registerGetShaderNameAndDurationNs( + GetShaderNameAndDurationNsFn get_shader_name_and_duration_ns); + +TORCH_API void deregisterGetShaderNameAndDurationNs(); + +std::tuple getShaderNameAndDurationNs( + const vulkan_id_t& vulkan_id); + +} // namespace vulkan +} // namespace impl +} // namespace profiler +} // namespace torch diff --git a/shared/package-files/9d/9db5e8c1f089162cb81a355f17d23c56f07a7f1932479ccd07514a76716c6134/blob b/shared/package-files/9d/9db5e8c1f089162cb81a355f17d23c56f07a7f1932479ccd07514a76716c6134/blob new file mode 100644 index 0000000000000000000000000000000000000000..768f2328200fb2635213358226cfdb3f9273c808 --- /dev/null +++ b/shared/package-files/9d/9db5e8c1f089162cb81a355f17d23c56f07a7f1932479ccd07514a76716c6134/blob @@ -0,0 +1,33 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +#pragma once + +#include "arrow/vendored/pcg/pcg_random.hpp" // IWYU pragma: export + +namespace arrow { +namespace random { + +using pcg32 = ::arrow_vendored::pcg32; +using pcg64 = ::arrow_vendored::pcg64; +using pcg32_fast = ::arrow_vendored::pcg32_fast; +using pcg64_fast = ::arrow_vendored::pcg64_fast; +using pcg32_oneseq = ::arrow_vendored::pcg32_oneseq; +using pcg64_oneseq = ::arrow_vendored::pcg64_oneseq; + +} // namespace random +} // namespace arrow diff --git a/shared/package-files/9d/9db611b60fb4611d1732714e18ccd1cdb8043ad342fdc7e451a38c3a635558c0/blob b/shared/package-files/9d/9db611b60fb4611d1732714e18ccd1cdb8043ad342fdc7e451a38c3a635558c0/blob new file mode 100644 index 0000000000000000000000000000000000000000..07bfc15513962cce01d11b6a4854d736a926ded3 --- /dev/null +++ b/shared/package-files/9d/9db611b60fb4611d1732714e18ccd1cdb8043ad342fdc7e451a38c3a635558c0/blob @@ -0,0 +1,684 @@ +"""Stubs for more_itertools.more""" +from __future__ import annotations + +from types import TracebackType +from typing import ( + Any, + Callable, + Container, + ContextManager, + Generic, + Hashable, + Iterable, + Iterator, + overload, + Reversible, + Sequence, + Sized, + Type, + TypeVar, + type_check_only, +) +from typing_extensions import Protocol + +# Type and type variable definitions +_T = TypeVar('_T') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_U = TypeVar('_U') +_V = TypeVar('_V') +_W = TypeVar('_W') +_T_co = TypeVar('_T_co', covariant=True) +_GenFn = TypeVar('_GenFn', bound=Callable[..., Iterator[object]]) +_Raisable = BaseException | Type[BaseException] + +@type_check_only +class _SizedIterable(Protocol[_T_co], Sized, Iterable[_T_co]): ... + +@type_check_only +class _SizedReversible(Protocol[_T_co], Sized, Reversible[_T_co]): ... + +@type_check_only +class _SupportsSlicing(Protocol[_T_co]): + def __getitem__(self, __k: slice) -> _T_co: ... + +def chunked( + iterable: Iterable[_T], n: int | None, strict: bool = ... +) -> Iterator[list[_T]]: ... +@overload +def first(iterable: Iterable[_T]) -> _T: ... +@overload +def first(iterable: Iterable[_T], default: _U) -> _T | _U: ... +@overload +def last(iterable: Iterable[_T]) -> _T: ... +@overload +def last(iterable: Iterable[_T], default: _U) -> _T | _U: ... +@overload +def nth_or_last(iterable: Iterable[_T], n: int) -> _T: ... +@overload +def nth_or_last(iterable: Iterable[_T], n: int, default: _U) -> _T | _U: ... + +class peekable(Generic[_T], Iterator[_T]): + def __init__(self, iterable: Iterable[_T]) -> None: ... + def __iter__(self) -> peekable[_T]: ... + def __bool__(self) -> bool: ... + @overload + def peek(self) -> _T: ... + @overload + def peek(self, default: _U) -> _T | _U: ... + def prepend(self, *items: _T) -> None: ... + def __next__(self) -> _T: ... + @overload + def __getitem__(self, index: int) -> _T: ... + @overload + def __getitem__(self, index: slice) -> list[_T]: ... + +def consumer(func: _GenFn) -> _GenFn: ... +def ilen(iterable: Iterable[object]) -> int: ... +def iterate(func: Callable[[_T], _T], start: _T) -> Iterator[_T]: ... +def with_iter( + context_manager: ContextManager[Iterable[_T]], +) -> Iterator[_T]: ... +def one( + iterable: Iterable[_T], + too_short: _Raisable | None = ..., + too_long: _Raisable | None = ..., +) -> _T: ... +def raise_(exception: _Raisable, *args: Any) -> None: ... +def strictly_n( + iterable: Iterable[_T], + n: int, + too_short: _GenFn | None = ..., + too_long: _GenFn | None = ..., +) -> list[_T]: ... +def distinct_permutations( + iterable: Iterable[_T], r: int | None = ... +) -> Iterator[tuple[_T, ...]]: ... +def intersperse( + e: _U, iterable: Iterable[_T], n: int = ... +) -> Iterator[_T | _U]: ... +def unique_to_each(*iterables: Iterable[_T]) -> list[list[_T]]: ... +@overload +def windowed( + seq: Iterable[_T], n: int, *, step: int = ... +) -> Iterator[tuple[_T | None, ...]]: ... +@overload +def windowed( + seq: Iterable[_T], n: int, fillvalue: _U, step: int = ... +) -> Iterator[tuple[_T | _U, ...]]: ... +def substrings(iterable: Iterable[_T]) -> Iterator[tuple[_T, ...]]: ... +def substrings_indexes( + seq: Sequence[_T], reverse: bool = ... +) -> Iterator[tuple[Sequence[_T], int, int]]: ... + +class bucket(Generic[_T, _U], Container[_U]): + def __init__( + self, + iterable: Iterable[_T], + key: Callable[[_T], _U], + validator: Callable[[object], object] | None = ..., + ) -> None: ... + def __contains__(self, value: object) -> bool: ... + def __iter__(self) -> Iterator[_U]: ... + def __getitem__(self, value: object) -> Iterator[_T]: ... + +def spy( + iterable: Iterable[_T], n: int = ... +) -> tuple[list[_T], Iterator[_T]]: ... +def interleave(*iterables: Iterable[_T]) -> Iterator[_T]: ... +def interleave_longest(*iterables: Iterable[_T]) -> Iterator[_T]: ... +def interleave_evenly( + iterables: list[Iterable[_T]], lengths: list[int] | None = ... +) -> Iterator[_T]: ... +def collapse( + iterable: Iterable[Any], + base_type: type | None = ..., + levels: int | None = ..., +) -> Iterator[Any]: ... +@overload +def side_effect( + func: Callable[[_T], object], + iterable: Iterable[_T], + chunk_size: None = ..., + before: Callable[[], object] | None = ..., + after: Callable[[], object] | None = ..., +) -> Iterator[_T]: ... +@overload +def side_effect( + func: Callable[[list[_T]], object], + iterable: Iterable[_T], + chunk_size: int, + before: Callable[[], object] | None = ..., + after: Callable[[], object] | None = ..., +) -> Iterator[_T]: ... +def sliced( + seq: _SupportsSlicing[_T], n: int, strict: bool = ... +) -> Iterator[_T]: ... +def split_at( + iterable: Iterable[_T], + pred: Callable[[_T], object], + maxsplit: int = ..., + keep_separator: bool = ..., +) -> Iterator[list[_T]]: ... +def split_before( + iterable: Iterable[_T], pred: Callable[[_T], object], maxsplit: int = ... +) -> Iterator[list[_T]]: ... +def split_after( + iterable: Iterable[_T], pred: Callable[[_T], object], maxsplit: int = ... +) -> Iterator[list[_T]]: ... +def split_when( + iterable: Iterable[_T], + pred: Callable[[_T, _T], object], + maxsplit: int = ..., +) -> Iterator[list[_T]]: ... +def split_into( + iterable: Iterable[_T], sizes: Iterable[int | None] +) -> Iterator[list[_T]]: ... +@overload +def padded( + iterable: Iterable[_T], + *, + n: int | None = ..., + next_multiple: bool = ..., +) -> Iterator[_T | None]: ... +@overload +def padded( + iterable: Iterable[_T], + fillvalue: _U, + n: int | None = ..., + next_multiple: bool = ..., +) -> Iterator[_T | _U]: ... +@overload +def repeat_last(iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def repeat_last(iterable: Iterable[_T], default: _U) -> Iterator[_T | _U]: ... +def distribute(n: int, iterable: Iterable[_T]) -> list[Iterator[_T]]: ... +@overload +def stagger( + iterable: Iterable[_T], + offsets: _SizedIterable[int] = ..., + longest: bool = ..., +) -> Iterator[tuple[_T | None, ...]]: ... +@overload +def stagger( + iterable: Iterable[_T], + offsets: _SizedIterable[int] = ..., + longest: bool = ..., + fillvalue: _U = ..., +) -> Iterator[tuple[_T | _U, ...]]: ... + +class UnequalIterablesError(ValueError): + def __init__(self, details: tuple[int, int, int] | None = ...) -> None: ... + +@overload +def zip_equal(__iter1: Iterable[_T1]) -> Iterator[tuple[_T1]]: ... +@overload +def zip_equal( + __iter1: Iterable[_T1], __iter2: Iterable[_T2] +) -> Iterator[tuple[_T1, _T2]]: ... +@overload +def zip_equal( + __iter1: Iterable[_T], + __iter2: Iterable[_T], + __iter3: Iterable[_T], + *iterables: Iterable[_T], +) -> Iterator[tuple[_T, ...]]: ... +@overload +def zip_offset( + __iter1: Iterable[_T1], + *, + offsets: _SizedIterable[int], + longest: bool = ..., + fillvalue: None = None, +) -> Iterator[tuple[_T1 | None]]: ... +@overload +def zip_offset( + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + *, + offsets: _SizedIterable[int], + longest: bool = ..., + fillvalue: None = None, +) -> Iterator[tuple[_T1 | None, _T2 | None]]: ... +@overload +def zip_offset( + __iter1: Iterable[_T], + __iter2: Iterable[_T], + __iter3: Iterable[_T], + *iterables: Iterable[_T], + offsets: _SizedIterable[int], + longest: bool = ..., + fillvalue: None = None, +) -> Iterator[tuple[_T | None, ...]]: ... +@overload +def zip_offset( + __iter1: Iterable[_T1], + *, + offsets: _SizedIterable[int], + longest: bool = ..., + fillvalue: _U, +) -> Iterator[tuple[_T1 | _U]]: ... +@overload +def zip_offset( + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + *, + offsets: _SizedIterable[int], + longest: bool = ..., + fillvalue: _U, +) -> Iterator[tuple[_T1 | _U, _T2 | _U]]: ... +@overload +def zip_offset( + __iter1: Iterable[_T], + __iter2: Iterable[_T], + __iter3: Iterable[_T], + *iterables: Iterable[_T], + offsets: _SizedIterable[int], + longest: bool = ..., + fillvalue: _U, +) -> Iterator[tuple[_T | _U, ...]]: ... +def sort_together( + iterables: Iterable[Iterable[_T]], + key_list: Iterable[int] = ..., + key: Callable[..., Any] | None = ..., + reverse: bool = ..., +) -> list[tuple[_T, ...]]: ... +def unzip(iterable: Iterable[Sequence[_T]]) -> tuple[Iterator[_T], ...]: ... +def divide(n: int, iterable: Iterable[_T]) -> list[Iterator[_T]]: ... +def always_iterable( + obj: object, + base_type: type | tuple[type | tuple[Any, ...], ...] | None = ..., +) -> Iterator[Any]: ... +def adjacent( + predicate: Callable[[_T], bool], + iterable: Iterable[_T], + distance: int = ..., +) -> Iterator[tuple[bool, _T]]: ... +@overload +def groupby_transform( + iterable: Iterable[_T], + keyfunc: None = None, + valuefunc: None = None, + reducefunc: None = None, +) -> Iterator[tuple[_T, Iterator[_T]]]: ... +@overload +def groupby_transform( + iterable: Iterable[_T], + keyfunc: Callable[[_T], _U], + valuefunc: None, + reducefunc: None, +) -> Iterator[tuple[_U, Iterator[_T]]]: ... +@overload +def groupby_transform( + iterable: Iterable[_T], + keyfunc: None, + valuefunc: Callable[[_T], _V], + reducefunc: None, +) -> Iterable[tuple[_T, Iterable[_V]]]: ... +@overload +def groupby_transform( + iterable: Iterable[_T], + keyfunc: Callable[[_T], _U], + valuefunc: Callable[[_T], _V], + reducefunc: None, +) -> Iterable[tuple[_U, Iterator[_V]]]: ... +@overload +def groupby_transform( + iterable: Iterable[_T], + keyfunc: None, + valuefunc: None, + reducefunc: Callable[[Iterator[_T]], _W], +) -> Iterable[tuple[_T, _W]]: ... +@overload +def groupby_transform( + iterable: Iterable[_T], + keyfunc: Callable[[_T], _U], + valuefunc: None, + reducefunc: Callable[[Iterator[_T]], _W], +) -> Iterable[tuple[_U, _W]]: ... +@overload +def groupby_transform( + iterable: Iterable[_T], + keyfunc: None, + valuefunc: Callable[[_T], _V], + reducefunc: Callable[[Iterable[_V]], _W], +) -> Iterable[tuple[_T, _W]]: ... +@overload +def groupby_transform( + iterable: Iterable[_T], + keyfunc: Callable[[_T], _U], + valuefunc: Callable[[_T], _V], + reducefunc: Callable[[Iterable[_V]], _W], +) -> Iterable[tuple[_U, _W]]: ... + +class numeric_range(Generic[_T, _U], Sequence[_T], Hashable, Reversible[_T]): + @overload + def __init__(self, __stop: _T) -> None: ... + @overload + def __init__(self, __start: _T, __stop: _T) -> None: ... + @overload + def __init__(self, __start: _T, __stop: _T, __step: _U) -> None: ... + def __bool__(self) -> bool: ... + def __contains__(self, elem: object) -> bool: ... + def __eq__(self, other: object) -> bool: ... + @overload + def __getitem__(self, key: int) -> _T: ... + @overload + def __getitem__(self, key: slice) -> numeric_range[_T, _U]: ... + def __hash__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __len__(self) -> int: ... + def __reduce__( + self, + ) -> tuple[Type[numeric_range[_T, _U]], tuple[_T, _T, _U]]: ... + def __repr__(self) -> str: ... + def __reversed__(self) -> Iterator[_T]: ... + def count(self, value: _T) -> int: ... + def index(self, value: _T) -> int: ... # type: ignore + +def count_cycle( + iterable: Iterable[_T], n: int | None = ... +) -> Iterable[tuple[int, _T]]: ... +def mark_ends( + iterable: Iterable[_T], +) -> Iterable[tuple[bool, bool, _T]]: ... +def locate( + iterable: Iterable[object], + pred: Callable[..., Any] = ..., + window_size: int | None = ..., +) -> Iterator[int]: ... +def lstrip( + iterable: Iterable[_T], pred: Callable[[_T], object] +) -> Iterator[_T]: ... +def rstrip( + iterable: Iterable[_T], pred: Callable[[_T], object] +) -> Iterator[_T]: ... +def strip( + iterable: Iterable[_T], pred: Callable[[_T], object] +) -> Iterator[_T]: ... + +class islice_extended(Generic[_T], Iterator[_T]): + def __init__(self, iterable: Iterable[_T], *args: int | None) -> None: ... + def __iter__(self) -> islice_extended[_T]: ... + def __next__(self) -> _T: ... + def __getitem__(self, index: slice) -> islice_extended[_T]: ... + +def always_reversible(iterable: Iterable[_T]) -> Iterator[_T]: ... +def consecutive_groups( + iterable: Iterable[_T], ordering: Callable[[_T], int] = ... +) -> Iterator[Iterator[_T]]: ... +@overload +def difference( + iterable: Iterable[_T], + func: Callable[[_T, _T], _U] = ..., + *, + initial: None = ..., +) -> Iterator[_T | _U]: ... +@overload +def difference( + iterable: Iterable[_T], func: Callable[[_T, _T], _U] = ..., *, initial: _U +) -> Iterator[_U]: ... + +class SequenceView(Generic[_T], Sequence[_T]): + def __init__(self, target: Sequence[_T]) -> None: ... + @overload + def __getitem__(self, index: int) -> _T: ... + @overload + def __getitem__(self, index: slice) -> Sequence[_T]: ... + def __len__(self) -> int: ... + +class seekable(Generic[_T], Iterator[_T]): + def __init__( + self, iterable: Iterable[_T], maxlen: int | None = ... + ) -> None: ... + def __iter__(self) -> seekable[_T]: ... + def __next__(self) -> _T: ... + def __bool__(self) -> bool: ... + @overload + def peek(self) -> _T: ... + @overload + def peek(self, default: _U) -> _T | _U: ... + def elements(self) -> SequenceView[_T]: ... + def seek(self, index: int) -> None: ... + def relative_seek(self, count: int) -> None: ... + +class run_length: + @staticmethod + def encode(iterable: Iterable[_T]) -> Iterator[tuple[_T, int]]: ... + @staticmethod + def decode(iterable: Iterable[tuple[_T, int]]) -> Iterator[_T]: ... + +def exactly_n( + iterable: Iterable[_T], n: int, predicate: Callable[[_T], object] = ... +) -> bool: ... +def circular_shifts(iterable: Iterable[_T]) -> list[tuple[_T, ...]]: ... +def make_decorator( + wrapping_func: Callable[..., _U], result_index: int = ... +) -> Callable[..., Callable[[Callable[..., Any]], Callable[..., _U]]]: ... +@overload +def map_reduce( + iterable: Iterable[_T], + keyfunc: Callable[[_T], _U], + valuefunc: None = ..., + reducefunc: None = ..., +) -> dict[_U, list[_T]]: ... +@overload +def map_reduce( + iterable: Iterable[_T], + keyfunc: Callable[[_T], _U], + valuefunc: Callable[[_T], _V], + reducefunc: None = ..., +) -> dict[_U, list[_V]]: ... +@overload +def map_reduce( + iterable: Iterable[_T], + keyfunc: Callable[[_T], _U], + valuefunc: None = ..., + reducefunc: Callable[[list[_T]], _W] = ..., +) -> dict[_U, _W]: ... +@overload +def map_reduce( + iterable: Iterable[_T], + keyfunc: Callable[[_T], _U], + valuefunc: Callable[[_T], _V], + reducefunc: Callable[[list[_V]], _W], +) -> dict[_U, _W]: ... +def rlocate( + iterable: Iterable[_T], + pred: Callable[..., object] = ..., + window_size: int | None = ..., +) -> Iterator[int]: ... +def replace( + iterable: Iterable[_T], + pred: Callable[..., object], + substitutes: Iterable[_U], + count: int | None = ..., + window_size: int = ..., +) -> Iterator[_T | _U]: ... +def partitions(iterable: Iterable[_T]) -> Iterator[list[list[_T]]]: ... +def set_partitions( + iterable: Iterable[_T], k: int | None = ... +) -> Iterator[list[list[_T]]]: ... + +class time_limited(Generic[_T], Iterator[_T]): + def __init__( + self, limit_seconds: float, iterable: Iterable[_T] + ) -> None: ... + def __iter__(self) -> islice_extended[_T]: ... + def __next__(self) -> _T: ... + +@overload +def only( + iterable: Iterable[_T], *, too_long: _Raisable | None = ... +) -> _T | None: ... +@overload +def only( + iterable: Iterable[_T], default: _U, too_long: _Raisable | None = ... +) -> _T | _U: ... +def ichunked(iterable: Iterable[_T], n: int) -> Iterator[Iterator[_T]]: ... +def distinct_combinations( + iterable: Iterable[_T], r: int +) -> Iterator[tuple[_T, ...]]: ... +def filter_except( + validator: Callable[[Any], object], + iterable: Iterable[_T], + *exceptions: Type[BaseException], +) -> Iterator[_T]: ... +def map_except( + function: Callable[[Any], _U], + iterable: Iterable[_T], + *exceptions: Type[BaseException], +) -> Iterator[_U]: ... +def map_if( + iterable: Iterable[Any], + pred: Callable[[Any], bool], + func: Callable[[Any], Any], + func_else: Callable[[Any], Any] | None = ..., +) -> Iterator[Any]: ... +def sample( + iterable: Iterable[_T], + k: int, + weights: Iterable[float] | None = ..., +) -> list[_T]: ... +def is_sorted( + iterable: Iterable[_T], + key: Callable[[_T], _U] | None = ..., + reverse: bool = False, + strict: bool = False, +) -> bool: ... + +class AbortThread(BaseException): + pass + +class callback_iter(Generic[_T], Iterator[_T]): + def __init__( + self, + func: Callable[..., Any], + callback_kwd: str = ..., + wait_seconds: float = ..., + ) -> None: ... + def __enter__(self) -> callback_iter[_T]: ... + def __exit__( + self, + exc_type: Type[BaseException] | None, + exc_value: BaseException | None, + traceback: TracebackType | None, + ) -> bool | None: ... + def __iter__(self) -> callback_iter[_T]: ... + def __next__(self) -> _T: ... + def _reader(self) -> Iterator[_T]: ... + @property + def done(self) -> bool: ... + @property + def result(self) -> Any: ... + +def windowed_complete( + iterable: Iterable[_T], n: int +) -> Iterator[tuple[_T, ...]]: ... +def all_unique( + iterable: Iterable[_T], key: Callable[[_T], _U] | None = ... +) -> bool: ... +def nth_product(index: int, *args: Iterable[_T]) -> tuple[_T, ...]: ... +def nth_combination_with_replacement( + iterable: Iterable[_T], r: int, index: int +) -> tuple[_T, ...]: ... +def nth_permutation( + iterable: Iterable[_T], r: int, index: int +) -> tuple[_T, ...]: ... +def value_chain(*args: _T | Iterable[_T]) -> Iterable[_T]: ... +def product_index(element: Iterable[_T], *args: Iterable[_T]) -> int: ... +def combination_index( + element: Iterable[_T], iterable: Iterable[_T] +) -> int: ... +def combination_with_replacement_index( + element: Iterable[_T], iterable: Iterable[_T] +) -> int: ... +def permutation_index( + element: Iterable[_T], iterable: Iterable[_T] +) -> int: ... +def repeat_each(iterable: Iterable[_T], n: int = ...) -> Iterator[_T]: ... + +class countable(Generic[_T], Iterator[_T]): + def __init__(self, iterable: Iterable[_T]) -> None: ... + def __iter__(self) -> countable[_T]: ... + def __next__(self) -> _T: ... + +def chunked_even(iterable: Iterable[_T], n: int) -> Iterator[list[_T]]: ... +def zip_broadcast( + *objects: _T | Iterable[_T], + scalar_types: type | tuple[type | tuple[Any, ...], ...] | None = ..., + strict: bool = ..., +) -> Iterable[tuple[_T, ...]]: ... +def unique_in_window( + iterable: Iterable[_T], n: int, key: Callable[[_T], _U] | None = ... +) -> Iterator[_T]: ... +def duplicates_everseen( + iterable: Iterable[_T], key: Callable[[_T], _U] | None = ... +) -> Iterator[_T]: ... +def duplicates_justseen( + iterable: Iterable[_T], key: Callable[[_T], _U] | None = ... +) -> Iterator[_T]: ... + +class _SupportsLessThan(Protocol): + def __lt__(self, __other: Any) -> bool: ... + +_SupportsLessThanT = TypeVar("_SupportsLessThanT", bound=_SupportsLessThan) + +@overload +def minmax( + iterable_or_value: Iterable[_SupportsLessThanT], *, key: None = None +) -> tuple[_SupportsLessThanT, _SupportsLessThanT]: ... +@overload +def minmax( + iterable_or_value: Iterable[_T], *, key: Callable[[_T], _SupportsLessThan] +) -> tuple[_T, _T]: ... +@overload +def minmax( + iterable_or_value: Iterable[_SupportsLessThanT], + *, + key: None = None, + default: _U, +) -> _U | tuple[_SupportsLessThanT, _SupportsLessThanT]: ... +@overload +def minmax( + iterable_or_value: Iterable[_T], + *, + key: Callable[[_T], _SupportsLessThan], + default: _U, +) -> _U | tuple[_T, _T]: ... +@overload +def minmax( + iterable_or_value: _SupportsLessThanT, + __other: _SupportsLessThanT, + *others: _SupportsLessThanT, +) -> tuple[_SupportsLessThanT, _SupportsLessThanT]: ... +@overload +def minmax( + iterable_or_value: _T, + __other: _T, + *others: _T, + key: Callable[[_T], _SupportsLessThan], +) -> tuple[_T, _T]: ... +def longest_common_prefix( + iterables: Iterable[Iterable[_T]], +) -> Iterator[_T]: ... +def iequals(*iterables: Iterable[object]) -> bool: ... +def constrained_batches( + iterable: Iterable[object], + max_size: int, + max_count: int | None = ..., + get_len: Callable[[_T], object] = ..., + strict: bool = ..., +) -> Iterator[tuple[_T]]: ... +def gray_product(*iterables: Iterable[_T]) -> Iterator[tuple[_T, ...]]: ... +def partial_product(*iterables: Iterable[_T]) -> Iterator[tuple[_T, ...]]: ... +def takewhile_inclusive( + predicate: Callable[[_T], bool], iterable: Iterable[_T] +) -> Iterator[_T]: ... +def outer_product( + func: Callable[[_T, _U], _V], + xs: Iterable[_T], + ys: Iterable[_U], + *args: Any, + **kwargs: Any, +) -> Iterator[tuple[_V, ...]]: ... diff --git a/shared/package-files/9d/9db6e02b5b85c055ead91df1479c5f1b415d5e2e7229b17bfcdab2f94534394d/blob b/shared/package-files/9d/9db6e02b5b85c055ead91df1479c5f1b415d5e2e7229b17bfcdab2f94534394d/blob new file mode 100644 index 0000000000000000000000000000000000000000..2ef9b910d17edd1ffbd18eb205e30c54f6a0653a --- /dev/null +++ b/shared/package-files/9d/9db6e02b5b85c055ead91df1479c5f1b415d5e2e7229b17bfcdab2f94534394d/blob @@ -0,0 +1,817 @@ +# Copyright (C) 2014 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from __future__ import annotations + +import datetime +import json +import os +import pathlib +import re +import time +from functools import partial +from io import StringIO, TextIOBase +from warnings import warn + +import jinja2 +import yaml + +try: + import tomllib # Python 3.11 +except: + import tomli as tomllib + +from typing import TYPE_CHECKING + +from . import _load_setup_py_data +from .environ import get_dict as get_environ +from .exceptions import CondaBuildException +from .render import get_env_dependencies +from .utils import ( + HashableDict, + apply_pin_expressions, + check_call_env, + copy_into, + ensure_valid_spec, + get_installed_packages, + get_logger, + rm_rf, +) +from .variants import DEFAULT_COMPILERS + +if TYPE_CHECKING: + from typing import IO, Any + +log = get_logger(__name__) + + +class UndefinedNeverFail(jinja2.Undefined): + """ + A class for Undefined jinja variables. + This is even less strict than the default jinja2.Undefined class, + because it permits things like {{ MY_UNDEFINED_VAR[:2] }} and + {{ MY_UNDEFINED_VAR|int }}. This can mask lots of errors in jinja templates, so it + should only be used for a first-pass parse, when you plan on running a 'strict' + second pass later. + + Note: + When using this class, any usage of an undefined variable in a jinja template is recorded + in the (global) all_undefined_names class member. Therefore, after jinja rendering, + you can detect which undefined names were used by inspecting that list. + Be sure to clear the all_undefined_names list before calling template.render(). + """ + + all_undefined_names = [] + + def __init__( + self, + hint=None, + obj=jinja2.runtime.missing, + name=None, + exc=jinja2.exceptions.UndefinedError, + ): + jinja2.Undefined.__init__(self, hint, obj, name, exc) + + # Using any of these methods on an Undefined variable + # results in another Undefined variable. + __add__ = ( + __radd__ + ) = ( + __mul__ + ) = ( + __rmul__ + ) = ( + __div__ + ) = ( + __rdiv__ + ) = ( + __truediv__ + ) = ( + __rtruediv__ + ) = ( + __floordiv__ + ) = ( + __rfloordiv__ + ) = ( + __mod__ + ) = ( + __rmod__ + ) = ( + __pos__ + ) = ( + __neg__ + ) = ( + __call__ + ) = ( + __getitem__ + ) = __lt__ = __le__ = __gt__ = __ge__ = __complex__ = __pow__ = __rpow__ = ( + lambda self, *args, **kwargs: self._return_undefined(self._undefined_name) + ) + + # Accessing an attribute of an Undefined variable + # results in another Undefined variable. + def __getattr__(self, k): + try: + return object.__getattr__(self, k) + except AttributeError: + self._return_undefined(self._undefined_name + "." + k) + + # Unlike the methods above, Python requires that these + # few methods must always return the correct type + __str__ = __repr__ = lambda self: self._return_value("") + __unicode__ = lambda self: self._return_value("") + __int__ = lambda self: self._return_value(0) + __float__ = lambda self: self._return_value(0.0) + __nonzero__ = lambda self: self._return_value(False) + + def _return_undefined(self, result_name): + # Record that this undefined variable was actually used. + UndefinedNeverFail.all_undefined_names.append(self._undefined_name) + return UndefinedNeverFail( + hint=self._undefined_hint, + obj=self._undefined_obj, + name=result_name, + exc=self._undefined_exception, + ) + + def _return_value(self, value=None): + # Record that this undefined variable was actually used. + UndefinedNeverFail.all_undefined_names.append(self._undefined_name) + return value + + +class FilteredLoader(jinja2.BaseLoader): + """ + A pass-through for the given loader, except that the loaded source is + filtered according to any metadata selectors in the source text. + """ + + def __init__(self, unfiltered_loader, config): + self._unfiltered_loader = unfiltered_loader + self.list_templates = unfiltered_loader.list_templates + self.config = config + + def get_source(self, environment, template): + # we have circular imports here. Do a local import + from .metadata import get_selectors, select_lines + + contents, filename, uptodate = self._unfiltered_loader.get_source( + environment, template + ) + return ( + select_lines( + contents, + get_selectors(self.config), + variants_in_place=bool(self.config.variant), + ), + filename, + uptodate, + ) + + +def load_setup_py_data( + m, + setup_file="setup.py", + from_recipe_dir=False, + recipe_dir=None, + permit_undefined_jinja=True, +): + _setuptools_data = None + # we must copy the script into the work folder to avoid incompatible pyc files + origin_setup_script = os.path.join( + os.path.dirname(__file__), "_load_setup_py_data.py" + ) + dest_setup_script = os.path.join(m.config.work_dir, "_load_setup_py_data.py") + copy_into(origin_setup_script, dest_setup_script) + env = get_environ(m) + env["CONDA_BUILD_STATE"] = "RENDER" + if os.path.isfile(m.config.build_python): + args = [m.config.build_python, dest_setup_script, m.config.work_dir, setup_file] + if from_recipe_dir: + assert recipe_dir, "recipe_dir must be set if from_recipe_dir is True" + args.append("--from-recipe-dir") + args.extend(["--recipe-dir", recipe_dir]) + if permit_undefined_jinja: + args.append("--permit-undefined-jinja") + check_call_env(args, env=env) + # this is a file that the subprocess will have written + with open( + os.path.join(m.config.work_dir, "conda_build_loaded_setup_py.json") + ) as f: + _setuptools_data = json.load(f) + else: + try: + _setuptools_data = _load_setup_py_data.load_setup_py_data( + setup_file, + from_recipe_dir=from_recipe_dir, + recipe_dir=recipe_dir, + work_dir=m.config.work_dir, + permit_undefined_jinja=permit_undefined_jinja, + ) + except (TypeError, OSError): + # setup.py file doesn't yet exist. Will get picked up in future parsings + pass + except ImportError as e: + if permit_undefined_jinja: + log.debug( + "Reading setup.py failed due to missing modules. This is probably OK, " + "since it may succeed in later passes. Watch for incomplete recipe " + "info, though." + ) + else: + raise CondaBuildException( + "Could not render recipe - need modules " + f'installed in root env. Import error was "{e}"' + ) + # cleanup: we must leave the source tree empty unless the source code is already present + rm_rf(os.path.join(m.config.work_dir, "_load_setup_py_data.py")) + return _setuptools_data if _setuptools_data else {} + + +def load_setuptools( + m, + setup_file="setup.py", + from_recipe_dir=False, + recipe_dir=None, + permit_undefined_jinja=True, +): + warn( + "conda_build.jinja_context.load_setuptools is pending deprecation in a future release. " + "Use conda_build.jinja_context.load_setup_py_data instead.", + PendingDeprecationWarning, + ) + return load_setup_py_data( + m, + setup_file=setup_file, + from_recipe_dir=from_recipe_dir, + recipe_dir=recipe_dir, + permit_undefined_jinja=permit_undefined_jinja, + ) + + +def load_npm(): + mode_dict = {"mode": "r", "encoding": "utf-8"} + with open("package.json", **mode_dict) as pkg: + return json.load(pkg) + + +def _find_file(file_name: str, from_recipe_dir: bool, recipe_dir: str, config) -> str: + """Get the path to the given file which may be in the work_dir + or in the recipe_dir. + + Note, the returned file name may not exist. + """ + if os.path.isabs(file_name): + path = file_name + elif from_recipe_dir and recipe_dir: + path = os.path.abspath(os.path.join(recipe_dir, file_name)) + elif os.path.exists(config.work_dir): + path = os.path.join(config.work_dir, file_name) + + if not os.path.isfile(path): + raise FileNotFoundError(f"No such file: {file_name!r}") + return path + + +def load_file_regex( + config, + load_file, + regex_pattern, + from_recipe_dir=False, + recipe_dir=None, + permit_undefined_jinja=True, +): + try: + load_file = _find_file(load_file, from_recipe_dir, recipe_dir, config) + except FileNotFoundError as e: + if permit_undefined_jinja: + log.debug(e) + return None + raise + else: + with open(load_file) as lfile: + return re.search(regex_pattern, lfile.read()) + + +cached_env_dependencies = {} + + +def pin_compatible( + m, + package_name, + lower_bound=None, + upper_bound=None, + min_pin="x.x.x.x.x.x", + max_pin="x", + permit_undefined_jinja=False, + exact=False, + bypass_env_check=False, +): + """dynamically pin based on currently installed version. + + only mandatory input is package_name. + upper_bound is the authoritative upper bound, if provided. The lower bound is the the + currently installed version. + pin expressions are of the form 'x.x' - the number of pins is the number of x's separated + by ``.``. + """ + global cached_env_dependencies + compatibility = "" + + # optimization: this is slow (requires solver), so better to bypass it + # until the finalization stage. + if not bypass_env_check and not permit_undefined_jinja: + # this is the version split up into its component bits. + # There are two cases considered here (so far): + # 1. Good packages that follow semver style (if not philosophy). For example, 1.2.3 + # 2. Evil packages that cram everything alongside a single major version. For example, 9b + key = (m.name(), HashableDict(m.config.variant)) + if key in cached_env_dependencies: + pins = cached_env_dependencies[key] + else: + if m.is_cross and not m.build_is_host: + pins, _, _ = get_env_dependencies(m, "host", m.config.variant) + else: + pins, _, _ = get_env_dependencies(m, "build", m.config.variant) + if m.build_is_host: + host_pins, _, _ = get_env_dependencies(m, "host", m.config.variant) + pins.extend(host_pins) + cached_env_dependencies[key] = pins + versions = {p.split(" ")[0]: p.split(" ")[1:] for p in pins} + if versions: + if exact and versions.get(package_name): + compatibility = " ".join(versions[package_name]) + else: + version = lower_bound or versions.get(package_name) + if version: + if hasattr(version, "__iter__") and not isinstance(version, str): + version = version[0] + else: + version = str(version) + if upper_bound: + if min_pin or lower_bound: + compatibility = ">=" + str(version) + "," + compatibility += f"<{upper_bound}" + else: + compatibility = apply_pin_expressions(version, min_pin, max_pin) + + if not compatibility and not permit_undefined_jinja and not bypass_env_check: + check = re.compile(rf'pin_compatible\s*\(\s*["]{package_name}["]') + if check.search(m.extract_requirements_text()): + raise RuntimeError( + f"Could not get compatibility information for {package_name} package. " + "Is it one of your host dependencies?" + ) + return ( + " ".join((package_name, compatibility)) + if compatibility is not None + else package_name + ) + + +def pin_subpackage_against_outputs( + metadata, + matching_package_keys, + outputs, + min_pin, + max_pin, + exact, + permit_undefined_jinja, + skip_build_id=False, +): + pin = None + if matching_package_keys: + # two ways to match: + # 1. only one other output named the same as the subpackage_name from the key + # 2. whole key matches (both subpackage name and variant (used keys only)) + if len(matching_package_keys) == 1: + key = matching_package_keys[0] + elif len(matching_package_keys) > 1: + key = None + for pkg_name, variant in matching_package_keys: + # This matches other outputs with any keys that are common to both + # metadata objects. For debugging, the keys are always the (package + # name, used vars+values). It used to be (package name, variant) - + # but that was really big and hard to look at. + shared_vars = set(variant.keys()) & set(metadata.config.variant.keys()) + if not shared_vars or all( + variant[sv] == metadata.config.variant[sv] for sv in shared_vars + ): + key = (pkg_name, variant) + break + + if key in outputs: + sp_m = outputs[key][1] + if permit_undefined_jinja and not sp_m.version(): + pin = None + else: + if exact: + pin = " ".join( + [ + sp_m.name(), + sp_m.version(), + sp_m.build_id() + if not skip_build_id + else str(sp_m.build_number()), + ] + ) + else: + pin = f"{sp_m.name()} {apply_pin_expressions(sp_m.version(), min_pin, max_pin)}" + else: + pin = matching_package_keys[0][0] + return pin + + +def pin_subpackage( + metadata, + subpackage_name, + min_pin="x.x.x.x.x.x", + max_pin="x", + exact=False, + permit_undefined_jinja=False, + allow_no_other_outputs=False, + skip_build_id=False, +): + """allow people to specify pinnings based on subpackages that are defined in the recipe. + + For example, given a compiler package, allow it to specify either a compatible or exact + pinning on the runtime package that is also created by the compiler package recipe + """ + pin = None + + if not hasattr(metadata, "other_outputs"): + if allow_no_other_outputs: + pin = subpackage_name + else: + raise ValueError( + "Bug in conda-build: we need to have info about other outputs in " + "order to allow pinning to them. It's not here." + ) + else: + # two ways to match: + # 1. only one other output named the same as the subpackage_name from the key + # 2. whole key matches (both subpackage name and variant) + keys = list(metadata.other_outputs.keys()) + matching_package_keys = [k for k in keys if k[0] == subpackage_name] + pin = pin_subpackage_against_outputs( + metadata, + matching_package_keys, + metadata.other_outputs, + min_pin, + max_pin, + exact, + permit_undefined_jinja, + skip_build_id=skip_build_id, + ) + if not pin: + pin = subpackage_name + if not permit_undefined_jinja and not allow_no_other_outputs: + raise ValueError( + f"Didn't find subpackage version info for '{subpackage_name}', which is used in a" + " pin_subpackage expression. Is it actually a subpackage? If not, " + "you want pin_compatible instead." + ) + return pin + + +def native_compiler(language, config): + compiler = language + + for platform in [config.platform, config.platform.split("-")[0]]: + try: + compiler = DEFAULT_COMPILERS[platform][language] + break + except KeyError: + continue + if hasattr(compiler, "keys"): + compiler = compiler.get(config.variant.get("python", "nope"), "vs2017") + return compiler + + +def _target(language, config, permit_undefined_jinja=False, component="compiler"): + """Support configuration of compilers/stdlib. This is somewhat platform specific. + + Native compilers/stdlib never list their host - it is always implied. Generally, they are + metapackages, pointing at a package that does specify the host. These in turn may be + metapackages, pointing at a package where the host is the same as the target (both being the + native architecture). + """ + + if component == "compiler": + package_prefix = native_compiler(language, config) + else: + package_prefix = language + + version = None + if config.variant: + target_platform = config.variant.get("target_platform", config.subdir) + language_key = f"{language}_{component}" + # fall back to native if language-key is not explicitly set in variant + package_prefix = config.variant.get(language_key, package_prefix) + version = config.variant.get(language_key + "_version") + else: + target_platform = config.subdir + + # support cross components. A cross package will have a name such as + # gcc_target + # gcc_linux-cos6-64 + package = f"{package_prefix}_{target_platform}" + if version: + package = f"{package} {version}" + package = ensure_valid_spec(package, warn=False) + return package + + +# ensure we have compiler in namespace +compiler = partial(_target, component="compiler") + + +def ccache(method, config, permit_undefined_jinja=False): + config.ccache_method = method + return "ccache" + + +def cdt(package_name, config, permit_undefined_jinja=False): + """Support configuration of Core Dependency Trees. + We should define CDTs in a single location. The current + idea is to emit parts of the following to index.json (the + bits that the solver could make use of) and parts to + about.json (the other bits). + "system": { + "os": { + "type": "windows", "linux", "bsd", "darwin", + "os_distribution": "CentOS", "FreeBSD", "Windows", "osx", + "os_version": "6.9", "10.12.3", + "os_kernel_version" : "2.6.32", + "os_libc_family": "glibc", + "os_libc_version": "2.12", + } + "cpu": { + # Whichever cpu_architecture/cpu_isa we build-out for: + # .. armv6 is compatible with and uses all CPU features of a Raspberry PI 1 + # .. armv7a is compatible with and uses all CPU features of a Raspberry PI 2 + # .. aarch64 is compatible with and uses all CPU features of a Raspberry PI 3 + "cpu_architecture": "x86", "x86_64", + "armv6", "armv7a", "aarch32", "aarch64", + "powerpc", "powerpc64", + "s390", "s390x", + "cpu_isa": "nocona", "armv8.1-a", "armv8.3-a", + # "?" because the vfpu is specified by cpu_architecture + cpu_isa + rules. + "vfpu": "?", + "cpu_endianness": "BE", "LE", + } + "gpu ?": { + } + "compilerflags": { + # When put into a CDT these should be the base defaults. + # Package builds can and will change these frequently. + "CPPFLAGS": "-D_FORTIFY_SOURCE=2", + "CFLAGS": "-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe", + "CXXFLAGS": "-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe", + "LDFLAGS": "-Wl,-O1,--sort-common,--as-needed,-z,relro", + "FFLAGS": "-fopenmp", + # These are appended to the non-DEBUG values: + "DEBUG_CFLAGS": "-Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments", + "DEBUG_CXXFLAGS": "-Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments", + "DEBUG_FFLAGS": "-Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments", + } + } + """ # NOQA + + cdt_name = "cos6" + arch = config.host_arch or config.arch + if arch == "ppc64le" or arch == "aarch64" or arch == "ppc64" or arch == "s390x": + cdt_name = "cos7" + cdt_arch = arch + else: + cdt_arch = "x86_64" if arch == "64" else "i686" + if config.variant: + cdt_name = config.variant.get("cdt_name", cdt_name) + cdt_arch = config.variant.get("cdt_arch", cdt_arch) + if " " in package_name: + name = package_name.split(" ")[0] + ver_build = package_name.split(" ")[1:] + result = name + "-" + cdt_name + "-" + cdt_arch + " " + " ".join(ver_build) + else: + result = package_name + "-" + cdt_name + "-" + cdt_arch + return result + + +def resolved_packages(m, env, permit_undefined_jinja=False, bypass_env_check=False): + """Returns the final list of packages that are listed in host or build. + This include all packages (including the indirect dependencies) that will + be installed in the host or build environment. An example usage of this + jinja function can be:: + + requirements: + host: + - curl 7.55.1 + run_constrained: + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} + + which will render to:: + + requirements: + host: + - ca-certificates 2017.08.26 h1d4fec5_0 + - curl 7.55.1 h78862de_4 + - libgcc-ng 7.2.0 h7cc24e2_2 + - libssh2 1.8.0 h9cfc8f7_4 + - openssl 1.0.2n hb7f436b_0 + - zlib 1.2.11 ha838bed_2 + run_constrained: + - ca-certificates 2017.08.26 h1d4fec5_0 + - curl 7.55.1 h78862de_4 + - libgcc-ng 7.2.0 h7cc24e2_2 + - libssh2 1.8.0 h9cfc8f7_4 + - openssl 1.0.2n hb7f436b_0 + - zlib 1.2.11 ha838bed_2 + """ + if env not in ("host", "build"): + raise ValueError("Only host and build dependencies are supported.") + + package_names = [] + + # optimization: this is slow (requires solver), so better to bypass it + # until the finalization stage as done similarly in pin_compatible. + if not bypass_env_check and not permit_undefined_jinja: + package_names, _, _ = get_env_dependencies(m, env, m.config.variant) + + return package_names + + +def _toml_load(stream): + """ + Load .toml from a pathname. + """ + if isinstance(stream, (TextIOBase, str)): + if isinstance(stream, TextIOBase): + data = stream.read() + else: + data = stream + return tomllib.loads(data) + + # tomllib prefers binary files + return tomllib.load(stream) + + +_file_parsers = { + "json": json.load, + "yaml": yaml.safe_load, + "yml": yaml.safe_load, + "toml": _toml_load, +} + + +def _load_data(stream: IO, fmt: str, *args, **kwargs) -> Any: + try: + load = _file_parsers[fmt.lower()] + except KeyError: + raise ValueError( + f"Unknown file format: {fmt}. Allowed formats: {list(_file_parsers.keys())}" + ) + else: + return load(stream, *args, **kwargs) + + +def load_file_data( + filename: str, + fmt: str | None = None, + *args, + config=None, + from_recipe_dir=False, + recipe_dir=None, + permit_undefined_jinja=True, + **kwargs, +): + """Loads a file and returns the parsed data. + + For example to load file data from a JSON file, you can use any of: + + load_file_data("my_file.json") + load_file_data("my_json_file_without_ext", "json") + """ + try: + file_path = _find_file(filename, from_recipe_dir, recipe_dir, config) + except FileNotFoundError as e: + if permit_undefined_jinja: + log.debug(e) + return {} + raise + else: + with open(file_path) as f: + return _load_data( + f, fmt or pathlib.Path(filename).suffix.lstrip("."), *args, **kwargs + ) + + +def load_str_data(string: str, fmt: str, *args, **kwargs): + """Parses data from a string + + For example to load string data, you can use any of: + + load_str_data("[{"name": "foo", "val": "bar"}, {"name": "biz", "val": "buz"}]", "json") + load_str_data("[tool.poetry]\\nname = 'foo'", "toml") + load_str_data("name: foo\\nval: bar", "yaml") + """ + return _load_data(StringIO(string), fmt, *args, **kwargs) + + +def context_processor( + initial_metadata, + recipe_dir, + config, + permit_undefined_jinja, + allow_no_other_outputs=False, + bypass_env_check=False, + skip_build_id=False, + variant=None, +): + """ + Return a dictionary to use as context for jinja templates. + + initial_metadata: Augment the context with values from this MetaData object. + Used to bootstrap metadata contents via multiple parsing passes. + """ + ctx = get_environ( + m=initial_metadata, + for_env=False, + skip_build_id=skip_build_id, + escape_backslash=True, + variant=variant, + ) + environ = dict(os.environ) + environ.update(get_environ(m=initial_metadata, skip_build_id=skip_build_id)) + + ctx.update( + load_setup_py_data=partial( + load_setup_py_data, + m=initial_metadata, + recipe_dir=recipe_dir, + permit_undefined_jinja=permit_undefined_jinja, + ), + # maintain old alias for backwards compatibility: + load_setuptools=partial( + load_setuptools, + m=initial_metadata, + recipe_dir=recipe_dir, + permit_undefined_jinja=permit_undefined_jinja, + ), + load_npm=load_npm, + load_file_regex=partial( + load_file_regex, + config=config, + recipe_dir=recipe_dir, + permit_undefined_jinja=permit_undefined_jinja, + ), + load_file_data=partial( + load_file_data, + config=config, + recipe_dir=recipe_dir, + permit_undefined_jinja=permit_undefined_jinja, + ), + load_str_data=load_str_data, + installed=get_installed_packages( + os.path.join(config.host_prefix, "conda-meta") + ), + pin_compatible=partial( + pin_compatible, + initial_metadata, + permit_undefined_jinja=permit_undefined_jinja, + bypass_env_check=bypass_env_check, + ), + pin_subpackage=partial( + pin_subpackage, + initial_metadata, + permit_undefined_jinja=permit_undefined_jinja, + allow_no_other_outputs=allow_no_other_outputs, + skip_build_id=skip_build_id, + ), + compiler=partial( + _target, + config=config, + permit_undefined_jinja=permit_undefined_jinja, + component="compiler", + ), + stdlib=partial( + _target, + config=config, + permit_undefined_jinja=permit_undefined_jinja, + component="stdlib", + ), + cdt=partial(cdt, config=config, permit_undefined_jinja=permit_undefined_jinja), + ccache=partial( + ccache, config=config, permit_undefined_jinja=permit_undefined_jinja + ), + resolved_packages=partial( + resolved_packages, + initial_metadata, + permit_undefined_jinja=permit_undefined_jinja, + bypass_env_check=bypass_env_check, + ), + time=time, + datetime=datetime, + environ=environ, + ) + return ctx diff --git a/shared/package-files/9d/9db8bcd64916831ba24a4746574c773966927355b79f84f8597f3e627c80b93d/blob b/shared/package-files/9d/9db8bcd64916831ba24a4746574c773966927355b79f84f8597f3e627c80b93d/blob new file mode 100644 index 0000000000000000000000000000000000000000..10e8ad80c41ac13b24fac82a41fee581efa2ea50 --- /dev/null +++ b/shared/package-files/9d/9db8bcd64916831ba24a4746574c773966927355b79f84f8597f3e627c80b93d/blob @@ -0,0 +1,115 @@ +# Copyright 2022-2024 MetaOPT Team. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== +"""Utility functions for OpTree.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Callable, Iterable, Sequence, overload + + +if TYPE_CHECKING: + from optree.typing import S, T, U + + +def total_order_sorted( + iterable: Iterable[T], + *, + key: Callable[[T], Any] | None = None, + reverse: bool = False, +) -> list[T]: + """Sort an iterable in a total order. + + This is useful for sorting objects that are not comparable, e.g., dictionaries with different + types of keys. + """ + sequence = list(iterable) + + try: + # Sort directly if possible + return sorted(sequence, key=key, reverse=reverse) # type: ignore[type-var,arg-type] + except TypeError: + if key is None: + + def key_fn(x: T) -> tuple[str, Any]: + return (f'{x.__class__.__module__}.{x.__class__.__qualname__}', x) + + else: + + def key_fn(x: T) -> tuple[str, Any]: + y = key(x) + return (f'{y.__class__.__module__}.{y.__class__.__qualname__}', y) + + try: + # Add `{obj.__class__.__module__}.{obj.__class__.__qualname__}` to the key order to make + # it sortable between different types (e.g., `int` vs. `str`) + return sorted(sequence, key=key_fn, reverse=reverse) + except TypeError: # cannot sort the keys (e.g., user-defined types) + return sequence # fallback to original order + + +@overload +def safe_zip( + __iter1: Iterable[T], +) -> zip[tuple[T]]: # pragma: no cover + ... + + +@overload +def safe_zip( + __iter1: Iterable[T], + __iter2: Iterable[S], +) -> zip[tuple[T, S]]: # pragma: no cover + ... + + +@overload +def safe_zip( + __iter1: Iterable[T], + __iter2: Iterable[S], + __iter3: Iterable[U], +) -> zip[tuple[T, S, U]]: # pragma: no cover + ... + + +@overload +def safe_zip( + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + *__iters: Iterable[Any], +) -> zip[tuple[Any, ...]]: # pragma: no cover + ... + + +def safe_zip(*args): + """Strict zip that requires all arguments to be the same length.""" + seqs = [arg if isinstance(arg, Sequence) else list(arg) for arg in args] + if len(set(map(len, seqs))) > 1: + raise ValueError(f'length mismatch: {list(map(len, seqs))}') + return zip(*seqs) + + +def unzip2(xys: Iterable[tuple[T, S]]) -> tuple[tuple[T, ...], tuple[S, ...]]: + """Unzip sequence of length-2 tuples into two tuples.""" + # Note: we deliberately don't use zip(*xys) because it is lazily evaluated, + # is too permissive about inputs, and does not guarantee a length-2 output. + # For example, for empty dict: tuple(zip(*{}.items())) -> () + xs = [] + ys = [] + for x, y in xys: + xs.append(x) + ys.append(y) + return tuple(xs), tuple(ys) diff --git a/shared/package-files/9d/9dbcedde2d1a80f54fd3b8eaaa08e16988cc9ae022fd6e44d04cb0662bd53bc1/blob b/shared/package-files/9d/9dbcedde2d1a80f54fd3b8eaaa08e16988cc9ae022fd6e44d04cb0662bd53bc1/blob new file mode 100644 index 0000000000000000000000000000000000000000..b8fb2154b6d0618b62281578e5e947bca487cee4 --- /dev/null +++ b/shared/package-files/9d/9dbcedde2d1a80f54fd3b8eaaa08e16988cc9ae022fd6e44d04cb0662bd53bc1/blob @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +""" +backports.makefile +~~~~~~~~~~~~~~~~~~ + +Backports the Python 3 ``socket.makefile`` method for use with anything that +wants to create a "fake" socket object. +""" +import io +from socket import SocketIO + + +def backport_makefile( + self, mode="r", buffering=None, encoding=None, errors=None, newline=None +): + """ + Backport of ``socket.makefile`` from Python 3.5. + """ + if not set(mode) <= {"r", "w", "b"}: + raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,)) + writing = "w" in mode + reading = "r" in mode or not writing + assert reading or writing + binary = "b" in mode + rawmode = "" + if reading: + rawmode += "r" + if writing: + rawmode += "w" + raw = SocketIO(self, rawmode) + self._makefile_refs += 1 + if buffering is None: + buffering = -1 + if buffering < 0: + buffering = io.DEFAULT_BUFFER_SIZE + if buffering == 0: + if not binary: + raise ValueError("unbuffered streams must be binary") + return raw + if reading and writing: + buffer = io.BufferedRWPair(raw, raw, buffering) + elif reading: + buffer = io.BufferedReader(raw, buffering) + else: + assert writing + buffer = io.BufferedWriter(raw, buffering) + if binary: + return buffer + text = io.TextIOWrapper(buffer, encoding, errors, newline) + text.mode = mode + return text diff --git a/shared/package-files/9d/9dbf9c32190e98ef2bdb5a35d2f7070944e3b9f7e3468caf44b586536d640290/blob b/shared/package-files/9d/9dbf9c32190e98ef2bdb5a35d2f7070944e3b9f7e3468caf44b586536d640290/blob new file mode 100644 index 0000000000000000000000000000000000000000..c1b9b1284d4cdb8ed7250b54795c5434db44098d --- /dev/null +++ b/shared/package-files/9d/9dbf9c32190e98ef2bdb5a35d2f7070944e3b9f7e3468caf44b586536d640290/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor align_as(const at::Tensor & self, const at::Tensor & other); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9d/9dc0de11c61e814988290a03068b9f5215568f8758a59017c4b5f4aa612ab750/blob b/shared/package-files/9d/9dc0de11c61e814988290a03068b9f5215568f8758a59017c4b5f4aa612ab750/blob new file mode 100644 index 0000000000000000000000000000000000000000..9ddd257552ecda94cb55bbc1eed1dae8a5382380 --- /dev/null +++ b/shared/package-files/9d/9dc0de11c61e814988290a03068b9f5215568f8758a59017c4b5f4aa612ab750/blob @@ -0,0 +1,884 @@ +import math +from typing import List, Optional, Tuple + +import torch + + +__all__ = ["Emformer"] + + +def _lengths_to_padding_mask(lengths: torch.Tensor) -> torch.Tensor: + batch_size = lengths.shape[0] + max_length = int(torch.max(lengths).item()) + padding_mask = torch.arange(max_length, device=lengths.device, dtype=lengths.dtype).expand( + batch_size, max_length + ) >= lengths.unsqueeze(1) + return padding_mask + + +def _gen_padding_mask( + utterance: torch.Tensor, + right_context: torch.Tensor, + summary: torch.Tensor, + lengths: torch.Tensor, + mems: torch.Tensor, + left_context_key: Optional[torch.Tensor] = None, +) -> Optional[torch.Tensor]: + T = right_context.size(0) + utterance.size(0) + summary.size(0) + B = right_context.size(1) + if B == 1: + padding_mask = None + else: + right_context_blocks_length = T - torch.max(lengths).int() - summary.size(0) + left_context_blocks_length = left_context_key.size(0) if left_context_key is not None else 0 + klengths = lengths + mems.size(0) + right_context_blocks_length + left_context_blocks_length + padding_mask = _lengths_to_padding_mask(lengths=klengths) + return padding_mask + + +def _get_activation_module(activation: str) -> torch.nn.Module: + if activation == "relu": + return torch.nn.ReLU() + elif activation == "gelu": + return torch.nn.GELU() + elif activation == "silu": + return torch.nn.SiLU() + else: + raise ValueError(f"Unsupported activation {activation}") + + +def _get_weight_init_gains(weight_init_scale_strategy: Optional[str], num_layers: int) -> List[Optional[float]]: + if weight_init_scale_strategy is None: + return [None for _ in range(num_layers)] + elif weight_init_scale_strategy == "depthwise": + return [1.0 / math.sqrt(layer_idx + 1) for layer_idx in range(num_layers)] + elif weight_init_scale_strategy == "constant": + return [1.0 / math.sqrt(2) for layer_idx in range(num_layers)] + else: + raise ValueError(f"Unsupported weight_init_scale_strategy value {weight_init_scale_strategy}") + + +def _gen_attention_mask_block( + col_widths: List[int], col_mask: List[bool], num_rows: int, device: torch.device +) -> torch.Tensor: + if len(col_widths) != len(col_mask): + raise ValueError("Length of col_widths must match that of col_mask") + + mask_block = [ + torch.ones(num_rows, col_width, device=device) + if is_ones_col + else torch.zeros(num_rows, col_width, device=device) + for col_width, is_ones_col in zip(col_widths, col_mask) + ] + return torch.cat(mask_block, dim=1) + + +class _EmformerAttention(torch.nn.Module): + r"""Emformer layer attention module. + + Args: + input_dim (int): input dimension. + num_heads (int): number of attention heads in each Emformer layer. + dropout (float, optional): dropout probability. (Default: 0.0) + weight_init_gain (float or None, optional): scale factor to apply when initializing + attention module parameters. (Default: ``None``) + tanh_on_mem (bool, optional): if ``True``, applies tanh to memory elements. (Default: ``False``) + negative_inf (float, optional): value to use for negative infinity in attention weights. (Default: -1e8) + """ + + def __init__( + self, + input_dim: int, + num_heads: int, + dropout: float = 0.0, + weight_init_gain: Optional[float] = None, + tanh_on_mem: bool = False, + negative_inf: float = -1e8, + ): + super().__init__() + + if input_dim % num_heads != 0: + raise ValueError(f"input_dim ({input_dim}) is not a multiple of num_heads ({num_heads}).") + + self.input_dim = input_dim + self.num_heads = num_heads + self.dropout = dropout + self.tanh_on_mem = tanh_on_mem + self.negative_inf = negative_inf + + self.scaling = (self.input_dim // self.num_heads) ** -0.5 + + self.emb_to_key_value = torch.nn.Linear(input_dim, 2 * input_dim, bias=True) + self.emb_to_query = torch.nn.Linear(input_dim, input_dim, bias=True) + self.out_proj = torch.nn.Linear(input_dim, input_dim, bias=True) + + if weight_init_gain: + torch.nn.init.xavier_uniform_(self.emb_to_key_value.weight, gain=weight_init_gain) + torch.nn.init.xavier_uniform_(self.emb_to_query.weight, gain=weight_init_gain) + + def _gen_key_value(self, input: torch.Tensor, mems: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: + T, _, _ = input.shape + summary_length = mems.size(0) + 1 + right_ctx_utterance_block = input[: T - summary_length] + mems_right_ctx_utterance_block = torch.cat([mems, right_ctx_utterance_block]) + key, value = self.emb_to_key_value(mems_right_ctx_utterance_block).chunk(chunks=2, dim=2) + return key, value + + def _gen_attention_probs( + self, + attention_weights: torch.Tensor, + attention_mask: torch.Tensor, + padding_mask: Optional[torch.Tensor], + ) -> torch.Tensor: + attention_weights_float = attention_weights.float() + attention_weights_float = attention_weights_float.masked_fill(attention_mask.unsqueeze(0), self.negative_inf) + T = attention_weights.size(1) + B = attention_weights.size(0) // self.num_heads + if padding_mask is not None: + attention_weights_float = attention_weights_float.view(B, self.num_heads, T, -1) + attention_weights_float = attention_weights_float.masked_fill( + padding_mask.unsqueeze(1).unsqueeze(2).to(torch.bool), self.negative_inf + ) + attention_weights_float = attention_weights_float.view(B * self.num_heads, T, -1) + attention_probs = torch.nn.functional.softmax(attention_weights_float, dim=-1).type_as(attention_weights) + return torch.nn.functional.dropout(attention_probs, p=float(self.dropout), training=self.training) + + def _forward_impl( + self, + utterance: torch.Tensor, + lengths: torch.Tensor, + right_context: torch.Tensor, + summary: torch.Tensor, + mems: torch.Tensor, + attention_mask: torch.Tensor, + left_context_key: Optional[torch.Tensor] = None, + left_context_val: Optional[torch.Tensor] = None, + ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]: + B = utterance.size(1) + T = right_context.size(0) + utterance.size(0) + summary.size(0) + + # Compute query with [right context, utterance, summary]. + query = self.emb_to_query(torch.cat([right_context, utterance, summary])) + + # Compute key and value with [mems, right context, utterance]. + key, value = self.emb_to_key_value(torch.cat([mems, right_context, utterance])).chunk(chunks=2, dim=2) + + if left_context_key is not None and left_context_val is not None: + right_context_blocks_length = T - torch.max(lengths).int() - summary.size(0) + key = torch.cat( + [ + key[: mems.size(0) + right_context_blocks_length], + left_context_key, + key[mems.size(0) + right_context_blocks_length :], + ], + ) + value = torch.cat( + [ + value[: mems.size(0) + right_context_blocks_length], + left_context_val, + value[mems.size(0) + right_context_blocks_length :], + ], + ) + + # Compute attention weights from query, key, and value. + reshaped_query, reshaped_key, reshaped_value = [ + tensor.contiguous().view(-1, B * self.num_heads, self.input_dim // self.num_heads).transpose(0, 1) + for tensor in [query, key, value] + ] + attention_weights = torch.bmm(reshaped_query * self.scaling, reshaped_key.transpose(1, 2)) + + # Compute padding mask. + padding_mask = _gen_padding_mask(utterance, right_context, summary, lengths, mems, left_context_key) + + # Compute attention probabilities. + attention_probs = self._gen_attention_probs(attention_weights, attention_mask, padding_mask) + + # Compute attention. + attention = torch.bmm(attention_probs, reshaped_value) + if attention.shape != ( + B * self.num_heads, + T, + self.input_dim // self.num_heads, + ): + raise AssertionError("Computed attention has incorrect dimensions") + attention = attention.transpose(0, 1).contiguous().view(T, B, self.input_dim) + + # Apply output projection. + output_right_context_mems = self.out_proj(attention) + + summary_length = summary.size(0) + output_right_context = output_right_context_mems[: T - summary_length] + output_mems = output_right_context_mems[T - summary_length :] + if self.tanh_on_mem: + output_mems = torch.tanh(output_mems) + else: + output_mems = torch.clamp(output_mems, min=-10, max=10) + + return output_right_context, output_mems, key, value + + def forward( + self, + utterance: torch.Tensor, + lengths: torch.Tensor, + right_context: torch.Tensor, + summary: torch.Tensor, + mems: torch.Tensor, + attention_mask: torch.Tensor, + ) -> Tuple[torch.Tensor, torch.Tensor]: + r"""Forward pass for training. + + B: batch size; + D: feature dimension of each frame; + T: number of utterance frames; + R: number of right context frames; + S: number of summary elements; + M: number of memory elements. + + Args: + utterance (torch.Tensor): utterance frames, with shape `(T, B, D)`. + lengths (torch.Tensor): with shape `(B,)` and i-th element representing + number of valid frames for i-th batch element in ``utterance``. + right_context (torch.Tensor): right context frames, with shape `(R, B, D)`. + summary (torch.Tensor): summary elements, with shape `(S, B, D)`. + mems (torch.Tensor): memory elements, with shape `(M, B, D)`. + attention_mask (torch.Tensor): attention mask for underlying attention module. + + Returns: + (Tensor, Tensor): + Tensor + output frames corresponding to utterance and right_context, with shape `(T + R, B, D)`. + Tensor + updated memory elements, with shape `(M, B, D)`. + """ + output, output_mems, _, _ = self._forward_impl(utterance, lengths, right_context, summary, mems, attention_mask) + return output, output_mems[:-1] + + @torch.jit.export + def infer( + self, + utterance: torch.Tensor, + lengths: torch.Tensor, + right_context: torch.Tensor, + summary: torch.Tensor, + mems: torch.Tensor, + left_context_key: torch.Tensor, + left_context_val: torch.Tensor, + ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]: + r"""Forward pass for inference. + + B: batch size; + D: feature dimension of each frame; + T: number of utterance frames; + R: number of right context frames; + S: number of summary elements; + M: number of memory elements. + + Args: + utterance (torch.Tensor): utterance frames, with shape `(T, B, D)`. + lengths (torch.Tensor): with shape `(B,)` and i-th element representing + number of valid frames for i-th batch element in ``utterance``. + right_context (torch.Tensor): right context frames, with shape `(R, B, D)`. + summary (torch.Tensor): summary elements, with shape `(S, B, D)`. + mems (torch.Tensor): memory elements, with shape `(M, B, D)`. + left_context_key (torch.Tensor): left context attention key computed from preceding invocation. + left_context_val (torch.Tensor): left context attention value computed from preceding invocation. + + Returns: + (Tensor, Tensor, Tensor, and Tensor): + Tensor + output frames corresponding to utterance and right_context, with shape `(T + R, B, D)`. + Tensor + updated memory elements, with shape `(M, B, D)`. + Tensor + attention key computed for left context and utterance. + Tensor + attention value computed for left context and utterance. + """ + query_dim = right_context.size(0) + utterance.size(0) + summary.size(0) + key_dim = right_context.size(0) + utterance.size(0) + mems.size(0) + left_context_key.size(0) + attention_mask = torch.zeros(query_dim, key_dim).to(dtype=torch.bool, device=utterance.device) + attention_mask[-1, : mems.size(0)] = True + output, output_mems, key, value = self._forward_impl( + utterance, + lengths, + right_context, + summary, + mems, + attention_mask, + left_context_key=left_context_key, + left_context_val=left_context_val, + ) + return ( + output, + output_mems, + key[mems.size(0) + right_context.size(0) :], + value[mems.size(0) + right_context.size(0) :], + ) + + +class _EmformerLayer(torch.nn.Module): + r"""Emformer layer that constitutes Emformer. + + Args: + input_dim (int): input dimension. + num_heads (int): number of attention heads. + ffn_dim: (int): hidden layer dimension of feedforward network. + segment_length (int): length of each input segment. + dropout (float, optional): dropout probability. (Default: 0.0) + activation (str, optional): activation function to use in feedforward network. + Must be one of ("relu", "gelu", "silu"). (Default: "relu") + left_context_length (int, optional): length of left context. (Default: 0) + max_memory_size (int, optional): maximum number of memory elements to use. (Default: 0) + weight_init_gain (float or None, optional): scale factor to apply when initializing + attention module parameters. (Default: ``None``) + tanh_on_mem (bool, optional): if ``True``, applies tanh to memory elements. (Default: ``False``) + negative_inf (float, optional): value to use for negative infinity in attention weights. (Default: -1e8) + """ + + def __init__( + self, + input_dim: int, + num_heads: int, + ffn_dim: int, + segment_length: int, + dropout: float = 0.0, + activation: str = "relu", + left_context_length: int = 0, + max_memory_size: int = 0, + weight_init_gain: Optional[float] = None, + tanh_on_mem: bool = False, + negative_inf: float = -1e8, + ): + super().__init__() + + self.attention = _EmformerAttention( + input_dim=input_dim, + num_heads=num_heads, + dropout=dropout, + weight_init_gain=weight_init_gain, + tanh_on_mem=tanh_on_mem, + negative_inf=negative_inf, + ) + self.dropout = torch.nn.Dropout(dropout) + self.memory_op = torch.nn.AvgPool1d(kernel_size=segment_length, stride=segment_length, ceil_mode=True) + + activation_module = _get_activation_module(activation) + self.pos_ff = torch.nn.Sequential( + torch.nn.LayerNorm(input_dim), + torch.nn.Linear(input_dim, ffn_dim), + activation_module, + torch.nn.Dropout(dropout), + torch.nn.Linear(ffn_dim, input_dim), + torch.nn.Dropout(dropout), + ) + self.layer_norm_input = torch.nn.LayerNorm(input_dim) + self.layer_norm_output = torch.nn.LayerNorm(input_dim) + + self.left_context_length = left_context_length + self.segment_length = segment_length + self.max_memory_size = max_memory_size + self.input_dim = input_dim + + self.use_mem = max_memory_size > 0 + + def _init_state(self, batch_size: int, device: Optional[torch.device]) -> List[torch.Tensor]: + empty_memory = torch.zeros(self.max_memory_size, batch_size, self.input_dim, device=device) + left_context_key = torch.zeros(self.left_context_length, batch_size, self.input_dim, device=device) + left_context_val = torch.zeros(self.left_context_length, batch_size, self.input_dim, device=device) + past_length = torch.zeros(1, batch_size, dtype=torch.int32, device=device) + return [empty_memory, left_context_key, left_context_val, past_length] + + def _unpack_state(self, state: List[torch.Tensor]) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: + past_length = state[3][0][0].item() + past_left_context_length = min(self.left_context_length, past_length) + past_mem_length = min(self.max_memory_size, math.ceil(past_length / self.segment_length)) + pre_mems = state[0][self.max_memory_size - past_mem_length :] + lc_key = state[1][self.left_context_length - past_left_context_length :] + lc_val = state[2][self.left_context_length - past_left_context_length :] + return pre_mems, lc_key, lc_val + + def _pack_state( + self, + next_k: torch.Tensor, + next_v: torch.Tensor, + update_length: int, + mems: torch.Tensor, + state: List[torch.Tensor], + ) -> List[torch.Tensor]: + new_k = torch.cat([state[1], next_k]) + new_v = torch.cat([state[2], next_v]) + state[0] = torch.cat([state[0], mems])[-self.max_memory_size :] + state[1] = new_k[new_k.shape[0] - self.left_context_length :] + state[2] = new_v[new_v.shape[0] - self.left_context_length :] + state[3] = state[3] + update_length + return state + + def _process_attention_output( + self, + rc_output: torch.Tensor, + utterance: torch.Tensor, + right_context: torch.Tensor, + ) -> torch.Tensor: + result = self.dropout(rc_output) + torch.cat([right_context, utterance]) + result = self.pos_ff(result) + result + result = self.layer_norm_output(result) + return result + + def _apply_pre_attention_layer_norm( + self, utterance: torch.Tensor, right_context: torch.Tensor + ) -> Tuple[torch.Tensor, torch.Tensor]: + layer_norm_input = self.layer_norm_input(torch.cat([right_context, utterance])) + return ( + layer_norm_input[right_context.size(0) :], + layer_norm_input[: right_context.size(0)], + ) + + def _apply_post_attention_ffn( + self, rc_output: torch.Tensor, utterance: torch.Tensor, right_context: torch.Tensor + ) -> Tuple[torch.Tensor, torch.Tensor]: + rc_output = self._process_attention_output(rc_output, utterance, right_context) + return rc_output[right_context.size(0) :], rc_output[: right_context.size(0)] + + def _apply_attention_forward( + self, + utterance: torch.Tensor, + lengths: torch.Tensor, + right_context: torch.Tensor, + mems: torch.Tensor, + attention_mask: Optional[torch.Tensor], + ) -> Tuple[torch.Tensor, torch.Tensor]: + if attention_mask is None: + raise ValueError("attention_mask must be not None when for_inference is False") + + if self.use_mem: + summary = self.memory_op(utterance.permute(1, 2, 0)).permute(2, 0, 1) + else: + summary = torch.empty(0).to(dtype=utterance.dtype, device=utterance.device) + rc_output, next_m = self.attention( + utterance=utterance, + lengths=lengths, + right_context=right_context, + summary=summary, + mems=mems, + attention_mask=attention_mask, + ) + return rc_output, next_m + + def _apply_attention_infer( + self, + utterance: torch.Tensor, + lengths: torch.Tensor, + right_context: torch.Tensor, + mems: torch.Tensor, + state: Optional[List[torch.Tensor]], + ) -> Tuple[torch.Tensor, torch.Tensor, List[torch.Tensor]]: + if state is None: + state = self._init_state(utterance.size(1), device=utterance.device) + pre_mems, lc_key, lc_val = self._unpack_state(state) + if self.use_mem: + summary = self.memory_op(utterance.permute(1, 2, 0)).permute(2, 0, 1) + summary = summary[:1] + else: + summary = torch.empty(0).to(dtype=utterance.dtype, device=utterance.device) + rc_output, next_m, next_k, next_v = self.attention.infer( + utterance=utterance, + lengths=lengths, + right_context=right_context, + summary=summary, + mems=pre_mems, + left_context_key=lc_key, + left_context_val=lc_val, + ) + state = self._pack_state(next_k, next_v, utterance.size(0), mems, state) + return rc_output, next_m, state + + def forward( + self, + utterance: torch.Tensor, + lengths: torch.Tensor, + right_context: torch.Tensor, + mems: torch.Tensor, + attention_mask: torch.Tensor, + ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: + r"""Forward pass for training. + + B: batch size; + D: feature dimension of each frame; + T: number of utterance frames; + R: number of right context frames; + M: number of memory elements. + + Args: + utterance (torch.Tensor): utterance frames, with shape `(T, B, D)`. + lengths (torch.Tensor): with shape `(B,)` and i-th element representing + number of valid frames for i-th batch element in ``utterance``. + right_context (torch.Tensor): right context frames, with shape `(R, B, D)`. + mems (torch.Tensor): memory elements, with shape `(M, B, D)`. + attention_mask (torch.Tensor): attention mask for underlying attention module. + + Returns: + (Tensor, Tensor, Tensor): + Tensor + encoded utterance frames, with shape `(T, B, D)`. + Tensor + updated right context frames, with shape `(R, B, D)`. + Tensor + updated memory elements, with shape `(M, B, D)`. + """ + ( + layer_norm_utterance, + layer_norm_right_context, + ) = self._apply_pre_attention_layer_norm(utterance, right_context) + rc_output, output_mems = self._apply_attention_forward( + layer_norm_utterance, + lengths, + layer_norm_right_context, + mems, + attention_mask, + ) + output_utterance, output_right_context = self._apply_post_attention_ffn(rc_output, utterance, right_context) + return output_utterance, output_right_context, output_mems + + @torch.jit.export + def infer( + self, + utterance: torch.Tensor, + lengths: torch.Tensor, + right_context: torch.Tensor, + state: Optional[List[torch.Tensor]], + mems: torch.Tensor, + ) -> Tuple[torch.Tensor, torch.Tensor, List[torch.Tensor], torch.Tensor]: + r"""Forward pass for inference. + + B: batch size; + D: feature dimension of each frame; + T: number of utterance frames; + R: number of right context frames; + M: number of memory elements. + + Args: + utterance (torch.Tensor): utterance frames, with shape `(T, B, D)`. + lengths (torch.Tensor): with shape `(B,)` and i-th element representing + number of valid frames for i-th batch element in ``utterance``. + right_context (torch.Tensor): right context frames, with shape `(R, B, D)`. + state (List[torch.Tensor] or None): list of tensors representing layer internal state + generated in preceding invocation of ``infer``. + mems (torch.Tensor): memory elements, with shape `(M, B, D)`. + + Returns: + (Tensor, Tensor, List[torch.Tensor], Tensor): + Tensor + encoded utterance frames, with shape `(T, B, D)`. + Tensor + updated right context frames, with shape `(R, B, D)`. + List[Tensor] + list of tensors representing layer internal state + generated in current invocation of ``infer``. + Tensor + updated memory elements, with shape `(M, B, D)`. + """ + ( + layer_norm_utterance, + layer_norm_right_context, + ) = self._apply_pre_attention_layer_norm(utterance, right_context) + rc_output, output_mems, output_state = self._apply_attention_infer( + layer_norm_utterance, lengths, layer_norm_right_context, mems, state + ) + output_utterance, output_right_context = self._apply_post_attention_ffn(rc_output, utterance, right_context) + return output_utterance, output_right_context, output_state, output_mems + + +class _EmformerImpl(torch.nn.Module): + def __init__( + self, + emformer_layers: torch.nn.ModuleList, + segment_length: int, + left_context_length: int = 0, + right_context_length: int = 0, + max_memory_size: int = 0, + ): + super().__init__() + + self.use_mem = max_memory_size > 0 + self.memory_op = torch.nn.AvgPool1d( + kernel_size=segment_length, + stride=segment_length, + ceil_mode=True, + ) + self.emformer_layers = emformer_layers + self.left_context_length = left_context_length + self.right_context_length = right_context_length + self.segment_length = segment_length + self.max_memory_size = max_memory_size + + def _gen_right_context(self, input: torch.Tensor) -> torch.Tensor: + T = input.shape[0] + num_segs = math.ceil((T - self.right_context_length) / self.segment_length) + right_context_blocks = [] + for seg_idx in range(num_segs - 1): + start = (seg_idx + 1) * self.segment_length + end = start + self.right_context_length + right_context_blocks.append(input[start:end]) + right_context_blocks.append(input[T - self.right_context_length :]) + return torch.cat(right_context_blocks) + + def _gen_attention_mask_col_widths(self, seg_idx: int, utterance_length: int) -> List[int]: + num_segs = math.ceil(utterance_length / self.segment_length) + rc = self.right_context_length + lc = self.left_context_length + rc_start = seg_idx * rc + rc_end = rc_start + rc + seg_start = max(seg_idx * self.segment_length - lc, 0) + seg_end = min((seg_idx + 1) * self.segment_length, utterance_length) + rc_length = self.right_context_length * num_segs + + if self.use_mem: + m_start = max(seg_idx - self.max_memory_size, 0) + mem_length = num_segs - 1 + col_widths = [ + m_start, # before memory + seg_idx - m_start, # memory + mem_length - seg_idx, # after memory + rc_start, # before right context + rc, # right context + rc_length - rc_end, # after right context + seg_start, # before query segment + seg_end - seg_start, # query segment + utterance_length - seg_end, # after query segment + ] + else: + col_widths = [ + rc_start, # before right context + rc, # right context + rc_length - rc_end, # after right context + seg_start, # before query segment + seg_end - seg_start, # query segment + utterance_length - seg_end, # after query segment + ] + + return col_widths + + def _gen_attention_mask(self, input: torch.Tensor) -> torch.Tensor: + utterance_length = input.size(0) + num_segs = math.ceil(utterance_length / self.segment_length) + + rc_mask = [] + query_mask = [] + summary_mask = [] + + if self.use_mem: + num_cols = 9 + # memory, right context, query segment + rc_q_cols_mask = [idx in [1, 4, 7] for idx in range(num_cols)] + # right context, query segment + s_cols_mask = [idx in [4, 7] for idx in range(num_cols)] + masks_to_concat = [rc_mask, query_mask, summary_mask] + else: + num_cols = 6 + # right context, query segment + rc_q_cols_mask = [idx in [1, 4] for idx in range(num_cols)] + s_cols_mask = None + masks_to_concat = [rc_mask, query_mask] + + for seg_idx in range(num_segs): + col_widths = self._gen_attention_mask_col_widths(seg_idx, utterance_length) + + rc_mask_block = _gen_attention_mask_block( + col_widths, rc_q_cols_mask, self.right_context_length, input.device + ) + rc_mask.append(rc_mask_block) + + query_mask_block = _gen_attention_mask_block( + col_widths, + rc_q_cols_mask, + min( + self.segment_length, + utterance_length - seg_idx * self.segment_length, + ), + input.device, + ) + query_mask.append(query_mask_block) + + if s_cols_mask is not None: + summary_mask_block = _gen_attention_mask_block(col_widths, s_cols_mask, 1, input.device) + summary_mask.append(summary_mask_block) + + attention_mask = (1 - torch.cat([torch.cat(mask) for mask in masks_to_concat])).to(torch.bool) + return attention_mask + + def forward(self, input: torch.Tensor, lengths: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: + r"""Forward pass for training and non-streaming inference. + + B: batch size; + T: max number of input frames in batch; + D: feature dimension of each frame. + + Args: + input (torch.Tensor): utterance frames right-padded with right context frames, with + shape `(B, T + right_context_length, D)`. + lengths (torch.Tensor): with shape `(B,)` and i-th element representing + number of valid utterance frames for i-th batch element in ``input``. + + Returns: + (Tensor, Tensor): + Tensor + output frames, with shape `(B, T, D)`. + Tensor + output lengths, with shape `(B,)` and i-th element representing + number of valid frames for i-th batch element in output frames. + """ + input = input.permute(1, 0, 2) + right_context = self._gen_right_context(input) + utterance = input[: input.size(0) - self.right_context_length] + attention_mask = self._gen_attention_mask(utterance) + mems = ( + self.memory_op(utterance.permute(1, 2, 0)).permute(2, 0, 1)[:-1] + if self.use_mem + else torch.empty(0).to(dtype=input.dtype, device=input.device) + ) + output = utterance + for layer in self.emformer_layers: + output, right_context, mems = layer(output, lengths, right_context, mems, attention_mask) + return output.permute(1, 0, 2), lengths + + @torch.jit.export + def infer( + self, + input: torch.Tensor, + lengths: torch.Tensor, + states: Optional[List[List[torch.Tensor]]] = None, + ) -> Tuple[torch.Tensor, torch.Tensor, List[List[torch.Tensor]]]: + r"""Forward pass for streaming inference. + + B: batch size; + D: feature dimension of each frame. + + Args: + input (torch.Tensor): utterance frames right-padded with right context frames, with + shape `(B, segment_length + right_context_length, D)`. + lengths (torch.Tensor): with shape `(B,)` and i-th element representing + number of valid frames for i-th batch element in ``input``. + states (List[List[torch.Tensor]] or None, optional): list of lists of tensors + representing internal state generated in preceding invocation of ``infer``. (Default: ``None``) + + Returns: + (Tensor, Tensor, List[List[Tensor]]): + Tensor + output frames, with shape `(B, segment_length, D)`. + Tensor + output lengths, with shape `(B,)` and i-th element representing + number of valid frames for i-th batch element in output frames. + List[List[Tensor]] + output states; list of lists of tensors representing internal state + generated in current invocation of ``infer``. + """ + if input.size(1) != self.segment_length + self.right_context_length: + raise ValueError( + "Per configured segment_length and right_context_length" + f", expected size of {self.segment_length + self.right_context_length} for dimension 1 of input" + f", but got {input.size(1)}." + ) + input = input.permute(1, 0, 2) + right_context_start_idx = input.size(0) - self.right_context_length + right_context = input[right_context_start_idx:] + utterance = input[:right_context_start_idx] + output_lengths = torch.clamp(lengths - self.right_context_length, min=0) + mems = ( + self.memory_op(utterance.permute(1, 2, 0)).permute(2, 0, 1) + if self.use_mem + else torch.empty(0).to(dtype=input.dtype, device=input.device) + ) + output = utterance + output_states: List[List[torch.Tensor]] = [] + for layer_idx, layer in enumerate(self.emformer_layers): + output, right_context, output_state, mems = layer.infer( + output, + output_lengths, + right_context, + None if states is None else states[layer_idx], + mems, + ) + output_states.append(output_state) + + return output.permute(1, 0, 2), output_lengths, output_states + + +class Emformer(_EmformerImpl): + r"""Emformer architecture introduced in + *Emformer: Efficient Memory Transformer Based Acoustic Model for Low Latency Streaming Speech Recognition* + :cite:`shi2021emformer`. + + See Also: + * :func:`~torchaudio.models.emformer_rnnt_model`, + :func:`~torchaudio.models.emformer_rnnt_base`: factory functions. + * :class:`torchaudio.pipelines.RNNTBundle`: ASR pipelines with pretrained model. + + Args: + input_dim (int): input dimension. + num_heads (int): number of attention heads in each Emformer layer. + ffn_dim (int): hidden layer dimension of each Emformer layer's feedforward network. + num_layers (int): number of Emformer layers to instantiate. + segment_length (int): length of each input segment. + dropout (float, optional): dropout probability. (Default: 0.0) + activation (str, optional): activation function to use in each Emformer layer's + feedforward network. Must be one of ("relu", "gelu", "silu"). (Default: "relu") + left_context_length (int, optional): length of left context. (Default: 0) + right_context_length (int, optional): length of right context. (Default: 0) + max_memory_size (int, optional): maximum number of memory elements to use. (Default: 0) + weight_init_scale_strategy (str or None, optional): per-layer weight initialization scaling + strategy. Must be one of ("depthwise", "constant", ``None``). (Default: "depthwise") + tanh_on_mem (bool, optional): if ``True``, applies tanh to memory elements. (Default: ``False``) + negative_inf (float, optional): value to use for negative infinity in attention weights. (Default: -1e8) + + Examples: + >>> emformer = Emformer(512, 8, 2048, 20, 4, right_context_length=1) + >>> input = torch.rand(128, 400, 512) # batch, num_frames, feature_dim + >>> lengths = torch.randint(1, 200, (128,)) # batch + >>> output, lengths = emformer(input, lengths) + >>> input = torch.rand(128, 5, 512) + >>> lengths = torch.ones(128) * 5 + >>> output, lengths, states = emformer.infer(input, lengths, None) + """ + + def __init__( + self, + input_dim: int, + num_heads: int, + ffn_dim: int, + num_layers: int, + segment_length: int, + dropout: float = 0.0, + activation: str = "relu", + left_context_length: int = 0, + right_context_length: int = 0, + max_memory_size: int = 0, + weight_init_scale_strategy: Optional[str] = "depthwise", + tanh_on_mem: bool = False, + negative_inf: float = -1e8, + ): + weight_init_gains = _get_weight_init_gains(weight_init_scale_strategy, num_layers) + emformer_layers = torch.nn.ModuleList( + [ + _EmformerLayer( + input_dim, + num_heads, + ffn_dim, + segment_length, + dropout=dropout, + activation=activation, + left_context_length=left_context_length, + max_memory_size=max_memory_size, + weight_init_gain=weight_init_gains[layer_idx], + tanh_on_mem=tanh_on_mem, + negative_inf=negative_inf, + ) + for layer_idx in range(num_layers) + ] + ) + super().__init__( + emformer_layers, + segment_length, + left_context_length=left_context_length, + right_context_length=right_context_length, + max_memory_size=max_memory_size, + ) diff --git a/shared/package-files/9d/9dc21f0850413b472bdf6e8bb7f7485ca5da45f4b12ae12c8fd67c82272346d8/blob b/shared/package-files/9d/9dc21f0850413b472bdf6e8bb7f7485ca5da45f4b12ae12c8fd67c82272346d8/blob new file mode 100644 index 0000000000000000000000000000000000000000..a14fb2b106bb7c4e60dc3a832ea72601937b142d --- /dev/null +++ b/shared/package-files/9d/9dc21f0850413b472bdf6e8bb7f7485ca5da45f4b12ae12c8fd67c82272346d8/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API new_empty { + using schema = at::Tensor (const at::Tensor &, c10::SymIntArrayRef, c10::optional, c10::optional, c10::optional, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::new_empty") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "new_empty(Tensor self, SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor") + static at::Tensor call(const at::Tensor & self, c10::SymIntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::SymIntArrayRef size, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +}; + +struct TORCH_API new_empty_out { + using schema = at::Tensor & (const at::Tensor &, c10::SymIntArrayRef, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::new_empty") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "new_empty.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, c10::SymIntArrayRef size, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::SymIntArrayRef size, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9d/9dc28f96f2769da088a2e2dac281ac881970a7b855345306c242c7abd2a58de8/blob b/shared/package-files/9d/9dc28f96f2769da088a2e2dac281ac881970a7b855345306c242c7abd2a58de8/blob new file mode 100644 index 0000000000000000000000000000000000000000..a455599b4a95b3c69d23df188669e84deac4e31c --- /dev/null +++ b/shared/package-files/9d/9dc28f96f2769da088a2e2dac281ac881970a7b855345306c242c7abd2a58de8/blob @@ -0,0 +1,293 @@ +/* Translated into C++ by SciPy developers in 2024. + * Original header with Copyright information appears below. + */ + +/* ellie.c + * + * Incomplete elliptic integral of the second kind + * + * + * + * SYNOPSIS: + * + * double phi, m, y, ellie(); + * + * y = ellie( phi, m ); + * + * + * + * DESCRIPTION: + * + * Approximates the integral + * + * + * phi + * - + * | | + * | 2 + * E(phi_\m) = | sqrt( 1 - m sin t ) dt + * | + * | | + * - + * 0 + * + * of amplitude phi and modulus m, using the arithmetic - + * geometric mean algorithm. + * + * + * + * ACCURACY: + * + * Tested at random arguments with phi in [-10, 10] and m in + * [0, 1]. + * Relative error: + * arithmetic domain # trials peak rms + * IEEE -10,10 150000 3.3e-15 1.4e-16 + */ + +/* + * Cephes Math Library Release 2.0: April, 1987 + * Copyright 1984, 1987, 1993 by Stephen L. Moshier + * Direct inquiries to 30 Frost Street, Cambridge, MA 02140 + */ +/* Copyright 2014, Eric W. Moore */ + +/* Incomplete elliptic integral of second kind */ +#pragma once + +#include "../config.h" +#include "const.h" +#include "ellpe.h" +#include "ellpk.h" +#include "unity.h" + +namespace xsf { +namespace cephes { + namespace detail { + + /* To calculate legendre's incomplete elliptical integral of the second kind for + * negative m, we use a power series in phi for small m*phi*phi, an asymptotic + * series in m for large m*phi*phi* and the relation to Carlson's symmetric + * integrals, R_F(x,y,z) and R_D(x,y,z). + * + * E(phi, m) = sin(phi) * R_F(cos(phi)^2, 1 - m * sin(phi)^2, 1.0) + * - m * sin(phi)^3 * R_D(cos(phi)^2, 1 - m * sin(phi)^2, 1.0) / 3 + * + * = R_F(c-1, c-m, c) - m * R_D(c-1, c-m, c) / 3 + * + * where c = csc(phi)^2. We use the second form of this for (approximately) + * phi > 1/(sqrt(DBL_MAX) ~ 1e-154, where csc(phi)^2 overflows. Elsewhere we + * use the first form, accounting for the smallness of phi. + * + * The algorithm used is described in Carlson, B. C. Numerical computation of + * real or complex elliptic integrals. (1994) https://arxiv.org/abs/math/9409227 + * Most variable names reflect Carlson's usage. + * + * In this routine, we assume m < 0 and 0 > phi > pi/2. + */ + XSF_HOST_DEVICE inline double ellie_neg_m(double phi, double m) { + double x, y, z, x1, y1, z1, ret, Q; + double A0f, Af, Xf, Yf, Zf, E2f, E3f, scalef; + double A0d, Ad, seriesn, seriesd, Xd, Yd, Zd, E2d, E3d, E4d, E5d, scaled; + int n = 0; + double mpp = (m * phi) * phi; + + if (-mpp < 1e-6 && phi < -m) { + return phi + (mpp * phi * phi / 30.0 - mpp * mpp / 40.0 - mpp / 6.0) * phi; + } + + if (-mpp > 1e6) { + double sm = std::sqrt(-m); + double sp = std::sin(phi); + double cp = std::cos(phi); + + double a = -cosm1(phi); + double b1 = std::log(4 * sp * sm / (1 + cp)); + double b = -(0.5 + b1) / 2.0 / m; + double c = (0.75 + cp / sp / sp - b1) / 16.0 / m / m; + return (a + b + c) * sm; + } + + if (phi > 1e-153 && m > -1e200) { + double s = std::sin(phi); + double csc2 = 1.0 / s / s; + scalef = 1.0; + scaled = m / 3.0; + x = 1.0 / std::tan(phi) / std::tan(phi); + y = csc2 - m; + z = csc2; + } else { + scalef = phi; + scaled = mpp * phi / 3.0; + x = 1.0; + y = 1 - mpp; + z = 1.0; + } + + if (x == y && x == z) { + return (scalef + scaled / x) / std::sqrt(x); + } + + A0f = (x + y + z) / 3.0; + Af = A0f; + A0d = (x + y + 3.0 * z) / 5.0; + Ad = A0d; + x1 = x; + y1 = y; + z1 = z; + seriesd = 0.0; + seriesn = 1.0; + /* Carlson gives 1/pow(3*r, 1.0/6.0) for this constant. if r == eps, + * it is ~338.38. */ + + /* N.B. This will evaluate its arguments multiple times. */ + Q = 400.0 * std::fmax(std::abs(A0f - x), std::fmax(std::abs(A0f - y), std::abs(A0f - z))); + + while (Q > std::abs(Af) && Q > std::abs(Ad) && n <= 100) { + double sx = std::sqrt(x1); + double sy = std::sqrt(y1); + double sz = std::sqrt(z1); + double lam = sx * sy + sx * sz + sy * sz; + seriesd += seriesn / (sz * (z1 + lam)); + x1 = (x1 + lam) / 4.0; + y1 = (y1 + lam) / 4.0; + z1 = (z1 + lam) / 4.0; + Af = (x1 + y1 + z1) / 3.0; + Ad = (Ad + lam) / 4.0; + n += 1; + Q /= 4.0; + seriesn /= 4.0; + } + + Xf = (A0f - x) / Af / (1 << 2 * n); + Yf = (A0f - y) / Af / (1 << 2 * n); + Zf = -(Xf + Yf); + + E2f = Xf * Yf - Zf * Zf; + E3f = Xf * Yf * Zf; + + ret = scalef * (1.0 - E2f / 10.0 + E3f / 14.0 + E2f * E2f / 24.0 - 3.0 * E2f * E3f / 44.0) / sqrt(Af); + + Xd = (A0d - x) / Ad / (1 << 2 * n); + Yd = (A0d - y) / Ad / (1 << 2 * n); + Zd = -(Xd + Yd) / 3.0; + + E2d = Xd * Yd - 6.0 * Zd * Zd; + E3d = (3 * Xd * Yd - 8.0 * Zd * Zd) * Zd; + E4d = 3.0 * (Xd * Yd - Zd * Zd) * Zd * Zd; + E5d = Xd * Yd * Zd * Zd * Zd; + + ret -= scaled * + (1.0 - 3.0 * E2d / 14.0 + E3d / 6.0 + 9.0 * E2d * E2d / 88.0 - 3.0 * E4d / 22.0 - + 9.0 * E2d * E3d / 52.0 + 3.0 * E5d / 26.0) / + (1 << 2 * n) / Ad / sqrt(Ad); + ret -= 3.0 * scaled * seriesd; + return ret; + } + + } // namespace detail + + XSF_HOST_DEVICE inline double ellie(double phi, double m) { + double a, b, c, e, temp; + double lphi, t, E, denom, npio2; + int d, mod, sign; + + if (std::isnan(phi) || std::isnan(m)) + return std::numeric_limits::quiet_NaN(); + if (m > 1.0) + return std::numeric_limits::quiet_NaN(); + ; + if (std::isinf(phi)) + return phi; + if (std::isinf(m)) + return -m; + if (m == 0.0) + return (phi); + lphi = phi; + npio2 = std::floor(lphi / M_PI_2); + if (std::fmod(std::abs(npio2), 2.0) == 1.0) + npio2 += 1; + lphi = lphi - npio2 * M_PI_2; + if (lphi < 0.0) { + lphi = -lphi; + sign = -1; + } else { + sign = 1; + } + a = 1.0 - m; + E = ellpe(m); + if (a == 0.0) { + temp = std::sin(lphi); + goto done; + } + if (a > 1.0) { + temp = detail::ellie_neg_m(lphi, m); + goto done; + } + + if (lphi < 0.135) { + double m11 = (((((-7.0 / 2816.0) * m + (5.0 / 1056.0)) * m - (7.0 / 2640.0)) * m + (17.0 / 41580.0)) * m - + (1.0 / 155925.0)) * + m; + double m9 = ((((-5.0 / 1152.0) * m + (1.0 / 144.0)) * m - (1.0 / 360.0)) * m + (1.0 / 5670.0)) * m; + double m7 = ((-m / 112.0 + (1.0 / 84.0)) * m - (1.0 / 315.0)) * m; + double m5 = (-m / 40.0 + (1.0 / 30)) * m; + double m3 = -m / 6.0; + double p2 = lphi * lphi; + + temp = ((((m11 * p2 + m9) * p2 + m7) * p2 + m5) * p2 + m3) * p2 * lphi + lphi; + goto done; + } + t = std::tan(lphi); + b = std::sqrt(a); + /* Thanks to Brian Fitzgerald + * for pointing out an instability near odd multiples of pi/2. */ + if (std::abs(t) > 10.0) { + /* Transform the amplitude */ + e = 1.0 / (b * t); + /* ... but avoid multiple recursions. */ + if (std::abs(e) < 10.0) { + e = std::atan(e); + temp = E + m * std::sin(lphi) * std::sin(e) - ellie(e, m); + goto done; + } + } + c = std::sqrt(m); + a = 1.0; + d = 1; + e = 0.0; + mod = 0; + + while (std::abs(c / a) > detail::MACHEP) { + temp = b / a; + lphi = lphi + atan(t * temp) + mod * M_PI; + denom = 1 - temp * t * t; + if (std::abs(denom) > 10 * detail::MACHEP) { + t = t * (1.0 + temp) / denom; + mod = (lphi + M_PI_2) / M_PI; + } else { + t = std::tan(lphi); + mod = static_cast(std::floor((lphi - std::atan(t)) / M_PI)); + } + c = (a - b) / 2.0; + temp = std::sqrt(a * b); + a = (a + b) / 2.0; + b = temp; + d += d; + e += c * std::sin(lphi); + } + + temp = E / ellpk(1.0 - m); + temp *= (std::atan(t) + mod * M_PI) / (d * a); + temp += e; + + done: + + if (sign < 0) + temp = -temp; + temp += npio2 * E; + return (temp); + } + +} // namespace cephes +} // namespace xsf diff --git a/shared/package-files/9d/9dc2cb4a8896d69d5db615f0cd6bd1dfc984afce8341043918c1a6f60bd87263/blob b/shared/package-files/9d/9dc2cb4a8896d69d5db615f0cd6bd1dfc984afce8341043918c1a6f60bd87263/blob new file mode 100644 index 0000000000000000000000000000000000000000..a02a3b122d993eb9454259426c3fe070398c55ae --- /dev/null +++ b/shared/package-files/9d/9dc2cb4a8896d69d5db615f0cd6bd1dfc984afce8341043918c1a6f60bd87263/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor t(const at::Tensor & self); +TORCH_API at::Tensor & t_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/9d/9dcac89597818f2b5f59e1bdad05fc55d1cef18bd2dc49aa049e2b21b699571c/blob b/shared/package-files/9d/9dcac89597818f2b5f59e1bdad05fc55d1cef18bd2dc49aa049e2b21b699571c/blob new file mode 100644 index 0000000000000000000000000000000000000000..3dcbd04324ed5956bde8d765d873f613cd83cc8b --- /dev/null +++ b/shared/package-files/9d/9dcac89597818f2b5f59e1bdad05fc55d1cef18bd2dc49aa049e2b21b699571c/blob @@ -0,0 +1,50 @@ +from typing import Any + +TAG_TYPE_BITS: Any +TAG_TYPE_MASK: Any +WIRETYPE_VARINT: Any +WIRETYPE_FIXED64: Any +WIRETYPE_LENGTH_DELIMITED: Any +WIRETYPE_START_GROUP: Any +WIRETYPE_END_GROUP: Any +WIRETYPE_FIXED32: Any +INT32_MAX: Any +INT32_MIN: Any +UINT32_MAX: Any +INT64_MAX: Any +INT64_MIN: Any +UINT64_MAX: Any +FORMAT_UINT32_LITTLE_ENDIAN: Any +FORMAT_UINT64_LITTLE_ENDIAN: Any +FORMAT_FLOAT_LITTLE_ENDIAN: Any +FORMAT_DOUBLE_LITTLE_ENDIAN: Any + +def PackTag(field_number, wire_type): ... +def UnpackTag(tag): ... +def ZigZagEncode(value): ... +def ZigZagDecode(value): ... +def Int32ByteSize(field_number, int32): ... +def Int32ByteSizeNoTag(int32): ... +def Int64ByteSize(field_number, int64): ... +def UInt32ByteSize(field_number, uint32): ... +def UInt64ByteSize(field_number, uint64): ... +def SInt32ByteSize(field_number, int32): ... +def SInt64ByteSize(field_number, int64): ... +def Fixed32ByteSize(field_number, fixed32): ... +def Fixed64ByteSize(field_number, fixed64): ... +def SFixed32ByteSize(field_number, sfixed32): ... +def SFixed64ByteSize(field_number, sfixed64): ... +def FloatByteSize(field_number, flt): ... +def DoubleByteSize(field_number, double): ... +def BoolByteSize(field_number, b): ... +def EnumByteSize(field_number, enum): ... +def StringByteSize(field_number, string): ... +def BytesByteSize(field_number, b): ... +def GroupByteSize(field_number, message): ... +def MessageByteSize(field_number, message): ... +def MessageSetItemByteSize(field_number, msg): ... +def TagByteSize(field_number): ... + +NON_PACKABLE_TYPES: Any + +def IsTypePackable(field_type): ... diff --git a/shared/package-files/9d/9dcad4689d4ffa00e4b693d868010311de8ed2f599a106d9684518909244522d/blob b/shared/package-files/9d/9dcad4689d4ffa00e4b693d868010311de8ed2f599a106d9684518909244522d/blob new file mode 100644 index 0000000000000000000000000000000000000000..bfc4d42cd065d5978a80261a6ee79c8c9f8c1858 --- /dev/null +++ b/shared/package-files/9d/9dcad4689d4ffa00e4b693d868010311de8ed2f599a106d9684518909244522d/blob @@ -0,0 +1,17 @@ +import types +from importlib.machinery import ModuleSpec +from typing import Any, List + +def create_builtin(__spec: ModuleSpec) -> types.ModuleType: ... +def create_dynamic(__spec: ModuleSpec, __file: Any = ...) -> None: ... +def acquire_lock() -> None: ... +def exec_builtin(__mod: types.ModuleType) -> int: ... +def exec_dynamic(__mod: types.ModuleType) -> int: ... +def extension_suffixes() -> List[str]: ... +def get_frozen_object(__name: str) -> types.CodeType: ... +def init_frozen(__name: str) -> types.ModuleType: ... +def is_builtin(__name: str) -> int: ... +def is_frozen(__name: str) -> bool: ... +def is_frozen_package(__name: str) -> bool: ... +def lock_held() -> bool: ... +def release_lock() -> None: ... diff --git a/shared/package-files/9d/9dcd8913910cac47fea76e2a85fd91f2a015e4fa4588eb8da580a6b660a39532/blob b/shared/package-files/9d/9dcd8913910cac47fea76e2a85fd91f2a015e4fa4588eb8da580a6b660a39532/blob new file mode 100644 index 0000000000000000000000000000000000000000..75370712a8c38162b167b1ee358e4adc75c6fff2 --- /dev/null +++ b/shared/package-files/9d/9dcd8913910cac47fea76e2a85fd91f2a015e4fa4588eb8da580a6b660a39532/blob @@ -0,0 +1,29 @@ +import pytest +from unittest.mock import patch +from bs4.builder import DetectsXMLParsedAsHTML + +class TestDetectsXMLParsedAsHTML(object): + + @pytest.mark.parametrize( + "markup,looks_like_xml", + [("No xml declaration", False), + ("obviously HTMLActually XHTML", False), + (" < html>Tricky XHTML", False), + ("", True), + ] + ) + def test_warn_if_markup_looks_like_xml(self, markup, looks_like_xml): + # Test of our ability to guess at whether markup looks XML-ish + # _and_ not HTML-ish. + with patch('bs4.builder.DetectsXMLParsedAsHTML._warn') as mock: + for data in markup, markup.encode('utf8'): + result = DetectsXMLParsedAsHTML.warn_if_markup_looks_like_xml( + data + ) + assert result == looks_like_xml + if looks_like_xml: + assert mock.called + else: + assert not mock.called + mock.reset_mock() diff --git a/shared/package-files/9d/9dcea6c9b3edd0608c7d4ec56654237f77e5b559e6acac6fce0da4691899e78d/blob b/shared/package-files/9d/9dcea6c9b3edd0608c7d4ec56654237f77e5b559e6acac6fce0da4691899e78d/blob new file mode 100644 index 0000000000000000000000000000000000000000..581727acecb83907ae4052b2395cb4d2a819e25f --- /dev/null +++ b/shared/package-files/9d/9dcea6c9b3edd0608c7d4ec56654237f77e5b559e6acac6fce0da4691899e78d/blob @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::upsample_bilinear2d_backward.grad_input(Tensor grad_output, SymInt[2] output_size, SymInt[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & upsample_bilinear2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::upsample_bilinear2d_backward_grad_input::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), align_corners, scales_h, scales_w, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & upsample_bilinear2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::upsample_bilinear2d_backward_grad_input::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), align_corners, scales_h, scales_w, grad_input); + } +} + +// aten::upsample_bilinear2d_backward.grad_input(Tensor grad_output, SymInt[2] output_size, SymInt[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & upsample_bilinear2d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional scales_h, c10::optional scales_w, at::Tensor & grad_input) { + return at::_ops::upsample_bilinear2d_backward_grad_input::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), align_corners, scales_h, scales_w, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & upsample_bilinear2d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional scales_h, c10::optional scales_w, at::Tensor & grad_input) { + return at::_ops::upsample_bilinear2d_backward_grad_input::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), align_corners, scales_h, scales_w, grad_input); + } +} + +// aten::upsample_bilinear2d_backward.grad_input(Tensor grad_output, SymInt[2] output_size, SymInt[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & upsample_bilinear2d_backward_symint_out(at::Tensor & grad_input, const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::upsample_bilinear2d_backward_grad_input::call(grad_output, output_size, input_size, align_corners, scales_h, scales_w, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & upsample_bilinear2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::upsample_bilinear2d_backward_grad_input::call(grad_output, output_size, input_size, align_corners, scales_h, scales_w, grad_input); + } +} + +// aten::upsample_bilinear2d_backward.grad_input(Tensor grad_output, SymInt[2] output_size, SymInt[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & upsample_bilinear2d_backward_symint_outf(const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, bool align_corners, c10::optional scales_h, c10::optional scales_w, at::Tensor & grad_input) { + return at::_ops::upsample_bilinear2d_backward_grad_input::call(grad_output, output_size, input_size, align_corners, scales_h, scales_w, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & upsample_bilinear2d_backward_outf(const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, bool align_corners, c10::optional scales_h, c10::optional scales_w, at::Tensor & grad_input) { + return at::_ops::upsample_bilinear2d_backward_grad_input::call(grad_output, output_size, input_size, align_corners, scales_h, scales_w, grad_input); + } +} + +// aten::upsample_bilinear2d_backward(Tensor grad_output, SymInt[2] output_size, SymInt[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None) -> Tensor +inline at::Tensor upsample_bilinear2d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::upsample_bilinear2d_backward::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), align_corners, scales_h, scales_w); +} +namespace symint { + template ::value>> + at::Tensor upsample_bilinear2d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::upsample_bilinear2d_backward::call(grad_output, c10::fromIntArrayRefSlow(output_size), c10::fromIntArrayRefSlow(input_size), align_corners, scales_h, scales_w); + } +} + +// aten::upsample_bilinear2d_backward(Tensor grad_output, SymInt[2] output_size, SymInt[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None) -> Tensor +inline at::Tensor upsample_bilinear2d_backward_symint(const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::upsample_bilinear2d_backward::call(grad_output, output_size, input_size, align_corners, scales_h, scales_w); +} +namespace symint { + template ::value>> + at::Tensor upsample_bilinear2d_backward(const at::Tensor & grad_output, c10::SymIntArrayRef output_size, c10::SymIntArrayRef input_size, bool align_corners, c10::optional scales_h=c10::nullopt, c10::optional scales_w=c10::nullopt) { + return at::_ops::upsample_bilinear2d_backward::call(grad_output, output_size, input_size, align_corners, scales_h, scales_w); + } +} + +} diff --git a/shared/package-files/9d/9dcef9644e575edadcf3c39c7c1e66006874d56a5fddde116ecbbcbcb24f4c2f/blob b/shared/package-files/9d/9dcef9644e575edadcf3c39c7c1e66006874d56a5fddde116ecbbcbcb24f4c2f/blob new file mode 100644 index 0000000000000000000000000000000000000000..b9d9d379917d41a45f5bac485f44bc2df7d488af --- /dev/null +++ b/shared/package-files/9d/9dcef9644e575edadcf3c39c7c1e66006874d56a5fddde116ecbbcbcb24f4c2f/blob @@ -0,0 +1,120 @@ +"""Tests for sho1d.py""" + +from sympy.core.numbers import (I, Integer) +from sympy.core.singleton import S +from sympy.core.symbol import Symbol +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.physics.quantum import Dagger +from sympy.physics.quantum.constants import hbar +from sympy.physics.quantum import Commutator +from sympy.physics.quantum.qapply import qapply +from sympy.physics.quantum.innerproduct import InnerProduct +from sympy.physics.quantum.cartesian import X, Px +from sympy.functions.special.tensor_functions import KroneckerDelta +from sympy.physics.quantum.hilbert import ComplexSpace +from sympy.physics.quantum.represent import represent +from sympy.external import import_module +from sympy.testing.pytest import skip + +from sympy.physics.quantum.sho1d import (RaisingOp, LoweringOp, + SHOKet, SHOBra, + Hamiltonian, NumberOp) + +ad = RaisingOp('a') +a = LoweringOp('a') +k = SHOKet('k') +kz = SHOKet(0) +kf = SHOKet(1) +k3 = SHOKet(3) +b = SHOBra('b') +b3 = SHOBra(3) +H = Hamiltonian('H') +N = NumberOp('N') +omega = Symbol('omega') +m = Symbol('m') +ndim = Integer(4) + +np = import_module('numpy') +scipy = import_module('scipy', import_kwargs={'fromlist': ['sparse']}) + +ad_rep_sympy = represent(ad, basis=N, ndim=4, format='sympy') +a_rep = represent(a, basis=N, ndim=4, format='sympy') +N_rep = represent(N, basis=N, ndim=4, format='sympy') +H_rep = represent(H, basis=N, ndim=4, format='sympy') +k3_rep = represent(k3, basis=N, ndim=4, format='sympy') +b3_rep = represent(b3, basis=N, ndim=4, format='sympy') + +def test_RaisingOp(): + assert Dagger(ad) == a + assert Commutator(ad, a).doit() == Integer(-1) + assert Commutator(ad, N).doit() == Integer(-1)*ad + assert qapply(ad*k) == (sqrt(k.n + 1)*SHOKet(k.n + 1)).expand() + assert qapply(ad*kz) == (sqrt(kz.n + 1)*SHOKet(kz.n + 1)).expand() + assert qapply(ad*kf) == (sqrt(kf.n + 1)*SHOKet(kf.n + 1)).expand() + assert ad.rewrite('xp').doit() == \ + (Integer(1)/sqrt(Integer(2)*hbar*m*omega))*(Integer(-1)*I*Px + m*omega*X) + assert ad.hilbert_space == ComplexSpace(S.Infinity) + for i in range(ndim - 1): + assert ad_rep_sympy[i + 1,i] == sqrt(i + 1) + + if not np: + skip("numpy not installed.") + + ad_rep_numpy = represent(ad, basis=N, ndim=4, format='numpy') + for i in range(ndim - 1): + assert ad_rep_numpy[i + 1,i] == float(sqrt(i + 1)) + + if not np: + skip("numpy not installed.") + if not scipy: + skip("scipy not installed.") + + ad_rep_scipy = represent(ad, basis=N, ndim=4, format='scipy.sparse', spmatrix='lil') + for i in range(ndim - 1): + assert ad_rep_scipy[i + 1,i] == float(sqrt(i + 1)) + + assert ad_rep_numpy.dtype == 'float64' + assert ad_rep_scipy.dtype == 'float64' + +def test_LoweringOp(): + assert Dagger(a) == ad + assert Commutator(a, ad).doit() == Integer(1) + assert Commutator(a, N).doit() == a + assert qapply(a*k) == (sqrt(k.n)*SHOKet(k.n-Integer(1))).expand() + assert qapply(a*kz) == Integer(0) + assert qapply(a*kf) == (sqrt(kf.n)*SHOKet(kf.n-Integer(1))).expand() + assert a.rewrite('xp').doit() == \ + (Integer(1)/sqrt(Integer(2)*hbar*m*omega))*(I*Px + m*omega*X) + for i in range(ndim - 1): + assert a_rep[i,i + 1] == sqrt(i + 1) + +def test_NumberOp(): + assert Commutator(N, ad).doit() == ad + assert Commutator(N, a).doit() == Integer(-1)*a + assert Commutator(N, H).doit() == Integer(0) + assert qapply(N*k) == (k.n*k).expand() + assert N.rewrite('a').doit() == ad*a + assert N.rewrite('xp').doit() == (Integer(1)/(Integer(2)*m*hbar*omega))*( + Px**2 + (m*omega*X)**2) - Integer(1)/Integer(2) + assert N.rewrite('H').doit() == H/(hbar*omega) - Integer(1)/Integer(2) + for i in range(ndim): + assert N_rep[i,i] == i + assert N_rep == ad_rep_sympy*a_rep + +def test_Hamiltonian(): + assert Commutator(H, N).doit() == Integer(0) + assert qapply(H*k) == ((hbar*omega*(k.n + Integer(1)/Integer(2)))*k).expand() + assert H.rewrite('a').doit() == hbar*omega*(ad*a + Integer(1)/Integer(2)) + assert H.rewrite('xp').doit() == \ + (Integer(1)/(Integer(2)*m))*(Px**2 + (m*omega*X)**2) + assert H.rewrite('N').doit() == hbar*omega*(N + Integer(1)/Integer(2)) + for i in range(ndim): + assert H_rep[i,i] == hbar*omega*(i + Integer(1)/Integer(2)) + +def test_SHOKet(): + assert SHOKet('k').dual_class() == SHOBra + assert SHOBra('b').dual_class() == SHOKet + assert InnerProduct(b,k).doit() == KroneckerDelta(k.n, b.n) + assert k.hilbert_space == ComplexSpace(S.Infinity) + assert k3_rep[k3.n, 0] == Integer(1) + assert b3_rep[0, b3.n] == Integer(1) diff --git a/shared/package-files/9d/9dd04c733aeceb160c3794469f208bf72abba4d531ad71d3494d66754b29e6d5/blob b/shared/package-files/9d/9dd04c733aeceb160c3794469f208bf72abba4d531ad71d3494d66754b29e6d5/blob new file mode 100644 index 0000000000000000000000000000000000000000..e30f217a44b4ea795270c0e2c66b6813b05e63ea --- /dev/null +++ b/shared/package-files/9d/9dd04c733aeceb160c3794469f208bf72abba4d531ad71d3494d66754b29e6d5/blob @@ -0,0 +1,213 @@ +from sympy.plotting.intervalmath import interval +from sympy.testing.pytest import raises + + +def test_interval(): + assert (interval(1, 1) == interval(1, 1, is_valid=True)) == (True, True) + assert (interval(1, 1) == interval(1, 1, is_valid=False)) == (True, False) + assert (interval(1, 1) == interval(1, 1, is_valid=None)) == (True, None) + assert (interval(1, 1.5) == interval(1, 2)) == (None, True) + assert (interval(0, 1) == interval(2, 3)) == (False, True) + assert (interval(0, 1) == interval(1, 2)) == (None, True) + assert (interval(1, 2) != interval(1, 2)) == (False, True) + assert (interval(1, 3) != interval(2, 3)) == (None, True) + assert (interval(1, 3) != interval(-5, -3)) == (True, True) + assert ( + interval(1, 3, is_valid=False) != interval(-5, -3)) == (True, False) + assert (interval(1, 3, is_valid=None) != interval(-5, 3)) == (None, None) + assert (interval(4, 4) != 4) == (False, True) + assert (interval(1, 1) == 1) == (True, True) + assert (interval(1, 3, is_valid=False) == interval(1, 3)) == (True, False) + assert (interval(1, 3, is_valid=None) == interval(1, 3)) == (True, None) + inter = interval(-5, 5) + assert (interval(inter) == interval(-5, 5)) == (True, True) + assert inter.width == 10 + assert 0 in inter + assert -5 in inter + assert 5 in inter + assert interval(0, 3) in inter + assert interval(-6, 2) not in inter + assert -5.05 not in inter + assert 5.3 not in inter + interb = interval(-float('inf'), float('inf')) + assert 0 in inter + assert inter in interb + assert interval(0, float('inf')) in interb + assert interval(-float('inf'), 5) in interb + assert interval(-1e50, 1e50) in interb + assert ( + -interval(-1, -2, is_valid=False) == interval(1, 2)) == (True, False) + raises(ValueError, lambda: interval(1, 2, 3)) + + +def test_interval_add(): + assert (interval(1, 2) + interval(2, 3) == interval(3, 5)) == (True, True) + assert (1 + interval(1, 2) == interval(2, 3)) == (True, True) + assert (interval(1, 2) + 1 == interval(2, 3)) == (True, True) + compare = (1 + interval(0, float('inf')) == interval(1, float('inf'))) + assert compare == (True, True) + a = 1 + interval(2, 5, is_valid=False) + assert a.is_valid is False + a = 1 + interval(2, 5, is_valid=None) + assert a.is_valid is None + a = interval(2, 5, is_valid=False) + interval(3, 5, is_valid=None) + assert a.is_valid is False + a = interval(3, 5) + interval(-1, 1, is_valid=None) + assert a.is_valid is None + a = interval(2, 5, is_valid=False) + 1 + assert a.is_valid is False + + +def test_interval_sub(): + assert (interval(1, 2) - interval(1, 5) == interval(-4, 1)) == (True, True) + assert (interval(1, 2) - 1 == interval(0, 1)) == (True, True) + assert (1 - interval(1, 2) == interval(-1, 0)) == (True, True) + a = 1 - interval(1, 2, is_valid=False) + assert a.is_valid is False + a = interval(1, 4, is_valid=None) - 1 + assert a.is_valid is None + a = interval(1, 3, is_valid=False) - interval(1, 3) + assert a.is_valid is False + a = interval(1, 3, is_valid=None) - interval(1, 3) + assert a.is_valid is None + + +def test_interval_inequality(): + assert (interval(1, 2) < interval(3, 4)) == (True, True) + assert (interval(1, 2) < interval(2, 4)) == (None, True) + assert (interval(1, 2) < interval(-2, 0)) == (False, True) + assert (interval(1, 2) <= interval(2, 4)) == (True, True) + assert (interval(1, 2) <= interval(1.5, 6)) == (None, True) + assert (interval(2, 3) <= interval(1, 2)) == (None, True) + assert (interval(2, 3) <= interval(1, 1.5)) == (False, True) + assert ( + interval(1, 2, is_valid=False) <= interval(-2, 0)) == (False, False) + assert (interval(1, 2, is_valid=None) <= interval(-2, 0)) == (False, None) + assert (interval(1, 2) <= 1.5) == (None, True) + assert (interval(1, 2) <= 3) == (True, True) + assert (interval(1, 2) <= 0) == (False, True) + assert (interval(5, 8) > interval(2, 3)) == (True, True) + assert (interval(2, 5) > interval(1, 3)) == (None, True) + assert (interval(2, 3) > interval(3.1, 5)) == (False, True) + + assert (interval(-1, 1) == 0) == (None, True) + assert (interval(-1, 1) == 2) == (False, True) + assert (interval(-1, 1) != 0) == (None, True) + assert (interval(-1, 1) != 2) == (True, True) + + assert (interval(3, 5) > 2) == (True, True) + assert (interval(3, 5) < 2) == (False, True) + assert (interval(1, 5) < 2) == (None, True) + assert (interval(1, 5) > 2) == (None, True) + assert (interval(0, 1) > 2) == (False, True) + assert (interval(1, 2) >= interval(0, 1)) == (True, True) + assert (interval(1, 2) >= interval(0, 1.5)) == (None, True) + assert (interval(1, 2) >= interval(3, 4)) == (False, True) + assert (interval(1, 2) >= 0) == (True, True) + assert (interval(1, 2) >= 1.2) == (None, True) + assert (interval(1, 2) >= 3) == (False, True) + assert (2 > interval(0, 1)) == (True, True) + a = interval(-1, 1, is_valid=False) < interval(2, 5, is_valid=None) + assert a == (True, False) + a = interval(-1, 1, is_valid=None) < interval(2, 5, is_valid=False) + assert a == (True, False) + a = interval(-1, 1, is_valid=None) < interval(2, 5, is_valid=None) + assert a == (True, None) + a = interval(-1, 1, is_valid=False) > interval(-5, -2, is_valid=None) + assert a == (True, False) + a = interval(-1, 1, is_valid=None) > interval(-5, -2, is_valid=False) + assert a == (True, False) + a = interval(-1, 1, is_valid=None) > interval(-5, -2, is_valid=None) + assert a == (True, None) + + +def test_interval_mul(): + assert ( + interval(1, 5) * interval(2, 10) == interval(2, 50)) == (True, True) + a = interval(-1, 1) * interval(2, 10) == interval(-10, 10) + assert a == (True, True) + + a = interval(-1, 1) * interval(-5, 3) == interval(-5, 5) + assert a == (True, True) + + assert (interval(1, 3) * 2 == interval(2, 6)) == (True, True) + assert (3 * interval(-1, 2) == interval(-3, 6)) == (True, True) + + a = 3 * interval(1, 2, is_valid=False) + assert a.is_valid is False + + a = 3 * interval(1, 2, is_valid=None) + assert a.is_valid is None + + a = interval(1, 5, is_valid=False) * interval(1, 2, is_valid=None) + assert a.is_valid is False + + +def test_interval_div(): + div = interval(1, 2, is_valid=False) / 3 + assert div == interval(-float('inf'), float('inf'), is_valid=False) + + div = interval(1, 2, is_valid=None) / 3 + assert div == interval(-float('inf'), float('inf'), is_valid=None) + + div = 3 / interval(1, 2, is_valid=None) + assert div == interval(-float('inf'), float('inf'), is_valid=None) + a = interval(1, 2) / 0 + assert a.is_valid is False + a = interval(0.5, 1) / interval(-1, 0) + assert a.is_valid is None + a = interval(0, 1) / interval(0, 1) + assert a.is_valid is None + + a = interval(-1, 1) / interval(-1, 1) + assert a.is_valid is None + + a = interval(-1, 2) / interval(0.5, 1) == interval(-2.0, 4.0) + assert a == (True, True) + a = interval(0, 1) / interval(0.5, 1) == interval(0.0, 2.0) + assert a == (True, True) + a = interval(-1, 0) / interval(0.5, 1) == interval(-2.0, 0.0) + assert a == (True, True) + a = interval(-0.5, -0.25) / interval(0.5, 1) == interval(-1.0, -0.25) + assert a == (True, True) + a = interval(0.5, 1) / interval(0.5, 1) == interval(0.5, 2.0) + assert a == (True, True) + a = interval(0.5, 4) / interval(0.5, 1) == interval(0.5, 8.0) + assert a == (True, True) + a = interval(-1, -0.5) / interval(0.5, 1) == interval(-2.0, -0.5) + assert a == (True, True) + a = interval(-4, -0.5) / interval(0.5, 1) == interval(-8.0, -0.5) + assert a == (True, True) + a = interval(-1, 2) / interval(-2, -0.5) == interval(-4.0, 2.0) + assert a == (True, True) + a = interval(0, 1) / interval(-2, -0.5) == interval(-2.0, 0.0) + assert a == (True, True) + a = interval(-1, 0) / interval(-2, -0.5) == interval(0.0, 2.0) + assert a == (True, True) + a = interval(-0.5, -0.25) / interval(-2, -0.5) == interval(0.125, 1.0) + assert a == (True, True) + a = interval(0.5, 1) / interval(-2, -0.5) == interval(-2.0, -0.25) + assert a == (True, True) + a = interval(0.5, 4) / interval(-2, -0.5) == interval(-8.0, -0.25) + assert a == (True, True) + a = interval(-1, -0.5) / interval(-2, -0.5) == interval(0.25, 2.0) + assert a == (True, True) + a = interval(-4, -0.5) / interval(-2, -0.5) == interval(0.25, 8.0) + assert a == (True, True) + a = interval(-5, 5, is_valid=False) / 2 + assert a.is_valid is False + +def test_hashable(): + ''' + test that interval objects are hashable. + this is required in order to be able to put them into the cache, which + appears to be necessary for plotting in py3k. For details, see: + + https://github.com/sympy/sympy/pull/2101 + https://github.com/sympy/sympy/issues/6533 + ''' + hash(interval(1, 1)) + hash(interval(1, 1, is_valid=True)) + hash(interval(-4, -0.5)) + hash(interval(-2, -0.5)) + hash(interval(0.25, 8.0)) diff --git a/shared/package-files/9d/9dd6789676f84c66ff33625cc99518ca2fdd64e215e6e0c11ffa76c679695945/blob b/shared/package-files/9d/9dd6789676f84c66ff33625cc99518ca2fdd64e215e6e0c11ffa76c679695945/blob new file mode 100644 index 0000000000000000000000000000000000000000..078a29061d455389dacddfb3d694feb5021dc640 Binary files /dev/null and b/shared/package-files/9d/9dd6789676f84c66ff33625cc99518ca2fdd64e215e6e0c11ffa76c679695945/blob differ diff --git a/shared/package-files/9d/9dd689146bc97d70aa526cc4c9411f4623640f0a185765f1777f62150743d9ba/blob b/shared/package-files/9d/9dd689146bc97d70aa526cc4c9411f4623640f0a185765f1777f62150743d9ba/blob new file mode 100644 index 0000000000000000000000000000000000000000..8b49f7c645d8d1bc3a154d62a1295a90b155f986 --- /dev/null +++ b/shared/package-files/9d/9dd689146bc97d70aa526cc4c9411f4623640f0a185765f1777f62150743d9ba/blob @@ -0,0 +1,14 @@ +# flake8: noqa: F401 +r""" +This file is in the process of migration to `torch/ao/quantization`, and +is kept here for compatibility while the migration process is ongoing. +If you are adding a new entry/functionality, please, add it to the +appropriate files under `torch/ao/quantization/fx/`, while adding an import statement +here. +""" +from torch.ao.quantization.fx.match_utils import ( + _find_matches, + _is_match, + _MatchResult, + MatchAllNode, +) diff --git a/shared/package-files/9d/9dd6f0ed4224a259a30ea7f4b1985726841161fcaf5b40a2df6e7ac4d2df03e1/blob b/shared/package-files/9d/9dd6f0ed4224a259a30ea7f4b1985726841161fcaf5b40a2df6e7ac4d2df03e1/blob new file mode 100644 index 0000000000000000000000000000000000000000..38a5ad686dd134d2767d33ba79b13e884df0794c --- /dev/null +++ b/shared/package-files/9d/9dd6f0ed4224a259a30ea7f4b1985726841161fcaf5b40a2df6e7ac4d2df03e1/blob @@ -0,0 +1,203 @@ +"r1","r2","r3","detN","m1","m2","m3","detPmu","v1","v2","v3","F1","F2","F3","a1","a2","a3","detP","alphahat1","alphahat2","alphahat3","detV","muhat1","muhat2","muhat3","detVmu","etahat1","etahat2","etahat3","detVeta","epshat1","epshat2","epshat3","Veps1","Veps2","Veps3" +3.93104930508059e-05,-4.74927774802766,-12.7383199661869,1.45890760503934e-07,0,0,0,999999999999998592,NA,26.3,23.961,1000001,1000001,1000001,0,26.2999737000263,23.9609760390239,3999999.99996655,39.3104930508059,21.550700701562,11.2226688119232,19.3333660284117,39.3104930508059,21.550700701562,11.2226688119232,19.3333660284117,3.93104930508059e-05,-4.74927774802766,-12.7383199661869,0.3819654489623,0,4.74929929872836,12.7383311888557,1,0.618033606782863,0.618033606782863 +3.93104930508059e-05,-6.04785479474273,7.37902887888031,1.91566448186757e-07,0,26.2999737000263,23.9609760390239,3999999.99996655,NA,-8.19997370002635,-45.5939760390239,1000002,2.99999899999239,2.99999899999239,0,20.8333254777908,-6.43500292095441,2777782.96295929,39.310532361299,16.8014229532848,-1.51565115493282,11.0599216730989,39.310532361299,16.8014229532848,-1.51565115493282,11.0599216730989,3.93104930508059e-05,-6.04785479474273,7.37902887888031,0.316187583657143,0,1.29857704671507,-20.1173488450672,1,0.472135899271045,0.472135899271044 +3.93104930508059e-05,2.80571336379929,3.1124066028278,1.98749623423023e-07,0,20.8333254777908,-6.43500292095441,2777782.96295929,NA,-18.9333254777907,16.5650029209544,1000003,2.66666655555467,2.66666655555467,0,8.99999735000718,3.91812364581185,2640632.87109319,39.310571671792,10.7535681585421,5.86337772394749,9.88188668205834,39.310571671792,10.7535681585421,5.86337772394749,9.88188668205834,3.93104930508059e-05,2.80571336379929,3.1124066028278,0.307109930418793,0,-8.85356815854202,4.26662227605251,1,0.450849710616695,0.450849710616688 +3.93104930508059e-05,-0.435005113859261,-20.2778090703969,1.9980868600128e-07,0,8.99999735000718,3.91812364581185,2640632.87109319,NA,7.80000264999278,28.4478763541881,1000004,2.62499998437488,2.62499998437488,0,13.8285704013631,21.5287137053249,2621325.67066183,39.3106109822851,13.5592815223414,8.97578432677528,9.54576019072231,39.3106109822851,13.5592815223414,8.97578432677528,9.54576019072231,3.93104930508059e-05,-0.435005113859261,-20.2778090703969,0.305796570643906,0,3.24071847765855,23.3902156732247,1,0.447744097546026,0.447744097545979 +3.93104930508059e-05,-9.71072870537721,1.99016618598146,1.99963436392211e-07,0,13.8285704013631,21.5287137053249,2621325.67066183,NA,8.57142959863699,-55.0987137053249,1000005,2.61904761678003,2.61904761678003,0,19.1272723322324,-12.5323092942977,2618525.48818632,39.3106502927781,13.1242764084821,-11.3020247436216,9.3263995714509,39.3106502927781,13.1242764084821,-11.3020247436216,9.3263995714509,3.93104930508059e-05,-9.71072870537721,1.99016618598146,0.305605189290669,0,9.27572359151795,-22.2679752563784,1,0.447290994705697,0.447290994705373 +3.93104930508059e-05,0.802818997727851,-5.54469237165873,1.99986019175244e-07,0,19.1272723322324,-12.5323092942977,2618525.48818632,NA,-26.2272723322326,10.7553092942977,1000006,2.61818181785124,2.61818181785124,0,2.9173609614924,-5.88493063375738,2618119.48933082,39.3106896032712,3.41354770310493,-9.31185855764017,9.12365135493298,39.3106896032712,3.41354770310493,-9.31185855764017,9.12365135493298,3.93104930508059e-05,0.802818997727851,-5.54469237165873,0.305577272137918,0,-10.5135477031051,7.53485855764018,1,0.447224887894063,0.447224887891842 +3.93104930508059e-05,2.61918569856054,16.2097566990424,1.99989314050576e-07,0,2.9173609614924,-5.88493063375738,2618119.48933082,NA,-0.517360961492312,-30.7260693662426,1000007,2.61805555550733,2.61805555550733,0,2.5976126749504,-24.8747825230227,2618062.49742673,39.3107289137642,4.21636670083278,-14.8565509292989,8.92327441084561,39.3107289137642,4.21636670083278,-14.8565509292989,8.92327441084561,3.93104930508059e-05,2.61918569856054,16.2097566990424,0.305573199205235,0,-1.81636670083269,-21.7544490707011,1,0.447215243052953,0.44721524303773 +3.93104930508059e-05,9.95473809795386,10.9219624687859,1.99989794666565e-07,0,2.5976126749504,-24.8747825230227,2618062.49742673,NA,-3.0976126749504,31.5157825230227,1000008,2.61803713527148,2.61803713527148,0,0.683181335825165,-5.39694327377052,2618056.41861809,39.3107682242573,6.83555239939332,1.35320576974347,8.72323568974603,39.3107682242573,6.83555239939332,1.35320576974347,8.72323568974603,3.93104930508059e-05,9.95473809795386,10.9219624687859,0.305572605100859,0,-7.33555239939332,5.2877942302565,1,0.447213835976819,0.447213835872479 +3.93104930508059e-05,0.145028595301123,3.3561307073152,1.99989864087647e-07,0,0.683181335825165,-5.39694327377052,2618056.41861809,NA,25.9168186641747,25.2379432737705,1000009,2.61803444782065,2.61803444782065,0,16.7006578863968,10.200965165936,2618057.76780153,39.3108075347503,16.7902904973472,12.2751682385293,8.52324490716159,39.3108075347503,16.7902904973472,12.2751682385293,8.52324490716159,3.93104930508059e-05,0.145028595301123,3.3561307073152,0.305572519287406,0,9.80970950265274,7.56583176147067,1,0.447213631284988,0.447213630569836 +3.93104930508059e-05,8.28034768794947,-4.99357034684026,1.99989869418906e-07,0,16.7006578863968,10.200965165936,2618057.76780153,NA,-7.90065788639682,13.780034834064,1000010,2.6180340557274,2.6180340557274,0,11.8177827019143,18.717495194202,2618060.20071259,39.3108468452434,16.9353190926483,15.6312989458445,8.3232606848154,39.3108468452434,16.9353190926483,15.6312989458445,8.3232606848154,3.93104930508059e-05,8.28034768794947,-4.99357034684026,0.305572512697281,0,-8.13531909264834,8.34970105415546,1,0.447213605518309,0.447213600616584 +3.93104930508059e-05,-3.00398553145278,0.408158252163961,1.99989837316624e-07,0,11.8177827019143,18.717495194202,2618060.20071259,NA,24.6822172980857,-13.481495194202,1000011,2.61803399852178,2.61803399852178,0,27.0722319450313,10.3854729257963,2618062.79173749,39.3108861557364,25.2156667805978,10.6377285990043,8.12327748689645,39.3108861557364,25.2156667805978,10.6377285990043,8.12327748689645,3.93104930508059e-05,-3.00398553145278,0.408158252163961,0.305572552379852,0,11.2843332194022,-5.40172859900423,1,0.447213629843381,0.447213596246464 +3.93104930508059e-05,-0.592304282307975,-7.3539548966678,1.99989607269397e-07,0,27.0722319450313,10.3854729257963,2618062.79173749,NA,-7.27223194503109,8.42252707420371,1000012,2.61803399017559,2.61803399017559,0,22.5777454274166,15.5908809305723,2618065.40583089,39.3109254662295,22.211681249145,11.0458868511682,7.92329697959605,39.3109254662295,22.211681249145,11.0458868511682,7.92329697959605,3.93104930508059e-05,-0.592304282307975,-7.3539548966678,0.305572836747972,0,-2.4116812491448,7.76211314883176,1,0.447213825885571,0.447213595608872 +3.93104930508059e-05,-2.07292731547087,-0.430022942167345,1.99988029041088e-07,0,22.5777454274166,15.5908809305723,2618065.40583089,NA,0.522254572583279,-18.8228809305724,1000013,2.6180339889579,2.6180339889579,0,22.900516504069,3.95770074871513,2618068.02328996,39.3109647767225,21.619376966837,3.69193195450043,7.72333580055348,39.3109647767225,21.619376966837,3.69193195450043,7.72333580055348,3.93104930508059e-05,-2.07292731547087,-0.430022942167345,0.30557478764224,0,1.4806230331629,-6.92393195450046,1,0.447215173855825,0.447213595515848 +3.93104930508059e-05,2.07352233589517,-3.09111392983426,1.99977211490153e-07,0,22.900516504069,3.95770074871513,2618068.02328996,NA,-7.50051650406891,1.96529925128487,1000014,2.61803398878024,2.61803398878024,0,18.2649423713417,5.1723224840826,2618070.64124007,39.3110040872156,19.5464496513661,3.26190901233308,7.52350577815102,39.3110040872156,19.5464496513661,3.26190901233308,7.52350577815102,3.93104930508059e-05,2.07352233589517,-3.09111392983426,0.305588159534,0,-4.14644965136605,2.66109098766692,1,0.447224413605411,0.447213595502276 +3.93104930508059e-05,-3.50650567684333,8.39168115266457,1.99903066861918e-07,0,18.2649423713417,5.1723224840826,2618070.64124007,NA,8.93505762865815,-16.4843224840826,1000015,2.61803398875432,2.61803398875432,0,23.7871116772972,-5.0155490926052,2618073.25926181,39.3110433977086,21.6199719872613,0.170795082498824,7.32455285080981,39.3110433977086,21.6199719872613,0.170795082498824,7.32455285080981,3.93104930508059e-05,-3.50650567684333,8.39168115266457,0.305679811882048,0,5.5800280127385,-11.4827950824988,1,0.447287743882263,0.447213595500296 +3.93104930508059e-05,1.50696063357452,-1.11684261217206,1.99394872015207e-07,0,23.7871116772972,-5.0155490926052,2618073.25926181,NA,-10.6871116772971,23.0865490926052,1000016,2.61803398875054,2.61803398875054,0,17.1821134191607,9.25272292957005,2618075.87729402,39.3110827082017,18.113466310418,8.5624762351634,7.13144817230428,39.3110827082017,18.113466310418,8.5624762351634,7.13144817230428,3.93104930508059e-05,1.50696063357452,-1.11684261217206,0.306308006426631,0,-5.01346631041785,9.50852376483663,1,0.447721816070641,0.447213595500007 +3.93104930508059e-05,2.42738757756697,1.31979101081927,1.95911652716462e-07,0,17.1821134191607,9.25272292957005,2618075.87729402,NA,1.51788658083933,-4.24372292957004,1000017,2.61803398874999,2.61803398874999,0,18.1202189171868,6.62995792025843,2618078.49532775,39.3111220186947,19.6204269439925,7.44563362299134,6.97729399207268,39.3111220186947,19.6204269439925,7.44563362299134,6.97729399207268,3.93104930508059e-05,2.42738757756697,1.31979101081927,0.310613715890657,0,-0.920426943992456,-2.43663362299133,1,0.450696991112437,0.447213595499965 +3.93104930508059e-05,-2.42479790087341,-1.28678435537008,1.72037312471961e-07,0,18.1202189171868,6.62995792025843,2618078.49532775,NA,8.77978108281306,4.74204207974152,1000018,2.61803398874991,2.61803398874991,0,23.5464220401486,9.56070110162094,2618081.1133617,39.3111613291878,22.0478145215595,8.76542463381061,7.08232425688181,39.3111613291878,22.0478145215595,8.76542463381061,7.08232425688181,3.93104930508059e-05,-2.42479790087341,-1.28678435537008,0.340125487594257,0,4.85218547844039,2.60657536618935,1,0.471089144216628,0.447213595499959 +3.93104930508059e-05,0.398218719812695,1.75985592307045,8.40015005919993e-09,0,23.5464220401486,9.56070110162094,2618081.1133617,NA,-6.74642204014869,-5.12870110162093,1000019,2.6180339887499,2.6180339887499,0,19.3769039168853,6.39098950268018,2618083.73139568,39.3112006396808,19.6230166206861,7.47864027844054,8.91044962716286,39.3112006396808,19.6230166206861,7.47864027844054,8.91044962716286,3.93104930508059e-05,0.398218719812695,1.75985592307045,0.542402180055435,0,-2.82301662068611,-3.04664027844052,1,0.610859040904169,0.447213595499958 +3.93104930508059e-05,0.398218719812695,-3.9906478754186,8.40015005919993e-09,0,19.3769039168853,6.39098950268018,2618083.73139568,NA,NA,8.59801049731985,1000020,2.61803398874989,2.61803398874989,0,19.3769039168853,11.7048522256522,4236152.69885934,39.3112399501739,20.0212353404988,9.23849620151098,22.1829478034946,39.3112399501739,20.0212353404988,9.23849620151098,22.1829478034946,3.93104930508059e-05,0.398218719812695,-3.9906478754186,0.542402180055435,0,0,5.75050379848905,1,1,0.447213595499958 +3.93104930508059e-05,0.398218719812695,3.00220045067378,8.40015005919993e-09,0,19.3769039168853,11.7048522256522,4236152.69885934,NA,NA,-13.4498522256522,1000021,3.61803398874989,2.61803398874989,0,19.3769039168853,3.39238640653573,5854224.90239096,39.3112792606669,20.4194540603115,5.24784832609238,34.0842376340759,39.3112792606669,20.4194540603115,5.24784832609238,34.0842376340759,3.93104930508059e-05,0.398218719812695,3.00220045067378,0.542402180055436,0,0,-6.99284832609238,1,1,0.447213595499958 +3.93104930508059e-05,0.398218719812695,2.27624922743993,8.4001500591999e-09,0,19.3769039168853,3.39238640653573,5854224.90239096,NA,NA,5.58361359346427,1000022,4.61803398874989,2.61803398874989,0,19.3769039168853,6.84324938734259,7472300.34199059,39.31131857116,20.8176727801241,8.25004877676615,44.6647169640579,39.31131857116,20.8176727801241,8.25004877676615,44.6647169640579,3.93104930508059e-05,0.398218719812695,2.27624922743993,0.542402180055438,0,0,0.725951223233845,1,1,0.447213595499959 +3.93104930508059e-05,0.398218719812695,9.64654723164601,8.4001500591996e-09,0,19.3769039168853,6.84324938734259,7472300.34199059,NA,NA,-3.68724938734258,1000023,5.61803398874989,2.61803398874989,0,19.3769039168853,4.56440394096765,9090379.01765818,39.311357881653,21.2158914999368,10.5262980042061,53.9747838399865,39.311357881653,21.2158914999368,10.5262980042061,53.9747838399865,3.93104930508059e-05,0.398218719812695,9.64654723164601,0.542402180055453,0,0,-7.37029800420608,1,1,0.447213595499965 +3.93104930508059e-05,0.398218719812695,-9.41560753250186,8.40015005919763e-09,0,19.3769039168853,4.56440394096765,9090379.01765818,NA,NA,34.6705960590323,1000024,6.61803398874989,2.61803398874989,0,19.3769039168853,25.9920107156678,10708460.9293938,39.3113971921461,21.6141102197495,20.1728452358521,62.0648365106031,39.3113971921461,21.6141102197495,20.1728452358521,62.0648365106031,3.93104930508059e-05,0.398218719812695,-9.41560753250186,0.542402180055557,0,0,19.0621547641479,1,1,0.447213595500005 +3.93104930508059e-05,0.398218719812695,1.36763017084832,8.40015005918399e-09,0,19.3769039168853,25.9920107156678,10708460.9293938,NA,NA,-26.0180107156677,1000025,7.61803398874989,2.61803398874989,0,19.3769039168853,9.91199577372614,12326546.0771973,39.3114365026391,22.0123289395622,10.7572377033502,68.9852734257349,39.3114365026391,22.0123289395622,10.7572377033502,68.9852734257349,3.93104930508059e-05,0.398218719812695,1.36763017084832,0.542402180056268,0,0,-10.7832377033502,1,1,0.447213595500282 +3.93104930508059e-05,0.398218719812695,-1.83250195495311,8.40015005909073e-09,0,19.3769039168853,9.91199577372614,12326546.0771973,NA,NA,5.41300422627384,1000026,8.61803398874989,2.61803398874989,0,19.3769039168853,13.2574163668102,13944634.4610688,39.3114758131322,22.4105476593749,12.1248678741986,74.7864932371879,39.3114758131322,22.4105476593749,12.1248678741986,74.7864932371879,3.93104930508059e-05,0.398218719812695,-1.83250195495311,0.542402180061141,0,0,3.20013212580143,1,1,0.447213595502179 +3.93104930508059e-05,0.398218719812695,6.41086396429236,8.40015005845134e-09,0,19.3769039168853,13.2574163668102,13944634.4610688,NA,NA,-11.2084163668102,1000027,9.61803398874989,2.61803398874989,0,19.3769039168853,6.33023409206088,15562726.0810083,39.3115151236252,22.8087663791876,10.2923659192454,79.518894799867,39.3115151236252,22.8087663791876,10.2923659192454,79.518894799867,3.93104930508059e-05,0.398218719812695,6.41086396429236,0.542402180094541,0,0,-8.24336591924547,1,1,0.447213595515181 +3.93104930508059e-05,0.398218719812695,-14.6369061521699,8.40015005406902e-09,0,19.3769039168853,6.33023409206088,15562726.0810083,NA,NA,31.4207659079392,1000028,10.6180339887499,2.61803398874989,0,19.3769039168853,25.7493353757212,17180820.9370158,39.3115544341183,23.2069850990003,16.7032298835378,83.232877180908,39.3115544341183,23.2069850990003,16.7032298835378,83.232877180908,3.93104930508059e-05,0.398218719812695,-14.6369061521699,0.542402180323468,0,0,21.0477701164622,1,1,0.447213595604297 +3.93104930508059e-05,0.398218719812695,-3.73458242080194,8.4001500240321e-09,0,19.3769039168853,25.7493353757212,17180820.9370158,NA,NA,-34.5853353757212,1000029,11.6180339887499,2.61803398874989,0,19.3769039168853,4.37442260121139,18798919.0290913,39.3115937446113,23.605203818813,2.06632373136792,85.9788397236703,39.3115937446113,23.605203818813,2.06632373136792,85.9788397236703,3.93104930508059e-05,0.398218719812695,-3.73458242080194,0.542402181892556,0,0,-10.9023237313679,1,1,0.44721359621511 +3.93104930508059e-05,0.398218719812695,-0.691841110235955,8.40014981815599e-09,0,19.3769039168853,4.37442260121139,18798919.0290913,NA,NA,-9.0854226012114,1000030,12.6180339887499,2.61803398874989,0,19.3769039168853,-1.24067736849374,20417020.3572346,39.3116330551044,24.0034225386257,-1.66825868943402,87.8071824916291,39.3116330551044,24.0034225386257,-1.66825868943402,87.8071824916291,3.93104930508059e-05,0.398218719812695,-0.691841110235955,0.542402192647247,0,0,-3.04274131056599,1,1,0.447213600401682 +3.93104930508059e-05,0.398218719812695,-5.31194090990592,8.40014840706026e-09,0,19.3769039168853,-1.24067736849374,20417020.3572346,NA,NA,3.50067736849373,1000031,13.6180339887499,2.61803398874989,0,19.3769039168853,0.922860228882926,22035124.9214461,39.3116723655974,24.4016412584384,-2.36009979966998,88.7683093188851,39.3116723655974,24.4016412584384,-2.36009979966998,88.7683093188851,3.93104930508059e-05,0.398218719812695,-5.31194090990592,0.542402266360998,0,0,4.62009979966997,1,1,0.447213629096876 +3.93104930508059e-05,0.398218719812695,-0.0339816194818372,8.40013873526612e-09,0,19.3769039168853,0.922860228882926,22035124.9214461,NA,NA,-13.8728602288829,1000032,14.6180339887499,2.61803398874989,0,19.3769039168853,-7.65103891374336,23653232.7217255,39.3117116760905,24.7998599782511,-7.6720407095759,88.9126485926108,39.3117116760905,24.7998599782511,-7.6720407095759,88.9126485926108,3.93104930508059e-05,0.398218719812695,-0.0339816194818372,0.542402771602562,0,0,-5.27795929042409,1,1,0.447213825776657 +3.93104930508059e-05,0.398218719812695,11.8739960514605,8.40007244380289e-09,0,19.3769039168853,-7.65103891374336,23653232.7217255,NA,NA,-11.9629610862567,1000033,15.6180339887499,2.61803398874989,0,19.3769039168853,-15.0445554711423,25271343.7580728,39.3117509865835,25.1980786980638,-7.70602232905774,88.2907936731136,39.3117509865835,25.1980786980638,-7.70602232905774,88.2907936731136,3.93104930508059e-05,0.398218719812695,11.8739960514605,0.542406234579759,0,0,-11.9079776709423,1,1,0.447215173839934 +3.93104930508059e-05,0.398218719812695,3.40196977386313,8.39961807535446e-09,0,19.3769039168853,-15.0445554711423,25271343.7580728,NA,NA,27.6845554711424,1000034,16.6180339887499,2.61803398874989,0,19.3769039168853,2.06544077345551,26889458.0304881,39.3117902970766,25.5962974178765,4.16797372240271,86.9544440782659,39.3117902970766,25.5962974178765,4.16797372240271,86.9544440782659,3.93104930508059e-05,0.398218719812695,3.40196977386313,0.542429970178574,0,0,8.47202627759733,1,1,0.447224413603093 +3.93104930508059e-05,0.398218719812695,1.17091327012898,8.39650378767862e-09,0,19.3769039168853,2.06544077345551,26889458.0304881,NA,NA,7.73555922654448,1000035,17.6180339887499,2.61803398874989,0,19.3769039168853,6.84627929744785,28507575.5389715,39.3118296075696,25.9945161376892,7.56994349626584,84.9626637047663,39.3118296075696,25.9945161376892,7.56994349626584,84.9626637047663,3.93104930508059e-05,0.398218719812695,1.17091327012898,0.54259265639308,0,0,2.23105650373415,1,1,0.447287743881925 +3.93104930508059e-05,0.398218719812695,-0.161229963476183,8.37515814239612e-09,0,19.3769039168853,6.84627929744785,28507575.5389715,NA,NA,3.22672070255213,1000036,18.6180339887499,2.61803398874989,0,19.3769039168853,8.840502363828,30125696.2835228,39.3118689180627,26.3927348575019,8.74085676639482,82.4231587723746,39.3118689180627,26.3927348575019,8.74085676639482,82.4231587723746,3.93104930508059e-05,0.398218719812695,-0.161229963476183,0.543707724295812,0,0,1.33214323360516,1,1,0.447721816070592 +3.93104930508059e-05,0.398218719812695,-10.7006031605576,8.2288529130945e-09,0,19.3769039168853,8.840502363828,30125696.2835228,NA,NA,10.278497636172,1000037,19.6180339887499,2.61803398874989,0,19.3769039168853,15.1929632562678,31743820.2641421,39.3119082285557,26.7909535773146,8.57962680291863,79.7622737317176,39.3119082285557,26.7909535773146,8.57962680291863,79.7622737317176,3.93104930508059e-05,0.398218719812695,-10.7006031605576,0.551350513400429,0,0,10.5393731970814,1,1,0.45069699111243 +3.93104930508059e-05,0.398218719812695,3.1514204818035,7.22606195326572e-09,0,19.3769039168853,15.1929632562678,31743820.2641421,NA,NA,-31.1659632562678,1000038,20.6180339887499,2.61803398874989,0,19.3769039168853,-4.06866132823607,33361947.4808294,39.3119475390488,27.1891722971273,-2.12097635763894,79.4755276399229,39.3119475390488,27.1891722971273,-2.12097635763894,79.4755276399229,3.93104930508059e-05,0.398218719812695,3.1514204818035,0.603734969230016,0,0,-13.8520236423611,1,1,0.471089144216627 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,-4.06866132823607,33361947.4808294,NA,NA,9.01366132823606,1000039,21.6180339887499,2.61803398874989,0,19.3769039168853,1.50208773569434,34980077.9335846,39.3119868495418,27.58739101694,1.03044412416455,97.3702489498367,39.3119868495418,27.58739101694,1.03044412416455,97.3702489498367,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,3.91455587583544,1,1,0.610859040904169 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,34980077.9335846,NA,NA,NA,1000040,22.6180339887499,2.61803398874989,0,19.3769039168853,1.50208773569434,59217150.3325171,39.3120261600349,27.9856097367527,0.267308730132611,234.021528812389,39.3120261600349,27.9856097367527,0.267308730132611,234.021528812389,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,59217150.3325171,NA,NA,NA,1000041,23.6180339887499,3.61803398874989,0,19.3769039168853,1.50208773569434,85454353.2035861,39.3120654705279,28.3838284565654,-0.495826663899332,343.827227244831,39.3120654705279,28.3838284565654,-0.495826663899332,343.827227244831,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,85454353.2035861,NA,NA,NA,1000042,24.6180339887499,4.61803398874989,0,19.3769039168853,1.50208773569434,113691692.54679,39.312104781021,28.782047176378,-1.25896205793127,426.169489039222,39.312104781021,28.782047176378,-1.25896205793127,426.169489039222,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,113691692.54679,NA,NA,NA,1000043,25.6180339887499,5.61803398874989,0,19.3769039168853,1.50208773569434,143929174.362131,39.312144091514,29.1802658961907,-2.02209745196322,480.994597127193,39.312144091514,29.1802658961907,-2.02209745196322,480.994597127193,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,143929174.362131,NA,NA,NA,1000044,26.6180339887499,6.61803398874989,0,19.3769039168853,1.50208773569434,176166804.649607,39.3121834020071,29.5784846160034,-2.78523284599516,508.770633947839,39.3121834020071,29.5784846160034,-2.78523284599516,508.770633947839,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,176166804.649607,NA,NA,NA,1000045,27.6180339887499,7.61803398874989,0,19.3769039168853,1.50208773569434,210404589.409219,39.3122227125001,29.9767033358161,-3.5483682400271,510.445142504558,39.3122227125001,29.9767033358161,-3.5483682400271,510.445142504558,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,210404589.409219,NA,NA,NA,1000046,28.6180339887499,8.61803398874989,0,19.3769039168853,1.50208773569434,246642534.640968,39.3122620229932,30.3749220556288,-4.31150363405905,487.402787222299,39.3122620229932,30.3749220556288,-4.31150363405905,487.402787222299,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,246642534.640968,NA,NA,NA,1000047,29.6180339887499,9.61803398874989,0,19.3769039168853,1.50208773569434,284880646.344853,39.3123013334862,30.7731407754415,-5.07463902809099,441.423014524865,39.3123013334862,30.7731407754415,-5.07463902809099,441.423014524865,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,284880646.344853,NA,NA,NA,1000048,30.6180339887499,10.6180339887499,0,19.3769039168853,1.50208773569434,325118930.520874,39.3123406439793,31.1713594952542,-5.83777442212293,374.637713163081,39.3123406439793,31.1713594952542,-5.83777442212293,374.637713163081,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,325118930.520874,NA,NA,NA,1000049,31.6180339887499,11.6180339887499,0,19.3769039168853,1.50208773569434,367357393.16903,39.3123799544723,31.5695782150669,-6.60090981615487,289.488874288941,39.3123799544723,31.5695782150669,-6.60090981615487,289.488874288941,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +3.93104930508059e-05,0.398218719812695,-0.763135394031943,3.5283046376582e-10,0,19.3769039168853,1.50208773569434,367357393.16903,NA,NA,NA,1000050,32.6180339887499,12.6180339887499,0,19.3769039168853,1.50208773569434,411596040.289321,39.3124192649654,31.9677969348796,-7.36404521018682,188.6862512757,39.3124192649654,31.9677969348796,-7.36404521018682,188.6862512757,3.93104930508059e-05,0.398218719812695,-0.763135394031943,0.962783370932509,0,0,0,1,1,1 +26.991497888965,0.398218719812695,-0.763135394031943,0.000134776118126662,0,19.3769039168853,1.50208773569434,411596040.289321,12.3209999999999,NA,NA,1000051,33.6180339887499,13.6180339887499,12.3209876796283,19.3769039168853,1.50208773569434,915.622601172475,39.3124585754584,32.3660156546923,-8.12718060421876,75.1650192839404,39.3124585754584,32.3660156546923,-8.12718060421876,75.1650192839404,26.991497888965,0.398218719812695,-0.763135394031943,0.595033301573348,-26.9914585784719,0,0,0.618033606794666,1,1 +13.7904543548196,0.398218719812695,-0.763135394031943,0.000154439637277554,12.3209876796283,19.3769039168853,1.50208773569434,915.622601172475,67.1840123203719,NA,NA,2.99999899999239,34.6180339887499,14.6180339887499,57.1103217615932,19.3769039168853,1.50208773569434,843.412606224117,66.3039564658548,32.764234374505,-8.8903159982507,59.2775451997449,66.3039564658548,32.764234374505,-8.8903159982507,59.2775451997449,13.7904543548196,0.398218719812695,-0.763135394031943,0.541379289550537,13.2010435341454,0,0,0.472135899271044,1,1 +-13.4471348245054,0.398218719812695,-0.763135394031943,0.00015730850605828,57.1103217615932,19.3769039168853,1.50208773569434,843.412606224117,50.2216782384062,NA,NA,2.66666655555467,35.6180339887499,15.6180339887499,88.4988698758771,19.3769039168853,1.50208773569434,903.960947662208,80.0944108206744,33.1624530943177,-9.65345139228264,57.8808899414837,80.0944108206744,33.1624530943177,-9.65345139228264,57.8808899414837,-13.4471348245054,0.398218719812695,-0.763135394031943,0.533551274693594,27.237589179325,0,0,0.450849710616688,1,1 +8.79814117166351,0.398218719812695,-0.763135394031943,0.000157727068372476,88.4988698758771,19.3769039168853,1.50208773569434,903.960947662208,-44.0968698758771,NA,NA,2.62499998437488,36.6180339887499,16.6180339887499,61.2008076717564,19.3769039168853,1.50208773569434,985.222424167378,66.647275996169,33.5606718141304,-10.4165867863146,58.2462236090637,66.647275996169,33.5606718141304,-10.4165867863146,58.2462236090637,8.79814117166351,0.398218719812695,-0.763135394031943,0.532409182717797,-22.2452759961689,0,0,0.447744097545979,1,1 +7.20055833949541,0.398218719812695,-0.763135394031943,0.000157788135791119,61.2008076717564,19.3769039168853,1.50208773569434,985.222424167378,15.8421923282441,NA,NA,2.61904761678003,37.6180339887499,17.6180339887499,70.9941629239793,19.3769039168853,1.50208773569434,1072.45938750696,75.4454171678325,33.9588905339431,-11.1797221803465,58.4423331231985,75.4454171678325,33.9588905339431,-11.1797221803465,58.4423331231985,7.20055833949541,0.398218719812695,-0.763135394031943,0.532242553744166,1.5975828321681,0,0,0.447290994705373,1,1 +-31.7734661531766,0.398218719812695,-0.763135394031943,0.000157797045407426,70.9941629239793,19.3769039168853,1.50208773569434,1072.45938750696,50.6258370760206,NA,NA,2.61818181785124,38.6180339887499,18.6180339887499,102.283742781023,19.3769039168853,1.50208773569434,1163.36878861692,82.6459755073279,34.3571092537558,-11.9428575743785,58.178680559852,82.6459755073279,34.3571092537558,-11.9428575743785,58.178680559852,-31.7734661531766,0.398218719812695,-0.763135394031943,0.532218242904548,38.974024492672,0,0,0.447224887891842,1,1 +-37.3059567990251,0.398218719812695,-0.763135394031943,0.000157798345302926,102.283742781023,19.3769039168853,1.50208773569434,1163.36878861692,-45.878742781023,NA,NA,2.61805555550733,39.6180339887499,19.6180339887499,73.9289760227823,19.3769039168853,1.50208773569434,1257.5836652169,50.8725093541513,34.7553279735685,-12.7059929684104,57.4142905116076,50.8725093541513,34.7553279735685,-12.7059929684104,57.4142905116076,-37.3059567990251,0.398218719812695,-0.763135394031943,0.532214696000849,5.53249064584847,0,0,0.44721524303773,1,1 +2.57959575610067,0.398218719812695,-0.763135394031943,0.000157798534955124,73.9289760227823,19.3769039168853,1.50208773569434,1257.5836652169,-100.247976022782,NA,NA,2.61803713527148,40.6180339887499,20.6180339887499,11.972273516404,19.3769039168853,1.50208773569434,1355.0456094439,13.5665525551262,35.1535466933812,-13.4691283624424,56.1485335277661,13.5665525551262,35.1535466933812,-13.4691283624424,56.1485335277661,2.57959575610067,0.398218719812695,-0.763135394031943,0.532214178514573,-39.8855525551257,0,0,0.447213835872479,1,1 +-28.0722559326722,0.398218719812695,-0.763135394031943,0.000157798562625007,11.972273516404,19.3769039168853,1.50208773569434,1355.0456094439,34.8257264835957,NA,NA,2.61803444782065,41.6180339887499,21.6180339887499,33.495758498714,19.3769039168853,1.50208773569434,1455.74535856208,16.1461483112269,35.5517654131939,-14.2322637564743,54.3899567844765,16.1461483112269,35.5517654131939,-14.2322637564743,54.3899567844765,-28.0722559326722,0.398218719812695,-0.763135394031943,0.532214103014343,30.6518516887729,0,0,0.447213630569836,1,1 +3.43463644588246,0.398218719812695,-0.763135394031943,0.000157798566661988,33.495758498714,19.3769039168853,1.50208773569434,1455.74535856208,-76.928758498714,NA,NA,2.6180340557274,42.6180339887499,22.6180339887499,-14.0488297175627,19.3769039168853,1.50208773569434,1559.68144901313,-11.9261076214453,35.9499841330066,-14.9953991505062,52.1516821863348,-11.9261076214453,35.9499841330066,-14.9953991505062,52.1516821863348,3.43463644588246,0.398218719812695,-0.763135394031943,0.532214091999008,-31.5068923785547,0,0,0.447213600616584,1,1 +-17.6278347296803,0.398218719812695,-0.763135394031943,0.000157798567250976,-14.0488297175627,19.3769039168853,1.50208773569434,1559.68144901313,26.6198297175626,NA,NA,2.61803399852178,43.6180339887499,23.6180339887499,2.40312986057738,19.3769039168853,1.50208773569434,1666.85365033111,-8.49147117556287,36.3482028528193,-15.7585345445382,49.4507328874756,-8.49147117556287,36.3482028528193,-15.7585345445382,49.4507328874756,-17.6278347296803,0.398218719812695,-0.763135394031943,0.532214090391892,21.0624711755628,0,0,0.447213596246464,1,1 +4.92085936507614,0.398218719812695,-0.763135394031943,0.000157798567336908,2.40312986057738,19.3769039168853,1.50208773569434,1666.85365033111,-51.071129860577,NA,NA,2.61803399017559,44.6180339887499,24.6180339887499,-29.1605642477421,19.3769039168853,1.50208773569434,1777.26192633711,-26.1193059052432,36.7464215726319,-16.5216699385701,46.307935587268,-26.1193059052432,36.7464215726319,-16.5216699385701,46.307935587268,4.92085936507614,0.398218719812695,-0.763135394031943,0.532214090157417,-22.5486940947565,0,0,0.447213595608872,1,1 +2.90241282490937,0.398218719812695,-0.763135394031943,0.000157798567349445,-29.1605642477421,19.3769039168853,1.50208773569434,1777.26192633711,9.98056424774176,NA,NA,2.6180339889579,45.6180339887499,25.6180339887499,-22.9922363154327,19.3769039168853,1.50208773569434,1890.90627136785,-21.1984465401671,37.1446402924446,-17.2848053326021,42.7479064808657,-21.1984465401671,37.1446402924446,-17.2848053326021,42.7479064808657,2.90241282490937,0.398218719812695,-0.763135394031943,0.532214090123208,2.01844654016677,0,0,0.447213595515848,1,1 +43.6513791096517,0.398218719812695,-0.763135394031943,0.000157798567351274,-22.9922363154327,19.3769039168853,1.50208773569434,1890.90627136785,-36.0527636845673,NA,NA,2.61803398878024,46.6180339887499,26.6180339887499,-45.2740696610229,19.3769039168853,1.50208773569434,2007.78668453912,-18.2960337152577,37.5428590122573,-18.047940726634,38.7990492573245,-18.2960337152577,37.5428590122573,-18.047940726634,38.7990492573245,43.6513791096517,0.398218719812695,-0.763135394031943,0.532214090118217,-40.7489662847424,0,0,0.447213595502276,1,1 +32.3597245040459,0.398218719812695,-0.763135394031943,0.000157798567351541,-45.2740696610229,19.3769039168853,1.50208773569434,2007.78668453912,81.9210696610228,NA,NA,2.61803398875432,47.6180339887499,27.6180339887499,5.35593578428997,19.3769039168853,1.50208773569434,2127.90316571322,25.355345394394,37.94107773207,-18.811076120666,34.4935548170859,25.355345394394,37.94107773207,-18.811076120666,34.4935548170859,32.3597245040459,0.398218719812695,-0.763135394031943,0.532214090117488,11.2916546056059,0,0,0.447213595500296,1,1 +8.68879440248531,0.398218719812695,-0.763135394031943,0.00015779856735158,5.35593578428997,19.3769039168853,1.50208773569434,2127.90316571322,76.0300642157105,NA,NA,2.61803398875054,48.6180339887499,28.6180339887499,52.3450996364433,19.3769039168853,1.50208773569434,2251.25571486874,57.7150698984399,38.3392964518827,-19.5742115146979,29.8674012325156,57.7150698984399,38.3392964518827,-19.5742115146979,29.8674012325156,8.68879440248531,0.398218719812695,-0.763135394031943,0.532214090117382,23.6709301015605,0,0,0.447213595500007,1,1 +10.9096587034105,0.398218719812695,-0.763135394031943,0.000157798567351586,52.3450996364433,19.3769039168853,1.50208773569434,2251.25571486874,11.8379003635567,NA,NA,2.61803398874999,49.6180339887499,29.6180339887499,59.6613244165562,19.3769039168853,1.50208773569434,2377.84433200237,66.4038643009252,38.7375151716954,-20.3373469087298,24.9603537424539,66.4038643009252,38.7375151716954,-20.3373469087298,24.9603537424539,10.9096587034105,0.398218719812695,-0.763135394031943,0.532214090117367,-2.2208643009252,0,0,0.447213595499965,1,1 +-24.9288182922529,0.398218719812695,-0.763135394031943,0.000157798567351586,59.6613244165562,19.3769039168853,1.50208773569434,2377.84433200237,53.4906755834429,NA,NA,2.61803398874991,50.6180339887499,30.6180339887499,92.7203800083182,19.3769039168853,1.50208773569434,2507.66901711359,77.3135230043357,39.1357338915081,-21.1004823027618,19.8159647514722,77.3135230043357,39.1357338915081,-21.1004823027618,19.8159647514722,-24.9288182922529,0.398218719812695,-0.763135394031943,0.532214090117365,35.8384769956634,0,0,0.447213595499959,1,1 +-10.8281135801707,0.398218719812695,-0.763135394031943,0.000157798567351587,92.7203800083182,19.3769039168853,1.50208773569434,2507.66901711359,-54.4363800083176,NA,NA,2.6180339887499,51.6180339887499,31.6180339887499,59.0768469386726,19.3769039168853,1.50208773569434,2640.72977020233,52.3847047120828,39.5339526113208,-21.8636176967937,14.4815738297741,52.3847047120828,39.5339526113208,-21.8636176967937,14.4815738297741,-10.8281135801707,0.398218719812695,-0.763135394031943,0.532214090117364,-14.1007047120822,0,0,0.447213595499958,1,1 +5.60347755174136,0.398218719812695,-0.763135394031943,0.000157798567351587,59.0768469386726,19.3769039168853,1.50208773569434,2640.72977020233,-33.9518469386726,NA,NA,2.61803398874989,52.6180339887499,32.6180339887499,38.0934515497389,19.3769039168853,1.50208773569434,2777.02659126858,41.5565911319121,39.9321713311335,-22.6267530908257,9.00830771318104,41.5565911319121,39.9321713311335,-22.6267530908257,9.00830771318104,5.60347755174136,0.398218719812695,-0.763135394031943,0.532214090117364,-16.4315911319121,0,0,0.447213595499958,1,1 +15.3365462353951,-3.5713912292413,-0.763135394031943,0.00323175672431719,38.0934515497389,19.3769039168853,1.50208773569434,2777.02659126858,-0.666451549739179,24.9230960831148,NA,2.61803398874989,53.6180339887499,33.6180339887499,37.681561840145,43.8351732574094,1.50208773569434,107.775750230013,47.1600686836534,40.3303900509462,-23.3898884848576,3.45108030313134,47.1600686836534,40.3303900509462,-23.3898884848576,3.45108030313134,15.3365462353951,-3.5713912292413,-0.763135394031943,0.333736816631528,-9.73306868365374,3.969609949054,0,0.447213595499958,0.610859040904168,1 +17.5701611544437,-6.31239240753641,-0.763135394031943,0.00368024117524921,37.681561840145,43.8351732574094,1.50208773569434,107.775750230013,22.5814381598549,-4.33517325740935,NA,2.61803398874989,2.9813495586166,34.6180339887499,51.6376581377892,40.9540976065285,1.50208773569434,93.2384587821971,62.4966149190485,36.7589988217049,-24.1530238788896,2.60999645771893,62.4966149190485,36.7589988217049,-24.1530238788896,2.60999645771893,17.5701611544437,-6.31239240753641,-0.763135394031943,0.304779372685822,-2.23361491904861,2.7410011782951,0,0.447213595499958,0.471089144216627,1 +-6.73206277206464,4.83421400663235,-0.763135394031943,0.00374567417480778,51.6376581377892,40.9540976065285,1.50208773569434,93.2384587821971,52.7313418622114,-21.6540976065288,NA,2.61803398874989,2.66458143188549,35.6180339887499,84.227419681026,27.4266413356357,1.50208773569434,93.6337703373397,80.0667760734922,30.4466064141685,-24.9161592729215,2.4402251811809,80.0667760734922,30.4466064141685,-24.9161592729215,2.4402251811809,-6.73206277206464,4.83421400663235,-0.763135394031943,0.300554538551708,24.3022239265084,-11.1466064141688,0,0.447213595499958,0.45069699111243,1 +-29.187349470637,6.61503442743319,-0.763135394031943,0.00375522072078576,84.227419681026,27.4266413356357,1.50208773569434,93.6337703373397,11.5625803189739,6.07335866436427,NA,2.61803398874989,2.62470653437963,36.6180339887499,91.3734873158025,31.1860808685418,1.50208773569434,95.9247907377673,73.3347133014276,35.2808204208008,-25.6792946669534,2.36017752849888,73.3347133014276,35.2808204208008,-25.6792946669534,2.36017752849888,-29.187349470637,6.61503442743319,-0.763135394031943,0.29993814355862,22.4552866985724,-1.78082042080084,0,0.447213595499958,0.447721816070592,1 +16.0880143601542,-4.88911072433286,-0.763135394031943,0.00375661354307306,91.3734873158025,31.1860808685418,1.50208773569434,95.9247907377673,-92.5014873158031,22.2139191314583,NA,2.61803398874989,2.6190050251708,37.6180339887499,34.2044241447189,44.9181838454055,1.50208773569434,98.4939115799613,44.1473638307906,41.895854848234,-26.4424300609854,2.28649729260917,44.1473638307906,41.895854848234,-26.4424300609854,2.28649729260917,16.0880143601542,-4.88911072433286,-0.763135394031943,0.299848212741115,-45.2753638307912,11.5041451517661,0,0.447213595499958,0.447287743881925,1 +57.7113925510989,11.1176333995683,-0.763135394031943,0.00375681675310613,34.2044241447189,44.9181838454055,1.50208773569434,98.4939115799613,-15.5924241447188,-23.9181838454055,NA,2.61803398874989,2.61817560852722,38.6180339887499,24.5677760562782,30.1354391078679,1.50208773569434,101.104616565445,60.2353781909448,37.0067441239012,-27.2055654550173,2.20727776433504,60.2353781909448,37.0067441239012,-27.2055654550173,2.20727776433504,57.7113925510989,11.1176333995683,-0.763135394031943,0.299835092011667,-41.6233781909447,-16.0067441239012,0,0.447213595499958,0.447224413603093,1 +-39.5058367068581,-18.1579890769623,-0.763135394031943,0.0037568464010504,24.5677760562782,30.1354391078679,1.50208773569434,101.104616565445,190.596223943723,47.2645608921322,NA,2.61803398874989,2.61805464967932,39.6180339887499,142.362720580885,59.3466866751917,1.50208773569434,103.721552780829,117.946770742044,48.1243775234695,-27.9687008490493,2.12082427278623,117.946770742044,48.1243775234695,-27.9687008490493,2.12082427278623,-39.5058367068581,-18.1579890769623,-0.763135394031943,0.299833177723039,97.217229257957,29.2756224765306,0,0.447213595499958,0.447215173839934,1 +-16.7959026716724,-3.69160063045511,-0.763135394031943,0.00375685072662718,142.362720580885,59.3466866751917,1.50208773569434,103.721552780829,-86.6317205808854,-43.8466866751917,NA,2.61803398874989,2.61803700311508,40.6180339887499,88.8213727580142,32.247924732546,1.50208773569434,106.339422442306,78.4409340351855,29.9663884465072,-28.7318362430812,2.02689654487904,78.4409340351855,29.9663884465072,-28.7318362430812,2.02689654487904,-16.7959026716724,-3.69160063045511,-0.763135394031943,0.299832898432092,-22.7099340351857,-14.4663884465072,0,0.447213595499958,0.447213825776657,1 +-31.0728713081588,-7.31681281440313,-0.763135394031943,0.00375685135772032,88.8213727580142,32.247924732546,1.50208773569434,106.339422442306,-12.8993727580146,-2.34792473254589,NA,2.61803398874989,2.61803442853934,41.6180339887499,80.8491219600067,30.7968272941529,1.50208773569434,108.957431848288,61.6450313635131,26.2747878160521,-29.4949716371132,1.92546065628251,61.6450313635131,26.2747878160521,-29.4949716371132,1.92546065628251,-31.0728713081588,-7.31681281440313,-0.763135394031943,0.299832857684092,14.2769686364864,3.62521218394802,0,0.447213595499958,0.447213629096876,1 +-10.2277112528044,-7.25883781275381,-0.763135394031943,0.00375685144979557,80.8491219600067,30.7968272941529,1.50208773569434,108.957431848288,-71.1221219600068,-11.8968272941533,NA,2.61803398874989,2.6180340529143,42.6180339887499,36.8932332367072,23.4441835567071,1.50208773569434,111.575462161788,30.5721600553543,18.9579750016489,-30.2581070311451,1.81651183904215,30.5721600553543,18.9579750016489,-30.2581070311451,1.81651183904215,-10.2277112528044,-7.25883781275381,-0.763135394031943,0.299832851739039,-20.8451600553544,-0.0579750016493122,0,0.447213595499958,0.447213600401682,1 +4.64773754974549,6.64029937614114,-0.763135394031943,0.00375685146322917,36.8932332367072,23.4441835567071,1.50208773569434,111.575462161788,-31.4242332367071,-25.6441835567069,NA,2.61803398874989,2.61803399811135,43.6180339887499,17.4719890260181,7.59520646989574,1.50208773569434,114.193495601389,20.3444488025499,11.6991371888951,-31.021242425177,1.70004942641947,20.3444488025499,11.6991371888951,-31.021242425177,1.70004942641947,4.64773754974549,6.64029937614114,-0.763135394031943,0.299832850871668,-14.8754488025499,-13.899137188895,0,0.447213595499958,0.44721359621511,1 +-12.2770760979595,-11.9202640588227,-0.763135394031943,0.0037568514651891,17.4719890260181,7.59520646989574,1.50208773569434,114.193495601389,24.4450109739823,29.3047935301043,NA,2.61803398874989,2.61803399011571,44.6180339887499,32.5798366633033,25.7065649106378,1.50208773569434,116.811529508131,24.9921863522954,18.3394365650363,-31.784377819209,1.5760733257063,24.9921863522954,18.3394365650363,-31.784377819209,1.5760733257063,-12.2770760979595,-11.9202640588227,-0.763135394031943,0.29983285074512,16.924813647705,18.5605634349638,0,0.447213595499958,0.447213595604297,1 +-15.7219658436233,-15.601091552609,-0.763135394031943,0.00375685146547505,32.5798366633033,25.7065649106378,1.50208773569434,116.811529508131,-16.4198366633034,-15.6065649106379,NA,2.61803398874989,2.61803398894916,45.6180339887499,22.4318195156601,16.0611773477784,1.50208773569434,119.429563484641,12.715110254336,6.41917250621361,-32.5475132132409,1.44458352409442,12.715110254336,6.41917250621361,-32.5475132132409,1.44458352409442,-15.7219658436233,-15.601091552609,-0.763135394031943,0.299832850726657,3.44488974566389,3.6808274937863,0,0.447213595499958,0.447213595515181,1 +-37.7008214329105,-18.1830105990044,-0.763135394031943,0.00375685146551678,22.4318195156601,16.0611773477784,1.50208773569434,119.429563484641,-3.45981951566036,-22.6611773477783,NA,2.61803398874989,2.61803398877897,46.6180339887499,20.2935334600418,2.05579952166608,1.50208773569434,122.047597471565,-3.00685558928739,-9.18191904639536,-33.3106486072729,1.30558001982735,-3.00685558928739,-9.18191904639536,-33.3106486072729,1.30558001982735,-37.7008214329105,-18.1830105990044,-0.763135394031943,0.299832850723963,21.9788555892871,2.58191904639546,0,0.447213595499958,0.447213595502179,1 +42.6855015448917,40.6520597555961,-0.763135394031943,0.00375685146552286,20.2935334600418,2.05579952166608,1.50208773569434,122.047597471565,-141.387533460042,-88.2557995216664,NA,2.61803398874989,2.61803398875414,47.6180339887499,-67.0887678037771,-52.4892842870751,1.50208773569434,124.665631460043,-40.7076770221979,-27.3649296453998,-34.0737840013048,1.15906281266627,-40.7076770221979,-27.3649296453998,-34.0737840013048,1.15906281266627,42.6855015448917,40.6520597555961,-0.763135394031943,0.29983285072357,-80.3863229778022,-58.8350703546005,0,0.447213595499958,0.447213595500282,1 +55.4193260675848,14.1391898657921,-0.763135394031943,0.00375685146552375,-67.0887678037771,-52.4892842870751,1.50208773569434,124.665631460043,56.3327678037777,92.2892842870752,NA,2.61803398874989,2.61803398875051,48.6180339887499,-32.2732026206867,4.54863019974739,1.50208773569434,127.283665448752,1.97782452269378,13.2871301101963,-34.8369193953367,1.00503190257906,1.97782452269378,13.2871301101963,-34.8369193953367,1.00503190257906,55.4193260675848,14.1391898657921,-0.763135394031943,0.299832850723513,-12.7338245226932,26.5128698898039,0,0.447213595499958,0.447213595500005,1 +5.97347665786362,-8.43449015821947,-0.763135394031943,0.00375685146552388,-32.2732026206867,4.54863019974739,1.50208773569434,127.283665448752,139.116202620687,45.4513698002526,NA,2.61803398874989,2.61803398874999,49.6180339887499,53.7053389847148,32.6391215715446,1.50208773569434,129.901699437496,57.3971505902786,27.4263199759884,-35.6000547893687,0.843487289561435,57.3971505902786,27.4263199759884,-35.6000547893687,0.843487289561435,5.97347665786362,-8.43449015821947,-0.763135394031943,0.299832850723505,49.4458494097212,22.5736800240116,0,0.447213595499958,0.447213595499965,1 +-52.9128960939938,-10.2426603404507,-0.763135394031943,0.0037568514655239,53.7053389847148,32.6391215715446,1.50208773569434,129.901699437496,68.5516610152848,-11.8391215715444,NA,2.61803398874989,2.61803398874991,50.6180339887499,96.0725954774219,25.3221420433881,1.50208773569434,132.519733426245,63.3706272481422,18.9918298177689,-36.3631901834006,0.674428973612848,63.3706272481422,18.9918298177689,-36.3631901834006,0.674428973612848,-52.9128960939938,-10.2426603404507,-0.763135394031943,0.299832850723503,58.8863727518574,1.80817018223125,0,0.447213595499958,0.447213595499959,1 +5.46683506015432,-1.49349086313249,-0.763135394031943,0.0037568514655239,96.0725954774219,25.3221420433881,1.50208773569434,132.519733426245,-143.994595477422,-25.3221420433881,NA,2.61803398874989,2.6180339887499,51.6180339887499,7.07904127608354,9.67219759262152,1.50208773569434,135.137767414995,10.4577311541485,8.74916947731822,-37.1263255774326,0.497856954733224,10.4577311541485,8.74916947731822,-37.1263255774326,0.497856954733224,5.46683506015432,-1.49349086313249,-0.763135394031943,0.299832850723503,-58.3797311541481,-8.74916947731822,0,0.447213595499958,0.447213595499958,1 +-50.997598725543,-9.73781224894675,-0.763135394031943,0.0037568514655239,7.07904127608354,9.67219759262152,1.50208773569434,135.137767414995,65.3099587239166,5.82780240737848,NA,2.61803398874989,2.61803398874989,52.6180339887499,47.4428155713167,13.2739775600999,1.50208773569434,137.755801403744,15.9245662143028,7.25567861418573,-37.8894609714645,0.313771232922553,15.9245662143028,7.25567861418573,-37.8894609714645,0.313771232922553,-50.997598725543,-9.73781224894675,-0.763135394031943,0.299832850723503,56.4644337856973,8.24432138581427,0,0.447213595499958,0.447213595499958,1 +-10.9486312367829,16.7800541162922,-8.22673175952849,0.0769413194919331,47.4428155713167,13.2739775600999,1.50208773569434,137.755801403744,-122.564815571317,-42.2739775600999,-32.6910877356943,2.61803398874989,2.61803398874989,53.6180339887499,-28.3064062766196,-12.8527774116922,-30.579296784426,5.18724048805286,-35.0730325112402,-2.48213363476102,-38.6525963654965,0.122171808180833,-35.0730325112402,-2.48213363476102,-38.6525963654965,0.122171808180833,-10.9486312367829,16.7800541162922,-8.22673175952849,0.188016933373469,-40.0489674887601,-26.517866365239,7.46359636549654,0.447213595499958,0.447213595499958,0.610859040904168 +40.7587050151943,6.47797459782351,25.4329401154466,0.0876187894780489,-28.3064062766196,-12.8527774116922,-30.579296784426,5.18724048805286,-69.4225937233807,37.4527774116921,-49.959703215574,2.61803398874989,2.61803398874989,2.9813495586166,-71.211928784844,10.2943120018178,-63.7815878840064,4.35793076571819,-46.0216637480231,14.2979204815312,-46.8793281250249,0.0942178288433253,-46.0216637480231,14.2979204815312,-46.8793281250249,0.0942178288433253,40.7587050151943,6.47797459782351,25.4329401154466,0.171703210890112,-51.7073362519772,10.3020795184687,-33.659671874975,0.447213595499958,0.447213595499958,0.471089144216627 +3.75474628236551,13.4538696771785,4.60055210586819,0.0891766113544512,-71.211928784844,10.2943120018178,-63.7815878840064,4.35793076571819,102.952928784844,3.50568799818189,63.1675878840064,2.61803398874989,2.61803398874989,2.66458143188549,-7.583519554463,12.4609463386468,-24.3203829718682,4.25353692874991,-5.26295873282881,20.7758950793547,-21.4463880095784,0.090139398222486,-5.26295873282881,20.7758950793547,-21.4463880095784,0.090139398222486,3.75474628236551,13.4538696771785,4.60055210586819,0.169323070856642,37.0039587328288,-6.97589507935497,20.8323880095784,0.447213595499958,0.447213595499958,0.45069699111243 +24.950533831902,18.1836344337117,-4.17028379784207,0.0894038945031515,-7.583519554463,12.4609463386468,-24.3203829718682,4.25353692874991,-15.1204804455367,17.0390536613532,16.2453829718683,2.61803398874989,2.61803398874989,2.62470653437963,-16.9284903960328,22.9916606374964,-14.2644092764576,4.23861018385404,-1.50821245046328,34.2297647565332,-16.8458359037102,0.0895443632141184,-1.50821245046328,34.2297647565332,-16.8458359037102,0.0895443632141184,24.950533831902,18.1836344337117,-4.17028379784207,0.168975813105708,-21.1957875495364,-4.72976475653318,8.77083590371026,0.447213595499958,0.447213595499958,0.447721816070592 +43.7618552133403,-0.102966376043776,35.7085965006058,0.0894370546676515,-16.9284903960328,22.9916606374964,-14.2644092764576,4.23861018385404,21.5594903960332,47.7083393625038,-46.6305907235425,2.61803398874989,2.61803398874989,2.6190050251708,-3.60399255115743,52.4770359103383,-43.0903030729671,4.2364387428903,23.4423213814387,52.4133991902448,-21.0161197015523,0.089457548776385,23.4423213814387,52.4133991902448,-21.0161197015523,0.089457548776385,43.7618552133403,-0.102966376043776,35.7085965006058,0.168925148882642,-18.8113213814384,18.2866008097554,-39.8788802984478,0.447213595499958,0.447213595499958,0.447287743881925 +37.9470318081191,13.5074664381575,28.2210732996592,0.0894418926704508,-3.60399255115743,52.4770359103383,-43.0903030729671,4.2364387428903,76.6229925511577,-13.7770359103385,65.2703030729672,2.61803398874989,2.61803398874989,2.61817560852722,43.751621165188,43.9623594535213,-2.74968877274165,4.23612206851525,67.204176594779,52.3104328142011,14.6924767990535,0.0894448827206186,67.204176594779,52.3104328142011,14.6924767990535,0.0894448827206186,37.9470318081191,13.5074664381575,28.2210732996592,0.168917757072116,5.81482340522125,-13.6104328142012,7.48752320094655,0.447213595499958,0.447213595499958,0.447224413603093 +9.49924021101785,0.225365690516086,8.872623398372,0.0894425985255465,43.751621165188,43.9623594535213,-2.74968877274165,4.23612206851525,89.8473788348112,35.1376405464786,65.0116887727416,2.61803398874989,2.61803398874989,2.61805464967932,99.2803550851893,65.6786155957215,37.4299405238141,4.23607586921031,105.151208402898,65.8178992523585,42.9135500987127,0.0894430347679868,105.151208402898,65.8178992523585,42.9135500987127,0.0894430347679868,9.49924021101785,0.225365690516086,8.872623398372,0.168916678621494,28.4477915971012,13.2821007476414,19.3484499012872,0.447213595499958,0.447213595499958,0.447215173839934 +4.30068882493358,-5.63136936660985,13.0937968954567,0.0894427015084171,99.2803550851893,65.6786155957215,37.4299405238141,4.23607586921031,20.5686449148109,6.22138440427905,10.1350594761859,2.61803398874989,2.61803398874989,2.61803700311508,111.99247674507,69.5236426146445,43.6937562153909,4.23606912888351,114.650448613916,66.0432649428746,51.7861734970847,0.0894427651553315,114.650448613916,66.0432649428746,51.7861734970847,0.0894427651553315,4.30068882493358,-5.63136936660985,13.0937968954567,0.168916521277669,5.19855138608427,5.85673505712593,-4.22117349708467,0.447213595499958,0.447213595499958,0.447213825776657 +-4.8541737362167,-10.8194737903445,-1.51623271200194,0.0894427165334155,111.99247674507,69.5236426146445,43.6937562153909,4.23606912888351,16.1135232549297,-3.92364261464502,35.7962437846091,2.61803398874989,2.61803398874989,2.61803442853934,121.951181795128,67.0986981190864,65.8170538407012,4.23606814548438,118.951137438849,60.4118955762648,64.8799703925414,0.0894427258193751,118.951137438849,60.4118955762648,64.8799703925414,0.0894427258193751,-4.8541737362167,-10.8194737903445,-1.51623271200194,0.168916498321514,9.15486256115029,5.18810442373468,14.6100296074586,0.447213595499958,0.447213595499958,0.447213629096876 +-13.4472100335844,2.77294799557572,-25.4884950314625,0.0894427187255332,121.951181795128,67.0986981190864,65.8170538407012,4.23606814548438,0.738818204872047,-31.0986981190864,21.5189461592988,2.61803398874989,2.61803398874989,2.6180340529143,122.407796557247,47.8786456756186,79.1164941706756,4.23606800200841,114.096963702633,49.5924217859203,63.3637376805395,0.0894427200803364,114.096963702633,49.5924217859203,63.3637376805395,0.0894427200803364,-13.4472100335844,2.77294799557572,-25.4884950314625,0.168916494972256,8.59303629736774,-13.5924217859202,23.9722623194606,0.447213595499958,0.447213595499958,0.447213600401682 +-24.127456364536,-5.56168222292813,-18.6912523823855,0.0894427190453587,122.407796557247,47.8786456756186,79.1164941706756,4.23606800200841,-11.0777965572466,12.8213543243813,-48.0384941706757,2.61803398874989,2.61803398874989,2.61803399811135,115.561341764412,55.8026784298916,49.4270719392225,4.23606798107555,100.649753669048,52.365369781496,37.8752426490769,0.089442719243022,100.649753669048,52.365369781496,37.8752426490769,0.089442719243022,-24.127456364536,-5.56168222292813,-18.6912523823855,0.168916494483606,10.6802463309516,8.33463021850385,-6.79724264907696,0.447213595499958,0.447213595499958,0.44721359621511 +-11.3541590600235,8.14200533563934,-21.6552621156942,0.0894427190920199,115.561341764412,55.8026784298916,49.4270719392225,4.23606798107555,-51.8123417644118,-22.7026784298913,-27.2790719392225,2.61803398874989,2.61803398874989,2.61803399011571,83.5395535172794,41.7716515245597,32.5676782937936,4.23606797802149,76.5222973045123,46.8036875585678,19.1839902666914,0.0894427191208598,76.5222973045123,46.8036875585678,19.1839902666914,0.0894427191208598,-11.3541590600235,8.14200533563934,-21.6552621156942,0.168916494412314,-12.7732973045125,-13.7036875585675,2.96400973330863,0.447213595499959,0.447213595499958,0.447213595604298 +-0.107020815535067,5.98769822984614,-8.13053396469699,0.0894427190988224,83.5395535172794,41.7716515245597,32.5676782937936,4.23606797802149,-29.6185535172791,15.3283484754406,-48.5636782937936,2.61803398874989,2.61803398874989,2.61803398894916,65.2342807459932,51.2450918737847,2.55367448810176,4.2360679775759,65.1681382444887,54.9456928942072,-2.47127184900279,0.0894427191030386,65.1681382444887,54.9456928942072,-2.47127184900279,0.0894427191030386,-0.107020815535067,5.98769822984614,-8.13053396469699,0.168916494401921,-11.2471382444885,2.15430710579319,-13.5247281509972,0.447213595499964,0.447213595499958,0.447213595515187 +1.94309661341911,-7.57891064610054,12.8856602216033,0.089442719099779,65.2342807459932,51.2450918737847,2.55367448810176,4.2360679775759,-2.22328074599365,23.2549081262153,-34.1716744881018,2.61803398874989,2.61803398874989,2.61803398877897,63.8602176784359,65.6174155010419,-18.5655817981878,4.23606797751089,65.0611174289537,60.9333911240533,-10.6018058136998,0.0894427191004522,65.0611174289537,60.9333911240533,-10.6018058136998,0.0894427191004522,1.94309661341911,-7.57891064610054,12.8856602216033,0.168916494400459,-2.05011742895418,13.5666088759467,-21.0161941863003,0.447213595499999,0.447213595499958,0.44721359550222 +11.8783106557915,5.17556983185277,-0.838485370493283,0.0894427190996725,63.8602176784359,65.6174155010419,-18.5655817981878,4.23606797751089,-6.79121767843545,-25.0174155010424,34.5735817981878,2.61803398874989,2.61803398874989,2.61803398875414,59.6630143281636,50.1558024107192,2.8020668659384,4.23606797750141,67.0042140423728,53.3544804779528,2.28385440790348,0.0894427191001688,67.0042140423728,53.3544804779528,2.28385440790348,0.0894427191001688,11.8783106557915,5.17556983185277,-0.838485370493283,0.168916494400622,-9.93521404237238,-12.7544804779533,13.7241455920966,0.447213595500239,0.447213595499958,0.447213595500563 +-15.4181646460443,-21.8943798583421,11.030883666917,0.0894427190979703,59.6630143281636,50.1558024107192,2.8020668659384,4.23606797750141,46.5159856718365,35.4441975892812,-13.2260668659385,2.61803398874989,2.61803398874989,2.61803398875051,88.4114744935617,72.061521224862,-5.37209199469158,4.23606797750003,78.8825246981643,58.5300503098055,1.4453690374102,0.0894427191007717,78.8825246981643,58.5300503098055,1.4453690374102,0.0894427191007717,-15.4181646460443,-21.8943798583421,11.030883666917,0.168916494403223,27.2964753018358,27.0699496901948,-11.8693690374103,0.447213595501885,0.447213595499958,0.447213595501932 +-4.34880459392384,4.64129059312198,-12.9678636287558,0.0894427190861617,88.4114744935617,72.061521224862,-5.37209199469158,4.23606797750003,-36.0164744935621,-61.9615212248626,41.8470919946916,2.61803398874989,2.61803398874989,2.61803398874999,66.1520691015966,33.767195113249,20.490833188372,4.23606797749982,63.46436005212,36.6356704514635,12.4762527043272,0.0894427191052753,63.46436005212,36.6356704514635,12.4762527043272,0.0894427191052753,-4.34880459392384,4.64129059312198,-12.9678636287558,0.168916494421265,-11.0693600521205,-26.535670451464,23.9987472956728,0.447213595513164,0.447213595499958,0.447213595513171 +-12.0722491357276,7.51825163770692,-11.4674745531844,0.0894427190052037,66.1520691015966,33.767195113249,20.490833188372,4.23606797749982,0.686930898403332,4.63280488675159,-22.482833188372,2.61803398874989,2.61803398874989,2.61803398874991,66.5766157447324,36.630425996508,6.59567811456392,4.23606797749979,59.1155554581961,41.2769610445855,-0.491610924428599,0.0894427191361975,59.1155554581961,41.2769610445855,-0.491610924428599,0.0894427191361975,-12.0722491357276,7.51825163770692,-11.4674745531844,0.168916494544958,7.72344454180379,-2.87696104458493,-1.50038907557136,0.447213595590472,0.447213595499958,0.447213595590473 +6.75905718674044,6.91346431999968,-1.95656003079747,0.0894427184503062,66.5766157447324,36.630425996508,6.59567811456392,4.23606797749979,-38.3646157447319,12.7695740034916,-28.065678114564,2.61803398874989,2.61803398874989,2.6180339887499,42.8659792491587,44.5224567525229,-10.7498648775507,4.23606797749979,47.0433063224685,48.7952126822924,-11.959085477613,0.0894427193481493,47.0433063224685,48.7952126822924,-11.959085477613,0.0894427193481493,6.75905718674044,6.91346431999968,-1.95656003079747,0.168916495392766,-18.8313063224681,0.60478731770724,-9.51091452238698,0.447213596120352,0.447213595499958,0.447213596120352 +-7.41957930405038,-19.3778586777083,13.7847944607919,0.089442714646982,42.8659792491587,44.5224567525229,-10.7498648775507,4.23606797749979,25.1150207508411,37.4775432474771,-18.9071351224493,2.61803398874989,2.61803398874989,2.61803398874989,58.3879157013374,67.6848522943079,-22.4351170131112,4.23606797749979,53.802363509209,55.7086770022921,-13.9156455084105,0.08944272080089,53.802363509209,55.7086770022921,-13.9156455084105,0.08944272080089,-7.41957930405038,-19.3778586777083,13.7847944607919,0.168916501203728,14.1786364907908,26.2913229977079,-15.7413544915894,0.447213599752204,0.447213595499958,0.447213599752204 +4.55420490110763,-11.7470403531243,12.2329434131734,0.089442688578612,58.3879157013374,67.6848522943079,-22.4351170131112,4.23606797749979,-23.9789157013368,-38.984852294308,23.8561170131112,2.61803398874989,2.61803398874989,2.61803398874989,43.5681307845427,43.5908885300312,-7.6912258594139,4.23606797749979,46.3827842051586,36.3308183245838,-0.13085104761857,0.0894427307581225,46.3827842051586,36.3308183245838,-0.13085104761857,0.0894427307581225,4.55420490110763,-11.7470403531243,12.2329434131734,0.16891654103266,-11.973784205158,-7.63081832458399,1.55185104761851,0.447213624645284,0.447213595499958,0.447213624645284 +15.831194007374,20.1367376183346,-3.70496422127166,0.0894425099034481,43.5681307845427,43.5908885300312,-7.6912258594139,4.23606797749979,-3.90813078454285,-50.8908885300304,35.7312258594139,2.61803398874989,2.61803398874989,2.61803398874989,41.1527731272154,12.1385897007902,14.391886181403,4.23606797749979,50.9369891062662,24.5837779714596,12.1020923655549,0.0894427990060254,50.9369891062662,24.5837779714596,12.1020923655549,0.0894427990060254,15.831194007374,20.1367376183346,-3.70496422127166,0.16891681402435,-11.2769891062664,-31.8837779714588,15.9379076344451,0.447213795264998,0.447213595499958,0.447213795264998 +6.10837712101421,0.657253208128863,3.36816392301147,0.0894412852504598,41.1527731272154,12.1385897007902,14.391886181403,4.23606797749979,35.3382268727846,52.0614102992096,-13.067886181403,2.61803398874989,2.61803398874989,2.61803398874989,62.9929984367512,44.3143107679556,6.31548836018093,4.23606797749979,66.7681831136402,44.7205155897941,8.39712814428321,0.0894432667848113,66.7681831136402,44.7205155897941,8.39712814428321,0.0894432667848113,6.10837712101421,0.657253208128863,3.36816392301147,0.168918685143163,9.72281688635979,19.4794844102057,-7.07312814428314,0.447214964709911,0.447213595499958,0.447214964709911 +15.9369373556688,-8.06497799394761,14.1784559903062,0.0894328915796739,62.9929984367512,44.3143107679556,6.31548836018093,4.23606797749979,0.055001563248581,9.78568923204388,-5.360488360181,2.61803398874989,2.61803398874989,2.61803398874989,63.0269912722732,50.3621993167026,3.00252435729088,4.23606797749979,72.8765602346544,45.377768797923,11.7652920672947,0.0894464730212324,72.8765602346544,45.377768797923,11.7652920672947,0.0894464730212324,15.9369373556688,-8.06497799394761,14.1784559903062,0.168931510261243,-9.82856023465463,8.72223120207647,-10.8102920672948,0.447222980204592,0.447213595499958,0.447222980204592 +-20.7135650540078,17.4478128100276,-33.8027959520929,0.0893753711058825,63.0269912722732,50.3621993167026,3.00252435729088,4.23606797749979,62.4370087277267,-38.5621993167024,70.9224756427092,2.61803398874989,2.61803398874989,2.61803398874989,101.615184821882,26.5294494580325,46.8350248707717,4.23606797749979,88.8134975903233,37.3127908039754,25.9437480576009,0.0894684504393495,88.8134975903233,37.3127908039754,25.9437480576009,0.0894684504393495,-20.7135650540078,17.4478128100276,-33.8027959520929,0.169019428032649,36.6505024096767,-25.5127908039752,47.9812519423991,0.447277919222441,0.447213595499958,0.447277919222441 +8.80836748230714,-9.99158357596927,15.920156153415,0.0889816179650814,101.615184821882,26.5294494580325,46.8350248707717,4.23606797749979,-63.0371848218817,55.6705505419673,-104.417024870772,2.61803398874989,2.61803398874989,2.61803398874989,62.6560620468503,60.9357418653872,-17.6982455035083,4.23606797749979,68.0999325363154,54.760603614003,-7.85904789449202,0.0896191585688449,68.0999325363154,54.760603614003,-7.85904789449202,0.0896191585688449,8.80836748230714,-9.99158357596927,15.920156153415,0.169622641028282,-29.521932536315,27.4393963859969,-49.722952105508,0.447654476852706,0.447213595499958,0.447654476852706 +-10.5643324990703,-1.62256353793613,0.52126441233816,0.0863061916173292,62.6560620468503,60.9357418653872,-17.6982455035083,4.23606797749979,33.6249379531497,-24.5357418653866,41.1582455035082,2.61803398874989,2.61803398874989,2.61803398874989,83.4374165715031,45.7718194533845,7.73894913497231,4.23606797749979,76.9083000186225,44.7690200380337,8.06110825892303,0.0906555411527689,76.9083000186225,44.7690200380337,8.06110825892303,0.0906555411527689,-10.5643324990703,-1.62256353793613,0.52126441233816,0.173786045714678,19.3726999813774,-8.36902003803314,15.3988917410769,0.450235441246711,0.447213595499958,0.450235441246711 +16.578635020482,1.72389296216124,2.75763708359935,0.069067746529926,83.4374165715031,45.7718194533845,7.73894913497231,4.23606797749979,-44.2364165715031,-5.97181945338431,-1.39294913497231,2.61803398874989,2.61803398874989,2.61803398874989,56.0978075898151,42.0810320565152,6.87805922495966,4.23606797749979,66.3439675195523,43.1464565000976,8.58237267126119,0.0979193841636164,66.3439675195523,43.1464565000976,8.58237267126119,0.0979193841636164,16.578635020482,1.72389296216124,2.75763708359935,0.203681131763313,-27.1429675195523,-3.34645650009737,-2.23637267126119,0.467925634374483,0.447213595499958,0.467925634374483 +-2.40776243948335,-13.2057575755792,0.930646838459861,0.00255268378663754,56.0978075898151,42.0810320565152,6.87805922495966,4.23606797749979,45.8111924101845,17.7189679434841,6.28894077504037,2.61803398874989,2.61803398874989,2.61803398874989,84.4106815644704,53.0319564911582,10.7648383771697,4.23606797749979,82.9226025400343,44.8703494622588,11.3400097548605,0.155240533045174,82.9226025400343,44.8703494622588,11.3400097548605,0.155240533045174,-2.40776243948335,-13.2057575755792,0.930646838459861,0.472414411185376,18.9863974599654,14.9296505377405,1.82699024513949,0.589176021874882,0.447213595499958,0.589176021874882 +-2.40776243948335,-0.441165688900204,0.930646838459861,0.00255268378663754,84.4106815644704,53.0319564911582,10.7648383771697,4.23606797749979,NA,-34.1319564911576,NA,2.61803398874989,2.61803398874989,2.61803398874989,84.4106815644704,31.9372472770902,10.7648383771697,11.0901699437495,80.514840100551,31.6645918866796,12.2706565933204,0.902064487461155,80.514840100551,31.6645918866796,12.2706565933204,0.902064487461155,-2.40776243948335,-0.441165688900204,0.930646838459861,0.472414411185376,0,-12.764591886679,0,1,0.447213595499958,1 +-2.40776243948335,7.68226050887971,0.930646838459861,0.00255268378663754,84.4106815644704,31.9372472770902,10.7648383771697,11.0901699437495,NA,-8.8372472770907,NA,3.61803398874989,2.61803398874989,3.61803398874989,84.4106815644704,26.4755280928606,10.7648383771697,21.1803398874989,78.1070776610676,31.2234261977794,13.2013034317803,1.97258534994171,78.1070776610676,31.2234261977794,13.2013034317803,1.97258534994171,-2.40776243948335,7.68226050887971,0.930646838459861,0.472414411185376,0,-8.12342619777991,0,1,0.447213595499958,1 +-2.40776243948335,-7.11205278446195,0.930646838459861,0.00255268378663754,84.4106815644704,26.4755280928606,10.7648383771697,21.1803398874989,NA,27.2244719071401,NA,4.61803398874989,2.61803398874989,4.61803398874989,84.4106815644704,43.3011770572399,10.7648383771697,34.5065778087482,75.6993152215843,38.9056867066591,14.1319502702401,3.09111327153,75.6993152215843,38.9056867066591,14.1319502702401,3.09111327153,-2.40776243948335,-7.11205278446195,0.930646838459861,0.472414411185376,0,14.7943132933417,0,1,0.447213595499958,1 +-2.40776243948335,-0.918418862264285,0.930646838459861,0.00255268378663754,84.4106815644704,43.3011770572399,10.7648383771697,34.5065778087482,NA,-17.7011770572404,NA,5.61803398874989,2.61803398874989,5.61803398874989,84.4106815644704,32.3612479949855,10.7648383771697,51.0688837074973,73.2915527821009,31.7936339221971,15.0625971087,4.04322281414845,73.2915527821009,31.7936339221971,15.0625971087,4.04322281414845,-2.40776243948335,-0.918418862264285,0.930646838459861,0.472414411185376,0,-6.19363392219767,0,1,0.447213595499958,1 +-2.40776243948335,-11.6432038023318,0.930646838459861,0.00255268378663754,84.4106815644704,32.3612479949855,10.7648383771697,51.0688837074973,NA,9.23875200501491,NA,6.61803398874989,2.61803398874989,6.61803398874989,84.4106815644704,38.0711107477159,10.7648383771697,70.8672575837461,70.8837903426176,30.8752150599328,15.9932439471598,4.67575295059883,70.8837903426176,30.8752150599328,15.9932439471598,4.67575295059883,-2.40776243948335,-11.6432038023318,0.930646838459861,0.472414411185376,0,10.7247849400675,0,1,0.447213595499958,1 +-2.40776243948335,-9.91119254473081,0.930646838459861,0.00255268378663754,84.4106815644704,38.0711107477159,10.7648383771697,70.8672575837461,NA,-20.5711107477159,NA,7.61803398874989,2.61803398874989,7.61803398874989,84.4106815644704,25.3574651192892,10.7648383771697,93.9016994374948,68.4760279031342,19.232011257601,16.9238907856197,4.89680706456217,68.4760279031342,19.232011257601,16.9238907856197,4.89680706456217,-2.40776243948335,-9.91119254473081,0.930646838459861,0.472414411185376,0,-1.73201125760101,0,1,0.447213595499958,1 +-2.40776243948335,-20.7903738318604,0.930646838459861,0.00255268378663754,84.4106815644704,25.3574651192892,10.7648383771697,93.9016994374948,NA,-5.1574651192894,NA,8.61803398874989,2.61803398874989,8.61803398874989,84.4106815644704,22.1699763797763,10.7648383771697,120.172209268743,66.0682654636509,9.32081871287021,17.8545376240796,4.67575295059883,66.0682654636509,9.32081871287021,17.8545376240796,4.67575295059883,-2.40776243948335,-20.7903738318604,0.930646838459861,0.472414411185376,0,10.8791812871296,0,1,0.447213595499958,1 +-2.40776243948335,9.24007104914937,0.930646838459861,0.00255268378663754,84.4106815644704,22.1699763797763,10.7648383771697,120.172209268743,NA,-63.6699763797763,NA,9.61803398874989,2.61803398874989,9.61803398874989,84.4106815644704,-17.1802330858284,10.7648383771697,149.678787077491,63.6605030241675,-11.4695551189902,18.7851844625394,4.04322281414845,63.6605030241675,-11.4695551189902,18.7851844625394,4.04322281414845,-2.40776243948335,9.24007104914937,0.930646838459861,0.472414411185376,0,-30.0304448810098,0,1,0.447213595499958,1 +-2.40776243948335,22.1105869793089,0.930646838459861,0.00255268378663754,84.4106815644704,-17.1802330858284,10.7648383771697,149.678787077491,NA,2.08023308582806,NA,10.6180339887499,2.61803398874989,10.6180339887499,84.4106815644704,-15.8945783342646,10.7648383771697,182.421432863739,61.2527405846842,-2.22948406984085,19.7158313009993,3.09111327153,61.2527405846842,-2.22948406984085,19.7158313009993,3.09111327153,-2.40776243948335,22.1105869793089,0.930646838459861,0.472414411185376,0,-12.8705159301595,0,1,0.447213595499958,1 +-2.40776243948335,1.69168988877674,0.930646838459861,0.00255268378663754,84.4106815644704,-15.8945783342646,10.7648383771697,182.421432863739,NA,56.1945783342648,NA,11.6180339887499,2.61803398874989,11.6180339887499,84.4106815644704,18.8355810597795,10.7648383771697,218.400146627487,58.8449781452008,19.881102909468,20.6464781394592,1.97258534994171,58.8449781452008,19.881102909468,20.6464781394592,1.97258534994171,-2.40776243948335,1.69168988877674,0.930646838459861,0.472414411185376,0,20.4188970905321,0,1,0.447213595499958,1 +-2.40776243948335,2.96448268702133,0.930646838459861,0.00255268378663754,84.4106815644704,18.8355810597795,10.7648383771697,218.400146627487,NA,1.4644189402207,NA,12.6180339887499,2.61803398874989,12.6180339887499,84.4106815644704,19.740641738605,10.7648383771697,257.614928368735,56.4372157057175,21.5727927982448,21.577124977919,0.902064487461154,56.4372157057175,21.5727927982448,21.577124977919,0.902064487461154,-2.40776243948335,2.96448268702133,0.930646838459861,0.472414411185376,0,-1.27279279824459,0,1,0.447213595499958,1 +20.1136908267501,29.9017581722871,-11.5485813451612,0.0690677465299261,84.4106815644704,19.740641738605,10.7648383771697,257.614928368735,-52.9026815644696,-22.1406417386046,24.2221616228303,13.6180339887499,2.61803398874989,13.6180339887499,35.3927517643283,6.05697261141276,33.2083172883222,6.00559868349362,54.0294532662341,24.5372754852661,22.5077718163789,0.155240533045174,54.0294532662341,24.5372754852661,22.5077718163789,0.155240533045174,20.1136908267501,29.9017581722871,-11.5485813451612,0.203681131763313,-22.5214532662335,-26.9372754852657,12.4792281836211,0.589176021874882,0.447213595499958,0.589176021874882 +5.68683491973465,-7.5592081701594,20.5056091260563,0.0863061916173293,35.3927517643283,6.05697261141276,33.2083172883222,6.00559868349362,53.1772482356714,85.8430273885869,-54.3033172883221,2.92656796121774,2.61803398874989,2.92656796121774,70.3994845906995,59.1108812347476,-2.53970997839846,4.44954212048734,74.1431440929843,54.4390336575532,10.9591904712176,0.0979193841636164,74.1431440929843,54.4390336575532,10.9591904712176,0.0979193841636164,5.68683491973465,-7.5592081701594,20.5056091260563,0.173786045714678,14.4268559070155,37.4609663424465,-32.0541904712176,0.467925634374483,0.447213595499958,0.467925634374483 +-1.16118606754633,7.12061731723455,-9.14559127666971,0.0889816179650814,70.3994845906995,59.1108812347476,-2.53970997839846,4.44954212048734,16.2785154093004,-26.9108812347478,63.6557099783984,2.65830282663796,2.61803398874989,2.65830282663796,80.5543502614604,42.4790419644617,37.1700035768213,4.26641880048683,79.8299790127189,46.8798254873938,31.464799597274,0.0906555411527689,79.8299790127189,46.8798254873938,31.464799597274,0.0906555411527689,-1.16118606754633,7.12061731723455,-9.14559127666971,0.169622641028282,6.84802098728098,-14.679825487394,29.651200402726,0.450235441246711,0.447213595499958,0.450235441246711 +-7.55939312237467,0.721060121862322,2.95061704393457,0.0893753711058825,80.5543502614604,42.4790419644617,37.1700035768213,4.26641880048683,4.51264973854055,17.9209580355388,-26.9470035768213,2.62382013441835,2.61803398874989,2.62382013441835,83.3471222997938,53.5548031413853,20.4931413192695,4.24047959984035,78.6687929451726,54.0004428046283,22.3192083206042,0.0896191585688449,78.6687929451726,54.0004428046283,22.3192083206042,0.0896191585688449,-7.55939312237467,0.721060121862322,2.95061704393457,0.169019428032649,6.39820705482834,6.39955719537223,-12.0962083206043,0.447654476852706,0.447213595499958,0.447654476852706 +-24.1049932995756,-12.057436951647,-3.40255759152666,0.0894328915796739,83.3471222997938,53.5548031413853,20.4931413192695,4.24047959984035,4.30787770020504,13.9451968586147,11.1298586807305,2.61887631439276,2.61803398874989,2.61887631439276,86.0100663784567,62.1734087798174,27.3731396230272,4.23671127448659,71.1093998227979,54.7215029264906,25.2698253645388,0.0894684504393496,71.1093998227979,54.7215029264906,25.2698253645388,0.0894684504393496,-24.1049932995756,-12.057436951647,-3.40255759152666,0.168931510261243,16.5456001772009,12.7784970735094,6.35317463546123,0.447277919222441,0.447213595499958,0.447277919222441 +7.43041322364576,8.00662902319712,-5.7562898185145,0.0894412852504598,86.0100663784567,62.1734087798174,27.3731396230272,4.23671127448659,-70.5410663784557,-39.573408779818,-3.15213962302719,2.61815684287791,2.61803398874989,2.61815684287791,42.4120254227698,37.7156971031964,25.4249537018578,4.23616182581815,47.0044065232223,42.6640659748436,21.8672677730122,0.0894464730212324,47.0044065232223,42.6640659748436,21.8672677730122,0.0894464730212324,7.43041322364576,8.00662902319712,-5.7562898185145,0.168918685143163,-31.5354065232214,-20.0640659748442,2.35373222698784,0.447222980204592,0.447213595499958,0.447222980204592 +7.91523297051493,4.77732402123731,2.07068813598328,0.0894425099034481,42.4120254227698,37.7156971031964,25.4249537018578,4.23616182581815,11.5379745772291,16.1843028968041,-17.1409537018579,2.61805191208454,2.61803398874989,2.61805191208454,49.5429160441875,47.7181463776448,14.8312168915893,4.2360816696264,54.4348197468681,50.6706949980407,16.1109779544977,0.0894432667848113,54.4348197468681,50.6706949980407,16.1109779544977,0.0894432667848113,7.91523297051493,4.77732402123731,2.07068813598328,0.16891681402435,-0.484819746869168,3.22930500195981,-7.82697795449778,0.447214964709911,0.447213595499958,0.447214964709911 +25.5922856878973,-1.3746569594841,21.0013542264642,0.089442688578612,49.5429160441875,47.7181463776448,14.8312168915893,4.2360816696264,-4.86991604418684,13.8818536223547,-15.5802168915893,2.61803660371128,2.61803398874989,2.61803660371128,46.5331405485642,56.2976037431108,5.20210735636892,4.23606997515077,62.350052717383,55.448019019278,18.1816660904809,0.0894427990060254,62.350052717383,55.448019019278,18.1816660904809,0.0894427990060254,25.5922856878973,-1.3746569594841,21.0013542264642,0.16891654103266,-17.6770527173823,6.15198098072141,-18.930666090481,0.447213795264998,0.447213595499958,0.447213795264998 +0.873624093177445,1.69870510030983,4.11537454340922,0.089442714646982,46.5331405485642,56.2976037431108,5.20210735636892,4.23606997515077,66.1278594514359,-5.29760374311081,50.8668926436313,2.61803437026724,2.61803398874989,2.61803437026724,87.4024089736776,53.0235045709397,36.6395787436097,4.23606826895307,87.9423384052803,54.0733620597939,39.1830203169452,0.0894427307581226,87.9423384052803,54.0733620597939,39.1830203169452,0.0894427307581226,0.873624093177445,1.69870510030983,4.11537454340922,0.168916501203728,24.7186615947198,-3.07336205979394,16.885979683055,0.447213624645284,0.447213595499958,0.447213624645284 +5.53958659163551,-6.92922773958694,-0.848230596236336,0.0894427184503062,87.4024089736776,53.0235045709397,36.6395787436097,4.23606826895307,-3.25240897367794,11.3764954290609,11.6224212563903,2.61803404441252,2.61803398874989,2.61803404441252,85.3923096562164,60.0545654189571,43.8226302060146,4.23606802002225,88.8159624984577,55.7720671601038,43.2983948603544,0.0894427208008899,88.8159624984577,55.7720671601038,43.2983948603544,0.0894427208008899,5.53958659163551,-6.92922773958694,-0.848230596236336,0.168916495392765,-4.66596249845806,8.62793283989677,4.96360513964555,0.447213599752204,0.447213595499958,0.447213599752204 +-19.4888643182713,-1.48638831906973,-26.4080663321183,0.0894427190052038,85.3923096562164,60.0545654189571,43.8226302060146,4.23606802002225,33.9916903437836,-16.6545654189575,24.1873697939854,2.61803399687096,2.61803398874989,2.61803399687096,106.400329664011,49.7614779221828,58.7712468658185,4.23606798370373,94.3555490900932,48.8428394205168,42.4501642641181,0.0894427193481493,94.3555490900932,48.8428394205168,42.4501642641181,0.0894427193481493,-19.4888643182713,-1.48638831906973,-26.4080663321183,0.168916494544957,25.0284509099068,-5.44283942051721,25.5598357358819,0.447213596120352,0.447213595499958,0.447213596120352 +-1.60817954645019,-1.32993721762243,11.8340315998816,0.0894427190861622,106.400329664011,49.7614779221828,58.7712468658185,4.23606798370373,-49.4143296640105,-2.56147792218295,-80.9712468658185,2.61803398993474,2.61803398874989,2.61803398993474,75.8605943918185,48.1783975048412,8.72826417728697,4.23606797840493,74.8666847718219,47.3564511014471,16.0420979319998,0.0894427191361973,74.8666847718219,47.3564511014471,16.0420979319998,0.0894427191361973,-1.60817954645019,-1.32993721762243,11.8340315998816,0.168916494421264,-17.8806847718211,-0.156451101447299,-38.2420979319998,0.447213595590472,0.447213595499958,0.447213595590472 +-27.2406743210781,-13.9034233337981,-16.8248388682372,0.0894427190979739,75.8605943918185,48.1783975048412,8.72826417728697,4.23606797840493,23.0304056081811,10.4216024951591,47.8067358227131,2.61803398892276,2.61803398874989,2.61803398892276,90.0941678329515,54.6193020640903,38.2744518081166,4.23606797763185,73.2585052253717,46.0265138838247,27.8761295318813,0.0894427191052739,73.2585052253717,46.0265138838247,27.8761295318813,0.0894427191052739,-27.2406743210781,-13.9034233337981,-16.8248388682372,0.168916494403217,25.6324947746279,12.5734861161757,28.6588704681187,0.447213595513164,0.447213595499958,0.447213595513164 +-3.30984341678402,11.2196672162285,-18.6735482045929,0.0894427190996972,90.0941678329515,54.6193020640903,38.2744518081166,4.23606797763185,-68.007167832952,-47.6193020640903,-25.3744518081167,2.61803398877512,2.61803398874989,2.61803398877512,48.0634266333184,25.1889548679345,22.5921781447109,4.23606797751906,46.0178309042936,32.1230905500266,11.0512906636442,0.0894427191007623,46.0178309042936,32.1230905500266,11.0512906636442,0.0894427191007623,-3.30984341678402,11.2196672162285,-18.6735482045929,0.168916494400584,-23.9308309042941,-25.1230905500266,1.8487093363557,0.447213595501885,0.447213595499958,0.447213595501885 +19.9971440707257,5.36242498248372,8.18419425445843,0.0894427190999487,48.0634266333184,25.1889548679345,22.5921781447109,4.23606797751906,-28.6624266333186,24.0110451320653,-57.0721781447109,2.61803398875357,2.61803398874989,2.61803398875357,30.3490727738619,40.0285968649586,-12.68036776074,4.2360679775026,42.7079874875096,43.3427577662551,-7.62225754094871,0.089442719100104,42.7079874875096,43.3427577662551,-7.62225754094871,0.089442719100104,19.9971440707257,5.36242498248372,8.18419425445843,0.1689164944002,-23.3069874875098,5.85724223374476,-26.8577424590513,0.447213595500239,0.447213595499958,0.447213595500239 +6.68627562896143,-0.0323922687778753,20.7551309679679,0.0894427190999853,30.3490727738619,40.0285968649586,-12.68036776074,4.2360679775026,45.6669272261377,14.0714031350418,0.671367760740232,2.61803398875043,2.61803398874989,2.61803398875043,58.5727859613866,48.7252022718162,-12.2654396656516,4.2360679775002,62.7051315582353,48.7051827487388,0.56193671350972,0.089442719100008,62.7051315582353,48.7051827487388,0.56193671350972,0.089442719100008,6.68627562896143,-0.0323922687778753,20.7551309679679,0.168916494400144,13.3108684417643,5.39481725126159,-12.5709367135095,0.447213595499999,0.447213595499958,0.447213595499999 +12.4866828161578,5.64039821118302,7.28119864944566,0.0894427190999906,58.5727859613866,48.7252022718162,-12.2654396656516,4.2360679775002,5.01821403861379,-5.72520227181622,47.0564396656515,2.61803398874997,2.61803398874989,2.61803398874997,61.6742128000718,45.1868326753657,16.8170394372803,4.23606797749985,69.3914071871968,48.6727904799609,21.3170676814777,0.089442719099994,69.3914071871968,48.6727904799609,21.3170676814777,0.089442719099994,12.4866828161578,5.64039821118302,7.28119864944566,0.168916494400136,-5.80040718719641,-5.6727904799609,13.4739323185223,0.447213595499964,0.447213595499958,0.447213595499964 +31.451772819512,3.65358690232767,19.1434649803691,0.0894427190999914,61.6742128000718,45.1868326753657,16.8170394372803,4.23606797749985,1.23878719992865,11.1131673246336,-0.0810394372804524,2.61803398874991,2.61803398874989,2.61803398874991,62.439825394456,52.055147804654,16.7669543106118,4.2360679774998,81.8780900033546,54.3131886911439,28.5982663309233,0.089442719099992,81.8780900033546,54.3131886911439,28.5982663309233,0.089442719099992,31.451772819512,3.65358690232767,19.1434649803691,0.168916494400135,-18.9650900033541,1.98681130885535,-11.8622663309234,0.447213595499959,0.447213595499958,0.447213595499959 +-15.0823643576211,-8.57963750420146,0.21819629166137,0.0894427190999916,62.439825394456,52.055147804654,16.7669543106118,4.2360679774998,97.4241746055435,18.1448521953468,49.9000456893883,2.6180339887499,2.61803398874989,2.6180339887499,122.651276626586,63.2692831822214,47.6068785868265,4.23606797749979,113.329862822867,57.9667755934716,47.7417313112924,0.0894427190999916,113.329862822867,57.9667755934716,47.7417313112924,0.0894427190999916,-15.0823643576211,-8.57963750420146,0.21819629166137,0.168916494400135,46.534137177133,12.2332244065291,18.9252686887077,0.447213595499958,0.447213595499958,0.447213595499958 +1.33813410762329,3.30750058506868,-20.0858761053847,0.0894427190999916,122.651276626586,63.2692831822214,47.6068785868265,4.23606797749979,-40.8242766265852,-25.7692831822214,20.6571214131734,2.61803398874989,2.61803398874989,2.61803398874989,97.4204861052288,47.3429903098875,60.3736817299009,4.23606797749979,98.2474984652455,49.3871380892701,47.9599276029538,0.0894427190999916,98.2474984652455,49.3871380892701,47.9599276029538,0.0894427190999916,1.33813410762329,3.30750058506868,-20.0858761053847,0.168916494400135,-16.4204984652444,-11.8871380892701,20.3040723970461,0.447213595499958,0.447213595499958,0.447213595499958 +-2.65523331950765,4.5021392594075,11.6541753921843,0.0894427190999916,97.4204861052288,47.3429903098875,60.3736817299009,4.23606797749979,6.15851389477095,4.15700969011247,-64.2396817299009,2.61803398874989,2.61803398874989,2.61803398874989,101.226657012386,49.9121635899397,20.6713749943465,4.23606797749979,99.5856325728688,52.6946386743388,27.8740514975691,0.0894427190999916,99.5856325728688,52.6946386743388,27.8740514975691,0.0894427190999916,-2.65523331950765,4.5021392594075,11.6541753921843,0.168916494400135,3.99336742713095,-1.19463867433881,-31.740051497569,0.447213595499958,0.447213595499958,0.447213595499958 +20.4981659338534,-2.40108280684565,18.0714022819376,0.0894427190999916,101.226657012386,49.9121635899397,20.6713749943465,4.23606797749979,-27.4496570123857,14.1878364100598,12.4396250056536,2.61803398874989,2.61803398874989,2.61803398874989,84.2618359992045,58.6807287181799,28.3594860551435,4.23606797749979,96.9303992533611,57.1967779337463,39.5282268897534,0.0894427190999916,96.9303992533611,57.1967779337463,39.5282268897534,0.0894427190999916,20.4981659338534,-2.40108280684565,18.0714022819376,0.168916494400135,-23.1533992533611,6.90322206625314,-6.41722688975326,0.447213595499958,0.447213595499958,0.447213595499958 +-5.38926887893093,26.394612320055,-17.0009685463715,0.0894427190999916,84.2618359992045,58.6807287181799,28.3594860551435,4.23606797749979,59.0541640007944,-32.6807287181799,64.3125139448565,2.61803398874989,2.61803398874989,2.61803398874989,120.759316528906,38.4829275932299,68.1068055750164,4.23606797749979,117.428565187215,54.7956951269007,57.5996291716909,0.0894427190999916,117.428565187215,54.7956951269007,57.5996291716909,0.0894427190999916,-5.38926887893093,26.394612320055,-17.0009685463715,0.168916494400135,25.8874348127844,-28.7956951269007,35.0723708283091,0.447213595499958,0.447213595499958,0.447213595499958 +-16.4709725706483,-2.21508023298949,-3.85230792105195,0.0894427190999916,120.759316528906,38.4829275932299,68.1068055750164,4.23606797749979,2.36168347109509,71.3170724067702,-40.6568055750166,2.61803398874989,2.61803398874989,2.61803398874989,122.218917184712,82.5593023187512,42.97951785566,4.23606797749979,112.039296308284,81.1903074469557,40.5986606253194,0.0894427190999916,112.039296308284,81.1903074469557,40.5986606253194,0.0894427190999916,-16.4709725706483,-2.21508023298949,-3.85230792105195,0.168916494400135,11.0817036917174,28.6096925530445,-13.1486606253196,0.447213595499958,0.447213595499958,0.447213595499958 +2.89535116698772,1.66014698097634,7.79704478321552,0.0894427190999916,122.218917184712,82.5593023187512,42.97951785566,4.23606797749979,-46.0169171847122,-7.45930231875086,-17.88251785566,2.61803398874989,2.61803398874989,2.61803398874989,93.7788983070702,77.9491999534023,31.9275140164352,4.23606797749979,95.5683237376353,78.9752272139662,36.7463527042675,0.0894427190999916,95.5683237376353,78.9752272139662,36.7463527042675,0.0894427190999916,2.89535116698772,1.66014698097634,7.79704478321552,0.168916494400135,-19.366323737636,-3.87522721396583,-11.6493527042675,0.447213595499958,0.447213595499958,0.447213595499958 +6.80802607161129,16.1955211759194,-23.8685577293016,0.0894427190999916,93.7788983070702,77.9491999534023,31.9275140164352,4.23606797749979,0.772101692929226,-11.8491999534028,44.2814859835649,2.61803398874989,2.61803398874989,2.61803398874989,94.2560833960718,70.6259916427057,59.2949774266303,4.23606797749979,98.463674904623,80.6353741949425,44.543397487483,0.0894427190999916,98.463674904623,80.6353741949425,44.543397487483,0.0894427190999916,6.80802607161129,16.1955211759194,-23.8685577293016,0.168916494400135,-3.91267490462357,-14.5353741949431,31.6656025125171,0.447213595499958,0.447213595499958,0.447213595499958 +21.2277270478449,-2.3735834532192,16.8222820288799,0.0894427190999916,94.2560833960718,70.6259916427057,59.2949774266303,4.23606797749979,-3.40408339607107,44.7740083572949,-79.3109774266304,2.61803398874989,2.61803398874989,2.61803398874989,92.1522441567607,98.2978506200857,10.2780976959971,4.23606797749979,105.271700976234,96.8308953708619,20.6748397581814,0.0894427190999916,105.271700976234,96.8308953708619,20.6748397581814,0.0894427190999916,21.2277270478449,-2.3735834532192,16.8222820288799,0.168916494400135,-14.4197009762336,18.5691046291386,-40.6908397581815,0.447213595499958,0.447213595499958,0.447213595499958 +13.2171550719238,1.58372846442354,6.96440381594128,0.0894427190999916,92.1522441567607,98.2978506200857,10.2780976959971,4.23606797749979,42.3577558432395,-7.79785062008574,37.0769023040029,2.61803398874989,2.61803398874989,2.61803398874989,118.330776955052,93.4785138976783,33.1928835174302,4.23606797749979,126.499428024079,94.4573119176427,37.4971217870614,0.0894427190999916,126.499428024079,94.4573119176427,37.4971217870614,0.0894427190999916,13.2171550719238,1.58372846442354,6.96440381594128,0.168916494400135,8.01057197592103,-3.95731191764274,9.85787821293866,0.447213595499958,0.447213595499958,0.447213595499958 +-25.8542618320736,-8.37523115351018,-3.24607058105612,0.0894427190999916,118.330776955052,93.4785138976783,33.1928835174302,4.23606797749979,60.4572230449483,12.5214861023217,21.4791164825699,2.61803398874989,2.61803398874989,2.61803398874989,155.695395662264,101.217217898573,46.4677075519764,4.23606797749979,139.716583096003,96.0410403820663,44.4615256030026,0.0894427190999916,139.716583096003,96.0410403820663,44.4615256030026,0.0894427190999916,-25.8542618320736,-8.37523115351018,-3.24607058105612,0.168916494400135,39.0714169039975,9.95895961793372,10.2104743969974,0.447213595499958,0.447213595499958,0.447213595499958 +-5.59594056814363,10.0905780750461,-17.2806155591096,0.0894427190999916,155.695395662264,101.217217898573,46.4677075519764,4.23606797749979,-62.0913956622643,-32.0172178985727,8.78229244802357,2.61803398874989,2.61803398874989,2.61803398874989,117.320802734067,81.4294890120431,51.8954627839965,4.23606797749979,113.862321263929,87.6658092285561,41.2154550219465,0.0894427190999916,113.862321263929,87.6658092285561,41.2154550219465,0.0894427190999916,-5.59594056814363,10.0905780750461,-17.2806155591096,0.168916494400135,-20.25832126393,-18.4658092285563,14.0345449780535,0.447213595499958,0.447213595499958,0.447213595499958 +19.8004401276413,-3.75303462135115,12.9732239037272,0.0894427190999916,117.320802734067,81.4294890120431,51.8954627839965,4.23606797749979,-34.4508027340657,30.1705109879563,-58.2144627839965,2.61803398874989,2.61803398874989,2.61803398874989,96.0290357046961,100.075890260552,15.9169461466709,4.23606797749979,108.266380695786,97.7563873036022,23.9348394628369,0.0894427190999916,108.266380695786,97.7563873036022,23.9348394628369,0.0894427190999916,19.8004401276413,-3.75303462135115,12.9732239037272,0.168916494400135,-25.3963806957849,13.8436126963972,-30.2538394628369,0.447213595499958,0.447213595499958,0.447213595499958 +12.0022609510686,3.75031806089991,4.60628727029129,0.0894427190999916,96.0290357046961,100.075890260552,15.9169461466709,4.23606797749979,39.8359642953037,-13.5758902605523,29.3580538533292,2.61803398874989,2.61803398874989,2.61803398874989,120.649015613821,91.6855286519923,34.0612212715781,4.23606797749979,128.066820823427,94.003352682251,36.9080633665641,0.0894427190999916,128.066820823427,94.003352682251,36.9080633665641,0.0894427190999916,12.0022609510686,3.75031806089991,4.60628727029129,0.168916494400135,7.79817917657273,-7.50335268225105,8.36693663343595,0.447213595499958,0.447213595499958,0.447213595499958 +-42.2686572744359,-1.29601119594932,-19.4973620928532,0.0894427190999916,120.649015613821,91.6855286519923,34.0612212715781,4.23606797749979,73.6909843861791,11.1144713480079,31.5567787284218,2.61803398874989,2.61803398874989,2.61803398874989,166.192548628918,98.554649712048,53.5643831012025,4.23606797749979,140.069081774496,97.753670743151,41.5143506368554,0.0894427190999916,140.069081774496,97.753670743151,41.5143506368554,0.0894427190999916,-42.2686572744359,-1.29601119594932,-19.4973620928532,0.168916494400135,54.2709182255045,5.04632925684922,24.1036493631445,0.447213595499958,0.447213595499958,0.447213595499958 +26.7417672256247,-16.938351648748,29.250626451149,0.0894427190999916,166.192548628918,98.554649712048,53.5643831012025,4.23606797749979,-137.402548628918,13.5453502879523,-80.2953831012025,2.61803398874989,2.61803398874989,2.61803398874989,81.2731034353857,106.926136579526,3.93910720496542,4.23606797749979,97.8004245000597,96.4576595472016,22.0169885440022,0.0894427190999916,97.8004245000597,96.4576595472016,22.0169885440022,0.0894427190999916,26.7417672256247,-16.938351648748,29.250626451149,0.168916494400135,-69.0104245000607,15.6423404527987,-48.7479885440022,0.447213595499958,0.447213595499958,0.447213595499958 +-64.1260410486907,-7.91904375029446,-50.1747585536998,0.0894427190999916,81.2731034353857,106.926136579526,3.93910720496542,4.23606797749979,134.136896564614,-36.4261365795257,126.753892795035,2.61803398874989,2.61803398874989,2.61803398874989,164.174264657746,84.413546094533,82.2773211586572,4.23606797749979,124.542191725684,79.5193078984536,51.2676149951512,0.0894427190999916,124.542191725684,79.5193078984536,51.2676149951512,0.0894427190999916,-64.1260410486907,-7.91904375029446,-50.1747585536998,0.168916494400135,90.8678082743154,-9.01930789845358,79.4253850048488,0.447213595499958,0.447213595499958,0.447213595499958 +-13.1228903716973,-10.4187796021348,-17.5089021122482,0.0894427190999916,164.174264657746,84.413546094533,82.2773211586572,4.23606797749979,-154.761264657746,-10.3135460945335,-113.850321158657,2.61803398874989,2.61803398874989,2.61803398874989,68.5265429573415,78.0394240635725,11.9139530525157,4.23606797749979,60.4161506769938,71.6002641481591,1.09285644145149,0.0894427190999916,60.4161506769938,71.6002641481591,1.09285644145149,0.0894427190999916,-13.1228903716973,-10.4187796021348,-17.5089021122482,0.168916494400135,-51.0031506769933,2.49973585184033,-32.6658564414516,0.447213595499958,0.447213595499958,0.447213595499958 +-32.5066300664006,-16.8372950561108,-34.813947783045,0.0894427190999916,68.5265429573415,78.0394240635725,11.9139530525157,4.23606797749979,-1.84954295734181,-10.4394240635722,-11.0249530525156,2.61803398874989,2.61803398874989,2.61803398874989,67.3834625460512,71.5875051693114,5.10015734168916,4.23606797749979,47.2932603052964,61.1814845460243,-16.4160456707967,0.0894427190999916,47.2932603052964,61.1814845460243,-16.4160456707967,0.0894427190999916,-32.5066300664006,-16.8372950561108,-34.813947783045,0.168916494400135,19.3837396947032,6.41851545397602,17.3050456707968,0.447213595499958,0.447213595499958,0.447213595499958 +19.6530001724948,-3.29310556619747,19.1100587631133,0.0894427190999916,67.3834625460512,71.5875051693114,5.10015734168916,4.23606797749979,-104.756462546051,-40.7875051693112,-110.254157341689,2.61803398874989,2.61803398874989,2.61803398874989,2.6404081513865,46.379440658365,-63.0406592964535,4.23606797749979,14.7866302388958,44.3441894899135,-51.2299934538417,0.0894427190999916,14.7866302388958,44.3441894899135,-51.2299934538417,0.0894427190999916,19.6530001724948,-3.29310556619747,19.1100587631133,0.168916494400135,-52.1596302388954,-13.5441894899133,-53.9240065461583,0.447213595499958,0.447213595499958,0.447213595499958 +-19.9873694161144,8.55797835751877,-6.96887592761521,0.0894427190999916,2.6404081513865,46.379440658365,-63.0406592964535,4.23606797749979,71.4395918486134,-17.1794406583652,56.9996592964536,2.61803398874989,2.61803398874989,2.61803398874989,46.7925040562495,35.7619624237835,-27.8129325040813,4.23606797749979,34.4396304113907,41.0510839237161,-32.1199346907284,0.0894427190999916,34.4396304113907,41.0510839237161,-32.1199346907284,0.0894427190999916,-19.9873694161144,8.55797835751877,-6.96887592761521,0.168916494400135,39.6403695886092,-11.8510839237162,26.0789346907285,0.447213595499958,0.447213595499958,0.447213595499958 +25.6408915791614,23.9670406387538,-6.48168654595882,0.0894427190999916,46.7925040562495,35.7619624237835,-27.8129325040813,4.23606797749979,-77.968504056249,-1.56196242378364,-11.7630674959187,2.61803398874989,2.61803398874989,2.61803398874989,-1.39468150249639,34.796616556735,-35.0829080285182,4.23606797749979,14.4522609952763,49.6090622812348,-39.0888106183436,0.0894427190999916,14.4522609952763,49.6090622812348,-39.0888106183436,0.0894427190999916,25.6408915791614,23.9670406387538,-6.48168654595882,0.168916494400135,-45.6282609952758,-15.409062281235,-0.487189381656387,0.447213595499958,0.447213595499958,0.447213595499958 +25.6810441535992,-24.7568564412578,53.8328162897387,0.0894427190999916,-1.39468150249639,34.796616556735,-35.0829080285182,4.23606797749979,41.4476815024963,87.5033834432652,-70.8020919714818,2.61803398874989,2.61803398874989,2.61803398874989,24.2213944209266,88.8766816552877,-78.84100734149,4.23606797749979,40.0931525744377,73.5761029199886,-45.5704971643025,0.0894427190999916,40.0931525744377,73.5761029199886,-45.5704971643025,0.0894427190999916,25.6810441535992,-24.7568564412578,53.8328162897387,0.168916494400135,-0.0401525744378288,48.7238970800116,-60.3145028356975,0.447213595499958,0.447213595499958,0.447213595499958 +-6.28475911836362,-3.23760996252713,3.95713541517506,0.0894427190999916,24.2213944209266,88.8766816552877,-78.84100734149,4.23606797749979,73.5186055790732,-61.5766816552875,136.97900734149,2.61803398874989,2.61803398874989,2.61803398874989,69.6583914742915,50.8201994778879,5.81667494077215,4.23606797749979,65.7741967280369,48.8192464787308,8.26231912543625,0.0894427190999916,65.7741967280369,48.8192464787308,8.26231912543625,0.0894427190999916,-6.28475911836362,-3.23760996252713,3.95713541517506,0.168916494400135,31.9658032719628,-21.5192464787307,49.8756808745636,0.447213595499958,0.447213595499958,0.447213595499958 +-7.69732150869036,1.84402655367658,-5.27541004421361,0.0894427190999916,69.6583914742915,50.8201994778879,5.81667494077215,4.23606797749979,-8.75639147429143,-10.3201994778879,15.6353250592279,2.61803398874989,2.61803398874989,2.61803398874989,64.2466439243796,44.4419654298742,15.4798372525279,4.23606797749979,59.4894376096733,45.5816365162037,12.2194545406113,0.0894427190999916,59.4894376096733,45.5816365162037,12.2194545406113,0.0894427190999916,-7.69732150869036,1.84402655367658,-5.27541004421361,0.168916494400135,1.41256239032673,-5.08163651620371,9.23254545938867,0.447213595499958,0.447213595499958,0.447213595499958 +-13.5652054077073,-4.93031037644295,-2.08336554781585,0.0894427190999916,64.2466439243796,44.4419654298742,15.4798372525279,4.23606797749979,-6.58664392437971,9.75803457012557,-11.727837252528,2.61803398874989,2.61803398874989,2.61803398874989,60.1758741073199,50.4727624576083,8.23163521593845,4.23606797749979,51.792116100983,47.4256630698803,6.94404449639772,0.0894427190999916,51.792116100983,47.4256630698803,6.94404449639772,0.0894427190999916,-13.5652054077073,-4.93031037644295,-2.08336554781585,0.168916494400135,5.8678838990169,6.77433693011953,-3.19204449639776,0.447213595499958,0.447213595499958,0.447213595499958 +22.2677052855682,8.96504231699402,4.08931340076592,0.0894427190999916,60.1758741073199,50.4727624576083,8.23163521593845,4.23606797749979,-57.7818741073197,-21.872762457608,-9.54363521593835,2.61803398874989,2.61803398874989,2.61803398874989,24.4647119753289,36.9546518309539,2.33334427625811,4.23606797749979,38.2269106932757,42.4953526934373,4.86067894858187,0.0894427190999916,38.2269106932757,42.4953526934373,4.86067894858187,0.0894427190999916,22.2677052855682,8.96504231699402,4.08931340076592,0.168916494400135,-35.8329106932755,-13.895352693437,-6.17267894858177,0.447213595499958,0.447213595499958,0.447213595499958 +35.7673212644131,18.7254373274256,13.1173057501137,0.0894427190999916,24.4647119753289,36.9546518309539,2.33334427625811,4.23606797749979,22.5302880246701,4.7453481690459,-2.41134427625808,2.61803398874989,2.61803398874989,2.61803398874989,38.3891957508997,39.8874382878764,0.843051554953098,4.23606797749979,60.4946159788439,51.4603950104314,8.94999234934779,0.0894427190999916,60.4946159788439,51.4603950104314,8.94999234934779,0.0894427190999916,35.7673212644131,18.7254373274256,13.1173057501137,0.168916494400135,-13.4996159788449,-9.76039501043154,-9.02799234934776,0.447213595499958,0.447213595499958,0.447213595499958 +39.1422585076695,13.4112696652834,24.6276038495751,0.0894427190999916,38.3891957508997,39.8874382878764,0.843051554953098,4.23606797749979,54.4978042491009,35.6125617121227,9.71394844504692,2.61803398874989,2.61803398874989,2.61803398874989,72.0706910890825,61.8972118524213,6.84660185895628,4.23606797749979,96.261937243257,70.1858323378569,22.0672980994615,0.0894427190999916,96.261937243257,70.1858323378569,22.0672980994615,0.0894427190999916,39.1422585076695,13.4112696652834,24.6276038495751,0.168916494400135,-3.37493724325638,5.31416766214218,-11.5102980994615,0.447213595499958,0.447213595499958,0.447213595499958 +-22.2085457414032,-17.2916283315774,5.13750579861184,0.0894427190999916,72.0706910890825,61.8972118524213,6.84660185895628,4.23606797749979,124.684308910917,52.4027881475797,59.3383981410437,2.61803398874989,2.61803398874989,2.61803398874989,149.12983185982,94.2839160328858,43.5197487480948,4.23606797749979,135.404195750926,83.5971020031403,46.6949019490366,0.0894427190999916,135.404195750926,83.5971020031403,46.6949019490366,0.0894427190999916,-22.2085457414032,-17.2916283315774,5.13750579861184,0.168916494400135,61.3508042490727,30.7028979968608,19.4900980509633,0.447213595499958,0.447213595499958,0.447213595499958 +-16.3688957318797,3.11384533998575,-12.9300864537396,0.0894427190999916,149.12983185982,94.2839160328858,43.5197487480948,4.23606797749979,-41.7738318598206,-48.3839160328861,26.380251251905,2.61803398874989,2.61803398874989,2.61803398874989,123.312183930128,64.3810114157412,59.8236406535341,4.23606797749979,113.195650009523,66.3054736715628,51.8324077476485,0.0894427190999916,113.195650009523,66.3054736715628,51.8324077476485,0.0894427190999916,-16.3688957318797,3.11384533998575,-12.9300864537396,0.168916494400135,-5.83965000952353,-20.4054736715632,18.0675922523514,0.447213595499958,0.447213595499958,0.447213595499958 +-4.34814145423654,-7.06683564846604,15.7402348401691,0.0894427190999916,123.312183930128,64.3810114157412,59.8236406535341,4.23606797749979,-38.5061839301275,15.2189885842592,-49.5916406535339,2.61803398874989,2.61803398874989,2.61803398874989,99.5140534842542,73.78686363521,29.1743211717791,4.23606797749979,96.8267542776436,69.4193190115486,38.9023212939089,0.0894427190999916,96.8267542776436,69.4193190115486,38.9023212939089,0.0894427190999916,-4.34814145423654,-7.06683564846604,15.7402348401691,0.168916494400135,-12.0207542776431,10.1806809884518,-28.6703212939087,0.447213595499958,0.447213595499958,0.447213595499958 +1.93547136917085,9.68564771461614,-15.1822090257526,0.0894427190999916,99.5140534842542,73.78686363521,29.1743211717791,4.23606797749979,-13.3190534842545,-28.1868636352096,56.3906788282207,2.61803398874989,2.61803398874989,2.61803398874989,91.2824257330072,56.366423872392,64.0256773362986,4.23606797749979,92.4786128234071,62.3524833630825,54.642556134078,0.0894427190999916,92.4786128234071,62.3524833630825,54.642556134078,0.0894427190999916,1.93547136917085,9.68564771461614,-15.1822090257526,0.168916494400135,-6.28361282340738,-16.7524833630822,30.9224438659218,0.447213595499958,0.447213595499958,0.447213595499958 +6.63455556174864,9.12377879231628,-2.37286191742756,0.0894427190999916,91.2824257330072,56.366423872392,64.0256773362986,4.23606797749979,-1.56742573300707,16.2335761276065,-37.3746773362983,2.61803398874989,2.61803398874989,2.61803398874989,90.3137033551676,66.3993256782118,40.9268564239059,4.23606797749979,94.4140841925779,72.0381310776987,39.4603471083254,0.0894427190999916,94.4140841925779,72.0381310776987,39.4603471083254,0.0894427190999916,6.63455556174864,9.12377879231628,-2.37286191742756,0.168916494400135,-4.6990841925778,0.56186892229986,-12.8093471083251,0.447213595499958,0.447213595499958,0.447213595499958 +0.934195316075438,-8.11431133767021,-8.20637672652955,0.0894427190999915,90.3137033551676,66.3993256782118,40.9268564239059,4.23606797749979,16.4352966448322,32.0006743217897,1.99414357609395,2.61803398874989,2.61803398874989,2.61803398874989,100.471275296861,86.1768300719938,42.1593049323792,4.23606797749979,101.048639754327,81.161909870015,37.0874851908978,0.0894427190999916,101.048639754327,81.161909870015,37.0874851908978,0.0894427190999916,0.934195316075438,-8.11431133767021,-8.20637672652955,0.168916494400135,5.70036024567321,17.2380901299865,5.83351480910199,0.447213595499958,0.447213595499958,0.447213595499958 +-20.9139696135227,0.133287194675265,-24.4722682621612,0.0894427190999914,100.471275296861,86.1768300719938,42.1593049323792,4.23606797749979,23.3597247031391,-21.3768300719945,2.98769506762074,2.61803398874989,2.61803398874989,2.61803398874989,114.908379131242,72.9652225157703,44.0058020321892,4.23606797749979,101.982835070402,73.0475985323448,28.8811084643683,0.0894427190999917,101.982835070402,73.0475985323448,28.8811084643683,0.0894427190999917,-20.9139696135227,0.133287194675265,-24.4722682621612,0.168916494400135,21.8481649295981,-8.24759853234548,16.2658915356317,0.447213595499958,0.447213595499958,0.447213595499958 +6.73289584335623,-10.5858270783044,18.767571940046,0.0894427190999899,114.908379131242,72.9652225157703,44.0058020321892,4.23606797749979,-61.4863791312411,10.9347774842293,-82.8368020321894,2.61803398874989,2.61803398874989,2.61803398874989,76.9077069829723,79.7232866604411,-7.19015714305016,4.23606797749979,81.0688654568794,73.18088572702,4.40884020220707,0.0894427190999922,81.0688654568794,73.18088572702,4.40884020220707,0.0894427190999922,6.73289584335623,-10.5858270783044,18.767571940046,0.168916494400137,-27.6468654568789,10.7191142729796,-43.2398402022072,0.447213595499959,0.447213595499959,0.447213595499959 +-1.08334285640858,-10.6907684295894,18.4629840822989,0.0894427190999803,76.9077069829723,79.7232866604411,-7.19015714305016,4.23606797749979,18.7102930170281,-17.0232866604404,30.6711571430504,2.61803398874989,2.61803398874989,2.61803398874989,88.4713040069655,69.2023169040563,11.7656604456441,4.23606797749979,87.8017613002356,62.5950586487156,23.1764121422531,0.0894427190999959,87.8017613002356,62.5950586487156,23.1764121422531,0.0894427190999959,-1.08334285640858,-10.6907684295894,18.4629840822989,0.168916494400152,7.8162386997648,0.104941351285074,0.30458785774713,0.447213595499965,0.447213595499965,0.447213595499965 +20.0890755874182,18.3135217895371,-17.1416196931493,0.0894427190999141,88.4713040069655,69.2023169040563,11.7656604456441,4.23606797749979,-22.9253040069652,-46.3023169040566,65.478339554356,2.61803398874989,2.61803398874989,2.61803398874989,74.3026869282368,40.5859112994805,52.2334998171428,4.23606797749979,86.718418443827,51.9042902191262,41.639396224552,0.0894427191000212,86.718418443827,51.9042902191262,41.639396224552,0.0894427191000212,20.0890755874182,18.3135217895371,-17.1416196931493,0.168916494400253,-21.1724184438267,-29.0042902191266,35.6046037754482,0.447213595500007,0.447213595500007,0.447213595500007 +-40.3424303813362,-9.56866620179987,-25.1718431617463,0.0894427190994602,74.3026869282368,40.5859112994805,52.2334998171428,4.23606797749979,92.9363130717628,57.5140887005199,-19.705499817143,2.61803398874989,2.61803398874989,2.61803398874989,131.740487195687,76.1315729483781,40.0548311648436,4.23606797749979,106.807494031245,70.2178120086634,24.4977765314027,0.0894427191001945,106.807494031245,70.2178120086634,24.4977765314027,0.0894427191001945,-40.3424303813362,-9.56866620179987,-25.1718431617463,0.168916494400946,60.4315059687544,27.882187991337,8.03022346859707,0.447213595500296,0.447213595500296,0.447213595500296 +-20.4013667314268,2.680479605064,-22.3719097920898,0.0894427190963499,131.740487195687,76.1315729483781,40.0548311648436,4.23606797749979,-85.2164871956879,-27.7315729483784,-43.5288311648437,2.61803398874989,2.61803398874989,2.61803398874989,79.073801706882,58.9925183047831,13.1525340144145,4.23606797749979,66.4650636499089,60.6491458068635,-0.674066630343603,0.0894427191013827,66.4650636499089,60.6491458068635,-0.674066630343603,0.0894427191013827,-20.4013667314268,2.680479605064,-22.3719097920898,0.168916494405699,-19.9410636499095,-12.2491458068639,-2.79993336965655,0.447213595502276,0.447213595502276,0.447213595502276 +22.2083301870556,10.3101050169908,-13.8068862145233,0.0894427190750307,79.073801706882,58.9925183047831,13.1525340144145,4.23606797749979,-75.6198017068823,-3.29251830478233,-44.7635340144143,2.61803398874989,2.61803398874989,2.61803398874989,32.3381940295014,56.9576300838464,-14.5128514630556,4.23606797749979,46.0636969184821,63.3296254119275,-23.0459764224334,0.0894427191095258,46.0636969184821,63.3296254119275,-23.0459764224334,0.0894427191095258,22.2083301870556,10.3101050169908,-13.8068862145233,0.168916494438271,-42.6096969184824,-7.62962541192679,-8.56502357756649,0.447213595515848,0.447213595515848,0.447213595515848 +-4.28264270740754,-6.95016455409055,13.0102511485201,0.0894427189289074,32.3381940295014,56.9576300838464,-14.5128514630556,4.23606797749979,62.4248059704994,33.9423699161532,-49.1571485369445,2.61803398874989,2.61803398874989,2.61803398874989,70.9188458603874,77.935168350751,-44.8936400489145,4.23606797749979,68.2720271055377,73.6397304289183,-36.8528626369567,0.0894427191653399,68.2720271055377,73.6397304289183,-36.8528626369567,0.0894427191653399,-4.28264270740754,-6.95016455409055,13.0102511485201,0.168916494661528,26.4909728944631,17.2602695710813,-26.8171373630434,0.447213595608872,0.447213595608872,0.447213595608872 +20.4847416907229,-23.7605986792628,22.5246396600835,0.0894427179273626,70.9188458603874,77.935168350751,-44.8936400489145,4.23606797749979,-31.6968458603877,5.56483164924899,11.5366400489145,2.61803398874989,2.61803398874989,2.61803398874989,51.3291177825014,81.374423451658,-37.7636043827121,4.23606797749979,63.9893843981302,66.6895658748277,-23.8426114884366,0.089442719547896,63.9893843981302,66.6895658748277,-23.8426114884366,0.089442719547896,20.4847416907229,-23.7605986792628,22.5246396600835,0.168916496191752,-24.7673843981304,16.8104341251723,-9.51438851156338,0.447213596246465,0.447213596246465,0.447213596246465 +0.882867779574944,-7.2316314836975,-8.39833216826967,0.0894427110626729,51.3291177825014,81.374423451658,-37.7636043827121,4.23606797749979,52.7468822174995,-54.9744234516584,67.3686043827121,2.61803398874989,2.61803398874989,2.61803398874989,83.9284837935035,47.3983612466038,3.87248290044914,4.23606797749979,84.474126088853,42.9289671955649,-1.31797182835312,0.0894427221699743,84.474126088853,42.9289671955649,-1.31797182835312,0.0894427221699743,0.882867779574944,-7.2316314836975,-8.39833216826967,0.168916506680065,19.6018739111479,-16.5289671955653,30.9229718283531,0.447213600616596,0.447213600616596,0.447213600616596 +-30.8921383519967,-15.6342957718304,-22.3916361648925,0.0894426640113997,83.9284837935035,47.3983612466038,3.87248290044914,4.23606797749979,33.2035162064961,-3.29836124660346,0.404517099550908,2.61803398874989,2.61803398874989,2.61803398874989,104.449385355126,45.3598618890274,4.12248821700212,4.23606797749979,85.3569938684279,35.6973357118674,-9.71630399662279,0.0894427401419672,85.3569938684279,35.6973357118674,-9.71630399662279,0.0894427401419672,-30.8921383519967,-15.6342957718304,-22.3916361648925,0.168916578568045,31.7750061315716,8.40266428813293,13.9933039966228,0.447213630569915,0.447213630569915,0.447213630569915 +-46.5672828355649,-23.5712558317934,-11.4345763264077,0.0894423415176199,104.449385355126,45.3598618890274,4.12248821700212,4.23606797749979,-34.3093853551267,-17.3598618890274,-47.1874882170022,2.61803398874989,2.61803398874989,2.61803398874989,83.2450190725399,34.6308772016045,-25.0409833448404,4.23606797749979,54.4648555164312,20.063039940037,-32.1079401615153,0.0894428633239045,54.4648555164312,20.063039940037,-32.1079401615153,0.0894428633239045,-46.5672828355649,-23.5712558317934,-11.4345763264077,0.168917071296133,15.6751444835682,7.93696005996298,-10.9570598384848,0.447213835873017,0.447213835873017,0.447213835873017 +-14.2857101546985,-13.0794717235498,-14.4370928143308,0.0894401311332342,83.2450190725399,34.6308772016045,-25.0409833448404,4.23606797749979,-107.62901907254,-48.6308772016045,-15.4990166551596,2.61803398874989,2.61803398874989,2.61803398874989,16.7266271098996,4.57534218829055,-34.6199024299297,4.23606797749979,7.89757268086638,-3.50821589175639,-43.542516487923,0.0894437076285072,7.89757268086638,-3.50821589175639,-43.542516487923,0.0894437076285072,-14.2857101546985,-13.0794717235498,-14.4370928143308,0.168920448530483,-32.2815726808664,-10.4917841082436,3.00251648792307,0.447215243041414,0.447215243041414,0.447215243041414 +-69.0748476285305,-31.0671593388556,-16.0487021165847,0.0894249819134705,16.7266271098996,4.57534218829055,-34.6199024299297,4.23606797749979,31.6743728901003,-3.17534218829092,-21.7480975700702,2.61803398874989,2.61803398874989,2.61803398874989,36.3024661283198,2.6128727900153,-48.0609659188821,4.23606797749979,-6.38813747383213,-16.5876876153062,-57.9796093022538,0.0894494947213581,-6.38813747383213,-16.5876876153062,-57.9796093022538,0.0894494947213581,-69.0748476285305,-31.0671593388556,-16.0487021165847,0.168943597650733,54.789137473832,17.9876876153058,1.6116093022539,0.447224887917093,0.447224887917093,0.447224887917093 +-53.8718327308938,4.5779937069819,-54.2520135354232,0.0893211936581228,36.3024661283198,2.6128727900153,-48.0609659188821,4.23606797749979,-126.968466128319,-85.9128727900146,12.2359659188821,2.61803398874989,2.61803398874989,2.61803398874989,-42.1683614384211,-50.4842026653597,-40.4987230958277,4.23606797749979,-75.4629851023626,-47.6548469541618,-74.0283114188386,0.0894891667648662,-75.4629851023626,-47.6548469541618,-74.0283114188386,0.0894891667648662,-53.8718327308938,4.5779937069819,-54.2520135354232,0.169102321010081,-15.2030148976367,-35.6451530458375,38.2033114188385,0.447290994878445,0.447290994878444,0.447290994878445 +-0.526650564149875,33.9011404598035,-49.5003384896851,0.0886119791166665,-42.1683614384211,-50.4842026653597,-40.4987230958277,4.23606797749979,-140.511638561579,-21.9157973346417,-92.5332769041723,2.61803398874989,2.61803398874989,2.61803398874989,-129.009329884417,-64.0289103087227,-97.6874333130118,4.23606797749979,-129.334817833256,-43.0768532471799,-128.280324954262,0.089761398771559,-129.334817833256,-43.0768532471799,-128.280324954262,0.089761398771559,-0.526650564149875,33.9011404598035,-49.5003384896851,0.170192903770381,-53.3451821667439,-29.3231467528216,-4.75167504573814,0.447744098732229,0.447744098732229,0.447744098732229 +86.121881038444,10.8254276724256,71.8859980663682,0.0838517404088302,-129.009329884417,-64.0289103087227,-97.6874333130118,4.23606797749979,-87.5006701155827,77.9289103087241,-201.479566686988,2.61803398874989,2.61803398874989,2.61803398874989,-183.08771805424,-15.8661950316891,-222.208653564172,4.23606797749979,-129.861468397406,-9.17571278737644,-177.780663443947,0.0916421794821756,-129.861468397406,-9.17571278737644,-177.780663443947,0.0916421794821756,86.121881038444,10.8254276724256,71.8859980663682,0.177794334647952,-86.6485316025939,23.0757127873779,-121.386336556053,0.450849718747371,0.450849718747371,0.450849718747371 +66.2882936794809,32.6751425574754,67.8073326887892,0.0557280900008412,-183.08771805424,-15.8661950316891,-222.208653564172,4.23606797749979,159.181718054241,-4.33380496831163,120.392653564172,2.61803398874989,2.61803398874989,2.61803398874989,-84.7080059091162,-18.5446338027188,-147.801901665722,4.23606797749979,-43.7395873589622,1.64971488504914,-105.894665377579,0.105244939971399,-43.7395873589622,1.64971488504914,-105.894665377579,0.105244939971399,66.2882936794809,32.6751425574754,67.8073326887892,0.23606797749979,19.8335873589632,-21.8497148850499,4.07866537757892,0.472135954999579,0.472135954999579,0.472135954999579 +0,0,0,0,-84.7080059091162,-18.5446338027188,-147.801901665722,4.23606797749979,173.545005909116,85.5446338027188,177.521901665722,2.61803398874989,2.61803398874989,2.61803398874989,22.5487063205186,34.3248574425246,-38.0873326887895,4.23606797749979,22.5487063205186,34.3248574425246,-38.0873326887895,0.23606797749979,22.5487063205186,34.3248574425246,-38.0873326887895,0.23606797749979,0,0,0,1,66.2882936794809,32.6751425574754,67.8073326887892,0.618033988749895,0.618033988749895,0.618033988749895 diff --git a/shared/package-files/9d/9dd7a53f79a74ec38d12cd9304a0bfcb54812bda029d8576a3c7d3811b251705/blob b/shared/package-files/9d/9dd7a53f79a74ec38d12cd9304a0bfcb54812bda029d8576a3c7d3811b251705/blob new file mode 100644 index 0000000000000000000000000000000000000000..430a4175426e30bde02be7972b3144eed4923b27 --- /dev/null +++ b/shared/package-files/9d/9dd7a53f79a74ec38d12cd9304a0bfcb54812bda029d8576a3c7d3811b251705/blob @@ -0,0 +1,1518 @@ +import math + +import numpy as np + +import pytest +from numpy.testing import (assert_equal, assert_almost_equal, assert_array_almost_equal, + assert_allclose, suppress_warnings) + +from scipy import special +from scipy.special import (legendre_p, legendre_p_all, assoc_legendre_p, + assoc_legendre_p_all, sph_legendre_p, sph_legendre_p_all) + +# The functions lpn, lpmn, clpmn, appearing below are +# deprecated in favor of legendre_p_all, assoc_legendre_p_all, and +# assoc_legendre_p_all (assoc_legendre_p_all covers lpmn and clpmn) +# respectively. The deprecated functions listed above are implemented as +# shims around their respective replacements. The replacements are tested +# separately, but tests for the deprecated functions remain to verify the +# correctness of the shims. + +# Base polynomials come from Abrahmowitz and Stegan +class TestLegendre: + def test_legendre(self): + leg0 = special.legendre(0) + leg1 = special.legendre(1) + leg2 = special.legendre(2) + leg3 = special.legendre(3) + leg4 = special.legendre(4) + leg5 = special.legendre(5) + assert_equal(leg0.c, [1]) + assert_equal(leg1.c, [1,0]) + assert_almost_equal(leg2.c, np.array([3,0,-1])/2.0, decimal=13) + assert_almost_equal(leg3.c, np.array([5,0,-3,0])/2.0) + assert_almost_equal(leg4.c, np.array([35,0,-30,0,3])/8.0) + assert_almost_equal(leg5.c, np.array([63,0,-70,0,15,0])/8.0) + + @pytest.mark.parametrize('n', [1, 2, 3, 4, 5]) + @pytest.mark.parametrize('zr', [0.5241717, 12.80232, -9.699001, + 0.5122437, 0.1714377]) + @pytest.mark.parametrize('zi', [9.766818, 0.2999083, 8.24726, -22.84843, + -0.8792666]) + def test_lpn_against_clpmn(self, n, zr, zi): + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + reslpn = special.lpn(n, zr + zi*1j) + resclpmn = special.clpmn(0, n, zr+zi*1j) + + assert_allclose(reslpn[0], resclpmn[0][0]) + assert_allclose(reslpn[1], resclpmn[1][0]) + +class TestLegendreP: + @pytest.mark.parametrize("shape", [(10,), (4, 9), (3, 5, 7)]) + def test_ode(self, shape): + rng = np.random.default_rng(1234) + + n = rng.integers(0, 100, shape) + x = rng.uniform(-1, 1, shape) + + p, p_jac, p_hess = legendre_p(n, x, diff_n=2) + + assert p.shape == shape + assert p_jac.shape == p.shape + assert p_hess.shape == p_jac.shape + + err = (1 - x * x) * p_hess - 2 * x * p_jac + n * (n + 1) * p + np.testing.assert_allclose(err, 0, atol=1e-10) + + @pytest.mark.parametrize("n_max", [1, 2, 4, 8, 16, 32]) + @pytest.mark.parametrize("x_shape", [(10,), (4, 9), (3, 5, 7)]) + def test_all_ode(self, n_max, x_shape): + rng = np.random.default_rng(1234) + + x = rng.uniform(-1, 1, x_shape) + p, p_jac, p_hess = legendre_p_all(n_max, x, diff_n=2) + + n = np.arange(n_max + 1) + n = np.expand_dims(n, axis = tuple(range(1, x.ndim + 1))) + + assert p.shape == (len(n),) + x.shape + assert p_jac.shape == p.shape + assert p_hess.shape == p_jac.shape + + err = (1 - x * x) * p_hess - 2 * x * p_jac + n * (n + 1) * p + np.testing.assert_allclose(err, 0, atol=1e-10) + + def test_legacy(self): + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + p, pd = special.lpn(2, 0.5) + + assert_array_almost_equal(p, [1.00000, 0.50000, -0.12500], 4) + assert_array_almost_equal(pd, [0.00000, 1.00000, 1.50000], 4) + +class TestAssocLegendreP: + @pytest.mark.parametrize("shape", [(10,), (4, 9), (3, 5, 7, 10)]) + @pytest.mark.parametrize("m_max", [5, 4]) + @pytest.mark.parametrize("n_max", [7, 10]) + def test_lpmn(self, shape, n_max, m_max): + rng = np.random.default_rng(1234) + + x = rng.uniform(-0.99, 0.99, shape) + p_all, p_all_jac, p_all_hess = \ + assoc_legendre_p_all(n_max, m_max, x, diff_n=2) + + n = np.arange(n_max + 1) + n = np.expand_dims(n, axis = tuple(range(1, x.ndim + 2))) + + m = np.concatenate([np.arange(m_max + 1), np.arange(-m_max, 0)]) + m = np.expand_dims(m, axis = (0,) + tuple(range(2, x.ndim + 2))) + + x = np.expand_dims(x, axis = (0, 1)) + p, p_jac, p_hess = assoc_legendre_p(n, m, x, diff_n=2) + + np.testing.assert_allclose(p, p_all) + np.testing.assert_allclose(p_jac, p_all_jac) + np.testing.assert_allclose(p_hess, p_all_hess) + + @pytest.mark.parametrize("shape", [(10,), (4, 9), (3, 5, 7, 10)]) + @pytest.mark.parametrize("norm", [True, False]) + def test_ode(self, shape, norm): + rng = np.random.default_rng(1234) + + n = rng.integers(0, 10, shape) + m = rng.integers(-10, 10, shape) + x = rng.uniform(-1, 1, shape) + + p, p_jac, p_hess = assoc_legendre_p(n, m, x, norm=norm, diff_n=2) + + assert p.shape == shape + assert p_jac.shape == p.shape + assert p_hess.shape == p_jac.shape + + np.testing.assert_allclose((1 - x * x) * p_hess, + 2 * x * p_jac - (n * (n + 1) - m * m / (1 - x * x)) * p, + rtol=1e-05, atol=1e-08) + + @pytest.mark.parametrize("shape", [(10,), (4, 9), (3, 5, 7)]) + def test_all(self, shape): + rng = np.random.default_rng(1234) + + n_max = 20 + m_max = 20 + + x = rng.uniform(-0.99, 0.99, shape) + + p, p_jac, p_hess = assoc_legendre_p_all(n_max, m_max, x, diff_n=2) + + m = np.concatenate([np.arange(m_max + 1), np.arange(-m_max, 0)]) + n = np.arange(n_max + 1) + + n = np.expand_dims(n, axis = tuple(range(1, x.ndim + 2))) + m = np.expand_dims(m, axis = (0,) + tuple(range(2, x.ndim + 2))) + np.testing.assert_allclose((1 - x * x) * p_hess, + 2 * x * p_jac - (n * (n + 1) - m * m / (1 - x * x)) * p, + rtol=1e-05, atol=1e-08) + + @pytest.mark.parametrize("shape", [(10,), (4, 9), (3, 5, 7)]) + @pytest.mark.parametrize("norm", [True, False]) + def test_specific(self, shape, norm): + rng = np.random.default_rng(1234) + + x = rng.uniform(-0.99, 0.99, shape) + + p, p_jac = assoc_legendre_p_all(4, 4, x, norm=norm, diff_n=1) + + np.testing.assert_allclose(p[0, 0], + assoc_legendre_p_0_0(x, norm=norm)) + np.testing.assert_allclose(p[0, 1], 0) + np.testing.assert_allclose(p[0, 2], 0) + np.testing.assert_allclose(p[0, 3], 0) + np.testing.assert_allclose(p[0, 4], 0) + np.testing.assert_allclose(p[0, -3], 0) + np.testing.assert_allclose(p[0, -2], 0) + np.testing.assert_allclose(p[0, -1], 0) + + np.testing.assert_allclose(p[1, 0], + assoc_legendre_p_1_0(x, norm=norm)) + np.testing.assert_allclose(p[1, 1], + assoc_legendre_p_1_1(x, norm=norm)) + np.testing.assert_allclose(p[1, 2], 0) + np.testing.assert_allclose(p[1, 3], 0) + np.testing.assert_allclose(p[1, 4], 0) + np.testing.assert_allclose(p[1, -4], 0) + np.testing.assert_allclose(p[1, -3], 0) + np.testing.assert_allclose(p[1, -2], 0) + np.testing.assert_allclose(p[1, -1], + assoc_legendre_p_1_m1(x, norm=norm)) + + np.testing.assert_allclose(p[2, 0], + assoc_legendre_p_2_0(x, norm=norm)) + np.testing.assert_allclose(p[2, 1], + assoc_legendre_p_2_1(x, norm=norm)) + np.testing.assert_allclose(p[2, 2], + assoc_legendre_p_2_2(x, norm=norm)) + np.testing.assert_allclose(p[2, 3], 0) + np.testing.assert_allclose(p[2, 4], 0) + np.testing.assert_allclose(p[2, -4], 0) + np.testing.assert_allclose(p[2, -3], 0) + np.testing.assert_allclose(p[2, -2], + assoc_legendre_p_2_m2(x, norm=norm)) + np.testing.assert_allclose(p[2, -1], + assoc_legendre_p_2_m1(x, norm=norm)) + + np.testing.assert_allclose(p[3, 0], + assoc_legendre_p_3_0(x, norm=norm)) + np.testing.assert_allclose(p[3, 1], + assoc_legendre_p_3_1(x, norm=norm)) + np.testing.assert_allclose(p[3, 2], + assoc_legendre_p_3_2(x, norm=norm)) + np.testing.assert_allclose(p[3, 3], + assoc_legendre_p_3_3(x, norm=norm)) + np.testing.assert_allclose(p[3, 4], 0) + np.testing.assert_allclose(p[3, -4], 0) + np.testing.assert_allclose(p[3, -3], + assoc_legendre_p_3_m3(x, norm=norm)) + np.testing.assert_allclose(p[3, -2], + assoc_legendre_p_3_m2(x, norm=norm)) + np.testing.assert_allclose(p[3, -1], + assoc_legendre_p_3_m1(x, norm=norm)) + + np.testing.assert_allclose(p[4, 0], + assoc_legendre_p_4_0(x, norm=norm)) + np.testing.assert_allclose(p[4, 1], + assoc_legendre_p_4_1(x, norm=norm)) + np.testing.assert_allclose(p[4, 2], + assoc_legendre_p_4_2(x, norm=norm)) + np.testing.assert_allclose(p[4, 3], + assoc_legendre_p_4_3(x, norm=norm)) + np.testing.assert_allclose(p[4, 4], + assoc_legendre_p_4_4(x, norm=norm)) + np.testing.assert_allclose(p[4, -4], + assoc_legendre_p_4_m4(x, norm=norm)) + np.testing.assert_allclose(p[4, -3], + assoc_legendre_p_4_m3(x, norm=norm)) + np.testing.assert_allclose(p[4, -2], + assoc_legendre_p_4_m2(x, norm=norm)) + np.testing.assert_allclose(p[4, -1], + assoc_legendre_p_4_m1(x, norm=norm)) + + np.testing.assert_allclose(p_jac[0, 0], + assoc_legendre_p_0_0_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[0, 1], 0) + np.testing.assert_allclose(p_jac[0, 2], 0) + np.testing.assert_allclose(p_jac[0, 3], 0) + np.testing.assert_allclose(p_jac[0, 4], 0) + np.testing.assert_allclose(p_jac[0, -4], 0) + np.testing.assert_allclose(p_jac[0, -3], 0) + np.testing.assert_allclose(p_jac[0, -2], 0) + np.testing.assert_allclose(p_jac[0, -1], 0) + + np.testing.assert_allclose(p_jac[1, 0], + assoc_legendre_p_1_0_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[1, 1], + assoc_legendre_p_1_1_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[1, 2], 0) + np.testing.assert_allclose(p_jac[1, 3], 0) + np.testing.assert_allclose(p_jac[1, 4], 0) + np.testing.assert_allclose(p_jac[1, -4], 0) + np.testing.assert_allclose(p_jac[1, -3], 0) + np.testing.assert_allclose(p_jac[1, -2], 0) + np.testing.assert_allclose(p_jac[1, -1], + assoc_legendre_p_1_m1_jac(x, norm=norm)) + + np.testing.assert_allclose(p_jac[2, 0], + assoc_legendre_p_2_0_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[2, 1], + assoc_legendre_p_2_1_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[2, 2], + assoc_legendre_p_2_2_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[2, 3], 0) + np.testing.assert_allclose(p_jac[2, 4], 0) + np.testing.assert_allclose(p_jac[2, -4], 0) + np.testing.assert_allclose(p_jac[2, -3], 0) + np.testing.assert_allclose(p_jac[2, -2], + assoc_legendre_p_2_m2_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[2, -1], + assoc_legendre_p_2_m1_jac(x, norm=norm)) + + np.testing.assert_allclose(p_jac[3, 0], + assoc_legendre_p_3_0_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[3, 1], + assoc_legendre_p_3_1_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[3, 2], + assoc_legendre_p_3_2_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[3, 3], + assoc_legendre_p_3_3_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[3, 4], 0) + np.testing.assert_allclose(p_jac[3, -4], 0) + np.testing.assert_allclose(p_jac[3, -3], + assoc_legendre_p_3_m3_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[3, -2], + assoc_legendre_p_3_m2_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[3, -1], + assoc_legendre_p_3_m1_jac(x, norm=norm)) + + np.testing.assert_allclose(p_jac[4, 0], + assoc_legendre_p_4_0_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[4, 1], + assoc_legendre_p_4_1_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[4, 2], + assoc_legendre_p_4_2_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[4, 3], + assoc_legendre_p_4_3_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[4, 4], + assoc_legendre_p_4_4_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[4, -4], + assoc_legendre_p_4_m4_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[4, -3], + assoc_legendre_p_4_m3_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[4, -2], + assoc_legendre_p_4_m2_jac(x, norm=norm)) + np.testing.assert_allclose(p_jac[4, -1], + assoc_legendre_p_4_m1_jac(x, norm=norm)) + + @pytest.mark.parametrize("m_max", [7]) + @pytest.mark.parametrize("n_max", [10]) + @pytest.mark.parametrize("x", [1, -1]) + def test_all_limits(self, m_max, n_max, x): + p, p_jac = assoc_legendre_p_all(n_max, m_max, x, diff_n=1) + + n = np.arange(n_max + 1) + + np.testing.assert_allclose(p_jac[:, 0], + pow(x, n + 1) * n * (n + 1) / 2) + np.testing.assert_allclose(p_jac[:, 1], + np.where(n >= 1, pow(x, n) * np.inf, 0)) + np.testing.assert_allclose(p_jac[:, 2], + np.where(n >= 2, -pow(x, n + 1) * (n + 2) * (n + 1) * n * (n - 1) / 4, 0)) + np.testing.assert_allclose(p_jac[:, -2], + np.where(n >= 2, -pow(x, n + 1) / 4, 0)) + np.testing.assert_allclose(p_jac[:, -1], + np.where(n >= 1, -pow(x, n) * np.inf, 0)) + + for m in range(3, m_max + 1): + np.testing.assert_allclose(p_jac[:, m], 0) + np.testing.assert_allclose(p_jac[:, -m], 0) + + @pytest.mark.parametrize("m_max", [3, 5, 10]) + @pytest.mark.parametrize("n_max", [10]) + def test_legacy(self, m_max, n_max): + x = 0.5 + p, p_jac = assoc_legendre_p_all(n_max, m_max, x, diff_n=1) + + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + + p_legacy, p_jac_legacy = special.lpmn(m_max, n_max, x) + for m in range(m_max + 1): + np.testing.assert_allclose(p_legacy[m], p[:, m]) + + p_legacy, p_jac_legacy = special.lpmn(-m_max, n_max, x) + for m in range(m_max + 1): + np.testing.assert_allclose(p_legacy[m], p[:, -m]) + +class TestMultiAssocLegendreP: + @pytest.mark.parametrize("shape", [(1000,), (4, 9), (3, 5, 7)]) + @pytest.mark.parametrize("branch_cut", [2, 3]) + @pytest.mark.parametrize("z_min, z_max", [(-10 - 10j, 10 + 10j), + (-1, 1), (-10j, 10j)]) + @pytest.mark.parametrize("norm", [True, False]) + def test_specific(self, shape, branch_cut, z_min, z_max, norm): + rng = np.random.default_rng(1234) + + z = rng.uniform(z_min.real, z_max.real, shape) + \ + 1j * rng.uniform(z_min.imag, z_max.imag, shape) + + p, p_jac = assoc_legendre_p_all(4, 4, + z, branch_cut=branch_cut, norm=norm, diff_n=1) + + np.testing.assert_allclose(p[0, 0], + assoc_legendre_p_0_0(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[0, 1], 0) + np.testing.assert_allclose(p[0, 2], 0) + np.testing.assert_allclose(p[0, 3], 0) + np.testing.assert_allclose(p[0, 4], 0) + np.testing.assert_allclose(p[0, -4], 0) + np.testing.assert_allclose(p[0, -3], 0) + np.testing.assert_allclose(p[0, -2], 0) + np.testing.assert_allclose(p[0, -1], 0) + + np.testing.assert_allclose(p[1, 0], + assoc_legendre_p_1_0(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[1, 1], + assoc_legendre_p_1_1(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[1, 2], 0) + np.testing.assert_allclose(p[1, 3], 0) + np.testing.assert_allclose(p[1, 4], 0) + np.testing.assert_allclose(p[1, -4], 0) + np.testing.assert_allclose(p[1, -3], 0) + np.testing.assert_allclose(p[1, -2], 0) + np.testing.assert_allclose(p[1, -1], + assoc_legendre_p_1_m1(z, branch_cut=branch_cut, norm=norm)) + + np.testing.assert_allclose(p[2, 0], + assoc_legendre_p_2_0(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[2, 1], + assoc_legendre_p_2_1(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[2, 2], + assoc_legendre_p_2_2(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[2, 3], 0) + np.testing.assert_allclose(p[2, 4], 0) + np.testing.assert_allclose(p[2, -4], 0) + np.testing.assert_allclose(p[2, -3], 0) + np.testing.assert_allclose(p[2, -2], + assoc_legendre_p_2_m2(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[2, -1], + assoc_legendre_p_2_m1(z, branch_cut=branch_cut, norm=norm)) + + np.testing.assert_allclose(p[3, 0], + assoc_legendre_p_3_0(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[3, 1], + assoc_legendre_p_3_1(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[3, 2], + assoc_legendre_p_3_2(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[3, 3], + assoc_legendre_p_3_3(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[3, 4], 0) + np.testing.assert_allclose(p[3, -4], 0) + np.testing.assert_allclose(p[3, -3], + assoc_legendre_p_3_m3(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[3, -2], + assoc_legendre_p_3_m2(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[3, -1], + assoc_legendre_p_3_m1(z, branch_cut=branch_cut, norm=norm)) + + np.testing.assert_allclose(p[4, 0], + assoc_legendre_p_4_0(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[4, 1], + assoc_legendre_p_4_1(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[4, 2], + assoc_legendre_p_4_2(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[4, 3], + assoc_legendre_p_4_3(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[4, 4], + assoc_legendre_p_4_4(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[4, -4], + assoc_legendre_p_4_m4(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[4, -3], + assoc_legendre_p_4_m3(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[4, -2], + assoc_legendre_p_4_m2(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p[4, -1], + assoc_legendre_p_4_m1(z, branch_cut=branch_cut, norm=norm)) + + np.testing.assert_allclose(p_jac[0, 0], + assoc_legendre_p_0_0_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[0, 1], 0) + np.testing.assert_allclose(p_jac[0, 2], 0) + np.testing.assert_allclose(p_jac[0, 3], 0) + np.testing.assert_allclose(p_jac[0, 4], 0) + np.testing.assert_allclose(p_jac[0, -4], 0) + np.testing.assert_allclose(p_jac[0, -3], 0) + np.testing.assert_allclose(p_jac[0, -2], 0) + np.testing.assert_allclose(p_jac[0, -1], 0) + + np.testing.assert_allclose(p_jac[1, 0], + assoc_legendre_p_1_0_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[1, 1], + assoc_legendre_p_1_1_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[1, 2], 0) + np.testing.assert_allclose(p_jac[1, 3], 0) + np.testing.assert_allclose(p_jac[1, 4], 0) + np.testing.assert_allclose(p_jac[1, -4], 0) + np.testing.assert_allclose(p_jac[1, -3], 0) + np.testing.assert_allclose(p_jac[1, -2], 0) + np.testing.assert_allclose(p_jac[1, -1], + assoc_legendre_p_1_m1_jac(z, branch_cut=branch_cut, norm=norm)) + + np.testing.assert_allclose(p_jac[2, 0], + assoc_legendre_p_2_0_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[2, 1], + assoc_legendre_p_2_1_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[2, 2], + assoc_legendre_p_2_2_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[2, 3], 0) + np.testing.assert_allclose(p_jac[2, 4], 0) + np.testing.assert_allclose(p_jac[2, -4], 0) + np.testing.assert_allclose(p_jac[2, -3], 0) + np.testing.assert_allclose(p_jac[2, -2], + assoc_legendre_p_2_m2_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[2, -1], + assoc_legendre_p_2_m1_jac(z, branch_cut=branch_cut, norm=norm)) + + np.testing.assert_allclose(p_jac[3, 0], + assoc_legendre_p_3_0_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[3, 1], + assoc_legendre_p_3_1_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[3, 2], + assoc_legendre_p_3_2_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[3, 3], + assoc_legendre_p_3_3_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[3, 4], 0) + np.testing.assert_allclose(p_jac[3, -4], 0) + np.testing.assert_allclose(p_jac[3, -3], + assoc_legendre_p_3_m3_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[3, -2], + assoc_legendre_p_3_m2_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[3, -1], + assoc_legendre_p_3_m1_jac(z, branch_cut=branch_cut, norm=norm)) + + np.testing.assert_allclose(p_jac[4, 0], + assoc_legendre_p_4_0_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[4, 1], + assoc_legendre_p_4_1_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[4, 2], + assoc_legendre_p_4_2_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[4, 3], + assoc_legendre_p_4_3_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[4, 4], + assoc_legendre_p_4_4_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[4, -4], + assoc_legendre_p_4_m4_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[4, -3], + assoc_legendre_p_4_m3_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[4, -2], + assoc_legendre_p_4_m2_jac(z, branch_cut=branch_cut, norm=norm)) + np.testing.assert_allclose(p_jac[4, -1], + assoc_legendre_p_4_m1_jac(z, branch_cut=branch_cut, norm=norm)) + +class TestSphLegendreP: + @pytest.mark.parametrize("shape", [(10,), (4, 9), (3, 5, 7)]) + def test_specific(self, shape): + rng = np.random.default_rng(1234) + + theta = rng.uniform(-np.pi, np.pi, shape) + + p, p_jac = sph_legendre_p_all(4, 4, theta, diff_n=1) + + np.testing.assert_allclose(p[0, 0], + sph_legendre_p_0_0(theta)) + np.testing.assert_allclose(p[0, 1], 0) + np.testing.assert_allclose(p[0, 2], 0) + np.testing.assert_allclose(p[0, 3], 0) + np.testing.assert_allclose(p[0, 4], 0) + np.testing.assert_allclose(p[0, -3], 0) + np.testing.assert_allclose(p[0, -2], 0) + np.testing.assert_allclose(p[0, -1], 0) + + np.testing.assert_allclose(p[1, 0], + sph_legendre_p_1_0(theta)) + np.testing.assert_allclose(p[1, 1], + sph_legendre_p_1_1(theta)) + np.testing.assert_allclose(p[1, 2], 0) + np.testing.assert_allclose(p[1, 3], 0) + np.testing.assert_allclose(p[1, 4], 0) + np.testing.assert_allclose(p[1, -4], 0) + np.testing.assert_allclose(p[1, -3], 0) + np.testing.assert_allclose(p[1, -2], 0) + np.testing.assert_allclose(p[1, -1], + sph_legendre_p_1_m1(theta)) + + np.testing.assert_allclose(p[2, 0], + sph_legendre_p_2_0(theta)) + np.testing.assert_allclose(p[2, 1], + sph_legendre_p_2_1(theta)) + np.testing.assert_allclose(p[2, 2], + sph_legendre_p_2_2(theta)) + np.testing.assert_allclose(p[2, 3], 0) + np.testing.assert_allclose(p[2, 4], 0) + np.testing.assert_allclose(p[2, -4], 0) + np.testing.assert_allclose(p[2, -3], 0) + np.testing.assert_allclose(p[2, -2], + sph_legendre_p_2_m2(theta)) + np.testing.assert_allclose(p[2, -1], + sph_legendre_p_2_m1(theta)) + + np.testing.assert_allclose(p[3, 0], + sph_legendre_p_3_0(theta)) + np.testing.assert_allclose(p[3, 1], + sph_legendre_p_3_1(theta)) + np.testing.assert_allclose(p[3, 2], + sph_legendre_p_3_2(theta)) + np.testing.assert_allclose(p[3, 3], + sph_legendre_p_3_3(theta)) + np.testing.assert_allclose(p[3, 4], 0) + np.testing.assert_allclose(p[3, -4], 0) + np.testing.assert_allclose(p[3, -3], + sph_legendre_p_3_m3(theta)) + np.testing.assert_allclose(p[3, -2], + sph_legendre_p_3_m2(theta)) + np.testing.assert_allclose(p[3, -1], + sph_legendre_p_3_m1(theta)) + + np.testing.assert_allclose(p[4, 0], + sph_legendre_p_4_0(theta)) + np.testing.assert_allclose(p[4, 1], + sph_legendre_p_4_1(theta)) + np.testing.assert_allclose(p[4, 2], + sph_legendre_p_4_2(theta)) + np.testing.assert_allclose(p[4, 3], + sph_legendre_p_4_3(theta)) + np.testing.assert_allclose(p[4, 4], + sph_legendre_p_4_4(theta)) + np.testing.assert_allclose(p[4, -4], + sph_legendre_p_4_m4(theta)) + np.testing.assert_allclose(p[4, -3], + sph_legendre_p_4_m3(theta)) + np.testing.assert_allclose(p[4, -2], + sph_legendre_p_4_m2(theta)) + np.testing.assert_allclose(p[4, -1], + sph_legendre_p_4_m1(theta)) + + np.testing.assert_allclose(p_jac[0, 0], + sph_legendre_p_0_0_jac(theta)) + np.testing.assert_allclose(p_jac[0, 1], 0) + np.testing.assert_allclose(p_jac[0, 2], 0) + np.testing.assert_allclose(p_jac[0, 3], 0) + np.testing.assert_allclose(p_jac[0, 4], 0) + np.testing.assert_allclose(p_jac[0, -3], 0) + np.testing.assert_allclose(p_jac[0, -2], 0) + np.testing.assert_allclose(p_jac[0, -1], 0) + + np.testing.assert_allclose(p_jac[1, 0], + sph_legendre_p_1_0_jac(theta)) + np.testing.assert_allclose(p_jac[1, 1], + sph_legendre_p_1_1_jac(theta)) + np.testing.assert_allclose(p_jac[1, 2], 0) + np.testing.assert_allclose(p_jac[1, 3], 0) + np.testing.assert_allclose(p_jac[1, 4], 0) + np.testing.assert_allclose(p_jac[1, -4], 0) + np.testing.assert_allclose(p_jac[1, -3], 0) + np.testing.assert_allclose(p_jac[1, -2], 0) + np.testing.assert_allclose(p_jac[1, -1], + sph_legendre_p_1_m1_jac(theta)) + + np.testing.assert_allclose(p_jac[2, 0], + sph_legendre_p_2_0_jac(theta)) + np.testing.assert_allclose(p_jac[2, 1], + sph_legendre_p_2_1_jac(theta)) + np.testing.assert_allclose(p_jac[2, 2], + sph_legendre_p_2_2_jac(theta)) + np.testing.assert_allclose(p_jac[2, 3], 0) + np.testing.assert_allclose(p_jac[2, 4], 0) + np.testing.assert_allclose(p_jac[2, -4], 0) + np.testing.assert_allclose(p_jac[2, -3], 0) + np.testing.assert_allclose(p_jac[2, -2], + sph_legendre_p_2_m2_jac(theta)) + np.testing.assert_allclose(p_jac[2, -1], + sph_legendre_p_2_m1_jac(theta)) + + np.testing.assert_allclose(p_jac[3, 0], + sph_legendre_p_3_0_jac(theta)) + np.testing.assert_allclose(p_jac[3, 1], + sph_legendre_p_3_1_jac(theta)) + np.testing.assert_allclose(p_jac[3, 2], + sph_legendre_p_3_2_jac(theta)) + np.testing.assert_allclose(p_jac[3, 3], + sph_legendre_p_3_3_jac(theta)) + np.testing.assert_allclose(p_jac[3, 4], 0) + np.testing.assert_allclose(p_jac[3, -4], 0) + np.testing.assert_allclose(p_jac[3, -3], + sph_legendre_p_3_m3_jac(theta)) + np.testing.assert_allclose(p_jac[3, -2], + sph_legendre_p_3_m2_jac(theta)) + np.testing.assert_allclose(p_jac[3, -1], + sph_legendre_p_3_m1_jac(theta)) + + np.testing.assert_allclose(p_jac[4, 0], + sph_legendre_p_4_0_jac(theta)) + np.testing.assert_allclose(p_jac[4, 1], + sph_legendre_p_4_1_jac(theta)) + np.testing.assert_allclose(p_jac[4, 2], + sph_legendre_p_4_2_jac(theta)) + np.testing.assert_allclose(p_jac[4, 3], + sph_legendre_p_4_3_jac(theta)) + np.testing.assert_allclose(p_jac[4, 4], + sph_legendre_p_4_4_jac(theta)) + np.testing.assert_allclose(p_jac[4, -4], + sph_legendre_p_4_m4_jac(theta)) + np.testing.assert_allclose(p_jac[4, -3], + sph_legendre_p_4_m3_jac(theta)) + np.testing.assert_allclose(p_jac[4, -2], + sph_legendre_p_4_m2_jac(theta)) + np.testing.assert_allclose(p_jac[4, -1], + sph_legendre_p_4_m1_jac(theta)) + + @pytest.mark.parametrize("shape", [(10,), (4, 9), (3, 5, 7, 10)]) + def test_ode(self, shape): + rng = np.random.default_rng(1234) + + n = rng.integers(0, 10, shape) + m = rng.integers(-10, 10, shape) + theta = rng.uniform(-np.pi, np.pi, shape) + + p, p_jac, p_hess = sph_legendre_p(n, m, theta, diff_n=2) + + assert p.shape == shape + assert p_jac.shape == p.shape + assert p_hess.shape == p_jac.shape + + np.testing.assert_allclose(np.sin(theta) * p_hess, -np.cos(theta) * p_jac + - (n * (n + 1) * np.sin(theta) - m * m / np.sin(theta)) * p, + rtol=1e-05, atol=1e-08) + +class TestLegendreFunctions: + def test_clpmn(self): + z = 0.5+0.3j + + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + clp = special.clpmn(2, 2, z, 3) + + assert_array_almost_equal(clp, + (np.array([[1.0000, z, 0.5*(3*z*z-1)], + [0.0000, np.sqrt(z*z-1), 3*z*np.sqrt(z*z-1)], + [0.0000, 0.0000, 3*(z*z-1)]]), + np.array([[0.0000, 1.0000, 3*z], + [0.0000, z/np.sqrt(z*z-1), 3*(2*z*z-1)/np.sqrt(z*z-1)], + [0.0000, 0.0000, 6*z]])), + 7) + + def test_clpmn_close_to_real_2(self): + eps = 1e-10 + m = 1 + n = 3 + x = 0.5 + + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + clp_plus = special.clpmn(m, n, x+1j*eps, 2)[0][m, n] + clp_minus = special.clpmn(m, n, x-1j*eps, 2)[0][m, n] + + assert_array_almost_equal(np.array([clp_plus, clp_minus]), + np.array([special.lpmv(m, n, x), + special.lpmv(m, n, x)]), + 7) + + def test_clpmn_close_to_real_3(self): + eps = 1e-10 + m = 1 + n = 3 + x = 0.5 + + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + clp_plus = special.clpmn(m, n, x+1j*eps, 3)[0][m, n] + clp_minus = special.clpmn(m, n, x-1j*eps, 3)[0][m, n] + + assert_array_almost_equal(np.array([clp_plus, clp_minus]), + np.array([special.lpmv(m, n, x)*np.exp(-0.5j*m*np.pi), + special.lpmv(m, n, x)*np.exp(0.5j*m*np.pi)]), + 7) + + def test_clpmn_across_unit_circle(self): + eps = 1e-7 + m = 1 + n = 1 + x = 1j + + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + for type in [2, 3]: + assert_almost_equal(special.clpmn(m, n, x+1j*eps, type)[0][m, n], + special.clpmn(m, n, x-1j*eps, type)[0][m, n], 6) + + def test_inf(self): + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + for z in (1, -1): + for n in range(4): + for m in range(1, n): + lp = special.clpmn(m, n, z) + assert np.isinf(lp[1][1,1:]).all() + lp = special.lpmn(m, n, z) + assert np.isinf(lp[1][1,1:]).all() + + def test_deriv_clpmn(self): + # data inside and outside of the unit circle + zvals = [0.5+0.5j, -0.5+0.5j, -0.5-0.5j, 0.5-0.5j, + 1+1j, -1+1j, -1-1j, 1-1j] + m = 2 + n = 3 + + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + for type in [2, 3]: + for z in zvals: + for h in [1e-3, 1e-3j]: + approx_derivative = (special.clpmn(m, n, z+0.5*h, type)[0] + - special.clpmn(m, n, z-0.5*h, type)[0])/h + assert_allclose(special.clpmn(m, n, z, type)[1], + approx_derivative, + rtol=1e-4) + + """ + @pytest.mark.parametrize("m_max", [3]) + @pytest.mark.parametrize("n_max", [5]) + @pytest.mark.parametrize("z", [-1]) + def test_clpmn_all_limits(self, m_max, n_max, z): + rng = np.random.default_rng(1234) + + type = 2 + + p, p_jac = special.clpmn_all(m_max, n_max, type, z, diff_n=1) + + n = np.arange(n_max + 1) + + np.testing.assert_allclose(p_jac[0], pow(z, n + 1) * n * (n + 1) / 2) + np.testing.assert_allclose(p_jac[1], np.where(n >= 1, pow(z, n) * np.inf, 0)) + np.testing.assert_allclose(p_jac[2], np.where(n >= 2, + -pow(z, n + 1) * (n + 2) * (n + 1) * n * (n - 1) / 4, 0)) + np.testing.assert_allclose(p_jac[-2], np.where(n >= 2, -pow(z, n + 1) / 4, 0)) + np.testing.assert_allclose(p_jac[-1], np.where(n >= 1, -pow(z, n) * np.inf, 0)) + + for m in range(3, m_max + 1): + np.testing.assert_allclose(p_jac[m], 0) + np.testing.assert_allclose(p_jac[-m], 0) + """ + + def test_lpmv(self): + lp = special.lpmv(0,2,.5) + assert_almost_equal(lp,-0.125,7) + lp = special.lpmv(0,40,.001) + assert_almost_equal(lp,0.1252678976534484,7) + + # XXX: this is outside the domain of the current implementation, + # so ensure it returns a NaN rather than a wrong answer. + with np.errstate(all='ignore'): + lp = special.lpmv(-1,-1,.001) + assert lp != 0 or np.isnan(lp) + + def test_lqmn(self): + lqmnf = special.lqmn(0,2,.5) + lqf = special.lqn(2,.5) + assert_array_almost_equal(lqmnf[0][0],lqf[0],4) + assert_array_almost_equal(lqmnf[1][0],lqf[1],4) + + def test_lqmn_gt1(self): + """algorithm for real arguments changes at 1.0001 + test against analytical result for m=2, n=1 + """ + x0 = 1.0001 + delta = 0.00002 + for x in (x0-delta, x0+delta): + lq = special.lqmn(2, 1, x)[0][-1, -1] + expected = 2/(x*x-1) + assert_almost_equal(lq, expected) + + def test_lqmn_shape(self): + a, b = special.lqmn(4, 4, 1.1) + assert_equal(a.shape, (5, 5)) + assert_equal(b.shape, (5, 5)) + + a, b = special.lqmn(4, 0, 1.1) + assert_equal(a.shape, (5, 1)) + assert_equal(b.shape, (5, 1)) + + def test_lqn(self): + lqf = special.lqn(2,.5) + assert_array_almost_equal(lqf,(np.array([0.5493, -0.7253, -0.8187]), + np.array([1.3333, 1.216, -0.8427])),4) + + @pytest.mark.parametrize("function", [special.lpn, special.lqn]) + @pytest.mark.parametrize("n", [1, 2, 4, 8, 16, 32]) + @pytest.mark.parametrize("z_complex", [False, True]) + @pytest.mark.parametrize("z_inexact", [False, True]) + @pytest.mark.parametrize( + "input_shape", + [ + (), (1, ), (2, ), (2, 1), (1, 2), (2, 2), (2, 2, 1), (2, 2, 2) + ] + ) + def test_array_inputs_lxn(self, function, n, z_complex, z_inexact, input_shape): + """Tests for correct output shapes.""" + rng = np.random.default_rng(1234) + if z_inexact: + z = rng.integers(-3, 3, size=input_shape) + else: + z = rng.uniform(-1, 1, size=input_shape) + + if z_complex: + z = 1j * z + 0.5j * z + + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + P_z, P_d_z = function(n, z) + assert P_z.shape == (n + 1, ) + input_shape + assert P_d_z.shape == (n + 1, ) + input_shape + + @pytest.mark.parametrize("function", [special.lqmn]) + @pytest.mark.parametrize( + "m,n", + [(0, 1), (1, 2), (1, 4), (3, 8), (11, 16), (19, 32)] + ) + @pytest.mark.parametrize("z_inexact", [False, True]) + @pytest.mark.parametrize( + "input_shape", [ + (), (1, ), (2, ), (2, 1), (1, 2), (2, 2), (2, 2, 1) + ] + ) + def test_array_inputs_lxmn(self, function, m, n, z_inexact, input_shape): + """Tests for correct output shapes and dtypes.""" + rng = np.random.default_rng(1234) + if z_inexact: + z = rng.integers(-3, 3, size=input_shape) + else: + z = rng.uniform(-1, 1, size=input_shape) + + P_z, P_d_z = function(m, n, z) + assert P_z.shape == (m + 1, n + 1) + input_shape + assert P_d_z.shape == (m + 1, n + 1) + input_shape + + @pytest.mark.parametrize("function", [special.clpmn, special.lqmn]) + @pytest.mark.parametrize( + "m,n", + [(0, 1), (1, 2), (1, 4), (3, 8), (11, 16), (19, 32)] + ) + @pytest.mark.parametrize( + "input_shape", [ + (), (1, ), (2, ), (2, 1), (1, 2), (2, 2), (2, 2, 1) + ] + ) + def test_array_inputs_clxmn(self, function, m, n, input_shape): + """Tests for correct output shapes and dtypes.""" + rng = np.random.default_rng(1234) + z = rng.uniform(-1, 1, size=input_shape) + z = 1j * z + 0.5j * z + + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + P_z, P_d_z = function(m, n, z) + + assert P_z.shape == (m + 1, n + 1) + input_shape + assert P_d_z.shape == (m + 1, n + 1) + input_shape + +def assoc_legendre_factor(n, m, norm): + if norm: + return (math.sqrt((2 * n + 1) * + math.factorial(n - m) / (2 * math.factorial(n + m)))) + + return 1 + +def assoc_legendre_p_0_0(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(0, 0, norm) + + return np.full_like(z, fac) + +def assoc_legendre_p_1_0(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(1, 0, norm) + + return fac * z + +def assoc_legendre_p_1_1(z, *, branch_cut=2, norm=False): + branch_sign = np.where(branch_cut == 3, np.where(np.signbit(np.real(z)), 1, -1), -1) + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(1, 1, norm) + + w = np.sqrt(np.where(branch_cut == 3, z * z - 1, 1 - z * z)) + + return branch_cut_sign * branch_sign * fac * w + +def assoc_legendre_p_1_m1(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(1, -1, norm) + + return (-branch_cut_sign * fac * + assoc_legendre_p_1_1(z, branch_cut=branch_cut) / 2) + +def assoc_legendre_p_2_0(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(2, 0, norm) + + return fac * (3 * z * z - 1) / 2 + +def assoc_legendre_p_2_1(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(2, 1, norm) + + return (3 * fac * z * + assoc_legendre_p_1_1(z, branch_cut=branch_cut)) + +def assoc_legendre_p_2_2(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(2, 2, norm) + + return 3 * branch_cut_sign * fac * (1 - z * z) + +def assoc_legendre_p_2_m2(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(2, -2, norm) + + return branch_cut_sign * fac * (1 - z * z) / 8 + +def assoc_legendre_p_2_m1(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(2, -1, norm) + + return (-branch_cut_sign * fac * z * + assoc_legendre_p_1_1(z, branch_cut=branch_cut) / 2) + +def assoc_legendre_p_3_0(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(3, 0, norm) + + return fac * (5 * z * z - 3) * z / 2 + +def assoc_legendre_p_3_1(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(3, 1, norm) + + return (3 * fac * (5 * z * z - 1) * + assoc_legendre_p_1_1(z, branch_cut=branch_cut) / 2) + +def assoc_legendre_p_3_2(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(3, 2, norm) + + return 15 * branch_cut_sign * fac * (1 - z * z) * z + +def assoc_legendre_p_3_3(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(3, 3, norm) + + return (15 * branch_cut_sign * fac * (1 - z * z) * + assoc_legendre_p_1_1(z, branch_cut=branch_cut)) + +def assoc_legendre_p_3_m3(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(3, -3, norm) + + return (fac * (z * z - 1) * + assoc_legendre_p_1_1(z, branch_cut=branch_cut) / 48) + +def assoc_legendre_p_3_m2(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(3, -2, norm) + + return branch_cut_sign * fac * (1 - z * z) * z / 8 + +def assoc_legendre_p_3_m1(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(3, -1, norm) + + return (branch_cut_sign * fac * (1 - 5 * z * z) * + assoc_legendre_p_1_1(z, branch_cut=branch_cut) / 8) + +def assoc_legendre_p_4_0(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, 0, norm) + + return fac * ((35 * z * z - 30) * z * z + 3) / 8 + +def assoc_legendre_p_4_1(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, 1, norm) + + return (5 * fac * (7 * z * z - 3) * z * + assoc_legendre_p_1_1(z, branch_cut=branch_cut) / 2) + +def assoc_legendre_p_4_2(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(4, 2, norm) + + return 15 * branch_cut_sign * fac * ((8 - 7 * z * z) * z * z - 1) / 2 + +def assoc_legendre_p_4_3(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(4, 3, norm) + + return (105 * branch_cut_sign * fac * (1 - z * z) * z * + assoc_legendre_p_1_1(z, branch_cut=branch_cut)) + +def assoc_legendre_p_4_4(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, 4, norm) + + return 105 * fac * np.square(z * z - 1) + +def assoc_legendre_p_4_m4(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, -4, norm) + + return fac * np.square(z * z - 1) / 384 + +def assoc_legendre_p_4_m3(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, -3, norm) + + return (fac * (z * z - 1) * z * + assoc_legendre_p_1_1(z, branch_cut=branch_cut) / 48) + +def assoc_legendre_p_4_m2(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(4, -2, norm) + + return branch_cut_sign * fac * ((8 - 7 * z * z) * z * z - 1) / 48 + +def assoc_legendre_p_4_m1(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(4, -1, norm) + + return (branch_cut_sign * fac * (3 - 7 * z * z) * z * + assoc_legendre_p_1_1(z, branch_cut=branch_cut) / 8) + +def assoc_legendre_p_1_1_jac_div_z(z, branch_cut=2): + branch_sign = np.where(branch_cut == 3, np.where(np.signbit(np.real(z)), 1, -1), -1) + + out11_div_z = (-branch_sign / + np.sqrt(np.where(branch_cut == 3, z * z - 1, 1 - z * z))) + + return out11_div_z + +def assoc_legendre_p_0_0_jac(z, *, branch_cut=2, norm=False): + return np.zeros_like(z) + +def assoc_legendre_p_1_0_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(1, 0, norm) + + return np.full_like(z, fac) + +def assoc_legendre_p_1_1_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(1, 1, norm) + + return (fac * z * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut)) + +def assoc_legendre_p_1_m1_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(1, -1, norm) + + return (-branch_cut_sign * fac * z * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut) / 2) + +def assoc_legendre_p_2_0_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(2, 0, norm) + + return 3 * fac * z + +def assoc_legendre_p_2_1_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(2, 1, norm) + + return (3 * fac * (2 * z * z - 1) * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut)) + +def assoc_legendre_p_2_2_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(2, 2, norm) + + return -6 * branch_cut_sign * fac * z + +def assoc_legendre_p_2_m1_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(2, -1, norm) + + return (branch_cut_sign * fac * (1 - 2 * z * z) * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut) / 2) + +def assoc_legendre_p_2_m2_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(2, -2, norm) + + return -branch_cut_sign * fac * z / 4 + +def assoc_legendre_p_3_0_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(3, 0, norm) + + return 3 * fac * (5 * z * z - 1) / 2 + +def assoc_legendre_p_3_1_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(3, 1, norm) + + return (3 * fac * (15 * z * z - 11) * z * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut) / 2) + +def assoc_legendre_p_3_2_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(3, 2, norm) + + return 15 * branch_cut_sign * fac * (1 - 3 * z * z) + +def assoc_legendre_p_3_3_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(3, 3, norm) + + return (45 * branch_cut_sign * fac * (1 - z * z) * z * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut)) + +def assoc_legendre_p_3_m3_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(3, -3, norm) + + return (fac * (z * z - 1) * z * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut) / 16) + +def assoc_legendre_p_3_m2_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(3, -2, norm) + + return branch_cut_sign * fac * (1 - 3 * z * z) / 8 + +def assoc_legendre_p_3_m1_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(3, -1, norm) + + return (branch_cut_sign * fac * (11 - 15 * z * z) * z * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut) / 8) + +def assoc_legendre_p_4_0_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, 0, norm) + + return 5 * fac * (7 * z * z - 3) * z / 2 + +def assoc_legendre_p_4_1_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, 1, norm) + + return (5 * fac * ((28 * z * z - 27) * z * z + 3) * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut) / 2) + +def assoc_legendre_p_4_2_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(4, 2, norm) + + return 30 * branch_cut_sign * fac * (4 - 7 * z * z) * z + +def assoc_legendre_p_4_3_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(4, 3, norm) + + return (105 * branch_cut_sign * fac * ((5 - 4 * z * z) * z * z - 1) * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut)) + +def assoc_legendre_p_4_4_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, 4, norm) + + return 420 * fac * (z * z - 1) * z + +def assoc_legendre_p_4_m4_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, -4, norm) + + return fac * (z * z - 1) * z / 96 + +def assoc_legendre_p_4_m3_jac(z, *, branch_cut=2, norm=False): + fac = assoc_legendre_factor(4, -3, norm) + + return (fac * ((4 * z * z - 5) * z * z + 1) * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut) / 48) + +def assoc_legendre_p_4_m2_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(4, -2, norm) + + return branch_cut_sign * fac * (4 - 7 * z * z) * z / 12 + +def assoc_legendre_p_4_m1_jac(z, *, branch_cut=2, norm=False): + branch_cut_sign = np.where(branch_cut == 3, -1, 1) + fac = assoc_legendre_factor(4, -1, norm) + + return (branch_cut_sign * fac * ((27 - 28 * z * z) * z * z - 3) * + assoc_legendre_p_1_1_jac_div_z(z, branch_cut=branch_cut) / 8) + +def sph_legendre_factor(n, m): + return assoc_legendre_factor(n, m, norm=True) / np.sqrt(2 * np.pi) + +def sph_legendre_p_0_0(theta): + fac = sph_legendre_factor(0, 0) + + return np.full_like(theta, fac) + +def sph_legendre_p_1_0(theta): + fac = sph_legendre_factor(1, 0) + + return fac * np.cos(theta) + +def sph_legendre_p_1_1(theta): + fac = sph_legendre_factor(1, 1) + + return -fac * np.abs(np.sin(theta)) + +def sph_legendre_p_1_m1(theta): + fac = sph_legendre_factor(1, -1) + + return fac * np.abs(np.sin(theta)) / 2 + +def sph_legendre_p_2_0(theta): + fac = sph_legendre_factor(2, 0) + + return fac * (3 * np.square(np.cos(theta)) - 1) / 2 + +def sph_legendre_p_2_1(theta): + fac = sph_legendre_factor(2, 1) + + return -3 * fac * np.abs(np.sin(theta)) * np.cos(theta) + +def sph_legendre_p_2_2(theta): + fac = sph_legendre_factor(2, 2) + + return 3 * fac * (1 - np.square(np.cos(theta))) + +def sph_legendre_p_2_m2(theta): + fac = sph_legendre_factor(2, -2) + + return fac * (1 - np.square(np.cos(theta))) / 8 + +def sph_legendre_p_2_m1(theta): + fac = sph_legendre_factor(2, -1) + + return fac * np.cos(theta) * np.abs(np.sin(theta)) / 2 + +def sph_legendre_p_3_0(theta): + fac = sph_legendre_factor(3, 0) + + return (fac * (5 * np.square(np.cos(theta)) - 3) * + np.cos(theta) / 2) + +def sph_legendre_p_3_1(theta): + fac = sph_legendre_factor(3, 1) + + return (-3 * fac * (5 * np.square(np.cos(theta)) - 1) * + np.abs(np.sin(theta)) / 2) + +def sph_legendre_p_3_2(theta): + fac = sph_legendre_factor(3, 2) + + return (-15 * fac * (np.square(np.cos(theta)) - 1) * + np.cos(theta)) + +def sph_legendre_p_3_3(theta): + fac = sph_legendre_factor(3, 3) + + return -15 * fac * np.power(np.abs(np.sin(theta)), 3) + +def sph_legendre_p_3_m3(theta): + fac = sph_legendre_factor(3, -3) + + return fac * np.power(np.abs(np.sin(theta)), 3) / 48 + +def sph_legendre_p_3_m2(theta): + fac = sph_legendre_factor(3, -2) + + return (-fac * (np.square(np.cos(theta)) - 1) * + np.cos(theta) / 8) + +def sph_legendre_p_3_m1(theta): + fac = sph_legendre_factor(3, -1) + + return (fac * (5 * np.square(np.cos(theta)) - 1) * + np.abs(np.sin(theta)) / 8) + +def sph_legendre_p_4_0(theta): + fac = sph_legendre_factor(4, 0) + + return (fac * (35 * np.square(np.square(np.cos(theta))) - + 30 * np.square(np.cos(theta)) + 3) / 8) + +def sph_legendre_p_4_1(theta): + fac = sph_legendre_factor(4, 1) + + return (-5 * fac * (7 * np.square(np.cos(theta)) - 3) * + np.cos(theta) * np.abs(np.sin(theta)) / 2) + +def sph_legendre_p_4_2(theta): + fac = sph_legendre_factor(4, 2) + + return (-15 * fac * (7 * np.square(np.cos(theta)) - 1) * + (np.square(np.cos(theta)) - 1) / 2) + +def sph_legendre_p_4_3(theta): + fac = sph_legendre_factor(4, 3) + + return -105 * fac * np.power(np.abs(np.sin(theta)), 3) * np.cos(theta) + +def sph_legendre_p_4_4(theta): + fac = sph_legendre_factor(4, 4) + + return 105 * fac * np.square(np.square(np.cos(theta)) - 1) + +def sph_legendre_p_4_m4(theta): + fac = sph_legendre_factor(4, -4) + + return fac * np.square(np.square(np.cos(theta)) - 1) / 384 + +def sph_legendre_p_4_m3(theta): + fac = sph_legendre_factor(4, -3) + + return (fac * np.power(np.abs(np.sin(theta)), 3) * + np.cos(theta) / 48) + +def sph_legendre_p_4_m2(theta): + fac = sph_legendre_factor(4, -2) + + return (-fac * (7 * np.square(np.cos(theta)) - 1) * + (np.square(np.cos(theta)) - 1) / 48) + +def sph_legendre_p_4_m1(theta): + fac = sph_legendre_factor(4, -1) + + return (fac * (7 * np.square(np.cos(theta)) - 3) * + np.cos(theta) * np.abs(np.sin(theta)) / 8) + +def sph_legendre_p_0_0_jac(theta): + return np.zeros_like(theta) + +def sph_legendre_p_1_0_jac(theta): + fac = sph_legendre_factor(1, 0) + + return -fac * np.sin(theta) + +def sph_legendre_p_1_1_jac(theta): + fac = sph_legendre_factor(1, 1) + + return -fac * np.cos(theta) * (2 * np.heaviside(np.sin(theta), 1) - 1) + +def sph_legendre_p_1_m1_jac(theta): + fac = sph_legendre_factor(1, -1) + + return fac * np.cos(theta) * (2 * np.heaviside(np.sin(theta), 1) - 1) / 2 + +def sph_legendre_p_2_0_jac(theta): + fac = sph_legendre_factor(2, 0) + + return -3 * fac * np.cos(theta) * np.sin(theta) + +def sph_legendre_p_2_1_jac(theta): + fac = sph_legendre_factor(2, 1) + + return (3 * fac * (-np.square(np.cos(theta)) * + (2 * np.heaviside(np.sin(theta), 1) - 1) + + np.abs(np.sin(theta)) * np.sin(theta))) + +def sph_legendre_p_2_2_jac(theta): + fac = sph_legendre_factor(2, 2) + + return 6 * fac * np.sin(theta) * np.cos(theta) + +def sph_legendre_p_2_m2_jac(theta): + fac = sph_legendre_factor(2, -2) + + return fac * np.sin(theta) * np.cos(theta) / 4 + +def sph_legendre_p_2_m1_jac(theta): + fac = sph_legendre_factor(2, -1) + + return (-fac * (-np.square(np.cos(theta)) * + (2 * np.heaviside(np.sin(theta), 1) - 1) + + np.abs(np.sin(theta)) * np.sin(theta)) / 2) + +def sph_legendre_p_3_0_jac(theta): + fac = sph_legendre_factor(3, 0) + + return 3 * fac * (1 - 5 * np.square(np.cos(theta))) * np.sin(theta) / 2 + +def sph_legendre_p_3_1_jac(theta): + fac = sph_legendre_factor(3, 1) + + return (3 * fac * (11 - 15 * np.square(np.cos(theta))) * np.cos(theta) * + (2 * np.heaviside(np.sin(theta), 1) - 1) / 2) + +def sph_legendre_p_3_2_jac(theta): + fac = sph_legendre_factor(3, 2) + + return 15 * fac * (3 * np.square(np.cos(theta)) - 1) * np.sin(theta) + +def sph_legendre_p_3_3_jac(theta): + fac = sph_legendre_factor(3, 3) + + return -45 * fac * np.abs(np.sin(theta)) * np.sin(theta) * np.cos(theta) + +def sph_legendre_p_3_m3_jac(theta): + fac = sph_legendre_factor(3, -3) + + return fac * np.abs(np.sin(theta)) * np.sin(theta) * np.cos(theta) / 16 + +def sph_legendre_p_3_m2_jac(theta): + fac = sph_legendre_factor(3, -2) + + return fac * (3 * np.square(np.cos(theta)) - 1) * np.sin(theta) / 8 + +def sph_legendre_p_3_m1_jac(theta): + fac = sph_legendre_factor(3, -1) + + return (-fac * (11 - 15 * np.square(np.cos(theta))) * + np.cos(theta) * + (2 * np.heaviside(np.sin(theta), 1) - 1) / 8) + +def sph_legendre_p_4_0_jac(theta): + fac = sph_legendre_factor(4, 0) + + return (-5 * fac * (7 * np.square(np.cos(theta)) - 3) * + np.sin(theta) * np.cos(theta) / 2) + +def sph_legendre_p_4_1_jac(theta): + fac = sph_legendre_factor(4, 1) + + return (5 * fac * (-3 + 27 * np.square(np.cos(theta)) - + 28 * np.square(np.square(np.cos(theta)))) * + (2 * np.heaviside(np.sin(theta), 1) - 1) / 2) + +def sph_legendre_p_4_2_jac(theta): + fac = sph_legendre_factor(4, 2) + + return (30 * fac * (7 * np.square(np.cos(theta)) - 4) * + np.sin(theta) * np.cos(theta)) + +def sph_legendre_p_4_3_jac(theta): + fac = sph_legendre_factor(4, 3) + + return (-105 * fac * (4 * np.square(np.cos(theta)) - 1) * + np.abs(np.sin(theta)) * np.sin(theta)) + +def sph_legendre_p_4_4_jac(theta): + fac = sph_legendre_factor(4, 4) + + return (-420 * fac * (np.square(np.cos(theta)) - 1) * + np.sin(theta) * np.cos(theta)) + +def sph_legendre_p_4_m4_jac(theta): + fac = sph_legendre_factor(4, -4) + + return (-fac * (np.square(np.cos(theta)) - 1) * + np.sin(theta) * np.cos(theta) / 96) + +def sph_legendre_p_4_m3_jac(theta): + fac = sph_legendre_factor(4, -3) + + return (fac * (4 * np.square(np.cos(theta)) - 1) * + np.abs(np.sin(theta)) * np.sin(theta) / 48) + +def sph_legendre_p_4_m2_jac(theta): + fac = sph_legendre_factor(4, -2) + + return (fac * (7 * np.square(np.cos(theta)) - 4) * np.sin(theta) * + np.cos(theta) / 12) + +def sph_legendre_p_4_m1_jac(theta): + fac = sph_legendre_factor(4, -1) + + return (-fac * (-3 + 27 * np.square(np.cos(theta)) - + 28 * np.square(np.square(np.cos(theta)))) * + (2 * np.heaviside(np.sin(theta), 1) - 1) / 8) diff --git a/shared/package-files/9d/9dda7f279571ba5e1cb2af501e8e1ca509cacef5c57c83de5ab2a94ad8e4f8c6/blob b/shared/package-files/9d/9dda7f279571ba5e1cb2af501e8e1ca509cacef5c57c83de5ab2a94ad8e4f8c6/blob new file mode 100644 index 0000000000000000000000000000000000000000..6cc44cb8005c1a6290fe94d28041f15f9dad38e7 --- /dev/null +++ b/shared/package-files/9d/9dda7f279571ba5e1cb2af501e8e1ca509cacef5c57c83de5ab2a94ad8e4f8c6/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API ::std::tuple _embedding_bag_forward_only_out(at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, at::Tensor & out3, const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, bool scale_grad_by_freq=false, int64_t mode=0, bool sparse=false, const c10::optional & per_sample_weights={}, bool include_last_offset=false, int64_t padding_idx=-1); +TORCH_API ::std::tuple _embedding_bag_forward_only_outf(const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, bool scale_grad_by_freq, int64_t mode, bool sparse, const c10::optional & per_sample_weights, bool include_last_offset, int64_t padding_idx, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, at::Tensor & out3); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9d/9ddc4eb12e177eb678518ffd9ea4530a7c6193381da9cb941cbf277b377b3a9e/blob b/shared/package-files/9d/9ddc4eb12e177eb678518ffd9ea4530a7c6193381da9cb941cbf277b377b3a9e/blob new file mode 100644 index 0000000000000000000000000000000000000000..c1d4cdff8fd0b7e9cb9b539d9a49f3374a098a11 --- /dev/null +++ b/shared/package-files/9d/9ddc4eb12e177eb678518ffd9ea4530a7c6193381da9cb941cbf277b377b3a9e/blob @@ -0,0 +1,200 @@ +#!/usr/bin/env python3 +"""Prints type-coercion tables for the built-in NumPy types + +""" +import numpy as np +from collections import namedtuple + +# Generic object that can be added, but doesn't do anything else +class GenericObject: + def __init__(self, v): + self.v = v + + def __add__(self, other): + return self + + def __radd__(self, other): + return self + + dtype = np.dtype('O') + +def print_cancast_table(ntypes): + print('X', end=' ') + for char in ntypes: + print(char, end=' ') + print() + for row in ntypes: + print(row, end=' ') + for col in ntypes: + if np.can_cast(row, col, "equiv"): + cast = "#" + elif np.can_cast(row, col, "safe"): + cast = "=" + elif np.can_cast(row, col, "same_kind"): + cast = "~" + elif np.can_cast(row, col, "unsafe"): + cast = "." + else: + cast = " " + print(cast, end=' ') + print() + +def print_coercion_table(ntypes, inputfirstvalue, inputsecondvalue, firstarray, use_promote_types=False): + print('+', end=' ') + for char in ntypes: + print(char, end=' ') + print() + for row in ntypes: + if row == 'O': + rowtype = GenericObject + else: + rowtype = np.obj2sctype(row) + + print(row, end=' ') + for col in ntypes: + if col == 'O': + coltype = GenericObject + else: + coltype = np.obj2sctype(col) + try: + if firstarray: + rowvalue = np.array([rowtype(inputfirstvalue)], dtype=rowtype) + else: + rowvalue = rowtype(inputfirstvalue) + colvalue = coltype(inputsecondvalue) + if use_promote_types: + char = np.promote_types(rowvalue.dtype, colvalue.dtype).char + else: + value = np.add(rowvalue, colvalue) + if isinstance(value, np.ndarray): + char = value.dtype.char + else: + char = np.dtype(type(value)).char + except ValueError: + char = '!' + except OverflowError: + char = '@' + except TypeError: + char = '#' + print(char, end=' ') + print() + + +def print_new_cast_table(*, can_cast=True, legacy=False, flags=False): + """Prints new casts, the values given are default "can-cast" values, not + actual ones. + """ + from numpy.core._multiarray_tests import get_all_cast_information + + cast_table = { + -1: " ", + 0: "#", # No cast (classify as equivalent here) + 1: "#", # equivalent casting + 2: "=", # safe casting + 3: "~", # same-kind casting + 4: ".", # unsafe casting + } + flags_table = { + 0 : "▗", 7: "█", + 1: "▚", 2: "▐", 4: "▄", + 3: "▜", 5: "▙", + 6: "▟", + } + + cast_info = namedtuple("cast_info", ["can_cast", "legacy", "flags"]) + no_cast_info = cast_info(" ", " ", " ") + + casts = get_all_cast_information() + table = {} + dtypes = set() + for cast in casts: + dtypes.add(cast["from"]) + dtypes.add(cast["to"]) + + if cast["from"] not in table: + table[cast["from"]] = {} + to_dict = table[cast["from"]] + + can_cast = cast_table[cast["casting"]] + legacy = "L" if cast["legacy"] else "." + flags = 0 + if cast["requires_pyapi"]: + flags |= 1 + if cast["supports_unaligned"]: + flags |= 2 + if cast["no_floatingpoint_errors"]: + flags |= 4 + + flags = flags_table[flags] + to_dict[cast["to"]] = cast_info(can_cast=can_cast, legacy=legacy, flags=flags) + + # The np.dtype(x.type) is a bit strange, because dtype classes do + # not expose much yet. + types = np.typecodes["All"] + def sorter(x): + # This is a bit weird hack, to get a table as close as possible to + # the one printing all typecodes (but expecting user-dtypes). + dtype = np.dtype(x.type) + try: + indx = types.index(dtype.char) + except ValueError: + indx = np.inf + return (indx, dtype.char) + + dtypes = sorted(dtypes, key=sorter) + + def print_table(field="can_cast"): + print('X', end=' ') + for dt in dtypes: + print(np.dtype(dt.type).char, end=' ') + print() + for from_dt in dtypes: + print(np.dtype(from_dt.type).char, end=' ') + row = table.get(from_dt, {}) + for to_dt in dtypes: + print(getattr(row.get(to_dt, no_cast_info), field), end=' ') + print() + + if can_cast: + # Print the actual table: + print() + print("Casting: # is equivalent, = is safe, ~ is same-kind, and . is unsafe") + print() + print_table("can_cast") + + if legacy: + print() + print("L denotes a legacy cast . a non-legacy one.") + print() + print_table("legacy") + + if flags: + print() + print(f"{flags_table[0]}: no flags, {flags_table[1]}: PyAPI, " + f"{flags_table[2]}: supports unaligned, {flags_table[4]}: no-float-errors") + print() + print_table("flags") + + +if __name__ == '__main__': + print("can cast") + print_cancast_table(np.typecodes['All']) + print() + print("In these tables, ValueError is '!', OverflowError is '@', TypeError is '#'") + print() + print("scalar + scalar") + print_coercion_table(np.typecodes['All'], 0, 0, False) + print() + print("scalar + neg scalar") + print_coercion_table(np.typecodes['All'], 0, -1, False) + print() + print("array + scalar") + print_coercion_table(np.typecodes['All'], 0, 0, True) + print() + print("array + neg scalar") + print_coercion_table(np.typecodes['All'], 0, -1, True) + print() + print("promote_types") + print_coercion_table(np.typecodes['All'], 0, 0, False, True) + print("New casting type promotion:") + print_new_cast_table(can_cast=True, legacy=True, flags=True) diff --git a/shared/package-files/9d/9de11d71f2d9a072f06deaffd57cab9f6e8b717cb432b4ad6b4dd97bb68a6ba8/blob b/shared/package-files/9d/9de11d71f2d9a072f06deaffd57cab9f6e8b717cb432b4ad6b4dd97bb68a6ba8/blob new file mode 100644 index 0000000000000000000000000000000000000000..416a20f5e11b14b1da34e2bfb45c7961edc9097c --- /dev/null +++ b/shared/package-files/9d/9de11d71f2d9a072f06deaffd57cab9f6e8b717cb432b4ad6b4dd97bb68a6ba8/blob @@ -0,0 +1,95 @@ +""" +Module defining global singleton classes. + +This module raises a RuntimeError if an attempt to reload it is made. In that +way the identities of the classes defined here are fixed and will remain so +even if numpy itself is reloaded. In particular, a function like the following +will still work correctly after numpy is reloaded:: + + def foo(arg=np._NoValue): + if arg is np._NoValue: + ... + +That was not the case when the singleton classes were defined in the numpy +``__init__.py`` file. See gh-7844 for a discussion of the reload problem that +motivated this module. + +""" +import enum + +from ._utils import set_module as _set_module + +__all__ = ['_NoValue', '_CopyMode'] + + +# Disallow reloading this module so as to preserve the identities of the +# classes defined here. +if '_is_loaded' in globals(): + raise RuntimeError('Reloading numpy._globals is not allowed') +_is_loaded = True + + +class _NoValueType: + """Special keyword value. + + The instance of this class may be used as the default value assigned to a + keyword if no other obvious default (e.g., `None`) is suitable, + + Common reasons for using this keyword are: + + - A new keyword is added to a function, and that function forwards its + inputs to another function or method which can be defined outside of + NumPy. For example, ``np.std(x)`` calls ``x.std``, so when a ``keepdims`` + keyword was added that could only be forwarded if the user explicitly + specified ``keepdims``; downstream array libraries may not have added + the same keyword, so adding ``x.std(..., keepdims=keepdims)`` + unconditionally could have broken previously working code. + - A keyword is being deprecated, and a deprecation warning must only be + emitted when the keyword is used. + + """ + __instance = None + def __new__(cls): + # ensure that only one instance exists + if not cls.__instance: + cls.__instance = super().__new__(cls) + return cls.__instance + + def __repr__(self): + return "" + + +_NoValue = _NoValueType() + + +@_set_module("numpy") +class _CopyMode(enum.Enum): + """ + An enumeration for the copy modes supported + by numpy.copy() and numpy.array(). The following three modes are supported, + + - ALWAYS: This means that a deep copy of the input + array will always be taken. + - IF_NEEDED: This means that a deep copy of the input + array will be taken only if necessary. + - NEVER: This means that the deep copy will never be taken. + If a copy cannot be avoided then a `ValueError` will be + raised. + + Note that the buffer-protocol could in theory do copies. NumPy currently + assumes an object exporting the buffer protocol will never do this. + """ + + ALWAYS = True + IF_NEEDED = False + NEVER = 2 + + def __bool__(self): + # For backwards compatibility + if self == _CopyMode.ALWAYS: + return True + + if self == _CopyMode.IF_NEEDED: + return False + + raise ValueError(f"{self} is neither True nor False.") diff --git a/shared/package-files/9d/9de1781cc62336e0d350b2fb3d499913dccb20782f550de524c329dd94d4522a/blob b/shared/package-files/9d/9de1781cc62336e0d350b2fb3d499913dccb20782f550de524c329dd94d4522a/blob new file mode 100644 index 0000000000000000000000000000000000000000..3e8242ac0915e6b5411cd1a4717af8779d39e7ee Binary files /dev/null and b/shared/package-files/9d/9de1781cc62336e0d350b2fb3d499913dccb20782f550de524c329dd94d4522a/blob differ diff --git a/shared/package-files/9d/9de1906ecf76fbee938faad502fc3f71a100a3593f84669fa269f69f827a58a4/blob b/shared/package-files/9d/9de1906ecf76fbee938faad502fc3f71a100a3593f84669fa269f69f827a58a4/blob new file mode 100644 index 0000000000000000000000000000000000000000..a3ea9f0d545a8bc9d9e06f87ee02739bacca0412 --- /dev/null +++ b/shared/package-files/9d/9de1906ecf76fbee938faad502fc3f71a100a3593f84669fa269f69f827a58a4/blob @@ -0,0 +1,22 @@ +"""Traitlets Python configuration system""" +from warnings import warn + +from . import traitlets +from ._version import __version__, version_info +from .traitlets import * +from .utils.bunch import Bunch +from .utils.decorators import signature_has_traits +from .utils.importstring import import_item + + +class Sentinel(traitlets.Sentinel): # type:ignore[name-defined] + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + warn( + """ + Sentinel is not a public part of the traitlets API. + It was published by mistake, and may be removed in the future. + """, + DeprecationWarning, + stacklevel=2, + ) diff --git a/shared/package-files/9d/9de30aa2d6166c7beb856f4a5f3e10cd0f1fccf9224172c71e3cbcdaf2d27a88/blob b/shared/package-files/9d/9de30aa2d6166c7beb856f4a5f3e10cd0f1fccf9224172c71e3cbcdaf2d27a88/blob new file mode 100644 index 0000000000000000000000000000000000000000..abd699c2fe8615c1417a6d58d83937d097867d40 --- /dev/null +++ b/shared/package-files/9d/9de30aa2d6166c7beb856f4a5f3e10cd0f1fccf9224172c71e3cbcdaf2d27a88/blob @@ -0,0 +1,173 @@ +#ifndef Py_FORTRANOBJECT_H +#define Py_FORTRANOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifndef NPY_NO_DEPRECATED_API +#define NPY_NO_DEPRECATED_API NPY_API_VERSION +#endif +#ifdef FORTRANOBJECT_C +#define NO_IMPORT_ARRAY +#endif +#define PY_ARRAY_UNIQUE_SYMBOL _npy_f2py_ARRAY_API +#include "numpy/arrayobject.h" +#include "numpy/npy_3kcompat.h" + +#ifdef F2PY_REPORT_ATEXIT +#include +// clang-format off +extern void f2py_start_clock(void); +extern void f2py_stop_clock(void); +extern void f2py_start_call_clock(void); +extern void f2py_stop_call_clock(void); +extern void f2py_cb_start_clock(void); +extern void f2py_cb_stop_clock(void); +extern void f2py_cb_start_call_clock(void); +extern void f2py_cb_stop_call_clock(void); +extern void f2py_report_on_exit(int, void *); +// clang-format on +#endif + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +/* Fortran object interface */ + +/* +123456789-123456789-123456789-123456789-123456789-123456789-123456789-12 + +PyFortranObject represents various Fortran objects: +Fortran (module) routines, COMMON blocks, module data. + +Author: Pearu Peterson +*/ + +#define F2PY_MAX_DIMS 40 +#define F2PY_MESSAGE_BUFFER_SIZE 300 // Increase on "stack smashing detected" + +typedef void (*f2py_set_data_func)(char *, npy_intp *); +typedef void (*f2py_void_func)(void); +typedef void (*f2py_init_func)(int *, npy_intp *, f2py_set_data_func, int *); + +/*typedef void* (*f2py_c_func)(void*,...);*/ + +typedef void *(*f2pycfunc)(void); + +typedef struct { + char *name; /* attribute (array||routine) name */ + int rank; /* array rank, 0 for scalar, max is F2PY_MAX_DIMS, + || rank=-1 for Fortran routine */ + struct { + npy_intp d[F2PY_MAX_DIMS]; + } dims; /* dimensions of the array, || not used */ + int type; /* PyArray_ || not used */ + int elsize; /* Element size || not used */ + char *data; /* pointer to array || Fortran routine */ + f2py_init_func func; /* initialization function for + allocatable arrays: + func(&rank,dims,set_ptr_func,name,len(name)) + || C/API wrapper for Fortran routine */ + char *doc; /* documentation string; only recommended + for routines. */ +} FortranDataDef; + +typedef struct { + PyObject_HEAD + int len; /* Number of attributes */ + FortranDataDef *defs; /* An array of FortranDataDef's */ + PyObject *dict; /* Fortran object attribute dictionary */ +} PyFortranObject; + +#define PyFortran_Check(op) (Py_TYPE(op) == &PyFortran_Type) +#define PyFortran_Check1(op) (0 == strcmp(Py_TYPE(op)->tp_name, "fortran")) + +extern PyTypeObject PyFortran_Type; +extern int +F2PyDict_SetItemString(PyObject *dict, char *name, PyObject *obj); +extern PyObject * +PyFortranObject_New(FortranDataDef *defs, f2py_void_func init); +extern PyObject * +PyFortranObject_NewAsAttr(FortranDataDef *defs); + +PyObject * +F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)); +void * +F2PyCapsule_AsVoidPtr(PyObject *obj); +int +F2PyCapsule_Check(PyObject *ptr); + +extern void * +F2PySwapThreadLocalCallbackPtr(char *key, void *ptr); +extern void * +F2PyGetThreadLocalCallbackPtr(char *key); + +#define ISCONTIGUOUS(m) (PyArray_FLAGS(m) & NPY_ARRAY_C_CONTIGUOUS) +#define F2PY_INTENT_IN 1 +#define F2PY_INTENT_INOUT 2 +#define F2PY_INTENT_OUT 4 +#define F2PY_INTENT_HIDE 8 +#define F2PY_INTENT_CACHE 16 +#define F2PY_INTENT_COPY 32 +#define F2PY_INTENT_C 64 +#define F2PY_OPTIONAL 128 +#define F2PY_INTENT_INPLACE 256 +#define F2PY_INTENT_ALIGNED4 512 +#define F2PY_INTENT_ALIGNED8 1024 +#define F2PY_INTENT_ALIGNED16 2048 + +#define ARRAY_ISALIGNED(ARR, SIZE) ((size_t)(PyArray_DATA(ARR)) % (SIZE) == 0) +#define F2PY_ALIGN4(intent) (intent & F2PY_INTENT_ALIGNED4) +#define F2PY_ALIGN8(intent) (intent & F2PY_INTENT_ALIGNED8) +#define F2PY_ALIGN16(intent) (intent & F2PY_INTENT_ALIGNED16) + +#define F2PY_GET_ALIGNMENT(intent) \ + (F2PY_ALIGN4(intent) \ + ? 4 \ + : (F2PY_ALIGN8(intent) ? 8 : (F2PY_ALIGN16(intent) ? 16 : 1))) +#define F2PY_CHECK_ALIGNMENT(arr, intent) \ + ARRAY_ISALIGNED(arr, F2PY_GET_ALIGNMENT(intent)) +#define F2PY_ARRAY_IS_CHARACTER_COMPATIBLE(arr) ((PyArray_DESCR(arr)->type_num == NPY_STRING && PyArray_DESCR(arr)->elsize >= 1) \ + || PyArray_DESCR(arr)->type_num == NPY_UINT8) +#define F2PY_IS_UNICODE_ARRAY(arr) (PyArray_DESCR(arr)->type_num == NPY_UNICODE) + +extern PyArrayObject * +ndarray_from_pyobj(const int type_num, const int elsize_, npy_intp *dims, + const int rank, const int intent, PyObject *obj, + const char *errmess); + +extern PyArrayObject * +array_from_pyobj(const int type_num, npy_intp *dims, const int rank, + const int intent, PyObject *obj); +extern int +copy_ND_array(const PyArrayObject *in, PyArrayObject *out); + +#ifdef DEBUG_COPY_ND_ARRAY +extern void +dump_attrs(const PyArrayObject *arr); +#endif + + extern int f2py_describe(PyObject *obj, char *buf); + + /* Utility CPP macros and functions that can be used in signature file + expressions. See signature-file.rst for documentation. + */ + +#define f2py_itemsize(var) (PyArray_DESCR((capi_ ## var ## _as_array))->elsize) +#define f2py_size(var, ...) f2py_size_impl((PyArrayObject *)(capi_ ## var ## _as_array), ## __VA_ARGS__, -1) +#define f2py_rank(var) var ## _Rank +#define f2py_shape(var,dim) var ## _Dims[dim] +#define f2py_len(var) f2py_shape(var,0) +#define f2py_fshape(var,dim) f2py_shape(var,rank(var)-dim-1) +#define f2py_flen(var) f2py_fshape(var,0) +#define f2py_slen(var) capi_ ## var ## _len + + extern npy_intp f2py_size_impl(PyArrayObject* var, ...); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_FORTRANOBJECT_H */ diff --git a/shared/package-files/9d/9de3c2ac24a31ab674adea33a9fd9e97993658cbf9aa5182cdbb8f68a0675e7b/blob b/shared/package-files/9d/9de3c2ac24a31ab674adea33a9fd9e97993658cbf9aa5182cdbb8f68a0675e7b/blob new file mode 100644 index 0000000000000000000000000000000000000000..5ce32be62f48c602c5da79a9f16275b85b2d5d41 --- /dev/null +++ b/shared/package-files/9d/9de3c2ac24a31ab674adea33a9fd9e97993658cbf9aa5182cdbb8f68a0675e7b/blob @@ -0,0 +1,28 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor searchsorted(const at::Tensor & sorted_sequence, const at::Tensor & self, bool out_int32=false, bool right=false, c10::optional side=c10::nullopt, const c10::optional & sorter={}); +TORCH_API at::Tensor & searchsorted_out(at::Tensor & out, const at::Tensor & sorted_sequence, const at::Tensor & self, bool out_int32=false, bool right=false, c10::optional side=c10::nullopt, const c10::optional & sorter={}); +TORCH_API at::Tensor & searchsorted_outf(const at::Tensor & sorted_sequence, const at::Tensor & self, bool out_int32, bool right, c10::optional side, const c10::optional & sorter, at::Tensor & out); +TORCH_API at::Tensor searchsorted(const at::Tensor & sorted_sequence, const at::Scalar & self, bool out_int32=false, bool right=false, c10::optional side=c10::nullopt, const c10::optional & sorter={}); +TORCH_API at::Tensor & searchsorted_out(at::Tensor & out, const at::Tensor & sorted_sequence, const at::Scalar & self, bool out_int32=false, bool right=false, c10::optional side=c10::nullopt, const c10::optional & sorter={}); +TORCH_API at::Tensor & searchsorted_outf(const at::Tensor & sorted_sequence, const at::Scalar & self, bool out_int32, bool right, c10::optional side, const c10::optional & sorter, at::Tensor & out); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/9d/9dee21dd48b57accb30fda7b2a8d88b9e26f82949499f17f6796966e204a25cd/blob b/shared/package-files/9d/9dee21dd48b57accb30fda7b2a8d88b9e26f82949499f17f6796966e204a25cd/blob new file mode 100644 index 0000000000000000000000000000000000000000..8f01593bd0ae619b3bea471980b4eeabfc29f319 --- /dev/null +++ b/shared/package-files/9d/9dee21dd48b57accb30fda7b2a8d88b9e26f82949499f17f6796966e204a25cd/blob @@ -0,0 +1,90 @@ +from numpy.linalg import * # noqa: F403 +from numpy.linalg import __all__ as linalg_all +import numpy as _np + +from ..common import _linalg +from .._internal import get_xp + +# These functions are in both the main and linalg namespaces +from ._aliases import matmul, matrix_transpose, tensordot, vecdot # noqa: F401 + +import numpy as np + +cross = get_xp(np)(_linalg.cross) +outer = get_xp(np)(_linalg.outer) +EighResult = _linalg.EighResult +QRResult = _linalg.QRResult +SlogdetResult = _linalg.SlogdetResult +SVDResult = _linalg.SVDResult +eigh = get_xp(np)(_linalg.eigh) +qr = get_xp(np)(_linalg.qr) +slogdet = get_xp(np)(_linalg.slogdet) +svd = get_xp(np)(_linalg.svd) +cholesky = get_xp(np)(_linalg.cholesky) +matrix_rank = get_xp(np)(_linalg.matrix_rank) +pinv = get_xp(np)(_linalg.pinv) +matrix_norm = get_xp(np)(_linalg.matrix_norm) +svdvals = get_xp(np)(_linalg.svdvals) +diagonal = get_xp(np)(_linalg.diagonal) +trace = get_xp(np)(_linalg.trace) + +# Note: unlike np.linalg.solve, the array API solve() only accepts x2 as a +# vector when it is exactly 1-dimensional. All other cases treat x2 as a stack +# of matrices. The np.linalg.solve behavior of allowing stacks of both +# matrices and vectors is ambiguous c.f. +# https://github.com/numpy/numpy/issues/15349 and +# https://github.com/data-apis/array-api/issues/285. + +# To workaround this, the below is the code from np.linalg.solve except +# only calling solve1 in the exactly 1D case. + +# This code is here instead of in common because it is numpy specific. Also +# note that CuPy's solve() does not currently support broadcasting (see +# https://github.com/cupy/cupy/blob/main/cupy/cublas.py#L43). +def solve(x1: _np.ndarray, x2: _np.ndarray, /) -> _np.ndarray: + try: + from numpy.linalg._linalg import ( + _makearray, _assert_stacked_2d, _assert_stacked_square, + _commonType, isComplexType, _raise_linalgerror_singular + ) + except ImportError: + from numpy.linalg.linalg import ( + _makearray, _assert_stacked_2d, _assert_stacked_square, + _commonType, isComplexType, _raise_linalgerror_singular + ) + from numpy.linalg import _umath_linalg + + x1, _ = _makearray(x1) + _assert_stacked_2d(x1) + _assert_stacked_square(x1) + x2, wrap = _makearray(x2) + t, result_t = _commonType(x1, x2) + + # This part is different from np.linalg.solve + if x2.ndim == 1: + gufunc = _umath_linalg.solve1 + else: + gufunc = _umath_linalg.solve + + # This does nothing currently but is left in because it will be relevant + # when complex dtype support is added to the spec in 2022. + signature = 'DD->D' if isComplexType(t) else 'dd->d' + with _np.errstate(call=_raise_linalgerror_singular, invalid='call', + over='ignore', divide='ignore', under='ignore'): + r = gufunc(x1, x2, signature=signature) + + return wrap(r.astype(result_t, copy=False)) + +# These functions are completely new here. If the library already has them +# (i.e., numpy 2.0), use the library version instead of our wrapper. +if hasattr(np.linalg, 'vector_norm'): + vector_norm = np.linalg.vector_norm +else: + vector_norm = get_xp(np)(_linalg.vector_norm) + +__all__ = linalg_all + _linalg.__all__ + ['solve'] + +del get_xp +del np +del linalg_all +del _linalg diff --git a/shared/package-files/9d/9def0b2eeed11e06f0da5032246ad59491c9d3c93152e38b043f691fe70dc455/blob b/shared/package-files/9d/9def0b2eeed11e06f0da5032246ad59491c9d3c93152e38b043f691fe70dc455/blob new file mode 100644 index 0000000000000000000000000000000000000000..4d245366c64a9b7a0308d422d3c8fdcb779b1269 --- /dev/null +++ b/shared/package-files/9d/9def0b2eeed11e06f0da5032246ad59491c9d3c93152e38b043f691fe70dc455/blob @@ -0,0 +1,23 @@ +// Compile with: +// +// nvcc -gencode arch=compute_50,code=compute_50 -rdc true -ptx jitlink.cu +// +// using the oldest supported toolkit version (10.2 at the time of writing). + +extern "C" __device__ +int bar(int *out, int a) +{ + *out = a * 2; + return 0; +} + + +// The out argument is necessary due to Numba's CUDA calling convention, which +// always reserves the first parameter for a pointer to a returned value, even +// if there is no return value. +extern "C" __device__ +int array_mutator(void *out, int *a) +{ + a[0] = a[1]; + return 0; +} diff --git a/shared/package-files/9d/9df048f9c2d82c13fd56e6716fb0d25ad148837be00e984d7d5fae06d1433081/blob b/shared/package-files/9d/9df048f9c2d82c13fd56e6716fb0d25ad148837be00e984d7d5fae06d1433081/blob new file mode 100644 index 0000000000000000000000000000000000000000..b5b832ea5c94c4c38f134f5f9d4b62364da089bc --- /dev/null +++ b/shared/package-files/9d/9df048f9c2d82c13fd56e6716fb0d25ad148837be00e984d7d5fae06d1433081/blob @@ -0,0 +1,643 @@ +"""Symbolic primitives + unicode/ASCII abstraction for pretty.py""" + +import sys +import warnings +from string import ascii_lowercase, ascii_uppercase +import unicodedata + +unicode_warnings = '' + +def U(name): + """ + Get a unicode character by name or, None if not found. + + This exists because older versions of Python use older unicode databases. + """ + try: + return unicodedata.lookup(name) + except KeyError: + global unicode_warnings + unicode_warnings += 'No \'%s\' in unicodedata\n' % name + return None + +from sympy.printing.conventions import split_super_sub +from sympy.core.alphabets import greeks +from sympy.utilities.exceptions import sympy_deprecation_warning + +# prefix conventions when constructing tables +# L - LATIN i +# G - GREEK beta +# D - DIGIT 0 +# S - SYMBOL + + + +__all__ = ['greek_unicode', 'sub', 'sup', 'xsym', 'vobj', 'hobj', 'pretty_symbol', + 'annotated'] + + +_use_unicode = False + + +def pretty_use_unicode(flag=None): + """Set whether pretty-printer should use unicode by default""" + global _use_unicode + global unicode_warnings + if flag is None: + return _use_unicode + + if flag and unicode_warnings: + # print warnings (if any) on first unicode usage + warnings.warn(unicode_warnings) + unicode_warnings = '' + + use_unicode_prev = _use_unicode + _use_unicode = flag + return use_unicode_prev + + +def pretty_try_use_unicode(): + """See if unicode output is available and leverage it if possible""" + + encoding = getattr(sys.stdout, 'encoding', None) + + # this happens when e.g. stdout is redirected through a pipe, or is + # e.g. a cStringIO.StringO + if encoding is None: + return # sys.stdout has no encoding + + symbols = [] + + # see if we can represent greek alphabet + symbols += greek_unicode.values() + + # and atoms + symbols += atoms_table.values() + + for s in symbols: + if s is None: + return # common symbols not present! + + try: + s.encode(encoding) + except UnicodeEncodeError: + return + + # all the characters were present and encodable + pretty_use_unicode(True) + + +def xstr(*args): + sympy_deprecation_warning( + """ + The sympy.printing.pretty.pretty_symbology.xstr() function is + deprecated. Use str() instead. + """, + deprecated_since_version="1.7", + active_deprecations_target="deprecated-pretty-printing-functions" + ) + return str(*args) + +# GREEK +g = lambda l: U('GREEK SMALL LETTER %s' % l.upper()) +G = lambda l: U('GREEK CAPITAL LETTER %s' % l.upper()) + +greek_letters = list(greeks) # make a copy +# deal with Unicode's funny spelling of lambda +greek_letters[greek_letters.index('lambda')] = 'lamda' + +# {} greek letter -> (g,G) +greek_unicode = {L: g(L) for L in greek_letters} +greek_unicode.update((L[0].upper() + L[1:], G(L)) for L in greek_letters) + +# aliases +greek_unicode['lambda'] = greek_unicode['lamda'] +greek_unicode['Lambda'] = greek_unicode['Lamda'] +greek_unicode['varsigma'] = '\N{GREEK SMALL LETTER FINAL SIGMA}' + +# BOLD +b = lambda l: U('MATHEMATICAL BOLD SMALL %s' % l.upper()) +B = lambda l: U('MATHEMATICAL BOLD CAPITAL %s' % l.upper()) + +bold_unicode = {l: b(l) for l in ascii_lowercase} +bold_unicode.update((L, B(L)) for L in ascii_uppercase) + +# GREEK BOLD +gb = lambda l: U('MATHEMATICAL BOLD SMALL %s' % l.upper()) +GB = lambda l: U('MATHEMATICAL BOLD CAPITAL %s' % l.upper()) + +greek_bold_letters = list(greeks) # make a copy, not strictly required here +# deal with Unicode's funny spelling of lambda +greek_bold_letters[greek_bold_letters.index('lambda')] = 'lamda' + +# {} greek letter -> (g,G) +greek_bold_unicode = {L: g(L) for L in greek_bold_letters} +greek_bold_unicode.update((L[0].upper() + L[1:], G(L)) for L in greek_bold_letters) +greek_bold_unicode['lambda'] = greek_unicode['lamda'] +greek_bold_unicode['Lambda'] = greek_unicode['Lamda'] +greek_bold_unicode['varsigma'] = '\N{MATHEMATICAL BOLD SMALL FINAL SIGMA}' + +digit_2txt = { + '0': 'ZERO', + '1': 'ONE', + '2': 'TWO', + '3': 'THREE', + '4': 'FOUR', + '5': 'FIVE', + '6': 'SIX', + '7': 'SEVEN', + '8': 'EIGHT', + '9': 'NINE', +} + +symb_2txt = { + '+': 'PLUS SIGN', + '-': 'MINUS', + '=': 'EQUALS SIGN', + '(': 'LEFT PARENTHESIS', + ')': 'RIGHT PARENTHESIS', + '[': 'LEFT SQUARE BRACKET', + ']': 'RIGHT SQUARE BRACKET', + '{': 'LEFT CURLY BRACKET', + '}': 'RIGHT CURLY BRACKET', + + # non-std + '{}': 'CURLY BRACKET', + 'sum': 'SUMMATION', + 'int': 'INTEGRAL', +} + +# SUBSCRIPT & SUPERSCRIPT +LSUB = lambda letter: U('LATIN SUBSCRIPT SMALL LETTER %s' % letter.upper()) +GSUB = lambda letter: U('GREEK SUBSCRIPT SMALL LETTER %s' % letter.upper()) +DSUB = lambda digit: U('SUBSCRIPT %s' % digit_2txt[digit]) +SSUB = lambda symb: U('SUBSCRIPT %s' % symb_2txt[symb]) + +LSUP = lambda letter: U('SUPERSCRIPT LATIN SMALL LETTER %s' % letter.upper()) +DSUP = lambda digit: U('SUPERSCRIPT %s' % digit_2txt[digit]) +SSUP = lambda symb: U('SUPERSCRIPT %s' % symb_2txt[symb]) + +sub = {} # symb -> subscript symbol +sup = {} # symb -> superscript symbol + +# latin subscripts +for l in 'aeioruvxhklmnpst': + sub[l] = LSUB(l) + +for l in 'in': + sup[l] = LSUP(l) + +for gl in ['beta', 'gamma', 'rho', 'phi', 'chi']: + sub[gl] = GSUB(gl) + +for d in [str(i) for i in range(10)]: + sub[d] = DSUB(d) + sup[d] = DSUP(d) + +for s in '+-=()': + sub[s] = SSUB(s) + sup[s] = SSUP(s) + +# Variable modifiers +# TODO: Make brackets adjust to height of contents +modifier_dict = { + # Accents + 'mathring': lambda s: center_accent(s, '\N{COMBINING RING ABOVE}'), + 'ddddot': lambda s: center_accent(s, '\N{COMBINING FOUR DOTS ABOVE}'), + 'dddot': lambda s: center_accent(s, '\N{COMBINING THREE DOTS ABOVE}'), + 'ddot': lambda s: center_accent(s, '\N{COMBINING DIAERESIS}'), + 'dot': lambda s: center_accent(s, '\N{COMBINING DOT ABOVE}'), + 'check': lambda s: center_accent(s, '\N{COMBINING CARON}'), + 'breve': lambda s: center_accent(s, '\N{COMBINING BREVE}'), + 'acute': lambda s: center_accent(s, '\N{COMBINING ACUTE ACCENT}'), + 'grave': lambda s: center_accent(s, '\N{COMBINING GRAVE ACCENT}'), + 'tilde': lambda s: center_accent(s, '\N{COMBINING TILDE}'), + 'hat': lambda s: center_accent(s, '\N{COMBINING CIRCUMFLEX ACCENT}'), + 'bar': lambda s: center_accent(s, '\N{COMBINING OVERLINE}'), + 'vec': lambda s: center_accent(s, '\N{COMBINING RIGHT ARROW ABOVE}'), + 'prime': lambda s: s+'\N{PRIME}', + 'prm': lambda s: s+'\N{PRIME}', + # # Faces -- these are here for some compatibility with latex printing + # 'bold': lambda s: s, + # 'bm': lambda s: s, + # 'cal': lambda s: s, + # 'scr': lambda s: s, + # 'frak': lambda s: s, + # Brackets + 'norm': lambda s: '\N{DOUBLE VERTICAL LINE}'+s+'\N{DOUBLE VERTICAL LINE}', + 'avg': lambda s: '\N{MATHEMATICAL LEFT ANGLE BRACKET}'+s+'\N{MATHEMATICAL RIGHT ANGLE BRACKET}', + 'abs': lambda s: '\N{VERTICAL LINE}'+s+'\N{VERTICAL LINE}', + 'mag': lambda s: '\N{VERTICAL LINE}'+s+'\N{VERTICAL LINE}', +} + +# VERTICAL OBJECTS +HUP = lambda symb: U('%s UPPER HOOK' % symb_2txt[symb]) +CUP = lambda symb: U('%s UPPER CORNER' % symb_2txt[symb]) +MID = lambda symb: U('%s MIDDLE PIECE' % symb_2txt[symb]) +EXT = lambda symb: U('%s EXTENSION' % symb_2txt[symb]) +HLO = lambda symb: U('%s LOWER HOOK' % symb_2txt[symb]) +CLO = lambda symb: U('%s LOWER CORNER' % symb_2txt[symb]) +TOP = lambda symb: U('%s TOP' % symb_2txt[symb]) +BOT = lambda symb: U('%s BOTTOM' % symb_2txt[symb]) + +# {} '(' -> (extension, start, end, middle) 1-character +_xobj_unicode = { + + # vertical symbols + # (( ext, top, bot, mid ), c1) + '(': (( EXT('('), HUP('('), HLO('(') ), '('), + ')': (( EXT(')'), HUP(')'), HLO(')') ), ')'), + '[': (( EXT('['), CUP('['), CLO('[') ), '['), + ']': (( EXT(']'), CUP(']'), CLO(']') ), ']'), + '{': (( EXT('{}'), HUP('{'), HLO('{'), MID('{') ), '{'), + '}': (( EXT('{}'), HUP('}'), HLO('}'), MID('}') ), '}'), + '|': U('BOX DRAWINGS LIGHT VERTICAL'), + + '<': ((U('BOX DRAWINGS LIGHT VERTICAL'), + U('BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT'), + U('BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT')), '<'), + + '>': ((U('BOX DRAWINGS LIGHT VERTICAL'), + U('BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT'), + U('BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT')), '>'), + + 'lfloor': (( EXT('['), EXT('['), CLO('[') ), U('LEFT FLOOR')), + 'rfloor': (( EXT(']'), EXT(']'), CLO(']') ), U('RIGHT FLOOR')), + 'lceil': (( EXT('['), CUP('['), EXT('[') ), U('LEFT CEILING')), + 'rceil': (( EXT(']'), CUP(']'), EXT(']') ), U('RIGHT CEILING')), + + 'int': (( EXT('int'), U('TOP HALF INTEGRAL'), U('BOTTOM HALF INTEGRAL') ), U('INTEGRAL')), + 'sum': (( U('BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT'), '_', U('OVERLINE'), U('BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT')), U('N-ARY SUMMATION')), + + # horizontal objects + #'-': '-', + '-': U('BOX DRAWINGS LIGHT HORIZONTAL'), + '_': U('LOW LINE'), + # We used to use this, but LOW LINE looks better for roots, as it's a + # little lower (i.e., it lines up with the / perfectly. But perhaps this + # one would still be wanted for some cases? + # '_': U('HORIZONTAL SCAN LINE-9'), + + # diagonal objects '\' & '/' ? + '/': U('BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT'), + '\\': U('BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT'), +} + +_xobj_ascii = { + # vertical symbols + # (( ext, top, bot, mid ), c1) + '(': (( '|', '/', '\\' ), '('), + ')': (( '|', '\\', '/' ), ')'), + +# XXX this looks ugly +# '[': (( '|', '-', '-' ), '['), +# ']': (( '|', '-', '-' ), ']'), +# XXX not so ugly :( + '[': (( '[', '[', '[' ), '['), + ']': (( ']', ']', ']' ), ']'), + + '{': (( '|', '/', '\\', '<' ), '{'), + '}': (( '|', '\\', '/', '>' ), '}'), + '|': '|', + + '<': (( '|', '/', '\\' ), '<'), + '>': (( '|', '\\', '/' ), '>'), + + 'int': ( ' | ', ' /', '/ ' ), + + # horizontal objects + '-': '-', + '_': '_', + + # diagonal objects '\' & '/' ? + '/': '/', + '\\': '\\', +} + + +def xobj(symb, length): + """Construct spatial object of given length. + + return: [] of equal-length strings + """ + + if length <= 0: + raise ValueError("Length should be greater than 0") + + # TODO robustify when no unicodedat available + if _use_unicode: + _xobj = _xobj_unicode + else: + _xobj = _xobj_ascii + + vinfo = _xobj[symb] + + c1 = top = bot = mid = None + + if not isinstance(vinfo, tuple): # 1 entry + ext = vinfo + else: + if isinstance(vinfo[0], tuple): # (vlong), c1 + vlong = vinfo[0] + c1 = vinfo[1] + else: # (vlong), c1 + vlong = vinfo + + ext = vlong[0] + + try: + top = vlong[1] + bot = vlong[2] + mid = vlong[3] + except IndexError: + pass + + if c1 is None: + c1 = ext + if top is None: + top = ext + if bot is None: + bot = ext + if mid is not None: + if (length % 2) == 0: + # even height, but we have to print it somehow anyway... + # XXX is it ok? + length += 1 + + else: + mid = ext + + if length == 1: + return c1 + + res = [] + next = (length - 2)//2 + nmid = (length - 2) - next*2 + + res += [top] + res += [ext]*next + res += [mid]*nmid + res += [ext]*next + res += [bot] + + return res + + +def vobj(symb, height): + """Construct vertical object of a given height + + see: xobj + """ + return '\n'.join( xobj(symb, height) ) + + +def hobj(symb, width): + """Construct horizontal object of a given width + + see: xobj + """ + return ''.join( xobj(symb, width) ) + +# RADICAL +# n -> symbol +root = { + 2: U('SQUARE ROOT'), # U('RADICAL SYMBOL BOTTOM') + 3: U('CUBE ROOT'), + 4: U('FOURTH ROOT'), +} + + +# RATIONAL +VF = lambda txt: U('VULGAR FRACTION %s' % txt) + +# (p,q) -> symbol +frac = { + (1, 2): VF('ONE HALF'), + (1, 3): VF('ONE THIRD'), + (2, 3): VF('TWO THIRDS'), + (1, 4): VF('ONE QUARTER'), + (3, 4): VF('THREE QUARTERS'), + (1, 5): VF('ONE FIFTH'), + (2, 5): VF('TWO FIFTHS'), + (3, 5): VF('THREE FIFTHS'), + (4, 5): VF('FOUR FIFTHS'), + (1, 6): VF('ONE SIXTH'), + (5, 6): VF('FIVE SIXTHS'), + (1, 8): VF('ONE EIGHTH'), + (3, 8): VF('THREE EIGHTHS'), + (5, 8): VF('FIVE EIGHTHS'), + (7, 8): VF('SEVEN EIGHTHS'), +} + + +# atom symbols +_xsym = { + '==': ('=', '='), + '<': ('<', '<'), + '>': ('>', '>'), + '<=': ('<=', U('LESS-THAN OR EQUAL TO')), + '>=': ('>=', U('GREATER-THAN OR EQUAL TO')), + '!=': ('!=', U('NOT EQUAL TO')), + ':=': (':=', ':='), + '+=': ('+=', '+='), + '-=': ('-=', '-='), + '*=': ('*=', '*='), + '/=': ('/=', '/='), + '%=': ('%=', '%='), + '*': ('*', U('DOT OPERATOR')), + '-->': ('-->', U('EM DASH') + U('EM DASH') + + U('BLACK RIGHT-POINTING TRIANGLE') if U('EM DASH') + and U('BLACK RIGHT-POINTING TRIANGLE') else None), + '==>': ('==>', U('BOX DRAWINGS DOUBLE HORIZONTAL') + + U('BOX DRAWINGS DOUBLE HORIZONTAL') + + U('BLACK RIGHT-POINTING TRIANGLE') if + U('BOX DRAWINGS DOUBLE HORIZONTAL') and + U('BOX DRAWINGS DOUBLE HORIZONTAL') and + U('BLACK RIGHT-POINTING TRIANGLE') else None), + '.': ('*', U('RING OPERATOR')), +} + + +def xsym(sym): + """get symbology for a 'character'""" + op = _xsym[sym] + + if _use_unicode: + return op[1] + else: + return op[0] + + +# SYMBOLS + +atoms_table = { + # class how-to-display + 'Exp1': U('SCRIPT SMALL E'), + 'Pi': U('GREEK SMALL LETTER PI'), + 'Infinity': U('INFINITY'), + 'NegativeInfinity': U('INFINITY') and ('-' + U('INFINITY')), # XXX what to do here + #'ImaginaryUnit': U('GREEK SMALL LETTER IOTA'), + #'ImaginaryUnit': U('MATHEMATICAL ITALIC SMALL I'), + 'ImaginaryUnit': U('DOUBLE-STRUCK ITALIC SMALL I'), + 'EmptySet': U('EMPTY SET'), + 'Naturals': U('DOUBLE-STRUCK CAPITAL N'), + 'Naturals0': (U('DOUBLE-STRUCK CAPITAL N') and + (U('DOUBLE-STRUCK CAPITAL N') + + U('SUBSCRIPT ZERO'))), + 'Integers': U('DOUBLE-STRUCK CAPITAL Z'), + 'Rationals': U('DOUBLE-STRUCK CAPITAL Q'), + 'Reals': U('DOUBLE-STRUCK CAPITAL R'), + 'Complexes': U('DOUBLE-STRUCK CAPITAL C'), + 'Union': U('UNION'), + 'SymmetricDifference': U('INCREMENT'), + 'Intersection': U('INTERSECTION'), + 'Ring': U('RING OPERATOR'), + 'Modifier Letter Low Ring':U('Modifier Letter Low Ring'), + 'EmptySequence': 'EmptySequence', +} + + +def pretty_atom(atom_name, default=None, printer=None): + """return pretty representation of an atom""" + if _use_unicode: + if printer is not None and atom_name == 'ImaginaryUnit' and printer._settings['imaginary_unit'] == 'j': + return U('DOUBLE-STRUCK ITALIC SMALL J') + else: + return atoms_table[atom_name] + else: + if default is not None: + return default + + raise KeyError('only unicode') # send it default printer + + +def pretty_symbol(symb_name, bold_name=False): + """return pretty representation of a symbol""" + # let's split symb_name into symbol + index + # UC: beta1 + # UC: f_beta + + if not _use_unicode: + return symb_name + + name, sups, subs = split_super_sub(symb_name) + + def translate(s, bold_name) : + if bold_name: + gG = greek_bold_unicode.get(s) + else: + gG = greek_unicode.get(s) + if gG is not None: + return gG + for key in sorted(modifier_dict.keys(), key=lambda k:len(k), reverse=True) : + if s.lower().endswith(key) and len(s)>len(key): + return modifier_dict[key](translate(s[:-len(key)], bold_name)) + if bold_name: + return ''.join([bold_unicode[c] for c in s]) + return s + + name = translate(name, bold_name) + + # Let's prettify sups/subs. If it fails at one of them, pretty sups/subs are + # not used at all. + def pretty_list(l, mapping): + result = [] + for s in l: + pretty = mapping.get(s) + if pretty is None: + try: # match by separate characters + pretty = ''.join([mapping[c] for c in s]) + except (TypeError, KeyError): + return None + result.append(pretty) + return result + + pretty_sups = pretty_list(sups, sup) + if pretty_sups is not None: + pretty_subs = pretty_list(subs, sub) + else: + pretty_subs = None + + # glue the results into one string + if pretty_subs is None: # nice formatting of sups/subs did not work + if subs: + name += '_'+'_'.join([translate(s, bold_name) for s in subs]) + if sups: + name += '__'+'__'.join([translate(s, bold_name) for s in sups]) + return name + else: + sups_result = ' '.join(pretty_sups) + subs_result = ' '.join(pretty_subs) + + return ''.join([name, sups_result, subs_result]) + + +def annotated(letter): + """ + Return a stylised drawing of the letter ``letter``, together with + information on how to put annotations (super- and subscripts to the + left and to the right) on it. + + See pretty.py functions _print_meijerg, _print_hyper on how to use this + information. + """ + ucode_pics = { + 'F': (2, 0, 2, 0, '\N{BOX DRAWINGS LIGHT DOWN AND RIGHT}\N{BOX DRAWINGS LIGHT HORIZONTAL}\n' + '\N{BOX DRAWINGS LIGHT VERTICAL AND RIGHT}\N{BOX DRAWINGS LIGHT HORIZONTAL}\n' + '\N{BOX DRAWINGS LIGHT UP}'), + 'G': (3, 0, 3, 1, '\N{BOX DRAWINGS LIGHT ARC DOWN AND RIGHT}\N{BOX DRAWINGS LIGHT HORIZONTAL}\N{BOX DRAWINGS LIGHT ARC DOWN AND LEFT}\n' + '\N{BOX DRAWINGS LIGHT VERTICAL}\N{BOX DRAWINGS LIGHT RIGHT}\N{BOX DRAWINGS LIGHT DOWN AND LEFT}\n' + '\N{BOX DRAWINGS LIGHT ARC UP AND RIGHT}\N{BOX DRAWINGS LIGHT HORIZONTAL}\N{BOX DRAWINGS LIGHT ARC UP AND LEFT}') + } + ascii_pics = { + 'F': (3, 0, 3, 0, ' _\n|_\n|\n'), + 'G': (3, 0, 3, 1, ' __\n/__\n\\_|') + } + + if _use_unicode: + return ucode_pics[letter] + else: + return ascii_pics[letter] + +_remove_combining = dict.fromkeys(list(range(ord('\N{COMBINING GRAVE ACCENT}'), ord('\N{COMBINING LATIN SMALL LETTER X}'))) + + list(range(ord('\N{COMBINING LEFT HARPOON ABOVE}'), ord('\N{COMBINING ASTERISK ABOVE}')))) + +def is_combining(sym): + """Check whether symbol is a unicode modifier. """ + + return ord(sym) in _remove_combining + + +def center_accent(string, accent): + """ + Returns a string with accent inserted on the middle character. Useful to + put combining accents on symbol names, including multi-character names. + + Parameters + ========== + + string : string + The string to place the accent in. + accent : string + The combining accent to insert + + References + ========== + + .. [1] https://en.wikipedia.org/wiki/Combining_character + .. [2] https://en.wikipedia.org/wiki/Combining_Diacritical_Marks + + """ + + # Accent is placed on the previous character, although it may not always look + # like that depending on console + midpoint = len(string) // 2 + 1 + firstpart = string[:midpoint] + secondpart = string[midpoint:] + return firstpart + accent + secondpart + + +def line_width(line): + """Unicode combining symbols (modifiers) are not ever displayed as + separate symbols and thus should not be counted + """ + return len(line.translate(_remove_combining)) diff --git a/shared/package-files/9d/9df1906646a9e082d5c9a7f6a005dd8bcb0d628bf95c8d521ea9663c71b781cd/blob b/shared/package-files/9d/9df1906646a9e082d5c9a7f6a005dd8bcb0d628bf95c8d521ea9663c71b781cd/blob new file mode 100644 index 0000000000000000000000000000000000000000..2c75d3a42aec42d66ada7fe8a2541bce3e1db3aa --- /dev/null +++ b/shared/package-files/9d/9df1906646a9e082d5c9a7f6a005dd8bcb0d628bf95c8d521ea9663c71b781cd/blob @@ -0,0 +1,1048 @@ +from functools import reduce, partial +import inspect +import sys +from operator import attrgetter, not_ +from importlib import import_module +from types import MethodType + +from .utils import no_default + +PYPY = hasattr(sys, 'pypy_version_info') and sys.version_info[0] > 2 + + +__all__ = ('identity', 'apply', 'thread_first', 'thread_last', 'memoize', + 'compose', 'compose_left', 'pipe', 'complement', 'juxt', 'do', + 'curry', 'flip', 'excepts') + +PYPY = hasattr(sys, 'pypy_version_info') + + +def identity(x): + """ Identity function. Return x + + >>> identity(3) + 3 + """ + return x + + +def apply(*func_and_args, **kwargs): + """ Applies a function and returns the results + + >>> def double(x): return 2*x + >>> def inc(x): return x + 1 + >>> apply(double, 5) + 10 + + >>> tuple(map(apply, [double, inc, double], [10, 500, 8000])) + (20, 501, 16000) + """ + if not func_and_args: + raise TypeError('func argument is required') + func, args = func_and_args[0], func_and_args[1:] + return func(*args, **kwargs) + + +def thread_first(val, *forms): + """ Thread value through a sequence of functions/forms + + >>> def double(x): return 2*x + >>> def inc(x): return x + 1 + >>> thread_first(1, inc, double) + 4 + + If the function expects more than one input you can specify those inputs + in a tuple. The value is used as the first input. + + >>> def add(x, y): return x + y + >>> def pow(x, y): return x**y + >>> thread_first(1, (add, 4), (pow, 2)) # pow(add(1, 4), 2) + 25 + + So in general + thread_first(x, f, (g, y, z)) + expands to + g(f(x), y, z) + + See Also: + thread_last + """ + def evalform_front(val, form): + if callable(form): + return form(val) + if isinstance(form, tuple): + func, args = form[0], form[1:] + args = (val,) + args + return func(*args) + return reduce(evalform_front, forms, val) + + +def thread_last(val, *forms): + """ Thread value through a sequence of functions/forms + + >>> def double(x): return 2*x + >>> def inc(x): return x + 1 + >>> thread_last(1, inc, double) + 4 + + If the function expects more than one input you can specify those inputs + in a tuple. The value is used as the last input. + + >>> def add(x, y): return x + y + >>> def pow(x, y): return x**y + >>> thread_last(1, (add, 4), (pow, 2)) # pow(2, add(4, 1)) + 32 + + So in general + thread_last(x, f, (g, y, z)) + expands to + g(y, z, f(x)) + + >>> def iseven(x): + ... return x % 2 == 0 + >>> list(thread_last([1, 2, 3], (map, inc), (filter, iseven))) + [2, 4] + + See Also: + thread_first + """ + def evalform_back(val, form): + if callable(form): + return form(val) + if isinstance(form, tuple): + func, args = form[0], form[1:] + args = args + (val,) + return func(*args) + return reduce(evalform_back, forms, val) + + +def instanceproperty(fget=None, fset=None, fdel=None, doc=None, classval=None): + """ Like @property, but returns ``classval`` when used as a class attribute + + >>> class MyClass(object): + ... '''The class docstring''' + ... @instanceproperty(classval=__doc__) + ... def __doc__(self): + ... return 'An object docstring' + ... @instanceproperty + ... def val(self): + ... return 42 + ... + >>> MyClass.__doc__ + 'The class docstring' + >>> MyClass.val is None + True + >>> obj = MyClass() + >>> obj.__doc__ + 'An object docstring' + >>> obj.val + 42 + """ + if fget is None: + return partial(instanceproperty, fset=fset, fdel=fdel, doc=doc, + classval=classval) + return InstanceProperty(fget=fget, fset=fset, fdel=fdel, doc=doc, + classval=classval) + + +class InstanceProperty(property): + """ Like @property, but returns ``classval`` when used as a class attribute + + Should not be used directly. Use ``instanceproperty`` instead. + """ + def __init__(self, fget=None, fset=None, fdel=None, doc=None, + classval=None): + self.classval = classval + property.__init__(self, fget=fget, fset=fset, fdel=fdel, doc=doc) + + def __get__(self, obj, type=None): + if obj is None: + return self.classval + return property.__get__(self, obj, type) + + def __reduce__(self): + state = (self.fget, self.fset, self.fdel, self.__doc__, self.classval) + return InstanceProperty, state + + +class curry(object): + """ Curry a callable function + + Enables partial application of arguments through calling a function with an + incomplete set of arguments. + + >>> def mul(x, y): + ... return x * y + >>> mul = curry(mul) + + >>> double = mul(2) + >>> double(10) + 20 + + Also supports keyword arguments + + >>> @curry # Can use curry as a decorator + ... def f(x, y, a=10): + ... return a * (x + y) + + >>> add = f(a=1) + >>> add(2, 3) + 5 + + See Also: + toolz.curried - namespace of curried functions + https://toolz.readthedocs.io/en/latest/curry.html + """ + def __init__(self, *args, **kwargs): + if not args: + raise TypeError('__init__() takes at least 2 arguments (1 given)') + func, args = args[0], args[1:] + if not callable(func): + raise TypeError("Input must be callable") + + # curry- or functools.partial-like object? Unpack and merge arguments + if ( + hasattr(func, 'func') + and hasattr(func, 'args') + and hasattr(func, 'keywords') + and isinstance(func.args, tuple) + ): + _kwargs = {} + if func.keywords: + _kwargs.update(func.keywords) + _kwargs.update(kwargs) + kwargs = _kwargs + args = func.args + args + func = func.func + + if kwargs: + self._partial = partial(func, *args, **kwargs) + else: + self._partial = partial(func, *args) + + self.__doc__ = getattr(func, '__doc__', None) + self.__name__ = getattr(func, '__name__', '') + self.__module__ = getattr(func, '__module__', None) + self.__qualname__ = getattr(func, '__qualname__', None) + self._sigspec = None + self._has_unknown_args = None + + @instanceproperty + def func(self): + return self._partial.func + + @instanceproperty + def __signature__(self): + sig = inspect.signature(self.func) + args = self.args or () + keywords = self.keywords or {} + if is_partial_args(self.func, args, keywords, sig) is False: + raise TypeError('curry object has incorrect arguments') + + params = list(sig.parameters.values()) + skip = 0 + for param in params[:len(args)]: + if param.kind == param.VAR_POSITIONAL: + break + skip += 1 + + kwonly = False + newparams = [] + for param in params[skip:]: + kind = param.kind + default = param.default + if kind == param.VAR_KEYWORD: + pass + elif kind == param.VAR_POSITIONAL: + if kwonly: + continue + elif param.name in keywords: + default = keywords[param.name] + kind = param.KEYWORD_ONLY + kwonly = True + else: + if kwonly: + kind = param.KEYWORD_ONLY + if default is param.empty: + default = no_default + newparams.append(param.replace(default=default, kind=kind)) + + return sig.replace(parameters=newparams) + + @instanceproperty + def args(self): + return self._partial.args + + @instanceproperty + def keywords(self): + return self._partial.keywords + + @instanceproperty + def func_name(self): + return self.__name__ + + def __str__(self): + return str(self.func) + + def __repr__(self): + return repr(self.func) + + def __hash__(self): + return hash((self.func, self.args, + frozenset(self.keywords.items()) if self.keywords + else None)) + + def __eq__(self, other): + return (isinstance(other, curry) and self.func == other.func and + self.args == other.args and self.keywords == other.keywords) + + def __ne__(self, other): + return not self.__eq__(other) + + def __call__(self, *args, **kwargs): + try: + return self._partial(*args, **kwargs) + except TypeError as exc: + if self._should_curry(args, kwargs, exc): + return self.bind(*args, **kwargs) + raise + + def _should_curry(self, args, kwargs, exc=None): + func = self.func + args = self.args + args + if self.keywords: + kwargs = dict(self.keywords, **kwargs) + if self._sigspec is None: + sigspec = self._sigspec = _sigs.signature_or_spec(func) + self._has_unknown_args = has_varargs(func, sigspec) is not False + else: + sigspec = self._sigspec + + if is_partial_args(func, args, kwargs, sigspec) is False: + # Nothing can make the call valid + return False + elif self._has_unknown_args: + # The call may be valid and raised a TypeError, but we curry + # anyway because the function may have `*args`. This is useful + # for decorators with signature `func(*args, **kwargs)`. + return True + elif not is_valid_args(func, args, kwargs, sigspec): + # Adding more arguments may make the call valid + return True + else: + # There was a genuine TypeError + return False + + def bind(self, *args, **kwargs): + return type(self)(self, *args, **kwargs) + + def call(self, *args, **kwargs): + return self._partial(*args, **kwargs) + + def __get__(self, instance, owner): + if instance is None: + return self + return curry(self, instance) + + def __reduce__(self): + func = self.func + modname = getattr(func, '__module__', None) + qualname = getattr(func, '__qualname__', None) + if qualname is None: # pragma: no cover + qualname = getattr(func, '__name__', None) + is_decorated = None + if modname and qualname: + attrs = [] + obj = import_module(modname) + for attr in qualname.split('.'): + if isinstance(obj, curry): + attrs.append('func') + obj = obj.func + obj = getattr(obj, attr, None) + if obj is None: + break + attrs.append(attr) + if isinstance(obj, curry) and obj.func is func: + is_decorated = obj is self + qualname = '.'.join(attrs) + func = '%s:%s' % (modname, qualname) + + # functools.partial objects can't be pickled + userdict = tuple((k, v) for k, v in self.__dict__.items() + if k not in ('_partial', '_sigspec')) + state = (type(self), func, self.args, self.keywords, userdict, + is_decorated) + return _restore_curry, state + + +def _restore_curry(cls, func, args, kwargs, userdict, is_decorated): + if isinstance(func, str): + modname, qualname = func.rsplit(':', 1) + obj = import_module(modname) + for attr in qualname.split('.'): + obj = getattr(obj, attr) + if is_decorated: + return obj + func = obj.func + obj = cls(func, *args, **(kwargs or {})) + obj.__dict__.update(userdict) + return obj + + +@curry +def memoize(func, cache=None, key=None): + """ Cache a function's result for speedy future evaluation + + Considerations: + Trades memory for speed. + Only use on pure functions. + + >>> def add(x, y): return x + y + >>> add = memoize(add) + + Or use as a decorator + + >>> @memoize + ... def add(x, y): + ... return x + y + + Use the ``cache`` keyword to provide a dict-like object as an initial cache + + >>> @memoize(cache={(1, 2): 3}) + ... def add(x, y): + ... return x + y + + Note that the above works as a decorator because ``memoize`` is curried. + + It is also possible to provide a ``key(args, kwargs)`` function that + calculates keys used for the cache, which receives an ``args`` tuple and + ``kwargs`` dict as input, and must return a hashable value. However, + the default key function should be sufficient most of the time. + + >>> # Use key function that ignores extraneous keyword arguments + >>> @memoize(key=lambda args, kwargs: args) + ... def add(x, y, verbose=False): + ... if verbose: + ... print('Calculating %s + %s' % (x, y)) + ... return x + y + """ + if cache is None: + cache = {} + + try: + may_have_kwargs = has_keywords(func) is not False + # Is unary function (single arg, no variadic argument or keywords)? + is_unary = is_arity(1, func) + except TypeError: # pragma: no cover + may_have_kwargs = True + is_unary = False + + if key is None: + if is_unary: + def key(args, kwargs): + return args[0] + elif may_have_kwargs: + def key(args, kwargs): + return ( + args or None, + frozenset(kwargs.items()) if kwargs else None, + ) + else: + def key(args, kwargs): + return args + + def memof(*args, **kwargs): + k = key(args, kwargs) + try: + return cache[k] + except TypeError: + raise TypeError("Arguments to memoized function must be hashable") + except KeyError: + cache[k] = result = func(*args, **kwargs) + return result + + try: + memof.__name__ = func.__name__ + except AttributeError: + pass + memof.__doc__ = func.__doc__ + memof.__wrapped__ = func + return memof + + +class Compose(object): + """ A composition of functions + + See Also: + compose + """ + __slots__ = 'first', 'funcs' + + def __init__(self, funcs): + funcs = tuple(reversed(funcs)) + self.first = funcs[0] + self.funcs = funcs[1:] + + def __call__(self, *args, **kwargs): + ret = self.first(*args, **kwargs) + for f in self.funcs: + ret = f(ret) + return ret + + def __getstate__(self): + return self.first, self.funcs + + def __setstate__(self, state): + self.first, self.funcs = state + + @instanceproperty(classval=__doc__) + def __doc__(self): + def composed_doc(*fs): + """Generate a docstring for the composition of fs. + """ + if not fs: + # Argument name for the docstring. + return '*args, **kwargs' + + return '{f}({g})'.format(f=fs[0].__name__, g=composed_doc(*fs[1:])) + + try: + return ( + 'lambda *args, **kwargs: ' + + composed_doc(*reversed((self.first,) + self.funcs)) + ) + except AttributeError: + # One of our callables does not have a `__name__`, whatever. + return 'A composition of functions' + + @property + def __name__(self): + try: + return '_of_'.join( + (f.__name__ for f in reversed((self.first,) + self.funcs)) + ) + except AttributeError: + return type(self).__name__ + + def __repr__(self): + return '{.__class__.__name__}{!r}'.format( + self, tuple(reversed((self.first, ) + self.funcs))) + + def __eq__(self, other): + if isinstance(other, Compose): + return other.first == self.first and other.funcs == self.funcs + return NotImplemented + + def __ne__(self, other): + equality = self.__eq__(other) + return NotImplemented if equality is NotImplemented else not equality + + def __hash__(self): + return hash(self.first) ^ hash(self.funcs) + + # Mimic the descriptor behavior of python functions. + # i.e. let Compose be called as a method when bound to a class. + # adapted from + # docs.python.org/3/howto/descriptor.html#functions-and-methods + def __get__(self, obj, objtype=None): + return self if obj is None else MethodType(self, obj) + + # introspection with Signature is only possible from py3.3+ + @instanceproperty + def __signature__(self): + base = inspect.signature(self.first) + last = inspect.signature(self.funcs[-1]) + return base.replace(return_annotation=last.return_annotation) + + __wrapped__ = instanceproperty(attrgetter('first')) + + +def compose(*funcs): + """ Compose functions to operate in series. + + Returns a function that applies other functions in sequence. + + Functions are applied from right to left so that + ``compose(f, g, h)(x, y)`` is the same as ``f(g(h(x, y)))``. + + If no arguments are provided, the identity function (f(x) = x) is returned. + + >>> inc = lambda i: i + 1 + >>> compose(str, inc)(3) + '4' + + See Also: + compose_left + pipe + """ + if not funcs: + return identity + if len(funcs) == 1: + return funcs[0] + else: + return Compose(funcs) + + +def compose_left(*funcs): + """ Compose functions to operate in series. + + Returns a function that applies other functions in sequence. + + Functions are applied from left to right so that + ``compose_left(f, g, h)(x, y)`` is the same as ``h(g(f(x, y)))``. + + If no arguments are provided, the identity function (f(x) = x) is returned. + + >>> inc = lambda i: i + 1 + >>> compose_left(inc, str)(3) + '4' + + See Also: + compose + pipe + """ + return compose(*reversed(funcs)) + + +def pipe(data, *funcs): + """ Pipe a value through a sequence of functions + + I.e. ``pipe(data, f, g, h)`` is equivalent to ``h(g(f(data)))`` + + We think of the value as progressing through a pipe of several + transformations, much like pipes in UNIX + + ``$ cat data | f | g | h`` + + >>> double = lambda i: 2 * i + >>> pipe(3, double, str) + '6' + + See Also: + compose + compose_left + thread_first + thread_last + """ + for func in funcs: + data = func(data) + return data + + +def complement(func): + """ Convert a predicate function to its logical complement. + + In other words, return a function that, for inputs that normally + yield True, yields False, and vice-versa. + + >>> def iseven(n): return n % 2 == 0 + >>> isodd = complement(iseven) + >>> iseven(2) + True + >>> isodd(2) + False + """ + return compose(not_, func) + + +class juxt(object): + """ Creates a function that calls several functions with the same arguments + + Takes several functions and returns a function that applies its arguments + to each of those functions then returns a tuple of the results. + + Name comes from juxtaposition: the fact of two things being seen or placed + close together with contrasting effect. + + >>> inc = lambda x: x + 1 + >>> double = lambda x: x * 2 + >>> juxt(inc, double)(10) + (11, 20) + >>> juxt([inc, double])(10) + (11, 20) + """ + __slots__ = ['funcs'] + + def __init__(self, *funcs): + if len(funcs) == 1 and not callable(funcs[0]): + funcs = funcs[0] + self.funcs = tuple(funcs) + + def __call__(self, *args, **kwargs): + return tuple(func(*args, **kwargs) for func in self.funcs) + + def __getstate__(self): + return self.funcs + + def __setstate__(self, state): + self.funcs = state + + +def do(func, x): + """ Runs ``func`` on ``x``, returns ``x`` + + Because the results of ``func`` are not returned, only the side + effects of ``func`` are relevant. + + Logging functions can be made by composing ``do`` with a storage function + like ``list.append`` or ``file.write`` + + >>> from toolz import compose + >>> from toolz.curried import do + + >>> log = [] + >>> inc = lambda x: x + 1 + >>> inc = compose(inc, do(log.append)) + >>> inc(1) + 2 + >>> inc(11) + 12 + >>> log + [1, 11] + """ + func(x) + return x + + +@curry +def flip(func, a, b): + """ Call the function call with the arguments flipped + + This function is curried. + + >>> def div(a, b): + ... return a // b + ... + >>> flip(div, 2, 6) + 3 + >>> div_by_two = flip(div, 2) + >>> div_by_two(4) + 2 + + This is particularly useful for built in functions and functions defined + in C extensions that accept positional only arguments. For example: + isinstance, issubclass. + + >>> data = [1, 'a', 'b', 2, 1.5, object(), 3] + >>> only_ints = list(filter(flip(isinstance, int), data)) + >>> only_ints + [1, 2, 3] + """ + return func(b, a) + + +def return_none(exc): + """ Returns None. + """ + return None + + +class excepts(object): + """A wrapper around a function to catch exceptions and + dispatch to a handler. + + This is like a functional try/except block, in the same way that + ifexprs are functional if/else blocks. + + Examples + -------- + >>> excepting = excepts( + ... ValueError, + ... lambda a: [1, 2].index(a), + ... lambda _: -1, + ... ) + >>> excepting(1) + 0 + >>> excepting(3) + -1 + + Multiple exceptions and default except clause. + >>> excepting = excepts((IndexError, KeyError), lambda a: a[0]) + >>> excepting([]) + >>> excepting([1]) + 1 + >>> excepting({}) + >>> excepting({0: 1}) + 1 + """ + def __init__(self, exc, func, handler=return_none): + self.exc = exc + self.func = func + self.handler = handler + + def __call__(self, *args, **kwargs): + try: + return self.func(*args, **kwargs) + except self.exc as e: + return self.handler(e) + + @instanceproperty(classval=__doc__) + def __doc__(self): + from textwrap import dedent + + exc = self.exc + try: + if isinstance(exc, tuple): + exc_name = '(%s)' % ', '.join( + map(attrgetter('__name__'), exc), + ) + else: + exc_name = exc.__name__ + + return dedent( + """\ + A wrapper around {inst.func.__name__!r} that will except: + {exc} + and handle any exceptions with {inst.handler.__name__!r}. + + Docs for {inst.func.__name__!r}: + {inst.func.__doc__} + + Docs for {inst.handler.__name__!r}: + {inst.handler.__doc__} + """ + ).format( + inst=self, + exc=exc_name, + ) + except AttributeError: + return type(self).__doc__ + + @property + def __name__(self): + exc = self.exc + try: + if isinstance(exc, tuple): + exc_name = '_or_'.join(map(attrgetter('__name__'), exc)) + else: + exc_name = exc.__name__ + return '%s_excepting_%s' % (self.func.__name__, exc_name) + except AttributeError: + return 'excepting' + + +def _check_sigspec(sigspec, func, builtin_func, *builtin_args): + if sigspec is None: + try: + sigspec = inspect.signature(func) + except (ValueError, TypeError) as e: + sigspec = e + if isinstance(sigspec, ValueError): + return None, builtin_func(*builtin_args) + elif not isinstance(sigspec, inspect.Signature): + if ( + func in _sigs.signatures + and (( + hasattr(func, '__signature__') + and hasattr(func.__signature__, '__get__') + )) + ): + val = builtin_func(*builtin_args) + return None, val + return None, False + return sigspec, None + + +if PYPY: # pragma: no cover + _check_sigspec_orig = _check_sigspec + + def _check_sigspec(sigspec, func, builtin_func, *builtin_args): + # PyPy may lie, so use our registry for builtins instead + if func in _sigs.signatures: + val = builtin_func(*builtin_args) + return None, val + return _check_sigspec_orig(sigspec, func, builtin_func, *builtin_args) + + +_check_sigspec.__doc__ = """ \ +Private function to aid in introspection compatibly across Python versions. + +If a callable doesn't have a signature (Python 3) or an argspec (Python 2), +the signature registry in toolz._signatures is used. +""" + + +def num_required_args(func, sigspec=None): + sigspec, rv = _check_sigspec(sigspec, func, _sigs._num_required_args, + func) + if sigspec is None: + return rv + return sum(1 for p in sigspec.parameters.values() + if p.default is p.empty + and p.kind in (p.POSITIONAL_OR_KEYWORD, p.POSITIONAL_ONLY)) + + +def has_varargs(func, sigspec=None): + sigspec, rv = _check_sigspec(sigspec, func, _sigs._has_varargs, func) + if sigspec is None: + return rv + return any(p.kind == p.VAR_POSITIONAL + for p in sigspec.parameters.values()) + + +def has_keywords(func, sigspec=None): + sigspec, rv = _check_sigspec(sigspec, func, _sigs._has_keywords, func) + if sigspec is None: + return rv + return any(p.default is not p.empty + or p.kind in (p.KEYWORD_ONLY, p.VAR_KEYWORD) + for p in sigspec.parameters.values()) + + +def is_valid_args(func, args, kwargs, sigspec=None): + sigspec, rv = _check_sigspec(sigspec, func, _sigs._is_valid_args, + func, args, kwargs) + if sigspec is None: + return rv + try: + sigspec.bind(*args, **kwargs) + except TypeError: + return False + return True + + +def is_partial_args(func, args, kwargs, sigspec=None): + sigspec, rv = _check_sigspec(sigspec, func, _sigs._is_partial_args, + func, args, kwargs) + if sigspec is None: + return rv + try: + sigspec.bind_partial(*args, **kwargs) + except TypeError: + return False + return True + + +def is_arity(n, func, sigspec=None): + """ Does a function have only n positional arguments? + + This function relies on introspection and does not call the function. + Returns None if validity can't be determined. + + >>> def f(x): + ... return x + >>> is_arity(1, f) + True + >>> def g(x, y=1): + ... return x + y + >>> is_arity(1, g) + False + """ + sigspec, rv = _check_sigspec(sigspec, func, _sigs._is_arity, n, func) + if sigspec is None: + return rv + num = num_required_args(func, sigspec) + if num is not None: + num = num == n + if not num: + return False + varargs = has_varargs(func, sigspec) + if varargs: + return False + keywords = has_keywords(func, sigspec) + if keywords: + return False + if num is None or varargs is None or keywords is None: # pragma: no cover + return None + return True + + +num_required_args.__doc__ = """ \ +Number of required positional arguments + + This function relies on introspection and does not call the function. + Returns None if validity can't be determined. + + >>> def f(x, y, z=3): + ... return x + y + z + >>> num_required_args(f) + 2 + >>> def g(*args, **kwargs): + ... pass + >>> num_required_args(g) + 0 + """ + +has_varargs.__doc__ = """ \ +Does a function have variadic positional arguments? + + This function relies on introspection and does not call the function. + Returns None if validity can't be determined. + + >>> def f(*args): + ... return args + >>> has_varargs(f) + True + >>> def g(**kwargs): + ... return kwargs + >>> has_varargs(g) + False + """ + +has_keywords.__doc__ = """ \ +Does a function have keyword arguments? + + This function relies on introspection and does not call the function. + Returns None if validity can't be determined. + + >>> def f(x, y=0): + ... return x + y + + >>> has_keywords(f) + True + """ + +is_valid_args.__doc__ = """ \ +Is ``func(*args, **kwargs)`` a valid function call? + + This function relies on introspection and does not call the function. + Returns None if validity can't be determined. + + >>> def add(x, y): + ... return x + y + + >>> is_valid_args(add, (1,), {}) + False + >>> is_valid_args(add, (1, 2), {}) + True + >>> is_valid_args(map, (), {}) + False + + **Implementation notes** + Python 2 relies on ``inspect.getargspec``, which only works for + user-defined functions. Python 3 uses ``inspect.signature``, which + works for many more types of callables. + + Many builtins in the standard library are also supported. + """ + +is_partial_args.__doc__ = """ \ +Can partial(func, *args, **kwargs)(*args2, **kwargs2) be a valid call? + + Returns True *only* if the call is valid or if it is possible for the + call to become valid by adding more positional or keyword arguments. + + This function relies on introspection and does not call the function. + Returns None if validity can't be determined. + + >>> def add(x, y): + ... return x + y + + >>> is_partial_args(add, (1,), {}) + True + >>> is_partial_args(add, (1, 2), {}) + True + >>> is_partial_args(add, (1, 2, 3), {}) + False + >>> is_partial_args(map, (), {}) + True + + **Implementation notes** + Python 2 relies on ``inspect.getargspec``, which only works for + user-defined functions. Python 3 uses ``inspect.signature``, which + works for many more types of callables. + + Many builtins in the standard library are also supported. + """ + +from . import _signatures as _sigs diff --git a/shared/package-files/9d/9df1b2349bcdcbbfe399679b2a37af2ca87200c36f2398f2b64653365a440be8/blob b/shared/package-files/9d/9df1b2349bcdcbbfe399679b2a37af2ca87200c36f2398f2b64653365a440be8/blob new file mode 100644 index 0000000000000000000000000000000000000000..f6013baf86edcd566a17cd3127467a7443ac475a --- /dev/null +++ b/shared/package-files/9d/9df1b2349bcdcbbfe399679b2a37af2ca87200c36f2398f2b64653365a440be8/blob @@ -0,0 +1,14 @@ +from pandas import ( + TimedeltaIndex, + timedelta_range, +) +import pandas._testing as tm + + +class TestTimedeltaIndexOps: + def test_infer_freq(self, freq_sample): + # GH#11018 + idx = timedelta_range("1", freq=freq_sample, periods=10) + result = TimedeltaIndex(idx.asi8, freq="infer") + tm.assert_index_equal(idx, result) + assert result.freq == freq_sample diff --git a/shared/package-files/9d/9df589ec2e08dd5906368551f421f9c8a20663100f6b4282f0a43f280c05b3c6/blob b/shared/package-files/9d/9df589ec2e08dd5906368551f421f9c8a20663100f6b4282f0a43f280c05b3c6/blob new file mode 100644 index 0000000000000000000000000000000000000000..3c607fe45da7713dc52ca01ce70abb53cdebb42f --- /dev/null +++ b/shared/package-files/9d/9df589ec2e08dd5906368551f421f9c8a20663100f6b4282f0a43f280c05b3c6/blob @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +import logging +from typing import Dict, List + +__all__: List[str] = [] + +_log_handlers: Dict[str, logging.Handler] = { + "default": logging.NullHandler(), +} diff --git a/shared/package-files/9d/9df83af9b5360fa0cc1166fd10c2014799319cdb1b0d2c7450a7c71ff673a857/blob b/shared/package-files/9d/9df83af9b5360fa0cc1166fd10c2014799319cdb1b0d2c7450a7c71ff673a857/blob new file mode 100644 index 0000000000000000000000000000000000000000..4303b903e5e007484c0d8e1eea43a35e9b53f38b Binary files /dev/null and b/shared/package-files/9d/9df83af9b5360fa0cc1166fd10c2014799319cdb1b0d2c7450a7c71ff673a857/blob differ diff --git a/shared/package-files/9d/9df9372d87b6e8f8d9ceb4ee83e64328a088faab264ec4027e3f7df9f47d4efc/blob b/shared/package-files/9d/9df9372d87b6e8f8d9ceb4ee83e64328a088faab264ec4027e3f7df9f47d4efc/blob new file mode 100644 index 0000000000000000000000000000000000000000..1e2d8134f8679332a58e1c522332b96e50256116 --- /dev/null +++ b/shared/package-files/9d/9df9372d87b6e8f8d9ceb4ee83e64328a088faab264ec4027e3f7df9f47d4efc/blob @@ -0,0 +1,4174 @@ +# +# Author: Travis Oliphant 2002-2011 with contributions from +# SciPy Developers 2004-2011 +# +from scipy._lib._util import getfullargspec_no_self as _getfullargspec + +import sys +import keyword +import re +import types +import warnings +from itertools import zip_longest + +from scipy._lib import doccer +from ._distr_params import distcont, distdiscrete +from scipy._lib._util import check_random_state, _lazywhere + +from scipy.special import comb, entr + + +# for root finding for continuous distribution ppf, and maximum likelihood +# estimation +from scipy import optimize + +# for functions of continuous distributions (e.g. moments, entropy, cdf) +from scipy import integrate + +# to approximate the pdf of a continuous distribution given its cdf +from scipy._lib._finite_differences import _derivative + +# for scipy.stats.entropy. Attempts to import just that function or file +# have cause import problems +from scipy import stats + +from numpy import (arange, putmask, ones, shape, ndarray, zeros, floor, + logical_and, log, sqrt, place, argmax, vectorize, asarray, + nan, inf, isinf, empty) + +import numpy as np +from ._constants import _XMAX, _LOGXMAX +from ._censored_data import CensoredData +from scipy.stats._warnings_errors import FitError + +# These are the docstring parts used for substitution in specific +# distribution docstrings + +docheaders = {'methods': """\nMethods\n-------\n""", + 'notes': """\nNotes\n-----\n""", + 'examples': """\nExamples\n--------\n"""} + +_doc_rvs = """\ +rvs(%(shapes)s, loc=0, scale=1, size=1, random_state=None) + Random variates. +""" +_doc_pdf = """\ +pdf(x, %(shapes)s, loc=0, scale=1) + Probability density function. +""" +_doc_logpdf = """\ +logpdf(x, %(shapes)s, loc=0, scale=1) + Log of the probability density function. +""" +_doc_pmf = """\ +pmf(k, %(shapes)s, loc=0, scale=1) + Probability mass function. +""" +_doc_logpmf = """\ +logpmf(k, %(shapes)s, loc=0, scale=1) + Log of the probability mass function. +""" +_doc_cdf = """\ +cdf(x, %(shapes)s, loc=0, scale=1) + Cumulative distribution function. +""" +_doc_logcdf = """\ +logcdf(x, %(shapes)s, loc=0, scale=1) + Log of the cumulative distribution function. +""" +_doc_sf = """\ +sf(x, %(shapes)s, loc=0, scale=1) + Survival function (also defined as ``1 - cdf``, but `sf` is sometimes more accurate). +""" # noqa: E501 +_doc_logsf = """\ +logsf(x, %(shapes)s, loc=0, scale=1) + Log of the survival function. +""" +_doc_ppf = """\ +ppf(q, %(shapes)s, loc=0, scale=1) + Percent point function (inverse of ``cdf`` --- percentiles). +""" +_doc_isf = """\ +isf(q, %(shapes)s, loc=0, scale=1) + Inverse survival function (inverse of ``sf``). +""" +_doc_moment = """\ +moment(order, %(shapes)s, loc=0, scale=1) + Non-central moment of the specified order. +""" +_doc_stats = """\ +stats(%(shapes)s, loc=0, scale=1, moments='mv') + Mean('m'), variance('v'), skew('s'), and/or kurtosis('k'). +""" +_doc_entropy = """\ +entropy(%(shapes)s, loc=0, scale=1) + (Differential) entropy of the RV. +""" +_doc_fit = """\ +fit(data) + Parameter estimates for generic data. + See `scipy.stats.rv_continuous.fit `__ for detailed documentation of the + keyword arguments. +""" # noqa: E501 +_doc_expect = """\ +expect(func, args=(%(shapes_)s), loc=0, scale=1, lb=None, ub=None, conditional=False, **kwds) + Expected value of a function (of one argument) with respect to the distribution. +""" # noqa: E501 +_doc_expect_discrete = """\ +expect(func, args=(%(shapes_)s), loc=0, lb=None, ub=None, conditional=False) + Expected value of a function (of one argument) with respect to the distribution. +""" +_doc_median = """\ +median(%(shapes)s, loc=0, scale=1) + Median of the distribution. +""" +_doc_mean = """\ +mean(%(shapes)s, loc=0, scale=1) + Mean of the distribution. +""" +_doc_var = """\ +var(%(shapes)s, loc=0, scale=1) + Variance of the distribution. +""" +_doc_std = """\ +std(%(shapes)s, loc=0, scale=1) + Standard deviation of the distribution. +""" +_doc_interval = """\ +interval(confidence, %(shapes)s, loc=0, scale=1) + Confidence interval with equal areas around the median. +""" +_doc_allmethods = ''.join([docheaders['methods'], _doc_rvs, _doc_pdf, + _doc_logpdf, _doc_cdf, _doc_logcdf, _doc_sf, + _doc_logsf, _doc_ppf, _doc_isf, _doc_moment, + _doc_stats, _doc_entropy, _doc_fit, + _doc_expect, _doc_median, + _doc_mean, _doc_var, _doc_std, _doc_interval]) + +_doc_default_longsummary = """\ +As an instance of the `rv_continuous` class, `%(name)s` object inherits from it +a collection of generic methods (see below for the full list), +and completes them with details specific for this particular distribution. +""" + +_doc_default_frozen_note = """ +Alternatively, the object may be called (as a function) to fix the shape, +location, and scale parameters returning a "frozen" continuous RV object: + +rv = %(name)s(%(shapes)s, loc=0, scale=1) + - Frozen RV object with the same methods but holding the given shape, + location, and scale fixed. +""" +_doc_default_example = """\ +Examples +-------- +>>> import numpy as np +>>> from scipy.stats import %(name)s +>>> import matplotlib.pyplot as plt +>>> fig, ax = plt.subplots(1, 1) + +Calculate the first four moments: + +%(set_vals_stmt)s +>>> mean, var, skew, kurt = %(name)s.stats(%(shapes)s, moments='mvsk') + +Display the probability density function (``pdf``): + +>>> x = np.linspace(%(name)s.ppf(0.01, %(shapes)s), +... %(name)s.ppf(0.99, %(shapes)s), 100) +>>> ax.plot(x, %(name)s.pdf(x, %(shapes)s), +... 'r-', lw=5, alpha=0.6, label='%(name)s pdf') + +Alternatively, the distribution object can be called (as a function) +to fix the shape, location and scale parameters. This returns a "frozen" +RV object holding the given parameters fixed. + +Freeze the distribution and display the frozen ``pdf``: + +>>> rv = %(name)s(%(shapes)s) +>>> ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf') + +Check accuracy of ``cdf`` and ``ppf``: + +>>> vals = %(name)s.ppf([0.001, 0.5, 0.999], %(shapes)s) +>>> np.allclose([0.001, 0.5, 0.999], %(name)s.cdf(vals, %(shapes)s)) +True + +Generate random numbers: + +>>> r = %(name)s.rvs(%(shapes)s, size=1000) + +And compare the histogram: + +>>> ax.hist(r, density=True, bins='auto', histtype='stepfilled', alpha=0.2) +>>> ax.set_xlim([x[0], x[-1]]) +>>> ax.legend(loc='best', frameon=False) +>>> plt.show() + +""" + +_doc_default_locscale = """\ +The probability density above is defined in the "standardized" form. To shift +and/or scale the distribution use the ``loc`` and ``scale`` parameters. +Specifically, ``%(name)s.pdf(x, %(shapes)s, loc, scale)`` is identically +equivalent to ``%(name)s.pdf(y, %(shapes)s) / scale`` with +``y = (x - loc) / scale``. Note that shifting the location of a distribution +does not make it a "noncentral" distribution; noncentral generalizations of +some distributions are available in separate classes. +""" + +_doc_default = ''.join([_doc_default_longsummary, + _doc_allmethods, + '\n', + _doc_default_example]) + +_doc_default_before_notes = ''.join([_doc_default_longsummary, + _doc_allmethods]) + +docdict = { + 'rvs': _doc_rvs, + 'pdf': _doc_pdf, + 'logpdf': _doc_logpdf, + 'cdf': _doc_cdf, + 'logcdf': _doc_logcdf, + 'sf': _doc_sf, + 'logsf': _doc_logsf, + 'ppf': _doc_ppf, + 'isf': _doc_isf, + 'stats': _doc_stats, + 'entropy': _doc_entropy, + 'fit': _doc_fit, + 'moment': _doc_moment, + 'expect': _doc_expect, + 'interval': _doc_interval, + 'mean': _doc_mean, + 'std': _doc_std, + 'var': _doc_var, + 'median': _doc_median, + 'allmethods': _doc_allmethods, + 'longsummary': _doc_default_longsummary, + 'frozennote': _doc_default_frozen_note, + 'example': _doc_default_example, + 'default': _doc_default, + 'before_notes': _doc_default_before_notes, + 'after_notes': _doc_default_locscale +} + +# Reuse common content between continuous and discrete docs, change some +# minor bits. +docdict_discrete = docdict.copy() + +docdict_discrete['pmf'] = _doc_pmf +docdict_discrete['logpmf'] = _doc_logpmf +docdict_discrete['expect'] = _doc_expect_discrete +_doc_disc_methods = ['rvs', 'pmf', 'logpmf', 'cdf', 'logcdf', 'sf', 'logsf', + 'ppf', 'isf', 'stats', 'entropy', 'expect', 'median', + 'mean', 'var', 'std', 'interval'] +for obj in _doc_disc_methods: + docdict_discrete[obj] = docdict_discrete[obj].replace(', scale=1', '') + +_doc_disc_methods_err_varname = ['cdf', 'logcdf', 'sf', 'logsf'] +for obj in _doc_disc_methods_err_varname: + docdict_discrete[obj] = docdict_discrete[obj].replace('(x, ', '(k, ') + +docdict_discrete.pop('pdf') +docdict_discrete.pop('logpdf') + +_doc_allmethods = ''.join([docdict_discrete[obj] for obj in _doc_disc_methods]) +docdict_discrete['allmethods'] = docheaders['methods'] + _doc_allmethods + +docdict_discrete['longsummary'] = _doc_default_longsummary.replace( + 'rv_continuous', 'rv_discrete') + +_doc_default_frozen_note = """ +Alternatively, the object may be called (as a function) to fix the shape and +location parameters returning a "frozen" discrete RV object: + +rv = %(name)s(%(shapes)s, loc=0) + - Frozen RV object with the same methods but holding the given shape and + location fixed. +""" +docdict_discrete['frozennote'] = _doc_default_frozen_note + +_doc_default_discrete_example = """\ +Examples +-------- +>>> import numpy as np +>>> from scipy.stats import %(name)s +>>> import matplotlib.pyplot as plt +>>> fig, ax = plt.subplots(1, 1) + +Calculate the first four moments: + +%(set_vals_stmt)s +>>> mean, var, skew, kurt = %(name)s.stats(%(shapes)s, moments='mvsk') + +Display the probability mass function (``pmf``): + +>>> x = np.arange(%(name)s.ppf(0.01, %(shapes)s), +... %(name)s.ppf(0.99, %(shapes)s)) +>>> ax.plot(x, %(name)s.pmf(x, %(shapes)s), 'bo', ms=8, label='%(name)s pmf') +>>> ax.vlines(x, 0, %(name)s.pmf(x, %(shapes)s), colors='b', lw=5, alpha=0.5) + +Alternatively, the distribution object can be called (as a function) +to fix the shape and location. This returns a "frozen" RV object holding +the given parameters fixed. + +Freeze the distribution and display the frozen ``pmf``: + +>>> rv = %(name)s(%(shapes)s) +>>> ax.vlines(x, 0, rv.pmf(x), colors='k', linestyles='-', lw=1, +... label='frozen pmf') +>>> ax.legend(loc='best', frameon=False) +>>> plt.show() + +Check accuracy of ``cdf`` and ``ppf``: + +>>> prob = %(name)s.cdf(x, %(shapes)s) +>>> np.allclose(x, %(name)s.ppf(prob, %(shapes)s)) +True + +Generate random numbers: + +>>> r = %(name)s.rvs(%(shapes)s, size=1000) +""" + + +_doc_default_discrete_locscale = """\ +The probability mass function above is defined in the "standardized" form. +To shift distribution use the ``loc`` parameter. +Specifically, ``%(name)s.pmf(k, %(shapes)s, loc)`` is identically +equivalent to ``%(name)s.pmf(k - loc, %(shapes)s)``. +""" + +docdict_discrete['example'] = _doc_default_discrete_example +docdict_discrete['after_notes'] = _doc_default_discrete_locscale + +_doc_default_before_notes = ''.join([docdict_discrete['longsummary'], + docdict_discrete['allmethods']]) +docdict_discrete['before_notes'] = _doc_default_before_notes + +_doc_default_disc = ''.join([docdict_discrete['longsummary'], + docdict_discrete['allmethods'], + docdict_discrete['frozennote'], + docdict_discrete['example']]) +docdict_discrete['default'] = _doc_default_disc + +# clean up all the separate docstring elements, we do not need them anymore +for obj in [s for s in dir() if s.startswith('_doc_')]: + exec('del ' + obj) +del obj + + +def _moment(data, n, mu=None): + if mu is None: + mu = data.mean() + return ((data - mu)**n).mean() + + +def _moment_from_stats(n, mu, mu2, g1, g2, moment_func, args): + if (n == 0): + return 1.0 + elif (n == 1): + if mu is None: + val = moment_func(1, *args) + else: + val = mu + elif (n == 2): + if mu2 is None or mu is None: + val = moment_func(2, *args) + else: + val = mu2 + mu*mu + elif (n == 3): + if g1 is None or mu2 is None or mu is None: + val = moment_func(3, *args) + else: + mu3 = g1 * np.power(mu2, 1.5) # 3rd central moment + val = mu3+3*mu*mu2+mu*mu*mu # 3rd non-central moment + elif (n == 4): + if g1 is None or g2 is None or mu2 is None or mu is None: + val = moment_func(4, *args) + else: + mu4 = (g2+3.0)*(mu2**2.0) # 4th central moment + mu3 = g1*np.power(mu2, 1.5) # 3rd central moment + val = mu4+4*mu*mu3+6*mu*mu*mu2+mu*mu*mu*mu + else: + val = moment_func(n, *args) + + return val + + +def _skew(data): + """ + skew is third central moment / variance**(1.5) + """ + data = np.ravel(data) + mu = data.mean() + m2 = ((data - mu)**2).mean() + m3 = ((data - mu)**3).mean() + return m3 / np.power(m2, 1.5) + + +def _kurtosis(data): + """Fisher's excess kurtosis is fourth central moment / variance**2 - 3.""" + data = np.ravel(data) + mu = data.mean() + m2 = ((data - mu)**2).mean() + m4 = ((data - mu)**4).mean() + return m4 / m2**2 - 3 + +def _vectorize_rvs_over_shapes(_rvs1): + """Decorator that vectorizes _rvs method to work on ndarray shapes""" + # _rvs1 must be a _function_ that accepts _scalar_ args as positional + # arguments, `size` and `random_state` as keyword arguments. + # _rvs1 must return a random variate array with shape `size`. If `size` is + # None, _rvs1 must return a scalar. + # When applied to _rvs1, this decorator broadcasts ndarray args + # and loops over them, calling _rvs1 for each set of scalar args. + # For usage example, see _nchypergeom_gen + def _rvs(*args, size, random_state): + _rvs1_size, _rvs1_indices = _check_shape(args[0].shape, size) + + size = np.array(size) + _rvs1_size = np.array(_rvs1_size) + _rvs1_indices = np.array(_rvs1_indices) + + if np.all(_rvs1_indices): # all args are scalars + return _rvs1(*args, size, random_state) + + out = np.empty(size) + + # out.shape can mix dimensions associated with arg_shape and _rvs1_size + # Sort them to arg_shape + _rvs1_size for easy indexing of dimensions + # corresponding with the different sets of scalar args + j0 = np.arange(out.ndim) + j1 = np.hstack((j0[~_rvs1_indices], j0[_rvs1_indices])) + out = np.moveaxis(out, j1, j0) + + for i in np.ndindex(*size[~_rvs1_indices]): + # arg can be squeezed because singleton dimensions will be + # associated with _rvs1_size, not arg_shape per _check_shape + out[i] = _rvs1(*[np.squeeze(arg)[i] for arg in args], + _rvs1_size, random_state) + + return np.moveaxis(out, j0, j1) # move axes back before returning + return _rvs + + +def _fit_determine_optimizer(optimizer): + if not callable(optimizer) and isinstance(optimizer, str): + if not optimizer.startswith('fmin_'): + optimizer = "fmin_"+optimizer + if optimizer == 'fmin_': + optimizer = 'fmin' + try: + optimizer = getattr(optimize, optimizer) + except AttributeError as e: + raise ValueError(f"{optimizer} is not a valid optimizer") from e + return optimizer + +def _isintegral(x): + return x == np.round(x) + +def _sum_finite(x): + """ + For a 1D array x, return a tuple containing the sum of the + finite values of x and the number of nonfinite values. + + This is a utility function used when evaluating the negative + loglikelihood for a distribution and an array of samples. + + Examples + -------- + >>> import numpy as np + >>> from scipy.stats._distn_infrastructure import _sum_finite + >>> tot, nbad = _sum_finite(np.array([-2, -np.inf, 5, 1])) + >>> tot + 4.0 + >>> nbad + 1 + """ + finite_x = np.isfinite(x) + bad_count = finite_x.size - np.count_nonzero(finite_x) + return np.sum(x[finite_x]), bad_count + + +# Frozen RV class +class rv_frozen: + + def __init__(self, dist, *args, **kwds): + self.args = args + self.kwds = kwds + + # create a new instance + self.dist = dist.__class__(**dist._updated_ctor_param()) + + shapes, _, _ = self.dist._parse_args(*args, **kwds) + self.a, self.b = self.dist._get_support(*shapes) + + @property + def random_state(self): + return self.dist._random_state + + @random_state.setter + def random_state(self, seed): + self.dist._random_state = check_random_state(seed) + + def cdf(self, x): + return self.dist.cdf(x, *self.args, **self.kwds) + + def logcdf(self, x): + return self.dist.logcdf(x, *self.args, **self.kwds) + + def ppf(self, q): + return self.dist.ppf(q, *self.args, **self.kwds) + + def isf(self, q): + return self.dist.isf(q, *self.args, **self.kwds) + + def rvs(self, size=None, random_state=None): + kwds = self.kwds.copy() + kwds.update({'size': size, 'random_state': random_state}) + return self.dist.rvs(*self.args, **kwds) + + def sf(self, x): + return self.dist.sf(x, *self.args, **self.kwds) + + def logsf(self, x): + return self.dist.logsf(x, *self.args, **self.kwds) + + def stats(self, moments='mv'): + kwds = self.kwds.copy() + kwds.update({'moments': moments}) + return self.dist.stats(*self.args, **kwds) + + def median(self): + return self.dist.median(*self.args, **self.kwds) + + def mean(self): + return self.dist.mean(*self.args, **self.kwds) + + def var(self): + return self.dist.var(*self.args, **self.kwds) + + def std(self): + return self.dist.std(*self.args, **self.kwds) + + def moment(self, order=None): + return self.dist.moment(order, *self.args, **self.kwds) + + def entropy(self): + return self.dist.entropy(*self.args, **self.kwds) + + def interval(self, confidence=None): + return self.dist.interval(confidence, *self.args, **self.kwds) + + def expect(self, func=None, lb=None, ub=None, conditional=False, **kwds): + # expect method only accepts shape parameters as positional args + # hence convert self.args, self.kwds, also loc/scale + # See the .expect method docstrings for the meaning of + # other parameters. + a, loc, scale = self.dist._parse_args(*self.args, **self.kwds) + if isinstance(self.dist, rv_discrete): + return self.dist.expect(func, a, loc, lb, ub, conditional, **kwds) + else: + return self.dist.expect(func, a, loc, scale, lb, ub, + conditional, **kwds) + + def support(self): + return self.dist.support(*self.args, **self.kwds) + + +class rv_discrete_frozen(rv_frozen): + + def pmf(self, k): + return self.dist.pmf(k, *self.args, **self.kwds) + + def logpmf(self, k): # No error + return self.dist.logpmf(k, *self.args, **self.kwds) + + +class rv_continuous_frozen(rv_frozen): + + def pdf(self, x): + return self.dist.pdf(x, *self.args, **self.kwds) + + def logpdf(self, x): + return self.dist.logpdf(x, *self.args, **self.kwds) + + +def argsreduce(cond, *args): + """Clean arguments to: + + 1. Ensure all arguments are iterable (arrays of dimension at least one + 2. If cond != True and size > 1, ravel(args[i]) where ravel(condition) is + True, in 1D. + + Return list of processed arguments. + + Examples + -------- + >>> import numpy as np + >>> from scipy.stats._distn_infrastructure import argsreduce + >>> rng = np.random.default_rng() + >>> A = rng.random((4, 5)) + >>> B = 2 + >>> C = rng.random((1, 5)) + >>> cond = np.ones(A.shape) + >>> [A1, B1, C1] = argsreduce(cond, A, B, C) + >>> A1.shape + (4, 5) + >>> B1.shape + (1,) + >>> C1.shape + (1, 5) + >>> cond[2,:] = 0 + >>> [A1, B1, C1] = argsreduce(cond, A, B, C) + >>> A1.shape + (15,) + >>> B1.shape + (1,) + >>> C1.shape + (15,) + + """ + # some distributions assume arguments are iterable. + newargs = np.atleast_1d(*args) + + # np.atleast_1d returns an array if only one argument, or a list of arrays + # if more than one argument. + if not isinstance(newargs, (list | tuple)): + newargs = (newargs,) + + if np.all(cond): + # broadcast arrays with cond + *newargs, cond = np.broadcast_arrays(*newargs, cond) + return [arg.ravel() for arg in newargs] + + s = cond.shape + # np.extract returns flattened arrays, which are not broadcastable together + # unless they are either the same size or size == 1. + return [(arg if np.size(arg) == 1 + else np.extract(cond, np.broadcast_to(arg, s))) + for arg in newargs] + + +parse_arg_template = """ +def _parse_args(self, %(shape_arg_str)s %(locscale_in)s): + return (%(shape_arg_str)s), %(locscale_out)s + +def _parse_args_rvs(self, %(shape_arg_str)s %(locscale_in)s, size=None): + return self._argcheck_rvs(%(shape_arg_str)s %(locscale_out)s, size=size) + +def _parse_args_stats(self, %(shape_arg_str)s %(locscale_in)s, moments='mv'): + return (%(shape_arg_str)s), %(locscale_out)s, moments +""" + + +class rv_generic: + """Class which encapsulates common functionality between rv_discrete + and rv_continuous. + + """ + + def __init__(self, seed=None): + super().__init__() + + # figure out if _stats signature has 'moments' keyword + sig = _getfullargspec(self._stats) + self._stats_has_moments = ((sig.varkw is not None) or + ('moments' in sig.args) or + ('moments' in sig.kwonlyargs)) + self._random_state = check_random_state(seed) + + @property + def random_state(self): + """Get or set the generator object for generating random variates. + + If `random_state` is None (or `np.random`), the + `numpy.random.RandomState` singleton is used. + If `random_state` is an int, a new ``RandomState`` instance is used, + seeded with `random_state`. + If `random_state` is already a ``Generator`` or ``RandomState`` + instance, that instance is used. + + """ + return self._random_state + + @random_state.setter + def random_state(self, seed): + self._random_state = check_random_state(seed) + + def __setstate__(self, state): + try: + self.__dict__.update(state) + # attaches the dynamically created methods on each instance. + # if a subclass overrides rv_generic.__setstate__, or implements + # it's own _attach_methods, then it must make sure that + # _attach_argparser_methods is called. + self._attach_methods() + except ValueError: + # reconstitute an old pickle scipy<1.6, that contains + # (_ctor_param, random_state) as state + self._ctor_param = state[0] + self._random_state = state[1] + self.__init__() + + def _attach_methods(self): + """Attaches dynamically created methods to the rv_* instance. + + This method must be overridden by subclasses, and must itself call + _attach_argparser_methods. This method is called in __init__ in + subclasses, and in __setstate__ + """ + raise NotImplementedError + + def _attach_argparser_methods(self): + """ + Generates the argument-parsing functions dynamically and attaches + them to the instance. + + Should be called from `_attach_methods`, typically in __init__ and + during unpickling (__setstate__) + """ + ns = {} + exec(self._parse_arg_template, ns) + # NB: attach to the instance, not class + for name in ['_parse_args', '_parse_args_stats', '_parse_args_rvs']: + setattr(self, name, types.MethodType(ns[name], self)) + + def _construct_argparser( + self, meths_to_inspect, locscale_in, locscale_out): + """Construct the parser string for the shape arguments. + + This method should be called in __init__ of a class for each + distribution. It creates the `_parse_arg_template` attribute that is + then used by `_attach_argparser_methods` to dynamically create and + attach the `_parse_args`, `_parse_args_stats`, `_parse_args_rvs` + methods to the instance. + + If self.shapes is a non-empty string, interprets it as a + comma-separated list of shape parameters. + + Otherwise inspects the call signatures of `meths_to_inspect` + and constructs the argument-parsing functions from these. + In this case also sets `shapes` and `numargs`. + """ + + if self.shapes: + # sanitize the user-supplied shapes + if not isinstance(self.shapes, str): + raise TypeError('shapes must be a string.') + + shapes = self.shapes.replace(',', ' ').split() + + for field in shapes: + if keyword.iskeyword(field): + raise SyntaxError('keywords cannot be used as shapes.') + if not re.match('^[_a-zA-Z][_a-zA-Z0-9]*$', field): + raise SyntaxError( + 'shapes must be valid python identifiers') + else: + # find out the call signatures (_pdf, _cdf etc), deduce shape + # arguments. Generic methods only have 'self, x', any further args + # are shapes. + shapes_list = [] + for meth in meths_to_inspect: + shapes_args = _getfullargspec(meth) # NB does not contain self + args = shapes_args.args[1:] # peel off 'x', too + + if args: + shapes_list.append(args) + + # *args or **kwargs are not allowed w/automatic shapes + if shapes_args.varargs is not None: + raise TypeError( + '*args are not allowed w/out explicit shapes') + if shapes_args.varkw is not None: + raise TypeError( + '**kwds are not allowed w/out explicit shapes') + if shapes_args.kwonlyargs: + raise TypeError( + 'kwonly args are not allowed w/out explicit shapes') + if shapes_args.defaults is not None: + raise TypeError('defaults are not allowed for shapes') + + if shapes_list: + shapes = shapes_list[0] + + # make sure the signatures are consistent + for item in shapes_list: + if item != shapes: + raise TypeError('Shape arguments are inconsistent.') + else: + shapes = [] + + # have the arguments, construct the method from template + shapes_str = ', '.join(shapes) + ', ' if shapes else '' # NB: not None + dct = dict(shape_arg_str=shapes_str, + locscale_in=locscale_in, + locscale_out=locscale_out, + ) + + # this string is used by _attach_argparser_methods + self._parse_arg_template = parse_arg_template % dct + + self.shapes = ', '.join(shapes) if shapes else None + if not hasattr(self, 'numargs'): + # allows more general subclassing with *args + self.numargs = len(shapes) + + def _construct_doc(self, docdict, shapes_vals=None): + """Construct the instance docstring with string substitutions.""" + tempdict = docdict.copy() + tempdict['name'] = self.name or 'distname' + tempdict['shapes'] = self.shapes or '' + + if shapes_vals is None: + shapes_vals = () + try: + vals = ', '.join(f'{val:.3g}' for val in shapes_vals) + except TypeError: + vals = ', '.join(f'{val}' for val in shapes_vals) + tempdict['vals'] = vals + + tempdict['shapes_'] = self.shapes or '' + if self.shapes and self.numargs == 1: + tempdict['shapes_'] += ',' + + if self.shapes: + tempdict['set_vals_stmt'] = f'>>> {self.shapes} = {vals}' + else: + tempdict['set_vals_stmt'] = '' + + if self.shapes is None: + # remove shapes from call parameters if there are none + for item in ['default', 'before_notes']: + tempdict[item] = tempdict[item].replace( + "\n%(shapes)s : array_like\n shape parameters", "") + for i in range(2): + if self.shapes is None: + # necessary because we use %(shapes)s in two forms (w w/o ", ") + self.__doc__ = self.__doc__.replace("%(shapes)s, ", "") + try: + self.__doc__ = doccer.docformat(self.__doc__, tempdict) + except TypeError as e: + raise Exception("Unable to construct docstring for " + f"distribution \"{self.name}\": {repr(e)}") from e + + # correct for empty shapes + self.__doc__ = self.__doc__.replace('(, ', '(').replace(', )', ')') + + def _construct_default_doc(self, longname=None, + docdict=None, discrete='continuous'): + """Construct instance docstring from the default template.""" + if longname is None: + longname = 'A' + self.__doc__ = ''.join([f'{longname} {discrete} random variable.', + '\n\n%(before_notes)s\n', docheaders['notes'], + '\n%(example)s']) + self._construct_doc(docdict) + + def freeze(self, *args, **kwds): + """Freeze the distribution for the given arguments. + + Parameters + ---------- + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution. Should include all + the non-optional arguments, may include ``loc`` and ``scale``. + + Returns + ------- + rv_frozen : rv_frozen instance + The frozen distribution. + + """ + if isinstance(self, rv_continuous): + return rv_continuous_frozen(self, *args, **kwds) + else: + return rv_discrete_frozen(self, *args, **kwds) + + def __call__(self, *args, **kwds): + return self.freeze(*args, **kwds) + __call__.__doc__ = freeze.__doc__ + + # The actual calculation functions (no basic checking need be done) + # If these are defined, the others won't be looked at. + # Otherwise, the other set can be defined. + def _stats(self, *args, **kwds): + return None, None, None, None + + # Noncentral moments (also known as the moment about the origin). + # Expressed in LaTeX, munp would be $\mu'_{n}$, i.e. "mu-sub-n-prime". + # The primed mu is a widely used notation for the noncentral moment. + def _munp(self, n, *args): + # Silence floating point warnings from integration. + with np.errstate(all='ignore'): + vals = self.generic_moment(n, *args) + return vals + + def _argcheck_rvs(self, *args, **kwargs): + # Handle broadcasting and size validation of the rvs method. + # Subclasses should not have to override this method. + # The rule is that if `size` is not None, then `size` gives the + # shape of the result (integer values of `size` are treated as + # tuples with length 1; i.e. `size=3` is the same as `size=(3,)`.) + # + # `args` is expected to contain the shape parameters (if any), the + # location and the scale in a flat tuple (e.g. if there are two + # shape parameters `a` and `b`, `args` will be `(a, b, loc, scale)`). + # The only keyword argument expected is 'size'. + size = kwargs.get('size', None) + all_bcast = np.broadcast_arrays(*args) + + def squeeze_left(a): + while a.ndim > 0 and a.shape[0] == 1: + a = a[0] + return a + + # Eliminate trivial leading dimensions. In the convention + # used by numpy's random variate generators, trivial leading + # dimensions are effectively ignored. In other words, when `size` + # is given, trivial leading dimensions of the broadcast parameters + # in excess of the number of dimensions in size are ignored, e.g. + # >>> np.random.normal([[1, 3, 5]], [[[[0.01]]]], size=3) + # array([ 1.00104267, 3.00422496, 4.99799278]) + # If `size` is not given, the exact broadcast shape is preserved: + # >>> np.random.normal([[1, 3, 5]], [[[[0.01]]]]) + # array([[[[ 1.00862899, 3.00061431, 4.99867122]]]]) + # + all_bcast = [squeeze_left(a) for a in all_bcast] + bcast_shape = all_bcast[0].shape + bcast_ndim = all_bcast[0].ndim + + if size is None: + size_ = bcast_shape + else: + size_ = tuple(np.atleast_1d(size)) + + # Check compatibility of size_ with the broadcast shape of all + # the parameters. This check is intended to be consistent with + # how the numpy random variate generators (e.g. np.random.normal, + # np.random.beta) handle their arguments. The rule is that, if size + # is given, it determines the shape of the output. Broadcasting + # can't change the output size. + + # This is the standard broadcasting convention of extending the + # shape with fewer dimensions with enough dimensions of length 1 + # so that the two shapes have the same number of dimensions. + ndiff = bcast_ndim - len(size_) + if ndiff < 0: + bcast_shape = (1,)*(-ndiff) + bcast_shape + elif ndiff > 0: + size_ = (1,)*ndiff + size_ + + # This compatibility test is not standard. In "regular" broadcasting, + # two shapes are compatible if for each dimension, the lengths are the + # same or one of the lengths is 1. Here, the length of a dimension in + # size_ must not be less than the corresponding length in bcast_shape. + ok = all([bcdim == 1 or bcdim == szdim + for (bcdim, szdim) in zip(bcast_shape, size_)]) + if not ok: + raise ValueError("size does not match the broadcast shape of " + f"the parameters. {size}, {size_}, {bcast_shape}") + + param_bcast = all_bcast[:-2] + loc_bcast = all_bcast[-2] + scale_bcast = all_bcast[-1] + + return param_bcast, loc_bcast, scale_bcast, size_ + + # These are the methods you must define (standard form functions) + # NB: generic _pdf, _logpdf, _cdf are different for + # rv_continuous and rv_discrete hence are defined in there + def _argcheck(self, *args): + """Default check for correct values on args and keywords. + + Returns condition array of 1's where arguments are correct and + 0's where they are not. + + """ + cond = 1 + for arg in args: + cond = logical_and(cond, (asarray(arg) > 0)) + return cond + + def _get_support(self, *args, **kwargs): + """Return the support of the (unscaled, unshifted) distribution. + + *Must* be overridden by distributions which have support dependent + upon the shape parameters of the distribution. Any such override + *must not* set or change any of the class members, as these members + are shared amongst all instances of the distribution. + + Parameters + ---------- + arg1, arg2, ... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + + Returns + ------- + a, b : numeric (float, or int or +/-np.inf) + end-points of the distribution's support for the specified + shape parameters. + """ + return self.a, self.b + + def _support_mask(self, x, *args): + a, b = self._get_support(*args) + with np.errstate(invalid='ignore'): + return (a <= x) & (x <= b) + + def _open_support_mask(self, x, *args): + a, b = self._get_support(*args) + with np.errstate(invalid='ignore'): + return (a < x) & (x < b) + + def _rvs(self, *args, size=None, random_state=None): + # This method must handle size being a tuple, and it must + # properly broadcast *args and size. size might be + # an empty tuple, which means a scalar random variate is to be + # generated. + + # Use basic inverse cdf algorithm for RV generation as default. + U = random_state.uniform(size=size) + Y = self._ppf(U, *args) + return Y + + def _logcdf(self, x, *args): + with np.errstate(divide='ignore'): + return log(self._cdf(x, *args)) + + def _sf(self, x, *args): + return 1.0-self._cdf(x, *args) + + def _logsf(self, x, *args): + with np.errstate(divide='ignore'): + return log(self._sf(x, *args)) + + def _ppf(self, q, *args): + return self._ppfvec(q, *args) + + def _isf(self, q, *args): + return self._ppf(1.0-q, *args) # use correct _ppf for subclasses + + # These are actually called, and should not be overwritten if you + # want to keep error checking. + def rvs(self, *args, **kwds): + """Random variates of given type. + + Parameters + ---------- + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter (default=0). + scale : array_like, optional + Scale parameter (default=1). + size : int or tuple of ints, optional + Defining number of random variates (default is 1). + random_state : {None, int, `numpy.random.Generator`, + `numpy.random.RandomState`}, optional + + If `random_state` is None (or `np.random`), the + `numpy.random.RandomState` singleton is used. + If `random_state` is an int, a new ``RandomState`` instance is + used, seeded with `random_state`. + If `random_state` is already a ``Generator`` or ``RandomState`` + instance, that instance is used. + + Returns + ------- + rvs : ndarray or scalar + Random variates of given `size`. + + """ + discrete = kwds.pop('discrete', None) + rndm = kwds.pop('random_state', None) + args, loc, scale, size = self._parse_args_rvs(*args, **kwds) + cond = logical_and(self._argcheck(*args), (scale >= 0)) + if not np.all(cond): + message = ("Domain error in arguments. The `scale` parameter must " + "be positive for all distributions, and many " + "distributions have restrictions on shape parameters. " + f"Please see the `scipy.stats.{self.name}` " + "documentation for details.") + raise ValueError(message) + + if np.all(scale == 0): + return loc*ones(size, 'd') + + # extra gymnastics needed for a custom random_state + if rndm is not None: + random_state_saved = self._random_state + random_state = check_random_state(rndm) + else: + random_state = self._random_state + + vals = self._rvs(*args, size=size, random_state=random_state) + + vals = vals * scale + loc + + # do not forget to restore the _random_state + if rndm is not None: + self._random_state = random_state_saved + + # Cast to int if discrete + if discrete and not isinstance(self, rv_sample): + if size == (): + vals = int(vals) + else: + vals = vals.astype(np.int64) + + return vals + + def stats(self, *args, **kwds): + """Some statistics of the given RV. + + Parameters + ---------- + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional (continuous RVs only) + scale parameter (default=1) + moments : str, optional + composed of letters ['mvsk'] defining which moments to compute: + 'm' = mean, + 'v' = variance, + 's' = (Fisher's) skew, + 'k' = (Fisher's) kurtosis. + (default is 'mv') + + Returns + ------- + stats : sequence + of requested moments. + + """ + args, loc, scale, moments = self._parse_args_stats(*args, **kwds) + # scale = 1 by construction for discrete RVs + loc, scale = map(asarray, (loc, scale)) + args = tuple(map(asarray, args)) + cond = self._argcheck(*args) & (scale > 0) & (loc == loc) + output = [] + default = np.full(shape(cond), fill_value=self.badvalue) + + # Use only entries that are valid in calculation + if np.any(cond): + goodargs = argsreduce(cond, *(args+(scale, loc))) + scale, loc, goodargs = goodargs[-2], goodargs[-1], goodargs[:-2] + + if self._stats_has_moments: + mu, mu2, g1, g2 = self._stats(*goodargs, + **{'moments': moments}) + else: + mu, mu2, g1, g2 = self._stats(*goodargs) + + if 'm' in moments: + if mu is None: + mu = self._munp(1, *goodargs) + out0 = default.copy() + place(out0, cond, mu * scale + loc) + output.append(out0) + + if 'v' in moments: + if mu2 is None: + mu2p = self._munp(2, *goodargs) + if mu is None: + mu = self._munp(1, *goodargs) + # if mean is inf then var is also inf + with np.errstate(invalid='ignore'): + mu2 = np.where(~np.isinf(mu), mu2p - mu**2, np.inf) + out0 = default.copy() + place(out0, cond, mu2 * scale * scale) + output.append(out0) + + if 's' in moments: + if g1 is None: + mu3p = self._munp(3, *goodargs) + if mu is None: + mu = self._munp(1, *goodargs) + if mu2 is None: + mu2p = self._munp(2, *goodargs) + with np.errstate(invalid='ignore'): + mu2 = mu2p - mu * mu + with np.errstate(invalid='ignore'): + mu3 = (-mu*mu - 3*mu2)*mu + mu3p + g1 = mu3 / np.power(mu2, 1.5) + out0 = default.copy() + place(out0, cond, g1) + output.append(out0) + + if 'k' in moments: + if g2 is None: + mu4p = self._munp(4, *goodargs) + if mu is None: + mu = self._munp(1, *goodargs) + if mu2 is None: + mu2p = self._munp(2, *goodargs) + with np.errstate(invalid='ignore'): + mu2 = mu2p - mu * mu + if g1 is None: + mu3 = None + else: + # (mu2**1.5) breaks down for nan and inf + mu3 = g1 * np.power(mu2, 1.5) + if mu3 is None: + mu3p = self._munp(3, *goodargs) + with np.errstate(invalid='ignore'): + mu3 = (-mu * mu - 3 * mu2) * mu + mu3p + with np.errstate(invalid='ignore'): + mu4 = ((-mu**2 - 6*mu2) * mu - 4*mu3)*mu + mu4p + g2 = mu4 / mu2**2.0 - 3.0 + out0 = default.copy() + place(out0, cond, g2) + output.append(out0) + else: # no valid args + output = [default.copy() for _ in moments] + + output = [out[()] for out in output] + if len(output) == 1: + return output[0] + else: + return tuple(output) + + def entropy(self, *args, **kwds): + """Differential entropy of the RV. + + Parameters + ---------- + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter (default=0). + scale : array_like, optional (continuous distributions only). + Scale parameter (default=1). + + Notes + ----- + Entropy is defined base `e`: + + >>> import numpy as np + >>> from scipy.stats._distn_infrastructure import rv_discrete + >>> drv = rv_discrete(values=((0, 1), (0.5, 0.5))) + >>> np.allclose(drv.entropy(), np.log(2.0)) + True + + """ + args, loc, scale = self._parse_args(*args, **kwds) + # NB: for discrete distributions scale=1 by construction in _parse_args + loc, scale = map(asarray, (loc, scale)) + args = tuple(map(asarray, args)) + cond0 = self._argcheck(*args) & (scale > 0) & (loc == loc) + output = zeros(shape(cond0), 'd') + place(output, (1-cond0), self.badvalue) + goodargs = argsreduce(cond0, scale, *args) + goodscale = goodargs[0] + goodargs = goodargs[1:] + place(output, cond0, self.vecentropy(*goodargs) + log(goodscale)) + return output[()] + + def moment(self, order, *args, **kwds): + """non-central moment of distribution of specified order. + + Parameters + ---------- + order : int, order >= 1 + Order of moment. + arg1, arg2, arg3,... : float + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + """ + n = order + shapes, loc, scale = self._parse_args(*args, **kwds) + args = np.broadcast_arrays(*(*shapes, loc, scale)) + *shapes, loc, scale = args + + i0 = np.logical_and(self._argcheck(*shapes), scale > 0) + i1 = np.logical_and(i0, loc == 0) + i2 = np.logical_and(i0, loc != 0) + + args = argsreduce(i0, *shapes, loc, scale) + *shapes, loc, scale = args + + if (floor(n) != n): + raise ValueError("Moment must be an integer.") + if (n < 0): + raise ValueError("Moment must be positive.") + mu, mu2, g1, g2 = None, None, None, None + if (n > 0) and (n < 5): + if self._stats_has_moments: + mdict = {'moments': {1: 'm', 2: 'v', 3: 'vs', 4: 'mvsk'}[n]} + else: + mdict = {} + mu, mu2, g1, g2 = self._stats(*shapes, **mdict) + val = np.empty(loc.shape) # val needs to be indexed by loc + val[...] = _moment_from_stats(n, mu, mu2, g1, g2, self._munp, shapes) + + # Convert to transformed X = L + S*Y + # E[X^n] = E[(L+S*Y)^n] = L^n sum(comb(n, k)*(S/L)^k E[Y^k], k=0...n) + result = zeros(i0.shape) + place(result, ~i0, self.badvalue) + + if i1.any(): + res1 = scale[loc == 0]**n * val[loc == 0] + place(result, i1, res1) + + if i2.any(): + mom = [mu, mu2, g1, g2] + arrs = [i for i in mom if i is not None] + idx = [i for i in range(4) if mom[i] is not None] + if any(idx): + arrs = argsreduce(loc != 0, *arrs) + j = 0 + for i in idx: + mom[i] = arrs[j] + j += 1 + mu, mu2, g1, g2 = mom + args = argsreduce(loc != 0, *shapes, loc, scale, val) + *shapes, loc, scale, val = args + + res2 = zeros(loc.shape, dtype='d') + fac = scale / loc + for k in range(n): + valk = _moment_from_stats(k, mu, mu2, g1, g2, self._munp, + shapes) + res2 += comb(n, k, exact=True)*fac**k * valk + res2 += fac**n * val + res2 *= loc**n + place(result, i2, res2) + + return result[()] + + def median(self, *args, **kwds): + """Median of the distribution. + + Parameters + ---------- + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + Location parameter, Default is 0. + scale : array_like, optional + Scale parameter, Default is 1. + + Returns + ------- + median : float + The median of the distribution. + + See Also + -------- + rv_discrete.ppf + Inverse of the CDF + + """ + return self.ppf(0.5, *args, **kwds) + + def mean(self, *args, **kwds): + """Mean of the distribution. + + Parameters + ---------- + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + mean : float + the mean of the distribution + + """ + kwds['moments'] = 'm' + res = self.stats(*args, **kwds) + if isinstance(res, ndarray) and res.ndim == 0: + return res[()] + return res + + def var(self, *args, **kwds): + """Variance of the distribution. + + Parameters + ---------- + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + var : float + the variance of the distribution + + """ + kwds['moments'] = 'v' + res = self.stats(*args, **kwds) + if isinstance(res, ndarray) and res.ndim == 0: + return res[()] + return res + + def std(self, *args, **kwds): + """Standard deviation of the distribution. + + Parameters + ---------- + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + std : float + standard deviation of the distribution + + """ + kwds['moments'] = 'v' + res = sqrt(self.stats(*args, **kwds)) + return res + + def interval(self, confidence, *args, **kwds): + """Confidence interval with equal areas around the median. + + Parameters + ---------- + confidence : array_like of float + Probability that an rv will be drawn from the returned range. + Each value should be in the range [0, 1]. + arg1, arg2, ... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + location parameter, Default is 0. + scale : array_like, optional + scale parameter, Default is 1. + + Returns + ------- + a, b : ndarray of float + end-points of range that contain ``100 * alpha %`` of the rv's + possible values. + + Notes + ----- + This is implemented as ``ppf([p_tail, 1-p_tail])``, where + ``ppf`` is the inverse cumulative distribution function and + ``p_tail = (1-confidence)/2``. Suppose ``[c, d]`` is the support of a + discrete distribution; then ``ppf([0, 1]) == (c-1, d)``. Therefore, + when ``confidence=1`` and the distribution is discrete, the left end + of the interval will be beyond the support of the distribution. + For discrete distributions, the interval will limit the probability + in each tail to be less than or equal to ``p_tail`` (usually + strictly less). + + """ + alpha = confidence + + alpha = asarray(alpha) + if np.any((alpha > 1) | (alpha < 0)): + raise ValueError("alpha must be between 0 and 1 inclusive") + q1 = (1.0-alpha)/2 + q2 = (1.0+alpha)/2 + a = self.ppf(q1, *args, **kwds) + b = self.ppf(q2, *args, **kwds) + return a, b + + def support(self, *args, **kwargs): + """Support of the distribution. + + Parameters + ---------- + arg1, arg2, ... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + location parameter, Default is 0. + scale : array_like, optional + scale parameter, Default is 1. + + Returns + ------- + a, b : array_like + end-points of the distribution's support. + + """ + args, loc, scale = self._parse_args(*args, **kwargs) + arrs = np.broadcast_arrays(*args, loc, scale) + args, loc, scale = arrs[:-2], arrs[-2], arrs[-1] + cond = self._argcheck(*args) & (scale > 0) + _a, _b = self._get_support(*args) + if cond.all(): + return _a * scale + loc, _b * scale + loc + elif cond.ndim == 0: + return self.badvalue, self.badvalue + # promote bounds to at least float to fill in the badvalue + _a, _b = np.asarray(_a).astype('d'), np.asarray(_b).astype('d') + out_a, out_b = _a * scale + loc, _b * scale + loc + place(out_a, 1-cond, self.badvalue) + place(out_b, 1-cond, self.badvalue) + return out_a, out_b + + def nnlf(self, theta, x): + """Negative loglikelihood function. + Notes + ----- + This is ``-sum(log pdf(x, theta), axis=0)`` where `theta` are the + parameters (including loc and scale). + """ + loc, scale, args = self._unpack_loc_scale(theta) + if not self._argcheck(*args) or scale <= 0: + return inf + x = (asarray(x)-loc) / scale + n_log_scale = len(x) * log(scale) + if np.any(~self._support_mask(x, *args)): + return inf + return self._nnlf(x, *args) + n_log_scale + + def _nnlf(self, x, *args): + return -np.sum(self._logpxf(x, *args), axis=0) + + def _nlff_and_penalty(self, x, args, log_fitfun): + # negative log fit function + cond0 = ~self._support_mask(x, *args) + n_bad = np.count_nonzero(cond0, axis=0) + if n_bad > 0: + x = argsreduce(~cond0, x)[0] + logff = log_fitfun(x, *args) + finite_logff = np.isfinite(logff) + n_bad += np.sum(~finite_logff, axis=0) + if n_bad > 0: + penalty = n_bad * log(_XMAX) * 100 + return -np.sum(logff[finite_logff], axis=0) + penalty + return -np.sum(logff, axis=0) + + def _penalized_nnlf(self, theta, x): + """Penalized negative loglikelihood function. + i.e., - sum (log pdf(x, theta), axis=0) + penalty + where theta are the parameters (including loc and scale) + """ + loc, scale, args = self._unpack_loc_scale(theta) + if not self._argcheck(*args) or scale <= 0: + return inf + x = asarray((x-loc) / scale) + n_log_scale = len(x) * log(scale) + return self._nlff_and_penalty(x, args, self._logpxf) + n_log_scale + + def _penalized_nlpsf(self, theta, x): + """Penalized negative log product spacing function. + i.e., - sum (log (diff (cdf (x, theta))), axis=0) + penalty + where theta are the parameters (including loc and scale) + Follows reference [1] of scipy.stats.fit + """ + loc, scale, args = self._unpack_loc_scale(theta) + if not self._argcheck(*args) or scale <= 0: + return inf + x = (np.sort(x) - loc)/scale + + def log_psf(x, *args): + x, lj = np.unique(x, return_counts=True) # fast for sorted x + cdf_data = self._cdf(x, *args) if x.size else [] + if not (x.size and 1 - cdf_data[-1] <= 0): + cdf = np.concatenate(([0], cdf_data, [1])) + lj = np.concatenate((lj, [1])) + else: + cdf = np.concatenate(([0], cdf_data)) + # here we could use logcdf w/ logsumexp trick to take differences, + # but in the context of the method, it seems unlikely to matter + return lj * np.log(np.diff(cdf) / lj) + + return self._nlff_and_penalty(x, args, log_psf) + + +class _ShapeInfo: + def __init__(self, name, integrality=False, domain=(-np.inf, np.inf), + inclusive=(True, True)): + self.name = name + self.integrality = integrality + self.endpoints = domain + self.inclusive = inclusive + + domain = list(domain) + if np.isfinite(domain[0]) and not inclusive[0]: + domain[0] = np.nextafter(domain[0], np.inf) + if np.isfinite(domain[1]) and not inclusive[1]: + domain[1] = np.nextafter(domain[1], -np.inf) + self.domain = domain + + +def _get_fixed_fit_value(kwds, names): + """ + Given names such as ``['f0', 'fa', 'fix_a']``, check that there is + at most one non-None value in `kwds` associated with those names. + Return that value, or None if none of the names occur in `kwds`. + As a side effect, all occurrences of those names in `kwds` are + removed. + """ + vals = [(name, kwds.pop(name)) for name in names if name in kwds] + if len(vals) > 1: + repeated = [name for name, val in vals] + raise ValueError("fit method got multiple keyword arguments to " + "specify the same fixed parameter: " + + ', '.join(repeated)) + return vals[0][1] if vals else None + + +# continuous random variables: implement maybe later +# +# hf --- Hazard Function (PDF / SF) +# chf --- Cumulative hazard function (-log(SF)) +# psf --- Probability sparsity function (reciprocal of the pdf) in +# units of percent-point-function (as a function of q). +# Also, the derivative of the percent-point function. + + +class rv_continuous(rv_generic): + """A generic continuous random variable class meant for subclassing. + + `rv_continuous` is a base class to construct specific distribution classes + and instances for continuous random variables. It cannot be used + directly as a distribution. + + Parameters + ---------- + momtype : int, optional + The type of generic moment calculation to use: 0 for pdf, 1 (default) + for ppf. + a : float, optional + Lower bound of the support of the distribution, default is minus + infinity. + b : float, optional + Upper bound of the support of the distribution, default is plus + infinity. + xtol : float, optional + The tolerance for fixed point calculation for generic ppf. + badvalue : float, optional + The value in a result arrays that indicates a value that for which + some argument restriction is violated, default is np.nan. + name : str, optional + The name of the instance. This string is used to construct the default + example for distributions. + longname : str, optional + This string is used as part of the first line of the docstring returned + when a subclass has no docstring of its own. Note: `longname` exists + for backwards compatibility, do not use for new subclasses. + shapes : str, optional + The shape of the distribution. For example ``"m, n"`` for a + distribution that takes two integers as the two shape arguments for all + its methods. If not provided, shape parameters will be inferred from + the signature of the private methods, ``_pdf`` and ``_cdf`` of the + instance. + seed : {None, int, `numpy.random.Generator`, `numpy.random.RandomState`}, optional + If `seed` is None (or `np.random`), the `numpy.random.RandomState` + singleton is used. + If `seed` is an int, a new ``RandomState`` instance is used, + seeded with `seed`. + If `seed` is already a ``Generator`` or ``RandomState`` instance then + that instance is used. + + Methods + ------- + rvs + pdf + logpdf + cdf + logcdf + sf + logsf + ppf + isf + moment + stats + entropy + expect + median + mean + std + var + interval + __call__ + fit + fit_loc_scale + nnlf + support + + Notes + ----- + Public methods of an instance of a distribution class (e.g., ``pdf``, + ``cdf``) check their arguments and pass valid arguments to private, + computational methods (``_pdf``, ``_cdf``). For ``pdf(x)``, ``x`` is valid + if it is within the support of the distribution. + Whether a shape parameter is valid is decided by an ``_argcheck`` method + (which defaults to checking that its arguments are strictly positive.) + + **Subclassing** + + New random variables can be defined by subclassing the `rv_continuous` class + and re-defining at least the ``_pdf`` or the ``_cdf`` method (normalized + to location 0 and scale 1). + + If positive argument checking is not correct for your RV + then you will also need to re-define the ``_argcheck`` method. + + For most of the scipy.stats distributions, the support interval doesn't + depend on the shape parameters. ``x`` being in the support interval is + equivalent to ``self.a <= x <= self.b``. If either of the endpoints of + the support do depend on the shape parameters, then + i) the distribution must implement the ``_get_support`` method; and + ii) those dependent endpoints must be omitted from the distribution's + call to the ``rv_continuous`` initializer. + + Correct, but potentially slow defaults exist for the remaining + methods but for speed and/or accuracy you can over-ride:: + + _logpdf, _cdf, _logcdf, _ppf, _rvs, _isf, _sf, _logsf + + The default method ``_rvs`` relies on the inverse of the cdf, ``_ppf``, + applied to a uniform random variate. In order to generate random variates + efficiently, either the default ``_ppf`` needs to be overwritten (e.g. + if the inverse cdf can expressed in an explicit form) or a sampling + method needs to be implemented in a custom ``_rvs`` method. + + If possible, you should override ``_isf``, ``_sf`` or ``_logsf``. + The main reason would be to improve numerical accuracy: for example, + the survival function ``_sf`` is computed as ``1 - _cdf`` which can + result in loss of precision if ``_cdf(x)`` is close to one. + + **Methods that can be overwritten by subclasses** + :: + + _rvs + _pdf + _cdf + _sf + _ppf + _isf + _stats + _munp + _entropy + _argcheck + _get_support + + There are additional (internal and private) generic methods that can + be useful for cross-checking and for debugging, but might work in all + cases when directly called. + + A note on ``shapes``: subclasses need not specify them explicitly. In this + case, `shapes` will be automatically deduced from the signatures of the + overridden methods (`pdf`, `cdf` etc). + If, for some reason, you prefer to avoid relying on introspection, you can + specify ``shapes`` explicitly as an argument to the instance constructor. + + + **Frozen Distributions** + + Normally, you must provide shape parameters (and, optionally, location and + scale parameters to each call of a method of a distribution. + + Alternatively, the object may be called (as a function) to fix the shape, + location, and scale parameters returning a "frozen" continuous RV object: + + rv = generic(, loc=0, scale=1) + `rv_frozen` object with the same methods but holding the given shape, + location, and scale fixed + + **Statistics** + + Statistics are computed using numerical integration by default. + For speed you can redefine this using ``_stats``: + + - take shape parameters and return mu, mu2, g1, g2 + - If you can't compute one of these, return it as None + - Can also be defined with a keyword argument ``moments``, which is a + string composed of "m", "v", "s", and/or "k". + Only the components appearing in string should be computed and + returned in the order "m", "v", "s", or "k" with missing values + returned as None. + + Alternatively, you can override ``_munp``, which takes ``n`` and shape + parameters and returns the n-th non-central moment of the distribution. + + **Deepcopying / Pickling** + + If a distribution or frozen distribution is deepcopied (pickled/unpickled, + etc.), any underlying random number generator is deepcopied with it. An + implication is that if a distribution relies on the singleton RandomState + before copying, it will rely on a copy of that random state after copying, + and ``np.random.seed`` will no longer control the state. + + Examples + -------- + To create a new Gaussian distribution, we would do the following: + + >>> from scipy.stats import rv_continuous + >>> class gaussian_gen(rv_continuous): + ... "Gaussian distribution" + ... def _pdf(self, x): + ... return np.exp(-x**2 / 2.) / np.sqrt(2.0 * np.pi) + >>> gaussian = gaussian_gen(name='gaussian') + + ``scipy.stats`` distributions are *instances*, so here we subclass + `rv_continuous` and create an instance. With this, we now have + a fully functional distribution with all relevant methods automagically + generated by the framework. + + Note that above we defined a standard normal distribution, with zero mean + and unit variance. Shifting and scaling of the distribution can be done + by using ``loc`` and ``scale`` parameters: ``gaussian.pdf(x, loc, scale)`` + essentially computes ``y = (x - loc) / scale`` and + ``gaussian._pdf(y) / scale``. + + """ + + def __init__(self, momtype=1, a=None, b=None, xtol=1e-14, + badvalue=None, name=None, longname=None, + shapes=None, seed=None): + + super().__init__(seed) + + # save the ctor parameters, cf generic freeze + self._ctor_param = dict( + momtype=momtype, a=a, b=b, xtol=xtol, + badvalue=badvalue, name=name, longname=longname, + shapes=shapes, seed=seed) + + if badvalue is None: + badvalue = nan + if name is None: + name = 'Distribution' + self.badvalue = badvalue + self.name = name + self.a = a + self.b = b + if a is None: + self.a = -inf + if b is None: + self.b = inf + self.xtol = xtol + self.moment_type = momtype + self.shapes = shapes + + self._construct_argparser(meths_to_inspect=[self._pdf, self._cdf], + locscale_in='loc=0, scale=1', + locscale_out='loc, scale') + self._attach_methods() + + if longname is None: + if name[0] in ['aeiouAEIOU']: + hstr = "An " + else: + hstr = "A " + longname = hstr + name + + if sys.flags.optimize < 2: + # Skip adding docstrings if interpreter is run with -OO + if self.__doc__ is None: + self._construct_default_doc(longname=longname, + docdict=docdict, + discrete='continuous') + else: + dct = dict(distcont) + self._construct_doc(docdict, dct.get(self.name)) + + def __getstate__(self): + dct = self.__dict__.copy() + + # these methods will be remade in __setstate__ + # _random_state attribute is taken care of by rv_generic + attrs = ["_parse_args", "_parse_args_stats", "_parse_args_rvs", + "_cdfvec", "_ppfvec", "vecentropy", "generic_moment"] + [dct.pop(attr, None) for attr in attrs] + return dct + + def _attach_methods(self): + """ + Attaches dynamically created methods to the rv_continuous instance. + """ + # _attach_methods is responsible for calling _attach_argparser_methods + self._attach_argparser_methods() + + # nin correction + self._ppfvec = vectorize(self._ppf_single, otypes='d') + self._ppfvec.nin = self.numargs + 1 + self.vecentropy = vectorize(self._entropy, otypes='d') + self._cdfvec = vectorize(self._cdf_single, otypes='d') + self._cdfvec.nin = self.numargs + 1 + + if self.moment_type == 0: + self.generic_moment = vectorize(self._mom0_sc, otypes='d') + else: + self.generic_moment = vectorize(self._mom1_sc, otypes='d') + # Because of the *args argument of _mom0_sc, vectorize cannot count the + # number of arguments correctly. + self.generic_moment.nin = self.numargs + 1 + + def _updated_ctor_param(self): + """Return the current version of _ctor_param, possibly updated by user. + + Used by freezing. + Keep this in sync with the signature of __init__. + """ + dct = self._ctor_param.copy() + dct['a'] = self.a + dct['b'] = self.b + dct['xtol'] = self.xtol + dct['badvalue'] = self.badvalue + dct['name'] = self.name + dct['shapes'] = self.shapes + return dct + + def _ppf_to_solve(self, x, q, *args): + return self.cdf(*(x, )+args)-q + + def _ppf_single(self, q, *args): + factor = 10. + left, right = self._get_support(*args) + + if np.isinf(left): + left = min(-factor, right) + while self._ppf_to_solve(left, q, *args) > 0.: + left, right = left * factor, left + # left is now such that cdf(left) <= q + # if right has changed, then cdf(right) > q + + if np.isinf(right): + right = max(factor, left) + while self._ppf_to_solve(right, q, *args) < 0.: + left, right = right, right * factor + # right is now such that cdf(right) >= q + + return optimize.brentq(self._ppf_to_solve, + left, right, args=(q,)+args, xtol=self.xtol) + + # moment from definition + def _mom_integ0(self, x, m, *args): + return x**m * self.pdf(x, *args) + + def _mom0_sc(self, m, *args): + _a, _b = self._get_support(*args) + return integrate.quad(self._mom_integ0, _a, _b, + args=(m,)+args)[0] + + # moment calculated using ppf + def _mom_integ1(self, q, m, *args): + return (self.ppf(q, *args))**m + + def _mom1_sc(self, m, *args): + return integrate.quad(self._mom_integ1, 0, 1, args=(m,)+args)[0] + + def _pdf(self, x, *args): + return _derivative(self._cdf, x, dx=1e-5, args=args, order=5) + + # Could also define any of these + def _logpdf(self, x, *args): + p = self._pdf(x, *args) + with np.errstate(divide='ignore'): + return log(p) + + def _logpxf(self, x, *args): + # continuous distributions have PDF, discrete have PMF, but sometimes + # the distinction doesn't matter. This lets us use `_logpxf` for both + # discrete and continuous distributions. + return self._logpdf(x, *args) + + def _cdf_single(self, x, *args): + _a, _b = self._get_support(*args) + return integrate.quad(self._pdf, _a, x, args=args)[0] + + def _cdf(self, x, *args): + return self._cdfvec(x, *args) + + def _logcdf(self, x, *args): + median = self._ppf(0.5, *args) + with np.errstate(divide='ignore'): + return _lazywhere(x < median, (x,) + args, + f=lambda x, *args: np.log(self._cdf(x, *args)), + f2=lambda x, *args: np.log1p(-self._sf(x, *args))) + + def _logsf(self, x, *args): + median = self._ppf(0.5, *args) + with np.errstate(divide='ignore'): + return _lazywhere(x > median, (x,) + args, + f=lambda x, *args: np.log(self._sf(x, *args)), + f2=lambda x, *args: np.log1p(-self._cdf(x, *args))) + + # generic _argcheck, _sf, _ppf, _isf, _rvs are defined + # in rv_generic + + def pdf(self, x, *args, **kwds): + """Probability density function at x of the given RV. + + Parameters + ---------- + x : array_like + quantiles + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + pdf : ndarray + Probability density function evaluated at x + + """ + args, loc, scale = self._parse_args(*args, **kwds) + x, loc, scale = map(asarray, (x, loc, scale)) + args = tuple(map(asarray, args)) + dtyp = np.promote_types(x.dtype, np.float64) + x = np.asarray((x - loc)/scale, dtype=dtyp) + cond0 = self._argcheck(*args) & (scale > 0) + cond1 = self._support_mask(x, *args) & (scale > 0) + cond = cond0 & cond1 + output = zeros(shape(cond), dtyp) + putmask(output, (1-cond0)+np.isnan(x), self.badvalue) + if np.any(cond): + goodargs = argsreduce(cond, *((x,)+args+(scale,))) + scale, goodargs = goodargs[-1], goodargs[:-1] + place(output, cond, self._pdf(*goodargs) / scale) + if output.ndim == 0: + return output[()] + return output + + def logpdf(self, x, *args, **kwds): + """Log of the probability density function at x of the given RV. + + This uses a more numerically accurate calculation if available. + + Parameters + ---------- + x : array_like + quantiles + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + logpdf : array_like + Log of the probability density function evaluated at x + + """ + args, loc, scale = self._parse_args(*args, **kwds) + x, loc, scale = map(asarray, (x, loc, scale)) + args = tuple(map(asarray, args)) + dtyp = np.promote_types(x.dtype, np.float64) + x = np.asarray((x - loc)/scale, dtype=dtyp) + cond0 = self._argcheck(*args) & (scale > 0) + cond1 = self._support_mask(x, *args) & (scale > 0) + cond = cond0 & cond1 + output = empty(shape(cond), dtyp) + output.fill(-inf) + putmask(output, (1-cond0)+np.isnan(x), self.badvalue) + if np.any(cond): + goodargs = argsreduce(cond, *((x,)+args+(scale,))) + scale, goodargs = goodargs[-1], goodargs[:-1] + place(output, cond, self._logpdf(*goodargs) - log(scale)) + if output.ndim == 0: + return output[()] + return output + + def cdf(self, x, *args, **kwds): + """ + Cumulative distribution function of the given RV. + + Parameters + ---------- + x : array_like + quantiles + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + cdf : ndarray + Cumulative distribution function evaluated at `x` + + """ + args, loc, scale = self._parse_args(*args, **kwds) + x, loc, scale = map(asarray, (x, loc, scale)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + dtyp = np.promote_types(x.dtype, np.float64) + x = np.asarray((x - loc)/scale, dtype=dtyp) + cond0 = self._argcheck(*args) & (scale > 0) + cond1 = self._open_support_mask(x, *args) & (scale > 0) + cond2 = (x >= np.asarray(_b)) & cond0 + cond = cond0 & cond1 + output = zeros(shape(cond), dtyp) + place(output, (1-cond0)+np.isnan(x), self.badvalue) + place(output, cond2, 1.0) + if np.any(cond): # call only if at least 1 entry + goodargs = argsreduce(cond, *((x,)+args)) + place(output, cond, self._cdf(*goodargs)) + if output.ndim == 0: + return output[()] + return output + + def logcdf(self, x, *args, **kwds): + """Log of the cumulative distribution function at x of the given RV. + + Parameters + ---------- + x : array_like + quantiles + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + logcdf : array_like + Log of the cumulative distribution function evaluated at x + + """ + args, loc, scale = self._parse_args(*args, **kwds) + x, loc, scale = map(asarray, (x, loc, scale)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + dtyp = np.promote_types(x.dtype, np.float64) + x = np.asarray((x - loc)/scale, dtype=dtyp) + cond0 = self._argcheck(*args) & (scale > 0) + cond1 = self._open_support_mask(x, *args) & (scale > 0) + cond2 = (x >= _b) & cond0 + cond = cond0 & cond1 + output = empty(shape(cond), dtyp) + output.fill(-inf) + place(output, (1-cond0)*(cond1 == cond1)+np.isnan(x), self.badvalue) + place(output, cond2, 0.0) + if np.any(cond): # call only if at least 1 entry + goodargs = argsreduce(cond, *((x,)+args)) + place(output, cond, self._logcdf(*goodargs)) + if output.ndim == 0: + return output[()] + return output + + def sf(self, x, *args, **kwds): + """Survival function (1 - `cdf`) at x of the given RV. + + Parameters + ---------- + x : array_like + quantiles + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + sf : array_like + Survival function evaluated at x + + """ + args, loc, scale = self._parse_args(*args, **kwds) + x, loc, scale = map(asarray, (x, loc, scale)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + dtyp = np.promote_types(x.dtype, np.float64) + x = np.asarray((x - loc)/scale, dtype=dtyp) + cond0 = self._argcheck(*args) & (scale > 0) + cond1 = self._open_support_mask(x, *args) & (scale > 0) + cond2 = cond0 & (x <= _a) + cond = cond0 & cond1 + output = zeros(shape(cond), dtyp) + place(output, (1-cond0)+np.isnan(x), self.badvalue) + place(output, cond2, 1.0) + if np.any(cond): + goodargs = argsreduce(cond, *((x,)+args)) + place(output, cond, self._sf(*goodargs)) + if output.ndim == 0: + return output[()] + return output + + def logsf(self, x, *args, **kwds): + """Log of the survival function of the given RV. + + Returns the log of the "survival function," defined as (1 - `cdf`), + evaluated at `x`. + + Parameters + ---------- + x : array_like + quantiles + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + logsf : ndarray + Log of the survival function evaluated at `x`. + + """ + args, loc, scale = self._parse_args(*args, **kwds) + x, loc, scale = map(asarray, (x, loc, scale)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + dtyp = np.promote_types(x.dtype, np.float64) + x = np.asarray((x - loc)/scale, dtype=dtyp) + cond0 = self._argcheck(*args) & (scale > 0) + cond1 = self._open_support_mask(x, *args) & (scale > 0) + cond2 = cond0 & (x <= _a) + cond = cond0 & cond1 + output = empty(shape(cond), dtyp) + output.fill(-inf) + place(output, (1-cond0)+np.isnan(x), self.badvalue) + place(output, cond2, 0.0) + if np.any(cond): + goodargs = argsreduce(cond, *((x,)+args)) + place(output, cond, self._logsf(*goodargs)) + if output.ndim == 0: + return output[()] + return output + + def ppf(self, q, *args, **kwds): + """Percent point function (inverse of `cdf`) at q of the given RV. + + Parameters + ---------- + q : array_like + lower tail probability + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + x : array_like + quantile corresponding to the lower tail probability q. + + """ + args, loc, scale = self._parse_args(*args, **kwds) + q, loc, scale = map(asarray, (q, loc, scale)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + cond0 = self._argcheck(*args) & (scale > 0) & (loc == loc) + cond1 = (0 < q) & (q < 1) + cond2 = cond0 & (q == 0) + cond3 = cond0 & (q == 1) + cond = cond0 & cond1 + output = np.full(shape(cond), fill_value=self.badvalue) + + lower_bound = _a * scale + loc + upper_bound = _b * scale + loc + place(output, cond2, argsreduce(cond2, lower_bound)[0]) + place(output, cond3, argsreduce(cond3, upper_bound)[0]) + + if np.any(cond): # call only if at least 1 entry + goodargs = argsreduce(cond, *((q,)+args+(scale, loc))) + scale, loc, goodargs = goodargs[-2], goodargs[-1], goodargs[:-2] + place(output, cond, self._ppf(*goodargs) * scale + loc) + if output.ndim == 0: + return output[()] + return output + + def isf(self, q, *args, **kwds): + """Inverse survival function (inverse of `sf`) at q of the given RV. + + Parameters + ---------- + q : array_like + upper tail probability + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + location parameter (default=0) + scale : array_like, optional + scale parameter (default=1) + + Returns + ------- + x : ndarray or scalar + Quantile corresponding to the upper tail probability q. + + """ + args, loc, scale = self._parse_args(*args, **kwds) + q, loc, scale = map(asarray, (q, loc, scale)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + cond0 = self._argcheck(*args) & (scale > 0) & (loc == loc) + cond1 = (0 < q) & (q < 1) + cond2 = cond0 & (q == 1) + cond3 = cond0 & (q == 0) + cond = cond0 & cond1 + output = np.full(shape(cond), fill_value=self.badvalue) + + lower_bound = _a * scale + loc + upper_bound = _b * scale + loc + place(output, cond2, argsreduce(cond2, lower_bound)[0]) + place(output, cond3, argsreduce(cond3, upper_bound)[0]) + + if np.any(cond): + goodargs = argsreduce(cond, *((q,)+args+(scale, loc))) + scale, loc, goodargs = goodargs[-2], goodargs[-1], goodargs[:-2] + place(output, cond, self._isf(*goodargs) * scale + loc) + if output.ndim == 0: + return output[()] + return output + + def _unpack_loc_scale(self, theta): + try: + loc = theta[-2] + scale = theta[-1] + args = tuple(theta[:-2]) + except IndexError as e: + raise ValueError("Not enough input arguments.") from e + return loc, scale, args + + def _nnlf_and_penalty(self, x, args): + """ + Compute the penalized negative log-likelihood for the + "standardized" data (i.e. already shifted by loc and + scaled by scale) for the shape parameters in `args`. + + `x` can be a 1D numpy array or a CensoredData instance. + """ + if isinstance(x, CensoredData): + # Filter out the data that is not in the support. + xs = x._supported(*self._get_support(*args)) + n_bad = len(x) - len(xs) + i1, i2 = xs._interval.T + terms = [ + # logpdf of the noncensored data. + self._logpdf(xs._uncensored, *args), + # logcdf of the left-censored data. + self._logcdf(xs._left, *args), + # logsf of the right-censored data. + self._logsf(xs._right, *args), + # log of probability of the interval-censored data. + np.log(self._delta_cdf(i1, i2, *args)), + ] + else: + cond0 = ~self._support_mask(x, *args) + n_bad = np.count_nonzero(cond0) + if n_bad > 0: + x = argsreduce(~cond0, x)[0] + terms = [self._logpdf(x, *args)] + + totals, bad_counts = zip(*[_sum_finite(term) for term in terms]) + total = sum(totals) + n_bad += sum(bad_counts) + + return -total + n_bad * _LOGXMAX * 100 + + def _penalized_nnlf(self, theta, x): + """Penalized negative loglikelihood function. + + i.e., - sum (log pdf(x, theta), axis=0) + penalty + where theta are the parameters (including loc and scale) + """ + loc, scale, args = self._unpack_loc_scale(theta) + if not self._argcheck(*args) or scale <= 0: + return inf + if isinstance(x, CensoredData): + x = (x - loc) / scale + n_log_scale = (len(x) - x.num_censored()) * log(scale) + else: + x = (x - loc) / scale + n_log_scale = len(x) * log(scale) + + return self._nnlf_and_penalty(x, args) + n_log_scale + + def _fitstart(self, data, args=None): + """Starting point for fit (shape arguments + loc + scale).""" + if args is None: + args = (1.0,)*self.numargs + loc, scale = self._fit_loc_scale_support(data, *args) + return args + (loc, scale) + + def _reduce_func(self, args, kwds, data=None): + """ + Return the (possibly reduced) function to optimize in order to find MLE + estimates for the .fit method. + """ + # Convert fixed shape parameters to the standard numeric form: e.g. for + # stats.beta, shapes='a, b'. To fix `a`, the caller can give a value + # for `f0`, `fa` or 'fix_a'. The following converts the latter two + # into the first (numeric) form. + shapes = [] + if self.shapes: + shapes = self.shapes.replace(',', ' ').split() + for j, s in enumerate(shapes): + key = 'f' + str(j) + names = [key, 'f' + s, 'fix_' + s] + val = _get_fixed_fit_value(kwds, names) + if val is not None: + kwds[key] = val + + args = list(args) + Nargs = len(args) + fixedn = [] + names = ['f%d' % n for n in range(Nargs - 2)] + ['floc', 'fscale'] + x0 = [] + for n, key in enumerate(names): + if key in kwds: + fixedn.append(n) + args[n] = kwds.pop(key) + else: + x0.append(args[n]) + + methods = {"mle", "mm"} + method = kwds.pop('method', "mle").lower() + if method == "mm": + n_params = len(shapes) + 2 - len(fixedn) + exponents = (np.arange(1, n_params+1))[:, np.newaxis] + data_moments = np.sum(data[None, :]**exponents/len(data), axis=1) + + def objective(theta, x): + return self._moment_error(theta, x, data_moments) + + elif method == "mle": + objective = self._penalized_nnlf + else: + raise ValueError(f"Method '{method}' not available; " + f"must be one of {methods}") + + if len(fixedn) == 0: + func = objective + restore = None + else: + if len(fixedn) == Nargs: + raise ValueError( + "All parameters fixed. There is nothing to optimize.") + + def restore(args, theta): + # Replace with theta for all numbers not in fixedn + # This allows the non-fixed values to vary, but + # we still call self.nnlf with all parameters. + i = 0 + for n in range(Nargs): + if n not in fixedn: + args[n] = theta[i] + i += 1 + return args + + def func(theta, x): + newtheta = restore(args[:], theta) + return objective(newtheta, x) + + return x0, func, restore, args + + def _moment_error(self, theta, x, data_moments): + loc, scale, args = self._unpack_loc_scale(theta) + if not self._argcheck(*args) or scale <= 0: + return inf + + dist_moments = np.array([self.moment(i+1, *args, loc=loc, scale=scale) + for i in range(len(data_moments))]) + if np.any(np.isnan(dist_moments)): + raise ValueError("Method of moments encountered a non-finite " + "distribution moment and cannot continue. " + "Consider trying method='MLE'.") + + return (((data_moments - dist_moments) / + np.maximum(np.abs(data_moments), 1e-8))**2).sum() + + def fit(self, data, *args, **kwds): + r""" + Return estimates of shape (if applicable), location, and scale + parameters from data. The default estimation method is Maximum + Likelihood Estimation (MLE), but Method of Moments (MM) + is also available. + + Starting estimates for the fit are given by input arguments; + for any arguments not provided with starting estimates, + ``self._fitstart(data)`` is called to generate such. + + One can hold some parameters fixed to specific values by passing in + keyword arguments ``f0``, ``f1``, ..., ``fn`` (for shape parameters) + and ``floc`` and ``fscale`` (for location and scale parameters, + respectively). + + Parameters + ---------- + data : array_like or `CensoredData` instance + Data to use in estimating the distribution parameters. + arg1, arg2, arg3,... : floats, optional + Starting value(s) for any shape-characterizing arguments (those not + provided will be determined by a call to ``_fitstart(data)``). + No default value. + **kwds : floats, optional + - `loc`: initial guess of the distribution's location parameter. + - `scale`: initial guess of the distribution's scale parameter. + + Special keyword arguments are recognized as holding certain + parameters fixed: + + - f0...fn : hold respective shape parameters fixed. + Alternatively, shape parameters to fix can be specified by name. + For example, if ``self.shapes == "a, b"``, ``fa`` and ``fix_a`` + are equivalent to ``f0``, and ``fb`` and ``fix_b`` are + equivalent to ``f1``. + + - floc : hold location parameter fixed to specified value. + + - fscale : hold scale parameter fixed to specified value. + + - optimizer : The optimizer to use. The optimizer must take + ``func`` and starting position as the first two arguments, + plus ``args`` (for extra arguments to pass to the + function to be optimized) and ``disp``. + The ``fit`` method calls the optimizer with ``disp=0`` to suppress output. + The optimizer must return the estimated parameters. + + - method : The method to use. The default is "MLE" (Maximum + Likelihood Estimate); "MM" (Method of Moments) + is also available. + + Raises + ------ + TypeError, ValueError + If an input is invalid + `~scipy.stats.FitError` + If fitting fails or the fit produced would be invalid + + Returns + ------- + parameter_tuple : tuple of floats + Estimates for any shape parameters (if applicable), followed by + those for location and scale. For most random variables, shape + statistics will be returned, but there are exceptions (e.g. + ``norm``). + + Notes + ----- + With ``method="MLE"`` (default), the fit is computed by minimizing + the negative log-likelihood function. A large, finite penalty + (rather than infinite negative log-likelihood) is applied for + observations beyond the support of the distribution. + + With ``method="MM"``, the fit is computed by minimizing the L2 norm + of the relative errors between the first *k* raw (about zero) data + moments and the corresponding distribution moments, where *k* is the + number of non-fixed parameters. + More precisely, the objective function is:: + + (((data_moments - dist_moments) + / np.maximum(np.abs(data_moments), 1e-8))**2).sum() + + where the constant ``1e-8`` avoids division by zero in case of + vanishing data moments. Typically, this error norm can be reduced to + zero. + Note that the standard method of moments can produce parameters for + which some data are outside the support of the fitted distribution; + this implementation does nothing to prevent this. + + For either method, + the returned answer is not guaranteed to be globally optimal; it + may only be locally optimal, or the optimization may fail altogether. + If the data contain any of ``np.nan``, ``np.inf``, or ``-np.inf``, + the `fit` method will raise a ``RuntimeError``. + + When passing a ``CensoredData`` instance to ``data``, the log-likelihood + function is defined as: + + .. math:: + + l(\pmb{\theta}; k) & = \sum + \log(f(k_u; \pmb{\theta})) + + \sum + \log(F(k_l; \pmb{\theta})) \\ + & + \sum + \log(1 - F(k_r; \pmb{\theta})) \\ + & + \sum + \log(F(k_{\text{high}, i}; \pmb{\theta}) + - F(k_{\text{low}, i}; \pmb{\theta})) + + where :math:`f` and :math:`F` are the pdf and cdf, respectively, of the + function being fitted, :math:`\pmb{\theta}` is the parameter vector, + :math:`u` are the indices of uncensored observations, + :math:`l` are the indices of left-censored observations, + :math:`r` are the indices of right-censored observations, + subscripts "low"/"high" denote endpoints of interval-censored observations, and + :math:`i` are the indices of interval-censored observations. + + Examples + -------- + + Generate some data to fit: draw random variates from the `beta` + distribution + + >>> import numpy as np + >>> from scipy.stats import beta + >>> a, b = 1., 2. + >>> rng = np.random.default_rng(172786373191770012695001057628748821561) + >>> x = beta.rvs(a, b, size=1000, random_state=rng) + + Now we can fit all four parameters (``a``, ``b``, ``loc`` and + ``scale``): + + >>> a1, b1, loc1, scale1 = beta.fit(x) + >>> a1, b1, loc1, scale1 + (1.0198945204435628, 1.9484708982737828, 4.372241314917588e-05, 0.9979078845964814) + + The fit can be done also using a custom optimizer: + + >>> from scipy.optimize import minimize + >>> def custom_optimizer(func, x0, args=(), disp=0): + ... res = minimize(func, x0, args, method="slsqp", options={"disp": disp}) + ... if res.success: + ... return res.x + ... raise RuntimeError('optimization routine failed') + >>> a1, b1, loc1, scale1 = beta.fit(x, method="MLE", optimizer=custom_optimizer) + >>> a1, b1, loc1, scale1 + (1.0198821087258905, 1.948484145914738, 4.3705304486881485e-05, 0.9979104663953395) + + We can also use some prior knowledge about the dataset: let's keep + ``loc`` and ``scale`` fixed: + + >>> a1, b1, loc1, scale1 = beta.fit(x, floc=0, fscale=1) + >>> loc1, scale1 + (0, 1) + + We can also keep shape parameters fixed by using ``f``-keywords. To + keep the zero-th shape parameter ``a`` equal 1, use ``f0=1`` or, + equivalently, ``fa=1``: + + >>> a1, b1, loc1, scale1 = beta.fit(x, fa=1, floc=0, fscale=1) + >>> a1 + 1 + + Not all distributions return estimates for the shape parameters. + ``norm`` for example just returns estimates for location and scale: + + >>> from scipy.stats import norm + >>> x = norm.rvs(a, b, size=1000, random_state=123) + >>> loc1, scale1 = norm.fit(x) + >>> loc1, scale1 + (0.92087172783841631, 2.0015750750324668) + """ # noqa: E501 + method = kwds.get('method', "mle").lower() + + censored = isinstance(data, CensoredData) + if censored: + if method != 'mle': + raise ValueError('For censored data, the method must' + ' be "MLE".') + if data.num_censored() == 0: + # There are no censored values in data, so replace the + # CensoredData instance with a regular array. + data = data._uncensored + censored = False + + Narg = len(args) + if Narg > self.numargs: + raise TypeError("Too many input arguments.") + + # Check the finiteness of data only if data is not an instance of + # CensoredData. The arrays in a CensoredData instance have already + # been validated. + if not censored: + # Note: `ravel()` is called for backwards compatibility. + data = np.asarray(data).ravel() + if not np.isfinite(data).all(): + raise ValueError("The data contains non-finite values.") + + start = [None]*2 + if (Narg < self.numargs) or not ('loc' in kwds and + 'scale' in kwds): + # get distribution specific starting locations + start = self._fitstart(data) + args += start[Narg:-2] + loc = kwds.pop('loc', start[-2]) + scale = kwds.pop('scale', start[-1]) + args += (loc, scale) + x0, func, restore, args = self._reduce_func(args, kwds, data=data) + optimizer = kwds.pop('optimizer', optimize.fmin) + # convert string to function in scipy.optimize + optimizer = _fit_determine_optimizer(optimizer) + # by now kwds must be empty, since everybody took what they needed + if kwds: + raise TypeError(f"Unknown arguments: {kwds}.") + + # In some cases, method of moments can be done with fsolve/root + # instead of an optimizer, but sometimes no solution exists, + # especially when the user fixes parameters. Minimizing the sum + # of squares of the error generalizes to these cases. + vals = optimizer(func, x0, args=(data,), disp=0) + obj = func(vals, data) + + if restore is not None: + vals = restore(args, vals) + vals = tuple(vals) + + loc, scale, shapes = self._unpack_loc_scale(vals) + if not (np.all(self._argcheck(*shapes)) and scale > 0): + raise FitError("Optimization converged to parameters that are " + "outside the range allowed by the distribution.") + + if method == 'mm': + if not np.isfinite(obj): + raise FitError("Optimization failed: either a data moment " + "or fitted distribution moment is " + "non-finite.") + + return vals + + def _fit_loc_scale_support(self, data, *args): + """Estimate loc and scale parameters from data accounting for support. + + Parameters + ---------- + data : array_like + Data to fit. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + + Returns + ------- + Lhat : float + Estimated location parameter for the data. + Shat : float + Estimated scale parameter for the data. + + """ + if isinstance(data, CensoredData): + # For this estimate, "uncensor" the data by taking the + # given endpoints as the data for the left- or right-censored + # data, and the mean for the interval-censored data. + data = data._uncensor() + else: + data = np.asarray(data) + + # Estimate location and scale according to the method of moments. + loc_hat, scale_hat = self.fit_loc_scale(data, *args) + + # Compute the support according to the shape parameters. + self._argcheck(*args) + _a, _b = self._get_support(*args) + a, b = _a, _b + support_width = b - a + + # If the support is empty then return the moment-based estimates. + if support_width <= 0: + return loc_hat, scale_hat + + # Compute the proposed support according to the loc and scale + # estimates. + a_hat = loc_hat + a * scale_hat + b_hat = loc_hat + b * scale_hat + + # Use the moment-based estimates if they are compatible with the data. + data_a = np.min(data) + data_b = np.max(data) + if a_hat < data_a and data_b < b_hat: + return loc_hat, scale_hat + + # Otherwise find other estimates that are compatible with the data. + data_width = data_b - data_a + rel_margin = 0.1 + margin = data_width * rel_margin + + # For a finite interval, both the location and scale + # should have interesting values. + if support_width < np.inf: + loc_hat = (data_a - a) - margin + scale_hat = (data_width + 2 * margin) / support_width + return loc_hat, scale_hat + + # For a one-sided interval, use only an interesting location parameter. + if a > -np.inf: + return (data_a - a) - margin, 1 + elif b < np.inf: + return (data_b - b) + margin, 1 + else: + raise RuntimeError + + def fit_loc_scale(self, data, *args): + """ + Estimate loc and scale parameters from data using 1st and 2nd moments. + + Parameters + ---------- + data : array_like + Data to fit. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + + Returns + ------- + Lhat : float + Estimated location parameter for the data. + Shat : float + Estimated scale parameter for the data. + + """ + mu, mu2 = self.stats(*args, **{'moments': 'mv'}) + tmp = asarray(data) + muhat = tmp.mean() + mu2hat = tmp.var() + Shat = sqrt(mu2hat / mu2) + with np.errstate(invalid='ignore'): + Lhat = muhat - Shat*mu + if not np.isfinite(Lhat): + Lhat = 0 + if not (np.isfinite(Shat) and (0 < Shat)): + Shat = 1 + return Lhat, Shat + + def _entropy(self, *args): + def integ(x): + val = self._pdf(x, *args) + return entr(val) + + # upper limit is often inf, so suppress warnings when integrating + _a, _b = self._get_support(*args) + with np.errstate(over='ignore'): + h = integrate.quad(integ, _a, _b)[0] + + if not np.isnan(h): + return h + else: + # try with different limits if integration problems + low, upp = self.ppf([1e-10, 1. - 1e-10], *args) + if np.isinf(_b): + upper = upp + else: + upper = _b + if np.isinf(_a): + lower = low + else: + lower = _a + return integrate.quad(integ, lower, upper)[0] + + def expect(self, func=None, args=(), loc=0, scale=1, lb=None, ub=None, + conditional=False, **kwds): + """Calculate expected value of a function with respect to the + distribution by numerical integration. + + The expected value of a function ``f(x)`` with respect to a + distribution ``dist`` is defined as:: + + ub + E[f(x)] = Integral(f(x) * dist.pdf(x)), + lb + + where ``ub`` and ``lb`` are arguments and ``x`` has the ``dist.pdf(x)`` + distribution. If the bounds ``lb`` and ``ub`` correspond to the + support of the distribution, e.g. ``[-inf, inf]`` in the default + case, then the integral is the unrestricted expectation of ``f(x)``. + Also, the function ``f(x)`` may be defined such that ``f(x)`` is ``0`` + outside a finite interval in which case the expectation is + calculated within the finite range ``[lb, ub]``. + + Parameters + ---------- + func : callable, optional + Function for which integral is calculated. Takes only one argument. + The default is the identity mapping f(x) = x. + args : tuple, optional + Shape parameters of the distribution. + loc : float, optional + Location parameter (default=0). + scale : float, optional + Scale parameter (default=1). + lb, ub : scalar, optional + Lower and upper bound for integration. Default is set to the + support of the distribution. + conditional : bool, optional + If True, the integral is corrected by the conditional probability + of the integration interval. The return value is the expectation + of the function, conditional on being in the given interval. + Default is False. + + Additional keyword arguments are passed to the integration routine. + + Returns + ------- + expect : float + The calculated expected value. + + Notes + ----- + The integration behavior of this function is inherited from + `scipy.integrate.quad`. Neither this function nor + `scipy.integrate.quad` can verify whether the integral exists or is + finite. For example ``cauchy(0).mean()`` returns ``np.nan`` and + ``cauchy(0).expect()`` returns ``0.0``. + + Likewise, the accuracy of results is not verified by the function. + `scipy.integrate.quad` is typically reliable for integrals that are + numerically favorable, but it is not guaranteed to converge + to a correct value for all possible intervals and integrands. This + function is provided for convenience; for critical applications, + check results against other integration methods. + + The function is not vectorized. + + Examples + -------- + + To understand the effect of the bounds of integration consider + + >>> from scipy.stats import expon + >>> expon(1).expect(lambda x: 1, lb=0.0, ub=2.0) + 0.6321205588285578 + + This is close to + + >>> expon(1).cdf(2.0) - expon(1).cdf(0.0) + 0.6321205588285577 + + If ``conditional=True`` + + >>> expon(1).expect(lambda x: 1, lb=0.0, ub=2.0, conditional=True) + 1.0000000000000002 + + The slight deviation from 1 is due to numerical integration. + + The integrand can be treated as a complex-valued function + by passing ``complex_func=True`` to `scipy.integrate.quad` . + + >>> import numpy as np + >>> from scipy.stats import vonmises + >>> res = vonmises(loc=2, kappa=1).expect(lambda x: np.exp(1j*x), + ... complex_func=True) + >>> res + (-0.18576377217422957+0.40590124735052263j) + + >>> np.angle(res) # location of the (circular) distribution + 2.0 + + """ + lockwds = {'loc': loc, + 'scale': scale} + self._argcheck(*args) + _a, _b = self._get_support(*args) + if func is None: + def fun(x, *args): + return x * self.pdf(x, *args, **lockwds) + else: + def fun(x, *args): + return func(x) * self.pdf(x, *args, **lockwds) + if lb is None: + lb = loc + _a * scale + if ub is None: + ub = loc + _b * scale + + cdf_bounds = self.cdf([lb, ub], *args, **lockwds) + invfac = cdf_bounds[1] - cdf_bounds[0] + + kwds['args'] = args + + # split interval to help integrator w/ infinite support; see gh-8928 + alpha = 0.05 # split body from tails at probability mass `alpha` + inner_bounds = np.array([alpha, 1-alpha]) + cdf_inner_bounds = cdf_bounds[0] + invfac * inner_bounds + c, d = loc + self._ppf(cdf_inner_bounds, *args) * scale + + # Do not silence warnings from integration. + lbc = integrate.quad(fun, lb, c, **kwds)[0] + cd = integrate.quad(fun, c, d, **kwds)[0] + dub = integrate.quad(fun, d, ub, **kwds)[0] + vals = (lbc + cd + dub) + + if conditional: + vals /= invfac + return np.array(vals)[()] # make it a numpy scalar like other methods + + def _param_info(self): + shape_info = self._shape_info() + loc_info = _ShapeInfo("loc", False, (-np.inf, np.inf), (False, False)) + scale_info = _ShapeInfo("scale", False, (0, np.inf), (False, False)) + param_info = shape_info + [loc_info, scale_info] + return param_info + + # For now, _delta_cdf is a private method. + def _delta_cdf(self, x1, x2, *args, loc=0, scale=1): + """ + Compute CDF(x2) - CDF(x1). + + Where x1 is greater than the median, compute SF(x1) - SF(x2), + otherwise compute CDF(x2) - CDF(x1). + + This function is only useful if `dist.sf(x, ...)` has an implementation + that is numerically more accurate than `1 - dist.cdf(x, ...)`. + """ + cdf1 = self.cdf(x1, *args, loc=loc, scale=scale) + # Possible optimizations (needs investigation-these might not be + # better): + # * Use _lazywhere instead of np.where + # * Instead of cdf1 > 0.5, compare x1 to the median. + result = np.where(cdf1 > 0.5, + (self.sf(x1, *args, loc=loc, scale=scale) + - self.sf(x2, *args, loc=loc, scale=scale)), + self.cdf(x2, *args, loc=loc, scale=scale) - cdf1) + if result.ndim == 0: + result = result[()] + return result + + +# Helpers for the discrete distributions +def _drv2_moment(self, n, *args): + """Non-central moment of discrete distribution.""" + def fun(x): + return np.power(x, n) * self._pmf(x, *args) + + _a, _b = self._get_support(*args) + return _expect(fun, _a, _b, self._ppf(0.5, *args), self.inc) + + +def _drv2_ppfsingle(self, q, *args): # Use basic bisection algorithm + _a, _b = self._get_support(*args) + b = _b + a = _a + + step = 10 + if isinf(b): # Be sure ending point is > q + b = float(max(100*q, 10)) + while 1: + if b >= _b: + qb = 1.0 + break + qb = self._cdf(b, *args) + if (qb < q): + b += step + step *= 2 + else: + break + else: + qb = 1.0 + + step = 10 + if isinf(a): # be sure starting point < q + a = float(min(-100*q, -10)) + while 1: + if a <= _a: + qb = 0.0 + break + qa = self._cdf(a, *args) + if (qa > q): + a -= step + step *= 2 + else: + break + else: + qa = self._cdf(a, *args) + + if np.isinf(a) or np.isinf(b): + message = "Arguments that bracket the requested quantile could not be found." + raise RuntimeError(message) + + # maximum number of bisections within the normal float64s + # maxiter = int(np.log2(finfo.max) - np.log2(finfo.smallest_normal)) + maxiter = 2046 + for i in range(maxiter): + if (qa == q): + return a + if (qb == q): + return b + if b <= a+1: + if qa > q: + return a + else: + return b + c = int((a+b)/2.0) + qc = self._cdf(c, *args) + if (qc < q): + if a != c: + a = c + else: + raise RuntimeError('updating stopped, endless loop') + qa = qc + elif (qc > q): + if b != c: + b = c + else: + raise RuntimeError('updating stopped, endless loop') + qb = qc + else: + return c + + +# Must over-ride one of _pmf or _cdf or pass in +# x_k, p(x_k) lists in initialization + + +class rv_discrete(rv_generic): + """A generic discrete random variable class meant for subclassing. + + `rv_discrete` is a base class to construct specific distribution classes + and instances for discrete random variables. It can also be used + to construct an arbitrary distribution defined by a list of support + points and corresponding probabilities. + + Parameters + ---------- + a : float, optional + Lower bound of the support of the distribution, default: 0 + b : float, optional + Upper bound of the support of the distribution, default: plus infinity + moment_tol : float, optional + The tolerance for the generic calculation of moments. + values : tuple of two array_like, optional + ``(xk, pk)`` where ``xk`` are integers and ``pk`` are the non-zero + probabilities between 0 and 1 with ``sum(pk) = 1``. ``xk`` + and ``pk`` must have the same shape, and ``xk`` must be unique. + inc : integer, optional + Increment for the support of the distribution. + Default is 1. (other values have not been tested) + badvalue : float, optional + The value in a result arrays that indicates a value that for which + some argument restriction is violated, default is np.nan. + name : str, optional + The name of the instance. This string is used to construct the default + example for distributions. + longname : str, optional + This string is used as part of the first line of the docstring returned + when a subclass has no docstring of its own. Note: `longname` exists + for backwards compatibility, do not use for new subclasses. + shapes : str, optional + The shape of the distribution. For example "m, n" for a distribution + that takes two integers as the two shape arguments for all its methods + If not provided, shape parameters will be inferred from + the signatures of the private methods, ``_pmf`` and ``_cdf`` of + the instance. + seed : {None, int, `numpy.random.Generator`, `numpy.random.RandomState`}, optional + If `seed` is None (or `np.random`), the `numpy.random.RandomState` + singleton is used. + If `seed` is an int, a new ``RandomState`` instance is used, + seeded with `seed`. + If `seed` is already a ``Generator`` or ``RandomState`` instance then + that instance is used. + + Methods + ------- + rvs + pmf + logpmf + cdf + logcdf + sf + logsf + ppf + isf + moment + stats + entropy + expect + median + mean + std + var + interval + __call__ + support + + Notes + ----- + This class is similar to `rv_continuous`. Whether a shape parameter is + valid is decided by an ``_argcheck`` method (which defaults to checking + that its arguments are strictly positive.) + The main differences are as follows. + + - The support of the distribution is a set of integers. + - Instead of the probability density function, ``pdf`` (and the + corresponding private ``_pdf``), this class defines the + *probability mass function*, `pmf` (and the corresponding + private ``_pmf``.) + - There is no ``scale`` parameter. + - The default implementations of methods (e.g. ``_cdf``) are not designed + for distributions with support that is unbounded below (i.e. + ``a=-np.inf``), so they must be overridden. + + To create a new discrete distribution, we would do the following: + + >>> from scipy.stats import rv_discrete + >>> class poisson_gen(rv_discrete): + ... "Poisson distribution" + ... def _pmf(self, k, mu): + ... return exp(-mu) * mu**k / factorial(k) + + and create an instance:: + + >>> poisson = poisson_gen(name="poisson") + + Note that above we defined the Poisson distribution in the standard form. + Shifting the distribution can be done by providing the ``loc`` parameter + to the methods of the instance. For example, ``poisson.pmf(x, mu, loc)`` + delegates the work to ``poisson._pmf(x-loc, mu)``. + + **Discrete distributions from a list of probabilities** + + Alternatively, you can construct an arbitrary discrete rv defined + on a finite set of values ``xk`` with ``Prob{X=xk} = pk`` by using the + ``values`` keyword argument to the `rv_discrete` constructor. + + **Deepcopying / Pickling** + + If a distribution or frozen distribution is deepcopied (pickled/unpickled, + etc.), any underlying random number generator is deepcopied with it. An + implication is that if a distribution relies on the singleton RandomState + before copying, it will rely on a copy of that random state after copying, + and ``np.random.seed`` will no longer control the state. + + Examples + -------- + Custom made discrete distribution: + + >>> import numpy as np + >>> from scipy import stats + >>> xk = np.arange(7) + >>> pk = (0.1, 0.2, 0.3, 0.1, 0.1, 0.0, 0.2) + >>> custm = stats.rv_discrete(name='custm', values=(xk, pk)) + >>> + >>> import matplotlib.pyplot as plt + >>> fig, ax = plt.subplots(1, 1) + >>> ax.plot(xk, custm.pmf(xk), 'ro', ms=12, mec='r') + >>> ax.vlines(xk, 0, custm.pmf(xk), colors='r', lw=4) + >>> plt.show() + + Random number generation: + + >>> R = custm.rvs(size=100) + + """ + def __new__(cls, a=0, b=inf, name=None, badvalue=None, + moment_tol=1e-8, values=None, inc=1, longname=None, + shapes=None, seed=None): + + if values is not None: + # dispatch to a subclass + return super().__new__(rv_sample) + else: + # business as usual + return super().__new__(cls) + + def __init__(self, a=0, b=inf, name=None, badvalue=None, + moment_tol=1e-8, values=None, inc=1, longname=None, + shapes=None, seed=None): + + super().__init__(seed) + + # cf generic freeze + self._ctor_param = dict( + a=a, b=b, name=name, badvalue=badvalue, + moment_tol=moment_tol, values=values, inc=inc, + longname=longname, shapes=shapes, seed=seed) + + if badvalue is None: + badvalue = nan + self.badvalue = badvalue + self.a = a + self.b = b + self.moment_tol = moment_tol + self.inc = inc + self.shapes = shapes + + if values is not None: + raise ValueError("rv_discrete.__init__(..., values != None, ...)") + + self._construct_argparser(meths_to_inspect=[self._pmf, self._cdf], + locscale_in='loc=0', + # scale=1 for discrete RVs + locscale_out='loc, 1') + self._attach_methods() + self._construct_docstrings(name, longname) + + def __getstate__(self): + dct = self.__dict__.copy() + # these methods will be remade in __setstate__ + attrs = ["_parse_args", "_parse_args_stats", "_parse_args_rvs", + "_cdfvec", "_ppfvec", "generic_moment"] + [dct.pop(attr, None) for attr in attrs] + return dct + + def _attach_methods(self): + """Attaches dynamically created methods to the rv_discrete instance.""" + self._cdfvec = vectorize(self._cdf_single, otypes='d') + self.vecentropy = vectorize(self._entropy) + + # _attach_methods is responsible for calling _attach_argparser_methods + self._attach_argparser_methods() + + # nin correction needs to be after we know numargs + # correct nin for generic moment vectorization + _vec_generic_moment = vectorize(_drv2_moment, otypes='d') + _vec_generic_moment.nin = self.numargs + 2 + self.generic_moment = types.MethodType(_vec_generic_moment, self) + + # correct nin for ppf vectorization + _vppf = vectorize(_drv2_ppfsingle, otypes='d') + _vppf.nin = self.numargs + 2 + self._ppfvec = types.MethodType(_vppf, self) + + # now that self.numargs is defined, we can adjust nin + self._cdfvec.nin = self.numargs + 1 + + def _construct_docstrings(self, name, longname): + if name is None: + name = 'Distribution' + self.name = name + + # generate docstring for subclass instances + if longname is None: + if name[0] in ['aeiouAEIOU']: + hstr = "An " + else: + hstr = "A " + longname = hstr + name + + if sys.flags.optimize < 2: + # Skip adding docstrings if interpreter is run with -OO + if self.__doc__ is None: + self._construct_default_doc(longname=longname, + docdict=docdict_discrete, + discrete='discrete') + else: + dct = dict(distdiscrete) + self._construct_doc(docdict_discrete, dct.get(self.name)) + + # discrete RV do not have the scale parameter, remove it + self.__doc__ = self.__doc__.replace( + '\n scale : array_like, ' + 'optional\n scale parameter (default=1)', '') + + def _updated_ctor_param(self): + """Return the current version of _ctor_param, possibly updated by user. + + Used by freezing. + Keep this in sync with the signature of __init__. + """ + dct = self._ctor_param.copy() + dct['a'] = self.a + dct['b'] = self.b + dct['badvalue'] = self.badvalue + dct['moment_tol'] = self.moment_tol + dct['inc'] = self.inc + dct['name'] = self.name + dct['shapes'] = self.shapes + return dct + + def _nonzero(self, k, *args): + return floor(k) == k + + def _pmf(self, k, *args): + return self._cdf(k, *args) - self._cdf(k-1, *args) + + def _logpmf(self, k, *args): + with np.errstate(divide='ignore'): + return log(self._pmf(k, *args)) + + def _logpxf(self, k, *args): + # continuous distributions have PDF, discrete have PMF, but sometimes + # the distinction doesn't matter. This lets us use `_logpxf` for both + # discrete and continuous distributions. + return self._logpmf(k, *args) + + def _unpack_loc_scale(self, theta): + try: + loc = theta[-1] + scale = 1 + args = tuple(theta[:-1]) + except IndexError as e: + raise ValueError("Not enough input arguments.") from e + return loc, scale, args + + def _cdf_single(self, k, *args): + _a, _b = self._get_support(*args) + m = arange(int(_a), k+1) + return np.sum(self._pmf(m, *args), axis=0) + + def _cdf(self, x, *args): + k = floor(x).astype(np.float64) + return self._cdfvec(k, *args) + + # generic _logcdf, _sf, _logsf, _ppf, _isf, _rvs defined in rv_generic + + def rvs(self, *args, **kwargs): + """Random variates of given type. + + Parameters + ---------- + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter (default=0). + size : int or tuple of ints, optional + Defining number of random variates (Default is 1). Note that `size` + has to be given as keyword, not as positional argument. + random_state : {None, int, `numpy.random.Generator`, + `numpy.random.RandomState`}, optional + + If `random_state` is None (or `np.random`), the + `numpy.random.RandomState` singleton is used. + If `random_state` is an int, a new ``RandomState`` instance is + used, seeded with `random_state`. + If `random_state` is already a ``Generator`` or ``RandomState`` + instance, that instance is used. + + Returns + ------- + rvs : ndarray or scalar + Random variates of given `size`. + + """ + kwargs['discrete'] = True + return super().rvs(*args, **kwargs) + + def pmf(self, k, *args, **kwds): + """Probability mass function at k of the given RV. + + Parameters + ---------- + k : array_like + Quantiles. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information) + loc : array_like, optional + Location parameter (default=0). + + Returns + ------- + pmf : array_like + Probability mass function evaluated at k + + """ + args, loc, _ = self._parse_args(*args, **kwds) + k, loc = map(asarray, (k, loc)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + k = asarray(k-loc) + cond0 = self._argcheck(*args) + cond1 = (k >= _a) & (k <= _b) + if not isinstance(self, rv_sample): + cond1 = cond1 & self._nonzero(k, *args) + cond = cond0 & cond1 + output = zeros(shape(cond), 'd') + place(output, (1-cond0) + np.isnan(k), self.badvalue) + if np.any(cond): + goodargs = argsreduce(cond, *((k,)+args)) + place(output, cond, np.clip(self._pmf(*goodargs), 0, 1)) + if output.ndim == 0: + return output[()] + return output + + def logpmf(self, k, *args, **kwds): + """Log of the probability mass function at k of the given RV. + + Parameters + ---------- + k : array_like + Quantiles. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter. Default is 0. + + Returns + ------- + logpmf : array_like + Log of the probability mass function evaluated at k. + + """ + args, loc, _ = self._parse_args(*args, **kwds) + k, loc = map(asarray, (k, loc)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + k = asarray(k-loc) + cond0 = self._argcheck(*args) + cond1 = (k >= _a) & (k <= _b) + if not isinstance(self, rv_sample): + cond1 = cond1 & self._nonzero(k, *args) + cond = cond0 & cond1 + output = empty(shape(cond), 'd') + output.fill(-inf) + place(output, (1-cond0) + np.isnan(k), self.badvalue) + if np.any(cond): + goodargs = argsreduce(cond, *((k,)+args)) + place(output, cond, self._logpmf(*goodargs)) + if output.ndim == 0: + return output[()] + return output + + def cdf(self, k, *args, **kwds): + """Cumulative distribution function of the given RV. + + Parameters + ---------- + k : array_like, int + Quantiles. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter (default=0). + + Returns + ------- + cdf : ndarray + Cumulative distribution function evaluated at `k`. + + """ + args, loc, _ = self._parse_args(*args, **kwds) + k, loc = map(asarray, (k, loc)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + k = asarray(k-loc) + cond0 = self._argcheck(*args) + cond1 = (k >= _a) & (k < _b) + cond2 = (k >= _b) + cond3 = np.isneginf(k) + cond = cond0 & cond1 & np.isfinite(k) + + output = zeros(shape(cond), 'd') + place(output, cond2*(cond0 == cond0), 1.0) + place(output, cond3*(cond0 == cond0), 0.0) + place(output, (1-cond0) + np.isnan(k), self.badvalue) + + if np.any(cond): + goodargs = argsreduce(cond, *((k,)+args)) + place(output, cond, np.clip(self._cdf(*goodargs), 0, 1)) + if output.ndim == 0: + return output[()] + return output + + def logcdf(self, k, *args, **kwds): + """Log of the cumulative distribution function at k of the given RV. + + Parameters + ---------- + k : array_like, int + Quantiles. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter (default=0). + + Returns + ------- + logcdf : array_like + Log of the cumulative distribution function evaluated at k. + + """ + args, loc, _ = self._parse_args(*args, **kwds) + k, loc = map(asarray, (k, loc)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + k = asarray(k-loc) + cond0 = self._argcheck(*args) + cond1 = (k >= _a) & (k < _b) + cond2 = (k >= _b) + cond = cond0 & cond1 + output = empty(shape(cond), 'd') + output.fill(-inf) + place(output, (1-cond0) + np.isnan(k), self.badvalue) + place(output, cond2*(cond0 == cond0), 0.0) + + if np.any(cond): + goodargs = argsreduce(cond, *((k,)+args)) + place(output, cond, self._logcdf(*goodargs)) + if output.ndim == 0: + return output[()] + return output + + def sf(self, k, *args, **kwds): + """Survival function (1 - `cdf`) at k of the given RV. + + Parameters + ---------- + k : array_like + Quantiles. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter (default=0). + + Returns + ------- + sf : array_like + Survival function evaluated at k. + + """ + args, loc, _ = self._parse_args(*args, **kwds) + k, loc = map(asarray, (k, loc)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + k = asarray(k-loc) + cond0 = self._argcheck(*args) + cond1 = (k >= _a) & (k < _b) + cond2 = ((k < _a) | np.isneginf(k)) & cond0 + cond = cond0 & cond1 & np.isfinite(k) + output = zeros(shape(cond), 'd') + place(output, (1-cond0) + np.isnan(k), self.badvalue) + place(output, cond2, 1.0) + if np.any(cond): + goodargs = argsreduce(cond, *((k,)+args)) + place(output, cond, np.clip(self._sf(*goodargs), 0, 1)) + if output.ndim == 0: + return output[()] + return output + + def logsf(self, k, *args, **kwds): + """Log of the survival function of the given RV. + + Returns the log of the "survival function," defined as 1 - `cdf`, + evaluated at `k`. + + Parameters + ---------- + k : array_like + Quantiles. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter (default=0). + + Returns + ------- + logsf : ndarray + Log of the survival function evaluated at `k`. + + """ + args, loc, _ = self._parse_args(*args, **kwds) + k, loc = map(asarray, (k, loc)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + k = asarray(k-loc) + cond0 = self._argcheck(*args) + cond1 = (k >= _a) & (k < _b) + cond2 = (k < _a) & cond0 + cond = cond0 & cond1 + output = empty(shape(cond), 'd') + output.fill(-inf) + place(output, (1-cond0) + np.isnan(k), self.badvalue) + place(output, cond2, 0.0) + if np.any(cond): + goodargs = argsreduce(cond, *((k,)+args)) + place(output, cond, self._logsf(*goodargs)) + if output.ndim == 0: + return output[()] + return output + + def ppf(self, q, *args, **kwds): + """Percent point function (inverse of `cdf`) at q of the given RV. + + Parameters + ---------- + q : array_like + Lower tail probability. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter (default=0). + + Returns + ------- + k : array_like + Quantile corresponding to the lower tail probability, q. + + """ + args, loc, _ = self._parse_args(*args, **kwds) + q, loc = map(asarray, (q, loc)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + cond0 = self._argcheck(*args) & (loc == loc) + cond1 = (q > 0) & (q < 1) + cond2 = (q == 1) & cond0 + cond = cond0 & cond1 + output = np.full(shape(cond), fill_value=self.badvalue, dtype='d') + # output type 'd' to handle nin and inf + place(output, (q == 0)*(cond == cond), _a-1 + loc) + place(output, cond2, _b + loc) + if np.any(cond): + goodargs = argsreduce(cond, *((q,)+args+(loc,))) + loc, goodargs = goodargs[-1], goodargs[:-1] + place(output, cond, self._ppf(*goodargs) + loc) + + if output.ndim == 0: + return output[()] + return output + + def isf(self, q, *args, **kwds): + """Inverse survival function (inverse of `sf`) at q of the given RV. + + Parameters + ---------- + q : array_like + Upper tail probability. + arg1, arg2, arg3,... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + loc : array_like, optional + Location parameter (default=0). + + Returns + ------- + k : ndarray or scalar + Quantile corresponding to the upper tail probability, q. + + """ + args, loc, _ = self._parse_args(*args, **kwds) + q, loc = map(asarray, (q, loc)) + args = tuple(map(asarray, args)) + _a, _b = self._get_support(*args) + cond0 = self._argcheck(*args) & (loc == loc) + cond1 = (q > 0) & (q < 1) + cond2 = (q == 1) & cond0 + cond3 = (q == 0) & cond0 + cond = cond0 & cond1 + + # same problem as with ppf; copied from ppf and changed + output = np.full(shape(cond), fill_value=self.badvalue, dtype='d') + # output type 'd' to handle nin and inf + lower_bound = _a - 1 + loc + upper_bound = _b + loc + place(output, cond2*(cond == cond), lower_bound) + place(output, cond3*(cond == cond), upper_bound) + + # call place only if at least 1 valid argument + if np.any(cond): + goodargs = argsreduce(cond, *((q,)+args+(loc,))) + loc, goodargs = goodargs[-1], goodargs[:-1] + # PB same as ticket 766 + place(output, cond, self._isf(*goodargs) + loc) + + if output.ndim == 0: + return output[()] + return output + + def _entropy(self, *args): + if hasattr(self, 'pk'): + return stats.entropy(self.pk) + else: + _a, _b = self._get_support(*args) + return _expect(lambda x: entr(self._pmf(x, *args)), + _a, _b, self._ppf(0.5, *args), self.inc) + + def expect(self, func=None, args=(), loc=0, lb=None, ub=None, + conditional=False, maxcount=1000, tolerance=1e-10, chunksize=32): + """ + Calculate expected value of a function with respect to the distribution + for discrete distribution by numerical summation. + + Parameters + ---------- + func : callable, optional + Function for which the expectation value is calculated. + Takes only one argument. + The default is the identity mapping f(k) = k. + args : tuple, optional + Shape parameters of the distribution. + loc : float, optional + Location parameter. + Default is 0. + lb, ub : int, optional + Lower and upper bound for the summation, default is set to the + support of the distribution, inclusive (``lb <= k <= ub``). + conditional : bool, optional + If true then the expectation is corrected by the conditional + probability of the summation interval. The return value is the + expectation of the function, `func`, conditional on being in + the given interval (k such that ``lb <= k <= ub``). + Default is False. + maxcount : int, optional + Maximal number of terms to evaluate (to avoid an endless loop for + an infinite sum). Default is 1000. + tolerance : float, optional + Absolute tolerance for the summation. Default is 1e-10. + chunksize : int, optional + Iterate over the support of a distributions in chunks of this size. + Default is 32. + + Returns + ------- + expect : float + Expected value. + + Notes + ----- + For heavy-tailed distributions, the expected value may or + may not exist, + depending on the function, `func`. If it does exist, but the + sum converges + slowly, the accuracy of the result may be rather low. For instance, for + ``zipf(4)``, accuracy for mean, variance in example is only 1e-5. + increasing `maxcount` and/or `chunksize` may improve the result, + but may also make zipf very slow. + + The function is not vectorized. + + """ + # Although `args` is just the shape parameters, `poisson_binom` needs this + # to split the vector-valued shape into a tuple of separate shapes + args, _, _ = self._parse_args(*args) + + if func is None: + def fun(x): + # loc and args from outer scope + return (x+loc)*self._pmf(x, *args) + else: + def fun(x): + # loc and args from outer scope + return func(x+loc)*self._pmf(x, *args) + # used pmf because _pmf does not check support in randint and there + # might be problems(?) with correct self.a, self.b at this stage maybe + # not anymore, seems to work now with _pmf + + _a, _b = self._get_support(*args) + if lb is None: + lb = _a + else: + lb = lb - loc # convert bound for standardized distribution + if ub is None: + ub = _b + else: + ub = ub - loc # convert bound for standardized distribution + if conditional: + invfac = self.sf(lb-1, *args) - self.sf(ub, *args) + else: + invfac = 1.0 + + if isinstance(self, rv_sample): + res = self._expect(fun, lb, ub) + return res / invfac + + # iterate over the support, starting from the median + x0 = self._ppf(0.5, *args) + res = _expect(fun, lb, ub, x0, self.inc, maxcount, tolerance, chunksize) + return res / invfac + + def _param_info(self): + shape_info = self._shape_info() + loc_info = _ShapeInfo("loc", True, (-np.inf, np.inf), (False, False)) + param_info = shape_info + [loc_info] + return param_info + + +def _expect(fun, lb, ub, x0, inc, maxcount=1000, tolerance=1e-10, + chunksize=32): + """Helper for computing the expectation value of `fun`.""" + # short-circuit if the support size is small enough + if (ub - lb) <= chunksize: + supp = np.arange(lb, ub+1, inc) + vals = fun(supp) + return np.sum(vals) + + # otherwise, iterate starting from x0 + if x0 < lb: + x0 = lb + if x0 > ub: + x0 = ub + + count, tot = 0, 0. + # iterate over [x0, ub] inclusive + for x in _iter_chunked(x0, ub+1, chunksize=chunksize, inc=inc): + count += x.size + delta = np.sum(fun(x)) + tot += delta + if abs(delta) < tolerance * x.size: + break + if count > maxcount: + warnings.warn('expect(): sum did not converge', + RuntimeWarning, stacklevel=3) + return tot + + # iterate over [lb, x0) + for x in _iter_chunked(x0-1, lb-1, chunksize=chunksize, inc=-inc): + count += x.size + delta = np.sum(fun(x)) + tot += delta + if abs(delta) < tolerance * x.size: + break + if count > maxcount: + warnings.warn('expect(): sum did not converge', + RuntimeWarning, stacklevel=3) + break + + return tot + + +def _iter_chunked(x0, x1, chunksize=4, inc=1): + """Iterate from x0 to x1 in chunks of chunksize and steps inc. + + x0 must be finite, x1 need not be. In the latter case, the iterator is + infinite. + Handles both x0 < x1 and x0 > x1. In the latter case, iterates downwards + (make sure to set inc < 0.) + + >>> from scipy.stats._distn_infrastructure import _iter_chunked + >>> [x for x in _iter_chunked(2, 5, inc=2)] + [array([2, 4])] + >>> [x for x in _iter_chunked(2, 11, inc=2)] + [array([2, 4, 6, 8]), array([10])] + >>> [x for x in _iter_chunked(2, -5, inc=-2)] + [array([ 2, 0, -2, -4])] + >>> [x for x in _iter_chunked(2, -9, inc=-2)] + [array([ 2, 0, -2, -4]), array([-6, -8])] + + """ + if inc == 0: + raise ValueError('Cannot increment by zero.') + if chunksize <= 0: + raise ValueError(f'Chunk size must be positive; got {chunksize}.') + + s = 1 if inc > 0 else -1 + stepsize = abs(chunksize * inc) + + x = np.copy(x0) + while (x - x1) * inc < 0: + delta = min(stepsize, abs(x - x1)) + step = delta * s + supp = np.arange(x, x + step, inc) + x += step + yield supp + + +class rv_sample(rv_discrete): + """A 'sample' discrete distribution defined by the support and values. + + The ctor ignores most of the arguments, only needs the `values` argument. + """ + + def __init__(self, a=0, b=inf, name=None, badvalue=None, + moment_tol=1e-8, values=None, inc=1, longname=None, + shapes=None, seed=None): + + super(rv_discrete, self).__init__(seed) + + if values is None: + raise ValueError("rv_sample.__init__(..., values=None,...)") + + # cf generic freeze + self._ctor_param = dict( + a=a, b=b, name=name, badvalue=badvalue, + moment_tol=moment_tol, values=values, inc=inc, + longname=longname, shapes=shapes, seed=seed) + + if badvalue is None: + badvalue = nan + self.badvalue = badvalue + self.moment_tol = moment_tol + self.inc = inc + self.shapes = shapes + self.vecentropy = self._entropy + + xk, pk = values + + if np.shape(xk) != np.shape(pk): + raise ValueError("xk and pk must have the same shape.") + if np.less(pk, 0.0).any(): + raise ValueError("All elements of pk must be non-negative.") + if not np.allclose(np.sum(pk), 1): + raise ValueError("The sum of provided pk is not 1.") + if not len(set(np.ravel(xk))) == np.size(xk): + raise ValueError("xk may not contain duplicate values.") + + indx = np.argsort(np.ravel(xk)) + self.xk = np.take(np.ravel(xk), indx, 0) + self.pk = np.take(np.ravel(pk), indx, 0) + self.a = self.xk[0] + self.b = self.xk[-1] + + self.qvals = np.cumsum(self.pk, axis=0) + + self.shapes = ' ' # bypass inspection + + self._construct_argparser(meths_to_inspect=[self._pmf], + locscale_in='loc=0', + # scale=1 for discrete RVs + locscale_out='loc, 1') + + self._attach_methods() + + self._construct_docstrings(name, longname) + + def __getstate__(self): + dct = self.__dict__.copy() + + # these methods will be remade in rv_generic.__setstate__, + # which calls rv_generic._attach_methods + attrs = ["_parse_args", "_parse_args_stats", "_parse_args_rvs"] + [dct.pop(attr, None) for attr in attrs] + + return dct + + def _attach_methods(self): + """Attaches dynamically created argparser methods.""" + self._attach_argparser_methods() + + def _get_support(self, *args): + """Return the support of the (unscaled, unshifted) distribution. + + Parameters + ---------- + arg1, arg2, ... : array_like + The shape parameter(s) for the distribution (see docstring of the + instance object for more information). + + Returns + ------- + a, b : numeric (float, or int or +/-np.inf) + end-points of the distribution's support. + """ + return self.a, self.b + + def _pmf(self, x): + return np.select([x == k for k in self.xk], + [np.broadcast_arrays(p, x)[0] for p in self.pk], 0) + + def _cdf(self, x): + xx, xxk = np.broadcast_arrays(x[:, None], self.xk) + indx = np.argmax(xxk > xx, axis=-1) - 1 + return self.qvals[indx] + + def _ppf(self, q): + qq, sqq = np.broadcast_arrays(q[..., None], self.qvals) + indx = argmax(sqq >= qq, axis=-1) + return self.xk[indx] + + def _rvs(self, size=None, random_state=None): + # Need to define it explicitly, otherwise .rvs() with size=None + # fails due to explicit broadcasting in _ppf + U = random_state.uniform(size=size) + if size is None: + U = np.array(U, ndmin=1) + Y = self._ppf(U)[0] + else: + Y = self._ppf(U) + return Y + + def _entropy(self): + return stats.entropy(self.pk) + + def generic_moment(self, n): + n = asarray(n) + return np.sum(self.xk**n[np.newaxis, ...] * self.pk, axis=0) + + def _expect(self, fun, lb, ub, *args, **kwds): + # ignore all args, just do a brute force summation + supp = self.xk[(lb <= self.xk) & (self.xk <= ub)] + vals = fun(supp) + return np.sum(vals) + + +def _check_shape(argshape, size): + """ + This is a utility function used by `_rvs()` in the class geninvgauss_gen. + It compares the tuple argshape to the tuple size. + + Parameters + ---------- + argshape : tuple of integers + Shape of the arguments. + size : tuple of integers or integer + Size argument of rvs(). + + Returns + ------- + The function returns two tuples, scalar_shape and bc. + + scalar_shape : tuple + Shape to which the 1-d array of random variates returned by + _rvs_scalar() is converted when it is copied into the + output array of _rvs(). + + bc : tuple of booleans + bc is an tuple the same length as size. bc[j] is True if the data + associated with that index is generated in one call of _rvs_scalar(). + + """ + scalar_shape = [] + bc = [] + for argdim, sizedim in zip_longest(argshape[::-1], size[::-1], + fillvalue=1): + if sizedim > argdim or (argdim == sizedim == 1): + scalar_shape.append(sizedim) + bc.append(True) + else: + bc.append(False) + return tuple(scalar_shape[::-1]), tuple(bc[::-1]) + + +def get_distribution_names(namespace_pairs, rv_base_class): + """Collect names of statistical distributions and their generators. + + Parameters + ---------- + namespace_pairs : sequence + A snapshot of (name, value) pairs in the namespace of a module. + rv_base_class : class + The base class of random variable generator classes in a module. + + Returns + ------- + distn_names : list of strings + Names of the statistical distributions. + distn_gen_names : list of strings + Names of the generators of the statistical distributions. + Note that these are not simply the names of the statistical + distributions, with a _gen suffix added. + + """ + distn_names = [] + distn_gen_names = [] + for name, value in namespace_pairs: + if name.startswith('_'): + continue + if name.endswith('_gen') and issubclass(value, rv_base_class): + distn_gen_names.append(name) + if isinstance(value, rv_base_class): + distn_names.append(name) + return distn_names, distn_gen_names diff --git a/shared/package-files/9d/9dfc3d5f071cfb38722209d3b15d93589ad6c421c0d2b45c1d1c25a62f1f7388/blob b/shared/package-files/9d/9dfc3d5f071cfb38722209d3b15d93589ad6c421c0d2b45c1d1c25a62f1f7388/blob new file mode 100644 index 0000000000000000000000000000000000000000..d61a0a4ec0d8be8e1c3e49e352b288a4767b9ed0 --- /dev/null +++ b/shared/package-files/9d/9dfc3d5f071cfb38722209d3b15d93589ad6c421c0d2b45c1d1c25a62f1f7388/blob @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace torch { +namespace jit { + +// Peephole Optimizes alias sensitive peepholes +// Currently this is invoked as part of PeepholeOptimize +// return true if graph is modified +// Optimizes on TensorType if shape_peepholes is true +TORCH_API bool PeepholeOptimizeAliasSensitive( + const std::shared_ptr& graph, + bool shape_peepholes); + +} // namespace jit +} // namespace torch diff --git a/shared/package-files/9d/9dfcad59db1a286ca84d53ec222d01fb5e7279c46f350eb56372ffb13d2aa6fa/blob b/shared/package-files/9d/9dfcad59db1a286ca84d53ec222d01fb5e7279c46f350eb56372ffb13d2aa6fa/blob new file mode 100644 index 0000000000000000000000000000000000000000..76fc4172f0737fc0c049d59941d75488b25030de --- /dev/null +++ b/shared/package-files/9d/9dfcad59db1a286ca84d53ec222d01fb5e7279c46f350eb56372ffb13d2aa6fa/blob @@ -0,0 +1,8 @@ +from typing import Any + +log: Any +default_settings_dict: Any +OVERRIDE_SETTINGS_PATH: Any +override_settings: Any + +def get_settings_value(key): ... diff --git a/shared/package-files/9d/9dfee410d8ba1d624c3e9702a6105318679b02aedcff385f4d535ad9027bbcf1/blob b/shared/package-files/9d/9dfee410d8ba1d624c3e9702a6105318679b02aedcff385f4d535ad9027bbcf1/blob new file mode 100644 index 0000000000000000000000000000000000000000..08a5db3a9e9c6d6da6035fd36e0c0b40e206337d --- /dev/null +++ b/shared/package-files/9d/9dfee410d8ba1d624c3e9702a6105318679b02aedcff385f4d535ad9027bbcf1/blob @@ -0,0 +1,51 @@ +#pragma once + +// WARNING: Be careful when adding new includes here. This header will be used +// in model.so, and should not refer to any aten/c10 headers except the stable +// C ABI defined in torch/csrc/inductor/aoti_torch/c/shim.h. The same rule +// applies to other files under torch/csrc/inductor/aoti_runtime/. + +#ifdef USE_CUDA + +// FIXME: Currently, CPU and CUDA backend are mutually exclusive. +// This is a temporary workaround. We need a better way to support +// multi devices. + +#include +#include + +#define AOTI_RUNTIME_DEVICE_CHECK(EXPR) \ + do { \ + const cudaError_t code = EXPR; \ + const char* msg = cudaGetErrorString(code); \ + if (code != cudaSuccess) { \ + throw std::runtime_error( \ + std::string("CUDA error: ") + std::string(msg)); \ + } \ + } while (0) + +namespace torch { +namespace aot_inductor { + +using DeviceStreamType = cudaStream_t; + +} // namespace aot_inductor +} // namespace torch + +#else // !USE_CUDA + +#define AOTI_RUNTIME_DEVICE_CHECK(EXPR) \ + bool ok = EXPR; \ + if (!ok) { \ + throw std::runtime_error("CPU runtime error"); \ + } + +namespace torch { +namespace aot_inductor { + +using DeviceStreamType = void*; + +} // namespace aot_inductor +} // namespace torch + +#endif // USE_CUDA diff --git a/shared/package-files/9d/9dff6801a6bd44a710e5ec929f531befc05f96b3cdeb514aa9e65a5528445c22/blob b/shared/package-files/9d/9dff6801a6bd44a710e5ec929f531befc05f96b3cdeb514aa9e65a5528445c22/blob new file mode 100644 index 0000000000000000000000000000000000000000..13d52d4785eaabc1017f9373d4df460ac0d84306 Binary files /dev/null and b/shared/package-files/9d/9dff6801a6bd44a710e5ec929f531befc05f96b3cdeb514aa9e65a5528445c22/blob differ diff --git a/shared/package-files/9e/9e0383efbfd3248d4f3f10dc811737596fe59f77da04dc05f46f138d3947a156/blob b/shared/package-files/9e/9e0383efbfd3248d4f3f10dc811737596fe59f77da04dc05f46f138d3947a156/blob new file mode 100644 index 0000000000000000000000000000000000000000..26d6316b282cb69626ea9aba5b4a35034cca41b0 --- /dev/null +++ b/shared/package-files/9e/9e0383efbfd3248d4f3f10dc811737596fe59f77da04dc05f46f138d3947a156/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API angle { + using schema = at::Tensor (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::angle") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "angle(Tensor self) -> Tensor") + static at::Tensor call(const at::Tensor & self); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +struct TORCH_API angle_out { + using schema = at::Tensor & (const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::angle") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "angle.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9e/9e04871503d17e63a40cea39e2c5fe97926342fafb65313d3b34bd68f89c737a/blob b/shared/package-files/9e/9e04871503d17e63a40cea39e2c5fe97926342fafb65313d3b34bd68f89c737a/blob new file mode 100644 index 0000000000000000000000000000000000000000..b3bb35c9396f4d1748fff37b7334c68a0b055daf --- /dev/null +++ b/shared/package-files/9e/9e04871503d17e63a40cea39e2c5fe97926342fafb65313d3b34bd68f89c737a/blob @@ -0,0 +1,137 @@ +""" +Test extension array for storing nested data in a pandas container. + +The ListArray stores an ndarray of lists. +""" +from __future__ import annotations + +import numbers +import string +from typing import TYPE_CHECKING + +import numpy as np + +from pandas.core.dtypes.base import ExtensionDtype + +import pandas as pd +from pandas.api.types import ( + is_object_dtype, + is_string_dtype, +) +from pandas.core.arrays import ExtensionArray + +if TYPE_CHECKING: + from pandas._typing import type_t + + +class ListDtype(ExtensionDtype): + type = list + name = "list" + na_value = np.nan + + @classmethod + def construct_array_type(cls) -> type_t[ListArray]: + """ + Return the array type associated with this dtype. + + Returns + ------- + type + """ + return ListArray + + +class ListArray(ExtensionArray): + dtype = ListDtype() + __array_priority__ = 1000 + + def __init__(self, values, dtype=None, copy=False) -> None: + if not isinstance(values, np.ndarray): + raise TypeError("Need to pass a numpy array as values") + for val in values: + if not isinstance(val, self.dtype.type) and not pd.isna(val): + raise TypeError("All values must be of type " + str(self.dtype.type)) + self.data = values + + @classmethod + def _from_sequence(cls, scalars, *, dtype=None, copy=False): + data = np.empty(len(scalars), dtype=object) + data[:] = scalars + return cls(data) + + def __getitem__(self, item): + if isinstance(item, numbers.Integral): + return self.data[item] + else: + # slice, list-like, mask + return type(self)(self.data[item]) + + def __len__(self) -> int: + return len(self.data) + + def isna(self): + return np.array( + [not isinstance(x, list) and np.isnan(x) for x in self.data], dtype=bool + ) + + def take(self, indexer, allow_fill=False, fill_value=None): + # re-implement here, since NumPy has trouble setting + # sized objects like UserDicts into scalar slots of + # an ndarary. + indexer = np.asarray(indexer) + msg = ( + "Index is out of bounds or cannot do a " + "non-empty take from an empty array." + ) + + if allow_fill: + if fill_value is None: + fill_value = self.dtype.na_value + # bounds check + if (indexer < -1).any(): + raise ValueError + try: + output = [ + self.data[loc] if loc != -1 else fill_value for loc in indexer + ] + except IndexError as err: + raise IndexError(msg) from err + else: + try: + output = [self.data[loc] for loc in indexer] + except IndexError as err: + raise IndexError(msg) from err + + return self._from_sequence(output) + + def copy(self): + return type(self)(self.data[:]) + + def astype(self, dtype, copy=True): + if isinstance(dtype, type(self.dtype)) and dtype == self.dtype: + if copy: + return self.copy() + return self + elif is_string_dtype(dtype) and not is_object_dtype(dtype): + # numpy has problems with astype(str) for nested elements + return np.array([str(x) for x in self.data], dtype=dtype) + elif not copy: + return np.asarray(self.data, dtype=dtype) + else: + return np.array(self.data, dtype=dtype, copy=copy) + + @classmethod + def _concat_same_type(cls, to_concat): + data = np.concatenate([x.data for x in to_concat]) + return cls(data) + + +def make_data(): + # TODO: Use a regular dict. See _NDFrameIndexer._setitem_with_indexer + rng = np.random.default_rng(2) + data = np.empty(100, dtype=object) + data[:] = [ + [rng.choice(list(string.ascii_letters)) for _ in range(rng.integers(0, 10))] + for _ in range(100) + ] + return data diff --git a/shared/package-files/9e/9e07b30352ae20da8990b01c32b64947b6ccd08780db953a23e6b96884865c9a/blob b/shared/package-files/9e/9e07b30352ae20da8990b01c32b64947b6ccd08780db953a23e6b96884865c9a/blob new file mode 100644 index 0000000000000000000000000000000000000000..a6acc7384dd95f7ef51d17c85492342dde353d0d --- /dev/null +++ b/shared/package-files/9e/9e07b30352ae20da8990b01c32b64947b6ccd08780db953a23e6b96884865c9a/blob @@ -0,0 +1,14 @@ +#ifndef __VSX__ + #error "VSX is not supported" +#endif +#include + +typedef __vector unsigned int v_uint32x4; + +int main(void) +{ + v_uint32x4 v1 = (v_uint32x4){2, 4, 8, 16}; + v_uint32x4 v2 = (v_uint32x4){2, 2, 2, 2}; + v_uint32x4 v3 = vec_mod(v1, v2); + return (int)vec_extractm(v3); +} diff --git a/shared/package-files/9e/9e0893327205dea12004e88d18c580286e7977e081b5eda7baf5b7bc93bc6c52/blob b/shared/package-files/9e/9e0893327205dea12004e88d18c580286e7977e081b5eda7baf5b7bc93bc6c52/blob new file mode 100644 index 0000000000000000000000000000000000000000..ab921ee80cdf366532f027b2549e5bcba55a4fd5 --- /dev/null +++ b/shared/package-files/9e/9e0893327205dea12004e88d18c580286e7977e081b5eda7baf5b7bc93bc6c52/blob @@ -0,0 +1,39 @@ +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for exec. + +This converts usages of the exec statement into calls to a built-in +exec() function. + +exec code in ns1, ns2 -> exec(code, ns1, ns2) +""" + +# Local imports +from .. import fixer_base +from ..fixer_util import Comma, Name, Call + + +class FixExec(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + exec_stmt< 'exec' a=any 'in' b=any [',' c=any] > + | + exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any > + """ + + def transform(self, node, results): + assert results + syms = self.syms + a = results["a"] + b = results.get("b") + c = results.get("c") + args = [a.clone()] + args[0].prefix = "" + if b is not None: + args.extend([Comma(), b.clone()]) + if c is not None: + args.extend([Comma(), c.clone()]) + + return Call(Name("exec"), args, prefix=node.prefix) diff --git a/shared/package-files/9e/9e08972835d338d299d472a6026184fc91512db6fc9367fb8d934a02e8c50f85/blob b/shared/package-files/9e/9e08972835d338d299d472a6026184fc91512db6fc9367fb8d934a02e8c50f85/blob new file mode 100644 index 0000000000000000000000000000000000000000..d77466af0d34c9f09b1744357f6cb1dfe3d7bb55 --- /dev/null +++ b/shared/package-files/9e/9e08972835d338d299d472a6026184fc91512db6fc9367fb8d934a02e8c50f85/blob @@ -0,0 +1,83 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _fused_sgd_ { + using schema = void (at::TensorList, at::TensorList, at::TensorList, double, double, double, double, bool, bool, bool, const c10::optional &, const c10::optional &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_fused_sgd_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_fused_sgd_(Tensor(a!)[] self, Tensor(b!)[] grads, Tensor(c!)[] momentum_buffer_list, *, float weight_decay, float momentum, float lr, float dampening, bool nesterov, bool maximize, bool is_first_step, Tensor? grad_scale=None, Tensor? found_inf=None) -> ()") + static void call(at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, double lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf); + static void redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, double lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf); +}; + +struct TORCH_API _fused_sgd__tensor_lr { + using schema = void (at::TensorList, at::TensorList, at::TensorList, double, double, const at::Tensor &, double, bool, bool, bool, const c10::optional &, const c10::optional &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_fused_sgd_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "tensor_lr") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_fused_sgd_.tensor_lr(Tensor(a!)[] self, Tensor(b!)[] grads, Tensor(c!)[] momentum_buffer_list, *, float weight_decay, float momentum, Tensor lr, float dampening, bool nesterov, bool maximize, bool is_first_step, Tensor? grad_scale=None, Tensor? found_inf=None) -> ()") + static void call(at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, const at::Tensor & lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf); + static void redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, const at::Tensor & lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf); +}; + +struct TORCH_API _fused_sgd_out { + using schema = void (at::TensorList, at::TensorList, at::TensorList, double, double, double, double, bool, bool, bool, const c10::optional &, const c10::optional &, at::TensorList); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_fused_sgd") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_fused_sgd.out(Tensor[] self, Tensor(b!)[] grads, Tensor(c!)[] momentum_buffer_list, *, float weight_decay, float momentum, float lr, float dampening, bool nesterov, bool maximize, bool is_first_step, Tensor? grad_scale=None, Tensor? found_inf=None, Tensor(a!)[] out) -> ()") + static void call(at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, double lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf, at::TensorList out); + static void redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, double lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf, at::TensorList out); +}; + +struct TORCH_API _fused_sgd { + using schema = ::std::tuple<::std::vector,::std::vector,::std::vector> (at::TensorList, at::TensorList, at::TensorList, double, double, double, double, bool, bool, bool, const c10::optional &, const c10::optional &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_fused_sgd") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_fused_sgd(Tensor[] self, Tensor[] grads, Tensor[] momentum_buffer_list, *, float weight_decay, float momentum, float lr, float dampening, bool nesterov, bool maximize, bool is_first_step, Tensor? grad_scale=None, Tensor? found_inf=None) -> (Tensor[] self_out, Tensor[] grads_out, Tensor[] momentum_buffer_list_out)") + static ::std::tuple<::std::vector,::std::vector,::std::vector> call(at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, double lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf); + static ::std::tuple<::std::vector,::std::vector,::std::vector> redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, double lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf); +}; + +struct TORCH_API _fused_sgd_tensor_lr_out { + using schema = void (at::TensorList, at::TensorList, at::TensorList, double, double, const at::Tensor &, double, bool, bool, bool, const c10::optional &, const c10::optional &, at::TensorList); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_fused_sgd") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "tensor_lr_out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_fused_sgd.tensor_lr_out(Tensor[] self, Tensor(b!)[] grads, Tensor(c!)[] momentum_buffer_list, *, float weight_decay, float momentum, Tensor lr, float dampening, bool nesterov, bool maximize, bool is_first_step, Tensor? grad_scale=None, Tensor? found_inf=None, Tensor(a!)[] out) -> ()") + static void call(at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, const at::Tensor & lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf, at::TensorList out); + static void redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, const at::Tensor & lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf, at::TensorList out); +}; + +struct TORCH_API _fused_sgd_tensor_lr { + using schema = ::std::tuple<::std::vector,::std::vector,::std::vector> (at::TensorList, at::TensorList, at::TensorList, double, double, const at::Tensor &, double, bool, bool, bool, const c10::optional &, const c10::optional &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_fused_sgd") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "tensor_lr") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_fused_sgd.tensor_lr(Tensor[] self, Tensor[] grads, Tensor[] momentum_buffer_list, *, float weight_decay, float momentum, Tensor lr, float dampening, bool nesterov, bool maximize, bool is_first_step, Tensor? grad_scale=None, Tensor? found_inf=None) -> (Tensor[] self_out, Tensor[] grads_out, Tensor[] momentum_buffer_list_out)") + static ::std::tuple<::std::vector,::std::vector,::std::vector> call(at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, const at::Tensor & lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf); + static ::std::tuple<::std::vector,::std::vector,::std::vector> redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, at::TensorList grads, at::TensorList momentum_buffer_list, double weight_decay, double momentum, const at::Tensor & lr, double dampening, bool nesterov, bool maximize, bool is_first_step, const c10::optional & grad_scale, const c10::optional & found_inf); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9e/9e09d0e05cc00d42446efe9ea084a772990d23bde42a973c2046f4dc9e3c403a/blob b/shared/package-files/9e/9e09d0e05cc00d42446efe9ea084a772990d23bde42a973c2046f4dc9e3c403a/blob new file mode 100644 index 0000000000000000000000000000000000000000..9402b831cd2c6003b4562d7b10b0f9c5dea7ac8f --- /dev/null +++ b/shared/package-files/9e/9e09d0e05cc00d42446efe9ea084a772990d23bde42a973c2046f4dc9e3c403a/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_test_autograd_multiple_dispatch_view_copy(Tensor self) -> Tensor +inline at::Tensor _test_autograd_multiple_dispatch_view_copy(const at::Tensor & self) { + return at::_ops::_test_autograd_multiple_dispatch_view_copy::call(self); +} + +// aten::_test_autograd_multiple_dispatch_view_copy.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _test_autograd_multiple_dispatch_view_copy_out(at::Tensor & out, const at::Tensor & self) { + return at::_ops::_test_autograd_multiple_dispatch_view_copy_out::call(self, out); +} +// aten::_test_autograd_multiple_dispatch_view_copy.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & _test_autograd_multiple_dispatch_view_copy_outf(const at::Tensor & self, at::Tensor & out) { + return at::_ops::_test_autograd_multiple_dispatch_view_copy_out::call(self, out); +} + +} diff --git a/shared/package-files/9e/9e0b573e5fe8b30164e7da62c4b93dbe3f64978e2c06a2016cb8445d8ee6f6ef/blob b/shared/package-files/9e/9e0b573e5fe8b30164e7da62c4b93dbe3f64978e2c06a2016cb8445d8ee6f6ef/blob new file mode 100644 index 0000000000000000000000000000000000000000..286fcd38471985fc327835c9676278d0f6cef255 --- /dev/null +++ b/shared/package-files/9e/9e0b573e5fe8b30164e7da62c4b93dbe3f64978e2c06a2016cb8445d8ee6f6ef/blob @@ -0,0 +1,35 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & relu_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor relu(const at::Tensor & self); +TORCH_API at::Tensor & relu_(at::Tensor & self); +TORCH_API at::Tensor NestedTensor_relu(const at::Tensor & self); +TORCH_API at::Tensor & NestedTensor_relu_(at::Tensor & self); +TORCH_API at::Tensor relu_sparse(const at::Tensor & self); +TORCH_API at::Tensor & relu_sparse_(at::Tensor & self); +TORCH_API at::Tensor relu_sparse_csr(const at::Tensor & self); +TORCH_API at::Tensor & relu_sparse_csr_(at::Tensor & self); +TORCH_API at::Tensor mkldnn_relu(const at::Tensor & self); +TORCH_API at::Tensor & mkldnn_relu_(at::Tensor & self); +TORCH_API at::Tensor relu_quantized_cpu(const at::Tensor & self); +TORCH_API at::Tensor & relu_quantized_cpu_(at::Tensor & self); +TORCH_API at::Tensor relu_quantized_cuda(const at::Tensor & self); +TORCH_API at::Tensor & relu_quantized_cuda_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/9e/9e10cd54f8f2036c0e95704f183dd5c30a18f143995c565bb68efa70dfdea2e1/blob b/shared/package-files/9e/9e10cd54f8f2036c0e95704f183dd5c30a18f143995c565bb68efa70dfdea2e1/blob new file mode 100644 index 0000000000000000000000000000000000000000..2eb95092126f43659903613bd4eb9821e1916aff --- /dev/null +++ b/shared/package-files/9e/9e10cd54f8f2036c0e95704f183dd5c30a18f143995c565bb68efa70dfdea2e1/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor log_sigmoid(const at::Tensor & self); +TORCH_API at::Tensor & log_sigmoid_out(const at::Tensor & self, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/9e/9e12ba2cb5985bdddf05cb0588ed3d266a858f6ae01c4b0660539e682ec744ac/blob b/shared/package-files/9e/9e12ba2cb5985bdddf05cb0588ed3d266a858f6ae01c4b0660539e682ec744ac/blob new file mode 100644 index 0000000000000000000000000000000000000000..0223aa593bb2cb20b58f2b9e41bdc0dfa5ceed35 --- /dev/null +++ b/shared/package-files/9e/9e12ba2cb5985bdddf05cb0588ed3d266a858f6ae01c4b0660539e682ec744ac/blob @@ -0,0 +1,64 @@ +""" +Internal debugging utilities, that are not expected to be used in the rest of +the codebase. + +WARNING: Code in this module may change without prior notice! +""" + +from io import StringIO +from pathlib import Path +import subprocess + +from matplotlib.transforms import TransformNode + + +def graphviz_dump_transform(transform, dest, *, highlight=None): + """ + Generate a graphical representation of the transform tree for *transform* + using the :program:`dot` program (which this function depends on). The + output format (png, dot, etc.) is determined from the suffix of *dest*. + + Parameters + ---------- + transform : `~matplotlib.transform.Transform` + The represented transform. + dest : str + Output filename. The extension must be one of the formats supported + by :program:`dot`, e.g. png, svg, dot, ... + (see https://www.graphviz.org/doc/info/output.html). + highlight : list of `~matplotlib.transform.Transform` or None + The transforms in the tree to be drawn in bold. + If *None*, *transform* is highlighted. + """ + + if highlight is None: + highlight = [transform] + seen = set() + + def recurse(root, buf): + if id(root) in seen: + return + seen.add(id(root)) + props = {} + label = type(root).__name__ + if root._invalid: + label = f'[{label}]' + if root in highlight: + props['style'] = 'bold' + props['shape'] = 'box' + props['label'] = '"%s"' % label + props = ' '.join(map('{0[0]}={0[1]}'.format, props.items())) + buf.write(f'{id(root)} [{props}];\n') + for key, val in vars(root).items(): + if isinstance(val, TransformNode) and id(root) in val._parents: + buf.write(f'"{id(root)}" -> "{id(val)}" ' + f'[label="{key}", fontsize=10];\n') + recurse(val, buf) + + buf = StringIO() + buf.write('digraph G {\n') + recurse(transform, buf) + buf.write('}\n') + subprocess.run( + ['dot', '-T', Path(dest).suffix[1:], '-o', dest], + input=buf.getvalue().encode('utf-8'), check=True) diff --git a/shared/package-files/9e/9e13f8afa4857e0bdfdc64aca45d3e49892f1d9fb66d25ebf213957afa75a8c9/blob b/shared/package-files/9e/9e13f8afa4857e0bdfdc64aca45d3e49892f1d9fb66d25ebf213957afa75a8c9/blob new file mode 100644 index 0000000000000000000000000000000000000000..cdc6410d8f4bd0d65b21a741740ecf88e55aa04e --- /dev/null +++ b/shared/package-files/9e/9e13f8afa4857e0bdfdc64aca45d3e49892f1d9fb66d25ebf213957afa75a8c9/blob @@ -0,0 +1,81 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::div.Tensor(Tensor self, Tensor other) -> Tensor +inline at::Tensor div(const at::Tensor & self, const at::Tensor & other) { + return at::_ops::div_Tensor::call(self, other); +} + +// aten::div.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & div_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other) { + return at::_ops::div_out::call(self, other, out); +} +// aten::div.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & div_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out) { + return at::_ops::div_out::call(self, other, out); +} + +// aten::div.Tensor_mode(Tensor self, Tensor other, *, str? rounding_mode) -> Tensor +inline at::Tensor div(const at::Tensor & self, const at::Tensor & other, c10::optional rounding_mode) { + return at::_ops::div_Tensor_mode::call(self, other, rounding_mode); +} + +// aten::div.out_mode(Tensor self, Tensor other, *, str? rounding_mode, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & div_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, c10::optional rounding_mode) { + return at::_ops::div_out_mode::call(self, other, rounding_mode, out); +} +// aten::div.out_mode(Tensor self, Tensor other, *, str? rounding_mode, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & div_outf(const at::Tensor & self, const at::Tensor & other, c10::optional rounding_mode, at::Tensor & out) { + return at::_ops::div_out_mode::call(self, other, rounding_mode, out); +} + +// aten::div.Scalar(Tensor self, Scalar other) -> Tensor +inline at::Tensor div(const at::Tensor & self, const at::Scalar & other) { + return at::_ops::div_Scalar::call(self, other); +} + +// aten::div.Scalar_mode(Tensor self, Scalar other, *, str? rounding_mode) -> Tensor +inline at::Tensor div(const at::Tensor & self, const at::Scalar & other, c10::optional rounding_mode) { + return at::_ops::div_Scalar_mode::call(self, other, rounding_mode); +} + +// aten::div.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & div_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other) { + return at::_ops::div_Scalar_out::call(self, other, out); +} +// aten::div.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & div_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out) { + return at::_ops::div_Scalar_out::call(self, other, out); +} + +// aten::div.Scalar_mode_out(Tensor self, Scalar other, *, str? rounding_mode, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & div_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other, c10::optional rounding_mode) { + return at::_ops::div_Scalar_mode_out::call(self, other, rounding_mode, out); +} +// aten::div.Scalar_mode_out(Tensor self, Scalar other, *, str? rounding_mode, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & div_outf(const at::Tensor & self, const at::Scalar & other, c10::optional rounding_mode, at::Tensor & out) { + return at::_ops::div_Scalar_mode_out::call(self, other, rounding_mode, out); +} + +} diff --git a/shared/package-files/9e/9e14d8f7f54be953983f198c8d59f38842c5f73419a5e81be6460b3623e7307a/blob b/shared/package-files/9e/9e14d8f7f54be953983f198c8d59f38842c5f73419a5e81be6460b3623e7307a/blob new file mode 100644 index 0000000000000000000000000000000000000000..cec145b083039f22c68ec0120ce1dfc092d920b0 --- /dev/null +++ b/shared/package-files/9e/9e14d8f7f54be953983f198c8d59f38842c5f73419a5e81be6460b3623e7307a/blob @@ -0,0 +1,50 @@ +# created by tools/loadICU.tcl -- do not edit +namespace eval ::tcl::clock { + ::msgcat::mcset hr DAYS_OF_WEEK_ABBREV [list \ + "ned"\ + "pon"\ + "uto"\ + "sri"\ + "\u010det"\ + "pet"\ + "sub"] + ::msgcat::mcset hr DAYS_OF_WEEK_FULL [list \ + "nedjelja"\ + "ponedjeljak"\ + "utorak"\ + "srijeda"\ + "\u010detvrtak"\ + "petak"\ + "subota"] + ::msgcat::mcset hr MONTHS_ABBREV [list \ + "sij"\ + "vel"\ + "o\u017eu"\ + "tra"\ + "svi"\ + "lip"\ + "srp"\ + "kol"\ + "ruj"\ + "lis"\ + "stu"\ + "pro"\ + ""] + ::msgcat::mcset hr MONTHS_FULL [list \ + "sije\u010danj"\ + "velja\u010da"\ + "o\u017eujak"\ + "travanj"\ + "svibanj"\ + "lipanj"\ + "srpanj"\ + "kolovoz"\ + "rujan"\ + "listopad"\ + "studeni"\ + "prosinac"\ + ""] + ::msgcat::mcset hr DATE_FORMAT "%Y.%m.%d" + ::msgcat::mcset hr TIME_FORMAT "%H:%M:%S" + ::msgcat::mcset hr DATE_TIME_FORMAT "%Y.%m.%d %H:%M:%S %z" +} diff --git a/shared/package-files/9e/9e15dec11a6799bb195657d9cdd33f5341c8c75a02225e4826abce4252417a26/blob b/shared/package-files/9e/9e15dec11a6799bb195657d9cdd33f5341c8c75a02225e4826abce4252417a26/blob new file mode 100644 index 0000000000000000000000000000000000000000..dde6ba9dbaa732ad429d60e78639b741e2f6b6c6 Binary files /dev/null and b/shared/package-files/9e/9e15dec11a6799bb195657d9cdd33f5341c8c75a02225e4826abce4252417a26/blob differ diff --git a/shared/package-files/9e/9e17004d1ce9d7fed8a3b4c7e79c99479acc2978469924416efe442ae4c7609c/blob b/shared/package-files/9e/9e17004d1ce9d7fed8a3b4c7e79c99479acc2978469924416efe442ae4c7609c/blob new file mode 100644 index 0000000000000000000000000000000000000000..507a04e491d30e36b1f4bbec2a676efc53db7194 --- /dev/null +++ b/shared/package-files/9e/9e17004d1ce9d7fed8a3b4c7e79c99479acc2978469924416efe442ae4c7609c/blob @@ -0,0 +1,18 @@ +from torch.utils.data.datapipes.datapipe import DataChunk +from torch.utils.data.datapipes.dataframe import dataframe_wrapper as df_wrapper + +__all__ = ["DataChunkDF", ] + + +class DataChunkDF(DataChunk): + """DataChunkDF iterating over individual items inside of DataFrame containers, to access DataFrames user `raw_iterator`.""" + + def __iter__(self): + for df in self.items: + yield from df_wrapper.iterate(df) + + def __len__(self): + total_len = 0 + for df in self.items: + total_len += df_wrapper.get_len(df) + return total_len diff --git a/shared/package-files/9e/9e17e8efdc6d50bb7fe014df6343324995e15dea8e75c1bfde94cef3e4d9567b/blob b/shared/package-files/9e/9e17e8efdc6d50bb7fe014df6343324995e15dea8e75c1bfde94cef3e4d9567b/blob new file mode 100644 index 0000000000000000000000000000000000000000..1b4b8ee7917c598cb2392656a5d36c3f666dad59 --- /dev/null +++ b/shared/package-files/9e/9e17e8efdc6d50bb7fe014df6343324995e15dea8e75c1bfde94cef3e4d9567b/blob @@ -0,0 +1,289 @@ +"""This file exports ONNX ops for opset 14. + +Note [ONNX operators that are added/updated in opset 14] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +New operators: + HardSwish, Trilu + +Updated operators: + Reshape + Add, Sub, Mul, Div + GRU, LSTM, RNN + BatchNorm, Cumsum, Relu +""" + +# EDITING THIS FILE? READ THIS FIRST! +# see Note [Edit Symbolic Files] in README.md +from __future__ import annotations + +import functools +from typing import Optional + +import torch +from torch.onnx import _constants, _type_utils, symbolic_helper +from torch.onnx._globals import GLOBALS +from torch.onnx._internal import _beartype, jit_utils, registration + +__all__ = [ + "hardswish", + "tril", + "triu", + "reshape", + "batch_norm", + "quantized_hardswish", + "scaled_dot_product_attention", +] + +_onnx_symbolic = functools.partial(registration.onnx_symbolic, opset=14) + + +@_onnx_symbolic("aten::hardswish") +@symbolic_helper.parse_args("v") +@_beartype.beartype +def hardswish(g: jit_utils.GraphContext, self): + return g.op("HardSwish", self) + + +@_onnx_symbolic("aten::tril") +@_beartype.beartype +def tril(g: jit_utils.GraphContext, self, diagonal, out=None): + return g.op("Trilu", self, diagonal, upper_i=0) + + +@_onnx_symbolic("aten::triu") +@_beartype.beartype +def triu(g: jit_utils.GraphContext, self, diagonal, out=None): + return g.op("Trilu", self, diagonal, upper_i=1) + + +@_onnx_symbolic("aten::reshape") +@symbolic_helper.quantized_args(True) +@symbolic_helper.parse_args("v", "v") +@_beartype.beartype +def reshape(g: jit_utils.GraphContext, self, shape): + # NOTE: Due to bug in ORT https://github.com/microsoft/onnxruntime/issues/10664 + # Reshape export cannot utilize the new allowzero attribute introduced in opset 14. + return symbolic_helper._reshape_helper(g, self, shape, allowzero=0) + + +@_onnx_symbolic("aten::batch_norm") +@symbolic_helper.parse_args("v", "v", "v", "v", "v", "i", "f", "f", "i") +@_beartype.beartype +def batch_norm( + g: jit_utils.GraphContext, + input, + weight, + bias, + running_mean, + running_var, + training, + momentum, + eps, + cudnn_enabled, +): + if ( + torch.is_autocast_enabled() + and not symbolic_helper.args_have_same_dtype( + [input, weight, bias, running_mean, running_var] + ) + and GLOBALS.export_onnx_opset_version < 15 + ): + return symbolic_helper._onnx_opset_unsupported_detailed( + "BatchNormalization", + 14, + 15, + "All input tensors must have the same `dtype`." + " Turn off Autocast or export using opset version 15.", + input, + ) + + symbolic_helper.check_training_mode(training, "batch_norm") + weight, bias, running_mean, running_var = symbolic_helper._batchnorm_helper( + g, input, weight, bias, running_mean, running_var + ) + out = g.op( + "BatchNormalization", + input, + weight, + bias, + running_mean, + running_var, + epsilon_f=eps, + momentum_f=1 - momentum, + training_mode_i=0 if not training else 1, + outputs=1 if not training else 3, + ) + if not training: + return out + else: + res, new_running_mean, new_running_var = out + new_running_mean.setType(running_mean.type()) + new_running_var.setType(running_var.type()) + return res + + +@_onnx_symbolic("quantized::hardswish") +@_beartype.beartype +def quantized_hardswish(g: jit_utils.GraphContext, x, op_scale, op_zero_point): + x, _, _, _ = symbolic_helper.dequantize_helper(g, x) + + output = hardswish(g, x) + + return symbolic_helper.quantize_helper(g, output, op_scale, op_zero_point) + + +# Ported from +# https://github.com/microsoft/onnxscript/blob/6b1b81700b4523f31d8c6d3321e5d8ef5d42b764/onnxscript/function_libs/torch_aten/ops/nn.py#L1504 +# aten_scaled_dot_product_attention +# NOTE: Need op.Trilu +@_onnx_symbolic("aten::scaled_dot_product_attention") +@symbolic_helper.parse_args("v", "v", "v", "v", "f", "b", "v") +@_beartype.beartype +def scaled_dot_product_attention( + g: jit_utils.GraphContext, + query: torch._C.Value, + key: torch._C.Value, + value: torch._C.Value, + attn_mask: Optional[torch._C.Value] = None, + dropout_p: float = 0.0, + is_causal: bool = False, + scale: Optional[torch._C.Value] = None, +): + assert (not is_causal) or ( + is_causal and symbolic_helper._is_none(attn_mask) + ), "is_causal and attn_mask cannot be set at the same time" + + scale = symbolic_helper._maybe_get_const(scale, "f") + if symbolic_helper._is_none(scale): + scale = _attention_scale(g, query) + + if is_causal: + attn_mask = _causal_attention_mask(g, query, key) + + # Swap the last two axes of key + # NOTE: onnx-script has different logic here, because the attribute perms in + # transpose needs list of ints + key_shape_builtin = symbolic_helper._get_tensor_rank(key) + key_transposed_axes = list(range(key_shape_builtin)) + key_transposed_axes[-1], key_transposed_axes[-2] = ( + key_transposed_axes[-2], + key_transposed_axes[-1], + ) + key_transposed = g.op("Transpose", key, perm_i=key_transposed_axes) + + # https://github.com/pytorch/pytorch/blob/12da0c70378b5be9135c6fda62a9863bce4a4818/aten/src/ATen/native/transformers/attention.cpp#L653 + # Scale q, k before matmul for stability see https://tinyurl.com/sudb9s96 for math + query_scaled = g.op("Mul", query, g.op("Sqrt", scale)) + key_transposed_scaled = g.op("Mul", key_transposed, g.op("Sqrt", scale)) + mul_qk = g.op("MatMul", query_scaled, key_transposed_scaled) + + if symbolic_helper._is_none(attn_mask): + mul_qk_add = mul_qk + elif ( + _type_utils.JitScalarType.from_value(attn_mask) + == _type_utils.JitScalarType.BOOL + ): + # Turn the Boolean mask to float: attn_mask.masked_fill(not attn_mask, -float('inf')) + const_zero = g.op("Constant", value_t=torch.tensor([0.0])) + const_neg_inf = g.op("Constant", value_t=torch.tensor([-float("inf")])) + attn_mask = g.op("Where", attn_mask, const_zero, const_neg_inf) + mul_qk_add = g.op("Add", mul_qk, attn_mask) + elif _type_utils.JitScalarType.from_value(attn_mask) in ( + _type_utils.JitScalarType.FLOAT, + _type_utils.JitScalarType.HALF, + _type_utils.JitScalarType.BFLOAT16, + ): + mul_qk_add = g.op("Add", mul_qk, attn_mask) + else: + raise ValueError( + f"Unsupported type for attn_mask: {_type_utils.JitScalarType.from_value(attn_mask)}" + ) + + attn_weight = g.op("Softmax", mul_qk_add, axis_i=-1) + + if dropout_p != 0: + attn_weight = g.op( + "Dropout", + attn_weight, + g.op("Constant", value_t=torch.tensor(dropout_p, dtype=torch.float)), + ) + + return g.op("MatMul", attn_weight, value) + + +@_beartype.beartype +def _attention_scale( + g: jit_utils.GraphContext, query: torch._C.Value +) -> torch._C.Value: + """Calculate the scale factor for the attention result. + + Args: + query: Tensor of shape [..., L, E] + + Returns: + Scalar scale factor := 1 / math.sqrt(query.size(-1)) + """ + query_shape = g.op("Shape", query) + query_shape_last = g.op( + "Slice", + query_shape, + g.op("Constant", value_t=torch.tensor([-1], dtype=torch.int64)), + g.op( + "Constant", value_t=torch.tensor([_constants.INT64_MAX], dtype=torch.int64) + ), + ) + embedding_size = g.op( + "Cast", + query_shape_last, + to_i=_type_utils.JitScalarType.from_value(query).onnx_type(), + ) + const_one = g.op("Constant", value_t=torch.tensor([1.0], dtype=torch.float)) + scale = g.op("Div", const_one, g.op("Sqrt", embedding_size)) + # Add a Cast to convert the scale back to original type + scale = g.op( + "Cast", + scale, + to_i=_type_utils.JitScalarType.from_value(query).onnx_type(), + ) + return scale + + +@_beartype.beartype +def _causal_attention_mask( + g: jit_utils.GraphContext, query: torch._C.Value, key: torch._C.Value +) -> torch._C.Value: + """Create a causal mask for the given query and key tensors. + + Equivalent to:: + mask = torch.ones(L, S, dtype=torch.bool).tril(diagonal=0) + attn_mask = torch.zeros(L, S, dtype=torch.float) + attn_mask = attn_mask.masked_fill(not mask, -float('inf')) + + Args: + query: Tensor of shape [..., L, E] + key: Tensor of shape [..., S, E] + + Returns: + Tensor of shape [L, S] + """ + + query_shape = g.op("Shape", query) + key_shape = g.op("Shape", key) + + last_idx = g.op("Constant", value_t=torch.tensor([-1], dtype=torch.int64)) + second_last_idx = g.op("Constant", value_t=torch.tensor([-2], dtype=torch.int64)) + target_length = g.op("Slice", query_shape, second_last_idx, last_idx) + source_length = g.op("Slice", key_shape, second_last_idx, last_idx) + # attn_mask = torch.ones(L, S) := { + size = g.op("Concat", target_length, source_length, axis_i=0) + const_one = g.op("Constant", value_t=torch.tensor([1.0])) + attn_mask = g.op("Expand", const_one, size) + # } + attn_mask = g.op("Trilu", attn_mask, upper_i=0) + # The causal mask has 0s in the lower triangle and -inf in the upper triangle. + const_zero = g.op("Constant", value_t=torch.tensor([0.0])) + const_neg_inf = g.op("Constant", value_t=torch.tensor([-float("inf")])) + attn_mask = g.op( + "Where", g.op("Equal", attn_mask, const_zero), const_neg_inf, const_zero + ) + return attn_mask diff --git a/shared/package-files/9e/9e1a9021ade8f8fe5facc764e179724b310098673b8a0a2e625841491f14eecb/blob b/shared/package-files/9e/9e1a9021ade8f8fe5facc764e179724b310098673b8a0a2e625841491f14eecb/blob new file mode 100644 index 0000000000000000000000000000000000000000..fc0b2ba2156d84c28c148899cad99cf8b0182daa --- /dev/null +++ b/shared/package-files/9e/9e1a9021ade8f8fe5facc764e179724b310098673b8a0a2e625841491f14eecb/blob @@ -0,0 +1,311 @@ +"""Sparse Bit Set encoding/decoding for IFT (Incremental Font Transfer). + +Implements the sparse bit set format defined in the W3C IFT specification: +https://w3c.github.io/IFT/Overview.html#sparse-bit-set-decoding +""" + +# Reference: https://github.com/googlefonts/fontations/blob/main/read-fonts/src/collections/int_set/sparse_bit_set.rs + + +import bisect +from collections import deque +from typing import Dict, Iterable, Optional, Set, Tuple + +# Maximum tree height that fits within a 32-bit leaf node for each branching factor. +_BF_MAX_HEIGHT: Dict[int, int] = {2: 31, 4: 16, 8: 11, 32: 7} + + +class SparseBitSetDecodeError(Exception): + pass + + +def decode( + data: bytes, bias: int = 0, maxValue: int = 0xFFFFFFFF +) -> Tuple[Set[int], int]: + """Decode a sparse bit set from binary data. + + Args: + data: bytes-like object containing the sparse bit set encoding. + bias: integer added to each decoded value. + + Returns: + A tuple (values, bytesConsumed) where values is a set of integers + and bytesConsumed is the number of bytes read from data. + """ + if not data: + raise SparseBitSetDecodeError("Empty data") + + branchFactor, height = _decodeHeader(data[0]) + + maxHeight = _BF_MAX_HEIGHT[branchFactor] + if height > maxHeight: + raise SparseBitSetDecodeError( + f"Height {height} exceeds max {maxHeight} for branch factor {branchFactor}" + ) + + return _decodeImpl(data, branchFactor, height, bias, maxValue) + + +def _decodeImpl( + data: bytes, branchFactor: int, height: int, bias: int, maxValue: int +) -> Tuple[Set[int], int]: + if height == 0: + # 1 byte was used for the header. + return (set(), 1) + + bitStream = _InputBitStream(data, branchFactor) + result: Set[int] = set() + # Queue entries are (startValue, depth), where startValue is the first + # integer that could be covered by this node. + queue: deque[Tuple[int, int]] = deque() + queue.append((0, 1)) + + while queue: + start, depth = queue.popleft() + bits = bitStream.next() + if bits is None: + raise SparseBitSetDecodeError("Unexpected end of data") + + # all bits were were zero which is a special command to completely fill + # in all integers covered by this node. + if bits == 0: + exp = height - depth + 1 + nodeSize = branchFactor**exp + fillStart = start + bias + if fillStart > maxValue: + continue + fillEnd = min(maxValue, start + nodeSize - 1 + bias) + if fillStart < 0: + fillStart = 0 + if fillStart <= fillEnd: + result.update(range(fillStart, fillEnd + 1)) + continue + + # Non-zero node: each set bit identifies a child/value. + exp = height - depth + nextNodeSize = branchFactor**exp + while True: + bitIndex = _trailingZeros(bits, 32) + if bitIndex == 32: + break + if depth == height: + val = start + bitIndex + bias + if val > maxValue: + queue.clear() + break + if val >= 0: + result.add(val) + else: + startDelta = bitIndex * nextNodeSize + queue.append((start + startDelta, depth + 1)) + bits &= ~(1 << bitIndex) + + return (result, bitStream.bytesConsumed()) + + +def encode(values: Iterable[int]) -> bytes: + """Encode a set of integers as a sparse bit set. + + Tries all branching factors and returns the shortest encoding. + + Args: + values: iterable of non-negative integers. + + Returns: + bytes containing the sparse bit set encoding. + """ + valuesSorted = sorted(set(values)) + if not valuesSorted: + return _encodeHeader(2, 0) + + maxValue = valuesSorted[-1] + valueSet = set(valuesSorted) + + best: Optional[bytes] = None + for branchFactor in (2, 4, 8, 32): + height = _treeHeight(branchFactor, maxValue) + if height > _BF_MAX_HEIGHT[branchFactor]: + continue + encoded = _encodeWithBf(valueSet, branchFactor, height) + if best is None or len(encoded) < len(best): + best = encoded + + if best is None: + raise ValueError(f"Cannot encode max value {maxValue}") + return best + + +def _encodeHeader(branchFactor: int, height: int) -> bytes: + branchFactorToId = {2: 0, 4: 1, 8: 2, 32: 3} + return bytes([(height << 2) | branchFactorToId[branchFactor]]) + + +def _decodeHeader(headerByte: int) -> Tuple[int, int]: + id = headerByte & 0x03 + idToBranchFactor = {0: 2, 1: 4, 2: 8, 3: 32} + height = (headerByte >> 2) & 0x1F + return idToBranchFactor[id], height + + +def _treeHeight(branchFactor: int, maxValue: int) -> int: + """Return the minimum tree height needed to represent maxValue.""" + height = 1 + capacity = branchFactor + while capacity <= maxValue: + capacity *= branchFactor + height += 1 + return height + + +def _encodeWithBf(valueSet: Set[int], branchFactor: int, height: int) -> bytes: + if height == 0: + return _encodeHeader(branchFactor, 0) + + # Build layers bottom-up: layer 0 = leaves (individual values), + # each higher layer groups bf children into one parent bitmask. + layers: list[Dict[int, int]] = [{}] # list of dicts: nodeIndex -> bitmask + + for v in valueSet: + nodeIndex = v // branchFactor + bitPos = v % branchFactor + if nodeIndex not in layers[0]: + layers[0][nodeIndex] = 0 + layers[0][nodeIndex] |= 1 << bitPos + + for _ in range(1, height): + prevLayer = layers[-1] + newLayer: Dict[int, int] = {} + for nodeIndex, bitmask in prevLayer.items(): + parentIndex = nodeIndex // branchFactor + bitPos = nodeIndex % branchFactor + if parentIndex not in newLayer: + newLayer[parentIndex] = 0 + newLayer[parentIndex] |= 1 << bitPos + layers.append(newLayer) + + # For zero-node optimization: track count of values in sorted list. + valuesSorted = sorted(valueSet) + + def rangeCount(lo: int, hi: int) -> int: + return bisect.bisect_right(valuesSorted, hi) - bisect.bisect_left( + valuesSorted, lo + ) + + # Emit nodes BFS order (root to leaves). + # Queue entries: (nodeIndex, depthFromRoot, rangeStart, rangeEnd) + stream = _OutputBitStream(branchFactor) + subtreeSize = branchFactor**height + queue: deque[Tuple[int, int, int, int]] = deque([(0, 0, 0, subtreeSize - 1)]) + + while queue: + nodeIndex, depth, rangeStart, rangeEnd = queue.popleft() + layerIdx = height - 1 - depth # layers[0]=leaves, layers[height-1]=root + + bitmask = ( + layers[layerIdx].get(nodeIndex, 0) if 0 <= layerIdx < len(layers) else 0 + ) + + # Zero-node optimization: if entire range is filled on an INTERNAL node, + # write 0 and skip children. At leaf level we always write the explicit + # bitmask so the encoding matches the reference. + if ( + depth < height - 1 + and rangeCount(rangeStart, rangeEnd) == rangeEnd - rangeStart + 1 + ): + stream.write(0) + continue + + stream.write(bitmask) + + if bitmask != 0 and depth < height - 1: + childSize = (rangeEnd - rangeStart + 1) // branchFactor + bits = bitmask + while bits: + bitIndex = _trailingZeros(bits, 32) + childIndex = nodeIndex * branchFactor + bitIndex + childStart = rangeStart + bitIndex * childSize + childEnd = childStart + childSize - 1 + queue.append((childIndex, depth + 1, childStart, childEnd)) + bits &= ~(1 << bitIndex) + + return _encodeHeader(branchFactor, height) + stream.toBytes() + + +def _trailingZeros(val: int, maxBits: int) -> int: + if val == 0: + return maxBits + count = 0 + while (val & 1) == 0: + val >>= 1 + count += 1 + return count + + +class _InputBitStream: + """Reads bit nodes from a byte array, starting after the header byte.""" + + def __init__(self, data: bytes, branchFactor: int): + self.data = data + self.branchFactor = branchFactor + self.byteIndex = 1 # skip the header byte + self.subIndex = 0 # bit offset within current byte (for bf=2,4) + + def next(self) -> Optional[int]: + if self.branchFactor in (2, 4): + if self.byteIndex >= len(self.data): + return None + mask = (1 << self.branchFactor) - 1 + val = (self.data[self.byteIndex] >> self.subIndex) & mask + self.subIndex += self.branchFactor + if self.subIndex >= 8: + self.subIndex = 0 + self.byteIndex += 1 + return val + elif self.branchFactor == 8: + if self.byteIndex >= len(self.data): + return None + val = self.data[self.byteIndex] + self.byteIndex += 1 + return val + elif self.branchFactor == 32: + if self.byteIndex + 3 >= len(self.data): + return None + b = self.data + i = self.byteIndex + val = b[i] | (b[i + 1] << 8) | (b[i + 2] << 16) | (b[i + 3] << 24) + self.byteIndex += 4 + return val + return None + + def bytesConsumed(self) -> int: + return self.byteIndex + (1 if self.subIndex > 0 else 0) + + +class _OutputBitStream: + """Writes bit nodes into a byte array.""" + + def __init__(self, branchFactor: int): + self.branchFactor = branchFactor + self.data = bytearray() + self.subIndex = 0 # bit offset within current byte (for bf=2,4) + + def write(self, value: int) -> None: + if self.branchFactor in (2, 4): + mask = (1 << self.branchFactor) - 1 + value &= mask + if self.subIndex == 0: + self.data.append(0) + self.data[-1] |= value << self.subIndex + self.subIndex += self.branchFactor + if self.subIndex >= 8: + self.subIndex = 0 + elif self.branchFactor == 8: + self.data.append(value & 0xFF) + elif self.branchFactor == 32: + self.data.append(value & 0xFF) + self.data.append((value >> 8) & 0xFF) + self.data.append((value >> 16) & 0xFF) + self.data.append((value >> 24) & 0xFF) + + def toBytes(self) -> bytes: + return bytes(self.data) diff --git a/shared/package-files/9e/9e1cdef08e209fbcfa16ecada15b6cc8778f6b25ec9644ed96c125157c022843/blob b/shared/package-files/9e/9e1cdef08e209fbcfa16ecada15b6cc8778f6b25ec9644ed96c125157c022843/blob new file mode 100644 index 0000000000000000000000000000000000000000..3c6d9af06bbde7f6be554008a2350d4288392d2d --- /dev/null +++ b/shared/package-files/9e/9e1cdef08e209fbcfa16ecada15b6cc8778f6b25ec9644ed96c125157c022843/blob @@ -0,0 +1 @@ +torchelastic diff --git a/shared/package-files/9e/9e1d314a743609d70ef9b4ef91979030049ed007d4118f369d0556eba9573d4f/blob b/shared/package-files/9e/9e1d314a743609d70ef9b4ef91979030049ed007d4118f369d0556eba9573d4f/blob new file mode 100644 index 0000000000000000000000000000000000000000..660c87fb4133c4bffc9fb711767306a1ccf7f5f1 --- /dev/null +++ b/shared/package-files/9e/9e1d314a743609d70ef9b4ef91979030049ed007d4118f369d0556eba9573d4f/blob @@ -0,0 +1,189 @@ +"""Gradient interface.""" + +import torch +from .modules.utils import _single, _pair, _triple + + +def conv1d_input(input_size, weight, grad_output, stride=1, padding=0, dilation=1, groups=1): + r"""Compute the gradient of conv1d with respect to the input of the convolution. + + This is same as the 1D transposed convolution operator under the hood but requires + the shape of the gradient w.r.t. input to be specified explicitly. + + Args: + input_size : Shape of the input gradient tensor + weight: weight tensor (out_channels x in_channels/groups x kW) + grad_output : output gradient tensor (minibatch x out_channels x oW) + stride (int or tuple, optional): Stride of the convolution. Default: 1 + padding (int or tuple, optional): Zero-padding added to both sides of the input. Default: 0 + dilation (int or tuple, optional): Spacing between kernel elements. Default: 1 + groups (int, optional): Number of blocked connections from input channels to output channels. Default: 1 + + Examples:: + + >>> input = torch.randn(1, 1, 3, requires_grad=True) + >>> weight = torch.randn(1, 1, 1, requires_grad=True) + >>> output = F.conv1d(input, weight) + >>> grad_output = torch.randn(output.shape) + >>> grad_input = torch.autograd.grad(output, input, grad_output) + >>> F.grad.conv1d_input(input.shape, weight, grad_output) + + """ + input = grad_output.new_empty(1).expand(input_size) + + return torch.ops.aten.convolution_backward(grad_output, input, weight, None, + _single(stride), _single(padding), _single(dilation), + False, [0], groups, (True, False, False))[0] + + +def conv1d_weight(input, weight_size, grad_output, stride=1, padding=0, dilation=1, groups=1): + r"""Compute the gradient of conv1d with respect to the weight of the convolution. + + Args: + input: input tensor of shape (minibatch x in_channels x iW) + weight_size : Shape of the weight gradient tensor + grad_output : output gradient tensor (minibatch x out_channels x oW) + stride (int or tuple, optional): Stride of the convolution. Default: 1 + padding (int or tuple, optional): Zero-padding added to both sides of the input. Default: 0 + dilation (int or tuple, optional): Spacing between kernel elements. Default: 1 + groups (int, optional): Number of blocked connections from input channels to output channels. Default: 1 + + Examples:: + + >>> input = torch.randn(1, 1, 3, requires_grad=True) + >>> weight = torch.randn(1, 1, 1, requires_grad=True) + >>> output = F.conv1d(input, weight) + >>> grad_output = torch.randn(output.shape) + >>> # xdoctest: +SKIP + >>> grad_weight = torch.autograd.grad(output, filter, grad_output) + >>> F.grad.conv1d_weight(input, weight.shape, grad_output) + + """ + weight = grad_output.new_empty(1).expand(weight_size) + + return torch.ops.aten.convolution_backward(grad_output, input, weight, None, + _single(stride), _single(padding), _single(dilation), + False, [0], groups, (False, True, False))[1] + + +def conv2d_input(input_size, weight, grad_output, stride=1, padding=0, dilation=1, groups=1): + r"""Compute the gradient of conv2d with respect to the input of the convolution. + + This is same as the 2D transposed convolution operator under the hood but requires + the shape of the gradient w.r.t. input to be specified explicitly. + + Args: + input_size : Shape of the input gradient tensor + weight: weight tensor (out_channels x in_channels/groups x kH x kW) + grad_output : output gradient tensor (minibatch x out_channels x oH x oW) + stride (int or tuple, optional): Stride of the convolution. Default: 1 + padding (int or tuple, optional): Zero-padding added to both sides of the input. Default: 0 + dilation (int or tuple, optional): Spacing between kernel elements. Default: 1 + groups (int, optional): Number of blocked connections from input channels to output channels. Default: 1 + + Examples:: + + >>> input = torch.randn(1, 1, 3, 3, requires_grad=True) + >>> weight = torch.randn(1, 1, 1, 2, requires_grad=True) + >>> output = F.conv2d(input, weight) + >>> grad_output = torch.randn(output.shape) + >>> grad_input = torch.autograd.grad(output, input, grad_output) + >>> F.grad.conv2d_input(input.shape, weight, grad_output) + + """ + input = grad_output.new_empty(1).expand(input_size) + + return torch.ops.aten.convolution_backward(grad_output, input, weight, None, + _pair(stride), _pair(padding), _pair(dilation), + False, [0], groups, (True, False, False))[0] + + +def conv2d_weight(input, weight_size, grad_output, stride=1, padding=0, dilation=1, groups=1): + r"""Compute the gradient of conv2d with respect to the weight of the convolution. + + Args: + input: input tensor of shape (minibatch x in_channels x iH x iW) + weight_size : Shape of the weight gradient tensor + grad_output : output gradient tensor (minibatch x out_channels x oH x oW) + stride (int or tuple, optional): Stride of the convolution. Default: 1 + padding (int or tuple, optional): Zero-padding added to both sides of the input. Default: 0 + dilation (int or tuple, optional): Spacing between kernel elements. Default: 1 + groups (int, optional): Number of blocked connections from input channels to output channels. Default: 1 + + Examples:: + + >>> input = torch.randn(1, 1, 3, 3, requires_grad=True) + >>> weight = torch.randn(1, 1, 1, 2, requires_grad=True) + >>> output = F.conv2d(input, weight) + >>> grad_output = torch.randn(output.shape) + >>> # xdoctest: +SKIP + >>> grad_weight = torch.autograd.grad(output, filter, grad_output) + >>> F.grad.conv2d_weight(input, weight.shape, grad_output) + + """ + weight = grad_output.new_empty(1).expand(weight_size) + + return torch.ops.aten.convolution_backward(grad_output, input, weight, None, + _pair(stride), _pair(padding), _pair(dilation), + False, [0], groups, (False, True, False))[1] + + +def conv3d_input(input_size, weight, grad_output, stride=1, padding=0, dilation=1, groups=1): + r"""Compute the gradient of conv3d with respect to the input of the convolution. + + This is same as the 3D transposed convolution operator under the hood but requires + the shape of the gradient w.r.t. input to be specified explicitly. + + Args: + input_size : Shape of the input gradient tensor + weight: weights tensor (out_channels x in_channels/groups x kT x kH x kW) + grad_output : output gradient tensor (minibatch x out_channels x oT x oH x oW) + stride (int or tuple, optional): Stride of the convolution. Default: 1 + padding (int or tuple, optional): Zero-padding added to both sides of the input. Default: 0 + dilation (int or tuple, optional): Spacing between kernel elements. Default: 1 + groups (int, optional): Number of blocked connections from input channels to output channels. Default: 1 + + Examples:: + + >>> input = torch.randn(2, 8, 10, 10, 20, requires_grad=True) + >>> weight = torch.randn(4, 8, 2, 3, 3, requires_grad=True) + >>> output = F.conv3d(input, weight) + >>> grad_output = torch.randn(output.shape) + >>> grad_input = torch.autograd.grad(output, input, grad_output) + >>> F.grad.conv3d_input(input.shape, weight, grad_output) + + """ + input = grad_output.new_empty(1).expand(input_size) + + return torch.ops.aten.convolution_backward(grad_output, input, weight, None, + _triple(stride), _triple(padding), _triple(dilation), + False, [0], groups, (True, False, False))[0] + + +def conv3d_weight(input, weight_size, grad_output, stride=1, padding=0, dilation=1, groups=1): + r"""Compute the gradient of conv3d with respect to the weight of the convolution. + + Args: + input: input tensor of shape (minibatch x in_channels x iT x iH x iW) + weight_size : Shape of the weight gradient tensor + grad_output : output gradient tensor (minibatch x out_channels x oT x oH x oW) + stride (int or tuple, optional): Stride of the convolution. Default: 1 + padding (int or tuple, optional): Zero-padding added to both sides of the input. Default: 0 + dilation (int or tuple, optional): Spacing between kernel elements. Default: 1 + groups (int, optional): Number of blocked connections from input channels to output channels. Default: 1 + + Examples:: + + >>> input = torch.randn(2, 8, 10, 10, 20, requires_grad=True) + >>> weight = torch.randn(4, 8, 2, 3, 3, requires_grad=True) + >>> output = F.conv3d(input, weight) + >>> grad_output = torch.randn(output.shape) + >>> grad_weight = torch.autograd.grad(output, weight, grad_output) + >>> F.grad.conv3d_weight(input, weight.shape, grad_output) + + """ + weight = grad_output.new_empty(1).expand(weight_size) + + return torch.ops.aten.convolution_backward(grad_output, input, weight, None, + _triple(stride), _triple(padding), _triple(dilation), + False, [0], groups, (False, True, False))[1] diff --git a/shared/package-files/9e/9e1e17b67d06890cd0e238ad44906183aa0d1072d69c8564eb4f451011262a49/blob b/shared/package-files/9e/9e1e17b67d06890cd0e238ad44906183aa0d1072d69c8564eb4f451011262a49/blob new file mode 100644 index 0000000000000000000000000000000000000000..2b6d71d80afc66c9174f81eb6fdbdd3d803bcf4c --- /dev/null +++ b/shared/package-files/9e/9e1e17b67d06890cd0e238ad44906183aa0d1072d69c8564eb4f451011262a49/blob @@ -0,0 +1,44 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::resize_as_sparse_(Tensor(a!) self, Tensor the_template) -> Tensor(a!) +inline const at::Tensor & resize_as_sparse_(const at::Tensor & self, const at::Tensor & the_template) { + return at::_ops::resize_as_sparse_::call(self, the_template); +} + +// aten::resize_as_sparse.out(Tensor self, Tensor the_template, *, Tensor(a!) out) -> Tensor(a!) +inline const at::Tensor & resize_as_sparse_out(const at::Tensor & out, const at::Tensor & self, const at::Tensor & the_template) { + return at::_ops::resize_as_sparse_out::call(self, the_template, out); +} +// aten::resize_as_sparse.out(Tensor self, Tensor the_template, *, Tensor(a!) out) -> Tensor(a!) +inline const at::Tensor & resize_as_sparse_outf(const at::Tensor & self, const at::Tensor & the_template, const at::Tensor & out) { + return at::_ops::resize_as_sparse_out::call(self, the_template, out); +} + +// aten::resize_as_sparse(Tensor self, Tensor the_template) -> Tensor +inline at::Tensor resize_as_sparse(const at::Tensor & self, const at::Tensor & the_template) { + return at::_ops::resize_as_sparse::call(self, the_template); +} + +} diff --git a/shared/package-files/9e/9e257c3d1d00a27c3ce6b6e248fa4bf91b30027f5396da54c1c9e2dd0bbf925f/blob b/shared/package-files/9e/9e257c3d1d00a27c3ce6b6e248fa4bf91b30027f5396da54c1c9e2dd0bbf925f/blob new file mode 100644 index 0000000000000000000000000000000000000000..ce57e841f9f163edd3945f248a653c94acd2a93c --- /dev/null +++ b/shared/package-files/9e/9e257c3d1d00a27c3ce6b6e248fa4bf91b30027f5396da54c1c9e2dd0bbf925f/blob @@ -0,0 +1,540 @@ +import math +import numpy as np + +from .arpack import _arpack # type: ignore[attr-defined] +from . import eigsh + +from scipy._lib._util import check_random_state, _transition_to_rng +from scipy.sparse.linalg._interface import LinearOperator, aslinearoperator +from scipy.sparse.linalg._eigen.lobpcg import lobpcg # type: ignore[no-redef] +from scipy.sparse.linalg._svdp import _svdp +from scipy.linalg import svd + +arpack_int = _arpack.timing.nbx.dtype +__all__ = ['svds'] + + +def _herm(x): + return x.T.conj() + + +def _iv(A, k, ncv, tol, which, v0, maxiter, + return_singular, solver, rng): + + # input validation/standardization for `solver` + # out of order because it's needed for other parameters + solver = str(solver).lower() + solvers = {"arpack", "lobpcg", "propack"} + if solver not in solvers: + raise ValueError(f"solver must be one of {solvers}.") + + # input validation/standardization for `A` + A = aslinearoperator(A) # this takes care of some input validation + if not np.issubdtype(A.dtype, np.number): + message = "`A` must be of numeric data type." + raise ValueError(message) + if math.prod(A.shape) == 0: + message = "`A` must not be empty." + raise ValueError(message) + + # input validation/standardization for `k` + kmax = min(A.shape) if solver == 'propack' else min(A.shape) - 1 + if int(k) != k or not (0 < k <= kmax): + message = "`k` must be an integer satisfying `0 < k < min(A.shape)`." + raise ValueError(message) + k = int(k) + + # input validation/standardization for `ncv` + if solver == "arpack" and ncv is not None: + if int(ncv) != ncv or not (k < ncv < min(A.shape)): + message = ("`ncv` must be an integer satisfying " + "`k < ncv < min(A.shape)`.") + raise ValueError(message) + ncv = int(ncv) + + # input validation/standardization for `tol` + if tol < 0 or not np.isfinite(tol): + message = "`tol` must be a non-negative floating point value." + raise ValueError(message) + tol = float(tol) + + # input validation/standardization for `which` + which = str(which).upper() + whichs = {'LM', 'SM'} + if which not in whichs: + raise ValueError(f"`which` must be in {whichs}.") + + # input validation/standardization for `v0` + if v0 is not None: + v0 = np.atleast_1d(v0) + if not (np.issubdtype(v0.dtype, np.complexfloating) + or np.issubdtype(v0.dtype, np.floating)): + message = ("`v0` must be of floating or complex floating " + "data type.") + raise ValueError(message) + + shape = (A.shape[0],) if solver == 'propack' else (min(A.shape),) + if v0.shape != shape: + message = f"`v0` must have shape {shape}." + raise ValueError(message) + + # input validation/standardization for `maxiter` + if maxiter is not None and (int(maxiter) != maxiter or maxiter <= 0): + message = "`maxiter` must be a positive integer." + raise ValueError(message) + maxiter = int(maxiter) if maxiter is not None else maxiter + + # input validation/standardization for `return_singular_vectors` + # not going to be flexible with this; too complicated for little gain + rs_options = {True, False, "vh", "u"} + if return_singular not in rs_options: + raise ValueError(f"`return_singular_vectors` must be in {rs_options}.") + + rng = check_random_state(rng) + + return (A, k, ncv, tol, which, v0, maxiter, + return_singular, solver, rng) + + +@_transition_to_rng("random_state", position_num=9) +def svds(A, k=6, ncv=None, tol=0, which='LM', v0=None, + maxiter=None, return_singular_vectors=True, + solver='arpack', rng=None, options=None): + """ + Partial singular value decomposition of a sparse matrix. + + Compute the largest or smallest `k` singular values and corresponding + singular vectors of a sparse matrix `A`. The order in which the singular + values are returned is not guaranteed. + + In the descriptions below, let ``M, N = A.shape``. + + Parameters + ---------- + A : ndarray, sparse matrix, or LinearOperator + Matrix to decompose of a floating point numeric dtype. + k : int, default: 6 + Number of singular values and singular vectors to compute. + Must satisfy ``1 <= k <= kmax``, where ``kmax=min(M, N)`` for + ``solver='propack'`` and ``kmax=min(M, N) - 1`` otherwise. + ncv : int, optional + When ``solver='arpack'``, this is the number of Lanczos vectors + generated. See :ref:`'arpack' ` for details. + When ``solver='lobpcg'`` or ``solver='propack'``, this parameter is + ignored. + tol : float, optional + Tolerance for singular values. Zero (default) means machine precision. + which : {'LM', 'SM'} + Which `k` singular values to find: either the largest magnitude ('LM') + or smallest magnitude ('SM') singular values. + v0 : ndarray, optional + The starting vector for iteration; see method-specific + documentation (:ref:`'arpack' `, + :ref:`'lobpcg' `), or + :ref:`'propack' ` for details. + maxiter : int, optional + Maximum number of iterations; see method-specific + documentation (:ref:`'arpack' `, + :ref:`'lobpcg' `), or + :ref:`'propack' ` for details. + return_singular_vectors : {True, False, "u", "vh"} + Singular values are always computed and returned; this parameter + controls the computation and return of singular vectors. + + - ``True``: return singular vectors. + - ``False``: do not return singular vectors. + - ``"u"``: if ``M <= N``, compute only the left singular vectors and + return ``None`` for the right singular vectors. Otherwise, compute + all singular vectors. + - ``"vh"``: if ``M > N``, compute only the right singular vectors and + return ``None`` for the left singular vectors. Otherwise, compute + all singular vectors. + + If ``solver='propack'``, the option is respected regardless of the + matrix shape. + + solver : {'arpack', 'propack', 'lobpcg'}, optional + The solver used. + :ref:`'arpack' `, + :ref:`'lobpcg' `, and + :ref:`'propack' ` are supported. + Default: `'arpack'`. + rng : `numpy.random.Generator`, optional + Pseudorandom number generator state. When `rng` is None, a new + `numpy.random.Generator` is created using entropy from the + operating system. Types other than `numpy.random.Generator` are + passed to `numpy.random.default_rng` to instantiate a ``Generator``. + options : dict, optional + A dictionary of solver-specific options. No solver-specific options + are currently supported; this parameter is reserved for future use. + + Returns + ------- + u : ndarray, shape=(M, k) + Unitary matrix having left singular vectors as columns. + s : ndarray, shape=(k,) + The singular values. + vh : ndarray, shape=(k, N) + Unitary matrix having right singular vectors as rows. + + Notes + ----- + This is a naive implementation using ARPACK or LOBPCG as an eigensolver + on the matrix ``A.conj().T @ A`` or ``A @ A.conj().T``, depending on + which one is smaller size, followed by the Rayleigh-Ritz method + as postprocessing; see + Using the normal matrix, in Rayleigh-Ritz method, (2022, Nov. 19), + Wikipedia, https://w.wiki/4zms. + + Alternatively, the PROPACK solver can be called. + + Choices of the input matrix `A` numeric dtype may be limited. + Only ``solver="lobpcg"`` supports all floating point dtypes + real: 'np.float32', 'np.float64', 'np.longdouble' and + complex: 'np.complex64', 'np.complex128', 'np.clongdouble'. + The ``solver="arpack"`` supports only + 'np.float32', 'np.float64', and 'np.complex128'. + + Examples + -------- + Construct a matrix `A` from singular values and vectors. + + >>> import numpy as np + >>> from scipy import sparse, linalg, stats + >>> from scipy.sparse.linalg import svds, aslinearoperator, LinearOperator + + Construct a dense matrix `A` from singular values and vectors. + + >>> rng = np.random.default_rng(258265244568965474821194062361901728911) + >>> orthogonal = stats.ortho_group.rvs(10, random_state=rng) + >>> s = [1e-3, 1, 2, 3, 4] # non-zero singular values + >>> u = orthogonal[:, :5] # left singular vectors + >>> vT = orthogonal[:, 5:].T # right singular vectors + >>> A = u @ np.diag(s) @ vT + + With only four singular values/vectors, the SVD approximates the original + matrix. + + >>> u4, s4, vT4 = svds(A, k=4) + >>> A4 = u4 @ np.diag(s4) @ vT4 + >>> np.allclose(A4, A, atol=1e-3) + True + + With all five non-zero singular values/vectors, we can reproduce + the original matrix more accurately. + + >>> u5, s5, vT5 = svds(A, k=5) + >>> A5 = u5 @ np.diag(s5) @ vT5 + >>> np.allclose(A5, A) + True + + The singular values match the expected singular values. + + >>> np.allclose(s5, s) + True + + Since the singular values are not close to each other in this example, + every singular vector matches as expected up to a difference in sign. + + >>> (np.allclose(np.abs(u5), np.abs(u)) and + ... np.allclose(np.abs(vT5), np.abs(vT))) + True + + The singular vectors are also orthogonal. + + >>> (np.allclose(u5.T @ u5, np.eye(5)) and + ... np.allclose(vT5 @ vT5.T, np.eye(5))) + True + + If there are (nearly) multiple singular values, the corresponding + individual singular vectors may be unstable, but the whole invariant + subspace containing all such singular vectors is computed accurately + as can be measured by angles between subspaces via 'subspace_angles'. + + >>> rng = np.random.default_rng(178686584221410808734965903901790843963) + >>> s = [1, 1 + 1e-6] # non-zero singular values + >>> u, _ = np.linalg.qr(rng.standard_normal((99, 2))) + >>> v, _ = np.linalg.qr(rng.standard_normal((99, 2))) + >>> vT = v.T + >>> A = u @ np.diag(s) @ vT + >>> A = A.astype(np.float32) + >>> u2, s2, vT2 = svds(A, k=2, rng=rng) + >>> np.allclose(s2, s) + True + + The angles between the individual exact and computed singular vectors + may not be so small. To check use: + + >>> (linalg.subspace_angles(u2[:, :1], u[:, :1]) + + ... linalg.subspace_angles(u2[:, 1:], u[:, 1:])) + array([0.06562513]) # may vary + >>> (linalg.subspace_angles(vT2[:1, :].T, vT[:1, :].T) + + ... linalg.subspace_angles(vT2[1:, :].T, vT[1:, :].T)) + array([0.06562507]) # may vary + + As opposed to the angles between the 2-dimensional invariant subspaces + that these vectors span, which are small for rights singular vectors + + >>> linalg.subspace_angles(u2, u).sum() < 1e-6 + True + + as well as for left singular vectors. + + >>> linalg.subspace_angles(vT2.T, vT.T).sum() < 1e-6 + True + + The next example follows that of 'sklearn.decomposition.TruncatedSVD'. + + >>> rng = np.random.default_rng(0) + >>> X_dense = rng.random(size=(100, 100)) + >>> X_dense[:, 2 * np.arange(50)] = 0 + >>> X = sparse.csr_array(X_dense) + >>> _, singular_values, _ = svds(X, k=5, rng=rng) + >>> print(singular_values) + [ 4.3221... 4.4043... 4.4907... 4.5858... 35.4549...] + + The function can be called without the transpose of the input matrix + ever explicitly constructed. + + >>> rng = np.random.default_rng(102524723947864966825913730119128190974) + >>> G = sparse.random_array((8, 9), density=0.5, rng=rng) + >>> Glo = aslinearoperator(G) + >>> _, singular_values_svds, _ = svds(Glo, k=5, rng=rng) + >>> _, singular_values_svd, _ = linalg.svd(G.toarray()) + >>> np.allclose(singular_values_svds, singular_values_svd[-4::-1]) + True + + The most memory efficient scenario is where neither + the original matrix, nor its transpose, is explicitly constructed. + Our example computes the smallest singular values and vectors + of 'LinearOperator' constructed from the numpy function 'np.diff' used + column-wise to be consistent with 'LinearOperator' operating on columns. + + >>> diff0 = lambda a: np.diff(a, axis=0) + + Let us create the matrix from 'diff0' to be used for validation only. + + >>> n = 5 # The dimension of the space. + >>> M_from_diff0 = diff0(np.eye(n)) + >>> print(M_from_diff0.astype(int)) + [[-1 1 0 0 0] + [ 0 -1 1 0 0] + [ 0 0 -1 1 0] + [ 0 0 0 -1 1]] + + The matrix 'M_from_diff0' is bi-diagonal and could be alternatively + created directly by + + >>> M = - np.eye(n - 1, n, dtype=int) + >>> np.fill_diagonal(M[:,1:], 1) + >>> np.allclose(M, M_from_diff0) + True + + Its transpose + + >>> print(M.T) + [[-1 0 0 0] + [ 1 -1 0 0] + [ 0 1 -1 0] + [ 0 0 1 -1] + [ 0 0 0 1]] + + can be viewed as the incidence matrix; see + Incidence matrix, (2022, Nov. 19), Wikipedia, https://w.wiki/5YXU, + of a linear graph with 5 vertices and 4 edges. The 5x5 normal matrix + ``M.T @ M`` thus is + + >>> print(M.T @ M) + [[ 1 -1 0 0 0] + [-1 2 -1 0 0] + [ 0 -1 2 -1 0] + [ 0 0 -1 2 -1] + [ 0 0 0 -1 1]] + + the graph Laplacian, while the actually used in 'svds' smaller size + 4x4 normal matrix ``M @ M.T`` + + >>> print(M @ M.T) + [[ 2 -1 0 0] + [-1 2 -1 0] + [ 0 -1 2 -1] + [ 0 0 -1 2]] + + is the so-called edge-based Laplacian; see + Symmetric Laplacian via the incidence matrix, in Laplacian matrix, + (2022, Nov. 19), Wikipedia, https://w.wiki/5YXW. + + The 'LinearOperator' setup needs the options 'rmatvec' and 'rmatmat' + of multiplication by the matrix transpose ``M.T``, but we want to be + matrix-free to save memory, so knowing how ``M.T`` looks like, we + manually construct the following function to be + used in ``rmatmat=diff0t``. + + >>> def diff0t(a): + ... if a.ndim == 1: + ... a = a[:,np.newaxis] # Turn 1D into 2D array + ... d = np.zeros((a.shape[0] + 1, a.shape[1]), dtype=a.dtype) + ... d[0, :] = - a[0, :] + ... d[1:-1, :] = a[0:-1, :] - a[1:, :] + ... d[-1, :] = a[-1, :] + ... return d + + We check that our function 'diff0t' for the matrix transpose is valid. + + >>> np.allclose(M.T, diff0t(np.eye(n-1))) + True + + Now we setup our matrix-free 'LinearOperator' called 'diff0_func_aslo' + and for validation the matrix-based 'diff0_matrix_aslo'. + + >>> def diff0_func_aslo_def(n): + ... return LinearOperator(matvec=diff0, + ... matmat=diff0, + ... rmatvec=diff0t, + ... rmatmat=diff0t, + ... shape=(n - 1, n)) + >>> diff0_func_aslo = diff0_func_aslo_def(n) + >>> diff0_matrix_aslo = aslinearoperator(M_from_diff0) + + And validate both the matrix and its transpose in 'LinearOperator'. + + >>> np.allclose(diff0_func_aslo(np.eye(n)), + ... diff0_matrix_aslo(np.eye(n))) + True + >>> np.allclose(diff0_func_aslo.T(np.eye(n-1)), + ... diff0_matrix_aslo.T(np.eye(n-1))) + True + + Having the 'LinearOperator' setup validated, we run the solver. + + >>> n = 100 + >>> diff0_func_aslo = diff0_func_aslo_def(n) + >>> u, s, vT = svds(diff0_func_aslo, k=3, which='SM') + + The singular values squared and the singular vectors are known + explicitly; see + Pure Dirichlet boundary conditions, in + Eigenvalues and eigenvectors of the second derivative, + (2022, Nov. 19), Wikipedia, https://w.wiki/5YX6, + since 'diff' corresponds to first + derivative, and its smaller size n-1 x n-1 normal matrix + ``M @ M.T`` represent the discrete second derivative with the Dirichlet + boundary conditions. We use these analytic expressions for validation. + + >>> se = 2. * np.sin(np.pi * np.arange(1, 4) / (2. * n)) + >>> ue = np.sqrt(2 / n) * np.sin(np.pi * np.outer(np.arange(1, n), + ... np.arange(1, 4)) / n) + >>> np.allclose(s, se, atol=1e-3) + True + >>> np.allclose(np.abs(u), np.abs(ue), atol=1e-6) + True + + """ + args = _iv(A, k, ncv, tol, which, v0, maxiter, return_singular_vectors, + solver, rng) + (A, k, ncv, tol, which, v0, maxiter, + return_singular_vectors, solver, rng) = args + + largest = (which == 'LM') + n, m = A.shape + + if n >= m: + X_dot = A.matvec + X_matmat = A.matmat + XH_dot = A.rmatvec + XH_mat = A.rmatmat + transpose = False + else: + X_dot = A.rmatvec + X_matmat = A.rmatmat + XH_dot = A.matvec + XH_mat = A.matmat + transpose = True + + dtype = getattr(A, 'dtype', None) + if dtype is None: + dtype = A.dot(np.zeros([m, 1])).dtype + + def matvec_XH_X(x): + return XH_dot(X_dot(x)) + + def matmat_XH_X(x): + return XH_mat(X_matmat(x)) + + XH_X = LinearOperator(matvec=matvec_XH_X, dtype=A.dtype, + matmat=matmat_XH_X, + shape=(min(A.shape), min(A.shape))) + + # Get a low rank approximation of the implicitly defined gramian matrix. + # This is not a stable way to approach the problem. + if solver == 'lobpcg': + + if k == 1 and v0 is not None: + X = np.reshape(v0, (-1, 1)) + else: + X = rng.standard_normal(size=(min(A.shape), k)) + + _, eigvec = lobpcg(XH_X, X, tol=tol ** 2, maxiter=maxiter, + largest=largest) + + elif solver == 'propack': + jobu = return_singular_vectors in {True, 'u'} + jobv = return_singular_vectors in {True, 'vh'} + irl_mode = (which == 'SM') + res = _svdp(A, k=k, tol=tol**2, which=which, maxiter=None, + compute_u=jobu, compute_v=jobv, irl_mode=irl_mode, + kmax=maxiter, v0=v0, rng=rng) + + u, s, vh, _ = res # but we'll ignore bnd, the last output + + # PROPACK order appears to be largest first. `svds` output order is not + # guaranteed, according to documentation, but for ARPACK and LOBPCG + # they actually are ordered smallest to largest, so reverse for + # consistency. + s = s[::-1] + u = u[:, ::-1] + vh = vh[::-1] + + u = u if jobu else None + vh = vh if jobv else None + + if return_singular_vectors: + return u, s, vh + else: + return s + + elif solver == 'arpack' or solver is None: + if v0 is None: + v0 = rng.standard_normal(size=(min(A.shape),)) + _, eigvec = eigsh(XH_X, k=k, tol=tol ** 2, maxiter=maxiter, + ncv=ncv, which=which, v0=v0) + # arpack do not guarantee exactly orthonormal eigenvectors + # for clustered eigenvalues, especially in complex arithmetic + eigvec, _ = np.linalg.qr(eigvec) + + # the eigenvectors eigvec must be orthonomal here; see gh-16712 + Av = X_matmat(eigvec) + if not return_singular_vectors: + s = svd(Av, compute_uv=False, overwrite_a=True) + return s[::-1] + + # compute the left singular vectors of X and update the right ones + # accordingly + u, s, vh = svd(Av, full_matrices=False, overwrite_a=True) + u = u[:, ::-1] + s = s[::-1] + vh = vh[::-1] + + jobu = return_singular_vectors in {True, 'u'} + jobv = return_singular_vectors in {True, 'vh'} + + if transpose: + u_tmp = eigvec @ _herm(vh) if jobu else None + vh = _herm(u) if jobv else None + u = u_tmp + else: + if not jobu: + u = None + vh = vh @ _herm(eigvec) if jobv else None + + return u, s, vh diff --git a/shared/package-files/9e/9e26ab67863eab7b1d9b86d39c6eee98e97d000093ce4399e6aa7d25c4579222/blob b/shared/package-files/9e/9e26ab67863eab7b1d9b86d39c6eee98e97d000093ce4399e6aa7d25c4579222/blob new file mode 100644 index 0000000000000000000000000000000000000000..238f1c534dd901985853a87bedfcded3afdc19a8 --- /dev/null +++ b/shared/package-files/9e/9e26ab67863eab7b1d9b86d39c6eee98e97d000093ce4399e6aa7d25c4579222/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor add(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1); +TORCH_API at::Tensor & add_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1); +TORCH_API at::Tensor & add_outf(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha, at::Tensor & out); +TORCH_API at::Tensor & add_(at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/9e/9e2b599dc68cd3ad3991a22ed4d3baff94c5576fbe9e885408ee3a5d30ff9673/blob b/shared/package-files/9e/9e2b599dc68cd3ad3991a22ed4d3baff94c5576fbe9e885408ee3a5d30ff9673/blob new file mode 100644 index 0000000000000000000000000000000000000000..f50da3d2e07310fc19e1db2bd18fdce23223771c --- /dev/null +++ b/shared/package-files/9e/9e2b599dc68cd3ad3991a22ed4d3baff94c5576fbe9e885408ee3a5d30ff9673/blob @@ -0,0 +1,8 @@ +import networkx as nx +import networkx.algorithms.approximation as a + + +def test_min_maximal_matching(): + # smoke test + G = nx.Graph() + assert len(a.min_maximal_matching(G)) == 0 diff --git a/shared/package-files/9e/9e2cbc8500fe3bb72122056ec5e776567e58e26b20eaab02b149e85365c73703/blob b/shared/package-files/9e/9e2cbc8500fe3bb72122056ec5e776567e58e26b20eaab02b149e85365c73703/blob new file mode 100644 index 0000000000000000000000000000000000000000..8b8312f78ee649bd4127da10dd906790878dbd71 --- /dev/null +++ b/shared/package-files/9e/9e2cbc8500fe3bb72122056ec5e776567e58e26b20eaab02b149e85365c73703/blob @@ -0,0 +1,219 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace torch { +namespace nn { + +/// Options for a `D`-dimensional ReflectionPad module. +template +struct TORCH_API ReflectionPadOptions { + ReflectionPadOptions(ExpandingArray padding) : padding_(padding) {} + + /// The size of the padding. + /// If it is `int`, uses the same padding in all boundaries. + /// If it is a 2-`tuple` (for ReflectionPad1d), uses (padding_left, + /// padding_right). If it is a 4-`tuple` (for ReflectionPad2d), uses + /// (padding_left, padding_right, padding_top, padding_bottom). If it is a + /// 6-`tuple` (for ReflectionPad3d), uses (padding_left, padding_right, + /// padding_top, padding_bottom, padding_front, padding_back). + + TORCH_ARG(ExpandingArray, padding); +}; + +/// `ReflectionPadOptions` specialized for the `ReflectionPad1d` module. +/// +/// Example: +/// ``` +/// ReflectionPad1d model(ReflectionPad1dOptions({3, 1})); +/// ``` +using ReflectionPad1dOptions = ReflectionPadOptions<1>; + +/// `ReflectionPadOptions` specialized for the `ReflectionPad2d` module. +/// +/// Example: +/// ``` +/// ReflectionPad2d model(ReflectionPad2dOptions({1, 1, 2, 0})); +/// ``` +using ReflectionPad2dOptions = ReflectionPadOptions<2>; + +/// `ReflectionPadOptions` specialized for the `ReflectionPad3d` module. +/// +/// Example: +/// ``` +/// ReflectionPad3d model(ReflectionPad3dOptions({1, 1, 2, 0, 1, 1})); +/// ``` +using ReflectionPad3dOptions = ReflectionPadOptions<3>; + +// ============================================================================ + +/// Options for a `D`-dimensional ReplicationPad module. +template +struct TORCH_API ReplicationPadOptions { + ReplicationPadOptions(ExpandingArray padding) : padding_(padding) {} + + /// The size of the padding. + /// - If it is `int`, uses the same padding in all boundaries. + /// - If it is a 2-`tuple` (for ReplicationPad1d), uses (padding_left, + /// padding_right). + /// - If it is a 4-`tuple` (for ReplicationPad2d), uses (padding_left, + /// padding_right, padding_top, padding_bottom). + /// - If it is a 6-`tuple` (for ReplicationPad3d), uses + /// (padding_left, padding_right, padding_top, padding_bottom, + /// padding_front, padding_back). + TORCH_ARG(ExpandingArray, padding); +}; + +/// `ReplicationPadOptions` specialized for the `ReplicationPad1d` module. +/// +/// Example: +/// ``` +/// ReplicationPad1d model(ReplicationPad1dOptions({3, 1})); +/// ``` +using ReplicationPad1dOptions = ReplicationPadOptions<1>; + +/// `ReplicationPadOptions` specialized for the `ReplicationPad2d` module. +/// +/// Example: +/// ``` +/// ReplicationPad2d model(ReplicationPad2dOptions({1, 1, 2, 0})); +/// ``` +using ReplicationPad2dOptions = ReplicationPadOptions<2>; + +/// `ReplicationPadOptions` specialized for the `ReplicationPad3d` module. +/// +/// Example: +/// ``` +/// ReplicationPad3d model(ReplicationPad3dOptions({1, 2, 1, 2, 1, 2})); +/// ``` +using ReplicationPad3dOptions = ReplicationPadOptions<3>; + +// ============================================================================ + +template +struct TORCH_API ZeroPadOptions { + ZeroPadOptions(ExpandingArray padding) : padding_(padding) {} + + /// The size of the padding. + /// - If it is `int`, uses the same padding in all boundaries. + /// - If it is a 2-`tuple` (for ZeroPad1d), uses (padding_left, + /// padding_right). + /// - If it is a 4-`tuple` (for ZeroPad2d), uses (padding_left, padding_right, + /// padding_top, padding_bottom). + /// - If it is a 6-`tuple` (for ZeroPad3d), uses + /// (padding_left, padding_right, padding_top, padding_bottom, + /// padding_front, padding_back). + TORCH_ARG(ExpandingArray, padding); +}; + +/// `ZeroPadOptions` specialized for the `ZeroPad1d` module. +/// +/// Example: +/// ``` +/// ConstantPad1d model(ConstantPad1dOptions({3, 1}); +/// ``` +using ZeroPad1dOptions = ZeroPadOptions<1>; + +/// `ZeroPadOptions` specialized for the `ZeroPad2d` module. +/// +/// Example: +/// ``` +/// ConstantPad2d model(ConstantPad2dOptions({1, 1, 2, 0}); +/// ``` +using ZeroPad2dOptions = ZeroPadOptions<2>; + +/// `ZeroPadOptions` specialized for the `ZeroPad3d` module. +/// +/// Example: +/// ``` +/// ConstantPad3d model(ConstantPad3dOptions({1, 2, 1, 2, 1, 2}); +/// ``` +using ZeroPad3dOptions = ZeroPadOptions<3>; + +// ============================================================================ + +/// Options for a `D`-dimensional ConstantPad module. +template +struct TORCH_API ConstantPadOptions { + ConstantPadOptions(ExpandingArray padding, double value) + : padding_(padding), value_(value) {} + + /// The size of the padding. + /// - If it is `int`, uses the same padding in all boundaries. + /// - If it is a 2-`tuple` (for ConstantPad1d), uses (padding_left, + /// padding_right). + /// - If it is a 4-`tuple` (for ConstantPad2d), uses (padding_left, + /// padding_right, padding_top, padding_bottom). + /// - If it is a 6-`tuple` (for ConstantPad3d), uses + /// (padding_left, padding_right, padding_top, padding_bottom, + /// padding_front, padding_back). + TORCH_ARG(ExpandingArray, padding); + + /// Fill value for constant padding. + TORCH_ARG(double, value); +}; + +/// `ConstantPadOptions` specialized for the `ConstantPad1d` module. +/// +/// Example: +/// ``` +/// ConstantPad1d model(ConstantPad1dOptions({3, 1}, 3.5)); +/// ``` +using ConstantPad1dOptions = ConstantPadOptions<1>; + +/// `ConstantPadOptions` specialized for the `ConstantPad2d` module. +/// +/// Example: +/// ``` +/// ConstantPad2d model(ConstantPad2dOptions({3, 0, 2, 1}, 3.5)); +/// ``` +using ConstantPad2dOptions = ConstantPadOptions<2>; + +/// `ConstantPadOptions` specialized for the `ConstantPad3d` module. +/// +/// Example: +/// ``` +/// ConstantPad3d model(ConstantPad3dOptions({1, 2, 1, 2, 1, 2}, 3.5)); +/// ``` +using ConstantPad3dOptions = ConstantPadOptions<3>; + +// ============================================================================ + +namespace functional { + +/// Options for `torch::nn::functional::pad`. +/// +/// Example: +/// ``` +/// namespace F = torch::nn::functional; +/// F::pad(input, F::PadFuncOptions({1, 2, 2, 1, 1, +/// 2}).mode(torch::kReplicate)); +/// ``` +struct TORCH_API PadFuncOptions { + typedef std::variant< + enumtype::kConstant, + enumtype::kReflect, + enumtype::kReplicate, + enumtype::kCircular> + mode_t; + + PadFuncOptions(std::vector pad); + + /// m-elements tuple, where m/2 <= input dimensions and m is even. + TORCH_ARG(std::vector, pad); + + /// "constant", "reflect", "replicate" or "circular". Default: "constant" + TORCH_ARG(mode_t, mode) = torch::kConstant; + + /// fill value for "constant" padding. Default: 0 + TORCH_ARG(double, value) = 0; +}; + +} // namespace functional + +} // namespace nn +} // namespace torch diff --git a/shared/package-files/9e/9e2dca5739f97e89a05b9252bc61c66dfa905f96627cbe734ee9efc6165d972a/blob b/shared/package-files/9e/9e2dca5739f97e89a05b9252bc61c66dfa905f96627cbe734ee9efc6165d972a/blob new file mode 100644 index 0000000000000000000000000000000000000000..8d360d0df4f991a28557fcb0048ac2d3c76c65de --- /dev/null +++ b/shared/package-files/9e/9e2dca5739f97e89a05b9252bc61c66dfa905f96627cbe734ee9efc6165d972a/blob @@ -0,0 +1,579 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013, Mahmoud Hashemi +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# * The names of the contributors may not be used to endorse or +# promote products derived from this software without specific +# prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Python's :mod:`datetime` module provides some of the most complex +and powerful primitives in the Python standard library. Time is +nontrivial, but thankfully its support is first-class in +Python. ``dateutils`` provides some additional tools for working with +time. + +Additionally, timeutils provides a few basic utilities for working +with timezones in Python. The Python :mod:`datetime` module's +documentation describes how to create a +:class:`~datetime.datetime`-compatible :class:`~datetime.tzinfo` +subtype. It even provides a few examples. + +The following module defines usable forms of the timezones in those +docs, as well as a couple other useful ones, :data:`UTC` (aka GMT) and +:data:`LocalTZ` (representing the local timezone as configured in the +operating system). For timezones beyond these, as well as a higher +degree of accuracy in corner cases, check out `pytz`_ and `dateutil`_. + +.. _pytz: https://pypi.python.org/pypi/pytz +.. _dateutil: https://dateutil.readthedocs.io/en/stable/index.html +""" + +import re +import time +import bisect +import operator +from datetime import tzinfo, timedelta, date, datetime + + +def total_seconds(td): + """For those with older versions of Python, a pure-Python + implementation of Python 2.7's :meth:`~datetime.timedelta.total_seconds`. + + Args: + td (datetime.timedelta): The timedelta to convert to seconds. + Returns: + float: total number of seconds + + >>> td = timedelta(days=4, seconds=33) + >>> total_seconds(td) + 345633.0 + """ + a_milli = 1000000.0 + td_ds = td.seconds + (td.days * 86400) # 24 * 60 * 60 + td_micro = td.microseconds + (td_ds * a_milli) + return td_micro / a_milli + + +def dt_to_timestamp(dt): + """Converts from a :class:`~datetime.datetime` object to an integer + timestamp, suitable interoperation with :func:`time.time` and + other `Epoch-based timestamps`. + + .. _Epoch-based timestamps: https://en.wikipedia.org/wiki/Unix_time + + >>> abs(round(time.time() - dt_to_timestamp(datetime.utcnow()), 2)) + 0.0 + + ``dt_to_timestamp`` supports both timezone-aware and naïve + :class:`~datetime.datetime` objects. Note that it assumes naïve + datetime objects are implied UTC, such as those generated with + :meth:`datetime.datetime.utcnow`. If your datetime objects are + local time, such as those generated with + :meth:`datetime.datetime.now`, first convert it using the + :meth:`datetime.datetime.replace` method with ``tzinfo=`` + :class:`LocalTZ` object in this module, then pass the result of + that to ``dt_to_timestamp``. + """ + if dt.tzinfo: + td = dt - EPOCH_AWARE + else: + td = dt - EPOCH_NAIVE + return total_seconds(td) + + +_NONDIGIT_RE = re.compile(r'\D') + + +def isoparse(iso_str): + """Parses the limited subset of `ISO8601-formatted time`_ strings as + returned by :meth:`datetime.datetime.isoformat`. + + >>> epoch_dt = datetime.utcfromtimestamp(0) + >>> iso_str = epoch_dt.isoformat() + >>> print(iso_str) + 1970-01-01T00:00:00 + >>> isoparse(iso_str) + datetime.datetime(1970, 1, 1, 0, 0) + + >>> utcnow = datetime.utcnow() + >>> utcnow == isoparse(utcnow.isoformat()) + True + + For further datetime parsing, see the `iso8601`_ package for strict + ISO parsing and `dateutil`_ package for loose parsing and more. + + .. _ISO8601-formatted time: https://en.wikipedia.org/wiki/ISO_8601 + .. _iso8601: https://pypi.python.org/pypi/iso8601 + .. _dateutil: https://pypi.python.org/pypi/python-dateutil + + """ + dt_args = [int(p) for p in _NONDIGIT_RE.split(iso_str)] + return datetime(*dt_args) + + +_BOUNDS = [(0, timedelta(seconds=1), 'second'), + (1, timedelta(seconds=60), 'minute'), + (1, timedelta(seconds=3600), 'hour'), + (1, timedelta(days=1), 'day'), + (1, timedelta(days=7), 'week'), + (2, timedelta(days=30), 'month'), + (1, timedelta(days=365), 'year')] +_BOUNDS = [(b[0] * b[1], b[1], b[2]) for b in _BOUNDS] +_BOUND_DELTAS = [b[0] for b in _BOUNDS] + +_FLOAT_PATTERN = r'[+-]?\ *(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?' +_PARSE_TD_RE = re.compile(r"((?P%s)\s*(?P\w)\w*)" % _FLOAT_PATTERN) +_PARSE_TD_KW_MAP = dict([(unit[0], unit + 's') + for _, _, unit in reversed(_BOUNDS[:-2])]) + + +def parse_timedelta(text): + """Robustly parses a short text description of a time period into a + :class:`datetime.timedelta`. Supports weeks, days, hours, minutes, + and seconds, with or without decimal points: + + Args: + text (str): Text to parse. + Returns: + datetime.timedelta + Raises: + ValueError: on parse failure. + + >>> parse_td('1d 2h 3.5m 0s') == timedelta(days=1, seconds=7410) + True + + Also supports full words and whitespace. + + >>> parse_td('2 weeks 1 day') == timedelta(days=15) + True + + Negative times are supported, too: + + >>> parse_td('-1.5 weeks 3m 20s') == timedelta(days=-11, seconds=43400) + True + """ + td_kwargs = {} + for match in _PARSE_TD_RE.finditer(text): + value, unit = match.group('value'), match.group('unit') + try: + unit_key = _PARSE_TD_KW_MAP[unit] + except KeyError: + raise ValueError('invalid time unit %r, expected one of %r' + % (unit, _PARSE_TD_KW_MAP.keys())) + try: + value = float(value) + except ValueError: + raise ValueError('invalid time value for unit %r: %r' + % (unit, value)) + td_kwargs[unit_key] = value + return timedelta(**td_kwargs) + + +parse_td = parse_timedelta # legacy alias + + +def _cardinalize_time_unit(unit, value): + # removes dependency on strutils; nice and simple because + # all time units cardinalize normally + if value == 1: + return unit + return unit + 's' + + +def decimal_relative_time(d, other=None, ndigits=0, cardinalize=True): + """Get a tuple representing the relative time difference between two + :class:`~datetime.datetime` objects or one + :class:`~datetime.datetime` and now. + + Args: + d (datetime): The first datetime object. + other (datetime): An optional second datetime object. If + unset, defaults to the current time as determined + :meth:`datetime.utcnow`. + ndigits (int): The number of decimal digits to round to, + defaults to ``0``. + cardinalize (bool): Whether to pluralize the time unit if + appropriate, defaults to ``True``. + Returns: + (float, str): A tuple of the :class:`float` difference and + respective unit of time, pluralized if appropriate and + *cardinalize* is set to ``True``. + + Unlike :func:`relative_time`, this method's return is amenable to + localization into other languages and custom phrasing and + formatting. + + >>> now = datetime.utcnow() + >>> decimal_relative_time(now - timedelta(days=1, seconds=3600), now) + (1.0, 'day') + >>> decimal_relative_time(now - timedelta(seconds=0.002), now, ndigits=5) + (0.002, 'seconds') + >>> decimal_relative_time(now, now - timedelta(days=900), ndigits=1) + (-2.5, 'years') + + """ + if other is None: + other = datetime.utcnow() + diff = other - d + diff_seconds = total_seconds(diff) + abs_diff = abs(diff) + b_idx = bisect.bisect(_BOUND_DELTAS, abs_diff) - 1 + bbound, bunit, bname = _BOUNDS[b_idx] + f_diff = diff_seconds / total_seconds(bunit) + rounded_diff = round(f_diff, ndigits) + if cardinalize: + return rounded_diff, _cardinalize_time_unit(bname, abs(rounded_diff)) + return rounded_diff, bname + + +def relative_time(d, other=None, ndigits=0): + """Get a string representation of the difference between two + :class:`~datetime.datetime` objects or one + :class:`~datetime.datetime` and the current time. Handles past and + future times. + + Args: + d (datetime): The first datetime object. + other (datetime): An optional second datetime object. If + unset, defaults to the current time as determined + :meth:`datetime.utcnow`. + ndigits (int): The number of decimal digits to round to, + defaults to ``0``. + Returns: + A short English-language string. + + >>> now = datetime.utcnow() + >>> relative_time(now, ndigits=1) + '0 seconds ago' + >>> relative_time(now - timedelta(days=1, seconds=36000), ndigits=1) + '1.4 days ago' + >>> relative_time(now + timedelta(days=7), now, ndigits=1) + '1 week from now' + + """ + drt, unit = decimal_relative_time(d, other, ndigits, cardinalize=True) + phrase = 'ago' + if drt < 0: + phrase = 'from now' + return '%g %s %s' % (abs(drt), unit, phrase) + + +def strpdate(string, format): + """Parse the date string according to the format in `format`. Returns a + :class:`date` object. Internally, :meth:`datetime.strptime` is used to + parse the string and thus conversion specifiers for time fields (e.g. `%H`) + may be provided; these will be parsed but ignored. + + Args: + string (str): The date string to be parsed. + format (str): The `strptime`_-style date format string. + Returns: + datetime.date + + .. _`strptime`: https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior + + >>> strpdate('2016-02-14', '%Y-%m-%d') + datetime.date(2016, 2, 14) + >>> strpdate('26/12 (2015)', '%d/%m (%Y)') + datetime.date(2015, 12, 26) + >>> strpdate('20151231 23:59:59', '%Y%m%d %H:%M:%S') + datetime.date(2015, 12, 31) + >>> strpdate('20160101 00:00:00.001', '%Y%m%d %H:%M:%S.%f') + datetime.date(2016, 1, 1) + """ + whence = datetime.strptime(string, format) + return whence.date() + + +def daterange(start, stop, step=1, inclusive=False): + """In the spirit of :func:`range` and :func:`xrange`, the `daterange` + generator that yields a sequence of :class:`~datetime.date` + objects, starting at *start*, incrementing by *step*, until *stop* + is reached. + + When *inclusive* is True, the final date may be *stop*, **if** + *step* falls evenly on it. By default, *step* is one day. See + details below for many more details. + + Args: + start (datetime.date): The starting date The first value in + the sequence. + stop (datetime.date): The stopping date. By default not + included in return. Can be `None` to yield an infinite + sequence. + step (int): The value to increment *start* by to reach + *stop*. Can be an :class:`int` number of days, a + :class:`datetime.timedelta`, or a :class:`tuple` of integers, + `(year, month, day)`. Positive and negative *step* values + are supported. + inclusive (bool): Whether or not the *stop* date can be + returned. *stop* is only returned when a *step* falls evenly + on it. + + >>> christmas = date(year=2015, month=12, day=25) + >>> boxing_day = date(year=2015, month=12, day=26) + >>> new_year = date(year=2016, month=1, day=1) + >>> for day in daterange(christmas, new_year): + ... print(repr(day)) + datetime.date(2015, 12, 25) + datetime.date(2015, 12, 26) + datetime.date(2015, 12, 27) + datetime.date(2015, 12, 28) + datetime.date(2015, 12, 29) + datetime.date(2015, 12, 30) + datetime.date(2015, 12, 31) + >>> for day in daterange(christmas, boxing_day): + ... print(repr(day)) + datetime.date(2015, 12, 25) + >>> for day in daterange(date(2017, 5, 1), date(2017, 8, 1), + ... step=(0, 1, 0), inclusive=True): + ... print(repr(day)) + datetime.date(2017, 5, 1) + datetime.date(2017, 6, 1) + datetime.date(2017, 7, 1) + datetime.date(2017, 8, 1) + + *Be careful when using stop=None, as this will yield an infinite + sequence of dates.* + """ + if not isinstance(start, date): + raise TypeError("start expected datetime.date instance") + if stop and not isinstance(stop, date): + raise TypeError("stop expected datetime.date instance or None") + try: + y_step, m_step, d_step = step + except TypeError: + y_step, m_step, d_step = 0, 0, step + else: + y_step, m_step = int(y_step), int(m_step) + if isinstance(d_step, int): + d_step = timedelta(days=int(d_step)) + elif isinstance(d_step, timedelta): + pass + else: + raise ValueError('step expected int, timedelta, or tuple' + ' (year, month, day), not: %r' % step) + + if stop is None: + finished = lambda now, stop: False + elif start < stop: + finished = operator.gt if inclusive else operator.ge + else: + finished = operator.lt if inclusive else operator.le + now = start + + while not finished(now, stop): + yield now + if y_step or m_step: + m_y_step, cur_month = divmod(now.month + m_step, 12) + now = now.replace(year=now.year + y_step + m_y_step, + month=cur_month or 12) + now = now + d_step + return + + +# Timezone support (brought in from tzutils) + + +ZERO = timedelta(0) +HOUR = timedelta(hours=1) + + +class ConstantTZInfo(tzinfo): + """ + A :class:`~datetime.tzinfo` subtype whose *offset* remains constant + (no daylight savings). + + Args: + name (str): Name of the timezone. + offset (datetime.timedelta): Offset of the timezone. + """ + def __init__(self, name="ConstantTZ", offset=ZERO): + self.name = name + self.offset = offset + + @property + def utcoffset_hours(self): + return total_seconds(self.offset) / (60 * 60) + + def utcoffset(self, dt): + return self.offset + + def tzname(self, dt): + return self.name + + def dst(self, dt): + return ZERO + + def __repr__(self): + cn = self.__class__.__name__ + return '%s(name=%r, offset=%r)' % (cn, self.name, self.offset) + + +UTC = ConstantTZInfo('UTC') +EPOCH_AWARE = datetime.fromtimestamp(0, UTC) +EPOCH_NAIVE = datetime.utcfromtimestamp(0) + + +class LocalTZInfo(tzinfo): + """The ``LocalTZInfo`` type takes data available in the time module + about the local timezone and makes a practical + :class:`datetime.tzinfo` to represent the timezone settings of the + operating system. + + For a more in-depth integration with the operating system, check + out `tzlocal`_. It builds on `pytz`_ and implements heuristics for + many versions of major operating systems to provide the official + ``pytz`` tzinfo, instead of the LocalTZ generalization. + + .. _tzlocal: https://pypi.python.org/pypi/tzlocal + .. _pytz: https://pypi.python.org/pypi/pytz + + """ + _std_offset = timedelta(seconds=-time.timezone) + _dst_offset = _std_offset + if time.daylight: + _dst_offset = timedelta(seconds=-time.altzone) + + def is_dst(self, dt): + dt_t = (dt.year, dt.month, dt.day, dt.hour, dt.minute, + dt.second, dt.weekday(), 0, -1) + local_t = time.localtime(time.mktime(dt_t)) + return local_t.tm_isdst > 0 + + def utcoffset(self, dt): + if self.is_dst(dt): + return self._dst_offset + return self._std_offset + + def dst(self, dt): + if self.is_dst(dt): + return self._dst_offset - self._std_offset + return ZERO + + def tzname(self, dt): + return time.tzname[self.is_dst(dt)] + + def __repr__(self): + return '%s()' % self.__class__.__name__ + + +LocalTZ = LocalTZInfo() + + +def _first_sunday_on_or_after(dt): + days_to_go = 6 - dt.weekday() + if days_to_go: + dt += timedelta(days_to_go) + return dt + + +# US DST Rules +# +# This is a simplified (i.e., wrong for a few cases) set of rules for US +# DST start and end times. For a complete and up-to-date set of DST rules +# and timezone definitions, visit the Olson Database (or try pytz): +# http://www.twinsun.com/tz/tz-link.htm +# http://sourceforge.net/projects/pytz/ (might not be up-to-date) +# +# In the US, since 2007, DST starts at 2am (standard time) on the second +# Sunday in March, which is the first Sunday on or after Mar 8. +DSTSTART_2007 = datetime(1, 3, 8, 2) +# and ends at 2am (DST time; 1am standard time) on the first Sunday of Nov. +DSTEND_2007 = datetime(1, 11, 1, 1) +# From 1987 to 2006, DST used to start at 2am (standard time) on the first +# Sunday in April and to end at 2am (DST time; 1am standard time) on the last +# Sunday of October, which is the first Sunday on or after Oct 25. +DSTSTART_1987_2006 = datetime(1, 4, 1, 2) +DSTEND_1987_2006 = datetime(1, 10, 25, 1) +# From 1967 to 1986, DST used to start at 2am (standard time) on the last +# Sunday in April (the one on or after April 24) and to end at 2am (DST time; +# 1am standard time) on the last Sunday of October, which is the first Sunday +# on or after Oct 25. +DSTSTART_1967_1986 = datetime(1, 4, 24, 2) +DSTEND_1967_1986 = DSTEND_1987_2006 + + +class USTimeZone(tzinfo): + """Copied directly from the Python docs, the ``USTimeZone`` is a + :class:`datetime.tzinfo` subtype used to create the + :data:`Eastern`, :data:`Central`, :data:`Mountain`, and + :data:`Pacific` tzinfo types. + """ + def __init__(self, hours, reprname, stdname, dstname): + self.stdoffset = timedelta(hours=hours) + self.reprname = reprname + self.stdname = stdname + self.dstname = dstname + + def __repr__(self): + return self.reprname + + def tzname(self, dt): + if self.dst(dt): + return self.dstname + else: + return self.stdname + + def utcoffset(self, dt): + return self.stdoffset + self.dst(dt) + + def dst(self, dt): + if dt is None or dt.tzinfo is None: + # An exception may be sensible here, in one or both cases. + # It depends on how you want to treat them. The default + # fromutc() implementation (called by the default astimezone() + # implementation) passes a datetime with dt.tzinfo is self. + return ZERO + assert dt.tzinfo is self + + # Find start and end times for US DST. For years before 1967, return + # ZERO for no DST. + if 2006 < dt.year: + dststart, dstend = DSTSTART_2007, DSTEND_2007 + elif 1986 < dt.year < 2007: + dststart, dstend = DSTSTART_1987_2006, DSTEND_1987_2006 + elif 1966 < dt.year < 1987: + dststart, dstend = DSTSTART_1967_1986, DSTEND_1967_1986 + else: + return ZERO + + start = _first_sunday_on_or_after(dststart.replace(year=dt.year)) + end = _first_sunday_on_or_after(dstend.replace(year=dt.year)) + + # Can't compare naive to aware objects, so strip the timezone + # from dt first. + if start <= dt.replace(tzinfo=None) < end: + return HOUR + else: + return ZERO + + +Eastern = USTimeZone(-5, "Eastern", "EST", "EDT") +Central = USTimeZone(-6, "Central", "CST", "CDT") +Mountain = USTimeZone(-7, "Mountain", "MST", "MDT") +Pacific = USTimeZone(-8, "Pacific", "PST", "PDT") diff --git a/shared/package-files/9e/9e2ed5952256dbfcc6d00771c79e9fb8de6de3223abd138102e02ed3af95e1fd/blob b/shared/package-files/9e/9e2ed5952256dbfcc6d00771c79e9fb8de6de3223abd138102e02ed3af95e1fd/blob new file mode 100644 index 0000000000000000000000000000000000000000..1dc5136d726a1542a7e83cff8cf356ee207b1949 --- /dev/null +++ b/shared/package-files/9e/9e2ed5952256dbfcc6d00771c79e9fb8de6de3223abd138102e02ed3af95e1fd/blob @@ -0,0 +1,345 @@ +import warnings +from collections import namedtuple +from functools import partial +from typing import Any, Callable, List, Optional, Tuple + +import torch +import torch.nn as nn +import torch.nn.functional as F +from torch import Tensor + +from ..transforms._presets import ImageClassification +from ..utils import _log_api_usage_once +from ._api import register_model, Weights, WeightsEnum +from ._meta import _IMAGENET_CATEGORIES +from ._utils import _ovewrite_named_param, handle_legacy_interface + + +__all__ = ["GoogLeNet", "GoogLeNetOutputs", "_GoogLeNetOutputs", "GoogLeNet_Weights", "googlenet"] + + +GoogLeNetOutputs = namedtuple("GoogLeNetOutputs", ["logits", "aux_logits2", "aux_logits1"]) +GoogLeNetOutputs.__annotations__ = {"logits": Tensor, "aux_logits2": Optional[Tensor], "aux_logits1": Optional[Tensor]} + +# Script annotations failed with _GoogleNetOutputs = namedtuple ... +# _GoogLeNetOutputs set here for backwards compat +_GoogLeNetOutputs = GoogLeNetOutputs + + +class GoogLeNet(nn.Module): + __constants__ = ["aux_logits", "transform_input"] + + def __init__( + self, + num_classes: int = 1000, + aux_logits: bool = True, + transform_input: bool = False, + init_weights: Optional[bool] = None, + blocks: Optional[List[Callable[..., nn.Module]]] = None, + dropout: float = 0.2, + dropout_aux: float = 0.7, + ) -> None: + super().__init__() + _log_api_usage_once(self) + if blocks is None: + blocks = [BasicConv2d, Inception, InceptionAux] + if init_weights is None: + warnings.warn( + "The default weight initialization of GoogleNet will be changed in future releases of " + "torchvision. If you wish to keep the old behavior (which leads to long initialization times" + " due to scipy/scipy#11299), please set init_weights=True.", + FutureWarning, + ) + init_weights = True + if len(blocks) != 3: + raise ValueError(f"blocks length should be 3 instead of {len(blocks)}") + conv_block = blocks[0] + inception_block = blocks[1] + inception_aux_block = blocks[2] + + self.aux_logits = aux_logits + self.transform_input = transform_input + + self.conv1 = conv_block(3, 64, kernel_size=7, stride=2, padding=3) + self.maxpool1 = nn.MaxPool2d(3, stride=2, ceil_mode=True) + self.conv2 = conv_block(64, 64, kernel_size=1) + self.conv3 = conv_block(64, 192, kernel_size=3, padding=1) + self.maxpool2 = nn.MaxPool2d(3, stride=2, ceil_mode=True) + + self.inception3a = inception_block(192, 64, 96, 128, 16, 32, 32) + self.inception3b = inception_block(256, 128, 128, 192, 32, 96, 64) + self.maxpool3 = nn.MaxPool2d(3, stride=2, ceil_mode=True) + + self.inception4a = inception_block(480, 192, 96, 208, 16, 48, 64) + self.inception4b = inception_block(512, 160, 112, 224, 24, 64, 64) + self.inception4c = inception_block(512, 128, 128, 256, 24, 64, 64) + self.inception4d = inception_block(512, 112, 144, 288, 32, 64, 64) + self.inception4e = inception_block(528, 256, 160, 320, 32, 128, 128) + self.maxpool4 = nn.MaxPool2d(2, stride=2, ceil_mode=True) + + self.inception5a = inception_block(832, 256, 160, 320, 32, 128, 128) + self.inception5b = inception_block(832, 384, 192, 384, 48, 128, 128) + + if aux_logits: + self.aux1 = inception_aux_block(512, num_classes, dropout=dropout_aux) + self.aux2 = inception_aux_block(528, num_classes, dropout=dropout_aux) + else: + self.aux1 = None # type: ignore[assignment] + self.aux2 = None # type: ignore[assignment] + + self.avgpool = nn.AdaptiveAvgPool2d((1, 1)) + self.dropout = nn.Dropout(p=dropout) + self.fc = nn.Linear(1024, num_classes) + + if init_weights: + for m in self.modules(): + if isinstance(m, nn.Conv2d) or isinstance(m, nn.Linear): + torch.nn.init.trunc_normal_(m.weight, mean=0.0, std=0.01, a=-2, b=2) + elif isinstance(m, nn.BatchNorm2d): + nn.init.constant_(m.weight, 1) + nn.init.constant_(m.bias, 0) + + def _transform_input(self, x: Tensor) -> Tensor: + if self.transform_input: + x_ch0 = torch.unsqueeze(x[:, 0], 1) * (0.229 / 0.5) + (0.485 - 0.5) / 0.5 + x_ch1 = torch.unsqueeze(x[:, 1], 1) * (0.224 / 0.5) + (0.456 - 0.5) / 0.5 + x_ch2 = torch.unsqueeze(x[:, 2], 1) * (0.225 / 0.5) + (0.406 - 0.5) / 0.5 + x = torch.cat((x_ch0, x_ch1, x_ch2), 1) + return x + + def _forward(self, x: Tensor) -> Tuple[Tensor, Optional[Tensor], Optional[Tensor]]: + # N x 3 x 224 x 224 + x = self.conv1(x) + # N x 64 x 112 x 112 + x = self.maxpool1(x) + # N x 64 x 56 x 56 + x = self.conv2(x) + # N x 64 x 56 x 56 + x = self.conv3(x) + # N x 192 x 56 x 56 + x = self.maxpool2(x) + + # N x 192 x 28 x 28 + x = self.inception3a(x) + # N x 256 x 28 x 28 + x = self.inception3b(x) + # N x 480 x 28 x 28 + x = self.maxpool3(x) + # N x 480 x 14 x 14 + x = self.inception4a(x) + # N x 512 x 14 x 14 + aux1: Optional[Tensor] = None + if self.aux1 is not None: + if self.training: + aux1 = self.aux1(x) + + x = self.inception4b(x) + # N x 512 x 14 x 14 + x = self.inception4c(x) + # N x 512 x 14 x 14 + x = self.inception4d(x) + # N x 528 x 14 x 14 + aux2: Optional[Tensor] = None + if self.aux2 is not None: + if self.training: + aux2 = self.aux2(x) + + x = self.inception4e(x) + # N x 832 x 14 x 14 + x = self.maxpool4(x) + # N x 832 x 7 x 7 + x = self.inception5a(x) + # N x 832 x 7 x 7 + x = self.inception5b(x) + # N x 1024 x 7 x 7 + + x = self.avgpool(x) + # N x 1024 x 1 x 1 + x = torch.flatten(x, 1) + # N x 1024 + x = self.dropout(x) + x = self.fc(x) + # N x 1000 (num_classes) + return x, aux2, aux1 + + @torch.jit.unused + def eager_outputs(self, x: Tensor, aux2: Tensor, aux1: Optional[Tensor]) -> GoogLeNetOutputs: + if self.training and self.aux_logits: + return _GoogLeNetOutputs(x, aux2, aux1) + else: + return x # type: ignore[return-value] + + def forward(self, x: Tensor) -> GoogLeNetOutputs: + x = self._transform_input(x) + x, aux1, aux2 = self._forward(x) + aux_defined = self.training and self.aux_logits + if torch.jit.is_scripting(): + if not aux_defined: + warnings.warn("Scripted GoogleNet always returns GoogleNetOutputs Tuple") + return GoogLeNetOutputs(x, aux2, aux1) + else: + return self.eager_outputs(x, aux2, aux1) + + +class Inception(nn.Module): + def __init__( + self, + in_channels: int, + ch1x1: int, + ch3x3red: int, + ch3x3: int, + ch5x5red: int, + ch5x5: int, + pool_proj: int, + conv_block: Optional[Callable[..., nn.Module]] = None, + ) -> None: + super().__init__() + if conv_block is None: + conv_block = BasicConv2d + self.branch1 = conv_block(in_channels, ch1x1, kernel_size=1) + + self.branch2 = nn.Sequential( + conv_block(in_channels, ch3x3red, kernel_size=1), conv_block(ch3x3red, ch3x3, kernel_size=3, padding=1) + ) + + self.branch3 = nn.Sequential( + conv_block(in_channels, ch5x5red, kernel_size=1), + # Here, kernel_size=3 instead of kernel_size=5 is a known bug. + # Please see https://github.com/pytorch/vision/issues/906 for details. + conv_block(ch5x5red, ch5x5, kernel_size=3, padding=1), + ) + + self.branch4 = nn.Sequential( + nn.MaxPool2d(kernel_size=3, stride=1, padding=1, ceil_mode=True), + conv_block(in_channels, pool_proj, kernel_size=1), + ) + + def _forward(self, x: Tensor) -> List[Tensor]: + branch1 = self.branch1(x) + branch2 = self.branch2(x) + branch3 = self.branch3(x) + branch4 = self.branch4(x) + + outputs = [branch1, branch2, branch3, branch4] + return outputs + + def forward(self, x: Tensor) -> Tensor: + outputs = self._forward(x) + return torch.cat(outputs, 1) + + +class InceptionAux(nn.Module): + def __init__( + self, + in_channels: int, + num_classes: int, + conv_block: Optional[Callable[..., nn.Module]] = None, + dropout: float = 0.7, + ) -> None: + super().__init__() + if conv_block is None: + conv_block = BasicConv2d + self.conv = conv_block(in_channels, 128, kernel_size=1) + + self.fc1 = nn.Linear(2048, 1024) + self.fc2 = nn.Linear(1024, num_classes) + self.dropout = nn.Dropout(p=dropout) + + def forward(self, x: Tensor) -> Tensor: + # aux1: N x 512 x 14 x 14, aux2: N x 528 x 14 x 14 + x = F.adaptive_avg_pool2d(x, (4, 4)) + # aux1: N x 512 x 4 x 4, aux2: N x 528 x 4 x 4 + x = self.conv(x) + # N x 128 x 4 x 4 + x = torch.flatten(x, 1) + # N x 2048 + x = F.relu(self.fc1(x), inplace=True) + # N x 1024 + x = self.dropout(x) + # N x 1024 + x = self.fc2(x) + # N x 1000 (num_classes) + + return x + + +class BasicConv2d(nn.Module): + def __init__(self, in_channels: int, out_channels: int, **kwargs: Any) -> None: + super().__init__() + self.conv = nn.Conv2d(in_channels, out_channels, bias=False, **kwargs) + self.bn = nn.BatchNorm2d(out_channels, eps=0.001) + + def forward(self, x: Tensor) -> Tensor: + x = self.conv(x) + x = self.bn(x) + return F.relu(x, inplace=True) + + +class GoogLeNet_Weights(WeightsEnum): + IMAGENET1K_V1 = Weights( + url="https://download.pytorch.org/models/googlenet-1378be20.pth", + transforms=partial(ImageClassification, crop_size=224), + meta={ + "num_params": 6624904, + "min_size": (15, 15), + "categories": _IMAGENET_CATEGORIES, + "recipe": "https://github.com/pytorch/vision/tree/main/references/classification#googlenet", + "_metrics": { + "ImageNet-1K": { + "acc@1": 69.778, + "acc@5": 89.530, + } + }, + "_ops": 1.498, + "_file_size": 49.731, + "_docs": """These weights are ported from the original paper.""", + }, + ) + DEFAULT = IMAGENET1K_V1 + + +@register_model() +@handle_legacy_interface(weights=("pretrained", GoogLeNet_Weights.IMAGENET1K_V1)) +def googlenet(*, weights: Optional[GoogLeNet_Weights] = None, progress: bool = True, **kwargs: Any) -> GoogLeNet: + """GoogLeNet (Inception v1) model architecture from + `Going Deeper with Convolutions `_. + + Args: + weights (:class:`~torchvision.models.GoogLeNet_Weights`, optional): The + pretrained weights for the model. See + :class:`~torchvision.models.GoogLeNet_Weights` below for + more details, and possible values. By default, no pre-trained + weights are used. + progress (bool, optional): If True, displays a progress bar of the + download to stderr. Default is True. + **kwargs: parameters passed to the ``torchvision.models.GoogLeNet`` + base class. Please refer to the `source code + `_ + for more details about this class. + .. autoclass:: torchvision.models.GoogLeNet_Weights + :members: + """ + weights = GoogLeNet_Weights.verify(weights) + + original_aux_logits = kwargs.get("aux_logits", False) + if weights is not None: + if "transform_input" not in kwargs: + _ovewrite_named_param(kwargs, "transform_input", True) + _ovewrite_named_param(kwargs, "aux_logits", True) + _ovewrite_named_param(kwargs, "init_weights", False) + _ovewrite_named_param(kwargs, "num_classes", len(weights.meta["categories"])) + + model = GoogLeNet(**kwargs) + + if weights is not None: + model.load_state_dict(weights.get_state_dict(progress=progress, check_hash=True)) + if not original_aux_logits: + model.aux_logits = False + model.aux1 = None # type: ignore[assignment] + model.aux2 = None # type: ignore[assignment] + else: + warnings.warn( + "auxiliary heads in the pretrained googlenet model are NOT pretrained, so make sure to train them" + ) + + return model diff --git a/shared/package-files/9e/9e31eca8a6cf4aa13202dbc838615d12f6b47acf00e5289e9b1ffdc2ef762591/blob b/shared/package-files/9e/9e31eca8a6cf4aa13202dbc838615d12f6b47acf00e5289e9b1ffdc2ef762591/blob new file mode 100644 index 0000000000000000000000000000000000000000..c43b24f2bdb779fd0cee785b6419c75838dbdc52 --- /dev/null +++ b/shared/package-files/9e/9e31eca8a6cf4aa13202dbc838615d12f6b47acf00e5289e9b1ffdc2ef762591/blob @@ -0,0 +1,385 @@ +import sys +from _typeshed import AnyPath, FileDescriptorLike +from builtins import OSError +from io import TextIOWrapper as _TextIOWrapper +from posix import listdir as listdir, stat_result as stat_result # TODO: use this, see https://github.com/python/mypy/issues/3078 +from typing import ( + IO, + Any, + AnyStr, + Callable, + Dict, + Generic, + Iterator, + List, + Mapping, + MutableMapping, + NamedTuple, + NoReturn, + Optional, + Sequence, + Set, + Text, + Tuple, + TypeVar, + Union, + overload, +) + +from . import path as path + +# We need to use something from path, or flake8 and pytype get unhappy +_supports_unicode_filenames = path.supports_unicode_filenames + +_T = TypeVar("_T") + +# ----- os variables ----- + +error = OSError + +if sys.version_info >= (3, 2): + supports_bytes_environ: bool + +if sys.version_info >= (3, 3): + supports_dir_fd: Set[Callable[..., Any]] + supports_fd: Set[Callable[..., Any]] + supports_effective_ids: Set[Callable[..., Any]] + supports_follow_symlinks: Set[Callable[..., Any]] + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + +O_RDONLY: int +O_WRONLY: int +O_RDWR: int +O_APPEND: int +O_CREAT: int +O_EXCL: int +O_TRUNC: int +# We don't use sys.platform for O_* flags to denote platform-dependent APIs because some codes, +# including tests for mypy, use a more finer way than sys.platform before using these APIs +# See https://github.com/python/typeshed/pull/2286 for discussions +O_DSYNC: int # Unix only +O_RSYNC: int # Unix only +O_SYNC: int # Unix only +O_NDELAY: int # Unix only +O_NONBLOCK: int # Unix only +O_NOCTTY: int # Unix only +O_SHLOCK: int # Unix only +O_EXLOCK: int # Unix only +O_BINARY: int # Windows only +O_NOINHERIT: int # Windows only +O_SHORT_LIVED: int # Windows only +O_TEMPORARY: int # Windows only +O_RANDOM: int # Windows only +O_SEQUENTIAL: int # Windows only +O_TEXT: int # Windows only +O_ASYNC: int # Gnu extension if in C library +O_DIRECT: int # Gnu extension if in C library +O_DIRECTORY: int # Gnu extension if in C library +O_NOFOLLOW: int # Gnu extension if in C library +O_NOATIME: int # Gnu extension if in C library +O_LARGEFILE: int # Gnu extension if in C library + +curdir: str +pardir: str +sep: str +if sys.platform == "win32": + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +linesep: str +devnull: str +name: str + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): + def copy(self) -> Dict[AnyStr, AnyStr]: ... + def __delitem__(self, key: AnyStr) -> None: ... + def __getitem__(self, key: AnyStr) -> AnyStr: ... + def __setitem__(self, key: AnyStr, value: AnyStr) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __len__(self) -> int: ... + +environ: _Environ[str] +if sys.version_info >= (3, 2): + environb: _Environ[bytes] + +if sys.platform != "win32": + # Unix only + confstr_names: Dict[str, int] + pathconf_names: Dict[str, int] + sysconf_names: Dict[str, int] + + EX_OK: int + EX_USAGE: int + EX_DATAERR: int + EX_NOINPUT: int + EX_NOUSER: int + EX_NOHOST: int + EX_UNAVAILABLE: int + EX_SOFTWARE: int + EX_OSERR: int + EX_OSFILE: int + EX_CANTCREAT: int + EX_IOERR: int + EX_TEMPFAIL: int + EX_PROTOCOL: int + EX_NOPERM: int + EX_CONFIG: int + EX_NOTFOUND: int + +P_NOWAIT: int +P_NOWAITO: int +P_WAIT: int +if sys.platform == "win32": + P_DETACH: int + P_OVERLAY: int + +# wait()/waitpid() options +if sys.platform != "win32": + WNOHANG: int # Unix only + WCONTINUED: int # some Unix systems + WUNTRACED: int # Unix only + +TMP_MAX: int # Undocumented, but used by tempfile + +# ----- os classes (structures) ----- +if sys.version_info >= (3, 6): + from builtins import _PathLike + + PathLike = _PathLike # See comment in builtins + +class _StatVFS(NamedTuple): + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int + +def getlogin() -> str: ... +def getpid() -> int: ... +def getppid() -> int: ... +def strerror(code: int) -> str: ... +def umask(mask: int) -> int: ... + +if sys.platform != "win32": + def ctermid() -> str: ... + def getegid() -> int: ... + def geteuid() -> int: ... + def getgid() -> int: ... + def getgroups() -> List[int]: ... # Unix only, behaves differently on Mac + def initgroups(username: str, gid: int) -> None: ... + def getpgid(pid: int) -> int: ... + def getpgrp() -> int: ... + def getresuid() -> Tuple[int, int, int]: ... + def getresgid() -> Tuple[int, int, int]: ... + def getuid() -> int: ... + def setegid(egid: int) -> None: ... + def seteuid(euid: int) -> None: ... + def setgid(gid: int) -> None: ... + def setgroups(groups: Sequence[int]) -> None: ... + def setpgrp() -> None: ... + def setpgid(pid: int, pgrp: int) -> None: ... + def setregid(rgid: int, egid: int) -> None: ... + def setresgid(rgid: int, egid: int, sgid: int) -> None: ... + def setresuid(ruid: int, euid: int, suid: int) -> None: ... + def setreuid(ruid: int, euid: int) -> None: ... + def getsid(pid: int) -> int: ... + def setsid() -> None: ... + def setuid(uid: int) -> None: ... + def uname() -> Tuple[str, str, str, str, str]: ... + +@overload +def getenv(key: Text) -> Optional[str]: ... +@overload +def getenv(key: Text, default: _T) -> Union[str, _T]: ... +def putenv(key: Union[bytes, Text], value: Union[bytes, Text]) -> None: ... +def unsetenv(key: Union[bytes, Text]) -> None: ... +def fdopen(fd: int, *args, **kwargs) -> IO[Any]: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def dup(fd: int) -> int: ... +def dup2(fd: int, fd2: int) -> None: ... +def fstat(fd: int) -> Any: ... +def fsync(fd: FileDescriptorLike) -> None: ... +def lseek(fd: int, pos: int, how: int) -> int: ... +def open(file: AnyPath, flags: int, mode: int = ...) -> int: ... +def pipe() -> Tuple[int, int]: ... +def read(fd: int, n: int) -> bytes: ... +def write(fd: int, string: Union[bytes, buffer]) -> int: ... +def access(path: AnyPath, mode: int) -> bool: ... +def chdir(path: AnyPath) -> None: ... +def fchdir(fd: FileDescriptorLike) -> None: ... +def getcwd() -> str: ... +def getcwdu() -> unicode: ... +def chmod(path: AnyPath, mode: int) -> None: ... +def link(src: AnyPath, link_name: AnyPath) -> None: ... +def lstat(path: AnyPath) -> Any: ... +def mknod(filename: AnyPath, mode: int = ..., device: int = ...) -> None: ... +def major(device: int) -> int: ... +def minor(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +def mkdir(path: AnyPath, mode: int = ...) -> None: ... +def makedirs(path: AnyPath, mode: int = ...) -> None: ... +def readlink(path: AnyStr) -> AnyStr: ... +def remove(path: AnyPath) -> None: ... +def removedirs(path: AnyPath) -> None: ... +def rename(src: AnyPath, dst: AnyPath) -> None: ... +def renames(old: AnyPath, new: AnyPath) -> None: ... +def rmdir(path: AnyPath) -> None: ... +def stat(path: AnyPath) -> Any: ... +@overload +def stat_float_times() -> bool: ... +@overload +def stat_float_times(newvalue: bool) -> None: ... +def symlink(source: AnyPath, link_name: AnyPath) -> None: ... +def unlink(path: AnyPath) -> None: ... + +# TODO: add ns, dir_fd, follow_symlinks argument +if sys.version_info >= (3, 0): + def utime(path: AnyPath, times: Optional[Tuple[float, float]] = ...) -> None: ... + +else: + def utime(path: AnyPath, times: Optional[Tuple[float, float]]) -> None: ... + +if sys.platform != "win32": + # Unix only + def fchmod(fd: int, mode: int) -> None: ... + def fchown(fd: int, uid: int, gid: int) -> None: ... + if sys.platform != "darwin": + def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac + def fpathconf(fd: int, name: Union[str, int]) -> int: ... + def fstatvfs(fd: int) -> _StatVFS: ... + def ftruncate(fd: int, length: int) -> None: ... + def isatty(fd: int) -> bool: ... + def openpty() -> Tuple[int, int]: ... # some flavors of Unix + def tcgetpgrp(fd: int) -> int: ... + def tcsetpgrp(fd: int, pg: int) -> None: ... + def ttyname(fd: int) -> str: ... + def chflags(path: AnyPath, flags: int) -> None: ... + def chroot(path: AnyPath) -> None: ... + def chown(path: AnyPath, uid: int, gid: int) -> None: ... + def lchflags(path: AnyPath, flags: int) -> None: ... + def lchmod(path: AnyPath, mode: int) -> None: ... + def lchown(path: AnyPath, uid: int, gid: int) -> None: ... + def mkfifo(path: AnyPath, mode: int = ...) -> None: ... + def pathconf(path: AnyPath, name: Union[str, int]) -> int: ... + def statvfs(path: AnyPath) -> _StatVFS: ... + +if sys.version_info >= (3, 6): + def walk( + top: Union[AnyStr, PathLike[AnyStr]], + topdown: bool = ..., + onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ..., + ) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr]]]: ... + +else: + def walk( + top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., followlinks: bool = ... + ) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr]]]: ... + +def abort() -> NoReturn: ... + +# These are defined as execl(file, *args) but the first *arg is mandatory. +def execl(file: AnyPath, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execlp(file: AnyPath, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... + +# These are: execle(file, *args, env) but env is pulled from the last element of the args. +def execle(file: AnyPath, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execlpe(file: AnyPath, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... + +# The docs say `args: tuple or list of strings` +# The implementation enforces tuple or list so we can't use Sequence. +_ExecVArgs = Union[Tuple[Union[bytes, Text], ...], List[bytes], List[Text], List[Union[bytes, Text]]] + +def execv(path: AnyPath, args: _ExecVArgs) -> NoReturn: ... +def execve(path: AnyPath, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... +def execvp(file: AnyPath, args: _ExecVArgs) -> NoReturn: ... +def execvpe(file: AnyPath, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... +def _exit(n: int) -> NoReturn: ... +def kill(pid: int, sig: int) -> None: ... + +if sys.platform != "win32": + # Unix only + def fork() -> int: ... + def forkpty() -> Tuple[int, int]: ... # some flavors of Unix + def killpg(__pgid: int, __signal: int) -> None: ... + def nice(increment: int) -> int: ... + def plock(op: int) -> None: ... # ???op is int? + +if sys.version_info >= (3, 0): + class popen(_TextIOWrapper): + # TODO 'b' modes or bytes command not accepted? + def __init__(self, command: str, mode: str = ..., bufsize: int = ...) -> None: ... + def close(self) -> Any: ... # may return int + +else: + def popen(command: str, *args, **kwargs) -> IO[Any]: ... + def popen2(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... + def popen3(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any], IO[Any]]: ... + def popen4(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... + +def spawnl(mode: int, path: AnyPath, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... +def spawnle(mode: int, path: AnyPath, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise sig +def spawnv(mode: int, path: AnyPath, args: List[Union[bytes, Text]]) -> int: ... +def spawnve(mode: int, path: AnyPath, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... +def system(command: AnyPath) -> int: ... +def times() -> Tuple[float, float, float, float, float]: ... +def waitpid(pid: int, options: int) -> Tuple[int, int]: ... +def urandom(n: int) -> bytes: ... + +if sys.platform == "win32": + def startfile(path: AnyPath, operation: Optional[str] = ...) -> None: ... + +else: + # Unix only + def spawnlp(mode: int, file: AnyPath, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... + def spawnlpe(mode: int, file: AnyPath, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature + def spawnvp(mode: int, file: AnyPath, args: List[Union[bytes, Text]]) -> int: ... + def spawnvpe(mode: int, file: AnyPath, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... + def wait() -> Tuple[int, int]: ... + def wait3(options: int) -> Tuple[int, int, Any]: ... + def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ... + def WCOREDUMP(status: int) -> bool: ... + def WIFCONTINUED(status: int) -> bool: ... + def WIFSTOPPED(status: int) -> bool: ... + def WIFSIGNALED(status: int) -> bool: ... + def WIFEXITED(status: int) -> bool: ... + def WEXITSTATUS(status: int) -> int: ... + def WSTOPSIG(status: int) -> int: ... + def WTERMSIG(status: int) -> int: ... + def confstr(name: Union[str, int]) -> Optional[str]: ... + def getloadavg() -> Tuple[float, float, float]: ... + def sysconf(name: Union[str, int]) -> int: ... + +if sys.version_info >= (3, 0): + def sched_getaffinity(id: int) -> Set[int]: ... + +if sys.version_info >= (3, 3): + class waitresult: + si_pid: int + def waitid(idtype: int, id: int, options: int) -> waitresult: ... + +if sys.version_info < (3, 0): + def tmpfile() -> IO[Any]: ... + def tmpnam() -> str: ... + def tempnam(dir: str = ..., prefix: str = ...) -> str: ... + +P_ALL: int +WEXITED: int +WNOWAIT: int diff --git a/shared/package-files/9e/9e32665627d8e1a49cb6e5b73cfe441510b18c4c0c4433ba27f7de1b674a5ac2/blob b/shared/package-files/9e/9e32665627d8e1a49cb6e5b73cfe441510b18c4c0c4433ba27f7de1b674a5ac2/blob new file mode 100644 index 0000000000000000000000000000000000000000..9582fa730f121634348a79c1a8b0cc2df99c616f --- /dev/null +++ b/shared/package-files/9e/9e32665627d8e1a49cb6e5b73cfe441510b18c4c0c4433ba27f7de1b674a5ac2/blob @@ -0,0 +1,16 @@ +import sys + +# This code exists for backwards compatibility reasons. +# I don't like it either. Just look the other way. :) + +for package in ('urllib3', 'idna', 'chardet'): + vendored_package = "pip._vendor." + package + locals()[package] = __import__(vendored_package) + # This traversal is apparently necessary such that the identities are + # preserved (requests.packages.urllib3.* is urllib3.*) + for mod in list(sys.modules): + if mod == vendored_package or mod.startswith(vendored_package + '.'): + unprefixed_mod = mod[len("pip._vendor."):] + sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod] + +# Kinda cool, though, right? diff --git a/shared/package-files/9e/9e358cd7aa4f3258af8994524dcbb36a6e1e0c7a331e7be83dd8cf5a1be5ae62/blob b/shared/package-files/9e/9e358cd7aa4f3258af8994524dcbb36a6e1e0c7a331e7be83dd8cf5a1be5ae62/blob new file mode 100644 index 0000000000000000000000000000000000000000..9b4bdc4669e3c7a1593bdb459d68d26d85158948 --- /dev/null +++ b/shared/package-files/9e/9e358cd7aa4f3258af8994524dcbb36a6e1e0c7a331e7be83dd8cf5a1be5ae62/blob @@ -0,0 +1,1957 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +""" +Sections in this module are + + 1. top-level functions + 2. plan creators + 3. plan runners + 4. individual operations + 5. helper functions + +The top-level functions compose and execute full plans. + +A plan is created by composing various individual operations. The plan data structure is a +list of dicts, where each dict represents an individual operation. The dict contains two +keys--`function` and `kwargs`--where function is the name of the individual operation function +within this module. + +Each individual operation must + + a) return a `Result` (i.e. NEEDS_SUDO, MODIFIED, or NO_CHANGE) + b) have no side effects if context.dry_run is True + c) be verbose and descriptive about the changes being made or proposed is context.verbosity >= 1 + +The plan runner functions take the plan (list of dicts) as an argument, and then coordinate the +execution of each individual operation. The docstring for `run_plan_elevated()` has details on +how that strategy is implemented. + +""" + +import json +import os +import re +import struct +import sys +from difflib import unified_diff +from errno import ENOENT +from glob import glob +from itertools import chain +from logging import getLogger +from os.path import abspath, basename, dirname, exists, expanduser, isdir, isfile, join +from pathlib import Path +from random import randint + +from .. import CONDA_PACKAGE_ROOT, CondaError +from .. import __version__ as CONDA_VERSION +from ..activate import ( + CshActivator, + FishActivator, + PosixActivator, + PowerShellActivator, + XonshActivator, +) +from ..auxlib.compat import Utf8NamedTemporaryFile +from ..auxlib.ish import dals +from ..base.context import context +from ..common.compat import ( + ensure_binary, + ensure_text_type, + ensure_utf8_encoding, + on_mac, + on_win, + open, +) +from ..common.path import ( + expand, + get_bin_directory_short_path, + get_python_short_path, + get_python_site_packages_short_path, + win_path_ok, +) +from ..exceptions import CondaValueError +from ..gateways.disk.create import copy, mkdir_p +from ..gateways.disk.delete import rm_rf +from ..gateways.disk.link import lexists +from ..gateways.disk.permissions import make_executable +from ..gateways.disk.read import compute_sum +from ..gateways.subprocess import subprocess_call +from .portability import generate_shebang_for_entry_point + +if on_win: # pragma: no cover + import winreg + + from menuinst.knownfolders import FOLDERID, get_folder_path + from menuinst.winshortcut import create_shortcut + + +log = getLogger(__name__) + +CONDA_INITIALIZE_RE_BLOCK = ( + r"^# >>> conda initialize >>>(?:\n|\r\n)" + r"([\s\S]*?)" + r"# <<< conda initialize <<<(?:\n|\r\n)?" +) + +CONDA_INITIALIZE_PS_RE_BLOCK = ( + r"^#region conda initialize(?:\n|\r\n)" r"([\s\S]*?)" r"#endregion(?:\n|\r\n)?" +) + + +class Result: + NEEDS_SUDO = "needs sudo" + MODIFIED = "modified" + NO_CHANGE = "no change" + + +# ##################################################### +# top-level functions +# ##################################################### + + +def install(conda_prefix): + plan = make_install_plan(conda_prefix) + run_plan(plan) + if not context.dry_run: + assert not any(step["result"] == Result.NEEDS_SUDO for step in plan) + print_plan_results(plan) + return 0 + + +def initialize( + conda_prefix, shells, for_user, for_system, anaconda_prompt, reverse=False +): + plan1 = [] + if os.getenv("CONDA_PIP_UNINITIALIZED") == "true": + plan1 = make_install_plan(conda_prefix) + run_plan(plan1) + if not context.dry_run: + run_plan_elevated(plan1) + + plan2 = make_initialize_plan( + conda_prefix, shells, for_user, for_system, anaconda_prompt, reverse=reverse + ) + run_plan(plan2) + if not context.dry_run: + run_plan_elevated(plan2) + + plan = plan1 + plan2 + print_plan_results(plan) + + if any(step["result"] == Result.NEEDS_SUDO for step in plan): + print("Operation failed.", file=sys.stderr) + return 1 + + +def initialize_dev(shell, dev_env_prefix=None, conda_source_root=None): + # > alias conda-dev='eval "$(python -m conda init --dev)"' + # > eval "$(python -m conda init --dev)" + + prefix = expand(dev_env_prefix or sys.prefix) + conda_source_root = expand(conda_source_root or os.getcwd()) + + python_exe, python_version, site_packages_dir = _get_python_info(prefix) + + if not isfile(join(conda_source_root, "conda", "__main__.py")): + raise CondaValueError( + "Directory is not a conda source root: %s" % conda_source_root + ) + + plan = make_install_plan(prefix) + plan.append( + { + "function": remove_conda_in_sp_dir.__name__, + "kwargs": { + "target_path": site_packages_dir, + }, + } + ) + plan.append( + { + "function": make_conda_egg_link.__name__, + "kwargs": { + "target_path": join(site_packages_dir, "conda.egg-link"), + "conda_source_root": conda_source_root, + }, + } + ) + plan.append( + { + "function": modify_easy_install_pth.__name__, + "kwargs": { + "target_path": join(site_packages_dir, "easy-install.pth"), + "conda_source_root": conda_source_root, + }, + } + ) + plan.append( + { + "function": make_dev_egg_info_file.__name__, + "kwargs": { + "target_path": join(conda_source_root, "conda.egg-info"), + }, + } + ) + + run_plan(plan) + + if context.dry_run or context.verbosity: + print_plan_results(plan, sys.stderr) + + if any(step["result"] == Result.NEEDS_SUDO for step in plan): # pragma: no cover + raise CondaError( + "Operation failed. Privileged install disallowed for 'conda init --dev'." + ) + + env_vars = { + "PYTHONHASHSEED": randint(0, 4294967296), + "PYTHON_MAJOR_VERSION": python_version[0], + "TEST_PLATFORM": "win" if on_win else "unix", + } + unset_env_vars = ( + "CONDA_DEFAULT_ENV", + "CONDA_EXE", + "_CE_M", + "_CE_CONDA", + "CONDA_PREFIX", + "CONDA_PREFIX_1", + "CONDA_PREFIX_2", + "CONDA_PYTHON_EXE", + "CONDA_PROMPT_MODIFIER", + "CONDA_SHLVL", + ) + + if shell == "bash": + print("\n".join(_initialize_dev_bash(prefix, env_vars, unset_env_vars))) + elif shell == "cmd.exe": + script = _initialize_dev_cmdexe(prefix, env_vars, unset_env_vars) + if not context.dry_run: + with open("dev-init.bat", "w") as fh: + fh.write("\n".join(script)) + if context.verbosity: + print("\n".join(script)) + print("now run > .\\dev-init.bat") + else: + raise NotImplementedError() + return 0 + + +def _initialize_dev_bash(prefix, env_vars, unset_env_vars): + sys_executable = abspath(sys.executable) + if on_win: + sys_executable = f"$(cygpath '{sys_executable}')" + + # unset/set environment variables + yield from (f"unset {envvar}" for envvar in unset_env_vars) + yield from ( + f"export {envvar}='{value}'" for envvar, value in sorted(env_vars.items()) + ) + + # initialize shell interface + yield f'eval "$("{sys_executable}" -m conda shell.bash hook)"' + + # optionally activate environment + if context.auto_activate_base: + yield f"conda activate '{prefix}'" + + +def _initialize_dev_cmdexe(prefix, env_vars, unset_env_vars): + dev_arg = "" + if context.dev: + dev_arg = "--dev" + condabin = Path(prefix, "condabin") + + yield ( + '@IF NOT "%CONDA_PROMPT_MODIFIER%" == "" ' + '@CALL SET "PROMPT=%%PROMPT:%CONDA_PROMPT_MODIFIER%=%_empty_not_set_%%%"' + ) + + # unset/set environment variables + yield from (f"@SET {envvar}=" for envvar in unset_env_vars) + yield from ( + f'@SET "{envvar}={value}"' for envvar, value in sorted(env_vars.items()) + ) + + # initialize shell interface + yield f'@CALL "{condabin / "conda_hook.bat"}" {dev_arg}' + yield "@IF %ERRORLEVEL% NEQ 0 @EXIT /B %ERRORLEVEL%" + + # optionally activate environment + if context.auto_activate_base: + yield f'@CALL "{condabin / "conda.bat"}" activate {dev_arg} "{prefix}"' + yield "@IF %ERRORLEVEL% NEQ 0 @EXIT /B %ERRORLEVEL%" + + +# ##################################################### +# plan creators +# ##################################################### + + +def make_install_plan(conda_prefix): + try: + python_exe, python_version, site_packages_dir = _get_python_info(conda_prefix) + except OSError: + python_exe, python_version, site_packages_dir = None, None, None # NOQA + + plan = [] + + # ###################################### + # executables + # ###################################### + if on_win: + conda_exe_path = join(conda_prefix, "Scripts", "conda-script.py") + conda_env_exe_path = join(conda_prefix, "Scripts", "conda-env-script.py") + plan.append( + { + "function": make_entry_point_exe.__name__, + "kwargs": { + "target_path": join(conda_prefix, "Scripts", "conda.exe"), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": make_entry_point_exe.__name__, + "kwargs": { + "target_path": join(conda_prefix, "Scripts", "conda-env.exe"), + "conda_prefix": conda_prefix, + }, + } + ) + else: + # We can't put a conda.exe in condabin on Windows. It'll conflict with conda.bat. + plan.append( + { + "function": make_entry_point.__name__, + "kwargs": { + "target_path": join(conda_prefix, "condabin", "conda"), + "conda_prefix": conda_prefix, + "module": "conda.cli", + "func": "main", + }, + } + ) + conda_exe_path = join(conda_prefix, "bin", "conda") + conda_env_exe_path = join(conda_prefix, "bin", "conda-env") + + plan.append( + { + "function": make_entry_point.__name__, + "kwargs": { + "target_path": conda_exe_path, + "conda_prefix": conda_prefix, + "module": "conda.cli", + "func": "main", + }, + } + ) + plan.append( + { + "function": make_entry_point.__name__, + "kwargs": { + "target_path": conda_env_exe_path, + "conda_prefix": conda_prefix, + "module": "conda_env.cli.main", + "func": "main", + }, + } + ) + + # ###################################### + # shell wrappers + # ###################################### + if on_win: + plan.append( + { + "function": install_condabin_conda_bat.__name__, + "kwargs": { + "target_path": join(conda_prefix, "condabin", "conda.bat"), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_library_bin_conda_bat.__name__, + "kwargs": { + "target_path": join(conda_prefix, "Library", "bin", "conda.bat"), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_condabin_conda_activate_bat.__name__, + "kwargs": { + "target_path": join( + conda_prefix, "condabin", "_conda_activate.bat" + ), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_condabin_rename_tmp_bat.__name__, + "kwargs": { + "target_path": join(conda_prefix, "condabin", "rename_tmp.bat"), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_condabin_conda_auto_activate_bat.__name__, + "kwargs": { + "target_path": join( + conda_prefix, "condabin", "conda_auto_activate.bat" + ), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_condabin_hook_bat.__name__, + "kwargs": { + "target_path": join(conda_prefix, "condabin", "conda_hook.bat"), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_Scripts_activate_bat.__name__, + "kwargs": { + "target_path": join(conda_prefix, "Scripts", "activate.bat"), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_activate_bat.__name__, + "kwargs": { + "target_path": join(conda_prefix, "condabin", "activate.bat"), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_deactivate_bat.__name__, + "kwargs": { + "target_path": join(conda_prefix, "condabin", "deactivate.bat"), + "conda_prefix": conda_prefix, + }, + } + ) + + plan.append( + { + "function": install_activate.__name__, + "kwargs": { + "target_path": join( + conda_prefix, get_bin_directory_short_path(), "activate" + ), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_deactivate.__name__, + "kwargs": { + "target_path": join( + conda_prefix, get_bin_directory_short_path(), "deactivate" + ), + "conda_prefix": conda_prefix, + }, + } + ) + + plan.append( + { + "function": install_conda_sh.__name__, + "kwargs": { + "target_path": join(conda_prefix, "etc", "profile.d", "conda.sh"), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_conda_fish.__name__, + "kwargs": { + "target_path": join( + conda_prefix, "etc", "fish", "conf.d", "conda.fish" + ), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_conda_psm1.__name__, + "kwargs": { + "target_path": join(conda_prefix, "shell", "condabin", "Conda.psm1"), + "conda_prefix": conda_prefix, + }, + } + ) + plan.append( + { + "function": install_conda_hook_ps1.__name__, + "kwargs": { + "target_path": join( + conda_prefix, "shell", "condabin", "conda-hook.ps1" + ), + "conda_prefix": conda_prefix, + }, + } + ) + if site_packages_dir: + plan.append( + { + "function": install_conda_xsh.__name__, + "kwargs": { + "target_path": join(site_packages_dir, "xontrib", "conda.xsh"), + "conda_prefix": conda_prefix, + }, + } + ) + else: + print( + "WARNING: Cannot install xonsh wrapper without a python interpreter in prefix: " + "%s" % conda_prefix, + file=sys.stderr, + ) + plan.append( + { + "function": install_conda_csh.__name__, + "kwargs": { + "target_path": join(conda_prefix, "etc", "profile.d", "conda.csh"), + "conda_prefix": conda_prefix, + }, + } + ) + return plan + + +def make_initialize_plan( + conda_prefix, shells, for_user, for_system, anaconda_prompt, reverse=False +): + """ + Creates a plan for initializing conda in shells. + + Bash: + On Linux, when opening the terminal, .bashrc is sourced (because it is an interactive shell). + On macOS on the other hand, the .bash_profile gets sourced by default when executing it in + Terminal.app. Some other programs do the same on macOS so that's why we're initializing conda + in .bash_profile. + On Windows, there are multiple ways to open bash depending on how it was installed. Git Bash, + Cygwin, and MSYS2 all use .bash_profile by default. + + PowerShell: + There's several places PowerShell can store its path, depending on if it's Windows PowerShell, + PowerShell Core on Windows, or PowerShell Core on macOS/Linux. The easiest way to resolve it + is to just ask different possible installations of PowerShell where their profiles are. + """ + plan = make_install_plan(conda_prefix) + shells = set(shells) + if shells & {"bash", "zsh"}: + if "bash" in shells and for_user: + bashrc_path = expand( + join("~", ".bash_profile" if (on_mac or on_win) else ".bashrc") + ) + plan.append( + { + "function": init_sh_user.__name__, + "kwargs": { + "target_path": bashrc_path, + "conda_prefix": conda_prefix, + "shell": "bash", + "reverse": reverse, + }, + } + ) + + if "zsh" in shells and for_user: + if "ZDOTDIR" in os.environ: + zshrc_path = expand(join("$ZDOTDIR", ".zshrc")) + else: + zshrc_path = expand(join("~", ".zshrc")) + plan.append( + { + "function": init_sh_user.__name__, + "kwargs": { + "target_path": zshrc_path, + "conda_prefix": conda_prefix, + "shell": "zsh", + "reverse": reverse, + }, + } + ) + + if for_system: + plan.append( + { + "function": init_sh_system.__name__, + "kwargs": { + "target_path": "/etc/profile.d/conda.sh", + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + + if "fish" in shells: + if for_user: + config_fish_path = expand(join("~", ".config", "fish", "config.fish")) + plan.append( + { + "function": init_fish_user.__name__, + "kwargs": { + "target_path": config_fish_path, + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + + if for_system: + config_fish_path = expand(join("~", ".config", "fish", "config.fish")) + plan.append( + { + "function": init_fish_user.__name__, + "kwargs": { + "target_path": config_fish_path, + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + + if "xonsh" in shells: + if for_user: + config_xonsh_path = expand(join("~", ".xonshrc")) + plan.append( + { + "function": init_xonsh_user.__name__, + "kwargs": { + "target_path": config_xonsh_path, + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + + if for_system: + if on_win: + config_xonsh_path = expand( + join("%ALLUSERSPROFILE%", "xonsh", "xonshrc") + ) + else: + config_xonsh_path = "/etc/xonshrc" + plan.append( + { + "function": init_xonsh_user.__name__, + "kwargs": { + "target_path": config_xonsh_path, + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + + if "tcsh" in shells and for_user: + tcshrc_path = expand(join("~", ".tcshrc")) + plan.append( + { + "function": init_sh_user.__name__, + "kwargs": { + "target_path": tcshrc_path, + "conda_prefix": conda_prefix, + "shell": "tcsh", + "reverse": reverse, + }, + } + ) + + if "powershell" in shells: + if for_user: + profile = "$PROFILE.CurrentUserAllHosts" + + if for_system: + profile = "$PROFILE.AllUsersAllHosts" + + def find_powershell_paths(*exe_names): + for exe_name in exe_names: + try: + yield subprocess_call( + (exe_name, "-NoProfile", "-Command", profile) + ).stdout.strip() + except Exception: + pass + + config_powershell_paths = set( + find_powershell_paths("powershell", "pwsh", "pwsh-preview") + ) + + for config_path in config_powershell_paths: + if config_path is not None: + plan.append( + { + "function": init_powershell_user.__name__, + "kwargs": { + "target_path": config_path, + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + + if "cmd.exe" in shells: + if for_user: + plan.append( + { + "function": init_cmd_exe_registry.__name__, + "kwargs": { + "target_path": "HKEY_CURRENT_USER\\Software\\Microsoft\\" + "Command Processor\\AutoRun", + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + if for_system: + plan.append( + { + "function": init_cmd_exe_registry.__name__, + "kwargs": { + "target_path": "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\" + "Command Processor\\AutoRun", + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + # it would be nice to enable this on a user-level basis, but unfortunately, it is + # a system-level key only. + plan.append( + { + "function": init_long_path.__name__, + "kwargs": { + "target_path": "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\" + "FileSystem\\LongPathsEnabled" + }, + } + ) + if anaconda_prompt: + plan.append( + { + "function": install_anaconda_prompt.__name__, + "kwargs": { + "target_path": join( + conda_prefix, "condabin", "Anaconda Prompt.lnk" + ), + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + if on_win: + desktop_dir, exception = get_folder_path(FOLDERID.Desktop) + assert not exception + else: + desktop_dir = join(expanduser("~"), "Desktop") + plan.append( + { + "function": install_anaconda_prompt.__name__, + "kwargs": { + "target_path": join(desktop_dir, "Anaconda Prompt.lnk"), + "conda_prefix": conda_prefix, + "reverse": reverse, + }, + } + ) + + return plan + + +# ##################################################### +# plan runners +# ##################################################### + + +def run_plan(plan): + for step in plan: + previous_result = step.get("result", None) + if previous_result in (Result.MODIFIED, Result.NO_CHANGE): + continue + try: + result = globals()[step["function"]]( + *step.get("args", ()), **step.get("kwargs", {}) + ) + except OSError as e: + log.info("%s: %r", step["function"], e, exc_info=True) + result = Result.NEEDS_SUDO + step["result"] = result + + +def run_plan_elevated(plan): + """ + The strategy of this function differs between unix and Windows. Both strategies use a + subprocess call, where the subprocess is run with elevated privileges. The executable + invoked with the subprocess is `python -m conda.core.initialize`, so see the + `if __name__ == "__main__"` at the bottom of this module. + + For unix platforms, we convert the plan list to json, and then call this module with + `sudo python -m conda.core.initialize` while piping the plan json to stdin. We collect json + from stdout for the results of the plan execution with elevated privileges. + + For Windows, we create a temporary file that holds the json content of the plan. The + subprocess reads the content of the file, modifies the content of the file with updated + execution status, and then closes the file. This process then reads the content of that file + for the individual operation execution results, and then deletes the file. + """ + if any(step["result"] == Result.NEEDS_SUDO for step in plan): + if on_win: + from ..common._os.windows import run_as_admin + + temp_path = None + try: + with Utf8NamedTemporaryFile("w+", suffix=".json", delete=False) as tf: + # the default mode is 'w+b', and universal new lines don't work in that mode + tf.write( + json.dumps( + plan, ensure_ascii=False, default=lambda x: x.__dict__ + ) + ) + temp_path = tf.name + python_exe = '"%s"' % abspath(sys.executable) + hinstance, error_code = run_as_admin( + (python_exe, "-m", "conda.core.initialize", '"%s"' % temp_path) + ) + if error_code is not None: + print( + "ERROR during elevated execution.\n rc: %s" % error_code, + file=sys.stderr, + ) + + with open(temp_path) as fh: + _plan = json.loads(ensure_text_type(fh.read())) + + finally: + if temp_path and lexists(temp_path): + rm_rf(temp_path) + + else: + stdin = json.dumps(plan, ensure_ascii=False, default=lambda x: x.__dict__) + result = subprocess_call( + "sudo %s -m conda.core.initialize" % sys.executable, + env={}, + path=os.getcwd(), + stdin=stdin, + ) + stderr = result.stderr.strip() + if stderr: + print(stderr, file=sys.stderr) + _plan = json.loads(result.stdout.strip()) + + del plan[:] + plan.extend(_plan) + + +def run_plan_from_stdin(): + stdin = sys.stdin.read().strip() + plan = json.loads(stdin) + run_plan(plan) + sys.stdout.write(json.dumps(plan)) + + +def run_plan_from_temp_file(temp_path): + with open(temp_path) as fh: + plan = json.loads(ensure_text_type(fh.read())) + run_plan(plan) + with open(temp_path, "w+b") as fh: + fh.write(ensure_binary(json.dumps(plan, ensure_ascii=False))) + + +def print_plan_results(plan, stream=None): + if not stream: + stream = sys.stdout + for step in plan: + print( + "%-14s%s" % (step.get("result"), step["kwargs"]["target_path"]), file=stream + ) + + changed = any(step.get("result") == Result.MODIFIED for step in plan) + if changed: + print( + "\n==> For changes to take effect, close and re-open your current shell. <==\n", + file=stream, + ) + else: + print("No action taken.", file=stream) + + +# ##################################################### +# individual operations +# ##################################################### + + +def make_entry_point(target_path, conda_prefix, module, func): + # 'ep' in this function refers to 'entry point' + # target_path: join(conda_prefix, 'bin', 'conda') + conda_ep_path = target_path + + if isfile(conda_ep_path): + with open(conda_ep_path) as fh: + original_ep_content = fh.read() + else: + original_ep_content = "" + + if on_win: + # no shebang needed on windows + new_ep_content = "" + else: + python_path = join(conda_prefix, get_python_short_path()) + new_ep_content = generate_shebang_for_entry_point( + python_path, with_usr_bin_env=True + ) + + conda_extra = dals( + """ + # Before any more imports, leave cwd out of sys.path for internal 'conda shell.*' commands. + # see https://github.com/conda/conda/issues/6549 + if len(sys.argv) > 1 and sys.argv[1].startswith('shell.') and sys.path and sys.path[0] == '': + # The standard first entry in sys.path is an empty string, + # and os.path.abspath('') expands to os.getcwd(). + del sys.path[0] + """ + ) + + new_ep_content += ( + dals( + """ + # -*- coding: utf-8 -*- + import sys + %(extra)s + if __name__ == '__main__': + from %(module)s import %(func)s + sys.exit(%(func)s()) + """ + ) + % { + "extra": conda_extra if module == "conda.cli" else "", + "module": module, + "func": func, + } + ) + + if new_ep_content != original_ep_content: + if context.verbosity: + print("\n") + print(target_path) + print(make_diff(original_ep_content, new_ep_content)) + if not context.dry_run: + mkdir_p(dirname(conda_ep_path)) + with open(conda_ep_path, "w") as fdst: + fdst.write(new_ep_content) + if not on_win: + make_executable(conda_ep_path) + return Result.MODIFIED + else: + return Result.NO_CHANGE + + +def make_entry_point_exe(target_path, conda_prefix): + # target_path: join(conda_prefix, 'Scripts', 'conda.exe') + exe_path = target_path + bits = 8 * struct.calcsize("P") + source_exe_path = join(CONDA_PACKAGE_ROOT, "shell", "cli-%d.exe" % bits) + if isfile(exe_path): + if compute_sum(exe_path, "md5") == compute_sum(source_exe_path, "md5"): + return Result.NO_CHANGE + + if not context.dry_run: + if not isdir(dirname(exe_path)): + mkdir_p(dirname(exe_path)) + # prefer copy() over create_hard_link_or_copy() because of windows file deletion issues + # with open processes + copy(source_exe_path, exe_path) + return Result.MODIFIED + + +def install_anaconda_prompt(target_path, conda_prefix, reverse): + # target_path: join(conda_prefix, 'condabin', 'Anaconda Prompt.lnk') + # target: join(os.environ["HOMEPATH"], "Desktop", "Anaconda Prompt.lnk") + icon_path = join(CONDA_PACKAGE_ROOT, "shell", "conda_icon.ico") + target = join(os.environ["HOMEPATH"], "Desktop", "Anaconda Prompt.lnk") + + args = ( + "/K", + '""{}" && "{}""'.format( + join(conda_prefix, "condabin", "conda_hook.bat"), + join(conda_prefix, "condabin", "conda_auto_activate.bat"), + ), + ) + # The API for the call to 'create_shortcut' has 3 + # required arguments (path, description, filename) + # and 4 optional ones (args, working_dir, icon_path, icon_index). + result = Result.NO_CHANGE + if not context.dry_run: + create_shortcut( + "%windir%\\System32\\cmd.exe", + "Anconda Prompt", + "" + target_path, + " ".join(args), + "" + expanduser("~"), + "" + icon_path, + ) + result = Result.MODIFIED + if reverse: + if os.path.isfile(target): + os.remove(target) + result = Result.MODIFIED + return result + + +def _install_file(target_path, file_content): + if isfile(target_path): + with open(target_path) as fh: + original_content = fh.read() + else: + original_content = "" + + new_content = file_content + + if new_content != original_content: + if context.verbosity: + print("\n") + print(target_path) + print(make_diff(original_content, new_content)) + if not context.dry_run: + mkdir_p(dirname(target_path)) + with open(target_path, "w") as fdst: + fdst.write(new_content) + return Result.MODIFIED + else: + return Result.NO_CHANGE + + +def install_conda_sh(target_path, conda_prefix): + # target_path: join(conda_prefix, 'etc', 'profile.d', 'conda.sh') + file_content = PosixActivator().hook(auto_activate_base=False) + return _install_file(target_path, file_content) + + +def install_Scripts_activate_bat(target_path, conda_prefix): + # target_path: join(conda_prefix, 'Scripts', 'activate.bat') + src_path = join(CONDA_PACKAGE_ROOT, "shell", "Scripts", "activate.bat") + with open(src_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_activate_bat(target_path, conda_prefix): + # target_path: join(conda_prefix, 'condabin', 'activate.bat') + src_path = join(CONDA_PACKAGE_ROOT, "shell", "condabin", "activate.bat") + with open(src_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_deactivate_bat(target_path, conda_prefix): + # target_path: join(conda_prefix, 'condabin', 'deactivate.bat') + src_path = join(CONDA_PACKAGE_ROOT, "shell", "condabin", "deactivate.bat") + with open(src_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_activate(target_path, conda_prefix): + # target_path: join(conda_prefix, get_bin_directory_short_path(), 'activate') + src_path = join(CONDA_PACKAGE_ROOT, "shell", "bin", "activate") + file_content = ("#!/bin/sh\n" '_CONDA_ROOT="%s"\n') % conda_prefix + with open(src_path) as fsrc: + file_content += fsrc.read() + return _install_file(target_path, file_content) + + +def install_deactivate(target_path, conda_prefix): + # target_path: join(conda_prefix, get_bin_directory_short_path(), 'deactivate') + src_path = join(CONDA_PACKAGE_ROOT, "shell", "bin", "deactivate") + file_content = ("#!/bin/sh\n" '_CONDA_ROOT="%s"\n') % conda_prefix + with open(src_path) as fsrc: + file_content += fsrc.read() + return _install_file(target_path, file_content) + + +def install_condabin_conda_bat(target_path, conda_prefix): + # target_path: join(conda_prefix, 'condabin', 'conda.bat') + conda_bat_src_path = join(CONDA_PACKAGE_ROOT, "shell", "condabin", "conda.bat") + with open(conda_bat_src_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_library_bin_conda_bat(target_path, conda_prefix): + # target_path: join(conda_prefix, 'Library', 'bin', 'conda.bat') + conda_bat_src_path = join( + CONDA_PACKAGE_ROOT, "shell", "Library", "bin", "conda.bat" + ) + with open(conda_bat_src_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_condabin_conda_activate_bat(target_path, conda_prefix): + # target_path: join(conda_prefix, 'condabin', '_conda_activate.bat') + conda_bat_src_path = join( + CONDA_PACKAGE_ROOT, "shell", "condabin", "_conda_activate.bat" + ) + with open(conda_bat_src_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_condabin_rename_tmp_bat(target_path, conda_prefix): + # target_path: join(conda_prefix, 'condabin', 'rename_tmp.bat') + conda_bat_src_path = join(CONDA_PACKAGE_ROOT, "shell", "condabin", "rename_tmp.bat") + with open(conda_bat_src_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_condabin_conda_auto_activate_bat(target_path, conda_prefix): + # target_path: join(conda_prefix, 'condabin', 'conda_auto_activate.bat') + conda_bat_src_path = join( + CONDA_PACKAGE_ROOT, "shell", "condabin", "conda_auto_activate.bat" + ) + with open(conda_bat_src_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_condabin_hook_bat(target_path, conda_prefix): + # target_path: join(conda_prefix, 'condabin', 'conda_hook.bat') + conda_bat_src_path = join(CONDA_PACKAGE_ROOT, "shell", "condabin", "conda_hook.bat") + with open(conda_bat_src_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_conda_fish(target_path, conda_prefix): + # target_path: join(conda_prefix, 'etc', 'fish', 'conf.d', 'conda.fish') + file_content = FishActivator().hook(auto_activate_base=False) + return _install_file(target_path, file_content) + + +def install_conda_psm1(target_path, conda_prefix): + # target_path: join(conda_prefix, 'shell', 'condabin', 'Conda.psm1') + conda_psm1_path = join(CONDA_PACKAGE_ROOT, "shell", "condabin", "Conda.psm1") + with open(conda_psm1_path) as fsrc: + file_content = fsrc.read() + return _install_file(target_path, file_content) + + +def install_conda_hook_ps1(target_path, conda_prefix): + # target_path: join(conda_prefix, 'shell', 'condabin', 'conda-hook.ps1') + file_content = PowerShellActivator().hook(auto_activate_base=False) + return _install_file(target_path, file_content) + + +def install_conda_xsh(target_path, conda_prefix): + # target_path: join(site_packages_dir, 'xonsh', 'conda.xsh') + file_content = XonshActivator().hook(auto_activate_base=False) + return _install_file(target_path, file_content) + + +def install_conda_csh(target_path, conda_prefix): + # target_path: join(conda_prefix, 'etc', 'profile.d', 'conda.csh') + file_content = CshActivator().hook(auto_activate_base=False) + return _install_file(target_path, file_content) + + +def _config_fish_content(conda_prefix): + if on_win: + from ..activate import native_path_to_unix + + conda_exe = native_path_to_unix(join(conda_prefix, "Scripts", "conda.exe")) + else: + conda_exe = join(conda_prefix, "bin", "conda") + conda_initialize_content = ( + dals( + """ + # >>> conda initialize >>> + # !! Contents within this block are managed by 'conda init' !! + if test -f %(conda_exe)s + eval %(conda_exe)s "shell.fish" "hook" $argv | source + end + # <<< conda initialize <<< + """ + ) + % { + "conda_exe": conda_exe, + } + ) + return conda_initialize_content + + +def init_fish_user(target_path, conda_prefix, reverse): + # target_path: ~/.config/config.fish + user_rc_path = target_path + + try: + with open(user_rc_path) as fh: + rc_content = fh.read() + except FileNotFoundError: + rc_content = "" + except: + raise + + rc_original_content = rc_content + + conda_init_comment = "# commented out by conda initialize" + conda_initialize_content = _config_fish_content(conda_prefix) + if reverse: + # uncomment any lines that were commented by prior conda init run + rc_content = re.sub( + rf"#\s(.*?)\s*{conda_init_comment}", + r"\1", + rc_content, + flags=re.MULTILINE, + ) + + # remove any conda init sections added + rc_content = re.sub( + r"^\s*" + CONDA_INITIALIZE_RE_BLOCK, + "", + rc_content, + flags=re.DOTALL | re.MULTILINE, + ) + else: + if not on_win: + rc_content = re.sub( + r"^[ \t]*?(set -gx PATH ([\'\"]?).*?%s\/bin\2 [^\n]*?\$PATH)" + r"" % basename(conda_prefix), + rf"# \1 {conda_init_comment}", + rc_content, + flags=re.MULTILINE, + ) + + rc_content = re.sub( + r"^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*etc\/fish\/conf\.d\/conda\.fish.*?)\n" + r"(conda activate.*?)$", + r"# \1 {0}\n# \2 {0}".format(conda_init_comment), + rc_content, + flags=re.MULTILINE, + ) + rc_content = re.sub( + r"^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*etc\/fish\/conda\.d\/conda\.fish.*?)$", + rf"# \1 {conda_init_comment}", + rc_content, + flags=re.MULTILINE, + ) + + replace_str = "__CONDA_REPLACE_ME_123__" + rc_content = re.sub( + CONDA_INITIALIZE_RE_BLOCK, + replace_str, + rc_content, + flags=re.MULTILINE, + ) + # TODO: maybe remove all but last of replace_str, if there's more than one occurrence + rc_content = rc_content.replace(replace_str, conda_initialize_content) + + if "# >>> conda initialize >>>" not in rc_content: + rc_content += "\n%s\n" % conda_initialize_content + + if rc_content != rc_original_content: + if context.verbosity: + print("\n") + print(target_path) + print(make_diff(rc_original_content, rc_content)) + if not context.dry_run: + # Make the directory if needed. + if not exists(dirname(user_rc_path)): + mkdir_p(dirname(user_rc_path)) + with open(user_rc_path, "w") as fh: + fh.write(rc_content) + return Result.MODIFIED + else: + return Result.NO_CHANGE + + +def _config_xonsh_content(conda_prefix): + if on_win: + from ..activate import native_path_to_unix + + conda_exe = native_path_to_unix(join(conda_prefix, "Scripts", "conda.exe")) + else: + conda_exe = join(conda_prefix, "bin", "conda") + conda_initialize_content = dals( + """ + # >>> conda initialize >>> + # !! Contents within this block are managed by 'conda init' !! + if !(test -f "{conda_exe}"): + import sys as _sys + from types import ModuleType as _ModuleType + _mod = _ModuleType("xontrib.conda", + "Autogenerated from $({conda_exe} shell.xonsh hook)") + __xonsh__.execer.exec($("{conda_exe}" "shell.xonsh" "hook"), + glbs=_mod.__dict__, + filename="$({conda_exe} shell.xonsh hook)") + _sys.modules["xontrib.conda"] = _mod + del _sys, _mod, _ModuleType + # <<< conda initialize <<< + """ + ).format(conda_exe=conda_exe) + return conda_initialize_content + + +def init_xonsh_user(target_path, conda_prefix, reverse): + # target_path: ~/.xonshrc + user_rc_path = target_path + + try: + with open(user_rc_path) as fh: + rc_content = fh.read() + except FileNotFoundError: + rc_content = "" + except: + raise + + rc_original_content = rc_content + + conda_init_comment = "# commented out by conda initialize" + conda_initialize_content = _config_xonsh_content(conda_prefix) + if reverse: + # uncomment any lines that were commented by prior conda init run + rc_content = re.sub( + rf"#\s(.*?)\s*{conda_init_comment}", + r"\1", + rc_content, + flags=re.MULTILINE, + ) + + # remove any conda init sections added + rc_content = re.sub( + r"^\s*" + CONDA_INITIALIZE_RE_BLOCK, + "", + rc_content, + flags=re.DOTALL | re.MULTILINE, + ) + else: + replace_str = "__CONDA_REPLACE_ME_123__" + rc_content = re.sub( + CONDA_INITIALIZE_RE_BLOCK, + replace_str, + rc_content, + flags=re.MULTILINE, + ) + # TODO: maybe remove all but last of replace_str, if there's more than one occurrence + rc_content = rc_content.replace(replace_str, conda_initialize_content) + + if "# >>> conda initialize >>>" not in rc_content: + rc_content += f"\n{conda_initialize_content}\n" + + if rc_content != rc_original_content: + if context.verbosity: + print("\n") + print(target_path) + print(make_diff(rc_original_content, rc_content)) + if not context.dry_run: + # Make the directory if needed. + if not exists(dirname(user_rc_path)): + mkdir_p(dirname(user_rc_path)) + with open(user_rc_path, "w") as fh: + fh.write(rc_content) + return Result.MODIFIED + else: + return Result.NO_CHANGE + + +def _bashrc_content(conda_prefix, shell): + if on_win: + from ..activate import native_path_to_unix + + conda_exe = native_path_to_unix(join(conda_prefix, "Scripts", "conda.exe")) + conda_initialize_content = ( + dals( + """ + # >>> conda initialize >>> + # !! Contents within this block are managed by 'conda init' !! + if [ -f '%(conda_exe)s' ]; then + eval "$('%(conda_exe)s' 'shell.%(shell)s' 'hook')" + fi + # <<< conda initialize <<< + """ + ) + % { + "conda_exe": conda_exe, + "shell": shell, + } + ) + else: + conda_exe = join(conda_prefix, "bin", "conda") + if shell in ("csh", "tcsh"): + conda_initialize_content = ( + dals( + """ + # >>> conda initialize >>> + # !! Contents within this block are managed by 'conda init' !! + if ( -f "%(conda_prefix)s/etc/profile.d/conda.csh" ) then + source "%(conda_prefix)s/etc/profile.d/conda.csh" + else + setenv PATH "%(conda_bin)s:$PATH" + endif + # <<< conda initialize <<< + """ + ) + % { + "conda_exe": conda_exe, + "shell": shell, + "conda_bin": dirname(conda_exe), + "conda_prefix": conda_prefix, + } + ) + else: + conda_initialize_content = ( + dals( + """ + # >>> conda initialize >>> + # !! Contents within this block are managed by 'conda init' !! + __conda_setup="$('%(conda_exe)s' 'shell.%(shell)s' 'hook' 2> /dev/null)" + if [ $? -eq 0 ]; then + eval "$__conda_setup" + else + if [ -f "%(conda_prefix)s/etc/profile.d/conda.sh" ]; then + . "%(conda_prefix)s/etc/profile.d/conda.sh" + else + export PATH="%(conda_bin)s:$PATH" + fi + fi + unset __conda_setup + # <<< conda initialize <<< + """ + ) + % { + "conda_exe": conda_exe, + "shell": shell, + "conda_bin": dirname(conda_exe), + "conda_prefix": conda_prefix, + } + ) + return conda_initialize_content + + +def init_sh_user(target_path, conda_prefix, shell, reverse=False): + # target_path: ~/.bash_profile + user_rc_path = target_path + + try: + with open(user_rc_path) as fh: + rc_content = fh.read() + except FileNotFoundError: + rc_content = "" + except: + raise + + rc_original_content = rc_content + + conda_initialize_content = _bashrc_content(conda_prefix, shell) + conda_init_comment = "# commented out by conda initialize" + + if reverse: + # uncomment any lines that were commented by prior conda init run + rc_content = re.sub( + rf"#\s(.*?)\s*{conda_init_comment}", + r"\1", + rc_content, + flags=re.MULTILINE, + ) + + # remove any conda init sections added + rc_content = re.sub( + r"^\s*" + CONDA_INITIALIZE_RE_BLOCK, + "", + rc_content, + flags=re.DOTALL | re.MULTILINE, + ) + else: + if not on_win: + rc_content = re.sub( + r"^[ \t]*?(export PATH=[\'\"].*?%s\/bin:\$PATH[\'\"])" + r"" % basename(conda_prefix), + rf"# \1 {conda_init_comment}", + rc_content, + flags=re.MULTILINE, + ) + + rc_content = re.sub( + r"^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*etc\/profile\.d\/conda\.sh.*?)\n" + r"(conda activate.*?)$", + r"# \1 {0}\n# \2 {0}".format(conda_init_comment), + rc_content, + flags=re.MULTILINE, + ) + rc_content = re.sub( + r"^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*etc\/profile\.d\/conda\.sh.*?)$", + rf"# \1 {conda_init_comment}", + rc_content, + flags=re.MULTILINE, + ) + + if on_win: + rc_content = re.sub( + r"^[ \t]*^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*Scripts[/\\]activate.*?)$", + r"# \1 # commented out by conda initialize", + rc_content, + flags=re.MULTILINE, + ) + else: + rc_content = re.sub( + r"^[ \t]*^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*bin/activate.*?)$", + r"# \1 # commented out by conda initialize", + rc_content, + flags=re.MULTILINE, + ) + + replace_str = "__CONDA_REPLACE_ME_123__" + rc_content = re.sub( + CONDA_INITIALIZE_RE_BLOCK, + replace_str, + rc_content, + flags=re.MULTILINE, + ) + # TODO: maybe remove all but last of replace_str, if there's more than one occurrence + rc_content = rc_content.replace(replace_str, conda_initialize_content) + + if "# >>> conda initialize >>>" not in rc_content: + rc_content += "\n%s\n" % conda_initialize_content + + if rc_content != rc_original_content: + if context.verbosity: + print("\n") + print(target_path) + print(make_diff(rc_original_content, rc_content)) + if not context.dry_run: + with open(user_rc_path, "w") as fh: + fh.write(rc_content) + return Result.MODIFIED + else: + return Result.NO_CHANGE + + +def init_sh_system(target_path, conda_prefix, reverse=False): + # target_path: '/etc/profile.d/conda.sh' + conda_sh_system_path = target_path + + if exists(conda_sh_system_path): + with open(conda_sh_system_path) as fh: + conda_sh_system_contents = fh.read() + else: + conda_sh_system_contents = "" + if reverse: + if exists(conda_sh_system_path): + os.remove(conda_sh_system_path) + return Result.MODIFIED + else: + conda_sh_contents = _bashrc_content(conda_prefix, "posix") + if conda_sh_system_contents != conda_sh_contents: + if context.verbosity: + print("\n") + print(target_path) + print(make_diff(conda_sh_contents, conda_sh_system_contents)) + if not context.dry_run: + if lexists(conda_sh_system_path): + rm_rf(conda_sh_system_path) + mkdir_p(dirname(conda_sh_system_path)) + with open(conda_sh_system_path, "w") as fh: + fh.write(conda_sh_contents) + return Result.MODIFIED + return Result.NO_CHANGE + + +def _read_windows_registry(target_path): # pragma: no cover + # HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun + # HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun + # returns value_value, value_type -or- None, None if target does not exist + main_key, the_rest = target_path.split("\\", 1) + subkey_str, value_name = the_rest.rsplit("\\", 1) + main_key = getattr(winreg, main_key) + + try: + key = winreg.OpenKey(main_key, subkey_str, 0, winreg.KEY_READ) + except OSError as e: + if e.errno != ENOENT: + raise + return None, None + + try: + value_tuple = winreg.QueryValueEx(key, value_name) + value_value = value_tuple[0] + if isinstance(value_value, str): + value_value = value_value.strip() + value_type = value_tuple[1] + return value_value, value_type + except Exception: + # [WinError 2] The system cannot find the file specified + winreg.CloseKey(key) + return None, None + finally: + winreg.CloseKey(key) + + +def _write_windows_registry(target_path, value_value, value_type): # pragma: no cover + main_key, the_rest = target_path.split("\\", 1) + subkey_str, value_name = the_rest.rsplit("\\", 1) + main_key = getattr(winreg, main_key) + try: + key = winreg.OpenKey(main_key, subkey_str, 0, winreg.KEY_WRITE) + except OSError as e: + if e.errno != ENOENT: + raise + key = winreg.CreateKey(main_key, subkey_str) + try: + winreg.SetValueEx(key, value_name, 0, value_type, value_value) + finally: + winreg.CloseKey(key) + + +def init_cmd_exe_registry(target_path, conda_prefix, reverse=False): + # HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun + # HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun + + prev_value, value_type = _read_windows_registry(target_path) + if prev_value is None: + prev_value = "" + value_type = winreg.REG_EXPAND_SZ + + old_hook_path = '"{}"'.format(join(conda_prefix, "condabin", "conda_hook.bat")) + new_hook = "if exist {hp} {hp}".format(hp=old_hook_path) + if reverse: + # we can't just reset it to None and remove it, because there may be other contents here. + # We need to strip out our part, and if there's nothing left, remove the key. + # Break up string by parts joined with "&" + autorun_parts = prev_value.split("&") + autorun_parts = [part.strip() for part in autorun_parts if new_hook not in part] + # We must remove the old hook path too if it is there + autorun_parts = [ + part.strip() for part in autorun_parts if old_hook_path not in part + ] + new_value = " & ".join(autorun_parts) + else: + replace_str = "__CONDA_REPLACE_ME_123__" + # Replace new (if exist checked) hook + new_value = re.sub( + r"(if exist \"[^\"]*?conda[-_]hook\.bat\" \"[^\"]*?conda[-_]hook\.bat\")", + replace_str, + prev_value, + count=1, + flags=re.IGNORECASE | re.UNICODE, + ) + # Replace old hook + new_value = re.sub( + r"(\"[^\"]*?conda[-_]hook\.bat\")", + replace_str, + new_value, + flags=re.IGNORECASE | re.UNICODE, + ) + + # Fold repeats of 'HOOK & HOOK' + new_value_2 = new_value.replace(replace_str + " & " + replace_str, replace_str) + while new_value_2 != new_value: + new_value = new_value_2 + new_value_2 = new_value.replace( + replace_str + " & " + replace_str, replace_str + ) + new_value = new_value_2.replace(replace_str, new_hook) + if new_hook not in new_value: + if new_value: + new_value += " & " + new_hook + else: + new_value = new_hook + + if prev_value != new_value: + if context.verbosity: + print("\n") + print(target_path) + print(make_diff(prev_value, new_value)) + if not context.dry_run: + _write_windows_registry(target_path, new_value, value_type) + return Result.MODIFIED + else: + return Result.NO_CHANGE + + +def init_long_path(target_path): + win_ver, _, win_rev = context.os_distribution_name_version[1].split(".") + # win10, build 14352 was the first preview release that supported this + if int(win_ver) >= 10 and int(win_rev) >= 14352: + prev_value, value_type = _read_windows_registry(target_path) + if str(prev_value) != "1": + if context.verbosity: + print("\n") + print(target_path) + print(make_diff(str(prev_value), "1")) + if not context.dry_run: + _write_windows_registry(target_path, 1, winreg.REG_DWORD) + return Result.MODIFIED + else: + return Result.NO_CHANGE + else: + if context.verbosity: + print("\n") + print( + "Not setting long path registry key; Windows version must be at least 10 with " + 'the fall 2016 "Anniversary update" or newer.' + ) + return Result.NO_CHANGE + + +def _powershell_profile_content(conda_prefix): + if on_win: + conda_exe = join(conda_prefix, "Scripts", "conda.exe") + else: + conda_exe = join(conda_prefix, "bin", "conda") + + conda_powershell_module = dals( + """ + #region conda initialize + # !! Contents within this block are managed by 'conda init' !! + If (Test-Path "{conda_exe}") {{ + (& "{conda_exe}" "shell.powershell" "hook") | Out-String | ?{{$_}} | Invoke-Expression + }} + #endregion + """.format( + conda_exe=conda_exe + ) + ) + + return conda_powershell_module + + +def init_powershell_user(target_path, conda_prefix, reverse): + # target_path: $PROFILE + profile_path = target_path + + # NB: the user may not have created a profile. We need to check + # if the file exists first. + if os.path.exists(profile_path): + with open(profile_path) as fp: + profile_content = fp.read() + else: + profile_content = "" + + profile_original_content = profile_content + + # TODO: comment out old ipmos and Import-Modules. + + if reverse: + profile_content = re.sub( + CONDA_INITIALIZE_PS_RE_BLOCK, + "", + profile_content, + count=1, + flags=re.DOTALL | re.MULTILINE, + ) + else: + # Find what content we need to add. + conda_initialize_content = _powershell_profile_content(conda_prefix) + + if "#region conda initialize" not in profile_content: + profile_content += f"\n{conda_initialize_content}\n" + else: + profile_content = re.sub( + CONDA_INITIALIZE_PS_RE_BLOCK, + "__CONDA_REPLACE_ME_123__", + profile_content, + count=1, + flags=re.DOTALL | re.MULTILINE, + ).replace("__CONDA_REPLACE_ME_123__", conda_initialize_content) + + if profile_content != profile_original_content: + if context.verbosity: + print("\n") + print(target_path) + print(make_diff(profile_original_content, profile_content)) + if not context.dry_run: + # Make the directory if needed. + if not exists(dirname(profile_path)): + mkdir_p(dirname(profile_path)) + with open(profile_path, "w") as fp: + fp.write(profile_content) + return Result.MODIFIED + else: + return Result.NO_CHANGE + + +def remove_conda_in_sp_dir(target_path): + # target_path: site_packages_dir + modified = False + site_packages_dir = target_path + rm_rf_these = chain.from_iterable( + ( + glob(join(site_packages_dir, "conda-*info")), + glob(join(site_packages_dir, "conda.*")), + glob(join(site_packages_dir, "conda-*.egg")), + ) + ) + rm_rf_these = (p for p in rm_rf_these if not p.endswith("conda.egg-link")) + for fn in rm_rf_these: + print("rm -rf %s" % join(site_packages_dir, fn), file=sys.stderr) + if not context.dry_run: + rm_rf(join(site_packages_dir, fn)) + modified = True + others = ( + "conda", + "conda_env", + ) + for other in others: + path = join(site_packages_dir, other) + if lexists(path): + print("rm -rf %s" % path, file=sys.stderr) + if not context.dry_run: + rm_rf(path) + modified = True + if modified: + return Result.MODIFIED + else: + return Result.NO_CHANGE + + +def make_conda_egg_link(target_path, conda_source_root): + # target_path: join(site_packages_dir, 'conda.egg-link') + conda_egg_link_contents = conda_source_root + os.linesep + + if isfile(target_path): + with open(target_path, "rb") as fh: + conda_egg_link_contents_old = fh.read() + else: + conda_egg_link_contents_old = "" + + if conda_egg_link_contents_old != conda_egg_link_contents: + if context.verbosity: + print("\n", file=sys.stderr) + print(target_path, file=sys.stderr) + print( + make_diff(conda_egg_link_contents_old, conda_egg_link_contents), + file=sys.stderr, + ) + if not context.dry_run: + with open(target_path, "wb") as fh: + fh.write(ensure_utf8_encoding(conda_egg_link_contents)) + return Result.MODIFIED + else: + return Result.NO_CHANGE + + +def modify_easy_install_pth(target_path, conda_source_root): + # target_path: join(site_packages_dir, 'easy-install.pth') + easy_install_new_line = conda_source_root + + if isfile(target_path): + with open(target_path) as fh: + old_contents = fh.read() + else: + old_contents = "" + + old_contents_lines = old_contents.splitlines() + if easy_install_new_line in old_contents_lines: + return Result.NO_CHANGE + + ln_end = os.sep + "conda" + old_contents_lines = tuple( + ln for ln in old_contents_lines if not ln.endswith(ln_end) + ) + new_contents = ( + easy_install_new_line + + os.linesep + + os.linesep.join(old_contents_lines) + + os.linesep + ) + + if context.verbosity: + print("\n", file=sys.stderr) + print(target_path, file=sys.stderr) + print(make_diff(old_contents, new_contents), file=sys.stderr) + if not context.dry_run: + with open(target_path, "wb") as fh: + fh.write(ensure_utf8_encoding(new_contents)) + return Result.MODIFIED + + +def make_dev_egg_info_file(target_path): + # target_path: join(conda_source_root, 'conda.egg-info') + + if isfile(target_path): + with open(target_path) as fh: + old_contents = fh.read() + else: + old_contents = "" + + new_contents = ( + dals( + """ + Metadata-Version: 1.1 + Name: conda + Version: %s + Platform: UNKNOWN + Summary: OS-agnostic, system-level binary package manager. + """ + ) + % CONDA_VERSION + ) + + if old_contents == new_contents: + return Result.NO_CHANGE + + if context.verbosity: + print("\n", file=sys.stderr) + print(target_path, file=sys.stderr) + print(make_diff(old_contents, new_contents), file=sys.stderr) + if not context.dry_run: + if lexists(target_path): + rm_rf(target_path) + with open(target_path, "w") as fh: + fh.write(new_contents) + return Result.MODIFIED + + +# ##################################################### +# helper functions +# ##################################################### + + +def make_diff(old, new): + return "\n".join(unified_diff(old.splitlines(), new.splitlines())) + + +def _get_python_info(prefix): + python_exe = join(prefix, get_python_short_path()) + result = subprocess_call("%s --version" % python_exe) + stdout, stderr = result.stdout.strip(), result.stderr.strip() + if stderr: + python_version = stderr.split()[1] + elif stdout: # pragma: no cover + python_version = stdout.split()[1] + else: # pragma: no cover + raise ValueError("No python version information available.") + + site_packages_dir = join( + prefix, win_path_ok(get_python_site_packages_short_path(python_version)) + ) + return python_exe, python_version, site_packages_dir + + +if __name__ == "__main__": + if on_win: + temp_path = sys.argv[1] + run_plan_from_temp_file(temp_path) + else: + run_plan_from_stdin() diff --git a/shared/package-files/9e/9e35d2592eef88b1560c92e50d6d8351678d57dfb070fe84dd3fd97e34a17929/blob b/shared/package-files/9e/9e35d2592eef88b1560c92e50d6d8351678d57dfb070fe84dd3fd97e34a17929/blob new file mode 100644 index 0000000000000000000000000000000000000000..46e9f76fd8f3773bde40c7b65d340d0a1e335988 --- /dev/null +++ b/shared/package-files/9e/9e35d2592eef88b1560c92e50d6d8351678d57dfb070fe84dd3fd97e34a17929/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API split_with_sizes { + using schema = ::std::vector (const at::Tensor &, c10::SymIntArrayRef, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::split_with_sizes") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "split_with_sizes(Tensor(a -> *) self, SymInt[] split_sizes, int dim=0) -> Tensor(a)[]") + static ::std::vector call(const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim); + static ::std::vector redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::SymIntArrayRef split_sizes, int64_t dim); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9e/9e37252bab966a08b28b2f6f5e4400812fcdfd0355cb307230ac59a2a57847cc/blob b/shared/package-files/9e/9e37252bab966a08b28b2f6f5e4400812fcdfd0355cb307230ac59a2a57847cc/blob new file mode 100644 index 0000000000000000000000000000000000000000..41b0c937588f6982bdedc24e7b7d4bacb4b9a066 --- /dev/null +++ b/shared/package-files/9e/9e37252bab966a08b28b2f6f5e4400812fcdfd0355cb307230ac59a2a57847cc/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e37252bab966a08b28b2f6f5e4400812fcdfd0355cb307230ac59a2a57847cc +size 218000 diff --git a/shared/package-files/9e/9e3bf6d1b3d528abac2116ecf0c77560d5a5199415d665b97d63cd91d631f902/blob b/shared/package-files/9e/9e3bf6d1b3d528abac2116ecf0c77560d5a5199415d665b97d63cd91d631f902/blob new file mode 100644 index 0000000000000000000000000000000000000000..3b887dc5a41e550047477a66a3b4838d9ef2f515 --- /dev/null +++ b/shared/package-files/9e/9e3bf6d1b3d528abac2116ecf0c77560d5a5199415d665b97d63cd91d631f902/blob @@ -0,0 +1,470 @@ +"""distutils.fancy_getopt + +Wrapper around the standard getopt module that provides the following +additional features: + * short and long options are tied together + * options have help strings, so fancy_getopt could potentially + create a complete usage summary + * options set attributes of a passed-in object +""" + +import sys +import string +import re +import getopt +from .errors import DistutilsGetoptError, DistutilsArgError + +# Much like command_re in distutils.core, this is close to but not quite +# the same as a Python NAME -- except, in the spirit of most GNU +# utilities, we use '-' in place of '_'. (The spirit of LISP lives on!) +# The similarities to NAME are again not a coincidence... +longopt_pat = r'[a-zA-Z](?:[a-zA-Z0-9-]*)' +longopt_re = re.compile(r'^%s$' % longopt_pat) + +# For recognizing "negative alias" options, eg. "quiet=!verbose" +neg_alias_re = re.compile("^({})=!({})$".format(longopt_pat, longopt_pat)) + +# This is used to translate long options to legitimate Python identifiers +# (for use as attributes of some object). +longopt_xlate = str.maketrans('-', '_') + + +class FancyGetopt: + """Wrapper around the standard 'getopt()' module that provides some + handy extra functionality: + * short and long options are tied together + * options have help strings, and help text can be assembled + from them + * options set attributes of a passed-in object + * boolean options can have "negative aliases" -- eg. if + --quiet is the "negative alias" of --verbose, then "--quiet" + on the command line sets 'verbose' to false + """ + + def __init__(self, option_table=None): + # The option table is (currently) a list of tuples. The + # tuples may have 3 or four values: + # (long_option, short_option, help_string [, repeatable]) + # if an option takes an argument, its long_option should have '=' + # appended; short_option should just be a single character, no ':' + # in any case. If a long_option doesn't have a corresponding + # short_option, short_option should be None. All option tuples + # must have long options. + self.option_table = option_table + + # 'option_index' maps long option names to entries in the option + # table (ie. those 3-tuples). + self.option_index = {} + if self.option_table: + self._build_index() + + # 'alias' records (duh) alias options; {'foo': 'bar'} means + # --foo is an alias for --bar + self.alias = {} + + # 'negative_alias' keeps track of options that are the boolean + # opposite of some other option + self.negative_alias = {} + + # These keep track of the information in the option table. We + # don't actually populate these structures until we're ready to + # parse the command-line, since the 'option_table' passed in here + # isn't necessarily the final word. + self.short_opts = [] + self.long_opts = [] + self.short2long = {} + self.attr_name = {} + self.takes_arg = {} + + # And 'option_order' is filled up in 'getopt()'; it records the + # original order of options (and their values) on the command-line, + # but expands short options, converts aliases, etc. + self.option_order = [] + + def _build_index(self): + self.option_index.clear() + for option in self.option_table: + self.option_index[option[0]] = option + + def set_option_table(self, option_table): + self.option_table = option_table + self._build_index() + + def add_option(self, long_option, short_option=None, help_string=None): + if long_option in self.option_index: + raise DistutilsGetoptError( + "option conflict: already an option '%s'" % long_option + ) + else: + option = (long_option, short_option, help_string) + self.option_table.append(option) + self.option_index[long_option] = option + + def has_option(self, long_option): + """Return true if the option table for this parser has an + option with long name 'long_option'.""" + return long_option in self.option_index + + def get_attr_name(self, long_option): + """Translate long option name 'long_option' to the form it + has as an attribute of some object: ie., translate hyphens + to underscores.""" + return long_option.translate(longopt_xlate) + + def _check_alias_dict(self, aliases, what): + assert isinstance(aliases, dict) + for alias, opt in aliases.items(): + if alias not in self.option_index: + raise DistutilsGetoptError( + ("invalid %s '%s': " "option '%s' not defined") + % (what, alias, alias) + ) + if opt not in self.option_index: + raise DistutilsGetoptError( + ("invalid %s '%s': " "aliased option '%s' not defined") + % (what, alias, opt) + ) + + def set_aliases(self, alias): + """Set the aliases for this option parser.""" + self._check_alias_dict(alias, "alias") + self.alias = alias + + def set_negative_aliases(self, negative_alias): + """Set the negative aliases for this option parser. + 'negative_alias' should be a dictionary mapping option names to + option names, both the key and value must already be defined + in the option table.""" + self._check_alias_dict(negative_alias, "negative alias") + self.negative_alias = negative_alias + + def _grok_option_table(self): # noqa: C901 + """Populate the various data structures that keep tabs on the + option table. Called by 'getopt()' before it can do anything + worthwhile. + """ + self.long_opts = [] + self.short_opts = [] + self.short2long.clear() + self.repeat = {} + + for option in self.option_table: + if len(option) == 3: + long, short, help = option + repeat = 0 + elif len(option) == 4: + long, short, help, repeat = option + else: + # the option table is part of the code, so simply + # assert that it is correct + raise ValueError("invalid option tuple: {!r}".format(option)) + + # Type- and value-check the option names + if not isinstance(long, str) or len(long) < 2: + raise DistutilsGetoptError( + ("invalid long option '%s': " "must be a string of length >= 2") + % long + ) + + if not ((short is None) or (isinstance(short, str) and len(short) == 1)): + raise DistutilsGetoptError( + "invalid short option '%s': " + "must a single character or None" % short + ) + + self.repeat[long] = repeat + self.long_opts.append(long) + + if long[-1] == '=': # option takes an argument? + if short: + short = short + ':' + long = long[0:-1] + self.takes_arg[long] = 1 + else: + # Is option is a "negative alias" for some other option (eg. + # "quiet" == "!verbose")? + alias_to = self.negative_alias.get(long) + if alias_to is not None: + if self.takes_arg[alias_to]: + raise DistutilsGetoptError( + "invalid negative alias '%s': " + "aliased option '%s' takes a value" % (long, alias_to) + ) + + self.long_opts[-1] = long # XXX redundant?! + self.takes_arg[long] = 0 + + # If this is an alias option, make sure its "takes arg" flag is + # the same as the option it's aliased to. + alias_to = self.alias.get(long) + if alias_to is not None: + if self.takes_arg[long] != self.takes_arg[alias_to]: + raise DistutilsGetoptError( + "invalid alias '%s': inconsistent with " + "aliased option '%s' (one of them takes a value, " + "the other doesn't" % (long, alias_to) + ) + + # Now enforce some bondage on the long option name, so we can + # later translate it to an attribute name on some object. Have + # to do this a bit late to make sure we've removed any trailing + # '='. + if not longopt_re.match(long): + raise DistutilsGetoptError( + "invalid long option name '%s' " + "(must be letters, numbers, hyphens only" % long + ) + + self.attr_name[long] = self.get_attr_name(long) + if short: + self.short_opts.append(short) + self.short2long[short[0]] = long + + def getopt(self, args=None, object=None): # noqa: C901 + """Parse command-line options in args. Store as attributes on object. + + If 'args' is None or not supplied, uses 'sys.argv[1:]'. If + 'object' is None or not supplied, creates a new OptionDummy + object, stores option values there, and returns a tuple (args, + object). If 'object' is supplied, it is modified in place and + 'getopt()' just returns 'args'; in both cases, the returned + 'args' is a modified copy of the passed-in 'args' list, which + is left untouched. + """ + if args is None: + args = sys.argv[1:] + if object is None: + object = OptionDummy() + created_object = True + else: + created_object = False + + self._grok_option_table() + + short_opts = ' '.join(self.short_opts) + try: + opts, args = getopt.getopt(args, short_opts, self.long_opts) + except getopt.error as msg: + raise DistutilsArgError(msg) + + for opt, val in opts: + if len(opt) == 2 and opt[0] == '-': # it's a short option + opt = self.short2long[opt[1]] + else: + assert len(opt) > 2 and opt[:2] == '--' + opt = opt[2:] + + alias = self.alias.get(opt) + if alias: + opt = alias + + if not self.takes_arg[opt]: # boolean option? + assert val == '', "boolean option can't have value" + alias = self.negative_alias.get(opt) + if alias: + opt = alias + val = 0 + else: + val = 1 + + attr = self.attr_name[opt] + # The only repeating option at the moment is 'verbose'. + # It has a negative option -q quiet, which should set verbose = 0. + if val and self.repeat.get(attr) is not None: + val = getattr(object, attr, 0) + 1 + setattr(object, attr, val) + self.option_order.append((opt, val)) + + # for opts + if created_object: + return args, object + else: + return args + + def get_option_order(self): + """Returns the list of (option, value) tuples processed by the + previous run of 'getopt()'. Raises RuntimeError if + 'getopt()' hasn't been called yet. + """ + if self.option_order is None: + raise RuntimeError("'getopt()' hasn't been called yet") + else: + return self.option_order + + def generate_help(self, header=None): # noqa: C901 + """Generate help text (a list of strings, one per suggested line of + output) from the option table for this FancyGetopt object. + """ + # Blithely assume the option table is good: probably wouldn't call + # 'generate_help()' unless you've already called 'getopt()'. + + # First pass: determine maximum length of long option names + max_opt = 0 + for option in self.option_table: + long = option[0] + short = option[1] + ell = len(long) + if long[-1] == '=': + ell = ell - 1 + if short is not None: + ell = ell + 5 # " (-x)" where short == 'x' + if ell > max_opt: + max_opt = ell + + opt_width = max_opt + 2 + 2 + 2 # room for indent + dashes + gutter + + # Typical help block looks like this: + # --foo controls foonabulation + # Help block for longest option looks like this: + # --flimflam set the flim-flam level + # and with wrapped text: + # --flimflam set the flim-flam level (must be between + # 0 and 100, except on Tuesdays) + # Options with short names will have the short name shown (but + # it doesn't contribute to max_opt): + # --foo (-f) controls foonabulation + # If adding the short option would make the left column too wide, + # we push the explanation off to the next line + # --flimflam (-l) + # set the flim-flam level + # Important parameters: + # - 2 spaces before option block start lines + # - 2 dashes for each long option name + # - min. 2 spaces between option and explanation (gutter) + # - 5 characters (incl. space) for short option name + + # Now generate lines of help text. (If 80 columns were good enough + # for Jesus, then 78 columns are good enough for me!) + line_width = 78 + text_width = line_width - opt_width + big_indent = ' ' * opt_width + if header: + lines = [header] + else: + lines = ['Option summary:'] + + for option in self.option_table: + long, short, help = option[:3] + text = wrap_text(help, text_width) + if long[-1] == '=': + long = long[0:-1] + + # Case 1: no short option at all (makes life easy) + if short is None: + if text: + lines.append(" --%-*s %s" % (max_opt, long, text[0])) + else: + lines.append(" --%-*s " % (max_opt, long)) + + # Case 2: we have a short option, so we have to include it + # just after the long option + else: + opt_names = "{} (-{})".format(long, short) + if text: + lines.append(" --%-*s %s" % (max_opt, opt_names, text[0])) + else: + lines.append(" --%-*s" % opt_names) + + for ell in text[1:]: + lines.append(big_indent + ell) + return lines + + def print_help(self, header=None, file=None): + if file is None: + file = sys.stdout + for line in self.generate_help(header): + file.write(line + "\n") + + +def fancy_getopt(options, negative_opt, object, args): + parser = FancyGetopt(options) + parser.set_negative_aliases(negative_opt) + return parser.getopt(args, object) + + +WS_TRANS = {ord(_wschar): ' ' for _wschar in string.whitespace} + + +def wrap_text(text, width): + """wrap_text(text : string, width : int) -> [string] + + Split 'text' into multiple lines of no more than 'width' characters + each, and return the list of strings that results. + """ + if text is None: + return [] + if len(text) <= width: + return [text] + + text = text.expandtabs() + text = text.translate(WS_TRANS) + chunks = re.split(r'( +|-+)', text) + chunks = [ch for ch in chunks if ch] # ' - ' results in empty strings + lines = [] + + while chunks: + cur_line = [] # list of chunks (to-be-joined) + cur_len = 0 # length of current line + + while chunks: + ell = len(chunks[0]) + if cur_len + ell <= width: # can squeeze (at least) this chunk in + cur_line.append(chunks[0]) + del chunks[0] + cur_len = cur_len + ell + else: # this line is full + # drop last chunk if all space + if cur_line and cur_line[-1][0] == ' ': + del cur_line[-1] + break + + if chunks: # any chunks left to process? + # if the current line is still empty, then we had a single + # chunk that's too big too fit on a line -- so we break + # down and break it up at the line width + if cur_len == 0: + cur_line.append(chunks[0][0:width]) + chunks[0] = chunks[0][width:] + + # all-whitespace chunks at the end of a line can be discarded + # (and we know from the re.split above that if a chunk has + # *any* whitespace, it is *all* whitespace) + if chunks[0][0] == ' ': + del chunks[0] + + # and store this line in the list-of-all-lines -- as a single + # string, of course! + lines.append(''.join(cur_line)) + + return lines + + +def translate_longopt(opt): + """Convert a long option name to a valid Python identifier by + changing "-" to "_". + """ + return opt.translate(longopt_xlate) + + +class OptionDummy: + """Dummy class just used as a place to hold command-line option + values as instance attributes.""" + + def __init__(self, options=[]): + """Create a new OptionDummy instance. The attributes listed in + 'options' will be initialized to None.""" + for opt in options: + setattr(self, opt, None) + + +if __name__ == "__main__": + text = """\ +Tra-la-la, supercalifragilisticexpialidocious. +How *do* you spell that odd word, anyways? +(Someone ask Mary -- she'll know [or she'll +say, "How should I know?"].)""" + + for w in (10, 20, 30, 40): + print("width: %d" % w) + print("\n".join(wrap_text(text, w))) + print() diff --git a/shared/package-files/9e/9e41e3717845b6b4991f6242824a854d570b5a1603c5de96a9007ab712689a1d/blob b/shared/package-files/9e/9e41e3717845b6b4991f6242824a854d570b5a1603c5de96a9007ab712689a1d/blob new file mode 100644 index 0000000000000000000000000000000000000000..a03fe4e01b22c0214234bb89a3077c92808fda56 --- /dev/null +++ b/shared/package-files/9e/9e41e3717845b6b4991f6242824a854d570b5a1603c5de96a9007ab712689a1d/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor logaddexp(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & logaddexp_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & logaddexp_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/9e/9e44ecbe346a0a41bab3b96854100a2eeeac8e3e414559b662c355dd4520878a/blob b/shared/package-files/9e/9e44ecbe346a0a41bab3b96854100a2eeeac8e3e414559b662c355dd4520878a/blob new file mode 100644 index 0000000000000000000000000000000000000000..b819e3424f93d5f1b6454aab479e241710ac5241 Binary files /dev/null and b/shared/package-files/9e/9e44ecbe346a0a41bab3b96854100a2eeeac8e3e414559b662c355dd4520878a/blob differ diff --git a/shared/package-files/9e/9e45b67e5ece001704dec51ca0d33b88e36417ae0204449d5654634cb8378550/blob b/shared/package-files/9e/9e45b67e5ece001704dec51ca0d33b88e36417ae0204449d5654634cb8378550/blob new file mode 100644 index 0000000000000000000000000000000000000000..efa9b4740fc4b02e9419b7e5d7ccc7cec61cd781 --- /dev/null +++ b/shared/package-files/9e/9e45b67e5ece001704dec51ca0d33b88e36417ae0204449d5654634cb8378550/blob @@ -0,0 +1,79 @@ +import sys +if 'setuptools' in sys.modules: + import setuptools.command.install as old_install_mod + have_setuptools = True +else: + import distutils.command.install as old_install_mod + have_setuptools = False +from distutils.file_util import write_file + +old_install = old_install_mod.install + +class install(old_install): + + # Always run install_clib - the command is cheap, so no need to bypass it; + # but it's not run by setuptools -- so it's run again in install_data + sub_commands = old_install.sub_commands + [ + ('install_clib', lambda x: True) + ] + + def finalize_options (self): + old_install.finalize_options(self) + self.install_lib = self.install_libbase + + def setuptools_run(self): + """ The setuptools version of the .run() method. + + We must pull in the entire code so we can override the level used in the + _getframe() call since we wrap this call by one more level. + """ + from distutils.command.install import install as distutils_install + + # Explicit request for old-style install? Just do it + if self.old_and_unmanageable or self.single_version_externally_managed: + return distutils_install.run(self) + + # Attempt to detect whether we were called from setup() or by another + # command. If we were called by setup(), our caller will be the + # 'run_command' method in 'distutils.dist', and *its* caller will be + # the 'run_commands' method. If we were called any other way, our + # immediate caller *might* be 'run_command', but it won't have been + # called by 'run_commands'. This is slightly kludgy, but seems to + # work. + # + caller = sys._getframe(3) + caller_module = caller.f_globals.get('__name__', '') + caller_name = caller.f_code.co_name + + if caller_module != 'distutils.dist' or caller_name!='run_commands': + # We weren't called from the command line or setup(), so we + # should run in backward-compatibility mode to support bdist_* + # commands. + distutils_install.run(self) + else: + self.do_egg_install() + + def run(self): + if not have_setuptools: + r = old_install.run(self) + else: + r = self.setuptools_run() + if self.record: + # bdist_rpm fails when INSTALLED_FILES contains + # paths with spaces. Such paths must be enclosed + # with double-quotes. + with open(self.record) as f: + lines = [] + need_rewrite = False + for l in f: + l = l.rstrip() + if ' ' in l: + need_rewrite = True + l = '"%s"' % (l) + lines.append(l) + if need_rewrite: + self.execute(write_file, + (self.record, lines), + "re-writing list of installed files to '%s'" % + self.record) + return r diff --git a/shared/package-files/9e/9e45f9ac095378eead3d1e3f2b819cf5bbd588fbb51d46e803bfaf45d893113a/blob b/shared/package-files/9e/9e45f9ac095378eead3d1e3f2b819cf5bbd588fbb51d46e803bfaf45d893113a/blob new file mode 100644 index 0000000000000000000000000000000000000000..388697340e08b545be766c6d46cf7362371bc258 --- /dev/null +++ b/shared/package-files/9e/9e45f9ac095378eead3d1e3f2b819cf5bbd588fbb51d46e803bfaf45d893113a/blob @@ -0,0 +1,1070 @@ +import numpy as np +import pytest +from numpy.testing import assert_array_equal + +from sklearn.ensemble._hist_gradient_boosting.common import ( + G_H_DTYPE, + HISTOGRAM_DTYPE, + X_BINNED_DTYPE, + MonotonicConstraint, +) +from sklearn.ensemble._hist_gradient_boosting.histogram import HistogramBuilder +from sklearn.ensemble._hist_gradient_boosting.splitting import ( + Splitter, + compute_node_value, +) +from sklearn.utils._openmp_helpers import _openmp_effective_n_threads +from sklearn.utils._testing import skip_if_32bit + +n_threads = _openmp_effective_n_threads() + + +@pytest.mark.parametrize("n_bins", [3, 32, 256]) +def test_histogram_split(n_bins): + rng = np.random.RandomState(42) + feature_idx = 0 + l2_regularization = 0 + min_hessian_to_split = 1e-3 + min_samples_leaf = 1 + min_gain_to_split = 0.0 + X_binned = np.asfortranarray( + rng.randint(0, n_bins - 1, size=(int(1e4), 1)), dtype=X_BINNED_DTYPE + ) + binned_feature = X_binned.T[feature_idx] + sample_indices = np.arange(binned_feature.shape[0], dtype=np.uint32) + ordered_hessians = np.ones_like(binned_feature, dtype=G_H_DTYPE) + all_hessians = ordered_hessians + sum_hessians = all_hessians.sum() + hessians_are_constant = False + + for true_bin in range(1, n_bins - 2): + for sign in [-1, 1]: + ordered_gradients = np.full_like(binned_feature, sign, dtype=G_H_DTYPE) + ordered_gradients[binned_feature <= true_bin] *= -1 + all_gradients = ordered_gradients + sum_gradients = all_gradients.sum() + + builder = HistogramBuilder( + X_binned, + n_bins, + all_gradients, + all_hessians, + hessians_are_constant, + n_threads, + ) + n_bins_non_missing = np.array( + [n_bins - 1] * X_binned.shape[1], dtype=np.uint32 + ) + has_missing_values = np.array([False] * X_binned.shape[1], dtype=np.uint8) + monotonic_cst = np.array( + [MonotonicConstraint.NO_CST] * X_binned.shape[1], dtype=np.int8 + ) + is_categorical = np.zeros_like(monotonic_cst, dtype=np.uint8) + missing_values_bin_idx = n_bins - 1 + splitter = Splitter( + X_binned, + n_bins_non_missing, + missing_values_bin_idx, + has_missing_values, + is_categorical, + monotonic_cst, + l2_regularization, + min_hessian_to_split, + min_samples_leaf, + min_gain_to_split, + hessians_are_constant, + ) + + histograms = builder.compute_histograms_brute(sample_indices) + value = compute_node_value( + sum_gradients, sum_hessians, -np.inf, np.inf, l2_regularization + ) + split_info = splitter.find_node_split( + sample_indices.shape[0], histograms, sum_gradients, sum_hessians, value + ) + + assert split_info.bin_idx == true_bin + assert split_info.gain >= 0 + assert split_info.feature_idx == feature_idx + assert ( + split_info.n_samples_left + split_info.n_samples_right + == sample_indices.shape[0] + ) + # Constant hessian: 1. per sample. + assert split_info.n_samples_left == split_info.sum_hessian_left + + +@skip_if_32bit +@pytest.mark.parametrize("constant_hessian", [True, False]) +def test_gradient_and_hessian_sanity(constant_hessian): + # This test checks that the values of gradients and hessians are + # consistent in different places: + # - in split_info: si.sum_gradient_left + si.sum_gradient_right must be + # equal to the gradient at the node. Same for hessians. + # - in the histograms: summing 'sum_gradients' over the bins must be + # constant across all features, and those sums must be equal to the + # node's gradient. Same for hessians. + + rng = np.random.RandomState(42) + + n_bins = 10 + n_features = 20 + n_samples = 500 + l2_regularization = 0.0 + min_hessian_to_split = 1e-3 + min_samples_leaf = 1 + min_gain_to_split = 0.0 + + X_binned = rng.randint( + 0, n_bins, size=(n_samples, n_features), dtype=X_BINNED_DTYPE + ) + X_binned = np.asfortranarray(X_binned) + sample_indices = np.arange(n_samples, dtype=np.uint32) + all_gradients = rng.randn(n_samples).astype(G_H_DTYPE) + sum_gradients = all_gradients.sum() + if constant_hessian: + all_hessians = np.ones(1, dtype=G_H_DTYPE) + sum_hessians = 1 * n_samples + else: + all_hessians = rng.lognormal(size=n_samples).astype(G_H_DTYPE) + sum_hessians = all_hessians.sum() + + builder = HistogramBuilder( + X_binned, n_bins, all_gradients, all_hessians, constant_hessian, n_threads + ) + n_bins_non_missing = np.array([n_bins - 1] * X_binned.shape[1], dtype=np.uint32) + has_missing_values = np.array([False] * X_binned.shape[1], dtype=np.uint8) + monotonic_cst = np.array( + [MonotonicConstraint.NO_CST] * X_binned.shape[1], dtype=np.int8 + ) + is_categorical = np.zeros_like(monotonic_cst, dtype=np.uint8) + missing_values_bin_idx = n_bins - 1 + splitter = Splitter( + X_binned, + n_bins_non_missing, + missing_values_bin_idx, + has_missing_values, + is_categorical, + monotonic_cst, + l2_regularization, + min_hessian_to_split, + min_samples_leaf, + min_gain_to_split, + constant_hessian, + ) + + hists_parent = builder.compute_histograms_brute(sample_indices) + value_parent = compute_node_value( + sum_gradients, sum_hessians, -np.inf, np.inf, l2_regularization + ) + si_parent = splitter.find_node_split( + n_samples, hists_parent, sum_gradients, sum_hessians, value_parent + ) + sample_indices_left, sample_indices_right, _ = splitter.split_indices( + si_parent, sample_indices + ) + + hists_left = builder.compute_histograms_brute(sample_indices_left) + value_left = compute_node_value( + si_parent.sum_gradient_left, + si_parent.sum_hessian_left, + -np.inf, + np.inf, + l2_regularization, + ) + hists_right = builder.compute_histograms_brute(sample_indices_right) + value_right = compute_node_value( + si_parent.sum_gradient_right, + si_parent.sum_hessian_right, + -np.inf, + np.inf, + l2_regularization, + ) + si_left = splitter.find_node_split( + n_samples, + hists_left, + si_parent.sum_gradient_left, + si_parent.sum_hessian_left, + value_left, + ) + si_right = splitter.find_node_split( + n_samples, + hists_right, + si_parent.sum_gradient_right, + si_parent.sum_hessian_right, + value_right, + ) + + # make sure that si.sum_gradient_left + si.sum_gradient_right have their + # expected value, same for hessians + for si, indices in ( + (si_parent, sample_indices), + (si_left, sample_indices_left), + (si_right, sample_indices_right), + ): + gradient = si.sum_gradient_right + si.sum_gradient_left + expected_gradient = all_gradients[indices].sum() + hessian = si.sum_hessian_right + si.sum_hessian_left + if constant_hessian: + expected_hessian = indices.shape[0] * all_hessians[0] + else: + expected_hessian = all_hessians[indices].sum() + + assert np.isclose(gradient, expected_gradient) + assert np.isclose(hessian, expected_hessian) + + # make sure sum of gradients in histograms are the same for all features, + # and make sure they're equal to their expected value + hists_parent = np.asarray(hists_parent, dtype=HISTOGRAM_DTYPE) + hists_left = np.asarray(hists_left, dtype=HISTOGRAM_DTYPE) + hists_right = np.asarray(hists_right, dtype=HISTOGRAM_DTYPE) + for hists, indices in ( + (hists_parent, sample_indices), + (hists_left, sample_indices_left), + (hists_right, sample_indices_right), + ): + # note: gradients and hessians have shape (n_features,), + # we're comparing them to *scalars*. This has the benefit of also + # making sure that all the entries are equal across features. + gradients = hists["sum_gradients"].sum(axis=1) # shape = (n_features,) + expected_gradient = all_gradients[indices].sum() # scalar + hessians = hists["sum_hessians"].sum(axis=1) + if constant_hessian: + # 0 is not the actual hessian, but it's not computed in this case + expected_hessian = 0.0 + else: + expected_hessian = all_hessians[indices].sum() + + assert np.allclose(gradients, expected_gradient) + assert np.allclose(hessians, expected_hessian) + + +def test_split_indices(): + # Check that split_indices returns the correct splits and that + # splitter.partition is consistent with what is returned. + rng = np.random.RandomState(421) + + n_bins = 5 + n_samples = 10 + l2_regularization = 0.0 + min_hessian_to_split = 1e-3 + min_samples_leaf = 1 + min_gain_to_split = 0.0 + + # split will happen on feature 1 and on bin 3 + X_binned = [ + [0, 0], + [0, 3], + [0, 4], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 4], + [0, 0], + [0, 4], + ] + X_binned = np.asfortranarray(X_binned, dtype=X_BINNED_DTYPE) + sample_indices = np.arange(n_samples, dtype=np.uint32) + all_gradients = rng.randn(n_samples).astype(G_H_DTYPE) + all_hessians = np.ones(1, dtype=G_H_DTYPE) + sum_gradients = all_gradients.sum() + sum_hessians = 1 * n_samples + hessians_are_constant = True + + builder = HistogramBuilder( + X_binned, n_bins, all_gradients, all_hessians, hessians_are_constant, n_threads + ) + n_bins_non_missing = np.array([n_bins] * X_binned.shape[1], dtype=np.uint32) + has_missing_values = np.array([False] * X_binned.shape[1], dtype=np.uint8) + monotonic_cst = np.array( + [MonotonicConstraint.NO_CST] * X_binned.shape[1], dtype=np.int8 + ) + is_categorical = np.zeros_like(monotonic_cst, dtype=np.uint8) + missing_values_bin_idx = n_bins - 1 + splitter = Splitter( + X_binned, + n_bins_non_missing, + missing_values_bin_idx, + has_missing_values, + is_categorical, + monotonic_cst, + l2_regularization, + min_hessian_to_split, + min_samples_leaf, + min_gain_to_split, + hessians_are_constant, + ) + + assert np.all(sample_indices == splitter.partition) + + histograms = builder.compute_histograms_brute(sample_indices) + value = compute_node_value( + sum_gradients, sum_hessians, -np.inf, np.inf, l2_regularization + ) + si_root = splitter.find_node_split( + n_samples, histograms, sum_gradients, sum_hessians, value + ) + + # sanity checks for best split + assert si_root.feature_idx == 1 + assert si_root.bin_idx == 3 + + samples_left, samples_right, position_right = splitter.split_indices( + si_root, splitter.partition + ) + assert set(samples_left) == set([0, 1, 3, 4, 5, 6, 8]) + assert set(samples_right) == set([2, 7, 9]) + + assert list(samples_left) == list(splitter.partition[:position_right]) + assert list(samples_right) == list(splitter.partition[position_right:]) + + # Check that the resulting split indices sizes are consistent with the + # count statistics anticipated when looking for the best split. + assert samples_left.shape[0] == si_root.n_samples_left + assert samples_right.shape[0] == si_root.n_samples_right + + +def test_min_gain_to_split(): + # Try to split a pure node (all gradients are equal, same for hessians) + # with min_gain_to_split = 0 and make sure that the node is not split (best + # possible gain = -1). Note: before the strict inequality comparison, this + # test would fail because the node would be split with a gain of 0. + rng = np.random.RandomState(42) + l2_regularization = 0 + min_hessian_to_split = 0 + min_samples_leaf = 1 + min_gain_to_split = 0.0 + n_bins = 255 + n_samples = 100 + X_binned = np.asfortranarray( + rng.randint(0, n_bins, size=(n_samples, 1)), dtype=X_BINNED_DTYPE + ) + binned_feature = X_binned[:, 0] + sample_indices = np.arange(n_samples, dtype=np.uint32) + all_hessians = np.ones_like(binned_feature, dtype=G_H_DTYPE) + all_gradients = np.ones_like(binned_feature, dtype=G_H_DTYPE) + sum_gradients = all_gradients.sum() + sum_hessians = all_hessians.sum() + hessians_are_constant = False + + builder = HistogramBuilder( + X_binned, n_bins, all_gradients, all_hessians, hessians_are_constant, n_threads + ) + n_bins_non_missing = np.array([n_bins - 1] * X_binned.shape[1], dtype=np.uint32) + has_missing_values = np.array([False] * X_binned.shape[1], dtype=np.uint8) + monotonic_cst = np.array( + [MonotonicConstraint.NO_CST] * X_binned.shape[1], dtype=np.int8 + ) + is_categorical = np.zeros_like(monotonic_cst, dtype=np.uint8) + missing_values_bin_idx = n_bins - 1 + splitter = Splitter( + X_binned, + n_bins_non_missing, + missing_values_bin_idx, + has_missing_values, + is_categorical, + monotonic_cst, + l2_regularization, + min_hessian_to_split, + min_samples_leaf, + min_gain_to_split, + hessians_are_constant, + ) + + histograms = builder.compute_histograms_brute(sample_indices) + value = compute_node_value( + sum_gradients, sum_hessians, -np.inf, np.inf, l2_regularization + ) + split_info = splitter.find_node_split( + n_samples, histograms, sum_gradients, sum_hessians, value + ) + assert split_info.gain == -1 + + +@pytest.mark.parametrize( + ( + "X_binned, all_gradients, has_missing_values, n_bins_non_missing, " + " expected_split_on_nan, expected_bin_idx, expected_go_to_left" + ), + [ + # basic sanity check with no missing values: given the gradient + # values, the split must occur on bin_idx=3 + ( + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], # X_binned + [1, 1, 1, 1, 5, 5, 5, 5, 5, 5], # gradients + False, # no missing values + 10, # n_bins_non_missing + False, # don't split on nans + 3, # expected_bin_idx + "not_applicable", + ), + # We replace 2 samples by NaNs (bin_idx=8) + # These 2 samples were mapped to the left node before, so they should + # be mapped to left node again + # Notice how the bin_idx threshold changes from 3 to 1. + ( + [8, 0, 1, 8, 2, 3, 4, 5, 6, 7], # 8 <=> missing + [1, 1, 1, 1, 5, 5, 5, 5, 5, 5], + True, # missing values + 8, # n_bins_non_missing + False, # don't split on nans + 1, # cut on bin_idx=1 + True, + ), # missing values go to left + # same as above, but with non-consecutive missing_values_bin + ( + [9, 0, 1, 9, 2, 3, 4, 5, 6, 7], # 9 <=> missing + [1, 1, 1, 1, 5, 5, 5, 5, 5, 5], + True, # missing values + 8, # n_bins_non_missing + False, # don't split on nans + 1, # cut on bin_idx=1 + True, + ), # missing values go to left + # this time replacing 2 samples that were on the right. + ( + [0, 1, 2, 3, 8, 4, 8, 5, 6, 7], # 8 <=> missing + [1, 1, 1, 1, 5, 5, 5, 5, 5, 5], + True, # missing values + 8, # n_bins_non_missing + False, # don't split on nans + 3, # cut on bin_idx=3 (like in first case) + False, + ), # missing values go to right + # same as above, but with non-consecutive missing_values_bin + ( + [0, 1, 2, 3, 9, 4, 9, 5, 6, 7], # 9 <=> missing + [1, 1, 1, 1, 5, 5, 5, 5, 5, 5], + True, # missing values + 8, # n_bins_non_missing + False, # don't split on nans + 3, # cut on bin_idx=3 (like in first case) + False, + ), # missing values go to right + # For the following cases, split_on_nans is True (we replace all of + # the samples with nans, instead of just 2). + ( + [0, 1, 2, 3, 4, 4, 4, 4, 4, 4], # 4 <=> missing + [1, 1, 1, 1, 5, 5, 5, 5, 5, 5], + True, # missing values + 4, # n_bins_non_missing + True, # split on nans + 3, # cut on bin_idx=3 + False, + ), # missing values go to right + # same as above, but with non-consecutive missing_values_bin + ( + [0, 1, 2, 3, 9, 9, 9, 9, 9, 9], # 9 <=> missing + [1, 1, 1, 1, 1, 1, 5, 5, 5, 5], + True, # missing values + 4, # n_bins_non_missing + True, # split on nans + 3, # cut on bin_idx=3 + False, + ), # missing values go to right + ( + [6, 6, 6, 6, 0, 1, 2, 3, 4, 5], # 6 <=> missing + [1, 1, 1, 1, 5, 5, 5, 5, 5, 5], + True, # missing values + 6, # n_bins_non_missing + True, # split on nans + 5, # cut on bin_idx=5 + False, + ), # missing values go to right + # same as above, but with non-consecutive missing_values_bin + ( + [9, 9, 9, 9, 0, 1, 2, 3, 4, 5], # 9 <=> missing + [1, 1, 1, 1, 5, 5, 5, 5, 5, 5], + True, # missing values + 6, # n_bins_non_missing + True, # split on nans + 5, # cut on bin_idx=5 + False, + ), # missing values go to right + ], +) +def test_splitting_missing_values( + X_binned, + all_gradients, + has_missing_values, + n_bins_non_missing, + expected_split_on_nan, + expected_bin_idx, + expected_go_to_left, +): + # Make sure missing values are properly supported. + # we build an artificial example with gradients such that the best split + # is on bin_idx=3, when there are no missing values. + # Then we introduce missing values and: + # - make sure the chosen bin is correct (find_best_bin()): it's + # still the same split, even though the index of the bin may change + # - make sure the missing values are mapped to the correct child + # (split_indices()) + + n_bins = max(X_binned) + 1 + n_samples = len(X_binned) + l2_regularization = 0.0 + min_hessian_to_split = 1e-3 + min_samples_leaf = 1 + min_gain_to_split = 0.0 + + sample_indices = np.arange(n_samples, dtype=np.uint32) + X_binned = np.array(X_binned, dtype=X_BINNED_DTYPE).reshape(-1, 1) + X_binned = np.asfortranarray(X_binned) + all_gradients = np.array(all_gradients, dtype=G_H_DTYPE) + has_missing_values = np.array([has_missing_values], dtype=np.uint8) + all_hessians = np.ones(1, dtype=G_H_DTYPE) + sum_gradients = all_gradients.sum() + sum_hessians = 1 * n_samples + hessians_are_constant = True + + builder = HistogramBuilder( + X_binned, n_bins, all_gradients, all_hessians, hessians_are_constant, n_threads + ) + + n_bins_non_missing = np.array([n_bins_non_missing], dtype=np.uint32) + monotonic_cst = np.array( + [MonotonicConstraint.NO_CST] * X_binned.shape[1], dtype=np.int8 + ) + is_categorical = np.zeros_like(monotonic_cst, dtype=np.uint8) + missing_values_bin_idx = n_bins - 1 + splitter = Splitter( + X_binned, + n_bins_non_missing, + missing_values_bin_idx, + has_missing_values, + is_categorical, + monotonic_cst, + l2_regularization, + min_hessian_to_split, + min_samples_leaf, + min_gain_to_split, + hessians_are_constant, + ) + + histograms = builder.compute_histograms_brute(sample_indices) + value = compute_node_value( + sum_gradients, sum_hessians, -np.inf, np.inf, l2_regularization + ) + split_info = splitter.find_node_split( + n_samples, histograms, sum_gradients, sum_hessians, value + ) + + assert split_info.bin_idx == expected_bin_idx + if has_missing_values: + assert split_info.missing_go_to_left == expected_go_to_left + + split_on_nan = split_info.bin_idx == n_bins_non_missing[0] - 1 + assert split_on_nan == expected_split_on_nan + + # Make sure the split is properly computed. + # This also make sure missing values are properly assigned to the correct + # child in split_indices() + samples_left, samples_right, _ = splitter.split_indices( + split_info, splitter.partition + ) + + if not expected_split_on_nan: + # When we don't split on nans, the split should always be the same. + assert set(samples_left) == set([0, 1, 2, 3]) + assert set(samples_right) == set([4, 5, 6, 7, 8, 9]) + else: + # When we split on nans, samples with missing values are always mapped + # to the right child. + missing_samples_indices = np.flatnonzero( + np.array(X_binned) == missing_values_bin_idx + ) + non_missing_samples_indices = np.flatnonzero( + np.array(X_binned) != missing_values_bin_idx + ) + + assert set(samples_right) == set(missing_samples_indices) + assert set(samples_left) == set(non_missing_samples_indices) + + +@pytest.mark.parametrize( + "X_binned, has_missing_values, n_bins_non_missing, ", + [ + # one category + ([0] * 20, False, 1), + # all categories appear less than MIN_CAT_SUPPORT (hardcoded to 10) + ([0] * 9 + [1] * 8, False, 2), + # only one category appears more than MIN_CAT_SUPPORT + ([0] * 12 + [1] * 8, False, 2), + # missing values + category appear less than MIN_CAT_SUPPORT + # 9 is missing + ([0] * 9 + [1] * 8 + [9] * 4, True, 2), + # no non-missing category + ([9] * 11, True, 0), + ], +) +def test_splitting_categorical_cat_smooth( + X_binned, has_missing_values, n_bins_non_missing +): + # Checks categorical splits are correct when the MIN_CAT_SUPPORT constraint + # isn't respected: there are no splits + + n_bins = max(X_binned) + 1 + n_samples = len(X_binned) + X_binned = np.array([X_binned], dtype=X_BINNED_DTYPE).T + X_binned = np.asfortranarray(X_binned) + + l2_regularization = 0.0 + min_hessian_to_split = 1e-3 + min_samples_leaf = 1 + min_gain_to_split = 0.0 + + sample_indices = np.arange(n_samples, dtype=np.uint32) + all_gradients = np.ones(n_samples, dtype=G_H_DTYPE) + has_missing_values = np.array([has_missing_values], dtype=np.uint8) + all_hessians = np.ones(1, dtype=G_H_DTYPE) + sum_gradients = all_gradients.sum() + sum_hessians = n_samples + hessians_are_constant = True + + builder = HistogramBuilder( + X_binned, n_bins, all_gradients, all_hessians, hessians_are_constant, n_threads + ) + + n_bins_non_missing = np.array([n_bins_non_missing], dtype=np.uint32) + monotonic_cst = np.array( + [MonotonicConstraint.NO_CST] * X_binned.shape[1], dtype=np.int8 + ) + is_categorical = np.ones_like(monotonic_cst, dtype=np.uint8) + missing_values_bin_idx = n_bins - 1 + + splitter = Splitter( + X_binned, + n_bins_non_missing, + missing_values_bin_idx, + has_missing_values, + is_categorical, + monotonic_cst, + l2_regularization, + min_hessian_to_split, + min_samples_leaf, + min_gain_to_split, + hessians_are_constant, + ) + + histograms = builder.compute_histograms_brute(sample_indices) + value = compute_node_value( + sum_gradients, sum_hessians, -np.inf, np.inf, l2_regularization + ) + split_info = splitter.find_node_split( + n_samples, histograms, sum_gradients, sum_hessians, value + ) + + # no split found + assert split_info.gain == -1 + + +def _assert_categories_equals_bitset(categories, bitset): + # assert that the bitset exactly corresponds to the categories + # bitset is assumed to be an array of 8 uint32 elements + + # form bitset from threshold + expected_bitset = np.zeros(8, dtype=np.uint32) + for cat in categories: + idx = cat // 32 + shift = cat % 32 + expected_bitset[idx] |= 1 << shift + + # check for equality + assert_array_equal(expected_bitset, bitset) + + +@pytest.mark.parametrize( + ( + "X_binned, all_gradients, expected_categories_left, n_bins_non_missing," + "missing_values_bin_idx, has_missing_values, expected_missing_go_to_left" + ), + [ + # 4 categories + ( + [0, 1, 2, 3] * 11, # X_binned + [10, 1, 10, 10] * 11, # all_gradients + [1], # expected_categories_left + 4, # n_bins_non_missing + 4, # missing_values_bin_idx + False, # has_missing_values + None, + ), # expected_missing_go_to_left, unchecked + # Make sure that the categories that are on the right (second half) of + # the sorted categories array can still go in the left child. In this + # case, the best split was found when scanning from right to left. + ( + [0, 1, 2, 3] * 11, # X_binned + [10, 10, 10, 1] * 11, # all_gradients + [3], # expected_categories_left + 4, # n_bins_non_missing + 4, # missing_values_bin_idx + False, # has_missing_values + None, + ), # expected_missing_go_to_left, unchecked + # categories that don't respect MIN_CAT_SUPPORT (cat 4) are always + # mapped to the right child + ( + [0, 1, 2, 3] * 11 + [4] * 5, # X_binned + [10, 10, 10, 1] * 11 + [10] * 5, # all_gradients + [3], # expected_categories_left + 4, # n_bins_non_missing + 4, # missing_values_bin_idx + False, # has_missing_values + None, + ), # expected_missing_go_to_left, unchecked + # categories that don't respect MIN_CAT_SUPPORT are always mapped to + # the right child: in this case a more sensible split could have been + # 3, 4 - 0, 1, 2 + # But the split is still 3 - 0, 1, 2, 4. this is because we only scan + # up to the middle of the sorted category array (0, 1, 2, 3), and + # because we exclude cat 4 in this array. + ( + [0, 1, 2, 3] * 11 + [4] * 5, # X_binned + [10, 10, 10, 1] * 11 + [1] * 5, # all_gradients + [3], # expected_categories_left + 4, # n_bins_non_missing + 4, # missing_values_bin_idx + False, # has_missing_values + None, + ), # expected_missing_go_to_left, unchecked + # 4 categories with missing values that go to the right + ( + [0, 1, 2] * 11 + [9] * 11, # X_binned + [10, 1, 10] * 11 + [10] * 11, # all_gradients + [1], # expected_categories_left + 3, # n_bins_non_missing + 9, # missing_values_bin_idx + True, # has_missing_values + False, + ), # expected_missing_go_to_left + # 4 categories with missing values that go to the left + ( + [0, 1, 2] * 11 + [9] * 11, # X_binned + [10, 1, 10] * 11 + [1] * 11, # all_gradients + [1, 9], # expected_categories_left + 3, # n_bins_non_missing + 9, # missing_values_bin_idx + True, # has_missing_values + True, + ), # expected_missing_go_to_left + # split is on the missing value + ( + [0, 1, 2, 3, 4] * 11 + [255] * 12, # X_binned + [10, 10, 10, 10, 10] * 11 + [1] * 12, # all_gradients + [255], # expected_categories_left + 5, # n_bins_non_missing + 255, # missing_values_bin_idx + True, # has_missing_values + True, + ), # expected_missing_go_to_left + # split on even categories + ( + list(range(60)) * 12, # X_binned + [10, 1] * 360, # all_gradients + list(range(1, 60, 2)), # expected_categories_left + 59, # n_bins_non_missing + 59, # missing_values_bin_idx + True, # has_missing_values + True, + ), # expected_missing_go_to_left + # split on every 8 categories + ( + list(range(256)) * 12, # X_binned + [10, 10, 10, 10, 10, 10, 10, 1] * 384, # all_gradients + list(range(7, 256, 8)), # expected_categories_left + 255, # n_bins_non_missing + 255, # missing_values_bin_idx + True, # has_missing_values + True, + ), # expected_missing_go_to_left + ], +) +def test_splitting_categorical_sanity( + X_binned, + all_gradients, + expected_categories_left, + n_bins_non_missing, + missing_values_bin_idx, + has_missing_values, + expected_missing_go_to_left, +): + # Tests various combinations of categorical splits + + n_samples = len(X_binned) + n_bins = max(X_binned) + 1 + + X_binned = np.array(X_binned, dtype=X_BINNED_DTYPE).reshape(-1, 1) + X_binned = np.asfortranarray(X_binned) + + l2_regularization = 0.0 + min_hessian_to_split = 1e-3 + min_samples_leaf = 1 + min_gain_to_split = 0.0 + + sample_indices = np.arange(n_samples, dtype=np.uint32) + all_gradients = np.array(all_gradients, dtype=G_H_DTYPE) + all_hessians = np.ones(1, dtype=G_H_DTYPE) + has_missing_values = np.array([has_missing_values], dtype=np.uint8) + sum_gradients = all_gradients.sum() + sum_hessians = n_samples + hessians_are_constant = True + + builder = HistogramBuilder( + X_binned, n_bins, all_gradients, all_hessians, hessians_are_constant, n_threads + ) + + n_bins_non_missing = np.array([n_bins_non_missing], dtype=np.uint32) + monotonic_cst = np.array( + [MonotonicConstraint.NO_CST] * X_binned.shape[1], dtype=np.int8 + ) + is_categorical = np.ones_like(monotonic_cst, dtype=np.uint8) + + splitter = Splitter( + X_binned, + n_bins_non_missing, + missing_values_bin_idx, + has_missing_values, + is_categorical, + monotonic_cst, + l2_regularization, + min_hessian_to_split, + min_samples_leaf, + min_gain_to_split, + hessians_are_constant, + ) + + histograms = builder.compute_histograms_brute(sample_indices) + + value = compute_node_value( + sum_gradients, sum_hessians, -np.inf, np.inf, l2_regularization + ) + split_info = splitter.find_node_split( + n_samples, histograms, sum_gradients, sum_hessians, value + ) + + assert split_info.is_categorical + assert split_info.gain > 0 + _assert_categories_equals_bitset( + expected_categories_left, split_info.left_cat_bitset + ) + if has_missing_values: + assert split_info.missing_go_to_left == expected_missing_go_to_left + # If there is no missing value during training, the flag missing_go_to_left + # is set later in the grower. + + # make sure samples are split correctly + samples_left, samples_right, _ = splitter.split_indices( + split_info, splitter.partition + ) + + left_mask = np.isin(X_binned.ravel(), expected_categories_left) + assert_array_equal(sample_indices[left_mask], samples_left) + assert_array_equal(sample_indices[~left_mask], samples_right) + + +def test_split_interaction_constraints(): + """Check that allowed_features are respected.""" + n_features = 4 + # features 1 and 2 are not allowed to be split on + allowed_features = np.array([0, 3], dtype=np.uint32) + n_bins = 5 + n_samples = 10 + l2_regularization = 0.0 + min_hessian_to_split = 1e-3 + min_samples_leaf = 1 + min_gain_to_split = 0.0 + + sample_indices = np.arange(n_samples, dtype=np.uint32) + all_hessians = np.ones(1, dtype=G_H_DTYPE) + sum_hessians = n_samples + hessians_are_constant = True + + split_features = [] + + # The loop is to ensure that we split at least once on each allowed feature (0, 3). + # This is tracked by split_features and checked at the end. + for i in range(10): + rng = np.random.RandomState(919 + i) + X_binned = np.asfortranarray( + rng.randint(0, n_bins - 1, size=(n_samples, n_features)), + dtype=X_BINNED_DTYPE, + ) + X_binned = np.asfortranarray(X_binned, dtype=X_BINNED_DTYPE) + + # Make feature 1 very important + all_gradients = (10 * X_binned[:, 1] + rng.randn(n_samples)).astype(G_H_DTYPE) + sum_gradients = all_gradients.sum() + + builder = HistogramBuilder( + X_binned, + n_bins, + all_gradients, + all_hessians, + hessians_are_constant, + n_threads, + ) + n_bins_non_missing = np.array([n_bins] * X_binned.shape[1], dtype=np.uint32) + has_missing_values = np.array([False] * X_binned.shape[1], dtype=np.uint8) + monotonic_cst = np.array( + [MonotonicConstraint.NO_CST] * X_binned.shape[1], dtype=np.int8 + ) + is_categorical = np.zeros_like(monotonic_cst, dtype=np.uint8) + missing_values_bin_idx = n_bins - 1 + splitter = Splitter( + X_binned, + n_bins_non_missing, + missing_values_bin_idx, + has_missing_values, + is_categorical, + monotonic_cst, + l2_regularization, + min_hessian_to_split, + min_samples_leaf, + min_gain_to_split, + hessians_are_constant, + ) + + assert np.all(sample_indices == splitter.partition) + + histograms = builder.compute_histograms_brute(sample_indices) + value = compute_node_value( + sum_gradients, sum_hessians, -np.inf, np.inf, l2_regularization + ) + + # with all features allowed, feature 1 should be split on as it is the most + # important one by construction of the gradients + si_root = splitter.find_node_split( + n_samples, + histograms, + sum_gradients, + sum_hessians, + value, + allowed_features=None, + ) + assert si_root.feature_idx == 1 + + # only features 0 and 3 are allowed to be split on + si_root = splitter.find_node_split( + n_samples, + histograms, + sum_gradients, + sum_hessians, + value, + allowed_features=allowed_features, + ) + split_features.append(si_root.feature_idx) + assert si_root.feature_idx in allowed_features + + # make sure feature 0 and feature 3 are split on in the constraint setting + assert set(allowed_features) == set(split_features) + + +@pytest.mark.parametrize("forbidden_features", [set(), {1, 3}]) +def test_split_feature_fraction_per_split(forbidden_features): + """Check that feature_fraction_per_split is respected. + + Because we set `n_features = 4` and `feature_fraction_per_split = 0.25`, it means + that calling `splitter.find_node_split` will be allowed to select a split for a + single completely random feature at each call. So if we iterate enough, we should + cover all the allowed features, irrespective of the values of the gradients and + Hessians of the objective. + """ + n_features = 4 + allowed_features = np.array( + list(set(range(n_features)) - forbidden_features), dtype=np.uint32 + ) + n_bins = 5 + n_samples = 40 + l2_regularization = 0.0 + min_hessian_to_split = 1e-3 + min_samples_leaf = 1 + min_gain_to_split = 0.0 + rng = np.random.default_rng(42) + + sample_indices = np.arange(n_samples, dtype=np.uint32) + all_gradients = rng.uniform(low=0.5, high=1, size=n_samples).astype(G_H_DTYPE) + sum_gradients = all_gradients.sum() + all_hessians = np.ones(1, dtype=G_H_DTYPE) + sum_hessians = n_samples + hessians_are_constant = True + + X_binned = np.asfortranarray( + rng.integers(low=0, high=n_bins - 1, size=(n_samples, n_features)), + dtype=X_BINNED_DTYPE, + ) + X_binned = np.asfortranarray(X_binned, dtype=X_BINNED_DTYPE) + builder = HistogramBuilder( + X_binned, + n_bins, + all_gradients, + all_hessians, + hessians_are_constant, + n_threads, + ) + histograms = builder.compute_histograms_brute(sample_indices) + value = compute_node_value( + sum_gradients, sum_hessians, -np.inf, np.inf, l2_regularization + ) + n_bins_non_missing = np.array([n_bins] * X_binned.shape[1], dtype=np.uint32) + has_missing_values = np.array([False] * X_binned.shape[1], dtype=np.uint8) + monotonic_cst = np.array( + [MonotonicConstraint.NO_CST] * X_binned.shape[1], dtype=np.int8 + ) + is_categorical = np.zeros_like(monotonic_cst, dtype=np.uint8) + missing_values_bin_idx = n_bins - 1 + + params = dict( + X_binned=X_binned, + n_bins_non_missing=n_bins_non_missing, + missing_values_bin_idx=missing_values_bin_idx, + has_missing_values=has_missing_values, + is_categorical=is_categorical, + monotonic_cst=monotonic_cst, + l2_regularization=l2_regularization, + min_hessian_to_split=min_hessian_to_split, + min_samples_leaf=min_samples_leaf, + min_gain_to_split=min_gain_to_split, + hessians_are_constant=hessians_are_constant, + rng=rng, + ) + splitter_subsample = Splitter( + feature_fraction_per_split=0.25, # THIS is the important setting here. + **params, + ) + splitter_all_features = Splitter(feature_fraction_per_split=1.0, **params) + + assert np.all(sample_indices == splitter_subsample.partition) + + split_features_subsample = [] + split_features_all = [] + # The loop is to ensure that we split at least once on each feature. + # This is tracked by split_features and checked at the end. + for i in range(20): + si_root = splitter_subsample.find_node_split( + n_samples, + histograms, + sum_gradients, + sum_hessians, + value, + allowed_features=allowed_features, + ) + split_features_subsample.append(si_root.feature_idx) + + # This second splitter is our "counterfactual". + si_root = splitter_all_features.find_node_split( + n_samples, + histograms, + sum_gradients, + sum_hessians, + value, + allowed_features=allowed_features, + ) + split_features_all.append(si_root.feature_idx) + + # Make sure all features are split on. + assert set(split_features_subsample) == set(allowed_features) + + # Make sure, our counterfactual always splits on same feature. + assert len(set(split_features_all)) == 1 diff --git a/shared/package-files/9e/9e46bef5c47da7454a95754c9180ccc1d0bdc2f5d0e99305462cd79bc621b64e/blob b/shared/package-files/9e/9e46bef5c47da7454a95754c9180ccc1d0bdc2f5d0e99305462cd79bc621b64e/blob new file mode 100644 index 0000000000000000000000000000000000000000..b5638bb13e6e159bab6d630c9f479591dd7abb58 --- /dev/null +++ b/shared/package-files/9e/9e46bef5c47da7454a95754c9180ccc1d0bdc2f5d0e99305462cd79bc621b64e/blob @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::fft_fftn(Tensor self, SymInt[1]? s=None, int[1]? dim=None, str? norm=None) -> Tensor +inline at::Tensor fft_fftn(const at::Tensor & self, at::OptionalIntArrayRef s=c10::nullopt, at::OptionalIntArrayRef dim=c10::nullopt, c10::optional norm=c10::nullopt) { + return at::_ops::fft_fftn::call(self, s.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*s)) : c10::nullopt, dim, norm); +} +namespace symint { + template ::value>> + at::Tensor fft_fftn(const at::Tensor & self, at::OptionalIntArrayRef s=c10::nullopt, at::OptionalIntArrayRef dim=c10::nullopt, c10::optional norm=c10::nullopt) { + return at::_ops::fft_fftn::call(self, s.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*s)) : c10::nullopt, dim, norm); + } +} + +// aten::fft_fftn(Tensor self, SymInt[1]? s=None, int[1]? dim=None, str? norm=None) -> Tensor +inline at::Tensor fft_fftn_symint(const at::Tensor & self, at::OptionalSymIntArrayRef s=c10::nullopt, at::OptionalIntArrayRef dim=c10::nullopt, c10::optional norm=c10::nullopt) { + return at::_ops::fft_fftn::call(self, s, dim, norm); +} +namespace symint { + template ::value>> + at::Tensor fft_fftn(const at::Tensor & self, at::OptionalSymIntArrayRef s=c10::nullopt, at::OptionalIntArrayRef dim=c10::nullopt, c10::optional norm=c10::nullopt) { + return at::_ops::fft_fftn::call(self, s, dim, norm); + } +} + +// aten::fft_fftn.out(Tensor self, SymInt[1]? s=None, int[1]? dim=None, str? norm=None, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & fft_fftn_out(at::Tensor & out, const at::Tensor & self, at::OptionalIntArrayRef s=c10::nullopt, at::OptionalIntArrayRef dim=c10::nullopt, c10::optional norm=c10::nullopt) { + return at::_ops::fft_fftn_out::call(self, s.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*s)) : c10::nullopt, dim, norm, out); +} +namespace symint { + template ::value>> + at::Tensor & fft_fftn_out(at::Tensor & out, const at::Tensor & self, at::OptionalIntArrayRef s=c10::nullopt, at::OptionalIntArrayRef dim=c10::nullopt, c10::optional norm=c10::nullopt) { + return at::_ops::fft_fftn_out::call(self, s.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*s)) : c10::nullopt, dim, norm, out); + } +} + +// aten::fft_fftn.out(Tensor self, SymInt[1]? s=None, int[1]? dim=None, str? norm=None, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & fft_fftn_outf(const at::Tensor & self, at::OptionalIntArrayRef s, at::OptionalIntArrayRef dim, c10::optional norm, at::Tensor & out) { + return at::_ops::fft_fftn_out::call(self, s.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*s)) : c10::nullopt, dim, norm, out); +} +namespace symint { + template ::value>> + at::Tensor & fft_fftn_outf(const at::Tensor & self, at::OptionalIntArrayRef s, at::OptionalIntArrayRef dim, c10::optional norm, at::Tensor & out) { + return at::_ops::fft_fftn_out::call(self, s.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*s)) : c10::nullopt, dim, norm, out); + } +} + +// aten::fft_fftn.out(Tensor self, SymInt[1]? s=None, int[1]? dim=None, str? norm=None, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & fft_fftn_symint_out(at::Tensor & out, const at::Tensor & self, at::OptionalSymIntArrayRef s=c10::nullopt, at::OptionalIntArrayRef dim=c10::nullopt, c10::optional norm=c10::nullopt) { + return at::_ops::fft_fftn_out::call(self, s, dim, norm, out); +} +namespace symint { + template ::value>> + at::Tensor & fft_fftn_out(at::Tensor & out, const at::Tensor & self, at::OptionalSymIntArrayRef s=c10::nullopt, at::OptionalIntArrayRef dim=c10::nullopt, c10::optional norm=c10::nullopt) { + return at::_ops::fft_fftn_out::call(self, s, dim, norm, out); + } +} + +// aten::fft_fftn.out(Tensor self, SymInt[1]? s=None, int[1]? dim=None, str? norm=None, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & fft_fftn_symint_outf(const at::Tensor & self, at::OptionalSymIntArrayRef s, at::OptionalIntArrayRef dim, c10::optional norm, at::Tensor & out) { + return at::_ops::fft_fftn_out::call(self, s, dim, norm, out); +} +namespace symint { + template ::value>> + at::Tensor & fft_fftn_outf(const at::Tensor & self, at::OptionalSymIntArrayRef s, at::OptionalIntArrayRef dim, c10::optional norm, at::Tensor & out) { + return at::_ops::fft_fftn_out::call(self, s, dim, norm, out); + } +} + +} diff --git a/shared/package-files/9e/9e4758674c3965eb58756a4820a00b2e1e7fde7361144d61bd557dac9e72ca19/blob b/shared/package-files/9e/9e4758674c3965eb58756a4820a00b2e1e7fde7361144d61bd557dac9e72ca19/blob new file mode 100644 index 0000000000000000000000000000000000000000..24e4e0b7cef0a5fa66a70fa0ad70b52364b02091 --- /dev/null +++ b/shared/package-files/9e/9e4758674c3965eb58756a4820a00b2e1e7fde7361144d61bd557dac9e72ca19/blob @@ -0,0 +1,255 @@ +""" Google BigQuery support """ +from __future__ import annotations + +from typing import ( + TYPE_CHECKING, + Any, +) +import warnings + +from pandas.compat._optional import import_optional_dependency +from pandas.util._exceptions import find_stack_level + +if TYPE_CHECKING: + from google.auth.credentials import Credentials + + from pandas import DataFrame + + +def _try_import(): + # since pandas is a dependency of pandas-gbq + # we need to import on first use + msg = ( + "pandas-gbq is required to load data from Google BigQuery. " + "See the docs: https://pandas-gbq.readthedocs.io." + ) + pandas_gbq = import_optional_dependency("pandas_gbq", extra=msg) + return pandas_gbq + + +def read_gbq( + query: str, + project_id: str | None = None, + index_col: str | None = None, + col_order: list[str] | None = None, + reauth: bool = False, + auth_local_webserver: bool = True, + dialect: str | None = None, + location: str | None = None, + configuration: dict[str, Any] | None = None, + credentials: Credentials | None = None, + use_bqstorage_api: bool | None = None, + max_results: int | None = None, + progress_bar_type: str | None = None, +) -> DataFrame: + """ + Load data from Google BigQuery. + + .. deprecated:: 2.2.0 + + Please use ``pandas_gbq.read_gbq`` instead. + + This function requires the `pandas-gbq package + `__. + + See the `How to authenticate with Google BigQuery + `__ + guide for authentication instructions. + + Parameters + ---------- + query : str + SQL-Like Query to return data values. + project_id : str, optional + Google BigQuery Account project ID. Optional when available from + the environment. + index_col : str, optional + Name of result column to use for index in results DataFrame. + col_order : list(str), optional + List of BigQuery column names in the desired order for results + DataFrame. + reauth : bool, default False + Force Google BigQuery to re-authenticate the user. This is useful + if multiple accounts are used. + auth_local_webserver : bool, default True + Use the `local webserver flow`_ instead of the `console flow`_ + when getting user credentials. + + .. _local webserver flow: + https://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_local_server + .. _console flow: + https://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_console + + *New in version 0.2.0 of pandas-gbq*. + + .. versionchanged:: 1.5.0 + Default value is changed to ``True``. Google has deprecated the + ``auth_local_webserver = False`` `"out of band" (copy-paste) + flow + `_. + dialect : str, default 'legacy' + Note: The default value is changing to 'standard' in a future version. + + SQL syntax dialect to use. Value can be one of: + + ``'legacy'`` + Use BigQuery's legacy SQL dialect. For more information see + `BigQuery Legacy SQL Reference + `__. + ``'standard'`` + Use BigQuery's standard SQL, which is + compliant with the SQL 2011 standard. For more information + see `BigQuery Standard SQL Reference + `__. + location : str, optional + Location where the query job should run. See the `BigQuery locations + documentation + `__ for a + list of available locations. The location must match that of any + datasets used in the query. + + *New in version 0.5.0 of pandas-gbq*. + configuration : dict, optional + Query config parameters for job processing. + For example: + + configuration = {'query': {'useQueryCache': False}} + + For more information see `BigQuery REST API Reference + `__. + credentials : google.auth.credentials.Credentials, optional + Credentials for accessing Google APIs. Use this parameter to override + default credentials, such as to use Compute Engine + :class:`google.auth.compute_engine.Credentials` or Service Account + :class:`google.oauth2.service_account.Credentials` directly. + + *New in version 0.8.0 of pandas-gbq*. + use_bqstorage_api : bool, default False + Use the `BigQuery Storage API + `__ to + download query results quickly, but at an increased cost. To use this + API, first `enable it in the Cloud Console + `__. + You must also have the `bigquery.readsessions.create + `__ + permission on the project you are billing queries to. + + This feature requires version 0.10.0 or later of the ``pandas-gbq`` + package. It also requires the ``google-cloud-bigquery-storage`` and + ``fastavro`` packages. + + max_results : int, optional + If set, limit the maximum number of rows to fetch from the query + results. + + progress_bar_type : Optional, str + If set, use the `tqdm `__ library to + display a progress bar while the data downloads. Install the + ``tqdm`` package to use this feature. + + Possible values of ``progress_bar_type`` include: + + ``None`` + No progress bar. + ``'tqdm'`` + Use the :func:`tqdm.tqdm` function to print a progress bar + to :data:`sys.stderr`. + ``'tqdm_notebook'`` + Use the :func:`tqdm.tqdm_notebook` function to display a + progress bar as a Jupyter notebook widget. + ``'tqdm_gui'`` + Use the :func:`tqdm.tqdm_gui` function to display a + progress bar as a graphical dialog box. + + Returns + ------- + df: DataFrame + DataFrame representing results of query. + + See Also + -------- + pandas_gbq.read_gbq : This function in the pandas-gbq library. + DataFrame.to_gbq : Write a DataFrame to Google BigQuery. + + Examples + -------- + Example taken from `Google BigQuery documentation + `_ + + >>> sql = "SELECT name FROM table_name WHERE state = 'TX' LIMIT 100;" + >>> df = pd.read_gbq(sql, dialect="standard") # doctest: +SKIP + >>> project_id = "your-project-id" # doctest: +SKIP + >>> df = pd.read_gbq(sql, + ... project_id=project_id, + ... dialect="standard" + ... ) # doctest: +SKIP + """ + warnings.warn( + "read_gbq is deprecated and will be removed in a future version. " + "Please use pandas_gbq.read_gbq instead: " + "https://pandas-gbq.readthedocs.io/en/latest/api.html#pandas_gbq.read_gbq", + FutureWarning, + stacklevel=find_stack_level(), + ) + pandas_gbq = _try_import() + + kwargs: dict[str, str | bool | int | None] = {} + + # START: new kwargs. Don't populate unless explicitly set. + if use_bqstorage_api is not None: + kwargs["use_bqstorage_api"] = use_bqstorage_api + if max_results is not None: + kwargs["max_results"] = max_results + + kwargs["progress_bar_type"] = progress_bar_type + # END: new kwargs + + return pandas_gbq.read_gbq( + query, + project_id=project_id, + index_col=index_col, + col_order=col_order, + reauth=reauth, + auth_local_webserver=auth_local_webserver, + dialect=dialect, + location=location, + configuration=configuration, + credentials=credentials, + **kwargs, + ) + + +def to_gbq( + dataframe: DataFrame, + destination_table: str, + project_id: str | None = None, + chunksize: int | None = None, + reauth: bool = False, + if_exists: str = "fail", + auth_local_webserver: bool = True, + table_schema: list[dict[str, str]] | None = None, + location: str | None = None, + progress_bar: bool = True, + credentials: Credentials | None = None, +) -> None: + warnings.warn( + "to_gbq is deprecated and will be removed in a future version. " + "Please use pandas_gbq.to_gbq instead: " + "https://pandas-gbq.readthedocs.io/en/latest/api.html#pandas_gbq.to_gbq", + FutureWarning, + stacklevel=find_stack_level(), + ) + pandas_gbq = _try_import() + pandas_gbq.to_gbq( + dataframe, + destination_table, + project_id=project_id, + chunksize=chunksize, + reauth=reauth, + if_exists=if_exists, + auth_local_webserver=auth_local_webserver, + table_schema=table_schema, + location=location, + progress_bar=progress_bar, + credentials=credentials, + ) diff --git a/shared/package-files/9e/9e4b5ea2bdb2f0b818f0549ff5b4079b60ac02f541053427c4bcbcb52a7b5f77/blob b/shared/package-files/9e/9e4b5ea2bdb2f0b818f0549ff5b4079b60ac02f541053427c4bcbcb52a7b5f77/blob new file mode 100644 index 0000000000000000000000000000000000000000..8c82bf542169673ac1dc8917a8a53c114cf69b19 --- /dev/null +++ b/shared/package-files/9e/9e4b5ea2bdb2f0b818f0549ff5b4079b60ac02f541053427c4bcbcb52a7b5f77/blob @@ -0,0 +1,347 @@ +from dataclasses import dataclass +from typing import TYPE_CHECKING + +import torch +from torch.utils._python_dispatch import is_traceable_wrapper_subclass +from . import trace_rules, variables +from .comptime import comptime +from .eval_frame import DisableContext, innermost_fn, RunOnlyContext +from .exc import IncorrectUsage +from .external_utils import is_compiling + +if TYPE_CHECKING: + from torch._C._dynamo.eval_frame import ( # noqa: F401 + reset_code, + set_eval_frame, + set_guard_error_hook, + skip_code, + unsupported, + ) +else: + for name in dir(torch._C._dynamo.eval_frame): + if name.startswith("__"): + continue + globals()[name] = getattr(torch._C._dynamo.eval_frame, name) + + +def run(fn=None): + """Don't do any dynamic compiles, just use prior optimizations""" + if fn is not None: + fn = innermost_fn(fn) + assert callable(fn) + return RunOnlyContext()(fn) + return RunOnlyContext() + + +def disable(fn=None, recursive=True): + """ + Decorator and context manager to disable TorchDynamo + + If recursive=True, Dynamo is completely skipped on the decorated function + frame as well as the recursively invoked functions. + + If recursive=False, Dynamo skips frames associated with the function code, + but still process recursively invoked frames. + """ + if recursive: + if fn is not None: + fn = innermost_fn(fn) + assert callable(fn) + return DisableContext()(fn) + return DisableContext() + else: + return skip(fn) + + +def skip(fn=None): + """ + Skip frames associated with the function code, but still process recursively + invoked frames + """ + if fn is None: + return skip + fn = innermost_fn(fn) + assert callable(fn) + skip_code(fn.__code__) + fn._torchdynamo_disable = True + return fn + + +def assume_constant_result(fn): + fn._dynamo_marked_constant = True + return fn + + +def allow_in_graph(fn): + """ + Customize which functions TorchDynamo will include in the generated + graph. Similar to `torch.fx.wrap()`. + :: + + torch._dynamo.allow_in_graph(my_custom_function) + + @torch._dynamo.optimize(...) + def fn(a): + x = torch.add(x, 1) + x = my_custom_function(x) + x = torch.add(x, 1) + return x + + fn(...) + + Will capture a single graph containing `my_custom_function()`. + """ + if isinstance(fn, (list, tuple)): + return [allow_in_graph(x) for x in fn] + assert callable(fn), "allow_in_graph expects a callable" + if trace_rules.lookup_callable(fn) != variables.TorchInGraphFunctionVariable: + trace_rules._disallowed_callable_ids.remove(id(fn)) + trace_rules._allowed_callable_ids.add(id(fn)) + return fn + + +def _disallow_in_graph_helper(throw_if_not_allowed): + def inner(fn): + if isinstance(fn, (list, tuple)): + return [disallow_in_graph(x) for x in fn] + assert callable(fn), "disallow_in_graph expects a callable" + if ( + throw_if_not_allowed + and trace_rules.lookup_callable(fn) + != variables.TorchInGraphFunctionVariable + and trace_rules.lookup(fn) != variables.TorchInGraphFunctionVariable + ): + raise IncorrectUsage( + "disallow_in_graph is expected to be used on an already allowed callable (like torch.* ops). " + "Allowed callables means callables that TorchDynamo puts as-is in the extracted graph." + ) + trace_rules._allowed_callable_ids.remove(id(fn)) + trace_rules._disallowed_callable_ids.add(id(fn)) + return fn + + return inner + + +def disallow_in_graph(fn): + """ + Customize which functions TorchDynamo will exclude in the generated + graph and force a graph break on. + :: + + torch._dynamo.disallow_in_graph(torch.sub) + + @torch._dynamo.optimize(...) + def fn(a): + x = torch.add(x, 1) + x = torch.sub(x, 1) + x = torch.add(x, 1) + return x + + fn(...) + + Will break the graph on `torch.sub`, and give two graphs each with a + single `torch.add()` op. + """ + return _disallow_in_graph_helper(throw_if_not_allowed=True)(fn) + + +@_disallow_in_graph_helper(throw_if_not_allowed=False) +def graph_break(): + """Force a graph break""" + pass + + +def forbid_in_graph(fn): + """ + Customize which functions TorchDynamo will assert are not present while tracing. + + If you want a graph break on this function instead, use disallow_in_graph. + TODO(voz): We now have allow_in_graph, disallow_in_graph, forbid_in_graph - some more robust + documentation would not be amiss. + """ + if isinstance(fn, (list, tuple)): + return [forbid_in_graph(x) for x in fn] + assert callable(fn), "forbid_in_graph applies only to callables" + fn._dynamo_forbidden = True + return fn + + +# Helper function to flatten a tensor subclass and apply a function to +# all inner tensors that match the outer dim. Used to reduce duplication +# across the various marking APIs. +def _apply_func_to_inner_tensors_of_same_dim(func, t, *args, **kwargs): + assert is_traceable_wrapper_subclass(t) + + attrs, ctx = t.__tensor_flatten__() + for attr in attrs: + inner = getattr(t, attr) + if inner.dim() == t.dim(): + func(inner, *args, **kwargs) + + +@dataclass(frozen=True) +class _DimRange: + """ + This represents an dimension of a tensor and the corresponding + min and max values it can take. Don't create this + class directly; instead, use :func:`mark_dynamic`. + """ + + dim: int + min: int + max: int + + +@forbid_in_graph +def mark_dynamic(t, index, *, min=None, max=None): + """ + Mark a tensor as having a dynamic dim and set corresponding min and max range for the dim. + + [Note - on the state of mark_dynamic] + + The behavior of having a dynamic dimension on a tensor is governed by a few factors: + + 1) torch._dynamo.config dynamic_shapes True or False. + a) dynamic_shapes=True - dynamic_shapes must be True for mark_dynamic to work. + a) dynamic_shapes=False - This config will raise an exception when used in conjunction with + mark_dynamic. We will eventually support this. + + 2) If the dimension is fully constrained - as in, it does not allow more than a single value + in both eager (torch.compile, torch._dynamo.optimize) mode and export mode (torch._dynamo.export), + we will raise an error + + 3) If the dimension is partially constrained - allowing at least 2 values but not the full unbounded + range of shapes, in eager we will pass it through, but export will raise an error. + + 4) Attempts to trace this function will explicitly raise. As such, all calls to mark_dynamic must be made + before torch.compile. + + """ + if is_traceable_wrapper_subclass(t): + # default behavior: mirror mark_dynamic() on all inner tensors with same dim as t + # TODO: Make this configurable via a supported public API + _apply_func_to_inner_tensors_of_same_dim( + mark_dynamic, t, index, min=min, max=max + ) + + if isinstance(index, int): + if not hasattr(t, "_dynamo_dynamic_indices"): + t._dynamo_dynamic_indices = set() + t._dynamo_dynamic_range = set() + # TODO(voz): Should we bounds check? + t._dynamo_dynamic_indices.add(index) + t._dynamo_dynamic_range.add(_DimRange(index, min, max)) + return + + assert isinstance(index, (list, tuple)) + for i in index: + mark_dynamic(t, i, min=min, max=max) + + +@forbid_in_graph +def maybe_mark_dynamic(t, index): + """ + Mark a tensor as having a dynamic dim, but don't enforce it (i.e., if this + dimension ends up getting specialized, don't error). + """ + if is_traceable_wrapper_subclass(t): + # default behavior: mirror maybe_mark_dynamic() on all inner tensors with same dim as t + # TODO: Make this configurable via a supported public API + _apply_func_to_inner_tensors_of_same_dim(maybe_mark_dynamic, t, index) + + if isinstance(index, int): + if not hasattr(t, "_dynamo_weak_dynamic_indices"): + t._dynamo_weak_dynamic_indices = set() + # TODO(voz): Should we bounds check? + t._dynamo_weak_dynamic_indices.add(index) + return + + assert isinstance(index, (list, tuple)) + for i in index: + maybe_mark_dynamic(t, i) + + +def mark_static(t, index=None): + """ + Mark a tensor as having a static dim. + + This will prevent us from attempting to compile it dynamically + when dynamic=True; this can improve trace-time performance. + + This has lower precedence than mark_dynamic. + + Unlike mark_dynamic, this can be done inside a graph, in which case it + induces specialization on the tensor. + """ + if is_compiling(): + if index is None: + for s in t.size(): + comptime.force_static(s) + else: + comptime.force_static(t.size(index)) + return + + if is_traceable_wrapper_subclass(t): + # default behavior: mirror mark_static() on all inner tensors with same dim as t + # TODO: Make this configurable via a supported public API + _apply_func_to_inner_tensors_of_same_dim(mark_static, t, index) + + if isinstance(index, int): + if not hasattr(t, "_dynamo_static_indices"): + t._dynamo_static_indices = set() + # TODO(voz): Should we bounds check? + t._dynamo_static_indices.add(index) + elif index is None: + for i in range(t.dim()): + mark_static(t, i) + else: + assert isinstance(index, (list, tuple)) + for i in index: + mark_static(t, i) + + +@forbid_in_graph +def mark_static_address(t, guard=True): + """ + Marks an input tensor whose data_ptr will not change across multiple calls + to a dynamo-compiled function. This indicates to cudagraphs that an extra allocation + is not needed for this input. The data_ptr will be guarded if guard=True. Note: + Tensors marked in this way will be kept alive until `torch._dynamo.reset()` is called. + """ + if not isinstance(t, torch.Tensor): + raise TypeError(f"mark_static_address expects a tensor but recieved {type(t)}") + + if guard: + t._dynamo_static_input_type = "guarded" # type: ignore[attr-defined] + else: + t._dynamo_static_input_type = "unguarded" # type: ignore[attr-defined] + + +# Note: this carefully avoids eagerly import einops. +# TODO: we should delete this whole _allow_in_graph_einops logic by approximately 2024 Q2 +def _allow_in_graph_einops(): + import einops + + try: + # requires einops > 0.6.1, torch >= 2.0 + from einops._torch_specific import ( # type: ignore[attr-defined] # noqa: F401 + _ops_were_registered_in_torchdynamo, + ) + + # einops > 0.6.1 will call the op registration logic as it is imported. + pass + except ImportError: + # einops <= 0.6.1 + allow_in_graph(einops.rearrange) + allow_in_graph(einops.reduce) + if hasattr(einops, "repeat"): + allow_in_graph(einops.repeat) # available since einops 0.2.0 + if hasattr(einops, "einsum"): + allow_in_graph(einops.einsum) # available since einops 0.5.0 + if hasattr(einops, "pack"): + allow_in_graph(einops.pack) # available since einops 0.6.0 + if hasattr(einops, "unpack"): + allow_in_graph(einops.unpack) # available since einops 0.6.0 + + +trace_rules.add_module_init_func("einops", _allow_in_graph_einops) diff --git a/shared/package-files/9e/9e4de7801ff4d74fe71c204aa24854be37cff135a0895fad869fc0be213f8342/blob b/shared/package-files/9e/9e4de7801ff4d74fe71c204aa24854be37cff135a0895fad869fc0be213f8342/blob new file mode 100644 index 0000000000000000000000000000000000000000..fd3a7171863c75f270e163d584ce4dcae892d5ba --- /dev/null +++ b/shared/package-files/9e/9e4de7801ff4d74fe71c204aa24854be37cff135a0895fad869fc0be213f8342/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API embedding { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, c10::SymInt, bool, bool); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::embedding") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "embedding(Tensor weight, Tensor indices, SymInt padding_idx=-1, bool scale_grad_by_freq=False, bool sparse=False) -> Tensor") + static at::Tensor call(const at::Tensor & weight, const at::Tensor & indices, c10::SymInt padding_idx, bool scale_grad_by_freq, bool sparse); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & weight, const at::Tensor & indices, c10::SymInt padding_idx, bool scale_grad_by_freq, bool sparse); +}; + +struct TORCH_API embedding_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, c10::SymInt, bool, bool, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::embedding") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "embedding.out(Tensor weight, Tensor indices, SymInt padding_idx=-1, bool scale_grad_by_freq=False, bool sparse=False, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & weight, const at::Tensor & indices, c10::SymInt padding_idx, bool scale_grad_by_freq, bool sparse, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & weight, const at::Tensor & indices, c10::SymInt padding_idx, bool scale_grad_by_freq, bool sparse, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9e/9e4fe775c20a823706c49f2c928e08cd67d8d091b3224f1761a67001d7e31f13/blob b/shared/package-files/9e/9e4fe775c20a823706c49f2c928e08cd67d8d091b3224f1761a67001d7e31f13/blob new file mode 100644 index 0000000000000000000000000000000000000000..a8a55bb782c479ff2f0243601bd36a034980b2fe --- /dev/null +++ b/shared/package-files/9e/9e4fe775c20a823706c49f2c928e08cd67d8d091b3224f1761a67001d7e31f13/blob @@ -0,0 +1,151 @@ +#pragma once +#include +#include +#include +#include +#include + +namespace c10 { +/** + * class AliasInfo + * + * Data structure to hold aliasing information for an `Argument`. They can be + * nested to represent aliasing information on contained types. + * + * There is a `beforeSet` which describes the aliasing information before the + * operator executes, and an `afterSet` that describes aliasing info + * after execution. + */ +class AliasInfo { + public: + // Symbol for the set that can alias anything + static Symbol wildcardSet() { + static const Symbol wc = Symbol::fromQualString("alias::*"); + return wc; + } + + void setIsWrite(bool isWrite) { + isWrite_ = isWrite; + } + + bool isWrite() const { + return isWrite_; + } + + void addBeforeSet(Symbol aliasSet) { + beforeSets_.insert(aliasSet); + } + + void addAfterSet(Symbol aliasSet) { + afterSets_.insert(aliasSet); + } + + const std::unordered_set& beforeSets() const { + return beforeSets_; + } + + const std::unordered_set& afterSets() const { + return afterSets_; + } + + Symbol beforeSet() const { + AT_ASSERT(beforeSets_.size() == 1); + return *beforeSets_.begin(); + } + + bool isWildcardBefore() const { + return beforeSets_.count(wildcardSet()) != 0; + } + + bool isWildcardAfter() const { + return afterSets_.count(wildcardSet()) != 0; + } + + // the alias info for the contained types of the type + // e.g. if this is an annotation on List[T], `sets` refers to + // the alias sets that the list may be in + // while containedTypes()[0] refers to the sets that members of the list + // may be in + void addContainedType(AliasInfo aliasInfo) { + containedTypes_.push_back(std::move(aliasInfo)); + } + const std::vector& containedTypes() const { + return containedTypes_; + } + + private: + std::unordered_set beforeSets_; + std::unordered_set afterSets_; + std::vector containedTypes_; + bool isWrite_ = false; +}; + +inline bool operator==(const AliasInfo& lhs, const AliasInfo& rhs) { + return lhs.isWrite() == rhs.isWrite() + && lhs.beforeSets() == rhs.beforeSets() + && lhs.afterSets() == rhs.afterSets() + && lhs.containedTypes() == rhs.containedTypes(); +} + +// this does match the way things are represented in the schema +inline std::ostream& operator<<(std::ostream& out, const AliasInfo& aliasInfo) { + out << "("; + bool first = true; + for (const auto& set : aliasInfo.beforeSets()) { + if (first) { + first = false; + } else { + out << "|"; + } + out << set.toUnqualString(); + } + if (aliasInfo.isWrite()) { + out << "!"; + } + if (aliasInfo.beforeSets() != aliasInfo.afterSets()) { + out << " -> "; + first = true; + for (const auto& set : aliasInfo.afterSets()) { + if (first) { + first = false; + } else { + out << "|"; + } + out << set.toUnqualString(); + } + } + out << ")"; + return out; +} +} // namespace c10 + +namespace std { +template <> + struct hash { + size_t operator()(const c10::AliasInfo& aliasInfo) const { + auto hash = std::hash()(aliasInfo.isWrite()); + + // NOTE: for unordered_set hashes, we couldn't use hash_combine + // because hash_combine is order dependent. Instead, we choose to + // use XOR as the combining function as XOR is commutative. + size_t before_set_hash_seed = 0; + for (auto &e: aliasInfo.beforeSets()) { + auto symbol_hash = std::hash()(e); + before_set_hash_seed = before_set_hash_seed ^ symbol_hash; + } + size_t after_set_hash_seed = 0; + for (auto &e: aliasInfo.afterSets()) { + auto symbol_hash = std::hash()(e); + after_set_hash_seed = after_set_hash_seed ^ symbol_hash; + } + + hash = c10::hash_combine(hash, before_set_hash_seed); + hash = c10::hash_combine(hash, after_set_hash_seed); + for (auto &e: aliasInfo.containedTypes()) { + auto contained_type_hash = std::hash()(e); + hash = c10::hash_combine(hash, contained_type_hash); + } + return hash; + } + }; +} diff --git a/shared/package-files/9e/9e5014d3158742a4599fb24d575eb762002fe70c25ca4c2c8a43328f365e6642/blob b/shared/package-files/9e/9e5014d3158742a4599fb24d575eb762002fe70c25ca4c2c8a43328f365e6642/blob new file mode 100644 index 0000000000000000000000000000000000000000..fbb71c2cb123cb21fb57ec32341d86bff06f6a17 --- /dev/null +++ b/shared/package-files/9e/9e5014d3158742a4599fb24d575eb762002fe70c25ca4c2c8a43328f365e6642/blob @@ -0,0 +1,22 @@ +#pragma once +// ${generated_comment} + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +#if defined(AT_PER_OPERATOR_HEADERS) && defined(TORCH_ASSERT_ONLY_METHOD_OPERATORS) +#error This change adds a dependency on all pytorch operators, meaning the \ + file will need to be re-compiled every time an operator is changed or added. \ + Consider including a specific operator from \ + . \ + See NOTE [TORCH_ASSERT_ONLY_METHOD_OPERATORS]. +#endif + +${DispatchKeyFunctions_inl_includes} + + +${dispatch_namespaced_declarations} diff --git a/shared/package-files/9e/9e50f00682d907dde6fe5e79a9f64cfd097ee0bf383d26229a842ab794f3a439/blob b/shared/package-files/9e/9e50f00682d907dde6fe5e79a9f64cfd097ee0bf383d26229a842ab794f3a439/blob new file mode 100644 index 0000000000000000000000000000000000000000..18db3e34db979240b4a4a943ea6931db3091321d --- /dev/null +++ b/shared/package-files/9e/9e50f00682d907dde6fe5e79a9f64cfd097ee0bf383d26229a842ab794f3a439/blob @@ -0,0 +1,409 @@ +############################################################################### +# Synchronization primitives based on our SemLock implementation +# +# author: Thomas Moreau and Olivier Grisel +# +# adapted from multiprocessing/synchronize.py (17/02/2017) +# * Remove ctx argument for compatibility reason +# * Registers a cleanup function with the loky resource_tracker to remove the +# semaphore when the process dies instead. +# +# TODO: investigate which Python version is required to be able to use +# multiprocessing.resource_tracker and therefore multiprocessing.synchronize +# instead of a loky-specific fork. + +import os +import sys +import tempfile +import threading +import _multiprocessing +from time import time as _time +from multiprocessing import process, util +from multiprocessing.context import assert_spawning + +from . import resource_tracker + +__all__ = [ + "Lock", + "RLock", + "Semaphore", + "BoundedSemaphore", + "Condition", + "Event", +] +# Try to import the mp.synchronize module cleanly, if it fails +# raise ImportError for platforms lacking a working sem_open implementation. +# See issue 3770 +try: + from _multiprocessing import SemLock as _SemLock + from _multiprocessing import sem_unlink +except ImportError: + raise ImportError( + "This platform lacks a functioning sem_open" + " implementation, therefore, the required" + " synchronization primitives needed will not" + " function, see issue 3770." + ) + +# +# Constants +# + +RECURSIVE_MUTEX, SEMAPHORE = range(2) +SEM_VALUE_MAX = _multiprocessing.SemLock.SEM_VALUE_MAX + + +# +# Base class for semaphores and mutexes; wraps `_multiprocessing.SemLock` +# + + +class SemLock: + + _rand = tempfile._RandomNameSequence() + + def __init__(self, kind, value, maxvalue, name=None): + # unlink_now is only used on win32 or when we are using fork. + unlink_now = False + if name is None: + # Try to find an unused name for the SemLock instance. + for _ in range(100): + try: + self._semlock = _SemLock( + kind, value, maxvalue, SemLock._make_name(), unlink_now + ) + except FileExistsError: # pragma: no cover + pass + else: + break + else: # pragma: no cover + raise FileExistsError("cannot find name for semaphore") + else: + self._semlock = _SemLock(kind, value, maxvalue, name, unlink_now) + self.name = name + util.debug( + f"created semlock with handle {self._semlock.handle} and name " + f'"{self.name}"' + ) + + self._make_methods() + + def _after_fork(obj): + obj._semlock._after_fork() + + util.register_after_fork(self, _after_fork) + + # When the object is garbage collected or the + # process shuts down we unlink the semaphore name + resource_tracker.register(self._semlock.name, "semlock") + util.Finalize( + self, SemLock._cleanup, (self._semlock.name,), exitpriority=0 + ) + + @staticmethod + def _cleanup(name): + try: + sem_unlink(name) + except FileNotFoundError: + # Already unlinked, possibly by user code: ignore and make sure to + # unregister the semaphore from the resource tracker. + pass + finally: + resource_tracker.unregister(name, "semlock") + + def _make_methods(self): + self.acquire = self._semlock.acquire + self.release = self._semlock.release + + def __enter__(self): + return self._semlock.acquire() + + def __exit__(self, *args): + return self._semlock.release() + + def __getstate__(self): + assert_spawning(self) + sl = self._semlock + h = sl.handle + return (h, sl.kind, sl.maxvalue, sl.name) + + def __setstate__(self, state): + self._semlock = _SemLock._rebuild(*state) + util.debug( + f'recreated blocker with handle {state[0]!r} and name "{state[3]}"' + ) + self._make_methods() + + @staticmethod + def _make_name(): + # OSX does not support long names for semaphores + return f"/loky-{os.getpid()}-{next(SemLock._rand)}" + + +# +# Semaphore +# + + +class Semaphore(SemLock): + def __init__(self, value=1): + SemLock.__init__(self, SEMAPHORE, value, SEM_VALUE_MAX) + + def get_value(self): + if sys.platform == "darwin": + raise NotImplementedError("OSX does not implement sem_getvalue") + return self._semlock._get_value() + + def __repr__(self): + try: + value = self._semlock._get_value() + except Exception: + value = "unknown" + return f"<{self.__class__.__name__}(value={value})>" + + +# +# Bounded semaphore +# + + +class BoundedSemaphore(Semaphore): + def __init__(self, value=1): + SemLock.__init__(self, SEMAPHORE, value, value) + + def __repr__(self): + try: + value = self._semlock._get_value() + except Exception: + value = "unknown" + return ( + f"<{self.__class__.__name__}(value={value}, " + f"maxvalue={self._semlock.maxvalue})>" + ) + + +# +# Non-recursive lock +# + + +class Lock(SemLock): + def __init__(self): + super().__init__(SEMAPHORE, 1, 1) + + def __repr__(self): + try: + if self._semlock._is_mine(): + name = process.current_process().name + if threading.current_thread().name != "MainThread": + name = f"{name}|{threading.current_thread().name}" + elif self._semlock._get_value() == 1: + name = "None" + elif self._semlock._count() > 0: + name = "SomeOtherThread" + else: + name = "SomeOtherProcess" + except Exception: + name = "unknown" + return f"<{self.__class__.__name__}(owner={name})>" + + +# +# Recursive lock +# + + +class RLock(SemLock): + def __init__(self): + super().__init__(RECURSIVE_MUTEX, 1, 1) + + def __repr__(self): + try: + if self._semlock._is_mine(): + name = process.current_process().name + if threading.current_thread().name != "MainThread": + name = f"{name}|{threading.current_thread().name}" + count = self._semlock._count() + elif self._semlock._get_value() == 1: + name, count = "None", 0 + elif self._semlock._count() > 0: + name, count = "SomeOtherThread", "nonzero" + else: + name, count = "SomeOtherProcess", "nonzero" + except Exception: + name, count = "unknown", "unknown" + return f"<{self.__class__.__name__}({name}, {count})>" + + +# +# Condition variable +# + + +class Condition: + def __init__(self, lock=None): + self._lock = lock or RLock() + self._sleeping_count = Semaphore(0) + self._woken_count = Semaphore(0) + self._wait_semaphore = Semaphore(0) + self._make_methods() + + def __getstate__(self): + assert_spawning(self) + return ( + self._lock, + self._sleeping_count, + self._woken_count, + self._wait_semaphore, + ) + + def __setstate__(self, state): + ( + self._lock, + self._sleeping_count, + self._woken_count, + self._wait_semaphore, + ) = state + self._make_methods() + + def __enter__(self): + return self._lock.__enter__() + + def __exit__(self, *args): + return self._lock.__exit__(*args) + + def _make_methods(self): + self.acquire = self._lock.acquire + self.release = self._lock.release + + def __repr__(self): + try: + num_waiters = ( + self._sleeping_count._semlock._get_value() + - self._woken_count._semlock._get_value() + ) + except Exception: + num_waiters = "unknown" + return f"<{self.__class__.__name__}({self._lock}, {num_waiters})>" + + def wait(self, timeout=None): + assert ( + self._lock._semlock._is_mine() + ), "must acquire() condition before using wait()" + + # indicate that this thread is going to sleep + self._sleeping_count.release() + + # release lock + count = self._lock._semlock._count() + for _ in range(count): + self._lock.release() + + try: + # wait for notification or timeout + return self._wait_semaphore.acquire(True, timeout) + finally: + # indicate that this thread has woken + self._woken_count.release() + + # reacquire lock + for _ in range(count): + self._lock.acquire() + + def notify(self): + assert self._lock._semlock._is_mine(), "lock is not owned" + assert not self._wait_semaphore.acquire(False) + + # to take account of timeouts since last notify() we subtract + # woken_count from sleeping_count and rezero woken_count + while self._woken_count.acquire(False): + res = self._sleeping_count.acquire(False) + assert res + + if self._sleeping_count.acquire(False): # try grabbing a sleeper + self._wait_semaphore.release() # wake up one sleeper + self._woken_count.acquire() # wait for the sleeper to wake + + # rezero _wait_semaphore in case a timeout just happened + self._wait_semaphore.acquire(False) + + def notify_all(self): + assert self._lock._semlock._is_mine(), "lock is not owned" + assert not self._wait_semaphore.acquire(False) + + # to take account of timeouts since last notify*() we subtract + # woken_count from sleeping_count and rezero woken_count + while self._woken_count.acquire(False): + res = self._sleeping_count.acquire(False) + assert res + + sleepers = 0 + while self._sleeping_count.acquire(False): + self._wait_semaphore.release() # wake up one sleeper + sleepers += 1 + + if sleepers: + for _ in range(sleepers): + self._woken_count.acquire() # wait for a sleeper to wake + + # rezero wait_semaphore in case some timeouts just happened + while self._wait_semaphore.acquire(False): + pass + + def wait_for(self, predicate, timeout=None): + result = predicate() + if result: + return result + if timeout is not None: + endtime = _time() + timeout + else: + endtime = None + waittime = None + while not result: + if endtime is not None: + waittime = endtime - _time() + if waittime <= 0: + break + self.wait(waittime) + result = predicate() + return result + + +# +# Event +# + + +class Event: + def __init__(self): + self._cond = Condition(Lock()) + self._flag = Semaphore(0) + + def is_set(self): + with self._cond: + if self._flag.acquire(False): + self._flag.release() + return True + return False + + def set(self): + with self._cond: + self._flag.acquire(False) + self._flag.release() + self._cond.notify_all() + + def clear(self): + with self._cond: + self._flag.acquire(False) + + def wait(self, timeout=None): + with self._cond: + if self._flag.acquire(False): + self._flag.release() + else: + self._cond.wait(timeout) + + if self._flag.acquire(False): + self._flag.release() + return True + return False diff --git a/shared/package-files/9e/9e55e725794b88d6920ed5af68c17e6a4503d28467565933e70495cb10a28fd2/blob b/shared/package-files/9e/9e55e725794b88d6920ed5af68c17e6a4503d28467565933e70495cb10a28fd2/blob new file mode 100644 index 0000000000000000000000000000000000000000..58644c7c76734c072edbea9732faa555bf4bc665 --- /dev/null +++ b/shared/package-files/9e/9e55e725794b88d6920ed5af68c17e6a4503d28467565933e70495cb10a28fd2/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API roll { + using schema = at::Tensor (const at::Tensor &, c10::SymIntArrayRef, at::IntArrayRef); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::roll") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "roll(Tensor self, SymInt[1] shifts, int[1] dims=[]) -> Tensor") + static at::Tensor call(const at::Tensor & self, c10::SymIntArrayRef shifts, at::IntArrayRef dims); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::SymIntArrayRef shifts, at::IntArrayRef dims); +}; + +struct TORCH_API roll_out { + using schema = at::Tensor & (const at::Tensor &, c10::SymIntArrayRef, at::IntArrayRef, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::roll") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "roll.out(Tensor self, SymInt[1] shifts, int[1] dims=[], *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, c10::SymIntArrayRef shifts, at::IntArrayRef dims, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::SymIntArrayRef shifts, at::IntArrayRef dims, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9e/9e580e6e2aede262d752c93d6e3f25ae62b3bd8fdb92764ac53297bc8e97642c/blob b/shared/package-files/9e/9e580e6e2aede262d752c93d6e3f25ae62b3bd8fdb92764ac53297bc8e97642c/blob new file mode 100644 index 0000000000000000000000000000000000000000..25e0e10d04e5f739e24b89e6ec064f5cb425897e --- /dev/null +++ b/shared/package-files/9e/9e580e6e2aede262d752c93d6e3f25ae62b3bd8fdb92764ac53297bc8e97642c/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e580e6e2aede262d752c93d6e3f25ae62b3bd8fdb92764ac53297bc8e97642c +size 774200 diff --git a/shared/package-files/9e/9e58dbd5d1fb0bc872f3e7475fd0f1e6c978d0312a8b1c7297a9ec7953e69e2e/blob b/shared/package-files/9e/9e58dbd5d1fb0bc872f3e7475fd0f1e6c978d0312a8b1c7297a9ec7953e69e2e/blob new file mode 100644 index 0000000000000000000000000000000000000000..6c59e54e6fe05a15f4f7ad63c8b243bc66e0ac83 --- /dev/null +++ b/shared/package-files/9e/9e58dbd5d1fb0bc872f3e7475fd0f1e6c978d0312a8b1c7297a9ec7953e69e2e/blob @@ -0,0 +1,50 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _foreach_cos { + using schema = ::std::vector (at::TensorList); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_foreach_cos") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_foreach_cos(Tensor[] self) -> Tensor[]") + static ::std::vector call(at::TensorList self); + static ::std::vector redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self); +}; + +struct TORCH_API _foreach_cos_ { + using schema = void (at::TensorList); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_foreach_cos_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_foreach_cos_(Tensor(a!)[] self) -> ()") + static void call(at::TensorList self); + static void redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self); +}; + +struct TORCH_API _foreach_cos_out { + using schema = void (at::TensorList, at::TensorList); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_foreach_cos") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_foreach_cos.out(Tensor[] self, *, Tensor(a!)[] out) -> ()") + static void call(at::TensorList self, at::TensorList out); + static void redispatch(c10::DispatchKeySet dispatchKeySet, at::TensorList self, at::TensorList out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9e/9e5a3d3669f2537315a067835e2746d10eac230e91e13d098556d6863c73b47e/blob b/shared/package-files/9e/9e5a3d3669f2537315a067835e2746d10eac230e91e13d098556d6863c73b47e/blob new file mode 100644 index 0000000000000000000000000000000000000000..b6ac50be43efe49b1a1ba8ca424575c7b2a20fa6 --- /dev/null +++ b/shared/package-files/9e/9e5a3d3669f2537315a067835e2746d10eac230e91e13d098556d6863c73b47e/blob @@ -0,0 +1,277 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +""" +This module contains functions that construct metadata and generate signing +keys. + +Function Manifest for this Module + +Key Creation: + gen_keys + gen_and_write_keys + +Metadata Construction: + build_delegating_metadata + build_root_metadata (wraps build_delegating_metadata) +""" +from datetime import timedelta + +from .common import ( + SECURITY_METADATA_SPEC_VERSION, + PrivateKey, + PublicKey, + checkformat_delegations, + checkformat_natural_int, + checkformat_string, + checkformat_utc_isoformat, + iso8601_time_plus_delta, +) + +# Default expiration distance for repodata_verify.json. +REPODATA_VERIF_MD_EXPIRY_DISTANCE = timedelta(days=31) +ROOT_MD_EXPIRY_DISTANCE = timedelta(days=365) + + +def build_delegating_metadata( + metadata_type, delegations=None, version=1, timestamp=None, expiration=None +): + """ + # ✅ TODO: Docstring + + Builds delegating metadata, e.g. root.json, key_mgr.json. + + See metadata specification at: + anaconda.atlassian.net/wiki/spaces/AD/pages/285147281/Conda+Security+Metadata+Specification + + Arguments: + metadata_type: + The type of this metadata (e.g. root or key_mgr). This should + match the intended filename (without .json) + + delegations (default {} ) + a dictionary defining the delegations this metadata makes. + Each key is the role delegated to, with the value equal to a + dictionary listing the acceptable public keys and threshold + (number of signatures from distinct acceptable public keys) for the + delegated role. e.g. + { 'root.json': + {'pubkeys': ['01'*32, '02'*32, '03'*32], 'threshold': 2}, + 'key_mgr.json': + {'pubkeys': ['04'*32], 'threshold': 1}} + + If not provided, an empty dictionary (no delegations) will be used. + + version (default 1) + the version of the metadata; root metadata must advance one version + at a time (root chaining). For other types of metadata, versions + are advisory. + + timestamp (default: current system time) + UTC time associated with the production of this metadata, in + ISO8601 format (e.g. '2020-10-31T14:45:19Z') + + expiration (default: current system time plus ROOT_MD_EXPIRY_DISTANCE) + UTC time beyond which this metadata should be considered expired + and not verifiable by any client seeking new metadata + """ + + # Handle optional args + if delegations is None: + delegations = {} + if timestamp is None: + timestamp = iso8601_time_plus_delta(timedelta(0)) # now plus 0 + if expiration is None: + expiration = iso8601_time_plus_delta(ROOT_MD_EXPIRY_DISTANCE) + + # Argument validation. Note that this (checkformat_delegations) also + # checks for duplicates in lists of keys, which is important to reduce the + # odds of a developer introducing certain bugs that cause security issues + # (multiple signatures from same key being treated as two unique sigs, + # etc.) + checkformat_string(metadata_type) + # TODO: ✅⚠️ Consider a set of acceptable metadata types (root, key_mgr, + # channel_authority). Have to be careful about backward + # compatibility, though.... + checkformat_utc_isoformat(timestamp) + checkformat_utc_isoformat(expiration) + checkformat_natural_int(version) + checkformat_delegations(delegations) + + md = { + "type": metadata_type, + "version": version, + "metadata_spec_version": SECURITY_METADATA_SPEC_VERSION, + "timestamp": timestamp, + "expiration": expiration, + "delegations": delegations, + } + + # # This very redundant, but might be useful as defensive code. + # checkformat_delegating_metadata(wrap_as_signable(md) + + return md + + +def build_root_metadata( + root_version, + root_pubkeys, + root_threshold, + key_mgr_pubkeys, + key_mgr_threshold, + root_timestamp=None, + root_expiration=None, +): + """ + Wrapper for build_delegating_metadata(). Helpfully requires root to list + itself and key_mgr in its delegations. + + # ✅ TODO: Docstring + + # ✅ TODO: Expand build_root_metadata flexibility for + # directly-root-delegated roles (i.e. in addition to channeler). + """ + + # Note that argument validation is performed in the + # build_delegation_metadata call below. So is some of the optional + # argument default setting (timestamp). We set expiration explicitly here + # in case the defaults for generic delegating metadata and root metadata + # diverge later. + # Note that it is probably best to provide less revealing timestamps for + # root metadata generation (00:00:00 of a past day), since it is a manual + # process and patterns in that information might be somewhat useful to a + # sophisticated attacker. + if root_expiration is None: + root_expiration = iso8601_time_plus_delta(ROOT_MD_EXPIRY_DISTANCE) + # if channeler_pubkeys is None: + # channeler_pubkeys = [] + # if channeler_threshold = None: + # channeler_threshold = max(1, len(channeler_pubkeys)) + + delegations = { + "root": {"pubkeys": root_pubkeys, "threshold": root_threshold}, + "key_mgr": {"pubkeys": key_mgr_pubkeys, "threshold": key_mgr_threshold}, + } + + root_md = build_delegating_metadata( + metadata_type="root", + delegations=delegations, + version=root_version, + timestamp=root_timestamp, + expiration=root_expiration, + ) + + return root_md + + +def gen_and_write_keys(fname): + """ + Generate an ed25519 key pair, then write the key files to disk. + + Given fname, write the private key to fname.pri, and the public key to + fname.pub. Performs no filename validation, etc. Also returns the private + key object and the public key object, in that order. + """ + + # Create an ed25519 key pair, employing OS random generation. + # Note that this just has the private key sitting around. In the real + # implementation, we'll want to use an HSM equipped with an ed25519 key. + private, public = gen_keys() + + # Write the actual bytes of the key values to disk as requested. + # Note that where the private key is concerned, we're just grabbing the + # not-encrypted private key value. + with open(fname + ".pri", "wb") as fobj: + fobj.write(PrivateKey.to_bytes(private)) + with open(fname + ".pub", "wb") as fobj: + fobj.write(PublicKey.to_bytes(public)) + + return private, public + + +def gen_keys(): + """ + Generate an ed25519 key pair and return it (private key, public key). + + Returns two objects: + - a conda_content_trust.common.PrivateKey, a subclass of + cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PrivateKey + - a conda_content_trust.common.PublicKey, a subclass of + cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey + """ + # Create an ed25519 key pair, employing OS random generation. + # Note that this just has the private key sitting around. In the real + # implementation, we'll want to use an HSM equipped with an ed25519 key. + private = PrivateKey.generate() + public = private.public_key() + + return private, public + + +# This function is not in use. It's here for reference, in case it's useful +# again in the future. +# def build_repodata_verification_metadata( +# repodata_hashmap, channel=None, expiry=None, timestamp=None): +# """ +# # TODO: ✅ Full docstring. + +# # TODO: ✅ Contemplate the addition of "version" to this metadata. As yet, +# # the timestamp serves our purposes.... + +# Note that if expiry or timestamp are not provided or left as None, now is +# used for the timestamp, and expiry is produced using a default expiration +# distance, via iso8601_time_plus_delta(). (It does not mean no expiration!) + +# Channel may be optionally specified, and is only included if specified. + +# Sample input (repodata_hashmap): +# { +# "noarch/current_repodata.json": "908724926552827ab58dfc0bccba92426cec9f1f483883da3ff0d8664e18c0fe", +# "noarch/repodata.json": "...", +# "noarch/repodata_from_packages.json": "...", +# "osx-64/current_repodata.json": "...", +# "osx-64/repodata.json": "...", +# "osx-64/repodata_from_packages.json": "..." +# } + +# Sample output: +# See metadata specification (version defined by +# SECURITY_METADATA_SPEC_VERSION) for definition and samples of type +# "Repodata Verification Metadata". +# """ + +# if expiry is None: +# expiry = iso8601_time_plus_delta(REPODATA_VERIF_MD_EXPIRY_DISTANCE) + +# if timestamp is None: +# timestamp = iso8601_time_plus_delta(timedelta(0)) + +# # TODO: ✅ More argument validation: channel, +# checkformat_utc_isoformat(expiry) +# checkformat_utc_isoformat(timestamp) +# if not ( # dict with string keys and 32-byte-hash-as-hex-string values +# isinstance(repodata_hashmap, dict) +# and all([isinstance(x, string_types) for x in repodata_hashmap]) +# and all([is_hex_hash(repodata_hashmap[x]) for x in repodata_hashmap])): +# raise ValueError( +# 'Argument repodata_hashmap must be a dictionary with strings ' +# 'as keys (filenames of repodata.json files), and values that ' +# 'are 64-character hex strings representing 32-byte hashes (of ' +# 'those repodata.json files)') + +# # TODO: ✅ Really have to make TypeError and ValueError usages consistent +# # with norms throughout this codebase. + + +# rd_v_md = { +# 'type': 'repodata_verify', +# # (Take advantage of iso8601_time_plus_delta() to get current time +# # in the ISO8601 UTC format we want.) +# 'timestamp': timestamp, # version->timestamp in spec v 0.0.5 +# 'metadata_spec_version': SECURITY_METADATA_SPEC_VERSION, +# 'expiration': expiry, +# 'secured_files': repodata_hashmap} + +# if channel is not None: +# rd_v_md['channel'] = channel + +# return rd_v_md diff --git a/shared/package-files/9e/9e6183c68a5a1e321ff60e10a5b3ecac89b22ed5a20ed228c4aa059b414773b0/blob b/shared/package-files/9e/9e6183c68a5a1e321ff60e10a5b3ecac89b22ed5a20ed228c4aa059b414773b0/blob new file mode 100644 index 0000000000000000000000000000000000000000..e78b4924fe102d01a272b045d3507fe60fb2518e --- /dev/null +++ b/shared/package-files/9e/9e6183c68a5a1e321ff60e10a5b3ecac89b22ed5a20ed228c4aa059b414773b0/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API ::std::tuple native_group_norm(const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, int64_t N, int64_t C, int64_t HxW, int64_t group, double eps); +TORCH_API ::std::tuple native_group_norm_symint(const at::Tensor & input, const c10::optional & weight, const c10::optional & bias, c10::SymInt N, c10::SymInt C, c10::SymInt HxW, int64_t group, double eps); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/9e/9e63965d1978896afda8aa692dd20612820348e14c2affbe033d83f1d7d37b7b/blob b/shared/package-files/9e/9e63965d1978896afda8aa692dd20612820348e14c2affbe033d83f1d7d37b7b/blob new file mode 100644 index 0000000000000000000000000000000000000000..a3cf4b80057fcef19f49ff31a2fc417a7aceca0c Binary files /dev/null and b/shared/package-files/9e/9e63965d1978896afda8aa692dd20612820348e14c2affbe033d83f1d7d37b7b/blob differ diff --git a/shared/package-files/9e/9e67da1425736d5888390dbe323817b7e6cdf148faef8842822c2be48a25fbf5/blob b/shared/package-files/9e/9e67da1425736d5888390dbe323817b7e6cdf148faef8842822c2be48a25fbf5/blob new file mode 100644 index 0000000000000000000000000000000000000000..0817ae58c2140e912eaf3d61e040050016dede54 --- /dev/null +++ b/shared/package-files/9e/9e67da1425736d5888390dbe323817b7e6cdf148faef8842822c2be48a25fbf5/blob @@ -0,0 +1,55 @@ +from numpy.testing import assert_ + +import numpy.distutils.fcompiler + +g77_version_strings = [ + ('GNU Fortran 0.5.25 20010319 (prerelease)', '0.5.25'), + ('GNU Fortran (GCC 3.2) 3.2 20020814 (release)', '3.2'), + ('GNU Fortran (GCC) 3.3.3 20040110 (prerelease) (Debian)', '3.3.3'), + ('GNU Fortran (GCC) 3.3.3 (Debian 20040401)', '3.3.3'), + ('GNU Fortran (GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) 3.2.2' + ' 20030222 (Red Hat Linux 3.2.2-5)', '3.2.2'), +] + +gfortran_version_strings = [ + ('GNU Fortran 95 (GCC 4.0.3 20051023 (prerelease) (Debian 4.0.2-3))', + '4.0.3'), + ('GNU Fortran 95 (GCC) 4.1.0', '4.1.0'), + ('GNU Fortran 95 (GCC) 4.2.0 20060218 (experimental)', '4.2.0'), + ('GNU Fortran (GCC) 4.3.0 20070316 (experimental)', '4.3.0'), + ('GNU Fortran (rubenvb-4.8.0) 4.8.0', '4.8.0'), + ('4.8.0', '4.8.0'), + ('4.0.3-7', '4.0.3'), + ("gfortran: warning: couldn't understand kern.osversion '14.1.0\n4.9.1", + '4.9.1'), + ("gfortran: warning: couldn't understand kern.osversion '14.1.0\n" + "gfortran: warning: yet another warning\n4.9.1", + '4.9.1'), + ('GNU Fortran (crosstool-NG 8a21ab48) 7.2.0', '7.2.0') +] + +class TestG77Versions: + def test_g77_version(self): + fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu') + for vs, version in g77_version_strings: + v = fc.version_match(vs) + assert_(v == version, (vs, v)) + + def test_not_g77(self): + fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu') + for vs, _ in gfortran_version_strings: + v = fc.version_match(vs) + assert_(v is None, (vs, v)) + +class TestGFortranVersions: + def test_gfortran_version(self): + fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu95') + for vs, version in gfortran_version_strings: + v = fc.version_match(vs) + assert_(v == version, (vs, v)) + + def test_not_gfortran(self): + fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu95') + for vs, _ in g77_version_strings: + v = fc.version_match(vs) + assert_(v is None, (vs, v)) diff --git a/shared/package-files/9e/9e6aaa2c486af923fe7a237d0f9f7169f4a8fc267e64f2b9adb610426e7b895a/blob b/shared/package-files/9e/9e6aaa2c486af923fe7a237d0f9f7169f4a8fc267e64f2b9adb610426e7b895a/blob new file mode 100644 index 0000000000000000000000000000000000000000..ecc673f8b0f560c43aa1a53a79f91aa9ad26b4fc --- /dev/null +++ b/shared/package-files/9e/9e6aaa2c486af923fe7a237d0f9f7169f4a8fc267e64f2b9adb610426e7b895a/blob @@ -0,0 +1,105 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::view_copy(Tensor self, SymInt[] size) -> Tensor +inline at::Tensor view_copy(const at::Tensor & self, at::IntArrayRef size) { + return at::_ops::view_copy::call(self, c10::fromIntArrayRefSlow(size)); +} +namespace symint { + template ::value>> + at::Tensor view_copy(const at::Tensor & self, at::IntArrayRef size) { + return at::_ops::view_copy::call(self, c10::fromIntArrayRefSlow(size)); + } +} + +// aten::view_copy(Tensor self, SymInt[] size) -> Tensor +inline at::Tensor view_copy_symint(const at::Tensor & self, c10::SymIntArrayRef size) { + return at::_ops::view_copy::call(self, size); +} +namespace symint { + template ::value>> + at::Tensor view_copy(const at::Tensor & self, c10::SymIntArrayRef size) { + return at::_ops::view_copy::call(self, size); + } +} + +// aten::view_copy.dtype(Tensor self, ScalarType dtype) -> Tensor +inline at::Tensor view_copy(const at::Tensor & self, at::ScalarType dtype) { + return at::_ops::view_copy_dtype::call(self, dtype); +} + +// aten::view_copy.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & view_copy_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef size) { + return at::_ops::view_copy_out::call(self, c10::fromIntArrayRefSlow(size), out); +} +namespace symint { + template ::value>> + at::Tensor & view_copy_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef size) { + return at::_ops::view_copy_out::call(self, c10::fromIntArrayRefSlow(size), out); + } +} + +// aten::view_copy.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & view_copy_outf(const at::Tensor & self, at::IntArrayRef size, at::Tensor & out) { + return at::_ops::view_copy_out::call(self, c10::fromIntArrayRefSlow(size), out); +} +namespace symint { + template ::value>> + at::Tensor & view_copy_outf(const at::Tensor & self, at::IntArrayRef size, at::Tensor & out) { + return at::_ops::view_copy_out::call(self, c10::fromIntArrayRefSlow(size), out); + } +} + +// aten::view_copy.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & view_copy_symint_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef size) { + return at::_ops::view_copy_out::call(self, size, out); +} +namespace symint { + template ::value>> + at::Tensor & view_copy_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef size) { + return at::_ops::view_copy_out::call(self, size, out); + } +} + +// aten::view_copy.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & view_copy_symint_outf(const at::Tensor & self, c10::SymIntArrayRef size, at::Tensor & out) { + return at::_ops::view_copy_out::call(self, size, out); +} +namespace symint { + template ::value>> + at::Tensor & view_copy_outf(const at::Tensor & self, c10::SymIntArrayRef size, at::Tensor & out) { + return at::_ops::view_copy_out::call(self, size, out); + } +} + +// aten::view_copy.dtype_out(Tensor self, ScalarType dtype, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & view_copy_out(at::Tensor & out, const at::Tensor & self, at::ScalarType dtype) { + return at::_ops::view_copy_dtype_out::call(self, dtype, out); +} +// aten::view_copy.dtype_out(Tensor self, ScalarType dtype, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & view_copy_outf(const at::Tensor & self, at::ScalarType dtype, at::Tensor & out) { + return at::_ops::view_copy_dtype_out::call(self, dtype, out); +} + +} diff --git a/shared/package-files/9e/9e6b74abf66ac74c65d0d713a4a9de52b68c6dd1177a129e8bfbfe14985adf8d/blob b/shared/package-files/9e/9e6b74abf66ac74c65d0d713a4a9de52b68c6dd1177a129e8bfbfe14985adf8d/blob new file mode 100644 index 0000000000000000000000000000000000000000..79fe91e0c8ec39730f4041c55dc5a34c074c9709 --- /dev/null +++ b/shared/package-files/9e/9e6b74abf66ac74c65d0d713a4a9de52b68c6dd1177a129e8bfbfe14985adf8d/blob @@ -0,0 +1,57 @@ +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "openjp2" for configuration "" +set_property(TARGET openjp2 APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(openjp2 PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG "m;-lpthread" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/lib/libopenjp2.so.2.4.0" + IMPORTED_SONAME_NOCONFIG "libopenjp2.so.7" + ) + +list(APPEND _IMPORT_CHECK_TARGETS openjp2 ) +list(APPEND _IMPORT_CHECK_FILES_FOR_openjp2 "${_IMPORT_PREFIX}/lib/libopenjp2.so.2.4.0" ) + +# Import target "openjp2_static" for configuration "" +set_property(TARGET openjp2_static APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(openjp2_static PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "C" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/lib/libopenjp2.a" + ) + +list(APPEND _IMPORT_CHECK_TARGETS openjp2_static ) +list(APPEND _IMPORT_CHECK_FILES_FOR_openjp2_static "${_IMPORT_PREFIX}/lib/libopenjp2.a" ) + +# Import target "opj_decompress" for configuration "" +set_property(TARGET opj_decompress APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(opj_decompress PROPERTIES + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/opj_decompress" + ) + +list(APPEND _IMPORT_CHECK_TARGETS opj_decompress ) +list(APPEND _IMPORT_CHECK_FILES_FOR_opj_decompress "${_IMPORT_PREFIX}/bin/opj_decompress" ) + +# Import target "opj_compress" for configuration "" +set_property(TARGET opj_compress APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(opj_compress PROPERTIES + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/opj_compress" + ) + +list(APPEND _IMPORT_CHECK_TARGETS opj_compress ) +list(APPEND _IMPORT_CHECK_FILES_FOR_opj_compress "${_IMPORT_PREFIX}/bin/opj_compress" ) + +# Import target "opj_dump" for configuration "" +set_property(TARGET opj_dump APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(opj_dump PROPERTIES + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/opj_dump" + ) + +list(APPEND _IMPORT_CHECK_TARGETS opj_dump ) +list(APPEND _IMPORT_CHECK_FILES_FOR_opj_dump "${_IMPORT_PREFIX}/bin/opj_dump" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/shared/package-files/9e/9e6ba78a265f6b51b478415283c14b0d24e000dcfddaf6495ccc8e76517fda0a/blob b/shared/package-files/9e/9e6ba78a265f6b51b478415283c14b0d24e000dcfddaf6495ccc8e76517fda0a/blob new file mode 100644 index 0000000000000000000000000000000000000000..9530b0ede27459d33fe9c8a01b71129621da499c --- /dev/null +++ b/shared/package-files/9e/9e6ba78a265f6b51b478415283c14b0d24e000dcfddaf6495ccc8e76517fda0a/blob @@ -0,0 +1,58 @@ +#pragma once +#include +#include + +namespace at { namespace native { + +namespace { + + +// SFINAE doesn't work well with NVCC under Windows for math functions like pow and sqrt. +// So we need to define the functions with the explicit function signatures. +// As for pow, the following signatures are defined as the device function: +// pow(float, int) +// pow(double, int) +// pow(float, float) +// pow(double, double) +#ifdef _MSC_VER +// Functions for pow +// pow for at::Half +static inline __host__ __device__ at::Half pow_(at::Half base, at::Half exp) { + return static_cast(std::pow(static_cast(base), static_cast(exp))); +} +// pow for at::BFloat16 +static inline __host__ __device__ at::BFloat16 pow_(at::BFloat16 base, at::BFloat16 exp) { + return static_cast(std::pow(static_cast(base), static_cast(exp))); +} +// pow (floating, floating/int) +template +static inline __host__ __device__ typename std::enable_if::value && (std::is_same::value || std::is_same::value), Base_type>::type + pow_(Base_type base, Exp_type exp) { + return std::pow(base, exp); +} +// pow (Otherwise) +template +static inline __host__ __device__ typename std::enable_if::value && !std::is_same::value, Base_type>::type + pow_(Base_type base, Exp_type exp) { + return static_cast(std::pow(static_cast(base), static_cast(exp))); +} +#else +template +static inline __host__ __device__ Base_type pow_(Base_type base, Exp_type exp) { + return ::pow(base, exp); +} +#endif + +template +static inline __host__ __device__ std::enable_if_t::value, T> pow_( + T base, T exp) { + return at::native::powi(base, exp); +} + +template +static inline __host__ __device__ c10::complex pow_(c10::complex base, c10::complex exp) { + return c10_complex_math::pow(base, exp); +} + +} // namespace +}} // namespace at::native diff --git a/shared/package-files/9e/9e6bdbb24d0a2232836758923f08ae1473566c6bcc99379875ea078585cfa253/blob b/shared/package-files/9e/9e6bdbb24d0a2232836758923f08ae1473566c6bcc99379875ea078585cfa253/blob new file mode 100644 index 0000000000000000000000000000000000000000..277848224ac41b6511869c63913eba9bd63952ab --- /dev/null +++ b/shared/package-files/9e/9e6bdbb24d0a2232836758923f08ae1473566c6bcc99379875ea078585cfa253/blob @@ -0,0 +1,393 @@ +import numbers +from typing import Any, Dict, List, Literal, Optional, Sequence, Tuple, Union + +import numpy as np +import torch +from PIL import Image, ImageEnhance, ImageOps + +try: + import accimage +except ImportError: + accimage = None + + +@torch.jit.unused +def _is_pil_image(img: Any) -> bool: + if accimage is not None: + return isinstance(img, (Image.Image, accimage.Image)) + else: + return isinstance(img, Image.Image) + + +@torch.jit.unused +def get_dimensions(img: Any) -> List[int]: + if _is_pil_image(img): + if hasattr(img, "getbands"): + channels = len(img.getbands()) + else: + channels = img.channels + width, height = img.size + return [channels, height, width] + raise TypeError(f"Unexpected type {type(img)}") + + +@torch.jit.unused +def get_image_size(img: Any) -> List[int]: + if _is_pil_image(img): + return list(img.size) + raise TypeError(f"Unexpected type {type(img)}") + + +@torch.jit.unused +def get_image_num_channels(img: Any) -> int: + if _is_pil_image(img): + if hasattr(img, "getbands"): + return len(img.getbands()) + else: + return img.channels + raise TypeError(f"Unexpected type {type(img)}") + + +@torch.jit.unused +def hflip(img: Image.Image) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + return img.transpose(Image.FLIP_LEFT_RIGHT) + + +@torch.jit.unused +def vflip(img: Image.Image) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + return img.transpose(Image.FLIP_TOP_BOTTOM) + + +@torch.jit.unused +def adjust_brightness(img: Image.Image, brightness_factor: float) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + enhancer = ImageEnhance.Brightness(img) + img = enhancer.enhance(brightness_factor) + return img + + +@torch.jit.unused +def adjust_contrast(img: Image.Image, contrast_factor: float) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + enhancer = ImageEnhance.Contrast(img) + img = enhancer.enhance(contrast_factor) + return img + + +@torch.jit.unused +def adjust_saturation(img: Image.Image, saturation_factor: float) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + enhancer = ImageEnhance.Color(img) + img = enhancer.enhance(saturation_factor) + return img + + +@torch.jit.unused +def adjust_hue(img: Image.Image, hue_factor: float) -> Image.Image: + if not (-0.5 <= hue_factor <= 0.5): + raise ValueError(f"hue_factor ({hue_factor}) is not in [-0.5, 0.5].") + + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + input_mode = img.mode + if input_mode in {"L", "1", "I", "F"}: + return img + + h, s, v = img.convert("HSV").split() + + np_h = np.array(h, dtype=np.uint8) + # uint8 addition take cares of rotation across boundaries + with np.errstate(over="ignore"): + np_h += np.uint8(hue_factor * 255) + h = Image.fromarray(np_h, "L") + + img = Image.merge("HSV", (h, s, v)).convert(input_mode) + return img + + +@torch.jit.unused +def adjust_gamma( + img: Image.Image, + gamma: float, + gain: float = 1.0, +) -> Image.Image: + + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + if gamma < 0: + raise ValueError("Gamma should be a non-negative real number") + + input_mode = img.mode + img = img.convert("RGB") + gamma_map = [int((255 + 1 - 1e-3) * gain * pow(ele / 255.0, gamma)) for ele in range(256)] * 3 + img = img.point(gamma_map) # use PIL's point-function to accelerate this part + + img = img.convert(input_mode) + return img + + +@torch.jit.unused +def pad( + img: Image.Image, + padding: Union[int, List[int], Tuple[int, ...]], + fill: Optional[Union[float, List[float], Tuple[float, ...]]] = 0, + padding_mode: Literal["constant", "edge", "reflect", "symmetric"] = "constant", +) -> Image.Image: + + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + if not isinstance(padding, (numbers.Number, tuple, list)): + raise TypeError("Got inappropriate padding arg") + if fill is not None and not isinstance(fill, (numbers.Number, tuple, list)): + raise TypeError("Got inappropriate fill arg") + if not isinstance(padding_mode, str): + raise TypeError("Got inappropriate padding_mode arg") + + if isinstance(padding, list): + padding = tuple(padding) + + if isinstance(padding, tuple) and len(padding) not in [1, 2, 4]: + raise ValueError(f"Padding must be an int or a 1, 2, or 4 element tuple, not a {len(padding)} element tuple") + + if isinstance(padding, tuple) and len(padding) == 1: + # Compatibility with `functional_tensor.pad` + padding = padding[0] + + if padding_mode not in ["constant", "edge", "reflect", "symmetric"]: + raise ValueError("Padding mode should be either constant, edge, reflect or symmetric") + + if padding_mode == "constant": + opts = _parse_fill(fill, img, name="fill") + if img.mode == "P": + palette = img.getpalette() + image = ImageOps.expand(img, border=padding, **opts) + image.putpalette(palette) + return image + + return ImageOps.expand(img, border=padding, **opts) + else: + if isinstance(padding, int): + pad_left = pad_right = pad_top = pad_bottom = padding + if isinstance(padding, tuple) and len(padding) == 2: + pad_left = pad_right = padding[0] + pad_top = pad_bottom = padding[1] + if isinstance(padding, tuple) and len(padding) == 4: + pad_left = padding[0] + pad_top = padding[1] + pad_right = padding[2] + pad_bottom = padding[3] + + p = [pad_left, pad_top, pad_right, pad_bottom] + cropping = -np.minimum(p, 0) + + if cropping.any(): + crop_left, crop_top, crop_right, crop_bottom = cropping + img = img.crop((crop_left, crop_top, img.width - crop_right, img.height - crop_bottom)) + + pad_left, pad_top, pad_right, pad_bottom = np.maximum(p, 0) + + if img.mode == "P": + palette = img.getpalette() + img = np.asarray(img) + img = np.pad(img, ((pad_top, pad_bottom), (pad_left, pad_right)), mode=padding_mode) + img = Image.fromarray(img) + img.putpalette(palette) + return img + + img = np.asarray(img) + # RGB image + if len(img.shape) == 3: + img = np.pad(img, ((pad_top, pad_bottom), (pad_left, pad_right), (0, 0)), padding_mode) + # Grayscale image + if len(img.shape) == 2: + img = np.pad(img, ((pad_top, pad_bottom), (pad_left, pad_right)), padding_mode) + + return Image.fromarray(img) + + +@torch.jit.unused +def crop( + img: Image.Image, + top: int, + left: int, + height: int, + width: int, +) -> Image.Image: + + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + return img.crop((left, top, left + width, top + height)) + + +@torch.jit.unused +def resize( + img: Image.Image, + size: Union[List[int], int], + interpolation: int = Image.BILINEAR, +) -> Image.Image: + + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + if not (isinstance(size, list) and len(size) == 2): + raise TypeError(f"Got inappropriate size arg: {size}") + + return img.resize(tuple(size[::-1]), interpolation) + + +@torch.jit.unused +def _parse_fill( + fill: Optional[Union[float, List[float], Tuple[float, ...]]], + img: Image.Image, + name: str = "fillcolor", +) -> Dict[str, Optional[Union[float, List[float], Tuple[float, ...]]]]: + + # Process fill color for affine transforms + num_channels = get_image_num_channels(img) + if fill is None: + fill = 0 + if isinstance(fill, (int, float)) and num_channels > 1: + fill = tuple([fill] * num_channels) + if isinstance(fill, (list, tuple)): + if len(fill) == 1: + fill = fill * num_channels + elif len(fill) != num_channels: + msg = "The number of elements in 'fill' does not match the number of channels of the image ({} != {})" + raise ValueError(msg.format(len(fill), num_channels)) + + fill = tuple(fill) # type: ignore[arg-type] + + if img.mode != "F": + if isinstance(fill, (list, tuple)): + fill = tuple(int(x) for x in fill) + else: + fill = int(fill) + + return {name: fill} + + +@torch.jit.unused +def affine( + img: Image.Image, + matrix: List[float], + interpolation: int = Image.NEAREST, + fill: Optional[Union[int, float, Sequence[int], Sequence[float]]] = None, +) -> Image.Image: + + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + output_size = img.size + opts = _parse_fill(fill, img) + return img.transform(output_size, Image.AFFINE, matrix, interpolation, **opts) + + +@torch.jit.unused +def rotate( + img: Image.Image, + angle: float, + interpolation: int = Image.NEAREST, + expand: bool = False, + center: Optional[Tuple[int, int]] = None, + fill: Optional[Union[int, float, Sequence[int], Sequence[float]]] = None, +) -> Image.Image: + + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + opts = _parse_fill(fill, img) + return img.rotate(angle, interpolation, expand, center, **opts) + + +@torch.jit.unused +def perspective( + img: Image.Image, + perspective_coeffs: List[float], + interpolation: int = Image.BICUBIC, + fill: Optional[Union[int, float, Sequence[int], Sequence[float]]] = None, +) -> Image.Image: + + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + opts = _parse_fill(fill, img) + + return img.transform(img.size, Image.PERSPECTIVE, perspective_coeffs, interpolation, **opts) + + +@torch.jit.unused +def to_grayscale(img: Image.Image, num_output_channels: int) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + if num_output_channels == 1: + img = img.convert("L") + elif num_output_channels == 3: + img = img.convert("L") + np_img = np.array(img, dtype=np.uint8) + np_img = np.dstack([np_img, np_img, np_img]) + img = Image.fromarray(np_img, "RGB") + else: + raise ValueError("num_output_channels should be either 1 or 3") + + return img + + +@torch.jit.unused +def invert(img: Image.Image) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + return ImageOps.invert(img) + + +@torch.jit.unused +def posterize(img: Image.Image, bits: int) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + return ImageOps.posterize(img, bits) + + +@torch.jit.unused +def solarize(img: Image.Image, threshold: int) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + return ImageOps.solarize(img, threshold) + + +@torch.jit.unused +def adjust_sharpness(img: Image.Image, sharpness_factor: float) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + + enhancer = ImageEnhance.Sharpness(img) + img = enhancer.enhance(sharpness_factor) + return img + + +@torch.jit.unused +def autocontrast(img: Image.Image) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + return ImageOps.autocontrast(img) + + +@torch.jit.unused +def equalize(img: Image.Image) -> Image.Image: + if not _is_pil_image(img): + raise TypeError(f"img should be PIL Image. Got {type(img)}") + return ImageOps.equalize(img) diff --git a/shared/package-files/9e/9e6c8ccaec731bcec337a2b7464d8c53324b30b47af4cad6a5d9c7ccec155304/blob b/shared/package-files/9e/9e6c8ccaec731bcec337a2b7464d8c53324b30b47af4cad6a5d9c7ccec155304/blob new file mode 100644 index 0000000000000000000000000000000000000000..46ba835c66c9f4c3b15b0a0671447d33b3b240d1 --- /dev/null +++ b/shared/package-files/9e/9e6c8ccaec731bcec337a2b7464d8c53324b30b47af4cad6a5d9c7ccec155304/blob @@ -0,0 +1,145 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Shy Shalom - original C code +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from collections import namedtuple + +from .charsetprober import CharSetProber +from .enums import CharacterCategory, ProbingState, SequenceLikelihood + + +SingleByteCharSetModel = namedtuple('SingleByteCharSetModel', + ['charset_name', + 'language', + 'char_to_order_map', + 'language_model', + 'typical_positive_ratio', + 'keep_ascii_letters', + 'alphabet']) + + +class SingleByteCharSetProber(CharSetProber): + SAMPLE_SIZE = 64 + SB_ENOUGH_REL_THRESHOLD = 1024 # 0.25 * SAMPLE_SIZE^2 + POSITIVE_SHORTCUT_THRESHOLD = 0.95 + NEGATIVE_SHORTCUT_THRESHOLD = 0.05 + + def __init__(self, model, reversed=False, name_prober=None): + super(SingleByteCharSetProber, self).__init__() + self._model = model + # TRUE if we need to reverse every pair in the model lookup + self._reversed = reversed + # Optional auxiliary prober for name decision + self._name_prober = name_prober + self._last_order = None + self._seq_counters = None + self._total_seqs = None + self._total_char = None + self._freq_char = None + self.reset() + + def reset(self): + super(SingleByteCharSetProber, self).reset() + # char order of last character + self._last_order = 255 + self._seq_counters = [0] * SequenceLikelihood.get_num_categories() + self._total_seqs = 0 + self._total_char = 0 + # characters that fall in our sampling range + self._freq_char = 0 + + @property + def charset_name(self): + if self._name_prober: + return self._name_prober.charset_name + else: + return self._model.charset_name + + @property + def language(self): + if self._name_prober: + return self._name_prober.language + else: + return self._model.language + + def feed(self, byte_str): + # TODO: Make filter_international_words keep things in self.alphabet + if not self._model.keep_ascii_letters: + byte_str = self.filter_international_words(byte_str) + if not byte_str: + return self.state + char_to_order_map = self._model.char_to_order_map + language_model = self._model.language_model + for char in byte_str: + order = char_to_order_map.get(char, CharacterCategory.UNDEFINED) + # XXX: This was SYMBOL_CAT_ORDER before, with a value of 250, but + # CharacterCategory.SYMBOL is actually 253, so we use CONTROL + # to make it closer to the original intent. The only difference + # is whether or not we count digits and control characters for + # _total_char purposes. + if order < CharacterCategory.CONTROL: + self._total_char += 1 + # TODO: Follow uchardet's lead and discount confidence for frequent + # control characters. + # See https://github.com/BYVoid/uchardet/commit/55b4f23971db61 + if order < self.SAMPLE_SIZE: + self._freq_char += 1 + if self._last_order < self.SAMPLE_SIZE: + self._total_seqs += 1 + if not self._reversed: + lm_cat = language_model[self._last_order][order] + else: + lm_cat = language_model[order][self._last_order] + self._seq_counters[lm_cat] += 1 + self._last_order = order + + charset_name = self._model.charset_name + if self.state == ProbingState.DETECTING: + if self._total_seqs > self.SB_ENOUGH_REL_THRESHOLD: + confidence = self.get_confidence() + if confidence > self.POSITIVE_SHORTCUT_THRESHOLD: + self.logger.debug('%s confidence = %s, we have a winner', + charset_name, confidence) + self._state = ProbingState.FOUND_IT + elif confidence < self.NEGATIVE_SHORTCUT_THRESHOLD: + self.logger.debug('%s confidence = %s, below negative ' + 'shortcut threshhold %s', charset_name, + confidence, + self.NEGATIVE_SHORTCUT_THRESHOLD) + self._state = ProbingState.NOT_ME + + return self.state + + def get_confidence(self): + r = 0.01 + if self._total_seqs > 0: + r = ((1.0 * self._seq_counters[SequenceLikelihood.POSITIVE]) / + self._total_seqs / self._model.typical_positive_ratio) + r = r * self._freq_char / self._total_char + if r >= 1.0: + r = 0.99 + return r diff --git a/shared/package-files/9e/9e6f1aa2d465e8d23194cdc880f7a0291dc479ebd8668242ad8a55e126b54f92/blob b/shared/package-files/9e/9e6f1aa2d465e8d23194cdc880f7a0291dc479ebd8668242ad8a55e126b54f92/blob new file mode 100644 index 0000000000000000000000000000000000000000..4f6323870368cd97a6294e108ffea9067cf5e69b Binary files /dev/null and b/shared/package-files/9e/9e6f1aa2d465e8d23194cdc880f7a0291dc479ebd8668242ad8a55e126b54f92/blob differ diff --git a/shared/package-files/9e/9e724984087baf6d62268b5948c26deb713448f40c0f4e440fc8c2d78eba5c11/blob b/shared/package-files/9e/9e724984087baf6d62268b5948c26deb713448f40c0f4e440fc8c2d78eba5c11/blob new file mode 100644 index 0000000000000000000000000000000000000000..6ef8e065ff471a16f254e06614ea3c4fde466b09 --- /dev/null +++ b/shared/package-files/9e/9e724984087baf6d62268b5948c26deb713448f40c0f4e440fc8c2d78eba5c11/blob @@ -0,0 +1,405 @@ +0,1,1.548,-0.529,-1.202 +0,0,0.084,1.312,0.019 +0,1,-0.796,-1.706,-0.408 +1,0,-0.536,-0.584,-1.022 +1,0,0.548,0.282,-0.690 +1,0,-0.462,0.585,1.156 +1,0,-2.028,-0.104,-0.561 +1,0,-0.080,-0.493,-0.480 +2,1,0.004,1.750,1.630 +2,1,-1.373,0.071,0.546 +2,0,-0.190,0.917,0.506 +2,1,0.404,-0.881,0.791 +3,0,-1.302,-2.123,-1.336 +3,1,0.275,-0.970,-0.268 +3,1,-0.259,-0.495,0.065 +3,0,-0.895,0.427,-0.774 +3,1,0.826,-0.625,-0.789 +4,0,-1.778,-0.547,0.418 +4,0,0.676,-0.173,-0.544 +4,0,-0.729,0.618,-1.447 +4,0,-1.055,-0.485,-0.700 +5,1,1.345,-0.244,1.710 +5,1,1.660,0.891,0.799 +5,1,0.707,0.177,0.956 +5,0,1.400,0.316,-1.201 +5,1,1.514,0.793,-0.114 +6,1,0.871,-0.043,0.990 +6,1,0.497,0.737,0.292 +6,1,0.309,0.976,0.684 +6,1,0.038,-0.959,1.215 +7,0,-0.031,0.269,-0.201 +7,0,-0.338,0.668,1.651 +7,0,1.543,-0.087,-1.226 +7,1,1.150,0.821,0.456 +7,0,0.080,0.955,-0.585 +8,0,-2.154,1.197,1.599 +8,1,0.179,-1.007,0.011 +8,1,0.707,-0.092,-0.073 +9,1,0.060,-0.416,-0.363 +9,0,-0.027,0.273,0.663 +9,1,-0.930,-1.240,-0.947 +9,1,0.526,-0.078,-1.761 +10,1,0.282,-2.120,-2.174 +10,0,-1.283,-1.305,-0.416 +10,1,-0.150,0.681,1.477 +10,1,-0.446,0.312,0.467 +11,1,-1.358,-2.584,-1.192 +11,1,-1.144,-1.840,-1.196 +11,0,-1.756,-1.496,-3.135 +11,0,-1.745,0.107,-0.689 +11,1,0.773,-1.712,-0.566 +12,1,0.996,-0.681,-0.304 +12,0,1.894,0.397,-0.186 +12,0,2.059,1.827,1.490 +12,1,0.502,0.975,1.379 +12,0,0.206,-0.787,0.001 +13,1,0.328,-0.472,-0.703 +13,1,2.125,1.206,0.904 +13,0,0.002,0.592,0.472 +14,1,0.393,-1.771,-1.430 +14,1,0.846,-0.817,0.201 +14,0,0.285,-1.236,-1.672 +14,1,0.627,-1.362,-1.710 +14,1,0.052,-0.083,2.465 +15,0,-0.049,0.936,0.476 +15,1,-0.392,0.497,0.896 +15,0,0.363,0.334,-2.107 +15,0,0.133,-0.544,-1.103 +15,1,-0.675,0.200,0.057 +16,0,0.536,1.171,0.326 +16,1,-0.162,1.383,1.281 +16,0,0.827,-0.565,-0.925 +17,1,-0.438,-1.934,-1.293 +17,0,-0.847,-0.662,-0.179 +17,1,-0.468,-0.796,-0.746 +17,0,-0.302,0.502,-0.842 +17,1,-1.568,-1.071,-0.219 +18,1,-1.696,0.184,-0.086 +18,1,0.396,-0.845,-0.942 +18,1,0.588,-0.931,-1.260 +19,0,1.963,0.652,0.257 +19,1,1.016,0.271,-0.146 +19,1,1.266,0.247,0.274 +20,1,-1.034,-1.098,-1.370 +20,0,-2.120,-1.285,-1.005 +20,1,-1.476,-3.622,-2.686 +20,1,-0.708,-1.223,-1.488 +20,0,-0.111,-1.985,-3.268 +21,1,-0.922,-0.077,1.386 +21,0,-1.296,0.533,1.064 +21,1,-1.402,0.719,0.290 +21,0,-0.704,0.481,0.075 +21,1,-0.092,-0.753,-0.095 +22,0,-0.072,1.679,0.841 +22,0,0.919,0.915,0.836 +22,1,0.656,0.305,-0.128 +22,0,0.073,0.921,0.699 +23,1,-0.273,0.183,-0.506 +23,1,0.196,-0.776,-0.279 +23,0,0.154,0.251,0.407 +23,0,-1.238,0.343,0.204 +24,0,1.212,0.636,0.737 +24,1,-0.693,0.136,2.490 +24,1,-0.018,-0.208,1.494 +25,0,-1.159,-0.273,-1.149 +25,1,0.935,-0.507,-0.146 +25,1,1.750,-0.484,-0.838 +26,0,-0.399,1.233,0.271 +26,0,-0.644,1.642,0.949 +26,1,1.163,-0.348,-1.010 +26,1,1.168,-2.201,-0.559 +27,1,-0.450,-0.739,1.097 +27,0,0.868,0.065,-0.440 +27,0,0.288,1.105,1.994 +27,0,0.358,1.687,0.045 +27,1,1.880,0.636,0.818 +28,0,-0.905,0.613,0.510 +28,0,-0.280,-0.034,0.712 +28,0,-1.111,0.526,0.096 +28,1,2.047,0.258,1.244 +28,1,-0.156,-0.169,-0.174 +29,0,-0.960,-0.745,-0.938 +29,1,-2.192,-2.973,0.025 +29,0,-0.202,0.534,-1.675 +29,1,-0.817,-1.304,-0.451 +29,1,-1.388,-1.915,-2.432 +30,1,0.742,0.211,-0.108 +30,1,0.617,0.611,0.879 +30,0,0.759,-0.121,-0.573 +30,1,-0.760,-0.813,-0.040 +31,1,0.513,0.936,-0.024 +31,1,0.206,0.567,0.555 +31,1,0.380,0.378,0.106 +32,0,-0.249,1.422,1.140 +32,0,0.111,-0.171,-1.012 +32,0,-1.243,-1.328,-0.496 +32,1,0.366,-0.396,-0.616 +33,0,0.524,0.179,-0.348 +33,1,0.101,0.360,1.011 +33,1,0.329,-1.218,-0.952 +34,0,-1.359,-0.920,-1.708 +34,1,-2.244,-0.773,0.222 +34,0,-0.676,-0.451,-1.480 +35,1,1.043,0.850,0.611 +35,1,-0.376,1.303,1.833 +35,0,-0.178,0.520,-0.960 +36,0,0.674,-0.063,-0.193 +36,0,0.185,1.276,-0.165 +36,1,0.740,-0.298,-0.306 +36,1,0.553,0.123,0.410 +36,1,-1.300,0.233,1.447 +37,1,-1.893,-1.619,-0.034 +37,1,-0.955,-0.344,-0.659 +37,0,-0.453,-1.925,-0.566 +37,1,-0.066,-0.048,-1.278 +38,1,0.073,1.901,1.075 +38,1,0.707,-0.534,0.725 +38,1,-0.132,-0.712,0.225 +38,1,1.712,-0.371,0.022 +38,0,-1.594,0.900,1.108 +39,1,1.522,0.600,2.198 +39,1,2.067,0.839,0.428 +39,1,0.903,0.150,1.970 +40,1,0.186,-0.016,1.459 +40,1,0.315,0.415,-0.100 +40,0,-0.162,-0.147,1.305 +40,1,0.800,-0.037,-1.897 +41,1,3.318,-2.128,-1.639 +41,1,0.421,-0.392,0.236 +41,0,-1.503,0.870,-1.712 +41,0,1.225,2.190,0.421 +41,0,-0.247,0.524,1.334 +42,1,0.094,0.634,1.815 +42,0,0.788,2.015,1.196 +42,1,0.007,-0.035,0.198 +43,0,-1.633,-1.032,-1.123 +43,0,-1.261,-0.870,0.647 +43,0,-1.316,0.487,-2.478 +43,1,-0.155,-1.666,-0.578 +44,0,-0.538,1.551,1.148 +44,0,-1.021,0.439,0.229 +44,1,0.521,-0.333,0.872 +44,0,0.820,-0.104,-1.519 +44,1,-0.273,-0.668,1.887 +45,1,1.069,-0.461,0.686 +45,0,-0.450,1.918,0.448 +45,0,-1.357,0.394,1.221 +46,1,0.349,-0.263,-0.243 +46,0,-0.266,1.219,-0.978 +46,1,-0.926,-0.860,-0.041 +46,1,-1.821,-0.773,-1.373 +46,1,-1.232,-0.480,-1.162 +47,1,-1.074,-0.071,0.805 +47,1,1.558,-1.422,-0.596 +47,1,-0.336,-1.018,0.457 +47,1,-0.072,0.028,-0.864 +48,1,0.327,-1.873,-2.254 +48,1,-0.876,-1.410,-0.010 +48,0,0.037,0.613,-0.477 +48,0,-0.951,0.515,-1.375 +48,1,0.358,0.011,0.226 +49,1,-0.630,-1.009,-0.900 +49,1,-0.224,-1.513,-1.778 +49,1,0.339,-0.213,-0.205 +49,0,-0.892,-0.176,-0.229 +49,0,-0.493,-0.625,-1.609 +50,1,0.553,-1.131,-0.299 +50,1,-0.561,-0.657,-0.064 +50,1,0.509,-0.544,-0.511 +50,0,0.084,0.238,0.477 +51,1,0.261,1.333,0.410 +51,0,0.949,2.030,0.562 +51,1,1.240,-0.929,0.418 +52,1,-0.662,-1.578,-0.536 +52,0,-0.729,-0.217,0.023 +52,1,1.456,0.318,0.298 +52,1,0.774,1.178,0.631 +53,0,0.567,0.298,-0.115 +53,1,0.171,-1.003,-1.263 +53,0,-0.455,0.677,-0.505 +53,1,0.040,-1.087,-0.880 +54,0,-0.779,-0.215,-0.318 +54,1,-0.112,0.689,-0.054 +54,0,1.037,-0.298,-1.121 +54,0,-1.304,-1.379,0.065 +54,1,0.162,-0.120,-0.395 +55,0,0.311,0.797,0.030 +55,1,0.806,0.952,0.201 +55,1,1.746,-0.739,0.726 +55,0,-0.549,-0.645,-0.257 +56,0,-0.644,-1.239,-0.655 +56,1,-1.110,-0.353,-0.500 +56,1,0.525,-1.847,-0.641 +57,0,-0.443,0.567,-0.837 +57,0,-1.126,-0.298,0.410 +57,1,-1.115,0.075,-0.067 +58,1,0.788,0.324,1.564 +58,1,0.626,-0.193,1.219 +58,0,0.116,1.274,0.907 +58,1,0.843,0.793,1.189 +59,1,0.394,-1.005,-0.232 +59,1,0.769,-1.460,-0.101 +59,1,0.779,0.378,-0.002 +60,0,-1.374,-1.201,-1.303 +60,0,0.115,-0.593,-0.957 +60,0,-0.567,0.206,-0.422 +61,0,-3.465,-0.162,-1.189 +61,0,-0.894,-1.233,-1.080 +61,1,-1.479,-1.797,-1.108 +61,0,-1.028,-0.698,-1.060 +61,1,0.423,-1.090,-1.960 +62,0,-0.831,-1.068,-0.869 +62,1,-0.479,-1.970,-0.993 +62,0,-1.571,-0.116,0.645 +62,1,-0.330,-1.617,-0.731 +63,0,0.840,1.718,0.948 +63,0,-0.553,1.923,0.587 +63,0,0.447,0.991,-0.490 +63,0,1.054,0.827,0.195 +63,1,0.175,0.159,2.262 +64,1,0.749,-0.018,0.987 +64,1,0.870,1.326,2.189 +64,0,-1.511,-0.550,-0.211 +65,1,0.110,-0.616,0.677 +65,0,0.035,-0.452,-0.834 +65,0,-0.535,-0.946,-2.080 +66,0,-0.244,0.607,-0.180 +66,0,-0.158,-0.592,-0.390 +66,0,-0.831,0.007,-0.742 +66,0,-2.702,-0.173,-0.627 +66,1,0.127,-1.284,-1.134 +67,1,-0.019,-0.011,0.629 +67,1,0.342,0.030,-0.052 +67,1,0.029,-1.448,-1.414 +67,0,-0.908,-0.654,0.621 +67,1,1.046,-0.615,1.091 +68,0,1.226,1.539,1.281 +68,1,0.607,-0.017,0.445 +68,0,0.034,0.540,-0.123 +68,0,-0.472,1.462,0.152 +68,0,0.071,-0.296,0.501 +69,0,0.171,0.077,-0.250 +69,0,-1.505,0.892,0.494 +69,0,-1.323,-0.118,-2.233 +70,0,-0.241,-1.165,-1.026 +70,0,0.049,-0.135,-1.815 +70,1,-1.034,-1.699,-0.633 +70,0,-1.023,-0.640,-1.268 +70,0,-0.526,-0.900,-0.125 +71,1,-1.258,0.278,0.976 +71,0,-0.227,0.418,0.196 +71,1,0.861,-0.645,-0.325 +71,0,0.723,1.198,0.735 +71,1,1.383,0.266,-0.367 +72,1,1.051,0.205,1.127 +72,0,0.189,0.341,1.646 +72,0,0.419,1.143,1.203 +73,1,0.273,0.602,0.232 +73,1,0.026,-1.156,-0.154 +73,0,-0.146,1.330,0.929 +73,1,0.441,-0.742,0.088 +74,1,1.077,0.468,-0.853 +74,1,0.762,-0.734,-0.792 +74,0,0.527,1.874,1.111 +75,0,-1.184,-0.760,-0.354 +75,1,-0.562,-0.668,0.498 +75,1,-1.899,-1.153,-0.412 +76,0,0.299,0.394,-0.508 +76,1,-0.173,-0.463,-1.483 +76,1,0.989,1.104,1.273 +76,0,0.056,0.255,0.541 +76,0,-0.791,1.418,0.620 +77,1,1.378,0.369,1.177 +77,1,0.838,-1.108,0.643 +77,1,0.290,-0.577,-0.108 +77,1,0.232,-0.693,-0.408 +77,1,0.088,-0.056,0.251 +78,1,0.372,-0.891,-0.664 +78,1,0.465,-1.149,-0.877 +78,0,0.006,0.769,-0.335 +78,1,0.099,-1.169,-0.556 +78,0,-1.657,-0.537,-0.883 +79,0,-0.416,1.591,-0.134 +79,0,0.736,1.799,0.627 +79,1,0.861,-0.259,1.117 +80,0,1.034,1.587,0.848 +80,0,-0.073,0.096,1.879 +80,0,0.255,2.103,1.678 +81,0,-0.805,0.800,-0.431 +81,0,0.871,0.838,0.186 +81,1,0.132,-0.404,-0.703 +81,0,-0.538,-1.135,0.052 +81,0,-0.377,-0.380,-0.070 +82,1,0.126,-0.976,-0.559 +82,1,1.340,-0.905,0.349 +82,0,-0.595,0.833,0.392 +82,0,0.250,1.137,0.648 +83,1,0.630,-2.457,-0.912 +83,0,-0.722,-0.160,-0.791 +83,0,-0.792,-1.037,-1.090 +83,1,2.366,0.454,0.712 +83,0,-1.206,0.467,0.636 +84,0,-0.824,0.080,0.236 +84,0,-0.465,1.221,0.450 +84,0,-0.038,-0.846,-1.597 +84,0,0.338,-0.219,-0.462 +84,0,-1.183,0.710,0.367 +85,0,-0.232,1.064,1.111 +85,0,-0.718,-0.957,-0.499 +85,1,0.108,-0.307,0.549 +85,0,1.065,1.185,-0.365 +86,0,-0.152,-0.335,0.460 +86,0,0.136,0.340,0.139 +86,1,0.625,-1.260,-1.055 +86,1,-0.639,-0.283,0.615 +86,0,-1.311,-1.058,-1.331 +87,1,0.722,1.639,2.768 +87,0,1.323,2.400,2.418 +87,0,0.510,1.850,1.053 +87,1,2.412,1.368,1.987 +88,1,1.233,-0.295,-0.576 +88,0,-0.495,-0.028,0.195 +88,1,-1.346,-1.850,-1.998 +88,1,0.262,-0.740,0.519 +88,1,-0.945,-1.215,-0.444 +89,1,0.712,1.025,0.635 +89,0,-0.119,1.420,2.225 +89,1,-0.739,-0.875,0.020 +90,0,-0.138,-0.556,-1.433 +90,0,-0.449,-1.425,-1.333 +90,1,-1.222,-0.166,0.305 +91,0,-0.012,0.647,1.009 +91,0,1.981,1.315,1.321 +91,1,0.161,-0.306,0.903 +91,0,-0.310,-0.933,-0.584 +91,0,-0.537,1.372,0.731 +92,1,1.447,-1.860,-0.807 +92,0,-0.665,0.582,0.603 +92,0,-0.572,-0.251,-0.438 +92,0,-1.938,-0.438,-2.119 +92,0,-1.318,-0.096,-1.238 +93,0,0.144,0.112,-1.106 +93,0,-0.699,-0.236,-1.634 +93,0,-0.646,-0.373,-1.453 +93,0,-1.280,-0.266,-0.613 +93,0,-0.700,-0.774,-0.306 +94,1,0.416,-0.308,-0.984 +94,1,1.229,1.059,0.690 +94,0,0.545,-0.163,-0.516 +95,0,0.581,0.231,0.004 +95,0,0.116,0.108,-0.864 +95,1,0.137,-1.301,-2.356 +96,1,-0.778,-1.520,-0.577 +96,1,0.491,-0.398,0.452 +96,1,-0.217,-0.623,0.954 +97,0,0.805,0.473,-0.568 +97,1,0.241,0.721,0.991 +97,0,-0.278,0.807,-1.064 +98,1,-0.931,-1.886,-1.640 +98,0,-1.223,-1.645,-1.548 +98,0,-2.199,-0.865,-0.425 +98,1,-0.356,-2.400,-0.766 +99,1,0.540,-0.949,-0.317 +99,0,-0.658,-1.097,-2.819 +99,0,-0.823,-0.994,-1.202 diff --git a/shared/package-files/9e/9e7299a7432e9a547825e22403aeac2260f98cca8336c69f213120527273a9e9/blob b/shared/package-files/9e/9e7299a7432e9a547825e22403aeac2260f98cca8336c69f213120527273a9e9/blob new file mode 100644 index 0000000000000000000000000000000000000000..2c6cecac85a87112c4d94716c246a2dd5888fc5c --- /dev/null +++ b/shared/package-files/9e/9e7299a7432e9a547825e22403aeac2260f98cca8336c69f213120527273a9e9/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e7299a7432e9a547825e22403aeac2260f98cca8336c69f213120527273a9e9 +size 210768 diff --git a/shared/package-files/9e/9e76d8350e857eba01bcd350d267300f0f924f152c0f486f21bfb46178ab071a/blob b/shared/package-files/9e/9e76d8350e857eba01bcd350d267300f0f924f152c0f486f21bfb46178ab071a/blob new file mode 100644 index 0000000000000000000000000000000000000000..a981b146256aea249b5ab784850027e46f152452 --- /dev/null +++ b/shared/package-files/9e/9e76d8350e857eba01bcd350d267300f0f924f152c0f486f21bfb46178ab071a/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e76d8350e857eba01bcd350d267300f0f924f152c0f486f21bfb46178ab071a +size 138128 diff --git a/shared/package-files/9e/9e788e3a186baf1f3cc14775886d82dafca14fa99f77537851b0ede2963517bf/blob b/shared/package-files/9e/9e788e3a186baf1f3cc14775886d82dafca14fa99f77537851b0ede2963517bf/blob new file mode 100644 index 0000000000000000000000000000000000000000..9ebf32d3e536eee7233b911acb880f3d40521793 --- /dev/null +++ b/shared/package-files/9e/9e788e3a186baf1f3cc14775886d82dafca14fa99f77537851b0ede2963517bf/blob @@ -0,0 +1,1095 @@ +from __future__ import annotations + +import datetime +from functools import partial +from textwrap import dedent +from typing import TYPE_CHECKING + +import numpy as np + +from pandas._libs.tslibs import Timedelta +import pandas._libs.window.aggregations as window_aggregations +from pandas.util._decorators import doc + +from pandas.core.dtypes.common import ( + is_datetime64_dtype, + is_numeric_dtype, +) +from pandas.core.dtypes.dtypes import DatetimeTZDtype +from pandas.core.dtypes.generic import ABCSeries +from pandas.core.dtypes.missing import isna + +from pandas.core import common +from pandas.core.arrays.datetimelike import dtype_to_unit +from pandas.core.indexers.objects import ( + BaseIndexer, + ExponentialMovingWindowIndexer, + GroupbyIndexer, +) +from pandas.core.util.numba_ import ( + get_jit_arguments, + maybe_use_numba, +) +from pandas.core.window.common import zsqrt +from pandas.core.window.doc import ( + _shared_docs, + create_section_header, + kwargs_numeric_only, + numba_notes, + template_header, + template_returns, + template_see_also, + window_agg_numba_parameters, +) +from pandas.core.window.numba_ import ( + generate_numba_ewm_func, + generate_numba_ewm_table_func, +) +from pandas.core.window.online import ( + EWMMeanState, + generate_online_numba_ewma_func, +) +from pandas.core.window.rolling import ( + BaseWindow, + BaseWindowGroupby, +) + +if TYPE_CHECKING: + from pandas._typing import ( + Axis, + TimedeltaConvertibleTypes, + npt, + ) + + from pandas import ( + DataFrame, + Series, + ) + from pandas.core.generic import NDFrame + + +def get_center_of_mass( + comass: float | None, + span: float | None, + halflife: float | None, + alpha: float | None, +) -> float: + valid_count = common.count_not_none(comass, span, halflife, alpha) + if valid_count > 1: + raise ValueError("comass, span, halflife, and alpha are mutually exclusive") + + # Convert to center of mass; domain checks ensure 0 < alpha <= 1 + if comass is not None: + if comass < 0: + raise ValueError("comass must satisfy: comass >= 0") + elif span is not None: + if span < 1: + raise ValueError("span must satisfy: span >= 1") + comass = (span - 1) / 2 + elif halflife is not None: + if halflife <= 0: + raise ValueError("halflife must satisfy: halflife > 0") + decay = 1 - np.exp(np.log(0.5) / halflife) + comass = 1 / decay - 1 + elif alpha is not None: + if alpha <= 0 or alpha > 1: + raise ValueError("alpha must satisfy: 0 < alpha <= 1") + comass = (1 - alpha) / alpha + else: + raise ValueError("Must pass one of comass, span, halflife, or alpha") + + return float(comass) + + +def _calculate_deltas( + times: np.ndarray | NDFrame, + halflife: float | TimedeltaConvertibleTypes | None, +) -> npt.NDArray[np.float64]: + """ + Return the diff of the times divided by the half-life. These values are used in + the calculation of the ewm mean. + + Parameters + ---------- + times : np.ndarray, Series + Times corresponding to the observations. Must be monotonically increasing + and ``datetime64[ns]`` dtype. + halflife : float, str, timedelta, optional + Half-life specifying the decay + + Returns + ------- + np.ndarray + Diff of the times divided by the half-life + """ + unit = dtype_to_unit(times.dtype) + if isinstance(times, ABCSeries): + times = times._values + _times = np.asarray(times.view(np.int64), dtype=np.float64) + _halflife = float(Timedelta(halflife).as_unit(unit)._value) + return np.diff(_times) / _halflife + + +class ExponentialMovingWindow(BaseWindow): + r""" + Provide exponentially weighted (EW) calculations. + + Exactly one of ``com``, ``span``, ``halflife``, or ``alpha`` must be + provided if ``times`` is not provided. If ``times`` is provided, + ``halflife`` and one of ``com``, ``span`` or ``alpha`` may be provided. + + Parameters + ---------- + com : float, optional + Specify decay in terms of center of mass + + :math:`\alpha = 1 / (1 + com)`, for :math:`com \geq 0`. + + span : float, optional + Specify decay in terms of span + + :math:`\alpha = 2 / (span + 1)`, for :math:`span \geq 1`. + + halflife : float, str, timedelta, optional + Specify decay in terms of half-life + + :math:`\alpha = 1 - \exp\left(-\ln(2) / halflife\right)`, for + :math:`halflife > 0`. + + If ``times`` is specified, a timedelta convertible unit over which an + observation decays to half its value. Only applicable to ``mean()``, + and halflife value will not apply to the other functions. + + alpha : float, optional + Specify smoothing factor :math:`\alpha` directly + + :math:`0 < \alpha \leq 1`. + + min_periods : int, default 0 + Minimum number of observations in window required to have a value; + otherwise, result is ``np.nan``. + + adjust : bool, default True + Divide by decaying adjustment factor in beginning periods to account + for imbalance in relative weightings (viewing EWMA as a moving average). + + - When ``adjust=True`` (default), the EW function is calculated using weights + :math:`w_i = (1 - \alpha)^i`. For example, the EW moving average of the series + [:math:`x_0, x_1, ..., x_t`] would be: + + .. math:: + y_t = \frac{x_t + (1 - \alpha)x_{t-1} + (1 - \alpha)^2 x_{t-2} + ... + (1 - + \alpha)^t x_0}{1 + (1 - \alpha) + (1 - \alpha)^2 + ... + (1 - \alpha)^t} + + - When ``adjust=False``, the exponentially weighted function is calculated + recursively: + + .. math:: + \begin{split} + y_0 &= x_0\\ + y_t &= (1 - \alpha) y_{t-1} + \alpha x_t, + \end{split} + ignore_na : bool, default False + Ignore missing values when calculating weights. + + - When ``ignore_na=False`` (default), weights are based on absolute positions. + For example, the weights of :math:`x_0` and :math:`x_2` used in calculating + the final weighted average of [:math:`x_0`, None, :math:`x_2`] are + :math:`(1-\alpha)^2` and :math:`1` if ``adjust=True``, and + :math:`(1-\alpha)^2` and :math:`\alpha` if ``adjust=False``. + + - When ``ignore_na=True``, weights are based + on relative positions. For example, the weights of :math:`x_0` and :math:`x_2` + used in calculating the final weighted average of + [:math:`x_0`, None, :math:`x_2`] are :math:`1-\alpha` and :math:`1` if + ``adjust=True``, and :math:`1-\alpha` and :math:`\alpha` if ``adjust=False``. + + axis : {0, 1}, default 0 + If ``0`` or ``'index'``, calculate across the rows. + + If ``1`` or ``'columns'``, calculate across the columns. + + For `Series` this parameter is unused and defaults to 0. + + times : np.ndarray, Series, default None + + Only applicable to ``mean()``. + + Times corresponding to the observations. Must be monotonically increasing and + ``datetime64[ns]`` dtype. + + If 1-D array like, a sequence with the same shape as the observations. + + method : str {'single', 'table'}, default 'single' + .. versionadded:: 1.4.0 + + Execute the rolling operation per single column or row (``'single'``) + or over the entire object (``'table'``). + + This argument is only implemented when specifying ``engine='numba'`` + in the method call. + + Only applicable to ``mean()`` + + Returns + ------- + pandas.api.typing.ExponentialMovingWindow + + See Also + -------- + rolling : Provides rolling window calculations. + expanding : Provides expanding transformations. + + Notes + ----- + See :ref:`Windowing Operations ` + for further usage details and examples. + + Examples + -------- + >>> df = pd.DataFrame({'B': [0, 1, 2, np.nan, 4]}) + >>> df + B + 0 0.0 + 1 1.0 + 2 2.0 + 3 NaN + 4 4.0 + + >>> df.ewm(com=0.5).mean() + B + 0 0.000000 + 1 0.750000 + 2 1.615385 + 3 1.615385 + 4 3.670213 + >>> df.ewm(alpha=2 / 3).mean() + B + 0 0.000000 + 1 0.750000 + 2 1.615385 + 3 1.615385 + 4 3.670213 + + **adjust** + + >>> df.ewm(com=0.5, adjust=True).mean() + B + 0 0.000000 + 1 0.750000 + 2 1.615385 + 3 1.615385 + 4 3.670213 + >>> df.ewm(com=0.5, adjust=False).mean() + B + 0 0.000000 + 1 0.666667 + 2 1.555556 + 3 1.555556 + 4 3.650794 + + **ignore_na** + + >>> df.ewm(com=0.5, ignore_na=True).mean() + B + 0 0.000000 + 1 0.750000 + 2 1.615385 + 3 1.615385 + 4 3.225000 + >>> df.ewm(com=0.5, ignore_na=False).mean() + B + 0 0.000000 + 1 0.750000 + 2 1.615385 + 3 1.615385 + 4 3.670213 + + **times** + + Exponentially weighted mean with weights calculated with a timedelta ``halflife`` + relative to ``times``. + + >>> times = ['2020-01-01', '2020-01-03', '2020-01-10', '2020-01-15', '2020-01-17'] + >>> df.ewm(halflife='4 days', times=pd.DatetimeIndex(times)).mean() + B + 0 0.000000 + 1 0.585786 + 2 1.523889 + 3 1.523889 + 4 3.233686 + """ + + _attributes = [ + "com", + "span", + "halflife", + "alpha", + "min_periods", + "adjust", + "ignore_na", + "axis", + "times", + "method", + ] + + def __init__( + self, + obj: NDFrame, + com: float | None = None, + span: float | None = None, + halflife: float | TimedeltaConvertibleTypes | None = None, + alpha: float | None = None, + min_periods: int | None = 0, + adjust: bool = True, + ignore_na: bool = False, + axis: Axis = 0, + times: np.ndarray | NDFrame | None = None, + method: str = "single", + *, + selection=None, + ) -> None: + super().__init__( + obj=obj, + min_periods=1 if min_periods is None else max(int(min_periods), 1), + on=None, + center=False, + closed=None, + method=method, + axis=axis, + selection=selection, + ) + self.com = com + self.span = span + self.halflife = halflife + self.alpha = alpha + self.adjust = adjust + self.ignore_na = ignore_na + self.times = times + if self.times is not None: + if not self.adjust: + raise NotImplementedError("times is not supported with adjust=False.") + times_dtype = getattr(self.times, "dtype", None) + if not ( + is_datetime64_dtype(times_dtype) + or isinstance(times_dtype, DatetimeTZDtype) + ): + raise ValueError("times must be datetime64 dtype.") + if len(self.times) != len(obj): + raise ValueError("times must be the same length as the object.") + if not isinstance(self.halflife, (str, datetime.timedelta, np.timedelta64)): + raise ValueError("halflife must be a timedelta convertible object") + if isna(self.times).any(): + raise ValueError("Cannot convert NaT values to integer") + self._deltas = _calculate_deltas(self.times, self.halflife) + # Halflife is no longer applicable when calculating COM + # But allow COM to still be calculated if the user passes other decay args + if common.count_not_none(self.com, self.span, self.alpha) > 0: + self._com = get_center_of_mass(self.com, self.span, None, self.alpha) + else: + self._com = 1.0 + else: + if self.halflife is not None and isinstance( + self.halflife, (str, datetime.timedelta, np.timedelta64) + ): + raise ValueError( + "halflife can only be a timedelta convertible argument if " + "times is not None." + ) + # Without times, points are equally spaced + self._deltas = np.ones( + max(self.obj.shape[self.axis] - 1, 0), dtype=np.float64 + ) + self._com = get_center_of_mass( + # error: Argument 3 to "get_center_of_mass" has incompatible type + # "Union[float, Any, None, timedelta64, signedinteger[_64Bit]]"; + # expected "Optional[float]" + self.com, + self.span, + self.halflife, # type: ignore[arg-type] + self.alpha, + ) + + def _check_window_bounds( + self, start: np.ndarray, end: np.ndarray, num_vals: int + ) -> None: + # emw algorithms are iterative with each point + # ExponentialMovingWindowIndexer "bounds" are the entire window + pass + + def _get_window_indexer(self) -> BaseIndexer: + """ + Return an indexer class that will compute the window start and end bounds + """ + return ExponentialMovingWindowIndexer() + + def online( + self, engine: str = "numba", engine_kwargs=None + ) -> OnlineExponentialMovingWindow: + """ + Return an ``OnlineExponentialMovingWindow`` object to calculate + exponentially moving window aggregations in an online method. + + .. versionadded:: 1.3.0 + + Parameters + ---------- + engine: str, default ``'numba'`` + Execution engine to calculate online aggregations. + Applies to all supported aggregation methods. + + engine_kwargs : dict, default None + Applies to all supported aggregation methods. + + * For ``'numba'`` engine, the engine can accept ``nopython``, ``nogil`` + and ``parallel`` dictionary keys. The values must either be ``True`` or + ``False``. The default ``engine_kwargs`` for the ``'numba'`` engine is + ``{{'nopython': True, 'nogil': False, 'parallel': False}}`` and will be + applied to the function + + Returns + ------- + OnlineExponentialMovingWindow + """ + return OnlineExponentialMovingWindow( + obj=self.obj, + com=self.com, + span=self.span, + halflife=self.halflife, + alpha=self.alpha, + min_periods=self.min_periods, + adjust=self.adjust, + ignore_na=self.ignore_na, + axis=self.axis, + times=self.times, + engine=engine, + engine_kwargs=engine_kwargs, + selection=self._selection, + ) + + @doc( + _shared_docs["aggregate"], + see_also=dedent( + """ + See Also + -------- + pandas.DataFrame.rolling.aggregate + """ + ), + examples=dedent( + """ + Examples + -------- + >>> df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6], "C": [7, 8, 9]}) + >>> df + A B C + 0 1 4 7 + 1 2 5 8 + 2 3 6 9 + + >>> df.ewm(alpha=0.5).mean() + A B C + 0 1.000000 4.000000 7.000000 + 1 1.666667 4.666667 7.666667 + 2 2.428571 5.428571 8.428571 + """ + ), + klass="Series/Dataframe", + axis="", + ) + def aggregate(self, func, *args, **kwargs): + return super().aggregate(func, *args, **kwargs) + + agg = aggregate + + @doc( + template_header, + create_section_header("Parameters"), + kwargs_numeric_only, + window_agg_numba_parameters(), + create_section_header("Returns"), + template_returns, + create_section_header("See Also"), + template_see_also, + create_section_header("Notes"), + numba_notes, + create_section_header("Examples"), + dedent( + """\ + >>> ser = pd.Series([1, 2, 3, 4]) + >>> ser.ewm(alpha=.2).mean() + 0 1.000000 + 1 1.555556 + 2 2.147541 + 3 2.775068 + dtype: float64 + """ + ), + window_method="ewm", + aggregation_description="(exponential weighted moment) mean", + agg_method="mean", + ) + def mean( + self, + numeric_only: bool = False, + engine=None, + engine_kwargs=None, + ): + if maybe_use_numba(engine): + if self.method == "single": + func = generate_numba_ewm_func + else: + func = generate_numba_ewm_table_func + ewm_func = func( + **get_jit_arguments(engine_kwargs), + com=self._com, + adjust=self.adjust, + ignore_na=self.ignore_na, + deltas=tuple(self._deltas), + normalize=True, + ) + return self._apply(ewm_func, name="mean") + elif engine in ("cython", None): + if engine_kwargs is not None: + raise ValueError("cython engine does not accept engine_kwargs") + + deltas = None if self.times is None else self._deltas + window_func = partial( + window_aggregations.ewm, + com=self._com, + adjust=self.adjust, + ignore_na=self.ignore_na, + deltas=deltas, + normalize=True, + ) + return self._apply(window_func, name="mean", numeric_only=numeric_only) + else: + raise ValueError("engine must be either 'numba' or 'cython'") + + @doc( + template_header, + create_section_header("Parameters"), + kwargs_numeric_only, + window_agg_numba_parameters(), + create_section_header("Returns"), + template_returns, + create_section_header("See Also"), + template_see_also, + create_section_header("Notes"), + numba_notes, + create_section_header("Examples"), + dedent( + """\ + >>> ser = pd.Series([1, 2, 3, 4]) + >>> ser.ewm(alpha=.2).sum() + 0 1.000 + 1 2.800 + 2 5.240 + 3 8.192 + dtype: float64 + """ + ), + window_method="ewm", + aggregation_description="(exponential weighted moment) sum", + agg_method="sum", + ) + def sum( + self, + numeric_only: bool = False, + engine=None, + engine_kwargs=None, + ): + if not self.adjust: + raise NotImplementedError("sum is not implemented with adjust=False") + if maybe_use_numba(engine): + if self.method == "single": + func = generate_numba_ewm_func + else: + func = generate_numba_ewm_table_func + ewm_func = func( + **get_jit_arguments(engine_kwargs), + com=self._com, + adjust=self.adjust, + ignore_na=self.ignore_na, + deltas=tuple(self._deltas), + normalize=False, + ) + return self._apply(ewm_func, name="sum") + elif engine in ("cython", None): + if engine_kwargs is not None: + raise ValueError("cython engine does not accept engine_kwargs") + + deltas = None if self.times is None else self._deltas + window_func = partial( + window_aggregations.ewm, + com=self._com, + adjust=self.adjust, + ignore_na=self.ignore_na, + deltas=deltas, + normalize=False, + ) + return self._apply(window_func, name="sum", numeric_only=numeric_only) + else: + raise ValueError("engine must be either 'numba' or 'cython'") + + @doc( + template_header, + create_section_header("Parameters"), + dedent( + """\ + bias : bool, default False + Use a standard estimation bias correction. + """ + ), + kwargs_numeric_only, + create_section_header("Returns"), + template_returns, + create_section_header("See Also"), + template_see_also, + create_section_header("Examples"), + dedent( + """\ + >>> ser = pd.Series([1, 2, 3, 4]) + >>> ser.ewm(alpha=.2).std() + 0 NaN + 1 0.707107 + 2 0.995893 + 3 1.277320 + dtype: float64 + """ + ), + window_method="ewm", + aggregation_description="(exponential weighted moment) standard deviation", + agg_method="std", + ) + def std(self, bias: bool = False, numeric_only: bool = False): + if ( + numeric_only + and self._selected_obj.ndim == 1 + and not is_numeric_dtype(self._selected_obj.dtype) + ): + # Raise directly so error message says std instead of var + raise NotImplementedError( + f"{type(self).__name__}.std does not implement numeric_only" + ) + return zsqrt(self.var(bias=bias, numeric_only=numeric_only)) + + @doc( + template_header, + create_section_header("Parameters"), + dedent( + """\ + bias : bool, default False + Use a standard estimation bias correction. + """ + ), + kwargs_numeric_only, + create_section_header("Returns"), + template_returns, + create_section_header("See Also"), + template_see_also, + create_section_header("Examples"), + dedent( + """\ + >>> ser = pd.Series([1, 2, 3, 4]) + >>> ser.ewm(alpha=.2).var() + 0 NaN + 1 0.500000 + 2 0.991803 + 3 1.631547 + dtype: float64 + """ + ), + window_method="ewm", + aggregation_description="(exponential weighted moment) variance", + agg_method="var", + ) + def var(self, bias: bool = False, numeric_only: bool = False): + window_func = window_aggregations.ewmcov + wfunc = partial( + window_func, + com=self._com, + adjust=self.adjust, + ignore_na=self.ignore_na, + bias=bias, + ) + + def var_func(values, begin, end, min_periods): + return wfunc(values, begin, end, min_periods, values) + + return self._apply(var_func, name="var", numeric_only=numeric_only) + + @doc( + template_header, + create_section_header("Parameters"), + dedent( + """\ + other : Series or DataFrame , optional + If not supplied then will default to self and produce pairwise + output. + pairwise : bool, default None + If False then only matching columns between self and other will be + used and the output will be a DataFrame. + If True then all pairwise combinations will be calculated and the + output will be a MultiIndex DataFrame in the case of DataFrame + inputs. In the case of missing elements, only complete pairwise + observations will be used. + bias : bool, default False + Use a standard estimation bias correction. + """ + ), + kwargs_numeric_only, + create_section_header("Returns"), + template_returns, + create_section_header("See Also"), + template_see_also, + create_section_header("Examples"), + dedent( + """\ + >>> ser1 = pd.Series([1, 2, 3, 4]) + >>> ser2 = pd.Series([10, 11, 13, 16]) + >>> ser1.ewm(alpha=.2).cov(ser2) + 0 NaN + 1 0.500000 + 2 1.524590 + 3 3.408836 + dtype: float64 + """ + ), + window_method="ewm", + aggregation_description="(exponential weighted moment) sample covariance", + agg_method="cov", + ) + def cov( + self, + other: DataFrame | Series | None = None, + pairwise: bool | None = None, + bias: bool = False, + numeric_only: bool = False, + ): + from pandas import Series + + self._validate_numeric_only("cov", numeric_only) + + def cov_func(x, y): + x_array = self._prep_values(x) + y_array = self._prep_values(y) + window_indexer = self._get_window_indexer() + min_periods = ( + self.min_periods + if self.min_periods is not None + else window_indexer.window_size + ) + start, end = window_indexer.get_window_bounds( + num_values=len(x_array), + min_periods=min_periods, + center=self.center, + closed=self.closed, + step=self.step, + ) + result = window_aggregations.ewmcov( + x_array, + start, + end, + # error: Argument 4 to "ewmcov" has incompatible type + # "Optional[int]"; expected "int" + self.min_periods, # type: ignore[arg-type] + y_array, + self._com, + self.adjust, + self.ignore_na, + bias, + ) + return Series(result, index=x.index, name=x.name, copy=False) + + return self._apply_pairwise( + self._selected_obj, other, pairwise, cov_func, numeric_only + ) + + @doc( + template_header, + create_section_header("Parameters"), + dedent( + """\ + other : Series or DataFrame, optional + If not supplied then will default to self and produce pairwise + output. + pairwise : bool, default None + If False then only matching columns between self and other will be + used and the output will be a DataFrame. + If True then all pairwise combinations will be calculated and the + output will be a MultiIndex DataFrame in the case of DataFrame + inputs. In the case of missing elements, only complete pairwise + observations will be used. + """ + ), + kwargs_numeric_only, + create_section_header("Returns"), + template_returns, + create_section_header("See Also"), + template_see_also, + create_section_header("Examples"), + dedent( + """\ + >>> ser1 = pd.Series([1, 2, 3, 4]) + >>> ser2 = pd.Series([10, 11, 13, 16]) + >>> ser1.ewm(alpha=.2).corr(ser2) + 0 NaN + 1 1.000000 + 2 0.982821 + 3 0.977802 + dtype: float64 + """ + ), + window_method="ewm", + aggregation_description="(exponential weighted moment) sample correlation", + agg_method="corr", + ) + def corr( + self, + other: DataFrame | Series | None = None, + pairwise: bool | None = None, + numeric_only: bool = False, + ): + from pandas import Series + + self._validate_numeric_only("corr", numeric_only) + + def cov_func(x, y): + x_array = self._prep_values(x) + y_array = self._prep_values(y) + window_indexer = self._get_window_indexer() + min_periods = ( + self.min_periods + if self.min_periods is not None + else window_indexer.window_size + ) + start, end = window_indexer.get_window_bounds( + num_values=len(x_array), + min_periods=min_periods, + center=self.center, + closed=self.closed, + step=self.step, + ) + + def _cov(X, Y): + return window_aggregations.ewmcov( + X, + start, + end, + min_periods, + Y, + self._com, + self.adjust, + self.ignore_na, + True, + ) + + with np.errstate(all="ignore"): + cov = _cov(x_array, y_array) + x_var = _cov(x_array, x_array) + y_var = _cov(y_array, y_array) + result = cov / zsqrt(x_var * y_var) + return Series(result, index=x.index, name=x.name, copy=False) + + return self._apply_pairwise( + self._selected_obj, other, pairwise, cov_func, numeric_only + ) + + +class ExponentialMovingWindowGroupby(BaseWindowGroupby, ExponentialMovingWindow): + """ + Provide an exponential moving window groupby implementation. + """ + + _attributes = ExponentialMovingWindow._attributes + BaseWindowGroupby._attributes + + def __init__(self, obj, *args, _grouper=None, **kwargs) -> None: + super().__init__(obj, *args, _grouper=_grouper, **kwargs) + + if not obj.empty and self.times is not None: + # sort the times and recalculate the deltas according to the groups + groupby_order = np.concatenate(list(self._grouper.indices.values())) + self._deltas = _calculate_deltas( + self.times.take(groupby_order), + self.halflife, + ) + + def _get_window_indexer(self) -> GroupbyIndexer: + """ + Return an indexer class that will compute the window start and end bounds + + Returns + ------- + GroupbyIndexer + """ + window_indexer = GroupbyIndexer( + groupby_indices=self._grouper.indices, + window_indexer=ExponentialMovingWindowIndexer, + ) + return window_indexer + + +class OnlineExponentialMovingWindow(ExponentialMovingWindow): + def __init__( + self, + obj: NDFrame, + com: float | None = None, + span: float | None = None, + halflife: float | TimedeltaConvertibleTypes | None = None, + alpha: float | None = None, + min_periods: int | None = 0, + adjust: bool = True, + ignore_na: bool = False, + axis: Axis = 0, + times: np.ndarray | NDFrame | None = None, + engine: str = "numba", + engine_kwargs: dict[str, bool] | None = None, + *, + selection=None, + ) -> None: + if times is not None: + raise NotImplementedError( + "times is not implemented with online operations." + ) + super().__init__( + obj=obj, + com=com, + span=span, + halflife=halflife, + alpha=alpha, + min_periods=min_periods, + adjust=adjust, + ignore_na=ignore_na, + axis=axis, + times=times, + selection=selection, + ) + self._mean = EWMMeanState( + self._com, self.adjust, self.ignore_na, self.axis, obj.shape + ) + if maybe_use_numba(engine): + self.engine = engine + self.engine_kwargs = engine_kwargs + else: + raise ValueError("'numba' is the only supported engine") + + def reset(self) -> None: + """ + Reset the state captured by `update` calls. + """ + self._mean.reset() + + def aggregate(self, func, *args, **kwargs): + raise NotImplementedError("aggregate is not implemented.") + + def std(self, bias: bool = False, *args, **kwargs): + raise NotImplementedError("std is not implemented.") + + def corr( + self, + other: DataFrame | Series | None = None, + pairwise: bool | None = None, + numeric_only: bool = False, + ): + raise NotImplementedError("corr is not implemented.") + + def cov( + self, + other: DataFrame | Series | None = None, + pairwise: bool | None = None, + bias: bool = False, + numeric_only: bool = False, + ): + raise NotImplementedError("cov is not implemented.") + + def var(self, bias: bool = False, numeric_only: bool = False): + raise NotImplementedError("var is not implemented.") + + def mean(self, *args, update=None, update_times=None, **kwargs): + """ + Calculate an online exponentially weighted mean. + + Parameters + ---------- + update: DataFrame or Series, default None + New values to continue calculating the + exponentially weighted mean from the last values and weights. + Values should be float64 dtype. + + ``update`` needs to be ``None`` the first time the + exponentially weighted mean is calculated. + + update_times: Series or 1-D np.ndarray, default None + New times to continue calculating the + exponentially weighted mean from the last values and weights. + If ``None``, values are assumed to be evenly spaced + in time. + This feature is currently unsupported. + + Returns + ------- + DataFrame or Series + + Examples + -------- + >>> df = pd.DataFrame({"a": range(5), "b": range(5, 10)}) + >>> online_ewm = df.head(2).ewm(0.5).online() + >>> online_ewm.mean() + a b + 0 0.00 5.00 + 1 0.75 5.75 + >>> online_ewm.mean(update=df.tail(3)) + a b + 2 1.615385 6.615385 + 3 2.550000 7.550000 + 4 3.520661 8.520661 + >>> online_ewm.reset() + >>> online_ewm.mean() + a b + 0 0.00 5.00 + 1 0.75 5.75 + """ + result_kwargs = {} + is_frame = self._selected_obj.ndim == 2 + if update_times is not None: + raise NotImplementedError("update_times is not implemented.") + update_deltas = np.ones( + max(self._selected_obj.shape[self.axis - 1] - 1, 0), dtype=np.float64 + ) + if update is not None: + if self._mean.last_ewm is None: + raise ValueError( + "Must call mean with update=None first before passing update" + ) + result_from = 1 + result_kwargs["index"] = update.index + if is_frame: + last_value = self._mean.last_ewm[np.newaxis, :] + result_kwargs["columns"] = update.columns + else: + last_value = self._mean.last_ewm + result_kwargs["name"] = update.name + np_array = np.concatenate((last_value, update.to_numpy())) + else: + result_from = 0 + result_kwargs["index"] = self._selected_obj.index + if is_frame: + result_kwargs["columns"] = self._selected_obj.columns + else: + result_kwargs["name"] = self._selected_obj.name + np_array = self._selected_obj.astype(np.float64, copy=False).to_numpy() + ewma_func = generate_online_numba_ewma_func( + **get_jit_arguments(self.engine_kwargs) + ) + result = self._mean.run_ewm( + np_array if is_frame else np_array[:, np.newaxis], + update_deltas, + self.min_periods, + ewma_func, + ) + if not is_frame: + result = result.squeeze() + result = result[result_from:] + result = self._selected_obj._constructor(result, **result_kwargs) + return result diff --git a/shared/package-files/9e/9e797f24d834a3da01e79db50a124e07e688bfa2dc0b47884b4fad9afda29bec/blob b/shared/package-files/9e/9e797f24d834a3da01e79db50a124e07e688bfa2dc0b47884b4fad9afda29bec/blob new file mode 100644 index 0000000000000000000000000000000000000000..a86b3bf6e294f59e6ca93eeb81d0490442dfac17 --- /dev/null +++ b/shared/package-files/9e/9e797f24d834a3da01e79db50a124e07e688bfa2dc0b47884b4fad9afda29bec/blob @@ -0,0 +1,29 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_sqrt_out : public at::meta::structured_sqrt { +void impl(const at::Tensor & self, const at::Tensor & out); +}; +TORCH_API at::Tensor sqrt_sparse(const at::Tensor & self); +TORCH_API at::Tensor & sqrt_sparse_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & sqrt_sparse_(at::Tensor & self); +TORCH_API at::Tensor sqrt_sparse_csr(const at::Tensor & self); +TORCH_API at::Tensor & sqrt_sparse_csr_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & sqrt_sparse_csr_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/shared/package-files/9e/9e7cce40edc2244f7730b27a54883d59a72af87167aaf8cd0fc60a6f57f8e711/blob b/shared/package-files/9e/9e7cce40edc2244f7730b27a54883d59a72af87167aaf8cd0fc60a6f57f8e711/blob new file mode 100644 index 0000000000000000000000000000000000000000..7f4210608aa26f6ccdadd488dd90224e43590738 --- /dev/null +++ b/shared/package-files/9e/9e7cce40edc2244f7730b27a54883d59a72af87167aaf8cd0fc60a6f57f8e711/blob @@ -0,0 +1,62 @@ +Metadata-Version: 2.1 +Name: zstandard +Version: 0.19.0 +Summary: Zstandard bindings for Python +Home-page: https://github.com/indygreg/python-zstandard +Author: Gregory Szorc +Author-email: gregory.szorc@gmail.com +License: BSD +Keywords: zstandard,zstd,compression +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: C +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Requires-Python: >=3.6 +License-File: LICENSE +Requires-Dist: cffi (>=1.11) ; platform_python_implementation == "PyPy" +Provides-Extra: cffi +Requires-Dist: cffi (>=1.11) ; extra == 'cffi' + +================ +python-zstandard +================ + +| |ci-test| |ci-wheel| |ci-typing| |ci-sdist| |ci-anaconda| |ci-sphinx| + +This project provides Python bindings for interfacing with the +`Zstandard `_ compression library. A C extension +and CFFI interface are provided. + +The primary goal of the project is to provide a rich interface to the +underlying C API through a Pythonic interface while not sacrificing +performance. This means exposing most of the features and flexibility +of the C API while not sacrificing usability or safety that Python provides. + +The canonical home for this project is +https://github.com/indygreg/python-zstandard. + +For usage documentation, see https://python-zstandard.readthedocs.org/. + +.. |ci-test| image:: https://github.com/indygreg/python-zstandard/workflows/.github/workflows/test.yml/badge.svg + :target: https://github.com/indygreg/python-zstandard/blob/main/.github/workflows/test.yml + +.. |ci-wheel| image:: https://github.com/indygreg/python-zstandard/workflows/.github/workflows/wheel.yml/badge.svg + :target: https://github.com/indygreg/python-zstandard/blob/main/.github/workflows/wheel.yml + +.. |ci-typing| image:: https://github.com/indygreg/python-zstandard/workflows/.github/workflows/typing.yml/badge.svg + :target: https://github.com/indygreg/python-zstandard/blob/main/.github/workflows/typing.yml + +.. |ci-sdist| image:: https://github.com/indygreg/python-zstandard/workflows/.github/workflows/sdist.yml/badge.svg + :target: https://github.com/indygreg/python-zstandard/blob/main/.github/workflows/sdist.yml + +.. |ci-anaconda| image:: https://github.com/indygreg/python-zstandard/workflows/.github/workflows/anaconda.yml/badge.svg + :target: https://github.com/indygreg/python-zstandard/blob/main/.github/workflows/anaconda.yml + +.. |ci-sphinx| image:: https://github.com/indygreg/python-zstandard/workflows/.github/workflows/sphinx.yml/badge.svg + :target: https://github.com/indygreg/python-zstandard/blob/main/.github/workflows/sphinx.yml diff --git a/shared/package-files/9e/9e81f2e145e2e1e89e37937d791a5c2301fce8371add75f1d865c4647a030f81/blob b/shared/package-files/9e/9e81f2e145e2e1e89e37937d791a5c2301fce8371add75f1d865c4647a030f81/blob new file mode 100644 index 0000000000000000000000000000000000000000..003f5504199d476d879abb58e55317a9c07493d8 --- /dev/null +++ b/shared/package-files/9e/9e81f2e145e2e1e89e37937d791a5c2301fce8371add75f1d865c4647a030f81/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor outer(const at::Tensor & self, const at::Tensor & vec2); +TORCH_API at::Tensor & outer_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & vec2); +TORCH_API at::Tensor & outer_outf(const at::Tensor & self, const at::Tensor & vec2, at::Tensor & out); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9e/9e82e42aaf32ed13727f9a4388341e76822a04e1e3dd1de99d28ad9d8df98440/blob b/shared/package-files/9e/9e82e42aaf32ed13727f9a4388341e76822a04e1e3dd1de99d28ad9d8df98440/blob new file mode 100644 index 0000000000000000000000000000000000000000..1366d434e9a4b574721041258ad3cbf6a708f573 --- /dev/null +++ b/shared/package-files/9e/9e82e42aaf32ed13727f9a4388341e76822a04e1e3dd1de99d28ad9d8df98440/blob @@ -0,0 +1,431 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +import os +from logging import getLogger +from os.path import abspath, basename, exists, isdir, isfile, join + +from .. import CondaError +from ..auxlib.ish import dals +from ..base.constants import REPODATA_FN, ROOT_ENV_NAME, DepsModifier, UpdateModifier +from ..base.context import context, locate_prefix_by_name +from ..common.constants import NULL +from ..common.path import is_package_file, paths_equal +from ..core.index import calculate_channel_urls, get_index +from ..core.prefix_data import PrefixData +from ..exceptions import ( + CondaExitZero, + CondaImportError, + CondaOSError, + CondaSystemExit, + CondaValueError, + DirectoryNotACondaEnvironmentError, + DirectoryNotFoundError, + DryRunExit, + EnvironmentLocationNotFound, + NoBaseEnvironmentError, + PackageNotInstalledError, + PackagesNotFoundError, + SpecsConfigurationConflictError, + TooManyArgumentsError, + UnsatisfiableError, +) +from ..gateways.disk.create import mkdir_p +from ..gateways.disk.delete import delete_trash, path_is_clean +from ..misc import clone_env, explicit, touch_nonadmin +from ..models.match_spec import MatchSpec +from ..plan import revert_actions +from ..resolve import ResolvePackageNotFound +from . import common +from .common import check_non_admin + +log = getLogger(__name__) +stderrlog = getLogger("conda.stderr") + + +def check_prefix(prefix, json=False): + name = basename(prefix) + error = None + if name == ROOT_ENV_NAME: + error = "'%s' is a reserved environment name" % name + if exists(prefix): + if isdir(prefix) and "conda-meta" not in tuple( + entry.name for entry in os.scandir(prefix) + ): + return None + error = "prefix already exists: %s" % prefix + + if error: + raise CondaValueError(error, json) + + if " " in prefix: + stderrlog.warning( + "WARNING: A space was detected in your requested environment path:\n" + f"'{prefix}'\n" + "Spaces in paths can sometimes be problematic. To minimize issues,\n" + "make sure you activate your environment before running any executables!\n" + ) + + +def clone(src_arg, dst_prefix, json=False, quiet=False, index_args=None): + if os.sep in src_arg: + src_prefix = abspath(src_arg) + if not isdir(src_prefix): + raise DirectoryNotFoundError(src_arg) + else: + src_prefix = locate_prefix_by_name(src_arg) + + if not json: + print("Source: %s" % src_prefix) + print("Destination: %s" % dst_prefix) + + actions, untracked_files = clone_env( + src_prefix, dst_prefix, verbose=not json, quiet=quiet, index_args=index_args + ) + + if json: + common.stdout_json_success( + actions=actions, + untracked_files=list(untracked_files), + src_prefix=src_prefix, + dst_prefix=dst_prefix, + ) + + +def print_activate(env_name_or_prefix): # pragma: no cover + if not context.quiet and not context.json: + if " " in env_name_or_prefix: + env_name_or_prefix = f'"{env_name_or_prefix}"' + message = dals( + f""" + # + # To activate this environment, use + # + # $ conda activate {env_name_or_prefix} + # + # To deactivate an active environment, use + # + # $ conda deactivate + """ + ) + print(message) # TODO: use logger + + +def get_revision(arg, json=False): + try: + return int(arg) + except ValueError: + raise CondaValueError("expected revision number, not: '%s'" % arg, json) + + +def install(args, parser, command="install"): + """Logic for `conda install`, `conda update`, and `conda create`.""" + context.validate_configuration() + check_non_admin() + # this is sort of a hack. current_repodata.json may not have any .tar.bz2 files, + # because it deduplicates records that exist as both formats. Forcing this to + # repodata.json ensures that .tar.bz2 files are available + if context.use_only_tar_bz2: + args.repodata_fns = ("repodata.json",) + + newenv = bool(command == "create") + isupdate = bool(command == "update") + isinstall = bool(command == "install") + isremove = bool(command == "remove") + prefix = context.target_prefix + if newenv: + check_prefix(prefix, json=context.json) + if context.force_32bit and prefix == context.root_prefix: + raise CondaValueError("cannot use CONDA_FORCE_32BIT=1 in base env") + if isupdate and not ( + args.file + or args.packages + or context.update_modifier == UpdateModifier.UPDATE_ALL + ): + raise CondaValueError( + """no package names supplied +# Example: conda update -n myenv scipy +""" + ) + + if not newenv: + if isdir(prefix): + delete_trash(prefix) + if not isfile(join(prefix, "conda-meta", "history")): + if paths_equal(prefix, context.conda_prefix): + raise NoBaseEnvironmentError() + else: + if not path_is_clean(prefix): + raise DirectoryNotACondaEnvironmentError(prefix) + else: + # fall-through expected under normal operation + pass + else: + if hasattr(args, "mkdir") and args.mkdir: + try: + mkdir_p(prefix) + except OSError as e: + raise CondaOSError( + "Could not create directory: %s" % prefix, caused_by=e + ) + else: + raise EnvironmentLocationNotFound(prefix) + + args_packages = [s.strip("\"'") for s in args.packages] + if newenv and not args.no_default_packages: + # Override defaults if they are specified at the command line + # TODO: rework in 4.4 branch using MatchSpec + args_packages_names = [ + pkg.replace(" ", "=").split("=", 1)[0] for pkg in args_packages + ] + for default_pkg in context.create_default_packages: + default_pkg_name = default_pkg.replace(" ", "=").split("=", 1)[0] + if default_pkg_name not in args_packages_names: + args_packages.append(default_pkg) + + index_args = { + "use_cache": args.use_index_cache, + "channel_urls": context.channels, + "unknown": args.unknown, + "prepend": not args.override_channels, + "use_local": args.use_local, + } + + num_cp = sum(is_package_file(s) for s in args_packages) + if num_cp: + if num_cp == len(args_packages): + explicit(args_packages, prefix, verbose=not context.quiet) + return + else: + raise CondaValueError( + "cannot mix specifications with conda package" " filenames" + ) + + specs = [] + if args.file: + for fpath in args.file: + try: + specs.extend(common.specs_from_url(fpath, json=context.json)) + except UnicodeError: + raise CondaError( + "Error reading file, file should be a text file containing" + " packages \nconda create --help for details" + ) + if "@EXPLICIT" in specs: + explicit(specs, prefix, verbose=not context.quiet, index_args=index_args) + return + specs.extend(common.specs_from_args(args_packages, json=context.json)) + + if isinstall and args.revision: + get_revision(args.revision, json=context.json) + elif isinstall and not (args.file or args_packages): + raise CondaValueError( + "too few arguments, " "must supply command line package specs or --file" + ) + + # for 'conda update', make sure the requested specs actually exist in the prefix + # and that they are name-only specs + if isupdate and context.update_modifier != UpdateModifier.UPDATE_ALL: + prefix_data = PrefixData(prefix) + for spec in specs: + spec = MatchSpec(spec) + if not spec.is_name_only_spec: + raise CondaError( + "Invalid spec for 'conda update': %s\n" + "Use 'conda install' instead." % spec + ) + if not prefix_data.get(spec.name, None): + raise PackageNotInstalledError(prefix, spec.name) + + if newenv and args.clone: + if args.packages: + raise TooManyArgumentsError( + 0, + len(args.packages), + list(args.packages), + "did not expect any arguments for --clone", + ) + + clone( + args.clone, + prefix, + json=context.json, + quiet=context.quiet, + index_args=index_args, + ) + touch_nonadmin(prefix) + print_activate(args.name or prefix) + return + + repodata_fns = args.repodata_fns + if not repodata_fns: + repodata_fns = context.repodata_fns + if REPODATA_FN not in repodata_fns: + repodata_fns.append(REPODATA_FN) + + args_set_update_modifier = ( + hasattr(args, "update_modifier") and args.update_modifier != NULL + ) + # This helps us differentiate between an update, the --freeze-installed option, and the retry + # behavior in our initial fast frozen solve + _should_retry_unfrozen = ( + not args_set_update_modifier + or args.update_modifier + not in (UpdateModifier.FREEZE_INSTALLED, UpdateModifier.UPDATE_SPECS) + ) and not newenv + + for repodata_fn in repodata_fns: + try: + if isinstall and args.revision: + index = get_index( + channel_urls=index_args["channel_urls"], + prepend=index_args["prepend"], + platform=None, + use_local=index_args["use_local"], + use_cache=index_args["use_cache"], + unknown=index_args["unknown"], + prefix=prefix, + repodata_fn=repodata_fn, + ) + unlink_link_transaction = revert_actions( + prefix, get_revision(args.revision), index + ) + else: + solver_backend = context.plugin_manager.get_cached_solver_backend() + solver = solver_backend( + prefix, + context.channels, + context.subdirs, + specs_to_add=specs, + repodata_fn=repodata_fn, + command=args.cmd, + ) + update_modifier = context.update_modifier + if (isinstall or isremove) and args.update_modifier == NULL: + update_modifier = UpdateModifier.FREEZE_INSTALLED + deps_modifier = context.deps_modifier + if isupdate: + deps_modifier = context.deps_modifier or DepsModifier.UPDATE_SPECS + + unlink_link_transaction = solver.solve_for_transaction( + deps_modifier=deps_modifier, + update_modifier=update_modifier, + force_reinstall=context.force_reinstall or context.force, + should_retry_solve=( + _should_retry_unfrozen or repodata_fn != repodata_fns[-1] + ), + ) + # we only need one of these to work. If we haven't raised an exception, + # we're good. + break + + except (ResolvePackageNotFound, PackagesNotFoundError) as e: + if not getattr(e, "allow_retry", True): + raise e # see note in next except block + # end of the line. Raise the exception + if repodata_fn == repodata_fns[-1]: + # PackagesNotFoundError is the only exception type we want to raise. + # Over time, we should try to get rid of ResolvePackageNotFound + if isinstance(e, PackagesNotFoundError): + raise e + else: + channels_urls = tuple( + calculate_channel_urls( + channel_urls=index_args["channel_urls"], + prepend=index_args["prepend"], + platform=None, + use_local=index_args["use_local"], + ) + ) + # convert the ResolvePackageNotFound into PackagesNotFoundError + raise PackagesNotFoundError(e._formatted_chains, channels_urls) + + except (UnsatisfiableError, SystemExit, SpecsConfigurationConflictError) as e: + if not getattr(e, "allow_retry", True): + # TODO: This is a temporary workaround to allow downstream libraries + # to inject this attribute set to False and skip the retry logic + # Other solvers might implement their own internal retry logic without + # depending --freeze-install implicitly like conda classic does. Example + # retry loop in conda-libmamba-solver: + # https://github.com/conda-incubator/conda-libmamba-solver/blob/da5b1ba/conda_libmamba_solver/solver.py#L254-L299 + # If we end up raising UnsatisfiableError, we annotate it with `allow_retry` + # so we don't have go through all the repodatas and freeze-installed logic + # unnecessarily (see https://github.com/conda/conda/issues/11294). see also: + # https://github.com/conda-incubator/conda-libmamba-solver/blob/7c698209/conda_libmamba_solver/solver.py#L617 + raise e + # Quick solve with frozen env or trimmed repodata failed. Try again without that. + if not hasattr(args, "update_modifier"): + if repodata_fn == repodata_fns[-1]: + raise e + elif _should_retry_unfrozen: + try: + unlink_link_transaction = solver.solve_for_transaction( + deps_modifier=deps_modifier, + update_modifier=UpdateModifier.UPDATE_SPECS, + force_reinstall=context.force_reinstall or context.force, + should_retry_solve=(repodata_fn != repodata_fns[-1]), + ) + except ( + UnsatisfiableError, + SystemExit, + SpecsConfigurationConflictError, + ) as e: + # Unsatisfiable package specifications/no such revision/import error + if e.args and "could not import" in e.args[0]: + raise CondaImportError(str(e)) + # we want to fall through without raising if we're not at the end of the list + # of fns. That way, we fall to the next fn. + if repodata_fn == repodata_fns[-1]: + raise e + elif repodata_fn != repodata_fns[-1]: + continue # if we hit this, we should retry with next repodata source + else: + # end of the line. Raise the exception + # Unsatisfiable package specifications/no such revision/import error + if e.args and "could not import" in e.args[0]: + raise CondaImportError(str(e)) + raise e + handle_txn(unlink_link_transaction, prefix, args, newenv) + + +def handle_txn(unlink_link_transaction, prefix, args, newenv, remove_op=False): + if unlink_link_transaction.nothing_to_do: + if remove_op: + # No packages found to remove from environment + raise PackagesNotFoundError(args.package_names) + elif not newenv: + if context.json: + common.stdout_json_success( + message="All requested packages already installed." + ) + else: + print("\n# All requested packages already installed.\n") + return + + if not context.json: + unlink_link_transaction.print_transaction_summary() + common.confirm_yn() + + elif context.dry_run: + actions = unlink_link_transaction._make_legacy_action_groups()[0] + common.stdout_json_success(prefix=prefix, actions=actions, dry_run=True) + raise DryRunExit() + + try: + unlink_link_transaction.download_and_extract() + if context.download_only: + raise CondaExitZero( + "Package caches prepared. UnlinkLinkTransaction cancelled with " + "--download-only option." + ) + unlink_link_transaction.execute() + + except SystemExit as e: + raise CondaSystemExit("Exiting", e) + + if newenv: + touch_nonadmin(prefix) + print_activate(args.name or prefix) + + if context.json: + actions = unlink_link_transaction._make_legacy_action_groups()[0] + common.stdout_json_success(prefix=prefix, actions=actions) diff --git a/shared/package-files/9e/9e83d8bc6a39b92a37f2657be15e716635976d08db88b0e8617ea31518510f89/model_manifest.json b/shared/package-files/9e/9e83d8bc6a39b92a37f2657be15e716635976d08db88b0e8617ea31518510f89/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..2a0051e2af939bdef6588b558beb09f81ceb61bf --- /dev/null +++ b/shared/package-files/9e/9e83d8bc6a39b92a37f2657be15e716635976d08db88b0e8617ea31518510f89/model_manifest.json @@ -0,0 +1,13 @@ +{ + "schema": "massspecgym-retrieval-model/v1", + "checkpoint": { + "path": "model.pt", + "sha256": "e7a187fe0175f81c107a2a4e1de70d84eb9b977267c42dc7b7fd8e1c0a5fe59b", + "format": "pytorch" + }, + "model_config": "model_config.json", + "training_provenance": { + "data": "MassSpecGym v1.5 train and supplied held-out-clean ICEBERG simulations; validation only for model selection", + "pretrained_assets": [] + } +} \ No newline at end of file diff --git a/shared/package-files/9e/9e84fb02095ba456ca96a6593c3bbd563a4040e6a24aeebba8be1bf062cdec83/blob b/shared/package-files/9e/9e84fb02095ba456ca96a6593c3bbd563a4040e6a24aeebba8be1bf062cdec83/blob new file mode 100644 index 0000000000000000000000000000000000000000..73c8d84c76c28584396b59ba1aad08da8ca6d686 --- /dev/null +++ b/shared/package-files/9e/9e84fb02095ba456ca96a6593c3bbd563a4040e6a24aeebba8be1bf062cdec83/blob @@ -0,0 +1,15 @@ +# flake8: noqa: F401 +r"""Quantized Modules. + +This file is in the process of migration to `torch/ao/nn/quantized`, and +is kept here for compatibility while the migration process is ongoing. +If you are adding a new entry/functionality, please, add it to the +appropriate file under the `torch/ao/nn/quantized/modules`, +while adding an import statement here. +""" + +__all__ = ['EmbeddingPackedParams', 'Embedding', 'EmbeddingBag'] + +from torch.ao.nn.quantized.modules.embedding_ops import Embedding +from torch.ao.nn.quantized.modules.embedding_ops import EmbeddingBag +from torch.ao.nn.quantized.modules.embedding_ops import EmbeddingPackedParams diff --git a/shared/package-files/9e/9e85c88fc1f208936da780971887eccbafb2022ee94f53f8b939fefef61d18fa/blob b/shared/package-files/9e/9e85c88fc1f208936da780971887eccbafb2022ee94f53f8b939fefef61d18fa/blob new file mode 100644 index 0000000000000000000000000000000000000000..f63b8fa12da6a4237ebabd28f8a957e8122ae86d --- /dev/null +++ b/shared/package-files/9e/9e85c88fc1f208936da780971887eccbafb2022ee94f53f8b939fefef61d18fa/blob @@ -0,0 +1,26 @@ +import logging +from typing import Any + +from . import connectionpool, filepost, poolmanager, response +from .util import request as _request, retry, timeout, url + +__license__: Any + +HTTPConnectionPool = connectionpool.HTTPConnectionPool +HTTPSConnectionPool = connectionpool.HTTPSConnectionPool +connection_from_url = connectionpool.connection_from_url +encode_multipart_formdata = filepost.encode_multipart_formdata +PoolManager = poolmanager.PoolManager +ProxyManager = poolmanager.ProxyManager +proxy_from_url = poolmanager.proxy_from_url +HTTPResponse = response.HTTPResponse +make_headers = _request.make_headers +get_host = url.get_host +Timeout = timeout.Timeout +Retry = retry.Retry + +class NullHandler(logging.Handler): + def emit(self, record): ... + +def add_stderr_logger(level=...): ... +def disable_warnings(category=...): ... diff --git a/shared/package-files/9e/9e87e356321459dd9058d5353646b7c40813a2b86389b58ee0afd61919461ffb/blob b/shared/package-files/9e/9e87e356321459dd9058d5353646b7c40813a2b86389b58ee0afd61919461ffb/blob new file mode 100644 index 0000000000000000000000000000000000000000..feae5588009cabcd2424aba1a8dea619dd317224 --- /dev/null +++ b/shared/package-files/9e/9e87e356321459dd9058d5353646b7c40813a2b86389b58ee0afd61919461ffb/blob @@ -0,0 +1,10 @@ +"eta1","eta2","eta3","eps1","eps2","eps3","state1","state2","state3","signal1","signal2","signal3" +-0.00707614116231493,-0.00343719425392803,-0.0347922425061224,-0.00291921001196926,0.00726281652993645,0.0208586475611312,0.0278613442709423,0.00802329308895826,0.0593540336980345,0.0278613442709423,0.00802329308895826,0.0593540336980345 +-0.00387024549425167,-0.00331270982079964,-0.0063778442747854,0.000813337566656511,0.00351540514803166,-0.00776676718578853,-0.00200628969508274,0.00687057248340571,-0.0643642758546388,-0.00200628969508274,0.00687057248340571,-0.0643642758546388 +0.00692863694805055,-0.000985966990294491,0.037786887879322,0.00287660159346168,0.000377560445652924,0.0348630791864489,0.000617930990424314,0.000706450430966828,-0.000437968078185628,0.000617930990424314,0.000706450430966828,-0.000437968078185628 +-0.0128565188856924,-0.00374289540137993,-0.0842099370286948,0.0147448262909886,0.00999707101447812,0.0641295473218112,0.00744535317086104,-0.000462920189973421,0.0385342207346904,0.00744535317086104,-0.000462920189973421,0.0385342207346904 +-0.00901232771372828,-0.0102085148375063,-0.0332415444040201,0.00847665774996061,0.0152557211774593,-0.0139885744115985,-0.0131612110730808,-0.00268329316632621,-0.0927052708443691,-0.0131612110730808,-0.00268329316632621,-0.0927052708443691 +-0.0140741906906816,-0.00345240754935475,-0.0935269932093794,0.0136495752492263,0.00943787713070066,0.0378906175540744,-0.0120166950902412,-0.0134058036771714,-0.0438684968173701,-0.0120166950902412,-0.0134058036771714,-0.0438684968173701 +-0.00210675657910527,-0.00101919157504131,-0.0158040546058577,0.0121862896154432,0.0138945231109119,-0.00152332603225318,-0.0250926495836355,-0.0125514899135732,-0.130328691899703,-0.0250926495836355,-0.0125514899135732,-0.130328691899703 +0.00382300710542964,0.00364210664481087,0.00412259195140235,0.018926244550721,0.0113539077608011,0.071238269394727,-0.0130036533115703,-0.0116335576562645,-0.0459940886801504,-0.0130036533115703,-0.0116335576562645,-0.0459940886801504 +0,0,0,0.0241740968474436,0.0195640031732756,0.0949340947848488,-0.005639562705552,-0.00479416222945712,-0.0231002211004876,-0.005639562705552,-0.00479416222945712,-0.0231002211004876 diff --git a/shared/package-files/9e/9e887c6d834a76cdb22f69d5fc35b910f083ba014c9e21b509bd45b78329d5e2/blob b/shared/package-files/9e/9e887c6d834a76cdb22f69d5fc35b910f083ba014c9e21b509bd45b78329d5e2/blob new file mode 100644 index 0000000000000000000000000000000000000000..844c715350b05f6abef9257f2ed9b5b132f2cc01 --- /dev/null +++ b/shared/package-files/9e/9e887c6d834a76cdb22f69d5fc35b910f083ba014c9e21b509bd45b78329d5e2/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor & _histogramdd_from_bin_tensors_out(at::Tensor & out, const at::Tensor & self, at::TensorList bins, const c10::optional & weight={}, bool density=false); +TORCH_API at::Tensor & _histogramdd_from_bin_tensors_outf(const at::Tensor & self, at::TensorList bins, const c10::optional & weight, bool density, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9e/9e8b01de4e73e6cebfcba32c51fecc9189a89ee8b1bd81a3582002a7efec069d/blob b/shared/package-files/9e/9e8b01de4e73e6cebfcba32c51fecc9189a89ee8b1bd81a3582002a7efec069d/blob new file mode 100644 index 0000000000000000000000000000000000000000..d4ab7187513c15ad0bbc8cff610ec3831f3a51fe --- /dev/null +++ b/shared/package-files/9e/9e8b01de4e73e6cebfcba32c51fecc9189a89ee8b1bd81a3582002a7efec069d/blob @@ -0,0 +1,13 @@ +#pragma once + +#include +#include + +namespace at::xpu { + +inline Device getDeviceFromPtr(void* ptr) { + auto device = c10::xpu::get_device_idx_from_pointer(ptr); + return {c10::DeviceType::XPU, device}; +} + +} // namespace at::xpu diff --git a/shared/package-files/9e/9e8ffe6517a5f126f53f2e1fc93deda2dbbc2ed3de79733583e7aab51a472573/blob b/shared/package-files/9e/9e8ffe6517a5f126f53f2e1fc93deda2dbbc2ed3de79733583e7aab51a472573/blob new file mode 100644 index 0000000000000000000000000000000000000000..9592f54bd22961b1074a93716ae29749179bd3b6 --- /dev/null +++ b/shared/package-files/9e/9e8ffe6517a5f126f53f2e1fc93deda2dbbc2ed3de79733583e7aab51a472573/blob @@ -0,0 +1,13 @@ +*** Sat, 3 Sep 2016 22:32:51 *** +TEST FOR GRANGER-CAUSALITY: +H0: "realgdp" do not Granger-cause "realcons, realinv" + +Test statistic l = 3.1668 +pval-F( l; 8, 555) = 0.0016 + +TEST FOR INSTANTANEOUS CAUSALITY: +H0: No instantaneous causality between "realgdp" and "realcons, realinv" + +Test statistic: c = 86.2497 +pval-Chi( c; 2) = 0.0000 + diff --git a/shared/package-files/9e/9e9514f16a54efab19bfca2a510a81a5c57f4074fa456f63e361154d203aa6f0/blob b/shared/package-files/9e/9e9514f16a54efab19bfca2a510a81a5c57f4074fa456f63e361154d203aa6f0/blob new file mode 100644 index 0000000000000000000000000000000000000000..c92d5eb3898ecea0fb9e1f79c2725d1bc6dfa7fb --- /dev/null +++ b/shared/package-files/9e/9e9514f16a54efab19bfca2a510a81a5c57f4074fa456f63e361154d203aa6f0/blob @@ -0,0 +1,23 @@ +#pragma once +// ${generated_comment} + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace ${dispatch_namespace} { + +${dispatch_namespaced_declarations} + +} // namespace ${dispatch_namespace} +} // namespace at diff --git a/shared/package-files/9e/9e989b2163c43554e78b53205f29c6ba596dc7ec2d820cd15645db2a3cc0d3d2/blob b/shared/package-files/9e/9e989b2163c43554e78b53205f29c6ba596dc7ec2d820cd15645db2a3cc0d3d2/blob new file mode 100644 index 0000000000000000000000000000000000000000..c1aa0da122667f39374dc4cc65a1c7cd4f34136d Binary files /dev/null and b/shared/package-files/9e/9e989b2163c43554e78b53205f29c6ba596dc7ec2d820cd15645db2a3cc0d3d2/blob differ diff --git a/shared/package-files/9e/9e9ef177fdd88ce529367a7381b2c7c53bfaf93d63f396de77013e6cd2eb8f6a/blob b/shared/package-files/9e/9e9ef177fdd88ce529367a7381b2c7c53bfaf93d63f396de77013e6cd2eb8f6a/blob new file mode 100644 index 0000000000000000000000000000000000000000..c7cdcb89ff9da6d9d2a034a095706d0f160be64a Binary files /dev/null and b/shared/package-files/9e/9e9ef177fdd88ce529367a7381b2c7c53bfaf93d63f396de77013e6cd2eb8f6a/blob differ diff --git a/shared/package-files/9e/9ea0a9db09e8e6688e31eb05f151e16da850fc93f94574f6d72b06f596717889/blob b/shared/package-files/9e/9ea0a9db09e8e6688e31eb05f151e16da850fc93f94574f6d72b06f596717889/blob new file mode 100644 index 0000000000000000000000000000000000000000..bcea0a12c64285542bc6652f101ccfddfc7c7c3a --- /dev/null +++ b/shared/package-files/9e/9ea0a9db09e8e6688e31eb05f151e16da850fc93f94574f6d72b06f596717889/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ea0a9db09e8e6688e31eb05f151e16da850fc93f94574f6d72b06f596717889 +size 507691264 diff --git a/shared/package-files/9e/9ea3b595a1060ba582a495c81145da0ef01e092303974cce944d5dffa42e9deb/blob b/shared/package-files/9e/9ea3b595a1060ba582a495c81145da0ef01e092303974cce944d5dffa42e9deb/blob new file mode 100644 index 0000000000000000000000000000000000000000..5679294a0de9dd45ca37c0cfc83f5d49ebf19ece --- /dev/null +++ b/shared/package-files/9e/9ea3b595a1060ba582a495c81145da0ef01e092303974cce944d5dffa42e9deb/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ea3b595a1060ba582a495c81145da0ef01e092303974cce944d5dffa42e9deb +size 828890 diff --git a/shared/package-files/9e/9ea4d761fbd8efa059d9c978ea451bf26924965e52b5d0b305a4e7fd89067c89/blob b/shared/package-files/9e/9ea4d761fbd8efa059d9c978ea451bf26924965e52b5d0b305a4e7fd89067c89/blob new file mode 100644 index 0000000000000000000000000000000000000000..5d9a469915cfb718aba9020b82105c66d93b429f --- /dev/null +++ b/shared/package-files/9e/9ea4d761fbd8efa059d9c978ea451bf26924965e52b5d0b305a4e7fd89067c89/blob @@ -0,0 +1,99 @@ +import pytest + +from pandas import ( + Index, + Series, +) +import pandas._testing as tm +from pandas.api.types import is_bool_dtype + + +@pytest.mark.parametrize( + "data, index, drop_labels, axis, expected_data, expected_index", + [ + # Unique Index + ([1, 2], ["one", "two"], ["two"], 0, [1], ["one"]), + ([1, 2], ["one", "two"], ["two"], "rows", [1], ["one"]), + ([1, 1, 2], ["one", "two", "one"], ["two"], 0, [1, 2], ["one", "one"]), + # GH 5248 Non-Unique Index + ([1, 1, 2], ["one", "two", "one"], "two", 0, [1, 2], ["one", "one"]), + ([1, 1, 2], ["one", "two", "one"], ["one"], 0, [1], ["two"]), + ([1, 1, 2], ["one", "two", "one"], "one", 0, [1], ["two"]), + ], +) +def test_drop_unique_and_non_unique_index( + data, index, axis, drop_labels, expected_data, expected_index +): + ser = Series(data=data, index=index) + result = ser.drop(drop_labels, axis=axis) + expected = Series(data=expected_data, index=expected_index) + tm.assert_series_equal(result, expected) + + +@pytest.mark.parametrize( + "data, index, drop_labels, axis, error_type, error_desc", + [ + # single string/tuple-like + (range(3), list("abc"), "bc", 0, KeyError, "not found in axis"), + # bad axis + (range(3), list("abc"), ("a",), 0, KeyError, "not found in axis"), + (range(3), list("abc"), "one", "columns", ValueError, "No axis named columns"), + ], +) +def test_drop_exception_raised(data, index, drop_labels, axis, error_type, error_desc): + ser = Series(data, index=index) + with pytest.raises(error_type, match=error_desc): + ser.drop(drop_labels, axis=axis) + + +def test_drop_with_ignore_errors(): + # errors='ignore' + ser = Series(range(3), index=list("abc")) + result = ser.drop("bc", errors="ignore") + tm.assert_series_equal(result, ser) + result = ser.drop(["a", "d"], errors="ignore") + expected = ser.iloc[1:] + tm.assert_series_equal(result, expected) + + # GH 8522 + ser = Series([2, 3], index=[True, False]) + assert is_bool_dtype(ser.index) + assert ser.index.dtype == bool + result = ser.drop(True) + expected = Series([3], index=[False]) + tm.assert_series_equal(result, expected) + + +@pytest.mark.parametrize("index", [[1, 2, 3], [1, 1, 3]]) +@pytest.mark.parametrize("drop_labels", [[], [1], [3]]) +def test_drop_empty_list(index, drop_labels): + # GH 21494 + expected_index = [i for i in index if i not in drop_labels] + series = Series(index=index, dtype=object).drop(drop_labels) + expected = Series(index=expected_index, dtype=object) + tm.assert_series_equal(series, expected) + + +@pytest.mark.parametrize( + "data, index, drop_labels", + [ + (None, [1, 2, 3], [1, 4]), + (None, [1, 2, 2], [1, 4]), + ([2, 3], [0, 1], [False, True]), + ], +) +def test_drop_non_empty_list(data, index, drop_labels): + # GH 21494 and GH 16877 + dtype = object if data is None else None + ser = Series(data=data, index=index, dtype=dtype) + with pytest.raises(KeyError, match="not found in axis"): + ser.drop(drop_labels) + + +def test_drop_index_ea_dtype(any_numeric_ea_dtype): + # GH#45860 + df = Series(100, index=Index([1, 2, 2], dtype=any_numeric_ea_dtype)) + idx = Index([df.index[1]]) + result = df.drop(idx) + expected = Series(100, index=Index([1], dtype=any_numeric_ea_dtype)) + tm.assert_series_equal(result, expected) diff --git a/shared/package-files/9e/9ea5288e8892b1584e2eb793a9f26cc19fce5428c1fe757c6eb6c9d6dbe37303/blob b/shared/package-files/9e/9ea5288e8892b1584e2eb793a9f26cc19fce5428c1fe757c6eb6c9d6dbe37303/blob new file mode 100644 index 0000000000000000000000000000000000000000..a512b6a34563eec7ce9c2da41c0e1d84e7589754 --- /dev/null +++ b/shared/package-files/9e/9ea5288e8892b1584e2eb793a9f26cc19fce5428c1fe757c6eb6c9d6dbe37303/blob @@ -0,0 +1,394 @@ +"""Simplify TrueType glyphs by merging overlapping contours/components. + +Requires https://github.com/fonttools/skia-pathops +""" + +import itertools +import logging +from typing import Callable, Iterable, Optional, Mapping + +from fontTools.cffLib import CFFFontSet +from fontTools.ttLib import ttFont +from fontTools.ttLib.tables import _g_l_y_f +from fontTools.ttLib.tables import _h_m_t_x +from fontTools.misc.psCharStrings import T2CharString +from fontTools.misc.roundTools import otRound, noRound +from fontTools.pens.ttGlyphPen import TTGlyphPen +from fontTools.pens.t2CharStringPen import T2CharStringPen + +import pathops + +__all__ = ["removeOverlaps"] + + +class RemoveOverlapsError(Exception): + pass + + +log = logging.getLogger("fontTools.ttLib.removeOverlaps") + +_TTGlyphMapping = Mapping[str, ttFont._TTGlyph] + + +def skPathFromGlyph(glyphName: str, glyphSet: _TTGlyphMapping) -> pathops.Path: + path = pathops.Path() + pathPen = path.getPen(glyphSet=glyphSet) + glyphSet[glyphName].draw(pathPen) + return path + + +def skPathFromGlyphComponent( + component: _g_l_y_f.GlyphComponent, glyphSet: _TTGlyphMapping +): + baseGlyphName, transformation = component.getComponentInfo() + path = skPathFromGlyph(baseGlyphName, glyphSet) + return path.transform(*transformation) + + +def componentsOverlap(glyph: _g_l_y_f.Glyph, glyphSet: _TTGlyphMapping) -> bool: + if not glyph.isComposite(): + raise ValueError("This method only works with TrueType composite glyphs") + if len(glyph.components) < 2: + return False # single component, no overlaps + + component_paths = {} + + def _get_nth_component_path(index: int) -> pathops.Path: + if index not in component_paths: + component_paths[index] = skPathFromGlyphComponent( + glyph.components[index], glyphSet + ) + return component_paths[index] + + return any( + pathops.op( + _get_nth_component_path(i), + _get_nth_component_path(j), + pathops.PathOp.INTERSECTION, + fix_winding=False, + keep_starting_points=False, + ) + for i, j in itertools.combinations(range(len(glyph.components)), 2) + ) + + +def ttfGlyphFromSkPath(path: pathops.Path) -> _g_l_y_f.Glyph: + # Skia paths have no 'components', no need for glyphSet + ttPen = TTGlyphPen(glyphSet=None) + path.draw(ttPen) + glyph = ttPen.glyph() + assert not glyph.isComposite() + # compute glyph.xMin (glyfTable parameter unused for non composites) + glyph.recalcBounds(glyfTable=None) + return glyph + + +def _charString_from_SkPath( + path: pathops.Path, charString: T2CharString +) -> T2CharString: + if charString.width == charString.private.defaultWidthX: + width = None + else: + width = charString.width - charString.private.nominalWidthX + t2Pen = T2CharStringPen(width=width, glyphSet=None) + path.draw(t2Pen) + return t2Pen.getCharString(charString.private, charString.globalSubrs) + + +def _round_path( + path: pathops.Path, round: Callable[[float], float] = otRound +) -> pathops.Path: + rounded_path = pathops.Path() + for verb, points in path: + rounded_path.add(verb, *((round(p[0]), round(p[1])) for p in points)) + return rounded_path + + +def _simplify( + path: pathops.Path, + debugGlyphName: str, + *, + round: Callable[[float], float] = otRound, +) -> pathops.Path: + # skia-pathops has a bug where it sometimes fails to simplify paths when there + # are float coordinates and control points are very close to one another. + # Rounding coordinates to integers works around the bug. + # Since we are going to round glyf coordinates later on anyway, here it is + # ok(-ish) to also round before simplify. Better than failing the whole process + # for the entire font. + # https://bugs.chromium.org/p/skia/issues/detail?id=11958 + # https://github.com/google/fonts/issues/3365 + # TODO(anthrotype): remove once this Skia bug is fixed + try: + return pathops.simplify(path, clockwise=path.clockwise) + except pathops.PathOpsError: + pass + + path = _round_path(path, round=round) + try: + path = pathops.simplify(path, clockwise=path.clockwise) + log.debug( + "skia-pathops failed to simplify '%s' with float coordinates, " + "but succeded using rounded integer coordinates", + debugGlyphName, + ) + return path + except pathops.PathOpsError as e: + if log.isEnabledFor(logging.DEBUG): + path.dump() + raise RemoveOverlapsError( + f"Failed to remove overlaps from glyph {debugGlyphName!r}" + ) from e + + raise AssertionError("Unreachable") + + +def _same_path(path1: pathops.Path, path2: pathops.Path) -> bool: + return {tuple(c) for c in path1.contours} == {tuple(c) for c in path2.contours} + + +def removeTTGlyphOverlaps( + glyphName: str, + glyphSet: _TTGlyphMapping, + glyfTable: _g_l_y_f.table__g_l_y_f, + hmtxTable: _h_m_t_x.table__h_m_t_x, + removeHinting: bool = True, +) -> bool: + glyph = glyfTable[glyphName] + # decompose composite glyphs only if components overlap each other + if ( + glyph.numberOfContours > 0 + or glyph.isComposite() + and componentsOverlap(glyph, glyphSet) + ): + path = skPathFromGlyph(glyphName, glyphSet) + + # remove overlaps + path2 = _simplify(path, glyphName) + + # replace TTGlyph if simplified path is different (ignoring contour order) + if not _same_path(path, path2): + glyfTable[glyphName] = glyph = ttfGlyphFromSkPath(path2) + # simplified glyph is always unhinted + assert not glyph.program + # also ensure hmtx LSB == glyph.xMin so glyph origin is at x=0 + width, lsb = hmtxTable[glyphName] + if lsb != glyph.xMin: + hmtxTable[glyphName] = (width, glyph.xMin) + return True + + if removeHinting: + glyph.removeHinting() + return False + + +def _remove_glyf_overlaps( + *, + font: ttFont.TTFont, + glyphNames: Iterable[str], + glyphSet: _TTGlyphMapping, + removeHinting: bool, + ignoreErrors: bool, +) -> None: + glyfTable = font["glyf"] + hmtxTable = font["hmtx"] + + # process all simple glyphs first, then composites with increasing component depth, + # so that by the time we test for component intersections the respective base glyphs + # have already been simplified + glyphNames = sorted( + glyphNames, + key=lambda name: ( + ( + glyfTable[name].getCompositeMaxpValues(glyfTable).maxComponentDepth + if glyfTable[name].isComposite() + else 0 + ), + name, + ), + ) + modified = set() + for glyphName in glyphNames: + try: + if removeTTGlyphOverlaps( + glyphName, glyphSet, glyfTable, hmtxTable, removeHinting + ): + modified.add(glyphName) + except RemoveOverlapsError: + if not ignoreErrors: + raise + log.error("Failed to remove overlaps for '%s'", glyphName) + + log.debug("Removed overlaps for %s glyphs:\n%s", len(modified), " ".join(modified)) + + +def _remove_charstring_overlaps( + *, + glyphName: str, + glyphSet: _TTGlyphMapping, + cffFontSet: CFFFontSet, +) -> bool: + path = skPathFromGlyph(glyphName, glyphSet) + + # remove overlaps + path2 = _simplify(path, glyphName, round=noRound) + + # replace TTGlyph if simplified path is different (ignoring contour order) + if not _same_path(path, path2): + charStrings = cffFontSet[0].CharStrings + charStrings[glyphName] = _charString_from_SkPath(path2, charStrings[glyphName]) + return True + + return False + + +def _remove_cff_overlaps( + *, + font: ttFont.TTFont, + glyphNames: Iterable[str], + glyphSet: _TTGlyphMapping, + removeHinting: bool, + ignoreErrors: bool, + table_tag: str, + removeUnusedSubroutines: bool = True, +) -> None: + cffFontSet = font[table_tag].cff + modified = set() + for glyphName in glyphNames: + try: + if _remove_charstring_overlaps( + glyphName=glyphName, + glyphSet=glyphSet, + cffFontSet=cffFontSet, + ): + modified.add(glyphName) + except RemoveOverlapsError: + if not ignoreErrors: + raise + log.error("Failed to remove overlaps for '%s'", glyphName) + + if not modified: + log.debug("No overlaps found in the specified CFF glyphs") + return + + if removeHinting: + cffFontSet.remove_hints() + + if removeUnusedSubroutines: + cffFontSet.remove_unused_subroutines() + + log.debug("Removed overlaps for %s glyphs:\n%s", len(modified), " ".join(modified)) + + +def removeOverlaps( + font: ttFont.TTFont, + glyphNames: Optional[Iterable[str]] = None, + removeHinting: bool = True, + ignoreErrors: bool = False, + *, + removeUnusedSubroutines: bool = True, +) -> None: + """Simplify glyphs in TTFont by merging overlapping contours. + + Overlapping components are first decomposed to simple contours, then merged. + + Currently this only works for fonts with 'glyf' or 'CFF ' tables. + Raises NotImplementedError if 'glyf' or 'CFF ' tables are absent. + + Note that removing overlaps invalidates the hinting. By default we drop hinting + from all glyphs whether or not overlaps are removed from a given one, as it would + look weird if only some glyphs are left (un)hinted. + + Args: + font: input TTFont object, modified in place. + glyphNames: optional iterable of glyph names (str) to remove overlaps from. + By default, all glyphs in the font are processed. + removeHinting (bool): set to False to keep hinting for unmodified glyphs. + ignoreErrors (bool): set to True to ignore errors while removing overlaps, + thus keeping the tricky glyphs unchanged (fonttools/fonttools#2363). + removeUnusedSubroutines (bool): set to False to keep unused subroutines + in CFF table after removing overlaps. Default is to remove them if + any glyphs are modified. + """ + + if "glyf" not in font and "CFF " not in font and "CFF2" not in font: + raise NotImplementedError( + "No outline data found in the font: missing 'glyf', 'CFF ', or 'CFF2' table" + ) + + if glyphNames is None: + glyphNames = font.getGlyphOrder() + + # Wraps the underlying glyphs, takes care of interfacing with drawing pens + glyphSet = font.getGlyphSet() + + if "glyf" in font: + _remove_glyf_overlaps( + font=font, + glyphNames=glyphNames, + glyphSet=glyphSet, + removeHinting=removeHinting, + ignoreErrors=ignoreErrors, + ) + + if "CFF " in font or "CFF2" in font: + _remove_cff_overlaps( + font=font, + glyphNames=glyphNames, + glyphSet=glyphSet, + removeHinting=removeHinting, + ignoreErrors=ignoreErrors, + table_tag="CFF " if "CFF " in font else "CFF2", + removeUnusedSubroutines=removeUnusedSubroutines, + ) + + +def main(args=None): + """Simplify glyphs in TTFont by merging overlapping contours.""" + + import argparse + + parser = argparse.ArgumentParser( + "fonttools ttLib.removeOverlaps", description=__doc__ + ) + + parser.add_argument("input", metavar="INPUT.ttf", help="Input font file") + parser.add_argument("output", metavar="OUTPUT.ttf", help="Output font file") + parser.add_argument( + "glyphs", + metavar="GLYPHS", + nargs="*", + help="Optional list of glyph names to remove overlaps from", + ) + parser.add_argument( + "--keep-hinting", + action="store_true", + help="Keep hinting for unmodified glyphs, default is to drop hinting", + ) + parser.add_argument( + "--ignore-errors", + action="store_true", + help="ignore errors while removing overlaps, " + "thus keeping the tricky glyphs unchanged", + ) + parser.add_argument( + "--keep-unused-subroutines", + action="store_true", + help="Keep unused subroutines in CFF table after removing overlaps, " + "default is to remove them if any glyphs are modified", + ) + args = parser.parse_args(args) + + with ttFont.TTFont(args.input) as font: + removeOverlaps( + font=font, + glyphNames=args.glyphs or None, + removeHinting=not args.keep_hinting, + ignoreErrors=args.ignore_errors, + removeUnusedSubroutines=not args.keep_unused_subroutines, + ) + font.save(args.output) + + +if __name__ == "__main__": + main() diff --git a/shared/package-files/9e/9ea583c74e11c7239bc01d0f67a909fbb0a2a942fff7c4184dba8494e1468edf/blob b/shared/package-files/9e/9ea583c74e11c7239bc01d0f67a909fbb0a2a942fff7c4184dba8494e1468edf/blob new file mode 100644 index 0000000000000000000000000000000000000000..06141fd20c923f6de3d555233f21bcd2fc750d20 --- /dev/null +++ b/shared/package-files/9e/9ea583c74e11c7239bc01d0f67a909fbb0a2a942fff7c4184dba8494e1468edf/blob @@ -0,0 +1,1253 @@ +from __future__ import annotations # type: ignore[attr-defined] +from dataclasses import dataclass +from typing import ( + Callable, + Dict, + List, + Optional, + Sequence, + Tuple, + cast, +) +import copy +import warnings +from functools import reduce +import weakref + +import threading +import torch +import torch.distributed as dist +from torch.distributed import rpc +from torch.distributed import distributed_c10d +from torch.distributed._shard.metadata import ShardMetadata +import torch.distributed._shard.sharding_spec as shard_spec +from torch.distributed._shard.sharding_spec.api import ( + _dispatch_custom_op, + _has_custom_op, +) +from torch.distributed._shard.sharding_spec._internals import ( + check_tensor, + validate_non_overlapping_shards_metadata, +) +from torch.distributed._shard._utils import ( + DEPRECATE_MSG, +) + +from .metadata import TensorProperties, ShardedTensorMetadata +from .shard import Shard +from .reshard import reshuffle_local_shard, reshard_local_shard +from .utils import ( + _flatten_tensor_size, + _parse_and_validate_remote_device, + _validate_output_tensor_for_gather, + build_metadata_from_local_shards, + build_global_metadata +) +from torch.distributed.remote_device import _remote_device +from torch.utils import _pytree as pytree +import operator + +# Tracking for sharded tensor objects. +_sharded_tensor_lock = threading.Lock() +_sharded_tensor_current_id = 0 +_sharded_tensor_map: Dict[int, weakref.ReferenceType[ShardedTensor]] = {} + +# Default sharded ops +_SHARDED_OPS: Dict[Callable, Callable] = {} + +# Customized user ops +_CUSTOM_SHARDED_OPS: Dict[Callable, Callable] = {} + +def _register_remote_shards(sharded_tensor_id: int, rrefs: List[rpc.RRef[Shard]], rpc_rank: int): + with _sharded_tensor_lock: + if sharded_tensor_id not in _sharded_tensor_map: + raise RuntimeError( + f'Could not find sharded_tensor_id: {sharded_tensor_id} in map: {_sharded_tensor_map.keys()}') + + sharded_tensor = _sharded_tensor_map[sharded_tensor_id]() + if sharded_tensor is None: + raise RuntimeError('ShardedTensor weakref has been deallocated') + else: + sharded_tensor._register_remote_shards(rrefs, rpc_rank) + +class ShardedTensorBase(torch.Tensor): + _sharding_spec: shard_spec.ShardingSpec + _metadata: ShardedTensorMetadata + _local_shards: List[Shard] + + def __new__(cls, sharding_spec: shard_spec.ShardingSpec, *size, **kwargs): + # Use __new__ to construct a wrapper tensor, for recording tensor + # properties and logging purposes. + torch._C._log_api_usage_once("torch.distributed._shard.sharded_tensor") + + # check sharding spec and build sharded tensor metadata + if not isinstance(sharding_spec, shard_spec.ShardingSpec): + raise ValueError(f"Expecting ShardingSpec but got: {type(sharding_spec)}") + + sizes = _flatten_tensor_size(size) + dtype = kwargs["dtype"] + layout = kwargs["layout"] + pin_memory = kwargs["pin_memory"] + requires_grad = kwargs["requires_grad"] + + if dtype is None: + dtype = torch.get_default_dtype() + + tensor_properties = TensorProperties( + dtype, layout, requires_grad, pin_memory=pin_memory + ) + sharded_tensor_metadata = sharding_spec.build_metadata( + sizes, tensor_properties=tensor_properties + ) + + r = torch.Tensor._make_wrapper_subclass( # type: ignore[attr-defined] + cls, + sizes, + dtype=dtype, + layout=layout, + pin_memory=pin_memory, + requires_grad=requires_grad, + ) + # set sharding spec + r._sharding_spec = sharding_spec + # set metadata + r._metadata = sharded_tensor_metadata + # set local shards + r._local_shards = [] + return r + + def metadata(self) -> ShardedTensorMetadata: + """ + Returns a :class:`ShardedTensorMetadata` object corresponding to the + metadata for the entire tensor. + """ + return self._metadata + + def local_shards(self) -> List[Shard]: + """ + Returns a list of :class:`Shard' corresponding to the + local shards for this rank. Returns an empty list if the current rank + does not host any shards for this Tensor. + """ + return self._local_shards + + @classmethod + def _init_from_local_shards_and_global_metadata( + cls, + local_shards: List[Shard], + sharded_tensor_metadata: ShardedTensorMetadata, + sharding_spec=None, + ) -> ShardedTensorBase: + """ + Initialize a ShardedTensorBase with local shards and a global + ShardedTensorMetadata built on each rank. + Warning: This API is experimental and subject to change. It does + not do cross rank validations, and fully rely on the user + for the correctness of sharded_tensor_metadata on each rank + """ + shards_metadata = sharded_tensor_metadata.shards_metadata + tensor_properties = sharded_tensor_metadata.tensor_properties + + if len(shards_metadata) == 0: + raise ValueError("shards_metadata must not be empty!") + + if tensor_properties.layout != torch.strided: + raise ValueError("Only torch.strided layout is currently supported") + + if sharding_spec is None: + spec = shard_spec._infer_sharding_spec_from_shards_metadata(shards_metadata) + else: + spec = sharding_spec + + sharded_tensor_base = ShardedTensorBase.__new__( + ShardedTensor, + spec, + sharded_tensor_metadata.size, + dtype=tensor_properties.dtype, + layout=tensor_properties.layout, + pin_memory=tensor_properties.pin_memory, + requires_grad=tensor_properties.requires_grad, + ) + + # check if shards_metadata have overlap shards + validate_non_overlapping_shards_metadata(shards_metadata) + + # check if the shards_metadata is compatible with overall size of the sharded tensor. + check_tensor(shards_metadata, list(sharded_tensor_metadata.size)) + + # done validation, add local_shards + sharded_tensor_base._local_shards = local_shards + return sharded_tensor_base + + @classmethod + def __torch_dispatch__(cls, func, types, args=(), kwargs=None): + raise RuntimeError( + f"A {cls.__name__} object is being used from c++ while calling {func.__module__}.{func.__name__} " + "but the there is no custom __torch_dispatch__ implementation for it." + ) + +class ShardedTensor(ShardedTensorBase): + """ + ShardedTensor is an torch.Tensor subclass to represent Tensors that are sharded + across multiple devices and multiple processes. + + ShardedTensor is initialized in an SPMD like fashion where each rank + initializes the ShardedTensor. The ShardedTensor object on each rank + then only stores the local shard for the Tensor and provides global + metadata for all the shards. + + ShardedTensor doesn't provide any Tensor like operations but is a wrapper + providing the Tensor representing the local shard and the global metadata. + Using these, users can build their custom distributed._sharded computations + on top of this primitive. The local shards are all initialized using the + create_op specified by tensor_init_params.create_op, e.g., torch.ones, or + torch.empty + + Args: + sharding_spec (:class:`torch.distributed._shard.sharding_spec.ShardingSpec`): The specification + describing how to shard the Tensor. + size (int...): a sequence of integers defining the shape of the output + tensor. Can be a variable number of arguments or a collection like a list or tuple. + + Keyword args: + dtype (:class:`torch.dtype`, optional): the desired data type of returned tensor. + Default: if ``None``, uses a global default (see :func:`torch.set_default_dtype`). + layout (:class:`torch.layout`, optional): the desired layout of returned Tensor. + Default: ``torch.strided``. + requires_grad (bool, optional): If autograd should record operations on the + returned tensor. Default: ``False``. + pin_memory (bool, optional): If set, returned tensor would be allocated in + the pinned memory. Works only for CPU tensors. Default: ``False``. + memory_format (:class:`torch.memory_format`, optional): the desired memory format of + returned Tensor. Default: ``torch.contiguous_format``. + init_rrefs (bool, optional): Whether or not to initialize + :class:`torch.distributed.rpc.RRef`s pointing to remote shards. + Need to initialize the RPC Framework if specified as ``True``. + Default: ``False``. + + .. note:: ShardedTensor uses collectives to do various operations, i.e. it + uses all_gather to do cross rank validations. For NCCL-based process + groups, internal tensor representations of objects must be moved to the + GPU device before communication takes place. In this case, the device + used is given by ``torch.cuda.current_device()`` and it is the user's + responsibility to ensure that this is set so that each rank has an + individual GPU, via ``torch.cuda.set_device()`` + + """ + def __new__(cls, sharding_spec: shard_spec.ShardingSpec, *size, **kwargs): + self = super().__new__(cls, sharding_spec, *size, **kwargs) + return self + + def __init__( + self, + sharding_spec: shard_spec.ShardingSpec, + *size, + dtype=None, + layout=torch.strided, + requires_grad=False, + pin_memory=False, + memory_format=torch.contiguous_format, + process_group=None, + init_rrefs=False, + ): + # prepare initialization, initialize fields like + # _process_group, _local_shards, etc. + self._prepare_init(process_group=process_group, init_rrefs=init_rrefs) + + if layout != torch.strided: + raise ValueError('Only torch.strided layout is currently supported') + + if memory_format != torch.contiguous_format: + raise ValueError('Only torch.contiguous_format memory_format is currently supported') + + self._metadata.tensor_properties.memory_format = memory_format + + current_rank = dist.get_rank(self._process_group) + + for shard_metadata in self._metadata.shards_metadata: + rank, device = _parse_and_validate_remote_device(self._process_group, shard_metadata.placement) + if rank == current_rank: + local_tensor = _create_tensor_from_params( + shard_metadata.shard_sizes, + local_device=device, + tensor_properties=self._metadata.tensor_properties + ) + self._local_shards.append(Shard(local_tensor, shard_metadata)) + + # do post initialization (i.e. register sharded_tensor_id, initialize_rpc) + self._post_init() + + def _prepare_init(self, process_group=None, init_rrefs=False): + self._init_rrefs = init_rrefs + self._sharded_tensor_id = None + + self._process_group = ( + process_group + if process_group is not None + else distributed_c10d._get_default_group() + ) + + self._remote_shards: Dict[int, List[rpc.RRef[Shard]]] = {} + + def _post_init(self): + # Initialize RPC if available. + if self._init_rrefs: + with _sharded_tensor_lock: + global _sharded_tensor_current_id, _sharded_tensor_map + self._sharded_tensor_id = _sharded_tensor_current_id + _sharded_tensor_map[self._sharded_tensor_id] = weakref.ref(self) + _sharded_tensor_current_id += 1 + + if not rpc._is_current_rpc_agent_set(): + raise RuntimeError( + 'RPC Framework needs to be initialized using' + ' torch.distributed.rpc.init_rpc if init_rrefs is set to True') + self._init_rpc() + + def __del__(self): + # Clean up the global map. + with _sharded_tensor_lock: + global _sharded_tensor_current_id, _sharded_tensor_map + if ( + hasattr(self, "_sharded_tensor_id") + and self._sharded_tensor_id in _sharded_tensor_map + ): + _sharded_tensor_map.pop(self._sharded_tensor_id) # type: ignore[call-overload] + + def _init_rpc(self): + # Validate PG and RPC ranks match. + pg_rank = dist.get_rank() + rpc_rank = rpc.get_worker_info().id + if pg_rank != rpc_rank: + raise ValueError( + f'Default ProcessGroup and RPC ranks must be ' + f'the same for ShardedTensor, found process group rank: ' + f'{pg_rank} and RPC rank: {rpc_rank}' + ) + + self._remote_shards = {} + + # Gather all the sharded tensor ids. + worker_infos = rpc._get_current_rpc_agent().get_worker_infos() + rank_to_name = {} + name_to_rank = {} + + for worker_info in worker_infos: + rank_to_name[worker_info.id] = worker_info.name + name_to_rank[worker_info.name] = worker_info.id + + all_tensor_ids = rpc.api._all_gather(self._sharded_tensor_id) + + # Share the local shards to the entire world. + futs = [] + rpc_rank = rpc.get_worker_info().id + for rank in range(dist.get_world_size()): + # Skip self. + if rank == dist.get_rank(): + continue + + if len(self.local_shards()) != 0: + rrefs: List[rpc.RRef[Shard]] = [rpc.RRef(shard) for shard in self.local_shards()] + fut = rpc.rpc_async( + rank, + _register_remote_shards, + args=(all_tensor_ids[rank_to_name[rank]], rrefs, rpc_rank)) + futs.append(fut) + + torch.futures.wait_all(futs) + + # Barrier for all RPCs to finish on all ranks. + rpc.api._all_gather(None) + + def _get_preferred_device(self) -> torch.device: + """ + Return the preferred device to be used when creating tensors for collectives. + This method takes into account the associated process group + """ + if dist.get_backend(self._process_group) == dist.Backend.NCCL: + return torch.device(torch.cuda.current_device()) + return torch.device("cpu") + + def gather( # type: ignore[override] + self, + dst: int = 0, + out: Optional[torch.Tensor] = None, + enforce_dtype: bool = False, + dtype: Optional[torch.dtype] = None, + ) -> None: + """ + Creates a full :class:`Tensor` on rank ``dst`` by gathering all shards of the + sharded tensor. + + The API needs to be called on all ranks in SPMD fashion. All ranks should have + the same ``dst``. ``out`` should be a tensor of the same size as the overall + size of the sharded tensor on ``dst`` and ``None`` on all other ranks. + + Args: + dst(int): The rank where full tensor is constructed. + Default: 0 + out (:class `torch.Tensor`, optional): The output full tensor. + Must to be provided ONLY on ``dst`` rank. + Default: ``None`` + enforce_dtype (bool): Deprecated, please use dtype instead. Force the + gathered tensors to be the same type as input and output. + dtype (torch.dtype): Force the gathered tensors to be this dtype. + Default: ``None`` + """ + def shard_size(shard_md): + return reduce(operator.mul, shard_md.shard_sizes) # type: ignore[attr-defined] + + if enforce_dtype: + warnings.warn("enforce_dtype is deprecated. Please use dtype instead.") + + rank = dist.get_rank(self._process_group) + full_size = self.metadata().size + _validate_output_tensor_for_gather(rank, dst, full_size, out) + + local_shards = self.local_shards() + world_size = dist.get_world_size(self._process_group) + rank_sizes = [0 for _ in range(world_size)] + max_rank_size = 0 + shard_placement: Dict[ShardMetadata, Tuple[int, int]] = {} + # collect sizes + for shard_md in self.metadata().shards_metadata: + shard_rank = cast(_remote_device, shard_md.placement).rank() + assert shard_rank is not None + + shard_placement[shard_md] = (shard_rank, rank_sizes[shard_rank]) + rank_sizes[shard_rank] += shard_size(shard_md) + max_rank_size = max(max_rank_size, rank_sizes[shard_rank]) + + gather_list: Optional[List[torch.Tensor]] + if rank == dst: + assert out is not None + if enforce_dtype: + # enforce_dtype is deprecated. Do it for backward compatibility. + dtype = out.dtype + # TODO make it as a view of out tensor + gather_list = [torch.empty((max_rank_size,), device=out.device, dtype=dtype) for _ in range(world_size)] + else: + gather_list = None + + with torch.no_grad(): + if enforce_dtype and len(local_shards) > 0: + # enforce_dtype is deprecated. Do it for backward compatibility. + dtype = local_shards[0].tensor.dtype + data = torch.empty(max_rank_size, device=self._get_preferred_device(), dtype=dtype) + + for shard in local_shards: + src = shard.tensor.flatten() + if src.nelement() == 0 : + warnings.warn("Gathering a tensor with zero elements on rank " + str(rank)) + return + shard_offset = shard_placement[shard.metadata][1] + data[shard_offset: shard_offset + src.numel()].copy_(src) + + dist.gather( + tensor=data, + gather_list=gather_list, + dst=dst, + group=self._process_group, + ) + if rank != dst: + return + # In _validate_output_tensor_for_gather, we raise if out == None and rank == dst + out = cast(torch.Tensor, out) + assert gather_list is not None + + full_size = self.metadata().size + dims = len(full_size) + for shard_md in self.metadata().shards_metadata: + rank, rank_offset = shard_placement[shard_md] + tensor = gather_list[rank] + tensor = tensor[rank_offset : rank_offset + shard_size(shard_md)] + tensor = tensor.view(shard_md.shard_sizes) + + out_narrow_view = out + for dim in range(dims): + out_narrow_view = out_narrow_view.narrow( + dim, + shard_md.shard_offsets[dim], + shard_md.shard_sizes[dim], + ) + + out_narrow_view.copy_(tensor) + + def cpu( + self, + memory_format=torch.preserve_format, + process_group=None + ) -> ShardedTensor: + """ + Returns a copy of this object in CPU memory. + + If this ShardedTensor is already on CPU memory, then no copy is + performed and original object is returned. + + .. note:: When moving a ShardedTensor from GPU to CPU, the ShardedTensor might + need to be managed by a different type of ProcessGroup(i.e. ProcessGroupGloo), + it is the user's responsiblity to explicitly pass in a new process_group that + is compatible with CPU. + """ + # TODO: make this a __torch_function__ op once ShardedTensor becomes a + # torch.Tensor subclass, see https://github.com/pytorch/pytorch/issues/75402 + if memory_format != torch.preserve_format and \ + memory_format != torch.contiguous_format: + raise RuntimeError("Only `torch.contiguous_format` or " + "`torch.preserve_format` is supported!") + all_on_cpu = True + for meta in self.metadata().shards_metadata: + all_on_cpu &= (meta.placement.device().type == "cpu") # type: ignore[union-attr] + + # if every shard is already on CPU, return the original object + if all_on_cpu: + return self + + # if not, returns a copy of this object on CPU + list_shards: List[Shard] = [] + # move all local shards to cpu, and change metadata + for shard in self._local_shards: + cpu_tensor = shard.tensor.cpu(memory_format=memory_format) # type: ignore[call-arg] + metadata = copy.deepcopy(shard.metadata) + metadata.placement._device = torch.device("cpu") # type: ignore[union-attr] + list_shards.append( + Shard(cpu_tensor, metadata) + ) + + st_meta = copy.deepcopy(self.metadata()) + for meta in st_meta.shards_metadata: + if meta.placement.device().type != "cpu": # type: ignore[union-attr] + meta.placement._device = torch.device("cpu") # type: ignore[union-attr] + + pg = self._process_group if process_group is None else process_group + st_cpu = ShardedTensor._init_from_local_shards_and_global_metadata( + list_shards, + sharded_tensor_metadata=st_meta, + process_group=pg, + init_rrefs=self._init_rrefs + ) + return st_cpu + + def cuda( + self, + device=None, + non_blocking=False, + memory_format=torch.preserve_format, + process_group=None + ) -> ShardedTensor: + """ + Returns a copy of this object in CUDA memory, if the original ShardedTensor + is on CPU, we will move the local shard to the current GPU device of each + process in a SPMD fashion. + If this ShardedTensor is already on CUDA memory and local shards on each rank are + already on current device, we still returns a new ShardedTensor object with new + metadata, but no underlying data movements are performed. + .. note:: When moving a ShardedTensor from CPU to GPU, the ShardedTensor might + need to be managed by a different type of ProcessGroup(i.e. ProcessGroupNCCL), + it is the user's responsiblity to explicitly pass in a new process_group that + is compatible with GPU. + """ + if memory_format != torch.preserve_format and \ + memory_format != torch.contiguous_format: + raise RuntimeError("Only `torch.contiguous_format` or " + "`torch.preserve_format` is supported!") + + if device is not None: + device = torch.device(device) if isinstance(device, str) else device + assert isinstance(device, torch.device) and device.index == torch.cuda.current_device(), \ + '''Only device without device id (e.g. "cpu" or "cuda") is expected for ShardedTensor!''' + + current_device = torch.device(torch.cuda.current_device()) + # returns a copy of ShardedTensor on CUDA current device + list_shards: List[Shard] = [] + # move all local shards to current device, and change metadata + # if local shards already on the current device, there's no + # real data movement, only the metadata are copied. + for shard in self._local_shards: + cuda_tensor = shard.tensor.cuda( + device=current_device, + non_blocking=non_blocking, + memory_format=memory_format + ) # type: ignore[call-arg] + metadata = copy.deepcopy(shard.metadata) + metadata.placement._device = current_device # type: ignore[union-attr] + + list_shards.append( + Shard(cuda_tensor, metadata) + ) + + st_meta = copy.deepcopy(self.metadata()) + for meta in st_meta.shards_metadata: + if meta.placement.device().type != "cuda": # type: ignore[union-attr] + meta.placement._device = current_device # type: ignore[union-attr] + + pg = self._process_group if process_group is None else process_group + # we need to use `init_from_local_shards` to communicate between ranks + # and update the sharding spec/shards metadata. + st_cuda = ShardedTensor._init_from_local_shards_and_global_metadata( + list_shards, + sharded_tensor_metadata=st_meta, + process_group=pg, + init_rrefs=self._init_rrefs + ) + return st_cuda + + def to(self, *args, **kwargs) -> ShardedTensor: + current_device: torch.device + if self._local_shards: + current_device = self._local_shards[0].tensor.device + elif self._process_group._get_backend_name() == "gloo": + current_device = torch.device("cpu") + else: + current_device = torch.device(torch.cuda.current_device()) + current_dtype = self.dtype + device_to = current_device + dtype_to = current_dtype + if len(args) == 1: + if isinstance(args[0], torch.dtype): + dtype_to = args[0] + elif isinstance(args[0], torch.device): + device_to = args[0] + elif isinstance(args[0], (str, int)): + device_to = torch.device(args[0]) + elif isinstance(args[0], torch.Tensor): + dtype_to = args[0].dtype + device_to = args[0].device + else: + raise RuntimeError(f"ShardedTensor.to() have wrong arguments: {args}") + elif len(args) == 2: + device_to, dtype_to = args + else: + dtype_to = kwargs.get("dtype", current_dtype) + device_to = kwargs.get("device", current_device) + + device_to = torch.device(device_to) if isinstance(device_to, (str, int)) else device_to + + if device_to.type == "cuda": + # if device_to set to cuda, set to current device even + # if user specify the device index. + current_idx = torch.cuda.current_device() + if device_to.index != current_idx: + warnings.warn("ShardedTensor.to only move tensor to its current device" + "If you want to put to different device, use `reshard` instead.") + device_to = torch.device(current_idx) + + copy_tensor = kwargs.get("copy", False) + non_blocking = kwargs.get("non_blocking", False) + memory_format = kwargs.get("memory_format", torch.preserve_format) + process_group = kwargs.get("process_group", None) + + if not copy_tensor and dtype_to == current_dtype and device_to == current_device: + # already have correct dtype and device, return itself + return self + + # returns a copy of ShardedTensor on CUDA current device + list_shards: List[Shard] = [] + + for shard in self._local_shards: + new_tensor = shard.tensor.to( # type: ignore[call-overload] + device=device_to, + dtype=dtype_to, + non_blocking=non_blocking, + copy=copy_tensor, + memory_format=memory_format + ) + metadata = copy.deepcopy(shard.metadata) + if metadata.placement is not None: + metadata.placement._device = device_to + list_shards.append(Shard(new_tensor, metadata)) + + # update metadata + st_meta = copy.deepcopy(self.metadata()) + st_meta.tensor_properties.dtype = dtype_to + for meta in st_meta.shards_metadata: + meta.placement._device = device_to # type: ignore[union-attr] + + pg = self._process_group if process_group is None else process_group + # we need to use `init_from_local_shards` to communicate between ranks + # and update the sharding spec/shards metadata. + st_to = ShardedTensor._init_from_local_shards_and_global_metadata( + list_shards, + sharded_tensor_metadata=st_meta, + process_group=pg, + init_rrefs=self._init_rrefs + ) + return st_to + + + @classmethod + def _init_from_local_shards( + cls, + local_shards: List[Shard], + *global_size, + process_group=None, + init_rrefs=False, + ): + # STEP 1: Validate the Shardmetadatas locally + process_group = ( + process_group + if process_group is not None + else distributed_c10d._get_default_group() + ) + current_rank = dist.get_rank(process_group) + world_size = dist.get_world_size(process_group) + + local_sharded_tensor_metadata: Optional[ShardedTensorMetadata] = None + global_tensor_size = _flatten_tensor_size(global_size) + + if len(local_shards) > 0: + local_sharded_tensor_metadata = \ + build_metadata_from_local_shards(local_shards, global_tensor_size, current_rank, process_group) + + # STEP 2. Validate metadata across ranks, and build a global sharded tensor + # metadata by gathering local ShardedTensorMetadata + gathered_metadatas: List[Optional[ShardedTensorMetadata]] = [] + if world_size > 1: + gathered_metadatas = [None for _ in range(world_size)] + + dist.all_gather_object( + gathered_metadatas, + local_sharded_tensor_metadata, + group=process_group + ) + else: + gathered_metadatas = [local_sharded_tensor_metadata] + + global_sharded_tensor_metadata = build_global_metadata(gathered_metadatas) + tensor_properties = global_sharded_tensor_metadata.tensor_properties + + # STEP 3: Validation done, create the actual ShardedTensor and populate fields + # prepare initialization + spec = shard_spec._infer_sharding_spec_from_shards_metadata( + global_sharded_tensor_metadata.shards_metadata + ) + sharded_tensor = cls.__new__(cls, + spec, + global_sharded_tensor_metadata.size, + dtype=tensor_properties.dtype, + layout=tensor_properties.layout, + pin_memory=tensor_properties.pin_memory, + requires_grad=tensor_properties.requires_grad) + sharded_tensor._prepare_init(process_group=process_group, init_rrefs=init_rrefs) + + # attach local_shards to the ShardedTensor created + sharded_tensor._local_shards = local_shards + + # run post initialization, i.e. map registration, rpc initialization + sharded_tensor._post_init() + return sharded_tensor + + @classmethod + def _init_from_local_tensor( + cls, + local_tensor: torch.Tensor, + sharding_spec: shard_spec.ShardingSpec, + *global_size: Sequence[int], + process_group: Optional[dist.ProcessGroup] = None, + init_rrefs=False, + ) -> ShardedTensor: + """ + Initialize a ShardedTensor given only one local tensor, global sharded tensor + size and sharding spec on each rank. + + Args: + local_tensor (Tensor): Single tensor of local shard stored in each rank. + sharding_spec (:class:`torch.distributed._shard.sharding_spec.ShardingSpec`): + The specification describing how to shard the Tensor. + global_size (Sequence[int]): Size of the sharded tensor. + process_group (ProcessGroup, optional): The process group to aggregate on. + Default: None + init_rrefs (bool, optional): Whether or not to initialize + :class:`torch.distributed.rpc.RRef`s pointing to remote shards. + Need to initialize the RPC Framework if specified as ``True``. + Default: ``False``. + + Returns: + A :class:`ShardedTensor` sharded based on the given sharding_spec with local + tensor stored in the current rank. + + Examples: + >>> # xdoctest: +SKIP + >>> # All tensors below are of torch.int64 type. + >>> # We have 2 process groups, 2 ranks. + >>> tensor = torch.arange(2, dtype=torch.int64) + 1 + 2 * rank + >>> local_tensor = torch.unsqueeze(torch.cat([tensor, tensor + 2])) + >>> local_tensor + tensor([[1, 2, 3, 4]]) # Rank 0 + tensor([[3, 4, 5, 6]]) # Rank 1 + >>> sharding_dim = 0 + >>> sharding_spec = ChunkShardingSpec( + dim=sharding_dim, + placements=[ + "rank:0/cuda:0", + "rank:1/cuda:1", + ], + ) + >>> st = ShardedTensor._init_from_local_tensor(local_tensor, sharding_spec, [2, 4]) + >>> st + ShardedTensor( + ShardedTensorMetadata( + shards_metadata=[ + ShardMetadata(shard_offsets=[0, 0], shard_sizes=[1, 4], placement=rank:0/cuda:0), + ShardMetadata(shard_offsets=[1, 0], shard_sizes=[1, 4], placement=rank:1/cuda:1), + ], + size=torch.Size([2, 4]) + ) + >>> st.local_tensor() + tensor([1, 2, 3, 4]) # Rank 0 + tensor([3, 4, 5, 6]) # Rank 1 + + Warning: This API is experimental and subject to change. It lacks of a fully across + rank validations, and we only validate the local shard on the current rank. + We fully rely on the user to ensure local tensor is sharded based on the + sharding spec. + """ + warnings.warn(DEPRECATE_MSG) + + if not local_tensor.is_contiguous(): + raise ValueError('local_tensor is not a contiguous Tensor.') + + global_tensor_size = _flatten_tensor_size(global_size) + tensor_properties = TensorProperties( + dtype=local_tensor.dtype, + layout=local_tensor.layout, + requires_grad=local_tensor.requires_grad, + memory_format=torch.contiguous_format, + pin_memory=local_tensor.is_pinned()) + sharded_tensor_metadata = sharding_spec.build_metadata( + global_tensor_size, + tensor_properties + ) + + process_group = ( + process_group + if process_group is not None + else distributed_c10d._get_default_group() + ) + current_rank = dist.get_rank(process_group) + + local_shards: List[Shard] = [] + for shard_metadata in sharded_tensor_metadata.shards_metadata: + rank, device = _parse_and_validate_remote_device(process_group, shard_metadata.placement) + if rank == current_rank: + local_shards.append(Shard(local_tensor, shard_metadata)) + + # TODO: figure out what the API should behave when some rank have no shard + # see https://github.com/pytorch/pytorch/issues/7313 + return ShardedTensor._init_from_local_shards_and_global_metadata( + local_shards, + sharded_tensor_metadata, + process_group=process_group, + init_rrefs=init_rrefs, + sharding_spec=sharding_spec, + ) + + @classmethod + def _init_from_local_shards_and_global_metadata( # type: ignore[override] + cls, + local_shards: List[Shard], + sharded_tensor_metadata: ShardedTensorMetadata, + process_group=None, + init_rrefs=False, + sharding_spec=None, + ) -> ShardedTensor: + """ + Initialize a ShardedTensor with local shards and a global + ShardedTensorMetadata built on each rank. + + Warning: This API is experimental and subject to change. It does + not do cross rank validations, and fully rely on the user + for the correctness of sharded_tensor_metadata on each rank + """ + process_group = ( + process_group + if process_group is not None + else distributed_c10d._get_default_group() + ) + current_rank = dist.get_rank(process_group) + + shards_metadata = sharded_tensor_metadata.shards_metadata + + local_shard_metadatas = [] + + # collect local shard metadatas from the global sharded_tensor_metadata + for shard_metadata in shards_metadata: # type: ignore[attr-defined] + rank, local_device = _parse_and_validate_remote_device(process_group, shard_metadata.placement) + + if current_rank == rank: + local_shard_metadatas.append(shard_metadata) + + if len(local_shards) != len(local_shard_metadatas): + raise RuntimeError( + f'Number of local shards ({len(local_shards)}) does not match number of local ' + f'shards metadata in sharded_tensor_metadata ({len(local_shard_metadatas)}) ' + f'on rank ({current_rank}) ' + ) + + shards_metadata = sharded_tensor_metadata.shards_metadata + tensor_properties = sharded_tensor_metadata.tensor_properties + + if len(shards_metadata) == 0: + raise ValueError("shards_metadata must not be empty!") + + if tensor_properties.layout != torch.strided: + raise ValueError("Only torch.strided layout is currently supported") + + if sharding_spec is None: + spec = shard_spec._infer_sharding_spec_from_shards_metadata(shards_metadata) + else: + spec = sharding_spec + + sharded_tensor = ShardedTensor.__new__( + ShardedTensor, + spec, + sharded_tensor_metadata.size, + dtype=tensor_properties.dtype, + layout=tensor_properties.layout, + pin_memory=tensor_properties.pin_memory, + requires_grad=tensor_properties.requires_grad, + ) + + def _raise_if_mismatch(expected, actual, prop_name, rank, is_property=False): + tensor_property_or_metadata = ( + "tensor property" if is_property else "local ShardMetadata" + ) + if expected != actual: + raise ValueError( + f"Local shards' tensor {prop_name} property is incompatible with " + f"{tensor_property_or_metadata} on rank {rank}: " + f"{tensor_property_or_metadata} {prop_name}={expected}, " + f"local shard tensor {prop_name}={actual}." + ) + + for shard in local_shards: + shard_meta = shard.metadata + local_shard_tensor = shard.tensor + placement = shard_meta.placement + assert placement is not None, "Must specify placement for `Shard`!" + rank = placement.rank() + local_device = placement.device() + + _raise_if_mismatch( + tensor_properties.layout, + local_shard_tensor.layout, + "layout", + rank, + True, + ) + if not local_shard_tensor.is_contiguous(): + raise ValueError( + "Only torch.contiguous_format memory_format is currently supported" + ) + + _raise_if_mismatch( + shard_meta.shard_sizes, + list(local_shard_tensor.size()), + "size", + rank, + ) + _raise_if_mismatch( + tensor_properties.pin_memory, + local_shard_tensor.is_pinned(), + "pin_memory", + rank, + True, + ) + _raise_if_mismatch(local_device, local_shard_tensor.device, "device", rank) + _raise_if_mismatch( + tensor_properties.dtype, + local_shard_tensor.dtype, + "dtype", + rank, + True, + ) + _raise_if_mismatch( + tensor_properties.requires_grad, + local_shard_tensor.requires_grad, + "requires_grad", + rank, + True, + ) + + # check if shards_metadata have overlap shards + validate_non_overlapping_shards_metadata(shards_metadata) + + # check if the shards_metadata is compatible with overall size of the sharded tensor. + check_tensor(shards_metadata, list(sharded_tensor_metadata.size)) + + # done validation, add local_shards + sharded_tensor._local_shards = local_shards + sharded_tensor._prepare_init(process_group=process_group, init_rrefs=init_rrefs) + + # run post initialization, i.e. map registration, rpc initialization + sharded_tensor._post_init() + return sharded_tensor + + def sharding_spec(self) -> shard_spec.ShardingSpec: + """ + Returns the ShardingSpec for the tensor. + """ + return self._sharding_spec + + def reshard(self, resharding_spec: shard_spec.ShardingSpec) -> ShardedTensor: + """ + Reshard a sharded tensor given the ``resharding_spec``. For now, we only support + single local shard. + + If ``resharding_spec`` is same as the original one, this becomes a no-op. + If only ``resharding_spec`` shares the same sharding dim with the original one, + we swap local shards directly. + For more generic cases, we merge different shards across different ranks and split + the local shards based on the ``resharding_spec`` via `all_to_all` collective API. + + Args: + resharding_spec (:class:`torch.distributed._shard.sharding_spec.ShardingSpec`): The + specification describing how the tensor is sharded. + + Returns: + A :class:`ShardedTensor` object whose local shards are resharded. + + Examples: + >>> # xdoctest: +SKIP + >>> # We have 2 process groups, 2 ranks. + >>> tensor = torch.arange(4, dtype=torch.int64) + 1 + 2 * rank + >>> tensor = torch.stack([tensor, tensor]) + >>> tensor + tensor([[1, 2, 3, 4], [1, 2, 3, 4]]) # Rank 0 + tensor([[3, 4, 5, 6], [3, 4, 5, 6]]) # Rank 1 + tensor([[5, 6, 7, 8], [5, 6, 7, 8]]) # Rank 2 + tensor([[7, 8, 9, 10], [7, 8, 9, 10]]) # Rank 3 + >>> sharding_dim = 0 + >>> spec = ChunkShardingSpec( + dim=sharding_dim, + placements=[ + "rank:0/cuda:0", + "rank:1/cuda:1", + "rank:2/cuda:2", + "rank:3/cuda:3", + ], + ) + >>> current_offsets = [0] * 2 + >>> current_offsets[0] = rank * 2 + >>> shard_metadata = ShardMetadata( + shard_offsets=copy.deepcopy(current_offsets), + shard_sizes=tensor.size(), + placement=spec.placements[rank], + ) + >>> local_shards = [ + Shard( + tensor=tensor, + metadata=shard_metadata, + ) + ] + >>> st = ShardedTensor._init_from_local_shards(local_shards, tensor.size()) + >>> sharding_dim = 1 + >>> resharding_spec = ChunkShardingSpec( + dim=sharding_dim, + placements=[ + "rank:0/cuda:0", + "rank:1/cuda:1", + "rank:2/cuda:2", + "rank:3/cuda:3", + ], + ) + >>> st.reshard(resharding_spec) + >>> tensor = st.local_shards()[0].tensor + >>> tensor + tensor([[1], [1], [3], [3], [5], [5], [7], [7]]) # Rank 0 + tensor([[2], [2], [4], [4], [6], [6], [8], [8]]) # Rank 1 + tensor([[3], [3], [5], [5], [7], [7], [9], [9]]) # Rank 2 + tensor([[4], [4], [6], [6], [8], [8], [10], [10]]) # Rank 3 + """ + warnings.warn(DEPRECATE_MSG) + + if ( + not isinstance(resharding_spec, shard_spec.ChunkShardingSpec) or + not isinstance(self._sharding_spec, shard_spec.ChunkShardingSpec) + ): + raise NotImplementedError("Only ChunkShardingSpec supported for reshard.") + if (len(self.local_shards()) != 1): + raise NotImplementedError("Only single local shard supported for reshard.") + + if self._sharding_spec.dim == resharding_spec.dim: # type: ignore[attr-defined] + if self._sharding_spec.placements == resharding_spec.placements: # type: ignore[attr-defined] + return self + else: + local_shards, shards_metadata = reshuffle_local_shard( + self.local_tensor(), + self.size(), # type: ignore[arg-type] + self._sharding_spec, + resharding_spec, + self._process_group, + ) + else: + local_shards, shards_metadata = reshard_local_shard( + self.local_tensor(), + self.size(), # type: ignore[arg-type] + self._sharding_spec, + resharding_spec, + self._process_group, + ) + self._local_shards = local_shards + self._metadata.shards_metadata = shards_metadata + self._sharding_spec = resharding_spec + return self + + def local_tensor(self) -> torch.Tensor: + """ + Return local tensor for a sharded_tensor. For now we only support single local shard. + + Returns: + A :class:`torch.Tensor` of the local shard. + """ + if len(self.local_shards()) != 1: + raise NotImplementedError("Only single local shard is supported.") + return self.local_shards()[0].tensor + + @classmethod + def __torch_function__(cls, func, types, args=(), kwargs=None): + def dispatch(st: ShardedTensor, func: Callable): + # Dispatch to custom user provided op first if it exists. + if func in _CUSTOM_SHARDED_OPS: + return _CUSTOM_SHARDED_OPS[func](types, args, kwargs, st._process_group) + + # Dispatch to custom sharding spec op if it has one. + if _has_custom_op(st._sharding_spec, func): + return _dispatch_custom_op( + st._sharding_spec, + func, + types, + args, + kwargs, + st._process_group + ) + + if func in _SHARDED_OPS: + return _SHARDED_OPS[func](types, args, kwargs, st._process_group) + + raise RuntimeError( + f"torch function '{func.__name__}', with args: {args} and " + f"kwargs: {kwargs} not supported for ShardedTensor!") + + warnings.warn(DEPRECATE_MSG) + # Find ShardedTensor instance to get process_group and sharding_spec. + st_instance = None + + def find_sharded_tensor(e): + nonlocal st_instance + if st_instance is None and isinstance(e, ShardedTensor): + st_instance = e + + pytree.tree_map_(find_sharded_tensor, args) + pytree.tree_map_(find_sharded_tensor, kwargs) + + if st_instance is not None: + return dispatch(st_instance, func) + + raise RuntimeError( + f"torch function '{func.__name__}', with args: {args} and " + f"kwargs: {kwargs} not supported for ShardedTensor!") + + def is_pinned(self) -> bool: # type: ignore[override] + """ + Returns True if the sharded tensor (each local shard) resides in pinned memory. + """ + return self._metadata.tensor_properties.pin_memory + + def _register_remote_shards(self, remote_shards: List[rpc.RRef[Shard]], rpc_rank: int): + self._remote_shards[rpc_rank] = remote_shards + + def remote_shards(self) -> Dict[int, List[rpc.RRef[Shard]]]: + """ + Returns a Dict[int, RRef] with keys being the RPC rank and values + being RRefs to shards on that rank. Need to initialize the + RPC framework for this functionality. + + Raises an exception if ShardedTensor was created with ``init_rrefs=False`` + """ + if not self._init_rrefs: + raise RuntimeError( + 'ShardedTensor created with init_rrefs=False, no RRefs to remote shards available' + ) + return self._remote_shards + + def __hash__(self): + return id(self) + + def __repr__(self): + return f'ShardedTensor({self._metadata})' + + @dataclass + class ProcessGroupState: + """ + State for ser-de of process group + """ + local_rank: int + global_rank: int + local_world_size: int + global_world_size: int + + def __getstate__(self): + pg_state = ShardedTensor.ProcessGroupState( + distributed_c10d.get_rank(self._process_group), + distributed_c10d.get_rank(), + distributed_c10d.get_world_size(self._process_group), + distributed_c10d.get_world_size(), + ) + + return self._local_shards, self._metadata, pg_state, self._sharding_spec, self._init_rrefs + + def __setstate__(self, state): + self._sharded_tensor_id = None + if not distributed_c10d.is_initialized(): + raise RuntimeError( + 'Need to initialize default process group using ' + '"init_process_group" before loading ShardedTensor') + + self._local_shards, self._metadata, pg_state, self._sharding_spec, self._init_rrefs = state + + # Setup process group + from torch.distributed._shard.api import _get_current_process_group + self._process_group = _get_current_process_group() + + # Validate process group. + local_rank = distributed_c10d.get_rank(self._process_group) + if pg_state.local_rank != local_rank: + raise RuntimeError( + f'Local rank at save time was {pg_state.local_rank}, but at ' + f'load time was {local_rank}') + + global_rank = distributed_c10d.get_rank() + if pg_state.global_rank != global_rank: + raise RuntimeError( + f'Global rank at save time was {pg_state.global_rank}, but at ' + f'load time was {global_rank}') + + local_world_size = distributed_c10d.get_world_size(self._process_group) + if pg_state.local_world_size != local_world_size: + raise RuntimeError( + f'Local world size at save time was {pg_state.local_world_size}, ' + f'but at load time was {local_world_size}') + + global_world_size = distributed_c10d.get_world_size() + if pg_state.global_world_size != global_world_size: + raise RuntimeError( + f'Global world size at save time was {pg_state.global_world_size}, ' + f'but at load time was {global_world_size}') + + self._post_init() + + +def _create_tensor_from_params(*size, local_device, tensor_properties: TensorProperties): + """ Helper to construct tensor from size, device and common params. """ + dtype = tensor_properties.dtype + layout = tensor_properties.layout + requires_grad = tensor_properties.requires_grad + memory_format = tensor_properties.memory_format + pin_memory = tensor_properties.pin_memory + + return torch.empty( + *size, dtype=dtype, layout=layout, + device=local_device, requires_grad=requires_grad, + memory_format=memory_format, pin_memory=pin_memory + ) diff --git a/shared/package-files/9e/9ea6c2256ca9296e2ae7a9fd31d8dc4e5acf5223d10fbfffb3c004c5231b5656/blob b/shared/package-files/9e/9ea6c2256ca9296e2ae7a9fd31d8dc4e5acf5223d10fbfffb3c004c5231b5656/blob new file mode 100644 index 0000000000000000000000000000000000000000..e7a9789ccd0f3317c83b1542b823586d3419c485 --- /dev/null +++ b/shared/package-files/9e/9ea6c2256ca9296e2ae7a9fd31d8dc4e5acf5223d10fbfffb3c004c5231b5656/blob @@ -0,0 +1,284 @@ +from __future__ import annotations + +import json +from typing import ( + TYPE_CHECKING, + Any, +) + +from pandas.io.excel._base import ExcelWriter +from pandas.io.excel._util import ( + combine_kwargs, + validate_freeze_panes, +) + +if TYPE_CHECKING: + from pandas._typing import ( + ExcelWriterIfSheetExists, + FilePath, + StorageOptions, + WriteExcelBuffer, + ) + + +class _XlsxStyler: + # Map from openpyxl-oriented styles to flatter xlsxwriter representation + # Ordering necessary for both determinism and because some are keyed by + # prefixes of others. + STYLE_MAPPING: dict[str, list[tuple[tuple[str, ...], str]]] = { + "font": [ + (("name",), "font_name"), + (("sz",), "font_size"), + (("size",), "font_size"), + (("color", "rgb"), "font_color"), + (("color",), "font_color"), + (("b",), "bold"), + (("bold",), "bold"), + (("i",), "italic"), + (("italic",), "italic"), + (("u",), "underline"), + (("underline",), "underline"), + (("strike",), "font_strikeout"), + (("vertAlign",), "font_script"), + (("vertalign",), "font_script"), + ], + "number_format": [(("format_code",), "num_format"), ((), "num_format")], + "protection": [(("locked",), "locked"), (("hidden",), "hidden")], + "alignment": [ + (("horizontal",), "align"), + (("vertical",), "valign"), + (("text_rotation",), "rotation"), + (("wrap_text",), "text_wrap"), + (("indent",), "indent"), + (("shrink_to_fit",), "shrink"), + ], + "fill": [ + (("patternType",), "pattern"), + (("patterntype",), "pattern"), + (("fill_type",), "pattern"), + (("start_color", "rgb"), "fg_color"), + (("fgColor", "rgb"), "fg_color"), + (("fgcolor", "rgb"), "fg_color"), + (("start_color",), "fg_color"), + (("fgColor",), "fg_color"), + (("fgcolor",), "fg_color"), + (("end_color", "rgb"), "bg_color"), + (("bgColor", "rgb"), "bg_color"), + (("bgcolor", "rgb"), "bg_color"), + (("end_color",), "bg_color"), + (("bgColor",), "bg_color"), + (("bgcolor",), "bg_color"), + ], + "border": [ + (("color", "rgb"), "border_color"), + (("color",), "border_color"), + (("style",), "border"), + (("top", "color", "rgb"), "top_color"), + (("top", "color"), "top_color"), + (("top", "style"), "top"), + (("top",), "top"), + (("right", "color", "rgb"), "right_color"), + (("right", "color"), "right_color"), + (("right", "style"), "right"), + (("right",), "right"), + (("bottom", "color", "rgb"), "bottom_color"), + (("bottom", "color"), "bottom_color"), + (("bottom", "style"), "bottom"), + (("bottom",), "bottom"), + (("left", "color", "rgb"), "left_color"), + (("left", "color"), "left_color"), + (("left", "style"), "left"), + (("left",), "left"), + ], + } + + @classmethod + def convert(cls, style_dict, num_format_str=None): + """ + converts a style_dict to an xlsxwriter format dict + + Parameters + ---------- + style_dict : style dictionary to convert + num_format_str : optional number format string + """ + # Create a XlsxWriter format object. + props = {} + + if num_format_str is not None: + props["num_format"] = num_format_str + + if style_dict is None: + return props + + if "borders" in style_dict: + style_dict = style_dict.copy() + style_dict["border"] = style_dict.pop("borders") + + for style_group_key, style_group in style_dict.items(): + for src, dst in cls.STYLE_MAPPING.get(style_group_key, []): + # src is a sequence of keys into a nested dict + # dst is a flat key + if dst in props: + continue + v = style_group + for k in src: + try: + v = v[k] + except (KeyError, TypeError): + break + else: + props[dst] = v + + if isinstance(props.get("pattern"), str): + # TODO: support other fill patterns + props["pattern"] = 0 if props["pattern"] == "none" else 1 + + for k in ["border", "top", "right", "bottom", "left"]: + if isinstance(props.get(k), str): + try: + props[k] = [ + "none", + "thin", + "medium", + "dashed", + "dotted", + "thick", + "double", + "hair", + "mediumDashed", + "dashDot", + "mediumDashDot", + "dashDotDot", + "mediumDashDotDot", + "slantDashDot", + ].index(props[k]) + except ValueError: + props[k] = 2 + + if isinstance(props.get("font_script"), str): + props["font_script"] = ["baseline", "superscript", "subscript"].index( + props["font_script"] + ) + + if isinstance(props.get("underline"), str): + props["underline"] = { + "none": 0, + "single": 1, + "double": 2, + "singleAccounting": 33, + "doubleAccounting": 34, + }[props["underline"]] + + # GH 30107 - xlsxwriter uses different name + if props.get("valign") == "center": + props["valign"] = "vcenter" + + return props + + +class XlsxWriter(ExcelWriter): + _engine = "xlsxwriter" + _supported_extensions = (".xlsx",) + + def __init__( + self, + path: FilePath | WriteExcelBuffer | ExcelWriter, + engine: str | None = None, + date_format: str | None = None, + datetime_format: str | None = None, + mode: str = "w", + storage_options: StorageOptions | None = None, + if_sheet_exists: ExcelWriterIfSheetExists | None = None, + engine_kwargs: dict[str, Any] | None = None, + **kwargs, + ) -> None: + # Use the xlsxwriter module as the Excel writer. + from xlsxwriter import Workbook + + engine_kwargs = combine_kwargs(engine_kwargs, kwargs) + + if mode == "a": + raise ValueError("Append mode is not supported with xlsxwriter!") + + super().__init__( + path, + engine=engine, + date_format=date_format, + datetime_format=datetime_format, + mode=mode, + storage_options=storage_options, + if_sheet_exists=if_sheet_exists, + engine_kwargs=engine_kwargs, + ) + + try: + self._book = Workbook(self._handles.handle, **engine_kwargs) # type: ignore[arg-type] + except TypeError: + self._handles.handle.close() + raise + + @property + def book(self): + """ + Book instance of class xlsxwriter.Workbook. + + This attribute can be used to access engine-specific features. + """ + return self._book + + @property + def sheets(self) -> dict[str, Any]: + result = self.book.sheetnames + return result + + def _save(self) -> None: + """ + Save workbook to disk. + """ + self.book.close() + + def _write_cells( + self, + cells, + sheet_name: str | None = None, + startrow: int = 0, + startcol: int = 0, + freeze_panes: tuple[int, int] | None = None, + ) -> None: + # Write the frame cells using xlsxwriter. + sheet_name = self._get_sheet_name(sheet_name) + + wks = self.book.get_worksheet_by_name(sheet_name) + if wks is None: + wks = self.book.add_worksheet(sheet_name) + + style_dict = {"null": None} + + if validate_freeze_panes(freeze_panes): + wks.freeze_panes(*(freeze_panes)) + + for cell in cells: + val, fmt = self._value_with_fmt(cell.val) + + stylekey = json.dumps(cell.style) + if fmt: + stylekey += fmt + + if stylekey in style_dict: + style = style_dict[stylekey] + else: + style = self.book.add_format(_XlsxStyler.convert(cell.style, fmt)) + style_dict[stylekey] = style + + if cell.mergestart is not None and cell.mergeend is not None: + wks.merge_range( + startrow + cell.row, + startcol + cell.col, + startrow + cell.mergestart, + startcol + cell.mergeend, + val, + style, + ) + else: + wks.write(startrow + cell.row, startcol + cell.col, val, style) diff --git a/shared/package-files/9e/9ea9f417dc35f987784c9a2f6c3a896b1e552199f433cc7280626d32e8c7bbcf/blob b/shared/package-files/9e/9ea9f417dc35f987784c9a2f6c3a896b1e552199f433cc7280626d32e8c7bbcf/blob new file mode 100644 index 0000000000000000000000000000000000000000..f6b40a609d5ed0f5e30cd8074029a241ed7c2363 --- /dev/null +++ b/shared/package-files/9e/9ea9f417dc35f987784c9a2f6c3a896b1e552199f433cc7280626d32e8c7bbcf/blob @@ -0,0 +1,6 @@ +class ResultsStore: + def __str__(self): + return getattr(self, "_str", self.__class__.__name__) + + +__all__ = ["ResultsStore"] diff --git a/shared/package-files/9e/9eac8d217c8b97c3e4dacf033ca50c02f18797b97786da4a2c4d821783f675f0/blob b/shared/package-files/9e/9eac8d217c8b97c3e4dacf033ca50c02f18797b97786da4a2c4d821783f675f0/blob new file mode 100644 index 0000000000000000000000000000000000000000..ff61eba0eb6bf21b6d4a7a5d3c12d4a01136b09d --- /dev/null +++ b/shared/package-files/9e/9eac8d217c8b97c3e4dacf033ca50c02f18797b97786da4a2c4d821783f675f0/blob @@ -0,0 +1,27 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeMetaFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace meta { + +struct TORCH_API structured_sigmoid_backward : public TensorIteratorBase { + + + void meta(const at::Tensor & grad_output, const at::Tensor & output); +}; + +} // namespace native +} // namespace at diff --git a/shared/package-files/9e/9eae5757419f59ecda44b4e9ba2fa03939dd4ad5c57da175567bfcbc69e2ceba/blob b/shared/package-files/9e/9eae5757419f59ecda44b4e9ba2fa03939dd4ad5c57da175567bfcbc69e2ceba/blob new file mode 100644 index 0000000000000000000000000000000000000000..00a541668fcce8df2b858163fb26212bdb59ae74 --- /dev/null +++ b/shared/package-files/9e/9eae5757419f59ecda44b4e9ba2fa03939dd4ad5c57da175567bfcbc69e2ceba/blob @@ -0,0 +1,21 @@ +import importlib + + +_delayed_symbols = { + "Dict": ".typeddict", + "List": ".typedlist", + "Set": ".typedset", +} + + +def __getattr__(name): + # Uses PEP-562 but requires python>3.6 + if name in _delayed_symbols: + modpath = _delayed_symbols[name] + mod = importlib.import_module(modpath, __name__) + return getattr(mod, name) + else: + try: + return importlib.import_module(f".{name}", __name__) + except ModuleNotFoundError: + raise AttributeError diff --git a/shared/package-files/9e/9eaff0155b761011dc4f7007c5ab6d7ca5f1d890dfd4ae43f90073514d3fd790/blob b/shared/package-files/9e/9eaff0155b761011dc4f7007c5ab6d7ca5f1d890dfd4ae43f90073514d3fd790/blob new file mode 100644 index 0000000000000000000000000000000000000000..40c8418f5c1809130672dca46e8c43469692da09 --- /dev/null +++ b/shared/package-files/9e/9eaff0155b761011dc4f7007c5ab6d7ca5f1d890dfd4ae43f90073514d3fd790/blob @@ -0,0 +1,84 @@ +"""Test deprecation and future warnings. + +""" +import pytest +import numpy as np +from numpy.testing import assert_warns +from numpy.ma.testutils import assert_equal +from numpy.ma.core import MaskedArrayFutureWarning +import io +import textwrap + +class TestArgsort: + """ gh-8701 """ + def _test_base(self, argsort, cls): + arr_0d = np.array(1).view(cls) + argsort(arr_0d) + + arr_1d = np.array([1, 2, 3]).view(cls) + argsort(arr_1d) + + # argsort has a bad default for >1d arrays + arr_2d = np.array([[1, 2], [3, 4]]).view(cls) + result = assert_warns( + np.ma.core.MaskedArrayFutureWarning, argsort, arr_2d) + assert_equal(result, argsort(arr_2d, axis=None)) + + # should be no warnings for explicitly specifying it + argsort(arr_2d, axis=None) + argsort(arr_2d, axis=-1) + + def test_function_ndarray(self): + return self._test_base(np.ma.argsort, np.ndarray) + + def test_function_maskedarray(self): + return self._test_base(np.ma.argsort, np.ma.MaskedArray) + + def test_method(self): + return self._test_base(np.ma.MaskedArray.argsort, np.ma.MaskedArray) + + +class TestMinimumMaximum: + + def test_axis_default(self): + # NumPy 1.13, 2017-05-06 + + data1d = np.ma.arange(6) + data2d = data1d.reshape(2, 3) + + ma_min = np.ma.minimum.reduce + ma_max = np.ma.maximum.reduce + + # check that the default axis is still None, but warns on 2d arrays + result = assert_warns(MaskedArrayFutureWarning, ma_max, data2d) + assert_equal(result, ma_max(data2d, axis=None)) + + result = assert_warns(MaskedArrayFutureWarning, ma_min, data2d) + assert_equal(result, ma_min(data2d, axis=None)) + + # no warnings on 1d, as both new and old defaults are equivalent + result = ma_min(data1d) + assert_equal(result, ma_min(data1d, axis=None)) + assert_equal(result, ma_min(data1d, axis=0)) + + result = ma_max(data1d) + assert_equal(result, ma_max(data1d, axis=None)) + assert_equal(result, ma_max(data1d, axis=0)) + + +class TestFromtextfile: + def test_fromtextfile_delimitor(self): + # NumPy 1.22.0, 2021-09-23 + + textfile = io.StringIO(textwrap.dedent( + """ + A,B,C,D + 'string 1';1;1.0;'mixed column' + 'string 2';2;2.0; + 'string 3';3;3.0;123 + 'string 4';4;4.0;3.14 + """ + )) + + with pytest.warns(DeprecationWarning): + result = np.ma.mrecords.fromtextfile(textfile, delimitor=';') diff --git a/shared/package-files/9e/9ebfc8f610541414267d93afc16787f732ee432067b52dec972aa0714a81f096/blob b/shared/package-files/9e/9ebfc8f610541414267d93afc16787f732ee432067b52dec972aa0714a81f096/blob new file mode 100644 index 0000000000000000000000000000000000000000..567b38160dd4f59d63f9081e3f01ffe9aec28409 --- /dev/null +++ b/shared/package-files/9e/9ebfc8f610541414267d93afc16787f732ee432067b52dec972aa0714a81f096/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor sspaddmm(const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta=1, const at::Scalar & alpha=1); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9e/9ec04440d9df7fe6858c760ae2d863bd42b8c525c349fbf96936dc139f693a41/blob b/shared/package-files/9e/9ec04440d9df7fe6858c760ae2d863bd42b8c525c349fbf96936dc139f693a41/blob new file mode 100644 index 0000000000000000000000000000000000000000..cdb8e4794ccdb30fa4fea3045b30a188f6ff5357 --- /dev/null +++ b/shared/package-files/9e/9ec04440d9df7fe6858c760ae2d863bd42b8c525c349fbf96936dc139f693a41/blob @@ -0,0 +1,1001 @@ +seed, 0x0 +0, 0x7ab4ea94 +1, 0x9b561119 +2, 0x4957d02e +3, 0x7dd3fdc2 +4, 0x5affe54 +5, 0x5a01741c +6, 0x8b9e8c1f +7, 0xda5bf11a +8, 0x509226 +9, 0x64e2ea17 +10, 0x82c6dab5 +11, 0xe4302515 +12, 0x8198b873 +13, 0xc3ec9a82 +14, 0x829dff28 +15, 0x5278e44f +16, 0x994a7d2c +17, 0xf1c89398 +18, 0xaf2fddec +19, 0x22abc6ee +20, 0x963dbd43 +21, 0xc29edffb +22, 0x41c1ce07 +23, 0x9c90034d +24, 0x1f17a796 +25, 0x3833caa8 +26, 0xb8795528 +27, 0xebc595a2 +28, 0xf8f5b5dd +29, 0xc2881f72 +30, 0x18e5d3f0 +31, 0x9b19ac7a +32, 0xb9992436 +33, 0xc00052b3 +34, 0xb63f4475 +35, 0x962642d9 +36, 0x63506c10 +37, 0x2be6b127 +38, 0x569bdbc6 +39, 0x7f185e01 +40, 0xebb55f53 +41, 0x1c30198c +42, 0x7c8d75c6 +43, 0xd3f2186b +44, 0xaca5b9b1 +45, 0xbc49ff45 +46, 0xc4a802af +47, 0x2cecd86f +48, 0x8e0da529 +49, 0x1f22b00e +50, 0x4559ea80 +51, 0x60f587d8 +52, 0x7c7460e9 +53, 0x67be0a4a +54, 0x987a0183 +55, 0x7bd30f1 +56, 0xab18c4ac +57, 0xffdbfb64 +58, 0x9ea917f9 +59, 0x1239dab7 +60, 0x38efabeb +61, 0x5da91888 +62, 0x8f49ed62 +63, 0x83f60b1e +64, 0x5950a3fc +65, 0xd8911104 +66, 0x19e8859e +67, 0x1a4d89ec +68, 0x968ca180 +69, 0x9e1b6da3 +70, 0x3d99c2c +71, 0x55f76289 +72, 0x8fa28b9e +73, 0x9fe01d33 +74, 0xdade4e38 +75, 0x1ea04290 +76, 0xa7263313 +77, 0xaafc762e +78, 0x460476d6 +79, 0x31226e12 +80, 0x451d3f05 +81, 0xd0d2764b +82, 0xd06e1ab3 +83, 0x1394e3f4 +84, 0x2fc04ea3 +85, 0x5b8401c +86, 0xebd6c929 +87, 0xe881687c +88, 0x94bdd66a +89, 0xabf85983 +90, 0x223ad12d +91, 0x2aaeeaa3 +92, 0x1f704934 +93, 0x2db2efb6 +94, 0xf49b8dfb +95, 0x5bdbbb9d +96, 0xba0cd0db +97, 0x4ec4674e +98, 0xad0129e +99, 0x7a66129b +100, 0x50d12c5e +101, 0x85b1d335 +102, 0x3efda58a +103, 0xecd886fb +104, 0x8ecadd3d +105, 0x60ebac0f +106, 0x5e10fe79 +107, 0xa84f7e5d +108, 0x43931288 +109, 0xfacf448 +110, 0x4ee01997 +111, 0xcdc0a651 +112, 0x33c87037 +113, 0x8b50fc03 +114, 0xf52aad34 +115, 0xda6cd856 +116, 0x7585bea0 +117, 0xe947c762 +118, 0x4ddff5d8 +119, 0xe0e79b3b +120, 0xb804cf09 +121, 0x84765c44 +122, 0x3ff666b4 +123, 0xe31621ad +124, 0x816f2236 +125, 0x228176bc +126, 0xfdc14904 +127, 0x635f5077 +128, 0x6981a817 +129, 0xfd9a0300 +130, 0xd3fa8a24 +131, 0xd67c1a77 +132, 0x903fe97a +133, 0xf7c4a4d5 +134, 0x109f2058 +135, 0x48ab87fe +136, 0xfd6f1928 +137, 0x707e9452 +138, 0xf327db9e +139, 0x7b80d76d +140, 0xfb6ba193 +141, 0x454a1ad0 +142, 0xe20b51e +143, 0xb774d085 +144, 0x6b1ed574 +145, 0xb1e77de4 +146, 0xe2a83b37 +147, 0x33d3176f +148, 0x2f0ca0fc +149, 0x17f51e2 +150, 0x7c1fbf55 +151, 0xf09e9cd0 +152, 0xe3d9bacd +153, 0x4244db0a +154, 0x876c09fc +155, 0x9db4fc2f +156, 0xd3771d60 +157, 0x25fc6a75 +158, 0xb309915c +159, 0xc50ee027 +160, 0xaa5b7b38 +161, 0x4c650ded +162, 0x1acb2879 +163, 0x50db5887 +164, 0x90054847 +165, 0xfef23e5b +166, 0x2dd7b7d5 +167, 0x990b8c2e +168, 0x6001a601 +169, 0xb5d314c4 +170, 0xfbfb7bf9 +171, 0x1aba997d +172, 0x814e7304 +173, 0x989d956a +174, 0x86d5a29c +175, 0x70a9fa08 +176, 0xc4ccba87 +177, 0x7e9cb366 +178, 0xee18eb0a +179, 0x44f5be58 +180, 0x91d4af2d +181, 0x5ab6e593 +182, 0x9fd6bb4d +183, 0x85894ce +184, 0x728a2401 +185, 0xf006f6d4 +186, 0xd782741e +187, 0x842cd5bd +188, 0xfb5883aa +189, 0x7e5a471 +190, 0x83ff6965 +191, 0xc9675c6b +192, 0xb6ced3c7 +193, 0x3de6425b +194, 0x25e14db4 +195, 0x69ca3dec +196, 0x81342d13 +197, 0xd7cd8417 +198, 0x88d15e69 +199, 0xefba17c9 +200, 0x43d595e6 +201, 0x89d4cf25 +202, 0x7cae9b9b +203, 0x2242c621 +204, 0x27fc3598 +205, 0x467b1d84 +206, 0xe84d4622 +207, 0xa26bf980 +208, 0x80411010 +209, 0xe2c2bfea +210, 0xbc6ca25a +211, 0x3ddb592a +212, 0xdd46eb9e +213, 0xdfe8f657 +214, 0x2cedc974 +215, 0xf0dc546b +216, 0xd46be68f +217, 0x26d8a5aa +218, 0x76e96ba3 +219, 0x7d5b5353 +220, 0xf532237c +221, 0x6478b79 +222, 0x9b81a5e5 +223, 0x5fc68e5c +224, 0x68436e70 +225, 0x2a0043f9 +226, 0x108d523c +227, 0x7a4c32a3 +228, 0x9c84c742 +229, 0x6f813dae +230, 0xfcc5bbcc +231, 0x215b6f3a +232, 0x84cb321d +233, 0x7913a248 +234, 0xb1e6b585 +235, 0x49376b31 +236, 0x1dc896b0 +237, 0x347051ad +238, 0x5524c042 +239, 0xda0eef9d +240, 0xf2e73342 +241, 0xbeee2f9d +242, 0x7c702874 +243, 0x9eb3bd34 +244, 0x97b09700 +245, 0xcdbab1d4 +246, 0x4a2f6ed1 +247, 0x2047bda5 +248, 0x3ecc7005 +249, 0x8d0d5e67 +250, 0x40876fb5 +251, 0xb5fd2187 +252, 0xe915d8af +253, 0x9a2351c7 +254, 0xccc658ae +255, 0xebb1eddc +256, 0xc4a83671 +257, 0xffb2548f +258, 0xe4fe387a +259, 0x477aaab4 +260, 0x8475a4e4 +261, 0xf8823e46 +262, 0xe4130f71 +263, 0xbdb54482 +264, 0x98fe0462 +265, 0xf36b27b8 +266, 0xed7733da +267, 0x5f428afc +268, 0x43a3a21a +269, 0xf8370b55 +270, 0xfade1de1 +271, 0xd9a038ea +272, 0x3c69af23 +273, 0x24df7dd0 +274, 0xf66d9353 +275, 0x71d811be +276, 0xcc4d024b +277, 0xb8c30bf0 +278, 0x4198509d +279, 0x8b37ba36 +280, 0xa41ae29a +281, 0x8cf7799e +282, 0x5cd0136a +283, 0xa11324ef +284, 0x2f8b6d4b +285, 0x3657cf17 +286, 0x35b6873f +287, 0xee6e5bd7 +288, 0xbeeaa98 +289, 0x9ad3c581 +290, 0xe2376c3f +291, 0x738027cc +292, 0x536ac839 +293, 0xf066227 +294, 0x6c9cb0f9 +295, 0x84082ae6 +296, 0xab38ae9d +297, 0x493eade9 +298, 0xcb630b3a +299, 0x64d44250 +300, 0xe5efb557 +301, 0xea2424d9 +302, 0x11a690ba +303, 0x30a48ae4 +304, 0x58987e53 +305, 0x94ec6076 +306, 0x5d3308fa +307, 0xf1635ebb +308, 0x56a5ab90 +309, 0x2b2f2ee4 +310, 0x6f9e6483 +311, 0x8b93e327 +312, 0xa7ce140b +313, 0x4c8aa42 +314, 0x7657bb3f +315, 0xf250fd75 +316, 0x1edfcb0f +317, 0xdb42ace3 +318, 0xf8147e16 +319, 0xd1992bd +320, 0x64bb14d1 +321, 0x423e724d +322, 0x7b172f7c +323, 0x17171696 +324, 0x4acaf83b +325, 0x7a83527e +326, 0xfc980c60 +327, 0xc8b56bb +328, 0x2453f77f +329, 0x85ad1bf9 +330, 0x62a85dfe +331, 0x48238c4d +332, 0xbb3ec1eb +333, 0x4c1c039c +334, 0x1f37f571 +335, 0x98aecb63 +336, 0xc3b3ddd6 +337, 0xd22dad4 +338, 0xe49671a3 +339, 0xe3baf945 +340, 0xb9e21680 +341, 0xda562856 +342, 0xe8b88ce4 +343, 0x86f88de2 +344, 0x986faf76 +345, 0x6f0025c3 +346, 0x3fe21234 +347, 0xd8d3f729 +348, 0xc2d11c6f +349, 0xd4f9e8f +350, 0xf61a0aa +351, 0xc48bb313 +352, 0xe944e940 +353, 0xf1801b2e +354, 0x253590be +355, 0x981f069d +356, 0x891454d8 +357, 0xa4f824ad +358, 0x6dd2cc48 +359, 0x3018827e +360, 0x3fb329e6 +361, 0x65276517 +362, 0x8d2c0dd2 +363, 0xc965b48e +364, 0x85d14d90 +365, 0x5a51623c +366, 0xa9573d6a +367, 0x82d00edf +368, 0x5ed7ce07 +369, 0x1d946abc +370, 0x24fa567b +371, 0x83ef5ecc +372, 0x9001724a +373, 0xc4fe48f3 +374, 0x1e07c25c +375, 0xf4d5e65e +376, 0xb734f6e9 +377, 0x327a2df8 +378, 0x766d59b7 +379, 0x625e6b61 +380, 0xe82f32d7 +381, 0x1566c638 +382, 0x2e815871 +383, 0x606514aa +384, 0x36b7386e +385, 0xcaa8ce08 +386, 0xb453fe9c +387, 0x48574e23 +388, 0x71f0da06 +389, 0xa8a79463 +390, 0x6b590210 +391, 0x86e989db +392, 0x42899f4f +393, 0x7a654ef9 +394, 0x4c4fe932 +395, 0x77b2fd10 +396, 0xb6b4565c +397, 0xa2e537a3 +398, 0xef5a3dca +399, 0x41235ea8 +400, 0x95c90541 +401, 0x50ad32c4 +402, 0xc1b8e0a4 +403, 0x498e9aab +404, 0xffc965f1 +405, 0x72633485 +406, 0x3a731aef +407, 0x7cfddd0b +408, 0xb04d4129 +409, 0x184fc28e +410, 0x424369b0 +411, 0xf9ae13a1 +412, 0xaf357c8d +413, 0x7a19228e +414, 0xb46de2a8 +415, 0xeff2ac76 +416, 0xa6c9357b +417, 0x614f19c1 +418, 0x8ee1a53f +419, 0xbe1257b1 +420, 0xf72651fe +421, 0xd347c298 +422, 0x96dd2f23 +423, 0x5bb1d63e +424, 0x32e10887 +425, 0x36a144da +426, 0x9d70e791 +427, 0x5e535a25 +428, 0x214253da +429, 0x2e43dd40 +430, 0xfc0413f4 +431, 0x1f5ea409 +432, 0x1754c126 +433, 0xcdbeebbe +434, 0x1fb44a14 +435, 0xaec7926 +436, 0xb9d9a1e +437, 0x9e4a6577 +438, 0x8b1f04c5 +439, 0x19854e8a +440, 0x531080cd +441, 0xc0cbd73 +442, 0x20399d77 +443, 0x7d8e9ed5 +444, 0x66177598 +445, 0x4d18a5c2 +446, 0xe08ebf58 +447, 0xb1f9c87b +448, 0x66bedb10 +449, 0x26670d21 +450, 0x7a7892da +451, 0x69b69d86 +452, 0xd04f1d1c +453, 0xaf469625 +454, 0x7946b813 +455, 0x1ee596bd +456, 0x7f365d85 +457, 0x795b662b +458, 0x194ad02d +459, 0x5a9649b5 +460, 0x6085e278 +461, 0x2cf54550 +462, 0x9c77ea0b +463, 0x3c6ff8b +464, 0x2141cd34 +465, 0xb90bc671 +466, 0x35037c4b +467, 0xd04c0d76 +468, 0xc75bff8 +469, 0x8f52003b +470, 0xfad3d031 +471, 0x667024bc +472, 0xcb04ea36 +473, 0x3e03d587 +474, 0x2644d3a0 +475, 0xa8fe99ba +476, 0x2b9a55fc +477, 0x45c4d44a +478, 0xd059881 +479, 0xe07fcd20 +480, 0x4e22046c +481, 0x7c2cbf81 +482, 0xbf7f23de +483, 0x69d924c3 +484, 0xe53cd01 +485, 0x3879017c +486, 0xa590e558 +487, 0x263bc076 +488, 0x245465b1 +489, 0x449212c6 +490, 0x249dcb29 +491, 0x703d42d7 +492, 0x140eb9ec +493, 0xc86c5741 +494, 0x7992aa5b +495, 0xb8b76a91 +496, 0x771dac3d +497, 0x4ecd81e3 +498, 0xe5ac30b3 +499, 0xf4d7a5a6 +500, 0xac24b97 +501, 0x63494d78 +502, 0x627ffa89 +503, 0xfa4f330 +504, 0x8098a1aa +505, 0xcc0c61dc +506, 0x34749fa0 +507, 0x7f217822 +508, 0x418d6f15 +509, 0xa4b6e51e +510, 0x1036de68 +511, 0x1436986e +512, 0x44df961d +513, 0x368e4651 +514, 0x6a9e5d8c +515, 0x27d1597e +516, 0xa1926c62 +517, 0x8d1f2b55 +518, 0x5797eb42 +519, 0xa90f9e81 +520, 0x57547b10 +521, 0xdbbcca8e +522, 0x9edd2d86 +523, 0xbb0a7527 +524, 0x7662380c +525, 0xe7c98590 +526, 0x950fbf3f +527, 0xdc2b76b3 +528, 0x8a945102 +529, 0x3f0a1a85 +530, 0xeb215834 +531, 0xc59f2802 +532, 0xe2a4610 +533, 0x8b5a8665 +534, 0x8b2d9933 +535, 0x40a4f0bc +536, 0xaab5bc67 +537, 0x1442a69e +538, 0xdf531193 +539, 0x698d3db4 +540, 0x2d40324e +541, 0x1a25feb2 +542, 0xe8cc898f +543, 0xf12e98f5 +544, 0xc03ad34c +545, 0xf62fceff +546, 0xdd827e1e +547, 0x7d8ccb3b +548, 0xab2d6bc1 +549, 0xc323a124 +550, 0x8184a19a +551, 0xc3c4e934 +552, 0x5487424d +553, 0xd6a81a44 +554, 0x90a8689d +555, 0xe69c4c67 +556, 0xbdae02dd +557, 0x72a18a79 +558, 0x2a88e907 +559, 0x31cf4b5d +560, 0xb157772f +561, 0x206ba601 +562, 0x18529232 +563, 0x7dac90d8 +564, 0x3a5f8a09 +565, 0x9f4b64a3 +566, 0xae373af9 +567, 0x1d79447c +568, 0x2a23684b +569, 0x41fb7ba4 +570, 0x55e4bb9e +571, 0xd7619d3e +572, 0xc04e4dd8 +573, 0x8418d516 +574, 0x2b2ca585 +575, 0xfa8eedf +576, 0x5bafd977 +577, 0x31974fb0 +578, 0x9eb6697b +579, 0xc8be22f5 +580, 0x173b126a +581, 0x8809becf +582, 0x3e41efe1 +583, 0x3d6cbbb8 +584, 0x278c81d8 +585, 0xa6f08434 +586, 0xa0e6601d +587, 0x2fccd88d +588, 0x3cbc8beb +589, 0x5f65d864 +590, 0xa1ff8ddf +591, 0x609dcb7c +592, 0x4a4e1663 +593, 0xeae5531 +594, 0x962a7c85 +595, 0x1e110607 +596, 0x8c5db5d0 +597, 0xc7f2337e +598, 0xc94fcc9c +599, 0xe7f62629 +600, 0x6c9aa9f8 +601, 0x2e27fe0e +602, 0x4d0dae12 +603, 0x9eecf588 +604, 0x977ba3f2 +605, 0xed0a51af +606, 0x3f3ec633 +607, 0xc174b2ec +608, 0x590be8a9 +609, 0x4f630d18 +610, 0xf579e989 +611, 0xe2a55584 +612, 0xee11edcd +613, 0x150a4833 +614, 0xc0a0535c +615, 0xb5e00993 +616, 0xb6435700 +617, 0xa98dbff +618, 0x315716af +619, 0x94395776 +620, 0x6cbd48d9 +621, 0xab17f8fc +622, 0xa794ffb7 +623, 0x6b55e231 +624, 0x89ff5783 +625, 0x431dcb26 +626, 0x270f9bf8 +627, 0x2af1b8d0 +628, 0x881745ed +629, 0x17e1be4e +630, 0x132a0ec4 +631, 0x5712df17 +632, 0x2dfb3334 +633, 0xf5a35519 +634, 0xcafbdac6 +635, 0x73b6189d +636, 0x10107cac +637, 0x18c1045e +638, 0xbc19bbad +639, 0x8b4f05ac +640, 0x5830d038 +641, 0x468cd98a +642, 0x5b83a201 +643, 0xf0ccdd9c +644, 0xcb20c4bd +645, 0x1ff186c9 +646, 0xcdddb47f +647, 0x5c65ce6 +648, 0xb748c580 +649, 0x23b6f262 +650, 0xe2ba8e5c +651, 0x9a164a03 +652, 0x62d3322e +653, 0x918d8b43 +654, 0x45c8b49d +655, 0xce172c6e +656, 0x23febc6 +657, 0x84fdc5b7 +658, 0xe7d1fd82 +659, 0xf0ddf3a6 +660, 0x87050436 +661, 0x13d46375 +662, 0x5b191c78 +663, 0x2cbd99c0 +664, 0x7686c7f +665, 0xcff56c84 +666, 0x7f9b4486 +667, 0xefc997fe +668, 0x984d4588 +669, 0xfa44f36a +670, 0x7a5276c1 +671, 0xcfde6176 +672, 0xcacf7b1d +673, 0xcffae9a7 +674, 0xe98848d5 +675, 0xd4346001 +676, 0xa2196cac +677, 0x217f07dc +678, 0x42d5bef +679, 0x6f2e8838 +680, 0x4677a24 +681, 0x4ad9cd54 +682, 0x43df42af +683, 0x2dde417 +684, 0xaef5acb1 +685, 0xf377f4b3 +686, 0x7d870d40 +687, 0xe53df1c2 +688, 0xaeb5be50 +689, 0x7c92eac0 +690, 0x4f00838c +691, 0x91e05e84 +692, 0x23856c80 +693, 0xc4266fa6 +694, 0x912fddb +695, 0x34d42d22 +696, 0x6c02ffa +697, 0xe47d093 +698, 0x183c55b3 +699, 0xc161d142 +700, 0x3d43ff5f +701, 0xc944a36 +702, 0x27bb9fc6 +703, 0x75c91080 +704, 0x2460d0dc +705, 0xd2174558 +706, 0x68062dbf +707, 0x778e5c6e +708, 0xa4dc9a +709, 0x7a191e69 +710, 0xc084b2ba +711, 0xbb391d2 +712, 0x88849be +713, 0x69c02714 +714, 0x69d4a389 +715, 0x8f51854d +716, 0xaf10bb82 +717, 0x4d5d1c77 +718, 0x53b53109 +719, 0xa0a92aa0 +720, 0x83ecb757 +721, 0x5325752a +722, 0x114e466e +723, 0x4b3f2780 +724, 0xa7a6a39c +725, 0x5e723357 +726, 0xa6b8be9b +727, 0x157c32ff +728, 0x8b898012 +729, 0xd7ff2b1e +730, 0x69cd8444 +731, 0x6ad8030c +732, 0xa08a49ec +733, 0xfbc055d3 +734, 0xedf17e46 +735, 0xc9526200 +736, 0x3849b88a +737, 0x2746860b +738, 0xae13d0c1 +739, 0x4f15154f +740, 0xd65c3975 +741, 0x6a377278 +742, 0x54d501f7 +743, 0x81a054ea +744, 0x143592ba +745, 0x97714ad6 +746, 0x4f9926d9 +747, 0x4f7ac56d +748, 0xe87ca939 +749, 0x58b76f6f +750, 0x60901ad8 +751, 0x3e401bb6 +752, 0xa058468e +753, 0xc0bb14f6 +754, 0x2cb8f02a +755, 0x7c2cf756 +756, 0x34c31de5 +757, 0x9b243e83 +758, 0xa5c85ab4 +759, 0x2741e3b3 +760, 0x1249000e +761, 0x3fc4e72b +762, 0xa3e038a2 +763, 0x952dd92c +764, 0x2b821966 +765, 0xfa81b365 +766, 0x530919b9 +767, 0x4486d66f +768, 0xccf4f3c1 +769, 0xa8bddd1d +770, 0xcc295eb9 +771, 0xfccbe42f +772, 0x38bacd8d +773, 0x2261854f +774, 0x56068c62 +775, 0x9bdaeb8 +776, 0x555fa5b6 +777, 0x20fe615e +778, 0x49fb23d3 +779, 0xd093bad6 +780, 0x54919e86 +781, 0x7373eb24 +782, 0xfbaa7a98 +783, 0x5f62fb39 +784, 0xe03bc9ec +785, 0xa5074d41 +786, 0xa1cefb1 +787, 0x13912d74 +788, 0xf6421b8 +789, 0xfcb48812 +790, 0x8f1db50b +791, 0xc1654b87 +792, 0x948b43c2 +793, 0xf503ef77 +794, 0x117d891d +795, 0x5493ffa +796, 0x171313b1 +797, 0xa4b62e1e +798, 0x77454ea6 +799, 0xbea0aff0 +800, 0x13c36389 +801, 0xe3b60bac +802, 0xa176bed3 +803, 0x2863d428 +804, 0xe2314f46 +805, 0xa85cd3d4 +806, 0x7866e57 +807, 0x8f03f5bc +808, 0x239ae +809, 0x46f279fb +810, 0xcca00559 +811, 0xaa07a104 +812, 0x89123d08 +813, 0x2e6856ba +814, 0x43a9780d +815, 0x676cff25 +816, 0x6744b87d +817, 0xee260d4f +818, 0xb98d8b77 +819, 0x9b0ca455 +820, 0x659f6fe +821, 0x28d20d1c +822, 0x601f2657 +823, 0xdec3073e +824, 0x61263863 +825, 0x1a13435a +826, 0x27497d1e +827, 0x17a8458e +828, 0xdddc407d +829, 0x4bb2e8ac +830, 0x16b2aedb +831, 0x77ccd696 +832, 0x9d108fcd +833, 0x25ad233e +834, 0xaa9bc370 +835, 0xa873ab50 +836, 0xaf19c9d9 +837, 0x696e1e6b +838, 0x1fdc4bf4 +839, 0x4c2ebc81 +840, 0xde4929ed +841, 0xf4d0c10c +842, 0xb6595b76 +843, 0x75cbb1b3 +844, 0xbcb6de49 +845, 0xe23157fd +846, 0x5e596078 +847, 0xa69b0d29 +848, 0x2118a41 +849, 0x7088c16 +850, 0xc75e1e1 +851, 0x6a4af2d6 +852, 0xf19c6521 +853, 0xaff7b3b1 +854, 0x615295c7 +855, 0xbda3a8d7 +856, 0x5b5ca72e +857, 0xdad9d80f +858, 0xfa81c084 +859, 0xf4703fa +860, 0x3ca54540 +861, 0xa8961d51 +862, 0x53d1ecc2 +863, 0x808d83b6 +864, 0x68e8c48e +865, 0x89be2039 +866, 0x9088ea11 +867, 0xb8665d12 +868, 0x91272f9 +869, 0x53dddff2 +870, 0xb7a54ab +871, 0xd2b645ca +872, 0x99fb8590 +873, 0x5315c8e +874, 0x2a913806 +875, 0x7f15eb2b +876, 0xa7f1cc5d +877, 0xbb2ee836 +878, 0xd9fafd60 +879, 0x17448d6f +880, 0x999ec436 +881, 0x482ec606 +882, 0x9b403c0e +883, 0x569eb51b +884, 0xb275d1a6 +885, 0xadd29c31 +886, 0xb7ebdb15 +887, 0xdfef3662 +888, 0x51aba6db +889, 0x6d41946d +890, 0x77bf8896 +891, 0xcafa6fab +892, 0x976ab40f +893, 0x49a6d86b +894, 0x56639e55 +895, 0x9945b996 +896, 0x81459b50 +897, 0xbce97542 +898, 0xe397c9c9 +899, 0x247a5955 +900, 0xb72b1573 +901, 0x86306f86 +902, 0x34f65dc5 +903, 0x909360c0 +904, 0xf3f696ef +905, 0xcb9faae5 +906, 0x93daecd9 +907, 0xde1af7af +908, 0x43a1f2d +909, 0x6d75cde5 +910, 0x9e412b6 +911, 0x5673fed +912, 0x16bb511a +913, 0x35ef4cca +914, 0x4e615aca +915, 0x5cdaf47a +916, 0x26676047 +917, 0x8c199325 +918, 0x2adf0cb9 +919, 0x84f2e6fd +920, 0x5e627f64 +921, 0xb7cee354 +922, 0x542ab4a6 +923, 0xe59cd83b +924, 0x89cc3f10 +925, 0x92b0f5f +926, 0xc1328370 +927, 0x8208d9f7 +928, 0x68eb00cf +929, 0xfadd4ac4 +930, 0x2517784f +931, 0x4042b99 +932, 0x75ce0230 +933, 0x97c5a1b4 +934, 0x1a97f709 +935, 0x4c62781e +936, 0xf530a83 +937, 0x75776413 +938, 0x321c7240 +939, 0x6afe4e36 +940, 0xad00a2b4 +941, 0xbc05477d +942, 0xb0911e80 +943, 0x9935b87d +944, 0xd535eec5 +945, 0x149af45e +946, 0x786934b0 +947, 0xbc13cdac +948, 0x208bfa2e +949, 0xcf4b39cc +950, 0x6ac6c172 +951, 0xbfa9a37 +952, 0x42d28db6 +953, 0x2bf1ea63 +954, 0xbed6e677 +955, 0x50325d27 +956, 0xa79d3b8b +957, 0x52448bb1 +958, 0xefaad1bd +959, 0x833a2e54 +960, 0xd9de549a +961, 0x9f59672f +962, 0x9d5f5f16 +963, 0x1c914489 +964, 0xc08fa058 +965, 0xb188698b +966, 0xdc4672b5 +967, 0x594f720e +968, 0x56ed428f +969, 0x9b0898af +970, 0x8a64d3d5 +971, 0x773308d6 +972, 0x84d62098 +973, 0x46da7cf9 +974, 0x1114eae7 +975, 0xf9f2a092 +976, 0x5363a28 +977, 0xf2db7b3a +978, 0x102c71a9 +979, 0xe8e76aaf +980, 0x77a97b3b +981, 0x77b090d +982, 0x1099620e +983, 0xa6daaae6 +984, 0x86ff4713 +985, 0xc0ef85b8 +986, 0xf621d409 +987, 0xfd1561e2 +988, 0x4bcc687d +989, 0x596f760 +990, 0x7c8819f9 +991, 0x8cb865b8 +992, 0xadea115a +993, 0x56609348 +994, 0xb321ac14 +995, 0x1bac7db2 +996, 0x5fe6ee2 +997, 0xe9bfe072 +998, 0x15549e74 +999, 0xad8c191b diff --git a/shared/package-files/9e/9ec1fa2d983273f6ac96fe0d6b95ef24c122cc2eae4b3b1c465556f75935a6ee/blob b/shared/package-files/9e/9ec1fa2d983273f6ac96fe0d6b95ef24c122cc2eae4b3b1c465556f75935a6ee/blob new file mode 100644 index 0000000000000000000000000000000000000000..75b75cb5f2e0693eea98a7b1c9b3e7f036ec26f6 --- /dev/null +++ b/shared/package-files/9e/9ec1fa2d983273f6ac96fe0d6b95ef24c122cc2eae4b3b1c465556f75935a6ee/blob @@ -0,0 +1,151 @@ +""" Generic SymPy-Independent Strategies """ +from __future__ import annotations +from collections.abc import Callable, Mapping +from typing import TypeVar +from sys import stdout + + +_S = TypeVar('_S') +_T = TypeVar('_T') + + +def identity(x: _T) -> _T: + return x + + +def exhaust(rule: Callable[[_T], _T]) -> Callable[[_T], _T]: + """ Apply a rule repeatedly until it has no effect """ + def exhaustive_rl(expr: _T) -> _T: + new, old = rule(expr), expr + while new != old: + new, old = rule(new), new + return new + return exhaustive_rl + + +def memoize(rule: Callable[[_S], _T]) -> Callable[[_S], _T]: + """Memoized version of a rule + + Notes + ===== + + This cache can grow infinitely, so it is not recommended to use this + than ``functools.lru_cache`` unless you need very heavy computation. + """ + cache: dict[_S, _T] = {} + + def memoized_rl(expr: _S) -> _T: + if expr in cache: + return cache[expr] + else: + result = rule(expr) + cache[expr] = result + return result + return memoized_rl + + +def condition( + cond: Callable[[_T], bool], rule: Callable[[_T], _T] +) -> Callable[[_T], _T]: + """ Only apply rule if condition is true """ + def conditioned_rl(expr: _T) -> _T: + if cond(expr): + return rule(expr) + return expr + return conditioned_rl + + +def chain(*rules: Callable[[_T], _T]) -> Callable[[_T], _T]: + """ + Compose a sequence of rules so that they apply to the expr sequentially + """ + def chain_rl(expr: _T) -> _T: + for rule in rules: + expr = rule(expr) + return expr + return chain_rl + + +def debug(rule, file=None): + """ Print out before and after expressions each time rule is used """ + if file is None: + file = stdout + + def debug_rl(*args, **kwargs): + expr = args[0] + result = rule(*args, **kwargs) + if result != expr: + file.write("Rule: %s\n" % rule.__name__) + file.write("In: %s\nOut: %s\n\n" % (expr, result)) + return result + return debug_rl + + +def null_safe(rule: Callable[[_T], _T | None]) -> Callable[[_T], _T]: + """ Return original expr if rule returns None """ + def null_safe_rl(expr: _T) -> _T: + result = rule(expr) + if result is None: + return expr + return result + return null_safe_rl + + +def tryit(rule: Callable[[_T], _T], exception) -> Callable[[_T], _T]: + """ Return original expr if rule raises exception """ + def try_rl(expr: _T) -> _T: + try: + return rule(expr) + except exception: + return expr + return try_rl + + +def do_one(*rules: Callable[[_T], _T]) -> Callable[[_T], _T]: + """ Try each of the rules until one works. Then stop. """ + def do_one_rl(expr: _T) -> _T: + for rl in rules: + result = rl(expr) + if result != expr: + return result + return expr + return do_one_rl + + +def switch( + key: Callable[[_S], _T], + ruledict: Mapping[_T, Callable[[_S], _S]] +) -> Callable[[_S], _S]: + """ Select a rule based on the result of key called on the function """ + def switch_rl(expr: _S) -> _S: + rl = ruledict.get(key(expr), identity) + return rl(expr) + return switch_rl + + +# XXX Untyped default argument for minimize function +# where python requires SupportsRichComparison type +def _identity(x): + return x + + +def minimize( + *rules: Callable[[_S], _T], + objective=_identity +) -> Callable[[_S], _T]: + """ Select result of rules that minimizes objective + + >>> from sympy.strategies import minimize + >>> inc = lambda x: x + 1 + >>> dec = lambda x: x - 1 + >>> rl = minimize(inc, dec) + >>> rl(4) + 3 + + >>> rl = minimize(inc, dec, objective=lambda x: -x) # maximize + >>> rl(4) + 5 + """ + def minrule(expr: _S) -> _T: + return min([rule(expr) for rule in rules], key=objective) + return minrule diff --git a/shared/package-files/9e/9ec47595697628058434c8b056c581aefce247c4d774d5392cf6e74fd04075be/blob b/shared/package-files/9e/9ec47595697628058434c8b056c581aefce247c4d774d5392cf6e74fd04075be/blob new file mode 100644 index 0000000000000000000000000000000000000000..5e76b7b8e76f8bb79b170ba72cbf9a6a7e00bc85 --- /dev/null +++ b/shared/package-files/9e/9ec47595697628058434c8b056c581aefce247c4d774d5392cf6e74fd04075be/blob @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shared/package-files/9e/9ec6b71ad98770922d852389ecd8dfd1be1cd182d6e3979b1939036b59b12344/blob b/shared/package-files/9e/9ec6b71ad98770922d852389ecd8dfd1be1cd182d6e3979b1939036b59b12344/blob new file mode 100644 index 0000000000000000000000000000000000000000..1dae58ad0ed17a1f1494a2e9e323bb28fbdac6ce --- /dev/null +++ b/shared/package-files/9e/9ec6b71ad98770922d852389ecd8dfd1be1cd182d6e3979b1939036b59b12344/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _cummin_helper { + using schema = void (const at::Tensor &, at::Tensor &, at::Tensor &, int64_t); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_cummin_helper") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_cummin_helper(Tensor self, Tensor(a!) values, Tensor(b!) indices, int dim) -> ()") + static void call(const at::Tensor & self, at::Tensor & values, at::Tensor & indices, int64_t dim); + static void redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Tensor & values, at::Tensor & indices, int64_t dim); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9e/9ec78fe9e0e42e388d20e4b19b610315391e993a8d15436abef349a4c88d6556/blob b/shared/package-files/9e/9ec78fe9e0e42e388d20e4b19b610315391e993a8d15436abef349a4c88d6556/blob new file mode 100644 index 0000000000000000000000000000000000000000..53e8bdc4534dc66dc1b68e603b2af431d0c0b209 --- /dev/null +++ b/shared/package-files/9e/9ec78fe9e0e42e388d20e4b19b610315391e993a8d15436abef349a4c88d6556/blob @@ -0,0 +1,24 @@ +import numpy as np + +from pandas import ( + DataFrame, + Index, + Series, +) +import pandas._testing as tm + + +def test_corrwith_with_1_axis(): + # GH 47723 + df = DataFrame({"a": [1, 1, 2], "b": [3, 7, 4]}) + gb = df.groupby("a") + + msg = "DataFrameGroupBy.corrwith with axis=1 is deprecated" + with tm.assert_produces_warning(FutureWarning, match=msg): + result = gb.corrwith(df, axis=1) + index = Index( + data=[(1, 0), (1, 1), (1, 2), (2, 2), (2, 0), (2, 1)], + name=("a", None), + ) + expected = Series([np.nan] * 6, index=index) + tm.assert_series_equal(result, expected) diff --git a/shared/package-files/9e/9ec96a2cd19e4e6dfac7e0593fa63c000ee616d596c3716a5a8dff3a50d5f56e/blob b/shared/package-files/9e/9ec96a2cd19e4e6dfac7e0593fa63c000ee616d596c3716a5a8dff3a50d5f56e/blob new file mode 100644 index 0000000000000000000000000000000000000000..13de29c342ff373924663fd74dc5e251d026b2cd --- /dev/null +++ b/shared/package-files/9e/9ec96a2cd19e4e6dfac7e0593fa63c000ee616d596c3716a5a8dff3a50d5f56e/blob @@ -0,0 +1,172 @@ +Metadata-Version: 2.1 +Name: prompt-toolkit +Version: 3.0.43 +Summary: Library for building powerful interactive command lines in Python +Home-page: https://github.com/prompt-toolkit/python-prompt-toolkit +Author: Jonathan Slenders +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python +Classifier: Topic :: Software Development +Requires-Python: >=3.7.0 +Description-Content-Type: text/x-rst +License-File: LICENSE +License-File: AUTHORS.rst +Requires-Dist: wcwidth + +Python Prompt Toolkit +===================== + +|AppVeyor| |PyPI| |RTD| |License| |Codecov| + +.. image :: https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/logo_400px.png + +``prompt_toolkit`` *is a library for building powerful interactive command line applications in Python.* + +Read the `documentation on readthedocs +`_. + + +Gallery +******* + +`ptpython `_ is an interactive +Python Shell, build on top of ``prompt_toolkit``. + +.. image :: https://github.com/prompt-toolkit/python-prompt-toolkit/raw/master/docs/images/ptpython.png + +`More examples `_ + + +prompt_toolkit features +*********************** + +``prompt_toolkit`` could be a replacement for `GNU readline +`_, but it can be much +more than that. + +Some features: + +- **Pure Python**. +- Syntax highlighting of the input while typing. (For instance, with a Pygments lexer.) +- Multi-line input editing. +- Advanced code completion. +- Both Emacs and Vi key bindings. (Similar to readline.) +- Even some advanced Vi functionality, like named registers and digraphs. +- Reverse and forward incremental search. +- Works well with Unicode double width characters. (Chinese input.) +- Selecting text for copy/paste. (Both Emacs and Vi style.) +- Support for `bracketed paste `_. +- Mouse support for cursor positioning and scrolling. +- Auto suggestions. (Like `fish shell `_.) +- Multiple input buffers. +- No global state. +- Lightweight, the only dependencies are Pygments and wcwidth. +- Runs on Linux, OS X, FreeBSD, OpenBSD and Windows systems. +- And much more... + +Feel free to create tickets for bugs and feature requests, and create pull +requests if you have nice patches that you would like to share with others. + + +Installation +************ + +:: + + pip install prompt_toolkit + +For Conda, do: + +:: + + conda install -c https://conda.anaconda.org/conda-forge prompt_toolkit + + +About Windows support +********************* + +``prompt_toolkit`` is cross platform, and everything that you build on top +should run fine on both Unix and Windows systems. Windows support is best on +recent Windows 10 builds, for which the command line window supports vt100 +escape sequences. (If not supported, we fall back to using Win32 APIs for color +and cursor movements). + +It's worth noting that the implementation is a "best effort of what is +possible". Both Unix and Windows terminals have their limitations. But in +general, the Unix experience will still be a little better. + +For Windows, it's recommended to use either `cmder +`_ or `conemu `_. + +Getting started +*************** + +The most simple example of the library would look like this: + +.. code:: python + + from prompt_toolkit import prompt + + if __name__ == '__main__': + answer = prompt('Give me some input: ') + print('You said: %s' % answer) + +For more complex examples, have a look in the ``examples`` directory. All +examples are chosen to demonstrate only one thing. Also, don't be afraid to +look at the source code. The implementation of the ``prompt`` function could be +a good start. + +Philosophy +********** + +The source code of ``prompt_toolkit`` should be **readable**, **concise** and +**efficient**. We prefer short functions focusing each on one task and for which +the input and output types are clearly specified. We mostly prefer composition +over inheritance, because inheritance can result in too much functionality in +the same object. We prefer immutable objects where possible (objects don't +change after initialization). Reusability is important. We absolutely refrain +from having a changing global state, it should be possible to have multiple +independent instances of the same code in the same process. The architecture +should be layered: the lower levels operate on primitive operations and data +structures giving -- when correctly combined -- all the possible flexibility; +while at the higher level, there should be a simpler API, ready-to-use and +sufficient for most use cases. Thinking about algorithms and efficiency is +important, but avoid premature optimization. + + +`Projects using prompt_toolkit `_ +*********************************************** + +Special thanks to +***************** + +- `Pygments `_: Syntax highlighter. +- `wcwidth `_: Determine columns needed for a wide characters. + +.. |PyPI| image:: https://img.shields.io/pypi/v/prompt_toolkit.svg + :target: https://pypi.python.org/pypi/prompt-toolkit/ + :alt: Latest Version + +.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true + :target: https://ci.appveyor.com/project/prompt-toolkit/python-prompt-toolkit/ + +.. |RTD| image:: https://readthedocs.org/projects/python-prompt-toolkit/badge/ + :target: https://python-prompt-toolkit.readthedocs.io/en/master/ + +.. |License| image:: https://img.shields.io/github/license/prompt-toolkit/python-prompt-toolkit.svg + :target: https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/LICENSE + +.. |Codecov| image:: https://codecov.io/gh/prompt-toolkit/python-prompt-toolkit/branch/master/graphs/badge.svg?style=flat + :target: https://codecov.io/gh/prompt-toolkit/python-prompt-toolkit/ + diff --git a/shared/package-files/9e/9ecd558955082ec491fe4f93fe8f816702b0bb14b25553c26ccafcb8a57f5ee2/blob b/shared/package-files/9e/9ecd558955082ec491fe4f93fe8f816702b0bb14b25553c26ccafcb8a57f5ee2/blob new file mode 100644 index 0000000000000000000000000000000000000000..9aa4b7c958bb5d8bce5458154275a51a26eed8b0 --- /dev/null +++ b/shared/package-files/9e/9ecd558955082ec491fe4f93fe8f816702b0bb14b25553c26ccafcb8a57f5ee2/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ecd558955082ec491fe4f93fe8f816702b0bb14b25553c26ccafcb8a57f5ee2 +size 208346 diff --git a/shared/package-files/9e/9ece788dfdfd9b0fa887c8056749a3f59db360af7c46ae5725f03df7e1239931/blob b/shared/package-files/9e/9ece788dfdfd9b0fa887c8056749a3f59db360af7c46ae5725f03df7e1239931/blob new file mode 100644 index 0000000000000000000000000000000000000000..dc4aedd2cdef2ce9472cbbb4f2f90123f730a6fa --- /dev/null +++ b/shared/package-files/9e/9ece788dfdfd9b0fa887c8056749a3f59db360af7c46ae5725f03df7e1239931/blob @@ -0,0 +1,302 @@ +""" + pygments.lexers.algebra + ~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for computer algebra systems. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Generic, Whitespace + +__all__ = ['GAPLexer', 'GAPConsoleLexer', 'MathematicaLexer', 'MuPADLexer', + 'BCLexer'] + + +class GAPLexer(RegexLexer): + """ + For GAP source code. + + .. versionadded:: 2.0 + """ + name = 'GAP' + url = 'http://www.gap-system.org' + aliases = ['gap'] + filenames = ['*.g', '*.gd', '*.gi', '*.gap'] + + tokens = { + 'root': [ + (r'#.*$', Comment.Single), + (r'"(?:[^"\\]|\\.)*"', String), + (r'\(|\)|\[|\]|\{|\}', Punctuation), + (r'''(?x)\b(?: + if|then|elif|else|fi| + for|while|do|od| + repeat|until| + break|continue| + function|local|return|end| + rec| + quit|QUIT| + IsBound|Unbind| + TryNextMethod| + Info|Assert + )\b''', Keyword), + (r'''(?x)\b(?: + true|false|fail|infinity + )\b''', + Name.Constant), + (r'''(?x)\b(?: + (Declare|Install)([A-Z][A-Za-z]+)| + BindGlobal|BIND_GLOBAL + )\b''', + Name.Builtin), + (r'\.|,|:=|;|=|\+|-|\*|/|\^|>|<', Operator), + (r'''(?x)\b(?: + and|or|not|mod|in + )\b''', + Operator.Word), + (r'''(?x) + (?:\w+|`[^`]*`) + (?:::\w+|`[^`]*`)*''', Name.Variable), + (r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number), + (r'\.[0-9]+(?:e[0-9]+)?', Number), + (r'.', Text) + ], + } + + def analyse_text(text): + score = 0.0 + + # Declaration part + if re.search( + r"(InstallTrueMethod|Declare(Attribute|Category|Filter|Operation" + + r"|GlobalFunction|Synonym|SynonymAttr|Property))", text + ): + score += 0.7 + + # Implementation part + if re.search( + r"(DeclareRepresentation|Install(GlobalFunction|Method|" + + r"ImmediateMethod|OtherMethod)|New(Family|Type)|Objectify)", text + ): + score += 0.7 + + return min(score, 1.0) + + +class GAPConsoleLexer(Lexer): + """ + For GAP console sessions. Modeled after JuliaConsoleLexer. + + .. versionadded:: 2.14 + """ + name = 'GAP session' + aliases = ['gap-console', 'gap-repl'] + filenames = ['*.tst'] + + def get_tokens_unprocessed(self, text): + gaplexer = GAPLexer(**self.options) + start = 0 + curcode = '' + insertions = [] + output = False + error = False + + for line in text.splitlines(keepends=True): + if line.startswith('gap> ') or line.startswith('brk> '): + insertions.append((len(curcode), [(0, Generic.Prompt, line[:5])])) + curcode += line[5:] + output = False + error = False + elif not output and line.startswith('> '): + insertions.append((len(curcode), [(0, Generic.Prompt, line[:2])])) + curcode += line[2:] + else: + if curcode: + yield from do_insertions( + insertions, gaplexer.get_tokens_unprocessed(curcode)) + curcode = '' + insertions = [] + if line.startswith('Error, ') or error: + yield start, Generic.Error, line + error = True + else: + yield start, Generic.Output, line + output = True + start += len(line) + + if curcode: + yield from do_insertions( + insertions, gaplexer.get_tokens_unprocessed(curcode)) + + # the following is needed to distinguish Scilab and GAP .tst files + def analyse_text(text): + # GAP prompts are a dead give away, although hypothetical;y a + # file in another language could be trying to compare a variable + # "gap" as in "gap> 0.1". But that this should happen at the + # start of a line seems unlikely... + if re.search(r"^gap> ", text): + return 0.9 + else: + return 0.0 + + +class MathematicaLexer(RegexLexer): + """ + Lexer for Mathematica source code. + + .. versionadded:: 2.0 + """ + name = 'Mathematica' + url = 'http://www.wolfram.com/mathematica/' + aliases = ['mathematica', 'mma', 'nb'] + filenames = ['*.nb', '*.cdf', '*.nbp', '*.ma'] + mimetypes = ['application/mathematica', + 'application/vnd.wolfram.mathematica', + 'application/vnd.wolfram.mathematica.package', + 'application/vnd.wolfram.cdf'] + + # http://reference.wolfram.com/mathematica/guide/Syntax.html + operators = ( + ";;", "=", "=.", "!=" "==", ":=", "->", ":>", "/.", "+", "-", "*", "/", + "^", "&&", "||", "!", "<>", "|", "/;", "?", "@", "//", "/@", "@@", + "@@@", "~~", "===", "&", "<", ">", "<=", ">=", + ) + + punctuation = (",", ";", "(", ")", "[", "]", "{", "}") + + def _multi_escape(entries): + return '(%s)' % ('|'.join(re.escape(entry) for entry in entries)) + + tokens = { + 'root': [ + (r'(?s)\(\*.*?\*\)', Comment), + + (r'([a-zA-Z]+[A-Za-z0-9]*`)', Name.Namespace), + (r'([A-Za-z0-9]*_+[A-Za-z0-9]*)', Name.Variable), + (r'#\d*', Name.Variable), + (r'([a-zA-Z]+[a-zA-Z0-9]*)', Name), + + (r'-?\d+\.\d*', Number.Float), + (r'-?\d*\.\d+', Number.Float), + (r'-?\d+', Number.Integer), + + (words(operators), Operator), + (words(punctuation), Punctuation), + (r'".*?"', String), + (r'\s+', Text.Whitespace), + ], + } + + +class MuPADLexer(RegexLexer): + """ + A MuPAD lexer. + Contributed by Christopher Creutzig . + + .. versionadded:: 0.8 + """ + name = 'MuPAD' + url = 'http://www.mupad.com' + aliases = ['mupad'] + filenames = ['*.mu'] + + tokens = { + 'root': [ + (r'//.*?$', Comment.Single), + (r'/\*', Comment.Multiline, 'comment'), + (r'"(?:[^"\\]|\\.)*"', String), + (r'\(|\)|\[|\]|\{|\}', Punctuation), + (r'''(?x)\b(?: + next|break|end| + axiom|end_axiom|category|end_category|domain|end_domain|inherits| + if|%if|then|elif|else|end_if| + case|of|do|otherwise|end_case| + while|end_while| + repeat|until|end_repeat| + for|from|to|downto|step|end_for| + proc|local|option|save|begin|end_proc| + delete|frame + )\b''', Keyword), + (r'''(?x)\b(?: + DOM_ARRAY|DOM_BOOL|DOM_COMPLEX|DOM_DOMAIN|DOM_EXEC|DOM_EXPR| + DOM_FAIL|DOM_FLOAT|DOM_FRAME|DOM_FUNC_ENV|DOM_HFARRAY|DOM_IDENT| + DOM_INT|DOM_INTERVAL|DOM_LIST|DOM_NIL|DOM_NULL|DOM_POLY|DOM_PROC| + DOM_PROC_ENV|DOM_RAT|DOM_SET|DOM_STRING|DOM_TABLE|DOM_VAR + )\b''', Name.Class), + (r'''(?x)\b(?: + PI|EULER|E|CATALAN| + NIL|FAIL|undefined|infinity| + TRUE|FALSE|UNKNOWN + )\b''', + Name.Constant), + (r'\b(?:dom|procname)\b', Name.Builtin.Pseudo), + (r'\.|,|:|;|=|\+|-|\*|/|\^|@|>|<|\$|\||!|\'|%|~=', Operator), + (r'''(?x)\b(?: + and|or|not|xor| + assuming| + div|mod| + union|minus|intersect|in|subset + )\b''', + Operator.Word), + (r'\b(?:I|RDN_INF|RD_NINF|RD_NAN)\b', Number), + # (r'\b(?:adt|linalg|newDomain|hold)\b', Name.Builtin), + (r'''(?x) + ((?:[a-zA-Z_#][\w#]*|`[^`]*`) + (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*)(\s*)([(])''', + bygroups(Name.Function, Text, Punctuation)), + (r'''(?x) + (?:[a-zA-Z_#][\w#]*|`[^`]*`) + (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*''', Name.Variable), + (r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number), + (r'\.[0-9]+(?:e[0-9]+)?', Number), + (r'\s+', Whitespace), + (r'.', Text) + ], + 'comment': [ + (r'[^/*]+', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + } + + +class BCLexer(RegexLexer): + """ + A BC lexer. + + .. versionadded:: 2.1 + """ + name = 'BC' + url = 'https://www.gnu.org/software/bc/' + aliases = ['bc'] + filenames = ['*.bc'] + + tokens = { + 'root': [ + (r'/\*', Comment.Multiline, 'comment'), + (r'"(?:[^"\\]|\\.)*"', String), + (r'[{}();,]', Punctuation), + (words(('if', 'else', 'while', 'for', 'break', 'continue', + 'halt', 'return', 'define', 'auto', 'print', 'read', + 'length', 'scale', 'sqrt', 'limits', 'quit', + 'warranty'), suffix=r'\b'), Keyword), + (r'\+\+|--|\|\||&&|' + r'([-<>+*%\^/!=])=?', Operator), + # bc doesn't support exponential + (r'[0-9]+(\.[0-9]*)?', Number), + (r'\.[0-9]+', Number), + (r'.', Text) + ], + 'comment': [ + (r'[^*/]+', Comment.Multiline), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + } diff --git a/shared/package-files/9e/9ecfc4d76c057b809edc43f7f01d034610278474eb761ed67e18e70d6827249e/blob b/shared/package-files/9e/9ecfc4d76c057b809edc43f7f01d034610278474eb761ed67e18e70d6827249e/blob new file mode 100644 index 0000000000000000000000000000000000000000..5366e75116fda8b2baee275da4de91d7d9547c2a --- /dev/null +++ b/shared/package-files/9e/9ecfc4d76c057b809edc43f7f01d034610278474eb761ed67e18e70d6827249e/blob @@ -0,0 +1,3325 @@ +""" + pygments.lexers._php_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file loads the function names and their modules from the + php webpage and generates itself. + + Run with `python -I` to regenerate. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +MODULES = {'APCu': ('apcu_add', + 'apcu_cache_info', + 'apcu_cas', + 'apcu_clear_cache', + 'apcu_dec', + 'apcu_delete', + 'apcu_enabled', + 'apcu_entry', + 'apcu_exists', + 'apcu_fetch', + 'apcu_inc', + 'apcu_key_info', + 'apcu_sma_info', + 'apcu_store'), + 'Aliases and deprecated Mysqli': ('mysqli_connect', + 'mysqli_execute', + 'mysqli_get_client_stats', + 'mysqli_get_links_stats', + 'mysqli_report'), + 'Apache': ('apache_child_terminate', + 'apache_get_modules', + 'apache_get_version', + 'apache_getenv', + 'apache_lookup_uri', + 'apache_note', + 'apache_request_headers', + 'apache_response_headers', + 'apache_setenv', + 'getallheaders', + 'virtual'), + 'Array': ('array_change_key_case', + 'array_chunk', + 'array_column', + 'array_combine', + 'array_count_values', + 'array_diff_assoc', + 'array_diff_key', + 'array_diff_uassoc', + 'array_diff_ukey', + 'array_diff', + 'array_fill_keys', + 'array_fill', + 'array_filter', + 'array_flip', + 'array_intersect_assoc', + 'array_intersect_key', + 'array_intersect_uassoc', + 'array_intersect_ukey', + 'array_intersect', + 'array_is_list', + 'array_key_exists', + 'array_key_first', + 'array_key_last', + 'array_keys', + 'array_map', + 'array_merge_recursive', + 'array_merge', + 'array_multisort', + 'array_pad', + 'array_pop', + 'array_product', + 'array_push', + 'array_rand', + 'array_reduce', + 'array_replace_recursive', + 'array_replace', + 'array_reverse', + 'array_search', + 'array_shift', + 'array_slice', + 'array_splice', + 'array_sum', + 'array_udiff_assoc', + 'array_udiff_uassoc', + 'array_udiff', + 'array_uintersect_assoc', + 'array_uintersect_uassoc', + 'array_uintersect', + 'array_unique', + 'array_unshift', + 'array_values', + 'array_walk_recursive', + 'array_walk', + 'array', + 'arsort', + 'asort', + 'compact', + 'count', + 'current', + 'each', + 'end', + 'extract', + 'in_array', + 'key_exists', + 'key', + 'krsort', + 'ksort', + 'list', + 'natcasesort', + 'natsort', + 'next', + 'pos', + 'prev', + 'range', + 'reset', + 'rsort', + 'shuffle', + 'sizeof', + 'sort', + 'uasort', + 'uksort', + 'usort'), + 'BC Math': ('bcadd', + 'bccomp', + 'bcdiv', + 'bcmod', + 'bcmul', + 'bcpow', + 'bcpowmod', + 'bcscale', + 'bcsqrt', + 'bcsub'), + 'Bzip2': ('bzclose', + 'bzcompress', + 'bzdecompress', + 'bzerrno', + 'bzerror', + 'bzerrstr', + 'bzflush', + 'bzopen', + 'bzread', + 'bzwrite'), + 'COM': ('com_create_guid', + 'com_event_sink', + 'com_get_active_object', + 'com_load_typelib', + 'com_message_pump', + 'com_print_typeinfo', + 'variant_abs', + 'variant_add', + 'variant_and', + 'variant_cast', + 'variant_cat', + 'variant_cmp', + 'variant_date_from_timestamp', + 'variant_date_to_timestamp', + 'variant_div', + 'variant_eqv', + 'variant_fix', + 'variant_get_type', + 'variant_idiv', + 'variant_imp', + 'variant_int', + 'variant_mod', + 'variant_mul', + 'variant_neg', + 'variant_not', + 'variant_or', + 'variant_pow', + 'variant_round', + 'variant_set_type', + 'variant_set', + 'variant_sub', + 'variant_xor'), + 'CSPRNG': ('random_bytes', 'random_int'), + 'CUBRID': ('cubrid_bind', + 'cubrid_close_prepare', + 'cubrid_close_request', + 'cubrid_col_get', + 'cubrid_col_size', + 'cubrid_column_names', + 'cubrid_column_types', + 'cubrid_commit', + 'cubrid_connect_with_url', + 'cubrid_connect', + 'cubrid_current_oid', + 'cubrid_disconnect', + 'cubrid_drop', + 'cubrid_error_code_facility', + 'cubrid_error_code', + 'cubrid_error_msg', + 'cubrid_execute', + 'cubrid_fetch', + 'cubrid_free_result', + 'cubrid_get_autocommit', + 'cubrid_get_charset', + 'cubrid_get_class_name', + 'cubrid_get_client_info', + 'cubrid_get_db_parameter', + 'cubrid_get_query_timeout', + 'cubrid_get_server_info', + 'cubrid_get', + 'cubrid_insert_id', + 'cubrid_is_instance', + 'cubrid_lob_close', + 'cubrid_lob_export', + 'cubrid_lob_get', + 'cubrid_lob_send', + 'cubrid_lob_size', + 'cubrid_lob2_bind', + 'cubrid_lob2_close', + 'cubrid_lob2_export', + 'cubrid_lob2_import', + 'cubrid_lob2_new', + 'cubrid_lob2_read', + 'cubrid_lob2_seek64', + 'cubrid_lob2_seek', + 'cubrid_lob2_size64', + 'cubrid_lob2_size', + 'cubrid_lob2_tell64', + 'cubrid_lob2_tell', + 'cubrid_lob2_write', + 'cubrid_lock_read', + 'cubrid_lock_write', + 'cubrid_move_cursor', + 'cubrid_next_result', + 'cubrid_num_cols', + 'cubrid_num_rows', + 'cubrid_pconnect_with_url', + 'cubrid_pconnect', + 'cubrid_prepare', + 'cubrid_put', + 'cubrid_rollback', + 'cubrid_schema', + 'cubrid_seq_drop', + 'cubrid_seq_insert', + 'cubrid_seq_put', + 'cubrid_set_add', + 'cubrid_set_autocommit', + 'cubrid_set_db_parameter', + 'cubrid_set_drop', + 'cubrid_set_query_timeout', + 'cubrid_version'), + 'Calendar': ('cal_days_in_month', + 'cal_from_jd', + 'cal_info', + 'cal_to_jd', + 'easter_date', + 'easter_days', + 'frenchtojd', + 'gregoriantojd', + 'jddayofweek', + 'jdmonthname', + 'jdtofrench', + 'jdtogregorian', + 'jdtojewish', + 'jdtojulian', + 'jdtounix', + 'jewishtojd', + 'juliantojd', + 'unixtojd'), + 'Classes/Object': ('__autoload', + 'class_alias', + 'class_exists', + 'enum_exists', + 'get_called_class', + 'get_class_methods', + 'get_class_vars', + 'get_class', + 'get_declared_classes', + 'get_declared_interfaces', + 'get_declared_traits', + 'get_mangled_object_vars', + 'get_object_vars', + 'get_parent_class', + 'interface_exists', + 'is_a', + 'is_subclass_of', + 'method_exists', + 'property_exists', + 'trait_exists'), + 'Ctype': ('ctype_alnum', + 'ctype_alpha', + 'ctype_cntrl', + 'ctype_digit', + 'ctype_graph', + 'ctype_lower', + 'ctype_print', + 'ctype_punct', + 'ctype_space', + 'ctype_upper', + 'ctype_xdigit'), + 'DBA': ('dba_close', + 'dba_delete', + 'dba_exists', + 'dba_fetch', + 'dba_firstkey', + 'dba_handlers', + 'dba_insert', + 'dba_key_split', + 'dba_list', + 'dba_nextkey', + 'dba_open', + 'dba_optimize', + 'dba_popen', + 'dba_replace', + 'dba_sync'), + 'DOM': ('dom_import_simplexml',), + 'Date/Time': ('checkdate', + 'date_add', + 'date_create_from_format', + 'date_create_immutable_from_format', + 'date_create_immutable', + 'date_create', + 'date_date_set', + 'date_default_timezone_get', + 'date_default_timezone_set', + 'date_diff', + 'date_format', + 'date_get_last_errors', + 'date_interval_create_from_date_string', + 'date_interval_format', + 'date_isodate_set', + 'date_modify', + 'date_offset_get', + 'date_parse_from_format', + 'date_parse', + 'date_sub', + 'date_sun_info', + 'date_sunrise', + 'date_sunset', + 'date_time_set', + 'date_timestamp_get', + 'date_timestamp_set', + 'date_timezone_get', + 'date_timezone_set', + 'date', + 'getdate', + 'gettimeofday', + 'gmdate', + 'gmmktime', + 'gmstrftime', + 'idate', + 'localtime', + 'microtime', + 'mktime', + 'strftime', + 'strptime', + 'strtotime', + 'time', + 'timezone_abbreviations_list', + 'timezone_identifiers_list', + 'timezone_location_get', + 'timezone_name_from_abbr', + 'timezone_name_get', + 'timezone_offset_get', + 'timezone_open', + 'timezone_transitions_get', + 'timezone_version_get'), + 'Direct IO': ('dio_close', + 'dio_fcntl', + 'dio_open', + 'dio_read', + 'dio_seek', + 'dio_stat', + 'dio_tcsetattr', + 'dio_truncate', + 'dio_write'), + 'Directory': ('chdir', + 'chroot', + 'closedir', + 'dir', + 'getcwd', + 'opendir', + 'readdir', + 'rewinddir', + 'scandir'), + 'Eio': ('eio_busy', + 'eio_cancel', + 'eio_chmod', + 'eio_chown', + 'eio_close', + 'eio_custom', + 'eio_dup2', + 'eio_event_loop', + 'eio_fallocate', + 'eio_fchmod', + 'eio_fchown', + 'eio_fdatasync', + 'eio_fstat', + 'eio_fstatvfs', + 'eio_fsync', + 'eio_ftruncate', + 'eio_futime', + 'eio_get_event_stream', + 'eio_get_last_error', + 'eio_grp_add', + 'eio_grp_cancel', + 'eio_grp_limit', + 'eio_grp', + 'eio_init', + 'eio_link', + 'eio_lstat', + 'eio_mkdir', + 'eio_mknod', + 'eio_nop', + 'eio_npending', + 'eio_nready', + 'eio_nreqs', + 'eio_nthreads', + 'eio_open', + 'eio_poll', + 'eio_read', + 'eio_readahead', + 'eio_readdir', + 'eio_readlink', + 'eio_realpath', + 'eio_rename', + 'eio_rmdir', + 'eio_seek', + 'eio_sendfile', + 'eio_set_max_idle', + 'eio_set_max_parallel', + 'eio_set_max_poll_reqs', + 'eio_set_max_poll_time', + 'eio_set_min_parallel', + 'eio_stat', + 'eio_statvfs', + 'eio_symlink', + 'eio_sync_file_range', + 'eio_sync', + 'eio_syncfs', + 'eio_truncate', + 'eio_unlink', + 'eio_utime', + 'eio_write'), + 'Enchant': ('enchant_broker_describe', + 'enchant_broker_dict_exists', + 'enchant_broker_free_dict', + 'enchant_broker_free', + 'enchant_broker_get_dict_path', + 'enchant_broker_get_error', + 'enchant_broker_init', + 'enchant_broker_list_dicts', + 'enchant_broker_request_dict', + 'enchant_broker_request_pwl_dict', + 'enchant_broker_set_dict_path', + 'enchant_broker_set_ordering', + 'enchant_dict_add_to_personal', + 'enchant_dict_add_to_session', + 'enchant_dict_add', + 'enchant_dict_check', + 'enchant_dict_describe', + 'enchant_dict_get_error', + 'enchant_dict_is_added', + 'enchant_dict_is_in_session', + 'enchant_dict_quick_check', + 'enchant_dict_store_replacement', + 'enchant_dict_suggest'), + 'Error Handling': ('debug_backtrace', + 'debug_print_backtrace', + 'error_clear_last', + 'error_get_last', + 'error_log', + 'error_reporting', + 'restore_error_handler', + 'restore_exception_handler', + 'set_error_handler', + 'set_exception_handler', + 'trigger_error', + 'user_error'), + 'Exif': ('exif_imagetype', + 'exif_read_data', + 'exif_tagname', + 'exif_thumbnail', + 'read_exif_data'), + 'Expect': ('expect_expectl', 'expect_popen'), + 'FDF': ('fdf_add_doc_javascript', + 'fdf_add_template', + 'fdf_close', + 'fdf_create', + 'fdf_enum_values', + 'fdf_errno', + 'fdf_error', + 'fdf_get_ap', + 'fdf_get_attachment', + 'fdf_get_encoding', + 'fdf_get_file', + 'fdf_get_flags', + 'fdf_get_opt', + 'fdf_get_status', + 'fdf_get_value', + 'fdf_get_version', + 'fdf_header', + 'fdf_next_field_name', + 'fdf_open_string', + 'fdf_open', + 'fdf_remove_item', + 'fdf_save_string', + 'fdf_save', + 'fdf_set_ap', + 'fdf_set_encoding', + 'fdf_set_file', + 'fdf_set_flags', + 'fdf_set_javascript_action', + 'fdf_set_on_import_javascript', + 'fdf_set_opt', + 'fdf_set_status', + 'fdf_set_submit_form_action', + 'fdf_set_target_frame', + 'fdf_set_value', + 'fdf_set_version'), + 'FPM': ('fastcgi_finish_request',), + 'FTP': ('ftp_alloc', + 'ftp_append', + 'ftp_cdup', + 'ftp_chdir', + 'ftp_chmod', + 'ftp_close', + 'ftp_connect', + 'ftp_delete', + 'ftp_exec', + 'ftp_fget', + 'ftp_fput', + 'ftp_get_option', + 'ftp_get', + 'ftp_login', + 'ftp_mdtm', + 'ftp_mkdir', + 'ftp_mlsd', + 'ftp_nb_continue', + 'ftp_nb_fget', + 'ftp_nb_fput', + 'ftp_nb_get', + 'ftp_nb_put', + 'ftp_nlist', + 'ftp_pasv', + 'ftp_put', + 'ftp_pwd', + 'ftp_quit', + 'ftp_raw', + 'ftp_rawlist', + 'ftp_rename', + 'ftp_rmdir', + 'ftp_set_option', + 'ftp_site', + 'ftp_size', + 'ftp_ssl_connect', + 'ftp_systype'), + 'Fann': ('fann_cascadetrain_on_data', + 'fann_cascadetrain_on_file', + 'fann_clear_scaling_params', + 'fann_copy', + 'fann_create_from_file', + 'fann_create_shortcut_array', + 'fann_create_shortcut', + 'fann_create_sparse_array', + 'fann_create_sparse', + 'fann_create_standard_array', + 'fann_create_standard', + 'fann_create_train_from_callback', + 'fann_create_train', + 'fann_descale_input', + 'fann_descale_output', + 'fann_descale_train', + 'fann_destroy_train', + 'fann_destroy', + 'fann_duplicate_train_data', + 'fann_get_activation_function', + 'fann_get_activation_steepness', + 'fann_get_bias_array', + 'fann_get_bit_fail_limit', + 'fann_get_bit_fail', + 'fann_get_cascade_activation_functions_count', + 'fann_get_cascade_activation_functions', + 'fann_get_cascade_activation_steepnesses_count', + 'fann_get_cascade_activation_steepnesses', + 'fann_get_cascade_candidate_change_fraction', + 'fann_get_cascade_candidate_limit', + 'fann_get_cascade_candidate_stagnation_epochs', + 'fann_get_cascade_max_cand_epochs', + 'fann_get_cascade_max_out_epochs', + 'fann_get_cascade_min_cand_epochs', + 'fann_get_cascade_min_out_epochs', + 'fann_get_cascade_num_candidate_groups', + 'fann_get_cascade_num_candidates', + 'fann_get_cascade_output_change_fraction', + 'fann_get_cascade_output_stagnation_epochs', + 'fann_get_cascade_weight_multiplier', + 'fann_get_connection_array', + 'fann_get_connection_rate', + 'fann_get_errno', + 'fann_get_errstr', + 'fann_get_layer_array', + 'fann_get_learning_momentum', + 'fann_get_learning_rate', + 'fann_get_MSE', + 'fann_get_network_type', + 'fann_get_num_input', + 'fann_get_num_layers', + 'fann_get_num_output', + 'fann_get_quickprop_decay', + 'fann_get_quickprop_mu', + 'fann_get_rprop_decrease_factor', + 'fann_get_rprop_delta_max', + 'fann_get_rprop_delta_min', + 'fann_get_rprop_delta_zero', + 'fann_get_rprop_increase_factor', + 'fann_get_sarprop_step_error_shift', + 'fann_get_sarprop_step_error_threshold_factor', + 'fann_get_sarprop_temperature', + 'fann_get_sarprop_weight_decay_shift', + 'fann_get_total_connections', + 'fann_get_total_neurons', + 'fann_get_train_error_function', + 'fann_get_train_stop_function', + 'fann_get_training_algorithm', + 'fann_init_weights', + 'fann_length_train_data', + 'fann_merge_train_data', + 'fann_num_input_train_data', + 'fann_num_output_train_data', + 'fann_print_error', + 'fann_randomize_weights', + 'fann_read_train_from_file', + 'fann_reset_errno', + 'fann_reset_errstr', + 'fann_reset_MSE', + 'fann_run', + 'fann_save_train', + 'fann_save', + 'fann_scale_input_train_data', + 'fann_scale_input', + 'fann_scale_output_train_data', + 'fann_scale_output', + 'fann_scale_train_data', + 'fann_scale_train', + 'fann_set_activation_function_hidden', + 'fann_set_activation_function_layer', + 'fann_set_activation_function_output', + 'fann_set_activation_function', + 'fann_set_activation_steepness_hidden', + 'fann_set_activation_steepness_layer', + 'fann_set_activation_steepness_output', + 'fann_set_activation_steepness', + 'fann_set_bit_fail_limit', + 'fann_set_callback', + 'fann_set_cascade_activation_functions', + 'fann_set_cascade_activation_steepnesses', + 'fann_set_cascade_candidate_change_fraction', + 'fann_set_cascade_candidate_limit', + 'fann_set_cascade_candidate_stagnation_epochs', + 'fann_set_cascade_max_cand_epochs', + 'fann_set_cascade_max_out_epochs', + 'fann_set_cascade_min_cand_epochs', + 'fann_set_cascade_min_out_epochs', + 'fann_set_cascade_num_candidate_groups', + 'fann_set_cascade_output_change_fraction', + 'fann_set_cascade_output_stagnation_epochs', + 'fann_set_cascade_weight_multiplier', + 'fann_set_error_log', + 'fann_set_input_scaling_params', + 'fann_set_learning_momentum', + 'fann_set_learning_rate', + 'fann_set_output_scaling_params', + 'fann_set_quickprop_decay', + 'fann_set_quickprop_mu', + 'fann_set_rprop_decrease_factor', + 'fann_set_rprop_delta_max', + 'fann_set_rprop_delta_min', + 'fann_set_rprop_delta_zero', + 'fann_set_rprop_increase_factor', + 'fann_set_sarprop_step_error_shift', + 'fann_set_sarprop_step_error_threshold_factor', + 'fann_set_sarprop_temperature', + 'fann_set_sarprop_weight_decay_shift', + 'fann_set_scaling_params', + 'fann_set_train_error_function', + 'fann_set_train_stop_function', + 'fann_set_training_algorithm', + 'fann_set_weight_array', + 'fann_set_weight', + 'fann_shuffle_train_data', + 'fann_subset_train_data', + 'fann_test_data', + 'fann_test', + 'fann_train_epoch', + 'fann_train_on_data', + 'fann_train_on_file', + 'fann_train'), + 'Fileinfo': ('finfo_buffer', + 'finfo_close', + 'finfo_file', + 'finfo_open', + 'finfo_set_flags', + 'mime_content_type'), + 'Filesystem': ('basename', + 'chgrp', + 'chmod', + 'chown', + 'clearstatcache', + 'copy', + 'dirname', + 'disk_free_space', + 'disk_total_space', + 'diskfreespace', + 'fclose', + 'fdatasync', + 'feof', + 'fflush', + 'fgetc', + 'fgetcsv', + 'fgets', + 'fgetss', + 'file_exists', + 'file_get_contents', + 'file_put_contents', + 'file', + 'fileatime', + 'filectime', + 'filegroup', + 'fileinode', + 'filemtime', + 'fileowner', + 'fileperms', + 'filesize', + 'filetype', + 'flock', + 'fnmatch', + 'fopen', + 'fpassthru', + 'fputcsv', + 'fputs', + 'fread', + 'fscanf', + 'fseek', + 'fstat', + 'fsync', + 'ftell', + 'ftruncate', + 'fwrite', + 'glob', + 'is_dir', + 'is_executable', + 'is_file', + 'is_link', + 'is_readable', + 'is_uploaded_file', + 'is_writable', + 'is_writeable', + 'lchgrp', + 'lchown', + 'link', + 'linkinfo', + 'lstat', + 'mkdir', + 'move_uploaded_file', + 'parse_ini_file', + 'parse_ini_string', + 'pathinfo', + 'pclose', + 'popen', + 'readfile', + 'readlink', + 'realpath_cache_get', + 'realpath_cache_size', + 'realpath', + 'rename', + 'rewind', + 'rmdir', + 'set_file_buffer', + 'stat', + 'symlink', + 'tempnam', + 'tmpfile', + 'touch', + 'umask', + 'unlink'), + 'Filter': ('filter_has_var', + 'filter_id', + 'filter_input_array', + 'filter_input', + 'filter_list', + 'filter_var_array', + 'filter_var'), + 'Firebird/InterBase': ('fbird_add_user', + 'fbird_affected_rows', + 'fbird_backup', + 'fbird_blob_add', + 'fbird_blob_cancel', + 'fbird_blob_close', + 'fbird_blob_create', + 'fbird_blob_echo', + 'fbird_blob_get', + 'fbird_blob_import', + 'fbird_blob_info', + 'fbird_blob_open', + 'fbird_close', + 'fbird_commit_ret', + 'fbird_commit', + 'fbird_connect', + 'fbird_db_info', + 'fbird_delete_user', + 'fbird_drop_db', + 'fbird_errcode', + 'fbird_errmsg', + 'fbird_execute', + 'fbird_fetch_assoc', + 'fbird_fetch_object', + 'fbird_fetch_row', + 'fbird_field_info', + 'fbird_free_event_handler', + 'fbird_free_query', + 'fbird_free_result', + 'fbird_gen_id', + 'fbird_maintain_db', + 'fbird_modify_user', + 'fbird_name_result', + 'fbird_num_fields', + 'fbird_num_params', + 'fbird_param_info', + 'fbird_pconnect', + 'fbird_prepare', + 'fbird_query', + 'fbird_restore', + 'fbird_rollback_ret', + 'fbird_rollback', + 'fbird_server_info', + 'fbird_service_attach', + 'fbird_service_detach', + 'fbird_set_event_handler', + 'fbird_trans', + 'fbird_wait_event', + 'ibase_add_user', + 'ibase_affected_rows', + 'ibase_backup', + 'ibase_blob_add', + 'ibase_blob_cancel', + 'ibase_blob_close', + 'ibase_blob_create', + 'ibase_blob_echo', + 'ibase_blob_get', + 'ibase_blob_import', + 'ibase_blob_info', + 'ibase_blob_open', + 'ibase_close', + 'ibase_commit_ret', + 'ibase_commit', + 'ibase_connect', + 'ibase_db_info', + 'ibase_delete_user', + 'ibase_drop_db', + 'ibase_errcode', + 'ibase_errmsg', + 'ibase_execute', + 'ibase_fetch_assoc', + 'ibase_fetch_object', + 'ibase_fetch_row', + 'ibase_field_info', + 'ibase_free_event_handler', + 'ibase_free_query', + 'ibase_free_result', + 'ibase_gen_id', + 'ibase_maintain_db', + 'ibase_modify_user', + 'ibase_name_result', + 'ibase_num_fields', + 'ibase_num_params', + 'ibase_param_info', + 'ibase_pconnect', + 'ibase_prepare', + 'ibase_query', + 'ibase_restore', + 'ibase_rollback_ret', + 'ibase_rollback', + 'ibase_server_info', + 'ibase_service_attach', + 'ibase_service_detach', + 'ibase_set_event_handler', + 'ibase_trans', + 'ibase_wait_event'), + 'Function handling': ('call_user_func_array', + 'call_user_func', + 'create_function', + 'forward_static_call_array', + 'forward_static_call', + 'func_get_arg', + 'func_get_args', + 'func_num_args', + 'function_exists', + 'get_defined_functions', + 'register_shutdown_function', + 'register_tick_function', + 'unregister_tick_function'), + 'GD and Image': ('gd_info', + 'getimagesize', + 'getimagesizefromstring', + 'image_type_to_extension', + 'image_type_to_mime_type', + 'image2wbmp', + 'imageaffine', + 'imageaffinematrixconcat', + 'imageaffinematrixget', + 'imagealphablending', + 'imageantialias', + 'imagearc', + 'imageavif', + 'imagebmp', + 'imagechar', + 'imagecharup', + 'imagecolorallocate', + 'imagecolorallocatealpha', + 'imagecolorat', + 'imagecolorclosest', + 'imagecolorclosestalpha', + 'imagecolorclosesthwb', + 'imagecolordeallocate', + 'imagecolorexact', + 'imagecolorexactalpha', + 'imagecolormatch', + 'imagecolorresolve', + 'imagecolorresolvealpha', + 'imagecolorset', + 'imagecolorsforindex', + 'imagecolorstotal', + 'imagecolortransparent', + 'imageconvolution', + 'imagecopy', + 'imagecopymerge', + 'imagecopymergegray', + 'imagecopyresampled', + 'imagecopyresized', + 'imagecreate', + 'imagecreatefromavif', + 'imagecreatefrombmp', + 'imagecreatefromgd2', + 'imagecreatefromgd2part', + 'imagecreatefromgd', + 'imagecreatefromgif', + 'imagecreatefromjpeg', + 'imagecreatefrompng', + 'imagecreatefromstring', + 'imagecreatefromtga', + 'imagecreatefromwbmp', + 'imagecreatefromwebp', + 'imagecreatefromxbm', + 'imagecreatefromxpm', + 'imagecreatetruecolor', + 'imagecrop', + 'imagecropauto', + 'imagedashedline', + 'imagedestroy', + 'imageellipse', + 'imagefill', + 'imagefilledarc', + 'imagefilledellipse', + 'imagefilledpolygon', + 'imagefilledrectangle', + 'imagefilltoborder', + 'imagefilter', + 'imageflip', + 'imagefontheight', + 'imagefontwidth', + 'imageftbbox', + 'imagefttext', + 'imagegammacorrect', + 'imagegd2', + 'imagegd', + 'imagegetclip', + 'imagegetinterpolation', + 'imagegif', + 'imagegrabscreen', + 'imagegrabwindow', + 'imageinterlace', + 'imageistruecolor', + 'imagejpeg', + 'imagelayereffect', + 'imageline', + 'imageloadfont', + 'imageopenpolygon', + 'imagepalettecopy', + 'imagepalettetotruecolor', + 'imagepng', + 'imagepolygon', + 'imagerectangle', + 'imageresolution', + 'imagerotate', + 'imagesavealpha', + 'imagescale', + 'imagesetbrush', + 'imagesetclip', + 'imagesetinterpolation', + 'imagesetpixel', + 'imagesetstyle', + 'imagesetthickness', + 'imagesettile', + 'imagestring', + 'imagestringup', + 'imagesx', + 'imagesy', + 'imagetruecolortopalette', + 'imagettfbbox', + 'imagettftext', + 'imagetypes', + 'imagewbmp', + 'imagewebp', + 'imagexbm', + 'iptcembed', + 'iptcparse', + 'jpeg2wbmp', + 'png2wbmp'), + 'GMP': ('gmp_abs', + 'gmp_add', + 'gmp_and', + 'gmp_binomial', + 'gmp_clrbit', + 'gmp_cmp', + 'gmp_com', + 'gmp_div_q', + 'gmp_div_qr', + 'gmp_div_r', + 'gmp_div', + 'gmp_divexact', + 'gmp_export', + 'gmp_fact', + 'gmp_gcd', + 'gmp_gcdext', + 'gmp_hamdist', + 'gmp_import', + 'gmp_init', + 'gmp_intval', + 'gmp_invert', + 'gmp_jacobi', + 'gmp_kronecker', + 'gmp_lcm', + 'gmp_legendre', + 'gmp_mod', + 'gmp_mul', + 'gmp_neg', + 'gmp_nextprime', + 'gmp_or', + 'gmp_perfect_power', + 'gmp_perfect_square', + 'gmp_popcount', + 'gmp_pow', + 'gmp_powm', + 'gmp_prob_prime', + 'gmp_random_bits', + 'gmp_random_range', + 'gmp_random_seed', + 'gmp_random', + 'gmp_root', + 'gmp_rootrem', + 'gmp_scan0', + 'gmp_scan1', + 'gmp_setbit', + 'gmp_sign', + 'gmp_sqrt', + 'gmp_sqrtrem', + 'gmp_strval', + 'gmp_sub', + 'gmp_testbit', + 'gmp_xor'), + 'GeoIP': ('geoip_asnum_by_name', + 'geoip_continent_code_by_name', + 'geoip_country_code_by_name', + 'geoip_country_code3_by_name', + 'geoip_country_name_by_name', + 'geoip_database_info', + 'geoip_db_avail', + 'geoip_db_filename', + 'geoip_db_get_all_info', + 'geoip_domain_by_name', + 'geoip_id_by_name', + 'geoip_isp_by_name', + 'geoip_netspeedcell_by_name', + 'geoip_org_by_name', + 'geoip_record_by_name', + 'geoip_region_by_name', + 'geoip_region_name_by_code', + 'geoip_setup_custom_directory', + 'geoip_time_zone_by_country_and_region'), + 'Gettext': ('bind_textdomain_codeset', + 'bindtextdomain', + 'dcgettext', + 'dcngettext', + 'dgettext', + 'dngettext', + 'gettext', + 'ngettext', + 'textdomain'), + 'GnuPG': ('gnupg_adddecryptkey', + 'gnupg_addencryptkey', + 'gnupg_addsignkey', + 'gnupg_cleardecryptkeys', + 'gnupg_clearencryptkeys', + 'gnupg_clearsignkeys', + 'gnupg_decrypt', + 'gnupg_decryptverify', + 'gnupg_encrypt', + 'gnupg_encryptsign', + 'gnupg_export', + 'gnupg_getengineinfo', + 'gnupg_geterror', + 'gnupg_geterrorinfo', + 'gnupg_getprotocol', + 'gnupg_import', + 'gnupg_init', + 'gnupg_keyinfo', + 'gnupg_setarmor', + 'gnupg_seterrormode', + 'gnupg_setsignmode', + 'gnupg_sign', + 'gnupg_verify'), + 'Grapheme': ('grapheme_extract', + 'grapheme_stripos', + 'grapheme_stristr', + 'grapheme_strlen', + 'grapheme_strpos', + 'grapheme_strripos', + 'grapheme_strrpos', + 'grapheme_strstr', + 'grapheme_substr'), + 'Hash': ('hash_algos', + 'hash_copy', + 'hash_equals', + 'hash_file', + 'hash_final', + 'hash_hkdf', + 'hash_hmac_algos', + 'hash_hmac_file', + 'hash_hmac', + 'hash_init', + 'hash_pbkdf2', + 'hash_update_file', + 'hash_update_stream', + 'hash_update', + 'hash'), + 'IBM DB2': ('db2_autocommit', + 'db2_bind_param', + 'db2_client_info', + 'db2_close', + 'db2_column_privileges', + 'db2_columns', + 'db2_commit', + 'db2_conn_error', + 'db2_conn_errormsg', + 'db2_connect', + 'db2_cursor_type', + 'db2_escape_string', + 'db2_exec', + 'db2_execute', + 'db2_fetch_array', + 'db2_fetch_assoc', + 'db2_fetch_both', + 'db2_fetch_object', + 'db2_fetch_row', + 'db2_field_display_size', + 'db2_field_name', + 'db2_field_num', + 'db2_field_precision', + 'db2_field_scale', + 'db2_field_type', + 'db2_field_width', + 'db2_foreign_keys', + 'db2_free_result', + 'db2_free_stmt', + 'db2_get_option', + 'db2_last_insert_id', + 'db2_lob_read', + 'db2_next_result', + 'db2_num_fields', + 'db2_num_rows', + 'db2_pclose', + 'db2_pconnect', + 'db2_prepare', + 'db2_primary_keys', + 'db2_procedure_columns', + 'db2_procedures', + 'db2_result', + 'db2_rollback', + 'db2_server_info', + 'db2_set_option', + 'db2_special_columns', + 'db2_statistics', + 'db2_stmt_error', + 'db2_stmt_errormsg', + 'db2_table_privileges', + 'db2_tables'), + 'IDN': ('idn_to_ascii', 'idn_to_utf8'), + 'IMAP': ('imap_8bit', + 'imap_alerts', + 'imap_append', + 'imap_base64', + 'imap_binary', + 'imap_body', + 'imap_bodystruct', + 'imap_check', + 'imap_clearflag_full', + 'imap_close', + 'imap_create', + 'imap_createmailbox', + 'imap_delete', + 'imap_deletemailbox', + 'imap_errors', + 'imap_expunge', + 'imap_fetch_overview', + 'imap_fetchbody', + 'imap_fetchheader', + 'imap_fetchmime', + 'imap_fetchstructure', + 'imap_fetchtext', + 'imap_gc', + 'imap_get_quota', + 'imap_get_quotaroot', + 'imap_getacl', + 'imap_getmailboxes', + 'imap_getsubscribed', + 'imap_header', + 'imap_headerinfo', + 'imap_headers', + 'imap_last_error', + 'imap_list', + 'imap_listmailbox', + 'imap_listscan', + 'imap_listsubscribed', + 'imap_lsub', + 'imap_mail_compose', + 'imap_mail_copy', + 'imap_mail_move', + 'imap_mail', + 'imap_mailboxmsginfo', + 'imap_mime_header_decode', + 'imap_msgno', + 'imap_mutf7_to_utf8', + 'imap_num_msg', + 'imap_num_recent', + 'imap_open', + 'imap_ping', + 'imap_qprint', + 'imap_rename', + 'imap_renamemailbox', + 'imap_reopen', + 'imap_rfc822_parse_adrlist', + 'imap_rfc822_parse_headers', + 'imap_rfc822_write_address', + 'imap_savebody', + 'imap_scan', + 'imap_scanmailbox', + 'imap_search', + 'imap_set_quota', + 'imap_setacl', + 'imap_setflag_full', + 'imap_sort', + 'imap_status', + 'imap_subscribe', + 'imap_thread', + 'imap_timeout', + 'imap_uid', + 'imap_undelete', + 'imap_unsubscribe', + 'imap_utf7_decode', + 'imap_utf7_encode', + 'imap_utf8_to_mutf7', + 'imap_utf8'), + 'Igbinary': ('igbinary_serialize', 'igbinary_unserialize'), + 'Inotify': ('inotify_add_watch', + 'inotify_init', + 'inotify_queue_len', + 'inotify_read', + 'inotify_rm_watch'), + 'JSON': ('json_decode', + 'json_encode', + 'json_last_error_msg', + 'json_last_error'), + 'LDAP': ('ldap_8859_to_t61', + 'ldap_add_ext', + 'ldap_add', + 'ldap_bind_ext', + 'ldap_bind', + 'ldap_close', + 'ldap_compare', + 'ldap_connect', + 'ldap_control_paged_result_response', + 'ldap_control_paged_result', + 'ldap_count_entries', + 'ldap_count_references', + 'ldap_delete_ext', + 'ldap_delete', + 'ldap_dn2ufn', + 'ldap_err2str', + 'ldap_errno', + 'ldap_error', + 'ldap_escape', + 'ldap_exop_passwd', + 'ldap_exop_refresh', + 'ldap_exop_whoami', + 'ldap_exop', + 'ldap_explode_dn', + 'ldap_first_attribute', + 'ldap_first_entry', + 'ldap_first_reference', + 'ldap_free_result', + 'ldap_get_attributes', + 'ldap_get_dn', + 'ldap_get_entries', + 'ldap_get_option', + 'ldap_get_values_len', + 'ldap_get_values', + 'ldap_list', + 'ldap_mod_add_ext', + 'ldap_mod_add', + 'ldap_mod_del_ext', + 'ldap_mod_del', + 'ldap_mod_replace_ext', + 'ldap_mod_replace', + 'ldap_modify_batch', + 'ldap_modify', + 'ldap_next_attribute', + 'ldap_next_entry', + 'ldap_next_reference', + 'ldap_parse_exop', + 'ldap_parse_reference', + 'ldap_parse_result', + 'ldap_read', + 'ldap_rename_ext', + 'ldap_rename', + 'ldap_sasl_bind', + 'ldap_search', + 'ldap_set_option', + 'ldap_set_rebind_proc', + 'ldap_sort', + 'ldap_start_tls', + 'ldap_t61_to_8859', + 'ldap_unbind'), + 'LZF': ('lzf_compress', 'lzf_decompress', 'lzf_optimized_for'), + 'Mail': ('ezmlm_hash', 'mail'), + 'Mailparse': ('mailparse_determine_best_xfer_encoding', + 'mailparse_msg_create', + 'mailparse_msg_extract_part_file', + 'mailparse_msg_extract_part', + 'mailparse_msg_extract_whole_part_file', + 'mailparse_msg_free', + 'mailparse_msg_get_part_data', + 'mailparse_msg_get_part', + 'mailparse_msg_get_structure', + 'mailparse_msg_parse_file', + 'mailparse_msg_parse', + 'mailparse_rfc822_parse_addresses', + 'mailparse_stream_encode', + 'mailparse_uudecode_all'), + 'Math': ('abs', + 'acos', + 'acosh', + 'asin', + 'asinh', + 'atan2', + 'atan', + 'atanh', + 'base_convert', + 'bindec', + 'ceil', + 'cos', + 'cosh', + 'decbin', + 'dechex', + 'decoct', + 'deg2rad', + 'exp', + 'expm1', + 'fdiv', + 'floor', + 'fmod', + 'getrandmax', + 'hexdec', + 'hypot', + 'intdiv', + 'is_finite', + 'is_infinite', + 'is_nan', + 'lcg_value', + 'log10', + 'log1p', + 'log', + 'max', + 'min', + 'mt_getrandmax', + 'mt_rand', + 'mt_srand', + 'octdec', + 'pi', + 'pow', + 'rad2deg', + 'rand', + 'round', + 'sin', + 'sinh', + 'sqrt', + 'srand', + 'tan', + 'tanh'), + 'Mcrypt': ('mcrypt_create_iv', + 'mcrypt_decrypt', + 'mcrypt_enc_get_algorithms_name', + 'mcrypt_enc_get_block_size', + 'mcrypt_enc_get_iv_size', + 'mcrypt_enc_get_key_size', + 'mcrypt_enc_get_modes_name', + 'mcrypt_enc_get_supported_key_sizes', + 'mcrypt_enc_is_block_algorithm_mode', + 'mcrypt_enc_is_block_algorithm', + 'mcrypt_enc_is_block_mode', + 'mcrypt_enc_self_test', + 'mcrypt_encrypt', + 'mcrypt_generic_deinit', + 'mcrypt_generic_init', + 'mcrypt_generic', + 'mcrypt_get_block_size', + 'mcrypt_get_cipher_name', + 'mcrypt_get_iv_size', + 'mcrypt_get_key_size', + 'mcrypt_list_algorithms', + 'mcrypt_list_modes', + 'mcrypt_module_close', + 'mcrypt_module_get_algo_block_size', + 'mcrypt_module_get_algo_key_size', + 'mcrypt_module_get_supported_key_sizes', + 'mcrypt_module_is_block_algorithm_mode', + 'mcrypt_module_is_block_algorithm', + 'mcrypt_module_is_block_mode', + 'mcrypt_module_open', + 'mcrypt_module_self_test', + 'mdecrypt_generic'), + 'Memcache': ('memcache_debug',), + 'Mhash': ('mhash_count', + 'mhash_get_block_size', + 'mhash_get_hash_name', + 'mhash_keygen_s2k', + 'mhash'), + 'Misc.': ('connection_aborted', + 'connection_status', + 'constant', + 'define', + 'defined', + 'die', + 'eval', + 'exit', + 'get_browser', + '__halt_compiler', + 'highlight_file', + 'highlight_string', + 'hrtime', + 'ignore_user_abort', + 'pack', + 'php_strip_whitespace', + 'sapi_windows_cp_conv', + 'sapi_windows_cp_get', + 'sapi_windows_cp_is_utf8', + 'sapi_windows_cp_set', + 'sapi_windows_generate_ctrl_event', + 'sapi_windows_set_ctrl_handler', + 'sapi_windows_vt100_support', + 'show_source', + 'sleep', + 'sys_getloadavg', + 'time_nanosleep', + 'time_sleep_until', + 'uniqid', + 'unpack', + 'usleep'), + 'Multibyte String': ('mb_check_encoding', + 'mb_chr', + 'mb_convert_case', + 'mb_convert_encoding', + 'mb_convert_kana', + 'mb_convert_variables', + 'mb_decode_mimeheader', + 'mb_decode_numericentity', + 'mb_detect_encoding', + 'mb_detect_order', + 'mb_encode_mimeheader', + 'mb_encode_numericentity', + 'mb_encoding_aliases', + 'mb_ereg_match', + 'mb_ereg_replace_callback', + 'mb_ereg_replace', + 'mb_ereg_search_getpos', + 'mb_ereg_search_getregs', + 'mb_ereg_search_init', + 'mb_ereg_search_pos', + 'mb_ereg_search_regs', + 'mb_ereg_search_setpos', + 'mb_ereg_search', + 'mb_ereg', + 'mb_eregi_replace', + 'mb_eregi', + 'mb_get_info', + 'mb_http_input', + 'mb_http_output', + 'mb_internal_encoding', + 'mb_language', + 'mb_list_encodings', + 'mb_ord', + 'mb_output_handler', + 'mb_parse_str', + 'mb_preferred_mime_name', + 'mb_regex_encoding', + 'mb_regex_set_options', + 'mb_scrub', + 'mb_send_mail', + 'mb_split', + 'mb_str_split', + 'mb_strcut', + 'mb_strimwidth', + 'mb_stripos', + 'mb_stristr', + 'mb_strlen', + 'mb_strpos', + 'mb_strrchr', + 'mb_strrichr', + 'mb_strripos', + 'mb_strrpos', + 'mb_strstr', + 'mb_strtolower', + 'mb_strtoupper', + 'mb_strwidth', + 'mb_substitute_character', + 'mb_substr_count', + 'mb_substr'), + 'MySQL': ('mysql_affected_rows', + 'mysql_client_encoding', + 'mysql_close', + 'mysql_connect', + 'mysql_create_db', + 'mysql_data_seek', + 'mysql_db_name', + 'mysql_db_query', + 'mysql_drop_db', + 'mysql_errno', + 'mysql_error', + 'mysql_escape_string', + 'mysql_fetch_array', + 'mysql_fetch_assoc', + 'mysql_fetch_field', + 'mysql_fetch_lengths', + 'mysql_fetch_object', + 'mysql_fetch_row', + 'mysql_field_flags', + 'mysql_field_len', + 'mysql_field_name', + 'mysql_field_seek', + 'mysql_field_table', + 'mysql_field_type', + 'mysql_free_result', + 'mysql_get_client_info', + 'mysql_get_host_info', + 'mysql_get_proto_info', + 'mysql_get_server_info', + 'mysql_info', + 'mysql_insert_id', + 'mysql_list_dbs', + 'mysql_list_fields', + 'mysql_list_processes', + 'mysql_list_tables', + 'mysql_num_fields', + 'mysql_num_rows', + 'mysql_pconnect', + 'mysql_ping', + 'mysql_query', + 'mysql_real_escape_string', + 'mysql_result', + 'mysql_select_db', + 'mysql_set_charset', + 'mysql_stat', + 'mysql_tablename', + 'mysql_thread_id', + 'mysql_unbuffered_query'), + 'Mysql_xdevapi': ('expression', 'getSession'), + 'Network': ('checkdnsrr', + 'closelog', + 'dns_check_record', + 'dns_get_mx', + 'dns_get_record', + 'fsockopen', + 'gethostbyaddr', + 'gethostbyname', + 'gethostbynamel', + 'gethostname', + 'getmxrr', + 'getprotobyname', + 'getprotobynumber', + 'getservbyname', + 'getservbyport', + 'header_register_callback', + 'header_remove', + 'header', + 'headers_list', + 'headers_sent', + 'http_response_code', + 'inet_ntop', + 'inet_pton', + 'ip2long', + 'long2ip', + 'net_get_interfaces', + 'openlog', + 'pfsockopen', + 'setcookie', + 'setrawcookie', + 'socket_get_status', + 'socket_set_blocking', + 'socket_set_timeout', + 'syslog'), + 'OAuth': ('oauth_get_sbs', 'oauth_urlencode'), + 'OCI8': ('oci_bind_array_by_name', + 'oci_bind_by_name', + 'oci_cancel', + 'oci_client_version', + 'oci_close', + 'oci_commit', + 'oci_connect', + 'oci_define_by_name', + 'oci_error', + 'oci_execute', + 'oci_fetch_all', + 'oci_fetch_array', + 'oci_fetch_assoc', + 'oci_fetch_object', + 'oci_fetch_row', + 'oci_fetch', + 'oci_field_is_null', + 'oci_field_name', + 'oci_field_precision', + 'oci_field_scale', + 'oci_field_size', + 'oci_field_type_raw', + 'oci_field_type', + 'oci_free_descriptor', + 'oci_free_statement', + 'oci_get_implicit_resultset', + 'oci_lob_copy', + 'oci_lob_is_equal', + 'oci_new_collection', + 'oci_new_connect', + 'oci_new_cursor', + 'oci_new_descriptor', + 'oci_num_fields', + 'oci_num_rows', + 'oci_parse', + 'oci_password_change', + 'oci_pconnect', + 'oci_register_taf_callback', + 'oci_result', + 'oci_rollback', + 'oci_server_version', + 'oci_set_action', + 'oci_set_call_timeout', + 'oci_set_client_identifier', + 'oci_set_client_info', + 'oci_set_db_operation', + 'oci_set_edition', + 'oci_set_module_name', + 'oci_set_prefetch_lob', + 'oci_set_prefetch', + 'oci_statement_type', + 'oci_unregister_taf_callback'), + 'ODBC': ('odbc_autocommit', + 'odbc_binmode', + 'odbc_close_all', + 'odbc_close', + 'odbc_columnprivileges', + 'odbc_columns', + 'odbc_commit', + 'odbc_connect', + 'odbc_cursor', + 'odbc_data_source', + 'odbc_do', + 'odbc_error', + 'odbc_errormsg', + 'odbc_exec', + 'odbc_execute', + 'odbc_fetch_array', + 'odbc_fetch_into', + 'odbc_fetch_object', + 'odbc_fetch_row', + 'odbc_field_len', + 'odbc_field_name', + 'odbc_field_num', + 'odbc_field_precision', + 'odbc_field_scale', + 'odbc_field_type', + 'odbc_foreignkeys', + 'odbc_free_result', + 'odbc_gettypeinfo', + 'odbc_longreadlen', + 'odbc_next_result', + 'odbc_num_fields', + 'odbc_num_rows', + 'odbc_pconnect', + 'odbc_prepare', + 'odbc_primarykeys', + 'odbc_procedurecolumns', + 'odbc_procedures', + 'odbc_result_all', + 'odbc_result', + 'odbc_rollback', + 'odbc_setoption', + 'odbc_specialcolumns', + 'odbc_statistics', + 'odbc_tableprivileges', + 'odbc_tables'), + 'OPcache': ('opcache_compile_file', + 'opcache_get_configuration', + 'opcache_get_status', + 'opcache_invalidate', + 'opcache_is_script_cached', + 'opcache_reset'), + 'OpenAL': ('openal_buffer_create', + 'openal_buffer_data', + 'openal_buffer_destroy', + 'openal_buffer_get', + 'openal_buffer_loadwav', + 'openal_context_create', + 'openal_context_current', + 'openal_context_destroy', + 'openal_context_process', + 'openal_context_suspend', + 'openal_device_close', + 'openal_device_open', + 'openal_listener_get', + 'openal_listener_set', + 'openal_source_create', + 'openal_source_destroy', + 'openal_source_get', + 'openal_source_pause', + 'openal_source_play', + 'openal_source_rewind', + 'openal_source_set', + 'openal_source_stop', + 'openal_stream'), + 'OpenSSL': ('openssl_cipher_iv_length', + 'openssl_cms_decrypt', + 'openssl_cms_encrypt', + 'openssl_cms_read', + 'openssl_cms_sign', + 'openssl_cms_verify', + 'openssl_csr_export_to_file', + 'openssl_csr_export', + 'openssl_csr_get_public_key', + 'openssl_csr_get_subject', + 'openssl_csr_new', + 'openssl_csr_sign', + 'openssl_decrypt', + 'openssl_dh_compute_key', + 'openssl_digest', + 'openssl_encrypt', + 'openssl_error_string', + 'openssl_free_key', + 'openssl_get_cert_locations', + 'openssl_get_cipher_methods', + 'openssl_get_curve_names', + 'openssl_get_md_methods', + 'openssl_get_privatekey', + 'openssl_get_publickey', + 'openssl_open', + 'openssl_pbkdf2', + 'openssl_pkcs12_export_to_file', + 'openssl_pkcs12_export', + 'openssl_pkcs12_read', + 'openssl_pkcs7_decrypt', + 'openssl_pkcs7_encrypt', + 'openssl_pkcs7_read', + 'openssl_pkcs7_sign', + 'openssl_pkcs7_verify', + 'openssl_pkey_derive', + 'openssl_pkey_export_to_file', + 'openssl_pkey_export', + 'openssl_pkey_free', + 'openssl_pkey_get_details', + 'openssl_pkey_get_private', + 'openssl_pkey_get_public', + 'openssl_pkey_new', + 'openssl_private_decrypt', + 'openssl_private_encrypt', + 'openssl_public_decrypt', + 'openssl_public_encrypt', + 'openssl_random_pseudo_bytes', + 'openssl_seal', + 'openssl_sign', + 'openssl_spki_export_challenge', + 'openssl_spki_export', + 'openssl_spki_new', + 'openssl_spki_verify', + 'openssl_verify', + 'openssl_x509_check_private_key', + 'openssl_x509_checkpurpose', + 'openssl_x509_export_to_file', + 'openssl_x509_export', + 'openssl_x509_fingerprint', + 'openssl_x509_free', + 'openssl_x509_parse', + 'openssl_x509_read', + 'openssl_x509_verify'), + 'Output Control': ('flush', + 'ob_clean', + 'ob_end_clean', + 'ob_end_flush', + 'ob_flush', + 'ob_get_clean', + 'ob_get_contents', + 'ob_get_flush', + 'ob_get_length', + 'ob_get_level', + 'ob_get_status', + 'ob_gzhandler', + 'ob_implicit_flush', + 'ob_list_handlers', + 'ob_start', + 'output_add_rewrite_var', + 'output_reset_rewrite_vars'), + 'PCNTL': ('pcntl_alarm', + 'pcntl_async_signals', + 'pcntl_errno', + 'pcntl_exec', + 'pcntl_fork', + 'pcntl_get_last_error', + 'pcntl_getpriority', + 'pcntl_setpriority', + 'pcntl_signal_dispatch', + 'pcntl_signal_get_handler', + 'pcntl_signal', + 'pcntl_sigprocmask', + 'pcntl_sigtimedwait', + 'pcntl_sigwaitinfo', + 'pcntl_strerror', + 'pcntl_wait', + 'pcntl_waitpid', + 'pcntl_wexitstatus', + 'pcntl_wifexited', + 'pcntl_wifsignaled', + 'pcntl_wifstopped', + 'pcntl_wstopsig', + 'pcntl_wtermsig'), + 'PCRE': ('preg_filter', + 'preg_grep', + 'preg_last_error_msg', + 'preg_last_error', + 'preg_match_all', + 'preg_match', + 'preg_quote', + 'preg_replace_callback_array', + 'preg_replace_callback', + 'preg_replace', + 'preg_split'), + 'PHP Options/Info': ('assert_options', + 'assert', + 'cli_get_process_title', + 'cli_set_process_title', + 'dl', + 'extension_loaded', + 'gc_collect_cycles', + 'gc_disable', + 'gc_enable', + 'gc_enabled', + 'gc_mem_caches', + 'gc_status', + 'get_cfg_var', + 'get_current_user', + 'get_defined_constants', + 'get_extension_funcs', + 'get_include_path', + 'get_included_files', + 'get_loaded_extensions', + 'get_magic_quotes_gpc', + 'get_magic_quotes_runtime', + 'get_required_files', + 'get_resources', + 'getenv', + 'getlastmod', + 'getmygid', + 'getmyinode', + 'getmypid', + 'getmyuid', + 'getopt', + 'getrusage', + 'ini_alter', + 'ini_get_all', + 'ini_get', + 'ini_restore', + 'ini_set', + 'memory_get_peak_usage', + 'memory_get_usage', + 'php_ini_loaded_file', + 'php_ini_scanned_files', + 'php_sapi_name', + 'php_uname', + 'phpcredits', + 'phpinfo', + 'phpversion', + 'putenv', + 'restore_include_path', + 'set_include_path', + 'set_time_limit', + 'sys_get_temp_dir', + 'version_compare', + 'zend_thread_id', + 'zend_version'), + 'POSIX': ('posix_access', + 'posix_ctermid', + 'posix_errno', + 'posix_get_last_error', + 'posix_getcwd', + 'posix_getegid', + 'posix_geteuid', + 'posix_getgid', + 'posix_getgrgid', + 'posix_getgrnam', + 'posix_getgroups', + 'posix_getlogin', + 'posix_getpgid', + 'posix_getpgrp', + 'posix_getpid', + 'posix_getppid', + 'posix_getpwnam', + 'posix_getpwuid', + 'posix_getrlimit', + 'posix_getsid', + 'posix_getuid', + 'posix_initgroups', + 'posix_isatty', + 'posix_kill', + 'posix_mkfifo', + 'posix_mknod', + 'posix_setegid', + 'posix_seteuid', + 'posix_setgid', + 'posix_setpgid', + 'posix_setrlimit', + 'posix_setsid', + 'posix_setuid', + 'posix_strerror', + 'posix_times', + 'posix_ttyname', + 'posix_uname'), + 'PS': ('ps_add_bookmark', + 'ps_add_launchlink', + 'ps_add_locallink', + 'ps_add_note', + 'ps_add_pdflink', + 'ps_add_weblink', + 'ps_arc', + 'ps_arcn', + 'ps_begin_page', + 'ps_begin_pattern', + 'ps_begin_template', + 'ps_circle', + 'ps_clip', + 'ps_close_image', + 'ps_close', + 'ps_closepath_stroke', + 'ps_closepath', + 'ps_continue_text', + 'ps_curveto', + 'ps_delete', + 'ps_end_page', + 'ps_end_pattern', + 'ps_end_template', + 'ps_fill_stroke', + 'ps_fill', + 'ps_findfont', + 'ps_get_buffer', + 'ps_get_parameter', + 'ps_get_value', + 'ps_hyphenate', + 'ps_include_file', + 'ps_lineto', + 'ps_makespotcolor', + 'ps_moveto', + 'ps_new', + 'ps_open_file', + 'ps_open_image_file', + 'ps_open_image', + 'ps_open_memory_image', + 'ps_place_image', + 'ps_rect', + 'ps_restore', + 'ps_rotate', + 'ps_save', + 'ps_scale', + 'ps_set_border_color', + 'ps_set_border_dash', + 'ps_set_border_style', + 'ps_set_info', + 'ps_set_parameter', + 'ps_set_text_pos', + 'ps_set_value', + 'ps_setcolor', + 'ps_setdash', + 'ps_setflat', + 'ps_setfont', + 'ps_setgray', + 'ps_setlinecap', + 'ps_setlinejoin', + 'ps_setlinewidth', + 'ps_setmiterlimit', + 'ps_setoverprintmode', + 'ps_setpolydash', + 'ps_shading_pattern', + 'ps_shading', + 'ps_shfill', + 'ps_show_boxed', + 'ps_show_xy2', + 'ps_show_xy', + 'ps_show2', + 'ps_show', + 'ps_string_geometry', + 'ps_stringwidth', + 'ps_stroke', + 'ps_symbol_name', + 'ps_symbol_width', + 'ps_symbol', + 'ps_translate'), + 'Password Hashing': ('password_algos', + 'password_get_info', + 'password_hash', + 'password_needs_rehash', + 'password_verify'), + 'PostgreSQL': ('pg_affected_rows', + 'pg_cancel_query', + 'pg_client_encoding', + 'pg_close', + 'pg_connect_poll', + 'pg_connect', + 'pg_connection_busy', + 'pg_connection_reset', + 'pg_connection_status', + 'pg_consume_input', + 'pg_convert', + 'pg_copy_from', + 'pg_copy_to', + 'pg_dbname', + 'pg_delete', + 'pg_end_copy', + 'pg_escape_bytea', + 'pg_escape_identifier', + 'pg_escape_literal', + 'pg_escape_string', + 'pg_execute', + 'pg_fetch_all_columns', + 'pg_fetch_all', + 'pg_fetch_array', + 'pg_fetch_assoc', + 'pg_fetch_object', + 'pg_fetch_result', + 'pg_fetch_row', + 'pg_field_is_null', + 'pg_field_name', + 'pg_field_num', + 'pg_field_prtlen', + 'pg_field_size', + 'pg_field_table', + 'pg_field_type_oid', + 'pg_field_type', + 'pg_flush', + 'pg_free_result', + 'pg_get_notify', + 'pg_get_pid', + 'pg_get_result', + 'pg_host', + 'pg_insert', + 'pg_last_error', + 'pg_last_notice', + 'pg_last_oid', + 'pg_lo_close', + 'pg_lo_create', + 'pg_lo_export', + 'pg_lo_import', + 'pg_lo_open', + 'pg_lo_read_all', + 'pg_lo_read', + 'pg_lo_seek', + 'pg_lo_tell', + 'pg_lo_truncate', + 'pg_lo_unlink', + 'pg_lo_write', + 'pg_meta_data', + 'pg_num_fields', + 'pg_num_rows', + 'pg_options', + 'pg_parameter_status', + 'pg_pconnect', + 'pg_ping', + 'pg_port', + 'pg_prepare', + 'pg_put_line', + 'pg_query_params', + 'pg_query', + 'pg_result_error_field', + 'pg_result_error', + 'pg_result_seek', + 'pg_result_status', + 'pg_select', + 'pg_send_execute', + 'pg_send_prepare', + 'pg_send_query_params', + 'pg_send_query', + 'pg_set_client_encoding', + 'pg_set_error_verbosity', + 'pg_socket', + 'pg_trace', + 'pg_transaction_status', + 'pg_tty', + 'pg_unescape_bytea', + 'pg_untrace', + 'pg_update', + 'pg_version'), + 'Program execution': ('escapeshellarg', + 'escapeshellcmd', + 'exec', + 'passthru', + 'proc_close', + 'proc_get_status', + 'proc_nice', + 'proc_open', + 'proc_terminate', + 'shell_exec', + 'system'), + 'Pspell': ('pspell_add_to_personal', + 'pspell_add_to_session', + 'pspell_check', + 'pspell_clear_session', + 'pspell_config_create', + 'pspell_config_data_dir', + 'pspell_config_dict_dir', + 'pspell_config_ignore', + 'pspell_config_mode', + 'pspell_config_personal', + 'pspell_config_repl', + 'pspell_config_runtogether', + 'pspell_config_save_repl', + 'pspell_new_config', + 'pspell_new_personal', + 'pspell_new', + 'pspell_save_wordlist', + 'pspell_store_replacement', + 'pspell_suggest'), + 'RRD': ('rrd_create', + 'rrd_error', + 'rrd_fetch', + 'rrd_first', + 'rrd_graph', + 'rrd_info', + 'rrd_last', + 'rrd_lastupdate', + 'rrd_restore', + 'rrd_tune', + 'rrd_update', + 'rrd_version', + 'rrd_xport', + 'rrdc_disconnect'), + 'Radius': ('radius_acct_open', + 'radius_add_server', + 'radius_auth_open', + 'radius_close', + 'radius_config', + 'radius_create_request', + 'radius_cvt_addr', + 'radius_cvt_int', + 'radius_cvt_string', + 'radius_demangle_mppe_key', + 'radius_demangle', + 'radius_get_attr', + 'radius_get_tagged_attr_data', + 'radius_get_tagged_attr_tag', + 'radius_get_vendor_attr', + 'radius_put_addr', + 'radius_put_attr', + 'radius_put_int', + 'radius_put_string', + 'radius_put_vendor_addr', + 'radius_put_vendor_attr', + 'radius_put_vendor_int', + 'radius_put_vendor_string', + 'radius_request_authenticator', + 'radius_salt_encrypt_attr', + 'radius_send_request', + 'radius_server_secret', + 'radius_strerror'), + 'Rar': ('rar_wrapper_cache_stats',), + 'Readline': ('readline_add_history', + 'readline_callback_handler_install', + 'readline_callback_handler_remove', + 'readline_callback_read_char', + 'readline_clear_history', + 'readline_completion_function', + 'readline_info', + 'readline_list_history', + 'readline_on_new_line', + 'readline_read_history', + 'readline_redisplay', + 'readline_write_history', + 'readline'), + 'Recode': ('recode_file', 'recode_string', 'recode'), + 'RpmInfo': ('rpmaddtag', 'rpmdbinfo', 'rpmdbsearch', 'rpminfo', 'rpmvercmp'), + 'SNMP': ('snmp_get_quick_print', + 'snmp_get_valueretrieval', + 'snmp_read_mib', + 'snmp_set_enum_print', + 'snmp_set_oid_numeric_print', + 'snmp_set_oid_output_format', + 'snmp_set_quick_print', + 'snmp_set_valueretrieval', + 'snmp2_get', + 'snmp2_getnext', + 'snmp2_real_walk', + 'snmp2_set', + 'snmp2_walk', + 'snmp3_get', + 'snmp3_getnext', + 'snmp3_real_walk', + 'snmp3_set', + 'snmp3_walk', + 'snmpget', + 'snmpgetnext', + 'snmprealwalk', + 'snmpset', + 'snmpwalk', + 'snmpwalkoid'), + 'SOAP': ('is_soap_fault', 'use_soap_error_handler'), + 'SPL': ('class_implements', + 'class_parents', + 'class_uses', + 'iterator_apply', + 'iterator_count', + 'iterator_to_array', + 'spl_autoload_call', + 'spl_autoload_extensions', + 'spl_autoload_functions', + 'spl_autoload_register', + 'spl_autoload_unregister', + 'spl_autoload', + 'spl_classes', + 'spl_object_hash', + 'spl_object_id'), + 'SQLSRV': ('sqlsrv_begin_transaction', + 'sqlsrv_cancel', + 'sqlsrv_client_info', + 'sqlsrv_close', + 'sqlsrv_commit', + 'sqlsrv_configure', + 'sqlsrv_connect', + 'sqlsrv_errors', + 'sqlsrv_execute', + 'sqlsrv_fetch_array', + 'sqlsrv_fetch_object', + 'sqlsrv_fetch', + 'sqlsrv_field_metadata', + 'sqlsrv_free_stmt', + 'sqlsrv_get_config', + 'sqlsrv_get_field', + 'sqlsrv_has_rows', + 'sqlsrv_next_result', + 'sqlsrv_num_fields', + 'sqlsrv_num_rows', + 'sqlsrv_prepare', + 'sqlsrv_query', + 'sqlsrv_rollback', + 'sqlsrv_rows_affected', + 'sqlsrv_send_stream_data', + 'sqlsrv_server_info'), + 'SSH2': ('ssh2_auth_agent', + 'ssh2_auth_hostbased_file', + 'ssh2_auth_none', + 'ssh2_auth_password', + 'ssh2_auth_pubkey_file', + 'ssh2_connect', + 'ssh2_disconnect', + 'ssh2_exec', + 'ssh2_fetch_stream', + 'ssh2_fingerprint', + 'ssh2_forward_accept', + 'ssh2_forward_listen', + 'ssh2_methods_negotiated', + 'ssh2_poll', + 'ssh2_publickey_add', + 'ssh2_publickey_init', + 'ssh2_publickey_list', + 'ssh2_publickey_remove', + 'ssh2_scp_recv', + 'ssh2_scp_send', + 'ssh2_send_eof', + 'ssh2_sftp_chmod', + 'ssh2_sftp_lstat', + 'ssh2_sftp_mkdir', + 'ssh2_sftp_readlink', + 'ssh2_sftp_realpath', + 'ssh2_sftp_rename', + 'ssh2_sftp_rmdir', + 'ssh2_sftp_stat', + 'ssh2_sftp_symlink', + 'ssh2_sftp_unlink', + 'ssh2_sftp', + 'ssh2_shell', + 'ssh2_tunnel'), + 'SVN': ('svn_add', + 'svn_auth_get_parameter', + 'svn_auth_set_parameter', + 'svn_blame', + 'svn_cat', + 'svn_checkout', + 'svn_cleanup', + 'svn_client_version', + 'svn_commit', + 'svn_delete', + 'svn_diff', + 'svn_export', + 'svn_fs_abort_txn', + 'svn_fs_apply_text', + 'svn_fs_begin_txn2', + 'svn_fs_change_node_prop', + 'svn_fs_check_path', + 'svn_fs_contents_changed', + 'svn_fs_copy', + 'svn_fs_delete', + 'svn_fs_dir_entries', + 'svn_fs_file_contents', + 'svn_fs_file_length', + 'svn_fs_is_dir', + 'svn_fs_is_file', + 'svn_fs_make_dir', + 'svn_fs_make_file', + 'svn_fs_node_created_rev', + 'svn_fs_node_prop', + 'svn_fs_props_changed', + 'svn_fs_revision_prop', + 'svn_fs_revision_root', + 'svn_fs_txn_root', + 'svn_fs_youngest_rev', + 'svn_import', + 'svn_log', + 'svn_ls', + 'svn_mkdir', + 'svn_repos_create', + 'svn_repos_fs_begin_txn_for_commit', + 'svn_repos_fs_commit_txn', + 'svn_repos_fs', + 'svn_repos_hotcopy', + 'svn_repos_open', + 'svn_repos_recover', + 'svn_revert', + 'svn_status', + 'svn_update'), + 'Scoutapm': ('scoutapm_get_calls', 'scoutapm_list_instrumented_functions'), + 'Seaslog': ('seaslog_get_author', 'seaslog_get_version'), + 'Semaphore': ('ftok', + 'msg_get_queue', + 'msg_queue_exists', + 'msg_receive', + 'msg_remove_queue', + 'msg_send', + 'msg_set_queue', + 'msg_stat_queue', + 'sem_acquire', + 'sem_get', + 'sem_release', + 'sem_remove', + 'shm_attach', + 'shm_detach', + 'shm_get_var', + 'shm_has_var', + 'shm_put_var', + 'shm_remove_var', + 'shm_remove'), + 'Session': ('session_abort', + 'session_cache_expire', + 'session_cache_limiter', + 'session_commit', + 'session_create_id', + 'session_decode', + 'session_destroy', + 'session_encode', + 'session_gc', + 'session_get_cookie_params', + 'session_id', + 'session_module_name', + 'session_name', + 'session_regenerate_id', + 'session_register_shutdown', + 'session_reset', + 'session_save_path', + 'session_set_cookie_params', + 'session_set_save_handler', + 'session_start', + 'session_status', + 'session_unset', + 'session_write_close'), + 'Shared Memory': ('shmop_close', + 'shmop_delete', + 'shmop_open', + 'shmop_read', + 'shmop_size', + 'shmop_write'), + 'SimpleXML': ('simplexml_import_dom', + 'simplexml_load_file', + 'simplexml_load_string'), + 'Socket': ('socket_accept', + 'socket_addrinfo_bind', + 'socket_addrinfo_connect', + 'socket_addrinfo_explain', + 'socket_addrinfo_lookup', + 'socket_bind', + 'socket_clear_error', + 'socket_close', + 'socket_cmsg_space', + 'socket_connect', + 'socket_create_listen', + 'socket_create_pair', + 'socket_create', + 'socket_export_stream', + 'socket_get_option', + 'socket_getopt', + 'socket_getpeername', + 'socket_getsockname', + 'socket_import_stream', + 'socket_last_error', + 'socket_listen', + 'socket_read', + 'socket_recv', + 'socket_recvfrom', + 'socket_recvmsg', + 'socket_select', + 'socket_send', + 'socket_sendmsg', + 'socket_sendto', + 'socket_set_block', + 'socket_set_nonblock', + 'socket_set_option', + 'socket_setopt', + 'socket_shutdown', + 'socket_strerror', + 'socket_write', + 'socket_wsaprotocol_info_export', + 'socket_wsaprotocol_info_import', + 'socket_wsaprotocol_info_release'), + 'Sodium': ('sodium_add', + 'sodium_base642bin', + 'sodium_bin2base64', + 'sodium_bin2hex', + 'sodium_compare', + 'sodium_crypto_aead_aes256gcm_decrypt', + 'sodium_crypto_aead_aes256gcm_encrypt', + 'sodium_crypto_aead_aes256gcm_is_available', + 'sodium_crypto_aead_aes256gcm_keygen', + 'sodium_crypto_aead_chacha20poly1305_decrypt', + 'sodium_crypto_aead_chacha20poly1305_encrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_encrypt', + 'sodium_crypto_aead_chacha20poly1305_ietf_keygen', + 'sodium_crypto_aead_chacha20poly1305_keygen', + 'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt', + 'sodium_crypto_aead_xchacha20poly1305_ietf_keygen', + 'sodium_crypto_auth_keygen', + 'sodium_crypto_auth_verify', + 'sodium_crypto_auth', + 'sodium_crypto_box_keypair_from_secretkey_and_publickey', + 'sodium_crypto_box_keypair', + 'sodium_crypto_box_open', + 'sodium_crypto_box_publickey_from_secretkey', + 'sodium_crypto_box_publickey', + 'sodium_crypto_box_seal_open', + 'sodium_crypto_box_seal', + 'sodium_crypto_box_secretkey', + 'sodium_crypto_box_seed_keypair', + 'sodium_crypto_box', + 'sodium_crypto_generichash_final', + 'sodium_crypto_generichash_init', + 'sodium_crypto_generichash_keygen', + 'sodium_crypto_generichash_update', + 'sodium_crypto_generichash', + 'sodium_crypto_kdf_derive_from_key', + 'sodium_crypto_kdf_keygen', + 'sodium_crypto_kx_client_session_keys', + 'sodium_crypto_kx_keypair', + 'sodium_crypto_kx_publickey', + 'sodium_crypto_kx_secretkey', + 'sodium_crypto_kx_seed_keypair', + 'sodium_crypto_kx_server_session_keys', + 'sodium_crypto_pwhash_scryptsalsa208sha256_str_verify', + 'sodium_crypto_pwhash_scryptsalsa208sha256_str', + 'sodium_crypto_pwhash_scryptsalsa208sha256', + 'sodium_crypto_pwhash_str_needs_rehash', + 'sodium_crypto_pwhash_str_verify', + 'sodium_crypto_pwhash_str', + 'sodium_crypto_pwhash', + 'sodium_crypto_scalarmult_base', + 'sodium_crypto_scalarmult', + 'sodium_crypto_secretbox_keygen', + 'sodium_crypto_secretbox_open', + 'sodium_crypto_secretbox', + 'sodium_crypto_secretstream_xchacha20poly1305_init_pull', + 'sodium_crypto_secretstream_xchacha20poly1305_init_push', + 'sodium_crypto_secretstream_xchacha20poly1305_keygen', + 'sodium_crypto_secretstream_xchacha20poly1305_pull', + 'sodium_crypto_secretstream_xchacha20poly1305_push', + 'sodium_crypto_secretstream_xchacha20poly1305_rekey', + 'sodium_crypto_shorthash_keygen', + 'sodium_crypto_shorthash', + 'sodium_crypto_sign_detached', + 'sodium_crypto_sign_ed25519_pk_to_curve25519', + 'sodium_crypto_sign_ed25519_sk_to_curve25519', + 'sodium_crypto_sign_keypair_from_secretkey_and_publickey', + 'sodium_crypto_sign_keypair', + 'sodium_crypto_sign_open', + 'sodium_crypto_sign_publickey_from_secretkey', + 'sodium_crypto_sign_publickey', + 'sodium_crypto_sign_secretkey', + 'sodium_crypto_sign_seed_keypair', + 'sodium_crypto_sign_verify_detached', + 'sodium_crypto_sign', + 'sodium_crypto_stream_keygen', + 'sodium_crypto_stream_xor', + 'sodium_crypto_stream', + 'sodium_hex2bin', + 'sodium_increment', + 'sodium_memcmp', + 'sodium_memzero', + 'sodium_pad', + 'sodium_unpad'), + 'Solr': ('solr_get_version',), + 'Stomp': ('stomp_connect_error', 'stomp_version'), + 'Stream': ('stream_bucket_append', + 'stream_bucket_make_writeable', + 'stream_bucket_new', + 'stream_bucket_prepend', + 'stream_context_create', + 'stream_context_get_default', + 'stream_context_get_options', + 'stream_context_get_params', + 'stream_context_set_default', + 'stream_context_set_option', + 'stream_context_set_params', + 'stream_copy_to_stream', + 'stream_filter_append', + 'stream_filter_prepend', + 'stream_filter_register', + 'stream_filter_remove', + 'stream_get_contents', + 'stream_get_filters', + 'stream_get_line', + 'stream_get_meta_data', + 'stream_get_transports', + 'stream_get_wrappers', + 'stream_is_local', + 'stream_isatty', + 'stream_notification_callback', + 'stream_register_wrapper', + 'stream_resolve_include_path', + 'stream_select', + 'stream_set_blocking', + 'stream_set_chunk_size', + 'stream_set_read_buffer', + 'stream_set_timeout', + 'stream_set_write_buffer', + 'stream_socket_accept', + 'stream_socket_client', + 'stream_socket_enable_crypto', + 'stream_socket_get_name', + 'stream_socket_pair', + 'stream_socket_recvfrom', + 'stream_socket_sendto', + 'stream_socket_server', + 'stream_socket_shutdown', + 'stream_supports_lock', + 'stream_wrapper_register', + 'stream_wrapper_restore', + 'stream_wrapper_unregister'), + 'String': ('addcslashes', + 'addslashes', + 'bin2hex', + 'chop', + 'chr', + 'chunk_split', + 'convert_cyr_string', + 'convert_uudecode', + 'convert_uuencode', + 'count_chars', + 'crc32', + 'crypt', + 'echo', + 'explode', + 'fprintf', + 'get_html_translation_table', + 'hebrev', + 'hebrevc', + 'hex2bin', + 'html_entity_decode', + 'htmlentities', + 'htmlspecialchars_decode', + 'htmlspecialchars', + 'implode', + 'join', + 'lcfirst', + 'levenshtein', + 'localeconv', + 'ltrim', + 'md5_file', + 'md5', + 'metaphone', + 'money_format', + 'nl_langinfo', + 'nl2br', + 'number_format', + 'ord', + 'parse_str', + 'print', + 'printf', + 'quoted_printable_decode', + 'quoted_printable_encode', + 'quotemeta', + 'rtrim', + 'setlocale', + 'sha1_file', + 'sha1', + 'similar_text', + 'soundex', + 'sprintf', + 'sscanf', + 'str_contains', + 'str_ends_with', + 'str_getcsv', + 'str_ireplace', + 'str_pad', + 'str_repeat', + 'str_replace', + 'str_rot13', + 'str_shuffle', + 'str_split', + 'str_starts_with', + 'str_word_count', + 'strcasecmp', + 'strchr', + 'strcmp', + 'strcoll', + 'strcspn', + 'strip_tags', + 'stripcslashes', + 'stripos', + 'stripslashes', + 'stristr', + 'strlen', + 'strnatcasecmp', + 'strnatcmp', + 'strncasecmp', + 'strncmp', + 'strpbrk', + 'strpos', + 'strrchr', + 'strrev', + 'strripos', + 'strrpos', + 'strspn', + 'strstr', + 'strtok', + 'strtolower', + 'strtoupper', + 'strtr', + 'substr_compare', + 'substr_count', + 'substr_replace', + 'substr', + 'trim', + 'ucfirst', + 'ucwords', + 'vfprintf', + 'vprintf', + 'vsprintf', + 'wordwrap'), + 'Swoole': ('swoole_async_dns_lookup', + 'swoole_async_read', + 'swoole_async_readfile', + 'swoole_async_set', + 'swoole_async_write', + 'swoole_async_writefile', + 'swoole_clear_error', + 'swoole_client_select', + 'swoole_cpu_num', + 'swoole_errno', + 'swoole_error_log', + 'swoole_event_add', + 'swoole_event_defer', + 'swoole_event_del', + 'swoole_event_exit', + 'swoole_event_set', + 'swoole_event_wait', + 'swoole_event_write', + 'swoole_get_local_ip', + 'swoole_last_error', + 'swoole_load_module', + 'swoole_select', + 'swoole_set_process_name', + 'swoole_strerror', + 'swoole_timer_after', + 'swoole_timer_exists', + 'swoole_timer_tick', + 'swoole_version'), + 'TCP': ('tcpwrap_check',), + 'Taint': ('is_tainted', 'taint', 'untaint'), + 'Tidy': ('ob_tidyhandler', + 'tidy_access_count', + 'tidy_config_count', + 'tidy_error_count', + 'tidy_get_output', + 'tidy_warning_count'), + 'Tokenizer': ('token_get_all', 'token_name'), + 'Trader': ('trader_acos', + 'trader_ad', + 'trader_add', + 'trader_adosc', + 'trader_adx', + 'trader_adxr', + 'trader_apo', + 'trader_aroon', + 'trader_aroonosc', + 'trader_asin', + 'trader_atan', + 'trader_atr', + 'trader_avgprice', + 'trader_bbands', + 'trader_beta', + 'trader_bop', + 'trader_cci', + 'trader_cdl2crows', + 'trader_cdl3blackcrows', + 'trader_cdl3inside', + 'trader_cdl3linestrike', + 'trader_cdl3outside', + 'trader_cdl3starsinsouth', + 'trader_cdl3whitesoldiers', + 'trader_cdlabandonedbaby', + 'trader_cdladvanceblock', + 'trader_cdlbelthold', + 'trader_cdlbreakaway', + 'trader_cdlclosingmarubozu', + 'trader_cdlconcealbabyswall', + 'trader_cdlcounterattack', + 'trader_cdldarkcloudcover', + 'trader_cdldoji', + 'trader_cdldojistar', + 'trader_cdldragonflydoji', + 'trader_cdlengulfing', + 'trader_cdleveningdojistar', + 'trader_cdleveningstar', + 'trader_cdlgapsidesidewhite', + 'trader_cdlgravestonedoji', + 'trader_cdlhammer', + 'trader_cdlhangingman', + 'trader_cdlharami', + 'trader_cdlharamicross', + 'trader_cdlhighwave', + 'trader_cdlhikkake', + 'trader_cdlhikkakemod', + 'trader_cdlhomingpigeon', + 'trader_cdlidentical3crows', + 'trader_cdlinneck', + 'trader_cdlinvertedhammer', + 'trader_cdlkicking', + 'trader_cdlkickingbylength', + 'trader_cdlladderbottom', + 'trader_cdllongleggeddoji', + 'trader_cdllongline', + 'trader_cdlmarubozu', + 'trader_cdlmatchinglow', + 'trader_cdlmathold', + 'trader_cdlmorningdojistar', + 'trader_cdlmorningstar', + 'trader_cdlonneck', + 'trader_cdlpiercing', + 'trader_cdlrickshawman', + 'trader_cdlrisefall3methods', + 'trader_cdlseparatinglines', + 'trader_cdlshootingstar', + 'trader_cdlshortline', + 'trader_cdlspinningtop', + 'trader_cdlstalledpattern', + 'trader_cdlsticksandwich', + 'trader_cdltakuri', + 'trader_cdltasukigap', + 'trader_cdlthrusting', + 'trader_cdltristar', + 'trader_cdlunique3river', + 'trader_cdlupsidegap2crows', + 'trader_cdlxsidegap3methods', + 'trader_ceil', + 'trader_cmo', + 'trader_correl', + 'trader_cos', + 'trader_cosh', + 'trader_dema', + 'trader_div', + 'trader_dx', + 'trader_ema', + 'trader_errno', + 'trader_exp', + 'trader_floor', + 'trader_get_compat', + 'trader_get_unstable_period', + 'trader_ht_dcperiod', + 'trader_ht_dcphase', + 'trader_ht_phasor', + 'trader_ht_sine', + 'trader_ht_trendline', + 'trader_ht_trendmode', + 'trader_kama', + 'trader_linearreg_angle', + 'trader_linearreg_intercept', + 'trader_linearreg_slope', + 'trader_linearreg', + 'trader_ln', + 'trader_log10', + 'trader_ma', + 'trader_macd', + 'trader_macdext', + 'trader_macdfix', + 'trader_mama', + 'trader_mavp', + 'trader_max', + 'trader_maxindex', + 'trader_medprice', + 'trader_mfi', + 'trader_midpoint', + 'trader_midprice', + 'trader_min', + 'trader_minindex', + 'trader_minmax', + 'trader_minmaxindex', + 'trader_minus_di', + 'trader_minus_dm', + 'trader_mom', + 'trader_mult', + 'trader_natr', + 'trader_obv', + 'trader_plus_di', + 'trader_plus_dm', + 'trader_ppo', + 'trader_roc', + 'trader_rocp', + 'trader_rocr100', + 'trader_rocr', + 'trader_rsi', + 'trader_sar', + 'trader_sarext', + 'trader_set_compat', + 'trader_set_unstable_period', + 'trader_sin', + 'trader_sinh', + 'trader_sma', + 'trader_sqrt', + 'trader_stddev', + 'trader_stoch', + 'trader_stochf', + 'trader_stochrsi', + 'trader_sub', + 'trader_sum', + 'trader_t3', + 'trader_tan', + 'trader_tanh', + 'trader_tema', + 'trader_trange', + 'trader_trima', + 'trader_trix', + 'trader_tsf', + 'trader_typprice', + 'trader_ultosc', + 'trader_var', + 'trader_wclprice', + 'trader_willr', + 'trader_wma'), + 'URL': ('base64_decode', + 'base64_encode', + 'get_headers', + 'get_meta_tags', + 'http_build_query', + 'parse_url', + 'rawurldecode', + 'rawurlencode', + 'urldecode', + 'urlencode'), + 'Uopz': ('uopz_add_function', + 'uopz_allow_exit', + 'uopz_backup', + 'uopz_compose', + 'uopz_copy', + 'uopz_del_function', + 'uopz_delete', + 'uopz_extend', + 'uopz_flags', + 'uopz_function', + 'uopz_get_exit_status', + 'uopz_get_hook', + 'uopz_get_mock', + 'uopz_get_property', + 'uopz_get_return', + 'uopz_get_static', + 'uopz_implement', + 'uopz_overload', + 'uopz_redefine', + 'uopz_rename', + 'uopz_restore', + 'uopz_set_hook', + 'uopz_set_mock', + 'uopz_set_property', + 'uopz_set_return', + 'uopz_set_static', + 'uopz_undefine', + 'uopz_unset_hook', + 'uopz_unset_mock', + 'uopz_unset_return'), + 'Variable handling': ('boolval', + 'debug_zval_dump', + 'doubleval', + 'empty', + 'floatval', + 'get_debug_type', + 'get_defined_vars', + 'get_resource_id', + 'get_resource_type', + 'gettype', + 'intval', + 'is_array', + 'is_bool', + 'is_callable', + 'is_countable', + 'is_double', + 'is_float', + 'is_int', + 'is_integer', + 'is_iterable', + 'is_long', + 'is_null', + 'is_numeric', + 'is_object', + 'is_real', + 'is_resource', + 'is_scalar', + 'is_string', + 'isset', + 'print_r', + 'serialize', + 'settype', + 'strval', + 'unserialize', + 'unset', + 'var_dump', + 'var_export'), + 'WDDX': ('wddx_add_vars', + 'wddx_deserialize', + 'wddx_packet_end', + 'wddx_packet_start', + 'wddx_serialize_value', + 'wddx_serialize_vars'), + 'WinCache': ('wincache_fcache_fileinfo', + 'wincache_fcache_meminfo', + 'wincache_lock', + 'wincache_ocache_fileinfo', + 'wincache_ocache_meminfo', + 'wincache_refresh_if_changed', + 'wincache_rplist_fileinfo', + 'wincache_rplist_meminfo', + 'wincache_scache_info', + 'wincache_scache_meminfo', + 'wincache_ucache_add', + 'wincache_ucache_cas', + 'wincache_ucache_clear', + 'wincache_ucache_dec', + 'wincache_ucache_delete', + 'wincache_ucache_exists', + 'wincache_ucache_get', + 'wincache_ucache_inc', + 'wincache_ucache_info', + 'wincache_ucache_meminfo', + 'wincache_ucache_set', + 'wincache_unlock'), + 'XML Parser': ('utf8_decode', + 'utf8_encode', + 'xml_error_string', + 'xml_get_current_byte_index', + 'xml_get_current_column_number', + 'xml_get_current_line_number', + 'xml_get_error_code', + 'xml_parse_into_struct', + 'xml_parse', + 'xml_parser_create_ns', + 'xml_parser_create', + 'xml_parser_free', + 'xml_parser_get_option', + 'xml_parser_set_option', + 'xml_set_character_data_handler', + 'xml_set_default_handler', + 'xml_set_element_handler', + 'xml_set_end_namespace_decl_handler', + 'xml_set_external_entity_ref_handler', + 'xml_set_notation_decl_handler', + 'xml_set_object', + 'xml_set_processing_instruction_handler', + 'xml_set_start_namespace_decl_handler', + 'xml_set_unparsed_entity_decl_handler'), + 'XML-RPC': ('xmlrpc_decode_request', + 'xmlrpc_decode', + 'xmlrpc_encode_request', + 'xmlrpc_encode', + 'xmlrpc_get_type', + 'xmlrpc_is_fault', + 'xmlrpc_parse_method_descriptions', + 'xmlrpc_server_add_introspection_data', + 'xmlrpc_server_call_method', + 'xmlrpc_server_create', + 'xmlrpc_server_destroy', + 'xmlrpc_server_register_introspection_callback', + 'xmlrpc_server_register_method', + 'xmlrpc_set_type'), + 'Xhprof': ('xhprof_disable', + 'xhprof_enable', + 'xhprof_sample_disable', + 'xhprof_sample_enable'), + 'YAZ': ('yaz_addinfo', + 'yaz_ccl_conf', + 'yaz_ccl_parse', + 'yaz_close', + 'yaz_connect', + 'yaz_database', + 'yaz_element', + 'yaz_errno', + 'yaz_error', + 'yaz_es_result', + 'yaz_es', + 'yaz_get_option', + 'yaz_hits', + 'yaz_itemorder', + 'yaz_present', + 'yaz_range', + 'yaz_record', + 'yaz_scan_result', + 'yaz_scan', + 'yaz_schema', + 'yaz_search', + 'yaz_set_option', + 'yaz_sort', + 'yaz_syntax', + 'yaz_wait'), + 'Yaml': ('yaml_emit_file', + 'yaml_emit', + 'yaml_parse_file', + 'yaml_parse_url', + 'yaml_parse'), + 'Zip': ('zip_close', + 'zip_entry_close', + 'zip_entry_compressedsize', + 'zip_entry_compressionmethod', + 'zip_entry_filesize', + 'zip_entry_name', + 'zip_entry_open', + 'zip_entry_read', + 'zip_open', + 'zip_read'), + 'Zlib': ('deflate_add', + 'deflate_init', + 'gzclose', + 'gzcompress', + 'gzdecode', + 'gzdeflate', + 'gzencode', + 'gzeof', + 'gzfile', + 'gzgetc', + 'gzgets', + 'gzgetss', + 'gzinflate', + 'gzopen', + 'gzpassthru', + 'gzputs', + 'gzread', + 'gzrewind', + 'gzseek', + 'gztell', + 'gzuncompress', + 'gzwrite', + 'inflate_add', + 'inflate_get_read_len', + 'inflate_get_status', + 'inflate_init', + 'readgzfile', + 'zlib_decode', + 'zlib_encode', + 'zlib_get_coding_type'), + 'ZooKeeper': ('zookeeper_dispatch',), + 'cURL': ('curl_close', + 'curl_copy_handle', + 'curl_errno', + 'curl_error', + 'curl_escape', + 'curl_exec', + 'curl_file_create', + 'curl_getinfo', + 'curl_init', + 'curl_multi_add_handle', + 'curl_multi_close', + 'curl_multi_errno', + 'curl_multi_exec', + 'curl_multi_getcontent', + 'curl_multi_info_read', + 'curl_multi_init', + 'curl_multi_remove_handle', + 'curl_multi_select', + 'curl_multi_setopt', + 'curl_multi_strerror', + 'curl_pause', + 'curl_reset', + 'curl_setopt_array', + 'curl_setopt', + 'curl_share_close', + 'curl_share_errno', + 'curl_share_init', + 'curl_share_setopt', + 'curl_share_strerror', + 'curl_strerror', + 'curl_unescape', + 'curl_version'), + 'dBase': ('dbase_add_record', + 'dbase_close', + 'dbase_create', + 'dbase_delete_record', + 'dbase_get_header_info', + 'dbase_get_record_with_names', + 'dbase_get_record', + 'dbase_numfields', + 'dbase_numrecords', + 'dbase_open', + 'dbase_pack', + 'dbase_replace_record'), + 'iconv': ('iconv_get_encoding', + 'iconv_mime_decode_headers', + 'iconv_mime_decode', + 'iconv_mime_encode', + 'iconv_set_encoding', + 'iconv_strlen', + 'iconv_strpos', + 'iconv_strrpos', + 'iconv_substr', + 'iconv', + 'ob_iconv_handler'), + 'intl': ('intl_error_name', + 'intl_get_error_code', + 'intl_get_error_message', + 'intl_is_failure'), + 'libxml': ('libxml_clear_errors', + 'libxml_disable_entity_loader', + 'libxml_get_errors', + 'libxml_get_last_error', + 'libxml_set_external_entity_loader', + 'libxml_set_streams_context', + 'libxml_use_internal_errors'), + 'mqseries': ('mqseries_back', + 'mqseries_begin', + 'mqseries_close', + 'mqseries_cmit', + 'mqseries_conn', + 'mqseries_connx', + 'mqseries_disc', + 'mqseries_get', + 'mqseries_inq', + 'mqseries_open', + 'mqseries_put1', + 'mqseries_put', + 'mqseries_set', + 'mqseries_strerror'), + 'phpdbg': ('phpdbg_break_file', + 'phpdbg_break_function', + 'phpdbg_break_method', + 'phpdbg_break_next', + 'phpdbg_clear', + 'phpdbg_color', + 'phpdbg_end_oplog', + 'phpdbg_exec', + 'phpdbg_get_executable', + 'phpdbg_prompt', + 'phpdbg_start_oplog'), + 'runkit7': ('runkit7_constant_add', + 'runkit7_constant_redefine', + 'runkit7_constant_remove', + 'runkit7_function_add', + 'runkit7_function_copy', + 'runkit7_function_redefine', + 'runkit7_function_remove', + 'runkit7_function_rename', + 'runkit7_import', + 'runkit7_method_add', + 'runkit7_method_copy', + 'runkit7_method_redefine', + 'runkit7_method_remove', + 'runkit7_method_rename', + 'runkit7_object_id', + 'runkit7_superglobals', + 'runkit7_zval_inspect'), + 'ssdeep': ('ssdeep_fuzzy_compare', + 'ssdeep_fuzzy_hash_filename', + 'ssdeep_fuzzy_hash'), + 'var_representation': ('var_representation',), + 'win32service': ('win32_continue_service', + 'win32_create_service', + 'win32_delete_service', + 'win32_get_last_control_message', + 'win32_pause_service', + 'win32_query_service_status', + 'win32_send_custom_control', + 'win32_set_service_exit_code', + 'win32_set_service_exit_mode', + 'win32_set_service_status', + 'win32_start_service_ctrl_dispatcher', + 'win32_start_service', + 'win32_stop_service'), + 'xattr': ('xattr_get', + 'xattr_list', + 'xattr_remove', + 'xattr_set', + 'xattr_supported'), + 'xdiff': ('xdiff_file_bdiff_size', + 'xdiff_file_bdiff', + 'xdiff_file_bpatch', + 'xdiff_file_diff_binary', + 'xdiff_file_diff', + 'xdiff_file_merge3', + 'xdiff_file_patch_binary', + 'xdiff_file_patch', + 'xdiff_file_rabdiff', + 'xdiff_string_bdiff_size', + 'xdiff_string_bdiff', + 'xdiff_string_bpatch', + 'xdiff_string_diff_binary', + 'xdiff_string_diff', + 'xdiff_string_merge3', + 'xdiff_string_patch_binary', + 'xdiff_string_patch', + 'xdiff_string_rabdiff')} + +if __name__ == '__main__': # pragma: no cover + import glob + import os + import pprint + import re + import shutil + import tarfile + from urllib.request import urlretrieve + + PHP_MANUAL_URL = 'http://us3.php.net/distributions/manual/php_manual_en.tar.gz' + PHP_MANUAL_DIR = './php-chunked-xhtml/' + PHP_REFERENCE_GLOB = 'ref.*' + PHP_FUNCTION_RE = r'(.*?)' + PHP_MODULE_RE = '(.*?) Functions' + + def get_php_functions(): + function_re = re.compile(PHP_FUNCTION_RE) + module_re = re.compile(PHP_MODULE_RE) + modules = {} + + for file in get_php_references(): + module = '' + with open(file, encoding='utf-8') as f: + for line in f: + if not module: + search = module_re.search(line) + if search: + module = search.group(1) + modules[module] = [] + + elif 'href="function.' in line: + for match in function_re.finditer(line): + fn = match.group(1) + if '»' not in fn and '«' not in fn and \ + '::' not in fn and '\\' not in fn and \ + fn not in modules[module]: + modules[module].append(fn) + + if module: + # These are dummy manual pages, not actual functions + if module == 'Filesystem': + modules[module].remove('delete') + + if not modules[module]: + del modules[module] + + for key in modules: + modules[key] = tuple(modules[key]) + return modules + + def get_php_references(): + download = urlretrieve(PHP_MANUAL_URL) + with tarfile.open(download[0]) as tar: + tar.extractall() + yield from glob.glob("%s%s" % (PHP_MANUAL_DIR, PHP_REFERENCE_GLOB)) + os.remove(download[0]) + + def regenerate(filename, modules): + with open(filename, encoding='utf-8') as fp: + content = fp.read() + + header = content[:content.find('MODULES = {')] + footer = content[content.find("if __name__ == '__main__':"):] + + with open(filename, 'w', encoding='utf-8') as fp: + fp.write(header) + fp.write('MODULES = %s\n\n' % pprint.pformat(modules)) + fp.write(footer) + + def run(): + print('>> Downloading Function Index') + modules = get_php_functions() + total = sum(len(v) for v in modules.values()) + print('%d functions found' % total) + regenerate(__file__, modules) + shutil.rmtree(PHP_MANUAL_DIR) + + run() diff --git a/shared/package-files/9e/9ed17c430b2e86cab241dc4c07a1fb3183fba3c03bc52c477b450c4d92ca48af/blob b/shared/package-files/9e/9ed17c430b2e86cab241dc4c07a1fb3183fba3c03bc52c477b450c4d92ca48af/blob new file mode 100644 index 0000000000000000000000000000000000000000..e35b0b5f0a547eecc87f908e15aef4f5600cf90d --- /dev/null +++ b/shared/package-files/9e/9ed17c430b2e86cab241dc4c07a1fb3183fba3c03bc52c477b450c4d92ca48af/blob @@ -0,0 +1,26 @@ +""" + pygments.lexers.text + ~~~~~~~~~~~~~~~~~~~~ + + Lexers for non-source code file types. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexers.configs import ApacheConfLexer, NginxConfLexer, \ + SquidConfLexer, LighttpdConfLexer, IniLexer, RegeditLexer, PropertiesLexer, \ + UnixConfigLexer +from pygments.lexers.console import PyPyLogLexer +from pygments.lexers.textedit import VimLexer +from pygments.lexers.markup import BBCodeLexer, MoinWikiLexer, RstLexer, \ + TexLexer, GroffLexer +from pygments.lexers.installers import DebianControlLexer, SourcesListLexer +from pygments.lexers.make import MakefileLexer, BaseMakefileLexer, CMakeLexer +from pygments.lexers.haxe import HxmlLexer +from pygments.lexers.sgf import SmartGameFormatLexer +from pygments.lexers.diff import DiffLexer, DarcsPatchLexer +from pygments.lexers.data import YamlLexer +from pygments.lexers.textfmts import IrcLogsLexer, GettextLexer, HttpLexer + +__all__ = [] diff --git a/shared/package-files/9e/9ed21b5e6be57474ef8aba01a4f2aeca6cecaca2f85e697bd4245712e635121c/blob b/shared/package-files/9e/9ed21b5e6be57474ef8aba01a4f2aeca6cecaca2f85e697bd4245712e635121c/blob new file mode 100644 index 0000000000000000000000000000000000000000..72bd9f918f33c7acccb97dc086cc45a4fb881d7c --- /dev/null +++ b/shared/package-files/9e/9ed21b5e6be57474ef8aba01a4f2aeca6cecaca2f85e697bd4245712e635121c/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor igammac(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & igammac_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & igammac_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +TORCH_API at::Tensor & igammac_(at::Tensor & self, const at::Tensor & other); + +} // namespace cpu +} // namespace at diff --git a/shared/package-files/9e/9ed4b4373dce636ead027ad1db453ba4788d4db0e6ab7f38f189b3eabe6810bc/blob b/shared/package-files/9e/9ed4b4373dce636ead027ad1db453ba4788d4db0e6ab7f38f189b3eabe6810bc/blob new file mode 100644 index 0000000000000000000000000000000000000000..82663937ba3bc18398c9e143bd5022866e10ac36 --- /dev/null +++ b/shared/package-files/9e/9ed4b4373dce636ead027ad1db453ba4788d4db0e6ab7f38f189b3eabe6810bc/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ed4b4373dce636ead027ad1db453ba4788d4db0e6ab7f38f189b3eabe6810bc +size 576328 diff --git a/shared/package-files/9e/9ed6a2c5d692a64700121344db2d5950621cf749e133e0f8749dee5f24f23ef3/blob b/shared/package-files/9e/9ed6a2c5d692a64700121344db2d5950621cf749e133e0f8749dee5f24f23ef3/blob new file mode 100644 index 0000000000000000000000000000000000000000..54cfd3b58c969609a49a9537255238d31928684f --- /dev/null +++ b/shared/package-files/9e/9ed6a2c5d692a64700121344db2d5950621cf749e133e0f8749dee5f24f23ef3/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor cov(const at::Tensor & self, int64_t correction=1, const c10::optional & fweights={}, const c10::optional & aweights={}); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9e/9ed8b3e7c98810034cc77adfbd8ce318397f0adc944db4364d7dd63e4b05ee27/blob b/shared/package-files/9e/9ed8b3e7c98810034cc77adfbd8ce318397f0adc944db4364d7dd63e4b05ee27/blob new file mode 100644 index 0000000000000000000000000000000000000000..773f8c3137480c014ea8ac28dc3f96d4f2206eef --- /dev/null +++ b/shared/package-files/9e/9ed8b3e7c98810034cc77adfbd8ce318397f0adc944db4364d7dd63e4b05ee27/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ed8b3e7c98810034cc77adfbd8ce318397f0adc944db4364d7dd63e4b05ee27 +size 210768 diff --git a/shared/package-files/9e/9ed968ce55283d06066d99e366a5a7cd1f3303235b5c6626c7828141ae5c0ec4/blob b/shared/package-files/9e/9ed968ce55283d06066d99e366a5a7cd1f3303235b5c6626c7828141ae5c0ec4/blob new file mode 100644 index 0000000000000000000000000000000000000000..05d4a64a4e789bbe09b14f19f5999184747d4cf7 --- /dev/null +++ b/shared/package-files/9e/9ed968ce55283d06066d99e366a5a7cd1f3303235b5c6626c7828141ae5c0ec4/blob @@ -0,0 +1,97 @@ +::msgcat::mcset en "Widget Demonstration" +::msgcat::mcset en "tkWidgetDemo" +::msgcat::mcset en "&File" +::msgcat::mcset en "About..." +::msgcat::mcset en "&About..." +::msgcat::mcset en "" +::msgcat::mcset en "&Quit" +::msgcat::mcset en "Meta+Q" ;# Displayed hotkey +::msgcat::mcset en "Meta-q" ;# Actual binding sequence +::msgcat::mcset en "Ctrl+Q" ;# Displayed hotkey +::msgcat::mcset en "Control-q" ;# Actual binding sequence +::msgcat::mcset en "Variable values" +::msgcat::mcset en "Variable values:" +::msgcat::mcset en "OK" +::msgcat::mcset en "Run the \"%s\" sample program" +::msgcat::mcset en "Dismiss" +::msgcat::mcset en "Rerun Demo" +::msgcat::mcset en "Demo code: %s" +::msgcat::mcset en "About Widget Demo" +::msgcat::mcset en "Tk widget demonstration application" +::msgcat::mcset en "Copyright © %s" +::msgcat::mcset en " + @@title + Tk Widget Demonstrations + @@newline + @@normal + @@newline + + This application provides a front end for several short scripts + that demonstrate what you can do with Tk widgets. Each of the + numbered lines below describes a demonstration; you can click on + it to invoke the demonstration. Once the demonstration window + appears, you can click the + @@bold + See Code + @@normal + button to see the Tcl/Tk code that created the demonstration. If + you wish, you can edit the code and click the + @@bold + Rerun Demo + @@normal + button in the code window to reinvoke the demonstration with the + modified code. + @@newline +" +::msgcat::mcset en "Labels, buttons, checkbuttons, and radiobuttons" +::msgcat::mcset en "Labels (text and bitmaps)" +::msgcat::mcset en "Labels and UNICODE text" +::msgcat::mcset en "Buttons" +::msgcat::mcset en "Check-buttons (select any of a group)" +::msgcat::mcset en "Radio-buttons (select one of a group)" +::msgcat::mcset en "A 15-puzzle game made out of buttons" +::msgcat::mcset en "Iconic buttons that use bitmaps" +::msgcat::mcset en "Two labels displaying images" +::msgcat::mcset en "A simple user interface for viewing images" +::msgcat::mcset en "Labelled frames" +::msgcat::mcset en "Listboxes" +::msgcat::mcset en "The 50 states" +::msgcat::mcset en "Colors: change the color scheme for the application" +::msgcat::mcset en "A collection of famous and infamous sayings" +::msgcat::mcset en "Entries and Spin-boxes" +::msgcat::mcset en "Entries without scrollbars" +::msgcat::mcset en "Entries with scrollbars" +::msgcat::mcset en "Validated entries and password fields" +::msgcat::mcset en "Spin-boxes" +::msgcat::mcset en "Simple Rolodex-like form" +::msgcat::mcset en "Text" +::msgcat::mcset en "Basic editable text" +::msgcat::mcset en "Text display styles" +::msgcat::mcset en "Hypertext (tag bindings)" +::msgcat::mcset en "A text widget with embedded windows" +::msgcat::mcset en "A search tool built with a text widget" +::msgcat::mcset en "Canvases" +::msgcat::mcset en "The canvas item types" +::msgcat::mcset en "A simple 2-D plot" +::msgcat::mcset en "Text items in canvases" +::msgcat::mcset en "An editor for arrowheads on canvas lines" +::msgcat::mcset en "A ruler with adjustable tab stops" +::msgcat::mcset en "A building floor plan" +::msgcat::mcset en "A simple scrollable canvas" +::msgcat::mcset en "Scales" +::msgcat::mcset en "Horizontal scale" +::msgcat::mcset en "Vertical scale" +::msgcat::mcset en "Paned Windows" +::msgcat::mcset en "Horizontal paned window" +::msgcat::mcset en "Vertical paned window" +::msgcat::mcset en "Menus" +::msgcat::mcset en "Menus and cascades (sub-menus)" +::msgcat::mcset en "Menu-buttons" +::msgcat::mcset en "Common Dialogs" +::msgcat::mcset en "Message boxes" +::msgcat::mcset en "File selection dialog" +::msgcat::mcset en "Color picker" +::msgcat::mcset en "Miscellaneous" +::msgcat::mcset en "The built-in bitmaps" +::msgcat::mcset en "A dialog box with a local grab" +::msgcat::mcset en "A dialog box with a global grab" diff --git a/shared/package-files/9e/9eda313e6064486153fb7a3a522b7a889d4d43c3b89e21943529315b91dae501/blob b/shared/package-files/9e/9eda313e6064486153fb7a3a522b7a889d4d43c3b89e21943529315b91dae501/blob new file mode 100644 index 0000000000000000000000000000000000000000..94515a7aff9204e9d2075d768e6e646c1475a643 --- /dev/null +++ b/shared/package-files/9e/9eda313e6064486153fb7a3a522b7a889d4d43c3b89e21943529315b91dae501/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _scaled_dot_product_cudnn_attention { + using schema = ::std::tuple (const at::Tensor &, const at::Tensor &, const at::Tensor &, double, bool, bool, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_scaled_dot_product_cudnn_attention") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_scaled_dot_product_cudnn_attention(Tensor query, Tensor key, Tensor value, float dropout_p=0.0, bool is_causal=False, bool return_debug_mask=False, *, float? scale=None) -> (Tensor output, Tensor logsumexp, Tensor philox_seed, Tensor philox_offset)") + static ::std::tuple call(const at::Tensor & query, const at::Tensor & key, const at::Tensor & value, double dropout_p, bool is_causal, bool return_debug_mask, c10::optional scale); + static ::std::tuple redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & query, const at::Tensor & key, const at::Tensor & value, double dropout_p, bool is_causal, bool return_debug_mask, c10::optional scale); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9e/9edbc2b4591f79bbe284c896ecd8407852bd327e5fdce9be0d1e1f8936eeaf32/blob b/shared/package-files/9e/9edbc2b4591f79bbe284c896ecd8407852bd327e5fdce9be0d1e1f8936eeaf32/blob new file mode 100644 index 0000000000000000000000000000000000000000..53771dc4d6c1cf542f62314dadbf6a670e9a99da --- /dev/null +++ b/shared/package-files/9e/9edbc2b4591f79bbe284c896ecd8407852bd327e5fdce9be0d1e1f8936eeaf32/blob @@ -0,0 +1,28 @@ +import doctest +import unittest +from numba.tests.support import TestCase + + +class TestDocTest(TestCase): + def test_basic_decorators(self): + from . import doctest_usecase + + # Make sure the finder see all the doctest + finder = doctest.DocTestFinder() + tests = finder.find(doctest_usecase) + testnames = {x.name for x in tests} + expected = { + 'numba.tests.doctest_usecase', + 'numba.tests.doctest_usecase.a', + 'numba.tests.doctest_usecase.b', + 'numba.tests.doctest_usecase.c', + 'numba.tests.doctest_usecase.d', + } + self.assertEqual(testnames, expected) + + # Execute the doctest in the module + doctest.testmod(doctest_usecase) + + +if __name__ == "__main__": + unittest.main() diff --git a/shared/package-files/9e/9edc2c56ab309e7f397a03580d580f53fa4490d580b4d203acf81a40e5a52f89/blob b/shared/package-files/9e/9edc2c56ab309e7f397a03580d580f53fa4490d580b4d203acf81a40e5a52f89/blob new file mode 100644 index 0000000000000000000000000000000000000000..136156df067f1618c7e0df704bb27a684d3a35f6 --- /dev/null +++ b/shared/package-files/9e/9edc2c56ab309e7f397a03580d580f53fa4490d580b4d203acf81a40e5a52f89/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor special_i0e(const at::Tensor & self); +TORCH_API at::Tensor & special_i0e_out(at::Tensor & out, const at::Tensor & self); +TORCH_API at::Tensor & special_i0e_outf(const at::Tensor & self, at::Tensor & out); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/9e/9edfd72e0f744b6a901824fdf8c771ff41763fb53b527c7717356b444c4e8a23/blob b/shared/package-files/9e/9edfd72e0f744b6a901824fdf8c771ff41763fb53b527c7717356b444c4e8a23/blob new file mode 100644 index 0000000000000000000000000000000000000000..9494926eef3c6c7fb0faaac4b57a520a29388f15 --- /dev/null +++ b/shared/package-files/9e/9edfd72e0f744b6a901824fdf8c771ff41763fb53b527c7717356b444c4e8a23/blob @@ -0,0 +1,390 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace torch { +namespace nn { + +/// A list of `Module`s that acts as a `Module` itself. +/// +/// A `Sequential` is fundamentally a list of `Module`s, each with a `forward()` +/// method. `Sequential` provides a `forward()` method of its own, which accepts +/// any input and forwards it to the first module it stores. It then "chains" +/// outputs to inputs sequentially for each subsequent module, finally returning +/// the output of the last module. For example: +/// +/// \rst +/// .. code-block:: cpp +/// +/// torch::nn::Sequential seq( +/// torch::nn::Linear(3, 4), +/// torch::nn::BatchNorm1d(4), +/// torch::nn::Dropout(0.5) +/// ); +/// +/// auto output = seq->forward(torch::ones(3)); +/// +/// \endrst +/// +/// This can conceptually be thought of as the following loop (using Python as +/// pseudocode): +/// +/// \rst +/// .. code-block:: python +/// +/// def forward(sequential, input): +/// for module in sequential: +/// input = module(input) +/// return input +/// +/// \endrst +/// +/// Why should you use `Sequential` instead of a simple `std::vector`? The value +/// a `Sequential` provides over manually calling a sequence of modules is that +/// it allows treating the whole container *as a single module*, such that +/// performing a transformation on the `Sequential` applies to each of the +/// modules it stores (which are each a registered submodule of the +/// `Sequential`). For example, calling +/// `.to(torch::kCUDA)` on a `Sequential` will move each module in the list to +/// CUDA memory. For example: +/// +/// \rst +/// .. code-block:: cpp +/// +/// torch::nn::Sequential seq( +/// torch::nn::Linear(3, 4), +/// torch::nn::BatchNorm1d(4), +/// torch::nn::Dropout(0.5) +/// ); +/// +/// // Convert all modules to CUDA. +/// seq->to(torch::kCUDA); +/// +/// \endrst +/// +/// Finally, `Sequential` provides a lightweight container API, such as allowing +/// iteration over submodules, positional access, adding a new module after +/// construction via `push_back`, as well as joining two `Sequential`s via +/// `extend`. +/// +/// \rst +/// .. attention:: +/// One current limitation of `Sequential` is that all except the first module +/// must accept a single argument. If your modules need to take multiple +/// arguments, you should define them to take and return tuples. +/// \endrst +class SequentialImpl : public Cloneable { + public: + using Iterator = std::vector::iterator; + using ConstIterator = std::vector::const_iterator; + + SequentialImpl() = default; + + /// Constructs the `Sequential` from a variadic list of modules. + template + explicit SequentialImpl(Modules&&... modules) { + modules_.reserve(sizeof...(Modules)); + push_back(std::forward(modules)...); + } + + /// Constructs the `Sequential` from an `OrderedDict` of named `AnyModule`s. + explicit SequentialImpl( + torch::OrderedDict&& ordered_dict) { + modules_.reserve(ordered_dict.size()); + for (auto& item : ordered_dict) { + push_back(item.key(), std::move(item.value())); + } + } + + /// Constructs the `Sequential` from a braced-init-list of named `AnyModule`s. + /// It enables the following use case: + /// `Sequential sequential({{"m1", M(1)}, {"m2", M(2)}})` + explicit SequentialImpl(std::initializer_list named_modules) { + modules_.reserve(named_modules.size()); + for (const auto& named_module : named_modules) { + push_back(named_module.name(), named_module.module()); + } + } + + /// Special cloning function for `Sequential` because it does not use + /// `reset()`. + std::shared_ptr clone( + const optional& device = nullopt) const override { + auto clone = std::make_shared(); + for (const auto& module : modules_) { + clone->push_back(module.clone(device)); + } + return clone; + } + + /// `reset()` is empty for `Sequential`, since it does not have parameters of + /// its own. + void reset() override {} + + /// Pretty prints the `Sequential` module into the given `stream`. + void pretty_print(std::ostream& stream) const override { + stream << "torch::nn::Sequential"; + } + + /// Feeds `inputs` to the first module and then chains outputs to inputs, + /// returning the last output. + /// + /// Conceptually the following loop in Python: + /// + /// \rst + /// .. code-block:: python + /// + /// def forward(sequential, input): + /// for module in sequential: + /// input = module(input) + /// return input + /// + /// \endrst + /// + /// The return type is taken as the first template parameter. It defaults to + /// `Tensor`. If the last module in the `Sequential` returns another type `T`, + /// you should call `forward(inputs)` instead of just `forward(inputs)`: + /// + /// \rst + /// .. code-block:: cpp + /// + /// torch::Tensor tensor = sequential1->forward(inputs); + /// int integer = sequential2->forward(inputs); + /// float value = sequential3->forward(inputs); + /// + /// \endrst + template + ReturnType forward(InputTypes&&... inputs) { + TORCH_CHECK(!is_empty(), "Cannot call forward() on an empty Sequential"); + + auto iterator = modules_.begin(); + auto input = iterator->any_forward(std::forward(inputs)...); + + for (++iterator; iterator != modules_.end(); ++iterator) { + input = iterator->any_forward(std::move(input)); + } + + // Check the return value and give a nice error message if the requested + // return type was incorrect. + if (auto* return_value = input.template try_get()) { + return std::move(*return_value); + } + AT_ERROR( + "The type of the return value is ", + c10::demangle(input.type_info().name()), + ", but you asked for type ", + c10::demangle(typeid(ReturnType).name())); + } + + /// Adds a new (boxed) `Module` to the `Sequential` container. + template + void push_back(std::shared_ptr module_ptr) { + push_back(c10::to_string(modules_.size()), std::move(module_ptr)); + } + + /// Adds a new named (boxed) `Module` to the `Sequential` container. + template + void push_back(std::string name, std::shared_ptr module_ptr) { + push_back(std::move(name), AnyModule(std::move(module_ptr))); + } + + /// Adds a new `Module` to the `Sequential` container, moving or copying it + /// into a `shared_ptr` internally. This method allows passing value types, + /// and letting the container deal with the boxing. This means you can write + /// `Sequential(Module(3, 4))` instead of + /// `Sequential(std::make_shared(3, 4))`. + template > + void push_back(M&& module) { + push_back(c10::to_string(modules_.size()), std::forward(module)); + } + + /// Adds a new named `Module` to the `Sequential` container, moving or copying + /// it into a `shared_ptr` internally. This method allows passing value types, + /// and letting the container deal with the boxing. + template > + void push_back(std::string name, M&& module) { + using Type = typename std::remove_reference::type; + push_back(std::move(name), std::make_shared(std::forward(module))); + } + + /// Unwraps the contained module of a `ModuleHolder` and adds it to the + /// `Sequential`. + template + void push_back(const ModuleHolder& module_holder) { + push_back(c10::to_string(modules_.size()), module_holder); + } + + /// Unwraps the contained named module of a `ModuleHolder` and adds it to the + /// `Sequential`. + template + void push_back(std::string name, const ModuleHolder& module_holder) { + push_back(std::move(name), module_holder.ptr()); + } + + /// Iterates over the container and calls `push_back()` on each value. + template + void extend(const Container& container) { + for (const auto& module : container) { + push_back(module); + } + } + + /// Adds a type-erased `AnyModule` to the `Sequential`. + void push_back(AnyModule any_module) { + push_back(c10::to_string(modules_.size()), std::move(any_module)); + } + + void push_back(std::string name, AnyModule any_module) { + modules_.push_back(std::move(any_module)); + const auto index = modules_.size() - 1; + register_module(std::move(name), modules_[index].ptr()); + } + + /// Returns an iterator to the start of the `Sequential`. + Iterator begin() { + return modules_.begin(); + } + + /// Returns a const iterator to the start of the `Sequential`. + ConstIterator begin() const { + return modules_.begin(); + } + + /// Returns an iterator to the end of the `Sequential`. + Iterator end() { + return modules_.end(); + } + + /// Returns a const iterator to the end of the `Sequential`. + ConstIterator end() const { + return modules_.end(); + } + + /// Attempts to return the module at the given index as the requested type. + /// Throws an exception if the index is out of bounds or the types do not + /// match. + template + T& at(size_t index) { + static_assert( + torch::detail::is_module::value, + "Can only call Sequential::at with an nn::Module type"); + TORCH_CHECK(index < size(), "Index out of range"); + return modules_[index].get(); + } + + /// Attempts to return the module at the given index as the requested type. + /// Throws an exception if the index is out of bounds or the types do not + /// match. + template + const T& at(size_t index) const { + static_assert( + torch::detail::is_module::value, + "Can only call Sequential::at with an nn::Module type"); + TORCH_CHECK(index < size(), "Index out of range"); + return modules_[index].get(); + } + + /// Attempts to return a `std::shared_ptr` whose dynamic type is that of the + /// underlying module at the given index. Throws an exception if the index is + /// out of bounds. + std::shared_ptr ptr(size_t index) const { + TORCH_CHECK(index < size(), "Index out of range"); + return modules_[index].ptr(); + } + + /// Attempts to return a `std::shared_ptr` whose type is the one provided. + /// Throws an exception if the index is out of bounds or the types do not + /// match. + template + std::shared_ptr ptr(size_t index) const { + static_assert( + torch::detail::is_module::value, + "Can only call Sequential::ptr with an nn::Module type"); + TORCH_CHECK(index < size(), "Index out of range"); + return modules_[index].ptr(); + } + + /// Like `ptr(index)`. + std::shared_ptr operator[](size_t index) const { + // This is the only method we can call without a type. + return ptr(index); + } + + /// The current size of the `Sequential` container. + size_t size() const noexcept { + return modules_.size(); + } + + /// True if there are no modules in the `Sequential`. + bool is_empty() const noexcept { + return size() == 0; + } + + private: + /// Takes a First *and* Second parameter, to avoid ambiguity when a parameter + /// pack has only one type, in which case the template would be preferred, + /// even if the other `push_back` functions are better fits (e.g. `unique_ptr` + /// -> `shared_ptr` overload). + /// NOTE: We explicitly avoid matching this template with + /// `push_back(std::string("name"), module)` or `push_back("name", module)`, + /// since they should be handled by their respective `push_back` functions. + template < + typename First, + typename Second, + typename... Rest, + typename = torch::disable_if_t< + std::is_same::value || + // NOLINTNEXTLINE(modernize-avoid-c-arrays,cppcoreguidelines-avoid-c-arrays) + std::is_same< + typename std::decay::type, + std::decay::type>::value>> + void push_back(First&& first, Second&& second, Rest&&... rest) { + push_back(std::forward(first)); + // Recursively calls this method, until the parameter pack only thas this + // entry left. Then calls `push_back()` a final time (above). + push_back(std::forward(second), std::forward(rest)...); + } + + /// The base case, when the list of modules is empty. + void push_back() {} + + // Box the AnyModules to give Sequential reference semantics, like the rest of + // the API. Note that this is not required otherwise, this could just be a + // `vector`. + std::vector modules_; +}; + +/// A `ModuleHolder` subclass for `SequentialImpl`. +/// See the documentation for `SequentialImpl` class to learn what methods it +/// provides, or the documentation for `ModuleHolder` to learn about PyTorch's +/// module storage semantics. +class Sequential : public torch::nn::ModuleHolder { + public: + using torch::nn::ModuleHolder::ModuleHolder; + + Sequential() : ModuleHolder() {} + + /// Constructs the `Sequential` from a braced-init-list of named `AnyModule`s. + /// It enables the following use case: + /// `Sequential sequential({{"m1", M(1)}, {"m2", M(2)}})` + Sequential(std::initializer_list named_modules) + : ModuleHolder(std::make_shared(named_modules)) {} +}; +} // namespace nn +} // namespace torch diff --git a/shared/package-files/9e/9ee299ac4babfa5fd63c3945d285e057241d771897c430b1b49f3882fa199b4d/blob b/shared/package-files/9e/9ee299ac4babfa5fd63c3945d285e057241d771897c430b1b49f3882fa199b4d/blob new file mode 100644 index 0000000000000000000000000000000000000000..1a31dba65058e15b5b79fa9294f40ad83401de96 --- /dev/null +++ b/shared/package-files/9e/9ee299ac4babfa5fd63c3945d285e057241d771897c430b1b49f3882fa199b4d/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & _to_sparse_sparse_dim_out(const at::Tensor & self, int64_t sparse_dim, at::Tensor & out); +TORCH_API at::Tensor dense_to_sparse(const at::Tensor & self, int64_t sparse_dim); +TORCH_API at::Tensor sparse_coo_to_sparse(const at::Tensor & self, int64_t sparse_dim); +TORCH_API at::Tensor sparse_compressed_to_sparse(const at::Tensor & self, int64_t sparse_dim); +TORCH_API at::Tensor & _to_sparse_out(const at::Tensor & self, c10::optional layout, at::OptionalIntArrayRef blocksize, c10::optional dense_dim, at::Tensor & out); +TORCH_API at::Tensor dense_to_sparse(const at::Tensor & self, c10::optional layout=c10::nullopt, at::OptionalIntArrayRef blocksize=c10::nullopt, c10::optional dense_dim=c10::nullopt); +TORCH_API at::Tensor sparse_coo_to_sparse(const at::Tensor & self, c10::optional layout=c10::nullopt, at::OptionalIntArrayRef blocksize=c10::nullopt, c10::optional dense_dim=c10::nullopt); +TORCH_API at::Tensor sparse_compressed_to_sparse(const at::Tensor & self, c10::optional layout=c10::nullopt, at::OptionalIntArrayRef blocksize=c10::nullopt, c10::optional dense_dim=c10::nullopt); +} // namespace native +} // namespace at diff --git a/shared/package-files/9e/9ee59625e4a0de73c9b30759dd357c63b871011ca8b368b8d972fd3e8fecc9f4/blob b/shared/package-files/9e/9ee59625e4a0de73c9b30759dd357c63b871011ca8b368b8d972fd3e8fecc9f4/blob new file mode 100644 index 0000000000000000000000000000000000000000..979f97eeaa52f4885355d2d0050a736b9978f273 Binary files /dev/null and b/shared/package-files/9e/9ee59625e4a0de73c9b30759dd357c63b871011ca8b368b8d972fd3e8fecc9f4/blob differ diff --git a/shared/package-files/9e/9ee621cd48377552353da96e10eb250c0407b1bf35be33bcd2c44f2140f35224/blob b/shared/package-files/9e/9ee621cd48377552353da96e10eb250c0407b1bf35be33bcd2c44f2140f35224/blob new file mode 100644 index 0000000000000000000000000000000000000000..aa769170867f55e242c9867865eeda7887ae7449 --- /dev/null +++ b/shared/package-files/9e/9ee621cd48377552353da96e10eb250c0407b1bf35be33bcd2c44f2140f35224/blob @@ -0,0 +1,19 @@ +# pkg-config file generated by gen-pkgconfig +# vile:makemode + +prefix=/opt/conda +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include/ncursesw +abi_version=6 +major_version=6 +version=6.4.20221231 + +Name: menuw +Description: ncurses 6.4 add-on library +Version: ${version} +URL: https://invisible-island.net/ncurses +Requires.private: ncursesw +Libs: -L/opt/conda/lib -Wl,-O2 -Wl,--sort-common -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/opt/conda/lib -Wl,-rpath-link,/opt/conda/lib -lmenuw +Libs.private: +Cflags: -D_GNU_SOURCE -DNCURSES_WIDECHAR -I${includedir} -I/opt/conda/include diff --git a/shared/package-files/9e/9ee804b756c470c0dca712f41d7cb6a2d85fee747fae57d1b5d9d2965bb5be64/blob b/shared/package-files/9e/9ee804b756c470c0dca712f41d7cb6a2d85fee747fae57d1b5d9d2965bb5be64/blob new file mode 100644 index 0000000000000000000000000000000000000000..56783433df569965f6011e7dd58ff1106f9a7eb4 --- /dev/null +++ b/shared/package-files/9e/9ee804b756c470c0dca712f41d7cb6a2d85fee747fae57d1b5d9d2965bb5be64/blob @@ -0,0 +1,67 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::median(Tensor self) -> Tensor +inline at::Tensor median(const at::Tensor & self) { + return at::_ops::median::call(self); +} + +// aten::median.dim(Tensor self, int dim, bool keepdim=False) -> (Tensor values, Tensor indices) +inline ::std::tuple median(const at::Tensor & self, int64_t dim, bool keepdim=false) { + return at::_ops::median_dim::call(self, dim, keepdim); +} + +// aten::median.dim_values(Tensor self, int dim, bool keepdim=False, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices) +inline ::std::tuple median_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, int64_t dim, bool keepdim=false) { + return at::_ops::median_dim_values::call(self, dim, keepdim, values, indices); +} +// aten::median.dim_values(Tensor self, int dim, bool keepdim=False, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices) +inline ::std::tuple median_outf(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & values, at::Tensor & indices) { + return at::_ops::median_dim_values::call(self, dim, keepdim, values, indices); +} + +// aten::median.names_dim(Tensor self, Dimname dim, bool keepdim=False) -> (Tensor values, Tensor indices) +inline ::std::tuple median(const at::Tensor & self, at::Dimname dim, bool keepdim=false) { + return at::_ops::median_names_dim::call(self, dim, keepdim); +} + +// aten::median.names_dim_values(Tensor self, Dimname dim, bool keepdim=False, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices) +inline ::std::tuple median_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, at::Dimname dim, bool keepdim=false) { + return at::_ops::median_names_dim_values::call(self, dim, keepdim, values, indices); +} +// aten::median.names_dim_values(Tensor self, Dimname dim, bool keepdim=False, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices) +inline ::std::tuple median_outf(const at::Tensor & self, at::Dimname dim, bool keepdim, at::Tensor & values, at::Tensor & indices) { + return at::_ops::median_names_dim_values::call(self, dim, keepdim, values, indices); +} + +// aten::median.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & median_out(at::Tensor & out, const at::Tensor & self) { + return at::_ops::median_out::call(self, out); +} +// aten::median.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & median_outf(const at::Tensor & self, at::Tensor & out) { + return at::_ops::median_out::call(self, out); +} + +} diff --git a/shared/package-files/9e/9eed2bd29c36278165440dd2616206b66a22554ae55d59f310b3d776af10bc34/blob b/shared/package-files/9e/9eed2bd29c36278165440dd2616206b66a22554ae55d59f310b3d776af10bc34/blob new file mode 100644 index 0000000000000000000000000000000000000000..2df7534f56de68cd8c16175e64ac59f24543e257 --- /dev/null +++ b/shared/package-files/9e/9eed2bd29c36278165440dd2616206b66a22554ae55d59f310b3d776af10bc34/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor nll_loss_symint(const at::Tensor & self, const at::Tensor & target, const c10::optional & weight={}, int64_t reduction=at::Reduction::Mean, c10::SymInt ignore_index=-100); +TORCH_API at::Tensor & nll_loss_out(const at::Tensor & self, const at::Tensor & target, const c10::optional & weight, int64_t reduction, int64_t ignore_index, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/9e/9ef16fd0844c7813bced464be5669163c60801271602443111cd39f1e12d0a9b/blob b/shared/package-files/9e/9ef16fd0844c7813bced464be5669163c60801271602443111cd39f1e12d0a9b/blob new file mode 100644 index 0000000000000000000000000000000000000000..0de26c8ee8b0721ba7acb6d7e2482a5c1b35f14d --- /dev/null +++ b/shared/package-files/9e/9ef16fd0844c7813bced464be5669163c60801271602443111cd39f1e12d0a9b/blob @@ -0,0 +1,420 @@ +from __future__ import annotations + +import warnings +from functools import lru_cache +from itertools import chain +from operator import methodcaller +from typing import TYPE_CHECKING, Any, ClassVar, Literal, cast + +from narwhals._compliant import EagerGroupBy +from narwhals._exceptions import issue_warning +from narwhals._expression_parsing import evaluate_output_names_and_aliases +from narwhals._pandas_like.utils import make_group_by_kwargs +from narwhals.dependencies import is_pandas_like_dataframe + +if TYPE_CHECKING: + from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence + from typing import TypeAlias + + import pandas as pd + from pandas.api.typing import DataFrameGroupBy as _NativeGroupBy + from typing_extensions import Unpack + + from narwhals._compliant.typing import NarwhalsAggregation, ScalarKwargs + from narwhals._pandas_like.dataframe import PandasLikeDataFrame + from narwhals._pandas_like.expr import PandasLikeExpr + + NativeGroupBy: TypeAlias = "_NativeGroupBy[tuple[str, ...], Literal[True]]" + +NativeApply: TypeAlias = "Callable[[pd.DataFrame], pd.Series[Any]]" +InefficientNativeAggregation: TypeAlias = Literal["cov", "skew"] +NativeAggregation: TypeAlias = Literal[ + "any", + "all", + "count", + "idxmax", + "idxmin", + "max", + "mean", + "median", + "min", + "mode", + "nth", + "nunique", + "prod", + "quantile", + "sem", + "size", + "std", + "sum", + "var", + InefficientNativeAggregation, +] +"""https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html#built-in-aggregation-methods""" + +_NativeAgg: TypeAlias = "Callable[[Any], pd.DataFrame | pd.Series[Any]]" +"""Equivalent to a partial method call on `DataFrameGroupBy`.""" + + +NonStrHashable: TypeAlias = Any +"""Because `pandas` allows *"names"* like that 😭""" + +_REMAP_ORDERED_INDEX: Mapping[NarwhalsAggregation, Literal[0, -1]] = { + "first": 0, + "last": -1, + "any_value": 0, +} + + +@lru_cache(maxsize=32) +def _native_agg(name: NativeAggregation, /, **kwds: Unpack[ScalarKwargs]) -> _NativeAgg: + if name == "nunique": + return methodcaller(name, dropna=False) + if name == "quantile": + assert "quantile" in kwds # noqa: S101 + assert "interpolation" in kwds # noqa: S101 + return methodcaller(name, q=kwds["quantile"], interpolation=kwds["interpolation"]) + if not kwds or kwds.get("ddof") == 1: + return methodcaller(name) + return methodcaller(name, **kwds) + + +class AggExpr: + """Wrapper storing the intermediate state per-`PandasLikeExpr`. + + There's a lot of edge cases to handle, so aim to evaluate as little + as possible - and store anything that's needed twice. + + Warning: + While a `PandasLikeExpr` can be reused - this wrapper is valid **only** + in a single `.agg(...)` operation. + """ + + expr: PandasLikeExpr + output_names: Sequence[str] + aliases: Sequence[str] + + def __init__(self, expr: PandasLikeExpr) -> None: + self.expr = expr + self.output_names = () + self.aliases = () + self._leaf_name: NarwhalsAggregation | Any = "" + + def with_expand_names(self, group_by: PandasLikeGroupBy, /) -> AggExpr: + """**Mutating operation**. + + Stores the results of `evaluate_output_names_and_aliases`. + """ + df = group_by.compliant + exclude = group_by.exclude + self.output_names, self.aliases = evaluate_output_names_and_aliases( + self.expr, df, exclude + ) + return self + + def _getitem_aggs(self, group_by: PandasLikeGroupBy) -> pd.DataFrame | pd.Series[Any]: + """Evaluate the wrapped expression as a group_by operation.""" + grouped = group_by._grouped + result: pd.DataFrame | pd.Series[Any] + names = self.output_names + if self.is_len() and self.is_top_level_function(): + result = grouped.size() + elif self.is_len(): + result_single = grouped.size() + ns = group_by.compliant.__narwhals_namespace__() + result = ns._concat_by_index( + [ns.from_native(result_single).alias(name).native for name in names] + ) + elif self.is_mode(): + compliant = group_by.compliant + node_kwargs = group_by._kwargs(self.expr) + if (keep := node_kwargs.get("keep")) != "any": # pragma: no cover + msg = ( + f"`Expr.mode(keep='{keep}')` is not implemented in group by context for " + f"backend {compliant._implementation}\n\n" + "Hint: Use `nw.col(...).mode(keep='any')` instead." + ) + raise NotImplementedError(msg) + + cols = list(names) + native = compliant.native + keys, kwargs = group_by._keys, group_by._group_by_kwargs + + # Implementation based on the following suggestion: + # https://github.com/pandas-dev/pandas/issues/19254#issuecomment-778661578 + ns = compliant.__narwhals_namespace__() + result = ns._concat_by_index( + [ + native.groupby([*keys, col], **kwargs) + .size() + .sort_values(ascending=False) + .reset_index(col) + .groupby(keys, **kwargs)[col] + .head(1) + .sort_index() + for col in cols + ] + ) + elif self.is_last() or self.is_first() or self.is_any_value(): + result = self.native_agg()(grouped[[*group_by._keys, *names]]) + impl = group_by.compliant._implementation + backend_version = impl._backend_version() + if impl.is_pandas() and backend_version < (3, 0): # pragma: no cover + # NOTE: Keep `inplace=True` to avoid making a redundant copy. + result.set_index(group_by._keys, inplace=True) # noqa: PD002 + else: + result = result.set_index(group_by._keys) + else: + select = names[0] if len(names) == 1 else list(names) + result = self.native_agg()(grouped[select]) + if is_pandas_like_dataframe(result): + result = cast("pd.DataFrame", result) + result.columns = list(self.aliases) + else: + result = cast("pd.Series[Any]", result) + result.name = self.aliases[0] + return result + + def is_len(self) -> bool: + return self.leaf_name == "len" + + def is_last(self) -> bool: + return self.leaf_name == "last" + + def is_first(self) -> bool: + return self.leaf_name == "first" + + def is_mode(self) -> bool: + return self.leaf_name == "mode" + + def is_any_value(self) -> bool: + return self.leaf_name == "any_value" + + def is_top_level_function(self) -> bool: + # e.g. `nw.len()`. + return len(list(self.expr._metadata.op_nodes_reversed())) == 1 + + @property + def leaf_name(self) -> NarwhalsAggregation | Any: + if name := self._leaf_name: + return name + self._leaf_name = PandasLikeGroupBy._leaf_name(self.expr) + return self._leaf_name + + def native_agg(self) -> _NativeAgg: + """Return a partial `DataFrameGroupBy` method, missing only `self`.""" + native_name = PandasLikeGroupBy._remap_expr_name(self.leaf_name) + last_node = next(self.expr._metadata.op_nodes_reversed()) + if self.leaf_name in _REMAP_ORDERED_INDEX: + if last_node.kwargs.get("ignore_nulls"): + msg = ( + "`Expr.any_value(ignore_nulls=True)` is not supported in a `group_by` " + "context for pandas-like backend" + ) + raise NotImplementedError(msg) + return methodcaller("nth", n=_REMAP_ORDERED_INDEX[self.leaf_name]) + return _native_agg(native_name, **last_node.kwargs) + + +class PandasLikeGroupBy( + EagerGroupBy["PandasLikeDataFrame", "PandasLikeExpr", NativeAggregation] +): + _REMAP_AGGS: ClassVar[Mapping[NarwhalsAggregation, NativeAggregation]] = { + "sum": "sum", + "mean": "mean", + "median": "median", + "max": "max", + "min": "min", + "mode": "mode", + "std": "std", + "var": "var", + "len": "size", + "n_unique": "nunique", + "count": "count", + "quantile": "quantile", + "all": "all", + "any": "any", + "first": "nth", + "last": "nth", + "any_value": "nth", + } + _original_columns: tuple[str, ...] + """Column names *prior* to any aliasing in `ParseKeysGroupBy`.""" + + _keys: list[str] + """Stores the **aliased** version of group keys from `ParseKeysGroupBy`.""" + + _output_key_names: list[str] + """Stores the **original** version of group keys.""" + + _group_by_kwargs: Mapping[str, bool] + """Stores keyword arguments for `DataFrame.groupby` other than `by`.""" + + @property + def exclude(self) -> tuple[str, ...]: + """Group keys to ignore when expanding multi-output aggregations.""" + return self._exclude + + def __init__( + self, + df: PandasLikeDataFrame, + keys: Sequence[PandasLikeExpr] | Sequence[str], + /, + *, + drop_null_keys: bool, + ) -> None: + self._original_columns = tuple(df.columns) + self._drop_null_keys = drop_null_keys + self._compliant_frame, self._keys, self._output_key_names = self._parse_keys( + df, keys + ) + self._exclude: tuple[str, ...] = (*self._keys, *self._output_key_names) + self._group_by_kwargs = make_group_by_kwargs(drop_null_keys=drop_null_keys) + + # Drop index to avoid potential collisions: + # https://github.com/narwhals-dev/narwhals/issues/1907. + self._native = self.compliant.native + if set(self._native.index.names).intersection(self.compliant.columns): + self._native = self._native.reset_index(drop=True) + + def agg(self, *exprs: PandasLikeExpr) -> PandasLikeDataFrame: # noqa: PLR0912 + all_aggs_are_simple = True + agg_exprs: list[AggExpr] = [] + order_by = () + for expr in exprs: + agg_exprs.append(AggExpr(expr).with_expand_names(self)) + if not self._is_simple(expr): + all_aggs_are_simple = False + md = next(expr._metadata.op_nodes_reversed()) + if _current_order_by := md.kwargs.get("order_by", ()): + if order_by and _current_order_by != order_by: + msg = f"Only one `order_by` can be specified in `group_by`. Found both {order_by} and {_current_order_by}." + raise NotImplementedError(msg) + order_by = _current_order_by + + if order_by: + grouped: NativeGroupBy = self._native.sort_values( + list(order_by), na_position="first" + ).groupby(self._keys.copy(), **self._group_by_kwargs) + else: + grouped = self._native.groupby(self._keys.copy(), **self._group_by_kwargs) + self._grouped = grouped + + if all_aggs_are_simple: + result: pd.DataFrame + if agg_exprs: + ns = self.compliant.__narwhals_namespace__() + result = ns._concat_by_index(self._getitem_aggs(agg_exprs)) + else: + result = self.compliant.__native_namespace__().DataFrame( + list(grouped.groups), columns=self._keys + ) + elif self.compliant.native.empty: + raise empty_results_error() + else: + result = self._apply_aggs(grouped, exprs) + + impl = self.compliant._implementation + backend_version = impl._backend_version() + if impl.is_pandas() and backend_version < (3, 0): # pragma: no cover + # NOTE: Keep `inplace=True` to avoid making a redundant copy. + result.reset_index(inplace=True) # noqa: PD002 + else: + result = result.reset_index() + + return self._select_results(result, agg_exprs) + + def _select_results( + self, df: pd.DataFrame, /, agg_exprs: Sequence[AggExpr] + ) -> PandasLikeDataFrame: + """Responsible for remapping temp column names back to original. + + See `ParseKeysGroupBy`. + """ + new_names = chain.from_iterable(e.aliases for e in agg_exprs) + return ( + self.compliant._with_native(df, validate_column_names=False) + .simple_select(*self._keys, *new_names) + .rename(dict(zip(self._keys, self._output_key_names, strict=False))) + ) + + def _getitem_aggs( + self, exprs: Iterable[AggExpr], / + ) -> list[pd.DataFrame | pd.Series[Any]]: + return [e._getitem_aggs(self) for e in exprs] + + def _apply_aggs( + self, grouped: NativeGroupBy, exprs: Iterable[PandasLikeExpr] + ) -> pd.DataFrame: + """Stub issue for `include_groups` [pandas-dev/pandas-stubs#1270]. + + - [User guide] mentions `include_groups` 4 times without deprecation. + - [`DataFrameGroupBy.apply`] doc says the default value of `True` is deprecated since `2.2.0`. + - `False` is explicitly the only *non-deprecated* option, but entirely omitted since [pandas-dev/pandas-stubs#1268]. + + [pandas-dev/pandas-stubs#1270]: https://github.com/pandas-dev/pandas-stubs/issues/1270 + [User guide]: https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html + [`DataFrameGroupBy.apply`]: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.DataFrameGroupBy.apply.html + [pandas-dev/pandas-stubs#1268]: https://github.com/pandas-dev/pandas-stubs/pull/1268 + """ + warn_complex_group_by() + impl = self.compliant._implementation + func = self._apply_exprs_function(exprs) + apply = grouped.apply + if impl.is_pandas() and impl._backend_version() >= (2, 2): + return apply(func, include_groups=False) # type: ignore[call-overload] + return apply(func) # type: ignore[return-value] # pragma: no cover + + def _apply_exprs_function(self, exprs: Iterable[PandasLikeExpr]) -> NativeApply: + ns = self.compliant.__narwhals_namespace__() + into_series = ns._series.from_iterable + + def fn(df: pd.DataFrame) -> pd.Series[Any]: + compliant = self.compliant._with_native(df) + results = [ + (keys.native.iloc[0], keys.name) + for expr in exprs + for keys in expr(compliant) + ] + out_group, out_names = zip(*results, strict=True) if results else ([], []) + return into_series(out_group, index=out_names, context=ns).native + + return fn + + def __iter__(self) -> Iterator[tuple[Any, PandasLikeDataFrame]]: + grouped = self._native.groupby(self._keys.copy(), **self._group_by_kwargs) + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + message=".*a length 1 tuple will be returned", + category=FutureWarning, + ) + with_native = self.compliant._with_native + for key, group in grouped: + yield (key, with_native(group).simple_select(*self._original_columns)) + + +def empty_results_error() -> ValueError: + """Don't even attempt this, it's way too inconsistent across pandas versions.""" + msg = ( + "No results for group-by aggregation.\n\n" + "Hint: you were probably trying to apply a non-elementary aggregation with a " + "pandas-like API.\n" + "Please rewrite your query such that group-by aggregations " + "are elementary. For example, instead of:\n\n" + " df.group_by('a').agg(nw.col('b').round(2).mean())\n\n" + "use:\n\n" + " df.with_columns(nw.col('b').round(2)).group_by('a').agg(nw.col('b').mean())\n\n" + ) + return ValueError(msg) + + +def warn_complex_group_by() -> None: + issue_warning( + "Found complex group-by expression, which can't be expressed efficiently with the " + "pandas API. If you can, please rewrite your query such that group-by aggregations " + "are simple (e.g. mean, std, min, max, ...). \n\n" + "Please see: " + "https://narwhals-dev.github.io/narwhals/concepts/improve_group_by_operation/", + UserWarning, + ) diff --git a/shared/package-files/9e/9ef189438f3b81ec60819bc3774b6e527ef12b2a0eb7fbee960b517b5400cd2d/blob b/shared/package-files/9e/9ef189438f3b81ec60819bc3774b6e527ef12b2a0eb7fbee960b517b5400cd2d/blob new file mode 100644 index 0000000000000000000000000000000000000000..2bbfd1ec9478c1a8f50af4e8d0be98662c56a792 Binary files /dev/null and b/shared/package-files/9e/9ef189438f3b81ec60819bc3774b6e527ef12b2a0eb7fbee960b517b5400cd2d/blob differ diff --git a/shared/package-files/9e/9ef463d49e395be29106fb7cc8587933a862339141f7bd0eeab3c414eec9b28e/blob b/shared/package-files/9e/9ef463d49e395be29106fb7cc8587933a862339141f7bd0eeab3c414eec9b28e/blob new file mode 100644 index 0000000000000000000000000000000000000000..19def292a9494398c2d8646ab1ce2ed51e660fad --- /dev/null +++ b/shared/package-files/9e/9ef463d49e395be29106fb7cc8587933a862339141f7bd0eeab3c414eec9b28e/blob @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::_test_parallel_materialize(Tensor self, int num_parallel, bool skip_first=False) -> Tensor +inline at::Tensor _test_parallel_materialize(const at::Tensor & self, int64_t num_parallel, bool skip_first=false) { + return at::_ops::_test_parallel_materialize::call(self, num_parallel, skip_first); +} + +} diff --git a/shared/package-files/9e/9ef4741c6d01dbe184629162a283c42c83a07cbe97de051eb4f8051ae1f89d6b/blob b/shared/package-files/9e/9ef4741c6d01dbe184629162a283c42c83a07cbe97de051eb4f8051ae1f89d6b/blob new file mode 100644 index 0000000000000000000000000000000000000000..f7869f0a9d1924b77255ac258e9fd9cc36127aae --- /dev/null +++ b/shared/package-files/9e/9ef4741c6d01dbe184629162a283c42c83a07cbe97de051eb4f8051ae1f89d6b/blob @@ -0,0 +1,8 @@ +from ..extension import _load_library + + +try: + _load_library("Decoder") + _HAS_GPU_VIDEO_DECODER = True +except (ImportError, OSError): + _HAS_GPU_VIDEO_DECODER = False diff --git a/shared/package-files/9e/9ef47cceaf3682c22a879adb3968fbfec3982e02fc2773349685f0fcbf8e19a8/blob b/shared/package-files/9e/9ef47cceaf3682c22a879adb3968fbfec3982e02fc2773349685f0fcbf8e19a8/blob new file mode 100644 index 0000000000000000000000000000000000000000..c5b1295ee4a7d4ad8f4a76b58e4b40837cd46d4c --- /dev/null +++ b/shared/package-files/9e/9ef47cceaf3682c22a879adb3968fbfec3982e02fc2773349685f0fcbf8e19a8/blob @@ -0,0 +1,230 @@ +import operator + +import pytest + +from pandas._config.config import _get_option + +from pandas import ( + Series, + options, +) + + +@pytest.fixture +def dtype(): + """A fixture providing the ExtensionDtype to validate.""" + raise NotImplementedError + + +@pytest.fixture +def data(): + """ + Length-100 array for this type. + + * data[0] and data[1] should both be non missing + * data[0] and data[1] should not be equal + """ + raise NotImplementedError + + +@pytest.fixture +def data_for_twos(dtype): + """ + Length-100 array in which all the elements are two. + + Call pytest.skip in your fixture if the dtype does not support divmod. + """ + if not (dtype._is_numeric or dtype.kind == "m"): + # Object-dtypes may want to allow this, but for the most part + # only numeric and timedelta-like dtypes will need to implement this. + pytest.skip(f"{dtype} is not a numeric dtype") + + raise NotImplementedError + + +@pytest.fixture +def data_missing(): + """Length-2 array with [NA, Valid]""" + raise NotImplementedError + + +@pytest.fixture(params=["data", "data_missing"]) +def all_data(request, data, data_missing): + """Parametrized fixture giving 'data' and 'data_missing'""" + if request.param == "data": + return data + elif request.param == "data_missing": + return data_missing + + +@pytest.fixture +def data_repeated(data): + """ + Generate many datasets. + + Parameters + ---------- + data : fixture implementing `data` + + Returns + ------- + Callable[[int], Generator]: + A callable that takes a `count` argument and + returns a generator yielding `count` datasets. + """ + + def gen(count): + for _ in range(count): + yield data + + return gen + + +@pytest.fixture +def data_for_sorting(): + """ + Length-3 array with a known sort order. + + This should be three items [B, C, A] with + A < B < C + + For boolean dtypes (for which there are only 2 values available), + set B=C=True + """ + raise NotImplementedError + + +@pytest.fixture +def data_missing_for_sorting(): + """ + Length-3 array with a known sort order. + + This should be three items [B, NA, A] with + A < B and NA missing. + """ + raise NotImplementedError + + +@pytest.fixture +def na_cmp(): + """ + Binary operator for comparing NA values. + + Should return a function of two arguments that returns + True if both arguments are (scalar) NA for your type. + + By default, uses ``operator.is_`` + """ + return operator.is_ + + +@pytest.fixture +def na_value(dtype): + """ + The scalar missing value for this type. Default dtype.na_value. + + TODO: can be removed in 3.x (see https://github.com/pandas-dev/pandas/pull/54930) + """ + return dtype.na_value + + +@pytest.fixture +def data_for_grouping(): + """ + Data for factorization, grouping, and unique tests. + + Expected to be like [B, B, NA, NA, A, A, B, C] + + Where A < B < C and NA is missing. + + If a dtype has _is_boolean = True, i.e. only 2 unique non-NA entries, + then set C=B. + """ + raise NotImplementedError + + +@pytest.fixture(params=[True, False]) +def box_in_series(request): + """Whether to box the data in a Series""" + return request.param + + +@pytest.fixture( + params=[ + lambda x: 1, + lambda x: [1] * len(x), + lambda x: Series([1] * len(x)), + lambda x: x, + ], + ids=["scalar", "list", "series", "object"], +) +def groupby_apply_op(request): + """ + Functions to test groupby.apply(). + """ + return request.param + + +@pytest.fixture(params=[True, False]) +def as_frame(request): + """ + Boolean fixture to support Series and Series.to_frame() comparison testing. + """ + return request.param + + +@pytest.fixture(params=[True, False]) +def as_series(request): + """ + Boolean fixture to support arr and Series(arr) comparison testing. + """ + return request.param + + +@pytest.fixture(params=[True, False]) +def use_numpy(request): + """ + Boolean fixture to support comparison testing of ExtensionDtype array + and numpy array. + """ + return request.param + + +@pytest.fixture(params=["ffill", "bfill"]) +def fillna_method(request): + """ + Parametrized fixture giving method parameters 'ffill' and 'bfill' for + Series.fillna(method=) testing. + """ + return request.param + + +@pytest.fixture(params=[True, False]) +def as_array(request): + """ + Boolean fixture to support ExtensionDtype _from_sequence method testing. + """ + return request.param + + +@pytest.fixture +def invalid_scalar(data): + """ + A scalar that *cannot* be held by this ExtensionArray. + + The default should work for most subclasses, but is not guaranteed. + + If the array can hold any item (i.e. object dtype), then use pytest.skip. + """ + return object.__new__(object) + + +@pytest.fixture +def using_copy_on_write() -> bool: + """ + Fixture to check if Copy-on-Write is enabled. + """ + return ( + options.mode.copy_on_write is True + and _get_option("mode.data_manager", silent=True) == "block" + ) diff --git a/shared/package-files/9e/9ef65e28678a56de880dd29a2867bda394054ee8be51dffef646819c72b86b10/blob b/shared/package-files/9e/9ef65e28678a56de880dd29a2867bda394054ee8be51dffef646819c72b86b10/blob new file mode 100644 index 0000000000000000000000000000000000000000..5b4da0b37f49cb40b81ca91e715702d770dc2a0f --- /dev/null +++ b/shared/package-files/9e/9ef65e28678a56de880dd29a2867bda394054ee8be51dffef646819c72b86b10/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API ::std::tuple nll_loss_forward(const at::Tensor & self, const at::Tensor & target, const c10::optional & weight, int64_t reduction, int64_t ignore_index); +TORCH_API ::std::tuple nll_loss_forward_symint(const at::Tensor & self, const at::Tensor & target, const c10::optional & weight, int64_t reduction, c10::SymInt ignore_index); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9e/9efab3ead4ec3ce2a9cfb53b62df89cb37055182765fdbaec9fd734c76d026f5/blob b/shared/package-files/9e/9efab3ead4ec3ce2a9cfb53b62df89cb37055182765fdbaec9fd734c76d026f5/blob new file mode 100644 index 0000000000000000000000000000000000000000..eb6f998371410541d59d90fb20d4b477770507a8 Binary files /dev/null and b/shared/package-files/9e/9efab3ead4ec3ce2a9cfb53b62df89cb37055182765fdbaec9fd734c76d026f5/blob differ diff --git a/shared/package-files/9e/9efcc8e85bbd1687272a0991f6d0429a4c06679db2d114b2ac95db27a70f9d13/blob b/shared/package-files/9e/9efcc8e85bbd1687272a0991f6d0429a4c06679db2d114b2ac95db27a70f9d13/blob new file mode 100644 index 0000000000000000000000000000000000000000..bec7ae39fbac9d9310a1dbd67c07a6c7017f785e --- /dev/null +++ b/shared/package-files/9e/9efcc8e85bbd1687272a0991f6d0429a4c06679db2d114b2ac95db27a70f9d13/blob @@ -0,0 +1,698 @@ +""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py. + +"""#" + +import codecs + +### Codec APIs + +class Codec(codecs.Codec): + + def encode(self,input,errors='strict'): + return codecs.charmap_encode(input,errors,encoding_map) + + def decode(self,input,errors='strict'): + return codecs.charmap_decode(input,errors,decoding_table) + +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input, final=False): + return codecs.charmap_encode(input,self.errors,encoding_map)[0] + +class IncrementalDecoder(codecs.IncrementalDecoder): + def decode(self, input, final=False): + return codecs.charmap_decode(input,self.errors,decoding_table)[0] + +class StreamWriter(Codec,codecs.StreamWriter): + pass + +class StreamReader(Codec,codecs.StreamReader): + pass + +### encodings module API + +def getregentry(): + return codecs.CodecInfo( + name='cp866', + encode=Codec().encode, + decode=Codec().decode, + incrementalencoder=IncrementalEncoder, + incrementaldecoder=IncrementalDecoder, + streamreader=StreamReader, + streamwriter=StreamWriter, + ) + +### Decoding Map + +decoding_map = codecs.make_identity_dict(range(256)) +decoding_map.update({ + 0x0080: 0x0410, # CYRILLIC CAPITAL LETTER A + 0x0081: 0x0411, # CYRILLIC CAPITAL LETTER BE + 0x0082: 0x0412, # CYRILLIC CAPITAL LETTER VE + 0x0083: 0x0413, # CYRILLIC CAPITAL LETTER GHE + 0x0084: 0x0414, # CYRILLIC CAPITAL LETTER DE + 0x0085: 0x0415, # CYRILLIC CAPITAL LETTER IE + 0x0086: 0x0416, # CYRILLIC CAPITAL LETTER ZHE + 0x0087: 0x0417, # CYRILLIC CAPITAL LETTER ZE + 0x0088: 0x0418, # CYRILLIC CAPITAL LETTER I + 0x0089: 0x0419, # CYRILLIC CAPITAL LETTER SHORT I + 0x008a: 0x041a, # CYRILLIC CAPITAL LETTER KA + 0x008b: 0x041b, # CYRILLIC CAPITAL LETTER EL + 0x008c: 0x041c, # CYRILLIC CAPITAL LETTER EM + 0x008d: 0x041d, # CYRILLIC CAPITAL LETTER EN + 0x008e: 0x041e, # CYRILLIC CAPITAL LETTER O + 0x008f: 0x041f, # CYRILLIC CAPITAL LETTER PE + 0x0090: 0x0420, # CYRILLIC CAPITAL LETTER ER + 0x0091: 0x0421, # CYRILLIC CAPITAL LETTER ES + 0x0092: 0x0422, # CYRILLIC CAPITAL LETTER TE + 0x0093: 0x0423, # CYRILLIC CAPITAL LETTER U + 0x0094: 0x0424, # CYRILLIC CAPITAL LETTER EF + 0x0095: 0x0425, # CYRILLIC CAPITAL LETTER HA + 0x0096: 0x0426, # CYRILLIC CAPITAL LETTER TSE + 0x0097: 0x0427, # CYRILLIC CAPITAL LETTER CHE + 0x0098: 0x0428, # CYRILLIC CAPITAL LETTER SHA + 0x0099: 0x0429, # CYRILLIC CAPITAL LETTER SHCHA + 0x009a: 0x042a, # CYRILLIC CAPITAL LETTER HARD SIGN + 0x009b: 0x042b, # CYRILLIC CAPITAL LETTER YERU + 0x009c: 0x042c, # CYRILLIC CAPITAL LETTER SOFT SIGN + 0x009d: 0x042d, # CYRILLIC CAPITAL LETTER E + 0x009e: 0x042e, # CYRILLIC CAPITAL LETTER YU + 0x009f: 0x042f, # CYRILLIC CAPITAL LETTER YA + 0x00a0: 0x0430, # CYRILLIC SMALL LETTER A + 0x00a1: 0x0431, # CYRILLIC SMALL LETTER BE + 0x00a2: 0x0432, # CYRILLIC SMALL LETTER VE + 0x00a3: 0x0433, # CYRILLIC SMALL LETTER GHE + 0x00a4: 0x0434, # CYRILLIC SMALL LETTER DE + 0x00a5: 0x0435, # CYRILLIC SMALL LETTER IE + 0x00a6: 0x0436, # CYRILLIC SMALL LETTER ZHE + 0x00a7: 0x0437, # CYRILLIC SMALL LETTER ZE + 0x00a8: 0x0438, # CYRILLIC SMALL LETTER I + 0x00a9: 0x0439, # CYRILLIC SMALL LETTER SHORT I + 0x00aa: 0x043a, # CYRILLIC SMALL LETTER KA + 0x00ab: 0x043b, # CYRILLIC SMALL LETTER EL + 0x00ac: 0x043c, # CYRILLIC SMALL LETTER EM + 0x00ad: 0x043d, # CYRILLIC SMALL LETTER EN + 0x00ae: 0x043e, # CYRILLIC SMALL LETTER O + 0x00af: 0x043f, # CYRILLIC SMALL LETTER PE + 0x00b0: 0x2591, # LIGHT SHADE + 0x00b1: 0x2592, # MEDIUM SHADE + 0x00b2: 0x2593, # DARK SHADE + 0x00b3: 0x2502, # BOX DRAWINGS LIGHT VERTICAL + 0x00b4: 0x2524, # BOX DRAWINGS LIGHT VERTICAL AND LEFT + 0x00b5: 0x2561, # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE + 0x00b6: 0x2562, # BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE + 0x00b7: 0x2556, # BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE + 0x00b8: 0x2555, # BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE + 0x00b9: 0x2563, # BOX DRAWINGS DOUBLE VERTICAL AND LEFT + 0x00ba: 0x2551, # BOX DRAWINGS DOUBLE VERTICAL + 0x00bb: 0x2557, # BOX DRAWINGS DOUBLE DOWN AND LEFT + 0x00bc: 0x255d, # BOX DRAWINGS DOUBLE UP AND LEFT + 0x00bd: 0x255c, # BOX DRAWINGS UP DOUBLE AND LEFT SINGLE + 0x00be: 0x255b, # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE + 0x00bf: 0x2510, # BOX DRAWINGS LIGHT DOWN AND LEFT + 0x00c0: 0x2514, # BOX DRAWINGS LIGHT UP AND RIGHT + 0x00c1: 0x2534, # BOX DRAWINGS LIGHT UP AND HORIZONTAL + 0x00c2: 0x252c, # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL + 0x00c3: 0x251c, # BOX DRAWINGS LIGHT VERTICAL AND RIGHT + 0x00c4: 0x2500, # BOX DRAWINGS LIGHT HORIZONTAL + 0x00c5: 0x253c, # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL + 0x00c6: 0x255e, # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE + 0x00c7: 0x255f, # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE + 0x00c8: 0x255a, # BOX DRAWINGS DOUBLE UP AND RIGHT + 0x00c9: 0x2554, # BOX DRAWINGS DOUBLE DOWN AND RIGHT + 0x00ca: 0x2569, # BOX DRAWINGS DOUBLE UP AND HORIZONTAL + 0x00cb: 0x2566, # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL + 0x00cc: 0x2560, # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT + 0x00cd: 0x2550, # BOX DRAWINGS DOUBLE HORIZONTAL + 0x00ce: 0x256c, # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL + 0x00cf: 0x2567, # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE + 0x00d0: 0x2568, # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE + 0x00d1: 0x2564, # BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE + 0x00d2: 0x2565, # BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE + 0x00d3: 0x2559, # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE + 0x00d4: 0x2558, # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE + 0x00d5: 0x2552, # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE + 0x00d6: 0x2553, # BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE + 0x00d7: 0x256b, # BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE + 0x00d8: 0x256a, # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE + 0x00d9: 0x2518, # BOX DRAWINGS LIGHT UP AND LEFT + 0x00da: 0x250c, # BOX DRAWINGS LIGHT DOWN AND RIGHT + 0x00db: 0x2588, # FULL BLOCK + 0x00dc: 0x2584, # LOWER HALF BLOCK + 0x00dd: 0x258c, # LEFT HALF BLOCK + 0x00de: 0x2590, # RIGHT HALF BLOCK + 0x00df: 0x2580, # UPPER HALF BLOCK + 0x00e0: 0x0440, # CYRILLIC SMALL LETTER ER + 0x00e1: 0x0441, # CYRILLIC SMALL LETTER ES + 0x00e2: 0x0442, # CYRILLIC SMALL LETTER TE + 0x00e3: 0x0443, # CYRILLIC SMALL LETTER U + 0x00e4: 0x0444, # CYRILLIC SMALL LETTER EF + 0x00e5: 0x0445, # CYRILLIC SMALL LETTER HA + 0x00e6: 0x0446, # CYRILLIC SMALL LETTER TSE + 0x00e7: 0x0447, # CYRILLIC SMALL LETTER CHE + 0x00e8: 0x0448, # CYRILLIC SMALL LETTER SHA + 0x00e9: 0x0449, # CYRILLIC SMALL LETTER SHCHA + 0x00ea: 0x044a, # CYRILLIC SMALL LETTER HARD SIGN + 0x00eb: 0x044b, # CYRILLIC SMALL LETTER YERU + 0x00ec: 0x044c, # CYRILLIC SMALL LETTER SOFT SIGN + 0x00ed: 0x044d, # CYRILLIC SMALL LETTER E + 0x00ee: 0x044e, # CYRILLIC SMALL LETTER YU + 0x00ef: 0x044f, # CYRILLIC SMALL LETTER YA + 0x00f0: 0x0401, # CYRILLIC CAPITAL LETTER IO + 0x00f1: 0x0451, # CYRILLIC SMALL LETTER IO + 0x00f2: 0x0404, # CYRILLIC CAPITAL LETTER UKRAINIAN IE + 0x00f3: 0x0454, # CYRILLIC SMALL LETTER UKRAINIAN IE + 0x00f4: 0x0407, # CYRILLIC CAPITAL LETTER YI + 0x00f5: 0x0457, # CYRILLIC SMALL LETTER YI + 0x00f6: 0x040e, # CYRILLIC CAPITAL LETTER SHORT U + 0x00f7: 0x045e, # CYRILLIC SMALL LETTER SHORT U + 0x00f8: 0x00b0, # DEGREE SIGN + 0x00f9: 0x2219, # BULLET OPERATOR + 0x00fa: 0x00b7, # MIDDLE DOT + 0x00fb: 0x221a, # SQUARE ROOT + 0x00fc: 0x2116, # NUMERO SIGN + 0x00fd: 0x00a4, # CURRENCY SIGN + 0x00fe: 0x25a0, # BLACK SQUARE + 0x00ff: 0x00a0, # NO-BREAK SPACE +}) + +### Decoding Table + +decoding_table = ( + '\x00' # 0x0000 -> NULL + '\x01' # 0x0001 -> START OF HEADING + '\x02' # 0x0002 -> START OF TEXT + '\x03' # 0x0003 -> END OF TEXT + '\x04' # 0x0004 -> END OF TRANSMISSION + '\x05' # 0x0005 -> ENQUIRY + '\x06' # 0x0006 -> ACKNOWLEDGE + '\x07' # 0x0007 -> BELL + '\x08' # 0x0008 -> BACKSPACE + '\t' # 0x0009 -> HORIZONTAL TABULATION + '\n' # 0x000a -> LINE FEED + '\x0b' # 0x000b -> VERTICAL TABULATION + '\x0c' # 0x000c -> FORM FEED + '\r' # 0x000d -> CARRIAGE RETURN + '\x0e' # 0x000e -> SHIFT OUT + '\x0f' # 0x000f -> SHIFT IN + '\x10' # 0x0010 -> DATA LINK ESCAPE + '\x11' # 0x0011 -> DEVICE CONTROL ONE + '\x12' # 0x0012 -> DEVICE CONTROL TWO + '\x13' # 0x0013 -> DEVICE CONTROL THREE + '\x14' # 0x0014 -> DEVICE CONTROL FOUR + '\x15' # 0x0015 -> NEGATIVE ACKNOWLEDGE + '\x16' # 0x0016 -> SYNCHRONOUS IDLE + '\x17' # 0x0017 -> END OF TRANSMISSION BLOCK + '\x18' # 0x0018 -> CANCEL + '\x19' # 0x0019 -> END OF MEDIUM + '\x1a' # 0x001a -> SUBSTITUTE + '\x1b' # 0x001b -> ESCAPE + '\x1c' # 0x001c -> FILE SEPARATOR + '\x1d' # 0x001d -> GROUP SEPARATOR + '\x1e' # 0x001e -> RECORD SEPARATOR + '\x1f' # 0x001f -> UNIT SEPARATOR + ' ' # 0x0020 -> SPACE + '!' # 0x0021 -> EXCLAMATION MARK + '"' # 0x0022 -> QUOTATION MARK + '#' # 0x0023 -> NUMBER SIGN + '$' # 0x0024 -> DOLLAR SIGN + '%' # 0x0025 -> PERCENT SIGN + '&' # 0x0026 -> AMPERSAND + "'" # 0x0027 -> APOSTROPHE + '(' # 0x0028 -> LEFT PARENTHESIS + ')' # 0x0029 -> RIGHT PARENTHESIS + '*' # 0x002a -> ASTERISK + '+' # 0x002b -> PLUS SIGN + ',' # 0x002c -> COMMA + '-' # 0x002d -> HYPHEN-MINUS + '.' # 0x002e -> FULL STOP + '/' # 0x002f -> SOLIDUS + '0' # 0x0030 -> DIGIT ZERO + '1' # 0x0031 -> DIGIT ONE + '2' # 0x0032 -> DIGIT TWO + '3' # 0x0033 -> DIGIT THREE + '4' # 0x0034 -> DIGIT FOUR + '5' # 0x0035 -> DIGIT FIVE + '6' # 0x0036 -> DIGIT SIX + '7' # 0x0037 -> DIGIT SEVEN + '8' # 0x0038 -> DIGIT EIGHT + '9' # 0x0039 -> DIGIT NINE + ':' # 0x003a -> COLON + ';' # 0x003b -> SEMICOLON + '<' # 0x003c -> LESS-THAN SIGN + '=' # 0x003d -> EQUALS SIGN + '>' # 0x003e -> GREATER-THAN SIGN + '?' # 0x003f -> QUESTION MARK + '@' # 0x0040 -> COMMERCIAL AT + 'A' # 0x0041 -> LATIN CAPITAL LETTER A + 'B' # 0x0042 -> LATIN CAPITAL LETTER B + 'C' # 0x0043 -> LATIN CAPITAL LETTER C + 'D' # 0x0044 -> LATIN CAPITAL LETTER D + 'E' # 0x0045 -> LATIN CAPITAL LETTER E + 'F' # 0x0046 -> LATIN CAPITAL LETTER F + 'G' # 0x0047 -> LATIN CAPITAL LETTER G + 'H' # 0x0048 -> LATIN CAPITAL LETTER H + 'I' # 0x0049 -> LATIN CAPITAL LETTER I + 'J' # 0x004a -> LATIN CAPITAL LETTER J + 'K' # 0x004b -> LATIN CAPITAL LETTER K + 'L' # 0x004c -> LATIN CAPITAL LETTER L + 'M' # 0x004d -> LATIN CAPITAL LETTER M + 'N' # 0x004e -> LATIN CAPITAL LETTER N + 'O' # 0x004f -> LATIN CAPITAL LETTER O + 'P' # 0x0050 -> LATIN CAPITAL LETTER P + 'Q' # 0x0051 -> LATIN CAPITAL LETTER Q + 'R' # 0x0052 -> LATIN CAPITAL LETTER R + 'S' # 0x0053 -> LATIN CAPITAL LETTER S + 'T' # 0x0054 -> LATIN CAPITAL LETTER T + 'U' # 0x0055 -> LATIN CAPITAL LETTER U + 'V' # 0x0056 -> LATIN CAPITAL LETTER V + 'W' # 0x0057 -> LATIN CAPITAL LETTER W + 'X' # 0x0058 -> LATIN CAPITAL LETTER X + 'Y' # 0x0059 -> LATIN CAPITAL LETTER Y + 'Z' # 0x005a -> LATIN CAPITAL LETTER Z + '[' # 0x005b -> LEFT SQUARE BRACKET + '\\' # 0x005c -> REVERSE SOLIDUS + ']' # 0x005d -> RIGHT SQUARE BRACKET + '^' # 0x005e -> CIRCUMFLEX ACCENT + '_' # 0x005f -> LOW LINE + '`' # 0x0060 -> GRAVE ACCENT + 'a' # 0x0061 -> LATIN SMALL LETTER A + 'b' # 0x0062 -> LATIN SMALL LETTER B + 'c' # 0x0063 -> LATIN SMALL LETTER C + 'd' # 0x0064 -> LATIN SMALL LETTER D + 'e' # 0x0065 -> LATIN SMALL LETTER E + 'f' # 0x0066 -> LATIN SMALL LETTER F + 'g' # 0x0067 -> LATIN SMALL LETTER G + 'h' # 0x0068 -> LATIN SMALL LETTER H + 'i' # 0x0069 -> LATIN SMALL LETTER I + 'j' # 0x006a -> LATIN SMALL LETTER J + 'k' # 0x006b -> LATIN SMALL LETTER K + 'l' # 0x006c -> LATIN SMALL LETTER L + 'm' # 0x006d -> LATIN SMALL LETTER M + 'n' # 0x006e -> LATIN SMALL LETTER N + 'o' # 0x006f -> LATIN SMALL LETTER O + 'p' # 0x0070 -> LATIN SMALL LETTER P + 'q' # 0x0071 -> LATIN SMALL LETTER Q + 'r' # 0x0072 -> LATIN SMALL LETTER R + 's' # 0x0073 -> LATIN SMALL LETTER S + 't' # 0x0074 -> LATIN SMALL LETTER T + 'u' # 0x0075 -> LATIN SMALL LETTER U + 'v' # 0x0076 -> LATIN SMALL LETTER V + 'w' # 0x0077 -> LATIN SMALL LETTER W + 'x' # 0x0078 -> LATIN SMALL LETTER X + 'y' # 0x0079 -> LATIN SMALL LETTER Y + 'z' # 0x007a -> LATIN SMALL LETTER Z + '{' # 0x007b -> LEFT CURLY BRACKET + '|' # 0x007c -> VERTICAL LINE + '}' # 0x007d -> RIGHT CURLY BRACKET + '~' # 0x007e -> TILDE + '\x7f' # 0x007f -> DELETE + '\u0410' # 0x0080 -> CYRILLIC CAPITAL LETTER A + '\u0411' # 0x0081 -> CYRILLIC CAPITAL LETTER BE + '\u0412' # 0x0082 -> CYRILLIC CAPITAL LETTER VE + '\u0413' # 0x0083 -> CYRILLIC CAPITAL LETTER GHE + '\u0414' # 0x0084 -> CYRILLIC CAPITAL LETTER DE + '\u0415' # 0x0085 -> CYRILLIC CAPITAL LETTER IE + '\u0416' # 0x0086 -> CYRILLIC CAPITAL LETTER ZHE + '\u0417' # 0x0087 -> CYRILLIC CAPITAL LETTER ZE + '\u0418' # 0x0088 -> CYRILLIC CAPITAL LETTER I + '\u0419' # 0x0089 -> CYRILLIC CAPITAL LETTER SHORT I + '\u041a' # 0x008a -> CYRILLIC CAPITAL LETTER KA + '\u041b' # 0x008b -> CYRILLIC CAPITAL LETTER EL + '\u041c' # 0x008c -> CYRILLIC CAPITAL LETTER EM + '\u041d' # 0x008d -> CYRILLIC CAPITAL LETTER EN + '\u041e' # 0x008e -> CYRILLIC CAPITAL LETTER O + '\u041f' # 0x008f -> CYRILLIC CAPITAL LETTER PE + '\u0420' # 0x0090 -> CYRILLIC CAPITAL LETTER ER + '\u0421' # 0x0091 -> CYRILLIC CAPITAL LETTER ES + '\u0422' # 0x0092 -> CYRILLIC CAPITAL LETTER TE + '\u0423' # 0x0093 -> CYRILLIC CAPITAL LETTER U + '\u0424' # 0x0094 -> CYRILLIC CAPITAL LETTER EF + '\u0425' # 0x0095 -> CYRILLIC CAPITAL LETTER HA + '\u0426' # 0x0096 -> CYRILLIC CAPITAL LETTER TSE + '\u0427' # 0x0097 -> CYRILLIC CAPITAL LETTER CHE + '\u0428' # 0x0098 -> CYRILLIC CAPITAL LETTER SHA + '\u0429' # 0x0099 -> CYRILLIC CAPITAL LETTER SHCHA + '\u042a' # 0x009a -> CYRILLIC CAPITAL LETTER HARD SIGN + '\u042b' # 0x009b -> CYRILLIC CAPITAL LETTER YERU + '\u042c' # 0x009c -> CYRILLIC CAPITAL LETTER SOFT SIGN + '\u042d' # 0x009d -> CYRILLIC CAPITAL LETTER E + '\u042e' # 0x009e -> CYRILLIC CAPITAL LETTER YU + '\u042f' # 0x009f -> CYRILLIC CAPITAL LETTER YA + '\u0430' # 0x00a0 -> CYRILLIC SMALL LETTER A + '\u0431' # 0x00a1 -> CYRILLIC SMALL LETTER BE + '\u0432' # 0x00a2 -> CYRILLIC SMALL LETTER VE + '\u0433' # 0x00a3 -> CYRILLIC SMALL LETTER GHE + '\u0434' # 0x00a4 -> CYRILLIC SMALL LETTER DE + '\u0435' # 0x00a5 -> CYRILLIC SMALL LETTER IE + '\u0436' # 0x00a6 -> CYRILLIC SMALL LETTER ZHE + '\u0437' # 0x00a7 -> CYRILLIC SMALL LETTER ZE + '\u0438' # 0x00a8 -> CYRILLIC SMALL LETTER I + '\u0439' # 0x00a9 -> CYRILLIC SMALL LETTER SHORT I + '\u043a' # 0x00aa -> CYRILLIC SMALL LETTER KA + '\u043b' # 0x00ab -> CYRILLIC SMALL LETTER EL + '\u043c' # 0x00ac -> CYRILLIC SMALL LETTER EM + '\u043d' # 0x00ad -> CYRILLIC SMALL LETTER EN + '\u043e' # 0x00ae -> CYRILLIC SMALL LETTER O + '\u043f' # 0x00af -> CYRILLIC SMALL LETTER PE + '\u2591' # 0x00b0 -> LIGHT SHADE + '\u2592' # 0x00b1 -> MEDIUM SHADE + '\u2593' # 0x00b2 -> DARK SHADE + '\u2502' # 0x00b3 -> BOX DRAWINGS LIGHT VERTICAL + '\u2524' # 0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT + '\u2561' # 0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE + '\u2562' # 0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE + '\u2556' # 0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE + '\u2555' # 0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE + '\u2563' # 0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT + '\u2551' # 0x00ba -> BOX DRAWINGS DOUBLE VERTICAL + '\u2557' # 0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT + '\u255d' # 0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT + '\u255c' # 0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE + '\u255b' # 0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE + '\u2510' # 0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT + '\u2514' # 0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT + '\u2534' # 0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL + '\u252c' # 0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL + '\u251c' # 0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT + '\u2500' # 0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL + '\u253c' # 0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL + '\u255e' # 0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE + '\u255f' # 0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE + '\u255a' # 0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT + '\u2554' # 0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT + '\u2569' # 0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL + '\u2566' # 0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL + '\u2560' # 0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT + '\u2550' # 0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL + '\u256c' # 0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL + '\u2567' # 0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE + '\u2568' # 0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE + '\u2564' # 0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE + '\u2565' # 0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE + '\u2559' # 0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE + '\u2558' # 0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE + '\u2552' # 0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE + '\u2553' # 0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE + '\u256b' # 0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE + '\u256a' # 0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE + '\u2518' # 0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT + '\u250c' # 0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT + '\u2588' # 0x00db -> FULL BLOCK + '\u2584' # 0x00dc -> LOWER HALF BLOCK + '\u258c' # 0x00dd -> LEFT HALF BLOCK + '\u2590' # 0x00de -> RIGHT HALF BLOCK + '\u2580' # 0x00df -> UPPER HALF BLOCK + '\u0440' # 0x00e0 -> CYRILLIC SMALL LETTER ER + '\u0441' # 0x00e1 -> CYRILLIC SMALL LETTER ES + '\u0442' # 0x00e2 -> CYRILLIC SMALL LETTER TE + '\u0443' # 0x00e3 -> CYRILLIC SMALL LETTER U + '\u0444' # 0x00e4 -> CYRILLIC SMALL LETTER EF + '\u0445' # 0x00e5 -> CYRILLIC SMALL LETTER HA + '\u0446' # 0x00e6 -> CYRILLIC SMALL LETTER TSE + '\u0447' # 0x00e7 -> CYRILLIC SMALL LETTER CHE + '\u0448' # 0x00e8 -> CYRILLIC SMALL LETTER SHA + '\u0449' # 0x00e9 -> CYRILLIC SMALL LETTER SHCHA + '\u044a' # 0x00ea -> CYRILLIC SMALL LETTER HARD SIGN + '\u044b' # 0x00eb -> CYRILLIC SMALL LETTER YERU + '\u044c' # 0x00ec -> CYRILLIC SMALL LETTER SOFT SIGN + '\u044d' # 0x00ed -> CYRILLIC SMALL LETTER E + '\u044e' # 0x00ee -> CYRILLIC SMALL LETTER YU + '\u044f' # 0x00ef -> CYRILLIC SMALL LETTER YA + '\u0401' # 0x00f0 -> CYRILLIC CAPITAL LETTER IO + '\u0451' # 0x00f1 -> CYRILLIC SMALL LETTER IO + '\u0404' # 0x00f2 -> CYRILLIC CAPITAL LETTER UKRAINIAN IE + '\u0454' # 0x00f3 -> CYRILLIC SMALL LETTER UKRAINIAN IE + '\u0407' # 0x00f4 -> CYRILLIC CAPITAL LETTER YI + '\u0457' # 0x00f5 -> CYRILLIC SMALL LETTER YI + '\u040e' # 0x00f6 -> CYRILLIC CAPITAL LETTER SHORT U + '\u045e' # 0x00f7 -> CYRILLIC SMALL LETTER SHORT U + '\xb0' # 0x00f8 -> DEGREE SIGN + '\u2219' # 0x00f9 -> BULLET OPERATOR + '\xb7' # 0x00fa -> MIDDLE DOT + '\u221a' # 0x00fb -> SQUARE ROOT + '\u2116' # 0x00fc -> NUMERO SIGN + '\xa4' # 0x00fd -> CURRENCY SIGN + '\u25a0' # 0x00fe -> BLACK SQUARE + '\xa0' # 0x00ff -> NO-BREAK SPACE +) + +### Encoding Map + +encoding_map = { + 0x0000: 0x0000, # NULL + 0x0001: 0x0001, # START OF HEADING + 0x0002: 0x0002, # START OF TEXT + 0x0003: 0x0003, # END OF TEXT + 0x0004: 0x0004, # END OF TRANSMISSION + 0x0005: 0x0005, # ENQUIRY + 0x0006: 0x0006, # ACKNOWLEDGE + 0x0007: 0x0007, # BELL + 0x0008: 0x0008, # BACKSPACE + 0x0009: 0x0009, # HORIZONTAL TABULATION + 0x000a: 0x000a, # LINE FEED + 0x000b: 0x000b, # VERTICAL TABULATION + 0x000c: 0x000c, # FORM FEED + 0x000d: 0x000d, # CARRIAGE RETURN + 0x000e: 0x000e, # SHIFT OUT + 0x000f: 0x000f, # SHIFT IN + 0x0010: 0x0010, # DATA LINK ESCAPE + 0x0011: 0x0011, # DEVICE CONTROL ONE + 0x0012: 0x0012, # DEVICE CONTROL TWO + 0x0013: 0x0013, # DEVICE CONTROL THREE + 0x0014: 0x0014, # DEVICE CONTROL FOUR + 0x0015: 0x0015, # NEGATIVE ACKNOWLEDGE + 0x0016: 0x0016, # SYNCHRONOUS IDLE + 0x0017: 0x0017, # END OF TRANSMISSION BLOCK + 0x0018: 0x0018, # CANCEL + 0x0019: 0x0019, # END OF MEDIUM + 0x001a: 0x001a, # SUBSTITUTE + 0x001b: 0x001b, # ESCAPE + 0x001c: 0x001c, # FILE SEPARATOR + 0x001d: 0x001d, # GROUP SEPARATOR + 0x001e: 0x001e, # RECORD SEPARATOR + 0x001f: 0x001f, # UNIT SEPARATOR + 0x0020: 0x0020, # SPACE + 0x0021: 0x0021, # EXCLAMATION MARK + 0x0022: 0x0022, # QUOTATION MARK + 0x0023: 0x0023, # NUMBER SIGN + 0x0024: 0x0024, # DOLLAR SIGN + 0x0025: 0x0025, # PERCENT SIGN + 0x0026: 0x0026, # AMPERSAND + 0x0027: 0x0027, # APOSTROPHE + 0x0028: 0x0028, # LEFT PARENTHESIS + 0x0029: 0x0029, # RIGHT PARENTHESIS + 0x002a: 0x002a, # ASTERISK + 0x002b: 0x002b, # PLUS SIGN + 0x002c: 0x002c, # COMMA + 0x002d: 0x002d, # HYPHEN-MINUS + 0x002e: 0x002e, # FULL STOP + 0x002f: 0x002f, # SOLIDUS + 0x0030: 0x0030, # DIGIT ZERO + 0x0031: 0x0031, # DIGIT ONE + 0x0032: 0x0032, # DIGIT TWO + 0x0033: 0x0033, # DIGIT THREE + 0x0034: 0x0034, # DIGIT FOUR + 0x0035: 0x0035, # DIGIT FIVE + 0x0036: 0x0036, # DIGIT SIX + 0x0037: 0x0037, # DIGIT SEVEN + 0x0038: 0x0038, # DIGIT EIGHT + 0x0039: 0x0039, # DIGIT NINE + 0x003a: 0x003a, # COLON + 0x003b: 0x003b, # SEMICOLON + 0x003c: 0x003c, # LESS-THAN SIGN + 0x003d: 0x003d, # EQUALS SIGN + 0x003e: 0x003e, # GREATER-THAN SIGN + 0x003f: 0x003f, # QUESTION MARK + 0x0040: 0x0040, # COMMERCIAL AT + 0x0041: 0x0041, # LATIN CAPITAL LETTER A + 0x0042: 0x0042, # LATIN CAPITAL LETTER B + 0x0043: 0x0043, # LATIN CAPITAL LETTER C + 0x0044: 0x0044, # LATIN CAPITAL LETTER D + 0x0045: 0x0045, # LATIN CAPITAL LETTER E + 0x0046: 0x0046, # LATIN CAPITAL LETTER F + 0x0047: 0x0047, # LATIN CAPITAL LETTER G + 0x0048: 0x0048, # LATIN CAPITAL LETTER H + 0x0049: 0x0049, # LATIN CAPITAL LETTER I + 0x004a: 0x004a, # LATIN CAPITAL LETTER J + 0x004b: 0x004b, # LATIN CAPITAL LETTER K + 0x004c: 0x004c, # LATIN CAPITAL LETTER L + 0x004d: 0x004d, # LATIN CAPITAL LETTER M + 0x004e: 0x004e, # LATIN CAPITAL LETTER N + 0x004f: 0x004f, # LATIN CAPITAL LETTER O + 0x0050: 0x0050, # LATIN CAPITAL LETTER P + 0x0051: 0x0051, # LATIN CAPITAL LETTER Q + 0x0052: 0x0052, # LATIN CAPITAL LETTER R + 0x0053: 0x0053, # LATIN CAPITAL LETTER S + 0x0054: 0x0054, # LATIN CAPITAL LETTER T + 0x0055: 0x0055, # LATIN CAPITAL LETTER U + 0x0056: 0x0056, # LATIN CAPITAL LETTER V + 0x0057: 0x0057, # LATIN CAPITAL LETTER W + 0x0058: 0x0058, # LATIN CAPITAL LETTER X + 0x0059: 0x0059, # LATIN CAPITAL LETTER Y + 0x005a: 0x005a, # LATIN CAPITAL LETTER Z + 0x005b: 0x005b, # LEFT SQUARE BRACKET + 0x005c: 0x005c, # REVERSE SOLIDUS + 0x005d: 0x005d, # RIGHT SQUARE BRACKET + 0x005e: 0x005e, # CIRCUMFLEX ACCENT + 0x005f: 0x005f, # LOW LINE + 0x0060: 0x0060, # GRAVE ACCENT + 0x0061: 0x0061, # LATIN SMALL LETTER A + 0x0062: 0x0062, # LATIN SMALL LETTER B + 0x0063: 0x0063, # LATIN SMALL LETTER C + 0x0064: 0x0064, # LATIN SMALL LETTER D + 0x0065: 0x0065, # LATIN SMALL LETTER E + 0x0066: 0x0066, # LATIN SMALL LETTER F + 0x0067: 0x0067, # LATIN SMALL LETTER G + 0x0068: 0x0068, # LATIN SMALL LETTER H + 0x0069: 0x0069, # LATIN SMALL LETTER I + 0x006a: 0x006a, # LATIN SMALL LETTER J + 0x006b: 0x006b, # LATIN SMALL LETTER K + 0x006c: 0x006c, # LATIN SMALL LETTER L + 0x006d: 0x006d, # LATIN SMALL LETTER M + 0x006e: 0x006e, # LATIN SMALL LETTER N + 0x006f: 0x006f, # LATIN SMALL LETTER O + 0x0070: 0x0070, # LATIN SMALL LETTER P + 0x0071: 0x0071, # LATIN SMALL LETTER Q + 0x0072: 0x0072, # LATIN SMALL LETTER R + 0x0073: 0x0073, # LATIN SMALL LETTER S + 0x0074: 0x0074, # LATIN SMALL LETTER T + 0x0075: 0x0075, # LATIN SMALL LETTER U + 0x0076: 0x0076, # LATIN SMALL LETTER V + 0x0077: 0x0077, # LATIN SMALL LETTER W + 0x0078: 0x0078, # LATIN SMALL LETTER X + 0x0079: 0x0079, # LATIN SMALL LETTER Y + 0x007a: 0x007a, # LATIN SMALL LETTER Z + 0x007b: 0x007b, # LEFT CURLY BRACKET + 0x007c: 0x007c, # VERTICAL LINE + 0x007d: 0x007d, # RIGHT CURLY BRACKET + 0x007e: 0x007e, # TILDE + 0x007f: 0x007f, # DELETE + 0x00a0: 0x00ff, # NO-BREAK SPACE + 0x00a4: 0x00fd, # CURRENCY SIGN + 0x00b0: 0x00f8, # DEGREE SIGN + 0x00b7: 0x00fa, # MIDDLE DOT + 0x0401: 0x00f0, # CYRILLIC CAPITAL LETTER IO + 0x0404: 0x00f2, # CYRILLIC CAPITAL LETTER UKRAINIAN IE + 0x0407: 0x00f4, # CYRILLIC CAPITAL LETTER YI + 0x040e: 0x00f6, # CYRILLIC CAPITAL LETTER SHORT U + 0x0410: 0x0080, # CYRILLIC CAPITAL LETTER A + 0x0411: 0x0081, # CYRILLIC CAPITAL LETTER BE + 0x0412: 0x0082, # CYRILLIC CAPITAL LETTER VE + 0x0413: 0x0083, # CYRILLIC CAPITAL LETTER GHE + 0x0414: 0x0084, # CYRILLIC CAPITAL LETTER DE + 0x0415: 0x0085, # CYRILLIC CAPITAL LETTER IE + 0x0416: 0x0086, # CYRILLIC CAPITAL LETTER ZHE + 0x0417: 0x0087, # CYRILLIC CAPITAL LETTER ZE + 0x0418: 0x0088, # CYRILLIC CAPITAL LETTER I + 0x0419: 0x0089, # CYRILLIC CAPITAL LETTER SHORT I + 0x041a: 0x008a, # CYRILLIC CAPITAL LETTER KA + 0x041b: 0x008b, # CYRILLIC CAPITAL LETTER EL + 0x041c: 0x008c, # CYRILLIC CAPITAL LETTER EM + 0x041d: 0x008d, # CYRILLIC CAPITAL LETTER EN + 0x041e: 0x008e, # CYRILLIC CAPITAL LETTER O + 0x041f: 0x008f, # CYRILLIC CAPITAL LETTER PE + 0x0420: 0x0090, # CYRILLIC CAPITAL LETTER ER + 0x0421: 0x0091, # CYRILLIC CAPITAL LETTER ES + 0x0422: 0x0092, # CYRILLIC CAPITAL LETTER TE + 0x0423: 0x0093, # CYRILLIC CAPITAL LETTER U + 0x0424: 0x0094, # CYRILLIC CAPITAL LETTER EF + 0x0425: 0x0095, # CYRILLIC CAPITAL LETTER HA + 0x0426: 0x0096, # CYRILLIC CAPITAL LETTER TSE + 0x0427: 0x0097, # CYRILLIC CAPITAL LETTER CHE + 0x0428: 0x0098, # CYRILLIC CAPITAL LETTER SHA + 0x0429: 0x0099, # CYRILLIC CAPITAL LETTER SHCHA + 0x042a: 0x009a, # CYRILLIC CAPITAL LETTER HARD SIGN + 0x042b: 0x009b, # CYRILLIC CAPITAL LETTER YERU + 0x042c: 0x009c, # CYRILLIC CAPITAL LETTER SOFT SIGN + 0x042d: 0x009d, # CYRILLIC CAPITAL LETTER E + 0x042e: 0x009e, # CYRILLIC CAPITAL LETTER YU + 0x042f: 0x009f, # CYRILLIC CAPITAL LETTER YA + 0x0430: 0x00a0, # CYRILLIC SMALL LETTER A + 0x0431: 0x00a1, # CYRILLIC SMALL LETTER BE + 0x0432: 0x00a2, # CYRILLIC SMALL LETTER VE + 0x0433: 0x00a3, # CYRILLIC SMALL LETTER GHE + 0x0434: 0x00a4, # CYRILLIC SMALL LETTER DE + 0x0435: 0x00a5, # CYRILLIC SMALL LETTER IE + 0x0436: 0x00a6, # CYRILLIC SMALL LETTER ZHE + 0x0437: 0x00a7, # CYRILLIC SMALL LETTER ZE + 0x0438: 0x00a8, # CYRILLIC SMALL LETTER I + 0x0439: 0x00a9, # CYRILLIC SMALL LETTER SHORT I + 0x043a: 0x00aa, # CYRILLIC SMALL LETTER KA + 0x043b: 0x00ab, # CYRILLIC SMALL LETTER EL + 0x043c: 0x00ac, # CYRILLIC SMALL LETTER EM + 0x043d: 0x00ad, # CYRILLIC SMALL LETTER EN + 0x043e: 0x00ae, # CYRILLIC SMALL LETTER O + 0x043f: 0x00af, # CYRILLIC SMALL LETTER PE + 0x0440: 0x00e0, # CYRILLIC SMALL LETTER ER + 0x0441: 0x00e1, # CYRILLIC SMALL LETTER ES + 0x0442: 0x00e2, # CYRILLIC SMALL LETTER TE + 0x0443: 0x00e3, # CYRILLIC SMALL LETTER U + 0x0444: 0x00e4, # CYRILLIC SMALL LETTER EF + 0x0445: 0x00e5, # CYRILLIC SMALL LETTER HA + 0x0446: 0x00e6, # CYRILLIC SMALL LETTER TSE + 0x0447: 0x00e7, # CYRILLIC SMALL LETTER CHE + 0x0448: 0x00e8, # CYRILLIC SMALL LETTER SHA + 0x0449: 0x00e9, # CYRILLIC SMALL LETTER SHCHA + 0x044a: 0x00ea, # CYRILLIC SMALL LETTER HARD SIGN + 0x044b: 0x00eb, # CYRILLIC SMALL LETTER YERU + 0x044c: 0x00ec, # CYRILLIC SMALL LETTER SOFT SIGN + 0x044d: 0x00ed, # CYRILLIC SMALL LETTER E + 0x044e: 0x00ee, # CYRILLIC SMALL LETTER YU + 0x044f: 0x00ef, # CYRILLIC SMALL LETTER YA + 0x0451: 0x00f1, # CYRILLIC SMALL LETTER IO + 0x0454: 0x00f3, # CYRILLIC SMALL LETTER UKRAINIAN IE + 0x0457: 0x00f5, # CYRILLIC SMALL LETTER YI + 0x045e: 0x00f7, # CYRILLIC SMALL LETTER SHORT U + 0x2116: 0x00fc, # NUMERO SIGN + 0x2219: 0x00f9, # BULLET OPERATOR + 0x221a: 0x00fb, # SQUARE ROOT + 0x2500: 0x00c4, # BOX DRAWINGS LIGHT HORIZONTAL + 0x2502: 0x00b3, # BOX DRAWINGS LIGHT VERTICAL + 0x250c: 0x00da, # BOX DRAWINGS LIGHT DOWN AND RIGHT + 0x2510: 0x00bf, # BOX DRAWINGS LIGHT DOWN AND LEFT + 0x2514: 0x00c0, # BOX DRAWINGS LIGHT UP AND RIGHT + 0x2518: 0x00d9, # BOX DRAWINGS LIGHT UP AND LEFT + 0x251c: 0x00c3, # BOX DRAWINGS LIGHT VERTICAL AND RIGHT + 0x2524: 0x00b4, # BOX DRAWINGS LIGHT VERTICAL AND LEFT + 0x252c: 0x00c2, # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL + 0x2534: 0x00c1, # BOX DRAWINGS LIGHT UP AND HORIZONTAL + 0x253c: 0x00c5, # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL + 0x2550: 0x00cd, # BOX DRAWINGS DOUBLE HORIZONTAL + 0x2551: 0x00ba, # BOX DRAWINGS DOUBLE VERTICAL + 0x2552: 0x00d5, # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE + 0x2553: 0x00d6, # BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE + 0x2554: 0x00c9, # BOX DRAWINGS DOUBLE DOWN AND RIGHT + 0x2555: 0x00b8, # BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE + 0x2556: 0x00b7, # BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE + 0x2557: 0x00bb, # BOX DRAWINGS DOUBLE DOWN AND LEFT + 0x2558: 0x00d4, # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE + 0x2559: 0x00d3, # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE + 0x255a: 0x00c8, # BOX DRAWINGS DOUBLE UP AND RIGHT + 0x255b: 0x00be, # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE + 0x255c: 0x00bd, # BOX DRAWINGS UP DOUBLE AND LEFT SINGLE + 0x255d: 0x00bc, # BOX DRAWINGS DOUBLE UP AND LEFT + 0x255e: 0x00c6, # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE + 0x255f: 0x00c7, # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE + 0x2560: 0x00cc, # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT + 0x2561: 0x00b5, # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE + 0x2562: 0x00b6, # BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE + 0x2563: 0x00b9, # BOX DRAWINGS DOUBLE VERTICAL AND LEFT + 0x2564: 0x00d1, # BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE + 0x2565: 0x00d2, # BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE + 0x2566: 0x00cb, # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL + 0x2567: 0x00cf, # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE + 0x2568: 0x00d0, # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE + 0x2569: 0x00ca, # BOX DRAWINGS DOUBLE UP AND HORIZONTAL + 0x256a: 0x00d8, # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE + 0x256b: 0x00d7, # BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE + 0x256c: 0x00ce, # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL + 0x2580: 0x00df, # UPPER HALF BLOCK + 0x2584: 0x00dc, # LOWER HALF BLOCK + 0x2588: 0x00db, # FULL BLOCK + 0x258c: 0x00dd, # LEFT HALF BLOCK + 0x2590: 0x00de, # RIGHT HALF BLOCK + 0x2591: 0x00b0, # LIGHT SHADE + 0x2592: 0x00b1, # MEDIUM SHADE + 0x2593: 0x00b2, # DARK SHADE + 0x25a0: 0x00fe, # BLACK SQUARE +} diff --git a/shared/package-files/9f/9f0073d4c1ee1e233b25073be30d9da04a604d2c20dcd61f1b019b4055d62b0f/blob b/shared/package-files/9f/9f0073d4c1ee1e233b25073be30d9da04a604d2c20dcd61f1b019b4055d62b0f/blob new file mode 100644 index 0000000000000000000000000000000000000000..1b0816a9405cb9dd6ed81691e72012c948b898a2 --- /dev/null +++ b/shared/package-files/9f/9f0073d4c1ee1e233b25073be30d9da04a604d2c20dcd61f1b019b4055d62b0f/blob @@ -0,0 +1,208 @@ +import numpy as np +import pytest + +from pandas import ( + Index, + IntervalIndex, + Timestamp, + interval_range, +) +import pandas._testing as tm + + +def monotonic_index(start, end, dtype="int64", closed="right"): + return IntervalIndex.from_breaks(np.arange(start, end, dtype=dtype), closed=closed) + + +def empty_index(dtype="int64", closed="right"): + return IntervalIndex(np.array([], dtype=dtype), closed=closed) + + +class TestIntervalIndex: + def test_union(self, closed, sort): + index = monotonic_index(0, 11, closed=closed) + other = monotonic_index(5, 13, closed=closed) + + expected = monotonic_index(0, 13, closed=closed) + result = index[::-1].union(other, sort=sort) + if sort in (None, True): + tm.assert_index_equal(result, expected) + else: + tm.assert_index_equal(result.sort_values(), expected) + + result = other[::-1].union(index, sort=sort) + if sort in (None, True): + tm.assert_index_equal(result, expected) + else: + tm.assert_index_equal(result.sort_values(), expected) + + tm.assert_index_equal(index.union(index, sort=sort), index) + tm.assert_index_equal(index.union(index[:1], sort=sort), index) + + def test_union_empty_result(self, closed, sort): + # GH 19101: empty result, same dtype + index = empty_index(dtype="int64", closed=closed) + result = index.union(index, sort=sort) + tm.assert_index_equal(result, index) + + # GH 19101: empty result, different numeric dtypes -> common dtype is f8 + other = empty_index(dtype="float64", closed=closed) + result = index.union(other, sort=sort) + expected = other + tm.assert_index_equal(result, expected) + + other = index.union(index, sort=sort) + tm.assert_index_equal(result, expected) + + other = empty_index(dtype="uint64", closed=closed) + result = index.union(other, sort=sort) + tm.assert_index_equal(result, expected) + + result = other.union(index, sort=sort) + tm.assert_index_equal(result, expected) + + def test_intersection(self, closed, sort): + index = monotonic_index(0, 11, closed=closed) + other = monotonic_index(5, 13, closed=closed) + + expected = monotonic_index(5, 11, closed=closed) + result = index[::-1].intersection(other, sort=sort) + if sort in (None, True): + tm.assert_index_equal(result, expected) + else: + tm.assert_index_equal(result.sort_values(), expected) + + result = other[::-1].intersection(index, sort=sort) + if sort in (None, True): + tm.assert_index_equal(result, expected) + else: + tm.assert_index_equal(result.sort_values(), expected) + + tm.assert_index_equal(index.intersection(index, sort=sort), index) + + # GH 26225: nested intervals + index = IntervalIndex.from_tuples([(1, 2), (1, 3), (1, 4), (0, 2)]) + other = IntervalIndex.from_tuples([(1, 2), (1, 3)]) + expected = IntervalIndex.from_tuples([(1, 2), (1, 3)]) + result = index.intersection(other) + tm.assert_index_equal(result, expected) + + # GH 26225 + index = IntervalIndex.from_tuples([(0, 3), (0, 2)]) + other = IntervalIndex.from_tuples([(0, 2), (1, 3)]) + expected = IntervalIndex.from_tuples([(0, 2)]) + result = index.intersection(other) + tm.assert_index_equal(result, expected) + + # GH 26225: duplicate nan element + index = IntervalIndex([np.nan, np.nan]) + other = IntervalIndex([np.nan]) + expected = IntervalIndex([np.nan]) + result = index.intersection(other) + tm.assert_index_equal(result, expected) + + def test_intersection_empty_result(self, closed, sort): + index = monotonic_index(0, 11, closed=closed) + + # GH 19101: empty result, same dtype + other = monotonic_index(300, 314, closed=closed) + expected = empty_index(dtype="int64", closed=closed) + result = index.intersection(other, sort=sort) + tm.assert_index_equal(result, expected) + + # GH 19101: empty result, different numeric dtypes -> common dtype is float64 + other = monotonic_index(300, 314, dtype="float64", closed=closed) + result = index.intersection(other, sort=sort) + expected = other[:0] + tm.assert_index_equal(result, expected) + + other = monotonic_index(300, 314, dtype="uint64", closed=closed) + result = index.intersection(other, sort=sort) + tm.assert_index_equal(result, expected) + + def test_intersection_duplicates(self): + # GH#38743 + index = IntervalIndex.from_tuples([(1, 2), (1, 2), (2, 3), (3, 4)]) + other = IntervalIndex.from_tuples([(1, 2), (2, 3)]) + expected = IntervalIndex.from_tuples([(1, 2), (2, 3)]) + result = index.intersection(other) + tm.assert_index_equal(result, expected) + + def test_difference(self, closed, sort): + index = IntervalIndex.from_arrays([1, 0, 3, 2], [1, 2, 3, 4], closed=closed) + result = index.difference(index[:1], sort=sort) + expected = index[1:] + if sort is None: + expected = expected.sort_values() + tm.assert_index_equal(result, expected) + + # GH 19101: empty result, same dtype + result = index.difference(index, sort=sort) + expected = empty_index(dtype="int64", closed=closed) + tm.assert_index_equal(result, expected) + + # GH 19101: empty result, different dtypes + other = IntervalIndex.from_arrays( + index.left.astype("float64"), index.right, closed=closed + ) + result = index.difference(other, sort=sort) + tm.assert_index_equal(result, expected) + + def test_symmetric_difference(self, closed, sort): + index = monotonic_index(0, 11, closed=closed) + result = index[1:].symmetric_difference(index[:-1], sort=sort) + expected = IntervalIndex([index[0], index[-1]]) + if sort in (None, True): + tm.assert_index_equal(result, expected) + else: + tm.assert_index_equal(result.sort_values(), expected) + + # GH 19101: empty result, same dtype + result = index.symmetric_difference(index, sort=sort) + expected = empty_index(dtype="int64", closed=closed) + if sort in (None, True): + tm.assert_index_equal(result, expected) + else: + tm.assert_index_equal(result.sort_values(), expected) + + # GH 19101: empty result, different dtypes + other = IntervalIndex.from_arrays( + index.left.astype("float64"), index.right, closed=closed + ) + result = index.symmetric_difference(other, sort=sort) + expected = empty_index(dtype="float64", closed=closed) + tm.assert_index_equal(result, expected) + + @pytest.mark.filterwarnings("ignore:'<' not supported between:RuntimeWarning") + @pytest.mark.parametrize( + "op_name", ["union", "intersection", "difference", "symmetric_difference"] + ) + def test_set_incompatible_types(self, closed, op_name, sort): + index = monotonic_index(0, 11, closed=closed) + set_op = getattr(index, op_name) + + # TODO: standardize return type of non-union setops type(self vs other) + # non-IntervalIndex + if op_name == "difference": + expected = index + else: + expected = getattr(index.astype("O"), op_name)(Index([1, 2, 3])) + result = set_op(Index([1, 2, 3]), sort=sort) + tm.assert_index_equal(result, expected) + + # mixed closed -> cast to object + for other_closed in {"right", "left", "both", "neither"} - {closed}: + other = monotonic_index(0, 11, closed=other_closed) + expected = getattr(index.astype(object), op_name)(other, sort=sort) + if op_name == "difference": + expected = index + result = set_op(other, sort=sort) + tm.assert_index_equal(result, expected) + + # GH 19016: incompatible dtypes -> cast to object + other = interval_range(Timestamp("20180101"), periods=9, closed=closed) + expected = getattr(index.astype(object), op_name)(other, sort=sort) + if op_name == "difference": + expected = index + result = set_op(other, sort=sort) + tm.assert_index_equal(result, expected) diff --git a/shared/package-files/9f/9f02654649816145bc76f8c210a5fe3ba1de142d4d97a1c93105732e747c285b/blob b/shared/package-files/9f/9f02654649816145bc76f8c210a5fe3ba1de142d4d97a1c93105732e747c285b/blob new file mode 100644 index 0000000000000000000000000000000000000000..c5d9ae2d0d5d040708f097fbf6450b86eef334dd --- /dev/null +++ b/shared/package-files/9f/9f02654649816145bc76f8c210a5fe3ba1de142d4d97a1c93105732e747c285b/blob @@ -0,0 +1,356 @@ +"""Implementation of JSONDecoder +""" +import re + +from json import scanner +try: + from _json import scanstring as c_scanstring +except ImportError: + c_scanstring = None + +__all__ = ['JSONDecoder', 'JSONDecodeError'] + +FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL + +NaN = float('nan') +PosInf = float('inf') +NegInf = float('-inf') + + +class JSONDecodeError(ValueError): + """Subclass of ValueError with the following additional properties: + + msg: The unformatted error message + doc: The JSON document being parsed + pos: The start index of doc where parsing failed + lineno: The line corresponding to pos + colno: The column corresponding to pos + + """ + # Note that this exception is used from _json + def __init__(self, msg, doc, pos): + lineno = doc.count('\n', 0, pos) + 1 + colno = pos - doc.rfind('\n', 0, pos) + errmsg = '%s: line %d column %d (char %d)' % (msg, lineno, colno, pos) + ValueError.__init__(self, errmsg) + self.msg = msg + self.doc = doc + self.pos = pos + self.lineno = lineno + self.colno = colno + + def __reduce__(self): + return self.__class__, (self.msg, self.doc, self.pos) + + +_CONSTANTS = { + '-Infinity': NegInf, + 'Infinity': PosInf, + 'NaN': NaN, +} + + +STRINGCHUNK = re.compile(r'(.*?)(["\\\x00-\x1f])', FLAGS) +BACKSLASH = { + '"': '"', '\\': '\\', '/': '/', + 'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t', +} + +def _decode_uXXXX(s, pos): + esc = s[pos + 1:pos + 5] + if len(esc) == 4 and esc[1] not in 'xX': + try: + return int(esc, 16) + except ValueError: + pass + msg = "Invalid \\uXXXX escape" + raise JSONDecodeError(msg, s, pos) + +def py_scanstring(s, end, strict=True, + _b=BACKSLASH, _m=STRINGCHUNK.match): + """Scan the string s for a JSON string. End is the index of the + character in s after the quote that started the JSON string. + Unescapes all valid JSON string escape sequences and raises ValueError + on attempt to decode an invalid string. If strict is False then literal + control characters are allowed in the string. + + Returns a tuple of the decoded string and the index of the character in s + after the end quote.""" + chunks = [] + _append = chunks.append + begin = end - 1 + while 1: + chunk = _m(s, end) + if chunk is None: + raise JSONDecodeError("Unterminated string starting at", s, begin) + end = chunk.end() + content, terminator = chunk.groups() + # Content is contains zero or more unescaped string characters + if content: + _append(content) + # Terminator is the end of string, a literal control character, + # or a backslash denoting that an escape sequence follows + if terminator == '"': + break + elif terminator != '\\': + if strict: + #msg = "Invalid control character %r at" % (terminator,) + msg = "Invalid control character {0!r} at".format(terminator) + raise JSONDecodeError(msg, s, end) + else: + _append(terminator) + continue + try: + esc = s[end] + except IndexError: + raise JSONDecodeError("Unterminated string starting at", + s, begin) from None + # If not a unicode escape sequence, must be in the lookup table + if esc != 'u': + try: + char = _b[esc] + except KeyError: + msg = "Invalid \\escape: {0!r}".format(esc) + raise JSONDecodeError(msg, s, end) + end += 1 + else: + uni = _decode_uXXXX(s, end) + end += 5 + if 0xd800 <= uni <= 0xdbff and s[end:end + 2] == '\\u': + uni2 = _decode_uXXXX(s, end + 1) + if 0xdc00 <= uni2 <= 0xdfff: + uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00)) + end += 6 + char = chr(uni) + _append(char) + return ''.join(chunks), end + + +# Use speedup if available +scanstring = c_scanstring or py_scanstring + +WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS) +WHITESPACE_STR = ' \t\n\r' + + +def JSONObject(s_and_end, strict, scan_once, object_hook, object_pairs_hook, + memo=None, _w=WHITESPACE.match, _ws=WHITESPACE_STR): + s, end = s_and_end + pairs = [] + pairs_append = pairs.append + # Backwards compatibility + if memo is None: + memo = {} + memo_get = memo.setdefault + # Use a slice to prevent IndexError from being raised, the following + # check will raise a more specific ValueError if the string is empty + nextchar = s[end:end + 1] + # Normally we expect nextchar == '"' + if nextchar != '"': + if nextchar in _ws: + end = _w(s, end).end() + nextchar = s[end:end + 1] + # Trivial empty object + if nextchar == '}': + if object_pairs_hook is not None: + result = object_pairs_hook(pairs) + return result, end + 1 + pairs = {} + if object_hook is not None: + pairs = object_hook(pairs) + return pairs, end + 1 + elif nextchar != '"': + raise JSONDecodeError( + "Expecting property name enclosed in double quotes", s, end) + end += 1 + while True: + key, end = scanstring(s, end, strict) + key = memo_get(key, key) + # To skip some function call overhead we optimize the fast paths where + # the JSON key separator is ": " or just ":". + if s[end:end + 1] != ':': + end = _w(s, end).end() + if s[end:end + 1] != ':': + raise JSONDecodeError("Expecting ':' delimiter", s, end) + end += 1 + + try: + if s[end] in _ws: + end += 1 + if s[end] in _ws: + end = _w(s, end + 1).end() + except IndexError: + pass + + try: + value, end = scan_once(s, end) + except StopIteration as err: + raise JSONDecodeError("Expecting value", s, err.value) from None + pairs_append((key, value)) + try: + nextchar = s[end] + if nextchar in _ws: + end = _w(s, end + 1).end() + nextchar = s[end] + except IndexError: + nextchar = '' + end += 1 + + if nextchar == '}': + break + elif nextchar != ',': + raise JSONDecodeError("Expecting ',' delimiter", s, end - 1) + end = _w(s, end).end() + nextchar = s[end:end + 1] + end += 1 + if nextchar != '"': + raise JSONDecodeError( + "Expecting property name enclosed in double quotes", s, end - 1) + if object_pairs_hook is not None: + result = object_pairs_hook(pairs) + return result, end + pairs = dict(pairs) + if object_hook is not None: + pairs = object_hook(pairs) + return pairs, end + +def JSONArray(s_and_end, scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR): + s, end = s_and_end + values = [] + nextchar = s[end:end + 1] + if nextchar in _ws: + end = _w(s, end + 1).end() + nextchar = s[end:end + 1] + # Look-ahead for trivial empty array + if nextchar == ']': + return values, end + 1 + _append = values.append + while True: + try: + value, end = scan_once(s, end) + except StopIteration as err: + raise JSONDecodeError("Expecting value", s, err.value) from None + _append(value) + nextchar = s[end:end + 1] + if nextchar in _ws: + end = _w(s, end + 1).end() + nextchar = s[end:end + 1] + end += 1 + if nextchar == ']': + break + elif nextchar != ',': + raise JSONDecodeError("Expecting ',' delimiter", s, end - 1) + try: + if s[end] in _ws: + end += 1 + if s[end] in _ws: + end = _w(s, end + 1).end() + except IndexError: + pass + + return values, end + + +class JSONDecoder(object): + """Simple JSON decoder + + Performs the following translations in decoding by default: + + +---------------+-------------------+ + | JSON | Python | + +===============+===================+ + | object | dict | + +---------------+-------------------+ + | array | list | + +---------------+-------------------+ + | string | str | + +---------------+-------------------+ + | number (int) | int | + +---------------+-------------------+ + | number (real) | float | + +---------------+-------------------+ + | true | True | + +---------------+-------------------+ + | false | False | + +---------------+-------------------+ + | null | None | + +---------------+-------------------+ + + It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as + their corresponding ``float`` values, which is outside the JSON spec. + + """ + + def __init__(self, *, object_hook=None, parse_float=None, + parse_int=None, parse_constant=None, strict=True, + object_pairs_hook=None): + """``object_hook``, if specified, will be called with the result + of every JSON object decoded and its return value will be used in + place of the given ``dict``. This can be used to provide custom + deserializations (e.g. to support JSON-RPC class hinting). + + ``object_pairs_hook``, if specified will be called with the result of + every JSON object decoded with an ordered list of pairs. The return + value of ``object_pairs_hook`` will be used instead of the ``dict``. + This feature can be used to implement custom decoders. + If ``object_hook`` is also defined, the ``object_pairs_hook`` takes + priority. + + ``parse_float``, if specified, will be called with the string + of every JSON float to be decoded. By default this is equivalent to + float(num_str). This can be used to use another datatype or parser + for JSON floats (e.g. decimal.Decimal). + + ``parse_int``, if specified, will be called with the string + of every JSON int to be decoded. By default this is equivalent to + int(num_str). This can be used to use another datatype or parser + for JSON integers (e.g. float). + + ``parse_constant``, if specified, will be called with one of the + following strings: -Infinity, Infinity, NaN. + This can be used to raise an exception if invalid JSON numbers + are encountered. + + If ``strict`` is false (true is the default), then control + characters will be allowed inside strings. Control characters in + this context are those with character codes in the 0-31 range, + including ``'\\t'`` (tab), ``'\\n'``, ``'\\r'`` and ``'\\0'``. + """ + self.object_hook = object_hook + self.parse_float = parse_float or float + self.parse_int = parse_int or int + self.parse_constant = parse_constant or _CONSTANTS.__getitem__ + self.strict = strict + self.object_pairs_hook = object_pairs_hook + self.parse_object = JSONObject + self.parse_array = JSONArray + self.parse_string = scanstring + self.memo = {} + self.scan_once = scanner.make_scanner(self) + + + def decode(self, s, _w=WHITESPACE.match): + """Return the Python representation of ``s`` (a ``str`` instance + containing a JSON document). + + """ + obj, end = self.raw_decode(s, idx=_w(s, 0).end()) + end = _w(s, end).end() + if end != len(s): + raise JSONDecodeError("Extra data", s, end) + return obj + + def raw_decode(self, s, idx=0): + """Decode a JSON document from ``s`` (a ``str`` beginning with + a JSON document) and return a 2-tuple of the Python + representation and the index in ``s`` where the document ended. + + This can be used to decode a JSON document from a string that may + have extraneous data at the end. + + """ + try: + obj, end = self.scan_once(s, idx) + except StopIteration as err: + raise JSONDecodeError("Expecting value", s, err.value) from None + return obj, end diff --git a/shared/package-files/9f/9f02c49c7a1000e23d14b8898219f847f33542d04c403c41e78a7e644783e5e9/blob b/shared/package-files/9f/9f02c49c7a1000e23d14b8898219f847f33542d04c403c41e78a7e644783e5e9/blob new file mode 100644 index 0000000000000000000000000000000000000000..1195c5ba49c43e0f5dd1086e4a46ae66befcd490 --- /dev/null +++ b/shared/package-files/9f/9f02c49c7a1000e23d14b8898219f847f33542d04c403c41e78a7e644783e5e9/blob @@ -0,0 +1,30 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::view_as_real(Tensor(a) self) -> Tensor(a) +inline at::Tensor view_as_real(const at::Tensor & self) { + return at::_ops::view_as_real::call(self); +} + +} diff --git a/shared/package-files/9f/9f05c92f83b98d4aa14f0aa190fc4763cb372971d04c311db1f6e0e0cb12cd54/blob b/shared/package-files/9f/9f05c92f83b98d4aa14f0aa190fc4763cb372971d04c311db1f6e0e0cb12cd54/blob new file mode 100644 index 0000000000000000000000000000000000000000..add4741c00e8d8aefe4fcf3a2a86815a15aab29c --- /dev/null +++ b/shared/package-files/9f/9f05c92f83b98d4aa14f0aa190fc4763cb372971d04c311db1f6e0e0cb12cd54/blob @@ -0,0 +1,75 @@ +from itertools import groupby + +import pytest + +import networkx as nx +from networkx import graph_atlas, graph_atlas_g +from networkx.generators.atlas import NUM_GRAPHS +from networkx.utils import edges_equal, nodes_equal, pairwise + + +class TestAtlasGraph: + """Unit tests for the :func:`~networkx.graph_atlas` function.""" + + def test_index_too_small(self): + with pytest.raises(ValueError): + graph_atlas(-1) + + def test_index_too_large(self): + with pytest.raises(ValueError): + graph_atlas(NUM_GRAPHS) + + def test_graph(self): + G = graph_atlas(6) + assert nodes_equal(G.nodes(), range(3)) + assert edges_equal(G.edges(), [(0, 1), (0, 2)]) + + +class TestAtlasGraphG: + """Unit tests for the :func:`~networkx.graph_atlas_g` function.""" + + @classmethod + def setup_class(cls): + cls.GAG = graph_atlas_g() + + def test_sizes(self): + G = self.GAG[0] + assert G.number_of_nodes() == 0 + assert G.number_of_edges() == 0 + + G = self.GAG[7] + assert G.number_of_nodes() == 3 + assert G.number_of_edges() == 3 + + def test_names(self): + for i, G in enumerate(self.GAG): + assert int(G.name[1:]) == i + + def test_nondecreasing_nodes(self): + # check for nondecreasing number of nodes + for n1, n2 in pairwise(map(len, self.GAG)): + assert n2 <= n1 + 1 + + def test_nondecreasing_edges(self): + # check for nondecreasing number of edges (for fixed number of + # nodes) + for n, group in groupby(self.GAG, key=nx.number_of_nodes): + for m1, m2 in pairwise(map(nx.number_of_edges, group)): + assert m2 <= m1 + 1 + + def test_nondecreasing_degree_sequence(self): + # Check for lexicographically nondecreasing degree sequences + # (for fixed number of nodes and edges). + # + # There are three exceptions to this rule in the order given in + # the "Atlas of Graphs" book, so we need to manually exclude + # those. + exceptions = [("G55", "G56"), ("G1007", "G1008"), ("G1012", "G1013")] + for n, group in groupby(self.GAG, key=nx.number_of_nodes): + for m, group in groupby(group, key=nx.number_of_edges): + for G1, G2 in pairwise(group): + if (G1.name, G2.name) in exceptions: + continue + d1 = sorted(d for v, d in G1.degree()) + d2 = sorted(d for v, d in G2.degree()) + assert d1 <= d2 diff --git a/shared/package-files/9f/9f0b8cb02be76fbf48cd6e07445a59284a64fe2e0df7403900b4735b67eb5ec6/blob b/shared/package-files/9f/9f0b8cb02be76fbf48cd6e07445a59284a64fe2e0df7403900b4735b67eb5ec6/blob new file mode 100644 index 0000000000000000000000000000000000000000..f5f4b8f57cf62069bbce8159bb496c70f8de1884 --- /dev/null +++ b/shared/package-files/9f/9f0b8cb02be76fbf48cd6e07445a59284a64fe2e0df7403900b4735b67eb5ec6/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API _unsafe_index_Tensor { + using schema = at::Tensor (const at::Tensor &, const c10::List> &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_unsafe_index") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_unsafe_index.Tensor(Tensor self, Tensor?[] indices) -> Tensor") + static at::Tensor call(const at::Tensor & self, const c10::List> & indices); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const c10::List> & indices); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9f/9f0eb8d9ad1a455b412c5bc15dae44ffcd0104b47bb13eb6d40d290c4dc96a71/blob b/shared/package-files/9f/9f0eb8d9ad1a455b412c5bc15dae44ffcd0104b47bb13eb6d40d290c4dc96a71/blob new file mode 100644 index 0000000000000000000000000000000000000000..df858127f7fd63ad94be2cafdccd37464cf1af1f --- /dev/null +++ b/shared/package-files/9f/9f0eb8d9ad1a455b412c5bc15dae44ffcd0104b47bb13eb6d40d290c4dc96a71/blob @@ -0,0 +1,25 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor linalg_lu_solve(const at::Tensor & LU, const at::Tensor & pivots, const at::Tensor & B, bool left=true, bool adjoint=false); +TORCH_API at::Tensor & linalg_lu_solve_out(at::Tensor & out, const at::Tensor & LU, const at::Tensor & pivots, const at::Tensor & B, bool left=true, bool adjoint=false); +TORCH_API at::Tensor & linalg_lu_solve_outf(const at::Tensor & LU, const at::Tensor & pivots, const at::Tensor & B, bool left, bool adjoint, at::Tensor & out); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/9f/9f14ddeea9f1a4f49fc0040419fc17cb118047280571712019b15e3ad6b3c70e/blob b/shared/package-files/9f/9f14ddeea9f1a4f49fc0040419fc17cb118047280571712019b15e3ad6b3c70e/blob new file mode 100644 index 0000000000000000000000000000000000000000..b574786c0bb1cf1269816edec2ef5d13980bd5e8 --- /dev/null +++ b/shared/package-files/9f/9f14ddeea9f1a4f49fc0040419fc17cb118047280571712019b15e3ad6b3c70e/blob @@ -0,0 +1,11 @@ +#pragma once + +#include + +namespace torch { +namespace jit { + +TORCH_API void RemoveRedundantProfiles(std::shared_ptr& graph); +TORCH_API void RemoveRedundantProfiles(Block* block, AliasDb& db); +} // namespace jit +} // namespace torch diff --git a/shared/package-files/9f/9f1613ddd4f73ff0f4dd012fa2295b71764b6252bac2c5a872b16efa99e6393f/blob b/shared/package-files/9f/9f1613ddd4f73ff0f4dd012fa2295b71764b6252bac2c5a872b16efa99e6393f/blob new file mode 100644 index 0000000000000000000000000000000000000000..b8d26bc657704096aa24f77ea4cdce60caf93e79 --- /dev/null +++ b/shared/package-files/9f/9f1613ddd4f73ff0f4dd012fa2295b71764b6252bac2c5a872b16efa99e6393f/blob @@ -0,0 +1,13 @@ +*** Sat, 3 Sep 2016 22:28:41 *** +TEST FOR GRANGER-CAUSALITY: +H0: "realcons, realinv" do not Granger-cause "realgdp" + +Test statistic l = 10.6470 +pval-F( l; 8, 549) = 0.0000 + +TEST FOR INSTANTANEOUS CAUSALITY: +H0: No instantaneous causality between "realcons, realinv" and "realgdp" + +Test statistic: c = 86.5410 +pval-Chi( c; 2) = 0.0000 + diff --git a/shared/package-files/9f/9f18a458ffeb14671801f06b03dc58951895a6eda6324335e987574aaa2782b4/blob b/shared/package-files/9f/9f18a458ffeb14671801f06b03dc58951895a6eda6324335e987574aaa2782b4/blob new file mode 100644 index 0000000000000000000000000000000000000000..8272599eb8fc95c315f0af85dd2c954cc22ef0de --- /dev/null +++ b/shared/package-files/9f/9f18a458ffeb14671801f06b03dc58951895a6eda6324335e987574aaa2782b4/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API ::std::tuple _embedding_bag_out(at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, at::Tensor & out3, const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, bool scale_grad_by_freq=false, int64_t mode=0, bool sparse=false, const c10::optional & per_sample_weights={}, bool include_last_offset=false, int64_t padding_idx=-1); +TORCH_API ::std::tuple _embedding_bag_outf(const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, bool scale_grad_by_freq, int64_t mode, bool sparse, const c10::optional & per_sample_weights, bool include_last_offset, int64_t padding_idx, at::Tensor & out0, at::Tensor & out1, at::Tensor & out2, at::Tensor & out3); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9f/9f19833a8605f4d5ee2da198cb4d6d2858e4351796265ac616e24d584893a3ce/blob b/shared/package-files/9f/9f19833a8605f4d5ee2da198cb4d6d2858e4351796265ac616e24d584893a3ce/blob new file mode 100644 index 0000000000000000000000000000000000000000..83f9018ee9357bd193e91abbc66fe9f0e7075f2c --- /dev/null +++ b/shared/package-files/9f/9f19833a8605f4d5ee2da198cb4d6d2858e4351796265ac616e24d584893a3ce/blob @@ -0,0 +1,656 @@ +# mypy: ignore-errors +import railroad +from pip._vendor import pyparsing +import typing +from typing import ( + List, + NamedTuple, + Generic, + TypeVar, + Dict, + Callable, + Set, + Iterable, +) +from jinja2 import Template +from io import StringIO +import inspect + + +jinja2_template_source = """\ +{% if not embed %} + + + +{% endif %} + {% if not head %} + + {% else %} + {{ head | safe }} + {% endif %} +{% if not embed %} + + +{% endif %} +{{ body | safe }} +{% for diagram in diagrams %} +
+

{{ diagram.title }}

+
{{ diagram.text }}
+
+ {{ diagram.svg }} +
+
+{% endfor %} +{% if not embed %} + + +{% endif %} +""" + +template = Template(jinja2_template_source) + +# Note: ideally this would be a dataclass, but we're supporting Python 3.5+ so we can't do this yet +NamedDiagram = NamedTuple( + "NamedDiagram", + [("name", str), ("diagram", typing.Optional[railroad.DiagramItem]), ("index", int)], +) +""" +A simple structure for associating a name with a railroad diagram +""" + +T = TypeVar("T") + + +class EachItem(railroad.Group): + """ + Custom railroad item to compose a: + - Group containing a + - OneOrMore containing a + - Choice of the elements in the Each + with the group label indicating that all must be matched + """ + + all_label = "[ALL]" + + def __init__(self, *items): + choice_item = railroad.Choice(len(items) - 1, *items) + one_or_more_item = railroad.OneOrMore(item=choice_item) + super().__init__(one_or_more_item, label=self.all_label) + + +class AnnotatedItem(railroad.Group): + """ + Simple subclass of Group that creates an annotation label + """ + + def __init__(self, label: str, item): + super().__init__(item=item, label="[{}]".format(label) if label else label) + + +class EditablePartial(Generic[T]): + """ + Acts like a functools.partial, but can be edited. In other words, it represents a type that hasn't yet been + constructed. + """ + + # We need this here because the railroad constructors actually transform the data, so can't be called until the + # entire tree is assembled + + def __init__(self, func: Callable[..., T], args: list, kwargs: dict): + self.func = func + self.args = args + self.kwargs = kwargs + + @classmethod + def from_call(cls, func: Callable[..., T], *args, **kwargs) -> "EditablePartial[T]": + """ + If you call this function in the same way that you would call the constructor, it will store the arguments + as you expect. For example EditablePartial.from_call(Fraction, 1, 3)() == Fraction(1, 3) + """ + return EditablePartial(func=func, args=list(args), kwargs=kwargs) + + @property + def name(self): + return self.kwargs["name"] + + def __call__(self) -> T: + """ + Evaluate the partial and return the result + """ + args = self.args.copy() + kwargs = self.kwargs.copy() + + # This is a helpful hack to allow you to specify varargs parameters (e.g. *args) as keyword args (e.g. + # args=['list', 'of', 'things']) + arg_spec = inspect.getfullargspec(self.func) + if arg_spec.varargs in self.kwargs: + args += kwargs.pop(arg_spec.varargs) + + return self.func(*args, **kwargs) + + +def railroad_to_html(diagrams: List[NamedDiagram], embed=False, **kwargs) -> str: + """ + Given a list of NamedDiagram, produce a single HTML string that visualises those diagrams + :params kwargs: kwargs to be passed in to the template + """ + data = [] + for diagram in diagrams: + if diagram.diagram is None: + continue + io = StringIO() + try: + css = kwargs.get('css') + diagram.diagram.writeStandalone(io.write, css=css) + except AttributeError: + diagram.diagram.writeSvg(io.write) + title = diagram.name + if diagram.index == 0: + title += " (root)" + data.append({"title": title, "text": "", "svg": io.getvalue()}) + + return template.render(diagrams=data, embed=embed, **kwargs) + + +def resolve_partial(partial: "EditablePartial[T]") -> T: + """ + Recursively resolves a collection of Partials into whatever type they are + """ + if isinstance(partial, EditablePartial): + partial.args = resolve_partial(partial.args) + partial.kwargs = resolve_partial(partial.kwargs) + return partial() + elif isinstance(partial, list): + return [resolve_partial(x) for x in partial] + elif isinstance(partial, dict): + return {key: resolve_partial(x) for key, x in partial.items()} + else: + return partial + + +def to_railroad( + element: pyparsing.ParserElement, + diagram_kwargs: typing.Optional[dict] = None, + vertical: int = 3, + show_results_names: bool = False, + show_groups: bool = False, +) -> List[NamedDiagram]: + """ + Convert a pyparsing element tree into a list of diagrams. This is the recommended entrypoint to diagram + creation if you want to access the Railroad tree before it is converted to HTML + :param element: base element of the parser being diagrammed + :param diagram_kwargs: kwargs to pass to the Diagram() constructor + :param vertical: (optional) - int - limit at which number of alternatives should be + shown vertically instead of horizontally + :param show_results_names - bool to indicate whether results name annotations should be + included in the diagram + :param show_groups - bool to indicate whether groups should be highlighted with an unlabeled + surrounding box + """ + # Convert the whole tree underneath the root + lookup = ConverterState(diagram_kwargs=diagram_kwargs or {}) + _to_diagram_element( + element, + lookup=lookup, + parent=None, + vertical=vertical, + show_results_names=show_results_names, + show_groups=show_groups, + ) + + root_id = id(element) + # Convert the root if it hasn't been already + if root_id in lookup: + if not element.customName: + lookup[root_id].name = "" + lookup[root_id].mark_for_extraction(root_id, lookup, force=True) + + # Now that we're finished, we can convert from intermediate structures into Railroad elements + diags = list(lookup.diagrams.values()) + if len(diags) > 1: + # collapse out duplicate diags with the same name + seen = set() + deduped_diags = [] + for d in diags: + # don't extract SkipTo elements, they are uninformative as subdiagrams + if d.name == "...": + continue + if d.name is not None and d.name not in seen: + seen.add(d.name) + deduped_diags.append(d) + resolved = [resolve_partial(partial) for partial in deduped_diags] + else: + # special case - if just one diagram, always display it, even if + # it has no name + resolved = [resolve_partial(partial) for partial in diags] + return sorted(resolved, key=lambda diag: diag.index) + + +def _should_vertical( + specification: int, exprs: Iterable[pyparsing.ParserElement] +) -> bool: + """ + Returns true if we should return a vertical list of elements + """ + if specification is None: + return False + else: + return len(_visible_exprs(exprs)) >= specification + + +class ElementState: + """ + State recorded for an individual pyparsing Element + """ + + # Note: this should be a dataclass, but we have to support Python 3.5 + def __init__( + self, + element: pyparsing.ParserElement, + converted: EditablePartial, + parent: EditablePartial, + number: int, + name: str = None, + parent_index: typing.Optional[int] = None, + ): + #: The pyparsing element that this represents + self.element: pyparsing.ParserElement = element + #: The name of the element + self.name: typing.Optional[str] = name + #: The output Railroad element in an unconverted state + self.converted: EditablePartial = converted + #: The parent Railroad element, which we store so that we can extract this if it's duplicated + self.parent: EditablePartial = parent + #: The order in which we found this element, used for sorting diagrams if this is extracted into a diagram + self.number: int = number + #: The index of this inside its parent + self.parent_index: typing.Optional[int] = parent_index + #: If true, we should extract this out into a subdiagram + self.extract: bool = False + #: If true, all of this element's children have been filled out + self.complete: bool = False + + def mark_for_extraction( + self, el_id: int, state: "ConverterState", name: str = None, force: bool = False + ): + """ + Called when this instance has been seen twice, and thus should eventually be extracted into a sub-diagram + :param el_id: id of the element + :param state: element/diagram state tracker + :param name: name to use for this element's text + :param force: If true, force extraction now, regardless of the state of this. Only useful for extracting the + root element when we know we're finished + """ + self.extract = True + + # Set the name + if not self.name: + if name: + # Allow forcing a custom name + self.name = name + elif self.element.customName: + self.name = self.element.customName + else: + self.name = "" + + # Just because this is marked for extraction doesn't mean we can do it yet. We may have to wait for children + # to be added + # Also, if this is just a string literal etc, don't bother extracting it + if force or (self.complete and _worth_extracting(self.element)): + state.extract_into_diagram(el_id) + + +class ConverterState: + """ + Stores some state that persists between recursions into the element tree + """ + + def __init__(self, diagram_kwargs: typing.Optional[dict] = None): + #: A dictionary mapping ParserElements to state relating to them + self._element_diagram_states: Dict[int, ElementState] = {} + #: A dictionary mapping ParserElement IDs to subdiagrams generated from them + self.diagrams: Dict[int, EditablePartial[NamedDiagram]] = {} + #: The index of the next unnamed element + self.unnamed_index: int = 1 + #: The index of the next element. This is used for sorting + self.index: int = 0 + #: Shared kwargs that are used to customize the construction of diagrams + self.diagram_kwargs: dict = diagram_kwargs or {} + self.extracted_diagram_names: Set[str] = set() + + def __setitem__(self, key: int, value: ElementState): + self._element_diagram_states[key] = value + + def __getitem__(self, key: int) -> ElementState: + return self._element_diagram_states[key] + + def __delitem__(self, key: int): + del self._element_diagram_states[key] + + def __contains__(self, key: int): + return key in self._element_diagram_states + + def generate_unnamed(self) -> int: + """ + Generate a number used in the name of an otherwise unnamed diagram + """ + self.unnamed_index += 1 + return self.unnamed_index + + def generate_index(self) -> int: + """ + Generate a number used to index a diagram + """ + self.index += 1 + return self.index + + def extract_into_diagram(self, el_id: int): + """ + Used when we encounter the same token twice in the same tree. When this + happens, we replace all instances of that token with a terminal, and + create a new subdiagram for the token + """ + position = self[el_id] + + # Replace the original definition of this element with a regular block + if position.parent: + ret = EditablePartial.from_call(railroad.NonTerminal, text=position.name) + if "item" in position.parent.kwargs: + position.parent.kwargs["item"] = ret + elif "items" in position.parent.kwargs: + position.parent.kwargs["items"][position.parent_index] = ret + + # If the element we're extracting is a group, skip to its content but keep the title + if position.converted.func == railroad.Group: + content = position.converted.kwargs["item"] + else: + content = position.converted + + self.diagrams[el_id] = EditablePartial.from_call( + NamedDiagram, + name=position.name, + diagram=EditablePartial.from_call( + railroad.Diagram, content, **self.diagram_kwargs + ), + index=position.number, + ) + + del self[el_id] + + +def _worth_extracting(element: pyparsing.ParserElement) -> bool: + """ + Returns true if this element is worth having its own sub-diagram. Simply, if any of its children + themselves have children, then its complex enough to extract + """ + children = element.recurse() + return any(child.recurse() for child in children) + + +def _apply_diagram_item_enhancements(fn): + """ + decorator to ensure enhancements to a diagram item (such as results name annotations) + get applied on return from _to_diagram_element (we do this since there are several + returns in _to_diagram_element) + """ + + def _inner( + element: pyparsing.ParserElement, + parent: typing.Optional[EditablePartial], + lookup: ConverterState = None, + vertical: int = None, + index: int = 0, + name_hint: str = None, + show_results_names: bool = False, + show_groups: bool = False, + ) -> typing.Optional[EditablePartial]: + ret = fn( + element, + parent, + lookup, + vertical, + index, + name_hint, + show_results_names, + show_groups, + ) + + # apply annotation for results name, if present + if show_results_names and ret is not None: + element_results_name = element.resultsName + if element_results_name: + # add "*" to indicate if this is a "list all results" name + element_results_name += "" if element.modalResults else "*" + ret = EditablePartial.from_call( + railroad.Group, item=ret, label=element_results_name + ) + + return ret + + return _inner + + +def _visible_exprs(exprs: Iterable[pyparsing.ParserElement]): + non_diagramming_exprs = ( + pyparsing.ParseElementEnhance, + pyparsing.PositionToken, + pyparsing.And._ErrorStop, + ) + return [ + e + for e in exprs + if not (e.customName or e.resultsName or isinstance(e, non_diagramming_exprs)) + ] + + +@_apply_diagram_item_enhancements +def _to_diagram_element( + element: pyparsing.ParserElement, + parent: typing.Optional[EditablePartial], + lookup: ConverterState = None, + vertical: int = None, + index: int = 0, + name_hint: str = None, + show_results_names: bool = False, + show_groups: bool = False, +) -> typing.Optional[EditablePartial]: + """ + Recursively converts a PyParsing Element to a railroad Element + :param lookup: The shared converter state that keeps track of useful things + :param index: The index of this element within the parent + :param parent: The parent of this element in the output tree + :param vertical: Controls at what point we make a list of elements vertical. If this is an integer (the default), + it sets the threshold of the number of items before we go vertical. If True, always go vertical, if False, never + do so + :param name_hint: If provided, this will override the generated name + :param show_results_names: bool flag indicating whether to add annotations for results names + :returns: The converted version of the input element, but as a Partial that hasn't yet been constructed + :param show_groups: bool flag indicating whether to show groups using bounding box + """ + exprs = element.recurse() + name = name_hint or element.customName or element.__class__.__name__ + + # Python's id() is used to provide a unique identifier for elements + el_id = id(element) + + element_results_name = element.resultsName + + # Here we basically bypass processing certain wrapper elements if they contribute nothing to the diagram + if not element.customName: + if isinstance( + element, + ( + # pyparsing.TokenConverter, + # pyparsing.Forward, + pyparsing.Located, + ), + ): + # However, if this element has a useful custom name, and its child does not, we can pass it on to the child + if exprs: + if not exprs[0].customName: + propagated_name = name + else: + propagated_name = None + + return _to_diagram_element( + element.expr, + parent=parent, + lookup=lookup, + vertical=vertical, + index=index, + name_hint=propagated_name, + show_results_names=show_results_names, + show_groups=show_groups, + ) + + # If the element isn't worth extracting, we always treat it as the first time we say it + if _worth_extracting(element): + if el_id in lookup: + # If we've seen this element exactly once before, we are only just now finding out that it's a duplicate, + # so we have to extract it into a new diagram. + looked_up = lookup[el_id] + looked_up.mark_for_extraction(el_id, lookup, name=name_hint) + ret = EditablePartial.from_call(railroad.NonTerminal, text=looked_up.name) + return ret + + elif el_id in lookup.diagrams: + # If we have seen the element at least twice before, and have already extracted it into a subdiagram, we + # just put in a marker element that refers to the sub-diagram + ret = EditablePartial.from_call( + railroad.NonTerminal, text=lookup.diagrams[el_id].kwargs["name"] + ) + return ret + + # Recursively convert child elements + # Here we find the most relevant Railroad element for matching pyparsing Element + # We use ``items=[]`` here to hold the place for where the child elements will go once created + if isinstance(element, pyparsing.And): + # detect And's created with ``expr*N`` notation - for these use a OneOrMore with a repeat + # (all will have the same name, and resultsName) + if not exprs: + return None + if len(set((e.name, e.resultsName) for e in exprs)) == 1: + ret = EditablePartial.from_call( + railroad.OneOrMore, item="", repeat=str(len(exprs)) + ) + elif _should_vertical(vertical, exprs): + ret = EditablePartial.from_call(railroad.Stack, items=[]) + else: + ret = EditablePartial.from_call(railroad.Sequence, items=[]) + elif isinstance(element, (pyparsing.Or, pyparsing.MatchFirst)): + if not exprs: + return None + if _should_vertical(vertical, exprs): + ret = EditablePartial.from_call(railroad.Choice, 0, items=[]) + else: + ret = EditablePartial.from_call(railroad.HorizontalChoice, items=[]) + elif isinstance(element, pyparsing.Each): + if not exprs: + return None + ret = EditablePartial.from_call(EachItem, items=[]) + elif isinstance(element, pyparsing.NotAny): + ret = EditablePartial.from_call(AnnotatedItem, label="NOT", item="") + elif isinstance(element, pyparsing.FollowedBy): + ret = EditablePartial.from_call(AnnotatedItem, label="LOOKAHEAD", item="") + elif isinstance(element, pyparsing.PrecededBy): + ret = EditablePartial.from_call(AnnotatedItem, label="LOOKBEHIND", item="") + elif isinstance(element, pyparsing.Group): + if show_groups: + ret = EditablePartial.from_call(AnnotatedItem, label="", item="") + else: + ret = EditablePartial.from_call(railroad.Group, label="", item="") + elif isinstance(element, pyparsing.TokenConverter): + label = type(element).__name__.lower() + if label == "tokenconverter": + ret = EditablePartial.from_call(railroad.Sequence, items=[]) + else: + ret = EditablePartial.from_call(AnnotatedItem, label=label, item="") + elif isinstance(element, pyparsing.Opt): + ret = EditablePartial.from_call(railroad.Optional, item="") + elif isinstance(element, pyparsing.OneOrMore): + ret = EditablePartial.from_call(railroad.OneOrMore, item="") + elif isinstance(element, pyparsing.ZeroOrMore): + ret = EditablePartial.from_call(railroad.ZeroOrMore, item="") + elif isinstance(element, pyparsing.Group): + ret = EditablePartial.from_call( + railroad.Group, item=None, label=element_results_name + ) + elif isinstance(element, pyparsing.Empty) and not element.customName: + # Skip unnamed "Empty" elements + ret = None + elif isinstance(element, pyparsing.ParseElementEnhance): + ret = EditablePartial.from_call(railroad.Sequence, items=[]) + elif len(exprs) > 0 and not element_results_name: + ret = EditablePartial.from_call(railroad.Group, item="", label=name) + elif len(exprs) > 0: + ret = EditablePartial.from_call(railroad.Sequence, items=[]) + else: + terminal = EditablePartial.from_call(railroad.Terminal, element.defaultName) + ret = terminal + + if ret is None: + return + + # Indicate this element's position in the tree so we can extract it if necessary + lookup[el_id] = ElementState( + element=element, + converted=ret, + parent=parent, + parent_index=index, + number=lookup.generate_index(), + ) + if element.customName: + lookup[el_id].mark_for_extraction(el_id, lookup, element.customName) + + i = 0 + for expr in exprs: + # Add a placeholder index in case we have to extract the child before we even add it to the parent + if "items" in ret.kwargs: + ret.kwargs["items"].insert(i, None) + + item = _to_diagram_element( + expr, + parent=ret, + lookup=lookup, + vertical=vertical, + index=i, + show_results_names=show_results_names, + show_groups=show_groups, + ) + + # Some elements don't need to be shown in the diagram + if item is not None: + if "item" in ret.kwargs: + ret.kwargs["item"] = item + elif "items" in ret.kwargs: + # If we've already extracted the child, don't touch this index, since it's occupied by a nonterminal + ret.kwargs["items"][i] = item + i += 1 + elif "items" in ret.kwargs: + # If we're supposed to skip this element, remove it from the parent + del ret.kwargs["items"][i] + + # If all this items children are none, skip this item + if ret and ( + ("items" in ret.kwargs and len(ret.kwargs["items"]) == 0) + or ("item" in ret.kwargs and ret.kwargs["item"] is None) + ): + ret = EditablePartial.from_call(railroad.Terminal, name) + + # Mark this element as "complete", ie it has all of its children + if el_id in lookup: + lookup[el_id].complete = True + + if el_id in lookup and lookup[el_id].extract and lookup[el_id].complete: + lookup.extract_into_diagram(el_id) + if ret is not None: + ret = EditablePartial.from_call( + railroad.NonTerminal, text=lookup.diagrams[el_id].kwargs["name"] + ) + + return ret diff --git a/shared/package-files/9f/9f1a48d67e419aec75ca6164d651a05a0cd2cea147203bc7ff2fc527348632a7/blob b/shared/package-files/9f/9f1a48d67e419aec75ca6164d651a05a0cd2cea147203bc7ff2fc527348632a7/blob new file mode 100644 index 0000000000000000000000000000000000000000..ed6eb8d9513e37b84e4d86b6b29c15f6ad654585 --- /dev/null +++ b/shared/package-files/9f/9f1a48d67e419aec75ca6164d651a05a0cd2cea147203bc7ff2fc527348632a7/blob @@ -0,0 +1,16 @@ +from typing import Any, Dict, Tuple +from weakref import ReferenceType + +localdict = Dict[Any, Any] + +class _localimpl: + key: str + dicts: Dict[int, Tuple[ReferenceType[Any], localdict]] + def __init__(self) -> None: ... + def get_dict(self) -> localdict: ... + def create_dict(self) -> localdict: ... + +class local: + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... diff --git a/shared/package-files/9f/9f1b5dc466753ea0d337fea68931e8e9d7f1900a6e64624656dea3d42093ef65/blob b/shared/package-files/9f/9f1b5dc466753ea0d337fea68931e8e9d7f1900a6e64624656dea3d42093ef65/blob new file mode 100644 index 0000000000000000000000000000000000000000..9e0dc6b68d697c568266c4e038869ba388fc7fc9 Binary files /dev/null and b/shared/package-files/9f/9f1b5dc466753ea0d337fea68931e8e9d7f1900a6e64624656dea3d42093ef65/blob differ diff --git a/shared/package-files/9f/9f1ee69b56346ac987944656208d10ee8c0b2eaa37175def28f3b4ad69c0ac79/blob b/shared/package-files/9f/9f1ee69b56346ac987944656208d10ee8c0b2eaa37175def28f3b4ad69c0ac79/blob new file mode 100644 index 0000000000000000000000000000000000000000..06f41fbe7355857c96601293d64a8e83ea322893 --- /dev/null +++ b/shared/package-files/9f/9f1ee69b56346ac987944656208d10ee8c0b2eaa37175def28f3b4ad69c0ac79/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API binomial { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, c10::optional); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::binomial") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "binomial(Tensor count, Tensor prob, Generator? generator=None) -> Tensor") + static at::Tensor call(const at::Tensor & count, const at::Tensor & prob, c10::optional generator); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & count, const at::Tensor & prob, c10::optional generator); +}; + +struct TORCH_API binomial_out { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, c10::optional, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::binomial") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "binomial.out(Tensor count, Tensor prob, Generator? generator=None, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & count, const at::Tensor & prob, c10::optional generator, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & count, const at::Tensor & prob, c10::optional generator, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9f/9f21817df9ab001c06e2b4f1bd1008f40a87863fde7833d2fa1ab817b5f56d4d/blob b/shared/package-files/9f/9f21817df9ab001c06e2b4f1bd1008f40a87863fde7833d2fa1ab817b5f56d4d/blob new file mode 100644 index 0000000000000000000000000000000000000000..8adc9b9838f3aee6b05b15a2c942e971ac354c7b --- /dev/null +++ b/shared/package-files/9f/9f21817df9ab001c06e2b4f1bd1008f40a87863fde7833d2fa1ab817b5f56d4d/blob @@ -0,0 +1,30 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API at::Tensor clip(const at::Tensor & self, const c10::optional & min, const c10::optional & max=c10::nullopt); +TORCH_API at::Tensor & clip_out(at::Tensor & out, const at::Tensor & self, const c10::optional & min, const c10::optional & max=c10::nullopt); +TORCH_API at::Tensor & clip_outf(const at::Tensor & self, const c10::optional & min, const c10::optional & max, at::Tensor & out); +TORCH_API at::Tensor & clip_(at::Tensor & self, const c10::optional & min, const c10::optional & max=c10::nullopt); +TORCH_API at::Tensor clip(const at::Tensor & self, const c10::optional & min={}, const c10::optional & max={}); +TORCH_API at::Tensor & clip_out(at::Tensor & out, const at::Tensor & self, const c10::optional & min={}, const c10::optional & max={}); +TORCH_API at::Tensor & clip_outf(const at::Tensor & self, const c10::optional & min, const c10::optional & max, at::Tensor & out); +TORCH_API at::Tensor & clip_(at::Tensor & self, const c10::optional & min={}, const c10::optional & max={}); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/shared/package-files/9f/9f221331d0f6f5de9b8ca32011b8c28579a7502806991f308afd64e14df0d90e/blob b/shared/package-files/9f/9f221331d0f6f5de9b8ca32011b8c28579a7502806991f308afd64e14df0d90e/blob new file mode 100644 index 0000000000000000000000000000000000000000..f8c2203e8450e8cdec8272dbc50a82efc040f679 --- /dev/null +++ b/shared/package-files/9f/9f221331d0f6f5de9b8ca32011b8c28579a7502806991f308afd64e14df0d90e/blob @@ -0,0 +1,24 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API void _foreach_tan_out(at::TensorList out, at::TensorList self); +TORCH_API void _foreach_tan_outf(at::TensorList self, at::TensorList out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9f/9f246f205d76a13651994d2a0e180e431f00b14828663d73314f2d0c6c8e3fc5/blob b/shared/package-files/9f/9f246f205d76a13651994d2a0e180e431f00b14828663d73314f2d0c6c8e3fc5/blob new file mode 100644 index 0000000000000000000000000000000000000000..9b4f8d65f88aef886ce8d12dcd2b844985d952e3 --- /dev/null +++ b/shared/package-files/9f/9f246f205d76a13651994d2a0e180e431f00b14828663d73314f2d0c6c8e3fc5/blob @@ -0,0 +1,1820 @@ +""" + pygments.lexers.jvm + ~~~~~~~~~~~~~~~~~~~ + + Pygments lexers for JVM languages. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \ + this, combined, default, words +from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ + Number, Punctuation, Whitespace +from pygments.util import shebang_matches +from pygments import unistring as uni + +__all__ = ['JavaLexer', 'ScalaLexer', 'GosuLexer', 'GosuTemplateLexer', + 'GroovyLexer', 'IokeLexer', 'ClojureLexer', 'ClojureScriptLexer', + 'KotlinLexer', 'XtendLexer', 'AspectJLexer', 'CeylonLexer', + 'PigLexer', 'GoloLexer', 'JasminLexer', 'SarlLexer'] + + +class JavaLexer(RegexLexer): + """ + For Java source code. + """ + + name = 'Java' + url = 'https://www.oracle.com/technetwork/java/' + aliases = ['java'] + filenames = ['*.java'] + mimetypes = ['text/x-java'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + (r'(^\s*)((?:(?:public|private|protected|static|strictfp)(?:\s+))*)(record)\b', + bygroups(Whitespace, using(this), Keyword.Declaration), 'class'), + (r'[^\S\n]+', Whitespace), + (r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)), + (r'/\*.*?\*/', Comment.Multiline), + # keywords: go before method names to avoid lexing "throw new XYZ" + # as a method signature + (r'(assert|break|case|catch|continue|default|do|else|finally|for|' + r'if|goto|instanceof|new|return|switch|this|throw|try|while)\b', + Keyword), + # method names + (r'((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)' # return arguments + r'((?:[^\W\d]|\$)[\w$]*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Whitespace, Punctuation)), + (r'@[^\W\d][\w.]*', Name.Decorator), + (r'(abstract|const|enum|extends|final|implements|native|private|' + r'protected|public|sealed|static|strictfp|super|synchronized|throws|' + r'transient|volatile|yield)\b', Keyword.Declaration), + (r'(boolean|byte|char|double|float|int|long|short|void)\b', + Keyword.Type), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'), + (r'(true|false|null)\b', Keyword.Constant), + (r'(class|interface)\b', Keyword.Declaration, 'class'), + (r'(var)(\s+)', bygroups(Keyword.Declaration, Whitespace), 'var'), + (r'(import(?:\s+static)?)(\s+)', bygroups(Keyword.Namespace, Whitespace), + 'import'), + (r'"""\n', String, 'multiline_string'), + (r'"', String, 'string'), + (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), + (r'(\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Punctuation, + Name.Attribute)), + (r'^(\s*)(default)(:)', bygroups(Whitespace, Keyword, Punctuation)), + (r'^(\s*)((?:[^\W\d]|\$)[\w$]*)(:)', bygroups(Whitespace, Name.Label, + Punctuation)), + (r'([^\W\d]|\$)[\w$]*', Name), + (r'([0-9][0-9_]*\.([0-9][0-9_]*)?|' + r'\.[0-9][0-9_]*)' + r'([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|' + r'[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|' + r'[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|' + r'0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|' + r'([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)' + r'[pP][+\-]?[0-9][0-9_]*[fFdD]?', Number.Float), + (r'0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?', Number.Hex), + (r'0[bB][01][01_]*[lL]?', Number.Bin), + (r'0[0-7_]+[lL]?', Number.Oct), + (r'0|[1-9][0-9_]*[lL]?', Number.Integer), + (r'[~^*!%&\[\]<>|+=/?-]', Operator), + (r'[{}();:.,]', Punctuation), + (r'\n', Whitespace) + ], + 'class': [ + (r'\s+', Text), + (r'([^\W\d]|\$)[\w$]*', Name.Class, '#pop') + ], + 'var': [ + (r'([^\W\d]|\$)[\w$]*', Name, '#pop') + ], + 'import': [ + (r'[\w.]+\*?', Name.Namespace, '#pop') + ], + 'multiline_string': [ + (r'"""', String, '#pop'), + (r'"', String), + include('string') + ], + 'string': [ + (r'[^\\"]+', String), + (r'\\\\', String), # Escaped backslash + (r'\\"', String), # Escaped quote + (r'\\', String), # Bare backslash + (r'"', String, '#pop'), # Closing quote + ], + } + + +class AspectJLexer(JavaLexer): + """ + For AspectJ source code. + + .. versionadded:: 1.6 + """ + + name = 'AspectJ' + url = 'http://www.eclipse.org/aspectj/' + aliases = ['aspectj'] + filenames = ['*.aj'] + mimetypes = ['text/x-aspectj'] + + aj_keywords = { + 'aspect', 'pointcut', 'privileged', 'call', 'execution', + 'initialization', 'preinitialization', 'handler', 'get', 'set', + 'staticinitialization', 'target', 'args', 'within', 'withincode', + 'cflow', 'cflowbelow', 'annotation', 'before', 'after', 'around', + 'proceed', 'throwing', 'returning', 'adviceexecution', 'declare', + 'parents', 'warning', 'error', 'soft', 'precedence', 'thisJoinPoint', + 'thisJoinPointStaticPart', 'thisEnclosingJoinPointStaticPart', + 'issingleton', 'perthis', 'pertarget', 'percflow', 'percflowbelow', + 'pertypewithin', 'lock', 'unlock', 'thisAspectInstance' + } + aj_inter_type = {'parents:', 'warning:', 'error:', 'soft:', 'precedence:'} + aj_inter_type_annotation = {'@type', '@method', '@constructor', '@field'} + + def get_tokens_unprocessed(self, text): + for index, token, value in JavaLexer.get_tokens_unprocessed(self, text): + if token is Name and value in self.aj_keywords: + yield index, Keyword, value + elif token is Name.Label and value in self.aj_inter_type: + yield index, Keyword, value[:-1] + yield index, Operator, value[-1] + elif token is Name.Decorator and value in self.aj_inter_type_annotation: + yield index, Keyword, value + else: + yield index, token, value + + +class ScalaLexer(RegexLexer): + """ + For Scala source code. + """ + + name = 'Scala' + url = 'http://www.scala-lang.org' + aliases = ['scala'] + filenames = ['*.scala'] + mimetypes = ['text/x-scala'] + + flags = re.MULTILINE | re.DOTALL + + opchar = '[!#%&*\\-\\/:?@^' + uni.combine('Sm', 'So') + ']' + letter = '[_\\$' + uni.combine('Ll', 'Lu', 'Lo', 'Nl', 'Lt') + ']' + upperLetter = '[' + uni.combine('Lu', 'Lt') + ']' + letterOrDigit = '(?:%s|[0-9])' % letter + letterOrDigitNoDollarSign = '(?:%s|[0-9])' % letter.replace('\\$', '') + alphaId = '%s+' % letter + simpleInterpolatedVariable = '%s%s*' % (letter, letterOrDigitNoDollarSign) + idrest = '%s%s*(?:(?<=_)%s+)?' % (letter, letterOrDigit, opchar) + idUpper = '%s%s*(?:(?<=_)%s+)?' % (upperLetter, letterOrDigit, opchar) + plainid = '(?:%s|%s+)' % (idrest, opchar) + backQuotedId = r'`[^`]+`' + anyId = r'(?:%s|%s)' % (plainid, backQuotedId) + notStartOfComment = r'(?!//|/\*)' + endOfLineMaybeWithComment = r'(?=\s*(//|$))' + + keywords = ( + 'new', 'return', 'throw', 'classOf', 'isInstanceOf', 'asInstanceOf', + 'else', 'if', 'then', 'do', 'while', 'for', 'yield', 'match', 'case', + 'catch', 'finally', 'try' + ) + + operators = ( + '<%', '=:=', '<:<', '<%<', '>:', '<:', '=', '==', '!=', '<=', '>=', + '<>', '<', '>', '<-', '←', '->', '→', '=>', '⇒', '?', '@', '|', '-', + '+', '*', '%', '~', '\\' + ) + + storage_modifiers = ( + 'private', 'protected', 'synchronized', '@volatile', 'abstract', + 'final', 'lazy', 'sealed', 'implicit', 'override', '@transient', + '@native' + ) + + tokens = { + 'root': [ + include('whitespace'), + include('comments'), + include('script-header'), + include('imports'), + include('exports'), + include('storage-modifiers'), + include('annotations'), + include('using'), + include('declarations'), + include('inheritance'), + include('extension'), + include('end'), + include('constants'), + include('strings'), + include('symbols'), + include('singleton-type'), + include('inline'), + include('quoted'), + include('keywords'), + include('operators'), + include('punctuation'), + include('names'), + ], + + # Includes: + 'whitespace': [ + (r'\s+', Whitespace), + ], + 'comments': [ + (r'//.*?\n', Comment.Single), + (r'/\*', Comment.Multiline, 'comment'), + ], + 'script-header': [ + (r'^#!([^\n]*)$', Comment.Hashbang), + ], + 'imports': [ + (r'\b(import)(\s+)', bygroups(Keyword, Whitespace), 'import-path'), + ], + 'exports': [ + (r'\b(export)(\s+)(given)(\s+)', + bygroups(Keyword, Whitespace, Keyword, Whitespace), 'export-path'), + (r'\b(export)(\s+)', bygroups(Keyword, Whitespace), 'export-path'), + ], + 'storage-modifiers': [ + (words(storage_modifiers, prefix=r'\b', suffix=r'\b'), Keyword), + # Only highlight soft modifiers if they are eventually followed by + # the correct keyword. Note that soft modifiers can be followed by a + # sequence of regular modifiers; [a-z\s]* skips those, and we just + # check that the soft modifier is applied to a supported statement. + (r'\b(transparent|opaque|infix|open|inline)\b(?=[a-z\s]*\b' + r'(def|val|var|given|type|class|trait|object|enum)\b)', Keyword), + ], + 'annotations': [ + (r'@%s' % idrest, Name.Decorator), + ], + 'using': [ + # using is a soft keyword, can only be used in the first position of + # a parameter or argument list. + (r'(\()(\s*)(using)(\s)', bygroups(Punctuation, Whitespace, Keyword, Whitespace)), + ], + 'declarations': [ + (r'\b(def)\b(\s*)%s(%s)?' % (notStartOfComment, anyId), + bygroups(Keyword, Whitespace, Name.Function)), + (r'\b(trait)\b(\s*)%s(%s)?' % (notStartOfComment, anyId), + bygroups(Keyword, Whitespace, Name.Class)), + (r'\b(?:(case)(\s+))?(class|object|enum)\b(\s*)%s(%s)?' % + (notStartOfComment, anyId), + bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Class)), + (r'(?)|(?=%s)|(?="))?' % + (idUpper, backQuotedId, plainid), + bygroups(Keyword, Whitespace, Name.Class)), + ], + 'extension': [ + (r'\b(extension)(\s+)(?=[\[\(])', bygroups(Keyword, Whitespace)), + ], + 'end': [ + # end is a soft keyword, should only be highlighted in certain cases + (r'\b(end)(\s+)(if|while|for|match|new|extension|val|var)\b', + bygroups(Keyword, Whitespace, Keyword)), + (r'\b(end)(\s+)(%s)%s' % (idUpper, endOfLineMaybeWithComment), + bygroups(Keyword, Whitespace, Name.Class)), + (r'\b(end)(\s+)(%s|%s)?%s' % + (backQuotedId, plainid, endOfLineMaybeWithComment), + bygroups(Keyword, Whitespace, Name.Namespace)), + ], + 'punctuation': [ + (r'[{}()\[\];,.]', Punctuation), + (r'(?', Operator), + (r'\}', Punctuation, '#pop'), + (r',', Punctuation), + (r'[\[\]]', Punctuation), + include('qualified-name'), + ], + 'export-path': [ + (r'(?<=[\n;:])', Text, '#pop'), + include('comments'), + include('qualified-name'), + (r'\{', Punctuation, 'export-path-curly-brace'), + ], + 'export-path-curly-brace': [ + include('whitespace'), + include('comments'), + (r'=>', Operator), + (r'\}', Punctuation, '#pop'), + (r',', Punctuation), + include('qualified-name'), + ], + 'package': [ + (r'(?<=[\n;])', Text, '#pop'), + (r':', Punctuation, '#pop'), + include('comments'), + include('qualified-name'), + ], + 'interpolated-string-triple': [ + (r'"""(?!")', String, '#pop'), + (r'"', String), + include('interpolated-string-common'), + ], + 'interpolated-string': [ + (r'"', String, '#pop'), + include('interpolated-string-common'), + ], + 'interpolated-string-brace': [ + (r'\}', String.Interpol, '#pop'), + (r'\{', Punctuation, 'interpolated-string-nested-brace'), + include('root'), + ], + 'interpolated-string-nested-brace': [ + (r'\{', Punctuation, '#push'), + (r'\}', Punctuation, '#pop'), + include('root'), + ], + + # Helpers + 'qualified-name': [ + (idUpper, Name.Class), + (r'(%s)(\.)' % anyId, bygroups(Name.Namespace, Punctuation)), + (r'\.', Punctuation), + (anyId, Name), + (r'[^\S\n]+', Whitespace), + ], + 'interpolated-string-common': [ + (r'[^"$\\]+', String), + (r'\$\$', String.Escape), + (r'(\$)(%s)' % simpleInterpolatedVariable, + bygroups(String.Interpol, Name)), + (r'\$\{', String.Interpol, 'interpolated-string-brace'), + (r'\\.', String), + ], + } + + +class GosuLexer(RegexLexer): + """ + For Gosu source code. + + .. versionadded:: 1.5 + """ + + name = 'Gosu' + aliases = ['gosu'] + filenames = ['*.gs', '*.gsx', '*.gsp', '*.vark'] + mimetypes = ['text/x-gosu'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # modifiers etc. + r'([a-zA-Z_]\w*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Whitespace, Operator)), + (r'[^\S\n]+', Whitespace), + (r'//.*?\n', Comment.Single), + (r'/\*.*?\*/', Comment.Multiline), + (r'@[a-zA-Z_][\w.]*', Name.Decorator), + (r'(in|as|typeof|statictypeof|typeis|typeas|if|else|foreach|for|' + r'index|while|do|continue|break|return|try|catch|finally|this|' + r'throw|new|switch|case|default|eval|super|outer|classpath|' + r'using)\b', Keyword), + (r'(var|delegate|construct|function|private|internal|protected|' + r'public|abstract|override|final|static|extends|transient|' + r'implements|represents|readonly)\b', Keyword.Declaration), + (r'(property)(\s+)(get|set)?', bygroups(Keyword.Declaration, Whitespace, Keyword.Declaration)), + (r'(boolean|byte|char|double|float|int|long|short|void|block)\b', + Keyword.Type), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace)), + (r'(true|false|null|NaN|Infinity)\b', Keyword.Constant), + (r'(class|interface|enhancement|enum)(\s+)([a-zA-Z_]\w*)', + bygroups(Keyword.Declaration, Whitespace, Name.Class)), + (r'(uses)(\s+)([\w.]+\*?)', + bygroups(Keyword.Namespace, Whitespace, Name.Namespace)), + (r'"', String, 'string'), + (r'(\??[.#])([a-zA-Z_]\w*)', + bygroups(Operator, Name.Attribute)), + (r'(:)([a-zA-Z_]\w*)', + bygroups(Operator, Name.Attribute)), + (r'[a-zA-Z_$]\w*', Name), + (r'and|or|not|[\\~^*!%&\[\](){}<>|+=:;,./?-]', Operator), + (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'[0-9]+', Number.Integer), + (r'\n', Whitespace) + ], + 'templateText': [ + (r'(\\<)|(\\\$)', String), + (r'(<%@\s+)(extends|params)', + bygroups(Operator, Name.Decorator), 'stringTemplate'), + (r'<%!--.*?--%>', Comment.Multiline), + (r'(<%)|(<%=)', Operator, 'stringTemplate'), + (r'\$\{', Operator, 'stringTemplateShorthand'), + (r'.', String) + ], + 'string': [ + (r'"', String, '#pop'), + include('templateText') + ], + 'stringTemplate': [ + (r'"', String, 'string'), + (r'%>', Operator, '#pop'), + include('root') + ], + 'stringTemplateShorthand': [ + (r'"', String, 'string'), + (r'\{', Operator, 'stringTemplateShorthand'), + (r'\}', Operator, '#pop'), + include('root') + ], + } + + +class GosuTemplateLexer(Lexer): + """ + For Gosu templates. + + .. versionadded:: 1.5 + """ + + name = 'Gosu Template' + aliases = ['gst'] + filenames = ['*.gst'] + mimetypes = ['text/x-gosu-template'] + + def get_tokens_unprocessed(self, text): + lexer = GosuLexer() + stack = ['templateText'] + yield from lexer.get_tokens_unprocessed(text, stack) + + +class GroovyLexer(RegexLexer): + """ + For Groovy source code. + + .. versionadded:: 1.5 + """ + + name = 'Groovy' + url = 'https://groovy-lang.org/' + aliases = ['groovy'] + filenames = ['*.groovy','*.gradle'] + mimetypes = ['text/x-groovy'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + # Groovy allows a file to start with a shebang + (r'#!(.*?)$', Comment.Preproc, 'base'), + default('base'), + ], + 'base': [ + (r'[^\S\n]+', Whitespace), + (r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)), + (r'/\*.*?\*/', Comment.Multiline), + # keywords: go before method names to avoid lexing "throw new XYZ" + # as a method signature + (r'(assert|break|case|catch|continue|default|do|else|finally|for|' + r'if|goto|instanceof|new|return|switch|this|throw|try|while|in|as)\b', + Keyword), + # method names + (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments + r'(' + r'[a-zA-Z_]\w*' # method name + r'|"(?:\\\\|\\[^\\]|[^"\\])*"' # or double-quoted method name + r"|'(?:\\\\|\\[^\\]|[^'\\])*'" # or single-quoted method name + r')' + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Whitespace, Operator)), + (r'@[a-zA-Z_][\w.]*', Name.Decorator), + (r'(abstract|const|enum|extends|final|implements|native|private|' + r'protected|public|static|strictfp|super|synchronized|throws|' + r'transient|volatile)\b', Keyword.Declaration), + (r'(def|boolean|byte|char|double|float|int|long|short|void)\b', + Keyword.Type), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace)), + (r'(true|false|null)\b', Keyword.Constant), + (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Whitespace), + 'class'), + (r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'), + (r'""".*?"""', String.Double), + (r"'''.*?'''", String.Single), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), + (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), + (r'\$/((?!/\$).)*/\$', String), + (r'/(\\\\|\\[^\\]|[^/\\])*/', String), + (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), + (r'(\.)([a-zA-Z_]\w*)', bygroups(Operator, Name.Attribute)), + (r'[a-zA-Z_]\w*:', Name.Label), + (r'[a-zA-Z_$]\w*', Name), + (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator), + (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Whitespace) + ], + 'class': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop') + ], + 'import': [ + (r'[\w.]+\*?', Name.Namespace, '#pop') + ], + } + + def analyse_text(text): + return shebang_matches(text, r'groovy') + + +class IokeLexer(RegexLexer): + """ + For Ioke (a strongly typed, dynamic, + prototype based programming language) source. + + .. versionadded:: 1.4 + """ + name = 'Ioke' + url = 'https://ioke.org/' + filenames = ['*.ik'] + aliases = ['ioke', 'ik'] + mimetypes = ['text/x-iokesrc'] + tokens = { + 'interpolatableText': [ + (r'(\\b|\\e|\\t|\\n|\\f|\\r|\\"|\\\\|\\#|\\\Z|\\u[0-9a-fA-F]{1,4}' + r'|\\[0-3]?[0-7]?[0-7])', String.Escape), + (r'#\{', Punctuation, 'textInterpolationRoot') + ], + + 'text': [ + (r'(?>|\|\|>>|\*\*>>|:::|::|\.\.\.|===|\*\*>|\*\*=|&&>|&&=|' + r'\|\|>|\|\|=|\->>|\+>>|!>>|<>>>|<>>|&>>|%>>|#>>|@>>|/>>|\*>>|' + r'\?>>|\|>>|\^>>|~>>|\$>>|=>>|<<=|>>=|<=>|<\->|=~|!~|=>|\+\+|' + r'\-\-|<=|>=|==|!=|&&|\.\.|\+=|\-=|\*=|\/=|%=|&=|\^=|\|=|<\-|' + r'\+>|!>|<>|&>|%>|#>|\@>|\/>|\*>|\?>|\|>|\^>|~>|\$>|<\->|\->|' + r'<<|>>|\*\*|\?\||\?&|\|\||>|<|\*|\/|%|\+|\-|&|\^|\||=|\$|!|~|' + r'\?|#|\u2260|\u2218|\u2208|\u2209)', Operator), + (r'(and|nand|or|xor|nor|return|import)(?![\w!?])', + Operator), + + # Punctuation + (r'(\`\`|\`|\'\'|\'|\.|\,|@@|@|\[|\]|\(|\)|\{|\})', Punctuation), + + # kinds + (r'[A-Z][\w!:?]*', Name.Class), + + # default cellnames + (r'[a-z_][\w!:?]*', Name) + ] + } + + +class ClojureLexer(RegexLexer): + """ + Lexer for Clojure source code. + + .. versionadded:: 0.11 + """ + name = 'Clojure' + url = 'http://clojure.org/' + aliases = ['clojure', 'clj'] + filenames = ['*.clj', '*.cljc'] + mimetypes = ['text/x-clojure', 'application/x-clojure'] + + special_forms = ( + '.', 'def', 'do', 'fn', 'if', 'let', 'new', 'quote', 'var', 'loop' + ) + + # It's safe to consider 'ns' a declaration thing because it defines a new + # namespace. + declarations = ( + 'def-', 'defn', 'defn-', 'defmacro', 'defmulti', 'defmethod', + 'defstruct', 'defonce', 'declare', 'definline', 'definterface', + 'defprotocol', 'defrecord', 'deftype', 'defproject', 'ns' + ) + + builtins = ( + '*', '+', '-', '->', '/', '<', '<=', '=', '==', '>', '>=', '..', + 'accessor', 'agent', 'agent-errors', 'aget', 'alength', 'all-ns', + 'alter', 'and', 'append-child', 'apply', 'array-map', 'aset', + 'aset-boolean', 'aset-byte', 'aset-char', 'aset-double', 'aset-float', + 'aset-int', 'aset-long', 'aset-short', 'assert', 'assoc', 'await', + 'await-for', 'bean', 'binding', 'bit-and', 'bit-not', 'bit-or', + 'bit-shift-left', 'bit-shift-right', 'bit-xor', 'boolean', 'branch?', + 'butlast', 'byte', 'cast', 'char', 'children', 'class', + 'clear-agent-errors', 'comment', 'commute', 'comp', 'comparator', + 'complement', 'concat', 'conj', 'cons', 'constantly', 'cond', 'if-not', + 'construct-proxy', 'contains?', 'count', 'create-ns', 'create-struct', + 'cycle', 'dec', 'deref', 'difference', 'disj', 'dissoc', 'distinct', + 'doall', 'doc', 'dorun', 'doseq', 'dosync', 'dotimes', 'doto', + 'double', 'down', 'drop', 'drop-while', 'edit', 'end?', 'ensure', + 'eval', 'every?', 'false?', 'ffirst', 'file-seq', 'filter', 'find', + 'find-doc', 'find-ns', 'find-var', 'first', 'float', 'flush', 'for', + 'fnseq', 'frest', 'gensym', 'get-proxy-class', 'get', + 'hash-map', 'hash-set', 'identical?', 'identity', 'if-let', 'import', + 'in-ns', 'inc', 'index', 'insert-child', 'insert-left', 'insert-right', + 'inspect-table', 'inspect-tree', 'instance?', 'int', 'interleave', + 'intersection', 'into', 'into-array', 'iterate', 'join', 'key', 'keys', + 'keyword', 'keyword?', 'last', 'lazy-cat', 'lazy-cons', 'left', + 'lefts', 'line-seq', 'list*', 'list', 'load', 'load-file', + 'locking', 'long', 'loop', 'macroexpand', 'macroexpand-1', + 'make-array', 'make-node', 'map', 'map-invert', 'map?', 'mapcat', + 'max', 'max-key', 'memfn', 'merge', 'merge-with', 'meta', 'min', + 'min-key', 'name', 'namespace', 'neg?', 'new', 'newline', 'next', + 'nil?', 'node', 'not', 'not-any?', 'not-every?', 'not=', 'ns-imports', + 'ns-interns', 'ns-map', 'ns-name', 'ns-publics', 'ns-refers', + 'ns-resolve', 'ns-unmap', 'nth', 'nthrest', 'or', 'parse', 'partial', + 'path', 'peek', 'pop', 'pos?', 'pr', 'pr-str', 'print', 'print-str', + 'println', 'println-str', 'prn', 'prn-str', 'project', 'proxy', + 'proxy-mappings', 'quot', 'rand', 'rand-int', 'range', 're-find', + 're-groups', 're-matcher', 're-matches', 're-pattern', 're-seq', + 'read', 'read-line', 'reduce', 'ref', 'ref-set', 'refer', 'rem', + 'remove', 'remove-method', 'remove-ns', 'rename', 'rename-keys', + 'repeat', 'replace', 'replicate', 'resolve', 'rest', 'resultset-seq', + 'reverse', 'rfirst', 'right', 'rights', 'root', 'rrest', 'rseq', + 'second', 'select', 'select-keys', 'send', 'send-off', 'seq', + 'seq-zip', 'seq?', 'set', 'short', 'slurp', 'some', 'sort', + 'sort-by', 'sorted-map', 'sorted-map-by', 'sorted-set', + 'special-symbol?', 'split-at', 'split-with', 'str', 'string?', + 'struct', 'struct-map', 'subs', 'subvec', 'symbol', 'symbol?', + 'sync', 'take', 'take-nth', 'take-while', 'test', 'time', 'to-array', + 'to-array-2d', 'tree-seq', 'true?', 'union', 'up', 'update-proxy', + 'val', 'vals', 'var-get', 'var-set', 'var?', 'vector', 'vector-zip', + 'vector?', 'when', 'when-first', 'when-let', 'when-not', + 'with-local-vars', 'with-meta', 'with-open', 'with-out-str', + 'xml-seq', 'xml-zip', 'zero?', 'zipmap', 'zipper') + + # valid names for identifiers + # well, names can only not consist fully of numbers + # but this should be good enough for now + + # TODO / should divide keywords/symbols into namespace/rest + # but that's hard, so just pretend / is part of the name + valid_name = r'(?!#)[\w!$%*+<=>?/.#|-]+' + + tokens = { + 'root': [ + # the comments - always starting with semicolon + # and going to the end of the line + (r';.*$', Comment.Single), + + # whitespaces - usually not relevant + (r',+', Text), + (r'\s+', Whitespace), + + # numbers + (r'-?\d+\.\d+', Number.Float), + (r'-?\d+/\d+', Number), + (r'-?\d+', Number.Integer), + (r'0x-?[abcdef\d]+', Number.Hex), + + # strings, symbols and characters + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + (r"'" + valid_name, String.Symbol), + (r"\\(.|[a-z]+)", String.Char), + + # keywords + (r'::?#?' + valid_name, String.Symbol), + + # special operators + (r'~@|[`\'#^~&@]', Operator), + + # highlight the special forms + (words(special_forms, suffix=' '), Keyword), + + # Technically, only the special forms are 'keywords'. The problem + # is that only treating them as keywords means that things like + # 'defn' and 'ns' need to be highlighted as builtins. This is ugly + # and weird for most styles. So, as a compromise we're going to + # highlight them as Keyword.Declarations. + (words(declarations, suffix=' '), Keyword.Declaration), + + # highlight the builtins + (words(builtins, suffix=' '), Name.Builtin), + + # the remaining functions + (r'(?<=\()' + valid_name, Name.Function), + + # find the remaining variables + (valid_name, Name.Variable), + + # Clojure accepts vector notation + (r'(\[|\])', Punctuation), + + # Clojure accepts map notation + (r'(\{|\})', Punctuation), + + # the famous parentheses! + (r'(\(|\))', Punctuation), + ], + } + + +class ClojureScriptLexer(ClojureLexer): + """ + Lexer for ClojureScript source code. + + .. versionadded:: 2.0 + """ + name = 'ClojureScript' + url = 'http://clojure.org/clojurescript' + aliases = ['clojurescript', 'cljs'] + filenames = ['*.cljs'] + mimetypes = ['text/x-clojurescript', 'application/x-clojurescript'] + + +class TeaLangLexer(RegexLexer): + """ + For Tea source code. Only used within a + TeaTemplateLexer. + + .. versionadded:: 1.5 + """ + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w\.\[\]]*\s+)+?)' # return arguments + r'([a-zA-Z_]\w*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Whitespace, Operator)), + (r'[^\S\n]+', Whitespace), + (r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)), + (r'/\*.*?\*/', Comment.Multiline), + (r'@[a-zA-Z_][\w\.]*', Name.Decorator), + (r'(and|break|else|foreach|if|in|not|or|reverse)\b', + Keyword), + (r'(as|call|define)\b', Keyword.Declaration), + (r'(true|false|null)\b', Keyword.Constant), + (r'(template)(\s+)', bygroups(Keyword.Declaration, Whitespace), 'template'), + (r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), + (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), + (r'(\.)([a-zA-Z_]\w*)', bygroups(Operator, Name.Attribute)), + (r'[a-zA-Z_]\w*:', Name.Label), + (r'[a-zA-Z_\$]\w*', Name), + (r'(isa|[.]{3}|[.]{2}|[=#!<>+-/%&;,.\*\\\(\)\[\]\{\}])', Operator), + (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Whitespace) + ], + 'template': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop') + ], + 'import': [ + (r'[\w.]+\*?', Name.Namespace, '#pop') + ], + } + + +class CeylonLexer(RegexLexer): + """ + For Ceylon source code. + + .. versionadded:: 1.6 + """ + + name = 'Ceylon' + url = 'http://ceylon-lang.org/' + aliases = ['ceylon'] + filenames = ['*.ceylon'] + mimetypes = ['text/x-ceylon'] + + flags = re.MULTILINE | re.DOTALL + + #: optional Comment or Whitespace + _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+' + + tokens = { + 'root': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments + r'([a-zA-Z_]\w*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Whitespace, Operator)), + (r'[^\S\n]+', Whitespace), + (r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)), + (r'/\*', Comment.Multiline, 'comment'), + (r'(shared|abstract|formal|default|actual|variable|deprecated|small|' + r'late|literal|doc|by|see|throws|optional|license|tagged|final|native|' + r'annotation|sealed)\b', Name.Decorator), + (r'(break|case|catch|continue|else|finally|for|in|' + r'if|return|switch|this|throw|try|while|is|exists|dynamic|' + r'nonempty|then|outer|assert|let)\b', Keyword), + (r'(abstracts|extends|satisfies|' + r'super|given|of|out|assign)\b', Keyword.Declaration), + (r'(function|value|void|new)\b', + Keyword.Type), + (r'(assembly|module|package)(\s+)', bygroups(Keyword.Namespace, Whitespace)), + (r'(true|false|null)\b', Keyword.Constant), + (r'(class|interface|object|alias)(\s+)', + bygroups(Keyword.Declaration, Whitespace), 'class'), + (r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String), + (r"'\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'", String.Char), + (r'(\.)([a-z_]\w*)', + bygroups(Operator, Name.Attribute)), + (r'[a-zA-Z_]\w*:', Name.Label), + (r'[a-zA-Z_]\w*', Name), + (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator), + (r'\d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float), + (r'\d{1,3}(_\d{3})+\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?', + Number.Float), + (r'[0-9][0-9]*\.\d{1,3}(_\d{3})+[kMGTPmunpf]?', Number.Float), + (r'[0-9][0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?', + Number.Float), + (r'#([0-9a-fA-F]{4})(_[0-9a-fA-F]{4})+', Number.Hex), + (r'#[0-9a-fA-F]+', Number.Hex), + (r'\$([01]{4})(_[01]{4})+', Number.Bin), + (r'\$[01]+', Number.Bin), + (r'\d{1,3}(_\d{3})+[kMGTP]?', Number.Integer), + (r'[0-9]+[kMGTP]?', Number.Integer), + (r'\n', Whitespace) + ], + 'class': [ + (r'[A-Za-z_]\w*', Name.Class, '#pop') + ], + 'import': [ + (r'[a-z][\w.]*', + Name.Namespace, '#pop') + ], + 'comment': [ + (r'[^*/]', Comment.Multiline), + (r'/\*', Comment.Multiline, '#push'), + (r'\*/', Comment.Multiline, '#pop'), + (r'[*/]', Comment.Multiline) + ], + } + + +class KotlinLexer(RegexLexer): + """ + For Kotlin source code. + + .. versionadded:: 1.5 + """ + + name = 'Kotlin' + url = 'http://kotlinlang.org/' + aliases = ['kotlin'] + filenames = ['*.kt', '*.kts'] + mimetypes = ['text/x-kotlin'] + + flags = re.MULTILINE | re.DOTALL + + kt_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + + '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', + 'Mn', 'Mc') + ']*') + + kt_space_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + + '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', + 'Mn', 'Mc', 'Zs') + + r'\'~!%^&*()+=|\[\]:;,.<>/\?-]*') + + kt_id = '(' + kt_name + '|`' + kt_space_name + '`)' + + modifiers = (r'actual|abstract|annotation|companion|const|crossinline|' + r'data|enum|expect|external|final|infix|inline|inner|' + r'internal|lateinit|noinline|open|operator|override|private|' + r'protected|public|sealed|suspend|tailrec|value') + + tokens = { + 'root': [ + # Whitespaces + (r'[^\S\n]+', Whitespace), + (r'\s+', Whitespace), + (r'\\$', String.Escape), # line continuation + (r'\n', Whitespace), + # Comments + (r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)), + (r'^(#!/.+?)(\n)', bygroups(Comment.Single, Whitespace)), # shebang for kotlin scripts + (r'/[*].*?[*]/', Comment.Multiline), + # Keywords + (r'as\?', Keyword), + (r'(as|break|by|catch|constructor|continue|do|dynamic|else|finally|' + r'get|for|if|init|[!]*in|[!]*is|out|reified|return|set|super|this|' + r'throw|try|typealias|typeof|vararg|when|where|while)\b', Keyword), + (r'it\b', Name.Builtin), + # Built-in types + (words(('Boolean?', 'Byte?', 'Char?', 'Double?', 'Float?', + 'Int?', 'Long?', 'Short?', 'String?', 'Any?', 'Unit?')), Keyword.Type), + (words(('Boolean', 'Byte', 'Char', 'Double', 'Float', + 'Int', 'Long', 'Short', 'String', 'Any', 'Unit'), suffix=r'\b'), Keyword.Type), + # Constants + (r'(true|false|null)\b', Keyword.Constant), + # Imports + (r'(package|import)(\s+)(\S+)', bygroups(Keyword, Whitespace, Name.Namespace)), + # Dot access + (r'(\?\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Operator, Name.Attribute)), + (r'(\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Punctuation, Name.Attribute)), + # Annotations + (r'@[^\W\d][\w.]*', Name.Decorator), + # Labels + (r'[^\W\d][\w.]+@', Name.Decorator), + # Object expression + (r'(object)(\s+)(:)(\s+)', bygroups(Keyword, Whitespace, Punctuation, Whitespace), 'class'), + # Types + (r'((?:(?:' + modifiers + r'|fun)\s+)*)(class|interface|object)(\s+)', + bygroups(using(this, state='modifiers'), Keyword.Declaration, Whitespace), 'class'), + # Variables + (r'(var|val)(\s+)(\()', bygroups(Keyword.Declaration, Whitespace, Punctuation), + 'destructuring_assignment'), + (r'((?:(?:' + modifiers + r')\s+)*)(var|val)(\s+)', + bygroups(using(this, state='modifiers'), Keyword.Declaration, Whitespace), 'variable'), + # Functions + (r'((?:(?:' + modifiers + r')\s+)*)(fun)(\s+)', + bygroups(using(this, state='modifiers'), Keyword.Declaration, Whitespace), 'function'), + # Operators + (r'::|!!|\?[:.]', Operator), + (r'[~^*!%&\[\]<>|+=/?-]', Operator), + # Punctuation + (r'[{}();:.,]', Punctuation), + # Strings + (r'"""', String, 'multiline_string'), + (r'"', String, 'string'), + (r"'\\.'|'[^\\]'", String.Char), + # Numbers + (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFL]?|" + r"0[xX][0-9a-fA-F]+[Ll]?", Number), + # Identifiers + (r'' + kt_id + r'((\?[^.])?)', Name) # additionally handle nullable types + ], + 'class': [ + (kt_id, Name.Class, '#pop') + ], + 'variable': [ + (kt_id, Name.Variable, '#pop') + ], + 'destructuring_assignment': [ + (r',', Punctuation), + (r'\s+', Whitespace), + (kt_id, Name.Variable), + (r'(:)(\s+)(' + kt_id + ')', bygroups(Punctuation, Whitespace, Name)), + (r'<', Operator, 'generic'), + (r'\)', Punctuation, '#pop') + ], + 'function': [ + (r'<', Operator, 'generic'), + (r'' + kt_id + r'(\.)' + kt_id, bygroups(Name, Punctuation, Name.Function), '#pop'), + (kt_id, Name.Function, '#pop') + ], + 'generic': [ + (r'(>)(\s*)', bygroups(Operator, Whitespace), '#pop'), + (r':', Punctuation), + (r'(reified|out|in)\b', Keyword), + (r',', Punctuation), + (r'\s+', Whitespace), + (kt_id, Name) + ], + 'modifiers': [ + (r'\w+', Keyword.Declaration), + (r'\s+', Whitespace), + default('#pop') + ], + 'string': [ + (r'"', String, '#pop'), + include('string_common') + ], + 'multiline_string': [ + (r'"""', String, '#pop'), + (r'"', String), + include('string_common') + ], + 'string_common': [ + (r'\\\\', String), # escaped backslash + (r'\\"', String), # escaped quote + (r'\\', String), # bare backslash + (r'\$\{', String.Interpol, 'interpolation'), + (r'(\$)(\w+)', bygroups(String.Interpol, Name)), + (r'[^\\"$]+', String) + ], + 'interpolation': [ + (r'"', String), + (r'\$\{', String.Interpol, 'interpolation'), + (r'\{', Punctuation, 'scope'), + (r'\}', String.Interpol, '#pop'), + include('root') + ], + 'scope': [ + (r'\{', Punctuation, 'scope'), + (r'\}', Punctuation, '#pop'), + include('root') + ] + } + + +class XtendLexer(RegexLexer): + """ + For Xtend source code. + + .. versionadded:: 1.6 + """ + + name = 'Xtend' + url = 'https://www.eclipse.org/xtend/' + aliases = ['xtend'] + filenames = ['*.xtend'] + mimetypes = ['text/x-xtend'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments + r'([a-zA-Z_$][\w$]*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Whitespace, Operator)), + (r'[^\S\n]+', Whitespace), + (r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)), + (r'/\*.*?\*/', Comment.Multiline), + (r'@[a-zA-Z_][\w.]*', Name.Decorator), + (r'(assert|break|case|catch|continue|default|do|else|finally|for|' + r'if|goto|instanceof|new|return|switch|this|throw|try|while|IF|' + r'ELSE|ELSEIF|ENDIF|FOR|ENDFOR|SEPARATOR|BEFORE|AFTER)\b', + Keyword), + (r'(def|abstract|const|enum|extends|final|implements|native|private|' + r'protected|public|static|strictfp|super|synchronized|throws|' + r'transient|volatile)\b', Keyword.Declaration), + (r'(boolean|byte|char|double|float|int|long|short|void)\b', + Keyword.Type), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace)), + (r'(true|false|null)\b', Keyword.Constant), + (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Whitespace), + 'class'), + (r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'), + (r"(''')", String, 'template'), + (r'(\u00BB)', String, 'template'), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), + (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), + (r'[a-zA-Z_]\w*:', Name.Label), + (r'[a-zA-Z_$]\w*', Name), + (r'[~^*!%&\[\](){}<>\|+=:;,./?-]', Operator), + (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Whitespace) + ], + 'class': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop') + ], + 'import': [ + (r'[\w.]+\*?', Name.Namespace, '#pop') + ], + 'template': [ + (r"'''", String, '#pop'), + (r'\u00AB', String, '#pop'), + (r'.', String) + ], + } + + +class PigLexer(RegexLexer): + """ + For Pig Latin source code. + + .. versionadded:: 2.0 + """ + + name = 'Pig' + url = 'https://pig.apache.org/' + aliases = ['pig'] + filenames = ['*.pig'] + mimetypes = ['text/x-pig'] + + flags = re.MULTILINE | re.IGNORECASE + + tokens = { + 'root': [ + (r'\s+', Whitespace), + (r'--.*', Comment), + (r'/\*[\w\W]*?\*/', Comment.Multiline), + (r'\\$', String.Escape), + (r'\\', Text), + (r'\'(?:\\[ntbrf\\\']|\\u[0-9a-f]{4}|[^\'\\\n\r])*\'', String), + include('keywords'), + include('types'), + include('builtins'), + include('punct'), + include('operators'), + (r'[0-9]*\.[0-9]+(e[0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-f]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Whitespace), + (r'([a-z_]\w*)(\s*)(\()', + bygroups(Name.Function, Whitespace, Punctuation)), + (r'[()#:]', Text), + (r'[^(:#\'")\s]+', Text), + (r'\S+\s+', Text) # TODO: make tests pass without \s+ + ], + 'keywords': [ + (r'(assert|and|any|all|arrange|as|asc|bag|by|cache|CASE|cat|cd|cp|' + r'%declare|%default|define|dense|desc|describe|distinct|du|dump|' + r'eval|exex|explain|filter|flatten|foreach|full|generate|group|' + r'help|if|illustrate|import|inner|input|into|is|join|kill|left|' + r'limit|load|ls|map|matches|mkdir|mv|not|null|onschema|or|order|' + r'outer|output|parallel|pig|pwd|quit|register|returns|right|rm|' + r'rmf|rollup|run|sample|set|ship|split|stderr|stdin|stdout|store|' + r'stream|through|union|using|void)\b', Keyword) + ], + 'builtins': [ + (r'(AVG|BinStorage|cogroup|CONCAT|copyFromLocal|copyToLocal|COUNT|' + r'cross|DIFF|MAX|MIN|PigDump|PigStorage|SIZE|SUM|TextLoader|' + r'TOKENIZE)\b', Name.Builtin) + ], + 'types': [ + (r'(bytearray|BIGINTEGER|BIGDECIMAL|chararray|datetime|double|float|' + r'int|long|tuple)\b', Keyword.Type) + ], + 'punct': [ + (r'[;(){}\[\]]', Punctuation), + ], + 'operators': [ + (r'[#=,./%+\-?]', Operator), + (r'(eq|gt|lt|gte|lte|neq|matches)\b', Operator), + (r'(==|<=|<|>=|>|!=)', Operator), + ], + } + + +class GoloLexer(RegexLexer): + """ + For Golo source code. + + .. versionadded:: 2.0 + """ + + name = 'Golo' + url = 'http://golo-lang.org/' + filenames = ['*.golo'] + aliases = ['golo'] + + tokens = { + 'root': [ + (r'[^\S\n]+', Whitespace), + + (r'#.*$', Comment), + + (r'(\^|\.\.\.|:|\?:|->|==|!=|=|\+|\*|%|/|<=|<|>=|>|=|\.)', + Operator), + (r'(?<=[^-])(-)(?=[^-])', Operator), + + (r'(?<=[^`])(is|isnt|and|or|not|oftype|in|orIfNull)\b', Operator.Word), + (r'[]{}|(),[]', Punctuation), + + (r'(module|import)(\s+)', + bygroups(Keyword.Namespace, Whitespace), + 'modname'), + (r'\b([a-zA-Z_][\w$.]*)(::)', bygroups(Name.Namespace, Punctuation)), + (r'\b([a-zA-Z_][\w$]*(?:\.[a-zA-Z_][\w$]*)+)\b', Name.Namespace), + + (r'(let|var)(\s+)', + bygroups(Keyword.Declaration, Whitespace), + 'varname'), + (r'(struct)(\s+)', + bygroups(Keyword.Declaration, Whitespace), + 'structname'), + (r'(function)(\s+)', + bygroups(Keyword.Declaration, Whitespace), + 'funcname'), + + (r'(null|true|false)\b', Keyword.Constant), + (r'(augment|pimp' + r'|if|else|case|match|return' + r'|case|when|then|otherwise' + r'|while|for|foreach' + r'|try|catch|finally|throw' + r'|local' + r'|continue|break)\b', Keyword), + + (r'(map|array|list|set|vector|tuple)(\[)', + bygroups(Name.Builtin, Punctuation)), + (r'(print|println|readln|raise|fun' + r'|asInterfaceInstance)\b', Name.Builtin), + (r'(`?[a-zA-Z_][\w$]*)(\()', + bygroups(Name.Function, Punctuation)), + + (r'-?[\d_]*\.[\d_]*([eE][+-]?\d[\d_]*)?F?', Number.Float), + (r'0[0-7]+j?', Number.Oct), + (r'0[xX][a-fA-F0-9]+', Number.Hex), + (r'-?\d[\d_]*L', Number.Integer.Long), + (r'-?\d[\d_]*', Number.Integer), + + (r'`?[a-zA-Z_][\w$]*', Name), + (r'@[a-zA-Z_][\w$.]*', Name.Decorator), + + (r'"""', String, combined('stringescape', 'triplestring')), + (r'"', String, combined('stringescape', 'doublestring')), + (r"'", String, combined('stringescape', 'singlestring')), + (r'----((.|\n)*?)----', String.Doc) + + ], + + 'funcname': [ + (r'`?[a-zA-Z_][\w$]*', Name.Function, '#pop'), + ], + 'modname': [ + (r'[a-zA-Z_][\w$.]*\*?', Name.Namespace, '#pop') + ], + 'structname': [ + (r'`?[\w.]+\*?', Name.Class, '#pop') + ], + 'varname': [ + (r'`?[a-zA-Z_][\w$]*', Name.Variable, '#pop'), + ], + 'string': [ + (r'[^\\\'"\n]+', String), + (r'[\'"\\]', String) + ], + 'stringescape': [ + (r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|' + r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape) + ], + 'triplestring': [ + (r'"""', String, '#pop'), + include('string'), + (r'\n', String), + ], + 'doublestring': [ + (r'"', String.Double, '#pop'), + include('string'), + ], + 'singlestring': [ + (r"'", String, '#pop'), + include('string'), + ], + 'operators': [ + (r'[#=,./%+\-?]', Operator), + (r'(eq|gt|lt|gte|lte|neq|matches)\b', Operator), + (r'(==|<=|<|>=|>|!=)', Operator), + ], + } + + +class JasminLexer(RegexLexer): + """ + For Jasmin assembly code. + + .. versionadded:: 2.0 + """ + + name = 'Jasmin' + url = 'http://jasmin.sourceforge.net/' + aliases = ['jasmin', 'jasminxt'] + filenames = ['*.j'] + + _whitespace = r' \n\t\r' + _ws = r'(?:[%s]+)' % _whitespace + _separator = r'%s:=' % _whitespace + _break = r'(?=[%s]|$)' % _separator + _name = r'[^%s]+' % _separator + _unqualified_name = r'(?:[^%s.;\[/]+)' % _separator + + tokens = { + 'default': [ + (r'\n', Whitespace, '#pop'), + (r"'", String.Single, ('#pop', 'quote')), + (r'"', String.Double, 'string'), + (r'=', Punctuation), + (r':', Punctuation, 'label'), + (_ws, Whitespace), + (r';.*', Comment.Single), + (r'(\$[-+])?0x-?[\da-fA-F]+%s' % _break, Number.Hex), + (r'(\$[-+]|\+)?-?\d+%s' % _break, Number.Integer), + (r'-?(\d+\.\d*|\.\d+)([eE][-+]?\d+)?[fFdD]?' + r'[\x00-\x08\x0b\x0c\x0e-\x1f]*%s' % _break, Number.Float), + (r'\$%s' % _name, Name.Variable), + + # Directives + (r'\.annotation%s' % _break, Keyword.Reserved, 'annotation'), + (r'(\.attribute|\.bytecode|\.debug|\.deprecated|\.enclosing|' + r'\.interface|\.line|\.signature|\.source|\.stack|\.var|abstract|' + r'annotation|bridge|class|default|enum|field|final|fpstrict|' + r'interface|native|private|protected|public|signature|static|' + r'synchronized|synthetic|transient|varargs|volatile)%s' % _break, + Keyword.Reserved), + (r'\.catch%s' % _break, Keyword.Reserved, 'caught-exception'), + (r'(\.class|\.implements|\.inner|\.super|inner|invisible|' + r'invisibleparam|outer|visible|visibleparam)%s' % _break, + Keyword.Reserved, 'class/convert-dots'), + (r'\.field%s' % _break, Keyword.Reserved, + ('descriptor/convert-dots', 'field')), + (r'(\.end|\.limit|use)%s' % _break, Keyword.Reserved, + 'no-verification'), + (r'\.method%s' % _break, Keyword.Reserved, 'method'), + (r'\.set%s' % _break, Keyword.Reserved, 'var'), + (r'\.throws%s' % _break, Keyword.Reserved, 'exception'), + (r'(from|offset|to|using)%s' % _break, Keyword.Reserved, 'label'), + (r'is%s' % _break, Keyword.Reserved, + ('descriptor/convert-dots', 'var')), + (r'(locals|stack)%s' % _break, Keyword.Reserved, 'verification'), + (r'method%s' % _break, Keyword.Reserved, 'enclosing-method'), + + # Instructions + (words(( + 'aaload', 'aastore', 'aconst_null', 'aload', 'aload_0', 'aload_1', 'aload_2', + 'aload_3', 'aload_w', 'areturn', 'arraylength', 'astore', 'astore_0', 'astore_1', + 'astore_2', 'astore_3', 'astore_w', 'athrow', 'baload', 'bastore', 'bipush', + 'breakpoint', 'caload', 'castore', 'd2f', 'd2i', 'd2l', 'dadd', 'daload', 'dastore', + 'dcmpg', 'dcmpl', 'dconst_0', 'dconst_1', 'ddiv', 'dload', 'dload_0', 'dload_1', + 'dload_2', 'dload_3', 'dload_w', 'dmul', 'dneg', 'drem', 'dreturn', 'dstore', 'dstore_0', + 'dstore_1', 'dstore_2', 'dstore_3', 'dstore_w', 'dsub', 'dup', 'dup2', 'dup2_x1', + 'dup2_x2', 'dup_x1', 'dup_x2', 'f2d', 'f2i', 'f2l', 'fadd', 'faload', 'fastore', 'fcmpg', + 'fcmpl', 'fconst_0', 'fconst_1', 'fconst_2', 'fdiv', 'fload', 'fload_0', 'fload_1', + 'fload_2', 'fload_3', 'fload_w', 'fmul', 'fneg', 'frem', 'freturn', 'fstore', 'fstore_0', + 'fstore_1', 'fstore_2', 'fstore_3', 'fstore_w', 'fsub', 'i2b', 'i2c', 'i2d', 'i2f', 'i2l', + 'i2s', 'iadd', 'iaload', 'iand', 'iastore', 'iconst_0', 'iconst_1', 'iconst_2', + 'iconst_3', 'iconst_4', 'iconst_5', 'iconst_m1', 'idiv', 'iinc', 'iinc_w', 'iload', + 'iload_0', 'iload_1', 'iload_2', 'iload_3', 'iload_w', 'imul', 'ineg', 'int2byte', + 'int2char', 'int2short', 'ior', 'irem', 'ireturn', 'ishl', 'ishr', 'istore', 'istore_0', + 'istore_1', 'istore_2', 'istore_3', 'istore_w', 'isub', 'iushr', 'ixor', 'l2d', 'l2f', + 'l2i', 'ladd', 'laload', 'land', 'lastore', 'lcmp', 'lconst_0', 'lconst_1', 'ldc2_w', + 'ldiv', 'lload', 'lload_0', 'lload_1', 'lload_2', 'lload_3', 'lload_w', 'lmul', 'lneg', + 'lookupswitch', 'lor', 'lrem', 'lreturn', 'lshl', 'lshr', 'lstore', 'lstore_0', + 'lstore_1', 'lstore_2', 'lstore_3', 'lstore_w', 'lsub', 'lushr', 'lxor', + 'monitorenter', 'monitorexit', 'nop', 'pop', 'pop2', 'ret', 'ret_w', 'return', 'saload', + 'sastore', 'sipush', 'swap'), suffix=_break), Keyword.Reserved), + (r'(anewarray|checkcast|instanceof|ldc|ldc_w|new)%s' % _break, + Keyword.Reserved, 'class/no-dots'), + (r'invoke(dynamic|interface|nonvirtual|special|' + r'static|virtual)%s' % _break, Keyword.Reserved, + 'invocation'), + (r'(getfield|putfield)%s' % _break, Keyword.Reserved, + ('descriptor/no-dots', 'field')), + (r'(getstatic|putstatic)%s' % _break, Keyword.Reserved, + ('descriptor/no-dots', 'static')), + (words(( + 'goto', 'goto_w', 'if_acmpeq', 'if_acmpne', 'if_icmpeq', + 'if_icmpge', 'if_icmpgt', 'if_icmple', 'if_icmplt', 'if_icmpne', + 'ifeq', 'ifge', 'ifgt', 'ifle', 'iflt', 'ifne', 'ifnonnull', + 'ifnull', 'jsr', 'jsr_w'), suffix=_break), + Keyword.Reserved, 'label'), + (r'(multianewarray|newarray)%s' % _break, Keyword.Reserved, + 'descriptor/convert-dots'), + (r'tableswitch%s' % _break, Keyword.Reserved, 'table') + ], + 'quote': [ + (r"'", String.Single, '#pop'), + (r'\\u[\da-fA-F]{4}', String.Escape), + (r"[^'\\]+", String.Single) + ], + 'string': [ + (r'"', String.Double, '#pop'), + (r'\\([nrtfb"\'\\]|u[\da-fA-F]{4}|[0-3]?[0-7]{1,2})', + String.Escape), + (r'[^"\\]+', String.Double) + ], + 'root': [ + (r'\n+', Whitespace), + (r"'", String.Single, 'quote'), + include('default'), + (r'(%s)([ \t\r]*)(:)' % _name, + bygroups(Name.Label, Whitespace, Punctuation)), + (_name, String.Other) + ], + 'annotation': [ + (r'\n', Whitespace, ('#pop', 'annotation-body')), + (r'default%s' % _break, Keyword.Reserved, + ('#pop', 'annotation-default')), + include('default') + ], + 'annotation-body': [ + (r'\n+', Whitespace), + (r'\.end%s' % _break, Keyword.Reserved, '#pop'), + include('default'), + (_name, String.Other, ('annotation-items', 'descriptor/no-dots')) + ], + 'annotation-default': [ + (r'\n+', Whitespace), + (r'\.end%s' % _break, Keyword.Reserved, '#pop'), + include('default'), + default(('annotation-items', 'descriptor/no-dots')) + ], + 'annotation-items': [ + (r"'", String.Single, 'quote'), + include('default'), + (_name, String.Other) + ], + 'caught-exception': [ + (r'all%s' % _break, Keyword, '#pop'), + include('exception') + ], + 'class/convert-dots': [ + include('default'), + (r'(L)((?:%s[/.])*)(%s)(;)' % (_unqualified_name, _name), + bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), + '#pop'), + (r'((?:%s[/.])*)(%s)' % (_unqualified_name, _name), + bygroups(Name.Namespace, Name.Class), '#pop') + ], + 'class/no-dots': [ + include('default'), + (r'\[+', Punctuation, ('#pop', 'descriptor/no-dots')), + (r'(L)((?:%s/)*)(%s)(;)' % (_unqualified_name, _name), + bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), + '#pop'), + (r'((?:%s/)*)(%s)' % (_unqualified_name, _name), + bygroups(Name.Namespace, Name.Class), '#pop') + ], + 'descriptor/convert-dots': [ + include('default'), + (r'\[+', Punctuation), + (r'(L)((?:%s[/.])*)(%s?)(;)' % (_unqualified_name, _name), + bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), + '#pop'), + (r'[^%s\[)L]+' % _separator, Keyword.Type, '#pop'), + default('#pop') + ], + 'descriptor/no-dots': [ + include('default'), + (r'\[+', Punctuation), + (r'(L)((?:%s/)*)(%s)(;)' % (_unqualified_name, _name), + bygroups(Keyword.Type, Name.Namespace, Name.Class, Punctuation), + '#pop'), + (r'[^%s\[)L]+' % _separator, Keyword.Type, '#pop'), + default('#pop') + ], + 'descriptors/convert-dots': [ + (r'\)', Punctuation, '#pop'), + default('descriptor/convert-dots') + ], + 'enclosing-method': [ + (_ws, Whitespace), + (r'(?=[^%s]*\()' % _separator, Text, ('#pop', 'invocation')), + default(('#pop', 'class/convert-dots')) + ], + 'exception': [ + include('default'), + (r'((?:%s[/.])*)(%s)' % (_unqualified_name, _name), + bygroups(Name.Namespace, Name.Exception), '#pop') + ], + 'field': [ + (r'static%s' % _break, Keyword.Reserved, ('#pop', 'static')), + include('default'), + (r'((?:%s[/.](?=[^%s]*[/.]))*)(%s[/.])?(%s)' % + (_unqualified_name, _separator, _unqualified_name, _name), + bygroups(Name.Namespace, Name.Class, Name.Variable.Instance), + '#pop') + ], + 'invocation': [ + include('default'), + (r'((?:%s[/.](?=[^%s(]*[/.]))*)(%s[/.])?(%s)(\()' % + (_unqualified_name, _separator, _unqualified_name, _name), + bygroups(Name.Namespace, Name.Class, Name.Function, Punctuation), + ('#pop', 'descriptor/convert-dots', 'descriptors/convert-dots', + 'descriptor/convert-dots')) + ], + 'label': [ + include('default'), + (_name, Name.Label, '#pop') + ], + 'method': [ + include('default'), + (r'(%s)(\()' % _name, bygroups(Name.Function, Punctuation), + ('#pop', 'descriptor/convert-dots', 'descriptors/convert-dots', + 'descriptor/convert-dots')) + ], + 'no-verification': [ + (r'(locals|method|stack)%s' % _break, Keyword.Reserved, '#pop'), + include('default') + ], + 'static': [ + include('default'), + (r'((?:%s[/.](?=[^%s]*[/.]))*)(%s[/.])?(%s)' % + (_unqualified_name, _separator, _unqualified_name, _name), + bygroups(Name.Namespace, Name.Class, Name.Variable.Class), '#pop') + ], + 'table': [ + (r'\n+', Whitespace), + (r'default%s' % _break, Keyword.Reserved, '#pop'), + include('default'), + (_name, Name.Label) + ], + 'var': [ + include('default'), + (_name, Name.Variable, '#pop') + ], + 'verification': [ + include('default'), + (r'(Double|Float|Integer|Long|Null|Top|UninitializedThis)%s' % + _break, Keyword, '#pop'), + (r'Object%s' % _break, Keyword, ('#pop', 'class/no-dots')), + (r'Uninitialized%s' % _break, Keyword, ('#pop', 'label')) + ] + } + + def analyse_text(text): + score = 0 + if re.search(r'^\s*\.class\s', text, re.MULTILINE): + score += 0.5 + if re.search(r'^\s*[a-z]+_[a-z]+\b', text, re.MULTILINE): + score += 0.3 + if re.search(r'^\s*\.(attribute|bytecode|debug|deprecated|enclosing|' + r'inner|interface|limit|set|signature|stack)\b', text, + re.MULTILINE): + score += 0.6 + return min(score, 1.0) + + +class SarlLexer(RegexLexer): + """ + For SARL source code. + + .. versionadded:: 2.4 + """ + + name = 'SARL' + url = 'http://www.sarl.io' + aliases = ['sarl'] + filenames = ['*.sarl'] + mimetypes = ['text/x-sarl'] + + flags = re.MULTILINE | re.DOTALL + + tokens = { + 'root': [ + # method names + (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments + r'([a-zA-Z_$][\w$]*)' # method name + r'(\s*)(\()', # signature start + bygroups(using(this), Name.Function, Whitespace, Operator)), + (r'[^\S\n]+', Whitespace), + (r'(//.*?)(\n)', bygroups(Comment.Single, Whitespace)), + (r'/\*.*?\*/', Comment.Multiline), + (r'@[a-zA-Z_][\w.]*', Name.Decorator), + (r'(as|break|case|catch|default|do|else|extends|extension|finally|' + r'fires|for|if|implements|instanceof|new|on|requires|return|super|' + r'switch|throw|throws|try|typeof|uses|while|with)\b', + Keyword), + (r'(abstract|def|dispatch|final|native|override|private|protected|' + r'public|static|strictfp|synchronized|transient|val|var|volatile)\b', + Keyword.Declaration), + (r'(boolean|byte|char|double|float|int|long|short|void)\b', + Keyword.Type), + (r'(package)(\s+)', bygroups(Keyword.Namespace, Whitespace)), + (r'(false|it|null|occurrence|this|true|void)\b', Keyword.Constant), + (r'(agent|annotation|artifact|behavior|capacity|class|enum|event|' + r'interface|skill|space)(\s+)', bygroups(Keyword.Declaration, Whitespace), + 'class'), + (r'(import)(\s+)', bygroups(Keyword.Namespace, Whitespace), 'import'), + (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), + (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), + (r'[a-zA-Z_]\w*:', Name.Label), + (r'[a-zA-Z_$]\w*', Name), + (r'[~^*!%&\[\](){}<>\|+=:;,./?-]', Operator), + (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), + (r'0x[0-9a-fA-F]+', Number.Hex), + (r'[0-9]+L?', Number.Integer), + (r'\n', Whitespace) + ], + 'class': [ + (r'[a-zA-Z_]\w*', Name.Class, '#pop') + ], + 'import': [ + (r'[\w.]+\*?', Name.Namespace, '#pop') + ], + } diff --git a/shared/package-files/9f/9f24f334e5a0a152c73c36a7cdb8e7c77c1c8a47e6195a59ac7428ed04ea006a/blob b/shared/package-files/9f/9f24f334e5a0a152c73c36a7cdb8e7c77c1c8a47e6195a59ac7428ed04ea006a/blob new file mode 100644 index 0000000000000000000000000000000000000000..393908e0a1d71d98a2b83bf3d4b644576caf1c44 --- /dev/null +++ b/shared/package-files/9f/9f24f334e5a0a152c73c36a7cdb8e7c77c1c8a47e6195a59ac7428ed04ea006a/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f24f334e5a0a152c73c36a7cdb8e7c77c1c8a47e6195a59ac7428ed04ea006a +size 134846 diff --git a/shared/package-files/9f/9f266e123271743b903d855de51e760ccf8d206743f67912b2826ffd7664f84f/blob b/shared/package-files/9f/9f266e123271743b903d855de51e760ccf8d206743f67912b2826ffd7664f84f/blob new file mode 100644 index 0000000000000000000000000000000000000000..5c7b57c7b5fa27ffe85b4d535afee4a337b693f7 --- /dev/null +++ b/shared/package-files/9f/9f266e123271743b903d855de51e760ccf8d206743f67912b2826ffd7664f84f/blob @@ -0,0 +1,42 @@ +# Copyright (C) 2014 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from collections import defaultdict + +from .config import Config +from .metadata import MetaData + + +def create_metapackage( + name, + version, + entry_points=(), + build_string=None, + build_number=0, + dependencies=(), + home=None, + license_name=None, + summary=None, + config=None, +): + # local import to avoid circular import, we provide create_metapackage in api + from .api import build + + if not config: + config = Config() + + d = defaultdict(dict) + d["package"]["name"] = name + d["package"]["version"] = version + d["build"]["number"] = build_number + d["build"]["entry_points"] = entry_points + # MetaData does the auto stuff if the build string is None + d["build"]["string"] = build_string + d["requirements"]["run"] = dependencies + d["about"]["home"] = home + d["about"]["license"] = license_name + d["about"]["summary"] = summary + d = dict(d) + m = MetaData.fromdict(d, config=config) + config.compute_build_id(m.name(), m.version()) + + return build(m, config=config, need_source_download=False) diff --git a/shared/package-files/9f/9f2a5b2880cb0230fc48d494584daf9adee34a9ce4248cf8b0ca314dbe464cb8/blob b/shared/package-files/9f/9f2a5b2880cb0230fc48d494584daf9adee34a9ce4248cf8b0ca314dbe464cb8/blob new file mode 100644 index 0000000000000000000000000000000000000000..4ac04f77cbdda13969362afd956448b7b634a043 Binary files /dev/null and b/shared/package-files/9f/9f2a5b2880cb0230fc48d494584daf9adee34a9ce4248cf8b0ca314dbe464cb8/blob differ diff --git a/shared/package-files/9f/9f2bffa3b4d8783b2cfb2ced9cc4319acf06988f61829a1e5291d55b19854e88/blob b/shared/package-files/9f/9f2bffa3b4d8783b2cfb2ced9cc4319acf06988f61829a1e5291d55b19854e88/blob new file mode 100644 index 0000000000000000000000000000000000000000..96fdb35a682eae0a5344a20f31a5d3ed6e1f9207 --- /dev/null +++ b/shared/package-files/9f/9f2bffa3b4d8783b2cfb2ced9cc4319acf06988f61829a1e5291d55b19854e88/blob @@ -0,0 +1,50 @@ +# created by tools/loadICU.tcl -- do not edit +namespace eval ::tcl::clock { + ::msgcat::mcset pt DAYS_OF_WEEK_ABBREV [list \ + "Dom"\ + "Seg"\ + "Ter"\ + "Qua"\ + "Qui"\ + "Sex"\ + "S\u00e1b"] + ::msgcat::mcset pt DAYS_OF_WEEK_FULL [list \ + "Domingo"\ + "Segunda-feira"\ + "Ter\u00e7a-feira"\ + "Quarta-feira"\ + "Quinta-feira"\ + "Sexta-feira"\ + "S\u00e1bado"] + ::msgcat::mcset pt MONTHS_ABBREV [list \ + "Jan"\ + "Fev"\ + "Mar"\ + "Abr"\ + "Mai"\ + "Jun"\ + "Jul"\ + "Ago"\ + "Set"\ + "Out"\ + "Nov"\ + "Dez"\ + ""] + ::msgcat::mcset pt MONTHS_FULL [list \ + "Janeiro"\ + "Fevereiro"\ + "Mar\u00e7o"\ + "Abril"\ + "Maio"\ + "Junho"\ + "Julho"\ + "Agosto"\ + "Setembro"\ + "Outubro"\ + "Novembro"\ + "Dezembro"\ + ""] + ::msgcat::mcset pt DATE_FORMAT "%d-%m-%Y" + ::msgcat::mcset pt TIME_FORMAT "%k:%M:%S" + ::msgcat::mcset pt DATE_TIME_FORMAT "%d-%m-%Y %k:%M:%S %z" +} diff --git a/shared/package-files/9f/9f2ce737cdb56a3a427defb3fa07845aa40335a5a71ec9e7ff7b5f0d3f350e3f/blob b/shared/package-files/9f/9f2ce737cdb56a3a427defb3fa07845aa40335a5a71ec9e7ff7b5f0d3f350e3f/blob new file mode 100644 index 0000000000000000000000000000000000000000..c0499ce750cf01e7c50a2a117652bae273c5251d --- /dev/null +++ b/shared/package-files/9f/9f2ce737cdb56a3a427defb3fa07845aa40335a5a71ec9e7ff7b5f0d3f350e3f/blob @@ -0,0 +1,1494 @@ +from __future__ import annotations + +from abc import ( + ABC, + abstractmethod, +) +from collections import abc +from io import StringIO +from itertools import islice +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Generic, + Literal, + TypeVar, + final, + overload, +) +import warnings + +import numpy as np + +from pandas._libs import lib +from pandas._libs.json import ( + ujson_dumps, + ujson_loads, +) +from pandas._libs.tslibs import iNaT +from pandas.compat._optional import import_optional_dependency +from pandas.errors import AbstractMethodError +from pandas.util._decorators import doc +from pandas.util._exceptions import find_stack_level +from pandas.util._validators import check_dtype_backend + +from pandas.core.dtypes.common import ( + ensure_str, + is_string_dtype, +) +from pandas.core.dtypes.dtypes import PeriodDtype + +from pandas import ( + DataFrame, + Index, + MultiIndex, + Series, + isna, + notna, + to_datetime, +) +from pandas.core.reshape.concat import concat +from pandas.core.shared_docs import _shared_docs + +from pandas.io._util import arrow_table_to_pandas +from pandas.io.common import ( + IOHandles, + dedup_names, + extension_to_compression, + file_exists, + get_handle, + is_fsspec_url, + is_potential_multi_index, + is_url, + stringify_path, +) +from pandas.io.json._normalize import convert_to_line_delimits +from pandas.io.json._table_schema import ( + build_table_schema, + parse_table_schema, +) +from pandas.io.parsers.readers import validate_integer + +if TYPE_CHECKING: + from collections.abc import ( + Hashable, + Mapping, + ) + from types import TracebackType + + from pandas._typing import ( + CompressionOptions, + DtypeArg, + DtypeBackend, + FilePath, + IndexLabel, + JSONEngine, + JSONSerializable, + ReadBuffer, + Self, + StorageOptions, + WriteBuffer, + ) + + from pandas.core.generic import NDFrame + +FrameSeriesStrT = TypeVar("FrameSeriesStrT", bound=Literal["frame", "series"]) + + +# interface to/from +@overload +def to_json( + path_or_buf: FilePath | WriteBuffer[str] | WriteBuffer[bytes], + obj: NDFrame, + orient: str | None = ..., + date_format: str = ..., + double_precision: int = ..., + force_ascii: bool = ..., + date_unit: str = ..., + default_handler: Callable[[Any], JSONSerializable] | None = ..., + lines: bool = ..., + compression: CompressionOptions = ..., + index: bool | None = ..., + indent: int = ..., + storage_options: StorageOptions = ..., + mode: Literal["a", "w"] = ..., +) -> None: + ... + + +@overload +def to_json( + path_or_buf: None, + obj: NDFrame, + orient: str | None = ..., + date_format: str = ..., + double_precision: int = ..., + force_ascii: bool = ..., + date_unit: str = ..., + default_handler: Callable[[Any], JSONSerializable] | None = ..., + lines: bool = ..., + compression: CompressionOptions = ..., + index: bool | None = ..., + indent: int = ..., + storage_options: StorageOptions = ..., + mode: Literal["a", "w"] = ..., +) -> str: + ... + + +def to_json( + path_or_buf: FilePath | WriteBuffer[str] | WriteBuffer[bytes] | None, + obj: NDFrame, + orient: str | None = None, + date_format: str = "epoch", + double_precision: int = 10, + force_ascii: bool = True, + date_unit: str = "ms", + default_handler: Callable[[Any], JSONSerializable] | None = None, + lines: bool = False, + compression: CompressionOptions = "infer", + index: bool | None = None, + indent: int = 0, + storage_options: StorageOptions | None = None, + mode: Literal["a", "w"] = "w", +) -> str | None: + if orient in ["records", "values"] and index is True: + raise ValueError( + "'index=True' is only valid when 'orient' is 'split', 'table', " + "'index', or 'columns'." + ) + elif orient in ["index", "columns"] and index is False: + raise ValueError( + "'index=False' is only valid when 'orient' is 'split', 'table', " + "'records', or 'values'." + ) + elif index is None: + # will be ignored for orient='records' and 'values' + index = True + + if lines and orient != "records": + raise ValueError("'lines' keyword only valid when 'orient' is records") + + if mode not in ["a", "w"]: + msg = ( + f"mode={mode} is not a valid option." + "Only 'w' and 'a' are currently supported." + ) + raise ValueError(msg) + + if mode == "a" and (not lines or orient != "records"): + msg = ( + "mode='a' (append) is only supported when " + "lines is True and orient is 'records'" + ) + raise ValueError(msg) + + if orient == "table" and isinstance(obj, Series): + obj = obj.to_frame(name=obj.name or "values") + + writer: type[Writer] + if orient == "table" and isinstance(obj, DataFrame): + writer = JSONTableWriter + elif isinstance(obj, Series): + writer = SeriesWriter + elif isinstance(obj, DataFrame): + writer = FrameWriter + else: + raise NotImplementedError("'obj' should be a Series or a DataFrame") + + s = writer( + obj, + orient=orient, + date_format=date_format, + double_precision=double_precision, + ensure_ascii=force_ascii, + date_unit=date_unit, + default_handler=default_handler, + index=index, + indent=indent, + ).write() + + if lines: + s = convert_to_line_delimits(s) + + if path_or_buf is not None: + # apply compression and byte/text conversion + with get_handle( + path_or_buf, mode, compression=compression, storage_options=storage_options + ) as handles: + handles.handle.write(s) + else: + return s + return None + + +class Writer(ABC): + _default_orient: str + + def __init__( + self, + obj: NDFrame, + orient: str | None, + date_format: str, + double_precision: int, + ensure_ascii: bool, + date_unit: str, + index: bool, + default_handler: Callable[[Any], JSONSerializable] | None = None, + indent: int = 0, + ) -> None: + self.obj = obj + + if orient is None: + orient = self._default_orient + + self.orient = orient + self.date_format = date_format + self.double_precision = double_precision + self.ensure_ascii = ensure_ascii + self.date_unit = date_unit + self.default_handler = default_handler + self.index = index + self.indent = indent + + self.is_copy = None + self._format_axes() + + def _format_axes(self) -> None: + raise AbstractMethodError(self) + + def write(self) -> str: + iso_dates = self.date_format == "iso" + return ujson_dumps( + self.obj_to_write, + orient=self.orient, + double_precision=self.double_precision, + ensure_ascii=self.ensure_ascii, + date_unit=self.date_unit, + iso_dates=iso_dates, + default_handler=self.default_handler, + indent=self.indent, + ) + + @property + @abstractmethod + def obj_to_write(self) -> NDFrame | Mapping[IndexLabel, Any]: + """Object to write in JSON format.""" + + +class SeriesWriter(Writer): + _default_orient = "index" + + @property + def obj_to_write(self) -> NDFrame | Mapping[IndexLabel, Any]: + if not self.index and self.orient == "split": + return {"name": self.obj.name, "data": self.obj.values} + else: + return self.obj + + def _format_axes(self) -> None: + if not self.obj.index.is_unique and self.orient == "index": + raise ValueError(f"Series index must be unique for orient='{self.orient}'") + + +class FrameWriter(Writer): + _default_orient = "columns" + + @property + def obj_to_write(self) -> NDFrame | Mapping[IndexLabel, Any]: + if not self.index and self.orient == "split": + obj_to_write = self.obj.to_dict(orient="split") + del obj_to_write["index"] + else: + obj_to_write = self.obj + return obj_to_write + + def _format_axes(self) -> None: + """ + Try to format axes if they are datelike. + """ + if not self.obj.index.is_unique and self.orient in ("index", "columns"): + raise ValueError( + f"DataFrame index must be unique for orient='{self.orient}'." + ) + if not self.obj.columns.is_unique and self.orient in ( + "index", + "columns", + "records", + ): + raise ValueError( + f"DataFrame columns must be unique for orient='{self.orient}'." + ) + + +class JSONTableWriter(FrameWriter): + _default_orient = "records" + + def __init__( + self, + obj, + orient: str | None, + date_format: str, + double_precision: int, + ensure_ascii: bool, + date_unit: str, + index: bool, + default_handler: Callable[[Any], JSONSerializable] | None = None, + indent: int = 0, + ) -> None: + """ + Adds a `schema` attribute with the Table Schema, resets + the index (can't do in caller, because the schema inference needs + to know what the index is, forces orient to records, and forces + date_format to 'iso'. + """ + super().__init__( + obj, + orient, + date_format, + double_precision, + ensure_ascii, + date_unit, + index, + default_handler=default_handler, + indent=indent, + ) + + if date_format != "iso": + msg = ( + "Trying to write with `orient='table'` and " + f"`date_format='{date_format}'`. Table Schema requires dates " + "to be formatted with `date_format='iso'`" + ) + raise ValueError(msg) + + self.schema = build_table_schema(obj, index=self.index) + + # NotImplemented on a column MultiIndex + if obj.ndim == 2 and isinstance(obj.columns, MultiIndex): + raise NotImplementedError( + "orient='table' is not supported for MultiIndex columns" + ) + + # TODO: Do this timedelta properly in objToJSON.c See GH #15137 + if ( + (obj.ndim == 1) + and (obj.name in set(obj.index.names)) + or len(obj.columns.intersection(obj.index.names)) + ): + msg = "Overlapping names between the index and columns" + raise ValueError(msg) + + obj = obj.copy() + timedeltas = obj.select_dtypes(include=["timedelta"]).columns + if len(timedeltas): + obj[timedeltas] = obj[timedeltas].map(lambda x: x.isoformat()) + # Convert PeriodIndex to datetimes before serializing + if isinstance(obj.index.dtype, PeriodDtype): + obj.index = obj.index.to_timestamp() + + # exclude index from obj if index=False + if not self.index: + self.obj = obj.reset_index(drop=True) + else: + self.obj = obj.reset_index(drop=False) + self.date_format = "iso" + self.orient = "records" + self.index = index + + @property + def obj_to_write(self) -> NDFrame | Mapping[IndexLabel, Any]: + return {"schema": self.schema, "data": self.obj} + + +@overload +def read_json( + path_or_buf: FilePath | ReadBuffer[str] | ReadBuffer[bytes], + *, + orient: str | None = ..., + typ: Literal["frame"] = ..., + dtype: DtypeArg | None = ..., + convert_axes: bool | None = ..., + convert_dates: bool | list[str] = ..., + keep_default_dates: bool = ..., + precise_float: bool = ..., + date_unit: str | None = ..., + encoding: str | None = ..., + encoding_errors: str | None = ..., + lines: bool = ..., + chunksize: int, + compression: CompressionOptions = ..., + nrows: int | None = ..., + storage_options: StorageOptions = ..., + dtype_backend: DtypeBackend | lib.NoDefault = ..., + engine: JSONEngine = ..., +) -> JsonReader[Literal["frame"]]: + ... + + +@overload +def read_json( + path_or_buf: FilePath | ReadBuffer[str] | ReadBuffer[bytes], + *, + orient: str | None = ..., + typ: Literal["series"], + dtype: DtypeArg | None = ..., + convert_axes: bool | None = ..., + convert_dates: bool | list[str] = ..., + keep_default_dates: bool = ..., + precise_float: bool = ..., + date_unit: str | None = ..., + encoding: str | None = ..., + encoding_errors: str | None = ..., + lines: bool = ..., + chunksize: int, + compression: CompressionOptions = ..., + nrows: int | None = ..., + storage_options: StorageOptions = ..., + dtype_backend: DtypeBackend | lib.NoDefault = ..., + engine: JSONEngine = ..., +) -> JsonReader[Literal["series"]]: + ... + + +@overload +def read_json( + path_or_buf: FilePath | ReadBuffer[str] | ReadBuffer[bytes], + *, + orient: str | None = ..., + typ: Literal["series"], + dtype: DtypeArg | None = ..., + convert_axes: bool | None = ..., + convert_dates: bool | list[str] = ..., + keep_default_dates: bool = ..., + precise_float: bool = ..., + date_unit: str | None = ..., + encoding: str | None = ..., + encoding_errors: str | None = ..., + lines: bool = ..., + chunksize: None = ..., + compression: CompressionOptions = ..., + nrows: int | None = ..., + storage_options: StorageOptions = ..., + dtype_backend: DtypeBackend | lib.NoDefault = ..., + engine: JSONEngine = ..., +) -> Series: + ... + + +@overload +def read_json( + path_or_buf: FilePath | ReadBuffer[str] | ReadBuffer[bytes], + *, + orient: str | None = ..., + typ: Literal["frame"] = ..., + dtype: DtypeArg | None = ..., + convert_axes: bool | None = ..., + convert_dates: bool | list[str] = ..., + keep_default_dates: bool = ..., + precise_float: bool = ..., + date_unit: str | None = ..., + encoding: str | None = ..., + encoding_errors: str | None = ..., + lines: bool = ..., + chunksize: None = ..., + compression: CompressionOptions = ..., + nrows: int | None = ..., + storage_options: StorageOptions = ..., + dtype_backend: DtypeBackend | lib.NoDefault = ..., + engine: JSONEngine = ..., +) -> DataFrame: + ... + + +@doc( + storage_options=_shared_docs["storage_options"], + decompression_options=_shared_docs["decompression_options"] % "path_or_buf", +) +def read_json( + path_or_buf: FilePath | ReadBuffer[str] | ReadBuffer[bytes], + *, + orient: str | None = None, + typ: Literal["frame", "series"] = "frame", + dtype: DtypeArg | None = None, + convert_axes: bool | None = None, + convert_dates: bool | list[str] = True, + keep_default_dates: bool = True, + precise_float: bool = False, + date_unit: str | None = None, + encoding: str | None = None, + encoding_errors: str | None = "strict", + lines: bool = False, + chunksize: int | None = None, + compression: CompressionOptions = "infer", + nrows: int | None = None, + storage_options: StorageOptions | None = None, + dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default, + engine: JSONEngine = "ujson", +) -> DataFrame | Series | JsonReader: + """ + Convert a JSON string to pandas object. + + Parameters + ---------- + path_or_buf : a valid JSON str, path object or file-like object + Any valid string path is acceptable. The string could be a URL. Valid + URL schemes include http, ftp, s3, and file. For file URLs, a host is + expected. A local file could be: + ``file://localhost/path/to/table.json``. + + If you want to pass in a path object, pandas accepts any + ``os.PathLike``. + + By file-like object, we refer to objects with a ``read()`` method, + such as a file handle (e.g. via builtin ``open`` function) + or ``StringIO``. + + .. deprecated:: 2.1.0 + Passing json literal strings is deprecated. + + orient : str, optional + Indication of expected JSON string format. + Compatible JSON strings can be produced by ``to_json()`` with a + corresponding orient value. + The set of possible orients is: + + - ``'split'`` : dict like + ``{{index -> [index], columns -> [columns], data -> [values]}}`` + - ``'records'`` : list like + ``[{{column -> value}}, ... , {{column -> value}}]`` + - ``'index'`` : dict like ``{{index -> {{column -> value}}}}`` + - ``'columns'`` : dict like ``{{column -> {{index -> value}}}}`` + - ``'values'`` : just the values array + - ``'table'`` : dict like ``{{'schema': {{schema}}, 'data': {{data}}}}`` + + The allowed and default values depend on the value + of the `typ` parameter. + + * when ``typ == 'series'``, + + - allowed orients are ``{{'split','records','index'}}`` + - default is ``'index'`` + - The Series index must be unique for orient ``'index'``. + + * when ``typ == 'frame'``, + + - allowed orients are ``{{'split','records','index', + 'columns','values', 'table'}}`` + - default is ``'columns'`` + - The DataFrame index must be unique for orients ``'index'`` and + ``'columns'``. + - The DataFrame columns must be unique for orients ``'index'``, + ``'columns'``, and ``'records'``. + + typ : {{'frame', 'series'}}, default 'frame' + The type of object to recover. + + dtype : bool or dict, default None + If True, infer dtypes; if a dict of column to dtype, then use those; + if False, then don't infer dtypes at all, applies only to the data. + + For all ``orient`` values except ``'table'``, default is True. + + convert_axes : bool, default None + Try to convert the axes to the proper dtypes. + + For all ``orient`` values except ``'table'``, default is True. + + convert_dates : bool or list of str, default True + If True then default datelike columns may be converted (depending on + keep_default_dates). + If False, no dates will be converted. + If a list of column names, then those columns will be converted and + default datelike columns may also be converted (depending on + keep_default_dates). + + keep_default_dates : bool, default True + If parsing dates (convert_dates is not False), then try to parse the + default datelike columns. + A column label is datelike if + + * it ends with ``'_at'``, + + * it ends with ``'_time'``, + + * it begins with ``'timestamp'``, + + * it is ``'modified'``, or + + * it is ``'date'``. + + precise_float : bool, default False + Set to enable usage of higher precision (strtod) function when + decoding string to double values. Default (False) is to use fast but + less precise builtin functionality. + + date_unit : str, default None + The timestamp unit to detect if converting dates. The default behaviour + is to try and detect the correct precision, but if this is not desired + then pass one of 's', 'ms', 'us' or 'ns' to force parsing only seconds, + milliseconds, microseconds or nanoseconds respectively. + + encoding : str, default is 'utf-8' + The encoding to use to decode py3 bytes. + + encoding_errors : str, optional, default "strict" + How encoding errors are treated. `List of possible values + `_ . + + .. versionadded:: 1.3.0 + + lines : bool, default False + Read the file as a json object per line. + + chunksize : int, optional + Return JsonReader object for iteration. + See the `line-delimited json docs + `_ + for more information on ``chunksize``. + This can only be passed if `lines=True`. + If this is None, the file will be read into memory all at once. + {decompression_options} + + .. versionchanged:: 1.4.0 Zstandard support. + + nrows : int, optional + The number of lines from the line-delimited jsonfile that has to be read. + This can only be passed if `lines=True`. + If this is None, all the rows will be returned. + + {storage_options} + + dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' + Back-end data type applied to the resultant :class:`DataFrame` + (still experimental). Behaviour is as follows: + + * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` + (default). + * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` + DataFrame. + + .. versionadded:: 2.0 + + engine : {{"ujson", "pyarrow"}}, default "ujson" + Parser engine to use. The ``"pyarrow"`` engine is only available when + ``lines=True``. + + .. versionadded:: 2.0 + + Returns + ------- + Series, DataFrame, or pandas.api.typing.JsonReader + A JsonReader is returned when ``chunksize`` is not ``0`` or ``None``. + Otherwise, the type returned depends on the value of ``typ``. + + See Also + -------- + DataFrame.to_json : Convert a DataFrame to a JSON string. + Series.to_json : Convert a Series to a JSON string. + json_normalize : Normalize semi-structured JSON data into a flat table. + + Notes + ----- + Specific to ``orient='table'``, if a :class:`DataFrame` with a literal + :class:`Index` name of `index` gets written with :func:`to_json`, the + subsequent read operation will incorrectly set the :class:`Index` name to + ``None``. This is because `index` is also used by :func:`DataFrame.to_json` + to denote a missing :class:`Index` name, and the subsequent + :func:`read_json` operation cannot distinguish between the two. The same + limitation is encountered with a :class:`MultiIndex` and any names + beginning with ``'level_'``. + + Examples + -------- + >>> from io import StringIO + >>> df = pd.DataFrame([['a', 'b'], ['c', 'd']], + ... index=['row 1', 'row 2'], + ... columns=['col 1', 'col 2']) + + Encoding/decoding a Dataframe using ``'split'`` formatted JSON: + + >>> df.to_json(orient='split') + '\ +{{\ +"columns":["col 1","col 2"],\ +"index":["row 1","row 2"],\ +"data":[["a","b"],["c","d"]]\ +}}\ +' + >>> pd.read_json(StringIO(_), orient='split') + col 1 col 2 + row 1 a b + row 2 c d + + Encoding/decoding a Dataframe using ``'index'`` formatted JSON: + + >>> df.to_json(orient='index') + '{{"row 1":{{"col 1":"a","col 2":"b"}},"row 2":{{"col 1":"c","col 2":"d"}}}}' + + >>> pd.read_json(StringIO(_), orient='index') + col 1 col 2 + row 1 a b + row 2 c d + + Encoding/decoding a Dataframe using ``'records'`` formatted JSON. + Note that index labels are not preserved with this encoding. + + >>> df.to_json(orient='records') + '[{{"col 1":"a","col 2":"b"}},{{"col 1":"c","col 2":"d"}}]' + >>> pd.read_json(StringIO(_), orient='records') + col 1 col 2 + 0 a b + 1 c d + + Encoding with Table Schema + + >>> df.to_json(orient='table') + '\ +{{"schema":{{"fields":[\ +{{"name":"index","type":"string"}},\ +{{"name":"col 1","type":"string"}},\ +{{"name":"col 2","type":"string"}}],\ +"primaryKey":["index"],\ +"pandas_version":"1.4.0"}},\ +"data":[\ +{{"index":"row 1","col 1":"a","col 2":"b"}},\ +{{"index":"row 2","col 1":"c","col 2":"d"}}]\ +}}\ +' + + The following example uses ``dtype_backend="numpy_nullable"`` + + >>> data = '''{{"index": {{"0": 0, "1": 1}}, + ... "a": {{"0": 1, "1": null}}, + ... "b": {{"0": 2.5, "1": 4.5}}, + ... "c": {{"0": true, "1": false}}, + ... "d": {{"0": "a", "1": "b"}}, + ... "e": {{"0": 1577.2, "1": 1577.1}}}}''' + >>> pd.read_json(StringIO(data), dtype_backend="numpy_nullable") + index a b c d e + 0 0 1 2.5 True a 1577.2 + 1 1 4.5 False b 1577.1 + """ + if orient == "table" and dtype: + raise ValueError("cannot pass both dtype and orient='table'") + if orient == "table" and convert_axes: + raise ValueError("cannot pass both convert_axes and orient='table'") + + check_dtype_backend(dtype_backend) + + if dtype is None and orient != "table": + # error: Incompatible types in assignment (expression has type "bool", variable + # has type "Union[ExtensionDtype, str, dtype[Any], Type[str], Type[float], + # Type[int], Type[complex], Type[bool], Type[object], Dict[Hashable, + # Union[ExtensionDtype, Union[str, dtype[Any]], Type[str], Type[float], + # Type[int], Type[complex], Type[bool], Type[object]]], None]") + dtype = True # type: ignore[assignment] + if convert_axes is None and orient != "table": + convert_axes = True + + json_reader = JsonReader( + path_or_buf, + orient=orient, + typ=typ, + dtype=dtype, + convert_axes=convert_axes, + convert_dates=convert_dates, + keep_default_dates=keep_default_dates, + precise_float=precise_float, + date_unit=date_unit, + encoding=encoding, + lines=lines, + chunksize=chunksize, + compression=compression, + nrows=nrows, + storage_options=storage_options, + encoding_errors=encoding_errors, + dtype_backend=dtype_backend, + engine=engine, + ) + + if chunksize: + return json_reader + else: + return json_reader.read() + + +class JsonReader(abc.Iterator, Generic[FrameSeriesStrT]): + """ + JsonReader provides an interface for reading in a JSON file. + + If initialized with ``lines=True`` and ``chunksize``, can be iterated over + ``chunksize`` lines at a time. Otherwise, calling ``read`` reads in the + whole document. + """ + + def __init__( + self, + filepath_or_buffer, + orient, + typ: FrameSeriesStrT, + dtype, + convert_axes: bool | None, + convert_dates, + keep_default_dates: bool, + precise_float: bool, + date_unit, + encoding, + lines: bool, + chunksize: int | None, + compression: CompressionOptions, + nrows: int | None, + storage_options: StorageOptions | None = None, + encoding_errors: str | None = "strict", + dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default, + engine: JSONEngine = "ujson", + ) -> None: + self.orient = orient + self.typ = typ + self.dtype = dtype + self.convert_axes = convert_axes + self.convert_dates = convert_dates + self.keep_default_dates = keep_default_dates + self.precise_float = precise_float + self.date_unit = date_unit + self.encoding = encoding + self.engine = engine + self.compression = compression + self.storage_options = storage_options + self.lines = lines + self.chunksize = chunksize + self.nrows_seen = 0 + self.nrows = nrows + self.encoding_errors = encoding_errors + self.handles: IOHandles[str] | None = None + self.dtype_backend = dtype_backend + + if self.engine not in {"pyarrow", "ujson"}: + raise ValueError( + f"The engine type {self.engine} is currently not supported." + ) + if self.chunksize is not None: + self.chunksize = validate_integer("chunksize", self.chunksize, 1) + if not self.lines: + raise ValueError("chunksize can only be passed if lines=True") + if self.engine == "pyarrow": + raise ValueError( + "currently pyarrow engine doesn't support chunksize parameter" + ) + if self.nrows is not None: + self.nrows = validate_integer("nrows", self.nrows, 0) + if not self.lines: + raise ValueError("nrows can only be passed if lines=True") + if ( + isinstance(filepath_or_buffer, str) + and not self.lines + and "\n" in filepath_or_buffer + ): + warnings.warn( + "Passing literal json to 'read_json' is deprecated and " + "will be removed in a future version. To read from a " + "literal string, wrap it in a 'StringIO' object.", + FutureWarning, + stacklevel=find_stack_level(), + ) + if self.engine == "pyarrow": + if not self.lines: + raise ValueError( + "currently pyarrow engine only supports " + "the line-delimited JSON format" + ) + self.data = filepath_or_buffer + elif self.engine == "ujson": + data = self._get_data_from_filepath(filepath_or_buffer) + self.data = self._preprocess_data(data) + + def _preprocess_data(self, data): + """ + At this point, the data either has a `read` attribute (e.g. a file + object or a StringIO) or is a string that is a JSON document. + + If self.chunksize, we prepare the data for the `__next__` method. + Otherwise, we read it into memory for the `read` method. + """ + if hasattr(data, "read") and not (self.chunksize or self.nrows): + with self: + data = data.read() + if not hasattr(data, "read") and (self.chunksize or self.nrows): + data = StringIO(data) + + return data + + def _get_data_from_filepath(self, filepath_or_buffer): + """ + The function read_json accepts three input types: + 1. filepath (string-like) + 2. file-like object (e.g. open file object, StringIO) + 3. JSON string + + This method turns (1) into (2) to simplify the rest of the processing. + It returns input types (2) and (3) unchanged. + + It raises FileNotFoundError if the input is a string ending in + one of .json, .json.gz, .json.bz2, etc. but no such file exists. + """ + # if it is a string but the file does not exist, it might be a JSON string + filepath_or_buffer = stringify_path(filepath_or_buffer) + if ( + not isinstance(filepath_or_buffer, str) + or is_url(filepath_or_buffer) + or is_fsspec_url(filepath_or_buffer) + or file_exists(filepath_or_buffer) + ): + self.handles = get_handle( + filepath_or_buffer, + "r", + encoding=self.encoding, + compression=self.compression, + storage_options=self.storage_options, + errors=self.encoding_errors, + ) + filepath_or_buffer = self.handles.handle + elif ( + isinstance(filepath_or_buffer, str) + and filepath_or_buffer.lower().endswith( + (".json",) + tuple(f".json{c}" for c in extension_to_compression) + ) + and not file_exists(filepath_or_buffer) + ): + raise FileNotFoundError(f"File {filepath_or_buffer} does not exist") + else: + warnings.warn( + "Passing literal json to 'read_json' is deprecated and " + "will be removed in a future version. To read from a " + "literal string, wrap it in a 'StringIO' object.", + FutureWarning, + stacklevel=find_stack_level(), + ) + return filepath_or_buffer + + def _combine_lines(self, lines) -> str: + """ + Combines a list of JSON objects into one JSON object. + """ + return ( + f'[{",".join([line for line in (line.strip() for line in lines) if line])}]' + ) + + @overload + def read(self: JsonReader[Literal["frame"]]) -> DataFrame: + ... + + @overload + def read(self: JsonReader[Literal["series"]]) -> Series: + ... + + @overload + def read(self: JsonReader[Literal["frame", "series"]]) -> DataFrame | Series: + ... + + def read(self) -> DataFrame | Series: + """ + Read the whole JSON input into a pandas object. + """ + obj: DataFrame | Series + with self: + if self.engine == "pyarrow": + pyarrow_json = import_optional_dependency("pyarrow.json") + pa_table = pyarrow_json.read_json(self.data) + return arrow_table_to_pandas(pa_table, dtype_backend=self.dtype_backend) + elif self.engine == "ujson": + if self.lines: + if self.chunksize: + obj = concat(self) + elif self.nrows: + lines = list(islice(self.data, self.nrows)) + lines_json = self._combine_lines(lines) + obj = self._get_object_parser(lines_json) + else: + data = ensure_str(self.data) + data_lines = data.split("\n") + obj = self._get_object_parser(self._combine_lines(data_lines)) + else: + obj = self._get_object_parser(self.data) + if self.dtype_backend is not lib.no_default: + return obj.convert_dtypes( + infer_objects=False, dtype_backend=self.dtype_backend + ) + else: + return obj + + def _get_object_parser(self, json) -> DataFrame | Series: + """ + Parses a json document into a pandas object. + """ + typ = self.typ + dtype = self.dtype + kwargs = { + "orient": self.orient, + "dtype": self.dtype, + "convert_axes": self.convert_axes, + "convert_dates": self.convert_dates, + "keep_default_dates": self.keep_default_dates, + "precise_float": self.precise_float, + "date_unit": self.date_unit, + "dtype_backend": self.dtype_backend, + } + obj = None + if typ == "frame": + obj = FrameParser(json, **kwargs).parse() + + if typ == "series" or obj is None: + if not isinstance(dtype, bool): + kwargs["dtype"] = dtype + obj = SeriesParser(json, **kwargs).parse() + + return obj + + def close(self) -> None: + """ + If we opened a stream earlier, in _get_data_from_filepath, we should + close it. + + If an open stream or file was passed, we leave it open. + """ + if self.handles is not None: + self.handles.close() + + def __iter__(self) -> Self: + return self + + @overload + def __next__(self: JsonReader[Literal["frame"]]) -> DataFrame: + ... + + @overload + def __next__(self: JsonReader[Literal["series"]]) -> Series: + ... + + @overload + def __next__(self: JsonReader[Literal["frame", "series"]]) -> DataFrame | Series: + ... + + def __next__(self) -> DataFrame | Series: + if self.nrows and self.nrows_seen >= self.nrows: + self.close() + raise StopIteration + + lines = list(islice(self.data, self.chunksize)) + if not lines: + self.close() + raise StopIteration + + try: + lines_json = self._combine_lines(lines) + obj = self._get_object_parser(lines_json) + + # Make sure that the returned objects have the right index. + obj.index = range(self.nrows_seen, self.nrows_seen + len(obj)) + self.nrows_seen += len(obj) + except Exception as ex: + self.close() + raise ex + + if self.dtype_backend is not lib.no_default: + return obj.convert_dtypes( + infer_objects=False, dtype_backend=self.dtype_backend + ) + else: + return obj + + def __enter__(self) -> Self: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + self.close() + + +class Parser: + _split_keys: tuple[str, ...] + _default_orient: str + + _STAMP_UNITS = ("s", "ms", "us", "ns") + _MIN_STAMPS = { + "s": 31536000, + "ms": 31536000000, + "us": 31536000000000, + "ns": 31536000000000000, + } + json: str + + def __init__( + self, + json: str, + orient, + dtype: DtypeArg | None = None, + convert_axes: bool = True, + convert_dates: bool | list[str] = True, + keep_default_dates: bool = False, + precise_float: bool = False, + date_unit=None, + dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default, + ) -> None: + self.json = json + + if orient is None: + orient = self._default_orient + + self.orient = orient + + self.dtype = dtype + + if date_unit is not None: + date_unit = date_unit.lower() + if date_unit not in self._STAMP_UNITS: + raise ValueError(f"date_unit must be one of {self._STAMP_UNITS}") + self.min_stamp = self._MIN_STAMPS[date_unit] + else: + self.min_stamp = self._MIN_STAMPS["s"] + + self.precise_float = precise_float + self.convert_axes = convert_axes + self.convert_dates = convert_dates + self.date_unit = date_unit + self.keep_default_dates = keep_default_dates + self.obj: DataFrame | Series | None = None + self.dtype_backend = dtype_backend + + @final + def check_keys_split(self, decoded: dict) -> None: + """ + Checks that dict has only the appropriate keys for orient='split'. + """ + bad_keys = set(decoded.keys()).difference(set(self._split_keys)) + if bad_keys: + bad_keys_joined = ", ".join(bad_keys) + raise ValueError(f"JSON data had unexpected key(s): {bad_keys_joined}") + + @final + def parse(self): + self._parse() + + if self.obj is None: + return None + if self.convert_axes: + self._convert_axes() + self._try_convert_types() + return self.obj + + def _parse(self) -> None: + raise AbstractMethodError(self) + + @final + def _convert_axes(self) -> None: + """ + Try to convert axes. + """ + obj = self.obj + assert obj is not None # for mypy + for axis_name in obj._AXIS_ORDERS: + ax = obj._get_axis(axis_name) + ser = Series(ax, dtype=ax.dtype, copy=False) + new_ser, result = self._try_convert_data( + name=axis_name, + data=ser, + use_dtypes=False, + convert_dates=True, + is_axis=True, + ) + if result: + new_axis = Index(new_ser, dtype=new_ser.dtype, copy=False) + setattr(self.obj, axis_name, new_axis) + + def _try_convert_types(self) -> None: + raise AbstractMethodError(self) + + @final + def _try_convert_data( + self, + name: Hashable, + data: Series, + use_dtypes: bool = True, + convert_dates: bool | list[str] = True, + is_axis: bool = False, + ) -> tuple[Series, bool]: + """ + Try to parse a Series into a column by inferring dtype. + """ + # don't try to coerce, unless a force conversion + if use_dtypes: + if not self.dtype: + if all(notna(data)): + return data, False + + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + "Downcasting object dtype arrays", + category=FutureWarning, + ) + filled = data.fillna(np.nan) + + return filled, True + + elif self.dtype is True: + pass + else: + # dtype to force + dtype = ( + self.dtype.get(name) if isinstance(self.dtype, dict) else self.dtype + ) + if dtype is not None: + try: + return data.astype(dtype), True + except (TypeError, ValueError): + return data, False + + if convert_dates: + new_data, result = self._try_convert_to_date(data) + if result: + return new_data, True + + converted = False + if self.dtype_backend is not lib.no_default and not is_axis: + # Fall through for conversion later on + return data, True + elif is_string_dtype(data.dtype): + # try float + try: + data = data.astype("float64") + converted = True + except (TypeError, ValueError): + pass + + if data.dtype.kind == "f" and data.dtype != "float64": + # coerce floats to 64 + try: + data = data.astype("float64") + converted = True + except (TypeError, ValueError): + pass + + # don't coerce 0-len data + if len(data) and data.dtype in ("float", "object"): + # coerce ints if we can + try: + new_data = data.astype("int64") + if (new_data == data).all(): + data = new_data + converted = True + except (TypeError, ValueError, OverflowError): + pass + + if data.dtype == "int" and data.dtype != "int64": + # coerce ints to 64 + try: + data = data.astype("int64") + converted = True + except (TypeError, ValueError): + pass + + # if we have an index, we want to preserve dtypes + if name == "index" and len(data): + if self.orient == "split": + return data, False + + return data, converted + + @final + def _try_convert_to_date(self, data: Series) -> tuple[Series, bool]: + """ + Try to parse a ndarray like into a date column. + + Try to coerce object in epoch/iso formats and integer/float in epoch + formats. Return a boolean if parsing was successful. + """ + # no conversion on empty + if not len(data): + return data, False + + new_data = data + + if new_data.dtype == "string": + new_data = new_data.astype(object) + + if new_data.dtype == "object": + try: + new_data = data.astype("int64") + except OverflowError: + return data, False + except (TypeError, ValueError): + pass + + # ignore numbers that are out of range + if issubclass(new_data.dtype.type, np.number): + in_range = ( + isna(new_data._values) + | (new_data > self.min_stamp) + | (new_data._values == iNaT) + ) + if not in_range.all(): + return data, False + + date_units = (self.date_unit,) if self.date_unit else self._STAMP_UNITS + for date_unit in date_units: + try: + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + ".*parsing datetimes with mixed time " + "zones will raise an error", + category=FutureWarning, + ) + new_data = to_datetime(new_data, errors="raise", unit=date_unit) + except (ValueError, OverflowError, TypeError): + continue + return new_data, True + return data, False + + +class SeriesParser(Parser): + _default_orient = "index" + _split_keys = ("name", "index", "data") + obj: Series | None + + def _parse(self) -> None: + data = ujson_loads(self.json, precise_float=self.precise_float) + + if self.orient == "split": + decoded = {str(k): v for k, v in data.items()} + self.check_keys_split(decoded) + self.obj = Series(**decoded) + else: + self.obj = Series(data) + + def _try_convert_types(self) -> None: + if self.obj is None: + return + obj, result = self._try_convert_data( + "data", self.obj, convert_dates=self.convert_dates + ) + if result: + self.obj = obj + + +class FrameParser(Parser): + _default_orient = "columns" + _split_keys = ("columns", "index", "data") + obj: DataFrame | None + + def _parse(self) -> None: + json = self.json + orient = self.orient + + if orient == "columns": + self.obj = DataFrame( + ujson_loads(json, precise_float=self.precise_float), dtype=None + ) + elif orient == "split": + decoded = { + str(k): v + for k, v in ujson_loads(json, precise_float=self.precise_float).items() + } + self.check_keys_split(decoded) + orig_names = [ + (tuple(col) if isinstance(col, list) else col) + for col in decoded["columns"] + ] + decoded["columns"] = dedup_names( + orig_names, + is_potential_multi_index(orig_names, None), + ) + self.obj = DataFrame(dtype=None, **decoded) + elif orient == "index": + self.obj = DataFrame.from_dict( + ujson_loads(json, precise_float=self.precise_float), + dtype=None, + orient="index", + ) + elif orient == "table": + self.obj = parse_table_schema(json, precise_float=self.precise_float) + else: + self.obj = DataFrame( + ujson_loads(json, precise_float=self.precise_float), dtype=None + ) + + def _process_converter( + self, + f: Callable[[Hashable, Series], tuple[Series, bool]], + filt: Callable[[Hashable], bool] | None = None, + ) -> None: + """ + Take a conversion function and possibly recreate the frame. + """ + if filt is None: + filt = lambda col: True + + obj = self.obj + assert obj is not None # for mypy + + needs_new_obj = False + new_obj = {} + for i, (col, c) in enumerate(obj.items()): + if filt(col): + new_data, result = f(col, c) + if result: + c = new_data + needs_new_obj = True + new_obj[i] = c + + if needs_new_obj: + # possibly handle dup columns + new_frame = DataFrame(new_obj, index=obj.index) + new_frame.columns = obj.columns + self.obj = new_frame + + def _try_convert_types(self) -> None: + if self.obj is None: + return + if self.convert_dates: + self._try_convert_dates() + + self._process_converter( + lambda col, c: self._try_convert_data(col, c, convert_dates=False) + ) + + def _try_convert_dates(self) -> None: + if self.obj is None: + return + + # our columns to parse + convert_dates_list_bool = self.convert_dates + if isinstance(convert_dates_list_bool, bool): + convert_dates_list_bool = [] + convert_dates = set(convert_dates_list_bool) + + def is_ok(col) -> bool: + """ + Return if this col is ok to try for a date parse. + """ + if col in convert_dates: + return True + if not self.keep_default_dates: + return False + if not isinstance(col, str): + return False + + col_lower = col.lower() + if ( + col_lower.endswith(("_at", "_time")) + or col_lower == "modified" + or col_lower == "date" + or col_lower == "datetime" + or col_lower.startswith("timestamp") + ): + return True + return False + + self._process_converter(lambda col, c: self._try_convert_to_date(c), filt=is_ok) diff --git a/shared/package-files/9f/9f33bd8a21a41b729b05dac5deeb0e868f218a092b0e3fe5988094cf167217f6/blob b/shared/package-files/9f/9f33bd8a21a41b729b05dac5deeb0e868f218a092b0e3fe5988094cf167217f6/blob new file mode 100644 index 0000000000000000000000000000000000000000..6bf240a8413ff3c22786eb0aa05b4bf37e15f912 Binary files /dev/null and b/shared/package-files/9f/9f33bd8a21a41b729b05dac5deeb0e868f218a092b0e3fe5988094cf167217f6/blob differ diff --git a/shared/package-files/9f/9f34a87ee6b0735f2135ef4d8f474dfe54de0f06b629b3e3b782b6aef6f7c66c/blob b/shared/package-files/9f/9f34a87ee6b0735f2135ef4d8f474dfe54de0f06b629b3e3b782b6aef6f7c66c/blob new file mode 100644 index 0000000000000000000000000000000000000000..8bfa990f080eebe4d6dd5bfdd733ce1a19adf329 --- /dev/null +++ b/shared/package-files/9f/9f34a87ee6b0735f2135ef4d8f474dfe54de0f06b629b3e3b782b6aef6f7c66c/blob @@ -0,0 +1,283 @@ +from sympy.assumptions.ask import (Q, ask) +from sympy.core.symbol import Symbol +from sympy.matrices.expressions.diagonal import (DiagMatrix, DiagonalMatrix) +from sympy.matrices.dense import Matrix +from sympy.matrices.expressions import (MatrixSymbol, Identity, ZeroMatrix, + OneMatrix, Trace, MatrixSlice, Determinant, BlockMatrix, BlockDiagMatrix) +from sympy.matrices.expressions.factorizations import LofLU +from sympy.testing.pytest import XFAIL + +X = MatrixSymbol('X', 2, 2) +Y = MatrixSymbol('Y', 2, 3) +Z = MatrixSymbol('Z', 2, 2) +A1x1 = MatrixSymbol('A1x1', 1, 1) +B1x1 = MatrixSymbol('B1x1', 1, 1) +C0x0 = MatrixSymbol('C0x0', 0, 0) +V1 = MatrixSymbol('V1', 2, 1) +V2 = MatrixSymbol('V2', 2, 1) + +def test_square(): + assert ask(Q.square(X)) + assert not ask(Q.square(Y)) + assert ask(Q.square(Y*Y.T)) + +def test_invertible(): + assert ask(Q.invertible(X), Q.invertible(X)) + assert ask(Q.invertible(Y)) is False + assert ask(Q.invertible(X*Y), Q.invertible(X)) is False + assert ask(Q.invertible(X*Z), Q.invertible(X)) is None + assert ask(Q.invertible(X*Z), Q.invertible(X) & Q.invertible(Z)) is True + assert ask(Q.invertible(X.T)) is None + assert ask(Q.invertible(X.T), Q.invertible(X)) is True + assert ask(Q.invertible(X.I)) is True + assert ask(Q.invertible(Identity(3))) is True + assert ask(Q.invertible(ZeroMatrix(3, 3))) is False + assert ask(Q.invertible(OneMatrix(1, 1))) is True + assert ask(Q.invertible(OneMatrix(3, 3))) is False + assert ask(Q.invertible(X), Q.fullrank(X) & Q.square(X)) + +def test_singular(): + assert ask(Q.singular(X)) is None + assert ask(Q.singular(X), Q.invertible(X)) is False + assert ask(Q.singular(X), ~Q.invertible(X)) is True + +@XFAIL +def test_invertible_fullrank(): + assert ask(Q.invertible(X), Q.fullrank(X)) is True + + +def test_invertible_BlockMatrix(): + assert ask(Q.invertible(BlockMatrix([Identity(3)]))) == True + assert ask(Q.invertible(BlockMatrix([ZeroMatrix(3, 3)]))) == False + + X = Matrix([[1, 2, 3], [3, 5, 4]]) + Y = Matrix([[4, 2, 7], [2, 3, 5]]) + # non-invertible A block + assert ask(Q.invertible(BlockMatrix([ + [Matrix.ones(3, 3), Y.T], + [X, Matrix.eye(2)], + ]))) == True + # non-invertible B block + assert ask(Q.invertible(BlockMatrix([ + [Y.T, Matrix.ones(3, 3)], + [Matrix.eye(2), X], + ]))) == True + # non-invertible C block + assert ask(Q.invertible(BlockMatrix([ + [X, Matrix.eye(2)], + [Matrix.ones(3, 3), Y.T], + ]))) == True + # non-invertible D block + assert ask(Q.invertible(BlockMatrix([ + [Matrix.eye(2), X], + [Y.T, Matrix.ones(3, 3)], + ]))) == True + + +def test_invertible_BlockDiagMatrix(): + assert ask(Q.invertible(BlockDiagMatrix(Identity(3), Identity(5)))) == True + assert ask(Q.invertible(BlockDiagMatrix(ZeroMatrix(3, 3), Identity(5)))) == False + assert ask(Q.invertible(BlockDiagMatrix(Identity(3), OneMatrix(5, 5)))) == False + + +def test_symmetric(): + assert ask(Q.symmetric(X), Q.symmetric(X)) + assert ask(Q.symmetric(X*Z), Q.symmetric(X)) is None + assert ask(Q.symmetric(X*Z), Q.symmetric(X) & Q.symmetric(Z)) is True + assert ask(Q.symmetric(X + Z), Q.symmetric(X) & Q.symmetric(Z)) is True + assert ask(Q.symmetric(Y)) is False + assert ask(Q.symmetric(Y*Y.T)) is True + assert ask(Q.symmetric(Y.T*X*Y)) is None + assert ask(Q.symmetric(Y.T*X*Y), Q.symmetric(X)) is True + assert ask(Q.symmetric(X**10), Q.symmetric(X)) is True + assert ask(Q.symmetric(A1x1)) is True + assert ask(Q.symmetric(A1x1 + B1x1)) is True + assert ask(Q.symmetric(A1x1 * B1x1)) is True + assert ask(Q.symmetric(V1.T*V1)) is True + assert ask(Q.symmetric(V1.T*(V1 + V2))) is True + assert ask(Q.symmetric(V1.T*(V1 + V2) + A1x1)) is True + assert ask(Q.symmetric(MatrixSlice(Y, (0, 1), (1, 2)))) is True + assert ask(Q.symmetric(Identity(3))) is True + assert ask(Q.symmetric(ZeroMatrix(3, 3))) is True + assert ask(Q.symmetric(OneMatrix(3, 3))) is True + +def _test_orthogonal_unitary(predicate): + assert ask(predicate(X), predicate(X)) + assert ask(predicate(X.T), predicate(X)) is True + assert ask(predicate(X.I), predicate(X)) is True + assert ask(predicate(X**2), predicate(X)) + assert ask(predicate(Y)) is False + assert ask(predicate(X)) is None + assert ask(predicate(X), ~Q.invertible(X)) is False + assert ask(predicate(X*Z*X), predicate(X) & predicate(Z)) is True + assert ask(predicate(Identity(3))) is True + assert ask(predicate(ZeroMatrix(3, 3))) is False + assert ask(Q.invertible(X), predicate(X)) + assert not ask(predicate(X + Z), predicate(X) & predicate(Z)) + +def test_orthogonal(): + _test_orthogonal_unitary(Q.orthogonal) + +def test_unitary(): + _test_orthogonal_unitary(Q.unitary) + assert ask(Q.unitary(X), Q.orthogonal(X)) + +def test_fullrank(): + assert ask(Q.fullrank(X), Q.fullrank(X)) + assert ask(Q.fullrank(X**2), Q.fullrank(X)) + assert ask(Q.fullrank(X.T), Q.fullrank(X)) is True + assert ask(Q.fullrank(X)) is None + assert ask(Q.fullrank(Y)) is None + assert ask(Q.fullrank(X*Z), Q.fullrank(X) & Q.fullrank(Z)) is True + assert ask(Q.fullrank(Identity(3))) is True + assert ask(Q.fullrank(ZeroMatrix(3, 3))) is False + assert ask(Q.fullrank(OneMatrix(1, 1))) is True + assert ask(Q.fullrank(OneMatrix(3, 3))) is False + assert ask(Q.invertible(X), ~Q.fullrank(X)) == False + + +def test_positive_definite(): + assert ask(Q.positive_definite(X), Q.positive_definite(X)) + assert ask(Q.positive_definite(X.T), Q.positive_definite(X)) is True + assert ask(Q.positive_definite(X.I), Q.positive_definite(X)) is True + assert ask(Q.positive_definite(Y)) is False + assert ask(Q.positive_definite(X)) is None + assert ask(Q.positive_definite(X**3), Q.positive_definite(X)) + assert ask(Q.positive_definite(X*Z*X), + Q.positive_definite(X) & Q.positive_definite(Z)) is True + assert ask(Q.positive_definite(X), Q.orthogonal(X)) + assert ask(Q.positive_definite(Y.T*X*Y), + Q.positive_definite(X) & Q.fullrank(Y)) is True + assert not ask(Q.positive_definite(Y.T*X*Y), Q.positive_definite(X)) + assert ask(Q.positive_definite(Identity(3))) is True + assert ask(Q.positive_definite(ZeroMatrix(3, 3))) is False + assert ask(Q.positive_definite(OneMatrix(1, 1))) is True + assert ask(Q.positive_definite(OneMatrix(3, 3))) is False + assert ask(Q.positive_definite(X + Z), Q.positive_definite(X) & + Q.positive_definite(Z)) is True + assert not ask(Q.positive_definite(-X), Q.positive_definite(X)) + assert ask(Q.positive(X[1, 1]), Q.positive_definite(X)) + +def test_triangular(): + assert ask(Q.upper_triangular(X + Z.T + Identity(2)), Q.upper_triangular(X) & + Q.lower_triangular(Z)) is True + assert ask(Q.upper_triangular(X*Z.T), Q.upper_triangular(X) & + Q.lower_triangular(Z)) is True + assert ask(Q.lower_triangular(Identity(3))) is True + assert ask(Q.lower_triangular(ZeroMatrix(3, 3))) is True + assert ask(Q.upper_triangular(ZeroMatrix(3, 3))) is True + assert ask(Q.lower_triangular(OneMatrix(1, 1))) is True + assert ask(Q.upper_triangular(OneMatrix(1, 1))) is True + assert ask(Q.lower_triangular(OneMatrix(3, 3))) is False + assert ask(Q.upper_triangular(OneMatrix(3, 3))) is False + assert ask(Q.triangular(X), Q.unit_triangular(X)) + assert ask(Q.upper_triangular(X**3), Q.upper_triangular(X)) + assert ask(Q.lower_triangular(X**3), Q.lower_triangular(X)) + + +def test_diagonal(): + assert ask(Q.diagonal(X + Z.T + Identity(2)), Q.diagonal(X) & + Q.diagonal(Z)) is True + assert ask(Q.diagonal(ZeroMatrix(3, 3))) + assert ask(Q.diagonal(OneMatrix(1, 1))) is True + assert ask(Q.diagonal(OneMatrix(3, 3))) is False + assert ask(Q.lower_triangular(X) & Q.upper_triangular(X), Q.diagonal(X)) + assert ask(Q.diagonal(X), Q.lower_triangular(X) & Q.upper_triangular(X)) + assert ask(Q.symmetric(X), Q.diagonal(X)) + assert ask(Q.triangular(X), Q.diagonal(X)) + assert ask(Q.diagonal(C0x0)) + assert ask(Q.diagonal(A1x1)) + assert ask(Q.diagonal(A1x1 + B1x1)) + assert ask(Q.diagonal(A1x1*B1x1)) + assert ask(Q.diagonal(V1.T*V2)) + assert ask(Q.diagonal(V1.T*(X + Z)*V1)) + assert ask(Q.diagonal(MatrixSlice(Y, (0, 1), (1, 2)))) is True + assert ask(Q.diagonal(V1.T*(V1 + V2))) is True + assert ask(Q.diagonal(X**3), Q.diagonal(X)) + assert ask(Q.diagonal(Identity(3))) + assert ask(Q.diagonal(DiagMatrix(V1))) + assert ask(Q.diagonal(DiagonalMatrix(X))) + + +def test_non_atoms(): + assert ask(Q.real(Trace(X)), Q.positive(Trace(X))) + +@XFAIL +def test_non_trivial_implies(): + X = MatrixSymbol('X', 3, 3) + Y = MatrixSymbol('Y', 3, 3) + assert ask(Q.lower_triangular(X+Y), Q.lower_triangular(X) & + Q.lower_triangular(Y)) is True + assert ask(Q.triangular(X), Q.lower_triangular(X)) is True + assert ask(Q.triangular(X+Y), Q.lower_triangular(X) & + Q.lower_triangular(Y)) is True + +def test_MatrixSlice(): + X = MatrixSymbol('X', 4, 4) + B = MatrixSlice(X, (1, 3), (1, 3)) + C = MatrixSlice(X, (0, 3), (1, 3)) + assert ask(Q.symmetric(B), Q.symmetric(X)) + assert ask(Q.invertible(B), Q.invertible(X)) + assert ask(Q.diagonal(B), Q.diagonal(X)) + assert ask(Q.orthogonal(B), Q.orthogonal(X)) + assert ask(Q.upper_triangular(B), Q.upper_triangular(X)) + + assert not ask(Q.symmetric(C), Q.symmetric(X)) + assert not ask(Q.invertible(C), Q.invertible(X)) + assert not ask(Q.diagonal(C), Q.diagonal(X)) + assert not ask(Q.orthogonal(C), Q.orthogonal(X)) + assert not ask(Q.upper_triangular(C), Q.upper_triangular(X)) + +def test_det_trace_positive(): + X = MatrixSymbol('X', 4, 4) + assert ask(Q.positive(Trace(X)), Q.positive_definite(X)) + assert ask(Q.positive(Determinant(X)), Q.positive_definite(X)) + +def test_field_assumptions(): + X = MatrixSymbol('X', 4, 4) + Y = MatrixSymbol('Y', 4, 4) + assert ask(Q.real_elements(X), Q.real_elements(X)) + assert not ask(Q.integer_elements(X), Q.real_elements(X)) + assert ask(Q.complex_elements(X), Q.real_elements(X)) + assert ask(Q.complex_elements(X**2), Q.real_elements(X)) + assert ask(Q.real_elements(X**2), Q.integer_elements(X)) + assert ask(Q.real_elements(X+Y), Q.real_elements(X)) is None + assert ask(Q.real_elements(X+Y), Q.real_elements(X) & Q.real_elements(Y)) + from sympy.matrices.expressions.hadamard import HadamardProduct + assert ask(Q.real_elements(HadamardProduct(X, Y)), + Q.real_elements(X) & Q.real_elements(Y)) + assert ask(Q.complex_elements(X+Y), Q.real_elements(X) & Q.complex_elements(Y)) + + assert ask(Q.real_elements(X.T), Q.real_elements(X)) + assert ask(Q.real_elements(X.I), Q.real_elements(X) & Q.invertible(X)) + assert ask(Q.real_elements(Trace(X)), Q.real_elements(X)) + assert ask(Q.integer_elements(Determinant(X)), Q.integer_elements(X)) + assert not ask(Q.integer_elements(X.I), Q.integer_elements(X)) + alpha = Symbol('alpha') + assert ask(Q.real_elements(alpha*X), Q.real_elements(X) & Q.real(alpha)) + assert ask(Q.real_elements(LofLU(X)), Q.real_elements(X)) + e = Symbol('e', integer=True, negative=True) + assert ask(Q.real_elements(X**e), Q.real_elements(X) & Q.invertible(X)) + assert ask(Q.real_elements(X**e), Q.real_elements(X)) is None + +def test_matrix_element_sets(): + X = MatrixSymbol('X', 4, 4) + assert ask(Q.real(X[1, 2]), Q.real_elements(X)) + assert ask(Q.integer(X[1, 2]), Q.integer_elements(X)) + assert ask(Q.complex(X[1, 2]), Q.complex_elements(X)) + assert ask(Q.integer_elements(Identity(3))) + assert ask(Q.integer_elements(ZeroMatrix(3, 3))) + assert ask(Q.integer_elements(OneMatrix(3, 3))) + from sympy.matrices.expressions.fourier import DFT + assert ask(Q.complex_elements(DFT(3))) + + +def test_matrix_element_sets_slices_blocks(): + X = MatrixSymbol('X', 4, 4) + assert ask(Q.integer_elements(X[:, 3]), Q.integer_elements(X)) + assert ask(Q.integer_elements(BlockMatrix([[X], [X]])), + Q.integer_elements(X)) + +def test_matrix_element_sets_determinant_trace(): + assert ask(Q.integer(Determinant(X)), Q.integer_elements(X)) + assert ask(Q.integer(Trace(X)), Q.integer_elements(X)) diff --git a/shared/package-files/9f/9f356a350b59d7c488dce4a3354a4b6dcd82535217b740f6fdec0c1214641eda/blob b/shared/package-files/9f/9f356a350b59d7c488dce4a3354a4b6dcd82535217b740f6fdec0c1214641eda/blob new file mode 100644 index 0000000000000000000000000000000000000000..8694ff01eea49ebfc23ad0110784cdecd402f891 --- /dev/null +++ b/shared/package-files/9f/9f356a350b59d7c488dce4a3354a4b6dcd82535217b740f6fdec0c1214641eda/blob @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor special_gammaincc(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & special_gammaincc_out(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/shared/package-files/9f/9f35d78f005ba0c2216b05ad484e01e1b295ca3804698b67d82da1a361e5c3b9/blob b/shared/package-files/9f/9f35d78f005ba0c2216b05ad484e01e1b295ca3804698b67d82da1a361e5c3b9/blob new file mode 100644 index 0000000000000000000000000000000000000000..e0a8174f153626580ac7346f33a03ed48c2124b7 --- /dev/null +++ b/shared/package-files/9f/9f35d78f005ba0c2216b05ad484e01e1b295ca3804698b67d82da1a361e5c3b9/blob @@ -0,0 +1,488 @@ +# encoding: utf-8 +""" +An application for IPython. + +All top-level applications should use the classes in this module for +handling configuration and creating configurables. + +The job of an :class:`Application` is to create the master configuration +object and then create the configurable objects, passing the config to them. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import atexit +from copy import deepcopy +import logging +import os +import shutil +import sys + +from pathlib import Path + +from traitlets.config.application import Application, catch_config_error +from traitlets.config.loader import ConfigFileNotFound, PyFileConfigLoader +from IPython.core import release, crashhandler +from IPython.core.profiledir import ProfileDir, ProfileDirError +from IPython.paths import get_ipython_dir, get_ipython_package_dir +from IPython.utils.path import ensure_dir_exists +from traitlets import ( + List, Unicode, Type, Bool, Set, Instance, Undefined, + default, observe, +) + +if os.name == "nt": + programdata = os.environ.get("PROGRAMDATA", None) + if programdata is not None: + SYSTEM_CONFIG_DIRS = [str(Path(programdata) / "ipython")] + else: # PROGRAMDATA is not defined by default on XP. + SYSTEM_CONFIG_DIRS = [] +else: + SYSTEM_CONFIG_DIRS = [ + "/usr/local/etc/ipython", + "/etc/ipython", + ] + + +ENV_CONFIG_DIRS = [] +_env_config_dir = os.path.join(sys.prefix, 'etc', 'ipython') +if _env_config_dir not in SYSTEM_CONFIG_DIRS: + # only add ENV_CONFIG if sys.prefix is not already included + ENV_CONFIG_DIRS.append(_env_config_dir) + + +_envvar = os.environ.get('IPYTHON_SUPPRESS_CONFIG_ERRORS') +if _envvar in {None, ''}: + IPYTHON_SUPPRESS_CONFIG_ERRORS = None +else: + if _envvar.lower() in {'1','true'}: + IPYTHON_SUPPRESS_CONFIG_ERRORS = True + elif _envvar.lower() in {'0','false'} : + IPYTHON_SUPPRESS_CONFIG_ERRORS = False + else: + sys.exit("Unsupported value for environment variable: 'IPYTHON_SUPPRESS_CONFIG_ERRORS' is set to '%s' which is none of {'0', '1', 'false', 'true', ''}."% _envvar ) + +# aliases and flags + +base_aliases = {} +if isinstance(Application.aliases, dict): + # traitlets 5 + base_aliases.update(Application.aliases) +base_aliases.update( + { + "profile-dir": "ProfileDir.location", + "profile": "BaseIPythonApplication.profile", + "ipython-dir": "BaseIPythonApplication.ipython_dir", + "log-level": "Application.log_level", + "config": "BaseIPythonApplication.extra_config_file", + } +) + +base_flags = dict() +if isinstance(Application.flags, dict): + # traitlets 5 + base_flags.update(Application.flags) +base_flags.update( + dict( + debug=( + {"Application": {"log_level": logging.DEBUG}}, + "set log level to logging.DEBUG (maximize logging output)", + ), + quiet=( + {"Application": {"log_level": logging.CRITICAL}}, + "set log level to logging.CRITICAL (minimize logging output)", + ), + init=( + { + "BaseIPythonApplication": { + "copy_config_files": True, + "auto_create": True, + } + }, + """Initialize profile with default config files. This is equivalent + to running `ipython profile create ` prior to startup. + """, + ), + ) +) + + +class ProfileAwareConfigLoader(PyFileConfigLoader): + """A Python file config loader that is aware of IPython profiles.""" + def load_subconfig(self, fname, path=None, profile=None): + if profile is not None: + try: + profile_dir = ProfileDir.find_profile_dir_by_name( + get_ipython_dir(), + profile, + ) + except ProfileDirError: + return + path = profile_dir.location + return super(ProfileAwareConfigLoader, self).load_subconfig(fname, path=path) + +class BaseIPythonApplication(Application): + name = "ipython" + description = "IPython: an enhanced interactive Python shell." + version = Unicode(release.version) + + aliases = base_aliases + flags = base_flags + classes = List([ProfileDir]) + + # enable `load_subconfig('cfg.py', profile='name')` + python_config_loader_class = ProfileAwareConfigLoader + + # Track whether the config_file has changed, + # because some logic happens only if we aren't using the default. + config_file_specified = Set() + + config_file_name = Unicode() + @default('config_file_name') + def _config_file_name_default(self): + return self.name.replace('-','_') + u'_config.py' + @observe('config_file_name') + def _config_file_name_changed(self, change): + if change['new'] != change['old']: + self.config_file_specified.add(change['new']) + + # The directory that contains IPython's builtin profiles. + builtin_profile_dir = Unicode( + os.path.join(get_ipython_package_dir(), u'config', u'profile', u'default') + ) + + config_file_paths = List(Unicode()) + @default('config_file_paths') + def _config_file_paths_default(self): + return [] + + extra_config_file = Unicode( + help="""Path to an extra config file to load. + + If specified, load this config file in addition to any other IPython config. + """).tag(config=True) + @observe('extra_config_file') + def _extra_config_file_changed(self, change): + old = change['old'] + new = change['new'] + try: + self.config_files.remove(old) + except ValueError: + pass + self.config_file_specified.add(new) + self.config_files.append(new) + + profile = Unicode(u'default', + help="""The IPython profile to use.""" + ).tag(config=True) + + @observe('profile') + def _profile_changed(self, change): + self.builtin_profile_dir = os.path.join( + get_ipython_package_dir(), u'config', u'profile', change['new'] + ) + + add_ipython_dir_to_sys_path = Bool( + False, + """Should the IPython profile directory be added to sys path ? + + This option was non-existing before IPython 8.0, and ipython_dir was added to + sys path to allow import of extensions present there. This was historical + baggage from when pip did not exist. This now default to false, + but can be set to true for legacy reasons. + """, + ).tag(config=True) + + ipython_dir = Unicode( + help=""" + The name of the IPython directory. This directory is used for logging + configuration (through profiles), history storage, etc. The default + is usually $HOME/.ipython. This option can also be specified through + the environment variable IPYTHONDIR. + """ + ).tag(config=True) + @default('ipython_dir') + def _ipython_dir_default(self): + d = get_ipython_dir() + self._ipython_dir_changed({ + 'name': 'ipython_dir', + 'old': d, + 'new': d, + }) + return d + + _in_init_profile_dir = False + profile_dir = Instance(ProfileDir, allow_none=True) + @default('profile_dir') + def _profile_dir_default(self): + # avoid recursion + if self._in_init_profile_dir: + return + # profile_dir requested early, force initialization + self.init_profile_dir() + return self.profile_dir + + overwrite = Bool(False, + help="""Whether to overwrite existing config files when copying""" + ).tag(config=True) + auto_create = Bool(False, + help="""Whether to create profile dir if it doesn't exist""" + ).tag(config=True) + + config_files = List(Unicode()) + @default('config_files') + def _config_files_default(self): + return [self.config_file_name] + + copy_config_files = Bool(False, + help="""Whether to install the default config files into the profile dir. + If a new profile is being created, and IPython contains config files for that + profile, then they will be staged into the new directory. Otherwise, + default config files will be automatically generated. + """).tag(config=True) + + verbose_crash = Bool(False, + help="""Create a massive crash report when IPython encounters what may be an + internal error. The default is to append a short message to the + usual traceback""").tag(config=True) + + # The class to use as the crash handler. + crash_handler_class = Type(crashhandler.CrashHandler) + + @catch_config_error + def __init__(self, **kwargs): + super(BaseIPythonApplication, self).__init__(**kwargs) + # ensure current working directory exists + try: + os.getcwd() + except: + # exit if cwd doesn't exist + self.log.error("Current working directory doesn't exist.") + self.exit(1) + + #------------------------------------------------------------------------- + # Various stages of Application creation + #------------------------------------------------------------------------- + + def init_crash_handler(self): + """Create a crash handler, typically setting sys.excepthook to it.""" + self.crash_handler = self.crash_handler_class(self) + sys.excepthook = self.excepthook + def unset_crashhandler(): + sys.excepthook = sys.__excepthook__ + atexit.register(unset_crashhandler) + + def excepthook(self, etype, evalue, tb): + """this is sys.excepthook after init_crashhandler + + set self.verbose_crash=True to use our full crashhandler, instead of + a regular traceback with a short message (crash_handler_lite) + """ + + if self.verbose_crash: + return self.crash_handler(etype, evalue, tb) + else: + return crashhandler.crash_handler_lite(etype, evalue, tb) + + @observe('ipython_dir') + def _ipython_dir_changed(self, change): + old = change['old'] + new = change['new'] + if old is not Undefined: + str_old = os.path.abspath(old) + if str_old in sys.path: + sys.path.remove(str_old) + if self.add_ipython_dir_to_sys_path: + str_path = os.path.abspath(new) + sys.path.append(str_path) + ensure_dir_exists(new) + readme = os.path.join(new, "README") + readme_src = os.path.join( + get_ipython_package_dir(), "config", "profile", "README" + ) + if not os.path.exists(readme) and os.path.exists(readme_src): + shutil.copy(readme_src, readme) + for d in ("extensions", "nbextensions"): + path = os.path.join(new, d) + try: + ensure_dir_exists(path) + except OSError as e: + # this will not be EEXIST + self.log.error("couldn't create path %s: %s", path, e) + self.log.debug("IPYTHONDIR set to: %s", new) + + def load_config_file(self, suppress_errors=IPYTHON_SUPPRESS_CONFIG_ERRORS): + """Load the config file. + + By default, errors in loading config are handled, and a warning + printed on screen. For testing, the suppress_errors option is set + to False, so errors will make tests fail. + + `suppress_errors` default value is to be `None` in which case the + behavior default to the one of `traitlets.Application`. + + The default value can be set : + - to `False` by setting 'IPYTHON_SUPPRESS_CONFIG_ERRORS' environment variable to '0', or 'false' (case insensitive). + - to `True` by setting 'IPYTHON_SUPPRESS_CONFIG_ERRORS' environment variable to '1' or 'true' (case insensitive). + - to `None` by setting 'IPYTHON_SUPPRESS_CONFIG_ERRORS' environment variable to '' (empty string) or leaving it unset. + + Any other value are invalid, and will make IPython exit with a non-zero return code. + """ + + + self.log.debug("Searching path %s for config files", self.config_file_paths) + base_config = 'ipython_config.py' + self.log.debug("Attempting to load config file: %s" % + base_config) + try: + if suppress_errors is not None: + old_value = Application.raise_config_file_errors + Application.raise_config_file_errors = not suppress_errors; + Application.load_config_file( + self, + base_config, + path=self.config_file_paths + ) + except ConfigFileNotFound: + # ignore errors loading parent + self.log.debug("Config file %s not found", base_config) + pass + if suppress_errors is not None: + Application.raise_config_file_errors = old_value + + for config_file_name in self.config_files: + if not config_file_name or config_file_name == base_config: + continue + self.log.debug("Attempting to load config file: %s" % + self.config_file_name) + try: + Application.load_config_file( + self, + config_file_name, + path=self.config_file_paths + ) + except ConfigFileNotFound: + # Only warn if the default config file was NOT being used. + if config_file_name in self.config_file_specified: + msg = self.log.warning + else: + msg = self.log.debug + msg("Config file not found, skipping: %s", config_file_name) + except Exception: + # For testing purposes. + if not suppress_errors: + raise + self.log.warning("Error loading config file: %s" % + self.config_file_name, exc_info=True) + + def init_profile_dir(self): + """initialize the profile dir""" + self._in_init_profile_dir = True + if self.profile_dir is not None: + # already ran + return + if 'ProfileDir.location' not in self.config: + # location not specified, find by profile name + try: + p = ProfileDir.find_profile_dir_by_name(self.ipython_dir, self.profile, self.config) + except ProfileDirError: + # not found, maybe create it (always create default profile) + if self.auto_create or self.profile == 'default': + try: + p = ProfileDir.create_profile_dir_by_name(self.ipython_dir, self.profile, self.config) + except ProfileDirError: + self.log.fatal("Could not create profile: %r"%self.profile) + self.exit(1) + else: + self.log.info("Created profile dir: %r"%p.location) + else: + self.log.fatal("Profile %r not found."%self.profile) + self.exit(1) + else: + self.log.debug("Using existing profile dir: %r", p.location) + else: + location = self.config.ProfileDir.location + # location is fully specified + try: + p = ProfileDir.find_profile_dir(location, self.config) + except ProfileDirError: + # not found, maybe create it + if self.auto_create: + try: + p = ProfileDir.create_profile_dir(location, self.config) + except ProfileDirError: + self.log.fatal("Could not create profile directory: %r"%location) + self.exit(1) + else: + self.log.debug("Creating new profile dir: %r"%location) + else: + self.log.fatal("Profile directory %r not found."%location) + self.exit(1) + else: + self.log.debug("Using existing profile dir: %r", p.location) + # if profile_dir is specified explicitly, set profile name + dir_name = os.path.basename(p.location) + if dir_name.startswith('profile_'): + self.profile = dir_name[8:] + + self.profile_dir = p + self.config_file_paths.append(p.location) + self._in_init_profile_dir = False + + def init_config_files(self): + """[optionally] copy default config files into profile dir.""" + self.config_file_paths.extend(ENV_CONFIG_DIRS) + self.config_file_paths.extend(SYSTEM_CONFIG_DIRS) + # copy config files + path = Path(self.builtin_profile_dir) + if self.copy_config_files: + src = self.profile + + cfg = self.config_file_name + if path and (path / cfg).exists(): + self.log.warning( + "Staging %r from %s into %r [overwrite=%s]" + % (cfg, src, self.profile_dir.location, self.overwrite) + ) + self.profile_dir.copy_config_file(cfg, path=path, overwrite=self.overwrite) + else: + self.stage_default_config_file() + else: + # Still stage *bundled* config files, but not generated ones + # This is necessary for `ipython profile=sympy` to load the profile + # on the first go + files = path.glob("*.py") + for fullpath in files: + cfg = fullpath.name + if self.profile_dir.copy_config_file(cfg, path=path, overwrite=False): + # file was copied + self.log.warning("Staging bundled %s from %s into %r"%( + cfg, self.profile, self.profile_dir.location) + ) + + + def stage_default_config_file(self): + """auto generate default config file, and stage it into the profile.""" + s = self.generate_config_file() + config_file = Path(self.profile_dir.location) / self.config_file_name + if self.overwrite or not config_file.exists(): + self.log.warning("Generating default config file: %r", (config_file)) + config_file.write_text(s, encoding="utf-8") + + @catch_config_error + def initialize(self, argv=None): + # don't hook up crash handler before parsing command-line + self.parse_command_line(argv) + self.init_crash_handler() + if self.subapp is not None: + # stop here if subapp is taking over + return + # save a copy of CLI config to re-load after config files + # so that it has highest priority + cl_config = deepcopy(self.config) + self.init_profile_dir() + self.init_config_files() + self.load_config_file() + # enforce cl-opts override configfile opts: + self.update_config(cl_config) diff --git a/shared/package-files/9f/9f3673a5473c01f4edc3e20d47728ec5c8f1f69cb355433c3a1b2b747d9d3bfc/blob b/shared/package-files/9f/9f3673a5473c01f4edc3e20d47728ec5c8f1f69cb355433c3a1b2b747d9d3bfc/blob new file mode 100644 index 0000000000000000000000000000000000000000..fdf36cec580ce9c24fbb9d2a60fdfcaa824b3f11 --- /dev/null +++ b/shared/package-files/9f/9f3673a5473c01f4edc3e20d47728ec5c8f1f69cb355433c3a1b2b747d9d3bfc/blob @@ -0,0 +1,22 @@ +#if defined(DETECT_FEATURES) && defined(__INTEL_COMPILER) + /* + * Unlike GCC and CLANG, Intel Compiler exposes all supported intrinsics, + * whether or not the build options for those features are specified. + * Therefore, we must test #definitions of CPU features when option native/host + * is enabled via `--cpu-baseline` or through env var `CFLAGS` otherwise + * the test will be broken and leads to enable all possible features. + */ + #ifndef __F16C__ + #error "HOST/ARCH doesn't support F16C" + #endif +#endif + +#include +#include + +int main(int argc, char **argv) +{ + __m128 a = _mm_cvtph_ps(_mm_loadu_si128((const __m128i*)argv[argc-1])); + __m256 a8 = _mm256_cvtph_ps(_mm_loadu_si128((const __m128i*)argv[argc-2])); + return (int)(_mm_cvtss_f32(a) + _mm_cvtss_f32(_mm256_castps256_ps128(a8))); +} diff --git a/shared/package-files/9f/9f3726df6c83e7ebdae53a2e926f2c5c434be05e80505c72003de20241763908/blob b/shared/package-files/9f/9f3726df6c83e7ebdae53a2e926f2c5c434be05e80505c72003de20241763908/blob new file mode 100644 index 0000000000000000000000000000000000000000..d04de7ce6a6ad5d8f63635f53d23df857e747ba0 --- /dev/null +++ b/shared/package-files/9f/9f3726df6c83e7ebdae53a2e926f2c5c434be05e80505c72003de20241763908/blob @@ -0,0 +1,458 @@ +from _typeshed import SupportsWrite +from typing import ( + IO, + Any, + Callable, + Container, + Dict, + Generic, + Iterable, + Iterator, + List, + Mapping, + MutableSet, + NoReturn, + Optional, + Text, + Tuple, + Type, + TypeVar, + Union, + overload, +) + +_K = TypeVar("_K") +_V = TypeVar("_V") +_R = TypeVar("_R") +_D = TypeVar("_D") + +def is_immutable(self) -> NoReturn: ... +def iter_multi_items(mapping): ... +def native_itermethods(names): ... + +class ImmutableListMixin(Generic[_V]): + def __hash__(self) -> int: ... + def __reduce_ex__(self: _D, protocol) -> Tuple[Type[_D], List[_V]]: ... + def __delitem__(self, key: _V) -> NoReturn: ... + def __iadd__(self, other: Any) -> NoReturn: ... + def __imul__(self, other: Any) -> NoReturn: ... + def __setitem__(self, key: str, value: Any) -> NoReturn: ... + def append(self, item: Any) -> NoReturn: ... + def remove(self, item: Any) -> NoReturn: ... + def extend(self, iterable: Any) -> NoReturn: ... + def insert(self, pos: int, value: Any) -> NoReturn: ... + def pop(self, index: int = ...) -> NoReturn: ... + def reverse(self) -> NoReturn: ... + def sort(self, cmp: Optional[Any] = ..., key: Optional[Any] = ..., reverse: Optional[Any] = ...) -> NoReturn: ... + +class ImmutableList(ImmutableListMixin[_V], List[_V]): ... # type: ignore + +class ImmutableDictMixin(object): + @classmethod + def fromkeys(cls, *args, **kwargs): ... + def __reduce_ex__(self, protocol): ... + def __hash__(self) -> int: ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def update(self, *args, **kwargs): ... + def pop(self, key, default: Optional[Any] = ...): ... + def popitem(self): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def clear(self): ... + +class ImmutableMultiDictMixin(ImmutableDictMixin): + def __reduce_ex__(self, protocol): ... + def add(self, key, value): ... + def popitemlist(self): ... + def poplist(self, key): ... + def setlist(self, key, new_list): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + +class UpdateDictMixin(object): + on_update: Any + def setdefault(self, key, default: Optional[Any] = ...): ... + def pop(self, key, default=...): ... + __setitem__: Any + __delitem__: Any + clear: Any + popitem: Any + update: Any + +class TypeConversionDict(Dict[_K, _V]): + @overload + def get(self, key: _K, *, type: None = ...) -> Optional[_V]: ... + @overload + def get(self, key: _K, default: _D, type: None = ...) -> Union[_V, _D]: ... + @overload + def get(self, key: _K, *, type: Callable[[_V], _R]) -> Optional[_R]: ... + @overload + def get(self, key: _K, default: _D, type: Callable[[_V], _R]) -> Union[_R, _D]: ... + +class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict[_K, _V]): # type: ignore + def copy(self) -> TypeConversionDict[_K, _V]: ... + def __copy__(self) -> ImmutableTypeConversionDict[_K, _V]: ... + +class ViewItems: + def __init__(self, multi_dict, method, repr_name, *a, **kw): ... + def __iter__(self): ... + +class MultiDict(TypeConversionDict[_K, _V]): + def __init__(self, mapping: Optional[Any] = ...): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def add(self, key, value): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def setlist(self, key, new_list): ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + def items(self, multi: bool = ...): ... + def lists(self): ... + def keys(self): ... + __iter__: Any + def values(self): ... + def listvalues(self): ... + def copy(self): ... + def deepcopy(self, memo: Optional[Any] = ...): ... + def to_dict(self, flat: bool = ...): ... + def update(self, other_dict): ... + def pop(self, key, default=...): ... + def popitem(self): ... + def poplist(self, key): ... + def popitemlist(self): ... + def __copy__(self): ... + def __deepcopy__(self, memo): ... + +class _omd_bucket: + prev: Any + key: Any + value: Any + next: Any + def __init__(self, omd, key, value): ... + def unlink(self, omd): ... + +class OrderedMultiDict(MultiDict[_K, _V]): + def __init__(self, mapping: Optional[Any] = ...): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __reduce_ex__(self, protocol): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def keys(self): ... + __iter__: Any + def values(self): ... + def items(self, multi: bool = ...): ... + def lists(self): ... + def listvalues(self): ... + def add(self, key, value): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def setlist(self, key, new_list): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + def update(self, mapping): ... + def poplist(self, key): ... + def pop(self, key, default=...): ... + def popitem(self): ... + def popitemlist(self): ... + +class Headers(object): + def __init__(self, defaults: Optional[Any] = ...): ... + def __getitem__(self, key, _get_mode: bool = ...): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + @overload + def get(self, key: str, *, type: None = ...) -> Optional[str]: ... + @overload + def get(self, key: str, default: _D, type: None = ...) -> Union[str, _D]: ... + @overload + def get(self, key: str, *, type: Callable[[str], _R]) -> Optional[_R]: ... + @overload + def get(self, key: str, default: _D, type: Callable[[str], _R]) -> Union[_R, _D]: ... + @overload + def get(self, key: str, *, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, *, type: None, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, *, type: Callable[[Any], _R], as_bytes: bool) -> Optional[_R]: ... + @overload + def get(self, key: str, default: Any, type: None, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, default: _D, type: Callable[[Any], _R], as_bytes: bool) -> Union[_R, _D]: ... + def getlist(self, key, type: Optional[Any] = ..., as_bytes: bool = ...): ... + def get_all(self, name): ... + def items(self, lower: bool = ...): ... + def keys(self, lower: bool = ...): ... + def values(self): ... + def extend(self, iterable): ... + def __delitem__(self, key: Any) -> None: ... + def remove(self, key): ... + def pop(self, **kwargs): ... + def popitem(self): ... + def __contains__(self, key): ... + has_key: Any + def __iter__(self): ... + def __len__(self): ... + def add(self, _key, _value, **kw): ... + def add_header(self, _key, _value, **_kw): ... + def clear(self): ... + def set(self, _key, _value, **kw): ... + def setdefault(self, key, value): ... + def __setitem__(self, key, value): ... + def to_list(self, charset: Text = ...): ... + def to_wsgi_list(self): ... + def copy(self): ... + def __copy__(self): ... + +class ImmutableHeadersMixin: + def __delitem__(self, key: str) -> None: ... + def __setitem__(self, key, value): ... + set: Any + def add(self, *args, **kwargs): ... + remove: Any + add_header: Any + def extend(self, iterable): ... + def insert(self, pos, value): ... + def pop(self, **kwargs): ... + def popitem(self): ... + def setdefault(self, key, default): ... + +class EnvironHeaders(ImmutableHeadersMixin, Headers): + environ: Any + def __init__(self, environ): ... + def __eq__(self, other): ... + def __getitem__(self, key, _get_mode: bool = ...): ... + def __len__(self): ... + def __iter__(self): ... + def copy(self): ... + +class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict[_K, _V]): # type: ignore + def __reduce_ex__(self, protocol): ... + dicts: Any + def __init__(self, dicts: Optional[Any] = ...): ... + @classmethod + def fromkeys(cls): ... + def __getitem__(self, key): ... + def get(self, key, default: Optional[Any] = ..., type: Optional[Any] = ...): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def keys(self): ... + __iter__: Any + def items(self, multi: bool = ...): ... + def values(self): ... + def lists(self): ... + def listvalues(self): ... + def copy(self): ... + def to_dict(self, flat: bool = ...): ... + def __len__(self): ... + def __contains__(self, key): ... + has_key: Any + +class FileMultiDict(MultiDict[_K, _V]): + def add_file(self, name, file, filename: Optional[Any] = ..., content_type: Optional[Any] = ...): ... + +class ImmutableDict(ImmutableDictMixin, Dict[_K, _V]): # type: ignore + def copy(self): ... + def __copy__(self): ... + +class ImmutableMultiDict(ImmutableMultiDictMixin, MultiDict[_K, _V]): # type: ignore + def copy(self): ... + def __copy__(self): ... + +class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict[_K, _V]): # type: ignore + def copy(self): ... + def __copy__(self): ... + +class Accept(ImmutableList[Tuple[str, float]]): + provided: bool + def __init__(self, values: Union[None, Accept, Iterable[Tuple[str, float]]] = ...) -> None: ... + @overload + def __getitem__(self, key: int) -> Tuple[str, float]: ... + @overload + def __getitem__(self, s: slice) -> List[Tuple[str, float]]: ... + @overload + def __getitem__(self, key: str) -> float: ... + def quality(self, key: str) -> float: ... + def __contains__(self, value: str) -> bool: ... # type: ignore + def index(self, key: Union[str, Tuple[str, float]]) -> int: ... # type: ignore + def find(self, key: Union[str, Tuple[str, float]]) -> int: ... + def values(self) -> Iterator[str]: ... + def to_header(self) -> str: ... + @overload + def best_match(self, matches: Iterable[str], default: None = ...) -> Optional[str]: ... + @overload + def best_match(self, matches: Iterable[str], default: _D) -> Union[str, _D]: ... + @property + def best(self) -> Optional[str]: ... + +class MIMEAccept(Accept): + @property + def accept_html(self) -> bool: ... + @property + def accept_xhtml(self) -> bool: ... + @property + def accept_json(self) -> bool: ... + +class LanguageAccept(Accept): ... +class CharsetAccept(Accept): ... + +def cache_property(key, empty, type): ... + +class _CacheControl(UpdateDictMixin, Dict[str, Any]): + no_cache: Any + no_store: Any + max_age: Any + no_transform: Any + on_update: Any + provided: Any + def __init__(self, values=..., on_update: Optional[Any] = ...): ... + def to_header(self): ... + +class RequestCacheControl(ImmutableDictMixin, _CacheControl): # type: ignore + max_stale: Any + min_fresh: Any + no_transform: Any + only_if_cached: Any + +class ResponseCacheControl(_CacheControl): + public: Any + private: Any + must_revalidate: Any + proxy_revalidate: Any + s_maxage: Any + +class CallbackDict(UpdateDictMixin, Dict[_K, _V]): + on_update: Any + def __init__(self, initial: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + +class HeaderSet(MutableSet[str]): + on_update: Any + def __init__(self, headers: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def add(self, header): ... + def remove(self, header): ... + def update(self, iterable): ... + def discard(self, header): ... + def find(self, header): ... + def index(self, header): ... + def clear(self): ... + def as_set(self, preserve_casing: bool = ...): ... + def to_header(self): ... + def __getitem__(self, idx): ... + def __delitem__(self, idx): ... + def __setitem__(self, idx, value): ... + def __contains__(self, header): ... + def __len__(self): ... + def __iter__(self): ... + def __nonzero__(self): ... + +class ETags(Container[str], Iterable[str]): + star_tag: Any + def __init__(self, strong_etags: Optional[Any] = ..., weak_etags: Optional[Any] = ..., star_tag: bool = ...): ... + def as_set(self, include_weak: bool = ...): ... + def is_weak(self, etag): ... + def contains_weak(self, etag): ... + def contains(self, etag): ... + def contains_raw(self, etag): ... + def to_header(self): ... + def __call__(self, etag: Optional[Any] = ..., data: Optional[Any] = ..., include_weak: bool = ...): ... + def __bool__(self): ... + __nonzero__: Any + def __iter__(self): ... + def __contains__(self, etag): ... + +class IfRange: + etag: Any + date: Any + def __init__(self, etag: Optional[Any] = ..., date: Optional[Any] = ...): ... + def to_header(self): ... + +class Range: + units: Any + ranges: Any + def __init__(self, units, ranges): ... + def range_for_length(self, length): ... + def make_content_range(self, length): ... + def to_header(self): ... + def to_content_range_header(self, length): ... + +class ContentRange: + on_update: Any + units: Optional[str] + start: Any + stop: Any + length: Any + def __init__(self, units: Optional[str], start, stop, length: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def set(self, start, stop, length: Optional[Any] = ..., units: Optional[str] = ...): ... + def unset(self) -> None: ... + def to_header(self): ... + def __nonzero__(self): ... + __bool__: Any + +class Authorization(ImmutableDictMixin, Dict[str, Any]): # type: ignore + type: str + def __init__(self, auth_type: str, data: Optional[Mapping[str, Any]] = ...) -> None: ... + @property + def username(self) -> Optional[str]: ... + @property + def password(self) -> Optional[str]: ... + @property + def realm(self) -> Optional[str]: ... + @property + def nonce(self) -> Optional[str]: ... + @property + def uri(self) -> Optional[str]: ... + @property + def nc(self) -> Optional[str]: ... + @property + def cnonce(self) -> Optional[str]: ... + @property + def response(self) -> Optional[str]: ... + @property + def opaque(self) -> Optional[str]: ... + @property + def qop(self) -> Optional[str]: ... + +class WWWAuthenticate(UpdateDictMixin, Dict[str, Any]): + on_update: Any + def __init__(self, auth_type: Optional[Any] = ..., values: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def set_basic(self, realm: str = ...): ... + def set_digest( + self, realm, nonce, qop=..., opaque: Optional[Any] = ..., algorithm: Optional[Any] = ..., stale: bool = ... + ): ... + def to_header(self): ... + @staticmethod + def auth_property(name, doc: Optional[Any] = ...): ... + type: Any + realm: Any + domain: Any + nonce: Any + opaque: Any + algorithm: Any + qop: Any + stale: Any + +class FileStorage(object): + name: Optional[Text] + stream: IO[bytes] + filename: Optional[Text] + headers: Headers + def __init__( + self, + stream: Optional[IO[bytes]] = ..., + filename: Union[None, Text, bytes] = ..., + name: Optional[Text] = ..., + content_type: Optional[Text] = ..., + content_length: Optional[int] = ..., + headers: Optional[Headers] = ..., + ): ... + @property + def content_type(self) -> Optional[Text]: ... + @property + def content_length(self) -> int: ... + @property + def mimetype(self) -> str: ... + @property + def mimetype_params(self) -> Dict[str, str]: ... + def save(self, dst: Union[Text, SupportsWrite[bytes]], buffer_size: int = ...): ... + def close(self) -> None: ... + def __nonzero__(self) -> bool: ... + def __bool__(self) -> bool: ... + def __getattr__(self, name: Text) -> Any: ... + def __iter__(self) -> Iterator[bytes]: ... diff --git a/shared/package-files/9f/9f3cebf6b75d78b7af2b47bfa6fd5fbd9c817a440b4f7385d8070a3cd3ca6d9f/blob b/shared/package-files/9f/9f3cebf6b75d78b7af2b47bfa6fd5fbd9c817a440b4f7385d8070a3cd3ca6d9f/blob new file mode 100644 index 0000000000000000000000000000000000000000..ed6c93078299a47fa9706d4df7f7989f11e4a856 --- /dev/null +++ b/shared/package-files/9f/9f3cebf6b75d78b7af2b47bfa6fd5fbd9c817a440b4f7385d8070a3cd3ca6d9f/blob @@ -0,0 +1,211 @@ +#!/usr/bin/env python3 + + +""" +A set of primitive functions for performing collective ops. + +Each should also handle single rank scenario. +""" + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Callable, cast, Generic, List, Optional, Tuple, TypeVar, Union + +import torch.distributed as dist + +T = TypeVar("T") + +@dataclass +class SyncPayload(Generic[T]): + stage_name: Optional[str] + success: bool + payload: T + exception: Optional[Exception] = None + +def broadcast( + data_or_fn: Union[T, Callable[[], T]], + *, + success: bool = True, + stage_name: Optional[str] = None, + rank: int = 0, + pg: Optional[dist.ProcessGroup] = None, +) -> T: + """ + Broadcasts the data payload from rank 0 to all other ranks. + Or if a function is passed, execute it in rank 0 and broadcast result to all other ranks. + + Can be used to broadcast a failure signal to stop all ranks. + + If the function raises an exception, all ranks will raise. + + Args: + data_or_fn: the data to broadcast or function to execute and broadcast result. + success: False to stop all ranks. + stage_name: the name of the logical stage for synchronization and debugging + rank: rank to broadcast data or execute function and broadcast resutls. + pg: the process group for sync + Throws: + RuntimeError from original exception trace + Returns: + the value after synchronization + + Example usage: + >> id = broadcast(data_or_fn=allocate_id, rank=0, pg=ext_pg.my_pg) + """ + + if not success and data_or_fn is not None: + raise AssertionError("Data or Function is expected to be None if not successful") + + payload: Optional[T] = None + exception : Optional[Exception] = None + # if no pg is passed then execute if rank is 0 + if (pg is None and rank == 0) or (pg is not None and pg.rank() == rank): + # determine if it is an executable function or data payload only + if callable(data_or_fn): + try: + payload = data_or_fn() + except Exception as e: + success = False + exception = e + else: + payload = data_or_fn + + # broadcast the exception type if any to all ranks for failure categorization + sync_obj = SyncPayload( + stage_name=stage_name, + success=success, + payload=payload, + exception=exception, + ) + + if pg is not None: + broadcast_list = [sync_obj] + dist.broadcast_object_list(broadcast_list, src=rank, group=pg) + assert len(broadcast_list) == 1 + sync_obj = broadcast_list[0] + + # failure in any rank will trigger a throw in every rank. + if not sync_obj.success: + error_msg = f"Rank {rank} failed" + if stage_name is not None: + error_msg += f": stage {sync_obj.stage_name}" + if sync_obj.exception is not None: + error_msg += f": exception {sync_obj.exception}" + raise RuntimeError(error_msg) from sync_obj.exception + + return cast(T, sync_obj.payload) + + +def all_gather( + data_or_fn: Union[T, Callable[[], T]], + stage_name: Optional[str] = None, + pg: Optional[dist.ProcessGroup] = None, +) -> List[T]: + """ + A simple all_gather primitive with basic synchronization guard logic, + by checking payload from all ranks has the same stage name. + + Args: + data_or_fn: the data to be all gathered across ranks or function to be executed + stage_name: the sync stage name for out-of-sync protection + pg: the process group for sync + Throws: + RuntimeError from original exception trace + Returns: + a list of synced data from all ranks + + Example usage: + >> all_ids = all_gather(data_or_fn=allocate_id, pg=ext_pg.my_pg) + """ + payload: Optional[T] = None + exception : Optional[Exception] = None + success = True + # determine if it is an executable function or data payload only + if callable(data_or_fn): + try: + payload = data_or_fn() + except Exception as e: + success = False + exception = e + else: + payload = data_or_fn + + sync_obj = SyncPayload( + stage_name=stage_name, + success=success, + payload=payload, + exception=exception, + ) + + if pg is not None: + # List of success/failure across all ranks. + total_list = [None] * dist.get_world_size(pg) + all_gather_object_enforce_type(pg, total_list, sync_obj) + # Each rank will throw RuntimeError in case of failure on any rank. + stage_name = cast(SyncPayload[T], total_list[0]).stage_name + exception_list: List[Tuple[int, Exception]] = [] + ret_list: List[T] = [] + error_msg: str = "" + + for i, sp in enumerate(cast(List[SyncPayload[T]], total_list)): + if sp.stage_name != stage_name: + error_msg += ( + f"Unexpected stage name received from rank {i}: {sp.stage_name} " + ) + continue + if not sp.success and sp.exception is not None: + exception_list.append((i, sp.exception)) + continue + ret_list.append(sp.payload) + + if len(exception_list) > 0: + raise RuntimeError( # type: ignore[misc] + error_msg, exception_list) from exception_list[0] + return ret_list + else: + if not sync_obj.success: + raise RuntimeError( + f"all_gather failed with exception {sync_obj.exception}", + ) from sync_obj.exception + return [sync_obj.payload] # type: ignore[list-item] + + +# Note: use Any for typing for now so users can pass in +# either a list of None or target type placeholders +# otherwise pyre would complain +def all_gather_object_enforce_type( + pg: dist.ProcessGroup, + # pyre-fixme[2]: Parameter must have a type that does not contain `Any` + object_list: List[Any], + # pyre-fixme[2]: Parameter must have a type other than `Any` + obj: Any, + # pyre-fixme[2]: Parameter must have a type that does not contain `Any` + type_checker: Callable[[Any, Any], bool] = lambda x, y: type(x) == type(y), +) -> None: + """ + Similar to plain all_gather_object but with additional type checking + AFTER gather is done to ensure basic consistency. + If check does not pass, all ranks will fail with exception. + + This is generally to prevent conditional logic leading to + unexpected messages being received. This is considered fatal code error, + but due to logic stacks this might happen implicitly in practice. + + The default check does not check sub type (considered different) + or covariance (considered same) but users can pass in custom checker + if more complicated check is needed. + """ + dist.all_gather_object(object_list, obj, group=pg) + + # conservative check + list_len = len(object_list) + if list_len == 0: + return + first_obj = object_list[0] + for i in range(1, list_len): + if not type_checker(first_obj, object_list[i]): + raise TypeError( + f"Object type at index {i} is {type(object_list[i])}, " + f"while first object type is {type(first_obj)}" + ) diff --git a/shared/package-files/9f/9f3d69bc4a7cef9e8f0ab9fa28863633abd503e6de61434e0efbdfe0d9c61748/blob b/shared/package-files/9f/9f3d69bc4a7cef9e8f0ab9fa28863633abd503e6de61434e0efbdfe0d9c61748/blob new file mode 100644 index 0000000000000000000000000000000000000000..b9603b114bc245ecf32da926573ddb4157210c7a --- /dev/null +++ b/shared/package-files/9f/9f3d69bc4a7cef9e8f0ab9fa28863633abd503e6de61434e0efbdfe0d9c61748/blob @@ -0,0 +1,82 @@ +""" +Low-level text helper utilities. +""" + +from __future__ import annotations + +import dataclasses + +from . import _api +from .ft2font import FT2Font, Kerning, LoadFlags + + +@dataclasses.dataclass(frozen=True) +class LayoutItem: + ft_object: FT2Font + char: str + glyph_idx: int + x: float + prev_kern: float + + +def warn_on_missing_glyph(codepoint, fontnames): + _api.warn_external( + f"Glyph {codepoint} " + f"({chr(codepoint).encode('ascii', 'namereplace').decode('ascii')}) " + f"missing from font(s) {fontnames}.") + + block = ("Hebrew" if 0x0590 <= codepoint <= 0x05ff else + "Arabic" if 0x0600 <= codepoint <= 0x06ff else + "Devanagari" if 0x0900 <= codepoint <= 0x097f else + "Bengali" if 0x0980 <= codepoint <= 0x09ff else + "Gurmukhi" if 0x0a00 <= codepoint <= 0x0a7f else + "Gujarati" if 0x0a80 <= codepoint <= 0x0aff else + "Oriya" if 0x0b00 <= codepoint <= 0x0b7f else + "Tamil" if 0x0b80 <= codepoint <= 0x0bff else + "Telugu" if 0x0c00 <= codepoint <= 0x0c7f else + "Kannada" if 0x0c80 <= codepoint <= 0x0cff else + "Malayalam" if 0x0d00 <= codepoint <= 0x0d7f else + "Sinhala" if 0x0d80 <= codepoint <= 0x0dff else + None) + if block: + _api.warn_external( + f"Matplotlib currently does not support {block} natively.") + + +def layout(string, font, *, kern_mode=Kerning.DEFAULT): + """ + Render *string* with *font*. + + For each character in *string*, yield a LayoutItem instance. When such an instance + is yielded, the font's glyph is set to the corresponding character. + + Parameters + ---------- + string : str + The string to be rendered. + font : FT2Font + The font. + kern_mode : Kerning + A FreeType kerning mode. + + Yields + ------ + LayoutItem + """ + x = 0 + prev_glyph_idx = None + char_to_font = font._get_fontmap(string) + base_font = font + for char in string: + # This has done the fallback logic + font = char_to_font.get(char, base_font) + glyph_idx = font.get_char_index(ord(char)) + kern = ( + base_font.get_kerning(prev_glyph_idx, glyph_idx, kern_mode) / 64 + if prev_glyph_idx is not None else 0. + ) + x += kern + glyph = font.load_glyph(glyph_idx, flags=LoadFlags.NO_HINTING) + yield LayoutItem(font, char, glyph_idx, x, kern) + x += glyph.linearHoriAdvance / 65536 + prev_glyph_idx = glyph_idx diff --git a/shared/package-files/9f/9f4129c3427dac16fcf715495935da0df6fde98173d3e8b6c5aad721d0ddf82c/blob b/shared/package-files/9f/9f4129c3427dac16fcf715495935da0df6fde98173d3e8b6c5aad721d0ddf82c/blob new file mode 100644 index 0000000000000000000000000000000000000000..f4be1f70999db86e4ff70b6b703d5784a891a84c --- /dev/null +++ b/shared/package-files/9f/9f4129c3427dac16fcf715495935da0df6fde98173d3e8b6c5aad721d0ddf82c/blob @@ -0,0 +1,54 @@ +import os +from typing import BinaryIO, Optional, Tuple, Union + +import torch +from torchaudio.io import CodecConfig + +from . import soundfile_backend +from .backend import Backend +from .common import AudioMetaData + + +class SoundfileBackend(Backend): + @staticmethod + def info(uri: Union[BinaryIO, str, os.PathLike], format: Optional[str], buffer_size: int = 4096) -> AudioMetaData: + return soundfile_backend.info(uri, format) + + @staticmethod + def load( + uri: Union[BinaryIO, str, os.PathLike], + frame_offset: int = 0, + num_frames: int = -1, + normalize: bool = True, + channels_first: bool = True, + format: Optional[str] = None, + buffer_size: int = 4096, + ) -> Tuple[torch.Tensor, int]: + return soundfile_backend.load(uri, frame_offset, num_frames, normalize, channels_first, format) + + @staticmethod + def save( + uri: Union[BinaryIO, str, os.PathLike], + src: torch.Tensor, + sample_rate: int, + channels_first: bool = True, + format: Optional[str] = None, + encoding: Optional[str] = None, + bits_per_sample: Optional[int] = None, + buffer_size: int = 4096, + compression: Optional[Union[CodecConfig, float, int]] = None, + ) -> None: + if compression: + raise ValueError("soundfile backend does not support argument `compression`.") + + soundfile_backend.save( + uri, src, sample_rate, channels_first, format=format, encoding=encoding, bits_per_sample=bits_per_sample + ) + + @staticmethod + def can_decode(uri, format) -> bool: + return True + + @staticmethod + def can_encode(uri, format) -> bool: + return True diff --git a/shared/package-files/9f/9f4179d8761f19fb7fe8bb23c4403e877c694229858236fb526195ccf828eb37/blob b/shared/package-files/9f/9f4179d8761f19fb7fe8bb23c4403e877c694229858236fb526195ccf828eb37/blob new file mode 100644 index 0000000000000000000000000000000000000000..4268533ec9c555880e4c62603aacef4ab6b7d5d6 --- /dev/null +++ b/shared/package-files/9f/9f4179d8761f19fb7fe8bb23c4403e877c694229858236fb526195ccf828eb37/blob @@ -0,0 +1,23 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor & tril_indices_out(int64_t row, int64_t col, int64_t offset, at::Tensor & out); +TORCH_API at::Tensor tril_indices_cpu(int64_t row, int64_t col, int64_t offset=0, c10::optional dtype={}, c10::optional layout={}, c10::optional device={}, c10::optional pin_memory={}); +TORCH_API at::Tensor tril_indices_cuda(int64_t row, int64_t col, int64_t offset=0, c10::optional dtype={}, c10::optional layout={}, c10::optional device={}, c10::optional pin_memory={}); +} // namespace native +} // namespace at diff --git a/shared/package-files/9f/9f458306850708c5cf7fea4612559a17740a4c95ef6ec9cebe62286ebf025506/blob b/shared/package-files/9f/9f458306850708c5cf7fea4612559a17740a4c95ef6ec9cebe62286ebf025506/blob new file mode 100644 index 0000000000000000000000000000000000000000..e0d6ec3e63b03994b8183fb8315691d6f92e77cb Binary files /dev/null and b/shared/package-files/9f/9f458306850708c5cf7fea4612559a17740a4c95ef6ec9cebe62286ebf025506/blob differ diff --git a/shared/package-files/9f/9f46358de8bdb2cad9e7c12fe063310d3b29617539f13c8084b273040a4bb6d1/blob b/shared/package-files/9f/9f46358de8bdb2cad9e7c12fe063310d3b29617539f13c8084b273040a4bb6d1/blob new file mode 100644 index 0000000000000000000000000000000000000000..beb7b4d6f10254cbbf8c84585a79e92f6fe03fa1 --- /dev/null +++ b/shared/package-files/9f/9f46358de8bdb2cad9e7c12fe063310d3b29617539f13c8084b273040a4bb6d1/blob @@ -0,0 +1,231 @@ +""" + pygments.lexers._cl_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + ANSI Common Lisp builtins. + + :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +BUILTIN_FUNCTIONS = { # 638 functions + '<', '<=', '=', '>', '>=', '-', '/', '/=', '*', '+', '1-', '1+', + 'abort', 'abs', 'acons', 'acos', 'acosh', 'add-method', 'adjoin', + 'adjustable-array-p', 'adjust-array', 'allocate-instance', + 'alpha-char-p', 'alphanumericp', 'append', 'apply', 'apropos', + 'apropos-list', 'aref', 'arithmetic-error-operands', + 'arithmetic-error-operation', 'array-dimension', 'array-dimensions', + 'array-displacement', 'array-element-type', 'array-has-fill-pointer-p', + 'array-in-bounds-p', 'arrayp', 'array-rank', 'array-row-major-index', + 'array-total-size', 'ash', 'asin', 'asinh', 'assoc', 'assoc-if', + 'assoc-if-not', 'atan', 'atanh', 'atom', 'bit', 'bit-and', 'bit-andc1', + 'bit-andc2', 'bit-eqv', 'bit-ior', 'bit-nand', 'bit-nor', 'bit-not', + 'bit-orc1', 'bit-orc2', 'bit-vector-p', 'bit-xor', 'boole', + 'both-case-p', 'boundp', 'break', 'broadcast-stream-streams', + 'butlast', 'byte', 'byte-position', 'byte-size', 'caaaar', 'caaadr', + 'caaar', 'caadar', 'caaddr', 'caadr', 'caar', 'cadaar', 'cadadr', + 'cadar', 'caddar', 'cadddr', 'caddr', 'cadr', 'call-next-method', 'car', + 'cdaaar', 'cdaadr', 'cdaar', 'cdadar', 'cdaddr', 'cdadr', 'cdar', + 'cddaar', 'cddadr', 'cddar', 'cdddar', 'cddddr', 'cdddr', 'cddr', 'cdr', + 'ceiling', 'cell-error-name', 'cerror', 'change-class', 'char', 'char<', + 'char<=', 'char=', 'char>', 'char>=', 'char/=', 'character', + 'characterp', 'char-code', 'char-downcase', 'char-equal', + 'char-greaterp', 'char-int', 'char-lessp', 'char-name', + 'char-not-equal', 'char-not-greaterp', 'char-not-lessp', 'char-upcase', + 'cis', 'class-name', 'class-of', 'clear-input', 'clear-output', + 'close', 'clrhash', 'code-char', 'coerce', 'compile', + 'compiled-function-p', 'compile-file', 'compile-file-pathname', + 'compiler-macro-function', 'complement', 'complex', 'complexp', + 'compute-applicable-methods', 'compute-restarts', 'concatenate', + 'concatenated-stream-streams', 'conjugate', 'cons', 'consp', + 'constantly', 'constantp', 'continue', 'copy-alist', 'copy-list', + 'copy-pprint-dispatch', 'copy-readtable', 'copy-seq', 'copy-structure', + 'copy-symbol', 'copy-tree', 'cos', 'cosh', 'count', 'count-if', + 'count-if-not', 'decode-float', 'decode-universal-time', 'delete', + 'delete-duplicates', 'delete-file', 'delete-if', 'delete-if-not', + 'delete-package', 'denominator', 'deposit-field', 'describe', + 'describe-object', 'digit-char', 'digit-char-p', 'directory', + 'directory-namestring', 'disassemble', 'documentation', 'dpb', + 'dribble', 'echo-stream-input-stream', 'echo-stream-output-stream', + 'ed', 'eighth', 'elt', 'encode-universal-time', 'endp', + 'enough-namestring', 'ensure-directories-exist', + 'ensure-generic-function', 'eq', 'eql', 'equal', 'equalp', 'error', + 'eval', 'evenp', 'every', 'exp', 'export', 'expt', 'fboundp', + 'fceiling', 'fdefinition', 'ffloor', 'fifth', 'file-author', + 'file-error-pathname', 'file-length', 'file-namestring', + 'file-position', 'file-string-length', 'file-write-date', + 'fill', 'fill-pointer', 'find', 'find-all-symbols', 'find-class', + 'find-if', 'find-if-not', 'find-method', 'find-package', 'find-restart', + 'find-symbol', 'finish-output', 'first', 'float', 'float-digits', + 'floatp', 'float-precision', 'float-radix', 'float-sign', 'floor', + 'fmakunbound', 'force-output', 'format', 'fourth', 'fresh-line', + 'fround', 'ftruncate', 'funcall', 'function-keywords', + 'function-lambda-expression', 'functionp', 'gcd', 'gensym', 'gentemp', + 'get', 'get-decoded-time', 'get-dispatch-macro-character', 'getf', + 'gethash', 'get-internal-real-time', 'get-internal-run-time', + 'get-macro-character', 'get-output-stream-string', 'get-properties', + 'get-setf-expansion', 'get-universal-time', 'graphic-char-p', + 'hash-table-count', 'hash-table-p', 'hash-table-rehash-size', + 'hash-table-rehash-threshold', 'hash-table-size', 'hash-table-test', + 'host-namestring', 'identity', 'imagpart', 'import', + 'initialize-instance', 'input-stream-p', 'inspect', + 'integer-decode-float', 'integer-length', 'integerp', + 'interactive-stream-p', 'intern', 'intersection', + 'invalid-method-error', 'invoke-debugger', 'invoke-restart', + 'invoke-restart-interactively', 'isqrt', 'keywordp', 'last', 'lcm', + 'ldb', 'ldb-test', 'ldiff', 'length', 'lisp-implementation-type', + 'lisp-implementation-version', 'list', 'list*', 'list-all-packages', + 'listen', 'list-length', 'listp', 'load', + 'load-logical-pathname-translations', 'log', 'logand', 'logandc1', + 'logandc2', 'logbitp', 'logcount', 'logeqv', 'logical-pathname', + 'logical-pathname-translations', 'logior', 'lognand', 'lognor', + 'lognot', 'logorc1', 'logorc2', 'logtest', 'logxor', 'long-site-name', + 'lower-case-p', 'machine-instance', 'machine-type', 'machine-version', + 'macroexpand', 'macroexpand-1', 'macro-function', 'make-array', + 'make-broadcast-stream', 'make-concatenated-stream', 'make-condition', + 'make-dispatch-macro-character', 'make-echo-stream', 'make-hash-table', + 'make-instance', 'make-instances-obsolete', 'make-list', + 'make-load-form', 'make-load-form-saving-slots', 'make-package', + 'make-pathname', 'make-random-state', 'make-sequence', 'make-string', + 'make-string-input-stream', 'make-string-output-stream', 'make-symbol', + 'make-synonym-stream', 'make-two-way-stream', 'makunbound', 'map', + 'mapc', 'mapcan', 'mapcar', 'mapcon', 'maphash', 'map-into', 'mapl', + 'maplist', 'mask-field', 'max', 'member', 'member-if', 'member-if-not', + 'merge', 'merge-pathnames', 'method-combination-error', + 'method-qualifiers', 'min', 'minusp', 'mismatch', 'mod', + 'muffle-warning', 'name-char', 'namestring', 'nbutlast', 'nconc', + 'next-method-p', 'nintersection', 'ninth', 'no-applicable-method', + 'no-next-method', 'not', 'notany', 'notevery', 'nreconc', 'nreverse', + 'nset-difference', 'nset-exclusive-or', 'nstring-capitalize', + 'nstring-downcase', 'nstring-upcase', 'nsublis', 'nsubst', 'nsubst-if', + 'nsubst-if-not', 'nsubstitute', 'nsubstitute-if', 'nsubstitute-if-not', + 'nth', 'nthcdr', 'null', 'numberp', 'numerator', 'nunion', 'oddp', + 'open', 'open-stream-p', 'output-stream-p', 'package-error-package', + 'package-name', 'package-nicknames', 'packagep', + 'package-shadowing-symbols', 'package-used-by-list', 'package-use-list', + 'pairlis', 'parse-integer', 'parse-namestring', 'pathname', + 'pathname-device', 'pathname-directory', 'pathname-host', + 'pathname-match-p', 'pathname-name', 'pathnamep', 'pathname-type', + 'pathname-version', 'peek-char', 'phase', 'plusp', 'position', + 'position-if', 'position-if-not', 'pprint', 'pprint-dispatch', + 'pprint-fill', 'pprint-indent', 'pprint-linear', 'pprint-newline', + 'pprint-tab', 'pprint-tabular', 'prin1', 'prin1-to-string', 'princ', + 'princ-to-string', 'print', 'print-object', 'probe-file', 'proclaim', + 'provide', 'random', 'random-state-p', 'rassoc', 'rassoc-if', + 'rassoc-if-not', 'rational', 'rationalize', 'rationalp', 'read', + 'read-byte', 'read-char', 'read-char-no-hang', 'read-delimited-list', + 'read-from-string', 'read-line', 'read-preserving-whitespace', + 'read-sequence', 'readtable-case', 'readtablep', 'realp', 'realpart', + 'reduce', 'reinitialize-instance', 'rem', 'remhash', 'remove', + 'remove-duplicates', 'remove-if', 'remove-if-not', 'remove-method', + 'remprop', 'rename-file', 'rename-package', 'replace', 'require', + 'rest', 'restart-name', 'revappend', 'reverse', 'room', 'round', + 'row-major-aref', 'rplaca', 'rplacd', 'sbit', 'scale-float', 'schar', + 'search', 'second', 'set', 'set-difference', + 'set-dispatch-macro-character', 'set-exclusive-or', + 'set-macro-character', 'set-pprint-dispatch', 'set-syntax-from-char', + 'seventh', 'shadow', 'shadowing-import', 'shared-initialize', + 'short-site-name', 'signal', 'signum', 'simple-bit-vector-p', + 'simple-condition-format-arguments', 'simple-condition-format-control', + 'simple-string-p', 'simple-vector-p', 'sin', 'sinh', 'sixth', 'sleep', + 'slot-boundp', 'slot-exists-p', 'slot-makunbound', 'slot-missing', + 'slot-unbound', 'slot-value', 'software-type', 'software-version', + 'some', 'sort', 'special-operator-p', 'sqrt', 'stable-sort', + 'standard-char-p', 'store-value', 'stream-element-type', + 'stream-error-stream', 'stream-external-format', 'streamp', 'string', + 'string<', 'string<=', 'string=', 'string>', 'string>=', 'string/=', + 'string-capitalize', 'string-downcase', 'string-equal', + 'string-greaterp', 'string-left-trim', 'string-lessp', + 'string-not-equal', 'string-not-greaterp', 'string-not-lessp', + 'stringp', 'string-right-trim', 'string-trim', 'string-upcase', + 'sublis', 'subseq', 'subsetp', 'subst', 'subst-if', 'subst-if-not', + 'substitute', 'substitute-if', 'substitute-if-not', 'subtypep','svref', + 'sxhash', 'symbol-function', 'symbol-name', 'symbolp', 'symbol-package', + 'symbol-plist', 'symbol-value', 'synonym-stream-symbol', 'syntax:', + 'tailp', 'tan', 'tanh', 'tenth', 'terpri', 'third', + 'translate-logical-pathname', 'translate-pathname', 'tree-equal', + 'truename', 'truncate', 'two-way-stream-input-stream', + 'two-way-stream-output-stream', 'type-error-datum', + 'type-error-expected-type', 'type-of', 'typep', 'unbound-slot-instance', + 'unexport', 'unintern', 'union', 'unread-char', 'unuse-package', + 'update-instance-for-different-class', + 'update-instance-for-redefined-class', 'upgraded-array-element-type', + 'upgraded-complex-part-type', 'upper-case-p', 'use-package', + 'user-homedir-pathname', 'use-value', 'values', 'values-list', 'vector', + 'vectorp', 'vector-pop', 'vector-push', 'vector-push-extend', 'warn', + 'wild-pathname-p', 'write', 'write-byte', 'write-char', 'write-line', + 'write-sequence', 'write-string', 'write-to-string', 'yes-or-no-p', + 'y-or-n-p', 'zerop', +} + +SPECIAL_FORMS = { + 'block', 'catch', 'declare', 'eval-when', 'flet', 'function', 'go', 'if', + 'labels', 'lambda', 'let', 'let*', 'load-time-value', 'locally', 'macrolet', + 'multiple-value-call', 'multiple-value-prog1', 'progn', 'progv', 'quote', + 'return-from', 'setq', 'symbol-macrolet', 'tagbody', 'the', 'throw', + 'unwind-protect', +} + +MACROS = { + 'and', 'assert', 'call-method', 'case', 'ccase', 'check-type', 'cond', + 'ctypecase', 'decf', 'declaim', 'defclass', 'defconstant', 'defgeneric', + 'define-compiler-macro', 'define-condition', 'define-method-combination', + 'define-modify-macro', 'define-setf-expander', 'define-symbol-macro', + 'defmacro', 'defmethod', 'defpackage', 'defparameter', 'defsetf', + 'defstruct', 'deftype', 'defun', 'defvar', 'destructuring-bind', 'do', + 'do*', 'do-all-symbols', 'do-external-symbols', 'dolist', 'do-symbols', + 'dotimes', 'ecase', 'etypecase', 'formatter', 'handler-bind', + 'handler-case', 'ignore-errors', 'incf', 'in-package', 'lambda', 'loop', + 'loop-finish', 'make-method', 'multiple-value-bind', 'multiple-value-list', + 'multiple-value-setq', 'nth-value', 'or', 'pop', + 'pprint-exit-if-list-exhausted', 'pprint-logical-block', 'pprint-pop', + 'print-unreadable-object', 'prog', 'prog*', 'prog1', 'prog2', 'psetf', + 'psetq', 'push', 'pushnew', 'remf', 'restart-bind', 'restart-case', + 'return', 'rotatef', 'setf', 'shiftf', 'step', 'time', 'trace', 'typecase', + 'unless', 'untrace', 'when', 'with-accessors', 'with-compilation-unit', + 'with-condition-restarts', 'with-hash-table-iterator', + 'with-input-from-string', 'with-open-file', 'with-open-stream', + 'with-output-to-string', 'with-package-iterator', 'with-simple-restart', + 'with-slots', 'with-standard-io-syntax', +} + +LAMBDA_LIST_KEYWORDS = { + '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional', + '&rest', '&whole', +} + +DECLARATIONS = { + 'dynamic-extent', 'ignore', 'optimize', 'ftype', 'inline', 'special', + 'ignorable', 'notinline', 'type', +} + +BUILTIN_TYPES = { + 'atom', 'boolean', 'base-char', 'base-string', 'bignum', 'bit', + 'compiled-function', 'extended-char', 'fixnum', 'keyword', 'nil', + 'signed-byte', 'short-float', 'single-float', 'double-float', 'long-float', + 'simple-array', 'simple-base-string', 'simple-bit-vector', 'simple-string', + 'simple-vector', 'standard-char', 'unsigned-byte', + + # Condition Types + 'arithmetic-error', 'cell-error', 'condition', 'control-error', + 'division-by-zero', 'end-of-file', 'error', 'file-error', + 'floating-point-inexact', 'floating-point-overflow', + 'floating-point-underflow', 'floating-point-invalid-operation', + 'parse-error', 'package-error', 'print-not-readable', 'program-error', + 'reader-error', 'serious-condition', 'simple-condition', 'simple-error', + 'simple-type-error', 'simple-warning', 'stream-error', 'storage-condition', + 'style-warning', 'type-error', 'unbound-variable', 'unbound-slot', + 'undefined-function', 'warning', +} + +BUILTIN_CLASSES = { + 'array', 'broadcast-stream', 'bit-vector', 'built-in-class', 'character', + 'class', 'complex', 'concatenated-stream', 'cons', 'echo-stream', + 'file-stream', 'float', 'function', 'generic-function', 'hash-table', + 'integer', 'list', 'logical-pathname', 'method-combination', 'method', + 'null', 'number', 'package', 'pathname', 'ratio', 'rational', 'readtable', + 'real', 'random-state', 'restart', 'sequence', 'standard-class', + 'standard-generic-function', 'standard-method', 'standard-object', + 'string-stream', 'stream', 'string', 'structure-class', 'structure-object', + 'symbol', 'synonym-stream', 't', 'two-way-stream', 'vector', +} diff --git a/shared/package-files/9f/9f499ba14a760b852cab68fab4d59cbb84d9fd84f8fa42a0ad83b4b7eaf3d72c/blob b/shared/package-files/9f/9f499ba14a760b852cab68fab4d59cbb84d9fd84f8fa42a0ad83b4b7eaf3d72c/blob new file mode 100644 index 0000000000000000000000000000000000000000..3326be4333b875b481ad294adb8235a7106838e5 --- /dev/null +++ b/shared/package-files/9f/9f499ba14a760b852cab68fab4d59cbb84d9fd84f8fa42a0ad83b4b7eaf3d72c/blob @@ -0,0 +1,21 @@ +# Seaborn paper context +figure.figsize: 6.4, 4.4 +axes.labelsize: 8.8 +axes.titlesize: 9.6 +xtick.labelsize: 8 +ytick.labelsize: 8 +legend.fontsize: 8 + +grid.linewidth: 0.8 +lines.linewidth: 1.4 +patch.linewidth: 0.24 +lines.markersize: 5.6 +lines.markeredgewidth: 0 + +xtick.major.width: 0.8 +ytick.major.width: 0.8 +xtick.minor.width: 0.4 +ytick.minor.width: 0.4 + +xtick.major.pad: 5.6 +ytick.major.pad: 5.6 diff --git a/shared/package-files/9f/9f4a1b498c8573b877e7a2e656a1a1c0530a1f83695c85c5e41c73b68536e34a/blob b/shared/package-files/9f/9f4a1b498c8573b877e7a2e656a1a1c0530a1f83695c85c5e41c73b68536e34a/blob new file mode 100644 index 0000000000000000000000000000000000000000..4259ced6e6f696425530c250aba947043aa852ca --- /dev/null +++ b/shared/package-files/9f/9f4a1b498c8573b877e7a2e656a1a1c0530a1f83695c85c5e41c73b68536e34a/blob @@ -0,0 +1,37 @@ +import sys +import ctypes +import struct as struct_ +import llvmlite.ir +from llvmlite.ir import Constant + +_trace_refs_ = hasattr(sys, 'getobjects') +_plat_bits = struct_.calcsize('@P') * 8 + +_int8 = llvmlite.ir.IntType(8) +_int32 = llvmlite.ir.IntType(32) + +_void_star = llvmlite.ir.PointerType(_int8) + +_int8_star = _void_star + +_sizeof_py_ssize_t = ctypes.sizeof(getattr(ctypes, 'c_size_t')) +_llvm_py_ssize_t = llvmlite.ir.IntType(_sizeof_py_ssize_t * 8) + +if _trace_refs_: + _pyobject_head = llvmlite.ir.LiteralStructType([_void_star, _void_star, + _llvm_py_ssize_t, _void_star]) + _pyobject_head_init = Constant.literal_struct([ + Constant(_void_star, None), # _ob_next + Constant(_void_star, None), # _ob_prev + Constant(_llvm_py_ssize_t, 1), # ob_refcnt + Constant(_void_star, None), # ob_type + ]) + +else: + _pyobject_head = llvmlite.ir.LiteralStructType([_llvm_py_ssize_t, _void_star]) + _pyobject_head_init = Constant.literal_struct([ + Constant(_llvm_py_ssize_t, 1), # ob_refcnt + Constant(_void_star, None), # ob_type + ]) + +_pyobject_head_p = llvmlite.ir.PointerType(_pyobject_head) diff --git a/shared/package-files/9f/9f4a7b7a0523858ec79e2f81c263997753a9396cbf1a4a4d0ca0d81c71dcaca1/blob b/shared/package-files/9f/9f4a7b7a0523858ec79e2f81c263997753a9396cbf1a4a4d0ca0d81c71dcaca1/blob new file mode 100644 index 0000000000000000000000000000000000000000..bafaf7bc5f66342b29eb03faacb2ad613e08d200 --- /dev/null +++ b/shared/package-files/9f/9f4a7b7a0523858ec79e2f81c263997753a9396cbf1a4a4d0ca0d81c71dcaca1/blob @@ -0,0 +1,35 @@ +# Types to support PEP 3333 (WSGI) +# +# This module doesn't exist at runtime and neither do the types defined in this +# file. They are provided for type checking purposes. + +from sys import _OptExcInfo +from typing import Any, Callable, Dict, Iterable, List, Optional, Protocol, Text, Tuple + +class StartResponse(Protocol): + def __call__( + self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[_OptExcInfo] = ... + ) -> Callable[[bytes], Any]: ... + +WSGIEnvironment = Dict[Text, Any] +WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] + +# WSGI input streams per PEP 3333 +class InputStream(Protocol): + def read(self, size: int = ...) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def __iter__(self) -> Iterable[bytes]: ... + +# WSGI error streams per PEP 3333 +class ErrorStream(Protocol): + def flush(self) -> None: ... + def write(self, s: str) -> None: ... + def writelines(self, seq: List[str]) -> None: ... + +class _Readable(Protocol): + def read(self, size: int = ...) -> bytes: ... + +# Optional file wrapper in wsgi.file_wrapper +class FileWrapper(Protocol): + def __call__(self, file: _Readable, block_size: int = ...) -> Iterable[bytes]: ... diff --git a/shared/package-files/9f/9f4afac33a453b0acc57b37867f47de4a60a9dffad875053ad37200eaec61c95/blob b/shared/package-files/9f/9f4afac33a453b0acc57b37867f47de4a60a9dffad875053ad37200eaec61c95/blob new file mode 100644 index 0000000000000000000000000000000000000000..3d30135b86ac30669eefa56da64447e1a50f0455 --- /dev/null +++ b/shared/package-files/9f/9f4afac33a453b0acc57b37867f47de4a60a9dffad875053ad37200eaec61c95/blob @@ -0,0 +1,193 @@ +from collections.abc import Callable, Iterable +from typing import Any, Final, Protocol, TypeAlias + +from typing_extensions import Generic, Self, TypeVar + +from .ir import Loc +from .target_extension import Target +from .types import Type + +__all__ = [ + "ByteCodeSupportError", + "CompilerError", + "ConstantInferenceError", + "DeprecationError", + "ForbiddenConstruct", + "ForceLiteralArg", + "IRError", + "InternalError", + "InternalTargetMismatchError", + "LiteralTypingError", + "LoweringError", + "NonexistentTargetError", + "NotDefinedError", + "NumbaAssertionError", + "NumbaAttributeError", + "NumbaDebugInfoWarning", + "NumbaDeprecationWarning", + "NumbaError", + "NumbaExperimentalFeatureWarning", + "NumbaIRAssumptionWarning", + "NumbaIndexError", + "NumbaInvalidConfigWarning", + "NumbaKeyError", + "NumbaNotImplementedError", + "NumbaParallelSafetyWarning", + "NumbaPedanticWarning", + "NumbaPendingDeprecationWarning", + "NumbaPerformanceWarning", + "NumbaRuntimeError", + "NumbaSystemWarning", + "NumbaTypeError", + "NumbaTypeSafetyWarning", + "NumbaValueError", + "NumbaWarning", + "RedefinedError", + "RequireLiteralValue", + "TypingError", + "UnsupportedBytecodeError", + "UnsupportedError", + "UnsupportedParforsError", + "UnsupportedRewriteError", + "UntypedAttributeError", + "VerificationError", +] + +_ExceptionT_co = TypeVar( + "_ExceptionT_co", + bound=BaseException | str, + default=Any, + covariant=True, +) + +_Ignored: TypeAlias = object +_FoldArgumentsFn: TypeAlias = Callable[ + [tuple[Any, ...], dict[str, Any]], + tuple[Any, ...], +] + +### + +class NumbaWarning(Warning): + msg: str + loc: Loc | None + + def __init__( + self, + msg: str, + loc: Loc | None = None, + highlighting: bool = True, + ) -> None: ... + +class NumbaPerformanceWarning(NumbaWarning): ... +class NumbaDeprecationWarning(NumbaWarning, DeprecationWarning): ... +class NumbaPendingDeprecationWarning(NumbaWarning, PendingDeprecationWarning): ... +class NumbaParallelSafetyWarning(NumbaWarning): ... +class NumbaTypeSafetyWarning(NumbaWarning): ... +class NumbaExperimentalFeatureWarning(NumbaWarning): ... +class NumbaInvalidConfigWarning(NumbaWarning): ... + +class NumbaPedanticWarning(NumbaWarning): + def __init__(self, msg: str) -> None: ... + +class NumbaIRAssumptionWarning(NumbaPedanticWarning): ... +class NumbaDebugInfoWarning(NumbaWarning): ... +class NumbaSystemWarning(NumbaWarning): ... + +class NumbaError(Exception): + def __init__( + self, + msg: str, + loc: Loc | None = None, + highlighting: bool = True, + ) -> None: ... + @property + def contexts(self) -> list[str]: ... + def add_context(self, msg: str) -> Self: ... + def patch_message(self, new_message: str) -> None: ... + +class UnsupportedError(NumbaError): ... + +class UnsupportedBytecodeError(Exception): + def __init__(self, msg: str, loc: Loc | None = None) -> None: ... + +class UnsupportedRewriteError(UnsupportedError): ... +class IRError(NumbaError): ... +class RedefinedError(IRError): ... + +class NotDefinedError(IRError): + def __init__(self, name: str, loc: Loc | None = None) -> None: ... + +class VerificationError(IRError): ... +class DeprecationError(NumbaError): ... + +class LoweringError(NumbaError): + def __init__(self, msg: str, loc: Loc | None = None) -> None: ... + +class UnsupportedParforsError(NumbaError): ... +class ForbiddenConstruct(LoweringError): ... +class TypingError(NumbaError): ... + +class UntypedAttributeError(TypingError): + def __init__(self, value: Type, attr: str, loc: Loc | None = None) -> None: ... + +class ByteCodeSupportError(NumbaError): + def __init__(self, msg: str, loc: Loc | None = None) -> None: ... + +class CompilerError(NumbaError): ... + +class ConstantInferenceError(NumbaError): + def __init__(self, value: str, loc: Loc | None = None) -> None: ... + +class InternalError(NumbaError, Generic[_ExceptionT_co]): + old_exception: _ExceptionT_co + + def __init__(self, exception: _ExceptionT_co) -> None: ... + +class InternalTargetMismatchError(InternalError[str]): + def __init__(self, kind: str, target_hw: str, hw_clazz: type[Target]) -> None: ... + +class NonexistentTargetError(InternalError[_ExceptionT_co]): ... +class RequireLiteralValue(TypingError): ... + +class ForceLiteralArg(NumbaError): + requested_args: Final[frozenset[int]] + fold_arguments: Final[_FoldArgumentsFn | None] + + def __init__( + self, + arg_indices: Iterable[int], + fold_arguments: _FoldArgumentsFn | None = None, + loc: Loc | None = None, + ) -> None: ... + + # + def bind_fold_arguments( + self, + fold_arguments: _FoldArgumentsFn, + ) -> ForceLiteralArg: ... + + # + def combine(self, other: ForceLiteralArg) -> ForceLiteralArg: ... + def __or__(self, other: ForceLiteralArg) -> ForceLiteralArg: ... + +class LiteralTypingError(TypingError): ... +class NumbaValueError(TypingError): ... +class NumbaTypeError(TypingError): ... +class NumbaAttributeError(TypingError): ... +class NumbaAssertionError(TypingError): ... +class NumbaNotImplementedError(TypingError): ... +class NumbaKeyError(TypingError): ... +class NumbaIndexError(TypingError): ... +class NumbaRuntimeError(NumbaError): ... + +class _SupportsColorScheme(Protocol): + def __init__(self, theme: str | None = None) -> None: ... + def code(self, msg: str) -> str: ... + def errmsg(self, msg: str) -> str: ... + def filename(self, msg: str) -> str: ... + def indicate(self, msg: str) -> str: ... + def highlight(self, msg: str) -> str: ... + def reset(self, msg: str) -> str: ... + +def termcolor() -> _SupportsColorScheme: ... diff --git a/shared/package-files/9f/9f4ffec456b0e90aa265b85ee79a32ee59c478ec2a4ef039e69e44505893a4dc/blob b/shared/package-files/9f/9f4ffec456b0e90aa265b85ee79a32ee59c478ec2a4ef039e69e44505893a4dc/blob new file mode 100644 index 0000000000000000000000000000000000000000..742aa1017115d7ee1841a33a3fea0cd32236e673 --- /dev/null +++ b/shared/package-files/9f/9f4ffec456b0e90aa265b85ee79a32ee59c478ec2a4ef039e69e44505893a4dc/blob @@ -0,0 +1,54 @@ +from numba.cuda.cudadrv import nvvm +from numba.cuda.testing import skip_on_cudasim +from numba.core import utils + +from llvmlite import ir +from llvmlite import binding as llvm + +import unittest + + +original = "call void @llvm.memset.p0i8.i64(" \ + "i8* align 4 %arg.x.41, i8 0, i64 %0, i1 false)" + +missing_align = "call void @llvm.memset.p0i8.i64(" \ + "i8* %arg.x.41, i8 0, i64 %0, i1 false)" + + +@skip_on_cudasim('libNVVM not supported in simulator') +@unittest.skipIf(utils.MACHINE_BITS == 32, "CUDA not support for 32-bit") +@unittest.skipIf(not nvvm.is_available(), "No libNVVM") +class TestNvvmWithoutCuda(unittest.TestCase): + def test_nvvm_accepts_encoding(self): + # Test that NVVM will accept a constant containing all possible 8-bit + # characters. Taken from the test case added in llvmlite PR #53: + # + # https://github.com/numba/llvmlite/pull/53 + # + # This test case is included in Numba to ensure that the encoding used + # by llvmlite (e.g. utf-8, latin1, etc.) does not result in an input to + # NVVM that it cannot parse correctly + + # Create a module with a constant containing all 8-bit characters + c = ir.Constant(ir.ArrayType(ir.IntType(8), 256), + bytearray(range(256))) + m = ir.Module() + m.triple = 'nvptx64-nvidia-cuda' + nvvm.add_ir_version(m) + gv = ir.GlobalVariable(m, c.type, "myconstant") + gv.global_constant = True + gv.initializer = c + m.data_layout = nvvm.NVVM().data_layout + + # Parse with LLVM then dump the parsed module into NVVM + parsed = llvm.parse_assembly(str(m)) + ptx = nvvm.compile_ir(str(parsed)) + + # Ensure all characters appear in the generated constant array. + elements = ", ".join([str(i) for i in range(256)]) + myconstant = f"myconstant[256] = {{{elements}}}".encode('utf-8') + self.assertIn(myconstant, ptx) + + +if __name__ == '__main__': + unittest.main() diff --git a/shared/package-files/9f/9f517db29787191239d771b9567288a614b3cc91ee18f9ccd5cdf1ecc79fb58a/blob b/shared/package-files/9f/9f517db29787191239d771b9567288a614b3cc91ee18f9ccd5cdf1ecc79fb58a/blob new file mode 100644 index 0000000000000000000000000000000000000000..0d764bbb313fcd0b36a5e66ba9da3b2db77d13d0 --- /dev/null +++ b/shared/package-files/9f/9f517db29787191239d771b9567288a614b3cc91ee18f9ccd5cdf1ecc79fb58a/blob @@ -0,0 +1,50 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API arctan { + using schema = at::Tensor (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::arctan") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "arctan(Tensor self) -> Tensor") + static at::Tensor call(const at::Tensor & self); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +struct TORCH_API arctan_ { + using schema = at::Tensor & (at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::arctan_") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "arctan_(Tensor(a!) self) -> Tensor(a!)") + static at::Tensor & call(at::Tensor & self); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self); +}; + +struct TORCH_API arctan_out { + using schema = at::Tensor & (const at::Tensor &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::arctan") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "arctan.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & self, at::Tensor & out); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Tensor & out); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9f/9f525a2b9a0e1ceb5220050933c2ced8a4047dfe3ef0f66654da29538a367f9c/blob b/shared/package-files/9f/9f525a2b9a0e1ceb5220050933c2ced8a4047dfe3ef0f66654da29538a367f9c/blob new file mode 100644 index 0000000000000000000000000000000000000000..0ebaa9bced2ca0a2758cc4211308b2ad51437833 --- /dev/null +++ b/shared/package-files/9f/9f525a2b9a0e1ceb5220050933c2ced8a4047dfe3ef0f66654da29538a367f9c/blob @@ -0,0 +1,28 @@ +import torch +from torch.amp.grad_scaler import OptState + +__all__ = ["GradScaler", "OptState"] + + +class GradScaler(torch.amp.GradScaler): + r""" + See :class:`torch.amp.GradScaler`. + ``torch.cuda.amp.GradScaler(args...)`` is equivalent to ``torch.amp.GradScaler("cuda", args...)`` + """ + + def __init__( + self, + init_scale: float = 2.0**16, + growth_factor: float = 2.0, + backoff_factor: float = 0.5, + growth_interval: int = 2000, + enabled: bool = True, + ) -> None: + super().__init__( + "cuda", + init_scale=init_scale, + growth_factor=growth_factor, + backoff_factor=backoff_factor, + growth_interval=growth_interval, + enabled=enabled, + ) diff --git a/shared/package-files/9f/9f53b2291446f9d7024544a6c9e8e9293c9f3ff8aeda4545d1327ff7220991ea/blob b/shared/package-files/9f/9f53b2291446f9d7024544a6c9e8e9293c9f3ff8aeda4545d1327ff7220991ea/blob new file mode 100644 index 0000000000000000000000000000000000000000..4e8189e72c427d75da0367532edfe04d0a7581e8 --- /dev/null +++ b/shared/package-files/9f/9f53b2291446f9d7024544a6c9e8e9293c9f3ff8aeda4545d1327ff7220991ea/blob @@ -0,0 +1,508 @@ +from __future__ import annotations + +from functools import wraps +import inspect +from textwrap import dedent +from typing import ( + TYPE_CHECKING, + Any, + Callable, + cast, +) +import warnings + +from pandas._libs.properties import cache_readonly +from pandas._typing import ( + F, + T, +) +from pandas.util._exceptions import find_stack_level + +if TYPE_CHECKING: + from collections.abc import Mapping + + +def deprecate( + name: str, + alternative: Callable[..., Any], + version: str, + alt_name: str | None = None, + klass: type[Warning] | None = None, + stacklevel: int = 2, + msg: str | None = None, +) -> Callable[[F], F]: + """ + Return a new function that emits a deprecation warning on use. + + To use this method for a deprecated function, another function + `alternative` with the same signature must exist. The deprecated + function will emit a deprecation warning, and in the docstring + it will contain the deprecation directive with the provided version + so it can be detected for future removal. + + Parameters + ---------- + name : str + Name of function to deprecate. + alternative : func + Function to use instead. + version : str + Version of pandas in which the method has been deprecated. + alt_name : str, optional + Name to use in preference of alternative.__name__. + klass : Warning, default FutureWarning + stacklevel : int, default 2 + msg : str + The message to display in the warning. + Default is '{name} is deprecated. Use {alt_name} instead.' + """ + alt_name = alt_name or alternative.__name__ + klass = klass or FutureWarning + warning_msg = msg or f"{name} is deprecated, use {alt_name} instead." + + @wraps(alternative) + def wrapper(*args, **kwargs) -> Callable[..., Any]: + warnings.warn(warning_msg, klass, stacklevel=stacklevel) + return alternative(*args, **kwargs) + + # adding deprecated directive to the docstring + msg = msg or f"Use `{alt_name}` instead." + doc_error_msg = ( + "deprecate needs a correctly formatted docstring in " + "the target function (should have a one liner short " + "summary, and opening quotes should be in their own " + f"line). Found:\n{alternative.__doc__}" + ) + + # when python is running in optimized mode (i.e. `-OO`), docstrings are + # removed, so we check that a docstring with correct formatting is used + # but we allow empty docstrings + if alternative.__doc__: + if alternative.__doc__.count("\n") < 3: + raise AssertionError(doc_error_msg) + empty1, summary, empty2, doc_string = alternative.__doc__.split("\n", 3) + if empty1 or empty2 and not summary: + raise AssertionError(doc_error_msg) + wrapper.__doc__ = dedent( + f""" + {summary.strip()} + + .. deprecated:: {version} + {msg} + + {dedent(doc_string)}""" + ) + # error: Incompatible return value type (got "Callable[[VarArg(Any), KwArg(Any)], + # Callable[...,Any]]", expected "Callable[[F], F]") + return wrapper # type: ignore[return-value] + + +def deprecate_kwarg( + old_arg_name: str, + new_arg_name: str | None, + mapping: Mapping[Any, Any] | Callable[[Any], Any] | None = None, + stacklevel: int = 2, +) -> Callable[[F], F]: + """ + Decorator to deprecate a keyword argument of a function. + + Parameters + ---------- + old_arg_name : str + Name of argument in function to deprecate + new_arg_name : str or None + Name of preferred argument in function. Use None to raise warning that + ``old_arg_name`` keyword is deprecated. + mapping : dict or callable + If mapping is present, use it to translate old arguments to + new arguments. A callable must do its own value checking; + values not found in a dict will be forwarded unchanged. + + Examples + -------- + The following deprecates 'cols', using 'columns' instead + + >>> @deprecate_kwarg(old_arg_name='cols', new_arg_name='columns') + ... def f(columns=''): + ... print(columns) + ... + >>> f(columns='should work ok') + should work ok + + >>> f(cols='should raise warning') # doctest: +SKIP + FutureWarning: cols is deprecated, use columns instead + warnings.warn(msg, FutureWarning) + should raise warning + + >>> f(cols='should error', columns="can\'t pass do both") # doctest: +SKIP + TypeError: Can only specify 'cols' or 'columns', not both + + >>> @deprecate_kwarg('old', 'new', {'yes': True, 'no': False}) + ... def f(new=False): + ... print('yes!' if new else 'no!') + ... + >>> f(old='yes') # doctest: +SKIP + FutureWarning: old='yes' is deprecated, use new=True instead + warnings.warn(msg, FutureWarning) + yes! + + To raise a warning that a keyword will be removed entirely in the future + + >>> @deprecate_kwarg(old_arg_name='cols', new_arg_name=None) + ... def f(cols='', another_param=''): + ... print(cols) + ... + >>> f(cols='should raise warning') # doctest: +SKIP + FutureWarning: the 'cols' keyword is deprecated and will be removed in a + future version please takes steps to stop use of 'cols' + should raise warning + >>> f(another_param='should not raise warning') # doctest: +SKIP + should not raise warning + + >>> f(cols='should raise warning', another_param='') # doctest: +SKIP + FutureWarning: the 'cols' keyword is deprecated and will be removed in a + future version please takes steps to stop use of 'cols' + should raise warning + """ + if mapping is not None and not hasattr(mapping, "get") and not callable(mapping): + raise TypeError( + "mapping from old to new argument values must be dict or callable!" + ) + + def _deprecate_kwarg(func: F) -> F: + @wraps(func) + def wrapper(*args, **kwargs) -> Callable[..., Any]: + old_arg_value = kwargs.pop(old_arg_name, None) + + if old_arg_value is not None: + if new_arg_name is None: + msg = ( + f"the {repr(old_arg_name)} keyword is deprecated and " + "will be removed in a future version. Please take " + f"steps to stop the use of {repr(old_arg_name)}" + ) + warnings.warn(msg, FutureWarning, stacklevel=stacklevel) + kwargs[old_arg_name] = old_arg_value + return func(*args, **kwargs) + + elif mapping is not None: + if callable(mapping): + new_arg_value = mapping(old_arg_value) + else: + new_arg_value = mapping.get(old_arg_value, old_arg_value) + msg = ( + f"the {old_arg_name}={repr(old_arg_value)} keyword is " + "deprecated, use " + f"{new_arg_name}={repr(new_arg_value)} instead." + ) + else: + new_arg_value = old_arg_value + msg = ( + f"the {repr(old_arg_name)} keyword is deprecated, " + f"use {repr(new_arg_name)} instead." + ) + + warnings.warn(msg, FutureWarning, stacklevel=stacklevel) + if kwargs.get(new_arg_name) is not None: + msg = ( + f"Can only specify {repr(old_arg_name)} " + f"or {repr(new_arg_name)}, not both." + ) + raise TypeError(msg) + kwargs[new_arg_name] = new_arg_value + return func(*args, **kwargs) + + return cast(F, wrapper) + + return _deprecate_kwarg + + +def _format_argument_list(allow_args: list[str]) -> str: + """ + Convert the allow_args argument (either string or integer) of + `deprecate_nonkeyword_arguments` function to a string describing + it to be inserted into warning message. + + Parameters + ---------- + allowed_args : list, tuple or int + The `allowed_args` argument for `deprecate_nonkeyword_arguments`, + but None value is not allowed. + + Returns + ------- + str + The substring describing the argument list in best way to be + inserted to the warning message. + + Examples + -------- + `format_argument_list([])` -> '' + `format_argument_list(['a'])` -> "except for the arguments 'a'" + `format_argument_list(['a', 'b'])` -> "except for the arguments 'a' and 'b'" + `format_argument_list(['a', 'b', 'c'])` -> + "except for the arguments 'a', 'b' and 'c'" + """ + if "self" in allow_args: + allow_args.remove("self") + if not allow_args: + return "" + elif len(allow_args) == 1: + return f" except for the argument '{allow_args[0]}'" + else: + last = allow_args[-1] + args = ", ".join(["'" + x + "'" for x in allow_args[:-1]]) + return f" except for the arguments {args} and '{last}'" + + +def future_version_msg(version: str | None) -> str: + """Specify which version of pandas the deprecation will take place in.""" + if version is None: + return "In a future version of pandas" + else: + return f"Starting with pandas version {version}" + + +def deprecate_nonkeyword_arguments( + version: str | None, + allowed_args: list[str] | None = None, + name: str | None = None, +) -> Callable[[F], F]: + """ + Decorator to deprecate a use of non-keyword arguments of a function. + + Parameters + ---------- + version : str, optional + The version in which positional arguments will become + keyword-only. If None, then the warning message won't + specify any particular version. + + allowed_args : list, optional + In case of list, it must be the list of names of some + first arguments of the decorated functions that are + OK to be given as positional arguments. In case of None value, + defaults to list of all arguments not having the + default value. + + name : str, optional + The specific name of the function to show in the warning + message. If None, then the Qualified name of the function + is used. + """ + + def decorate(func): + old_sig = inspect.signature(func) + + if allowed_args is not None: + allow_args = allowed_args + else: + allow_args = [ + p.name + for p in old_sig.parameters.values() + if p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD) + and p.default is p.empty + ] + + new_params = [ + p.replace(kind=p.KEYWORD_ONLY) + if ( + p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD) + and p.name not in allow_args + ) + else p + for p in old_sig.parameters.values() + ] + new_params.sort(key=lambda p: p.kind) + new_sig = old_sig.replace(parameters=new_params) + + num_allow_args = len(allow_args) + msg = ( + f"{future_version_msg(version)} all arguments of " + f"{name or func.__qualname__}{{arguments}} will be keyword-only." + ) + + @wraps(func) + def wrapper(*args, **kwargs): + if len(args) > num_allow_args: + warnings.warn( + msg.format(arguments=_format_argument_list(allow_args)), + FutureWarning, + stacklevel=find_stack_level(), + ) + return func(*args, **kwargs) + + # error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no + # attribute "__signature__" + wrapper.__signature__ = new_sig # type: ignore[attr-defined] + return wrapper + + return decorate + + +def doc(*docstrings: None | str | Callable, **params) -> Callable[[F], F]: + """ + A decorator to take docstring templates, concatenate them and perform string + substitution on them. + + This decorator will add a variable "_docstring_components" to the wrapped + callable to keep track the original docstring template for potential usage. + If it should be consider as a template, it will be saved as a string. + Otherwise, it will be saved as callable, and later user __doc__ and dedent + to get docstring. + + Parameters + ---------- + *docstrings : None, str, or callable + The string / docstring / docstring template to be appended in order + after default docstring under callable. + **params + The string which would be used to format docstring template. + """ + + def decorator(decorated: F) -> F: + # collecting docstring and docstring templates + docstring_components: list[str | Callable] = [] + if decorated.__doc__: + docstring_components.append(dedent(decorated.__doc__)) + + for docstring in docstrings: + if docstring is None: + continue + if hasattr(docstring, "_docstring_components"): + docstring_components.extend( + docstring._docstring_components # pyright: ignore[reportGeneralTypeIssues] + ) + elif isinstance(docstring, str) or docstring.__doc__: + docstring_components.append(docstring) + + params_applied = [ + component.format(**params) + if isinstance(component, str) and len(params) > 0 + else component + for component in docstring_components + ] + + decorated.__doc__ = "".join( + [ + component + if isinstance(component, str) + else dedent(component.__doc__ or "") + for component in params_applied + ] + ) + + # error: "F" has no attribute "_docstring_components" + decorated._docstring_components = ( # type: ignore[attr-defined] + docstring_components + ) + return decorated + + return decorator + + +# Substitution and Appender are derived from matplotlib.docstring (1.1.0) +# module https://matplotlib.org/users/license.html + + +class Substitution: + """ + A decorator to take a function's docstring and perform string + substitution on it. + + This decorator should be robust even if func.__doc__ is None + (for example, if -OO was passed to the interpreter) + + Usage: construct a docstring.Substitution with a sequence or + dictionary suitable for performing substitution; then + decorate a suitable function with the constructed object. e.g. + + sub_author_name = Substitution(author='Jason') + + @sub_author_name + def some_function(x): + "%(author)s wrote this function" + + # note that some_function.__doc__ is now "Jason wrote this function" + + One can also use positional arguments. + + sub_first_last_names = Substitution('Edgar Allen', 'Poe') + + @sub_first_last_names + def some_function(x): + "%s %s wrote the Raven" + """ + + def __init__(self, *args, **kwargs) -> None: + if args and kwargs: + raise AssertionError("Only positional or keyword args are allowed") + + self.params = args or kwargs + + def __call__(self, func: F) -> F: + func.__doc__ = func.__doc__ and func.__doc__ % self.params + return func + + def update(self, *args, **kwargs) -> None: + """ + Update self.params with supplied args. + """ + if isinstance(self.params, dict): + self.params.update(*args, **kwargs) + + +class Appender: + """ + A function decorator that will append an addendum to the docstring + of the target function. + + This decorator should be robust even if func.__doc__ is None + (for example, if -OO was passed to the interpreter). + + Usage: construct a docstring.Appender with a string to be joined to + the original docstring. An optional 'join' parameter may be supplied + which will be used to join the docstring and addendum. e.g. + + add_copyright = Appender("Copyright (c) 2009", join='\n') + + @add_copyright + def my_dog(has='fleas'): + "This docstring will have a copyright below" + pass + """ + + addendum: str | None + + def __init__(self, addendum: str | None, join: str = "", indents: int = 0) -> None: + if indents > 0: + self.addendum = indent(addendum, indents=indents) + else: + self.addendum = addendum + self.join = join + + def __call__(self, func: T) -> T: + func.__doc__ = func.__doc__ if func.__doc__ else "" + self.addendum = self.addendum if self.addendum else "" + docitems = [func.__doc__, self.addendum] + func.__doc__ = dedent(self.join.join(docitems)) + return func + + +def indent(text: str | None, indents: int = 1) -> str: + if not text or not isinstance(text, str): + return "" + jointext = "".join(["\n"] + [" "] * indents) + return jointext.join(text.split("\n")) + + +__all__ = [ + "Appender", + "cache_readonly", + "deprecate", + "deprecate_kwarg", + "deprecate_nonkeyword_arguments", + "doc", + "future_version_msg", + "Substitution", +] diff --git a/shared/package-files/9f/9f568192191060ec1876391032fe52f7f1b5361a5a0619b1de2c2e240ab79c2f/blob b/shared/package-files/9f/9f568192191060ec1876391032fe52f7f1b5361a5a0619b1de2c2e240ab79c2f/blob new file mode 100644 index 0000000000000000000000000000000000000000..309990ea03ad90eb7c82297a025c12bec21d1bb7 --- /dev/null +++ b/shared/package-files/9f/9f568192191060ec1876391032fe52f7f1b5361a5a0619b1de2c2e240ab79c2f/blob @@ -0,0 +1,433 @@ +from typing import Tuple + +import torch +import torchvision +from torch import Tensor +from torchvision.extension import _assert_has_ops + +from ..utils import _log_api_usage_once +from ._box_convert import _box_cxcywh_to_xyxy, _box_xywh_to_xyxy, _box_xyxy_to_cxcywh, _box_xyxy_to_xywh +from ._utils import _upcast + + +def nms(boxes: Tensor, scores: Tensor, iou_threshold: float) -> Tensor: + """ + Performs non-maximum suppression (NMS) on the boxes according + to their intersection-over-union (IoU). + + NMS iteratively removes lower scoring boxes which have an + IoU greater than ``iou_threshold`` with another (higher scoring) + box. + + If multiple boxes have the exact same score and satisfy the IoU + criterion with respect to a reference box, the selected box is + not guaranteed to be the same between CPU and GPU. This is similar + to the behavior of argsort in PyTorch when repeated values are present. + + Args: + boxes (Tensor[N, 4])): boxes to perform NMS on. They + are expected to be in ``(x1, y1, x2, y2)`` format with ``0 <= x1 < x2`` and + ``0 <= y1 < y2``. + scores (Tensor[N]): scores for each one of the boxes + iou_threshold (float): discards all overlapping boxes with IoU > iou_threshold + + Returns: + Tensor: int64 tensor with the indices of the elements that have been kept + by NMS, sorted in decreasing order of scores + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(nms) + _assert_has_ops() + return torch.ops.torchvision.nms(boxes, scores, iou_threshold) + + +def batched_nms( + boxes: Tensor, + scores: Tensor, + idxs: Tensor, + iou_threshold: float, +) -> Tensor: + """ + Performs non-maximum suppression in a batched fashion. + + Each index value correspond to a category, and NMS + will not be applied between elements of different categories. + + Args: + boxes (Tensor[N, 4]): boxes where NMS will be performed. They + are expected to be in ``(x1, y1, x2, y2)`` format with ``0 <= x1 < x2`` and + ``0 <= y1 < y2``. + scores (Tensor[N]): scores for each one of the boxes + idxs (Tensor[N]): indices of the categories for each one of the boxes. + iou_threshold (float): discards all overlapping boxes with IoU > iou_threshold + + Returns: + Tensor: int64 tensor with the indices of the elements that have been kept by NMS, sorted + in decreasing order of scores + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(batched_nms) + # Benchmarks that drove the following thresholds are at + # https://github.com/pytorch/vision/issues/1311#issuecomment-781329339 + if boxes.numel() > (4000 if boxes.device.type == "cpu" else 20000) and not torchvision._is_tracing(): + return _batched_nms_vanilla(boxes, scores, idxs, iou_threshold) + else: + return _batched_nms_coordinate_trick(boxes, scores, idxs, iou_threshold) + + +@torch.jit._script_if_tracing +def _batched_nms_coordinate_trick( + boxes: Tensor, + scores: Tensor, + idxs: Tensor, + iou_threshold: float, +) -> Tensor: + # strategy: in order to perform NMS independently per class, + # we add an offset to all the boxes. The offset is dependent + # only on the class idx, and is large enough so that boxes + # from different classes do not overlap + if boxes.numel() == 0: + return torch.empty((0,), dtype=torch.int64, device=boxes.device) + max_coordinate = boxes.max() + offsets = idxs.to(boxes) * (max_coordinate + torch.tensor(1).to(boxes)) + boxes_for_nms = boxes + offsets[:, None] + keep = nms(boxes_for_nms, scores, iou_threshold) + return keep + + +@torch.jit._script_if_tracing +def _batched_nms_vanilla( + boxes: Tensor, + scores: Tensor, + idxs: Tensor, + iou_threshold: float, +) -> Tensor: + # Based on Detectron2 implementation, just manually call nms() on each class independently + keep_mask = torch.zeros_like(scores, dtype=torch.bool) + for class_id in torch.unique(idxs): + curr_indices = torch.where(idxs == class_id)[0] + curr_keep_indices = nms(boxes[curr_indices], scores[curr_indices], iou_threshold) + keep_mask[curr_indices[curr_keep_indices]] = True + keep_indices = torch.where(keep_mask)[0] + return keep_indices[scores[keep_indices].sort(descending=True)[1]] + + +def remove_small_boxes(boxes: Tensor, min_size: float) -> Tensor: + """ + Remove every box from ``boxes`` which contains at least one side length + that is smaller than ``min_size``. + + .. note:: + For sanitizing a :class:`~torchvision.tv_tensors.BoundingBoxes` object, consider using + the transform :func:`~torchvision.transforms.v2.SanitizeBoundingBoxes` instead. + + Args: + boxes (Tensor[N, 4]): boxes in ``(x1, y1, x2, y2)`` format + with ``0 <= x1 < x2`` and ``0 <= y1 < y2``. + min_size (float): minimum size + + Returns: + Tensor[K]: indices of the boxes that have both sides + larger than ``min_size`` + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(remove_small_boxes) + ws, hs = boxes[:, 2] - boxes[:, 0], boxes[:, 3] - boxes[:, 1] + keep = (ws >= min_size) & (hs >= min_size) + keep = torch.where(keep)[0] + return keep + + +def clip_boxes_to_image(boxes: Tensor, size: Tuple[int, int]) -> Tensor: + """ + Clip boxes so that they lie inside an image of size ``size``. + + .. note:: + For clipping a :class:`~torchvision.tv_tensors.BoundingBoxes` object, consider using + the transform :func:`~torchvision.transforms.v2.ClampBoundingBoxes` instead. + + Args: + boxes (Tensor[N, 4]): boxes in ``(x1, y1, x2, y2)`` format + with ``0 <= x1 < x2`` and ``0 <= y1 < y2``. + size (Tuple[height, width]): size of the image + + Returns: + Tensor[N, 4]: clipped boxes + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(clip_boxes_to_image) + dim = boxes.dim() + boxes_x = boxes[..., 0::2] + boxes_y = boxes[..., 1::2] + height, width = size + + if torchvision._is_tracing(): + boxes_x = torch.max(boxes_x, torch.tensor(0, dtype=boxes.dtype, device=boxes.device)) + boxes_x = torch.min(boxes_x, torch.tensor(width, dtype=boxes.dtype, device=boxes.device)) + boxes_y = torch.max(boxes_y, torch.tensor(0, dtype=boxes.dtype, device=boxes.device)) + boxes_y = torch.min(boxes_y, torch.tensor(height, dtype=boxes.dtype, device=boxes.device)) + else: + boxes_x = boxes_x.clamp(min=0, max=width) + boxes_y = boxes_y.clamp(min=0, max=height) + + clipped_boxes = torch.stack((boxes_x, boxes_y), dim=dim) + return clipped_boxes.reshape(boxes.shape) + + +def box_convert(boxes: Tensor, in_fmt: str, out_fmt: str) -> Tensor: + """ + Converts :class:`torch.Tensor` boxes from a given ``in_fmt`` to ``out_fmt``. + + .. note:: + For converting a :class:`torch.Tensor` or a :class:`~torchvision.tv_tensors.BoundingBoxes` object + between different formats, + consider using :func:`~torchvision.transforms.v2.functional.convert_bounding_box_format` instead. + Or see the corresponding transform :func:`~torchvision.transforms.v2.ConvertBoundingBoxFormat`. + + Supported ``in_fmt`` and ``out_fmt`` strings are: + + ``'xyxy'``: boxes are represented via corners, x1, y1 being top left and x2, y2 being bottom right. + This is the format that torchvision utilities expect. + + ``'xywh'``: boxes are represented via corner, width and height, x1, y2 being top left, w, h being width and height. + + ``'cxcywh'``: boxes are represented via centre, width and height, cx, cy being center of box, w, h + being width and height. + + Args: + boxes (Tensor[N, 4]): boxes which will be converted. + in_fmt (str): Input format of given boxes. Supported formats are ['xyxy', 'xywh', 'cxcywh']. + out_fmt (str): Output format of given boxes. Supported formats are ['xyxy', 'xywh', 'cxcywh'] + + Returns: + Tensor[N, 4]: Boxes into converted format. + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(box_convert) + allowed_fmts = ("xyxy", "xywh", "cxcywh") + if in_fmt not in allowed_fmts or out_fmt not in allowed_fmts: + raise ValueError("Unsupported Bounding Box Conversions for given in_fmt and out_fmt") + + if in_fmt == out_fmt: + return boxes.clone() + + if in_fmt != "xyxy" and out_fmt != "xyxy": + # convert to xyxy and change in_fmt xyxy + if in_fmt == "xywh": + boxes = _box_xywh_to_xyxy(boxes) + elif in_fmt == "cxcywh": + boxes = _box_cxcywh_to_xyxy(boxes) + in_fmt = "xyxy" + + if in_fmt == "xyxy": + if out_fmt == "xywh": + boxes = _box_xyxy_to_xywh(boxes) + elif out_fmt == "cxcywh": + boxes = _box_xyxy_to_cxcywh(boxes) + elif out_fmt == "xyxy": + if in_fmt == "xywh": + boxes = _box_xywh_to_xyxy(boxes) + elif in_fmt == "cxcywh": + boxes = _box_cxcywh_to_xyxy(boxes) + return boxes + + +def box_area(boxes: Tensor) -> Tensor: + """ + Computes the area of a set of bounding boxes, which are specified by their + (x1, y1, x2, y2) coordinates. + + Args: + boxes (Tensor[N, 4]): boxes for which the area will be computed. They + are expected to be in (x1, y1, x2, y2) format with + ``0 <= x1 < x2`` and ``0 <= y1 < y2``. + + Returns: + Tensor[N]: the area for each box + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(box_area) + boxes = _upcast(boxes) + return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1]) + + +# implementation from https://github.com/kuangliu/torchcv/blob/master/torchcv/utils/box.py +# with slight modifications +def _box_inter_union(boxes1: Tensor, boxes2: Tensor) -> Tuple[Tensor, Tensor]: + area1 = box_area(boxes1) + area2 = box_area(boxes2) + + lt = torch.max(boxes1[:, None, :2], boxes2[:, :2]) # [N,M,2] + rb = torch.min(boxes1[:, None, 2:], boxes2[:, 2:]) # [N,M,2] + + wh = _upcast(rb - lt).clamp(min=0) # [N,M,2] + inter = wh[:, :, 0] * wh[:, :, 1] # [N,M] + + union = area1[:, None] + area2 - inter + + return inter, union + + +def box_iou(boxes1: Tensor, boxes2: Tensor) -> Tensor: + """ + Return intersection-over-union (Jaccard index) between two sets of boxes. + + Both sets of boxes are expected to be in ``(x1, y1, x2, y2)`` format with + ``0 <= x1 < x2`` and ``0 <= y1 < y2``. + + Args: + boxes1 (Tensor[N, 4]): first set of boxes + boxes2 (Tensor[M, 4]): second set of boxes + + Returns: + Tensor[N, M]: the NxM matrix containing the pairwise IoU values for every element in boxes1 and boxes2 + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(box_iou) + inter, union = _box_inter_union(boxes1, boxes2) + iou = inter / union + return iou + + +# Implementation adapted from https://github.com/facebookresearch/detr/blob/master/util/box_ops.py +def generalized_box_iou(boxes1: Tensor, boxes2: Tensor) -> Tensor: + """ + Return generalized intersection-over-union (Jaccard index) between two sets of boxes. + + Both sets of boxes are expected to be in ``(x1, y1, x2, y2)`` format with + ``0 <= x1 < x2`` and ``0 <= y1 < y2``. + + Args: + boxes1 (Tensor[N, 4]): first set of boxes + boxes2 (Tensor[M, 4]): second set of boxes + + Returns: + Tensor[N, M]: the NxM matrix containing the pairwise generalized IoU values + for every element in boxes1 and boxes2 + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(generalized_box_iou) + + inter, union = _box_inter_union(boxes1, boxes2) + iou = inter / union + + lti = torch.min(boxes1[:, None, :2], boxes2[:, :2]) + rbi = torch.max(boxes1[:, None, 2:], boxes2[:, 2:]) + + whi = _upcast(rbi - lti).clamp(min=0) # [N,M,2] + areai = whi[:, :, 0] * whi[:, :, 1] + + return iou - (areai - union) / areai + + +def complete_box_iou(boxes1: Tensor, boxes2: Tensor, eps: float = 1e-7) -> Tensor: + """ + Return complete intersection-over-union (Jaccard index) between two sets of boxes. + Both sets of boxes are expected to be in ``(x1, y1, x2, y2)`` format with + ``0 <= x1 < x2`` and ``0 <= y1 < y2``. + Args: + boxes1 (Tensor[N, 4]): first set of boxes + boxes2 (Tensor[M, 4]): second set of boxes + eps (float, optional): small number to prevent division by zero. Default: 1e-7 + Returns: + Tensor[N, M]: the NxM matrix containing the pairwise complete IoU values + for every element in boxes1 and boxes2 + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(complete_box_iou) + + boxes1 = _upcast(boxes1) + boxes2 = _upcast(boxes2) + + diou, iou = _box_diou_iou(boxes1, boxes2, eps) + + w_pred = boxes1[:, None, 2] - boxes1[:, None, 0] + h_pred = boxes1[:, None, 3] - boxes1[:, None, 1] + + w_gt = boxes2[:, 2] - boxes2[:, 0] + h_gt = boxes2[:, 3] - boxes2[:, 1] + + v = (4 / (torch.pi**2)) * torch.pow(torch.atan(w_pred / h_pred) - torch.atan(w_gt / h_gt), 2) + with torch.no_grad(): + alpha = v / (1 - iou + v + eps) + return diou - alpha * v + + +def distance_box_iou(boxes1: Tensor, boxes2: Tensor, eps: float = 1e-7) -> Tensor: + """ + Return distance intersection-over-union (Jaccard index) between two sets of boxes. + + Both sets of boxes are expected to be in ``(x1, y1, x2, y2)`` format with + ``0 <= x1 < x2`` and ``0 <= y1 < y2``. + + Args: + boxes1 (Tensor[N, 4]): first set of boxes + boxes2 (Tensor[M, 4]): second set of boxes + eps (float, optional): small number to prevent division by zero. Default: 1e-7 + + Returns: + Tensor[N, M]: the NxM matrix containing the pairwise distance IoU values + for every element in boxes1 and boxes2 + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(distance_box_iou) + + boxes1 = _upcast(boxes1) + boxes2 = _upcast(boxes2) + diou, _ = _box_diou_iou(boxes1, boxes2, eps=eps) + return diou + + +def _box_diou_iou(boxes1: Tensor, boxes2: Tensor, eps: float = 1e-7) -> Tuple[Tensor, Tensor]: + + iou = box_iou(boxes1, boxes2) + lti = torch.min(boxes1[:, None, :2], boxes2[:, :2]) + rbi = torch.max(boxes1[:, None, 2:], boxes2[:, 2:]) + whi = _upcast(rbi - lti).clamp(min=0) # [N,M,2] + diagonal_distance_squared = (whi[:, :, 0] ** 2) + (whi[:, :, 1] ** 2) + eps + # centers of boxes + x_p = (boxes1[:, 0] + boxes1[:, 2]) / 2 + y_p = (boxes1[:, 1] + boxes1[:, 3]) / 2 + x_g = (boxes2[:, 0] + boxes2[:, 2]) / 2 + y_g = (boxes2[:, 1] + boxes2[:, 3]) / 2 + # The distance between boxes' centers squared. + centers_distance_squared = (_upcast((x_p[:, None] - x_g[None, :])) ** 2) + ( + _upcast((y_p[:, None] - y_g[None, :])) ** 2 + ) + # The distance IoU is the IoU penalized by a normalized + # distance between boxes' centers squared. + return iou - (centers_distance_squared / diagonal_distance_squared), iou + + +def masks_to_boxes(masks: torch.Tensor) -> torch.Tensor: + """ + Compute the bounding boxes around the provided masks. + + Returns a [N, 4] tensor containing bounding boxes. The boxes are in ``(x1, y1, x2, y2)`` format with + ``0 <= x1 < x2`` and ``0 <= y1 < y2``. + + Args: + masks (Tensor[N, H, W]): masks to transform where N is the number of masks + and (H, W) are the spatial dimensions. + + Returns: + Tensor[N, 4]: bounding boxes + """ + if not torch.jit.is_scripting() and not torch.jit.is_tracing(): + _log_api_usage_once(masks_to_boxes) + if masks.numel() == 0: + return torch.zeros((0, 4), device=masks.device, dtype=torch.float) + + n = masks.shape[0] + + bounding_boxes = torch.zeros((n, 4), device=masks.device, dtype=torch.float) + + for index, mask in enumerate(masks): + y, x = torch.where(mask != 0) + + bounding_boxes[index, 0] = torch.min(x) + bounding_boxes[index, 1] = torch.min(y) + bounding_boxes[index, 2] = torch.max(x) + bounding_boxes[index, 3] = torch.max(y) + + return bounding_boxes diff --git a/shared/package-files/9f/9f5b9ca3ff2dc7bd2b9308d417f1698893f236677f3b41694144fa029db75506/blob b/shared/package-files/9f/9f5b9ca3ff2dc7bd2b9308d417f1698893f236677f3b41694144fa029db75506/blob new file mode 100644 index 0000000000000000000000000000000000000000..86c21f00bb8d00bcd14a5c0cff73a25ecb93e517 --- /dev/null +++ b/shared/package-files/9f/9f5b9ca3ff2dc7bd2b9308d417f1698893f236677f3b41694144fa029db75506/blob @@ -0,0 +1,467 @@ +"Test squeezer, coverage 95%" + +from textwrap import dedent +from tkinter import Text, Tk +import unittest +from unittest.mock import Mock, NonCallableMagicMock, patch, sentinel, ANY +from test.support import requires + +from idlelib.config import idleConf +from idlelib.percolator import Percolator +from idlelib.squeezer import count_lines_with_wrapping, ExpandingButton, \ + Squeezer +from idlelib import macosx +from idlelib.textview import view_text +from idlelib.tooltip import Hovertip + +SENTINEL_VALUE = sentinel.SENTINEL_VALUE + + +def get_test_tk_root(test_instance): + """Helper for tests: Create a root Tk object.""" + requires('gui') + root = Tk() + root.withdraw() + + def cleanup_root(): + root.update_idletasks() + root.destroy() + test_instance.addCleanup(cleanup_root) + + return root + + +class CountLinesTest(unittest.TestCase): + """Tests for the count_lines_with_wrapping function.""" + def check(self, expected, text, linewidth): + return self.assertEqual( + expected, + count_lines_with_wrapping(text, linewidth), + ) + + def test_count_empty(self): + """Test with an empty string.""" + self.assertEqual(count_lines_with_wrapping(""), 0) + + def test_count_begins_with_empty_line(self): + """Test with a string which begins with a newline.""" + self.assertEqual(count_lines_with_wrapping("\ntext"), 2) + + def test_count_ends_with_empty_line(self): + """Test with a string which ends with a newline.""" + self.assertEqual(count_lines_with_wrapping("text\n"), 1) + + def test_count_several_lines(self): + """Test with several lines of text.""" + self.assertEqual(count_lines_with_wrapping("1\n2\n3\n"), 3) + + def test_empty_lines(self): + self.check(expected=1, text='\n', linewidth=80) + self.check(expected=2, text='\n\n', linewidth=80) + self.check(expected=10, text='\n' * 10, linewidth=80) + + def test_long_line(self): + self.check(expected=3, text='a' * 200, linewidth=80) + self.check(expected=3, text='a' * 200 + '\n', linewidth=80) + + def test_several_lines_different_lengths(self): + text = dedent("""\ + 13 characters + 43 is the number of characters on this line + + 7 chars + 13 characters""") + self.check(expected=5, text=text, linewidth=80) + self.check(expected=5, text=text + '\n', linewidth=80) + self.check(expected=6, text=text, linewidth=40) + self.check(expected=7, text=text, linewidth=20) + self.check(expected=11, text=text, linewidth=10) + + +class SqueezerTest(unittest.TestCase): + """Tests for the Squeezer class.""" + def make_mock_editor_window(self, with_text_widget=False): + """Create a mock EditorWindow instance.""" + editwin = NonCallableMagicMock() + editwin.width = 80 + + if with_text_widget: + editwin.root = get_test_tk_root(self) + text_widget = self.make_text_widget(root=editwin.root) + editwin.text = editwin.per.bottom = text_widget + + return editwin + + def make_squeezer_instance(self, editor_window=None): + """Create an actual Squeezer instance with a mock EditorWindow.""" + if editor_window is None: + editor_window = self.make_mock_editor_window() + squeezer = Squeezer(editor_window) + return squeezer + + def make_text_widget(self, root=None): + if root is None: + root = get_test_tk_root(self) + text_widget = Text(root) + text_widget["font"] = ('Courier', 10) + text_widget.mark_set("iomark", "1.0") + return text_widget + + def set_idleconf_option_with_cleanup(self, configType, section, option, value): + prev_val = idleConf.GetOption(configType, section, option) + idleConf.SetOption(configType, section, option, value) + self.addCleanup(idleConf.SetOption, + configType, section, option, prev_val) + + def test_count_lines(self): + """Test Squeezer.count_lines() with various inputs.""" + editwin = self.make_mock_editor_window() + squeezer = self.make_squeezer_instance(editwin) + + for text_code, line_width, expected in [ + (r"'\n'", 80, 1), + (r"'\n' * 3", 80, 3), + (r"'a' * 40 + '\n'", 80, 1), + (r"'a' * 80 + '\n'", 80, 1), + (r"'a' * 200 + '\n'", 80, 3), + (r"'aa\t' * 20", 80, 2), + (r"'aa\t' * 21", 80, 3), + (r"'aa\t' * 20", 40, 4), + ]: + with self.subTest(text_code=text_code, + line_width=line_width, + expected=expected): + text = eval(text_code) + with patch.object(editwin, 'width', line_width): + self.assertEqual(squeezer.count_lines(text), expected) + + def test_init(self): + """Test the creation of Squeezer instances.""" + editwin = self.make_mock_editor_window() + squeezer = self.make_squeezer_instance(editwin) + self.assertIs(squeezer.editwin, editwin) + self.assertEqual(squeezer.expandingbuttons, []) + + def test_write_no_tags(self): + """Test Squeezer's overriding of the EditorWindow's write() method.""" + editwin = self.make_mock_editor_window() + for text in ['', 'TEXT', 'LONG TEXT' * 1000, 'MANY_LINES\n' * 100]: + editwin.write = orig_write = Mock(return_value=SENTINEL_VALUE) + squeezer = self.make_squeezer_instance(editwin) + + self.assertEqual(squeezer.editwin.write(text, ()), SENTINEL_VALUE) + self.assertEqual(orig_write.call_count, 1) + orig_write.assert_called_with(text, ()) + self.assertEqual(len(squeezer.expandingbuttons), 0) + + def test_write_not_stdout(self): + """Test Squeezer's overriding of the EditorWindow's write() method.""" + for text in ['', 'TEXT', 'LONG TEXT' * 1000, 'MANY_LINES\n' * 100]: + editwin = self.make_mock_editor_window() + editwin.write.return_value = SENTINEL_VALUE + orig_write = editwin.write + squeezer = self.make_squeezer_instance(editwin) + + self.assertEqual(squeezer.editwin.write(text, "stderr"), + SENTINEL_VALUE) + self.assertEqual(orig_write.call_count, 1) + orig_write.assert_called_with(text, "stderr") + self.assertEqual(len(squeezer.expandingbuttons), 0) + + def test_write_stdout(self): + """Test Squeezer's overriding of the EditorWindow's write() method.""" + requires('gui') + editwin = self.make_mock_editor_window() + + for text in ['', 'TEXT']: + editwin.write = orig_write = Mock(return_value=SENTINEL_VALUE) + squeezer = self.make_squeezer_instance(editwin) + squeezer.auto_squeeze_min_lines = 50 + + self.assertEqual(squeezer.editwin.write(text, "stdout"), + SENTINEL_VALUE) + self.assertEqual(orig_write.call_count, 1) + orig_write.assert_called_with(text, "stdout") + self.assertEqual(len(squeezer.expandingbuttons), 0) + + for text in ['LONG TEXT' * 1000, 'MANY_LINES\n' * 100]: + editwin.write = orig_write = Mock(return_value=SENTINEL_VALUE) + squeezer = self.make_squeezer_instance(editwin) + squeezer.auto_squeeze_min_lines = 50 + + self.assertEqual(squeezer.editwin.write(text, "stdout"), None) + self.assertEqual(orig_write.call_count, 0) + self.assertEqual(len(squeezer.expandingbuttons), 1) + + def test_auto_squeeze(self): + """Test that the auto-squeezing creates an ExpandingButton properly.""" + editwin = self.make_mock_editor_window(with_text_widget=True) + text_widget = editwin.text + squeezer = self.make_squeezer_instance(editwin) + squeezer.auto_squeeze_min_lines = 5 + squeezer.count_lines = Mock(return_value=6) + + editwin.write('TEXT\n'*6, "stdout") + self.assertEqual(text_widget.get('1.0', 'end'), '\n') + self.assertEqual(len(squeezer.expandingbuttons), 1) + + def test_squeeze_current_text(self): + """Test the squeeze_current_text method.""" + # Squeezing text should work for both stdout and stderr. + for tag_name in ["stdout", "stderr"]: + editwin = self.make_mock_editor_window(with_text_widget=True) + text_widget = editwin.text + squeezer = self.make_squeezer_instance(editwin) + squeezer.count_lines = Mock(return_value=6) + + # Prepare some text in the Text widget. + text_widget.insert("1.0", "SOME\nTEXT\n", tag_name) + text_widget.mark_set("insert", "1.0") + self.assertEqual(text_widget.get('1.0', 'end'), 'SOME\nTEXT\n\n') + + self.assertEqual(len(squeezer.expandingbuttons), 0) + + # Test squeezing the current text. + retval = squeezer.squeeze_current_text() + self.assertEqual(retval, "break") + self.assertEqual(text_widget.get('1.0', 'end'), '\n\n') + self.assertEqual(len(squeezer.expandingbuttons), 1) + self.assertEqual(squeezer.expandingbuttons[0].s, 'SOME\nTEXT') + + # Test that expanding the squeezed text works and afterwards + # the Text widget contains the original text. + squeezer.expandingbuttons[0].expand() + self.assertEqual(text_widget.get('1.0', 'end'), 'SOME\nTEXT\n\n') + self.assertEqual(len(squeezer.expandingbuttons), 0) + + def test_squeeze_current_text_no_allowed_tags(self): + """Test that the event doesn't squeeze text without a relevant tag.""" + editwin = self.make_mock_editor_window(with_text_widget=True) + text_widget = editwin.text + squeezer = self.make_squeezer_instance(editwin) + squeezer.count_lines = Mock(return_value=6) + + # Prepare some text in the Text widget. + text_widget.insert("1.0", "SOME\nTEXT\n", "TAG") + text_widget.mark_set("insert", "1.0") + self.assertEqual(text_widget.get('1.0', 'end'), 'SOME\nTEXT\n\n') + + self.assertEqual(len(squeezer.expandingbuttons), 0) + + # Test squeezing the current text. + retval = squeezer.squeeze_current_text() + self.assertEqual(retval, "break") + self.assertEqual(text_widget.get('1.0', 'end'), 'SOME\nTEXT\n\n') + self.assertEqual(len(squeezer.expandingbuttons), 0) + + def test_squeeze_text_before_existing_squeezed_text(self): + """Test squeezing text before existing squeezed text.""" + editwin = self.make_mock_editor_window(with_text_widget=True) + text_widget = editwin.text + squeezer = self.make_squeezer_instance(editwin) + squeezer.count_lines = Mock(return_value=6) + + # Prepare some text in the Text widget and squeeze it. + text_widget.insert("1.0", "SOME\nTEXT\n", "stdout") + text_widget.mark_set("insert", "1.0") + squeezer.squeeze_current_text() + self.assertEqual(len(squeezer.expandingbuttons), 1) + + # Test squeezing the current text. + text_widget.insert("1.0", "MORE\nSTUFF\n", "stdout") + text_widget.mark_set("insert", "1.0") + retval = squeezer.squeeze_current_text() + self.assertEqual(retval, "break") + self.assertEqual(text_widget.get('1.0', 'end'), '\n\n\n') + self.assertEqual(len(squeezer.expandingbuttons), 2) + self.assertTrue(text_widget.compare( + squeezer.expandingbuttons[0], + '<', + squeezer.expandingbuttons[1], + )) + + def test_reload(self): + """Test the reload() class-method.""" + editwin = self.make_mock_editor_window(with_text_widget=True) + squeezer = self.make_squeezer_instance(editwin) + + orig_auto_squeeze_min_lines = squeezer.auto_squeeze_min_lines + + # Increase auto-squeeze-min-lines. + new_auto_squeeze_min_lines = orig_auto_squeeze_min_lines + 10 + self.set_idleconf_option_with_cleanup( + 'main', 'PyShell', 'auto-squeeze-min-lines', + str(new_auto_squeeze_min_lines)) + + Squeezer.reload() + self.assertEqual(squeezer.auto_squeeze_min_lines, + new_auto_squeeze_min_lines) + + def test_reload_no_squeezer_instances(self): + """Test that Squeezer.reload() runs without any instances existing.""" + Squeezer.reload() + + +class ExpandingButtonTest(unittest.TestCase): + """Tests for the ExpandingButton class.""" + # In these tests the squeezer instance is a mock, but actual tkinter + # Text and Button instances are created. + def make_mock_squeezer(self): + """Helper for tests: Create a mock Squeezer object.""" + root = get_test_tk_root(self) + squeezer = Mock() + squeezer.editwin.text = Text(root) + squeezer.editwin.per = Percolator(squeezer.editwin.text) + self.addCleanup(squeezer.editwin.per.close) + + # Set default values for the configuration settings. + squeezer.auto_squeeze_min_lines = 50 + return squeezer + + @patch('idlelib.squeezer.Hovertip', autospec=Hovertip) + def test_init(self, MockHovertip): + """Test the simplest creation of an ExpandingButton.""" + squeezer = self.make_mock_squeezer() + text_widget = squeezer.editwin.text + + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + self.assertEqual(expandingbutton.s, 'TEXT') + + # Check that the underlying tkinter.Button is properly configured. + self.assertEqual(expandingbutton.master, text_widget) + self.assertTrue('50 lines' in expandingbutton.cget('text')) + + # Check that the text widget still contains no text. + self.assertEqual(text_widget.get('1.0', 'end'), '\n') + + # Check that the mouse events are bound. + self.assertIn('', expandingbutton.bind()) + right_button_code = '' % ('2' if macosx.isAquaTk() else '3') + self.assertIn(right_button_code, expandingbutton.bind()) + + # Check that ToolTip was called once, with appropriate values. + self.assertEqual(MockHovertip.call_count, 1) + MockHovertip.assert_called_with(expandingbutton, ANY, hover_delay=ANY) + + # Check that 'right-click' appears in the tooltip text. + tooltip_text = MockHovertip.call_args[0][1] + self.assertIn('right-click', tooltip_text.lower()) + + def test_expand(self): + """Test the expand event.""" + squeezer = self.make_mock_squeezer() + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + + # Insert the button into the text widget + # (this is normally done by the Squeezer class). + text_widget = squeezer.editwin.text + text_widget.window_create("1.0", window=expandingbutton) + + # trigger the expand event + retval = expandingbutton.expand(event=Mock()) + self.assertEqual(retval, None) + + # Check that the text was inserted into the text widget. + self.assertEqual(text_widget.get('1.0', 'end'), 'TEXT\n') + + # Check that the 'TAGS' tag was set on the inserted text. + text_end_index = text_widget.index('end-1c') + self.assertEqual(text_widget.get('1.0', text_end_index), 'TEXT') + self.assertEqual(text_widget.tag_nextrange('TAGS', '1.0'), + ('1.0', text_end_index)) + + # Check that the button removed itself from squeezer.expandingbuttons. + self.assertEqual(squeezer.expandingbuttons.remove.call_count, 1) + squeezer.expandingbuttons.remove.assert_called_with(expandingbutton) + + def test_expand_dangerous_oupput(self): + """Test that expanding very long output asks user for confirmation.""" + squeezer = self.make_mock_squeezer() + text = 'a' * 10**5 + expandingbutton = ExpandingButton(text, 'TAGS', 50, squeezer) + expandingbutton.set_is_dangerous() + self.assertTrue(expandingbutton.is_dangerous) + + # Insert the button into the text widget + # (this is normally done by the Squeezer class). + text_widget = expandingbutton.text + text_widget.window_create("1.0", window=expandingbutton) + + # Patch the message box module to always return False. + with patch('idlelib.squeezer.messagebox') as mock_msgbox: + mock_msgbox.askokcancel.return_value = False + mock_msgbox.askyesno.return_value = False + # Trigger the expand event. + retval = expandingbutton.expand(event=Mock()) + + # Check that the event chain was broken and no text was inserted. + self.assertEqual(retval, 'break') + self.assertEqual(expandingbutton.text.get('1.0', 'end-1c'), '') + + # Patch the message box module to always return True. + with patch('idlelib.squeezer.messagebox') as mock_msgbox: + mock_msgbox.askokcancel.return_value = True + mock_msgbox.askyesno.return_value = True + # Trigger the expand event. + retval = expandingbutton.expand(event=Mock()) + + # Check that the event chain wasn't broken and the text was inserted. + self.assertEqual(retval, None) + self.assertEqual(expandingbutton.text.get('1.0', 'end-1c'), text) + + def test_copy(self): + """Test the copy event.""" + # Testing with the actual clipboard proved problematic, so this + # test replaces the clipboard manipulation functions with mocks + # and checks that they are called appropriately. + squeezer = self.make_mock_squeezer() + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + expandingbutton.clipboard_clear = Mock() + expandingbutton.clipboard_append = Mock() + + # Trigger the copy event. + retval = expandingbutton.copy(event=Mock()) + self.assertEqual(retval, None) + + # Vheck that the expanding button called clipboard_clear() and + # clipboard_append('TEXT') once each. + self.assertEqual(expandingbutton.clipboard_clear.call_count, 1) + self.assertEqual(expandingbutton.clipboard_append.call_count, 1) + expandingbutton.clipboard_append.assert_called_with('TEXT') + + def test_view(self): + """Test the view event.""" + squeezer = self.make_mock_squeezer() + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + expandingbutton.selection_own = Mock() + + with patch('idlelib.squeezer.view_text', autospec=view_text)\ + as mock_view_text: + # Trigger the view event. + expandingbutton.view(event=Mock()) + + # Check that the expanding button called view_text. + self.assertEqual(mock_view_text.call_count, 1) + + # Check that the proper text was passed. + self.assertEqual(mock_view_text.call_args[0][2], 'TEXT') + + def test_rmenu(self): + """Test the context menu.""" + squeezer = self.make_mock_squeezer() + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + with patch('tkinter.Menu') as mock_Menu: + mock_menu = Mock() + mock_Menu.return_value = mock_menu + mock_event = Mock() + mock_event.x = 10 + mock_event.y = 10 + expandingbutton.context_menu_event(event=mock_event) + self.assertEqual(mock_menu.add_command.call_count, + len(expandingbutton.rmenu_specs)) + for label, *data in expandingbutton.rmenu_specs: + mock_menu.add_command.assert_any_call(label=label, command=ANY) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/shared/package-files/9f/9f5cfcdd3e02f983c8da55992c6fe988ec9279cd4374f3e1682bb7afdfc13b68/blob b/shared/package-files/9f/9f5cfcdd3e02f983c8da55992c6fe988ec9279cd4374f3e1682bb7afdfc13b68/blob new file mode 100644 index 0000000000000000000000000000000000000000..5f0225b05923ef753d68583293662a1789c525cb --- /dev/null +++ b/shared/package-files/9f/9f5cfcdd3e02f983c8da55992c6fe988ec9279cd4374f3e1682bb7afdfc13b68/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor polygamma(int64_t n, const at::Tensor & self); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9f/9f5ec77361b3a1d490b24dfa17f3a1aca1ee35d4dac1c6f52b991590427b3dbc/blob b/shared/package-files/9f/9f5ec77361b3a1d490b24dfa17f3a1aca1ee35d4dac1c6f52b991590427b3dbc/blob new file mode 100644 index 0000000000000000000000000000000000000000..8600211a8c3bfdc8df17740bfd4ea54d6b490e86 --- /dev/null +++ b/shared/package-files/9f/9f5ec77361b3a1d490b24dfa17f3a1aca1ee35d4dac1c6f52b991590427b3dbc/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor argmax(const at::Tensor & self, c10::optional dim=c10::nullopt, bool keepdim=false); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9f/9f660a656fb9858ec80904b01140592188767a0f59a137c3e785d177d3a5343a/blob b/shared/package-files/9f/9f660a656fb9858ec80904b01140592188767a0f59a137c3e785d177d3a5343a/blob new file mode 100644 index 0000000000000000000000000000000000000000..a87a97764845dc5af5287a59d8003d81625cc5c5 --- /dev/null +++ b/shared/package-files/9f/9f660a656fb9858ec80904b01140592188767a0f59a137c3e785d177d3a5343a/blob @@ -0,0 +1,75 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +#pragma once + +namespace arrow { + +#define ARROW_GENERATE_FOR_ALL_INTEGER_TYPES(ACTION) \ + ACTION(Int8); \ + ACTION(UInt8); \ + ACTION(Int16); \ + ACTION(UInt16); \ + ACTION(Int32); \ + ACTION(UInt32); \ + ACTION(Int64); \ + ACTION(UInt64) + +#define ARROW_GENERATE_FOR_ALL_NUMERIC_TYPES(ACTION) \ + ARROW_GENERATE_FOR_ALL_INTEGER_TYPES(ACTION); \ + ACTION(HalfFloat); \ + ACTION(Float); \ + ACTION(Double) + +#define ARROW_GENERATE_FOR_ALL_TYPES(ACTION) \ + ACTION(Null); \ + ACTION(Boolean); \ + ARROW_GENERATE_FOR_ALL_NUMERIC_TYPES(ACTION); \ + ACTION(String); \ + ACTION(StringView); \ + ACTION(Binary); \ + ACTION(BinaryView); \ + ACTION(LargeString); \ + ACTION(LargeBinary); \ + ACTION(FixedSizeBinary); \ + ACTION(Duration); \ + ACTION(Date32); \ + ACTION(Date64); \ + ACTION(Timestamp); \ + ACTION(Time32); \ + ACTION(Time64); \ + ACTION(MonthDayNanoInterval); \ + ACTION(MonthInterval); \ + ACTION(DayTimeInterval); \ + ACTION(Decimal32); \ + ACTION(Decimal64); \ + ACTION(Decimal128); \ + ACTION(Decimal256); \ + ACTION(List); \ + ACTION(LargeList); \ + ACTION(ListView); \ + ACTION(LargeListView); \ + ACTION(Map); \ + ACTION(FixedSizeList); \ + ACTION(Struct); \ + ACTION(SparseUnion); \ + ACTION(DenseUnion); \ + ACTION(Dictionary); \ + ACTION(RunEndEncoded); \ + ACTION(Extension) + +} // namespace arrow diff --git a/shared/package-files/9f/9f69a89467304bdb44ecba3ae5c96f26a4f29f298e9ada97ae7e6340f2a94db4/blob b/shared/package-files/9f/9f69a89467304bdb44ecba3ae5c96f26a4f29f298e9ada97ae7e6340f2a94db4/blob new file mode 100644 index 0000000000000000000000000000000000000000..2efc4ea93f7534cbca6ab41a4f9ec1550a7ddce1 --- /dev/null +++ b/shared/package-files/9f/9f69a89467304bdb44ecba3ae5c96f26a4f29f298e9ada97ae7e6340f2a94db4/blob @@ -0,0 +1,121 @@ +""" +Generators for random intersection graphs. +""" +import networkx as nx +from networkx.utils import py_random_state + +__all__ = [ + "uniform_random_intersection_graph", + "k_random_intersection_graph", + "general_random_intersection_graph", +] + + +@py_random_state(3) +def uniform_random_intersection_graph(n, m, p, seed=None): + """Returns a uniform random intersection graph. + + Parameters + ---------- + n : int + The number of nodes in the first bipartite set (nodes) + m : int + The number of nodes in the second bipartite set (attributes) + p : float + Probability of connecting nodes between bipartite sets + seed : integer, random_state, or None (default) + Indicator of random number generation state. + See :ref:`Randomness`. + + See Also + -------- + gnp_random_graph + + References + ---------- + .. [1] K.B. Singer-Cohen, Random Intersection Graphs, 1995, + PhD thesis, Johns Hopkins University + .. [2] Fill, J. A., Scheinerman, E. R., and Singer-Cohen, K. B., + Random intersection graphs when m = !(n): + An equivalence theorem relating the evolution of the g(n, m, p) + and g(n, p) models. Random Struct. Algorithms 16, 2 (2000), 156–176. + """ + from networkx.algorithms import bipartite + + G = bipartite.random_graph(n, m, p, seed) + return nx.projected_graph(G, range(n)) + + +@py_random_state(3) +def k_random_intersection_graph(n, m, k, seed=None): + """Returns a intersection graph with randomly chosen attribute sets for + each node that are of equal size (k). + + Parameters + ---------- + n : int + The number of nodes in the first bipartite set (nodes) + m : int + The number of nodes in the second bipartite set (attributes) + k : float + Size of attribute set to assign to each node. + seed : integer, random_state, or None (default) + Indicator of random number generation state. + See :ref:`Randomness`. + + See Also + -------- + gnp_random_graph, uniform_random_intersection_graph + + References + ---------- + .. [1] Godehardt, E., and Jaworski, J. + Two models of random intersection graphs and their applications. + Electronic Notes in Discrete Mathematics 10 (2001), 129--132. + """ + G = nx.empty_graph(n + m) + mset = range(n, n + m) + for v in range(n): + targets = seed.sample(mset, k) + G.add_edges_from(zip([v] * len(targets), targets)) + return nx.projected_graph(G, range(n)) + + +@py_random_state(3) +def general_random_intersection_graph(n, m, p, seed=None): + """Returns a random intersection graph with independent probabilities + for connections between node and attribute sets. + + Parameters + ---------- + n : int + The number of nodes in the first bipartite set (nodes) + m : int + The number of nodes in the second bipartite set (attributes) + p : list of floats of length m + Probabilities for connecting nodes to each attribute + seed : integer, random_state, or None (default) + Indicator of random number generation state. + See :ref:`Randomness`. + + See Also + -------- + gnp_random_graph, uniform_random_intersection_graph + + References + ---------- + .. [1] Nikoletseas, S. E., Raptopoulos, C., and Spirakis, P. G. + The existence and efficient construction of large independent sets + in general random intersection graphs. In ICALP (2004), J. D´ıaz, + J. Karhum¨aki, A. Lepist¨o, and D. Sannella, Eds., vol. 3142 + of Lecture Notes in Computer Science, Springer, pp. 1029–1040. + """ + if len(p) != m: + raise ValueError("Probability list p must have m elements.") + G = nx.empty_graph(n + m) + mset = range(n, n + m) + for u in range(n): + for v, q in zip(mset, p): + if seed.random() < q: + G.add_edge(u, v) + return nx.projected_graph(G, range(n)) diff --git a/shared/package-files/9f/9f6b68a270571d8159727db0919ede365d7973cd7a928b8c88da4db938c8292a/blob b/shared/package-files/9f/9f6b68a270571d8159727db0919ede365d7973cd7a928b8c88da4db938c8292a/blob new file mode 100644 index 0000000000000000000000000000000000000000..72b2e45cbcfb2ec6eaed30c04198920195239780 --- /dev/null +++ b/shared/package-files/9f/9f6b68a270571d8159727db0919ede365d7973cd7a928b8c88da4db938c8292a/blob @@ -0,0 +1,66 @@ +from distutils import log +import distutils.command.install_scripts as orig +import os +import sys + +from .._path import ensure_directory + + +class install_scripts(orig.install_scripts): + """Do normal script install, plus any egg_info wrapper scripts""" + + def initialize_options(self): + orig.install_scripts.initialize_options(self) + self.no_ep = False + + def run(self): + self.run_command("egg_info") + if self.distribution.scripts: + orig.install_scripts.run(self) # run first to set up self.outfiles + else: + self.outfiles = [] + if self.no_ep: + # don't install entry point scripts into .egg file! + return + self._install_ep_scripts() + + def _install_ep_scripts(self): + # Delay import side-effects + from pkg_resources import Distribution, PathMetadata + from . import easy_install as ei + + ei_cmd = self.get_finalized_command("egg_info") + dist = Distribution( + ei_cmd.egg_base, + PathMetadata(ei_cmd.egg_base, ei_cmd.egg_info), + ei_cmd.egg_name, + ei_cmd.egg_version, + ) + bs_cmd = self.get_finalized_command('build_scripts') + exec_param = getattr(bs_cmd, 'executable', None) + writer = ei.ScriptWriter + if exec_param == sys.executable: + # In case the path to the Python executable contains a space, wrap + # it so it's not split up. + exec_param = [exec_param] + # resolve the writer to the environment + writer = writer.best() + cmd = writer.command_spec_class.best().from_param(exec_param) + for args in writer.get_args(dist, cmd.as_header()): + self.write_script(*args) + + def write_script(self, script_name, contents, mode="t", *ignored): + """Write an executable file to the scripts directory""" + from setuptools.command.easy_install import chmod, current_umask + + log.info("Installing %s script to %s", script_name, self.install_dir) + target = os.path.join(self.install_dir, script_name) + self.outfiles.append(target) + + mask = current_umask() + if not self.dry_run: + ensure_directory(target) + f = open(target, "w" + mode) + f.write(contents) + f.close() + chmod(target, 0o777 - mask) diff --git a/shared/package-files/9f/9f6c87d05aef087a82cc4465310c8cd3f38327be6eafa43bd81fb98c4f3d088c/blob b/shared/package-files/9f/9f6c87d05aef087a82cc4465310c8cd3f38327be6eafa43bd81fb98c4f3d088c/blob new file mode 100644 index 0000000000000000000000000000000000000000..45cfb7f5af7d25ec35a5254cfcb2c97107d41701 --- /dev/null +++ b/shared/package-files/9f/9f6c87d05aef087a82cc4465310c8cd3f38327be6eafa43bd81fb98c4f3d088c/blob @@ -0,0 +1,20191 @@ +mdvis,lncoins,idp,lpi,fmde,physlm,disea,hlthg,hlthf,hlthp +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +6,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,0,1,6.109248,0,0,13.73189,1,0,0 +0,0,1,6.109248,0,0,13.73189,1,0,0 +0,0,1,6.109248,0,0,13.73189,1,0,0 +0,0,1,6.109248,0,0,13.73189,1,0,0 +0,0,1,6.109248,0,0,13.73189,1,0,0 +1,0,1,6.109248,0,1,13,1,0,0 +0,0,1,6.109248,0,1,13,1,0,0 +1,0,1,6.109248,0,1,13,1,0,0 +2,0,1,6.109248,0,1,13,1,0,0 +4,0,1,6.109248,0,1,13,1,0,0 +0,0,1,6.109248,0,0,17.4,1,0,0 +0,0,1,6.109248,0,0,17.4,1,0,0 +0,0,1,6.109248,0,0,17.4,1,0,0 +0,0,1,6.109248,0,0,17.4,1,0,0 +0,0,1,6.109248,0,0,17.4,1,0,0 +0,0,1,0,0,0,4.3,0,0,0 +0,0,1,0,0,0,4.3,0,0,0 +0,0,1,0,0,0,4.3,0,0,0 +0,0,0,6.006353,0,0,13,1,0,0 +0,0,0,6.006353,0,0,13,1,0,0 +0,0,0,6.006353,0,0,13,1,0,0 +1,0,0,6.006353,0,0,4.3,1,0,0 +0,0,0,6.006353,0,0,4.3,1,0,0 +0,0,0,6.006353,0,0,4.3,1,0,0 +0,0,0,6.006353,0,0,13,1,0,0 +0,0,0,6.006353,0,0,13,1,0,0 +0,0,0,6.006353,0,0,13,1,0,0 +1,0,0,6.006353,0,0,13,1,0,0 +0,0,0,6.006353,0,0,13,1,0,0 +7,0,0,6.006353,0,0,13,1,0,0 +1,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +8,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +0,0,0,0,0,0,8.7,0,0,0 +4,4.61512,1,6.802395,0,0,17.4,1,0,0 +5,4.61512,1,6.802395,0,0,17.4,1,0,0 +14,4.61512,1,6.802395,0,0,17.4,1,0,0 +3,4.61512,1,6.802395,0,0,13,1,0,0 +3,4.61512,1,6.802395,0,0,13,1,0,0 +5,4.61512,1,6.802395,0,0,13,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +2,3.258096,0,6.907755,8.294049,0,0,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +2,3.258096,0,6.907755,8.294049,1,26.1,0,0,0 +1,3.258096,0,6.907755,8.294049,1,26.1,0,0,0 +6,3.258096,0,6.907755,8.294049,1,26.1,0,0,0 +2,3.258096,0,6.907755,8.294049,1,26.1,0,0,0 +1,3.258096,0,6.907755,8.294049,1,26.1,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,30.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,30.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,30.4,0,0,0 +15,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +6,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +2,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +4,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +4,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +3,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +21,0,0,0,0,0,13,0,1,0 +15,0,0,0,0,0,13,0,1,0 +20,0,0,0,0,0,13,0,1,0 +20,0,0,0,0,0,13,0,1,0 +17,0,0,0,0,0,13,0,1,0 +7,0,0,0,0,0,17.4,1,0,0 +8,0,0,0,0,0,17.4,1,0,0 +6,0,0,0,0,0,17.4,1,0,0 +15,0,0,0,0,0,17.4,1,0,0 +10,0,0,0,0,0,17.4,1,0,0 +6,3.931826,0,6.683361,7.376508,0,0,1,0,0 +3,3.931826,0,6.683361,7.376508,0,0,1,0,0 +7,3.931826,0,6.683361,7.376508,0,0,1,0,0 +1,3.931826,0,6.683361,7.376508,0,34.8,1,0,0 +1,3.931826,0,6.683361,7.376508,0,34.8,1,0,0 +0,3.931826,0,6.683361,7.376508,0,34.8,1,0,0 +1,3.931826,0,6.683361,7.376508,0,13,0,1,0 +1,3.931826,0,6.683361,7.376508,0,13,0,1,0 +0,3.931826,0,6.683361,7.376508,0,13,0,1,0 +1,4.61512,1,6.907755,0,0,0,1,0,0 +4,4.61512,1,6.907755,0,0,0,1,0,0 +12,4.61512,1,6.907755,0,0,0,1,0,0 +3,4.61512,1,6.907755,0,0,17.4,0,1,0 +2,4.61512,1,6.907755,0,0,17.4,0,1,0 +2,4.61512,1,6.907755,0,0,17.4,0,1,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,8.7,1,0,0 +2,4.61512,1,6.907755,0,0,8.7,1,0,0 +1,4.61512,1,6.907755,0,0,8.7,1,0,0 +3,4.61512,1,6.907755,0,1,13,1,0,0 +1,4.61512,1,6.907755,0,1,13,1,0,0 +4,4.61512,1,6.907755,0,1,13,1,0,0 +20,4.61512,1,6.907755,0,0,21.7,1,0,0 +15,4.61512,1,6.907755,0,0,21.7,1,0,0 +11,4.61512,1,6.907755,0,0,21.7,1,0,0 +69,0,0,6.393591,0,1,13.73189,0,1,0 +58,0,0,6.393591,0,1,13.73189,0,1,0 +63,0,0,6.393591,0,1,13.73189,0,1,0 +2,0,0,6.393591,0,1,13.73189,0,0,0 +3,0,0,6.393591,0,1,13.73189,0,0,0 +2,0,0,6.393591,0,1,13.73189,0,0,0 +11,0,0,0,0,0,13.73189,0,0,0 +9,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +8,0,0,0,0,0,13.73189,0,0,0 +6,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +6,0,0,0,0,0,17.4,0,0,0 +10,0,0,0,0,0,17.4,0,0,0 +12,0,0,0,0,0,17.4,0,0,0 +35,0,0,0,0,0,13,0,0,0 +9,0,0,0,0,0,13,0,0,0 +6,0,0,0,0,0,13,0,0,0 +6,0,0,0,0,0,13,0,0,0 +14,0,0,0,0,0,13,0,0,0 +5,4.61512,1,6.907755,0,0,13.73189,1,0,0 +4,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +5,4.61512,1,6.907755,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +16,0,0,0,0,1,21.7,1,0,0 +16,0,0,0,0,1,21.7,1,0,0 +17,0,0,0,0,1,21.7,1,0,0 +0,0,0,0,0,0,13,0,0,0 +0,0,0,0,0,0,13,0,0,0 +3,0,0,0,0,0,13,0,0,0 +2,0,0,0,0,0,0,0,0,0 +4,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +6,0,0,0,0,0,4.3,1,0,0 +3,0,0,0,0,0,4.3,1,0,0 +3,0,0,0,0,0,4.3,1,0,0 +7,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +7,0,0,0,0,0,0,0,0,0 +8,0,0,0,0,0,26.1,0,0,0 +8,0,0,0,0,0,26.1,0,0,0 +4,0,0,0,0,0,26.1,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +8,0,0,0,0,1,13.73189,1,0,0 +4,0,0,0,0,1,13.73189,1,0,0 +7,0,0,0,0,1,13.73189,1,0,0 +7,0,0,5.446737,0,1,13,1,0,0 +19,0,0,5.446737,0,1,13,1,0,0 +0,0,0,5.446737,0,1,13,1,0,0 +12,0,0,5.446737,0,0,17.4,0,0,0 +7,0,0,5.446737,0,0,17.4,0,0,0 +3,0,0,5.446737,0,0,17.4,0,0,0 +0,0,0,5.446737,0,0,13.73189,0,0,0 +0,0,0,5.446737,0,0,13.73189,0,0,0 +1,0,0,5.446737,0,0,13.73189,0,0,0 +9,0,0,5.446737,0,0,13.73189,0,0,0 +2,0,0,5.446737,0,0,13.73189,0,0,0 +2,0,0,5.446737,0,0,13.73189,0,0,0 +3,0,0,5.446737,0,0,13.73189,0,0,0 +3,0,0,5.446737,0,0,13.73189,0,0,0 +2,0,0,5.446737,0,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13,1,0,0 +2,3.258096,0,6.907755,8.294049,0,26.1,1,0,0 +1,3.258096,0,6.907755,8.294049,0,26.1,1,0,0 +3,3.258096,0,6.907755,8.294049,0,26.1,1,0,0 +4,3.258096,0,6.907755,8.294049,0,26.1,1,0,0 +1,3.258096,0,6.907755,8.294049,0,26.1,1,0,0 +2,4.61512,1,6.907755,0,0,4.3,0,0,0 +2,4.61512,1,6.907755,0,0,4.3,0,0,0 +2,4.61512,1,6.907755,0,0,4.3,0,0,0 +2,4.61512,1,6.907755,0,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +4,4.61512,1,6.907755,0,0,17.4,1,0,0 +3,4.61512,1,6.907755,0,0,17.4,1,0,0 +10,4.61512,1,6.907755,0,0,17.4,1,0,0 +5,4.61512,1,6.907755,0,0,17.4,1,0,0 +11,4.61512,1,6.907755,0,0,17.4,1,0,0 +5,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +3,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +2,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +5,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +7,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +11,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +7,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +1,3.258096,0,6.300786,7.68708,0,13.73189,1,0,0 +2,3.258096,0,6.300786,7.68708,0,13.73189,1,0,0 +4,3.258096,0,6.300786,7.68708,0,13.73189,1,0,0 +0,3.258096,0,6.300786,7.68708,0,13.73189,1,0,0 +0,3.258096,0,6.300786,7.68708,0,13.73189,1,0,0 +1,3.258096,0,6.300786,7.68708,0,13.73189,1,0,0 +0,3.258096,0,6.300786,7.68708,0,13.73189,1,0,0 +0,3.258096,0,6.300786,7.68708,0,13.73189,1,0,0 +0,3.258096,0,6.300786,7.68708,0,13.73189,1,0,0 +4,4.61512,1,6.55108,0,0,17.4,0,0,0 +10,4.61512,1,6.55108,0,0,17.4,0,0,0 +1,4.61512,1,6.55108,0,0,17.4,0,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +1,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +1,4.61512,1,0,0,0,13.73189,1,0,0 +1,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,17.4,0,0,0 +1,4.61512,1,6.907755,0,0,17.4,0,0,0 +3,4.61512,1,6.907755,0,0,17.4,0,0,0 +3,4.61512,1,5.843544,0,0,4.3,0,0,0 +2,4.61512,1,5.843544,0,0,4.3,0,0,0 +1,4.61512,1,5.843544,0,0,4.3,0,0,0 +1,4.61512,1,5.843544,0,0,4.3,0,0,0 +2,4.61512,1,5.843544,0,0,4.3,0,0,0 +0,0,0,0,0,0,17.4,1,0,0 +0,0,0,0,0,0,17.4,1,0,0 +0,0,0,0,0,0,17.4,1,0,0 +3,0,0,0,0,0,17.4,1,0,0 +0,0,0,0,0,0,17.4,1,0,0 +6,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +5,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +11,4.61512,1,6.907755,0,1,8.7,1,0,0 +44,4.61512,1,6.907755,0,1,8.7,1,0,0 +7,4.61512,1,6.907755,0,1,8.7,1,0,0 +1,4.61512,1,6.907755,0,0,13,1,0,0 +1,4.61512,1,6.907755,0,0,13,1,0,0 +3,4.61512,1,6.907755,0,0,13,1,0,0 +0,4.61512,1,6.907755,0,1,13.73189,1,0,0 +3,4.61512,1,6.907755,0,1,13.73189,1,0,0 +1,4.61512,1,6.907755,0,1,13.73189,1,0,0 +8,4.61512,1,6.907755,0,1,39.1,0,1,0 +6,4.61512,1,6.907755,0,1,39.1,0,1,0 +3,4.61512,1,6.907755,0,1,39.1,0,1,0 +3,3.258096,0,5.420535,6.806829,1,21.7,1,0,0 +3,3.258096,0,5.420535,6.806829,1,21.7,1,0,0 +3,3.258096,0,5.420535,6.806829,1,21.7,1,0,0 +2,3.258096,0,6.272877,7.659172,0,8.7,0,0,0 +1,3.258096,0,6.272877,7.659172,0,8.7,0,0,0 +1,3.258096,0,6.272877,7.659172,0,8.7,0,0,0 +3,4.61512,1,6.907755,0,0,0,1,0,0 +1,4.61512,1,6.907755,0,0,0,1,0,0 +0,4.61512,1,6.907755,0,0,0,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +17,4.61512,1,6.907755,0,0,13.73189,1,0,0 +21,4.61512,1,6.907755,0,0,13.73189,1,0,0 +5,4.61512,1,6.907755,0,1,39.1,1,0,0 +5,4.61512,1,6.907755,0,1,39.1,1,0,0 +3,4.61512,1,6.907755,0,1,39.1,1,0,0 +10,0,0,0,0,1,13.73189,0,0,1 +1,0,0,0,0,1,13.73189,0,0,1 +1,0,0,0,0,1,13.73189,0,0,1 +2,0,0,0,0,1,13.73189,0,0,1 +1,0,0,0,0,1,13.73189,0,0,1 +2,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +7,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,1,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,1,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,1,0,0 +6,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +5,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,13.73189,0,1,0 +9,0,0,0,0,1,13.73189,0,1,0 +9,0,0,0,0,1,13.73189,0,1,0 +10,0,0,0,0,1,13.73189,0,1,0 +2,3.258096,0,5.720312,7.106606,0,13.73189,0,1,0 +5,3.258096,0,5.720312,7.106606,0,13.73189,0,1,0 +9,3.258096,0,5.720312,7.106606,0,13.73189,0,1,0 +48,3.258096,0,5.720312,7.106606,0,13.73189,0,1,0 +8,3.258096,0,5.720312,7.106606,0,13.73189,0,1,0 +5,4.61512,1,6.907755,0,0,4.3,0,0,0 +8,4.61512,1,6.907755,0,0,4.3,0,0,0 +14,4.61512,1,6.907755,0,0,4.3,0,0,0 +5,4.61512,1,6.907755,0,0,13.73189,0,0,0 +10,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,4.61512,1,6.907755,0,0,13.73189,0,0,0 +7,4.61512,1,6.907755,0,0,13.73189,0,0,0 +6,4.61512,1,6.907755,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,21.7,0,0,0 +2,4.61512,1,6.907755,0,0,21.7,0,0,0 +2,4.61512,1,6.907755,0,0,21.7,0,0,0 +1,4.61512,1,6.907755,0,0,0,0,0,0 +0,4.61512,1,6.907755,0,0,0,0,0,0 +0,4.61512,1,6.907755,0,0,0,0,0,0 +30,3.258096,0,6.907755,8.294049,1,43.5,0,0,1 +25,3.258096,0,6.907755,8.294049,1,43.5,0,0,1 +18,3.258096,0,6.907755,8.294049,1,43.5,0,0,1 +15,3.258096,0,6.907755,8.294049,1,43.5,0,0,1 +20,3.258096,0,6.907755,8.294049,1,43.5,0,0,1 +45,3.258096,0,6.907755,8.294049,1,43.5,1,0,0 +28,3.258096,0,6.907755,8.294049,1,43.5,1,0,0 +14,3.258096,0,6.907755,8.294049,1,43.5,1,0,0 +14,3.258096,0,6.907755,8.294049,1,43.5,1,0,0 +28,3.258096,0,6.907755,8.294049,1,43.5,1,0,0 +3,3.931826,0,6.907755,7.600903,0,13,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,17.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,17.4,0,0,0 +7,3.931826,0,6.907755,7.600903,0,17.4,0,0,0 +0,4.61512,1,5.883322,0,0,0,1,0,0 +0,4.61512,1,5.883322,0,0,0,1,0,0 +1,4.61512,1,5.883322,0,0,0,1,0,0 +0,4.61512,1,5.883322,0,0,13.73189,0,0,0 +0,4.61512,1,5.883322,0,0,13.73189,0,0,0 +2,4.61512,1,5.883322,0,0,13.73189,0,0,0 +0,4.61512,1,5.883322,0,0,26.1,0,0,0 +0,4.61512,1,5.883322,0,0,26.1,0,0,0 +0,4.61512,1,5.883322,0,0,26.1,0,0,0 +2,4.61512,1,6.907755,0,0,8.7,1,0,0 +2,4.61512,1,6.907755,0,0,8.7,1,0,0 +7,4.61512,1,6.907755,0,0,26.1,0,1,0 +4,4.61512,1,6.907755,0,0,26.1,0,1,0 +9,4.61512,1,6.907755,0,0,26.1,0,1,0 +10,4.61512,1,6.907755,0,0,26.1,0,1,0 +9,4.61512,1,6.907755,0,0,26.1,0,1,0 +5,4.61512,1,6.907755,0,0,8.7,1,0,0 +9,4.61512,1,6.907755,0,0,8.7,1,0,0 +7,4.61512,1,6.907755,0,0,8.7,1,0,0 +3,4.61512,1,6.907755,0,0,8.7,1,0,0 +4,4.61512,1,6.907755,0,0,8.7,1,0,0 +3,4.61512,1,6.907755,0,1,8.7,1,0,0 +3,4.61512,1,6.907755,0,1,8.7,1,0,0 +1,4.61512,1,6.907755,0,1,8.7,1,0,0 +0,4.61512,1,6.907755,0,1,8.7,1,0,0 +3,4.61512,1,6.907755,0,1,8.7,1,0,0 +4,4.61512,1,6.907755,0,0,13,1,0,0 +1,4.61512,1,6.907755,0,0,13,1,0,0 +1,4.61512,1,6.907755,0,0,13,1,0,0 +3,4.61512,1,6.907755,0,0,13,1,0,0 +2,4.61512,1,6.907755,0,0,13,1,0,0 +1,4.61512,1,6.907755,0,1,13.73189,0,1,0 +0,4.61512,1,6.907755,0,1,13.73189,0,1,0 +1,4.61512,1,6.907755,0,1,13.73189,0,1,0 +3,4.61512,1,6.907755,0,1,13.73189,0,1,0 +1,4.61512,1,6.907755,0,1,13.73189,0,1,0 +2,0,0,0,0,1,17.4,1,0,0 +1,0,0,0,0,1,17.4,1,0,0 +3,0,0,0,0,1,17.4,1,0,0 +0,0,0,0,0,1,17.4,1,0,0 +1,0,0,0,0,1,17.4,1,0,0 +0,0,0,0,0,0,13,0,1,0 +0,0,0,0,0,0,13,0,1,0 +0,0,0,0,0,0,13,0,1,0 +0,0,0,0,0,0,13,0,1,0 +0,0,0,0,0,0,13,0,1,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +3,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +4,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +2,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +2,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +2,4.61512,1,5.703783,0,0,13.73189,1,0,0 +1,4.61512,1,5.703783,0,0,13.73189,1,0,0 +1,4.61512,1,5.703783,0,0,13.73189,1,0,0 +0,4.61512,1,5.703783,0,0,13.73189,1,0,0 +5,4.61512,1,5.703783,0,0,13.73189,1,0,0 +1,4.61512,1,5.703783,0,0,13.73189,1,0,0 +6,4.61512,1,5.703783,0,0,13.73189,0,0,0 +1,4.61512,1,5.703783,0,0,13.73189,0,0,0 +3,4.61512,1,5.703783,0,0,13.73189,0,0,0 +4,0,0,0,0,0,4.3,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,8.7,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +8,0,0,0,0,0,4.3,0,0,0 +3,0,0,0,0,0,4.3,0,0,0 +4,0,0,0,0,0,8.7,0,0,0 +0,0,0,0,0,0,8.7,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +2,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +7,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +5,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13,1,0,0 +6,3.931826,0,6.907755,7.600903,0,13,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13,1,0,0 +10,0,0,0,0,0,17.4,0,0,0 +7,0,0,0,0,0,17.4,0,0,0 +8,0,0,0,0,0,17.4,0,0,0 +4,0,0,0,0,0,17.4,0,0,0 +3,0,0,0,0,0,17.4,0,0,0 +10,0,0,0,0,0,17.4,0,0,0 +15,0,0,0,0,0,17.4,0,0,0 +16,0,0,0,0,0,17.4,0,0,0 +3,0,0,0,0,0,17.4,0,0,0 +6,0,0,0,0,0,17.4,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +14,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +13,0,0,0,0,0,13.73189,0,0,0 +1,0,0,6.198479,0,0,13.73189,0,0,0 +9,0,0,6.198479,0,0,13.73189,0,0,0 +1,0,0,6.198479,0,0,13.73189,0,0,0 +2,0,0,6.198479,0,0,13.73189,0,0,0 +2,0,0,6.198479,0,0,13.73189,0,0,0 +2,0,0,6.198479,0,0,13.73189,0,0,0 +5,0,0,6.198479,0,0,13.73189,0,0,0 +2,0,0,6.198479,0,0,13.73189,0,0,0 +2,0,0,6.198479,0,0,13.73189,0,0,0 +6,0,0,6.198479,0,0,13.73189,0,0,0 +0,0,0,6.198479,0,0,13.73189,1,0,0 +0,0,0,6.198479,0,0,13.73189,1,0,0 +0,0,0,6.198479,0,0,13.73189,1,0,0 +2,0,0,6.198479,0,0,13.73189,1,0,0 +2,0,0,6.198479,0,0,13.73189,1,0,0 +6,0,0,5.662961,0,0,13.73189,0,0,0 +4,0,0,5.662961,0,0,13.73189,0,0,0 +5,0,0,5.662961,0,0,13.73189,0,0,0 +1,0,0,5.662961,0,0,13.73189,0,0,0 +2,0,0,5.662961,0,0,13.73189,0,0,0 +4,0,0,5.662961,0,0,13.73189,0,0,0 +4,0,0,5.662961,0,0,13.73189,0,0,0 +1,0,0,5.662961,0,0,13.73189,0,0,0 +1,0,0,5.662961,0,0,13.73189,0,0,0 +2,0,0,5.662961,0,0,13.73189,0,0,0 +10,0,0,5.662961,0,0,13.73189,0,0,0 +7,0,0,5.662961,0,0,13.73189,0,0,0 +5,0,0,5.662961,0,0,13.73189,0,0,0 +4,0,0,5.662961,0,0,13.73189,0,0,0 +4,0,0,5.662961,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +5,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +3,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +6,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +4,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +2,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +7,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +6,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +1,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +0,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +2,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +0,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +0,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +5,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +3,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +0,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +1,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +8,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +7,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +1,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +3,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +2,3.931826,0,6.395262,7.088409,0,13.73189,0,0,0 +1,3.931826,0,6.576469,7.269617,0,13.73189,0,0,0 +4,3.931826,0,6.576469,7.269617,0,13.73189,0,0,0 +1,3.931826,0,6.576469,7.269617,0,13.73189,0,0,0 +5,3.931826,0,6.576469,7.269617,0,13.73189,1,0,0 +1,3.931826,0,6.576469,7.269617,0,13.73189,1,0,0 +2,3.931826,0,6.576469,7.269617,0,13.73189,1,0,0 +13,3.931826,0,6.576469,7.269617,0,13.73189,0,1,0 +12,3.931826,0,6.576469,7.269617,0,13.73189,0,1,0 +13,3.931826,0,6.576469,7.269617,0,13.73189,0,1,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,0,1,4.532599,0,0,13,0,0,0 +4,0,1,4.532599,0,0,13,0,0,0 +0,0,1,4.532599,0,0,13,0,0,0 +0,4.61512,1,6.907755,0,0,0,1,0,0 +1,4.61512,1,6.907755,0,0,0,1,0,0 +1,4.61512,1,6.907755,0,0,0,1,0,0 +2,4.61512,1,6.907755,0,0,0,1,0,0 +0,4.61512,1,6.907755,0,0,0,1,0,0 +0,4.61512,1,6.907755,0,0,0,1,0,0 +1,4.61512,1,6.907755,0,0,0,1,0,0 +0,4.61512,1,6.907755,0,0,0,1,0,0 +1,4.61512,1,6.907755,0,0,0,1,0,0 +0,4.61512,1,6.907755,0,0,0,1,0,0 +4,0,0,5.777652,0,0,13.73189,1,0,0 +4,0,0,5.777652,0,0,13.73189,1,0,0 +4,0,0,5.777652,0,0,13.73189,1,0,0 +1,0,0,5.777652,0,0,13.73189,1,0,0 +3,0,0,5.777652,0,0,13.73189,1,0,0 +3,0,0,5.777652,0,0,13.73189,1,0,0 +12,0,0,5.777652,0,0,13.73189,1,0,0 +14,0,0,5.777652,0,0,13.73189,1,0,0 +5,0,0,5.777652,0,0,13.73189,1,0,0 +10,0,0,5.777652,0,0,13.73189,1,0,0 +4,0,0,5.777652,0,0,13.73189,0,1,0 +4,0,0,5.777652,0,0,13.73189,0,1,0 +4,0,0,5.777652,0,0,13.73189,0,1,0 +3,0,0,5.777652,0,0,13.73189,0,1,0 +3,0,0,5.777652,0,0,13.73189,0,1,0 +3,0,0,5.777652,0,0,13.73189,1,0,0 +2,0,0,5.777652,0,0,13.73189,1,0,0 +1,0,0,5.777652,0,0,13.73189,1,0,0 +5,0,0,5.777652,0,0,13.73189,1,0,0 +1,0,0,5.777652,0,0,13.73189,1,0,0 +19,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,4.61512,1,6.907755,0,0,13.73189,0,0,0 +15,4.61512,1,6.907755,0,0,13.73189,1,0,0 +10,4.61512,1,6.907755,0,0,13.73189,1,0,0 +7,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,0,1,5.703783,0,0,8.7,1,0,0 +0,0,1,5.703783,0,0,8.7,1,0,0 +0,0,1,5.703783,0,0,8.7,1,0,0 +1,0,1,5.703783,0,0,8.7,1,0,0 +0,0,1,5.703783,0,0,8.7,1,0,0 +5,0,1,5.703783,0,1,17.4,1,0,0 +2,0,1,5.703783,0,1,17.4,1,0,0 +0,0,1,5.703783,0,1,17.4,1,0,0 +3,0,1,5.703783,0,1,17.4,1,0,0 +4,0,1,5.703783,0,1,17.4,1,0,0 +0,0,1,6.272877,0,0,0,0,0,0 +1,0,1,6.272877,0,0,0,0,0,0 +3,0,1,6.272877,0,0,0,0,0,0 +1,0,1,6.272877,0,0,13.73189,0,0,0 +0,0,1,6.272877,0,0,13.73189,0,0,0 +4,0,1,6.272877,0,0,13.73189,0,0,0 +4,0,1,6.272877,0,0,13,0,0,0 +2,0,1,6.272877,0,0,13,0,0,0 +6,0,1,6.272877,0,0,13,0,0,0 +1,0,1,6.272877,0,0,13.73189,0,0,0 +2,0,1,6.272877,0,0,13.73189,0,0,0 +5,0,1,6.272877,0,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,1,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +4,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +7,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +6,3.258096,0,6.907755,8.294049,1,0,0,0,0 +4,3.258096,0,6.907755,8.294049,1,0,0,0,0 +0,3.258096,0,6.907755,8.294049,1,0,0,0,0 +2,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +3,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +14,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +0,0,1,4.727388,0,0,0,0,0,0 +0,0,1,4.727388,0,0,0,0,0,0 +1,0,1,4.727388,0,0,0,0,0,0 +2,0,1,4.727388,0,0,0,0,0,0 +2,0,1,4.727388,0,0,0,0,0,0 +2,0,1,4.727388,0,0,13,0,0,0 +0,0,1,4.727388,0,0,13,0,0,0 +0,0,1,4.727388,0,0,13,0,0,0 +7,0,1,4.727388,0,0,13,0,0,0 +3,0,1,4.727388,0,0,13,0,0,0 +3,0,1,4.727388,0,0,8.7,0,0,0 +3,0,1,4.727388,0,0,8.7,0,0,0 +3,0,1,4.727388,0,0,8.7,0,0,0 +0,0,1,4.727388,0,0,8.7,0,0,0 +0,0,1,4.727388,0,0,8.7,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +2,0,1,0,0,0,13.73189,0,0,0 +4,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,1,0,0 +1,0,1,0,0,0,13.73189,1,0,0 +1,0,1,0,0,0,13.73189,1,0,0 +0,0,1,0,0,1,13.73189,0,0,1 +0,0,1,0,0,1,13.73189,0,0,1 +0,0,1,0,0,1,13.73189,0,0,1 +2,0,1,0,0,0,13.73189,1,0,0 +1,0,1,0,0,0,13.73189,1,0,0 +2,0,1,0,0,0,13.73189,1,0,0 +0,3.258096,0,5.828946,7.21524,0,13.73189,1,0,0 +1,3.258096,0,5.828946,7.21524,0,13.73189,1,0,0 +0,3.258096,0,5.828946,7.21524,0,4.3,1,0,0 +0,3.258096,0,5.828946,7.21524,0,4.3,1,0,0 +3,3.258096,0,5.828946,7.21524,0,4.3,1,0,0 +2,3.258096,0,5.828946,7.21524,0,4.3,1,0,0 +0,3.258096,0,5.828946,7.21524,0,4.3,1,0,0 +0,3.258096,0,5.828946,7.21524,0,4.3,1,0,0 +0,3.258096,0,5.828946,7.21524,0,13.73189,1,0,0 +0,3.258096,0,5.828946,7.21524,0,13.73189,1,0,0 +0,3.258096,0,5.828946,7.21524,0,8.7,0,1,0 +5,3.258096,0,5.828946,7.21524,0,8.7,0,1,0 +2,0,1,5.703783,0,0,13.73189,1,0,0 +6,0,1,5.703783,0,0,13.73189,1,0,0 +0,0,1,5.703783,0,0,13.73189,1,0,0 +0,0,1,5.703783,0,0,13.73189,0,0,0 +0,0,1,5.703783,0,0,13.73189,0,0,0 +2,0,1,5.703783,0,0,13.73189,0,0,0 +35,0,1,5.986452,0,1,13.73189,1,0,0 +20,0,1,5.986452,0,1,13.73189,1,0,0 +16,0,1,5.986452,0,1,13.73189,1,0,0 +9,0,1,5.986452,0,1,13.73189,1,0,0 +16,0,1,5.986452,0,1,13.73189,1,0,0 +22,0,1,5.986452,0,0,13.73189,1,0,0 +9,0,1,5.986452,0,0,13.73189,1,0,0 +13,0,1,5.986452,0,0,13.73189,1,0,0 +8,0,1,5.986452,0,0,13.73189,1,0,0 +5,0,1,5.986452,0,0,13.73189,1,0,0 +1,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +1,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +1,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +3,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +8,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +10,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +7,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +10,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +2,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +2,4.61512,1,6.684612,0,0,13.73189,1,0,0 +3,4.61512,1,6.684612,0,0,13.73189,1,0,0 +1,4.61512,1,6.684612,0,0,13.73189,1,0,0 +1,4.61512,1,6.684612,0,0,13.73189,1,0,0 +4,4.61512,1,6.684612,0,0,13.73189,1,0,0 +15,4.61512,1,6.684612,0,0,13.73189,1,0,0 +9,4.61512,1,6.684612,0,0,13.73189,1,0,0 +10,4.61512,1,6.684612,0,0,13.73189,1,0,0 +2,4.61512,1,6.684612,0,0,13.73189,1,0,0 +4,4.61512,1,6.684612,0,0,13.73189,1,0,0 +4,4.61512,1,6.684612,0,0,13.73189,1,0,0 +2,4.61512,1,6.684612,0,0,13.73189,1,0,0 +0,4.61512,1,6.684612,0,0,13.73189,1,0,0 +3,4.61512,1,6.684612,0,0,13.73189,1,0,0 +0,4.61512,1,6.684612,0,0,13.73189,1,0,0 +6,3.258096,0,6.907755,8.294049,0,17.4,0,0,1 +2,3.258096,0,6.907755,8.294049,0,17.4,0,0,1 +5,3.258096,0,6.907755,8.294049,0,17.4,0,0,1 +9,3.258096,0,6.907755,8.294049,1,30.4,0,0,1 +2,3.258096,0,6.907755,8.294049,1,30.4,0,0,1 +8,3.258096,0,6.907755,8.294049,1,30.4,0,0,1 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13,0,0,0 +0,0,0,0,0,0,13,0,0,0 +0,0,0,0,0,0,13,0,0,0 +0,0,0,0,0,0,13,0,0,0 +0,0,0,0,0,0,13,0,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +7,0,0,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,8.7,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +4,0,0,0,0,0,8.7,0,0,0 +5,0,0,4.543295,0,1,34.8,1,0,0 +5,0,0,4.543295,0,1,34.8,1,0,0 +8,0,0,4.543295,0,1,34.8,1,0,0 +7,0,0,4.543295,0,1,34.8,1,0,0 +6,0,0,4.543295,0,1,34.8,1,0,0 +0,4.61512,1,6.826545,0,0,13.73189,1,0,0 +3,4.61512,1,6.826545,0,0,13.73189,1,0,0 +5,4.61512,1,6.826545,0,0,13.73189,1,0,0 +0,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +5,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +5,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +7,0,0,0,0,0,17.4,1,0,0 +1,0,0,0,0,0,17.4,1,0,0 +1,0,0,0,0,0,17.4,1,0,0 +3,0,0,0,0,0,17.4,1,0,0 +4,0,0,0,0,0,17.4,1,0,0 +2,3.931826,0,6.855409,7.548556,0,8.7,0,0,0 +0,3.931826,0,6.855409,7.548556,0,8.7,0,0,0 +1,3.931826,0,6.855409,7.548556,0,8.7,0,0,0 +1,3.931826,0,6.855409,7.548556,0,8.7,0,0,0 +0,3.931826,0,6.855409,7.548556,0,8.7,0,0,0 +8,3.931826,0,6.855409,7.548556,0,21.7,0,0,0 +1,3.931826,0,6.855409,7.548556,0,21.7,0,0,0 +5,3.931826,0,6.855409,7.548556,0,21.7,0,0,0 +3,3.931826,0,6.855409,7.548556,0,21.7,0,0,0 +7,3.931826,0,6.855409,7.548556,0,21.7,0,0,0 +0,3.258096,0,0,0,0,17.4,0,0,0 +0,3.258096,0,0,0,0,17.4,0,0,0 +0,3.258096,0,0,0,0,17.4,0,0,0 +0,3.258096,0,0,0,0,17.4,0,0,0 +1,3.258096,0,0,0,0,17.4,0,0,0 +5,3.258096,0,0,0,0,30.4,0,0,0 +2,3.258096,0,0,0,0,30.4,0,0,0 +2,3.258096,0,0,0,0,30.4,0,0,0 +0,3.258096,0,0,0,0,30.4,0,0,0 +1,3.258096,0,0,0,0,30.4,0,0,0 +0,3.258096,0,0,0,0,13.73189,0,0,0 +1,3.258096,0,0,0,0,13.73189,0,0,0 +2,3.258096,0,0,0,0,13.73189,0,0,0 +3,3.258096,0,0,0,0,13.73189,0,0,0 +3,3.258096,0,0,0,0,13.73189,0,0,0 +0,3.258096,0,0,0,0,13.73189,0,0,0 +2,3.258096,0,0,0,0,13.73189,0,0,0 +0,3.258096,0,0,0,0,13.73189,0,0,0 +1,3.258096,0,0,0,0,13.73189,0,0,0 +1,3.258096,0,0,0,0,13.73189,0,0,0 +3,3.258096,0,0,0,0,13.73189,0,0,0 +3,3.258096,0,0,0,0,13.73189,0,0,0 +0,3.258096,0,0,0,0,13.73189,0,0,0 +1,3.258096,0,0,0,0,13.73189,0,0,0 +1,3.258096,0,0,0,0,13.73189,0,0,0 +2,3.258096,0,0,0,0,13.73189,0,0,0 +2,3.258096,0,0,0,0,13.73189,0,0,0 +0,3.258096,0,0,0,0,13.73189,0,0,0 +1,3.258096,0,0,0,0,13.73189,0,0,0 +5,3.258096,0,0,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,0,1,0,0 +0,4.61512,1,6.907755,0,0,0,1,0,0 +0,4.61512,1,6.907755,0,0,0,1,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +4,3.258096,0,5.926926,7.313221,0,13,1,0,0 +0,3.258096,0,5.926926,7.313221,0,13,1,0,0 +0,3.258096,0,5.926926,7.313221,0,13,1,0,0 +0,3.258096,0,5.926926,7.313221,0,13,1,0,0 +0,3.258096,0,5.926926,7.313221,0,13,1,0,0 +2,4.61512,1,6.907755,0,1,13.73189,1,0,0 +1,4.61512,1,6.907755,0,1,13.73189,1,0,0 +0,4.61512,1,6.907755,0,1,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +8,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,21.7,1,0,0 +12,4.61512,1,6.907755,0,0,21.7,1,0,0 +18,4.61512,1,6.907755,0,0,21.7,1,0,0 +8,4.61512,1,6.907755,0,0,13,0,0,0 +4,4.61512,1,6.907755,0,0,13,0,0,0 +13,4.61512,1,6.907755,0,0,13,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13,0,0,0 +2,4.61512,1,6.907755,0,0,13,0,0,0 +4,4.61512,1,6.907755,0,0,13,0,0,0 +6,4.61512,1,6.907755,0,0,13,0,0,0 +0,4.61512,1,6.907755,0,0,13,0,0,0 +8,4.61512,1,6.907755,0,0,13,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +7,4.61512,1,6.907755,0,0,8.7,0,0,0 +1,3.258096,0,6.683361,8.069655,0,30.4,1,0,0 +1,3.258096,0,6.683361,8.069655,0,30.4,1,0,0 +2,3.258096,0,6.683361,8.069655,0,30.4,1,0,0 +12,3.258096,0,6.683361,8.069655,0,30.4,1,0,0 +3,3.258096,0,6.683361,8.069655,0,30.4,1,0,0 +4,3.258096,0,6.683361,8.069655,0,13.73189,1,0,0 +2,3.258096,0,6.683361,8.069655,0,13.73189,1,0,0 +3,3.258096,0,6.683361,8.069655,0,13.73189,1,0,0 +2,3.258096,0,6.683361,8.069655,0,13.73189,1,0,0 +2,3.258096,0,6.683361,8.069655,0,13.73189,1,0,0 +2,3.258096,0,6.683361,8.069655,1,30.4,1,0,0 +1,3.258096,0,6.683361,8.069655,1,30.4,1,0,0 +2,3.258096,0,6.683361,8.069655,1,30.4,1,0,0 +3,3.258096,0,6.683361,8.069655,1,30.4,1,0,0 +3,3.258096,0,6.683361,8.069655,1,30.4,1,0,0 +0,3.258096,0,5.556828,6.943122,0,4.3,1,0,0 +0,3.258096,0,5.556828,6.943122,0,4.3,1,0,0 +0,3.258096,0,5.556828,6.943122,0,4.3,1,0,0 +0,3.258096,0,5.556828,6.943122,0,4.3,1,0,0 +0,3.258096,0,5.556828,6.943122,0,4.3,1,0,0 +7,0,0,6.139884,0,0,13.73189,0,0,0 +6,0,0,6.139884,0,0,13.73189,0,0,0 +12,0,0,6.139884,0,0,13.73189,0,0,0 +5,0,0,6.139884,0,0,13.73189,1,0,0 +10,0,0,6.139884,0,0,13.73189,1,0,0 +5,0,0,6.139884,0,0,13.73189,1,0,0 +3,0,0,6.139884,0,0,13.73189,0,0,0 +7,0,0,6.139884,0,0,13.73189,0,0,0 +0,0,0,6.139884,0,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +1,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +3,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +8,3.931826,0,6.907755,7.600903,0,13,0,0,0 +8,3.931826,0,6.907755,7.600903,0,13,0,0,0 +8,3.931826,0,6.907755,7.600903,0,13,0,0,0 +5,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +2,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +3,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +6,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +4,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +5,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +7,0,1,5.313206,0,0,13,0,0,0 +9,0,1,5.313206,0,0,13,0,0,0 +5,0,1,5.313206,0,0,13,0,0,0 +0,4.61512,1,6.907755,0,0,17.4,0,1,0 +0,4.61512,1,6.907755,0,0,17.4,0,1,0 +0,4.61512,1,6.907755,0,0,17.4,0,1,0 +1,4.61512,1,6.907755,0,0,30.4,1,0,0 +0,4.61512,1,6.907755,0,0,30.4,1,0,0 +0,4.61512,1,6.907755,0,0,30.4,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +6,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +4,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +3,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +8,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +6,3.931826,0,6.907755,7.600903,0,13,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13,0,0,0 +6,3.931826,0,6.907755,7.600903,0,13,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13,0,0,0 +3,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +1,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +2,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +6,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +11,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +4,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +3,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +0,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +3,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +2,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +4,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +2,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +3,3.258096,0,6.907755,8.294049,0,0,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +3,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +3,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.519147,7.905442,0,8.7,0,0,0 +3,3.258096,0,6.519147,7.905442,0,8.7,0,0,0 +2,3.258096,0,6.519147,7.905442,0,8.7,0,0,0 +5,3.258096,0,6.519147,7.905442,0,8.7,0,0,0 +5,3.258096,0,6.519147,7.905442,0,8.7,0,0,0 +6,3.258096,0,6.519147,7.905442,0,13.73189,0,0,0 +1,3.258096,0,6.519147,7.905442,0,13.73189,0,0,0 +1,3.258096,0,6.519147,7.905442,0,13.73189,0,0,0 +0,3.258096,0,6.519147,7.905442,0,13.73189,0,0,0 +2,3.258096,0,6.519147,7.905442,0,13.73189,0,0,0 +0,3.258096,0,6.519147,7.905442,0,17.4,0,0,0 +1,3.258096,0,6.519147,7.905442,0,17.4,0,0,0 +1,3.258096,0,6.519147,7.905442,0,17.4,0,0,0 +3,3.258096,0,6.519147,7.905442,0,17.4,0,0,0 +5,3.258096,0,6.519147,7.905442,0,17.4,0,0,0 +0,3.258096,0,0,6.57368,0,0,0,0,0 +0,3.258096,0,0,6.57368,0,0,0,0,0 +0,3.258096,0,0,6.57368,0,0,0,0,0 +1,3.258096,0,0,6.57368,0,0,0,0,0 +0,3.258096,0,0,6.57368,0,0,0,0,0 +2,3.931826,0,0,0,0,13.73189,0,0,0 +5,3.931826,0,0,0,0,13.73189,0,0,0 +7,3.931826,0,0,0,0,13.73189,0,0,0 +7,3.931826,0,0,0,0,13.73189,0,0,0 +4,3.931826,0,0,0,0,13.73189,0,0,0 +1,3.931826,0,0,0,0,13.73189,0,0,0 +9,3.931826,0,0,0,1,13.73189,1,0,0 +7,3.931826,0,0,0,1,13.73189,1,0,0 +14,3.931826,0,0,0,1,13.73189,1,0,0 +11,3.931826,0,0,0,0,13.73189,0,0,0 +16,3.931826,0,0,0,0,13.73189,0,0,0 +15,3.931826,0,0,0,0,13.73189,0,0,0 +4,0,1,6.109248,0,0,13.73189,0,0,0 +3,0,1,6.109248,0,0,13.73189,0,0,0 +3,0,1,6.109248,0,0,13.73189,0,0,0 +1,0,1,6.109248,0,0,17.4,0,0,0 +0,0,1,6.109248,0,0,17.4,0,0,0 +0,0,1,6.109248,0,0,17.4,0,0,0 +4,0,1,6.109248,0,0,13,0,0,0 +0,0,1,6.109248,0,0,13,0,0,0 +3,0,1,6.109248,0,0,13,0,0,0 +19,0,0,0,0,0,13,0,0,0 +3,0,0,0,0,0,13,0,0,0 +10,0,0,0,0,0,13,0,0,0 +7,0,0,0,0,0,17.4,0,0,0 +9,0,0,0,0,0,17.4,0,0,0 +6,0,0,0,0,0,17.4,0,0,0 +5,0,0,0,0,0,13,0,0,0 +10,0,0,0,0,0,13,0,0,0 +1,0,0,0,0,0,13,0,0,0 +6,0,0,3.951244,0,0,4.3,0,0,0 +4,0,0,3.951244,0,0,4.3,0,0,0 +7,0,0,3.951244,0,0,4.3,0,0,0 +15,3.258096,0,6.57368,7.959975,0,13.73189,0,0,0 +16,3.258096,0,6.57368,7.959975,0,13.73189,0,0,0 +3,3.258096,0,6.57368,7.959975,0,13.73189,0,0,0 +1,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +2,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +3,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +2,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +9,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +2,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +1,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +0,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +2,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +2,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +0,3.258096,0,6.214608,7.600903,.12982,13.73189,1,0,0 +0,3.258096,0,6.214608,7.600903,.12982,13.73189,1,0,0 +0,3.258096,0,6.214608,7.600903,.12982,13.73189,1,0,0 +1,3.258096,0,6.214608,7.600903,.12982,13.73189,1,0,0 +0,3.258096,0,6.214608,7.600903,.12982,13.73189,1,0,0 +3,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +0,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +0,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +0,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +0,3.258096,0,6.214608,7.600903,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,17.4,1,0,0 +7,4.61512,1,6.907755,0,0,17.4,1,0,0 +14,4.61512,1,6.907755,0,0,17.4,1,0,0 +5,3.258096,0,6.120297,7.506592,0,13,0,0,0 +4,3.258096,0,6.120297,7.506592,0,13,0,0,0 +1,3.258096,0,6.120297,7.506592,0,13,0,0,0 +4,3.258096,0,6.120297,7.506592,0,13,0,0,0 +3,3.258096,0,6.120297,7.506592,0,13,0,0,0 +0,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +2,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +5,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +0,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +0,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +1,3.258096,0,6.120297,7.506592,0,4.3,0,0,0 +1,3.258096,0,6.120297,7.506592,0,4.3,0,0,0 +1,3.258096,0,6.120297,7.506592,0,4.3,0,0,0 +0,3.258096,0,6.120297,7.506592,0,4.3,0,0,0 +1,3.258096,0,6.120297,7.506592,0,4.3,0,0,0 +1,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +3,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +3,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +2,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +2,3.258096,0,6.120297,7.506592,0,13.73189,0,0,0 +0,0,1,6.131227,0,0,17.4,1,0,0 +4,0,1,6.131227,0,0,17.4,1,0,0 +1,0,1,6.131227,0,0,17.4,1,0,0 +0,0,1,6.131227,0,0,17.4,1,0,0 +0,0,1,6.131227,0,0,17.4,1,0,0 +1,0,1,6.131227,0,0,13.73189,1,0,0 +1,0,1,6.131227,0,0,13.73189,1,0,0 +3,0,1,6.131227,0,0,13.73189,1,0,0 +5,0,1,6.131227,0,0,13.73189,1,0,0 +1,0,1,6.131227,0,0,13.73189,1,0,0 +0,0,1,6.131227,0,0,4.3,1,0,0 +0,0,1,6.131227,0,0,4.3,1,0,0 +1,0,1,6.131227,0,0,4.3,1,0,0 +2,0,1,6.131227,0,0,4.3,1,0,0 +12,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +10,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +17,3.258096,0,6.684612,8.070906,1,26.1,1,0,0 +10,3.258096,0,6.684612,8.070906,1,26.1,1,0,0 +8,3.258096,0,6.684612,8.070906,1,26.1,1,0,0 +6,3.258096,0,6.684612,8.070906,1,26.1,1,0,0 +1,3.258096,0,6.684612,8.070906,1,26.1,1,0,0 +8,3.258096,0,6.684612,8.070906,1,21.7,0,1,0 +5,3.258096,0,6.684612,8.070906,1,21.7,0,1,0 +4,3.258096,0,6.684612,8.070906,1,21.7,0,1,0 +2,3.258096,0,6.684612,8.070906,1,21.7,0,1,0 +4,3.258096,0,6.684612,8.070906,1,21.7,0,1,0 +11,3.258096,0,6.684612,8.070906,0,13,0,0,0 +6,3.258096,0,6.684612,8.070906,0,13,0,0,0 +6,3.258096,0,6.684612,8.070906,0,13,0,0,0 +2,3.258096,0,6.684612,8.070906,0,13,0,0,0 +7,3.258096,0,6.684612,8.070906,0,13,0,0,0 +0,3.258096,0,6.736967,8.123261,0,13.73189,0,0,0 +0,3.258096,0,6.736967,8.123261,0,13.73189,0,0,0 +0,3.258096,0,6.736967,8.123261,0,13.73189,0,0,0 +14,4.61512,1,0,0,1,26.1,0,0,0 +3,4.61512,1,0,0,1,26.1,0,0,0 +7,0,1,6.109248,0,0,21.7,1,0,0 +3,0,1,6.109248,0,0,21.7,1,0,0 +2,0,1,6.109248,0,0,21.7,1,0,0 +1,0,1,6.109248,0,0,13,1,0,0 +3,0,1,6.109248,0,0,13,1,0,0 +2,0,1,6.109248,0,0,13,1,0,0 +8,0,1,6.109248,0,0,8.7,1,0,0 +14,0,1,6.109248,0,0,8.7,1,0,0 +6,0,1,6.109248,0,0,8.7,1,0,0 +0,3.931826,0,6.109248,5.786897,0,13.73189,1,0,0 +0,3.931826,0,6.109248,5.786897,0,13.73189,1,0,0 +2,3.931826,0,6.109248,5.786897,0,13.73189,1,0,0 +0,3.931826,0,6.109248,5.786897,0,13.73189,1,0,0 +5,3.931826,0,6.109248,5.786897,0,13.73189,1,0,0 +4,3.931826,0,6.109248,5.786897,0,26.1,1,0,0 +0,3.931826,0,6.109248,5.786897,0,26.1,1,0,0 +9,3.931826,0,6.109248,5.786897,0,26.1,1,0,0 +2,3.931826,0,6.109248,5.786897,0,26.1,1,0,0 +7,3.931826,0,6.109248,5.786897,0,26.1,1,0,0 +9,3.931826,0,6.109248,5.786897,0,13,1,0,0 +3,3.931826,0,6.109248,5.786897,0,13,1,0,0 +7,3.931826,0,6.109248,5.786897,0,13,1,0,0 +4,3.931826,0,6.109248,5.786897,0,13,1,0,0 +5,3.931826,0,6.109248,5.786897,0,13,1,0,0 +10,3.258096,0,6.907755,8.294049,0,21.7,0,1,0 +2,3.258096,0,6.907755,8.294049,0,21.7,0,1,0 +6,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +10,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +5,4.61512,1,6.907755,0,0,13.73189,1,0,0 +7,4.61512,1,6.907755,0,0,13.73189,1,0,0 +10,4.61512,1,6.907755,0,0,13.73189,1,0,0 +5,4.61512,1,6.907755,0,0,13.73189,1,0,0 +6,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +12,3.931826,0,6.907755,7.600903,1,26.1,1,0,0 +17,3.931826,0,6.907755,7.600903,1,26.1,1,0,0 +0,3.931826,0,6.907755,7.600903,1,26.1,1,0,0 +2,3.931826,0,6.907755,7.600903,0,4.3,1,0,0 +0,3.931826,0,6.907755,7.600903,0,4.3,1,0,0 +1,3.931826,0,6.907755,7.600903,0,4.3,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,17.4,1,0,0 +0,4.61512,1,6.907755,0,0,17.4,1,0,0 +0,4.61512,1,6.907755,0,0,17.4,1,0,0 +0,4.61512,1,6.907755,0,0,17.4,1,0,0 +0,4.61512,1,6.907755,0,0,17.4,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13,1,0,0 +0,4.61512,1,6.907755,0,0,13,1,0,0 +1,4.61512,1,6.907755,0,0,13,1,0,0 +1,4.61512,1,6.907755,0,0,13,1,0,0 +1,4.61512,1,6.907755,0,0,13,1,0,0 +4,4.61512,1,6.907755,0,0,8.7,1,0,0 +3,4.61512,1,6.907755,0,0,8.7,1,0,0 +1,4.61512,1,6.907755,0,0,8.7,1,0,0 +1,4.61512,1,6.907755,0,0,8.7,1,0,0 +0,4.61512,1,6.907755,0,0,8.7,1,0,0 +0,4.61512,1,6.907755,0,0,0,0,0,0 +0,4.61512,1,6.907755,0,0,0,0,0,0 +3,4.61512,1,6.907755,0,0,0,0,0,0 +2,4.61512,1,6.907755,0,0,0,0,0,0 +1,4.61512,1,6.907755,0,0,0,0,0,0 +1,4.61512,1,6.907755,0,.0277778,13.73189,1,0,0 +1,4.61512,1,6.907755,0,.0277778,13.73189,1,0,0 +2,4.61512,1,6.907755,0,.0277778,13.73189,1,0,0 +0,4.61512,1,6.907755,0,.0277778,13.73189,1,0,0 +2,4.61512,1,6.907755,0,.0277778,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,8.7,1,0,0 +6,4.61512,1,6.907755,0,0,8.7,1,0,0 +0,4.61512,1,6.907755,0,0,8.7,1,0,0 +1,4.61512,1,6.907755,0,0,8.7,1,0,0 +1,4.61512,1,6.907755,0,0,8.7,1,0,0 +12,3.931826,0,6.907755,7.600903,1,21.7,1,0,0 +9,3.931826,0,6.907755,7.600903,1,21.7,1,0,0 +7,3.931826,0,6.907755,7.600903,1,21.7,1,0,0 +3,3.931826,0,6.907755,7.600903,1,13,0,0,0 +2,3.931826,0,6.907755,7.600903,1,13,0,0,0 +3,3.931826,0,6.907755,7.600903,1,13,0,0,0 +10,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +7,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +4,4.61512,1,0,0,0,8.7,1,0,0 +3,4.61512,1,0,0,0,8.7,1,0,0 +0,4.61512,1,0,0,0,8.7,1,0,0 +1,4.61512,1,0,0,0,8.7,1,0,0 +1,4.61512,1,0,0,0,8.7,1,0,0 +1,4.61512,1,0,0,0,4.3,1,0,0 +1,4.61512,1,0,0,0,4.3,1,0,0 +0,4.61512,1,0,0,0,4.3,1,0,0 +0,4.61512,1,0,0,0,4.3,1,0,0 +0,4.61512,1,0,0,0,4.3,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +1,4.61512,1,0,0,0,13.73189,1,0,0 +8,4.61512,1,0,0,0,13.73189,1,0,0 +3,4.61512,1,0,0,0,13.73189,1,0,0 +2,4.61512,1,0,0,0,13.73189,1,0,0 +7,4.61512,1,0,0,0,17.4,1,0,0 +5,4.61512,1,0,0,0,17.4,1,0,0 +4,4.61512,1,0,0,0,17.4,1,0,0 +2,4.61512,1,0,0,0,17.4,1,0,0 +4,4.61512,1,0,0,0,17.4,1,0,0 +1,4.61512,1,0,0,0,13,0,1,0 +6,4.61512,1,0,0,0,13,0,1,0 +2,4.61512,1,0,0,0,13,0,1,0 +4,4.61512,1,0,0,0,13,0,1,0 +0,4.61512,1,0,0,0,13,0,1,0 +8,0,1,6.109248,0,0,13.73189,0,0,0 +4,0,1,6.109248,0,0,13.73189,0,0,0 +6,0,1,6.109248,0,0,13.73189,0,0,0 +4,0,1,6.109248,0,0,13.73189,0,0,0 +3,0,1,6.109248,0,0,13.73189,0,0,0 +4,0,1,6.109248,0,0,13.73189,0,0,0 +3,0,1,6.109248,0,0,13.73189,0,0,0 +2,0,1,6.109248,0,0,13.73189,0,0,0 +3,0,1,6.109248,0,0,13.73189,0,0,0 +3,0,1,6.109248,0,0,13.73189,0,0,0 +1,0,1,6.109248,0,0,13.73189,1,0,0 +0,0,1,6.109248,0,0,13.73189,1,0,0 +4,0,1,6.109248,0,0,13.73189,1,0,0 +3,0,1,6.109248,0,0,13.73189,1,0,0 +0,0,1,6.109248,0,0,13.73189,1,0,0 +3,0,1,6.109248,0,0,13.73189,1,0,0 +2,0,1,6.109248,0,0,13.73189,1,0,0 +1,0,1,6.109248,0,0,13.73189,1,0,0 +2,0,1,6.109248,0,0,13.73189,1,0,0 +2,0,1,6.109248,0,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +9,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +11,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +7,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +31,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +5,0,0,6.126869,0,0,13.73189,0,0,0 +3,0,0,6.126869,0,0,13.73189,0,0,0 +6,0,0,6.126869,0,0,13.73189,0,0,0 +4,0,0,6.126869,0,0,13.73189,0,0,0 +1,0,0,6.126869,0,0,13.73189,0,0,0 +3,0,0,6.126869,0,0,8.7,0,0,0 +9,0,0,6.126869,0,0,8.7,0,0,0 +1,0,0,6.126869,0,0,8.7,0,0,0 +4,0,0,6.126869,0,0,8.7,0,0,0 +1,0,0,6.126869,0,0,8.7,0,0,0 +1,0,0,6.126869,0,0,0,0,0,0 +3,0,0,6.126869,0,0,0,0,0,0 +0,0,0,6.126869,0,0,0,0,0,0 +2,0,0,6.126869,0,0,0,0,0,0 +1,0,0,6.126869,0,0,0,0,0,0 +3,0,0,6.126869,0,0,13.73189,0,0,0 +5,0,0,6.126869,0,0,13.73189,0,0,0 +7,0,0,6.126869,0,0,13.73189,0,0,0 +3,0,0,6.126869,0,0,13.73189,0,0,0 +0,0,0,6.126869,0,0,13.73189,0,0,0 +1,0,0,6.126869,0,0,13.73189,0,0,0 +5,0,0,6.126869,0,0,13.73189,0,0,0 +7,0,0,6.126869,0,0,13.73189,0,0,0 +4,0,0,6.126869,0,0,13.73189,0,0,0 +2,0,0,6.126869,0,0,13.73189,0,0,0 +8,0,0,0,0,1,30.4,0,0,1 +9,0,0,0,0,1,30.4,0,0,1 +2,0,0,0,0,1,30.4,0,0,1 +4,0,0,0,0,1,30.4,0,0,1 +3,0,0,0,0,1,30.4,0,0,1 +15,0,0,0,0,0,30.4,0,1,0 +28,0,0,0,0,0,30.4,0,1,0 +11,0,0,0,0,0,30.4,0,1,0 +16,0,0,0,0,0,30.4,0,1,0 +17,0,0,0,0,0,30.4,0,1,0 +0,0,1,0,0,0,4.3,0,0,0 +0,0,1,0,0,0,4.3,0,0,0 +0,0,1,0,0,0,4.3,0,0,0 +0,0,1,0,0,0,4.3,0,0,0 +0,0,1,0,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +4,4.61512,1,6.907755,0,1,13.73189,0,1,0 +0,4.61512,1,6.907755,0,1,13.73189,0,1,0 +3,4.61512,1,6.907755,0,1,13.73189,0,1,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,0,0,0,0,0,17.4,1,0,0 +5,0,0,0,0,0,17.4,1,0,0 +0,0,0,0,0,0,17.4,1,0,0 +0,0,0,0,0,0,17.4,1,0,0 +3,0,0,0,0,0,17.4,1,0,0 +4,0,0,0,0,0,4.3,1,0,0 +0,0,0,0,0,0,4.3,1,0,0 +0,0,0,0,0,0,4.3,1,0,0 +0,0,0,0,0,0,4.3,1,0,0 +2,0,0,0,0,0,4.3,1,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +10,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +6,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +5,3.931826,0,6.907755,7.600903,1,26.1,0,1,0 +2,3.931826,0,6.907755,7.600903,1,26.1,0,1,0 +5,3.931826,0,6.907755,7.600903,1,26.1,0,1,0 +3,3.931826,0,6.907755,7.600903,1,26.1,0,1,0 +4,3.931826,0,6.907755,7.600903,1,26.1,0,1,0 +0,3.931826,0,6.907755,7.600903,0,13,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13,1,0,0 +4,3.931826,0,6.907755,7.600903,0,13,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13,0,0,0 +3,0,0,0,0,1,17.4,1,0,0 +6,0,0,0,0,1,17.4,1,0,0 +2,0,0,0,0,1,17.4,1,0,0 +2,0,0,0,0,1,30.4,0,1,0 +1,0,0,0,0,1,30.4,0,1,0 +5,0,0,0,0,1,30.4,0,1,0 +8,3.258096,0,4.70048,6.086775,1,13.73189,0,1,0 +5,3.258096,0,4.70048,6.086775,1,13.73189,0,1,0 +0,0,0,0,0,0,4.3,1,0,0 +1,0,0,0,0,0,4.3,1,0,0 +3,0,0,0,0,0,4.3,1,0,0 +0,0,0,0,0,0,4.3,1,0,0 +2,0,0,0,0,0,4.3,1,0,0 +2,0,0,0,0,0,8.7,1,0,0 +0,0,0,0,0,0,8.7,1,0,0 +0,0,0,0,0,0,8.7,1,0,0 +0,0,0,0,0,0,8.7,1,0,0 +1,0,0,0,0,0,8.7,1,0,0 +0,0,0,0,0,0,8.7,1,0,0 +1,0,0,0,0,0,8.7,1,0,0 +8,0,0,0,0,0,8.7,1,0,0 +1,0,0,0,0,0,8.7,1,0,0 +3,0,0,0,0,0,8.7,1,0,0 +4,0,0,4.276666,0,0,0,1,0,0 +10,0,0,4.276666,0,0,0,1,0,0 +8,0,0,4.276666,0,0,0,1,0,0 +3,0,0,4.276666,0,0,0,1,0,0 +2,0,0,4.276666,0,0,0,1,0,0 +8,4.61512,1,0,0,0,21.7,0,0,1 +0,4.61512,1,0,0,0,21.7,0,0,1 +0,4.61512,1,0,0,0,21.7,0,0,1 +0,3.258096,0,4.61512,6.001415,0,13.73189,0,0,0 +0,3.258096,0,4.61512,6.001415,0,13.73189,0,0,0 +0,3.258096,0,4.61512,6.001415,0,13.73189,0,0,0 +0,3.258096,0,4.61512,6.001415,0,13.73189,0,0,0 +0,3.258096,0,4.61512,6.001415,0,13.73189,0,0,0 +0,3.258096,0,4.61512,6.001415,0,13.73189,0,0,0 +0,3.258096,0,4.61512,6.001415,0,8.7,0,0,0 +0,3.258096,0,4.61512,6.001415,0,8.7,0,0,0 +0,3.258096,0,4.61512,6.001415,0,21.7,0,0,0 +0,3.258096,0,4.61512,6.001415,0,21.7,0,0,0 +2,0,0,0,0,0,13,0,0,0 +5,0,0,0,0,0,13,0,0,0 +5,0,0,0,0,0,13,0,0,0 +5,0,0,0,0,0,13,0,0,0 +5,0,0,0,0,0,13,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +6,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +1,3.931826,0,6.907755,7.600903,0,0,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,1,21.7,1,0,0 +0,3.931826,0,6.907755,7.600903,1,21.7,1,0,0 +1,3.931826,0,6.907755,7.600903,1,21.7,1,0,0 +1,3.931826,0,6.907755,7.600903,1,21.7,1,0,0 +2,3.931826,0,6.907755,7.600903,1,21.7,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +6,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13,1,0,0 +2,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +9,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +4,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +2,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +7,3.258096,0,6.520621,7.906916,0,13,1,0,0 +13,3.258096,0,6.520621,7.906916,0,13,1,0,0 +4,3.258096,0,6.520621,7.906916,0,13,1,0,0 +1,3.258096,0,6.520621,7.906916,0,8.7,1,0,0 +1,3.258096,0,6.520621,7.906916,0,8.7,1,0,0 +7,3.258096,0,6.520621,7.906916,0,8.7,1,0,0 +2,3.258096,0,6.520621,7.906916,0,13.73189,1,0,0 +1,3.258096,0,6.520621,7.906916,0,13.73189,1,0,0 +0,3.258096,0,6.520621,7.906916,0,13.73189,1,0,0 +0,3.258096,0,6.520621,7.906916,0,13.73189,1,0,0 +1,3.258096,0,6.520621,7.906916,0,13.73189,1,0,0 +0,3.258096,0,6.520621,7.906916,0,13.73189,1,0,0 +5,0,1,6.109248,0,0,30.4,1,0,0 +2,0,1,6.109248,0,0,30.4,1,0,0 +0,0,1,6.109248,0,0,30.4,1,0,0 +3,0,1,6.109248,0,0,30.4,1,0,0 +4,0,1,6.109248,0,0,30.4,1,0,0 +2,0,1,6.109248,0,1,17.4,1,0,0 +1,0,1,6.109248,0,1,17.4,1,0,0 +1,0,1,6.109248,0,1,17.4,1,0,0 +1,0,1,6.109248,0,1,17.4,1,0,0 +1,0,1,6.109248,0,1,17.4,1,0,0 +9,0,1,6.109248,0,0,13.73189,1,0,0 +10,0,1,6.109248,0,0,13.73189,1,0,0 +8,0,1,6.109248,0,0,13.73189,1,0,0 +6,0,1,6.109248,0,0,13.73189,1,0,0 +8,0,1,6.109248,0,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +3,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +2,3.931826,0,6.907755,7.600903,0,0,0,0,0 +2,3.931826,0,6.907755,7.600903,0,0,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +5,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +4,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +3,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,1,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,1,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,1,0,0 +0,3.931826,0,6.907755,7.600903,0,4.3,1,0,0 +0,3.931826,0,6.907755,7.600903,0,4.3,1,0,0 +1,3.931826,0,6.907755,7.600903,0,4.3,1,0,0 +2,3.931826,0,6.907755,7.600903,0,0,1,0,0 +2,3.931826,0,6.907755,7.600903,0,0,1,0,0 +6,3.931826,0,6.907755,7.600903,0,0,1,0,0 +1,3.931826,0,6.907755,7.600903,0,21.7,1,0,0 +0,3.931826,0,6.907755,7.600903,0,21.7,1,0,0 +2,3.931826,0,6.907755,7.600903,0,21.7,1,0,0 +0,3.931826,0,6.907755,7.600903,1,30.4,1,0,0 +2,3.931826,0,6.907755,7.600903,1,30.4,1,0,0 +6,3.931826,0,6.907755,7.600903,1,30.4,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +7,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.363563,7.05671,0,21.7,1,0,0 +2,3.931826,0,6.363563,7.05671,0,21.7,1,0,0 +1,3.931826,0,6.363563,7.05671,0,21.7,1,0,0 +2,3.931826,0,6.263398,6.956545,0,8.7,0,0,0 +2,3.931826,0,6.263398,6.956545,0,8.7,0,0,0 +0,3.931826,0,6.263398,6.956545,0,8.7,0,0,0 +1,3.931826,0,6.263398,6.956545,0,8.7,0,0,0 +1,3.931826,0,6.263398,6.956545,0,8.7,0,0,0 +2,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +0,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +0,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +2,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +1,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +16,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +16,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +7,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +0,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +0,3.931826,0,6.263398,6.956545,0,13.73189,0,0,0 +4,3.931826,0,6.263398,6.956545,0,17.4,0,0,0 +0,3.931826,0,6.263398,6.956545,0,17.4,0,0,0 +3,3.931826,0,6.263398,6.956545,0,17.4,0,0,0 +1,3.931826,0,6.263398,6.956545,0,17.4,0,0,0 +2,3.931826,0,6.263398,6.956545,0,17.4,0,0,0 +0,3.258096,0,4.276666,5.662961,1,13.73189,0,1,0 +0,3.258096,0,4.276666,5.662961,1,13.73189,0,1,0 +29,3.258096,0,4.276666,5.662961,1,13.73189,0,1,0 +0,3.258096,0,4.276666,5.662961,1,26.1,0,1,0 +0,3.258096,0,4.276666,5.662961,1,26.1,0,1,0 +12,3.258096,0,4.276666,5.662961,1,26.1,0,1,0 +3,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +7,4.61512,1,6.907755,0,0,8.7,0,0,0 +2,4.61512,1,6.907755,0,0,8.7,0,0,0 +1,4.61512,1,6.907755,0,0,8.7,0,0,0 +4,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +3,4.61512,1,6.907755,0,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +2,4.61512,1,6.907755,0,0,4.3,0,0,0 +2,4.61512,1,6.907755,0,0,26.1,1,0,0 +4,4.61512,1,6.907755,0,0,26.1,1,0,0 +1,4.61512,1,6.907755,0,0,26.1,1,0,0 +4,4.61512,1,6.907755,0,0,26.1,1,0,0 +6,4.61512,1,6.907755,0,0,26.1,1,0,0 +2,4.61512,1,4.317488,0,0,13.73189,0,0,0 +8,4.61512,1,4.317488,0,0,13.73189,0,0,0 +2,4.61512,1,4.317488,0,0,13.73189,0,0,0 +4,4.61512,1,4.317488,0,0,13.73189,0,0,0 +4,4.61512,1,4.317488,0,0,13.73189,0,0,0 +8,4.61512,1,4.317488,0,0,21.7,0,0,0 +3,4.61512,1,4.317488,0,0,21.7,0,0,0 +16,4.61512,1,4.317488,0,0,21.7,0,0,0 +18,4.61512,1,4.317488,0,0,21.7,0,0,0 +8,4.61512,1,4.317488,0,0,21.7,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +7,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +5,4.61512,1,6.907755,0,1,13.73189,0,1,0 +1,4.61512,1,6.907755,0,1,13.73189,0,1,0 +11,4.61512,1,6.907755,0,1,13.73189,0,1,0 +8,4.61512,1,6.907755,0,1,13.73189,0,1,0 +9,4.61512,1,6.907755,0,1,13.73189,0,1,0 +6,0,1,4.382027,0,1,26.1,1,0,0 +2,0,1,4.382027,0,1,26.1,1,0,0 +4,0,1,4.382027,0,1,26.1,1,0,0 +3,0,1,4.382027,0,1,26.1,1,0,0 +6,0,1,4.382027,0,1,26.1,1,0,0 +3,0,1,4.382027,0,0,4.3,0,0,0 +4,0,1,4.382027,0,0,4.3,0,0,0 +3,0,1,4.382027,0,0,4.3,0,0,0 +3,0,1,4.382027,0,0,4.3,0,0,0 +5,0,1,4.382027,0,0,4.3,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,8.7,0,0,0 +6,0,0,0,0,0,8.7,0,0,0 +4,0,0,0,0,0,8.7,0,0,0 +5,0,0,0,0,0,17.4,0,0,0 +2,0,0,0,0,0,17.4,0,0,0 +4,0,0,0,0,0,17.4,0,0,0 +3,0,0,0,0,0,17.4,0,0,0 +5,0,0,0,0,0,17.4,0,0,0 +6,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +8,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +15,0,0,0,0,0,8.7,0,0,0 +4,0,0,0,0,0,8.7,0,0,0 +5,0,0,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,8.7,0,0,0 +0,0,0,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +12,0,0,0,0,0,4.3,0,0,0 +9,0,0,0,0,0,4.3,0,0,0 +4,0,0,0,0,0,4.3,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +3,0,0,5.451038,0,0,13.73189,1,0,0 +5,0,0,5.451038,0,0,13.73189,1,0,0 +4,0,0,5.451038,0,0,13.73189,1,0,0 +5,0,0,5.451038,0,0,13.73189,1,0,0 +3,0,0,5.451038,0,0,13.73189,1,0,0 +4,0,0,5.451038,0,0,13.73189,1,0,0 +5,0,0,5.451038,0,0,13.73189,1,0,0 +6,0,0,5.451038,0,0,13.73189,1,0,0 +5,0,0,5.451038,0,0,13.73189,1,0,0 +6,0,0,5.451038,0,0,13.73189,1,0,0 +1,0,0,5.451038,0,0,13.73189,1,0,0 +1,0,0,5.451038,0,0,13.73189,1,0,0 +0,0,0,5.451038,0,0,13.73189,1,0,0 +0,0,0,5.451038,0,0,13.73189,1,0,0 +1,0,0,5.451038,0,0,13.73189,1,0,0 +9,0,0,5.451038,0,0,13.73189,1,0,0 +4,0,0,5.451038,0,0,13.73189,1,0,0 +2,0,0,5.451038,0,0,13.73189,1,0,0 +2,0,0,5.451038,0,0,13.73189,1,0,0 +4,0,0,5.451038,0,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +5,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +6,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +11,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +13,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +9,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +1,4.61512,1,6.549651,0,0,4.3,0,0,0 +6,4.61512,1,6.549651,0,0,4.3,0,0,0 +0,4.61512,1,6.549651,0,0,4.3,0,0,0 +6,4.61512,1,6.549651,0,0,4.3,0,0,0 +5,4.61512,1,6.549651,0,0,4.3,0,0,0 +22,4.61512,1,6.549651,0,0,26.1,1,0,0 +2,4.61512,1,6.549651,0,0,26.1,1,0,0 +0,4.61512,1,6.549651,0,0,26.1,1,0,0 +2,4.61512,1,6.549651,0,0,26.1,1,0,0 +0,4.61512,1,6.549651,0,0,26.1,1,0,0 +8,0,1,4.976734,0,0,13.73189,0,0,0 +7,0,1,4.976734,0,0,13.73189,0,0,0 +1,0,1,4.976734,0,0,13.73189,0,0,0 +0,0,1,4.976734,0,0,13.73189,1,0,0 +7,0,1,4.976734,0,0,13.73189,1,0,0 +6,0,1,4.976734,0,0,13.73189,1,0,0 +0,0,1,4.976734,0,0,13.73189,1,0,0 +0,0,1,4.976734,0,0,13.73189,1,0,0 +0,0,1,4.976734,0,0,13.73189,1,0,0 +1,3.931826,0,6.907755,7.600903,0,0,0,0,0 +2,3.931826,0,6.907755,7.600903,0,0,0,0,0 +2,3.931826,0,6.907755,7.600903,0,0,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +5,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +4,3.931826,0,6.907755,7.600903,0,21.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +1,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +4,3.931826,0,6.907755,7.600903,0,4.3,1,0,0 +2,3.931826,0,6.907755,7.600903,0,4.3,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +1,3.931826,0,6.907755,7.600903,0,0,1,0,0 +1,3.931826,0,6.907755,7.600903,0,0,1,0,0 +1,3.931826,0,6.907755,7.600903,0,0,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +6,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13,0,0,0 +4,4.61512,1,6.907755,0,0,13,0,0,0 +3,4.61512,1,6.907755,0,0,13,0,0,0 +1,4.61512,1,6.907755,0,0,13,0,0,0 +0,4.61512,1,6.907755,0,0,13,0,0,0 +15,3.258096,0,6.461468,7.847763,0,13.73189,1,0,0 +4,3.258096,0,6.461468,7.847763,0,13.73189,1,0,0 +6,3.258096,0,6.461468,7.847763,0,13.73189,1,0,0 +11,3.258096,0,6.461468,7.847763,1,30.4,0,1,0 +1,3.258096,0,6.461468,7.847763,1,30.4,0,1,0 +6,3.258096,0,6.461468,7.847763,1,30.4,0,1,0 +7,3.258096,0,6.461468,7.847763,0,13.73189,1,0,0 +6,3.258096,0,6.461468,7.847763,0,13.73189,1,0,0 +5,3.258096,0,6.461468,7.847763,0,13.73189,1,0,0 +2,3.258096,0,6.461468,7.847763,0,26.1,0,0,0 +9,3.258096,0,6.461468,7.847763,0,26.1,0,0,0 +4,3.258096,0,6.461468,7.847763,0,26.1,0,0,0 +4,0,0,5.111988,0,0,13.73189,1,0,0 +4,0,0,5.111988,0,0,13.73189,1,0,0 +6,0,0,5.111988,0,0,13.73189,1,0,0 +2,0,0,5.111988,0,0,13.73189,0,0,0 +1,0,0,5.111988,0,0,13.73189,0,0,0 +5,0,0,5.111988,0,0,13.73189,0,0,0 +5,0,0,5.111988,0,0,13.73189,0,0,0 +5,0,0,5.111988,0,0,13.73189,0,0,0 +3,0,0,5.111988,0,0,13.73189,0,0,0 +0,3.258096,0,6.214608,7.600903,0,0,0,0,0 +0,3.258096,0,6.214608,7.600903,0,0,0,0,0 +0,3.258096,0,6.214608,7.600903,0,0,0,0,0 +0,3.258096,0,6.214608,7.600903,0,0,0,0,0 +0,3.258096,0,6.214608,7.600903,0,0,0,0,0 +8,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +3,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +2,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +4,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +1,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +10,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +6,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +2,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +1,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +2,3.258096,0,6.214608,7.600903,0,13.73189,0,0,0 +6,3.258096,0,6.214608,7.600903,0,26.1,0,0,0 +1,3.258096,0,6.214608,7.600903,0,26.1,0,0,0 +4,3.258096,0,6.214608,7.600903,0,26.1,0,0,0 +1,3.258096,0,6.214608,7.600903,0,26.1,0,0,0 +1,3.258096,0,6.214608,7.600903,0,26.1,0,0,0 +0,4.61512,1,6.39693,0,0,26.1,1,0,0 +4,4.61512,1,6.39693,0,0,26.1,1,0,0 +0,4.61512,1,6.39693,0,0,26.1,1,0,0 +0,4.61512,1,6.39693,0,0,26.1,1,0,0 +2,4.61512,1,6.39693,0,0,26.1,1,0,0 +4,4.61512,1,6.39693,0,0,4.3,0,0,0 +1,4.61512,1,6.39693,0,0,4.3,0,0,0 +0,4.61512,1,6.39693,0,0,4.3,0,0,0 +1,4.61512,1,6.39693,0,0,4.3,0,0,0 +7,4.61512,1,6.39693,0,0,4.3,0,0,0 +1,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +5,0,1,0,0,0,17.4,1,0,0 +3,0,1,0,0,0,17.4,1,0,0 +0,0,1,0,0,0,17.4,1,0,0 +9,0,1,0,0,0,17.4,1,0,0 +9,0,1,0,0,0,17.4,1,0,0 +0,0,1,0,0,0,8.7,0,0,0 +0,0,1,0,0,0,8.7,0,0,0 +5,0,1,0,0,0,8.7,0,0,0 +2,0,1,0,0,0,8.7,0,0,0 +0,0,1,0,0,0,8.7,0,0,0 +0,0,1,0,0,0,8.7,0,0,0 +0,0,1,0,0,0,8.7,0,0,0 +0,0,1,0,0,0,8.7,0,0,0 +2,0,1,0,0,0,8.7,0,0,0 +3,0,1,0,0,0,8.7,0,0,0 +2,0,1,0,0,0,13,0,0,0 +0,0,1,0,0,0,13,0,0,0 +0,0,1,0,0,0,13,0,0,0 +0,0,1,0,0,0,13,0,0,0 +3,0,1,0,0,0,13,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +2,0,1,0,0,0,13.73189,0,0,0 +6,0,1,0,0,0,13.73189,0,0,0 +1,0,1,0,0,0,13.73189,0,0,0 +1,0,1,0,0,0,8.7,0,0,0 +0,0,1,0,0,0,8.7,0,0,0 +0,0,1,0,0,0,8.7,0,0,0 +1,0,1,0,0,0,8.7,0,0,0 +1,0,1,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,26.1,1,0,0 +38,0,0,0,0,0,26.1,1,0,0 +22,0,0,0,0,0,26.1,1,0,0 +6,0,0,4.094345,0,0,13.73189,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13.73189,0,0,0 +4,0,0,4.094345,0,0,0,0,0,0 +3,0,0,4.094345,0,0,0,0,0,0 +1,0,0,4.094345,0,0,0,0,0,0 +3,0,0,4.094345,0,0,0,0,0,0 +5,0,0,4.094345,0,0,0,0,0,0 +5,0,0,4.094345,0,0,0,0,0,0 +0,0,0,4.094345,0,0,0,0,0,0 +1,0,0,4.094345,0,0,0,0,0,0 +1,0,0,4.094345,0,0,0,0,0,0 +0,0,0,4.094345,0,0,0,0,0,0 +6,0,0,4.094345,0,0,13,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +3,0,0,4.094345,0,0,13.73189,0,0,0 +6,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13.73189,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13.73189,0,0,0 +2,0,0,4.094345,0,0,13.73189,0,0,0 +3,0,0,4.094345,0,0,13.73189,0,0,0 +2,0,0,4.094345,0,0,13.73189,0,0,0 +2,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13.73189,0,0,0 +4,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13,0,0,0 +1,0,0,4.094345,0,0,13,0,0,0 +4,0,0,4.094345,0,0,13,0,0,0 +2,0,0,4.094345,0,0,13,0,0,0 +5,0,0,4.094345,0,0,13,0,0,0 +14,0,1,5.703783,0,0,21.7,1,0,0 +4,0,1,5.703783,0,0,21.7,1,0,0 +11,0,1,5.703783,0,0,21.7,1,0,0 +13,0,1,5.703783,0,0,21.7,1,0,0 +12,0,1,5.703783,0,0,21.7,1,0,0 +24,0,1,5.703783,0,0,4.3,1,0,0 +12,0,1,5.703783,0,0,4.3,1,0,0 +18,0,1,5.703783,0,0,4.3,1,0,0 +19,0,1,5.703783,0,0,4.3,1,0,0 +18,0,1,5.703783,0,0,4.3,1,0,0 +5,3.931826,0,0,0,1,30.4,1,0,0 +23,3.931826,0,0,0,1,30.4,1,0,0 +0,3.931826,0,0,0,1,30.4,1,0,0 +0,3.931826,0,0,7.600903,1,34.8,1,0,0 +0,3.931826,0,0,7.600903,1,34.8,1,0,0 +0,3.931826,0,0,7.600903,1,34.8,1,0,0 +6,0,1,5.924256,0,0,13.73189,1,0,0 +1,0,1,5.924256,0,0,13.73189,1,0,0 +0,0,1,5.924256,0,0,13.73189,1,0,0 +0,0,1,5.924256,0,0,13.73189,0,0,0 +0,0,1,5.924256,0,0,13.73189,0,0,0 +0,0,1,5.924256,0,0,13.73189,0,0,0 +3,0,1,5.924256,0,0,13.73189,0,0,0 +3,0,1,5.924256,0,0,13.73189,0,0,0 +3,0,1,5.924256,0,0,13.73189,0,0,0 +2,0,1,5.924256,0,0,13.73189,0,0,0 +1,0,1,5.924256,0,0,13.73189,0,0,0 +1,0,1,5.924256,0,0,13.73189,0,0,0 +1,0,0,0,0,1,21.7,0,0,1 +5,0,0,0,0,1,21.7,0,0,1 +3,0,0,0,0,1,21.7,0,0,1 +9,0,0,0,0,1,21.7,0,0,1 +4,0,0,0,0,1,21.7,0,0,1 +7,0,0,0,0,0,13,1,0,0 +9,0,0,0,0,0,13,1,0,0 +1,0,0,0,0,0,13,1,0,0 +4,0,0,0,0,0,13,1,0,0 +1,0,0,0,0,0,13,1,0,0 +0,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +13,4.61512,1,6.331502,0,1,13.73189,1,0,0 +0,4.61512,1,6.331502,0,1,13.73189,1,0,0 +7,4.61512,1,6.331502,0,1,13.73189,1,0,0 +12,4.61512,1,6.331502,0,1,13.73189,1,0,0 +15,4.61512,1,6.331502,0,1,13.73189,1,0,0 +0,0,1,5.402678,0,1,13,1,0,0 +0,0,1,5.402678,0,1,13,1,0,0 +1,0,1,5.402678,0,1,13,1,0,0 +4,0,1,5.402678,0,1,13,1,0,0 +3,0,1,5.402678,0,1,13,1,0,0 +2,4.61512,1,6.618739,0,0,13.73189,1,0,0 +3,4.61512,1,6.618739,0,0,13.73189,1,0,0 +11,4.61512,1,6.618739,0,0,13.73189,1,0,0 +3,4.61512,1,6.618739,0,0,13.73189,1,0,0 +0,4.61512,1,6.618739,0,0,13.73189,1,0,0 +4,4.61512,1,6.618739,0,0,13.73189,1,0,0 +8,4.61512,1,6.618739,0,0,13.73189,1,0,0 +1,4.61512,1,6.618739,0,0,13.73189,1,0,0 +1,4.61512,1,6.618739,0,0,13.73189,1,0,0 +0,4.61512,1,6.618739,0,0,13.73189,1,0,0 +1,4.61512,1,6.618739,0,0,13.73189,1,0,0 +2,3.931826,0,5.963579,6.656726,0,13,0,0,0 +1,3.931826,0,5.963579,6.656726,0,13,0,0,0 +1,3.931826,0,5.963579,6.656726,0,13,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +3,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +5,0,0,0,0,0,13,0,0,0 +7,0,0,0,0,0,13,0,0,0 +3,0,0,0,0,0,13,0,0,0 +1,0,0,0,0,0,13,0,0,0 +14,0,0,0,0,0,13,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +6,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,26.1,0,0,0 +3,0,0,0,0,0,26.1,0,0,0 +6,0,0,0,0,0,26.1,0,0,0 +8,0,0,0,0,0,26.1,0,0,0 +5,0,0,0,0,0,26.1,0,0,0 +1,0,0,0,0,0,21.7,0,0,0 +3,0,0,0,0,0,21.7,0,0,0 +9,0,0,0,0,0,21.7,0,0,0 +4,0,0,0,0,0,21.7,0,0,0 +6,0,0,0,0,0,21.7,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +6,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +10,0,0,0,0,0,13.73189,0,0,0 +51,0,0,0,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +6,4.61512,1,6.907755,0,0,13.73189,0,0,0 +23,4.61512,1,6.907755,0,0,13.73189,0,0,0 +23,4.61512,1,6.907755,0,0,21.7,0,0,0 +12,4.61512,1,6.907755,0,0,21.7,0,0,0 +17,4.61512,1,6.907755,0,0,21.7,0,0,0 +11,4.61512,1,6.907755,0,0,21.7,0,0,0 +13,4.61512,1,6.907755,0,0,21.7,0,0,0 +2,4.61512,1,6.907755,0,0,13,1,0,0 +2,4.61512,1,6.907755,0,0,13,1,0,0 +1,4.61512,1,6.907755,0,0,13,1,0,0 +5,4.61512,1,6.907755,0,0,13,1,0,0 +2,4.61512,1,6.907755,0,0,13,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +5,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,4.61512,1,6.907755,0,0,4.3,0,0,0 +3,4.61512,1,6.907755,0,0,4.3,0,0,0 +5,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +5,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +5,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +5,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +4,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +5,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +33,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +10,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +2,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +4,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +1,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +1,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +1,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +1,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +3,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +1,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +1,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,3.258096,0,6.244167,7.630461,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,0,1,0,0 +0,4.61512,1,5.645447,0,0,0,1,0,0 +0,4.61512,1,5.645447,0,0,0,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +0,4.61512,1,5.645447,0,0,13.73189,1,0,0 +2,3.931826,0,6.309918,7.003066,1,17.4,0,0,1 +0,3.931826,0,6.309918,7.003066,1,17.4,0,0,1 +0,3.931826,0,6.633318,7.326466,0,4.3,1,0,0 +3,3.931826,0,6.633318,7.326466,0,4.3,1,0,0 +0,3.931826,0,6.633318,7.326466,0,4.3,1,0,0 +0,3.931826,0,6.633318,7.326466,0,4.3,1,0,0 +5,3.931826,0,6.633318,7.326466,0,4.3,1,0,0 +4,0,0,0,0,1,13.73189,0,0,0 +3,0,0,0,0,1,13.73189,0,0,0 +1,0,0,0,0,1,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +0,3.258096,0,6.55108,7.937375,0,0,0,0,0 +0,3.258096,0,6.55108,7.937375,0,0,0,0,0 +1,3.258096,0,6.55108,7.937375,0,0,0,0,0 +0,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +0,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +1,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +0,3.258096,0,6.55108,7.937375,0,4.3,0,0,0 +0,3.258096,0,6.55108,7.937375,0,4.3,0,0,0 +0,3.258096,0,6.55108,7.937375,0,4.3,0,0,0 +0,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +1,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +1,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,4.3,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,4.3,0,0,0 +3,0,0,0,0,0,4.3,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +9,0,0,0,0,0,0,0,0,0 +17,0,0,0,0,0,0,0,0,0 +31,0,0,0,0,0,0,0,0,0 +13,0,0,0,0,0,0,0,0,0 +6,0,0,0,0,0,0,0,0,0 +8,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +15,0,0,0,0,0,13,0,0,0 +28,0,0,0,0,0,13,0,0,0 +10,0,0,0,0,0,13,0,0,0 +20,0,0,0,0,0,13,0,0,0 +16,0,0,0,0,0,13,0,0,0 +6,3.931826,0,0,6.527958,0,13.73189,0,0,0 +2,3.931826,0,0,6.527958,0,13.73189,0,0,0 +3,3.931826,0,0,6.527958,0,13.73189,0,0,0 +1,3.931826,0,0,6.527958,0,13.73189,0,0,0 +0,3.931826,0,0,6.527958,0,13.73189,0,0,0 +1,3.931826,0,0,6.527958,0,13.73189,0,0,0 +1,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +0,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +2,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +0,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +0,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +0,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +0,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +1,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +1,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +0,3.931826,0,6.028278,6.721426,0,13.73189,0,0,0 +2,3.931826,0,5.81413,6.507277,0,13.73189,0,0,0 +0,3.931826,0,5.81413,6.507277,0,13.73189,0,0,0 +4,3.931826,0,5.81413,6.507277,0,13.73189,0,0,0 +1,3.931826,0,5.81413,6.507277,0,13.73189,0,0,0 +1,3.931826,0,5.81413,6.507277,0,13.73189,0,0,0 +4,3.931826,0,6.028278,6.721426,0,13.73189,1,0,0 +1,3.931826,0,6.028278,6.721426,0,13.73189,1,0,0 +1,3.931826,0,6.028278,6.721426,0,13.73189,1,0,0 +1,3.931826,0,6.028278,6.721426,0,13.73189,1,0,0 +1,3.931826,0,6.028278,6.721426,0,13.73189,1,0,0 +1,0,0,4.174387,0,0,13.73189,0,0,0 +2,0,0,4.174387,0,0,13.73189,0,0,0 +5,0,0,4.174387,0,0,13.73189,0,0,0 +8,0,0,4.174387,0,0,13.73189,1,0,0 +3,0,0,4.174387,0,0,13.73189,1,0,0 +4,0,0,4.174387,0,0,13.73189,1,0,0 +5,0,0,4.174387,0,0,13.73189,0,0,0 +11,0,0,4.174387,0,0,13.73189,0,0,0 +7,0,0,4.174387,0,0,13.73189,0,0,0 +1,0,0,4.174387,0,0,13.73189,0,0,0 +0,0,0,4.174387,0,0,13.73189,0,0,0 +2,0,0,4.174387,0,0,13.73189,0,0,0 +6,0,0,4.174387,0,0,13.73189,0,0,0 +5,0,0,4.174387,0,0,13.73189,0,0,0 +12,0,0,4.174387,0,0,13.73189,0,0,0 +3,0,0,4.094345,0,0,4.3,0,0,0 +1,0,0,4.094345,0,0,4.3,0,0,0 +1,0,0,4.094345,0,0,4.3,0,0,0 +0,0,0,4.094345,0,0,4.3,0,0,0 +5,0,0,4.094345,0,0,4.3,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +2,0,0,4.094345,0,0,13.73189,0,0,0 +3,0,0,4.094345,0,0,13.73189,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,8.7,0,0,0 +0,0,0,4.094345,0,0,8.7,0,0,0 +0,0,0,4.094345,0,0,8.7,0,0,0 +0,0,0,4.094345,0,0,8.7,0,0,0 +0,0,0,4.094345,0,0,8.7,0,0,0 +6,0,0,4.094345,0,1,13,0,0,0 +3,0,0,4.094345,0,1,13,0,0,0 +4,0,0,4.094345,0,1,13,0,0,0 +2,0,0,4.094345,0,1,13,0,0,0 +1,0,0,4.094345,0,1,13,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +6,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +5,0,0,0,0,0,21.7,0,1,0 +5,0,0,0,0,0,21.7,0,1,0 +3,0,0,0,0,0,21.7,0,1,0 +2,0,0,0,0,0,47.8,0,1,0 +1,0,0,0,0,0,47.8,0,1,0 +4,0,0,0,0,0,47.8,0,1,0 +0,3.258096,0,6.907755,8.294049,0,13,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,26.1,0,1,0 +3,3.258096,0,6.907755,8.294049,0,26.1,0,1,0 +2,3.258096,0,6.907755,8.294049,0,26.1,0,1,0 +3,3.258096,0,6.907755,8.294049,0,26.1,0,1,0 +4,3.258096,0,6.907755,8.294049,0,26.1,0,1,0 +34,3.258096,0,6.907755,8.294049,0,4.3,1,0,0 +24,3.258096,0,6.907755,8.294049,0,4.3,1,0,0 +28,3.258096,0,6.907755,8.294049,0,4.3,1,0,0 +22,3.258096,0,6.907755,8.294049,0,4.3,1,0,0 +24,3.258096,0,6.907755,8.294049,0,4.3,1,0,0 +1,0,1,6.109248,0,0,13.73189,0,0,0 +0,0,1,6.109248,0,0,13.73189,0,0,0 +0,0,1,6.109248,0,0,13.73189,0,0,0 +2,0,1,6.109248,0,0,13.73189,0,0,0 +1,0,1,6.109248,0,0,13.73189,0,0,0 +0,0,1,6.109248,0,0,13.73189,0,0,0 +2,0,1,6.109248,0,0,13.73189,0,0,0 +2,0,1,6.109248,0,0,13.73189,0,0,0 +2,0,1,6.109248,0,0,13.73189,0,0,0 +3,0,1,6.109248,0,0,13.73189,0,0,0 +0,0,1,6.109248,0,0,13.73189,0,0,0 +0,0,1,6.109248,0,0,13.73189,0,0,0 +0,0,1,6.109248,0,0,13.73189,0,0,0 +0,0,1,6.109248,0,0,13.73189,0,0,0 +8,0,1,6.109248,0,0,13.73189,0,0,0 +0,4.61512,1,5.135798,0,0,17.4,0,1,0 +3,4.61512,1,5.135798,0,0,17.4,0,1,0 +2,4.61512,1,5.135798,0,0,17.4,0,1,0 +0,4.61512,1,5.135798,0,0,17.4,0,1,0 +4,4.61512,1,5.135798,0,0,17.4,0,1,0 +0,3.258096,0,0,0,1,30.4,0,1,0 +0,3.258096,0,0,0,1,30.4,0,1,0 +0,3.258096,0,0,0,1,30.4,0,1,0 +0,0,1,0,0,0,13.73189,0,1,0 +2,0,1,0,0,0,13.73189,0,1,0 +4,0,1,0,0,0,13.73189,0,1,0 +4,0,1,0,0,0,13.73189,0,1,0 +5,0,1,0,0,0,13.73189,0,1,0 +0,0,1,0,0,1,13.73189,1,0,0 +0,0,1,0,0,1,13.73189,1,0,0 +1,0,1,0,0,1,13.73189,1,0,0 +1,0,1,0,0,1,13.73189,1,0,0 +1,0,1,0,0,1,13.73189,1,0,0 +1,0,1,0,0,0,13.73189,1,0,0 +1,0,1,0,0,0,13.73189,1,0,0 +3,0,1,0,0,0,13.73189,1,0,0 +0,0,1,0,0,0,13.73189,1,0,0 +3,0,1,0,0,0,13.73189,1,0,0 +2,0,1,0,0,0,13.73189,1,0,0 +1,0,1,0,0,0,13.73189,1,0,0 +3,0,1,0,0,0,13.73189,1,0,0 +2,0,1,0,0,0,13.73189,1,0,0 +2,0,1,0,0,0,13.73189,1,0,0 +2,3.258096,0,5.83773,7.224025,0,26.1,1,0,0 +0,3.258096,0,5.83773,7.224025,0,26.1,1,0,0 +0,3.258096,0,5.83773,7.224025,0,26.1,1,0,0 +2,3.258096,0,5.83773,7.224025,0,26.1,1,0,0 +26,3.258096,0,5.83773,7.224025,0,26.1,1,0,0 +0,3.258096,0,5.83773,7.224025,1,17.4,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +7,4.61512,1,6.907755,0,0,13.73189,0,0,0 +6,4.61512,1,6.907755,0,0,13.73189,0,0,0 +8,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +6,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,0,0,0,0,0,4.3,0,0,0 +4,0,0,0,0,0,4.3,0,0,0 +10,0,0,0,0,0,4.3,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +7,0,0,0,0,0,13.73189,0,0,0 +7,0,0,0,0,0,13.73189,0,0,0 +6,0,0,0,0,0,13,0,0,0 +4,0,0,0,0,0,13,0,0,0 +2,0,0,0,0,0,13,0,0,0 +4,0,0,0,0,0,26.1,0,0,0 +2,0,0,0,0,0,26.1,0,0,0 +5,0,0,0,0,0,26.1,0,0,0 +18,4.61512,1,6.907755,0,0,0,0,0,0 +21,4.61512,1,6.907755,0,0,0,0,0,0 +14,4.61512,1,6.907755,0,0,0,0,0,0 +10,4.61512,1,6.907755,0,0,0,0,0,0 +14,4.61512,1,6.907755,0,0,0,0,0,0 +11,4.61512,1,6.907755,0,0,17.4,1,0,0 +8,4.61512,1,6.907755,0,0,17.4,1,0,0 +16,4.61512,1,6.907755,0,0,17.4,1,0,0 +3,4.61512,1,6.907755,0,0,17.4,1,0,0 +4,4.61512,1,6.907755,0,0,17.4,1,0,0 +0,4.61512,1,5.924256,0,0,13,0,0,0 +3,4.61512,1,5.924256,0,0,13,0,0,0 +0,4.61512,1,5.924256,0,0,13,0,0,0 +1,4.61512,1,5.924256,0,0,13,0,0,0 +0,4.61512,1,5.924256,0,0,13,0,0,0 +6,0,0,5.673323,0,0,13.73189,1,0,0 +5,0,0,5.673323,0,0,13.73189,1,0,0 +14,0,0,5.673323,0,0,13.73189,1,0,0 +2,0,0,5.673323,0,0,13.73189,1,0,0 +5,0,0,5.673323,0,0,13.73189,1,0,0 +5,0,0,5.673323,0,0,13.73189,1,0,0 +5,0,0,5.673323,0,0,34.8,1,0,0 +11,0,0,5.673323,0,0,34.8,1,0,0 +11,0,0,5.673323,0,0,34.8,1,0,0 +6,0,0,5.673323,0,0,17.4,0,0,1 +11,0,0,5.673323,0,0,17.4,0,0,1 +11,0,0,5.673323,0,0,17.4,0,0,1 +3,0,0,5.673323,0,0,13.73189,1,0,0 +6,0,0,5.673323,0,0,13.73189,1,0,0 +2,0,0,5.673323,0,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,0,0,0,0 +4,3.258096,0,6.907755,8.294049,0,0,0,0,0 +2,3.258096,0,6.907755,8.294049,0,0,0,0,0 +2,3.258096,0,6.907755,8.294049,0,0,0,0,0 +3,3.258096,0,6.907755,8.294049,0,0,0,0,0 +4,3.258096,0,6.907755,8.294049,0,0,0,0,0 +2,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +5,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +5,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +2,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +5,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +2,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +10,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +13,4.61512,1,6.907755,0,0,13.73189,1,0,0 +5,4.61512,1,6.907755,0,0,13.73189,1,0,0 +7,4.61512,1,6.907755,0,0,13.73189,1,0,0 +4,4.61512,1,6.907755,0,0,13.73189,1,0,0 +8,4.61512,1,6.907755,0,0,17.4,1,0,0 +3,4.61512,1,6.907755,0,0,17.4,1,0,0 +5,4.61512,1,6.907755,0,0,17.4,1,0,0 +15,4.61512,1,6.907755,0,0,21.7,1,0,0 +4,4.61512,1,6.907755,0,0,21.7,1,0,0 +9,4.61512,1,6.907755,0,0,21.7,1,0,0 +22,4.61512,1,6.907755,0,0,13.73189,1,0,0 +23,4.61512,1,6.907755,0,0,13.73189,1,0,0 +13,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +1,4.61512,1,6.436151,0,0,13.73189,0,0,0 +1,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,1,0,0 +0,4.61512,1,6.436151,0,0,13.73189,1,0,0 +0,4.61512,1,6.436151,0,0,13.73189,1,0,0 +0,4.61512,1,6.436151,0,0,13.73189,1,0,0 +0,4.61512,1,6.436151,0,0,13.73189,1,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +1,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +1,4.61512,1,6.436151,0,0,13.73189,1,0,0 +0,4.61512,1,6.436151,0,0,13.73189,1,0,0 +2,4.61512,1,6.436151,0,0,13.73189,1,0,0 +0,4.61512,1,6.436151,0,0,13.73189,1,0,0 +0,4.61512,1,6.436151,0,0,13.73189,1,0,0 +1,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +1,4.61512,1,6.436151,0,0,13.73189,0,0,0 +3,4.61512,1,6.436151,0,0,13.73189,0,0,0 +0,4.61512,1,6.436151,0,0,13.73189,0,0,0 +2,4.61512,1,5.998937,0,0,21.7,1,0,0 +0,4.61512,1,5.998937,0,0,21.7,1,0,0 +0,4.61512,1,5.998937,0,0,21.7,1,0,0 +3,4.61512,1,5.998937,0,0,21.7,1,0,0 +2,4.61512,1,5.998937,0,0,21.7,1,0,0 +6,0,0,0,0,0,13.73189,1,0,0 +6,0,0,0,0,0,13.73189,1,0,0 +6,0,0,0,0,0,13.73189,1,0,0 +8,0,0,0,0,0,13.73189,1,0,0 +6,0,0,0,0,0,13.73189,1,0,0 +7,0,0,0,0,1,21.7,1,0,0 +7,0,0,0,0,1,21.7,1,0,0 +6,0,0,0,0,1,21.7,1,0,0 +9,0,0,0,0,1,21.7,1,0,0 +6,0,0,0,0,1,21.7,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +5,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +1,0,0,0,0,0,8.7,1,0,0 +6,0,0,0,0,0,8.7,1,0,0 +0,0,0,0,0,0,8.7,1,0,0 +0,0,0,0,0,0,8.7,1,0,0 +1,0,0,0,0,0,8.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +9,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +10,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,1,0,0 +0,0,1,0,0,0,13.73189,1,0,0 +1,0,1,0,0,0,13.73189,1,0,0 +1,0,1,0,0,0,13.73189,1,0,0 +0,0,1,0,0,0,13.73189,1,0,0 +0,0,1,0,0,0,17.4,1,0,0 +0,0,1,0,0,0,17.4,1,0,0 +0,0,1,0,0,0,17.4,1,0,0 +0,0,1,0,0,0,17.4,1,0,0 +0,0,1,0,0,0,17.4,1,0,0 +0,3.258096,0,6.327937,7.714231,0,4.3,1,0,0 +0,3.258096,0,6.327937,7.714231,0,4.3,1,0,0 +0,3.258096,0,6.327937,7.714231,0,4.3,1,0,0 +2,3.258096,0,6.327937,7.714231,0,4.3,1,0,0 +2,3.258096,0,6.327937,7.714231,0,4.3,1,0,0 +4,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +3,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +2,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +1,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +6,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +1,3.258096,0,6.327937,7.714231,0,8.7,1,0,0 +2,3.258096,0,6.327937,7.714231,0,8.7,1,0,0 +1,3.258096,0,6.327937,7.714231,0,8.7,1,0,0 +1,3.258096,0,6.327937,7.714231,0,8.7,1,0,0 +1,3.258096,0,6.327937,7.714231,0,8.7,1,0,0 +2,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +6,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +4,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +1,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +2,3.258096,0,6.327937,7.714231,0,13.73189,1,0,0 +6,0,1,5.986452,0,0,30.4,1,0,0 +13,0,1,5.986452,0,0,30.4,1,0,0 +19,0,1,5.986452,0,0,30.4,1,0,0 +14,0,1,5.986452,0,1,26.1,1,0,0 +30,0,1,5.986452,0,1,26.1,1,0,0 +38,0,1,5.986452,0,1,26.1,1,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +10,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +9,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +11,3.258096,0,6.620073,8.006368,0,13.73189,1,0,0 +18,3.258096,0,6.620073,8.006368,0,13.73189,1,0,0 +2,3.258096,0,6.620073,8.006368,0,13.73189,1,0,0 +2,3.258096,0,6.620073,8.006368,0,13.73189,1,0,0 +0,3.258096,0,6.620073,8.006368,0,13.73189,1,0,0 +4,4.61512,1,6.448889,0,0,8.7,0,0,0 +1,4.61512,1,6.448889,0,0,8.7,0,0,0 +2,4.61512,1,6.448889,0,0,8.7,0,0,0 +4,4.61512,1,6.448889,0,0,8.7,0,0,0 +0,4.61512,1,6.448889,0,0,8.7,0,0,0 +1,4.61512,1,6.448889,0,0,8.7,0,0,0 +1,4.61512,1,6.448889,0,0,17.4,0,0,0 +1,4.61512,1,6.448889,0,0,17.4,0,0,0 +0,4.61512,1,6.448889,0,0,17.4,0,0,0 +0,0,1,4.356709,0,0,13.73189,0,0,0 +4,0,1,4.356709,0,0,13.73189,0,0,0 +9,0,1,4.356709,0,0,13.73189,0,0,0 +2,0,1,4.356709,0,0,13.73189,0,0,0 +0,0,1,4.356709,0,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +3,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +7,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +15,3.258096,0,6.907755,8.294049,0,13,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13,0,0,0 +16,3.258096,0,6.907755,8.294049,0,13,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +2,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +1,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +0,3.258096,0,6.907755,8.294049,0,21.7,0,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +3,4.61512,1,6.907755,0,0,21.7,1,0,0 +3,4.61512,1,6.907755,0,0,21.7,1,0,0 +5,4.61512,1,6.907755,0,0,21.7,1,0,0 +11,4.61512,1,6.907755,0,0,21.7,1,0,0 +2,4.61512,1,6.907755,0,0,21.7,1,0,0 +7,4.61512,1,6.907755,0,0,13,1,0,0 +6,4.61512,1,6.907755,0,0,13,1,0,0 +2,4.61512,1,6.907755,0,0,13,1,0,0 +2,4.61512,1,6.907755,0,0,13,1,0,0 +0,4.61512,1,6.907755,0,0,13,1,0,0 +5,4.61512,1,6.799056,0,0,21.7,0,1,0 +8,4.61512,1,6.799056,0,0,21.7,0,1,0 +6,4.61512,1,6.799056,0,0,21.7,0,1,0 +9,4.61512,1,6.799056,0,0,21.7,0,1,0 +4,4.61512,1,6.799056,0,0,21.7,0,1,0 +1,4.61512,1,6.799056,0,1,30.4,0,1,0 +0,4.61512,1,6.799056,0,1,30.4,0,1,0 +0,4.61512,1,6.799056,0,1,30.4,0,1,0 +0,4.61512,1,6.799056,0,1,30.4,0,1,0 +0,4.61512,1,6.799056,0,1,30.4,0,1,0 +1,4.61512,1,6.519147,0,0,13,1,0,0 +1,4.61512,1,6.519147,0,0,13,1,0,0 +0,4.61512,1,6.519147,0,0,13,1,0,0 +1,4.61512,1,6.519147,0,0,13,1,0,0 +0,4.61512,1,6.519147,0,0,13,1,0,0 +0,0,0,5.509388,0,0,21.7,0,0,0 +1,0,0,5.509388,0,0,21.7,0,0,0 +2,0,0,5.509388,0,0,21.7,0,0,0 +1,0,0,5.509388,0,0,21.7,0,0,0 +1,0,0,5.509388,0,0,21.7,0,0,0 +2,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +9,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,0,1,5.703783,0,0,30.4,1,0,0 +2,0,1,5.703783,0,0,30.4,1,0,0 +13,0,1,5.703783,0,1,26.1,0,1,0 +12,0,1,5.703783,0,1,26.1,0,1,0 +7,0,0,0,0,0,17.4,1,0,0 +11,0,0,0,0,0,17.4,1,0,0 +11,0,0,0,0,0,17.4,1,0,0 +2,0,0,0,0,0,30.4,1,0,0 +2,0,0,0,0,0,30.4,1,0,0 +2,0,0,0,0,0,30.4,1,0,0 +1,0,0,0,0,0,4.3,0,0,0 +0,0,0,0,0,0,4.3,0,0,0 +4,0,0,0,0,0,4.3,0,0,0 +0,3.258096,0,5.988961,7.375256,0,4.3,0,0,0 +0,3.258096,0,5.988961,7.375256,0,4.3,0,0,0 +2,3.258096,0,5.988961,7.375256,0,4.3,0,0,0 +1,3.258096,0,5.988961,7.375256,0,4.3,0,0,0 +1,3.258096,0,5.988961,7.375256,0,4.3,0,0,0 +0,4.61512,1,6.302619,0,0,13.73189,0,1,0 +0,4.61512,1,6.302619,0,0,13.73189,0,1,0 +0,4.61512,1,6.302619,0,0,13.73189,0,1,0 +6,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +5,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,4.61512,1,6.907755,0,0,13.73189,0,0,0 +5,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +6,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +8,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +5,4.61512,1,6.907755,0,0,13.73189,0,0,0 +13,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,0,1,5.703783,0,0,13.73189,0,0,0 +1,0,1,5.703783,0,0,13.73189,1,0,0 +0,0,1,5.703783,0,0,13.73189,1,0,0 +0,0,1,5.703783,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +8,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +5,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +6,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +7,0,0,0,0,0,13.73189,1,0,0 +5,0,0,0,0,0,21.7,1,0,0 +5,0,0,0,0,0,21.7,1,0,0 +7,0,0,0,0,0,21.7,1,0,0 +5,0,0,0,0,0,21.7,1,0,0 +9,0,0,0,0,0,21.7,1,0,0 +2,0,0,0,0,0,17.4,1,0,0 +3,0,0,0,0,0,17.4,1,0,0 +3,0,0,0,0,0,17.4,1,0,0 +1,0,0,0,0,0,17.4,1,0,0 +3,0,0,0,0,0,17.4,1,0,0 +3,3.931826,0,4.49981,0,0,4.3,1,0,0 +6,3.931826,0,4.49981,0,0,4.3,1,0,0 +0,3.931826,0,4.49981,0,0,4.3,1,0,0 +13,0,0,0,0,0,26.1,0,1,0 +1,0,0,0,0,0,26.1,0,1,0 +2,0,0,0,0,0,26.1,0,1,0 +9,0,0,0,0,1,43.5,0,1,0 +7,0,0,0,0,1,43.5,0,1,0 +13,0,0,0,0,1,43.5,0,1,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +11,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +4,4.61512,1,6.802395,0,0,0,0,0,0 +2,4.61512,1,6.802395,0,0,0,0,0,0 +5,4.61512,1,6.802395,0,0,0,0,0,0 +5,4.61512,1,6.802395,0,0,8.7,0,0,0 +0,4.61512,1,6.802395,0,0,8.7,0,0,0 +1,4.61512,1,6.802395,0,0,8.7,0,0,0 +9,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +8,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +4,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +3,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +5,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +4,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +5,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +0,3.258096,0,6.771935,8.15823,0,13.73189,0,0,0 +0,3.258096,0,6.771935,8.15823,0,13.73189,0,0,0 +0,3.258096,0,6.771935,8.15823,0,13.73189,0,0,0 +1,3.258096,0,6.771935,8.15823,0,13.73189,0,0,0 +2,3.258096,0,6.771935,8.15823,0,13.73189,0,0,0 +0,3.258096,0,6.771935,8.15823,0,13.73189,1,0,0 +0,3.258096,0,6.771935,8.15823,0,13.73189,1,0,0 +0,3.258096,0,6.771935,8.15823,0,13.73189,1,0,0 +0,3.258096,0,6.771935,8.15823,0,13.73189,1,0,0 +0,3.258096,0,6.771935,8.15823,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +31,0,0,0,0,0,13.73189,1,0,0 +17,0,0,0,0,0,13.73189,1,0,0 +9,0,0,0,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +2,4.61512,1,6.907755,0,0,4.3,0,0,0 +0,3.258096,0,6.635947,8.022241,0,13.73189,0,0,0 +1,3.258096,0,6.635947,8.022241,0,13.73189,0,0,0 +6,3.258096,0,6.635947,8.022241,0,13.73189,0,0,0 +8,3.258096,0,6.635947,8.022241,1,13.73189,0,0,0 +6,3.258096,0,6.635947,8.022241,1,13.73189,0,0,0 +8,3.258096,0,6.635947,8.022241,1,13.73189,0,0,0 +3,3.258096,0,6.635947,8.022241,0,13.73189,0,0,0 +2,3.258096,0,6.635947,8.022241,0,13.73189,0,0,0 +0,3.258096,0,6.635947,8.022241,0,13.73189,0,0,0 +3,3.258096,0,6.635947,8.022241,1,13.73189,0,0,0 +2,3.258096,0,6.635947,8.022241,1,13.73189,0,0,0 +0,3.258096,0,6.635947,8.022241,1,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +23,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +11,0,0,5.552959,0,0,13.73189,1,0,0 +3,0,0,5.552959,0,0,13.73189,1,0,0 +6,0,0,5.552959,0,0,13.73189,1,0,0 +6,0,0,5.552959,0,0,13.73189,1,0,0 +2,0,0,5.552959,0,0,13.73189,1,0,0 +0,0,0,5.552959,0,0,13.73189,1,0,0 +1,0,0,5.552959,0,0,13.73189,1,0,0 +5,0,0,5.552959,0,0,13.73189,1,0,0 +6,0,0,5.552959,0,0,13.73189,1,0,0 +0,0,0,5.552959,0,0,13.73189,1,0,0 +1,0,0,5.552959,0,0,13.73189,1,0,0 +1,0,0,5.552959,0,0,13.73189,1,0,0 +2,0,0,5.552959,0,0,13.73189,1,0,0 +11,0,0,5.552959,0,0,13.73189,1,0,0 +5,0,0,5.552959,0,0,13.73189,1,0,0 +4,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +2,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,0,0,0 +5,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,.12982,13.73189,0,0,0 +0,4.61512,1,6.907755,0,.12982,13.73189,0,0,0 +0,4.61512,1,6.907755,0,.12982,13.73189,0,0,0 +2,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +3,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +3,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +2,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +4,3.258096,0,6.55108,7.937375,0,13.73189,0,0,0 +0,4.61512,1,5.988961,0,0,13.73189,0,0,0 +6,4.61512,1,5.988961,0,0,13.73189,0,0,0 +6,4.61512,1,5.988961,0,0,13.73189,0,0,0 +3,4.61512,1,5.988961,0,0,21.7,0,0,0 +1,4.61512,1,5.988961,0,0,21.7,0,0,0 +2,4.61512,1,5.988961,0,0,21.7,0,0,0 +2,4.61512,1,5.988961,0,0,17.4,1,0,0 +2,4.61512,1,5.988961,0,0,17.4,1,0,0 +3,4.61512,1,5.988961,0,0,17.4,1,0,0 +8,4.61512,1,5.988961,0,0,13.73189,1,0,0 +3,4.61512,1,5.988961,0,0,13.73189,1,0,0 +20,4.61512,1,5.988961,0,0,13.73189,1,0,0 +7,4.61512,1,5.988961,0,0,8.7,0,0,0 +1,4.61512,1,5.988961,0,0,8.7,0,0,0 +5,4.61512,1,5.988961,0,0,8.7,0,0,0 +15,3.931826,0,5.298317,5.991465,0,8.7,1,0,0 +2,3.931826,0,5.298317,5.991465,0,8.7,1,0,0 +1,3.931826,0,5.298317,5.991465,0,8.7,1,0,0 +4,3.931826,0,5.298317,5.991465,0,8.7,1,0,0 +2,3.931826,0,5.298317,5.991465,0,8.7,1,0,0 +2,3.931826,0,4.744932,5.438079,0,8.7,1,0,0 +0,3.931826,0,4.744932,5.438079,0,8.7,1,0,0 +0,3.931826,0,4.744932,5.438079,0,8.7,1,0,0 +2,3.931826,0,4.744932,5.438079,0,8.7,1,0,0 +5,3.931826,0,4.744932,5.438079,0,8.7,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,0,0,5.673323,0,0,13.73189,0,0,0 +1,0,0,5.673323,0,0,13.73189,0,0,0 +1,0,0,5.673323,0,0,13.73189,0,0,0 +3,0,0,5.673323,0,0,13.73189,0,0,0 +1,0,0,5.673323,0,0,13.73189,0,0,0 +6,0,0,5.673323,0,0,17.4,1,0,0 +3,0,0,5.673323,0,0,17.4,1,0,0 +7,0,0,5.673323,0,0,17.4,1,0,0 +8,0,0,5.673323,0,0,17.4,1,0,0 +2,0,0,5.673323,0,0,17.4,1,0,0 +1,0,0,5.673323,0,0,13.73189,0,0,0 +0,0,0,5.673323,0,0,13.73189,0,0,0 +3,0,0,5.673323,0,0,13.73189,0,0,0 +6,0,0,5.673323,0,0,13.73189,0,0,0 +1,0,0,5.673323,0,0,13.73189,0,0,0 +2,0,0,5.673323,0,0,8.7,0,0,0 +2,0,0,5.673323,0,0,8.7,0,0,0 +5,0,0,5.673323,0,0,8.7,0,0,0 +3,0,0,5.673323,0,0,8.7,0,0,0 +2,0,0,5.673323,0,0,8.7,0,0,0 +1,4.61512,1,6.885509,0,0,13.73189,0,0,0 +3,4.61512,1,6.885509,0,0,13.73189,0,0,0 +1,4.61512,1,6.885509,0,0,13.73189,0,0,0 +2,4.61512,1,6.885509,0,0,13.73189,0,0,0 +1,4.61512,1,6.885509,0,0,13.73189,0,0,0 +2,4.61512,1,6.885509,0,0,13.73189,0,0,0 +0,4.61512,1,6.885509,0,0,13.73189,0,0,0 +3,4.61512,1,6.885509,0,0,13.73189,0,0,0 +0,4.61512,1,6.885509,0,0,13.73189,0,0,0 +22,4.61512,1,6.885509,0,0,13.73189,1,0,0 +19,4.61512,1,6.885509,0,0,13.73189,1,0,0 +14,4.61512,1,6.885509,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,0,1,0,0 +0,4.61512,1,0,0,0,0,1,0,0 +1,4.61512,1,0,0,0,0,1,0,0 +0,4.61512,1,0,0,0,0,1,0,0 +0,4.61512,1,0,0,0,0,1,0,0 +1,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +2,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +1,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,0,1,0,0 +0,4.61512,1,0,0,0,0,1,0,0 +0,4.61512,1,0,0,0,0,1,0,0 +0,4.61512,1,0,0,0,0,1,0,0 +0,4.61512,1,0,0,0,0,1,0,0 +1,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +5,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +1,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +3,0,0,5.105946,0,0,13.73189,0,0,0 +4,0,0,5.105946,0,0,13.73189,0,0,0 +1,0,0,5.105946,0,0,13.73189,0,0,0 +3,0,0,5.105946,0,0,13.73189,0,0,0 +9,0,0,5.105946,0,0,13.73189,0,0,0 +4,0,0,5.105946,0,0,13.73189,1,0,0 +11,0,0,5.105946,0,0,13.73189,1,0,0 +7,0,0,5.105946,0,0,13.73189,1,0,0 +6,0,0,5.105946,0,0,13.73189,1,0,0 +4,0,0,5.105946,0,0,13.73189,1,0,0 +2,0,0,5.105946,0,0,13.73189,0,0,0 +0,0,0,5.105946,0,0,13.73189,0,0,0 +4,0,0,5.105946,0,0,13.73189,0,0,0 +7,0,0,5.105946,0,0,13.73189,0,0,0 +11,0,0,5.105946,0,0,13.73189,0,0,0 +4,0,0,5.105946,0,0,13.73189,0,0,0 +5,0,0,5.105946,0,0,13.73189,0,0,0 +7,0,0,5.105946,0,0,13.73189,0,0,0 +4,0,0,5.105946,0,0,13.73189,0,0,0 +5,0,0,5.105946,0,0,13.73189,0,0,0 +0,0,0,5.105946,0,0,13.73189,0,0,0 +8,0,0,5.105946,0,0,13.73189,0,0,0 +4,0,0,5.105946,0,0,13.73189,0,0,0 +1,0,0,5.105946,0,0,13.73189,0,0,0 +4,0,0,5.105946,0,0,13.73189,0,0,0 +1,4.61512,1,5.351858,0,1,13.73189,0,0,1 +11,4.61512,1,5.351858,0,1,13.73189,0,0,1 +1,4.61512,1,5.351858,0,1,13.73189,0,0,1 +0,4.61512,1,4.317488,0,0,13.73189,1,0,0 +0,4.61512,1,4.317488,0,0,13.73189,1,0,0 +2,4.61512,1,4.317488,0,0,13.73189,1,0,0 +0,3.258096,0,5.129899,6.516193,0,17.4,1,0,0 +1,3.258096,0,5.129899,6.516193,0,17.4,1,0,0 +0,3.258096,0,5.129899,6.516193,0,17.4,1,0,0 +0,3.258096,0,5.129899,6.516193,0,13.73189,1,0,0 +0,3.258096,0,5.129899,6.516193,0,13.73189,1,0,0 +0,3.258096,0,5.129899,6.516193,0,13.73189,1,0,0 +0,4.61512,1,4.919981,0,.0327869,13.73189,0,0,0 +0,4.61512,1,4.919981,0,.12982,13.73189,1,0,0 +0,3.931826,0,5.187386,5.880533,.12982,13.73189,1,0,0 +0,3.931826,0,5.187386,5.880533,.12982,13.73189,1,0,0 +0,3.931826,0,5.187386,5.880533,.12982,13.73189,1,0,0 +1,3.931826,0,5.187386,5.880533,0,8.7,1,0,0 +0,3.931826,0,5.187386,5.880533,0,8.7,1,0,0 +0,3.931826,0,5.187386,5.880533,0,8.7,1,0,0 +0,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +7,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +11,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +12,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +9,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,0,0,1,13.73189,0,1,0 +2,3.258096,0,0,0,1,13.73189,0,1,0 +4,3.258096,0,0,0,1,13.73189,0,1,0 +4,3.258096,0,0,0,1,13.73189,0,1,0 +7,3.258096,0,0,0,1,13.73189,0,1,0 +20,3.258096,0,5.556828,6.590301,1,13.73189,0,1,0 +2,4.61512,1,4.844187,0,0,13.73189,1,0,0 +0,4.61512,1,4.844187,0,0,13.73189,1,0,0 +0,4.61512,1,6.476973,0,0,8.7,0,0,0 +4,4.61512,1,6.476973,0,0,8.7,0,0,0 +1,4.61512,1,6.476973,0,0,8.7,0,0,0 +2,4.61512,1,6.476973,0,0,8.7,0,0,0 +3,4.61512,1,6.476973,0,0,8.7,0,0,0 +8,4.61512,1,6.476973,0,0,8.7,0,0,0 +5,4.61512,1,6.476973,0,0,8.7,0,0,0 +4,4.61512,1,6.476973,0,0,8.7,0,0,0 +0,4.61512,1,6.476973,0,0,8.7,0,0,0 +2,4.61512,1,6.476973,0,0,8.7,0,0,0 +3,4.61512,1,6.476973,0,0,13.73189,0,0,0 +1,4.61512,1,6.476973,0,0,13.73189,0,0,0 +1,4.61512,1,6.476973,0,0,13.73189,0,0,0 +0,4.61512,1,6.476973,0,0,13.73189,0,0,0 +0,4.61512,1,6.476973,0,0,13.73189,0,0,0 +0,4.61512,1,6.476973,0,0,13.73189,0,0,0 +1,4.61512,1,6.476973,0,0,13.73189,0,0,0 +1,4.61512,1,6.476973,0,0,13.73189,0,0,0 +2,4.61512,1,6.476973,0,0,13.73189,0,0,0 +0,4.61512,1,6.476973,0,0,13.73189,0,0,0 +3,4.61512,1,6.476973,0,0,13.73189,0,0,0 +2,4.61512,1,6.476973,0,0,13.73189,0,0,0 +1,4.61512,1,6.476973,0,0,13.73189,0,0,0 +4,4.61512,1,6.476973,0,0,13.73189,0,0,0 +1,4.61512,1,6.476973,0,0,13.73189,0,0,0 +0,0,1,4.787492,0,0,21.7,0,0,0 +1,0,1,4.787492,0,0,21.7,0,0,0 +1,0,1,4.787492,0,0,21.7,0,0,0 +0,0,1,4.787492,0,0,21.7,0,0,0 +2,0,1,4.787492,0,0,21.7,0,0,0 +0,0,1,4.787492,0,0,0,0,0,0 +0,0,1,4.787492,0,0,0,0,0,0 +0,0,1,4.787492,0,0,0,0,0,0 +0,0,1,4.787492,0,0,0,0,0,0 +1,0,1,4.787492,0,0,0,0,0,0 +1,0,1,4.787492,0,0,13.73189,0,0,0 +1,0,1,4.787492,0,0,13.73189,0,0,0 +1,0,1,4.787492,0,0,13.73189,0,0,0 +0,0,1,4.787492,0,0,13.73189,0,0,0 +3,0,1,4.787492,0,0,13.73189,0,0,0 +2,0,1,4.787492,0,0,13.73189,0,0,0 +1,0,1,4.787492,0,0,13.73189,0,0,0 +0,0,1,4.787492,0,0,13.73189,0,0,0 +1,0,1,4.787492,0,0,13.73189,0,0,0 +4,0,1,4.787492,0,0,13.73189,0,0,0 +0,3.258096,0,6.871091,8.257385,0,4.3,0,0,0 +0,3.258096,0,6.871091,8.257385,0,4.3,0,0,0 +5,3.258096,0,6.871091,8.257385,0,4.3,0,0,0 +4,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +2,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +1,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +2,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +1,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +2,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +1,3.258096,0,6.871091,8.257385,1,13.73189,0,0,0 +2,3.258096,0,6.871091,8.257385,1,13.73189,0,0,0 +1,3.258096,0,6.871091,8.257385,1,13.73189,0,0,0 +2,3.258096,0,6.871091,8.257385,0,13,0,0,0 +1,3.258096,0,6.871091,8.257385,0,13,0,0,0 +1,3.258096,0,6.871091,8.257385,0,13,0,0,0 +6,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +1,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +1,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +4,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +1,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +1,3.258096,0,6.871091,8.257385,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13,1,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,17.4,0,0,0 +4,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +3,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +2,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +3,0,0,5.451038,0,0,13.73189,0,0,0 +6,0,0,5.451038,0,0,13.73189,0,0,0 +3,0,0,5.451038,0,0,13.73189,0,0,0 +4,0,0,5.451038,0,0,13.73189,0,0,0 +6,0,0,5.451038,0,0,13.73189,0,0,0 +4,0,0,5.451038,0,0,13,0,0,0 +10,0,0,5.451038,0,0,13,0,0,0 +3,0,0,5.451038,0,0,13,0,0,0 +7,0,0,5.451038,0,0,13,0,0,0 +5,0,0,5.451038,0,0,13,0,0,0 +5,0,0,5.451038,0,0,13.73189,0,0,0 +3,0,0,5.451038,0,0,13.73189,0,0,0 +5,0,0,5.451038,0,0,13.73189,0,0,0 +2,0,0,5.451038,0,0,13.73189,0,0,0 +4,0,0,5.451038,0,0,13.73189,0,0,0 +4,0,0,5.451038,0,0,4.3,0,0,0 +7,0,0,5.451038,0,0,4.3,0,0,0 +6,0,0,5.451038,0,0,4.3,0,0,0 +12,0,0,5.451038,0,0,4.3,0,0,0 +1,0,0,5.451038,0,0,4.3,0,0,0 +13,4.61512,1,6.386879,0,1,34.8,0,1,0 +5,4.61512,1,6.386879,0,1,34.8,0,1,0 +1,4.61512,1,6.386879,0,1,34.8,0,1,0 +1,4.61512,1,6.386879,0,0,13.73189,0,1,0 +6,4.61512,1,6.386879,0,0,13.73189,0,1,0 +7,4.61512,1,6.386879,0,0,13.73189,0,1,0 +1,4.61512,1,6.386879,0,0,13.73189,0,1,0 +3,4.61512,1,6.386879,0,0,13.73189,0,1,0 +2,4.61512,1,6.386879,0,0,13.73189,0,1,0 +4,4.61512,1,6.386879,0,0,13.73189,0,0,0 +6,4.61512,1,6.386879,0,0,13.73189,0,0,0 +2,4.61512,1,6.386879,0,0,13.73189,0,0,0 +2,4.61512,1,6.386879,0,0,17.4,1,0,0 +0,4.61512,1,6.386879,0,0,17.4,1,0,0 +1,4.61512,1,6.386879,0,0,17.4,1,0,0 +6,0,0,5.796058,0,0,13,0,0,0 +0,0,0,5.796058,0,0,13,0,0,0 +1,0,0,5.796058,0,0,13,0,0,0 +3,0,0,5.796058,0,0,13,0,0,0 +2,0,0,5.796058,0,0,13,0,0,0 +0,0,0,5.796058,0,0,4.3,0,0,0 +4,0,0,5.796058,0,0,4.3,0,0,0 +3,0,0,5.796058,0,0,4.3,0,0,0 +3,0,0,5.796058,0,0,4.3,0,0,0 +2,0,0,5.796058,0,0,4.3,0,0,0 +4,0,0,5.796058,0,0,17.4,1,0,0 +11,0,0,5.796058,0,0,17.4,1,0,0 +7,0,0,5.796058,0,0,17.4,1,0,0 +3,0,0,5.796058,0,0,17.4,1,0,0 +5,0,0,5.796058,0,0,17.4,1,0,0 +1,4.61512,1,6.791222,0,0,13.73189,0,0,0 +2,4.61512,1,6.791222,0,0,13.73189,0,0,0 +1,4.61512,1,6.791222,0,0,13.73189,0,0,0 +1,4.61512,1,6.791222,0,0,13.73189,0,0,0 +3,4.61512,1,6.791222,0,0,13.73189,0,0,0 +4,4.61512,1,6.791222,0,0,0,0,0,0 +3,4.61512,1,6.791222,0,0,0,0,0,0 +2,4.61512,1,6.791222,0,0,0,0,0,0 +1,4.61512,1,6.791222,0,0,0,0,0,0 +4,4.61512,1,6.791222,0,0,0,0,0,0 +2,4.61512,1,6.791222,0,0,8.7,0,0,0 +3,4.61512,1,6.791222,0,0,8.7,0,0,0 +6,4.61512,1,6.791222,0,0,8.7,0,0,0 +0,4.61512,1,6.791222,0,0,8.7,0,0,0 +2,4.61512,1,6.791222,0,0,8.7,0,0,0 +2,0,0,5.273,0,0,4.3,0,0,0 +3,0,0,5.273,0,0,4.3,0,0,0 +1,0,0,5.273,0,0,4.3,0,0,0 +0,0,0,5.273,0,0,4.3,0,0,0 +0,0,0,5.273,0,0,4.3,0,0,0 +4,0,0,5.273,0,0,4.3,0,0,0 +2,0,0,5.273,0,0,4.3,0,0,0 +1,0,0,5.273,0,0,4.3,0,0,0 +2,0,0,5.273,0,0,4.3,0,0,0 +7,0,0,5.273,0,0,0,0,0,0 +1,0,0,5.273,0,0,0,0,0,0 +2,0,0,5.273,0,0,0,0,0,0 +1,0,0,5.273,0,0,0,0,0,0 +4,0,0,5.273,0,0,0,0,0,0 +2,0,0,5.273,0,0,0,0,0,0 +3,0,0,5.273,0,0,0,0,0,0 +0,0,0,5.273,0,0,0,0,0,0 +4,0,0,5.273,0,0,0,0,0,0 +1,0,0,5.273,0,0,0,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,1,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,1,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,1,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,1,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,1,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +19,3.258096,0,6.907755,8.294049,1,13.73189,0,1,0 +11,3.258096,0,6.907755,8.294049,1,13.73189,0,1,0 +8,3.258096,0,6.907755,8.294049,1,13.73189,0,1,0 +1,3.258096,0,6.907755,8.294049,1,13.73189,0,1,0 +3,3.258096,0,6.907755,8.294049,1,13.73189,0,1,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +1,0,0,5.278115,0,0,13,0,0,0 +2,0,0,5.278115,0,0,13,0,0,0 +5,0,0,5.278115,0,0,13,0,0,0 +3,0,0,5.278115,0,0,13,0,0,0 +0,0,0,5.278115,0,0,13,0,0,0 +4,0,0,5.278115,0,0,13.73189,0,0,0 +3,0,0,5.278115,0,0,13.73189,0,0,0 +0,0,0,5.278115,0,0,13.73189,0,0,0 +1,0,0,5.278115,0,0,13.73189,0,0,0 +2,0,0,5.278115,0,0,13.73189,0,0,0 +20,0,0,5.278115,0,0,13.73189,1,0,0 +9,0,0,5.278115,0,0,13.73189,1,0,0 +26,0,0,5.278115,0,0,13.73189,1,0,0 +28,0,0,5.278115,0,0,13.73189,1,0,0 +33,0,0,5.278115,0,0,13.73189,1,0,0 +13,0,0,5.278115,0,0,8.7,0,0,0 +11,0,0,5.278115,0,0,8.7,0,0,0 +12,0,0,5.278115,0,0,8.7,0,0,0 +7,0,0,5.278115,0,0,8.7,0,0,0 +16,0,0,5.278115,0,0,8.7,0,0,0 +6,0,0,5.278115,0,0,8.7,0,0,0 +3,0,0,5.278115,0,0,8.7,0,0,0 +6,0,0,5.278115,0,0,8.7,0,0,0 +7,0,0,5.278115,0,0,8.7,0,0,0 +6,0,0,5.278115,0,0,8.7,0,0,0 +2,0,0,5.278115,0,0,13.73189,0,0,0 +0,0,0,5.278115,0,0,13.73189,0,0,0 +0,0,0,5.278115,0,0,13.73189,0,0,0 +3,0,0,5.278115,0,0,13.73189,0,0,0 +3,0,0,5.278115,0,0,13.73189,0,0,0 +2,3.258096,0,5.883322,7.269617,0,13.73189,1,0,0 +1,3.258096,0,5.883322,7.269617,0,13.73189,1,0,0 +0,3.258096,0,5.883322,7.269617,0,13.73189,1,0,0 +2,3.258096,0,5.883322,7.269617,0,13.73189,1,0,0 +3,3.258096,0,5.883322,7.269617,0,13.73189,1,0,0 +4,3.258096,0,5.883322,7.269617,0,13.73189,1,0,0 +1,3.258096,0,5.883322,7.269617,0,13.73189,1,0,0 +1,3.258096,0,5.883322,7.269617,0,13.73189,1,0,0 +1,3.258096,0,5.883322,7.269617,0,13.73189,1,0,0 +2,0,1,5.703783,0,0,8.7,1,0,0 +6,0,1,5.703783,0,0,8.7,1,0,0 +1,0,1,5.703783,0,0,8.7,1,0,0 +0,0,1,5.703783,0,0,4.3,1,0,0 +7,0,1,5.703783,0,0,4.3,1,0,0 +6,0,1,5.703783,0,0,4.3,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +37,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +11,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +6,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +8,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,1,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +3,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +2,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +0,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +3,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +0,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +1,0,0,0,0,0,17.4,0,0,0 +4,0,0,0,0,0,17.4,0,0,0 +1,0,0,0,0,0,17.4,0,0,0 +0,0,0,0,0,0,17.4,0,0,0 +1,0,0,0,0,0,17.4,0,0,0 +3,0,0,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,8.7,0,0,0 +3,0,0,0,0,0,8.7,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +3,0,0,0,0,0,8.7,0,0,0 +6,0,0,0,0,0,8.7,0,0,0 +7,0,0,0,0,0,8.7,0,0,0 +8,0,0,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,8.7,0,0,0 +2,0,0,0,0,0,17.4,0,0,0 +0,0,0,0,0,0,17.4,0,0,0 +0,0,0,0,0,0,17.4,0,0,0 +2,0,0,0,0,0,17.4,0,0,0 +0,0,0,0,0,0,17.4,0,0,0 +12,0,1,0,0,1,47.8,0,0,1 +38,0,1,0,0,1,30.4,1,0,0 +11,0,1,0,0,1,30.4,1,0,0 +6,0,1,0,0,1,30.4,1,0,0 +9,0,1,0,0,1,30.4,1,0,0 +7,0,1,0,0,1,30.4,1,0,0 +27,3.931826,0,6.408529,7.101676,1,13.73189,0,0,1 +0,3.931826,0,6.408529,7.101676,1,13.73189,0,0,1 +0,3.931826,0,6.408529,7.101676,1,13.73189,0,0,1 +0,3.931826,0,6.408529,7.101676,0,13.73189,1,0,0 +9,3.931826,0,6.408529,7.101676,0,13.73189,1,0,0 +11,3.931826,0,6.408529,7.101676,0,13.73189,1,0,0 +0,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +0,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +0,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +0,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +0,3.931826,0,6.907755,7.600903,0,4.3,0,0,0 +2,3.931826,0,6.907755,7.600903,0,17.4,0,0,0 +3,3.931826,0,6.907755,7.600903,0,17.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,17.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,17.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,17.4,0,0,0 +2,3.931826,0,6.50129,7.194437,0,17.4,1,0,0 +3,3.931826,0,6.50129,7.194437,0,17.4,1,0,0 +2,3.931826,0,6.50129,7.194437,0,17.4,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13,1,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,8.7,1,0,0 +1,4.61512,1,6.855409,0,0,8.7,0,0,0 +0,4.61512,1,6.855409,0,0,8.7,0,0,0 +0,4.61512,1,6.855409,0,0,8.7,0,0,0 +13,4.61512,1,6.855409,0,0,30.4,0,0,0 +8,4.61512,1,6.855409,0,0,30.4,0,0,0 +11,4.61512,1,6.855409,0,0,30.4,0,0,0 +1,4.61512,1,6.907755,0,0,21.7,1,0,0 +4,4.61512,1,6.907755,0,0,21.7,1,0,0 +1,4.61512,1,6.907755,0,0,21.7,1,0,0 +2,4.61512,1,6.907755,0,0,21.7,1,0,0 +3,4.61512,1,6.907755,0,0,21.7,1,0,0 +5,4.61512,1,6.907755,0,1,30.4,0,1,0 +2,4.61512,1,6.907755,0,1,30.4,0,1,0 +3,4.61512,1,6.907755,0,1,30.4,0,1,0 +13,4.61512,1,6.907755,0,1,30.4,0,1,0 +6,4.61512,1,6.907755,0,1,30.4,0,1,0 +1,3.931826,0,6.536692,7.229839,0,13.73189,0,0,0 +0,3.931826,0,6.536692,7.229839,0,13.73189,0,0,0 +1,3.931826,0,6.536692,7.229839,0,13.73189,0,0,0 +2,3.931826,0,6.536692,7.229839,0,13.73189,0,0,0 +2,3.931826,0,6.536692,7.229839,0,13.73189,0,0,0 +3,3.931826,0,6.536692,7.229839,0,13.73189,0,0,0 +9,3.931826,0,6.536692,7.229839,1,13.73189,1,0,0 +7,3.931826,0,6.536692,7.229839,1,13.73189,1,0,0 +5,3.931826,0,6.536692,7.229839,1,13.73189,1,0,0 +0,3.931826,0,6.536692,7.229839,0,13.73189,0,0,0 +0,3.931826,0,6.536692,7.229839,0,13.73189,0,0,0 +1,3.931826,0,6.536692,7.229839,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +6,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +8,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,0,0,0,0 +3,3.931826,0,6.907755,7.600903,0,0,0,0,0 +4,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +1,3.931826,0,6.907755,7.600903,0,0,0,0,0 +2,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +2,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +4,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +2,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +4,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +3,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +2,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +1,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,4.61512,1,6.802395,0,0,13,0,0,0 +0,4.61512,1,6.802395,0,0,13,0,0,0 +0,4.61512,1,6.802395,0,0,13,0,0,0 +0,4.61512,1,6.802395,0,0,13,0,0,0 +1,4.61512,1,6.802395,0,0,13,0,0,0 +0,4.61512,1,6.802395,0,0,13,0,0,0 +3,4.61512,1,6.802395,0,0,13.73189,0,0,0 +1,4.61512,1,6.802395,0,0,13.73189,0,0,0 +1,4.61512,1,6.802395,0,0,13.73189,0,0,0 +1,4.61512,1,6.802395,0,0,13.73189,0,0,0 +1,4.61512,1,6.802395,0,0,13.73189,0,0,0 +1,4.61512,1,6.802395,0,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +22,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +41,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +22,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +65,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +0,0,0,5.257495,0,0,8.7,1,0,0 +2,0,0,5.257495,0,0,8.7,1,0,0 +0,0,0,5.257495,0,0,8.7,1,0,0 +2,0,0,5.257495,0,0,17.4,1,0,0 +3,0,0,5.257495,0,0,17.4,1,0,0 +1,0,0,5.257495,0,0,17.4,1,0,0 +4,0,0,5.257495,0,0,13.73189,0,0,0 +0,0,0,5.257495,0,0,13.73189,0,0,0 +3,0,0,5.257495,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13.73189,0,0,0 +2,0,0,4.094345,0,0,13.73189,0,0,0 +1,0,0,4.094345,0,0,13.73189,0,0,0 +4,0,0,4.094345,0,0,13.73189,0,0,0 +2,0,0,4.094345,0,0,13.73189,0,0,0 +34,0,0,4.094345,0,0,13.73189,1,0,0 +22,0,0,4.094345,0,0,13.73189,1,0,0 +31,0,0,4.094345,0,0,13.73189,1,0,0 +4,0,0,4.094345,0,0,13.73189,1,0,0 +7,0,0,4.094345,0,0,13.73189,1,0,0 +2,0,0,4.094345,0,0,17.4,0,0,0 +4,0,0,4.094345,0,0,17.4,0,0,0 +2,0,0,4.094345,0,0,17.4,0,0,0 +10,0,0,4.094345,0,0,17.4,0,0,0 +12,0,0,4.094345,0,0,17.4,0,0,0 +28,0,0,4.094345,0,0,13,0,0,0 +9,0,0,4.094345,0,0,13,0,0,0 +1,0,0,4.094345,0,0,13,0,0,0 +9,0,0,4.094345,0,0,13,0,0,0 +24,0,0,4.094345,0,0,13,0,0,0 +6,0,0,5.552959,0,0,17.4,1,0,0 +5,0,0,5.552959,0,0,17.4,1,0,0 +6,0,0,5.552959,0,0,17.4,1,0,0 +11,0,0,5.552959,0,0,17.4,1,0,0 +10,0,0,5.552959,0,0,17.4,1,0,0 +4,0,0,4.430817,0,0,13,0,0,0 +4,0,0,4.430817,0,0,13,0,0,0 +5,0,0,4.430817,0,0,13,0,0,0 +4,0,0,4.430817,0,0,13,0,0,0 +10,0,0,4.430817,0,0,13,0,0,0 +16,0,0,4.430817,0,0,13,0,0,0 +8,0,0,4.430817,0,0,13,0,0,0 +7,0,0,4.430817,0,0,13,0,0,0 +5,0,0,4.430817,0,0,13,0,0,0 +7,0,0,4.430817,0,0,13,0,0,0 +4,0,0,4.430817,0,0,13,0,0,0 +1,0,0,4.430817,0,0,13,0,0,0 +4,0,0,4.430817,0,0,13,0,0,0 +4,0,0,4.430817,0,0,13,0,0,0 +2,0,0,4.430817,0,0,13,0,0,0 +4,0,0,4.430817,0,0,13.73189,1,0,0 +11,0,0,4.430817,0,0,13.73189,1,0,0 +13,0,0,4.430817,0,0,13.73189,1,0,0 +6,0,0,4.430817,0,0,13.73189,1,0,0 +9,0,0,4.430817,0,0,13.73189,1,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +9,0,0,0,0,0,13.73189,0,0,0 +5,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +12,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +8,0,0,0,0,0,13.73189,0,0,0 +18,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +6,0,0,0,0,0,13.73189,1,0,0 +5,0,0,0,0,0,13.73189,1,0,0 +6,0,0,0,0,0,13.73189,1,0,0 +2,3.931826,0,6.907755,7.600903,0,8.7,1,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,1,0,0 +4,3.931826,0,6.907755,7.600903,0,8.7,1,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,1,0,0 +0,3.931826,0,6.907755,7.600903,0,8.7,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13,1,0,0 +1,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +2,0,1,0,0,0,13.73189,0,0,0 +2,0,1,0,0,0,13.73189,0,0,0 +1,0,1,0,0,0,13.73189,0,0,0 +10,0,1,0,0,1,30.4,1,0,0 +3,0,1,0,0,1,30.4,1,0,0 +1,0,1,0,0,1,30.4,1,0,0 +2,0,1,0,0,1,30.4,1,0,0 +0,0,1,0,0,1,30.4,1,0,0 +3,0,1,0,0,0,0,0,0,0 +0,0,1,0,0,0,0,0,0,0 +0,0,1,0,0,0,0,0,0,0 +0,0,1,0,0,0,0,0,0,0 +3,0,1,0,0,0,0,0,0,0 +2,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +2,0,1,0,0,0,13.73189,0,0,0 +1,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +6,0,1,0,0,0,13.73189,0,0,0 +0,0,1,0,0,0,13.73189,0,0,0 +1,0,1,0,0,0,13.73189,0,0,0 +4,0,1,0,0,0,13.73189,0,0,0 +1,0,1,0,0,0,13.73189,0,0,0 +11,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +7,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +9,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +6,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +4,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +8,3.931826,0,6.906755,7.599902,0,17.4,1,0,0 +6,3.931826,0,6.906755,7.599902,0,17.4,1,0,0 +6,3.931826,0,6.906755,7.599902,0,17.4,1,0,0 +6,3.931826,0,6.906755,7.599902,0,17.4,1,0,0 +12,3.931826,0,6.906755,7.599902,0,17.4,1,0,0 +3,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +7,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +13,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +10,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +2,3.931826,0,6.906755,7.599902,0,13.73189,1,0,0 +2,3.931826,0,6.906755,7.599902,0,26.1,1,0,0 +2,3.931826,0,6.906755,7.599902,0,26.1,1,0,0 +4,3.931826,0,6.906755,7.599902,0,26.1,1,0,0 +3,3.931826,0,6.906755,7.599902,0,26.1,1,0,0 +4,3.931826,0,6.906755,7.599902,0,26.1,1,0,0 +8,0,0,3.178054,0,1,13.73189,1,0,0 +1,0,0,3.178054,0,1,13.73189,1,0,0 +0,0,0,3.178054,0,1,13.73189,1,0,0 +0,3.931826,0,6.309918,7.003066,1,8.7,1,0,0 +0,3.931826,0,6.309918,7.003066,1,8.7,1,0,0 +0,3.931826,0,6.309918,7.003066,1,8.7,1,0,0 +0,3.931826,0,6.309918,7.003066,1,8.7,1,0,0 +0,3.931826,0,6.309918,7.003066,1,8.7,1,0,0 +1,3.931826,0,6.309918,7.003066,0,8.7,1,0,0 +0,3.931826,0,6.309918,7.003066,0,8.7,1,0,0 +0,3.931826,0,6.309918,7.003066,0,8.7,1,0,0 +4,3.931826,0,6.309918,7.003066,0,8.7,1,0,0 +10,3.931826,0,6.309918,7.003066,0,21.7,1,0,0 +22,3.931826,0,6.309918,7.003066,0,21.7,1,0,0 +8,3.931826,0,6.309918,7.003066,0,21.7,1,0,0 +22,3.931826,0,6.309918,7.003066,0,21.7,1,0,0 +18,3.931826,0,6.309918,7.003066,0,21.7,1,0,0 +7,4.61512,1,6.802395,0,0,4.3,0,0,0 +7,4.61512,1,6.802395,0,0,4.3,0,0,0 +2,4.61512,1,6.802395,0,0,4.3,0,0,0 +0,4.61512,1,6.802395,0,0,4.3,0,0,0 +3,4.61512,1,6.802395,0,0,4.3,0,0,0 +0,4.61512,1,6.802395,0,0,4.3,0,0,0 +6,4.61512,1,6.802395,0,0,0,0,0,0 +5,4.61512,1,6.802395,0,0,0,0,0,0 +7,4.61512,1,6.802395,0,0,0,0,0,0 +2,4.61512,1,6.802395,0,0,17.4,0,0,0 +8,4.61512,1,6.802395,0,0,17.4,0,0,0 +3,4.61512,1,6.802395,0,0,17.4,0,0,0 +3,4.61512,1,6.802395,0,0,13.73189,0,0,0 +4,4.61512,1,6.802395,0,0,13.73189,0,0,0 +2,4.61512,1,6.802395,0,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13,1,0,0 +3,3.931826,0,6.907755,7.600903,0,13,1,0,0 +1,3.931826,0,6.907755,7.600903,0,13,1,0,0 +2,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +2,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +1,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +1,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +2,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +1,0,0,6.408529,0,0,13,1,0,0 +2,0,0,6.408529,0,0,13,1,0,0 +1,0,0,6.408529,0,0,13,1,0,0 +5,0,0,6.408529,0,1,34.8,1,0,0 +9,0,0,6.408529,0,1,34.8,1,0,0 +11,0,0,6.408529,0,1,34.8,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +2,3.931826,0,6.907755,7.600903,0,8.7,0,0,0 +5,3.931826,0,5.003946,5.697093,0,17.4,0,0,0 +3,3.931826,0,5.003946,5.697093,0,17.4,0,0,0 +2,3.931826,0,5.003946,5.697093,0,17.4,0,0,0 +5,3.931826,0,5.003946,5.697093,0,17.4,0,0,0 +4,3.931826,0,5.003946,5.697093,0,17.4,0,0,0 +3,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +2,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +6,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +4,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +3,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +4,3.931826,0,5.003946,5.697093,0,13.73189,1,0,0 +3,3.931826,0,5.003946,5.697093,0,13.73189,1,0,0 +0,3.931826,0,5.003946,5.697093,0,13.73189,1,0,0 +0,3.931826,0,5.003946,5.697093,0,13.73189,1,0,0 +3,3.931826,0,5.003946,5.697093,0,13.73189,1,0,0 +4,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +2,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +6,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +0,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +5,3.931826,0,5.003946,5.697093,0,13.73189,0,0,0 +3,4.61512,1,6.75227,0,0,13.73189,0,0,0 +0,4.61512,1,6.75227,0,0,13.73189,0,0,0 +1,4.61512,1,6.75227,0,0,13.73189,0,0,0 +2,4.61512,1,6.75227,0,0,13.73189,0,0,0 +0,4.61512,1,6.75227,0,0,13.73189,0,0,0 +6,4.61512,1,6.75227,0,0,13.73189,0,0,0 +0,4.61512,1,6.75227,0,0,13.73189,0,0,0 +3,4.61512,1,6.75227,0,0,13.73189,0,0,0 +1,4.61512,1,6.75227,0,0,13.73189,0,0,0 +0,4.61512,1,6.75227,0,0,13.73189,0,0,0 +2,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +7,4.61512,1,6.907755,0,0,13.73189,0,0,0 +4,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,3.931826,0,5.852202,6.190315,0,13.73189,1,0,0 +0,3.931826,0,5.852202,6.190315,0,13.73189,1,0,0 +1,3.931826,0,5.852202,6.190315,0,13.73189,1,0,0 +2,3.931826,0,5.852202,6.190315,1,30.4,0,1,0 +0,3.931826,0,5.852202,6.190315,1,30.4,0,1,0 +0,3.931826,0,5.852202,6.190315,1,30.4,0,1,0 +4,4.61512,1,6.907755,0,0,8.7,1,0,0 +1,4.61512,1,6.907755,0,0,8.7,1,0,0 +1,4.61512,1,6.907755,0,0,8.7,1,0,0 +3,4.61512,1,6.907755,0,0,13,1,0,0 +3,4.61512,1,6.907755,0,0,13,1,0,0 +1,4.61512,1,6.907755,0,0,13,1,0,0 +0,0,0,5.783825,0,0,13.73189,0,0,0 +0,0,0,5.783825,0,0,13.73189,0,0,0 +3,0,0,5.783825,0,0,13.73189,0,0,0 +6,0,0,5.783825,0,0,13.73189,0,0,0 +5,0,0,5.783825,0,0,13.73189,0,0,0 +1,0,0,5.783825,0,0,13.73189,0,0,0 +1,0,0,5.783825,0,0,13.73189,0,0,0 +4,0,0,5.783825,0,0,13.73189,0,0,0 +0,0,0,5.783825,0,0,13.73189,0,0,0 +1,0,0,5.783825,0,0,13.73189,0,0,0 +5,0,0,5.783825,0,0,8.7,0,0,0 +8,0,0,5.783825,0,0,8.7,0,0,0 +1,0,0,5.783825,0,0,8.7,0,0,0 +1,0,0,5.783825,0,0,8.7,0,0,0 +0,0,0,5.783825,0,0,8.7,0,0,0 +1,0,0,5.783825,0,0,13.73189,0,0,0 +1,0,0,5.783825,0,0,13.73189,0,0,0 +2,0,0,5.783825,0,0,13.73189,0,0,0 +1,0,0,5.783825,0,0,13.73189,0,0,0 +0,0,0,5.783825,0,0,13.73189,0,0,0 +4,0,0,5.783825,0,0,0,0,0,0 +4,0,0,5.783825,0,0,0,0,0,0 +9,0,0,5.783825,0,0,0,0,0,0 +4,0,0,5.783825,0,0,0,0,0,0 +7,0,0,5.783825,0,0,0,0,0,0 +0,0,0,5.783825,0,0,0,1,0,0 +2,0,0,5.783825,0,0,0,1,0,0 +0,0,0,5.783825,0,0,0,1,0,0 +4,0,0,5.783825,0,0,0,1,0,0 +0,0,0,5.783825,0,0,0,1,0,0 +0,0,0,5.783825,0,0,13.73189,0,0,0 +1,0,0,5.783825,0,0,13.73189,0,0,0 +1,0,0,5.783825,0,0,13.73189,0,0,0 +0,0,0,5.783825,0,0,13.73189,0,0,0 +0,0,0,5.783825,0,0,13.73189,0,0,0 +3,0,0,5.746203,0,1,26.1,0,0,1 +7,0,0,5.746203,0,1,26.1,0,0,1 +6,0,0,5.746203,0,1,26.1,0,0,1 +3,0,0,5.746203,0,0,17.4,0,1,0 +8,0,0,5.746203,0,0,17.4,0,1,0 +0,0,0,5.746203,0,0,17.4,0,1,0 +9,0,0,5.746203,0,1,34.8,0,0,1 +8,0,0,5.746203,0,1,34.8,0,0,1 +6,0,0,5.746203,0,1,34.8,0,0,1 +2,0,0,0,0,0,13.73189,0,0,0 +9,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +0,0,0,5.31812,0,0,13.73189,0,0,0 +0,0,0,5.31812,0,0,13.73189,0,0,0 +0,0,0,5.31812,0,0,13.73189,0,0,0 +0,0,0,5.31812,0,0,13.73189,0,0,0 +1,0,0,5.31812,0,0,13.73189,0,0,0 +12,3.258096,0,5.986452,6.79794,0,13.73189,0,0,0 +12,3.258096,0,5.986452,6.79794,0,13.73189,0,0,0 +7,3.258096,0,5.986452,6.79794,0,13.73189,0,0,0 +21,3.258096,0,5.986452,6.79794,1,30.4,0,0,1 +10,3.258096,0,5.986452,6.79794,1,30.4,0,0,1 +12,3.258096,0,5.986452,6.79794,1,30.4,0,0,1 +38,3.258096,0,5.986452,6.79794,0,26.1,1,0,0 +13,3.258096,0,5.986452,6.79794,0,26.1,1,0,0 +15,3.258096,0,5.986452,6.79794,0,26.1,1,0,0 +35,3.258096,0,5.986452,6.79794,0,13.73189,0,0,0 +46,3.258096,0,5.986452,6.79794,0,13.73189,0,0,0 +31,3.258096,0,5.986452,6.79794,0,13.73189,0,0,0 +13,3.258096,0,5.627621,7.013916,1,13.73189,0,0,0 +1,0,0,0,0,0,8.7,1,0,0 +2,0,0,0,0,0,8.7,1,0,0 +0,0,0,0,0,0,8.7,1,0,0 +1,0,0,0,0,0,13,0,1,0 +0,0,0,0,0,0,13,0,1,0 +0,0,0,0,0,0,13,0,1,0 +1,0,0,0,0,0,13,0,1,0 +1,0,0,0,0,0,13,0,1,0 +3,0,0,0,0,0,13,0,1,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +1,4.61512,1,0,0,0,13.73189,0,0,0 +1,4.61512,1,0,0,1,17.4,0,0,0 +3,4.61512,1,0,0,1,17.4,0,0,0 +2,4.61512,1,0,0,1,17.4,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +2,4.61512,1,0,0,0,8.7,0,0,0 +0,4.61512,1,0,0,0,8.7,0,0,0 +0,4.61512,1,0,0,0,8.7,0,0,0 +0,4.61512,1,0,0,1,13,1,0,0 +0,4.61512,1,0,0,1,13,1,0,0 +0,4.61512,1,0,0,1,13,1,0,0 +0,4.61512,1,5.56452,0,0,13.73189,1,0,0 +13,4.61512,1,5.56452,0,0,13.73189,1,0,0 +6,4.61512,1,5.56452,0,0,13.73189,1,0,0 +1,4.61512,1,5.56452,0,0,13.73189,1,0,0 +4,4.61512,1,5.56452,0,0,13.73189,1,0,0 +3,0,0,5.556828,0,1,39.1,1,0,0 +7,0,0,5.556828,0,1,39.1,1,0,0 +10,0,0,5.556828,0,1,39.1,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,21.7,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13.73189,1,0,0 +9,3.258096,0,6.39693,7.783224,0,17.4,1,0,0 +15,3.258096,0,6.39693,7.783224,0,17.4,1,0,0 +19,3.258096,0,6.39693,7.783224,0,17.4,1,0,0 +2,3.258096,0,6.39693,7.783224,0,17.4,1,0,0 +3,3.258096,0,6.39693,7.783224,0,17.4,1,0,0 +9,3.258096,0,0,0,0,30.4,0,1,0 +12,3.258096,0,0,0,0,30.4,0,1,0 +9,3.258096,0,0,0,0,30.4,0,1,0 +8,3.258096,0,0,0,0,30.4,0,1,0 +12,3.258096,0,0,0,0,30.4,0,1,0 +2,3.258096,0,0,0,0,13.73189,1,0,0 +1,3.258096,0,0,0,0,13.73189,1,0,0 +2,3.258096,0,0,0,0,13.73189,1,0,0 +1,3.258096,0,0,0,0,13.73189,1,0,0 +2,3.258096,0,0,0,0,13.73189,1,0,0 +2,3.258096,0,0,0,0,8.7,1,0,0 +2,3.258096,0,0,0,0,8.7,1,0,0 +5,3.258096,0,0,0,0,8.7,1,0,0 +4,3.258096,0,0,0,0,8.7,1,0,0 +8,3.258096,0,0,0,0,8.7,1,0,0 +11,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +2,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +3,0,0,0,0,0,13.73189,1,0,0 +4,0,0,0,0,0,13.73189,1,0,0 +13,0,0,0,0,0,26.1,1,0,0 +14,0,0,0,0,0,26.1,1,0,0 +2,0,0,0,0,0,26.1,1,0,0 +10,0,0,0,0,0,13,1,0,0 +4,0,0,0,0,0,13,1,0,0 +3,0,0,0,0,0,13,1,0,0 +0,3.931826,0,0,5.111988,0,13.73189,0,0,0 +0,3.931826,0,0,5.111988,0,13.73189,0,0,0 +0,3.931826,0,0,5.111988,0,13.73189,0,0,0 +3,3.931826,0,0,5.111988,0,13.73189,0,0,0 +0,3.931826,0,0,5.111988,0,13.73189,0,0,0 +6,3.931826,0,0,5.111988,0,13.73189,0,0,0 +8,3.931826,0,0,5.111988,0,13.73189,0,0,0 +17,3.931826,0,0,5.111988,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +1,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +3,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,26.1,0,1,0 +0,0,0,0,0,0,26.1,0,1,0 +0,0,0,0,0,0,26.1,0,1,0 +0,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,13.73189,0,1,0 +1,0,0,4.983607,0,0,4.3,0,0,0 +6,0,0,4.983607,0,0,4.3,0,0,0 +2,0,0,4.983607,0,0,4.3,0,0,0 +9,0,0,4.983607,0,0,8.7,0,0,0 +3,0,0,4.983607,0,0,8.7,0,0,0 +3,0,0,4.983607,0,0,8.7,0,0,0 +5,0,0,5.277298,0,0,8.7,1,0,0 +2,0,0,5.277298,0,0,8.7,1,0,0 +3,0,0,5.277298,0,0,8.7,1,0,0 +2,0,0,5.277298,0,.12982,13.73189,0,0,0 +6,0,0,5.277298,0,.12982,13.73189,0,0,0 +2,0,0,5.277298,0,.12982,13.73189,0,0,0 +3,0,0,5.277298,0,0,13.73189,0,0,0 +2,0,0,5.277298,0,0,13.73189,0,0,0 +4,0,0,5.277298,0,0,13.73189,0,0,0 +3,0,0,5.277298,0,0,13.73189,0,0,0 +5,0,0,5.277298,0,0,13.73189,0,0,0 +4,0,0,5.277298,0,0,13.73189,0,0,0 +8,0,0,5.277298,0,0,21.7,0,0,0 +10,0,0,5.277298,0,0,21.7,0,0,0 +10,0,0,5.277298,0,0,21.7,0,0,0 +0,3.931826,0,5.988961,6.682108,0,13.73189,1,0,0 +1,3.931826,0,5.988961,6.682108,0,13.73189,1,0,0 +0,3.931826,0,5.988961,6.682108,0,13.73189,1,0,0 +0,3.931826,0,5.988961,6.682108,0,13.73189,1,0,0 +1,3.931826,0,5.988961,6.682108,0,13.73189,1,0,0 +7,3.931826,0,5.988961,6.682108,0,8.7,1,0,0 +10,3.931826,0,5.988961,6.682108,0,8.7,1,0,0 +4,3.931826,0,5.988961,6.682108,0,8.7,1,0,0 +0,3.931826,0,5.988961,6.682108,0,8.7,1,0,0 +1,3.931826,0,5.988961,6.682108,0,8.7,1,0,0 +9,3.931826,0,0,7.570443,0,13.73189,0,0,0 +1,3.931826,0,0,7.570443,0,13.73189,0,0,0 +2,3.931826,0,0,7.570443,0,13.73189,0,0,0 +4,3.931826,0,0,7.570443,0,13.73189,0,0,0 +0,3.931826,0,0,7.570443,0,13.73189,0,0,0 +1,3.931826,0,0,7.570443,0,13.73189,0,0,0 +0,3.931826,0,0,7.570443,0,13.73189,0,0,0 +0,3.931826,0,0,7.570443,0,13.73189,0,0,0 +0,3.931826,0,0,7.570443,0,13.73189,0,0,0 +0,3.931826,0,0,7.570443,0,13.73189,0,0,0 +8,3.931826,0,0,7.570443,0,13.73189,1,0,0 +5,3.931826,0,0,7.570443,0,13.73189,1,0,0 +0,3.931826,0,0,7.570443,0,13.73189,1,0,0 +0,3.931826,0,0,7.570443,0,13.73189,1,0,0 +0,3.931826,0,0,7.570443,0,13.73189,1,0,0 +3,3.931826,0,0,7.570443,0,13.73189,0,0,0 +1,3.931826,0,0,7.570443,0,13.73189,0,0,0 +0,3.931826,0,0,7.570443,0,13.73189,0,0,0 +0,3.931826,0,0,7.570443,0,13.73189,0,0,0 +0,3.931826,0,0,7.570443,0,13.73189,0,0,0 +9,3.258096,0,6.907755,8.294049,0,13,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13,1,0,0 +8,3.258096,0,6.907755,8.294049,0,13,1,0,0 +1,0,0,0,0,0,13.73189,0,1,0 +3,0,0,0,0,0,13.73189,0,1,0 +4,0,0,0,0,0,13.73189,0,1,0 +0,0,0,0,0,0,13.73189,1,0,0 +0,0,0,0,0,0,13.73189,1,0,0 +7,0,0,0,0,0,13.73189,1,0,0 +3,0,1,6.475433,0,0,13,0,0,0 +6,0,1,6.475433,0,0,13,0,0,0 +3,0,1,6.475433,0,0,13,0,0,0 +0,0,1,6.475433,0,0,0,0,0,0 +9,0,1,6.475433,0,0,0,0,0,0 +0,0,1,6.475433,0,0,0,0,0,0 +5,0,0,0,0,0,13.73189,0,0,0 +12,0,0,0,0,0,13.73189,0,0,0 +44,0,0,0,0,0,13.73189,0,0,0 +56,0,0,0,0,0,13.73189,0,0,0 +38,0,0,0,0,0,13.73189,0,0,0 +10,0,0,0,0,0,8.7,0,0,0 +4,0,0,0,0,0,8.7,0,0,0 +4,0,0,0,0,0,8.7,0,0,0 +1,0,0,0,0,0,8.7,0,0,0 +3,0,0,0,0,0,8.7,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +5,0,0,4.094345,0,0,13.73189,0,0,0 +0,0,0,4.094345,0,0,13.73189,0,0,0 +7,0,0,4.094345,0,0,13.73189,0,0,0 +7,0,0,4.094345,0,0,13.73189,0,0,0 +9,0,0,4.094345,0,0,13.73189,0,0,0 +3,0,0,4.094345,0,0,13.73189,0,0,0 +7,0,0,4.094345,0,0,13.73189,0,0,0 +4,0,0,4.094345,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,4.3,0,0,0 +5,4.61512,1,6.907755,0,0,4.3,0,0,0 +3,4.61512,1,6.907755,0,0,4.3,0,0,0 +3,4.61512,1,6.907755,0,0,8.7,0,0,0 +5,4.61512,1,6.907755,0,0,8.7,0,0,0 +1,4.61512,1,6.907755,0,0,8.7,0,0,0 +1,4.61512,1,0,0,0,0,0,0,0 +2,4.61512,1,0,0,0,0,0,0,0 +0,4.61512,1,0,0,0,0,0,0,0 +0,4.61512,1,0,0,0,0,0,0,0 +4,0,0,0,0,0,4.3,0,0,0 +5,0,0,0,0,0,4.3,0,0,0 +3,0,0,0,0,0,4.3,0,0,0 +8,0,0,0,0,0,0,0,0,0 +10,0,0,0,0,0,0,0,0,0 +7,0,0,0,0,0,0,0,0,0 +13,0,0,0,0,1,39.1,0,0,0 +10,0,0,0,0,1,39.1,0,0,0 +11,0,0,0,0,1,39.1,0,0,0 +5,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +3,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,8.7,0,0,0 +13,3.258096,0,6.907755,8.294049,0,13,1,0,0 +16,3.258096,0,6.907755,8.294049,0,13,1,0,0 +7,3.258096,0,6.907755,8.294049,0,13,1,0,0 +4,3.931826,0,5.988961,6.682108,0,13.73189,1,0,0 +3,3.931826,0,5.988961,6.682108,0,13.73189,1,0,0 +0,3.931826,0,5.988961,6.682108,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,13,0,0,0 +0,4.61512,1,0,0,0,13,0,0,0 +0,4.61512,1,0,0,0,13,0,0,0 +1,4.61512,1,0,0,0,13,0,0,0 +1,4.61512,1,0,0,0,13,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +1,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,8.7,0,0,0 +0,4.61512,1,0,0,0,8.7,0,0,0 +7,4.61512,1,0,0,0,8.7,0,0,0 +1,4.61512,1,0,0,0,8.7,0,0,0 +3,4.61512,1,0,0,0,8.7,0,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +8,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +6,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +11,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +5,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +6,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +6,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +10,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +30,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +18,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +18,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +17,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +14,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +19,3.258096,0,6.907755,8.294049,1,26.1,1,0,0 +23,3.258096,0,6.907755,8.294049,1,26.1,1,0,0 +29,3.258096,0,6.907755,8.294049,1,26.1,1,0,0 +27,3.258096,0,6.907755,8.294049,1,26.1,1,0,0 +25,3.258096,0,6.907755,8.294049,1,26.1,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +7,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +6,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +2,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +6,3.258096,0,6.907755,8.294049,0,21.7,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +1,4.61512,1,6.005269,0,0,13.73189,0,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +0,4.61512,1,6.005269,0,0,13.73189,0,0,0 +1,4.61512,1,6.005269,0,0,13.73189,0,0,0 +1,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,8.7,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,0,0,0 +0,3.931826,0,6.620073,7.313221,0,4.3,0,0,0 +0,3.931826,0,6.620073,7.313221,0,4.3,0,0,0 +0,3.931826,0,6.620073,7.313221,0,4.3,0,0,0 +1,4.61512,1,6.907755,0,0,17.4,1,0,0 +5,4.61512,1,6.907755,0,0,17.4,1,0,0 +0,4.61512,1,6.907755,0,0,17.4,1,0,0 +0,4.61512,1,6.907755,0,0,17.4,1,0,0 +6,4.61512,1,6.907755,0,0,17.4,1,0,0 +3,4.61512,1,6.907755,0,0,21.7,1,0,0 +5,4.61512,1,6.907755,0,0,21.7,1,0,0 +1,4.61512,1,6.907755,0,0,21.7,1,0,0 +4,4.61512,1,6.907755,0,0,21.7,1,0,0 +1,4.61512,1,6.907755,0,0,21.7,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +3,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +1,4.61512,1,6.907755,0,0,13.73189,1,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +10,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +9,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +8,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +8,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +0,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,13.73189,0,0,0 +1,0,0,0,0,0,8.7,1,0,0 +0,0,0,0,0,0,8.7,1,0,0 +0,0,0,0,0,0,8.7,1,0,0 +2,0,0,0,0,0,21.7,1,0,0 +2,0,0,0,0,0,21.7,1,0,0 +1,0,0,0,0,0,21.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +6,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +8,0,0,4.61512,0,1,13.73189,0,0,0 +2,0,0,4.61512,0,1,13.73189,0,0,0 +6,0,0,4.61512,0,1,13.73189,0,0,0 +4,0,0,4.61512,0,1,13.73189,0,0,0 +3,0,0,4.61512,0,1,13.73189,0,0,0 +7,0,0,4.61512,0,0,13.73189,0,0,0 +6,0,0,4.61512,0,0,13.73189,0,0,0 +0,0,0,4.61512,0,0,13.73189,0,0,0 +0,0,0,4.61512,0,0,13.73189,0,0,0 +10,0,0,4.61512,0,0,13.73189,0,0,0 +9,0,0,4.61512,0,1,13.73189,0,0,0 +6,0,0,4.61512,0,1,13.73189,0,0,0 +9,0,0,4.61512,0,1,13.73189,0,0,0 +12,0,0,4.61512,0,1,13.73189,0,0,0 +0,0,0,4.61512,0,1,13.73189,0,0,0 +15,3.931826,0,5.991465,6.684612,0,8.7,1,0,0 +4,3.931826,0,5.991465,6.684612,0,8.7,1,0,0 +2,3.931826,0,5.991465,6.684612,0,8.7,1,0,0 +2,3.931826,0,5.389072,5.991465,0,13,0,0,0 +1,3.931826,0,5.389072,5.991465,0,13,0,0,0 +1,3.931826,0,5.389072,5.991465,0,13,0,0,0 +7,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,0,1,0,0 +4,0,0,0,0,0,0,1,0,0 +1,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,0,1,0,0 +4,0,0,0,0,0,13,1,0,0 +4,0,0,0,0,0,13,1,0,0 +8,0,0,0,0,0,13,1,0,0 +4,0,0,0,0,0,13,1,0,0 +4,0,0,0,0,0,13,1,0,0 +7,0,0,0,0,0,13.73189,0,0,0 +9,0,0,0,0,0,13.73189,0,0,0 +12,0,0,0,0,0,13.73189,0,0,0 +4,0,0,0,0,0,13.73189,0,0,0 +9,0,0,0,0,0,13.73189,0,0,0 +1,0,1,5.703783,0,0,13.73189,0,0,0 +0,0,1,5.703783,0,0,13.73189,0,0,0 +2,0,1,5.703783,0,0,13.73189,0,0,0 +2,0,1,5.703783,0,0,13.73189,0,0,0 +1,0,1,5.703783,0,0,13.73189,0,0,0 +4,0,1,5.703783,0,0,13.73189,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,0,1,0 +2,3.931826,0,6.39693,7.090077,0,13.73189,0,1,0 +5,3.931826,0,6.39693,7.090077,0,13.73189,0,1,0 +4,3.931826,0,6.39693,7.090077,0,13.73189,0,1,0 +4,3.931826,0,6.39693,7.090077,0,13.73189,0,0,0 +1,3.931826,0,6.39693,7.090077,0,13.73189,0,0,0 +0,3.931826,0,6.39693,7.090077,0,13.73189,0,0,0 +5,0,0,4.787492,0,0,13.73189,0,0,0 +11,0,0,4.787492,0,0,13.73189,0,0,0 +41,0,0,4.787492,0,0,13.73189,0,0,0 +2,0,0,4.787492,0,0,13.73189,0,0,0 +3,0,0,4.787492,0,0,13.73189,0,0,0 +3,0,0,4.787492,0,0,13.73189,0,0,0 +7,0,0,4.787492,0,0,13.73189,1,0,0 +10,0,0,4.787492,0,0,13.73189,1,0,0 +10,0,0,4.787492,0,0,13.73189,1,0,0 +7,0,1,0,0,1,13.73189,0,0,1 +6,0,1,0,0,1,13.73189,0,0,1 +11,0,1,0,0,1,13.73189,0,0,1 +4,0,1,0,0,0,13.73189,1,0,0 +7,0,1,0,0,0,13.73189,1,0,0 +6,0,1,0,0,0,13.73189,1,0,0 +2,0,1,0,0,1,13.73189,0,1,0 +2,0,1,0,0,1,13.73189,0,1,0 +4,0,1,0,0,1,13.73189,0,1,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +6,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +13,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,4.3,0,1,0 +1,3.931826,0,6.907755,7.600903,0,4.3,0,1,0 +0,3.931826,0,6.907755,7.600903,0,4.3,0,1,0 +2,3.931826,0,6.907755,7.600903,0,4.3,0,1,0 +0,3.931826,0,6.907755,7.600903,0,4.3,0,1,0 +0,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +6,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +2,3.931826,0,6.907755,7.600903,0,17.4,1,0,0 +0,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +1,4.61512,1,6.395262,0,0,8.7,1,0,0 +0,4.61512,1,6.395262,0,0,8.7,1,0,0 +2,4.61512,1,6.395262,0,0,8.7,1,0,0 +1,4.61512,1,6.395262,0,1,17.4,0,1,0 +0,4.61512,1,6.395262,0,1,17.4,0,1,0 +2,4.61512,1,6.395262,0,1,17.4,0,1,0 +0,4.61512,1,6.395262,0,0,13.73189,1,0,0 +0,4.61512,1,6.395262,0,0,13.73189,1,0,0 +2,4.61512,1,6.395262,0,0,13.73189,1,0,0 +0,4.61512,1,0,0,0,17.4,1,0,0 +0,4.61512,1,0,0,0,17.4,1,0,0 +0,4.61512,1,0,0,0,17.4,1,0,0 +0,4.61512,1,0,0,0,17.4,1,0,0 +0,4.61512,1,0,0,0,8.7,1,0,0 +0,4.61512,1,0,0,0,8.7,1,0,0 +0,4.61512,1,0,0,0,8.7,1,0,0 +0,4.61512,1,0,0,0,8.7,1,0,0 +0,4.61512,1,0,0,0,8.7,1,0,0 +0,4.61512,1,0,0,0,34.8,0,1,0 +0,4.61512,1,0,0,0,34.8,0,1,0 +0,4.61512,1,0,0,0,34.8,0,1,0 +0,4.61512,1,0,0,0,34.8,0,1,0 +0,4.61512,1,0,0,0,34.8,0,1,0 +0,4.61512,1,0,0,0,4.3,0,0,0 +0,4.61512,1,0,0,0,4.3,0,0,0 +0,4.61512,1,0,0,0,4.3,0,0,0 +0,4.61512,1,0,0,0,4.3,0,0,0 +0,4.61512,1,0,0,0,4.3,0,0,0 +0,4.61512,1,6.907755,0,0,13,0,0,0 +0,4.61512,1,6.907755,0,0,13,0,0,0 +0,4.61512,1,6.907755,0,0,13.73189,1,0,0 +7,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +5,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +4,3.258096,0,6.907755,8.294049,0,17.4,1,0,0 +2,3.258096,0,6.907755,8.294049,0,26.1,0,0,0 +2,3.258096,0,6.907755,8.294049,0,26.1,0,0,0 +15,3.258096,0,6.907755,8.294049,0,26.1,0,0,0 +0,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +2,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +1,3.258096,0,6.907755,8.294049,0,4.3,0,0,0 +3,4.61512,1,6.308098,0,0,8.7,0,0,0 +1,4.61512,1,6.308098,0,0,8.7,0,0,0 +3,4.61512,1,6.308098,0,0,8.7,0,0,0 +4,4.61512,1,6.308098,0,0,21.7,0,0,0 +3,4.61512,1,6.308098,0,0,21.7,0,0,0 +0,4.61512,1,6.308098,0,0,21.7,0,0,0 +7,4.61512,1,6.907755,0,1,8.7,0,1,0 +8,4.61512,1,6.907755,0,1,8.7,0,1,0 +9,4.61512,1,6.907755,0,1,8.7,0,1,0 +8,4.61512,1,6.907755,0,1,8.7,0,1,0 +7,4.61512,1,6.907755,0,1,8.7,0,1,0 +1,0,0,0,0,0,13.73189,1,0,0 +1,0,0,0,0,0,13.73189,1,0,0 +5,0,0,0,0,0,13.73189,1,0,0 +5,0,0,4.276666,0,0,13.73189,0,0,0 +3,0,0,4.276666,0,0,13.73189,0,0,0 +2,0,0,4.276666,0,0,13.73189,0,0,0 +0,4.61512,1,0,0,0,13.73189,0,1,0 +1,4.61512,1,0,0,0,13.73189,0,1,0 +0,4.61512,1,0,0,0,13.73189,0,1,0 +0,4.61512,1,0,0,0,13.73189,0,1,0 +0,4.61512,1,0,0,0,13.73189,0,1,0 +1,0,0,0,0,1,13.73189,0,1,0 +1,0,0,0,0,1,13.73189,0,1,0 +1,0,0,0,0,1,13.73189,0,1,0 +7,0,0,0,0,1,13.73189,0,1,0 +1,0,0,0,0,1,13.73189,0,1,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +4,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,1,0,0 +0,3.258096,0,5.828946,7.21524,0,13.73189,0,1,0 +0,3.258096,0,5.828946,7.21524,0,13.73189,0,1,0 +3,3.931826,0,6.683361,7.376508,0,13.73189,0,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,0,0,0 +0,3.931826,0,6.683361,7.376508,0,13.73189,0,0,0 +8,0,0,0,0,0,13.73189,0,0,0 +9,0,0,0,0,0,13.73189,0,0,0 +3,0,0,0,0,0,13.73189,0,0,0 +2,0,0,0,0,0,13.73189,0,0,0 +6,0,0,0,0,0,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.73189,0,0,0 +1,0,1,0,0,1,13.73189,0,0,0 +0,0,1,0,0,1,13.73189,0,0,0 +3,0,1,0,0,1,13.73189,0,0,0 +9,0,1,0,0,1,13.73189,0,0,0 +1,0,1,0,0,1,13.73189,0,0,0 +0,4.61512,1,5.645447,0,0,13.73189,0,0,0 +0,4.61512,1,5.645447,0,0,13.73189,0,0,0 +0,4.61512,1,5.645447,0,0,13.73189,0,0,0 +16,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +6,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +9,3.931826,0,6.907755,7.600903,0,13.73189,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.73189,0,0,0 +9,0,0,5.783825,0,.0327869,13.73189,0,0,0 +23,0,0,5.783825,0,.0327869,13.73189,0,0,0 +41,0,0,5.783825,0,.0327869,13.73189,0,0,0 +20,0,0,5.783825,0,.0327869,13.73189,0,0,0 +21,0,0,5.783825,0,.0327869,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +1,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +0,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +15,0,0,6.126869,0,.0327869,13.73189,0,0,0 +7,0,0,6.126869,0,.0327869,13.73189,0,0,0 +5,0,0,6.126869,0,.0327869,13.73189,0,0,0 +0,0,0,6.126869,0,.0327869,13.73189,0,0,0 +5,0,1,4.976734,0,.0327869,13.73189,0,0,0 +8,0,1,4.976734,0,.0327869,13.73189,0,0,0 +13,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +7,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +5,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +8,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +5,4.61512,1,0,0,.0327869,13.73189,0,0,0 +1,4.61512,1,0,0,.0327869,13.73189,0,0,0 +0,4.61512,1,0,0,.0327869,13.73189,0,0,0 +2,4.61512,1,0,0,.0327869,13.73189,0,0,0 +1,0,0,0,0,.0327869,13.73189,0,0,0 +2,0,0,0,0,.0327869,13.73189,0,0,0 +13,3.931826,0,6.109248,5.786897,.0327869,13.73189,0,0,0 +6,3.931826,0,6.109248,5.786897,.0327869,13.73189,0,0,0 +3,3.931826,0,6.109248,5.786897,.0327869,13.73189,0,0,0 +0,3.931826,0,6.109248,5.786897,.0327869,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +13,0,0,5.783825,0,.0327869,13.73189,0,0,0 +2,0,0,5.783825,0,.0327869,13.73189,0,0,0 +1,0,0,5.783825,0,.0327869,13.73189,0,0,0 +0,0,0,0,0,.0327869,13.73189,0,0,0 +0,0,0,0,0,.0327869,13.73189,0,0,0 +10,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +5,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +2,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +4,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +4,4.61512,1,6.802395,0,.0327869,13.73189,0,0,0 +2,4.61512,1,6.802395,0,.0327869,13.73189,0,0,0 +6,0,0,5.777652,0,.0327869,13.73189,0,0,0 +3,0,0,5.777652,0,.0327869,13.73189,0,0,0 +2,0,0,5.777652,0,.0327869,13.73189,0,0,0 +5,0,0,5.777652,0,.0327869,13.73189,0,0,0 +9,0,0,0,0,.0327869,13.73189,0,0,0 +7,0,0,0,0,.0327869,13.73189,0,0,0 +9,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +22,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +5,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +2,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +8,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +1,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +2,0,0,4.094345,0,.0327869,13.73189,0,0,0 +3,0,0,4.094345,0,.0327869,13.73189,0,0,0 +7,0,0,0,0,.0327869,13.73189,0,0,0 +1,0,0,0,0,.0327869,13.73189,0,0,0 +3,0,0,0,0,.0327869,13.73189,0,0,0 +2,0,0,0,0,.0327869,13.73189,0,0,0 +3,4.61512,1,6.791222,0,.0327869,13.73189,0,0,0 +1,4.61512,1,6.791222,0,.0327869,13.73189,0,0,0 +2,4.61512,1,6.791222,0,.0327869,13.73189,0,0,0 +6,4.61512,1,6.791222,0,.0327869,13.73189,0,0,0 +13,0,0,0,0,.0327869,13.73189,0,0,0 +4,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +5,3.258096,0,5.988961,7.375256,.0327869,13.73189,0,0,0 +5,3.258096,0,5.988961,7.375256,.0327869,13.73189,0,0,0 +1,3.258096,0,5.988961,7.375256,.0327869,13.73189,0,0,0 +3,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +0,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +0,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +6,0,0,5.31812,0,.0327869,13.73189,0,0,0 +1,0,0,5.31812,0,.0327869,13.73189,0,0,0 +2,0,0,5.31812,0,.0327869,13.73189,0,0,0 +6,0,0,0,0,.0327869,13.73189,0,0,0 +4,0,0,0,0,.0327869,13.73189,0,0,0 +7,0,0,0,0,.0327869,13.73189,0,0,0 +7,3.931826,0,5.298317,5.991465,.0327869,13.73189,0,0,0 +2,3.931826,0,5.298317,5.991465,.0327869,13.73189,0,0,0 +3,3.931826,0,5.298317,5.991465,.0327869,13.73189,0,0,0 +7,3.931826,0,6.907755,7.600903,.0327869,13.73189,0,0,0 +4,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +1,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +0,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +11,3.258096,0,6.907755,8.294049,.0327869,13.73189,0,0,0 +11,0,0,4.983607,0,.0327869,13.73189,0,0,0 +1,4.61512,1,4.317488,0,.0327869,13.73189,0,0,0 +0,4.61512,1,4.317488,0,.0327869,13.73189,0,0,0 +0,4.61512,1,4.317488,0,.0327869,13.73189,0,0,0 +18,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +5,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +2,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +12,0,0,0,0,.0327869,13.73189,0,0,0 +8,0,0,0,0,.0327869,13.73189,0,0,0 +8,0,1,6.109248,0,.0327869,13.73189,0,0,0 +15,0,0,0,0,.0327869,13.73189,0,0,0 +6,0,0,0,0,.0327869,13.73189,0,0,0 +6,3.931826,0,6.395262,7.088409,.0327869,13.73189,0,0,0 +6,3.931826,0,6.395262,7.088409,.0327869,13.73189,0,0,0 +4,0,0,5.783825,0,.0327869,13.73189,0,0,0 +3,0,0,5.783825,0,.0327869,13.73189,0,0,0 +8,0,0,0,0,.0327869,13.73189,0,0,0 +6,0,0,0,0,.0327869,13.73189,0,0,0 +20,0,0,4.61512,0,.0327869,13.73189,0,0,0 +14,0,0,4.61512,0,.0327869,13.73189,0,0,0 +2,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +0,4.61512,1,6.907755,0,.0327869,13.73189,0,0,0 +0,4.61512,1,0,0,.0327869,13.73189,0,0,0 +5,4.61512,1,0,0,.0327869,13.73189,0,0,0 +7,0,0,0,0,.0327869,13.73189,0,0,0 +6,3.258096,0,0,0,.0327869,13.73189,0,0,0 +2,0,1,0,0,.0327869,13.73189,0,0,0 +7,0,0,0,0,.0327869,13.73189,0,0,0 +5,0,0,5.552959,0,.0327869,13.73189,0,0,0 +0,4.61512,1,5.843544,0,.0327869,13.73189,0,0,0 +2,4.61512,1,0,0,.0327869,13.73189,0,0,0 +4,3.258096,0,6.39693,7.783224,.0327869,13.73189,0,0,0 +7,0,1,4.787492,0,.0327869,13.73189,0,0,0 +13,4.61512,1,5.924256,0,.0327869,13.73189,0,0,0 +2,0,1,5.703783,5.755076,0,13.8,0,0,0 +1,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,4.564348,0,6.309918,6.361212,0,6.9,1,0,0 +0,4.564348,0,6.309918,6.361212,0,6.9,1,0,0 +3,4.564348,0,6.309918,6.361212,0,6.9,1,0,0 +3,4.564348,0,6.309918,6.361212,0,6.9,1,0,0 +0,4.564348,0,6.309918,6.361212,0,6.9,1,0,0 +1,4.564348,0,6.309918,6.361212,0,10.3,1,0,0 +3,4.564348,0,6.309918,6.361212,0,10.3,1,0,0 +0,4.564348,0,6.309918,6.361212,0,10.3,1,0,0 +0,4.564348,0,6.309918,6.361212,0,10.3,1,0,0 +0,4.564348,0,6.309918,6.361212,0,10.3,1,0,0 +1,0,0,5.187609,0,0,10.3,1,0,0 +0,0,0,5.187609,0,0,10.3,1,0,0 +2,0,0,5.187609,0,0,10.3,1,0,0 +2,0,0,5.187609,0,0,27.6,1,0,0 +3,0,0,5.187609,0,0,27.6,1,0,0 +6,0,0,5.187609,0,0,27.6,1,0,0 +3,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +9,0,1,6.109248,6.160541,0,6.9,0,0,0 +19,0,1,6.109248,6.160541,0,11.84267,0,0,0 +6,0,1,6.109248,6.160541,0,11.84267,0,0,0 +7,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +5,0,1,6.109248,6.160541,0,11.84267,0,0,0 +6,0,1,6.109248,6.160541,0,11.84267,0,0,0 +4,0,1,6.109248,6.160541,0,24.1,1,0,0 +5,0,1,6.109248,6.160541,0,24.1,1,0,0 +2,0,1,6.109248,6.160541,0,24.1,1,0,0 +2,3.258096,0,6.907755,8.294049,0,20.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,20.7,1,0,0 +2,3.258096,0,6.907755,8.294049,0,20.7,1,0,0 +0,3.258096,0,6.907755,8.294049,0,20.7,1,0,0 +2,3.258096,0,6.907755,8.294049,0,20.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +3,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +6,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,4.564348,0,4.405865,5.374791,0,0,0,0,0 +0,4.564348,0,4.405865,5.374791,0,0,0,0,0 +0,4.564348,0,4.405865,5.374791,0,0,0,0,0 +1,4.564348,0,4.405865,5.374791,1,20.7,1,0,0 +1,4.564348,0,4.405865,5.374791,1,20.7,1,0,0 +0,4.564348,0,4.405865,5.374791,1,20.7,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,0,6.9,1,0,0 +14,0,0,0,0,0,13.8,1,0,0 +10,0,0,0,0,0,13.8,1,0,0 +22,0,0,0,0,0,13.8,1,0,0 +1,0,1,0,6.160541,0,10.3,0,0,0 +1,0,1,0,6.160541,0,10.3,0,0,0 +0,0,1,0,6.160541,0,10.3,0,0,0 +3,0,1,0,6.160541,0,0,0,0,0 +2,0,1,0,6.160541,0,0,0,0,0 +0,0,1,0,6.160541,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +3,0,1,0,5.061929,0,10.3,0,0,0 +7,0,1,0,5.061929,0,10.3,0,0,0 +13,0,1,0,5.061929,0,10.3,0,0,0 +4,0,0,6.177778,0,0,13.8,0,0,0 +3,0,0,6.177778,0,0,13.8,0,0,0 +3,0,0,6.177778,0,0,13.8,0,0,0 +4,0,0,6.177778,0,0,13.8,0,0,0 +8,0,0,6.177778,0,0,13.8,0,0,0 +2,4.564348,0,5.981894,6.365746,0,11.84267,1,0,0 +0,4.564348,0,5.981894,6.365746,0,11.84267,1,0,0 +1,4.564348,0,5.981894,6.365746,0,11.84267,1,0,0 +2,4.564348,0,5.981894,6.365746,0,10.3,1,0,0 +8,4.564348,0,5.981894,6.365746,0,10.3,1,0,0 +2,4.564348,0,5.981894,6.365746,0,10.3,1,0,0 +0,4.564348,0,5.981894,6.365746,1,27.6,1,0,0 +3,4.564348,0,5.981894,6.365746,1,27.6,1,0,0 +6,4.564348,0,5.981894,6.365746,1,27.6,1,0,0 +3,4.564348,0,5.981894,6.365746,0,11.84267,1,0,0 +6,4.564348,0,5.981894,6.365746,0,11.84267,1,0,0 +1,4.564348,0,5.981894,6.365746,0,11.84267,1,0,0 +0,4.564348,0,5.981894,6.365746,0,11.84267,1,0,0 +2,4.564348,0,5.981894,6.365746,0,11.84267,1,0,0 +3,4.564348,0,5.981894,6.365746,0,11.84267,1,0,0 +0,0,1,5.460734,6.160541,0,11.84267,0,0,0 +1,0,1,5.460734,6.160541,0,11.84267,0,0,0 +3,0,1,5.460734,6.160541,0,11.84267,0,0,0 +8,0,1,5.460734,6.160541,0,11.84267,0,0,0 +3,0,1,5.460734,6.160541,0,11.84267,0,0,0 +1,0,1,5.460734,6.160541,0,11.84267,0,0,0 +3,0,1,5.460734,6.160541,0,11.84267,0,0,0 +2,0,1,5.460734,6.160541,0,11.84267,0,0,0 +1,0,1,5.460734,6.160541,0,11.84267,0,0,0 +2,0,1,5.460734,6.160541,0,11.84267,0,0,0 +1,0,1,5.460734,6.160541,0,3.4,0,0,0 +1,0,1,5.460734,6.160541,0,3.4,0,0,0 +0,0,1,5.460734,6.160541,0,3.4,0,0,0 +1,0,1,5.460734,6.160541,0,3.4,0,0,0 +1,0,1,5.460734,6.160541,0,3.4,0,0,0 +4,0,1,5.460734,6.160541,0,11.84267,0,0,0 +2,0,1,5.460734,6.160541,0,11.84267,0,0,0 +3,0,1,5.460734,6.160541,0,11.84267,0,0,0 +1,0,1,5.460734,6.160541,0,11.84267,0,0,0 +4,0,1,5.460734,6.160541,0,11.84267,0,0,0 +1,0,1,5.460734,6.160541,0,3.4,0,0,0 +1,0,1,5.460734,6.160541,0,3.4,0,0,0 +0,0,1,5.460734,6.160541,0,3.4,0,0,0 +1,0,1,5.460734,6.160541,0,3.4,0,0,0 +1,0,1,5.460734,6.160541,0,3.4,0,0,0 +3,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +8,3.258096,0,6.907755,8.294049,0,0,1,0,0 +2,3.258096,0,6.907755,8.294049,0,0,1,0,0 +0,3.258096,0,6.907755,8.294049,0,0,1,0,0 +12,0,1,0,5.061929,1,27.6,1,0,0 +1,0,1,0,5.061929,1,27.6,1,0,0 +5,0,1,0,5.061929,1,27.6,1,0,0 +1,0,1,6.39693,6.160541,0,11.84267,0,0,0 +0,0,1,6.39693,6.160541,0,11.84267,0,0,0 +2,0,1,6.39693,6.160541,1,10.3,1,0,0 +1,0,1,6.39693,6.160541,1,10.3,1,0,0 +7,0,1,6.39693,6.160541,1,34.5,0,0,0 +2,0,1,6.39693,6.160541,1,34.5,0,0,0 +9,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +2,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +3,3.258096,0,6.907755,8.294049,0,3.4,1,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,1,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,1,0,0 +1,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +3,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +0,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +3,0,0,4.730568,0,0,3.4,0,0,0 +1,0,0,4.730568,0,0,3.4,0,0,0 +1,0,0,4.730568,0,0,3.4,0,0,0 +7,0,0,5.330978,0,0,11.84267,0,0,0 +7,0,0,5.330978,0,0,11.84267,0,0,0 +7,0,0,5.330978,0,0,11.84267,0,0,0 +11,0,0,5.330978,0,0,11.84267,0,0,0 +6,0,0,5.330978,0,0,11.84267,0,0,0 +2,0,0,5.330978,0,0,0,0,0,0 +2,0,0,5.330978,0,0,0,0,0,0 +4,0,0,5.330978,0,0,0,0,0,0 +1,0,0,5.330978,0,0,0,0,0,0 +4,0,0,5.330978,0,0,0,0,0,0 +1,0,0,5.330978,0,0,3.4,0,0,0 +2,0,0,5.330978,0,0,3.4,0,0,0 +7,0,0,5.330978,0,0,3.4,0,0,0 +5,0,0,5.330978,0,0,3.4,0,0,0 +7,0,0,5.330978,0,0,3.4,0,0,0 +12,0,0,0,0,0,31,0,0,0 +6,0,0,0,0,0,31,0,0,0 +7,0,0,0,0,0,31,0,0,0 +7,0,0,0,0,0,31,0,0,0 +8,0,0,0,0,0,31,0,0,0 +7,0,0,0,0,1,31,0,0,0 +7,0,0,0,0,1,31,0,0,0 +5,0,0,0,0,1,31,0,0,0 +5,0,0,0,0,1,31,0,0,0 +6,0,0,0,0,1,31,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +6,0,0,0,0,0,0,0,0,0 +7,0,0,0,0,0,0,0,0,0 +8,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +8,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,5.641907,0,0,11.84267,0,0,0 +12,0,0,5.641907,0,0,11.84267,0,0,0 +14,0,0,5.641907,0,0,11.84267,0,0,0 +3,0,0,5.641907,0,1,17.2,0,0,0 +3,0,0,5.641907,0,1,17.2,0,0,0 +2,0,0,5.641907,0,1,17.2,0,0,0 +3,0,0,5.641907,0,0,13.8,0,0,0 +3,0,0,5.641907,0,0,13.8,0,0,0 +1,0,0,5.641907,0,0,13.8,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,11.84267,0,0,0 +4,0,1,5.617753,6.160541,0,11.84267,0,0,0 +0,0,1,5.617753,6.160541,0,11.84267,0,0,0 +0,0,1,5.617753,6.160541,0,11.84267,0,0,0 +0,0,1,5.617753,6.160541,0,11.84267,0,0,0 +5,0,1,5.617753,6.160541,0,11.84267,0,0,0 +2,0,1,5.617753,6.160541,0,6.9,0,0,0 +3,0,1,5.617753,6.160541,0,6.9,0,0,0 +1,0,1,5.617753,6.160541,0,6.9,0,0,0 +2,0,1,5.617753,6.160541,0,6.9,0,0,0 +0,0,1,5.617753,6.160541,0,6.9,0,0,0 +8,0,1,5.617753,6.160541,1,10.3,0,0,0 +3,0,1,5.617753,6.160541,1,10.3,0,0,0 +1,0,1,5.617753,6.160541,1,10.3,0,0,0 +1,0,1,5.617753,6.160541,1,10.3,0,0,0 +3,0,1,5.617753,6.160541,1,10.3,0,0,0 +5,0,0,0,0,0,6.9,0,0,0 +6,0,0,0,0,0,6.9,0,0,0 +5,0,0,0,0,0,6.9,0,0,0 +6,0,0,0,0,0,17.2,1,0,0 +27,0,0,0,0,0,17.2,1,0,0 +15,0,0,0,0,0,17.2,1,0,0 +1,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +4,0,0,0,0,0,0,0,0,0 +2,0,0,5.878744,0,0,11.84267,1,0,0 +10,0,0,5.878744,0,0,11.84267,1,0,0 +6,0,0,5.878744,0,0,11.84267,1,0,0 +3,0,0,5.878744,0,0,13.8,1,0,0 +7,0,0,5.878744,0,0,13.8,1,0,0 +3,0,0,5.878744,0,0,13.8,1,0,0 +1,0,0,5.878744,0,0,6.9,1,0,0 +5,0,0,5.878744,0,0,6.9,1,0,0 +5,0,0,5.878744,0,0,6.9,1,0,0 +9,0,0,5.878744,0,0,11.84267,1,0,0 +8,0,0,5.878744,0,0,11.84267,1,0,0 +4,0,0,5.878744,0,0,11.84267,1,0,0 +0,4.564348,0,6.547474,6.943732,0,0,0,0,0 +3,4.564348,0,6.547474,6.943732,0,0,0,0,0 +0,4.564348,0,6.547474,6.943732,0,0,0,0,0 +0,4.564348,0,6.547474,6.943732,0,0,0,0,0 +0,4.564348,0,6.547474,6.943732,0,0,0,0,0 +0,4.564348,0,6.547474,6.943732,0,17.2,0,0,0 +2,4.564348,0,6.547474,6.943732,0,17.2,0,0,0 +0,4.564348,0,6.547474,6.943732,0,17.2,0,0,0 +4,4.564348,0,6.547474,6.943732,0,17.2,0,0,0 +1,4.564348,0,6.547474,6.943732,0,17.2,0,0,0 +1,3.258096,0,6.804725,8.19102,0,10.3,1,0,0 +1,3.258096,0,6.804725,8.19102,0,10.3,1,0,0 +1,3.258096,0,6.804725,8.19102,0,10.3,1,0,0 +4,3.258096,0,6.804725,8.19102,0,6.9,0,0,0 +2,3.258096,0,6.804725,8.19102,0,6.9,0,0,0 +0,3.258096,0,6.804725,8.19102,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +3,0,1,6.109248,6.160541,0,11.84267,0,0,0 +5,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +6,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,3.258096,0,5.298317,6.684612,0,27.6,0,0,0 +0,3.258096,0,5.298317,6.684612,0,27.6,0,0,0 +19,3.258096,0,5.298317,6.684612,0,27.6,0,0,0 +30,3.258096,0,5.298317,6.684612,0,27.6,0,0,0 +18,3.258096,0,5.298317,6.684612,0,27.6,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +28,0,0,0,0,1,17.2,1,0,0 +20,0,0,0,0,1,17.2,1,0,0 +2,0,0,0,0,1,17.2,1,0,0 +0,0,0,0,0,1,17.2,1,0,0 +0,0,0,0,0,1,17.2,1,0,0 +4,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +3,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +7,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +11,0,1,5.703783,5.755076,0,3.4,0,0,0 +7,0,1,5.703783,5.755076,0,3.4,0,0,0 +7,0,1,5.703783,5.755076,0,3.4,0,0,0 +3,0,1,5.703783,5.755076,0,10.3,0,0,0 +1,0,1,5.703783,5.755076,0,10.3,0,0,0 +8,0,1,5.703783,5.755076,0,10.3,0,0,0 +4,3.258096,0,6.856462,8.242756,0,6.9,0,0,0 +2,3.258096,0,6.856462,8.242756,0,6.9,0,0,0 +2,3.258096,0,6.856462,8.242756,0,6.9,0,0,0 +2,3.258096,0,6.856462,8.242756,0,6.9,0,0,0 +5,3.258096,0,6.856462,8.242756,0,6.9,0,0,0 +3,3.258096,0,6.907755,8.294049,0,24.1,0,0,0 +1,3.258096,0,6.907755,8.294049,0,24.1,0,0,0 +0,3.258096,0,6.907755,8.294049,0,24.1,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,1,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,1,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,1,0,0 +0,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +2,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +5,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,0,0,6.762128,0,0,6.9,0,0,0 +2,0,0,6.762128,0,0,6.9,0,0,0 +2,0,0,6.762128,0,0,6.9,0,0,0 +0,0,0,6.762128,0,0,0,0,0,0 +2,0,0,6.762128,0,0,0,0,0,0 +2,0,0,6.762128,0,0,0,0,0,0 +3,3.258096,0,5.808503,7.194797,0,13.8,0,0,0 +3,3.258096,0,5.808503,7.194797,0,13.8,0,0,0 +3,3.258096,0,5.808503,7.194797,0,13.8,0,0,0 +2,0,0,6.099332,0,0,11.84267,0,0,0 +2,0,0,6.099332,0,0,11.84267,0,0,0 +5,0,0,6.099332,0,0,11.84267,0,0,0 +7,0,0,6.099332,0,0,11.84267,0,0,0 +12,0,0,6.099332,0,0,11.84267,0,0,0 +6,0,0,6.099332,0,0,11.84267,0,0,0 +4,0,0,6.099332,0,0,11.84267,0,0,0 +3,0,0,6.099332,0,0,11.84267,0,0,0 +4,0,0,6.099332,0,0,11.84267,0,0,0 +11,0,0,6.099332,0,0,10.3,0,0,0 +9,0,0,6.099332,0,0,10.3,0,0,0 +5,0,0,6.099332,0,0,10.3,0,0,0 +2,0,0,6.099332,0,0,11.84267,0,0,0 +2,0,0,6.099332,0,0,11.84267,0,0,0 +1,0,0,6.099332,0,0,11.84267,0,0,0 +3,0,0,6.099332,0,0,20.7,0,0,0 +3,0,0,6.099332,0,0,20.7,0,0,0 +6,0,0,6.099332,0,0,20.7,0,0,0 +8,0,0,5.680172,0,1,41.4,0,1,0 +8,0,0,5.680172,0,1,41.4,0,1,0 +13,0,0,5.680172,0,1,41.4,0,1,0 +31,0,0,0,0,0,3.4,0,0,0 +33,0,0,0,0,0,3.4,0,0,0 +11,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +11,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,17.2,1,0,0 +3,0,0,0,0,0,17.2,1,0,0 +2,0,0,0,0,0,17.2,1,0,0 +3,0,1,5.992264,5.755076,0,13.8,1,0,0 +0,0,1,5.992264,5.755076,0,13.8,1,0,0 +3,0,1,5.992264,5.755076,0,13.8,1,0,0 +10,0,1,5.992264,5.755076,1,31,1,0,0 +3,0,1,5.992264,5.755076,1,31,1,0,0 +9,0,1,5.992264,5.755076,1,31,1,0,0 +5,0,0,0,0,1,34.5,0,0,0 +8,0,0,0,0,1,34.5,0,0,0 +16,0,0,0,0,1,34.5,0,0,0 +2,4.564348,0,6.393591,6.445051,1,13.8,1,0,0 +0,4.564348,0,6.393591,6.445051,1,13.8,1,0,0 +0,4.564348,0,6.393591,6.445051,1,13.8,1,0,0 +1,4.564348,0,6.393591,6.445051,0,10.3,0,0,0 +1,4.564348,0,6.393591,6.445051,0,10.3,0,0,0 +3,4.564348,0,6.393591,6.445051,0,10.3,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +3,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +3,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,0,1,5.010635,5.061929,0,0,0,0,0 +8,0,1,5.010635,5.061929,0,0,0,0,0 +2,0,1,5.010635,5.061929,0,0,0,0,0 +2,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +0,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +0,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +0,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +1,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +0,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +0,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +0,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +0,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +1,4.564348,0,5.926926,5.97822,0,11.84267,0,0,0 +1,4.564348,0,5.926926,5.97822,0,0,1,0,0 +0,4.564348,0,5.926926,5.97822,0,0,1,0,0 +0,4.564348,0,5.926926,5.97822,0,0,1,0,0 +5,4.564348,0,5.926926,5.97822,0,0,1,0,0 +2,4.564348,0,5.926926,5.97822,0,0,1,0,0 +14,3.258096,0,6.907755,8.294049,0,20.7,0,0,0 +3,3.258096,0,6.907755,8.294049,0,20.7,0,0,0 +6,3.258096,0,6.907755,8.294049,0,20.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,20.7,0,0,0 +2,3.258096,0,6.907755,8.294049,0,20.7,0,0,0 +4,3.258096,0,6.907755,8.294049,0,20.7,0,0,0 +5,0,0,6.45331,0,0,10.3,1,0,0 +14,0,0,6.45331,0,0,10.3,1,0,0 +13,0,0,6.45331,0,0,10.3,1,0,0 +9,0,0,6.45331,0,0,10.3,1,0,0 +13,0,0,6.45331,0,0,10.3,1,0,0 +9,0,0,6.45331,0,1,13.8,0,0,1 +10,0,0,6.45331,0,1,13.8,0,0,1 +19,0,0,6.45331,0,1,13.8,0,0,1 +13,0,0,6.45331,0,1,13.8,0,0,1 +19,0,0,6.45331,0,1,13.8,0,0,1 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +3,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +6,0,1,6.109248,6.160541,0,24.1,0,0,0 +0,0,1,6.109248,6.160541,0,24.1,0,0,0 +1,0,1,6.109248,6.160541,0,24.1,0,0,0 +5,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +4,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +4,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +2,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +1,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +0,0,1,5.010635,5.061929,0,13.8,1,0,0 +0,0,1,5.010635,5.061929,0,13.8,1,0,0 +2,0,1,5.010635,5.061929,0,13.8,1,0,0 +2,0,1,5.010635,5.061929,0,13.8,1,0,0 +0,0,1,5.010635,5.061929,0,13.8,1,0,0 +4,3.258096,0,5.273,6.659294,0,24.1,1,0,0 +3,3.258096,0,5.273,6.659294,0,24.1,1,0,0 +7,3.258096,0,5.273,6.659294,0,24.1,1,0,0 +4,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +11,0,1,3.688879,5.061929,0,20.7,0,0,0 +1,0,1,3.688879,5.061929,0,20.7,0,0,0 +1,0,1,3.688879,5.061929,0,20.7,0,0,0 +2,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +4,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +13,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +12,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +4,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +4,0,0,0,0,1,31,1,0,0 +1,0,0,0,0,1,31,1,0,0 +2,0,0,0,0,1,31,1,0,0 +8,0,0,0,0,1,31,1,0,0 +3,0,0,0,0,1,31,1,0,0 +2,0,0,0,0,0,3.4,1,0,0 +11,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,3.4,1,0,0 +10,0,0,0,0,0,3.4,1,0,0 +8,0,0,0,0,0,3.4,1,0,0 +7,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +5,0,0,0,0,0,13.8,0,0,0 +7,0,0,0,0,0,13.8,0,0,0 +9,0,0,0,0,0,13.8,0,0,0 +0,0,0,4.59875,0,0,11.84267,0,0,0 +0,0,0,4.59875,0,0,11.84267,0,0,0 +1,0,0,4.59875,0,0,11.84267,0,0,0 +4,0,0,4.59875,0,0,3.4,0,0,0 +1,0,0,4.59875,0,0,3.4,0,0,0 +3,0,0,4.59875,0,0,3.4,0,0,0 +5,0,0,4.59875,0,0,10.3,0,0,0 +1,0,0,4.59875,0,0,10.3,0,0,0 +1,0,0,4.59875,0,0,10.3,0,0,0 +1,0,0,4.59875,0,0,11.84267,1,0,0 +1,0,0,4.59875,0,0,11.84267,1,0,0 +1,0,0,4.59875,0,0,11.84267,1,0,0 +0,0,1,0,5.061929,1,20.7,0,0,0 +0,0,1,0,5.061929,1,20.7,0,0,0 +0,0,1,0,5.061929,1,20.7,0,0,0 +1,0,1,0,5.061929,1,20.7,0,0,0 +2,0,1,0,5.061929,1,20.7,0,0,0 +0,0,1,0,6.160541,0,11.84267,0,0,0 +1,0,1,0,6.160541,0,11.84267,0,0,0 +0,0,1,0,6.160541,0,11.84267,0,0,0 +1,0,1,0,6.160541,0,13.8,0,0,0 +2,0,1,0,6.160541,0,13.8,0,0,0 +2,0,1,0,6.160541,0,13.8,0,0,0 +1,0,1,0,6.160541,0,11.84267,0,0,0 +2,0,1,0,6.160541,0,11.84267,0,0,0 +2,0,1,0,6.160541,0,11.84267,0,0,0 +0,0,1,0,6.160541,0,11.84267,0,0,0 +1,0,1,0,6.160541,0,11.84267,0,0,0 +0,0,1,0,6.160541,0,11.84267,0,0,0 +1,0,1,0,6.160541,0,10.3,1,0,0 +0,0,1,0,6.160541,0,10.3,1,0,0 +1,0,1,0,6.160541,0,10.3,1,0,0 +4,3.258096,0,6.907755,8.294049,0,0,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +3,3.258096,0,6.907755,8.294049,0,0,0,0,0 +6,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +0,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +5,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +35,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +25,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +37,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +23,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +15,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,1,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,1,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,1,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,17.2,1,0,0 +1,4.564348,0,6.907755,6.959049,0,17.2,1,0,0 +1,4.564348,0,6.907755,6.959049,0,17.2,1,0,0 +0,4.564348,0,5.93648,6.735905,0,6.9,0,0,0 +0,4.564348,0,5.93648,6.735905,0,6.9,0,0,0 +0,4.564348,0,5.93648,6.735905,0,6.9,0,0,0 +2,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +6,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +0,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +4,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +1,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +1,0,1,5.703783,6.160541,0,11.84267,0,0,0 +1,0,1,5.703783,6.160541,0,11.84267,0,0,0 +1,0,1,5.703783,6.160541,0,11.84267,0,0,0 +0,0,1,5.703783,6.160541,0,6.9,0,0,0 +2,0,1,5.703783,6.160541,0,6.9,0,0,0 +1,0,1,5.703783,6.160541,0,6.9,0,0,0 +1,0,1,5.703783,6.160541,0,6.9,0,0,0 +2,0,1,5.703783,6.160541,0,6.9,0,0,0 +0,0,1,5.703783,6.160541,0,6.9,0,0,0 +10,0,1,5.05529,5.755076,0,10.3,0,1,0 +3,0,1,5.05529,5.755076,0,10.3,0,1,0 +2,0,1,5.05529,5.755076,0,17.2,0,0,0 +0,0,1,5.05529,5.755076,0,17.2,0,0,0 +3,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +5,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +3,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +2,3.258096,0,6.907755,8.294049,0,6.9,1,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,1,0,0 +3,3.258096,0,6.907755,8.294049,0,6.9,1,0,0 +11,3.258096,0,6.907755,8.294049,0,11.84267,1,0,0 +6,3.258096,0,6.907755,8.294049,0,11.84267,1,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,1,0,0 +3,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +0,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +0,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +0,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +0,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +11,3.258096,0,6.574629,7.960924,1,10.3,0,0,0 +1,3.258096,0,6.574629,7.960924,1,10.3,0,0,0 +0,3.258096,0,6.574629,7.960924,1,10.3,0,0,0 +0,3.258096,0,6.574629,7.960924,1,10.3,0,0,0 +0,3.258096,0,6.574629,7.960924,1,10.3,0,0,0 +1,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +0,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +0,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +0,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +0,3.258096,0,6.574629,7.960924,0,11.84267,0,0,0 +24,0,0,3.696848,0,0,10.3,0,1,0 +11,0,0,3.696848,0,0,10.3,0,1,0 +4,0,0,3.696848,0,0,10.3,0,1,0 +6,0,0,3.696848,0,0,13.8,0,1,0 +4,0,0,3.696848,0,0,13.8,0,1,0 +3,0,0,3.696848,0,0,13.8,0,1,0 +7,3.258096,0,6.115671,7.501966,0,11.84267,1,0,0 +8,3.258096,0,6.115671,7.501966,0,11.84267,1,0,0 +3,3.258096,0,6.115671,7.501966,0,11.84267,1,0,0 +2,3.258096,0,6.115671,7.501966,0,27.6,1,0,0 +3,3.258096,0,6.115671,7.501966,0,27.6,1,0,0 +1,3.258096,0,6.115671,7.501966,0,27.6,1,0,0 +2,3.258096,0,6.115671,7.501966,0,10.3,1,0,0 +0,3.258096,0,6.115671,7.501966,0,10.3,1,0,0 +1,3.258096,0,6.115671,7.501966,0,10.3,1,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +3,4.564348,0,5.947513,5.998806,1,27.6,0,1,0 +0,0,1,0,5.061929,0,6.9,0,0,0 +0,0,1,0,5.061929,0,6.9,0,0,0 +3,0,1,0,5.061929,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +2,0,1,6.109248,6.160541,0,11.84267,1,0,0 +2,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +9,0,0,0,0,0,11.84267,0,0,0 +14,0,0,0,0,0,11.84267,0,0,0 +9,0,0,0,0,0,10.3,1,0,0 +6,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,3.4,0,0,0 +7,0,0,0,0,0,3.4,0,0,0 +8,0,0,0,0,0,3.4,0,0,0 +1,0,1,4.341856,5.755076,0,10.3,0,0,0 +1,0,1,4.341856,5.755076,0,10.3,0,0,0 +2,0,1,4.341856,5.755076,0,10.3,0,0,0 +1,0,1,4.341856,5.755076,0,6.9,1,0,0 +0,0,1,4.341856,5.755076,0,6.9,1,0,0 +0,0,1,4.341856,5.755076,0,6.9,1,0,0 +5,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +10,0,0,0,0,1,24.1,1,0,0 +4,0,0,0,0,1,24.1,1,0,0 +3,0,0,0,0,1,24.1,1,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +7,0,0,0,0,1,17.2,0,1,0 +7,0,0,0,0,1,17.2,0,1,0 +0,0,0,0,0,1,17.2,0,1,0 +2,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +15,0,1,6.109248,6.160541,1,11.84267,0,0,0 +9,0,1,6.109248,6.160541,1,11.84267,0,0,0 +2,0,1,6.109248,6.160541,1,11.84267,0,0,0 +5,0,1,6.109248,6.160541,1,11.84267,0,0,0 +2,0,1,6.109248,6.160541,1,11.84267,0,0,0 +5,0,1,6.109248,6.160541,0,17.2,0,0,0 +2,0,1,6.109248,6.160541,0,17.2,0,0,0 +5,0,1,6.109248,6.160541,0,17.2,0,0,0 +6,0,1,6.109248,6.160541,0,17.2,0,0,0 +4,0,1,6.109248,6.160541,0,17.2,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +2,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +1,0,1,6.109248,6.160541,0,20.7,1,0,0 +2,0,1,6.109248,6.160541,0,20.7,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,11.84267,1,0,0 +6,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +3,0,1,6.109248,6.160541,1,13.8,0,0,0 +4,0,1,6.109248,6.160541,1,13.8,0,0,0 +1,0,1,6.109248,6.160541,1,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +5,0,1,6.109248,6.160541,0,3.4,0,0,0 +5,0,0,0,0,0,11.84267,0,0,0 +6,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +8,0,0,0,0,0,13.8,0,0,0 +5,0,0,0,0,0,13.8,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +6,0,0,0,0,1,20.7,0,1,0 +0,0,0,0,0,1,20.7,0,1,0 +0,0,0,0,0,1,20.7,0,1,0 +1,0,0,0,0,1,20.7,0,1,0 +0,0,0,0,0,1,20.7,0,1,0 +4,3.258096,0,6.87363,8.259924,0,3.4,1,0,0 +0,3.258096,0,6.87363,8.259924,0,3.4,1,0,0 +2,3.258096,0,6.87363,8.259924,0,3.4,1,0,0 +3,3.258096,0,6.87363,8.259924,0,3.4,1,0,0 +11,3.258096,0,6.87363,8.259924,0,3.4,1,0,0 +1,3.258096,0,6.87363,8.259924,0,0,0,0,0 +1,3.258096,0,6.87363,8.259924,0,0,0,0,0 +0,3.258096,0,6.87363,8.259924,0,0,0,0,0 +1,3.258096,0,6.87363,8.259924,0,0,0,0,0 +1,3.258096,0,6.87363,8.259924,0,0,0,0,0 +3,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +1,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +1,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +1,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +0,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +3,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +0,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +1,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +1,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +3,3.258096,0,6.87363,8.259924,0,11.84267,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,1,0,5.755076,0,10.3,0,0,0 +0,0,1,0,5.755076,0,10.3,0,0,0 +1,0,1,0,5.755076,0,10.3,0,0,0 +0,0,1,0,5.755076,0,10.3,0,0,0 +0,0,1,0,5.755076,0,10.3,0,0,0 +1,0,1,0,5.755076,0,10.3,1,0,0 +7,0,1,0,5.755076,0,10.3,1,0,0 +1,0,1,0,5.755076,0,10.3,1,0,0 +0,0,1,0,5.755076,0,10.3,1,0,0 +1,0,1,0,5.755076,0,10.3,1,0,0 +5,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +4,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +8,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +12,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +6,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +6,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +7,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,0,6.959049,0,27.6,1,0,0 +1,4.564348,0,0,6.959049,0,27.6,1,0,0 +5,4.564348,0,0,6.959049,0,27.6,1,0,0 +3,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +11,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +4,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +3,3.258096,0,6.907755,8.294049,0,0,0,0,0 +3,3.258096,0,6.907755,8.294049,0,0,0,0,0 +4,3.258096,0,6.907755,8.294049,0,0,0,0,0 +11,3.258096,0,6.907755,8.294049,1,11.84267,0,1,0 +11,3.258096,0,6.907755,8.294049,1,11.84267,0,1,0 +11,3.258096,0,6.907755,8.294049,1,11.84267,0,1,0 +2,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,17.2,0,0,0 +3,0,0,0,0,0,17.2,0,0,0 +1,0,0,0,0,0,17.2,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +4,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +6,0,1,6.109248,6.160541,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,10.3,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,1,0,0 +3,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +3,0,1,6.109248,6.160541,0,11.84267,0,0,0 +7,0,1,5.010635,5.061929,0,24.1,0,1,0 +16,0,1,5.010635,5.061929,0,24.1,0,1,0 +10,0,1,5.010635,5.061929,0,24.1,0,1,0 +2,0,1,4.362206,5.061929,0,10.3,1,0,0 +2,0,1,4.362206,5.061929,0,10.3,1,0,0 +0,0,1,4.362206,5.061929,0,10.3,1,0,0 +2,3.258096,0,6.151668,7.537962,1,6.9,0,0,0 +1,3.258096,0,6.151668,7.537962,1,6.9,0,0,0 +12,3.258096,0,6.151668,7.537962,1,6.9,0,0,0 +3,3.258096,0,6.151668,7.537962,1,6.9,0,0,0 +4,3.258096,0,6.151668,7.537962,1,6.9,0,0,0 +2,3.258096,0,6.158038,7.544332,0,17.2,1,0,0 +7,3.258096,0,6.158038,7.544332,0,17.2,1,0,0 +5,3.258096,0,6.158038,7.544332,0,17.2,1,0,0 +5,3.258096,0,6.158038,7.544332,0,17.2,1,0,0 +6,3.258096,0,6.158038,7.544332,0,17.2,1,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +4,0,1,5.703783,5.755076,0,6.9,0,0,0 +9,0,1,5.703783,5.755076,0,6.9,0,0,0 +3,0,1,5.703783,5.755076,1,6.9,1,0,0 +1,0,1,5.703783,5.755076,1,6.9,1,0,0 +1,0,1,5.703783,5.755076,1,6.9,1,0,0 +2,4.564348,0,5.587249,5.638542,1,17.2,1,0,0 +14,4.564348,0,5.587249,5.638542,1,17.2,1,0,0 +2,4.564348,0,5.587249,5.638542,1,17.2,1,0,0 +0,0,0,4.342636,0,0,13.8,1,0,0 +3,0,0,4.342636,0,0,13.8,1,0,0 +3,0,0,4.342636,0,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +2,4.564348,0,6.907755,6.959049,0,27.6,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,0,0,0,0,0,20.7,1,0,0 +0,0,0,0,0,0,20.7,1,0,0 +0,0,0,0,0,0,20.7,1,0,0 +0,0,0,0,0,0,20.7,1,0,0 +0,0,0,0,0,0,20.7,1,0,0 +11,0,0,0,0,0,6.9,0,0,0 +16,0,0,0,0,0,6.9,0,0,0 +16,0,0,0,0,0,6.9,0,0,0 +6,0,0,0,0,0,6.9,0,0,0 +11,0,0,0,0,0,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +8,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +3,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +4,3.258096,0,6.907755,8.294049,0,24.1,0,0,0 +6,3.258096,0,6.907755,8.294049,0,24.1,0,0,0 +5,3.258096,0,6.907755,8.294049,0,24.1,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,1,27.6,0,1,0 +7,3.258096,0,6.907755,8.294049,1,27.6,0,1,0 +3,3.258096,0,6.907755,8.294049,1,27.6,0,1,0 +1,3.258096,0,6.907755,8.294049,1,27.6,0,1,0 +1,3.258096,0,6.907755,8.294049,1,27.6,0,1,0 +1,3.258096,0,6.907755,8.294049,1,11.84267,0,0,0 +3,3.258096,0,6.907755,8.294049,1,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,1,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,1,11.84267,0,0,0 +4,3.258096,0,6.907755,8.294049,1,11.84267,0,0,0 +9,3.258096,0,6.907755,8.294049,1,31,0,1,0 +4,3.258096,0,6.907755,8.294049,1,31,0,1,0 +3,3.258096,0,6.907755,8.294049,1,31,0,1,0 +2,3.258096,0,6.907755,8.294049,1,31,0,1,0 +2,3.258096,0,6.907755,8.294049,1,31,0,1,0 +3,3.258096,0,6.907755,8.294049,1,11.84267,0,1,0 +4,3.258096,0,6.907755,8.294049,1,11.84267,0,1,0 +2,3.258096,0,6.907755,8.294049,1,11.84267,0,1,0 +7,3.258096,0,6.907755,8.294049,1,11.84267,0,1,0 +3,3.258096,0,6.907755,8.294049,1,11.84267,0,1,0 +2,3.258096,0,6.907755,8.294049,1,13.8,1,0,0 +2,3.258096,0,6.907755,8.294049,1,13.8,1,0,0 +1,3.258096,0,6.907755,8.294049,1,13.8,1,0,0 +1,3.258096,0,6.907755,8.294049,1,13.8,1,0,0 +3,3.258096,0,6.907755,8.294049,1,13.8,1,0,0 +0,3.258096,0,6.612041,7.998335,0,3.4,0,0,0 +2,3.258096,0,6.612041,7.998335,0,3.4,0,0,0 +0,3.258096,0,6.612041,7.998335,0,3.4,0,0,0 +1,4.564348,0,5.042651,5.746707,1,17.2,0,0,0 +1,4.564348,0,5.042651,5.746707,1,17.2,0,0,0 +1,4.564348,0,5.042651,5.746707,1,17.2,0,0,0 +0,4.564348,0,5.519459,5.570752,0,10.3,0,0,0 +0,4.564348,0,5.519459,5.570752,0,10.3,0,0,0 +0,4.564348,0,5.519459,5.570752,0,10.3,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,1,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,1,0,0 +3,3.258096,0,6.907755,8.294049,0,6.9,1,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,1,0,0 +3,3.258096,0,6.907755,8.294049,0,6.9,1,0,0 +2,3.258096,0,6.907755,8.294049,0,6.9,1,0,0 +3,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +3,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +5,0,1,0,6.160541,0,3.4,0,0,1 +4,0,1,0,6.160541,0,3.4,0,0,1 +3,0,1,0,6.160541,0,3.4,0,0,1 +0,0,1,0,6.160541,0,6.9,0,0,0 +8,0,1,0,6.160541,0,13.8,1,0,0 +8,0,1,0,6.160541,0,13.8,1,0,0 +5,0,1,0,6.160541,0,13.8,1,0,0 +2,0,0,6.475741,0,1,17.2,1,0,0 +6,0,0,6.475741,0,1,17.2,1,0,0 +13,0,0,6.475741,0,1,17.2,1,0,0 +2,0,0,6.475741,0,1,20.7,1,0,0 +1,0,0,6.475741,0,1,20.7,1,0,0 +5,0,0,6.475741,0,1,20.7,1,0,0 +6,0,0,6.475741,0,0,11.84267,0,0,0 +8,0,0,6.475741,0,0,11.84267,0,0,0 +6,0,0,6.475741,0,0,11.84267,0,0,0 +6,0,0,3.295837,0,0,13.8,1,0,0 +7,0,0,3.295837,0,0,13.8,1,0,0 +5,0,0,3.295837,0,0,13.8,1,0,0 +10,0,0,3.295837,0,0,13.8,1,0,0 +10,0,0,3.295837,0,0,13.8,1,0,0 +1,0,0,3.295837,0,0,11.84267,0,0,0 +1,0,0,3.295837,0,0,11.84267,0,0,0 +1,0,0,3.295837,0,0,11.84267,0,0,0 +2,0,0,3.295837,0,0,11.84267,0,0,0 +3,0,0,3.295837,0,0,11.84267,0,0,0 +1,0,0,3.295837,0,0,0,0,0,0 +0,0,0,3.295837,0,0,0,0,0,0 +1,0,0,3.295837,0,0,0,0,0,0 +4,0,0,3.295837,0,0,0,0,0,0 +4,0,0,3.295837,0,0,0,0,0,0 +0,0,0,3.295837,0,0,6.9,0,0,0 +1,0,0,3.295837,0,0,6.9,0,0,0 +0,0,0,3.295837,0,0,6.9,0,0,0 +0,0,0,3.295837,0,0,6.9,0,0,0 +5,0,0,3.295837,0,0,6.9,0,0,0 +6,0,0,3.295837,0,0,6.9,0,0,0 +17,0,0,3.295837,0,0,6.9,0,0,0 +7,0,0,3.295837,0,0,6.9,0,0,0 +6,0,0,3.295837,0,0,6.9,0,0,0 +7,0,0,3.295837,0,0,6.9,0,0,0 +0,4.564348,0,0,6.105732,0,13.8,0,0,0 +0,4.564348,0,0,6.105732,0,13.8,0,0,0 +0,4.564348,0,0,6.105732,0,13.8,0,0,0 +2,4.564348,0,0,6.105732,0,13.8,0,0,0 +0,4.564348,0,0,6.105732,0,13.8,0,0,0 +0,4.564348,0,0,6.105732,0,11.84267,0,0,0 +3,4.564348,0,0,6.105732,0,11.84267,0,0,0 +0,4.564348,0,0,6.105732,0,11.84267,0,0,0 +0,4.564348,0,0,6.105732,0,11.84267,0,0,0 +1,4.564348,0,0,6.105732,0,11.84267,0,0,0 +0,4.564348,0,0,6.105732,0,11.84267,0,0,0 +0,4.564348,0,0,6.105732,0,11.84267,0,0,0 +0,4.564348,0,0,6.105732,0,11.84267,0,0,0 +2,4.564348,0,0,6.105732,0,11.84267,0,0,0 +0,4.564348,0,0,6.105732,0,11.84267,0,0,0 +1,4.564348,0,0,6.105732,0,13.8,0,0,0 +0,4.564348,0,0,6.105732,0,13.8,0,0,0 +0,4.564348,0,0,6.105732,0,13.8,0,0,0 +0,4.564348,0,0,6.105732,0,13.8,0,0,0 +0,4.564348,0,0,6.105732,0,13.8,0,0,0 +2,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +1,0,1,5.703783,5.755076,0,20.7,0,0,0 +1,0,1,5.703783,5.755076,0,20.7,0,0,0 +1,0,1,5.703783,5.755076,0,20.7,0,0,0 +1,0,1,5.703783,5.755076,0,20.7,0,0,0 +6,0,1,5.703783,5.755076,0,20.7,0,0,0 +1,0,1,5.703783,5.755076,0,3.4,0,0,0 +4,0,1,5.703783,5.755076,0,3.4,0,0,0 +2,0,1,5.703783,5.755076,0,3.4,0,0,0 +1,0,1,5.703783,5.755076,0,3.4,0,0,0 +3,0,1,5.703783,5.755076,0,3.4,0,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +0,0,1,5.703783,5.755076,0,3.4,1,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +2,0,1,5.703783,5.755076,0,17.2,1,0,0 +5,0,1,5.703783,5.755076,0,17.2,1,0,0 +8,0,1,5.703783,5.755076,0,17.2,1,0,0 +16,0,1,5.703783,5.755076,0,3.4,1,0,0 +3,0,1,5.703783,5.755076,0,3.4,1,0,0 +6,0,1,5.703783,5.755076,0,3.4,1,0,0 +12,0,1,5.703783,5.755076,0,10.3,0,0,0 +6,0,1,5.703783,5.755076,0,10.3,0,0,0 +3,0,1,5.703783,5.755076,0,10.3,0,0,0 +7,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +8,0,0,0,0,0,11.84267,0,0,0 +9,0,0,0,0,0,11.84267,0,0,0 +7,0,0,0,0,0,11.84267,0,0,0 +8,0,0,0,0,0,17.2,0,0,0 +11,0,0,0,0,0,17.2,0,0,0 +7,0,0,0,0,0,17.2,0,0,0 +4,0,0,0,0,0,17.2,0,0,0 +5,0,0,0,0,0,17.2,0,0,0 +14,0,0,0,0,0,17.2,0,0,0 +2,0,0,0,0,0,17.2,0,0,0 +5,0,0,0,0,0,17.2,0,0,0 +8,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +5,0,0,0,0,0,11.84267,0,0,0 +7,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,11.84267,1,0,0 +6,0,0,0,0,0,11.84267,1,0,0 +11,0,0,0,0,0,11.84267,1,0,0 +5,0,0,0,0,0,11.84267,1,0,0 +9,0,0,0,0,0,11.84267,1,0,0 +1,0,1,0,5.755076,0,13.8,1,0,0 +2,0,1,0,5.755076,0,13.8,1,0,0 +0,0,1,0,5.755076,0,13.8,1,0,0 +3,0,1,0,5.755076,0,10.3,0,0,0 +0,0,1,0,5.755076,0,10.3,0,0,0 +3,0,1,0,5.755076,0,10.3,0,0,0 +1,3.258096,0,6.907755,8.294049,1,17.2,0,0,0 +2,3.258096,0,6.907755,8.294049,1,17.2,0,0,0 +1,3.258096,0,6.907755,8.294049,1,17.2,0,0,0 +3,3.258096,0,6.907755,8.294049,1,10.3,1,0,0 +3,3.258096,0,6.907755,8.294049,1,10.3,1,0,0 +15,3.258096,0,6.907755,8.294049,1,10.3,1,0,0 +6,3.258096,0,6.553078,7.939373,1,24.1,0,0,0 +2,3.258096,0,6.553078,7.939373,1,24.1,0,0,0 +5,3.258096,0,6.553078,7.939373,1,24.1,0,0,0 +2,3.258096,0,6.553078,7.939373,1,24.1,0,0,0 +3,3.258096,0,6.553078,7.939373,1,24.1,0,0,0 +5,3.258096,0,6.553078,7.939373,1,24.1,0,0,0 +3,3.258096,0,6.553078,7.939373,0,11.84267,0,0,0 +0,3.258096,0,6.553078,7.939373,0,11.84267,0,0,0 +0,3.258096,0,6.553078,7.939373,0,11.84267,0,0,0 +0,3.258096,0,6.553078,7.939373,0,11.84267,0,0,0 +1,3.258096,0,6.553078,7.939373,0,11.84267,0,0,0 +0,3.258096,0,6.553078,7.939373,0,11.84267,0,0,0 +5,0,0,5.988059,0,1,34.5,1,0,0 +7,0,0,5.988059,0,1,34.5,1,0,0 +8,0,0,5.988059,0,1,34.5,1,0,0 +5,0,0,5.988059,0,1,6.9,1,0,0 +9,0,0,5.988059,0,1,6.9,1,0,0 +3,0,0,5.988059,0,1,6.9,1,0,0 +0,4.564348,0,6.72827,6.779563,0,0,0,0,0 +1,4.564348,0,6.72827,6.779563,0,0,0,0,0 +0,4.564348,0,6.72827,6.779563,0,0,0,0,0 +0,4.564348,0,6.72827,6.779563,0,0,0,0,0 +1,4.564348,0,6.72827,6.779563,0,0,0,0,0 +1,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +0,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +1,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +1,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +0,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +2,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +3,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +0,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +1,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +4,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +0,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +1,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +0,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +0,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +0,4.564348,0,6.72827,6.779563,0,11.84267,0,0,0 +6,4.564348,0,6.72827,6.779563,1,10.3,0,0,0 +2,4.564348,0,6.72827,6.779563,1,10.3,0,0,0 +1,4.564348,0,6.72827,6.779563,1,10.3,0,0,0 +4,4.564348,0,6.72827,6.779563,1,10.3,0,0,0 +8,4.564348,0,6.72827,6.779563,1,10.3,0,0,0 +5,0,0,0,0,0,13.8,1,0,0 +2,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +5,0,0,0,0,0,13.8,1,0,0 +2,0,0,0,0,0,13.8,1,0,0 +7,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.079933,6.160541,0,3.4,1,0,0 +3,0,1,6.079933,6.160541,0,3.4,1,0,0 +0,0,1,6.079933,6.160541,0,6.9,0,0,0 +0,0,1,6.079933,6.160541,0,6.9,0,0,0 +2,0,1,6.079933,6.160541,0,6.9,0,0,0 +0,0,1,6.079933,6.160541,0,3.4,0,0,0 +0,0,1,6.079933,6.160541,0,3.4,0,0,0 +0,0,1,6.079933,6.160541,0,3.4,0,0,0 +4,4.564348,0,6.680604,6.731897,1,10.3,1,0,0 +4,4.564348,0,6.680604,6.731897,1,10.3,1,0,0 +0,4.564348,0,6.680604,6.731897,1,10.3,1,0,0 +2,4.564348,0,6.680604,6.731897,0,11.84267,0,0,0 +1,4.564348,0,6.680604,6.731897,0,11.84267,0,0,0 +1,4.564348,0,6.680604,6.731897,0,11.84267,0,0,0 +13,0,0,0,0,0,6.9,1,0,0 +7,0,0,0,0,0,6.9,1,0,0 +5,0,0,0,0,0,6.9,1,0,0 +4,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +6,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +2,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +1,4.564348,0,5.375278,6.958999,0,11.84267,0,0,0 +2,4.564348,0,5.375278,6.958999,0,11.84267,0,0,0 +1,4.564348,0,5.375278,6.958999,0,11.84267,0,0,0 +3,4.564348,0,5.375278,6.958999,0,20.7,0,0,0 +0,4.564348,0,5.375278,6.958999,0,20.7,0,0,0 +1,4.564348,0,5.375278,6.958999,0,20.7,0,0,0 +6,4.564348,0,5.375278,6.958999,0,6.9,0,0,0 +1,4.564348,0,5.375278,6.958999,0,6.9,0,0,0 +0,4.564348,0,5.375278,6.958999,0,6.9,0,0,0 +3,4.564348,0,5.375278,6.958999,0,11.84267,0,0,0 +1,4.564348,0,5.375278,6.958999,0,11.84267,0,0,0 +1,4.564348,0,5.375278,6.958999,0,11.84267,0,0,0 +4,0,0,4.063885,0,0,6.9,1,0,0 +0,0,0,4.063885,0,0,6.9,1,0,0 +4,0,0,4.063885,0,0,6.9,1,0,0 +8,0,0,4.063885,0,0,17.2,1,0,0 +1,0,0,4.063885,0,0,17.2,1,0,0 +2,0,0,4.063885,0,0,17.2,1,0,0 +10,0,0,4.063885,0,0,13.8,1,0,0 +7,0,0,4.063885,0,0,13.8,1,0,0 +7,0,0,4.063885,0,0,13.8,1,0,0 +3,0,0,6.840974,0,0,6.9,0,0,0 +1,0,0,6.840974,0,0,6.9,0,0,0 +4,0,0,6.840974,0,0,6.9,0,0,0 +2,0,0,6.840974,0,0,24.1,0,0,0 +2,0,0,6.840974,0,0,24.1,0,0,0 +3,0,0,6.840974,0,0,24.1,0,0,0 +2,0,0,6.840974,0,0,11.84267,0,0,0 +4,0,0,6.840974,0,0,11.84267,0,0,0 +4,0,0,6.840974,0,0,11.84267,0,0,0 +0,0,0,6.840974,0,0,11.84267,0,0,0 +3,0,0,6.840974,0,0,11.84267,0,0,0 +1,0,0,6.840974,0,0,11.84267,0,0,0 +2,0,0,6.840974,0,0,11.84267,0,0,0 +4,0,0,6.840974,0,0,11.84267,0,0,0 +1,0,0,6.840974,0,0,11.84267,0,0,0 +2,0,0,6.840974,0,.1981873,13.8,0,0,0 +2,0,0,6.840974,0,.1981873,13.8,0,0,0 +1,0,0,6.840974,0,.1981873,13.8,0,0,0 +11,0,0,0,0,0,10.3,0,0,0 +9,0,0,0,0,0,10.3,0,0,0 +6,0,0,0,0,0,10.3,0,0,0 +7,3.258096,0,6.572423,7.958717,0,24.1,1,0,0 +9,3.258096,0,6.572423,7.958717,0,24.1,1,0,0 +9,3.258096,0,6.572423,7.958717,0,24.1,1,0,0 +5,0,1,0,5.755076,0,3.4,0,0,0 +0,0,1,0,5.755076,0,3.4,0,0,0 +3,0,1,0,5.755076,0,3.4,0,0,0 +1,0,1,0,5.755076,0,3.4,0,0,0 +0,0,1,0,5.755076,0,3.4,0,0,0 +1,0,1,0,5.755076,0,3.4,0,0,0 +2,3.258096,0,0,7.167964,0,10.3,1,0,0 +3,3.258096,0,0,7.167964,0,10.3,1,0,0 +2,3.258096,0,0,7.167964,0,10.3,1,0,0 +1,3.258096,0,0,7.167964,0,3.4,0,0,0 +3,3.258096,0,0,7.167964,0,3.4,0,0,0 +4,3.258096,0,0,7.167964,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +6,0,0,0,0,0,3.4,0,0,0 +23,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +9,0,0,0,0,0,11.84267,0,0,0 +6,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +6,0,0,0,0,0,11.84267,0,0,0 +11,0,0,0,0,0,11.84267,0,0,0 +11,0,0,0,0,0,20.7,0,0,0 +2,0,0,0,0,0,20.7,0,0,0 +4,0,0,0,0,0,20.7,0,0,0 +13,0,0,0,0,0,20.7,0,0,0 +18,0,0,0,0,0,20.7,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +4,0,0,0,0,0,0,0,1,0 +3,0,0,0,0,0,0,0,1,0 +4,0,0,0,0,0,0,0,1,0 +4,0,0,0,0,0,17.2,1,0,0 +2,0,0,0,0,0,17.2,1,0,0 +5,0,0,0,0,0,17.2,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +8,0,0,0,0,1,6.9,0,0,0 +3,0,0,0,0,1,6.9,0,0,0 +5,0,0,0,0,1,6.9,0,0,0 +3,0,0,0,0,0,11.84267,1,0,0 +4,0,0,0,0,0,11.84267,1,0,0 +1,0,0,0,0,0,11.84267,1,0,0 +10,0,0,0,0,0,11.84267,0,1,0 +7,0,0,0,0,0,11.84267,0,1,0 +6,0,0,0,0,0,11.84267,0,1,0 +17,0,0,0,0,1,34.5,0,1,0 +19,0,0,0,0,1,34.5,0,1,0 +13,0,0,0,0,1,34.5,0,1,0 +6,0,0,4.599152,0,0,10.3,0,0,0 +2,0,0,4.599152,0,0,10.3,0,0,0 +7,0,0,4.599152,0,0,10.3,0,0,0 +4,0,0,4.599152,0,1,17.2,0,1,0 +6,0,0,4.599152,0,1,17.2,0,1,0 +4,0,0,4.599152,0,1,17.2,0,1,0 +1,0,1,5.703783,5.755076,0,27.6,0,0,0 +8,0,1,5.703783,5.755076,0,27.6,0,0,0 +2,0,1,5.703783,5.755076,0,27.6,0,0,0 +0,0,1,5.703783,5.755076,0,17.2,0,0,0 +4,0,1,5.703783,5.755076,0,17.2,0,0,0 +3,0,1,5.703783,5.755076,0,17.2,0,0,0 +0,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +1,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +1,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +0,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +1,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +13,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +0,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +1,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +0,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +0,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +0,4.564348,0,6.114964,6.63781,0,3.4,1,0,0 +0,4.564348,0,6.114964,6.63781,0,3.4,1,0,0 +0,4.564348,0,6.114964,6.63781,0,3.4,1,0,0 +0,4.564348,0,6.114964,6.63781,0,3.4,1,0,0 +0,4.564348,0,6.114964,6.63781,0,3.4,1,0,0 +0,4.564348,0,6.114964,6.63781,0,10.3,0,0,0 +0,4.564348,0,6.114964,6.63781,0,10.3,0,0,0 +0,4.564348,0,6.114964,6.63781,0,10.3,0,0,0 +0,4.564348,0,6.114964,6.63781,0,10.3,0,0,0 +0,4.564348,0,6.114964,6.63781,0,10.3,0,0,0 +0,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +0,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +2,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +0,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +1,4.564348,0,6.114964,6.63781,0,11.84267,0,0,0 +1,0,0,4.564348,0,0,0,0,0,0 +1,0,0,4.564348,0,0,0,0,0,0 +1,0,0,4.564348,0,0,0,0,0,0 +1,0,0,4.564348,0,0,0,0,0,0 +3,0,0,4.564348,0,0,0,0,0,0 +0,0,0,4.564348,0,0,0,0,0,0 +8,0,0,4.564348,0,0,0,0,0,0 +0,0,0,4.564348,0,0,0,0,0,0 +1,0,0,4.564348,0,0,0,0,0,0 +4,0,0,4.564348,0,0,0,0,0,0 +10,0,0,4.564348,0,1,31,1,0,0 +6,0,0,4.564348,0,1,31,1,0,0 +3,0,0,4.564348,0,1,31,1,0,0 +3,0,0,4.564348,0,1,31,1,0,0 +8,0,0,4.564348,0,1,31,1,0,0 +0,0,0,4.564348,0,0,11.84267,0,0,0 +5,0,0,4.564348,0,0,11.84267,0,0,0 +4,0,0,4.564348,0,0,11.84267,0,0,0 +6,0,0,4.564348,0,0,11.84267,0,0,0 +4,0,0,4.564348,0,0,11.84267,0,0,0 +9,0,0,4.564348,0,0,10.3,0,0,0 +0,0,0,4.564348,0,0,10.3,0,0,0 +0,0,0,4.564348,0,0,10.3,0,0,0 +1,0,0,4.564348,0,0,10.3,0,0,0 +3,0,0,4.564348,0,0,10.3,0,0,0 +5,0,1,6.109248,6.160541,1,13.8,1,0,0 +0,0,1,6.109248,6.160541,1,13.8,1,0,0 +6,0,1,6.109248,6.160541,1,13.8,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +6,0,1,6.109248,6.160541,0,20.7,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +4,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,27.6,1,0,0 +3,4.564348,0,6.907755,6.959049,0,27.6,1,0,0 +2,4.564348,0,6.907755,6.959049,0,27.6,1,0,0 +2,4.564348,0,6.907755,6.959049,0,27.6,1,0,0 +2,4.564348,0,6.907755,6.959049,0,27.6,1,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,1,0,0 +1,3.258096,0,6.907755,8.294049,0,3.4,1,0,0 +5,3.258096,0,6.907755,8.294049,0,3.4,1,0,0 +12,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +62,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +74,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +3,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +2,3.258096,0,6.907755,8.294049,1,3.4,1,0,0 +1,3.258096,0,6.907755,8.294049,1,3.4,1,0,0 +3,3.258096,0,6.907755,8.294049,1,3.4,1,0,0 +11,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +16,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +26,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +7,3.258096,0,0,8.294049,0,11.84267,0,0,0 +3,3.258096,0,0,8.294049,0,11.84267,0,0,0 +4,3.258096,0,0,8.294049,0,11.84267,0,0,0 +1,3.258096,0,0,8.294049,0,11.84267,0,0,0 +2,3.258096,0,0,8.294049,0,11.84267,0,0,0 +3,3.258096,0,0,8.294049,0,11.84267,0,0,0 +2,3.258096,0,0,8.294049,0,11.84267,0,0,0 +1,3.258096,0,0,8.294049,0,11.84267,0,0,0 +2,3.258096,0,0,8.294049,0,11.84267,0,0,0 +4,3.258096,0,0,8.294049,0,11.84267,0,0,0 +0,3.258096,0,0,8.294049,0,10.3,0,0,0 +1,3.258096,0,0,8.294049,0,10.3,0,0,0 +0,3.258096,0,0,8.294049,0,10.3,0,0,0 +0,3.258096,0,0,8.294049,0,10.3,0,0,0 +2,3.258096,0,0,8.294049,0,10.3,0,0,0 +3,3.258096,0,0,8.294049,0,13.8,0,0,0 +4,3.258096,0,0,8.294049,0,13.8,0,0,0 +6,3.258096,0,0,8.294049,0,13.8,0,0,0 +1,3.258096,0,0,8.294049,0,13.8,0,0,0 +2,3.258096,0,0,8.294049,0,13.8,0,0,0 +4,3.258096,0,0,6.624596,0,6.9,0,0,0 +4,3.258096,0,0,6.624596,0,6.9,0,0,0 +2,3.258096,0,0,6.624596,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +11,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +19,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +19,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +8,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +4,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,3.258096,0,6.981507,8.294049,0,3.4,1,0,0 +1,3.258096,0,6.981507,8.294049,0,3.4,1,0,0 +0,3.258096,0,6.981507,8.294049,0,3.4,1,0,0 +4,3.258096,0,6.981507,8.294049,0,11.84267,1,0,0 +2,3.258096,0,6.981507,8.294049,0,11.84267,1,0,0 +5,3.258096,0,6.981507,8.294049,0,11.84267,1,0,0 +3,3.258096,0,6.981507,8.294049,0,11.84267,1,0,0 +1,3.258096,0,6.981507,8.294049,0,11.84267,1,0,0 +1,3.258096,0,6.981507,8.294049,0,11.84267,1,0,0 +1,3.258096,0,6.981507,8.294049,0,11.84267,1,0,0 +2,3.258096,0,6.981507,8.294049,0,11.84267,1,0,0 +3,3.258096,0,6.981507,8.294049,0,11.84267,1,0,0 +0,3.258096,0,6.981507,8.294049,1,10.3,1,0,0 +0,3.258096,0,6.981507,8.294049,1,10.3,1,0,0 +2,3.258096,0,6.981507,8.294049,1,10.3,1,0,0 +10,0,0,0,0,1,6.9,0,0,0 +4,0,0,0,0,1,6.9,0,0,0 +0,0,0,0,0,1,6.9,0,0,0 +2,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +6,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +3,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.031646,7.417941,0,17.2,0,1,0 +0,3.258096,0,6.031646,7.417941,0,17.2,0,1,0 +0,3.258096,0,6.031646,7.417941,0,17.2,0,1,0 +0,3.258096,0,6.031646,7.417941,0,11.84267,0,1,0 +2,3.258096,0,6.031646,7.417941,0,11.84267,0,1,0 +0,3.258096,0,6.031646,7.417941,0,11.84267,0,1,0 +0,3.258096,0,6.031646,7.417941,0,0,0,1,0 +0,3.258096,0,6.031646,7.417941,0,0,0,1,0 +0,3.258096,0,6.031646,7.417941,0,0,0,1,0 +2,3.258096,0,6.031646,7.417941,0,0,0,1,0 +0,3.258096,0,6.031646,7.417941,0,0,0,1,0 +3,3.258096,0,6.031646,7.417941,0,0,0,1,0 +0,3.258096,0,6.031646,7.417941,0,11.84267,0,1,0 +0,3.258096,0,6.031646,7.417941,0,11.84267,0,1,0 +0,3.258096,0,6.031646,7.417941,0,11.84267,0,1,0 +0,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,10.3,0,1,0 +1,0,0,0,0,0,10.3,0,1,0 +1,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,1,34.5,1,0,0 +0,0,0,0,0,1,34.5,1,0,0 +3,0,0,0,0,1,34.5,1,0,0 +5,4.564348,0,6.703188,6.754481,0,6.9,0,0,0 +2,4.564348,0,6.703188,6.754481,0,6.9,0,0,0 +2,4.564348,0,6.703188,6.754481,0,6.9,0,0,0 +3,4.564348,0,6.703188,6.754481,0,11.84267,0,0,0 +0,4.564348,0,6.703188,6.754481,0,11.84267,0,0,0 +2,4.564348,0,6.703188,6.754481,0,11.84267,0,0,0 +2,4.564348,0,6.703188,6.754481,0,6.9,0,0,0 +1,4.564348,0,6.703188,6.754481,0,6.9,0,0,0 +3,4.564348,0,6.703188,6.754481,0,6.9,0,0,0 +6,4.564348,0,6.907755,6.959049,1,11.84267,0,1,0 +0,4.564348,0,6.907755,6.959049,1,11.84267,0,1,0 +1,4.564348,0,6.907755,6.959049,1,11.84267,0,1,0 +3,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +2,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +1,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +0,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +1,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +45,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +37,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,5.298317,5.349611,0,6.9,1,0,0 +0,4.564348,0,5.298317,5.349611,0,6.9,1,0,0 +0,4.564348,0,5.298317,5.349611,0,6.9,1,0,0 +4,4.564348,0,5.298317,5.349611,1,17.2,1,0,0 +2,4.564348,0,5.298317,5.349611,1,17.2,1,0,0 +4,4.564348,0,5.298317,5.349611,1,17.2,1,0,0 +4,0,1,5.010635,5.061929,0,6.9,1,0,0 +7,0,1,5.010635,5.061929,0,6.9,1,0,0 +7,0,1,5.010635,5.061929,0,6.9,1,0,0 +1,0,1,5.010635,5.061929,0,3.4,1,0,0 +0,0,1,5.010635,5.061929,0,3.4,1,0,0 +0,0,1,5.010635,5.061929,0,3.4,1,0,0 +0,0,1,5.010635,5.061929,0,13.8,1,0,0 +0,0,1,5.010635,5.061929,0,13.8,1,0,0 +0,0,1,5.010635,5.061929,0,13.8,1,0,0 +1,0,1,0,5.061929,0,0,0,0,0 +3,0,1,0,5.061929,0,0,0,0,0 +2,0,1,0,5.061929,0,0,0,0,0 +1,0,1,0,5.061929,0,3.4,0,0,0 +0,0,1,0,5.061929,0,3.4,0,0,0 +0,0,1,0,5.061929,0,3.4,0,0,0 +4,0,0,6.120297,0,0,10.3,0,0,0 +3,0,0,6.120297,0,0,10.3,0,0,0 +2,0,0,6.120297,0,0,10.3,0,0,0 +4,0,0,6.120297,0,0,11.84267,0,0,0 +1,0,0,6.120297,0,0,11.84267,0,0,0 +2,0,0,6.120297,0,0,11.84267,0,0,0 +2,0,0,6.120297,0,0,11.84267,0,0,0 +5,0,0,6.120297,0,0,11.84267,0,0,0 +2,0,0,6.120297,0,0,11.84267,0,0,0 +1,0,0,6.120297,0,0,10.3,0,0,0 +2,0,0,6.120297,0,0,10.3,0,0,0 +1,0,0,6.120297,0,0,10.3,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +7,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +7,4.564348,0,6.907755,6.959049,0,37.9,1,0,0 +1,4.564348,0,6.907755,6.959049,0,37.9,1,0,0 +2,4.564348,0,6.907755,6.959049,0,37.9,1,0,0 +2,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +10,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +5,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +0,0,1,5.010635,5.061929,0,10.3,1,0,0 +3,0,1,5.010635,5.061929,0,10.3,1,0,0 +4,0,1,5.010635,5.061929,0,10.3,1,0,0 +0,0,1,5.010635,5.061929,0,10.3,1,0,0 +0,0,1,5.010635,5.061929,0,10.3,1,0,0 +0,4.564348,0,0,6.671367,1,20.7,0,0,0 +0,4.564348,0,0,6.671367,1,20.7,0,0,0 +0,4.564348,0,0,6.671367,1,20.7,0,0,0 +0,4.564348,0,0,6.671367,1,20.7,0,0,0 +0,4.564348,0,0,6.671367,1,20.7,0,0,0 +5,3.258096,0,6.907755,8.294049,1,24.1,1,0,0 +1,3.258096,0,6.907755,8.294049,1,24.1,1,0,0 +5,3.258096,0,6.907755,8.294049,1,24.1,1,0,0 +4,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +4,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +4,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +8,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +8,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +0,3.258096,0,6.395262,7.774856,0,11.84267,0,0,0 +0,3.258096,0,6.395262,7.774856,0,11.84267,0,0,0 +0,3.258096,0,6.395262,7.774856,0,11.84267,0,0,0 +0,3.258096,0,6.395262,7.774856,0,3.4,1,0,0 +21,3.258096,0,6.395262,7.774856,0,3.4,1,0,0 +6,3.258096,0,6.395262,7.774856,0,3.4,1,0,0 +4,3.258096,0,6.395262,7.774856,0,11.84267,0,0,0 +3,3.258096,0,6.395262,7.774856,0,11.84267,0,0,0 +5,3.258096,0,6.395262,7.774856,0,11.84267,0,0,0 +0,3.258096,0,6.395262,7.774856,0,11.84267,0,0,0 +1,3.258096,0,6.395262,7.774856,0,11.84267,0,0,0 +0,3.258096,0,6.395262,7.774856,0,11.84267,0,0,0 +0,3.258096,0,6.395262,7.774856,0,3.4,1,0,0 +0,3.258096,0,6.395262,7.774856,0,3.4,1,0,0 +0,3.258096,0,6.395262,7.774856,0,3.4,1,0,0 +0,0,1,0,5.061929,0,3.4,0,1,0 +0,0,1,0,5.061929,0,3.4,0,1,0 +0,0,1,0,5.061929,0,3.4,0,1,0 +5,0,0,5.871329,0,0,6.9,1,0,0 +5,0,0,5.871329,0,0,6.9,1,0,0 +4,0,0,5.871329,0,0,6.9,1,0,0 +5,0,0,5.871329,0,1,10.3,1,0,0 +14,0,0,5.871329,0,1,10.3,1,0,0 +6,0,0,5.871329,0,1,10.3,1,0,0 +0,0,1,5.743003,5.755076,0,0,0,1,0 +0,0,1,5.743003,5.755076,0,0,0,1,0 +0,0,1,5.743003,5.755076,0,0,0,1,0 +4,0,1,5.743003,5.755076,0,10.3,0,1,0 +2,0,1,5.743003,5.755076,0,10.3,0,1,0 +0,0,1,5.743003,5.755076,0,10.3,0,1,0 +3,0,0,5.805978,0,0,10.3,0,0,0 +34,0,0,5.805978,0,0,10.3,0,0,0 +18,0,0,5.805978,0,0,10.3,0,0,0 +0,0,0,5.805978,0,0,17.2,0,0,0 +1,0,0,5.805978,0,0,17.2,0,0,0 +3,0,0,5.805978,0,0,17.2,0,0,0 +7,0,0,5.805978,0,0,11.84267,0,0,0 +1,0,0,5.805978,0,0,11.84267,0,0,0 +2,0,0,5.805978,0,0,11.84267,0,0,0 +0,0,0,5.506307,0,0,13.8,1,0,0 +1,0,0,5.506307,0,0,13.8,1,0,0 +1,0,0,5.506307,0,0,13.8,1,0,0 +7,0,0,5.506307,0,0,3.4,1,0,0 +4,0,0,5.506307,0,0,3.4,1,0,0 +2,0,0,5.506307,0,0,3.4,1,0,0 +0,0,0,5.506307,0,0,17.2,1,0,0 +1,0,0,5.506307,0,0,17.2,1,0,0 +3,0,0,5.506307,0,0,17.2,1,0,0 +8,3.258096,0,0,7.968458,0,10.3,0,1,0 +10,3.258096,0,0,7.968458,0,10.3,0,1,0 +12,3.258096,0,0,7.968458,0,10.3,0,1,0 +0,3.258096,0,0,7.968458,0,11.84267,1,0,0 +3,3.258096,0,0,7.968458,0,11.84267,1,0,0 +2,3.258096,0,0,7.968458,0,11.84267,1,0,0 +8,3.258096,0,0,7.968458,0,11.84267,1,0,0 +6,3.258096,0,0,7.968458,0,11.84267,1,0,0 +7,3.258096,0,0,7.968458,0,11.84267,1,0,0 +11,3.258096,0,0,7.968458,1,10.3,0,1,0 +2,3.258096,0,0,7.968458,1,10.3,0,1,0 +7,3.258096,0,0,7.968458,1,10.3,0,1,0 +6,3.258096,0,0,7.968458,0,11.84267,1,0,0 +3,3.258096,0,0,7.968458,0,11.84267,1,0,0 +6,3.258096,0,0,7.968458,0,11.84267,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +13,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +10,0,1,6.109248,6.160541,0,13.8,0,0,0 +4,0,1,6.109248,6.160541,0,13.8,0,0,0 +3,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,1,0,0,0,0 +0,0,1,6.109248,6.160541,1,0,0,0,0 +0,0,1,6.109248,6.160541,1,0,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +7,0,0,0,0,0,6.9,0,0,0 +8,0,0,0,0,1,17.2,0,1,0 +4,0,0,0,0,1,17.2,0,1,0 +5,0,0,0,0,1,17.2,0,1,0 +7,0,0,0,0,1,17.2,0,1,0 +3,0,0,0,0,1,17.2,0,1,0 +5,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +7,0,0,0,0,0,11.84267,1,0,0 +5,0,0,0,0,0,11.84267,1,0,0 +6,0,0,0,0,0,11.84267,1,0,0 +10,3.258096,0,6.243779,7.630073,0,10.3,0,0,0 +7,3.258096,0,6.243779,7.630073,0,10.3,0,0,0 +7,3.258096,0,6.243779,7.630073,0,10.3,0,0,0 +3,3.258096,0,6.243779,7.630073,0,11.84267,0,1,0 +0,3.258096,0,6.243779,7.630073,0,11.84267,0,1,0 +1,3.258096,0,6.243779,7.630073,0,11.84267,0,1,0 +3,3.258096,0,6.243779,7.630073,0,11.84267,0,0,0 +3,3.258096,0,6.243779,7.630073,0,11.84267,0,0,0 +1,3.258096,0,6.243779,7.630073,0,11.84267,0,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +19,0,1,6.215408,5.755076,1,31,0,0,0 +19,0,1,6.215408,5.755076,1,31,0,0,0 +12,0,1,6.215408,5.755076,1,31,0,0,0 +2,0,1,6.215408,5.755076,0,3.4,0,0,0 +5,0,0,3.871201,0,1,10.3,0,0,0 +0,0,0,3.871201,0,1,10.3,0,0,0 +0,0,0,3.871201,0,1,10.3,0,0,0 +0,0,0,3.871201,0,1,13.8,0,0,0 +0,0,0,3.871201,0,1,13.8,0,0,0 +0,0,0,3.871201,0,1,13.8,0,0,0 +0,0,0,3.871201,0,0,3.4,0,0,0 +0,0,0,3.871201,0,0,3.4,0,0,0 +0,0,0,3.871201,0,0,3.4,0,0,0 +0,0,0,3.871201,0,0,17.2,0,0,0 +0,0,0,3.871201,0,0,17.2,0,0,0 +0,0,0,3.871201,0,0,17.2,0,0,0 +9,3.258096,0,6.291291,7.677586,0,17.2,0,0,0 +12,3.258096,0,6.291291,7.677586,0,17.2,0,0,0 +10,3.258096,0,6.291291,7.677586,0,17.2,0,0,0 +1,3.258096,0,6.291291,7.677586,0,10.3,0,0,0 +5,3.258096,0,6.291291,7.677586,0,10.3,0,0,0 +1,3.258096,0,6.291291,7.677586,0,11.84267,0,0,0 +3,3.258096,0,6.291291,7.677586,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,1,11.84267,0,1,0 +1,0,0,0,0,1,11.84267,0,1,0 +2,0,0,0,0,1,11.84267,0,1,0 +1,0,0,0,0,0,11.84267,0,1,0 +0,0,0,0,0,0,11.84267,0,1,0 +0,0,0,0,0,0,11.84267,0,1,0 +0,0,0,0,0,0,27.6,1,0,0 +6,0,0,0,0,0,27.6,1,0,0 +2,0,0,0,0,0,27.6,1,0,0 +14,0,0,0,0,1,11.84267,0,1,0 +8,0,0,0,0,1,11.84267,0,1,0 +3,0,0,0,0,1,11.84267,0,1,0 +3,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +4,3.258096,0,5.768321,7.154615,0,20.7,1,0,0 +4,3.258096,0,5.768321,7.154615,0,20.7,1,0,0 +7,3.258096,0,5.768321,7.154615,0,20.7,1,0,0 +3,3.258096,0,5.768321,7.154615,0,11.84267,0,0,0 +3,3.258096,0,5.768321,7.154615,0,11.84267,0,0,0 +0,3.258096,0,5.768321,7.154615,0,11.84267,0,0,0 +6,3.258096,0,6.659294,8.045588,0,11.84267,0,0,0 +7,3.258096,0,6.659294,8.045588,0,11.84267,0,0,0 +4,3.258096,0,6.659294,8.045588,0,11.84267,0,0,0 +3,3.258096,0,6.659294,8.045588,0,17.2,1,0,0 +0,3.258096,0,6.659294,8.045588,0,17.2,1,0,0 +3,3.258096,0,6.659294,8.045588,0,17.2,1,0,0 +1,3.258096,0,6.659294,8.045588,0,11.84267,0,0,0 +4,3.258096,0,6.659294,8.045588,0,11.84267,0,0,0 +1,3.258096,0,6.659294,8.045588,0,11.84267,0,0,0 +3,3.258096,0,6.659294,8.045588,0,11.84267,0,0,0 +5,3.258096,0,6.659294,8.045588,0,11.84267,0,0,0 +3,3.258096,0,6.659294,8.045588,0,11.84267,0,0,0 +6,3.258096,0,6.659294,8.045588,0,0,0,0,0 +0,3.258096,0,6.659294,8.045588,0,0,0,0,0 +0,3.258096,0,6.659294,8.045588,0,0,0,0,0 +5,0,0,4.736198,0,0,6.9,0,0,0 +8,0,0,4.736198,0,0,6.9,0,0,0 +7,0,0,4.736198,0,0,6.9,0,0,0 +4,0,0,4.736198,0,0,11.84267,1,0,0 +1,0,0,4.736198,0,0,11.84267,1,0,0 +4,0,0,4.736198,0,0,11.84267,1,0,0 +2,0,0,4.736198,0,0,11.84267,1,0,0 +3,0,0,4.736198,0,0,11.84267,1,0,0 +2,0,0,4.736198,0,0,11.84267,1,0,0 +8,4.564348,0,5.584999,3.628682,0,17.2,0,0,0 +2,4.564348,0,5.584999,3.628682,0,17.2,0,0,0 +3,4.564348,0,5.584999,3.628682,0,17.2,0,0,0 +12,4.564348,0,5.675383,5.726676,1,24.1,0,1,0 +4,4.564348,0,5.675383,5.726676,1,24.1,0,1,0 +15,4.564348,0,5.675383,5.726676,1,24.1,0,1,0 +3,4.564348,0,5.675383,5.726676,1,3.4,0,1,0 +1,4.564348,0,5.675383,5.726676,1,3.4,0,1,0 +2,4.564348,0,5.675383,5.726676,1,3.4,0,1,0 +0,4.564348,0,5.675383,5.726676,0,6.9,0,1,0 +1,4.564348,0,5.675383,5.726676,0,6.9,0,1,0 +1,4.564348,0,5.675383,5.726676,0,6.9,0,1,0 +8,4.564348,0,5.675383,5.726676,0,0,1,0,0 +5,4.564348,0,5.675383,5.726676,0,0,1,0,0 +0,4.564348,0,5.675383,5.726676,0,0,1,0,0 +2,4.564348,0,5.675383,5.726676,1,6.9,1,0,0 +5,4.564348,0,5.675383,5.726676,1,6.9,1,0,0 +5,4.564348,0,5.675383,5.726676,1,6.9,1,0,0 +1,3.258096,0,0,7.495542,0,10.3,0,1,0 +1,3.258096,0,0,7.495542,0,10.3,0,1,0 +1,3.258096,0,0,7.495542,0,10.3,0,1,0 +1,3.258096,0,0,7.495542,0,10.3,0,1,0 +0,3.258096,0,0,7.495542,0,10.3,0,1,0 +19,4.564348,0,4.848116,4.89941,0,11.84267,0,0,0 +1,4.564348,0,4.848116,4.89941,0,13.8,0,0,0 +15,4.564348,0,6.907755,6.959049,1,20.7,0,1,0 +26,4.564348,0,6.907755,6.959049,1,20.7,0,1,0 +40,4.564348,0,6.907755,6.959049,1,20.7,0,1,0 +1,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +10,0,0,5.301911,0,1,17.2,1,0,0 +10,0,0,5.301911,0,1,17.2,1,0,0 +3,0,0,5.301911,0,1,17.2,1,0,0 +3,0,0,5.301911,0,1,17.2,1,0,0 +1,0,0,5.301911,0,1,17.2,1,0,0 +0,4.564348,0,0,6.566006,0,11.84267,0,0,0 +0,4.564348,0,0,6.566006,0,11.84267,0,0,0 +0,4.564348,0,0,6.566006,0,11.84267,0,0,0 +2,4.564348,0,5.087596,5.061929,0,17.2,1,0,0 +0,4.564348,0,5.087596,5.061929,0,17.2,1,0,0 +0,4.564348,0,5.087596,5.061929,0,17.2,1,0,0 +8,4.564348,0,5.087596,5.061929,0,13.8,1,0,0 +0,4.564348,0,5.087596,5.061929,0,13.8,1,0,0 +0,4.564348,0,5.087596,5.061929,0,13.8,1,0,0 +0,0,1,5.703783,5.755076,0,11.84267,0,0,0 +0,0,1,5.703783,5.755076,0,11.84267,0,0,0 +0,0,1,5.703783,5.755076,0,11.84267,0,0,0 +0,0,1,5.703783,5.755076,0,10.3,0,0,0 +0,0,1,5.703783,5.755076,0,10.3,0,0,0 +0,0,1,5.703783,5.755076,0,10.3,0,0,0 +13,3.258096,0,6.907755,8.294049,0,27.6,1,0,0 +7,3.258096,0,6.907755,8.294049,0,27.6,1,0,0 +15,3.258096,0,6.907755,8.294049,0,27.6,1,0,0 +2,0,1,6.145901,5.061929,0,17.2,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,5.941539,0,0,11.84267,0,0,0 +3,0,0,5.941539,0,0,11.84267,0,0,0 +2,0,0,5.941539,0,0,11.84267,0,0,0 +3,0,0,5.941539,0,0,11.84267,1,0,0 +7,0,0,5.941539,0,0,11.84267,1,0,0 +2,0,0,5.941539,0,0,11.84267,1,0,0 +6,0,0,5.941539,0,0,34.5,0,0,0 +7,0,0,5.941539,0,0,34.5,0,0,0 +3,0,0,5.941539,0,0,34.5,0,0,0 +2,0,0,0,0,1,17.2,1,0,0 +0,0,0,0,0,1,17.2,1,0,0 +4,0,0,0,0,1,17.2,1,0,0 +1,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +8,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,34.5,1,0,0 +13,0,0,0,0,0,34.5,1,0,0 +10,0,0,0,0,0,34.5,1,0,0 +16,0,0,0,0,0,11.84267,1,0,0 +5,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +6,0,0,0,0,0,3.4,0,0,0 +6,0,0,0,0,0,3.4,0,0,0 +7,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +0,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +10,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +4,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +0,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +4,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +1,3.258096,0,3.871201,5.257495,1,10.3,1,0,0 +0,3.258096,0,3.871201,5.257495,1,10.3,1,0,0 +5,3.258096,0,3.871201,5.257495,1,10.3,1,0,0 +2,3.258096,0,3.871201,5.257495,1,10.3,1,0,0 +4,3.258096,0,3.871201,5.257495,1,10.3,1,0,0 +24,3.258096,0,3.871201,5.257495,0,10.3,1,0,0 +16,3.258096,0,3.871201,5.257495,0,10.3,1,0,0 +9,3.258096,0,3.871201,5.257495,0,10.3,1,0,0 +4,3.258096,0,3.871201,5.257495,0,10.3,1,0,0 +4,3.258096,0,3.871201,5.257495,0,10.3,1,0,0 +0,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +1,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +0,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +0,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +0,3.258096,0,3.871201,5.257495,0,3.4,1,0,0 +10,0,0,5.622572,0,0,13.8,0,0,0 +9,0,0,5.622572,0,0,13.8,0,0,0 +1,0,0,5.622572,0,0,13.8,0,0,0 +2,0,0,5.622572,0,0,3.4,0,0,0 +3,0,0,5.622572,0,0,3.4,0,0,0 +1,0,0,5.622572,0,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +2,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +16,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,4.564348,0,6.300786,6.352079,0,11.84267,0,0,0 +1,4.564348,0,6.300786,6.352079,0,11.84267,0,0,0 +4,4.564348,0,6.300786,6.352079,0,17.2,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,1,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,1,0 +5,4.564348,0,6.907755,6.959049,0,10.3,0,1,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +6,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +8,4.564348,0,6.907755,6.959049,1,37.9,0,1,0 +5,4.564348,0,6.907755,6.959049,1,37.9,0,1,0 +7,4.564348,0,6.907755,6.959049,1,37.9,0,1,0 +3,0,0,6.351409,0,1,11.84267,0,0,0 +3,0,0,6.351409,0,1,11.84267,0,0,0 +0,0,0,6.351409,0,1,11.84267,0,0,0 +3,0,0,6.351409,0,0,11.84267,0,0,0 +1,0,0,6.351409,0,0,11.84267,0,0,0 +0,0,0,6.351409,0,0,11.84267,0,0,0 +3,0,0,6.351409,0,1,10.3,1,0,0 +2,0,0,6.351409,0,1,10.3,1,0,0 +3,0,0,6.351409,0,1,10.3,1,0,0 +4,0,0,3.583519,0,0,17.2,1,0,0 +3,0,0,3.583519,0,0,17.2,1,0,0 +9,0,0,3.583519,0,0,17.2,1,0,0 +2,0,0,0,0,1,20.7,0,0,0 +3,0,0,0,0,1,20.7,0,0,0 +2,0,0,0,0,1,20.7,0,0,0 +7,0,0,0,0,1,10.3,1,0,0 +11,0,0,0,0,1,10.3,1,0,0 +4,0,0,0,0,1,10.3,1,0,0 +5,3.258096,0,0,5.075174,0,17.2,0,0,0 +6,3.258096,0,0,5.075174,0,17.2,0,0,0 +13,3.258096,0,0,5.075174,0,17.2,0,0,0 +0,4.564348,0,0,6.619512,0,3.4,0,0,0 +0,4.564348,0,0,6.619512,0,3.4,0,0,0 +0,4.564348,0,0,6.619512,0,3.4,0,0,0 +2,4.564348,0,0,6.619512,0,3.4,1,0,0 +2,4.564348,0,0,6.619512,0,3.4,1,0,0 +0,4.564348,0,0,6.619512,0,3.4,1,0,0 +0,4.564348,0,0,6.619512,0,11.84267,0,0,0 +1,4.564348,0,0,6.619512,0,11.84267,0,0,0 +1,4.564348,0,0,6.619512,0,11.84267,0,0,0 +0,0,1,5.010635,5.061929,0,17.2,0,0,0 +0,4.564348,0,6.907755,6.959049,1,27.6,0,0,0 +0,4.564348,0,6.907755,6.959049,1,27.6,0,0,0 +0,4.564348,0,6.907755,6.959049,1,27.6,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,31,0,0,0 +2,4.564348,0,6.907755,6.959049,0,31,0,0,0 +2,4.564348,0,6.907755,6.959049,0,31,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +5,0,0,5.678431,0,1,27.6,1,0,0 +2,0,0,5.678431,0,1,27.6,1,0,0 +3,0,0,5.678431,0,1,27.6,1,0,0 +0,0,1,5.831296,5.061929,1,17.2,0,0,0 +1,0,1,5.831296,5.061929,1,17.2,0,0,0 +0,0,1,5.831296,5.061929,1,17.2,0,0,0 +0,0,1,0,5.061929,0,0,0,0,0 +2,0,1,0,5.061929,0,0,0,0,0 +0,0,1,0,5.061929,0,0,0,0,0 +7,0,1,6.109248,6.160541,0,11.84267,1,0,0 +11,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,11.84267,1,0,0 +5,0,1,6.109248,6.160541,0,13.8,1,0,0 +10,0,1,6.109248,6.160541,0,13.8,1,0,0 +6,0,1,6.109248,6.160541,0,13.8,1,0,0 +24,0,1,6.109248,6.160541,1,11.84267,0,1,0 +39,0,1,6.109248,6.160541,1,11.84267,0,1,0 +12,0,1,6.109248,6.160541,1,11.84267,0,1,0 +8,0,1,6.109248,6.160541,0,6.9,1,0,0 +6,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,1,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,1,20.7,0,1,0 +5,0,0,0,0,1,17.2,1,0,0 +2,3.258096,0,6.802839,8.189134,0,11.84267,0,0,0 +2,3.258096,0,6.802839,8.189134,0,11.84267,0,0,0 +11,3.258096,0,6.802839,8.189134,0,11.84267,0,0,0 +12,3.258096,0,6.802839,8.189134,0,11.84267,0,0,0 +5,3.258096,0,6.802839,8.189134,0,11.84267,0,0,0 +1,3.258096,0,6.802839,8.189134,1,10.3,1,0,0 +4,3.258096,0,6.802839,8.189134,1,10.3,1,0,0 +5,3.258096,0,6.802839,8.189134,1,10.3,1,0,0 +29,3.258096,0,6.802839,8.189134,1,10.3,1,0,0 +11,3.258096,0,6.802839,8.189134,1,20.7,1,0,0 +3,3.258096,0,6.802839,8.189134,1,20.7,1,0,0 +14,3.258096,0,6.802839,8.189134,1,20.7,1,0,0 +5,3.258096,0,6.802839,8.189134,1,20.7,1,0,0 +5,3.258096,0,6.802839,8.189134,1,20.7,1,0,0 +2,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,1 +1,0,1,6.109248,6.160541,0,3.4,0,0,1 +0,0,1,6.109248,6.160541,0,3.4,0,0,1 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +1,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +3,0,1,6.109248,6.160541,0,6.9,0,1,0 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +0,0,1,5.010635,5.061929,0,0,1,0,0 +2,0,1,5.010635,5.061929,0,0,1,0,0 +0,0,1,5.010635,5.061929,0,0,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +1,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +9,3.258096,0,6.907755,8.294049,1,27.6,1,0,0 +7,3.258096,0,6.907755,8.294049,1,27.6,1,0,0 +19,3.258096,0,6.907755,8.294049,1,27.6,1,0,0 +0,3.258096,0,6.907755,8.294049,1,17.2,0,0,0 +0,3.258096,0,6.907755,8.294049,1,17.2,0,0,0 +4,3.258096,0,6.907755,8.294049,1,17.2,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +2,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +4,0,0,0,0,1,13.8,1,0,0 +4,0,0,0,0,1,13.8,1,0,0 +12,0,0,0,0,1,13.8,1,0,0 +8,0,0,0,0,1,13.8,1,0,0 +52,0,0,0,0,1,13.8,1,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +11,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +6,0,0,0,0,0,11.84267,0,0,0 +11,0,0,0,0,0,11.84267,0,0,0 +8,0,0,0,0,0,11.84267,0,0,0 +8,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +6,0,0,0,0,0,10.3,0,0,0 +11,0,0,5.981414,0,1,10.3,1,0,0 +15,0,0,5.981414,0,1,10.3,1,0,0 +13,0,0,5.981414,0,1,10.3,1,0,0 +13,0,0,5.981414,0,1,10.3,1,0,0 +11,0,0,5.981414,0,1,10.3,1,0,0 +0,0,0,5.192957,0,0,3.4,0,0,0 +0,0,0,5.192957,0,0,3.4,0,0,0 +1,0,0,5.192957,0,0,3.4,0,0,0 +3,0,0,5.192957,0,0,6.9,0,0,0 +3,0,0,5.192957,0,0,6.9,0,0,0 +2,0,0,5.192957,0,0,6.9,0,0,0 +1,0,0,5.192957,0,0,0,0,0,0 +2,0,0,5.192957,0,0,0,0,0,0 +2,0,0,5.192957,0,0,0,0,0,0 +5,0,0,5.192957,0,1,13.8,0,0,1 +1,0,0,5.192957,0,1,13.8,0,0,1 +3,0,0,5.192957,0,1,13.8,0,0,1 +1,4.564348,0,6.720943,6.772237,0,17.2,1,0,0 +1,4.564348,0,6.720943,6.772237,0,17.2,1,0,0 +5,4.564348,0,6.720943,6.772237,0,17.2,1,0,0 +4,4.564348,0,6.720943,6.772237,0,11.84267,0,0,0 +1,4.564348,0,6.720943,6.772237,0,11.84267,0,0,0 +2,4.564348,0,6.720943,6.772237,0,11.84267,0,0,0 +1,4.564348,0,6.720943,6.772237,0,13.8,1,0,0 +4,4.564348,0,6.720943,6.772237,0,13.8,1,0,0 +0,4.564348,0,6.720943,6.772237,0,13.8,1,0,0 +9,4.564348,0,6.720943,6.772237,0,11.84267,1,0,0 +1,4.564348,0,6.720943,6.772237,0,10.3,0,0,0 +0,4.564348,0,6.720943,6.772237,0,10.3,0,0,0 +0,4.564348,0,6.720943,6.772237,0,10.3,0,0,0 +2,4.564348,0,6.720943,6.772237,0,10.3,0,1,0 +4,4.564348,0,6.720943,6.772237,0,11.84267,0,1,0 +0,4.564348,0,6.720943,6.772237,0,11.84267,0,1,0 +2,4.564348,0,6.720943,6.772237,0,11.84267,0,1,0 +2,4.564348,0,6.720943,6.772237,0,11.84267,0,0,0 +2,4.564348,0,6.720943,6.772237,0,11.84267,0,0,0 +0,4.564348,0,6.720943,6.772237,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,20.7,0,0,0 +3,0,1,6.109248,6.160541,0,20.7,0,0,0 +2,0,1,6.109248,6.160541,0,20.7,0,0,0 +4,0,1,6.109248,6.160541,0,20.7,0,0,0 +8,0,1,6.109248,6.160541,0,20.7,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +4,0,1,6.109248,6.160541,0,11.84267,0,0,0 +6,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,1,17.2,0,1,0 +9,0,1,6.109248,6.160541,1,17.2,0,1,0 +6,0,1,6.109248,6.160541,1,17.2,0,1,0 +5,0,1,6.109248,6.160541,1,17.2,0,1,0 +3,0,1,6.109248,6.160541,1,17.2,0,1,0 +19,0,1,5.010635,5.061929,0,31,0,0,0 +32,0,1,5.010635,5.061929,0,31,0,0,0 +3,0,1,5.010635,5.061929,0,31,0,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,5.975564,6.448223,0,17.2,1,0,0 +0,4.564348,0,5.975564,6.448223,0,17.2,1,0,0 +0,4.564348,0,5.975564,6.448223,0,17.2,1,0,0 +7,0,1,6.109248,6.160541,0,13.8,0,0,0 +2,0,1,6.109248,6.160541,0,13.8,0,0,0 +10,0,1,6.109248,6.160541,0,13.8,0,0,0 +2,0,1,6.109248,6.160541,0,20.7,0,0,0 +2,0,1,6.109248,6.160541,0,20.7,0,0,0 +6,0,1,6.109248,6.160541,0,20.7,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,0,0 +7,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,11.84267,1,0,0 +1,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +1,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +1,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +4,0,1,5.010635,5.061929,0,27.6,1,0,0 +1,0,1,5.010635,5.061929,0,27.6,1,0,0 +2,0,1,5.010635,5.061929,0,27.6,1,0,0 +3,0,1,5.010635,5.061929,0,27.6,1,0,0 +3,0,1,5.010635,5.061929,0,27.6,1,0,0 +3,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +5,0,0,0,0,0,11.84267,1,0,0 +7,0,0,0,0,0,17.2,1,0,0 +4,0,0,0,0,0,17.2,1,0,0 +3,0,0,0,0,0,17.2,1,0,0 +0,3.258096,0,6.146436,7.532731,0,6.9,1,0,0 +0,3.258096,0,6.146436,7.532731,0,6.9,1,0,0 +1,3.258096,0,6.146436,7.532731,0,6.9,1,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +4,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +1,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +1,4.564348,0,6.907755,6.959049,0,0,1,0,0 +1,4.564348,0,6.907755,6.959049,0,0,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +9,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +4,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +34,3.258096,0,6.282267,7.668561,1,31,0,1,0 +13,3.258096,0,6.282267,7.668561,0,10.3,0,1,0 +2,0,1,6.645819,6.160541,0,24.1,1,0,0 +4,0,1,6.645819,6.160541,0,24.1,1,0,0 +1,0,1,6.645819,6.160541,0,24.1,1,0,0 +9,0,1,6.645819,6.160541,0,11.84267,0,0,0 +35,0,1,6.645819,6.160541,0,11.84267,0,0,0 +30,0,1,6.645819,6.160541,0,11.84267,0,0,0 +5,0,1,6.645819,6.160541,0,11.84267,0,0,0 +2,0,1,6.645819,6.160541,0,11.84267,0,0,0 +1,0,1,6.645819,6.160541,0,11.84267,0,0,0 +0,0,1,6.645819,6.160541,0,17.2,0,0,0 +1,0,1,6.645819,6.160541,0,17.2,0,0,0 +0,0,1,6.645819,6.160541,0,17.2,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,1,0,0,0,0 +2,0,0,0,0,1,0,0,0,0 +0,0,0,0,0,1,0,0,0,0 +7,0,0,0,0,1,34.5,1,0,0 +2,0,0,0,0,1,34.5,1,0,0 +1,0,0,0,0,1,34.5,1,0,0 +2,0,1,5.703783,5.755076,0,11.84267,1,0,0 +2,0,1,5.703783,5.755076,0,11.84267,1,0,0 +4,0,1,5.703783,5.755076,0,11.84267,1,0,0 +3,0,1,5.703783,5.755076,0,24.1,1,0,0 +1,0,1,5.703783,5.755076,0,24.1,1,0,0 +1,0,1,5.703783,5.755076,0,24.1,1,0,0 +5,0,1,5.703783,5.755076,0,13.8,1,0,0 +11,0,1,5.703783,5.755076,0,13.8,1,0,0 +1,0,1,5.703783,5.755076,0,13.8,1,0,0 +0,0,1,5.703783,5.755076,0,10.3,0,1,0 +2,0,1,5.703783,5.755076,0,10.3,0,1,0 +6,0,1,5.703783,5.755076,0,10.3,0,1,0 +4,0,0,4.162003,0,0,10.3,0,0,0 +1,0,0,4.162003,0,0,10.3,0,0,0 +5,0,0,4.162003,0,0,10.3,0,0,0 +8,0,0,4.162003,0,0,10.3,0,0,0 +6,0,0,4.162003,0,0,10.3,0,0,0 +3,0,1,0,5.061929,1,13.8,0,1,0 +1,0,1,0,5.061929,1,13.8,0,1,0 +3,0,1,0,5.061929,1,13.8,0,1,0 +2,0,1,0,5.061929,1,13.8,0,1,0 +3,0,1,0,5.061929,1,13.8,0,1,0 +0,3.258096,0,6.200509,8.248006,0,6.9,0,0,0 +0,3.258096,0,6.200509,8.248006,0,6.9,0,0,0 +0,3.258096,0,6.200509,8.248006,0,6.9,0,0,0 +3,3.258096,0,6.200509,8.248006,0,10.3,0,0,0 +2,3.258096,0,6.200509,8.248006,0,10.3,0,0,0 +5,3.258096,0,6.200509,8.248006,0,10.3,0,0,0 +3,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +3,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +2,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +3,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +0,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +5,4.564348,0,0,6.529803,1,13.8,0,0,0 +7,4.564348,0,0,6.529803,1,13.8,0,0,0 +3,4.564348,0,0,6.529803,1,13.8,0,0,0 +4,4.564348,0,0,6.529803,0,17.2,0,0,1 +1,4.564348,0,0,6.529803,0,17.2,0,0,1 +0,4.564348,0,0,6.529803,0,17.2,0,0,1 +6,4.564348,0,0,6.529803,1,11.84267,0,0,0 +2,4.564348,0,0,6.529803,1,11.84267,0,0,0 +3,4.564348,0,0,6.529803,1,11.84267,0,0,0 +2,4.564348,0,0,6.529803,0,11.84267,0,0,0 +1,4.564348,0,0,6.529803,0,11.84267,0,0,0 +6,4.564348,0,0,6.529803,0,11.84267,0,0,0 +1,0,0,5.496512,0,0,20.7,0,0,0 +5,0,0,5.496512,0,0,20.7,0,0,0 +1,0,0,5.496512,0,0,20.7,0,0,0 +1,0,0,5.496512,0,0,6.9,0,0,0 +4,0,0,5.496512,0,0,6.9,0,0,0 +6,0,0,5.496512,0,0,6.9,0,0,0 +38,0,0,0,0,0,3.4,0,0,0 +26,0,0,0,0,0,3.4,0,0,0 +32,0,0,0,0,0,3.4,0,0,0 +2,4.564348,0,6.703188,6.754481,0,24.1,1,0,0 +8,4.564348,0,6.703188,6.754481,0,24.1,1,0,0 +10,4.564348,0,6.703188,6.754481,0,24.1,1,0,0 +0,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +4,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +8,0,0,0,0,0,11.84267,1,0,0 +4,0,0,0,0,0,11.84267,1,0,0 +4,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +6,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +6,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +6,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +3,3.258096,0,6.098074,7.484369,0,24.1,1,0,0 +0,3.258096,0,6.098074,7.484369,0,24.1,1,0,0 +1,3.258096,0,6.098074,7.484369,0,24.1,1,0,0 +3,0,1,5.852662,5.755076,0,17.2,1,0,0 +1,0,1,5.852662,5.755076,0,17.2,1,0,0 +1,0,1,5.852662,5.755076,0,17.2,1,0,0 +20,0,1,5.852662,5.755076,1,27.6,0,1,0 +38,0,1,5.852662,5.755076,1,27.6,0,1,0 +26,0,1,5.852662,5.755076,1,27.6,0,1,0 +4,3.258096,0,6.907755,8.294049,0,10.3,0,0,0 +1,3.258096,0,6.907755,8.294049,0,10.3,0,0,0 +0,3.258096,0,6.907755,8.294049,0,10.3,0,0,0 +1,3.258096,0,6.907755,8.294049,1,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,1,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,1,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,5.886104,7.272398,1,27.6,0,0,0 +9,3.258096,0,5.886104,7.272398,1,27.6,0,0,0 +3,3.258096,0,5.886104,7.272398,1,27.6,0,0,0 +6,3.258096,0,5.886104,7.272398,1,27.6,0,0,0 +3,3.258096,0,5.886104,7.272398,1,27.6,0,0,0 +5,3.258096,0,5.886104,7.272398,1,11.84267,0,1,0 +12,3.258096,0,5.886104,7.272398,1,11.84267,0,1,0 +2,3.258096,0,5.886104,7.272398,1,11.84267,0,1,0 +2,3.258096,0,5.886104,7.272398,1,11.84267,0,1,0 +2,3.258096,0,5.886104,7.272398,1,11.84267,0,1,0 +8,3.258096,0,5.886104,7.272398,1,17.2,0,0,0 +13,3.258096,0,5.886104,7.272398,1,17.2,0,0,0 +8,3.258096,0,5.886104,7.272398,1,17.2,0,0,0 +5,3.258096,0,5.886104,7.272398,1,17.2,0,0,0 +1,3.258096,0,5.886104,7.272398,1,17.2,0,0,0 +9,3.258096,0,5.886104,7.272398,0,11.84267,0,0,0 +11,3.258096,0,5.886104,7.272398,0,11.84267,0,0,0 +5,3.258096,0,5.886104,7.272398,0,11.84267,0,0,0 +3,3.258096,0,5.886104,7.272398,0,11.84267,0,0,0 +0,3.258096,0,5.886104,7.272398,0,11.84267,0,0,0 +5,0,1,6.109248,6.160541,0,11.84267,0,0,0 +4,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +9,0,1,6.109248,6.160541,0,13.8,1,0,0 +3,0,1,6.109248,6.160541,0,13.8,1,0,0 +4,0,1,6.109248,6.160541,0,13.8,1,0,0 +7,0,1,6.109248,6.160541,0,11.84267,0,0,0 +3,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +9,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +9,0,0,0,0,1,31,0,1,0 +5,0,0,0,0,1,31,0,1,0 +24,0,0,0,0,1,31,0,1,0 +6,0,0,0,0,1,17.2,0,1,0 +4,0,0,0,0,1,17.2,0,1,0 +2,0,0,0,0,1,17.2,0,1,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,24.1,0,0,0 +2,0,0,0,0,0,24.1,0,0,0 +2,0,0,0,0,0,24.1,0,0,0 +10,4.564348,0,6.907755,6.959049,1,20.7,0,1,0 +6,4.564348,0,6.907755,6.959049,1,20.7,0,1,0 +1,4.564348,0,6.907755,6.959049,1,20.7,0,1,0 +2,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,10.3,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +3,0,0,0,0,0,17.2,1,0,0 +0,0,0,0,0,0,17.2,1,0,0 +5,0,0,0,0,0,17.2,1,0,0 +19,3.258096,0,6.148917,7.535211,1,34.5,1,0,0 +32,3.258096,0,6.148917,7.535211,1,34.5,1,0,0 +27,3.258096,0,6.148917,7.535211,1,34.5,1,0,0 +0,3.258096,0,0,6.040255,0,6.9,1,0,0 +0,3.258096,0,0,6.040255,0,6.9,1,0,0 +6,3.258096,0,0,6.040255,0,6.9,1,0,0 +11,0,1,0,5.061929,0,10.3,0,0,0 +2,0,1,0,5.061929,0,10.3,0,0,0 +9,0,1,0,5.061929,0,10.3,0,0,0 +3,0,0,0,0,1,27.6,1,0,0 +2,0,0,0,0,1,27.6,1,0,0 +2,0,0,0,0,1,27.6,1,0,0 +6,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,1,17.2,1,0,0 +6,0,0,0,0,1,17.2,1,0,0 +5,0,0,0,0,1,17.2,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +3,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,1,0,0 +3,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +4,4.564348,0,6.907755,6.959049,0,37.9,0,0,0 +3,4.564348,0,6.907755,6.959049,0,37.9,0,0,0 +4,4.564348,0,6.907755,6.959049,0,37.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +38,0,1,6.109248,6.160541,0,11.84267,0,0,0 +37,0,1,6.109248,6.160541,0,11.84267,0,0,0 +16,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +3,3.258096,0,0,8.294049,0,11.84267,0,0,0 +3,3.258096,0,0,8.294049,0,11.84267,0,0,0 +0,3.258096,0,0,8.294049,1,10.3,0,0,0 +4,3.258096,0,0,8.294049,1,31,0,1,0 +4,3.258096,0,0,8.294049,0,11.84267,0,0,0 +0,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +4,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +8,0,0,0,0,1,17.2,0,1,0 +8,0,0,0,0,1,17.2,0,1,0 +21,0,0,0,0,1,17.2,0,1,0 +2,0,0,0,0,1,17.2,0,1,0 +11,0,0,0,0,0,20.7,1,0,0 +0,0,0,0,0,0,20.7,1,0,0 +2,0,0,0,0,0,20.7,1,0,0 +7,0,0,0,0,0,20.7,1,0,0 +3,0,0,0,0,0,20.7,1,0,0 +0,3.258096,0,6.109248,7.495542,0,3.4,0,0,0 +1,3.258096,0,6.109248,7.495542,0,3.4,0,0,0 +1,3.258096,0,6.109248,7.495542,0,3.4,0,0,0 +2,3.258096,0,6.109248,7.495542,0,3.4,0,0,0 +4,3.258096,0,6.109248,7.495542,0,3.4,0,0,0 +5,0,0,0,0,0,17.2,1,0,0 +3,0,0,0,0,0,17.2,1,0,0 +2,0,0,0,0,0,17.2,1,0,0 +1,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +1,0,1,6.109248,6.160541,0,13.8,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +5,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +2,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +8,4.564348,0,6.620273,6.671566,0,6.9,0,0,0 +5,4.564348,0,6.620273,6.671566,0,6.9,0,0,0 +8,4.564348,0,6.620273,6.671566,0,6.9,0,0,0 +11,4.564348,0,6.620273,6.671566,1,31,0,0,1 +10,4.564348,0,6.620273,6.671566,1,31,0,0,1 +7,4.564348,0,6.620273,6.671566,1,31,0,0,1 +0,0,0,0,0,0,20.7,1,0,0 +4,0,0,0,0,0,20.7,1,0,0 +0,0,0,0,0,0,20.7,1,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,24.1,1,0,0 +3,0,0,0,0,0,24.1,1,0,0 +3,0,0,0,0,0,24.1,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +3,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +3,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +1,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +2,3.258096,0,6.907755,8.294049,0,13.8,1,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,1,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,1,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,1,0,0 +3,0,0,6.047372,0,0,0,0,0,0 +2,0,0,6.047372,0,0,0,0,0,0 +1,0,0,6.047372,0,0,0,0,0,0 +3,0,0,6.047372,0,0,0,0,0,0 +7,0,0,6.047372,0,0,0,0,0,0 +5,0,0,6.047372,0,0,0,0,0,0 +3,0,0,6.047372,0,0,11.84267,0,0,0 +6,0,0,6.047372,0,0,11.84267,0,0,0 +3,0,0,6.047372,0,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +4,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,3.258096,0,6.415506,7.8018,1,20.7,0,1,0 +1,3.258096,0,5.700611,7.086905,0,3.4,0,0,0 +0,3.258096,0,5.700611,7.086905,0,3.4,0,0,0 +0,3.258096,0,5.700611,7.086905,0,3.4,0,0,0 +4,0,1,6.228511,6.160541,0,0,0,1,0 +1,0,1,6.228511,6.160541,0,0,0,1,0 +0,0,1,6.228511,6.160541,0,0,0,1,0 +0,0,1,6.228511,6.160541,0,0,0,1,0 +10,0,1,6.228511,6.160541,0,20.7,1,0,0 +5,0,1,6.228511,6.160541,0,20.7,1,0,0 +2,0,1,6.228511,6.160541,0,20.7,1,0,0 +3,0,1,6.228511,6.160541,0,20.7,1,0,0 +4,0,1,6.228511,6.160541,0,20.7,1,0,0 +9,0,1,6.228511,6.160541,0,6.9,0,1,0 +1,0,1,6.228511,6.160541,0,6.9,0,1,0 +2,0,1,6.228511,6.160541,0,6.9,0,1,0 +0,0,1,6.228511,6.160541,0,6.9,0,1,0 +6,0,1,6.228511,6.160541,0,6.9,0,1,0 +9,0,1,3.789177,5.061929,0,17.2,0,0,0 +1,0,1,3.789177,5.061929,0,17.2,0,0,0 +0,0,1,3.789177,5.061929,0,17.2,0,0,0 +5,0,0,5.355642,0,0,10.3,0,0,0 +0,0,0,5.355642,0,0,10.3,0,0,0 +0,0,0,5.355642,0,0,10.3,0,0,0 +1,0,0,5.355642,0,0,10.3,0,0,0 +1,0,0,5.355642,0,0,10.3,0,0,0 +0,0,0,6.246107,0,0,0,0,0,0 +1,0,0,6.246107,0,0,0,0,0,0 +8,0,0,6.246107,0,0,0,0,0,0 +5,0,0,6.246107,0,0,11.84267,0,1,0 +2,0,0,6.246107,0,0,11.84267,0,1,0 +4,0,0,6.246107,0,0,11.84267,0,1,0 +0,0,0,6.246107,0,0,11.84267,0,0,0 +5,0,0,6.246107,0,0,11.84267,0,0,0 +3,0,0,6.246107,0,0,11.84267,0,0,0 +2,0,0,6.246107,0,0,10.3,1,0,0 +7,0,0,6.246107,0,0,10.3,1,0,0 +7,0,0,6.246107,0,0,10.3,1,0,0 +2,0,0,5.219274,0,0,10.3,1,0,0 +1,0,0,5.219274,0,0,10.3,1,0,0 +0,0,0,5.219274,0,0,10.3,1,0,0 +11,0,0,5.219274,0,1,17.2,0,1,0 +2,0,0,5.219274,0,1,17.2,0,1,0 +1,0,0,5.219274,0,1,17.2,0,1,0 +1,0,0,5.219274,0,0,13.8,0,1,0 +0,0,0,5.219274,0,0,13.8,0,1,0 +5,0,0,5.219274,0,0,13.8,0,1,0 +0,4.564348,0,0,6.265902,0,3.4,0,0,0 +0,4.564348,0,0,6.265902,0,3.4,0,0,0 +0,4.564348,0,0,6.265902,0,3.4,0,0,0 +0,4.564348,0,0,6.265902,0,11.84267,0,0,0 +0,4.564348,0,0,6.265902,0,11.84267,0,0,0 +4,4.564348,0,0,6.265902,0,11.84267,0,0,0 +1,4.564348,0,0,6.265902,0,10.3,0,0,0 +1,4.564348,0,0,6.265902,0,10.3,0,0,0 +5,4.564348,0,0,6.265902,0,10.3,0,0,0 +6,4.564348,0,0,6.265902,0,11.84267,0,0,0 +3,4.564348,0,0,6.265902,0,11.84267,0,0,0 +2,4.564348,0,0,6.265902,0,11.84267,0,0,0 +0,0,1,0,5.755076,0,10.3,1,0,0 +1,0,1,0,5.755076,0,10.3,1,0,0 +2,0,1,0,5.755076,0,10.3,1,0,0 +0,0,1,0,5.755076,0,10.3,1,0,0 +1,0,1,0,5.755076,0,10.3,1,0,0 +0,0,1,0,5.755076,0,10.3,1,0,0 +4,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +2,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +10,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +3,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +1,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +0,3.258096,0,6.342209,7.728504,0,3.4,0,0,0 +1,3.258096,0,6.342209,7.728504,0,3.4,0,0,0 +1,3.258096,0,6.342209,7.728504,0,3.4,0,0,0 +15,3.258096,0,6.342209,7.728504,1,27.6,1,0,0 +6,3.258096,0,6.342209,7.728504,1,27.6,1,0,0 +12,3.258096,0,6.342209,7.728504,1,27.6,1,0,0 +6,0,1,6.489873,6.160541,0,13.8,0,0,0 +1,0,1,6.489873,6.160541,0,13.8,0,0,0 +0,0,1,6.489873,6.160541,0,13.8,0,0,0 +0,0,1,6.489873,6.160541,0,11.84267,0,0,0 +1,0,1,6.489873,6.160541,0,11.84267,0,0,0 +0,0,1,6.489873,6.160541,0,11.84267,0,0,0 +0,0,1,6.489873,6.160541,0,24.1,0,0,0 +1,0,1,6.489873,6.160541,0,24.1,0,0,0 +0,0,1,6.489873,6.160541,0,24.1,0,0,0 +0,0,1,6.489873,6.160541,0,11.84267,0,0,0 +0,0,1,6.489873,6.160541,0,11.84267,0,0,0 +0,0,1,6.489873,6.160541,0,11.84267,0,0,0 +20,0,1,6.489873,6.160541,1,11.84267,0,0,0 +18,0,1,6.489873,6.160541,1,11.84267,0,0,0 +16,0,1,6.489873,6.160541,1,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,11.84267,0,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +7,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,1,6.9,1,0,0 +5,0,0,0,0,1,6.9,1,0,0 +6,0,0,0,0,1,6.9,1,0,0 +15,0,0,0,0,1,6.9,1,0,0 +6,0,0,0,0,1,6.9,1,0,0 +0,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,44.8,0,1,0 +3,0,0,0,0,0,44.8,0,1,0 +3,0,0,0,0,0,44.8,0,1,0 +0,3.258096,0,0,8.294049,0,6.9,0,0,0 +0,3.258096,0,0,8.294049,0,6.9,0,0,0 +0,3.258096,0,0,8.294049,0,6.9,0,0,0 +9,0,0,0,0,1,20.7,1,0,0 +18,0,0,0,0,1,20.7,1,0,0 +3,0,0,0,0,1,20.7,1,0,0 +0,0,0,0,0,1,20.7,1,0,0 +1,0,0,0,0,1,20.7,1,0,0 +9,0,0,0,0,0,11.84267,1,0,0 +3,0,0,0,0,0,11.84267,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,1,6.9,1,0,0 +2,0,0,0,0,1,6.9,1,0,0 +0,0,0,0,0,1,6.9,1,0,0 +0,0,0,0,0,1,6.9,1,0,0 +0,0,0,0,0,1,6.9,1,0,0 +0,0,0,4.94876,0,1,6.9,1,0,0 +1,0,0,4.94876,0,1,6.9,1,0,0 +2,0,0,4.94876,0,1,6.9,1,0,0 +0,0,0,4.94876,0,1,6.9,1,0,0 +1,0,0,4.94876,0,1,6.9,1,0,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,17.2,0,0,0 +0,0,0,0,0,0,17.2,0,0,0 +1,0,0,0,0,0,17.2,0,0,0 +0,0,0,0,0,0,17.2,0,0,0 +2,0,0,0,0,0,17.2,0,0,0 +9,0,0,0,0,1,6.9,1,0,0 +11,0,0,0,0,1,6.9,1,0,0 +6,0,0,0,0,1,6.9,1,0,0 +10,0,0,0,0,1,6.9,1,0,0 +5,0,0,0,0,1,6.9,1,0,0 +8,0,1,6.771248,6.160541,0,6.9,0,0,0 +5,0,1,6.771248,6.160541,0,6.9,0,0,0 +3,0,1,6.771248,6.160541,0,6.9,0,0,0 +8,0,1,6.771248,6.160541,1,10.3,1,0,0 +5,0,1,6.771248,6.160541,1,10.3,1,0,0 +8,0,1,6.771248,6.160541,1,10.3,1,0,0 +2,0,1,6.771248,6.160541,0,11.84267,0,0,0 +1,0,1,6.771248,6.160541,0,11.84267,0,0,0 +0,0,1,6.771248,6.160541,0,11.84267,0,0,0 +0,4.564348,0,0,6.959049,0,0,0,0,0 +1,4.564348,0,0,6.959049,0,0,0,0,0 +0,4.564348,0,0,6.959049,0,0,0,0,0 +0,4.564348,0,0,6.959049,0,0,0,0,0 +1,4.564348,0,0,6.959049,0,0,0,0,0 +2,4.564348,0,0,6.959049,0,10.3,0,0,0 +1,4.564348,0,0,6.959049,0,10.3,0,0,0 +0,4.564348,0,0,6.959049,0,10.3,0,0,0 +0,4.564348,0,0,6.959049,0,10.3,0,0,0 +0,4.564348,0,0,6.959049,0,10.3,0,0,0 +1,4.564348,0,0,6.959049,0,6.9,0,0,0 +1,4.564348,0,0,6.959049,0,6.9,0,0,0 +0,4.564348,0,0,6.959049,0,6.9,0,0,0 +2,4.564348,0,0,6.959049,0,6.9,0,0,0 +1,4.564348,0,0,6.959049,0,6.9,0,0,0 +8,4.564348,0,0,6.959049,0,11.84267,0,0,0 +2,4.564348,0,0,6.959049,0,11.84267,0,0,0 +4,4.564348,0,0,6.959049,0,11.84267,0,0,0 +6,4.564348,0,0,6.959049,0,11.84267,0,0,0 +3,4.564348,0,0,6.959049,0,11.84267,0,0,0 +0,4.564348,0,0,6.959049,0,0,0,0,0 +1,4.564348,0,0,6.959049,0,0,0,0,0 +1,4.564348,0,0,6.959049,0,0,0,0,0 +0,4.564348,0,0,6.959049,0,0,0,0,0 +1,4.564348,0,0,6.959049,0,0,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +5,3.258096,0,6.907755,8.294049,0,13.8,0,0,0 +10,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,0,1,5.703783,5.755076,0,13.8,0,0,0 +1,0,1,5.703783,5.755076,1,10.3,1,0,0 +0,0,1,5.703783,5.755076,1,10.3,1,0,0 +1,0,1,5.703783,5.755076,1,10.3,1,0,0 +2,3.258096,0,6.907755,8.294049,0,20.7,1,0,0 +1,3.258096,0,6.907755,8.294049,0,20.7,1,0,0 +3,3.258096,0,6.907755,8.294049,0,20.7,1,0,0 +5,3.258096,0,6.515601,7.038784,0,17.2,0,0,0 +1,3.258096,0,6.515601,7.038784,0,17.2,0,0,0 +2,3.258096,0,6.515601,7.038784,0,17.2,0,0,0 +2,3.258096,0,6.515601,7.038784,0,17.2,0,0,0 +6,3.258096,0,6.515601,7.038784,0,17.2,0,0,0 +0,3.258096,0,6.515601,7.038784,0,3.4,0,0,0 +1,3.258096,0,6.515601,7.038784,0,3.4,0,0,0 +0,3.258096,0,6.515601,7.038784,0,3.4,0,0,0 +0,3.258096,0,6.515601,7.038784,0,3.4,0,0,0 +0,3.258096,0,6.515601,7.038784,0,3.4,0,0,0 +11,3.258096,0,6.515601,7.038784,0,10.3,0,0,0 +18,3.258096,0,6.515601,7.038784,0,10.3,0,0,0 +1,3.258096,0,6.515601,7.038784,0,10.3,0,0,0 +8,3.258096,0,6.515601,7.038784,0,10.3,0,0,0 +0,3.258096,0,6.515601,7.038784,0,10.3,0,0,0 +0,3.258096,0,6.515601,7.038784,0,10.3,0,0,0 +0,3.258096,0,6.515601,7.038784,0,10.3,0,0,0 +1,3.258096,0,6.814652,8.200947,0,11.84267,1,0,0 +0,3.258096,0,6.814652,8.200947,0,11.84267,1,0,0 +0,3.258096,0,6.814652,8.200947,0,11.84267,1,0,0 +1,3.258096,0,6.814652,8.200947,0,11.84267,1,0,0 +0,3.258096,0,6.814652,8.200947,0,11.84267,1,0,0 +0,3.258096,0,6.814652,8.200947,0,11.84267,1,0,0 +3,3.258096,0,6.814652,8.200947,0,17.2,1,0,0 +0,3.258096,0,6.814652,8.200947,0,17.2,1,0,0 +0,3.258096,0,6.814652,8.200947,0,17.2,1,0,0 +0,3.258096,0,6.814652,8.200947,0,10.3,1,0,0 +0,3.258096,0,6.814652,8.200947,0,10.3,1,0,0 +0,3.258096,0,6.814652,8.200947,0,10.3,1,0,0 +2,3.258096,0,6.814652,8.200947,0,11.84267,1,0,0 +0,3.258096,0,6.814652,8.200947,0,11.84267,1,0,0 +0,3.258096,0,6.814652,8.200947,0,11.84267,1,0,0 +1,3.258096,0,6.582247,7.654443,0,13.8,1,0,0 +0,3.258096,0,6.582247,7.654443,0,13.8,1,0,0 +2,3.258096,0,6.582247,7.654443,0,13.8,1,0,0 +8,3.258096,0,6.582247,7.654443,0,0,0,0,0 +4,3.258096,0,6.582247,7.654443,0,0,0,0,0 +4,3.258096,0,6.582247,7.654443,0,0,0,0,0 +8,3.258096,0,6.582247,7.654443,0,11.84267,0,0,0 +7,3.258096,0,6.582247,7.654443,0,11.84267,0,0,0 +10,3.258096,0,6.582247,7.654443,0,11.84267,0,0,0 +11,3.258096,0,6.582247,7.654443,0,11.84267,0,0,0 +10,3.258096,0,6.582247,7.654443,0,11.84267,0,0,0 +7,3.258096,0,6.582247,7.654443,0,11.84267,0,0,0 +1,4.564348,0,6.276794,6.767828,0,3.4,1,0,0 +1,4.564348,0,6.276794,6.767828,0,3.4,1,0,0 +0,4.564348,0,6.276794,6.767828,0,3.4,1,0,0 +1,4.564348,0,6.276794,6.767828,0,11.84267,1,0,0 +0,4.564348,0,6.276794,6.767828,0,11.84267,1,0,0 +0,4.564348,0,6.276794,6.767828,0,11.84267,1,0,0 +0,4.564348,0,6.276794,6.767828,0,20.7,1,0,0 +0,4.564348,0,6.276794,6.767828,0,20.7,1,0,0 +0,4.564348,0,6.276794,6.767828,0,20.7,1,0,0 +1,4.564348,0,6.276794,6.767828,0,3.4,1,0,0 +0,4.564348,0,6.276794,6.767828,0,3.4,1,0,0 +0,4.564348,0,6.276794,6.767828,0,11.84267,1,0,0 +0,4.564348,0,6.276794,6.767828,0,11.84267,1,0,0 +0,4.564348,0,6.276794,6.767828,0,11.84267,1,0,0 +0,4.564348,0,6.276794,6.767828,0,10.3,1,0,0 +0,4.564348,0,6.276794,6.767828,0,10.3,1,0,0 +0,4.564348,0,6.276794,6.767828,0,10.3,1,0,0 +2,0,0,0,0,1,20.7,1,0,0 +0,0,0,0,0,1,20.7,1,0,0 +0,0,0,0,0,1,20.7,1,0,0 +2,0,0,0,0,1,20.7,1,0,0 +5,0,0,0,0,1,20.7,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.3,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +3,0,0,5.51986,0,0,13.8,0,0,0 +0,0,0,5.51986,0,0,13.8,0,0,0 +1,0,0,5.51986,0,0,13.8,0,0,0 +1,0,0,5.51986,0,0,11.84267,0,0,0 +0,0,0,5.51986,0,0,11.84267,0,0,0 +0,0,0,5.51986,0,0,11.84267,0,0,0 +8,0,0,5.51986,0,0,11.84267,1,0,0 +4,0,0,5.51986,0,0,11.84267,1,0,0 +0,0,0,5.51986,0,0,11.84267,1,0,0 +4,0,0,5.51986,0,0,10.3,1,0,0 +15,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +17,0,0,0,0,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +3,0,1,6.109248,6.160541,0,13.8,0,1,0 +1,0,1,5.703783,5.755076,0,3.4,0,0,0 +1,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +5,0,1,5.703783,5.755076,0,6.9,0,0,0 +1,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.460734,6.160541,0,24.1,1,0,0 +3,0,1,5.460734,6.160541,0,24.1,1,0,0 +0,0,1,5.460734,6.160541,0,24.1,1,0,0 +5,0,1,5.460734,6.160541,0,11.84267,1,0,0 +2,0,1,5.460734,6.160541,0,11.84267,1,0,0 +2,0,1,5.460734,6.160541,0,11.84267,1,0,0 +8,0,1,5.460734,6.160541,0,11.84267,1,0,0 +2,0,1,5.460734,6.160541,0,11.84267,1,0,0 +4,0,1,5.460734,6.160541,0,11.84267,1,0,0 +5,0,1,5.460734,6.160541,0,20.7,1,0,0 +0,0,1,5.460734,6.160541,0,20.7,1,0,0 +4,0,1,5.460734,6.160541,0,20.7,1,0,0 +11,0,1,5.460734,6.160541,0,11.84267,1,0,0 +5,0,1,5.460734,6.160541,0,11.84267,1,0,0 +11,0,1,5.460734,6.160541,0,11.84267,1,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +2,0,0,6.288007,0,0,3.4,0,0,0 +1,0,0,6.288007,0,0,3.4,0,0,0 +0,0,0,6.288007,0,0,3.4,0,0,0 +8,0,0,6.288007,0,0,11.84267,0,0,0 +7,0,0,6.288007,0,0,11.84267,0,0,0 +1,0,0,6.288007,0,0,11.84267,0,0,0 +4,0,0,6.288007,0,0,11.84267,0,0,0 +0,0,0,6.288007,0,0,11.84267,0,0,0 +0,0,0,6.288007,0,0,11.84267,0,0,0 +1,0,0,6.288007,0,0,13.8,1,0,0 +1,0,0,6.288007,0,0,13.8,1,0,0 +2,0,0,6.288007,0,0,13.8,1,0,0 +2,3.258096,0,6.253829,8.294049,0,10.3,1,0,0 +0,3.258096,0,6.253829,8.294049,0,10.3,1,0,0 +3,3.258096,0,6.253829,8.294049,0,10.3,1,0,0 +1,3.258096,0,6.253829,8.294049,0,10.3,1,0,0 +0,3.258096,0,6.253829,8.294049,0,10.3,1,0,0 +0,3.258096,0,6.253829,8.294049,0,0,1,0,0 +5,3.258096,0,6.253829,8.294049,0,0,1,0,0 +0,3.258096,0,6.253829,8.294049,0,0,1,0,0 +1,3.258096,0,6.253829,8.294049,0,0,1,0,0 +0,3.258096,0,6.253829,8.294049,0,0,1,0,0 +6,0,0,5.762052,0,1,24.1,0,1,0 +2,0,0,5.762052,0,1,24.1,0,1,0 +3,0,0,5.762052,0,1,24.1,0,1,0 +0,0,0,5.762052,0,0,11.84267,0,0,0 +0,0,0,5.762052,0,0,11.84267,0,0,0 +0,0,0,5.762052,0,0,11.84267,0,0,0 +0,0,0,5.762052,0,0,11.84267,0,0,0 +0,0,0,5.762052,0,0,11.84267,0,0,0 +0,0,0,5.762052,0,0,11.84267,0,0,0 +3,0,0,5.375278,0,.1981873,11.84267,1,0,0 +4,0,0,5.375278,0,.1981873,11.84267,1,0,0 +0,0,0,5.375278,0,.1981873,11.84267,1,0,0 +6,0,0,5.375278,0,.1981873,11.84267,0,1,0 +6,0,0,5.375278,0,.1981873,11.84267,0,1,0 +1,0,0,5.375278,0,.1981873,11.84267,0,1,0 +2,0,0,5.785915,0,0,3.4,1,0,0 +2,0,0,5.785915,0,0,3.4,1,0,0 +2,0,0,5.785915,0,0,3.4,1,0,0 +7,0,0,5.785915,0,0,3.4,1,0,0 +5,0,0,5.785915,0,0,3.4,1,0,0 +1,0,0,5.785915,0,0,3.4,1,0,0 +2,0,0,5.785915,0,0,3.4,1,0,0 +0,0,0,5.785915,0,0,3.4,1,0,0 +0,0,0,5.785915,0,0,3.4,1,0,0 +0,0,0,5.785915,0,0,3.4,1,0,0 +1,0,0,5.897868,0,0,6.9,1,0,0 +5,0,0,5.897868,0,0,6.9,1,0,0 +8,0,0,5.897868,0,0,6.9,1,0,0 +4,0,0,5.897868,0,0,11.84267,1,0,0 +1,0,0,5.897868,0,0,11.84267,1,0,0 +2,0,0,5.897868,0,0,11.84267,1,0,0 +11,0,0,5.897868,0,0,11.84267,1,0,0 +3,0,0,5.897868,0,0,11.84267,1,0,0 +3,0,0,5.897868,0,0,11.84267,1,0,0 +6,0,0,5.897868,0,0,3.4,1,0,0 +2,0,0,5.897868,0,0,3.4,1,0,0 +0,0,0,5.897868,0,0,3.4,1,0,0 +8,0,0,6.243273,0,0,6.9,1,0,0 +4,0,0,6.243273,0,0,6.9,1,0,0 +2,0,0,6.243273,0,0,6.9,1,0,0 +10,0,0,6.243273,0,0,10.3,1,0,0 +10,0,0,6.243273,0,0,10.3,1,0,0 +4,0,0,6.243273,0,0,10.3,1,0,0 +6,0,0,6.408858,0,1,20.7,1,0,0 +3,0,0,6.408858,0,1,20.7,1,0,0 +5,0,0,6.408858,0,1,20.7,1,0,0 +3,0,0,6.408858,0,1,20.7,1,0,0 +3,0,0,6.408858,0,1,20.7,1,0,0 +1,0,0,6.408858,0,1,17.2,0,1,0 +2,0,0,6.408858,0,1,17.2,0,1,0 +1,0,0,6.408858,0,1,17.2,0,1,0 +8,0,0,6.408858,0,1,17.2,0,1,0 +4,0,0,6.408858,0,1,17.2,0,1,0 +2,0,0,6.408858,0,0,11.84267,0,0,0 +0,0,0,6.408858,0,0,11.84267,0,0,0 +3,0,0,6.408858,0,0,11.84267,0,0,0 +2,0,0,6.408858,0,0,11.84267,0,0,0 +6,0,0,6.408858,0,0,11.84267,0,0,0 +1,0,0,6.408858,0,0,11.84267,0,0,0 +0,0,0,6.408858,0,0,11.84267,0,0,0 +1,0,0,6.408858,0,0,11.84267,0,0,0 +0,0,0,6.408858,0,0,11.84267,0,0,0 +1,0,0,6.408858,0,0,11.84267,0,0,0 +9,0,1,6.109248,6.160541,1,11.84267,1,0,0 +11,0,1,6.109248,6.160541,1,11.84267,1,0,0 +14,0,1,6.109248,6.160541,1,11.84267,1,0,0 +14,0,1,6.109248,6.160541,0,11.84267,1,0,0 +8,0,1,6.109248,6.160541,0,11.84267,1,0,0 +17,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,17.2,1,0,0 +5,0,1,6.109248,6.160541,0,17.2,1,0,0 +2,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +3,0,1,6.109248,6.160541,0,3.4,1,0,0 +3,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,3.258096,0,6.573541,7.959835,0,3.4,1,0,0 +3,3.258096,0,6.573541,7.959835,0,3.4,1,0,0 +1,3.258096,0,6.573541,7.959835,0,3.4,1,0,0 +2,0,0,5.817825,0,0,0,1,0,0 +4,0,0,5.817825,0,0,0,1,0,0 +6,0,0,5.817825,0,0,0,1,0,0 +10,0,0,5.817825,0,0,27.6,1,0,0 +8,0,0,5.817825,0,0,27.6,1,0,0 +5,0,0,5.817825,0,0,27.6,1,0,0 +9,0,0,5.817825,0,0,6.9,0,0,0 +2,0,0,5.817825,0,0,6.9,0,0,0 +0,0,0,5.817825,0,0,6.9,0,0,0 +9,0,0,5.817825,0,0,3.4,0,0,0 +11,0,0,5.817825,0,0,3.4,0,0,0 +4,0,0,5.817825,0,0,10.3,1,0,0 +2,0,0,5.817825,0,0,10.3,1,0,0 +1,0,0,5.817825,0,0,10.3,1,0,0 +3,0,0,0,0,0,11.84267,0,0,0 +5,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +9,0,0,0,0,0,10.3,0,0,0 +3,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +12,0,0,0,0,0,11.84267,0,0,0 +12,0,0,0,0,0,11.84267,0,0,0 +6,0,0,0,0,0,11.84267,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +1,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +5,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +3,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,0,1,5.703783,5.755076,0,13.8,0,0,0 +1,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,0,1,5.703783,5.755076,0,13.8,0,0,0 +4,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +4,0,1,5.703783,5.755076,0,3.4,0,0,0 +44,0,1,5.703783,5.755076,0,3.4,0,0,0 +57,0,1,5.703783,5.755076,0,3.4,0,0,0 +5,0,1,6.109248,6.160541,0,11.84267,0,0,0 +11,0,1,6.109248,6.160541,0,11.84267,0,0,0 +3,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +11,0,1,6.109248,6.160541,0,10.3,0,0,0 +4,0,1,6.109248,6.160541,0,17.2,1,0,0 +5,0,1,6.109248,6.160541,0,17.2,1,0,0 +6,0,1,6.109248,6.160541,0,17.2,1,0,0 +2,0,1,6.109248,6.160541,0,17.2,1,0,0 +3,0,1,6.109248,6.160541,0,17.2,1,0,0 +3,0,1,6.109248,6.160541,0,17.2,1,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,5.274383,6.160541,0,11.84267,0,0,0 +0,0,1,5.274383,6.160541,0,11.84267,0,0,0 +0,0,1,5.274383,6.160541,0,11.84267,0,0,0 +3,0,1,5.274383,6.160541,0,10.3,0,0,0 +0,0,1,5.274383,6.160541,0,10.3,0,0,0 +0,0,1,5.274383,6.160541,0,10.3,0,0,0 +1,0,1,5.274383,6.160541,0,0,0,0,0 +2,0,1,5.274383,6.160541,0,0,0,0,0 +1,0,1,5.274383,6.160541,0,0,0,0,0 +1,0,1,5.274383,6.160541,0,11.84267,0,0,0 +1,0,1,5.274383,6.160541,0,11.84267,0,0,0 +0,0,1,5.274383,6.160541,0,11.84267,0,0,0 +1,4.564348,0,6.743352,6.794645,0,10.3,1,0,0 +0,4.564348,0,6.743352,6.794645,0,10.3,1,0,0 +0,4.564348,0,6.743352,6.794645,0,10.3,1,0,0 +0,4.564348,0,6.743352,6.794645,0,10.3,1,0,0 +0,4.564348,0,6.743352,6.794645,0,10.3,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,1,27.6,1,0,0 +4,0,0,0,0,1,27.6,1,0,0 +4,0,0,0,0,1,27.6,1,0,0 +3,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +33,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +3,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +6,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +5,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +3,3.258096,0,5.717028,7.103322,0,3.4,0,0,0 +1,3.258096,0,5.717028,7.103322,0,3.4,0,0,0 +1,3.258096,0,5.717028,7.103322,0,3.4,0,0,0 +1,3.258096,0,5.717028,7.103322,0,3.4,0,0,0 +1,3.258096,0,5.717028,7.103322,0,3.4,0,0,0 +1,3.258096,0,5.717028,7.103322,0,0,0,0,0 +1,3.258096,0,5.717028,7.103322,0,0,0,0,0 +0,3.258096,0,5.717028,7.103322,0,0,0,0,0 +0,3.258096,0,5.717028,7.103322,0,0,0,0,0 +1,3.258096,0,5.717028,7.103322,0,0,0,0,0 +2,0,0,0,0,1,3.4,0,0,0 +1,0,0,0,0,1,3.4,0,0,0 +4,0,0,0,0,1,3.4,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +6,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +7,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +5,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +5,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +5,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +5,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +8,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +6,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +7,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,0,1,6.243273,5.755076,0,6.9,0,0,0 +0,0,1,6.243273,5.755076,0,6.9,0,0,0 +0,0,1,6.243273,5.755076,0,6.9,0,0,0 +1,0,1,6.243273,5.755076,0,10.3,0,0,0 +19,0,1,6.243273,5.755076,0,10.3,0,0,0 +1,0,1,6.243273,5.755076,0,10.3,0,0,0 +14,3.258096,0,5.291293,5.703783,0,27.6,1,0,0 +11,3.258096,0,5.291293,5.703783,0,27.6,1,0,0 +10,3.258096,0,5.291293,5.703783,0,27.6,1,0,0 +3,3.258096,0,5.521461,6.907755,0,3.4,0,0,0 +6,3.258096,0,5.521461,6.907755,0,3.4,0,0,0 +6,3.258096,0,5.521461,6.907755,0,3.4,0,0,0 +7,4.564348,0,6.040255,6.091548,0,11.84267,0,0,0 +0,4.564348,0,6.040255,6.091548,0,11.84267,0,0,0 +6,4.564348,0,6.040255,6.091548,0,11.84267,0,0,0 +6,4.564348,0,6.040255,6.091548,0,11.84267,0,0,0 +2,4.564348,0,6.040255,6.091548,0,11.84267,0,0,0 +2,4.564348,0,6.040255,6.091548,0,11.84267,0,0,0 +2,4.564348,0,6.040255,6.091548,0,6.9,0,0,0 +2,4.564348,0,6.040255,6.091548,0,6.9,0,0,0 +3,4.564348,0,6.040255,6.091548,0,6.9,0,0,0 +5,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +5,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +4,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +2,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +5,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +3,4.564348,0,6.907755,6.959049,1,17.2,1,0,0 +3,4.564348,0,6.907755,6.959049,1,17.2,1,0,0 +3,4.564348,0,6.907755,6.959049,1,17.2,1,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +1,0,1,5.703783,5.755076,0,24.1,1,0,0 +2,0,1,5.703783,5.755076,0,24.1,1,0,0 +1,0,1,5.703783,5.755076,0,24.1,1,0,0 +1,0,1,5.703783,5.755076,0,24.1,1,0,0 +5,0,1,5.703783,5.755076,0,24.1,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,0,1,0,5.061929,1,13.8,1,0,0 +0,0,1,0,5.061929,1,13.8,1,0,0 +0,0,1,0,5.061929,1,13.8,1,0,0 +3,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +1,4.564348,0,6.907755,6.959049,0,20.7,0,1,0 +0,4.564348,0,5.857933,5.909226,0,17.2,0,0,0 +0,4.564348,0,5.857933,5.909226,0,17.2,0,0,0 +0,4.564348,0,5.857933,5.909226,0,17.2,0,0,0 +14,4.564348,0,6.907755,6.959049,0,17.2,1,0,0 +0,4.564348,0,6.907755,6.959049,0,17.2,1,0,0 +4,4.564348,0,6.907755,6.959049,0,17.2,1,0,0 +1,4.564348,0,6.907755,6.959049,0,17.2,1,0,0 +1,4.564348,0,6.907755,6.959049,0,17.2,1,0,0 +21,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +13,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +20,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +7,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +3,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +15,4.564348,0,6.907755,6.959049,0,11.84267,1,0,0 +2,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +1,0,0,0,0,0,11.84267,1,0,0 +3,0,0,0,0,0,11.84267,1,0,0 +1,0,0,0,0,0,11.84267,1,0,0 +0,4.564348,0,6.506501,6.959049,0,10.3,0,0,0 +4,4.564348,0,6.506501,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.506501,6.959049,0,10.3,0,0,0 +9,4.564348,0,6.506501,6.959049,1,11.84267,0,0,0 +2,4.564348,0,6.506501,6.959049,1,11.84267,0,0,0 +4,4.564348,0,6.506501,6.959049,1,11.84267,0,0,0 +1,4.564348,0,6.506501,6.959049,0,17.2,0,0,0 +3,4.564348,0,6.506501,6.959049,0,17.2,0,0,0 +1,4.564348,0,6.506501,6.959049,0,17.2,0,0,0 +7,4.564348,0,6.506501,6.959049,0,27.6,0,0,0 +55,4.564348,0,6.506501,6.959049,0,27.6,0,0,0 +3,4.564348,0,6.506501,6.959049,0,27.6,0,0,0 +1,0,1,0,5.061929,0,0,1,0,0 +14,0,1,0,5.061929,1,24.1,1,0,0 +2,0,1,0,5.061929,1,24.1,1,0,0 +0,0,1,0,5.061929,1,24.1,1,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +4,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +2,0,1,6.109248,6.160541,0,11.84267,0,0,0 +5,0,1,6.109248,6.160541,0,11.84267,0,0,0 +6,0,1,6.109248,6.160541,0,10.3,0,0,0 +9,0,1,6.109248,6.160541,0,10.3,0,0,0 +5,0,1,6.109248,6.160541,0,10.3,0,0,0 +3,0,1,6.109248,6.160541,0,10.3,0,0,0 +6,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +6,0,1,6.109248,6.160541,0,3.4,0,0,0 +3,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +4,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +3,0,0,6.282566,0,0,11.84267,0,0,0 +2,0,0,6.282566,0,0,11.84267,0,0,0 +0,0,0,6.282566,0,0,11.84267,0,0,0 +1,0,0,6.282566,0,0,6.9,0,0,0 +0,0,0,6.282566,0,0,6.9,0,0,0 +3,0,0,6.282566,0,0,6.9,0,0,0 +1,0,0,6.282566,0,0,6.9,1,0,0 +0,0,0,6.282566,0,0,6.9,1,0,0 +1,0,0,6.282566,0,0,6.9,1,0,0 +7,0,0,6.282566,0,0,3.4,1,0,0 +7,0,0,6.282566,0,0,3.4,1,0,0 +3,0,0,6.282566,0,0,3.4,1,0,0 +14,0,1,5.010635,5.061929,0,13.8,0,0,0 +7,0,1,5.010635,5.061929,0,13.8,0,0,0 +3,0,1,5.010635,5.061929,0,13.8,0,0,0 +3,4.564348,0,5.164786,5.216079,0,6.9,0,0,0 +5,4.564348,0,5.164786,5.216079,0,6.9,0,0,0 +0,4.564348,0,5.164786,5.216079,0,6.9,0,0,0 +1,4.564348,0,5.164786,5.216079,0,6.9,0,0,0 +1,4.564348,0,5.164786,5.216079,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +3,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +5,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,0,1,5.703783,5.755076,0,17.2,0,0,0 +0,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +2,3.258096,0,6.907755,8.294049,0,0,0,0,0 +5,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +3,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +8,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +9,3.258096,0,6.907755,8.294049,0,24.1,1,0,0 +6,3.258096,0,6.907755,8.294049,0,24.1,1,0,0 +7,3.258096,0,6.907755,8.294049,0,24.1,1,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +3,3.258096,0,6.907755,8.294049,0,0,0,0,0 +4,3.258096,0,6.907755,8.294049,1,13.8,0,1,0 +1,3.258096,0,6.907755,8.294049,1,13.8,0,1,0 +0,3.258096,0,6.907755,8.294049,1,13.8,0,1,0 +2,3.258096,0,6.907755,8.294049,0,10.3,0,0,0 +4,3.258096,0,6.907755,8.294049,0,10.3,0,0,0 +0,3.258096,0,6.907755,8.294049,0,10.3,0,0,0 +2,3.258096,0,0,7.832014,0,13.8,1,0,0 +1,3.258096,0,0,7.832014,0,13.8,1,0,0 +0,3.258096,0,0,7.832014,0,13.8,1,0,0 +1,0,1,0,5.061929,0,17.2,1,0,0 +0,0,1,0,5.061929,0,17.2,1,0,0 +0,0,1,0,5.061929,0,17.2,1,0,0 +0,0,1,0,5.061929,0,6.9,1,0,0 +1,0,1,0,5.061929,0,6.9,1,0,0 +1,0,1,0,5.061929,0,6.9,1,0,0 +2,0,1,0,5.061929,1,13.8,0,1,0 +0,0,1,0,5.061929,1,13.8,0,1,0 +2,0,1,0,5.061929,1,13.8,0,1,0 +3,0,0,4.587006,0,0,10.3,0,0,0 +3,0,0,4.587006,0,0,10.3,0,0,0 +6,0,0,4.587006,0,0,10.3,0,0,0 +1,0,0,4.587006,0,0,6.9,1,0,0 +0,0,0,4.587006,0,0,6.9,1,0,0 +5,0,0,4.587006,0,0,6.9,1,0,0 +0,4.564348,0,0,4.145638,1,17.2,0,0,0 +0,4.564348,0,0,4.145638,1,17.2,0,0,0 +5,0,0,5.962654,0,0,13.8,0,0,0 +6,0,0,5.962654,0,0,13.8,0,0,0 +2,0,0,5.962654,0,0,13.8,0,0,0 +5,0,0,5.962654,0,0,11.84267,0,0,0 +1,0,0,5.962654,0,0,11.84267,0,0,0 +4,0,0,5.962654,0,0,11.84267,0,0,0 +1,0,0,5.962654,0,0,3.4,0,0,0 +3,0,0,5.962654,0,0,3.4,0,0,0 +4,0,0,5.962654,0,0,3.4,0,0,0 +4,0,0,0,0,0,24.1,0,0,0 +6,0,0,0,0,0,24.1,0,0,0 +2,0,0,0,0,0,24.1,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +3,3.258096,0,4.969813,7.041412,0,6.9,1,0,0 +6,3.258096,0,4.969813,7.041412,0,6.9,1,0,0 +9,3.258096,0,4.969813,7.041412,0,6.9,1,0,0 +0,3.258096,0,0,6.579251,0,13.8,0,1,0 +1,3.258096,0,0,6.579251,0,13.8,0,1,0 +0,3.258096,0,0,6.579251,0,13.8,0,1,0 +5,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,0,0,0,0 +9,0,0,4.509099,0,0,13.8,1,0,0 +12,0,0,4.509099,0,0,13.8,1,0,0 +10,0,0,4.509099,0,0,13.8,1,0,0 +4,0,0,4.509099,0,0,10.3,1,0,0 +11,0,0,4.509099,0,0,10.3,1,0,0 +9,0,0,4.509099,0,0,10.3,1,0,0 +0,3.258096,0,4.49981,5.886104,0,6.9,0,0,0 +1,3.258096,0,4.49981,5.886104,0,6.9,0,0,0 +0,3.258096,0,4.49981,5.886104,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +2,0,1,6.109248,6.160541,0,24.1,0,0,0 +3,0,1,6.109248,6.160541,0,24.1,0,0,0 +0,0,1,6.109248,6.160541,0,24.1,0,0,0 +2,0,1,6.109248,6.160541,0,24.1,0,0,0 +2,0,1,6.109248,6.160541,0,24.1,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +1,4.564348,0,0,6.165086,0,13.8,1,0,0 +9,4.564348,0,0,6.165086,0,13.8,1,0,0 +11,4.564348,0,0,6.165086,0,13.8,1,0,0 +3,4.564348,0,6.639876,6.691169,0,0,0,0,0 +1,4.564348,0,6.639876,6.691169,0,0,0,0,0 +5,4.564348,0,6.639876,6.691169,0,0,0,0,0 +2,4.564348,0,6.639876,6.691169,0,0,0,0,0 +1,4.564348,0,6.639876,6.691169,0,0,0,0,0 +13,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +7,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +7,0,1,6.109248,6.160541,0,17.2,1,0,0 +7,0,1,6.109248,6.160541,0,17.2,1,0,0 +3,0,1,6.109248,6.160541,0,17.2,1,0,0 +11,3.258096,0,4.989071,6.375365,0,3.4,0,0,0 +0,3.258096,0,4.989071,6.375365,0,3.4,0,0,0 +8,0,0,0,0,0,6.9,0,0,0 +6,0,0,0,0,0,6.9,0,0,0 +13,0,0,0,0,0,6.9,0,0,0 +7,0,0,0,0,1,10.3,1,0,0 +4,0,0,0,0,1,10.3,1,0,0 +1,0,0,0,0,1,10.3,1,0,0 +2,0,0,0,0,0,6.9,0,1,0 +1,0,0,0,0,0,6.9,0,1,0 +1,0,0,0,0,0,6.9,0,1,0 +0,0,0,0,0,1,6.9,0,0,0 +0,0,0,0,0,1,6.9,0,0,0 +3,0,0,0,0,1,6.9,0,0,0 +2,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +3,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +6,3.258096,0,6.907755,8.294049,0,10.3,1,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +0,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +1,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +3,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,1,37.9,0,0,0 +4,4.564348,0,6.907755,6.959049,1,37.9,0,0,0 +1,4.564348,0,6.907755,6.959049,1,37.9,0,0,0 +2,4.564348,0,6.907755,6.959049,1,37.9,0,0,0 +0,4.564348,0,6.907755,6.959049,1,37.9,0,0,0 +2,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +9,0,1,6.289567,5.755076,1,10.3,0,0,0 +8,0,1,6.289567,5.755076,1,10.3,0,0,0 +10,0,1,6.289567,5.755076,1,10.3,0,0,0 +0,0,1,6.289567,5.755076,0,10.3,0,0,0 +1,0,1,6.289567,5.755076,0,10.3,0,0,0 +0,0,1,6.289567,5.755076,0,10.3,0,0,0 +2,0,0,5.949705,0,0,24.1,0,0,0 +5,0,0,5.949705,0,0,24.1,0,0,0 +3,0,0,5.949705,0,0,24.1,0,0,0 +2,0,0,5.949705,0,0,11.84267,0,0,0 +1,0,0,5.949705,0,0,11.84267,0,0,0 +4,0,0,5.949705,0,0,11.84267,0,0,0 +3,0,0,5.949705,0,0,11.84267,0,0,0 +2,0,0,5.949705,0,0,11.84267,0,0,0 +1,0,0,5.949705,0,0,11.84267,0,0,0 +2,0,0,5.949705,0,0,11.84267,0,0,0 +1,0,0,5.949705,0,0,11.84267,0,0,0 +1,0,0,5.949705,0,0,11.84267,0,0,0 +6,0,0,5.949705,0,0,10.3,0,0,0 +7,0,0,5.949705,0,0,10.3,0,0,0 +6,0,0,5.949705,0,0,10.3,0,0,0 +3,0,0,0,0,0,10.3,1,0,0 +16,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,3.258096,0,6.39693,7.783224,0,13.8,0,0,0 +3,3.258096,0,6.39693,7.783224,0,13.8,0,0,0 +0,3.258096,0,6.39693,7.783224,0,11.84267,0,0,0 +0,3.258096,0,6.39693,7.783224,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +2,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +3,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +2,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +3,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +2,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +4,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +4,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +2,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +12,0,1,5.703783,5.755076,1,3.4,0,0,0 +3,0,1,5.703783,5.755076,1,3.4,0,0,0 +1,0,1,5.703783,5.755076,1,3.4,0,0,0 +1,0,1,5.703783,5.755076,1,3.4,0,0,0 +4,0,1,5.703783,5.755076,1,3.4,0,0,0 +4,0,1,5.703783,5.755076,0,13.8,0,0,0 +1,0,1,5.703783,5.755076,0,13.8,0,0,0 +2,0,1,5.703783,5.755076,0,13.8,0,0,0 +3,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,0,1,5.703783,5.755076,0,13.8,0,0,0 +1,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +8,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +6,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +2,0,0,0,0,1,11.84267,0,0,0 +5,0,0,5.455321,0,0,24.1,0,1,0 +8,0,0,5.455321,0,0,24.1,0,1,0 +9,0,0,5.455321,0,0,24.1,0,1,0 +11,0,0,5.455321,0,1,20.7,0,0,0 +9,0,0,5.455321,0,1,20.7,0,0,0 +4,0,0,5.455321,0,1,20.7,0,0,0 +6,0,0,5.455321,0,0,11.84267,0,0,0 +2,0,0,5.455321,0,0,11.84267,0,0,0 +1,0,0,5.455321,0,0,11.84267,0,0,0 +4,0,0,6.378766,0,0,0,0,0,0 +2,0,0,6.378766,0,0,0,0,0,0 +4,0,0,6.378766,0,0,0,0,0,0 +6,0,0,6.378766,0,1,10.3,0,0,0 +2,0,0,6.378766,0,1,10.3,0,0,0 +3,0,0,6.378766,0,1,10.3,0,0,0 +1,0,1,6.249125,6.160541,0,24.1,1,0,0 +6,0,1,6.249125,6.160541,0,24.1,1,0,0 +24,0,1,6.249125,6.160541,0,24.1,1,0,0 +2,0,1,6.249125,6.160541,0,11.84267,0,0,0 +1,0,1,6.249125,6.160541,0,11.84267,0,0,0 +5,0,1,6.249125,6.160541,0,11.84267,0,0,0 +0,0,1,6.249125,6.160541,0,6.9,0,0,0 +0,0,1,6.249125,6.160541,0,6.9,0,0,0 +3,0,1,6.249125,6.160541,0,6.9,0,0,0 +0,0,1,6.249125,6.160541,0,11.84267,0,0,0 +2,0,1,6.249125,6.160541,0,11.84267,0,0,0 +1,0,1,6.249125,6.160541,0,11.84267,0,0,0 +4,0,0,0,0,0,13.8,0,0,0 +4,0,0,0,0,0,13.8,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +1,3.258096,0,6.43575,7.693937,1,24.1,1,0,0 +0,3.258096,0,6.43575,7.693937,1,24.1,1,0,0 +0,3.258096,0,6.43575,7.693937,1,24.1,1,0,0 +2,3.258096,0,6.43575,7.693937,1,13.8,1,0,0 +1,3.258096,0,6.43575,7.693937,1,13.8,1,0,0 +0,3.258096,0,6.43575,7.693937,1,13.8,1,0,0 +1,3.258096,0,6.43575,7.693937,0,11.84267,0,0,0 +2,3.258096,0,6.43575,7.693937,0,11.84267,0,0,0 +1,3.258096,0,6.43575,7.693937,0,11.84267,0,0,0 +3,4.564348,0,5.956356,6.007648,0,13.8,0,0,0 +0,4.564348,0,5.956356,6.007648,0,13.8,0,0,0 +0,0,1,3.648839,5.061929,0,0,1,0,0 +0,0,1,3.648839,5.061929,0,0,1,0,0 +0,0,1,3.648839,5.061929,0,0,1,0,0 +0,0,1,3.648839,5.061929,0,0,1,0,0 +0,0,1,3.648839,5.061929,0,0,1,0,0 +0,0,0,5.244916,0,0,24.1,1,0,0 +2,0,0,5.244916,0,0,24.1,1,0,0 +0,0,0,5.244916,0,0,24.1,1,0,0 +0,0,0,5.244916,0,0,24.1,1,0,0 +1,0,0,5.244916,0,0,24.1,1,0,0 +6,0,0,4.896346,0,0,17.2,1,0,0 +2,0,0,4.896346,0,0,17.2,1,0,0 +1,0,0,4.896346,0,0,17.2,1,0,0 +1,0,0,4.896346,0,0,17.2,1,0,0 +3,0,0,4.896346,0,0,17.2,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +8,0,0,0,0,1,13.8,1,0,0 +9,0,0,0,0,1,13.8,1,0,0 +9,0,0,0,0,1,13.8,1,0,0 +11,0,0,0,0,1,13.8,1,0,0 +6,0,0,0,0,1,13.8,1,0,0 +1,3.258096,0,5.783825,7.17012,1,17.2,1,0,0 +2,3.258096,0,0,6.329008,0,20.7,1,0,0 +2,3.258096,0,0,6.329008,0,20.7,1,0,0 +5,3.258096,0,0,6.329008,0,20.7,1,0,0 +4,3.258096,0,0,6.329008,0,20.7,1,0,0 +1,3.258096,0,0,6.329008,0,20.7,1,0,0 +2,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +3,0,1,6.109248,6.160541,0,13.8,0,0,0 +8,0,1,6.109248,6.160541,0,13.8,0,0,0 +3,0,1,6.109248,6.160541,0,13.8,0,0,0 +10,0,1,6.109248,6.160541,0,13.8,0,0,0 +1,0,1,6.109248,6.160541,0,13.8,0,0,0 +2,0,1,0,5.061929,0,3.4,0,0,0 +0,0,1,0,5.061929,0,3.4,0,0,0 +0,0,1,0,5.061929,0,3.4,0,0,0 +0,0,1,0,5.061929,0,3.4,0,0,0 +14,4.564348,0,0,5.435788,0,3.4,0,0,0 +9,4.564348,0,0,5.435788,0,3.4,0,0,0 +23,4.564348,0,0,5.435788,0,3.4,0,0,0 +7,0,1,6.109248,6.160541,0,10.3,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,1,0,0 +6,0,1,6.109248,6.160541,0,10.3,1,0,0 +3,0,1,6.109248,6.160541,0,10.3,1,0,0 +3,0,1,6.109248,6.160541,0,10.3,1,0,0 +5,0,1,6.109248,6.160541,0,10.3,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,1,0,0 +9,0,1,6.109248,6.160541,0,10.3,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,1,0,0 +5,0,1,6.109248,6.160541,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +6,0,1,6.109248,6.160541,0,6.9,0,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +7,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +13,0,1,6.109248,6.160541,0,3.4,0,0,0 +10,0,1,6.109248,6.160541,0,3.4,0,0,0 +6,0,1,6.109248,6.160541,0,3.4,0,0,0 +14,0,1,6.109248,6.160541,0,3.4,0,0,0 +5,3.258096,0,6.114788,7.501082,0,17.2,0,0,0 +12,3.258096,0,6.114788,7.501082,0,17.2,0,0,0 +21,3.258096,0,6.114788,7.501082,0,17.2,0,0,0 +0,0,0,4.189655,0,0,11.84267,0,0,0 +1,0,0,4.189655,0,0,11.84267,0,0,0 +1,0,0,4.189655,0,0,11.84267,0,0,0 +1,0,0,4.189655,0,0,11.84267,1,0,0 +2,0,0,4.189655,0,0,11.84267,1,0,0 +6,0,0,4.189655,0,0,11.84267,1,0,0 +5,0,0,4.189655,0,0,13.8,0,0,0 +2,0,0,4.189655,0,0,13.8,0,0,0 +4,0,0,4.189655,0,0,13.8,0,0,0 +0,0,1,0,6.160541,0,11.84267,1,0,0 +0,0,1,0,6.160541,0,11.84267,1,0,0 +1,0,1,0,6.160541,0,11.84267,1,0,0 +2,0,1,0,6.160541,0,11.84267,1,0,0 +1,0,1,0,6.160541,0,11.84267,1,0,0 +3,0,1,0,6.160541,1,6.9,1,0,0 +5,0,1,0,6.160541,1,6.9,1,0,0 +4,0,1,0,6.160541,1,6.9,1,0,0 +0,0,1,0,6.160541,1,6.9,1,0,0 +1,0,1,0,6.160541,1,6.9,1,0,0 +0,0,1,0,6.160541,0,11.84267,1,0,0 +15,0,0,0,0,1,20.7,1,0,0 +9,0,0,0,0,1,20.7,1,0,0 +1,0,0,0,0,1,20.7,1,0,0 +0,0,0,0,0,1,11.84267,0,0,0 +0,0,0,0,0,1,11.84267,0,0,0 +1,0,0,0,0,1,11.84267,0,0,0 +0,0,0,0,0,0,10.3,0,1,0 +6,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,0,1,0,0 +3,0,0,0,0,0,0,1,0,0 +21,0,1,6.86943,5.755076,1,20.7,0,1,0 +41,0,1,6.86943,5.755076,1,20.7,0,1,0 +25,0,1,6.86943,5.755076,1,20.7,0,1,0 +1,0,1,6.86943,5.755076,1,17.2,0,0,0 +1,0,1,6.86943,5.755076,1,17.2,0,0,0 +1,0,1,6.86943,5.755076,1,17.2,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +0,0,1,6.109248,6.160541,0,11.84267,0,0,0 +4,0,1,6.109248,6.160541,0,11.84267,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,3.258096,0,4.382027,8.294049,0,6.9,0,0,0 +1,3.258096,0,4.382027,8.294049,0,6.9,0,0,0 +1,3.258096,0,4.382027,8.294049,0,6.9,0,0,0 +0,3.258096,0,4.382027,8.294049,0,6.9,0,0,0 +0,3.258096,0,4.382027,8.294049,0,6.9,0,0,0 +0,3.258096,0,4.382027,8.294049,0,3.4,0,0,0 +2,3.258096,0,4.382027,8.294049,0,3.4,0,0,0 +7,3.258096,0,4.382027,8.294049,0,3.4,0,0,0 +3,3.258096,0,4.382027,8.294049,0,3.4,0,0,0 +0,3.258096,0,4.382027,8.294049,0,3.4,0,0,0 +0,3.258096,0,4.382027,8.294049,0,17.2,0,0,0 +5,3.258096,0,4.382027,8.294049,0,17.2,0,0,0 +8,3.258096,0,4.382027,8.294049,0,17.2,0,0,0 +2,3.258096,0,4.382027,8.294049,0,17.2,0,0,0 +1,3.258096,0,4.382027,8.294049,0,17.2,0,0,0 +9,0,0,0,0,0,10.3,0,0,0 +13,0,0,0,0,0,10.3,0,0,0 +14,0,0,0,0,0,10.3,0,0,0 +0,0,1,5.010635,5.061929,0,0,1,0,0 +0,0,1,0,5.061929,0,10.3,1,0,0 +1,0,1,0,5.061929,0,10.3,1,0,0 +10,0,1,0,5.061929,0,10.3,1,0,0 +4,0,1,0,5.061929,0,10.3,1,0,0 +4,0,1,0,5.061929,0,10.3,1,0,0 +3,0,0,0,0,0,20.7,0,1,0 +0,0,0,0,0,0,20.7,0,1,0 +8,0,0,0,0,0,20.7,0,1,0 +7,0,0,0,0,0,20.7,0,1,0 +1,0,0,0,0,0,11.84267,1,0,0 +0,0,0,0,0,0,11.84267,1,0,0 +1,0,0,0,0,0,11.84267,1,0,0 +5,0,0,0,0,0,11.84267,1,0,0 +1,0,0,0,0,0,11.84267,1,0,0 +19,0,0,0,0,0,24.1,0,0,1 +14,0,0,0,0,0,24.1,0,0,1 +23,0,0,0,0,0,24.1,0,0,1 +23,0,0,0,0,0,24.1,0,0,1 +14,0,0,0,0,0,24.1,0,0,1 +4,0,0,0,0,1,13.8,0,0,0 +9,0,0,0,0,1,13.8,0,0,0 +6,0,0,0,0,1,13.8,0,0,0 +5,0,0,0,0,0,6.9,0,0,0 +7,0,0,0,0,0,6.9,0,0,0 +8,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +3,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,4.564348,0,5.247024,5.298317,0,0,0,0,0 +6,0,0,0,0,1,0,0,0,0 +4,0,0,0,0,1,0,0,0,0 +9,0,0,0,0,1,0,0,0,0 +1,0,0,3.401197,0,0,10.3,0,0,0 +4,0,0,3.401197,0,0,10.3,0,0,0 +2,0,0,3.401197,0,0,10.3,0,0,0 +0,3.258096,0,6.351758,7.738052,1,20.7,1,0,0 +6,3.258096,0,6.351758,7.738052,1,20.7,1,0,0 +4,3.258096,0,6.351758,7.738052,1,20.7,1,0,0 +2,3.258096,0,6.351758,7.738052,0,11.84267,0,0,0 +3,3.258096,0,6.351758,7.738052,0,11.84267,0,0,0 +2,3.258096,0,6.351758,7.738052,0,11.84267,0,0,0 +0,0,0,0,0,0,13.8,1,0,0 +2,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,13.8,1,0,0 +1,3.258096,0,0,8.294049,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +4,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +5,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,1,6.109248,6.160541,0,11.84267,1,0,0 +1,0,1,6.109248,6.160541,0,11.84267,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,1,27.6,1,0,0 +0,0,0,0,0,1,27.6,1,0,0 +0,0,0,0,0,1,27.6,1,0,0 +1,0,0,0,0,1,3.4,0,0,1 +0,0,0,0,0,1,3.4,0,0,1 +0,0,0,0,0,1,3.4,0,0,1 +1,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +3,4.564348,0,6.645741,6.697034,0,13.8,0,0,0 +0,4.564348,0,6.645741,6.697034,0,13.8,0,0,0 +0,4.564348,0,6.645741,6.697034,0,13.8,0,0,0 +3,4.564348,0,6.645741,6.697034,0,6.9,0,0,0 +1,4.564348,0,6.645741,6.697034,0,6.9,0,0,0 +0,4.564348,0,6.645741,6.697034,0,6.9,0,0,0 +2,4.564348,0,6.645741,6.697034,0,0,0,0,0 +0,4.564348,0,6.645741,6.697034,0,0,0,0,0 +0,4.564348,0,6.645741,6.697034,0,0,0,0,0 +3,4.564348,0,6.645741,6.697034,0,17.2,0,0,0 +1,4.564348,0,6.645741,6.697034,0,17.2,0,0,0 +1,4.564348,0,6.645741,6.697034,0,17.2,0,0,0 +0,4.564348,0,6.645741,6.697034,0,11.84267,0,0,0 +0,4.564348,0,6.645741,6.697034,0,11.84267,0,0,0 +0,4.564348,0,6.645741,6.697034,0,11.84267,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,4.564348,0,0,6.959049,0,6.9,0,0,0 +0,4.564348,0,0,6.959049,0,17.2,0,0,0 +0,4.564348,0,0,6.959049,1,17.2,0,0,0 +0,0,1,5.554818,5.061929,0,10.3,0,0,1 +2,0,1,5.554818,5.061929,0,10.3,0,0,1 +1,0,1,5.554818,5.061929,0,10.3,0,0,1 +0,4.564348,0,0,6.602374,0,3.4,0,0,0 +0,4.564348,0,0,6.602374,0,3.4,0,0,0 +0,4.564348,0,0,6.602374,0,3.4,0,0,0 +0,0,0,0,0,.1981873,11.84267,0,0,0 +0,0,0,0,0,.1981873,11.84267,0,0,0 +0,0,0,0,0,.1981873,11.84267,0,0,0 +0,0,0,0,0,1,0,0,1,0 +0,0,0,0,0,1,0,0,1,0 +0,0,0,0,0,1,0,0,1,0 +0,3.258096,0,0,7.495542,0,6.9,1,0,0 +7,3.258096,0,0,7.495542,0,6.9,1,0,0 +2,3.258096,0,0,7.495542,0,6.9,1,0,0 +5,3.258096,0,6.907755,8.294049,0,24.1,1,0,0 +2,3.258096,0,6.907755,8.294049,0,24.1,1,0,0 +1,3.258096,0,6.907755,8.294049,0,24.1,1,0,0 +1,4.564348,0,0,4.807036,0,6.9,1,0,0 +5,4.564348,0,0,4.807036,0,6.9,1,0,0 +0,4.564348,0,0,4.807036,0,6.9,1,0,0 +7,3.258096,0,0,7.552342,1,6.9,1,0,0 +1,3.258096,0,0,7.552342,1,6.9,1,0,0 +1,3.258096,0,0,7.552342,1,6.9,1,0,0 +7,4.564348,0,5.788491,5.674408,1,24.1,1,0,0 +4,4.564348,0,5.788491,5.674408,1,24.1,1,0,0 +3,4.564348,0,5.788491,5.674408,1,24.1,1,0,0 +2,4.564348,0,5.788491,5.674408,1,27.6,1,0,0 +6,4.564348,0,5.788491,5.674408,1,27.6,1,0,0 +11,4.564348,0,5.788491,5.674408,1,27.6,1,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +12,0,1,5.617753,6.160541,0,11.84267,0,0,0 +8,0,1,5.617753,6.160541,0,11.84267,0,0,0 +6,0,1,5.617753,6.160541,0,11.84267,0,0,0 +3,0,1,5.617753,6.160541,0,11.84267,0,0,0 +3,0,1,5.617753,6.160541,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +4,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +5,3.258096,0,6.115671,7.501966,0,11.84267,0,0,0 +3,3.258096,0,6.115671,7.501966,0,11.84267,0,0,0 +9,3.258096,0,6.115671,7.501966,0,11.84267,0,0,0 +1,4.564348,0,4.882802,4.934095,1,10.3,0,0,0 +0,4.564348,0,4.882802,4.934095,1,10.3,0,0,0 +0,4.564348,0,4.882802,4.934095,1,10.3,0,0,0 +0,4.564348,0,0,6.566006,0,13.8,0,0,0 +0,4.564348,0,0,6.566006,0,13.8,0,0,0 +0,4.564348,0,0,6.566006,0,13.8,0,0,0 +4,0,0,0,0,.1981873,11.84267,0,0,0 +4,0,0,0,0,.1981873,11.84267,0,0,0 +1,0,0,0,0,.1981873,11.84267,0,0,0 +0,0,0,0,0,.0221239,11.84267,0,0,0 +5,0,0,0,0,.0221239,11.84267,0,0,0 +4,0,0,0,0,.0221239,11.84267,0,0,0 +2,0,1,6.39693,6.160541,.0221239,11.84267,0,0,0 +1,0,1,6.39693,6.160541,.0221239,11.84267,0,0,0 +6,0,0,6.762128,0,.0221239,11.84267,0,0,0 +5,0,0,6.762128,0,.0221239,11.84267,0,0,0 +4,0,0,6.762128,0,.0221239,11.84267,0,0,0 +4,0,0,0,0,0,11.84267,0,0,0 +1,0,0,0,0,0,11.84267,0,0,0 +0,0,0,0,0,0,11.84267,0,0,0 +3,0,0,6.351409,0,0,6.9,0,0,0 +1,0,0,6.351409,0,0,6.9,0,0,0 +0,0,0,6.351409,0,0,6.9,0,0,0 +7,0,0,5.871329,0,0,11.84267,0,0,0 +2,0,0,5.871329,0,0,11.84267,0,0,0 +6,0,0,5.871329,0,0,11.84267,0,0,0 +4,0,1,0,6.160541,0,11.84267,0,0,0 +0,0,1,0,6.160541,0,11.84267,0,0,0 +8,0,1,0,6.160541,0,11.84267,0,0,0 +8,0,0,5.785915,0,0,11.84267,0,0,0 +6,0,0,5.785915,0,0,11.84267,0,0,0 +1,0,0,5.785915,0,0,11.84267,0,0,0 +3,0,0,5.785915,0,0,11.84267,0,0,0 +2,0,0,5.785915,0,0,11.84267,0,0,0 +3,3.258096,0,0,7.167964,.0221239,11.84267,0,0,0 +2,3.258096,0,0,7.167964,.0221239,11.84267,0,0,0 +0,0,0,0,0,.1981873,11.84267,0,0,0 +3,0,0,0,0,.1981873,11.84267,0,0,0 +1,0,0,0,0,.1981873,11.84267,0,0,0 +3,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +1,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +1,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +2,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +2,3.258096,0,5.717028,7.103322,0,11.84267,0,0,0 +4,0,0,6.246107,0,0,11.84267,0,0,0 +4,0,0,6.246107,0,0,11.84267,0,0,0 +5,0,0,6.246107,0,0,11.84267,0,0,0 +7,4.564348,0,6.639876,6.691169,.1981873,11.84267,0,0,0 +8,4.564348,0,6.639876,6.691169,.1981873,11.84267,0,0,0 +7,4.564348,0,6.639876,6.691169,.1981873,11.84267,0,0,0 +7,4.564348,0,6.639876,6.691169,.1981873,11.84267,0,0,0 +16,4.564348,0,6.639876,6.691169,.1981873,11.84267,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +0,4.564348,0,0,6.959049,1,27.6,0,0,0 +1,3.258096,0,6.280845,6.628041,0,11.84267,1,0,0 +4,3.258096,0,6.280845,6.628041,0,11.84267,1,0,0 +5,3.258096,0,6.280845,6.628041,0,11.84267,1,0,0 +7,3.258096,0,6.280845,6.628041,0,3.4,1,0,0 +26,3.258096,0,6.280845,6.628041,0,3.4,1,0,0 +11,3.258096,0,6.280845,6.628041,0,3.4,1,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +5,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +1,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +2,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +2,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +0,3.258096,0,6.907755,8.294049,0,6.9,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,0,0,0,0,.0221239,11.84267,0,0,0 +2,0,0,0,0,.0221239,11.84267,0,0,0 +0,0,0,0,0,.0221239,11.84267,0,0,0 +1,0,0,0,0,.0221239,11.84267,0,0,0 +3,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,1,20.7,0,0,0 +1,0,0,5.355642,0,0,3.4,0,0,0 +1,0,0,5.355642,0,0,3.4,0,0,0 +2,0,0,5.355642,0,0,3.4,0,0,0 +9,0,0,5.355642,0,0,3.4,0,0,0 +3,0,0,5.355642,0,0,3.4,0,0,0 +15,0,0,4.587006,0,0,11.84267,0,0,0 +4,0,0,4.587006,0,0,11.84267,0,0,0 +1,0,0,4.587006,0,0,11.84267,0,0,0 +4,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +5,0,1,5.703783,5.755076,0,6.9,0,0,0 +3,3.258096,0,6.612041,7.998335,.0221239,11.84267,0,0,0 +5,3.258096,0,6.612041,7.998335,.0221239,11.84267,0,0,0 +0,3.258096,0,6.612041,7.998335,.0221239,11.84267,0,0,0 +4,0,1,6.109248,6.160541,0,0,0,0,0 +3,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +2,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +3,0,1,0,5.755076,0,10.3,0,0,0 +4,0,1,0,5.755076,0,10.3,0,0,0 +0,0,1,0,5.755076,0,10.3,0,0,0 +0,0,1,0,5.755076,0,10.3,0,0,0 +0,0,1,0,5.755076,0,10.3,0,0,0 +5,0,1,0,5.755076,1,24.1,0,0,0 +2,0,1,0,5.755076,1,24.1,0,0,0 +4,0,1,0,5.755076,1,24.1,0,0,0 +1,0,1,0,5.755076,1,24.1,0,0,0 +7,0,1,0,5.755076,1,24.1,0,0,0 +3,3.258096,0,6.907755,8.294049,0,0,0,0,0 +1,3.258096,0,6.907755,8.294049,0,0,0,0,0 +4,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +0,3.258096,0,6.907755,8.294049,0,0,0,0,0 +2,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +3,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,0,11.84267,0,0,0 +20,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +10,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +23,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +12,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +9,3.258096,0,6.907755,8.294049,0,17.2,0,0,0 +7,0,0,0,0,.0221239,11.84267,0,0,0 +6,0,0,0,0,.0221239,11.84267,0,0,0 +3,0,0,0,0,.0221239,11.84267,0,0,0 +4,4.564348,0,0,5.435788,0,10.3,0,0,0 +9,4.564348,0,0,5.435788,0,10.3,0,0,0 +5,4.564348,0,0,5.435788,0,10.3,0,0,0 +10,3.258096,0,6.280845,6.628041,1,13.8,0,0,0 +8,3.258096,0,6.280845,6.628041,1,13.8,0,0,0 +7,3.258096,0,6.280845,6.628041,1,13.8,0,0,0 +2,0,0,4.063885,0,0,3.4,0,0,0 +0,0,0,4.063885,0,0,3.4,0,0,0 +0,0,0,4.063885,0,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,11.84267,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +0,3.258096,0,6.907755,8.294049,0,3.4,0,0,0 +1,3.258096,0,0,7.194437,0,6.9,0,0,0 +0,3.258096,0,0,7.194437,0,6.9,0,0,0 +0,3.258096,0,0,7.194437,0,6.9,0,0,0 +0,3.258096,0,0,7.194437,0,11.84267,0,0,0 +0,3.258096,0,0,7.194437,0,11.84267,0,0,0 +0,3.258096,0,0,7.194437,0,11.84267,0,0,0 +0,3.258096,0,0,6.866933,0,3.4,0,0,0 +1,3.258096,0,0,6.866933,0,3.4,0,0,0 +1,3.258096,0,0,6.866933,0,3.4,0,0,0 +0,3.258096,0,5.783825,7.17012,0,13.8,0,0,0 +1,3.258096,0,5.783825,7.17012,0,13.8,0,0,0 +1,3.258096,0,5.783825,7.17012,0,13.8,0,0,0 +10,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +1,3.258096,0,5.521461,6.907755,1,13.8,0,0,0 +4,3.258096,0,5.521461,6.907755,1,13.8,0,0,0 +2,3.258096,0,5.521461,6.907755,1,13.8,0,0,0 +11,3.258096,0,5.886104,7.272398,.0221239,11.84267,0,0,0 +10,3.258096,0,5.886104,7.272398,.0221239,11.84267,0,0,0 +7,3.258096,0,5.886104,7.272398,.0221239,11.84267,0,0,0 +3,3.258096,0,5.886104,7.272398,.0221239,11.84267,0,0,0 +0,3.258096,0,5.886104,7.272398,.0221239,11.84267,0,0,0 +2,0,1,6.109248,6.160541,.0221239,11.84267,0,0,0 +1,0,1,6.109248,6.160541,.0221239,11.84267,0,0,0 +8,0,0,0,0,.0221239,11.84267,0,0,0 +5,0,0,0,0,.0221239,11.84267,0,0,0 +7,0,1,5.703783,5.755076,.0221239,11.84267,0,0,0 +2,0,1,5.703783,5.755076,.0221239,11.84267,0,0,0 +3,4.564348,0,5.519459,5.570752,.0221239,11.84267,0,0,0 +1,4.564348,0,5.519459,5.570752,.0221239,11.84267,0,0,0 +4,3.258096,0,6.907755,8.294049,.0221239,11.84267,0,0,0 +5,3.258096,0,6.907755,8.294049,.0221239,11.84267,0,0,0 +2,3.258096,0,6.43575,7.693937,.0221239,11.84267,0,0,0 +1,3.258096,0,6.43575,7.693937,.0221239,11.84267,0,0,0 +7,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,.0221239,11.84267,0,0,0 +5,0,0,0,0,.0221239,11.84267,0,0,0 +2,0,0,0,0,.0221239,11.84267,0,0,0 +4,0,0,0,0,.0221239,11.84267,0,0,0 +3,0,0,0,0,.0221239,11.84267,0,0,0 +1,0,0,0,0,.0221239,11.84267,0,0,0 +15,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +12,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +8,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +4,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +10,0,0,5.871329,0,.0221239,11.84267,0,0,0 +6,0,0,5.871329,0,.0221239,11.84267,0,0,0 +11,0,0,5.330978,0,.0221239,11.84267,0,0,0 +6,0,0,5.330978,0,.0221239,11.84267,0,0,0 +4,0,0,5.330978,0,.0221239,11.84267,0,0,0 +3,0,0,5.330978,0,.0221239,11.84267,0,0,0 +7,3.258096,0,6.804725,8.19102,.0221239,11.84267,0,0,0 +4,3.258096,0,6.804725,8.19102,.0221239,11.84267,0,0,0 +6,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +5,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,0,0,0,.0221239,11.84267,0,0,0 +1,0,0,0,0,.0221239,11.84267,0,0,0 +4,0,1,0,6.160541,.0221239,11.84267,0,0,0 +1,0,1,0,6.160541,.0221239,11.84267,0,0,0 +3,0,1,5.743003,5.755076,.0221239,11.84267,0,0,0 +0,0,1,5.743003,5.755076,.0221239,11.84267,0,0,0 +4,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +4,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +9,4.564348,0,6.703188,6.754481,.0221239,11.84267,0,0,0 +8,4.564348,0,6.703188,6.754481,.0221239,11.84267,0,0,0 +12,0,0,5.496512,0,.0221239,11.84267,0,0,0 +8,0,0,5.496512,0,.0221239,11.84267,0,0,0 +2,3.258096,0,6.907755,8.294049,.0221239,11.84267,0,0,0 +1,3.258096,0,6.907755,8.294049,.0221239,11.84267,0,0,0 +5,3.258096,0,6.87363,8.259924,.0221239,11.84267,0,0,0 +2,3.258096,0,6.87363,8.259924,.0221239,11.84267,0,0,0 +0,3.258096,0,6.87363,8.259924,.0221239,11.84267,0,0,0 +14,0,0,0,0,.0221239,11.84267,0,0,0 +12,0,0,0,0,.0221239,11.84267,0,0,0 +5,4.564348,0,6.547474,6.943732,.0221239,11.84267,0,0,0 +6,4.564348,0,6.547474,6.943732,.0221239,11.84267,0,0,0 +2,4.564348,0,6.547474,6.943732,.0221239,11.84267,0,0,0 +4,0,0,5.962654,0,.0221239,11.84267,0,0,0 +3,0,0,5.962654,0,.0221239,11.84267,0,0,0 +3,0,1,0,5.061929,.0221239,11.84267,0,0,0 +2,0,1,0,5.061929,.0221239,11.84267,0,0,0 +3,0,1,0,5.061929,.0221239,11.84267,0,0,0 +3,0,1,4.341856,5.755076,.0221239,11.84267,0,0,0 +5,0,1,4.341856,5.755076,.0221239,11.84267,0,0,0 +0,4.564348,0,6.743352,6.794645,.0221239,11.84267,0,0,0 +0,4.564348,0,6.743352,6.794645,.0221239,11.84267,0,0,0 +0,4.564348,0,6.743352,6.794645,.0221239,11.84267,0,0,0 +0,4.564348,0,6.743352,6.794645,.0221239,11.84267,0,0,0 +3,0,1,5.703783,6.160541,.0221239,11.84267,0,0,0 +2,0,1,5.617753,6.160541,.0221239,11.84267,0,0,0 +2,0,1,5.617753,6.160541,.0221239,11.84267,0,0,0 +2,0,1,5.617753,6.160541,.0221239,11.84267,0,0,0 +10,0,0,0,0,.0221239,11.84267,0,0,0 +2,0,0,0,0,.0221239,11.84267,0,0,0 +7,0,1,5.703783,5.755076,.0221239,11.84267,0,0,0 +1,0,1,5.703783,5.755076,.0221239,11.84267,0,0,0 +12,3.258096,0,6.342209,7.728504,.0221239,11.84267,0,0,0 +1,0,1,6.109248,6.160541,.0221239,11.84267,0,0,0 +5,3.258096,0,6.907755,8.294049,.0221239,11.84267,0,0,0 +12,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +6,3.258096,0,0,5.075174,.0221239,11.84267,0,0,0 +0,0,0,0,0,.0221239,11.84267,0,0,0 +3,0,1,6.109248,6.160541,.0221239,11.84267,0,0,0 +0,3.258096,0,0,7.194437,.0221239,11.84267,0,0,0 +6,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +1,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +4,0,0,0,0,.0221239,11.84267,0,0,0 +7,0,0,5.785915,0,.0221239,11.84267,0,0,0 +10,0,0,5.785915,0,.0221239,11.84267,0,0,0 +6,0,0,5.785915,0,.0221239,11.84267,0,0,0 +0,0,1,5.703783,5.755076,.0221239,11.84267,0,0,0 +6,0,1,5.703783,5.755076,.0221239,11.84267,0,0,0 +9,0,1,5.703783,5.755076,.0221239,11.84267,0,0,0 +3,0,0,5.355642,0,.0221239,11.84267,0,0,0 +6,0,0,5.355642,0,.0221239,11.84267,0,0,0 +3,0,0,5.355642,0,.0221239,11.84267,0,0,0 +1,0,0,0,0,.0221239,11.84267,0,0,0 +7,0,0,0,0,.0221239,11.84267,0,0,0 +2,0,0,0,0,.0221239,11.84267,0,0,0 +6,4.564348,0,6.547474,6.943732,.0221239,11.84267,0,0,0 +2,4.564348,0,6.547474,6.943732,.0221239,11.84267,0,0,0 +8,4.564348,0,6.72827,6.779563,.0221239,11.84267,0,0,0 +6,4.564348,0,6.72827,6.779563,.0221239,11.84267,0,0,0 +11,0,0,0,0,.0221239,11.84267,0,0,0 +2,0,0,0,0,.0221239,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +2,4.564348,0,6.907755,6.959049,.0221239,11.84267,0,0,0 +12,0,1,5.703783,5.755076,.0221239,11.84267,0,0,0 +8,0,1,5.703783,5.755076,.0221239,11.84267,0,0,0 +3,0,1,6.109248,6.160541,.0221239,11.84267,0,0,0 +8,4.564348,0,6.639876,6.691169,.0221239,11.84267,0,0,0 +7,0,0,0,0,.0221239,11.84267,0,0,0 +7,0,0,5.355642,0,.0221239,11.84267,0,0,0 +6,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +3,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +2,3.258096,0,6.620073,8.006368,0,0,0,0,0 +9,3.258096,0,6.620073,8.006368,0,0,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +5,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,1,17.2,1,0,0 +1,3.258096,0,6.620073,8.006368,1,17.2,1,0,0 +2,3.258096,0,6.620073,8.006368,1,17.2,1,0,0 +0,0,1,6.1441,5.755076,0,0,0,0,0 +3,0,1,6.1441,5.755076,0,0,0,0,0 +3,0,1,6.1441,5.755076,0,0,0,0,0 +4,0,1,6.1441,5.755076,0,10.3,0,0,0 +6,0,1,6.1441,5.755076,0,10.3,0,0,0 +1,0,1,6.1441,5.755076,0,10.3,0,0,0 +6,0,0,6.953913,0,0,9.967326,0,0,0 +2,0,0,6.953913,0,0,9.967326,0,0,0 +3,0,0,6.953913,0,0,9.967326,0,0,0 +2,0,0,6.953913,0,1,6.9,0,0,0 +1,0,0,6.953913,0,1,6.9,0,0,0 +37,0,0,6.953913,0,1,6.9,0,0,0 +1,0,0,6.953913,0,0,6.9,0,0,0 +3,0,0,6.953913,0,0,6.9,0,0,0 +1,0,0,6.953913,0,0,6.9,0,0,0 +6,0,0,6.953913,0,1,9.967326,0,0,0 +7,0,0,6.953913,0,1,9.967326,0,0,0 +13,0,0,6.953913,0,1,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,0,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +4,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +2,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +1,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +2,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +5,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +3,3.258096,0,6.620073,8.006368,0,27.6,1,0,0 +2,3.258096,0,6.620073,8.006368,0,27.6,1,0,0 +1,3.258096,0,6.620073,8.006368,0,27.6,1,0,0 +6,3.258096,0,6.620073,8.006368,0,27.6,1,0,0 +5,3.258096,0,6.620073,8.006368,0,27.6,1,0,0 +1,0,0,5.629059,0,0,9.967326,0,0,0 +3,0,0,5.629059,0,0,9.967326,0,0,0 +5,0,0,5.629059,0,0,9.967326,0,0,0 +2,0,0,5.629059,0,0,9.967326,0,0,0 +4,0,0,5.629059,0,0,9.967326,0,0,0 +1,0,0,5.629059,0,0,9.967326,0,0,0 +1,0,0,5.629059,0,0,9.967326,0,0,0 +5,0,0,5.629059,0,0,9.967326,0,0,0 +2,0,0,5.629059,0,0,9.967326,0,0,0 +1,0,0,5.629059,0,0,9.967326,0,0,0 +1,0,0,5.629059,0,1,13.8,0,0,0 +2,0,0,5.629059,0,1,13.8,0,0,0 +1,0,0,5.629059,0,1,13.8,0,0,0 +2,0,0,5.629059,0,1,13.8,0,0,0 +2,0,0,5.629059,0,1,13.8,0,0,0 +2,0,0,5.629059,0,0,3.4,0,0,0 +6,0,0,5.629059,0,0,3.4,0,0,0 +0,0,0,5.629059,0,0,3.4,0,0,0 +1,0,0,5.629059,0,0,3.4,0,0,0 +1,0,0,5.629059,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,1,17.2,1,0,0 +3,0,0,0,0,1,17.2,1,0,0 +5,0,0,0,0,1,17.2,1,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,1,6.694067,6.160541,0,0,1,0,0 +3,0,1,6.694067,6.160541,0,0,1,0,0 +2,0,1,6.694067,6.160541,0,0,1,0,0 +1,0,1,6.694067,6.160541,0,24.1,1,0,0 +1,0,1,6.694067,6.160541,0,24.1,1,0,0 +1,0,1,6.694067,6.160541,0,24.1,1,0,0 +5,0,1,6.694067,6.160541,0,9.967326,1,0,0 +4,0,1,6.694067,6.160541,0,9.967326,1,0,0 +6,0,1,6.694067,6.160541,0,9.967326,1,0,0 +0,4.564348,0,6.802395,6.959049,0,0,0,0,0 +0,4.564348,0,6.802395,6.959049,0,0,0,0,0 +2,4.564348,0,6.802395,6.959049,0,0,0,0,0 +0,4.564348,0,6.802395,6.959049,0,0,0,0,0 +0,4.564348,0,6.802395,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +4,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +4,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +9,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +4,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +7,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +5,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +11,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +34,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,20.7,1,0,0 +4,0,0,0,0,0,20.7,1,0,0 +5,0,0,0,0,0,20.7,1,0,0 +4,0,0,0,0,1,9.967326,0,0,0 +22,0,0,0,0,1,9.967326,0,0,0 +34,0,0,0,0,1,9.967326,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +3,0,0,0,0,0,10.3,0,0,0 +5,3.258096,0,6.620073,8.006368,1,13.8,0,1,0 +5,3.258096,0,6.620073,8.006368,1,13.8,0,1,0 +4,3.258096,0,6.620073,8.006368,1,13.8,0,1,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,0,0,6.364407,0,0,3.4,0,0,0 +1,0,0,6.364407,0,0,3.4,0,0,0 +3,0,0,6.364407,0,0,3.4,0,0,0 +1,0,0,6.364407,0,0,3.4,0,0,0 +2,0,0,6.364407,0,0,3.4,0,0,0 +5,0,0,6.364407,0,0,6.9,1,0,0 +2,0,0,6.364407,0,0,6.9,1,0,0 +2,0,0,6.364407,0,0,6.9,1,0,0 +0,0,0,6.364407,0,0,6.9,1,0,0 +2,0,0,6.364407,0,0,6.9,1,0,0 +2,0,0,6.364407,0,0,0,1,0,0 +0,0,0,6.364407,0,0,0,1,0,0 +3,0,0,6.364407,0,0,0,1,0,0 +1,0,0,6.364407,0,0,0,1,0,0 +9,0,0,6.364407,0,0,0,1,0,0 +1,0,0,6.364407,0,0,6.9,1,0,0 +2,0,0,6.364407,0,0,6.9,1,0,0 +9,0,0,6.364407,0,0,6.9,1,0,0 +3,0,0,6.364407,0,0,6.9,1,0,0 +8,0,0,6.364407,0,0,6.9,1,0,0 +11,4.564348,0,0,0,0,0,1,0,0 +6,4.564348,0,0,0,0,0,1,0,0 +2,4.564348,0,0,0,0,0,1,0,0 +1,0,1,5.010635,5.061929,0,13.8,1,0,0 +3,0,1,5.010635,5.061929,0,13.8,1,0,0 +2,0,1,5.010635,5.061929,0,13.8,1,0,0 +2,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +52,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +18,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +2,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,0,0,6.63752,0,0,24.1,0,0,0 +1,0,0,6.63752,0,0,24.1,0,0,0 +0,0,0,6.63752,0,0,24.1,0,0,0 +0,0,0,6.63752,0,0,24.1,0,0,0 +2,0,0,6.63752,0,0,24.1,0,0,0 +2,0,0,6.63752,0,1,9.967326,0,0,0 +1,0,0,6.63752,0,1,9.967326,0,0,0 +4,0,0,6.63752,0,1,9.967326,0,0,0 +8,0,0,6.63752,0,1,9.967326,0,0,0 +3,0,0,6.63752,0,1,9.967326,0,0,0 +0,0,0,6.63752,0,0,10.3,1,0,0 +1,0,0,6.63752,0,0,10.3,1,0,0 +0,0,0,6.63752,0,0,10.3,1,0,0 +0,0,0,6.63752,0,0,10.3,1,0,0 +0,0,0,6.63752,0,0,10.3,1,0,0 +0,0,0,6.63752,0,0,9.967326,0,0,0 +1,0,0,6.63752,0,0,9.967326,0,0,0 +2,0,0,6.63752,0,0,9.967326,0,0,0 +0,0,0,6.63752,0,0,9.967326,0,0,0 +0,0,0,6.63752,0,0,9.967326,0,0,0 +1,0,0,6.63752,0,0,9.967326,0,0,0 +1,0,0,6.63752,0,0,9.967326,0,0,0 +0,0,0,6.63752,0,0,9.967326,0,0,0 +1,0,0,6.63752,0,0,9.967326,0,0,0 +0,0,0,6.63752,0,0,9.967326,0,0,0 +3,0,0,6.63752,0,0,9.967326,0,0,0 +1,0,0,6.63752,0,0,9.967326,0,0,0 +3,0,0,6.63752,0,0,9.967326,0,0,0 +1,0,0,6.63752,0,0,9.967326,0,0,0 +3,0,0,6.63752,0,0,9.967326,0,0,0 +2,0,0,6.63752,0,0,9.967326,0,0,0 +3,0,0,6.63752,0,0,9.967326,0,0,0 +0,0,0,6.63752,0,0,9.967326,0,0,0 +0,0,0,6.63752,0,0,9.967326,0,0,0 +2,0,0,6.63752,0,0,9.967326,0,0,0 +4,3.931826,0,6.253829,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.253829,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.253829,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.253829,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.253829,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.253829,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.253829,7.600903,0,0,0,0,0 +1,3.931826,0,6.253829,7.600903,0,0,0,0,0 +4,3.931826,0,6.253829,7.600903,0,0,0,0,0 +2,0,0,6.107112,0,0,10.3,1,0,0 +5,0,0,6.107112,0,0,10.3,1,0,0 +9,0,0,6.107112,0,0,10.3,1,0,0 +7,0,0,6.107112,0,0,9.967326,1,0,0 +3,0,0,6.107112,0,0,9.967326,1,0,0 +4,0,0,6.107112,0,0,9.967326,1,0,0 +1,0,0,6.107112,0,0,6.9,1,0,0 +0,0,0,6.107112,0,0,6.9,1,0,0 +1,0,0,6.107112,0,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,20.7,1,0,0 +0,0,1,6.109248,6.160541,0,20.7,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +3,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +3,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +4,3.931826,0,6.907755,7.600903,0,31,1,0,0 +6,3.931826,0,6.907755,7.600903,0,31,1,0,0 +5,3.931826,0,6.907755,7.600903,0,31,1,0,0 +5,4.564348,0,4.918885,4.970179,0,13.8,1,0,0 +4,4.564348,0,4.918885,4.970179,0,13.8,1,0,0 +2,4.564348,0,4.918885,4.970179,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +6,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,0,0,4.832943,0,0,6.9,0,0,0 +0,0,0,4.832943,0,0,6.9,0,0,0 +1,0,0,4.832943,0,0,6.9,0,0,0 +7,0,0,4.832943,0,0,10.3,0,0,0 +1,0,0,4.832943,0,0,10.3,0,0,0 +4,0,0,4.832943,0,0,10.3,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,31,1,0,0 +1,0,0,0,0,0,31,1,0,0 +2,0,0,0,0,0,31,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +7,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,6.9,0,1,0 +2,0,0,0,0,0,6.9,0,1,0 +0,0,0,0,0,0,6.9,0,1,0 +1,0,1,5.083886,5.061929,0,17.2,1,0,0 +2,0,1,5.083886,5.061929,0,17.2,1,0,0 +0,0,1,5.083886,5.061929,0,17.2,1,0,0 +11,0,0,3.843316,0,0,13.8,0,0,0 +20,0,0,3.843316,0,0,13.8,0,0,0 +0,0,0,3.843316,0,1,9.967326,1,0,0 +4,0,0,3.843316,0,1,9.967326,1,0,0 +5,0,0,3.843316,0,1,9.967326,1,0,0 +1,0,0,3.843316,0,1,3.4,1,0,0 +2,0,0,3.843316,0,1,3.4,1,0,0 +15,0,0,3.843316,0,1,3.4,1,0,0 +1,0,0,3.843316,0,0,3.4,0,0,0 +1,0,0,3.843316,0,0,3.4,0,0,0 +3,0,0,3.843316,0,0,3.4,0,0,0 +2,0,0,3.843316,0,0,13.8,1,0,0 +0,0,0,3.843316,0,0,13.8,1,0,0 +1,0,0,3.843316,0,0,13.8,1,0,0 +3,0,0,3.843316,0,1,6.9,0,0,0 +5,0,0,3.843316,0,1,6.9,0,0,0 +4,0,0,3.843316,0,1,6.9,0,0,0 +4,0,0,3.843316,0,0,9.967326,0,0,0 +7,0,0,3.843316,0,0,9.967326,0,0,0 +0,0,0,3.843316,0,0,9.967326,0,0,0 +6,0,0,4.356709,0,0,0,1,0,0 +2,0,0,4.356709,0,0,0,1,0,0 +3,0,0,4.356709,0,0,0,1,0,0 +1,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +7,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +7,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +1,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +0,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +1,0,0,4.836282,0,0,3.4,0,0,0 +2,0,0,4.836282,0,0,3.4,0,0,0 +0,0,0,4.836282,0,0,3.4,0,0,0 +2,3.258096,0,0,0,0,6.9,1,0,0 +4,3.258096,0,0,0,0,6.9,1,0,0 +1,3.258096,0,0,0,0,6.9,1,0,0 +0,0,0,4.339902,0,0,3.4,0,0,0 +0,0,0,4.339902,0,0,3.4,0,0,0 +0,0,0,4.339902,0,0,3.4,0,0,0 +0,0,0,4.339902,0,0,3.4,0,0,0 +0,0,0,4.339902,0,0,3.4,0,0,0 +0,0,0,4.339902,0,0,3.4,0,0,0 +9,0,0,4.339902,0,0,3.4,0,0,0 +1,0,0,4.339902,0,0,3.4,0,0,0 +0,0,0,4.339902,0,0,3.4,0,0,0 +0,0,0,4.339902,0,0,3.4,0,0,0 +4,0,0,5.052161,0,0,9.967326,1,0,0 +1,0,0,5.052161,0,0,9.967326,1,0,0 +6,0,0,5.052161,0,0,9.967326,1,0,0 +5,0,0,5.052161,0,0,9.967326,1,0,0 +5,0,0,5.052161,0,0,9.967326,1,0,0 +3,0,0,5.052161,0,0,3.4,1,0,0 +3,0,0,5.052161,0,0,3.4,1,0,0 +1,0,0,5.052161,0,0,3.4,1,0,0 +3,0,0,5.052161,0,0,3.4,1,0,0 +2,0,0,5.052161,0,0,3.4,1,0,0 +4,0,0,5.052161,0,0,3.4,1,0,0 +3,0,0,5.052161,0,0,3.4,1,0,0 +4,0,0,5.052161,0,0,3.4,1,0,0 +1,0,0,5.052161,0,0,3.4,1,0,0 +1,0,0,5.052161,0,0,3.4,1,0,0 +9,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +4,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +2,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +1,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +3,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.258096,0,6.215408,7.601702,0,6.9,1,0,0 +0,3.258096,0,6.215408,7.601702,0,6.9,1,0,0 +1,3.258096,0,6.215408,7.601702,0,6.9,1,0,0 +3,3.258096,0,6.215408,7.601702,0,24.1,1,0,0 +0,3.258096,0,6.215408,7.601702,0,24.1,1,0,0 +2,3.258096,0,6.215408,7.601702,0,24.1,1,0,0 +0,0,0,5.949392,0,0,9.967326,0,0,0 +0,0,0,5.949392,0,0,9.967326,0,0,0 +0,0,0,5.949392,0,0,9.967326,0,0,0 +3,0,0,5.949392,0,1,24.1,1,0,0 +0,0,0,5.949392,0,1,24.1,1,0,0 +4,0,0,5.949392,0,1,24.1,1,0,0 +3,0,0,5.949392,0,0,9.967326,0,0,0 +0,0,0,5.949392,0,0,9.967326,0,0,0 +2,0,0,5.949392,0,0,9.967326,0,0,0 +3,0,0,5.949392,0,1,20.7,1,0,0 +0,0,0,5.949392,0,1,20.7,1,0,0 +3,0,0,5.949392,0,1,20.7,1,0,0 +8,0,0,0,0,1,20.7,1,0,0 +8,0,0,0,0,1,20.7,1,0,0 +10,0,0,0,0,1,20.7,1,0,0 +8,0,0,0,0,1,20.7,1,0,0 +13,0,0,0,0,1,20.7,1,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,1,10.3,0,1,0 +0,0,0,0,0,1,9.967326,1,0,0 +2,0,0,0,0,1,9.967326,1,0,0 +3,0,0,0,0,0,10.3,0,1,0 +3,0,0,0,0,0,10.3,0,1,0 +5,0,0,0,0,0,10.3,0,1,0 +2,0,0,0,0,0,10.3,0,1,0 +10,0,0,0,0,0,10.3,0,1,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +1,0,1,6.109248,6.160541,1,17.2,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,17.2,1,0,0 +10,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +3,0,0,6.061457,0,0,9.967326,0,0,0 +9,0,0,6.061457,0,0,9.967326,0,0,0 +5,0,0,6.061457,0,0,9.967326,0,0,0 +3,0,0,6.061457,0,0,9.967326,0,0,0 +2,0,0,6.061457,0,0,9.967326,0,0,0 +2,0,0,6.061457,0,0,9.967326,0,0,0 +2,0,0,6.061457,0,0,9.967326,0,0,0 +1,0,0,6.061457,0,0,9.967326,0,0,0 +1,0,0,6.061457,0,0,9.967326,0,0,0 +2,0,0,6.061457,0,0,9.967326,0,0,0 +3,0,0,6.061457,0,0,3.4,0,0,0 +6,0,0,6.061457,0,0,3.4,0,0,0 +6,0,0,6.061457,0,0,3.4,0,0,0 +3,0,0,6.061457,0,0,3.4,0,0,0 +1,0,0,6.061457,0,0,3.4,0,0,0 +4,0,0,6.061457,0,0,10.3,1,0,0 +2,0,0,6.061457,0,0,10.3,1,0,0 +1,0,0,6.061457,0,0,10.3,1,0,0 +2,0,0,6.061457,0,0,10.3,1,0,0 +1,0,0,6.061457,0,0,10.3,1,0,0 +3,0,0,6.061457,0,0,6.9,0,0,0 +6,0,0,6.061457,0,0,6.9,0,0,0 +7,0,0,6.061457,0,0,6.9,0,0,0 +0,0,0,6.061457,0,0,6.9,0,0,0 +0,0,0,6.061457,0,0,6.9,0,0,0 +3,0,0,6.061457,0,0,3.4,0,0,0 +0,0,0,6.061457,0,0,3.4,0,0,0 +0,0,0,6.061457,0,0,3.4,0,0,0 +2,0,0,6.061457,0,0,3.4,0,0,0 +1,0,0,6.061457,0,0,3.4,0,0,0 +5,0,0,6.865057,0,0,3.4,0,0,0 +1,0,0,6.865057,0,0,3.4,0,0,0 +4,0,0,6.865057,0,0,3.4,0,0,0 +9,0,0,6.865057,0,0,3.4,1,0,0 +2,0,0,6.865057,0,0,3.4,1,0,0 +3,0,0,6.865057,0,0,3.4,1,0,0 +2,0,0,6.865057,0,0,9.967326,1,0,0 +1,0,0,6.865057,0,0,9.967326,1,0,0 +0,0,0,6.865057,0,0,9.967326,1,0,0 +2,0,0,6.865057,0,0,9.967326,1,0,0 +3,0,0,6.865057,0,0,9.967326,1,0,0 +4,0,0,6.865057,0,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,0,0,0,0 +2,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +2,0,1,6.109248,6.160541,1,13.8,0,0,0 +3,0,1,6.109248,6.160541,1,13.8,0,0,0 +2,0,1,6.109248,6.160541,1,13.8,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,1,20.7,0,0,0 +0,0,1,6.109248,6.160541,1,20.7,0,0,0 +2,0,1,6.109248,6.160541,1,20.7,0,0,0 +10,0,1,6.109248,6.160541,0,9.967326,0,0,0 +5,0,1,6.109248,6.160541,0,9.967326,0,0,0 +11,0,1,6.109248,6.160541,0,9.967326,0,0,0 +10,0,1,6.109248,6.160541,0,9.967326,0,0,0 +7,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +4,0,1,6.109248,6.160541,0,0,0,0,0 +3,0,1,6.109248,6.160541,0,0,0,0,0 +1,3.931826,0,6.558198,7.251345,0,9.967326,0,0,0 +2,3.931826,0,6.558198,7.251345,0,9.967326,0,0,0 +1,3.931826,0,6.558198,7.251345,0,9.967326,0,0,0 +2,3.931826,0,6.558198,7.251345,0,6.9,1,0,0 +3,3.931826,0,6.558198,7.251345,0,6.9,1,0,0 +5,3.931826,0,6.558198,7.251345,0,6.9,1,0,0 +7,3.931826,0,6.599871,7.293018,1,20.7,0,1,0 +3,3.931826,0,6.599871,7.293018,1,20.7,0,1,0 +2,3.931826,0,6.599871,7.293018,1,20.7,0,1,0 +4,4.564348,0,6.907755,6.959049,0,9.967326,0,1,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,1,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,1,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,1,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,1,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,1,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,1,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,1,0 +3,4.564348,0,6.907755,6.959049,0,9.967326,0,1,0 +0,4.564348,0,6.39693,6.448223,0,20.7,0,0,0 +1,4.564348,0,6.39693,6.448223,0,20.7,0,0,0 +2,4.564348,0,6.39693,6.448223,0,20.7,0,0,0 +5,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.148468,6.199761,0,9.967326,0,0,0 +2,4.564348,0,6.148468,6.199761,0,9.967326,0,0,0 +2,4.564348,0,6.148468,6.199761,0,9.967326,0,0,0 +4,4.564348,0,6.148468,6.199761,0,9.967326,0,0,0 +2,4.564348,0,6.148468,6.199761,0,9.967326,0,0,0 +3,4.564348,0,6.148468,6.199761,0,9.967326,0,0,0 +6,4.564348,0,6.148468,6.199761,0,6.9,0,0,0 +2,4.564348,0,6.148468,6.199761,0,6.9,0,0,0 +0,4.564348,0,6.148468,6.199761,0,6.9,0,0,0 +2,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +6,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +2,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +4,0,1,6.109248,6.160541,0,20.7,1,0,0 +5,0,1,6.109248,6.160541,0,20.7,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +2,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +6,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +4,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +2,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +1,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +0,0,1,6.200184,6.160541,0,9.967326,0,0,0 +3,0,1,6.200184,6.160541,0,9.967326,0,0,0 +0,0,1,6.200184,6.160541,0,9.967326,0,0,0 +0,0,1,6.200184,6.160541,0,17.2,0,0,0 +2,0,1,6.200184,6.160541,0,17.2,0,0,0 +2,0,1,6.200184,6.160541,0,17.2,0,0,0 +1,0,1,6.200184,6.160541,0,9.967326,0,0,0 +2,0,1,6.200184,6.160541,0,9.967326,0,0,0 +1,0,1,6.200184,6.160541,0,9.967326,0,0,0 +0,0,1,6.200184,6.160541,0,3.4,0,0,0 +2,0,1,6.200184,6.160541,0,3.4,0,0,0 +0,0,1,6.200184,6.160541,0,3.4,0,0,0 +0,0,0,4.922023,0,1,24.1,1,0,0 +0,0,0,4.922023,0,1,24.1,1,0,0 +0,0,0,4.922023,0,1,24.1,1,0,0 +6,0,0,0,0,0,3.4,0,0,0 +6,0,0,0,0,0,3.4,0,0,0 +10,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,17.2,0,0,0 +2,0,0,0,0,0,17.2,0,0,0 +1,0,0,0,0,0,17.2,0,0,0 +7,0,0,5.45018,0,0,6.9,0,0,0 +6,0,0,5.45018,0,0,6.9,0,0,0 +3,0,0,5.45018,0,0,6.9,0,0,0 +1,0,0,5.45018,0,0,3.4,0,0,0 +1,0,0,5.45018,0,0,3.4,0,0,0 +3,0,0,5.45018,0,0,3.4,0,0,0 +7,0,0,5.45018,0,0,6.9,0,1,0 +4,0,0,5.45018,0,0,6.9,0,1,0 +2,0,0,5.45018,0,0,6.9,0,1,0 +4,0,0,5.45018,0,0,20.7,1,0,0 +9,0,0,5.45018,0,0,20.7,1,0,0 +14,0,0,5.45018,0,0,20.7,1,0,0 +21,0,0,5.45018,0,1,34.5,0,0,1 +6,0,0,5.45018,0,1,34.5,0,0,1 +6,0,0,5.45018,0,1,34.5,0,0,1 +2,4.564348,0,6.818924,6.870217,0,10.3,0,1,0 +6,4.564348,0,6.818924,6.870217,0,10.3,0,1,0 +1,4.564348,0,6.818924,6.870217,0,10.3,0,1,0 +1,4.564348,0,6.818924,6.870217,0,10.3,0,1,0 +5,4.564348,0,6.818924,6.870217,0,10.3,0,1,0 +7,4.564348,0,6.818924,6.870217,0,9.967326,1,0,0 +4,4.564348,0,6.818924,6.870217,0,9.967326,1,0,0 +2,4.564348,0,6.818924,6.870217,0,9.967326,1,0,0 +2,4.564348,0,6.818924,6.870217,0,9.967326,1,0,0 +3,4.564348,0,6.818924,6.870217,0,9.967326,1,0,0 +3,4.564348,0,6.818924,6.870217,0,3.4,0,0,0 +2,4.564348,0,6.818924,6.870217,0,3.4,0,0,0 +0,4.564348,0,6.818924,6.870217,0,3.4,0,0,0 +1,4.564348,0,6.818924,6.870217,0,3.4,0,0,0 +3,4.564348,0,6.818924,6.870217,0,3.4,0,0,0 +3,0,1,5.600494,5.061929,0,3.4,0,0,0 +4,0,1,5.600494,5.061929,0,3.4,0,0,0 +3,0,1,5.600494,5.061929,0,3.4,0,0,0 +15,0,0,0,0,1,27.6,0,1,0 +11,0,0,0,0,1,27.6,0,1,0 +9,0,0,0,0,1,27.6,0,1,0 +0,4.564348,0,6.620073,6.671367,0,9.967326,0,0,0 +2,4.564348,0,6.620073,6.671367,0,9.967326,0,0,0 +1,4.564348,0,6.620073,6.671367,0,9.967326,0,0,0 +0,4.564348,0,6.620073,6.671367,0,9.967326,0,0,0 +0,4.564348,0,6.620073,6.671367,0,9.967326,0,0,0 +2,4.564348,0,6.620073,6.671367,0,9.967326,0,0,0 +0,4.564348,0,6.620073,6.671367,0,10.3,0,0,0 +1,4.564348,0,6.620073,6.671367,0,10.3,0,0,0 +2,4.564348,0,6.620073,6.671367,0,10.3,0,0,0 +0,4.564348,0,6.620073,6.671367,0,9.967326,0,0,0 +1,4.564348,0,6.620073,6.671367,0,9.967326,0,0,0 +0,4.564348,0,6.620073,6.671367,0,9.967326,0,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +6,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +7,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +3,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +10,0,0,0,0,0,9.967326,0,1,0 +5,0,0,0,0,0,9.967326,0,1,0 +2,0,0,0,0,0,9.967326,1,0,0 +4,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +10,0,0,0,0,0,9.967326,1,0,0 +7,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +6,0,0,0,0,0,9.967326,1,0,0 +38,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +5,0,0,0,0,1,10.3,1,0,0 +3,0,0,0,0,1,10.3,1,0,0 +2,0,0,0,0,1,10.3,1,0,0 +8,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +5,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +7,0,0,0,0,0,34.5,1,0,0 +8,0,0,0,0,0,34.5,1,0,0 +7,0,0,0,0,0,34.5,1,0,0 +2,0,1,5.703783,5.755076,1,6.9,0,0,0 +2,0,1,5.703783,5.755076,1,6.9,0,0,0 +3,0,1,5.703783,5.755076,1,6.9,0,0,0 +1,0,1,5.703783,5.755076,0,10.3,0,0,0 +1,0,1,5.703783,5.755076,0,10.3,0,0,0 +0,0,1,5.703783,5.755076,0,10.3,0,0,0 +1,0,0,6.239028,0,0,10.3,1,0,0 +1,0,0,6.239028,0,0,10.3,1,0,0 +2,0,0,6.239028,0,0,10.3,1,0,0 +6,0,0,6.239028,0,0,3.4,1,0,0 +2,0,0,6.239028,0,0,3.4,1,0,0 +4,0,0,6.239028,0,0,3.4,1,0,0 +3,0,0,6.239028,0,0,20.7,0,0,0 +3,0,0,6.239028,0,0,20.7,0,0,0 +4,0,0,6.239028,0,0,20.7,0,0,0 +8,0,0,6.239028,0,1,41.4,1,0,0 +7,0,0,6.239028,0,1,41.4,1,0,0 +4,0,0,6.239028,0,1,41.4,1,0,0 +3,0,1,0,5.755076,0,6.9,1,0,0 +7,0,1,0,5.755076,0,6.9,1,0,0 +6,0,1,0,5.755076,0,6.9,1,0,0 +1,0,1,0,5.755076,0,6.9,1,0,0 +3,0,1,0,5.755076,0,6.9,1,0,0 +4,0,1,0,5.755076,0,10.3,1,0,0 +5,0,1,0,5.755076,0,10.3,1,0,0 +5,0,1,0,5.755076,0,10.3,1,0,0 +3,0,1,0,5.755076,0,10.3,1,0,0 +0,0,1,0,5.755076,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +9,0,1,6.109248,6.160541,0,3.4,0,0,0 +3,0,1,6.109248,6.160541,0,3.4,0,0,0 +8,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +7,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,3.258096,0,6.620073,8.006368,0,17.2,0,1,0 +2,3.258096,0,6.620073,8.006368,0,17.2,0,1,0 +3,3.258096,0,6.620073,8.006368,0,17.2,0,1,0 +18,3.258096,0,6.017132,7.403427,0,17.2,0,1,0 +11,3.258096,0,6.017132,7.403427,0,17.2,0,1,0 +9,3.258096,0,6.017132,7.403427,0,17.2,0,1,0 +3,3.258096,0,6.017132,7.403427,0,9.967326,1,0,0 +2,3.258096,0,6.017132,7.403427,0,9.967326,1,0,0 +2,3.258096,0,6.017132,7.403427,0,9.967326,1,0,0 +7,3.258096,0,6.017132,7.403427,0,9.967326,0,0,0 +7,3.258096,0,6.017132,7.403427,0,9.967326,0,0,0 +20,3.258096,0,6.017132,7.403427,0,9.967326,0,0,0 +1,0,1,5.010635,5.061929,0,20.7,1,0,0 +0,0,1,5.010635,5.061929,0,20.7,1,0,0 +0,0,1,5.010635,5.061929,0,20.7,1,0,0 +0,4.564348,0,6.185694,6.236988,0,0,0,0,0 +0,4.564348,0,6.185694,6.236988,0,0,0,0,0 +1,4.564348,0,6.185694,6.236988,0,0,0,0,0 +0,4.564348,0,6.185694,6.236988,0,0,0,0,0 +0,4.564348,0,6.185694,6.236988,0,0,0,0,0 +1,4.564348,0,6.185694,6.236988,1,6.9,1,0,0 +0,4.564348,0,6.185694,6.236988,1,6.9,1,0,0 +1,4.564348,0,6.185694,6.236988,1,6.9,1,0,0 +0,4.564348,0,6.185694,6.236988,1,6.9,1,0,0 +3,4.564348,0,6.185694,6.236988,1,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,24.1,0,0,0 +1,0,1,6.109248,6.160541,0,24.1,0,0,0 +0,0,1,6.109248,6.160541,0,24.1,0,0,0 +6,0,1,6.109248,6.160541,0,17.2,0,0,0 +2,0,1,6.109248,6.160541,0,17.2,0,0,0 +1,0,1,6.109248,6.160541,0,17.2,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,0,0 +5,0,1,6.109248,6.160541,0,10.3,1,0,0 +3,0,1,6.109248,6.160541,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,10.3,1,0,0 +1,0,1,5.010635,5.061929,0,6.9,0,0,0 +1,0,1,5.010635,5.061929,0,6.9,0,0,0 +1,0,1,5.010635,5.061929,0,6.9,0,0,0 +11,3.258096,0,6.620073,8.006368,0,0,1,0,0 +6,3.258096,0,6.620073,8.006368,0,0,1,0,0 +10,3.258096,0,6.620073,8.006368,0,0,1,0,0 +7,3.258096,0,6.620073,8.006368,0,0,1,0,0 +5,3.258096,0,6.620073,8.006368,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +6,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +5,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +8,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +7,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +7,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +5,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +6,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +9,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +9,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +2,0,0,3.594569,0,0,6.9,1,0,0 +3,0,0,3.594569,0,0,6.9,1,0,0 +1,0,0,3.594569,0,0,6.9,1,0,0 +3,0,0,3.594569,0,0,3.4,0,0,0 +4,0,0,3.594569,0,0,3.4,0,0,0 +4,0,0,3.594569,0,0,3.4,0,0,0 +1,0,0,3.594569,0,0,10.3,1,0,0 +3,0,0,3.594569,0,0,10.3,1,0,0 +1,0,0,3.594569,0,0,10.3,1,0,0 +6,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +44,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +1,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +2,0,1,6.109248,6.160541,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,10.3,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,1,3.4,1,0,0 +1,0,1,6.109248,6.160541,1,3.4,1,0,0 +1,0,1,6.109248,6.160541,1,3.4,1,0,0 +7,0,0,5.917603,0,0,10.3,1,0,0 +6,0,0,5.917603,0,0,10.3,1,0,0 +10,0,0,5.917603,0,0,10.3,1,0,0 +0,0,0,5.917603,0,0,9.967326,0,0,0 +2,0,0,5.917603,0,0,9.967326,0,0,0 +2,0,0,5.917603,0,0,9.967326,0,0,0 +1,0,0,5.917603,0,0,9.967326,0,0,0 +3,0,0,5.917603,0,0,9.967326,0,0,0 +2,0,0,5.917603,0,0,9.967326,0,0,0 +0,0,0,5.917603,0,0,6.9,0,0,0 +1,0,0,5.917603,0,0,6.9,0,0,0 +1,0,0,5.917603,0,0,6.9,0,0,0 +4,0,1,6.109248,6.160541,1,27.6,1,0,0 +6,0,1,6.109248,6.160541,1,27.6,1,0,0 +1,0,1,6.109248,6.160541,1,27.6,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,0,1,0,0 +1,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,0,5.061929,1,27.6,0,1,0 +0,0,1,0,5.061929,1,27.6,0,1,0 +1,0,1,0,5.061929,1,27.6,0,1,0 +1,0,1,0,5.061929,1,27.6,0,1,0 +1,0,1,0,5.061929,1,27.6,0,1,0 +2,0,1,6.109248,6.160541,1,0,1,0,0 +1,0,1,6.109248,6.160541,1,0,1,0,0 +1,0,1,6.109248,6.160541,1,0,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,1,9.967326,1,0,0 +0,0,1,6.109248,6.160541,1,9.967326,1,0,0 +5,0,1,6.109248,6.160541,1,9.967326,1,0,0 +4,0,0,5.566358,0,0,3.4,0,0,0 +1,0,0,5.566358,0,0,3.4,0,0,0 +2,0,0,5.566358,0,0,3.4,0,0,0 +10,0,0,5.566358,0,1,9.967326,0,0,0 +5,0,0,5.566358,0,1,9.967326,0,0,0 +2,0,0,5.566358,0,1,9.967326,0,0,0 +3,0,0,5.566358,0,0,0,0,0,0 +2,0,0,5.566358,0,0,0,0,0,0 +0,0,0,5.566358,0,0,0,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +13,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,1,20.7,1,0,0 +6,0,0,0,0,1,20.7,1,0,0 +1,0,0,0,0,1,20.7,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +5,0,0,0,0,0,9.967326,1,0,0 +3,0,0,5.45018,0,1,17.2,1,0,0 +2,0,0,5.45018,0,1,17.2,1,0,0 +6,0,0,5.45018,0,1,17.2,1,0,0 +3,0,0,5.45018,0,0,6.9,0,0,0 +1,0,0,5.45018,0,0,6.9,0,0,0 +3,0,0,5.45018,0,0,6.9,0,0,0 +2,0,1,5.703783,5.755076,0,13.8,0,0,0 +1,0,1,5.703783,5.755076,0,13.8,0,0,0 +0,0,1,5.703783,5.755076,0,13.8,0,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +3,0,1,5.703783,5.755076,0,3.4,1,0,0 +2,4.564348,0,5.438079,5.489373,0,13.8,0,1,0 +0,4.564348,0,5.438079,5.489373,0,13.8,0,1,0 +9,4.564348,0,5.438079,5.489373,0,13.8,0,1,0 +1,3.258096,0,6.561596,7.947891,0,17.2,0,0,0 +1,3.258096,0,6.561596,7.947891,0,17.2,0,0,0 +0,3.258096,0,6.561596,7.947891,0,17.2,0,0,0 +2,3.258096,0,6.561596,7.947891,0,10.3,1,0,0 +4,3.258096,0,6.561596,7.947891,0,10.3,1,0,0 +5,3.258096,0,6.561596,7.947891,0,10.3,1,0,0 +0,3.258096,0,6.561596,7.947891,0,9.967326,0,0,0 +1,3.258096,0,6.561596,7.947891,0,9.967326,0,0,0 +0,3.258096,0,6.561596,7.947891,0,9.967326,0,0,0 +0,3.258096,0,6.561596,7.947891,0,6.9,1,0,0 +0,3.258096,0,6.561596,7.947891,0,6.9,1,0,0 +0,3.258096,0,6.561596,7.947891,0,6.9,1,0,0 +0,3.258096,0,5.068904,6.455199,0,9.967326,0,0,0 +1,3.258096,0,5.068904,6.455199,0,9.967326,0,0,0 +0,3.258096,0,5.068904,6.455199,0,9.967326,0,0,0 +2,3.258096,0,5.068904,6.455199,0,9.967326,0,0,0 +1,3.258096,0,5.068904,6.455199,0,9.967326,0,0,0 +6,3.258096,0,5.068904,6.455199,0,9.967326,0,0,0 +4,3.258096,0,5.068904,6.455199,1,17.2,1,0,0 +5,3.258096,0,5.068904,6.455199,1,17.2,1,0,0 +2,3.258096,0,5.068904,6.455199,1,17.2,1,0,0 +3,0,0,6.061457,0,1,13.8,0,1,0 +4,0,0,6.061457,0,1,13.8,0,1,0 +4,0,0,6.061457,0,1,13.8,0,1,0 +0,0,0,6.061457,0,0,13.8,0,0,0 +1,0,0,6.061457,0,0,13.8,0,0,0 +0,0,0,6.061457,0,0,13.8,0,0,0 +1,0,0,7.128143,0,0,6.9,0,0,0 +1,0,0,7.128143,0,0,6.9,0,0,0 +1,0,0,7.128143,0,0,6.9,0,0,0 +2,0,0,7.128143,0,0,0,0,0,0 +5,0,0,7.128143,0,0,0,0,0,0 +1,0,0,7.128143,0,0,0,0,0,0 +1,0,0,7.128143,0,0,0,0,0,0 +9,0,0,7.128143,0,0,0,0,0,0 +2,0,0,7.128143,0,0,0,0,0,0 +1,0,0,7.128143,0,0,9.967326,0,0,0 +2,0,0,7.128143,0,0,9.967326,0,0,0 +1,0,0,7.128143,0,0,9.967326,0,0,0 +1,0,0,7.128143,0,0,17.2,0,0,0 +2,0,0,7.128143,0,0,17.2,0,0,0 +4,0,0,7.128143,0,0,17.2,0,0,0 +2,0,0,7.128143,0,1,9.967326,0,0,0 +6,0,0,7.128143,0,1,9.967326,0,0,0 +4,0,0,7.128143,0,1,9.967326,0,0,0 +1,0,0,7.128143,0,0,9.967326,0,0,0 +2,0,0,7.128143,0,0,9.967326,0,0,0 +4,0,0,7.128143,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +5,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,1,17.2,0,1,0 +1,0,0,0,0,1,17.2,0,1,0 +2,0,0,0,0,1,17.2,0,1,0 +1,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,1,0 +4,0,0,0,0,0,9.967326,0,1,0 +2,0,0,0,0,0,9.967326,0,1,0 +17,0,1,6.772897,6.160541,0,13.8,1,0,0 +16,0,1,6.772897,6.160541,0,13.8,1,0,0 +10,0,1,6.772897,6.160541,0,13.8,1,0,0 +0,0,1,6.772897,6.160541,0,9.967326,0,0,0 +2,0,1,6.772897,6.160541,0,9.967326,0,0,0 +2,0,1,6.772897,6.160541,0,9.967326,0,0,0 +0,0,1,6.772897,6.160541,0,0,1,0,0 +1,0,1,6.772897,6.160541,0,0,1,0,0 +3,0,1,6.772897,6.160541,0,0,1,0,0 +10,3.931826,0,0,6.818924,.1572505,9.967326,0,0,1 +6,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +7,0,1,6.109248,6.160541,0,0,0,0,0 +4,0,1,6.109248,6.160541,0,0,0,0,0 +3,0,1,6.109248,6.160541,0,0,0,0,0 +3,0,1,6.109248,6.160541,0,0,0,0,0 +7,0,1,6.109248,6.160541,0,6.9,0,0,0 +4,0,1,6.109248,6.160541,0,6.9,0,0,0 +5,0,1,6.109248,6.160541,0,6.9,0,0,0 +6,0,1,6.109248,6.160541,0,6.9,0,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +7,0,0,4.175003,0,0,13.8,0,0,0 +2,0,0,4.175003,0,0,13.8,0,0,0 +4,0,0,4.175003,0,0,13.8,0,0,0 +1,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +0,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +0,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.367501,6.418794,0,9.967326,0,0,0 +0,4.564348,0,6.367501,6.418794,0,9.967326,0,0,0 +0,4.564348,0,6.367501,6.418794,0,9.967326,0,0,0 +2,4.564348,0,6.367501,6.418794,0,9.967326,1,0,0 +0,4.564348,0,6.367501,6.418794,0,9.967326,1,0,0 +1,4.564348,0,6.367501,6.418794,0,9.967326,1,0,0 +1,4.564348,0,6.367501,6.418794,0,27.6,1,0,0 +4,4.564348,0,6.367501,6.418794,0,27.6,1,0,0 +2,4.564348,0,6.367501,6.418794,0,27.6,1,0,0 +2,4.564348,0,6.367501,6.418794,0,10.3,1,0,0 +1,4.564348,0,6.367501,6.418794,0,10.3,1,0,0 +0,4.564348,0,6.367501,6.418794,0,10.3,1,0,0 +1,4.564348,0,6.367501,6.418794,0,9.967326,1,0,0 +0,4.564348,0,6.367501,6.418794,0,9.967326,1,0,0 +2,4.564348,0,6.367501,6.418794,0,9.967326,1,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +4,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +4,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +4,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +0,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.258096,0,6.332569,7.718863,0,6.9,0,0,0 +0,3.258096,0,6.332569,7.718863,0,6.9,0,0,0 +0,3.258096,0,6.332569,7.718863,0,6.9,0,0,0 +2,0,0,0,0,.1572505,9.967326,0,0,0 +2,0,0,0,0,.1572505,9.967326,0,0,0 +9,0,0,0,0,.1572505,9.967326,0,0,0 +9,0,0,0,0,.1572505,9.967326,0,0,0 +7,0,0,0,0,.1572505,9.967326,0,0,0 +1,0,0,5.426711,0,0,3.4,0,0,0 +0,0,0,5.426711,0,0,3.4,0,0,0 +3,0,0,5.426711,0,0,3.4,0,0,0 +0,0,0,5.426711,0,0,3.4,0,0,0 +0,0,0,5.426711,0,0,3.4,0,0,0 +8,0,0,0,0,.1572505,9.967326,0,0,0 +1,0,0,0,0,.1572505,9.967326,0,0,0 +2,0,0,0,0,.1572505,9.967326,0,0,0 +1,0,0,0,0,.1572505,9.967326,0,0,0 +1,0,0,0,0,.1572505,9.967326,0,0,0 +1,0,0,0,0,.1572505,9.967326,0,0,0 +4,0,0,0,0,.1572505,9.967326,0,0,0 +0,0,0,0,0,.1572505,9.967326,0,0,0 +1,0,0,0,0,.1572505,9.967326,0,0,0 +2,0,0,0,0,.1572505,9.967326,0,0,0 +3,0,0,5.911122,0,0,13.8,1,0,0 +1,0,0,5.911122,0,0,13.8,1,0,0 +2,0,0,5.911122,0,0,13.8,1,0,0 +2,0,0,5.911122,0,0,13.8,1,0,0 +2,0,0,5.911122,0,0,13.8,1,0,0 +1,0,0,5.911122,0,0,6.9,1,0,0 +0,0,0,5.911122,0,0,6.9,1,0,0 +3,0,0,5.911122,0,0,6.9,1,0,0 +8,0,0,5.911122,0,0,6.9,1,0,0 +3,0,0,5.911122,0,0,6.9,1,0,0 +0,0,0,5.911122,0,0,0,1,0,0 +1,0,0,5.911122,0,0,0,1,0,0 +2,0,0,5.911122,0,0,0,1,0,0 +2,0,0,5.911122,0,0,0,1,0,0 +2,0,0,5.911122,0,0,0,1,0,0 +7,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,1,24.1,1,0,0 +1,0,0,0,0,1,24.1,1,0,0 +0,0,0,0,0,1,24.1,1,0,0 +1,0,0,0,0,1,24.1,1,0,0 +1,0,0,0,0,1,24.1,1,0,0 +8,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,.0431267,9.967326,0,1,0 +2,0,0,0,0,.0431267,9.967326,0,1,0 +3,0,0,0,0,.0431267,9.967326,0,1,0 +2,0,0,0,0,1,20.7,0,1,0 +11,0,0,0,0,1,20.7,0,1,0 +4,0,0,0,0,1,20.7,0,1,0 +9,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +8,0,1,6.109248,6.160541,0,17.2,0,0,0 +1,0,1,6.109248,6.160541,0,17.2,0,0,0 +1,0,1,6.109248,6.160541,0,17.2,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,3.258096,0,5.991465,7.377759,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,0,0,1,0,0 +0,3.258096,0,6.620073,8.006368,0,0,1,0,0 +3,4.564348,0,6.159518,6.262295,0,17.2,0,1,0 +2,4.564348,0,6.159518,6.262295,0,17.2,0,1,0 +3,4.564348,0,6.159518,6.262295,0,17.2,0,1,0 +2,4.564348,0,6.159518,6.262295,0,17.2,0,1,0 +2,4.564348,0,6.159518,6.262295,0,17.2,0,1,0 +2,4.564348,0,6.159518,6.262295,0,3.4,1,0,0 +0,4.564348,0,6.159518,6.262295,0,3.4,1,0,0 +1,4.564348,0,6.159518,6.262295,0,3.4,1,0,0 +1,4.564348,0,6.159518,6.262295,0,3.4,1,0,0 +1,4.564348,0,6.159518,6.262295,0,3.4,1,0,0 +1,4.564348,0,6.159518,6.262295,0,3.4,0,0,0 +0,4.564348,0,6.159518,6.262295,0,3.4,0,0,0 +0,4.564348,0,6.159518,6.262295,0,3.4,0,0,0 +0,4.564348,0,6.159518,6.262295,0,3.4,0,0,0 +0,4.564348,0,6.159518,6.262295,0,3.4,0,0,0 +3,0,0,5.796483,0,0,3.4,0,0,0 +1,0,0,5.796483,0,0,3.4,0,0,0 +0,0,0,5.796483,0,0,3.4,0,0,0 +1,0,0,5.796483,0,0,3.4,0,0,0 +0,0,0,5.796483,0,0,3.4,0,0,0 +4,0,0,5.796483,0,0,6.9,0,0,0 +6,0,0,5.796483,0,0,6.9,0,0,0 +7,0,0,5.796483,0,0,6.9,0,0,0 +1,0,0,5.796483,0,0,6.9,0,0,0 +4,0,0,5.796483,0,0,6.9,0,0,0 +1,3.258096,0,0,7.755767,0,9.967326,0,0,0 +0,3.258096,0,0,7.755767,0,9.967326,0,0,0 +0,3.258096,0,0,7.755767,0,9.967326,0,0,0 +0,3.258096,0,0,7.755767,0,9.967326,0,0,0 +0,3.258096,0,0,7.755767,0,9.967326,0,0,0 +0,3.258096,0,0,7.755767,0,9.967326,0,0,0 +0,3.258096,0,0,7.755767,0,9.967326,0,0,0 +1,3.258096,0,0,7.755767,0,9.967326,0,0,0 +1,3.258096,0,0,7.755767,0,9.967326,0,0,0 +12,3.258096,0,0,7.755767,0,6.9,0,0,0 +0,3.258096,0,0,7.755767,0,6.9,0,0,0 +4,3.258096,0,0,7.755767,0,6.9,0,0,0 +0,3.258096,0,0,7.755767,0,9.967326,0,0,0 +1,3.258096,0,0,7.755767,0,9.967326,0,0,0 +0,3.258096,0,0,7.755767,0,9.967326,0,0,0 +0,3.258096,0,0,7.755767,0,3.4,0,1,0 +0,3.258096,0,0,7.755767,0,3.4,0,1,0 +0,3.258096,0,0,7.755767,0,3.4,0,1,0 +1,0,1,5.010635,5.061929,0,24.1,1,0,0 +0,0,1,5.010635,5.061929,0,24.1,1,0,0 +0,0,1,5.010635,5.061929,0,24.1,1,0,0 +7,0,1,5.703783,5.755076,0,13.8,0,0,0 +14,0,1,5.703783,5.755076,0,13.8,0,0,0 +23,0,1,5.703783,5.755076,0,13.8,0,0,0 +14,0,1,5.703783,5.755076,0,13.8,0,0,0 +16,0,1,5.703783,5.755076,0,13.8,0,0,0 +21,0,1,5.703783,5.755076,0,20.7,0,0,0 +7,0,1,5.703783,5.755076,0,20.7,0,0,0 +5,0,1,5.703783,5.755076,0,20.7,0,0,0 +15,0,1,5.703783,5.755076,0,20.7,0,0,0 +5,0,1,5.703783,5.755076,0,20.7,0,0,0 +4,4.564348,0,6.620073,6.671367,0,17.2,1,0,0 +4,4.564348,0,6.620073,6.671367,0,17.2,1,0,0 +3,4.564348,0,6.620073,6.671367,0,17.2,1,0,0 +4,0,1,0,6.160541,0,0,0,0,0 +2,0,1,0,6.160541,0,0,0,0,0 +0,0,1,0,6.160541,0,0,0,0,0 +0,0,1,0,6.160541,0,0,0,0,0 +0,0,1,0,6.160541,0,0,0,0,0 +0,0,1,0,6.160541,0,0,0,0,0 +1,0,1,0,6.160541,0,9.967326,0,0,0 +0,0,1,0,6.160541,0,9.967326,0,0,0 +0,0,1,0,6.160541,0,9.967326,0,0,0 +5,0,1,5.010635,5.061929,0,20.7,0,0,0 +1,0,1,5.010635,5.061929,0,20.7,0,0,0 +6,0,1,5.010635,5.061929,0,20.7,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +3,4.564348,0,6.907755,6.959049,0,0,0,0,0 +3,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +2,4.564348,0,6.907755,6.959049,0,0,0,0,0 +3,4.564348,0,6.907755,6.959049,0,0,0,0,0 +5,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +2,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +5,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +3,0,1,5.703783,5.755076,0,3.4,1,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +5,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,0,5.061929,0,6.9,1,0,0 +1,0,1,0,5.061929,0,6.9,1,0,0 +0,0,1,0,5.061929,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,0,0,0 +3,0,1,5.703783,5.755076,1,17.2,1,0,0 +0,0,1,5.703783,5.755076,1,17.2,1,0,0 +2,0,1,5.703783,5.755076,1,17.2,1,0,0 +1,0,1,5.703783,5.755076,0,13.8,1,0,0 +0,0,1,5.703783,5.755076,0,13.8,1,0,0 +1,0,1,5.703783,5.755076,0,13.8,1,0,0 +2,0,1,5.50655,5.061929,1,10.3,1,0,0 +4,0,1,5.50655,5.061929,1,10.3,1,0,0 +11,0,1,5.50655,5.061929,1,10.3,1,0,0 +11,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +3,3.931826,0,6.907755,7.600903,0,10.3,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +3,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +5,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +5,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.258096,0,6.324359,7.710653,1,27.6,0,0,0 +6,3.258096,0,6.324359,7.710653,1,27.6,0,0,0 +6,3.258096,0,6.324359,7.710653,1,27.6,0,0,0 +6,3.258096,0,6.324359,7.710653,1,27.6,0,0,0 +9,3.258096,0,6.324359,7.710653,1,27.6,0,0,0 +1,3.258096,0,6.324359,7.710653,0,3.4,0,0,0 +0,3.258096,0,6.324359,7.710653,0,3.4,0,0,0 +1,3.258096,0,6.324359,7.710653,0,3.4,0,0,0 +2,3.258096,0,6.324359,7.710653,0,3.4,0,0,0 +0,3.258096,0,6.324359,7.710653,0,3.4,0,0,0 +2,3.258096,0,6.324359,7.710653,0,6.9,0,0,0 +0,3.258096,0,6.324359,7.710653,0,6.9,0,0,0 +2,3.258096,0,6.324359,7.710653,0,6.9,0,0,0 +2,3.258096,0,6.324359,7.710653,0,6.9,0,0,0 +0,3.258096,0,6.324359,7.710653,0,6.9,0,0,0 +1,3.258096,0,6.324359,7.710653,0,9.967326,0,0,0 +0,3.258096,0,6.324359,7.710653,0,9.967326,0,0,0 +1,3.258096,0,6.324359,7.710653,0,9.967326,0,0,0 +1,3.258096,0,6.324359,7.710653,0,9.967326,0,0,0 +2,3.258096,0,6.324359,7.710653,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +7,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +8,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +7,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +12,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,1,17.2,0,0,0 +1,3.258096,0,6.620073,8.006368,1,17.2,0,0,0 +1,3.258096,0,6.620073,8.006368,1,17.2,0,0,0 +4,3.258096,0,6.620073,8.006368,1,17.2,0,0,0 +2,3.258096,0,6.620073,8.006368,1,17.2,0,0,0 +1,3.258096,0,6.620073,8.006368,1,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,1,3.4,0,0,0 +3,3.258096,0,6.620073,8.006368,1,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,1,3.4,0,0,0 +6,3.258096,0,6.620073,8.006368,1,3.4,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +6,0,0,4.60517,0,0,6.9,0,0,0 +10,0,0,4.60517,0,0,6.9,0,0,0 +5,0,0,4.60517,0,0,6.9,0,0,0 +13,0,0,4.60517,0,0,13.8,1,0,0 +1,0,0,4.60517,0,0,13.8,1,0,0 +1,0,0,4.60517,0,0,13.8,1,0,0 +2,3.258096,0,6.620073,8.006368,0,0,0,0,0 +2,3.258096,0,6.620073,8.006368,0,0,0,0,0 +5,3.258096,0,6.620073,8.006368,0,0,0,0,0 +2,3.258096,0,6.620073,8.006368,0,0,0,0,0 +1,3.258096,0,6.620073,8.006368,0,0,0,0,0 +10,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +15,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +11,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +7,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +7,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +7,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,0,0,6.256287,0,1,48.3,0,1,0 +0,0,0,6.256287,0,1,48.3,0,1,0 +2,0,0,6.256287,0,1,48.3,0,1,0 +7,0,0,6.256287,0,1,20.7,1,0,0 +4,0,0,6.256287,0,1,20.7,1,0,0 +4,0,0,6.256287,0,1,20.7,1,0,0 +4,0,0,6.256287,0,0,13.8,1,0,0 +3,0,0,6.256287,0,0,13.8,1,0,0 +1,0,0,6.256287,0,0,13.8,1,0,0 +0,0,0,6.256287,0,0,9.967326,0,1,0 +0,0,0,6.256287,0,0,9.967326,0,1,0 +4,0,0,6.256287,0,0,9.967326,0,1,0 +2,0,0,6.256287,0,0,9.967326,1,0,0 +2,0,0,6.256287,0,0,9.967326,1,0,0 +5,0,0,6.256287,0,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +4,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +3,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +7,0,0,0,0,0,17.2,0,0,0 +3,0,0,0,0,0,17.2,0,0,0 +3,0,0,0,0,0,17.2,0,0,0 +2,0,0,0,0,0,17.2,0,0,0 +4,0,0,0,0,0,17.2,0,0,0 +6,0,0,0,0,0,3.4,1,0,0 +6,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +2,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +13,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +8,0,0,0,0,0,9.967326,0,0,0 +14,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +9,0,0,0,0,0,9.967326,0,0,0 +8,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +1,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +2,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +4,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,1,0 +1,0,1,6.109248,6.160541,0,9.967326,0,1,0 +3,0,1,6.109248,6.160541,0,9.967326,0,1,0 +1,0,1,6.109248,6.160541,0,9.967326,0,1,0 +3,0,1,6.109248,6.160541,0,9.967326,0,1,0 +6,3.931826,0,0,7.600903,0,20.7,0,0,0 +1,3.931826,0,0,7.600903,0,20.7,0,0,0 +4,3.931826,0,0,7.600903,0,20.7,0,0,0 +5,3.931826,0,0,7.600903,0,20.7,0,0,0 +4,3.931826,0,0,7.600903,0,20.7,0,0,0 +0,3.931826,0,0,7.600903,0,3.4,0,0,0 +0,3.931826,0,0,7.600903,0,3.4,0,0,0 +0,3.931826,0,0,7.600903,0,3.4,0,0,0 +0,3.931826,0,0,7.600903,0,3.4,0,0,0 +1,3.931826,0,0,7.600903,0,3.4,0,0,0 +10,3.931826,0,0,7.600903,0,9.967326,0,0,0 +11,3.931826,0,0,7.600903,0,9.967326,0,0,0 +6,3.931826,0,0,7.600903,0,9.967326,0,0,0 +2,3.931826,0,0,7.600903,0,9.967326,0,0,0 +2,3.931826,0,0,7.600903,0,9.967326,0,0,0 +0,3.931826,0,0,7.600903,0,6.9,0,0,0 +2,3.931826,0,0,7.600903,0,6.9,0,0,0 +0,3.931826,0,0,7.600903,0,6.9,0,0,0 +2,3.931826,0,0,7.600903,0,6.9,0,0,0 +0,3.931826,0,0,7.600903,0,6.9,0,0,0 +1,0,1,0,6.160541,0,9.967326,0,0,0 +0,0,1,0,6.160541,0,9.967326,0,0,0 +0,0,1,0,6.160541,0,9.967326,0,0,0 +1,0,1,0,6.160541,0,10.3,0,0,0 +0,0,1,0,6.160541,0,10.3,0,0,0 +0,0,1,0,6.160541,0,10.3,0,0,0 +2,0,1,0,6.160541,0,9.967326,0,0,0 +0,0,1,0,6.160541,0,9.967326,0,0,0 +0,0,1,0,6.160541,0,9.967326,0,0,0 +1,0,1,0,6.160541,0,6.9,0,0,0 +0,0,1,0,6.160541,0,6.9,0,0,0 +0,0,1,0,6.160541,0,6.9,0,0,0 +5,0,0,4.356709,0,0,9.967326,0,0,0 +1,0,0,4.356709,0,0,9.967326,0,0,0 +3,0,0,4.356709,0,0,9.967326,0,0,0 +3,0,0,4.356709,0,0,6.9,0,0,0 +0,0,0,4.356709,0,0,6.9,0,0,0 +2,0,0,4.356709,0,0,6.9,0,0,0 +2,0,0,4.356709,0,0,6.9,0,0,0 +0,0,0,4.356709,0,0,6.9,0,0,0 +0,0,0,4.356709,0,0,6.9,0,0,0 +6,0,0,6.64066,0,1,24.1,1,0,0 +4,0,0,6.64066,0,1,24.1,1,0,0 +7,0,0,6.64066,0,1,24.1,1,0,0 +0,0,0,6.64066,0,0,0,0,0,0 +10,0,0,6.64066,0,0,0,0,0,0 +11,0,0,6.64066,0,0,0,0,0,0 +3,0,0,0,0,0,13.8,1,0,0 +4,0,0,0,0,0,13.8,1,0,0 +4,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +6,4.564348,0,6.907755,6.959049,1,6.9,1,0,0 +4,4.564348,0,6.907755,6.959049,1,6.9,1,0,0 +2,4.564348,0,6.907755,6.959049,1,6.9,1,0,0 +10,4.564348,0,6.907755,6.959049,0,24.1,0,1,0 +2,4.564348,0,6.907755,6.959049,0,24.1,0,1,0 +11,4.564348,0,6.907755,6.959049,0,24.1,0,1,0 +2,4.564348,0,6.659294,6.710587,0,6.9,0,0,0 +6,4.564348,0,6.659294,6.710587,0,6.9,0,0,0 +2,4.564348,0,6.659294,6.710587,0,6.9,0,0,0 +5,4.564348,0,0,6.784695,0,6.9,0,0,0 +12,4.564348,0,0,6.784695,0,6.9,0,0,0 +2,4.564348,0,0,6.784695,0,6.9,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +1,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +2,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +2,0,1,5.352806,5.061929,.1572505,9.967326,1,0,0 +3,0,1,5.352806,5.061929,.1572505,9.967326,1,0,0 +7,0,1,5.352806,5.061929,.1572505,9.967326,1,0,0 +1,0,0,5.51986,0,0,6.9,1,0,0 +3,0,0,5.51986,0,0,6.9,1,0,0 +0,0,0,5.51986,0,0,6.9,1,0,0 +4,0,0,5.51986,0,1,13.8,0,0,1 +7,0,0,5.51986,0,1,13.8,0,0,1 +10,0,0,5.51986,0,1,13.8,0,0,1 +1,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +6,0,0,0,0,0,10.3,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +7,0,0,0,0,0,10.3,0,0,0 +5,0,0,0,0,0,10.3,0,0,0 +7,0,0,0,0,0,9.967326,1,0,0 +6,0,0,0,0,0,9.967326,1,0,0 +31,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +3,0,0,0,0,0,13.8,1,0,0 +6,0,0,0,0,0,13.8,1,0,0 +5,0,0,0,0,0,13.8,1,0,0 +2,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +2,0,0,5.040582,0,0,3.4,0,0,0 +2,0,0,5.040582,0,0,3.4,0,0,0 +8,0,0,5.040582,0,0,3.4,0,0,0 +1,0,0,5.45018,0,0,9.967326,1,0,0 +2,0,0,5.45018,0,0,9.967326,1,0,0 +2,0,0,5.45018,0,0,9.967326,1,0,0 +2,0,0,5.45018,0,0,9.967326,1,0,0 +3,0,0,5.45018,0,0,9.967326,1,0,0 +1,0,0,5.45018,0,0,9.967326,1,0,0 +0,0,0,5.45018,0,0,9.967326,1,0,0 +1,0,0,5.45018,0,0,9.967326,1,0,0 +0,0,0,5.45018,0,0,9.967326,1,0,0 +2,0,0,5.45018,0,0,9.967326,1,0,0 +0,0,0,5.45018,0,0,9.967326,0,0,0 +1,0,0,5.45018,0,0,9.967326,0,0,0 +0,0,0,5.45018,0,0,9.967326,0,0,0 +0,0,0,5.45018,0,0,9.967326,0,0,0 +2,0,0,5.45018,0,0,9.967326,0,0,0 +5,0,0,5.45018,0,0,6.9,1,0,0 +1,0,0,5.45018,0,0,6.9,1,0,0 +3,0,0,5.45018,0,0,6.9,1,0,0 +7,0,0,5.45018,0,0,6.9,1,0,0 +1,0,0,5.45018,0,0,6.9,1,0,0 +3,0,0,5.45018,0,0,3.4,1,0,0 +0,0,0,5.45018,0,0,3.4,1,0,0 +1,0,0,5.45018,0,0,3.4,1,0,0 +3,0,0,5.45018,0,0,3.4,1,0,0 +0,0,0,5.45018,0,0,3.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +5,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +4,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +6,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +6,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +2,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +2,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +2,3.931826,0,6.586172,7.408531,0,0,0,0,0 +6,3.931826,0,6.586172,7.408531,0,0,0,0,0 +6,3.931826,0,6.586172,7.408531,0,0,0,0,0 +6,3.931826,0,6.586172,7.408531,0,0,0,0,0 +1,3.931826,0,6.586172,7.408531,0,0,0,0,0 +0,4.564348,0,5.247024,5.298317,0,17.2,0,0,0 +2,4.564348,0,6.586379,6.637672,1,20.7,0,0,0 +0,4.564348,0,6.586379,6.637672,1,20.7,0,0,0 +0,4.564348,0,6.586379,6.637672,1,20.7,0,0,0 +0,4.564348,0,6.586379,6.637672,0,6.9,0,0,0 +3,4.564348,0,6.586379,6.637672,0,6.9,0,0,0 +0,4.564348,0,6.586379,6.637672,0,6.9,0,0,0 +0,4.564348,0,6.586379,6.637672,0,9.967326,1,0,0 +0,4.564348,0,6.586379,6.637672,0,9.967326,1,0,0 +2,4.564348,0,6.586379,6.637672,0,9.967326,1,0,0 +0,4.564348,0,6.586379,6.637672,0,9.967326,0,0,0 +4,4.564348,0,6.586379,6.637672,0,9.967326,0,0,0 +1,4.564348,0,6.586379,6.637672,0,9.967326,0,0,0 +0,4.564348,0,6.586379,6.637672,0,3.4,0,0,0 +5,4.564348,0,6.586379,6.637672,0,3.4,0,0,0 +1,4.564348,0,6.586379,6.637672,0,3.4,0,0,0 +0,4.564348,0,6.586379,6.637672,0,9.967326,0,0,0 +3,4.564348,0,6.586379,6.637672,0,9.967326,0,0,0 +0,4.564348,0,6.586379,6.637672,0,9.967326,0,0,0 +2,0,0,5.672085,0,0,3.4,0,0,0 +3,0,0,5.672085,0,0,3.4,0,0,0 +1,0,0,5.672085,0,0,3.4,0,0,0 +2,0,0,5.672085,0,0,3.4,0,0,0 +0,0,0,5.672085,0,0,3.4,0,0,0 +1,0,0,5.672085,0,0,3.4,0,0,0 +1,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +4,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +1,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +3,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +0,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +1,3.258096,0,6.131227,7.517521,0,37.9,1,0,0 +6,3.258096,0,6.131227,7.517521,0,37.9,1,0,0 +1,3.258096,0,6.131227,7.517521,0,37.9,1,0,0 +6,3.258096,0,6.131227,7.517521,0,37.9,1,0,0 +2,3.258096,0,6.131227,7.517521,0,37.9,1,0,0 +0,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +4,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +0,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +0,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +0,3.258096,0,6.131227,7.517521,0,9.967326,0,0,0 +1,3.258096,0,6.131227,7.517521,0,6.9,1,0,0 +2,3.258096,0,6.131227,7.517521,0,6.9,1,0,0 +0,3.258096,0,6.131227,7.517521,0,6.9,1,0,0 +0,3.258096,0,6.131227,7.517521,0,6.9,1,0,0 +0,3.258096,0,6.131227,7.517521,0,6.9,1,0,0 +2,0,0,0,0,0,20.7,0,0,0 +1,4.564348,0,5.164786,5.216079,0,3.4,0,0,0 +10,4.564348,0,5.164786,5.216079,0,3.4,0,0,0 +2,4.564348,0,5.164786,5.216079,0,3.4,0,0,0 +4,4.564348,0,5.164786,5.216079,0,3.4,0,0,0 +0,4.564348,0,5.164786,5.216079,0,3.4,0,0,0 +0,4.564348,0,5.164786,5.216079,0,3.4,0,0,0 +1,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +3,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,10.3,0,0,0 +0,0,1,5.010635,5.061929,0,10.3,0,0,0 +0,0,1,5.010635,5.061929,0,10.3,0,0,0 +4,0,0,4.958078,0,0,13.8,1,0,0 +1,0,0,4.958078,0,0,13.8,1,0,0 +2,0,0,4.958078,0,0,13.8,1,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,4.564348,0,6.49224,6.543533,0,17.2,1,0,0 +5,4.564348,0,6.49224,6.543533,0,17.2,1,0,0 +2,4.564348,0,6.49224,6.543533,0,17.2,1,0,0 +8,4.564348,0,6.49224,6.543533,0,9.967326,0,0,0 +4,4.564348,0,6.49224,6.543533,0,9.967326,0,0,0 +3,4.564348,0,6.49224,6.543533,0,9.967326,0,0,0 +0,4.564348,0,6.49224,6.543533,0,9.967326,0,0,0 +2,4.564348,0,6.49224,6.543533,0,9.967326,0,0,0 +0,4.564348,0,6.49224,6.543533,0,9.967326,0,0,0 +1,4.564348,0,6.49224,6.543533,0,6.9,0,0,0 +7,4.564348,0,6.49224,6.543533,0,6.9,0,0,0 +0,4.564348,0,6.49224,6.543533,0,6.9,0,0,0 +6,4.564348,0,6.49224,6.543533,0,9.967326,0,0,0 +5,4.564348,0,6.49224,6.543533,0,9.967326,0,0,0 +0,4.564348,0,6.49224,6.543533,0,9.967326,0,0,0 +4,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +8,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +5,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +5,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +8,3.258096,0,6.620073,8.006368,1,24.1,0,1,0 +3,3.258096,0,6.620073,8.006368,1,24.1,0,1,0 +2,3.258096,0,6.620073,8.006368,1,24.1,0,1,0 +1,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +2,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +5,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,24.1,0,0,0 +0,0,0,0,0,0,24.1,0,0,0 +0,0,0,0,0,0,24.1,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,17.2,0,0,0 +0,0,0,0,0,0,17.2,0,0,0 +0,0,0,0,0,0,17.2,0,0,0 +1,3.258096,0,6.476973,7.863267,0,10.3,1,0,0 +2,3.258096,0,6.476973,7.863267,0,10.3,1,0,0 +1,3.258096,0,6.476973,7.863267,0,10.3,1,0,0 +3,3.258096,0,6.476973,7.863267,0,10.3,0,0,0 +3,3.258096,0,6.476973,7.863267,0,10.3,0,0,0 +3,3.258096,0,6.476973,7.863267,0,10.3,0,0,0 +1,3.931826,0,5.416101,6.109248,0,6.9,1,0,0 +0,3.931826,0,5.416101,6.109248,0,6.9,1,0,0 +0,3.931826,0,5.416101,6.109248,0,6.9,1,0,0 +0,3.931826,0,5.416101,6.109248,0,9.967326,0,0,0 +1,3.931826,0,5.416101,6.109248,0,9.967326,0,0,0 +0,3.931826,0,5.416101,6.109248,0,9.967326,0,0,0 +6,0,0,6.965062,0,0,0,0,0,0 +1,0,0,6.965062,0,0,0,0,0,0 +0,0,0,6.965062,0,0,0,0,0,0 +1,0,0,6.965062,0,0,9.967326,0,0,0 +0,0,0,6.965062,0,0,9.967326,0,0,0 +1,0,0,6.965062,0,0,9.967326,0,0,0 +1,0,0,6.965062,0,0,10.3,0,0,0 +5,0,0,6.965062,0,0,10.3,0,0,0 +1,0,0,6.965062,0,0,10.3,0,0,0 +1,0,0,6.965062,0,0,9.967326,0,0,0 +0,0,0,6.965062,0,0,9.967326,0,0,0 +5,0,0,6.965062,0,0,9.967326,0,0,0 +7,3.931826,0,6.907755,7.600903,0,20.7,0,1,0 +4,3.931826,0,6.907755,7.600903,0,20.7,0,1,0 +6,3.931826,0,6.907755,7.600903,0,20.7,0,1,0 +6,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +13,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +5,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +2,0,1,5.703783,5.755076,0,9.967326,1,0,0 +0,0,1,5.703783,5.755076,0,9.967326,1,0,0 +0,0,1,5.703783,5.755076,0,9.967326,1,0,0 +1,0,1,5.703783,5.755076,0,10.3,1,0,0 +0,0,1,5.703783,5.755076,0,10.3,1,0,0 +2,0,1,5.703783,5.755076,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,1,0 +6,0,1,6.109248,6.160541,0,6.9,0,1,0 +2,0,1,6.109248,6.160541,0,6.9,0,1,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,1,0,0 +4,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +18,0,1,6.109248,6.160541,0,6.9,1,0,0 +11,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +8,0,1,6.109248,6.160541,0,9.967326,1,0,0 +11,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +5,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +6,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +14,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +10,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +3,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +1,0,1,6.109248,6.160541,1,20.7,0,1,0 +0,0,1,6.109248,6.160541,1,20.7,0,1,0 +0,0,1,6.109248,6.160541,1,20.7,0,1,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,17.2,1,0,0 +1,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,17.2,1,0,0 +4,0,1,0,5.061929,0,6.9,1,0,0 +1,0,1,0,5.061929,0,6.9,1,0,0 +0,0,1,0,5.061929,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,1,0 +1,0,1,6.109248,6.160541,0,9.967326,0,1,0 +0,0,1,6.109248,6.160541,0,9.967326,0,1,0 +5,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,3.258096,0,6.620073,8.006368,1,10.3,0,0,0 +0,3.258096,0,6.620073,8.006368,1,10.3,0,0,0 +2,3.258096,0,6.620073,8.006368,1,10.3,0,0,0 +1,3.258096,0,6.620073,8.006368,0,0,0,0,0 +1,3.258096,0,6.620073,8.006368,0,0,0,0,0 +6,3.258096,0,6.620073,8.006368,0,0,0,0,0 +5,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +2,3.258096,0,6.620073,8.006368,1,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,1,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,1,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +3,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,4.564348,0,0,5.611975,0,0,0,0,0 +3,4.564348,0,0,5.611975,0,0,0,0,0 +0,4.564348,0,0,5.611975,0,0,0,0,0 +0,4.564348,0,5.926926,6.042758,0,13.8,0,0,0 +1,4.564348,0,5.926926,6.042758,0,13.8,0,0,0 +1,4.564348,0,5.926926,6.042758,0,13.8,0,0,0 +1,0,0,6.383034,0,0,0,0,1,0 +2,0,0,6.383034,0,0,0,0,1,0 +1,0,0,6.383034,0,0,0,0,1,0 +0,0,0,6.383034,0,0,3.4,0,1,0 +3,0,0,6.383034,0,0,3.4,0,1,0 +3,0,0,6.383034,0,0,3.4,0,1,0 +0,0,0,6.383034,0,0,9.967326,0,0,0 +1,0,0,6.383034,0,0,9.967326,0,0,0 +0,0,0,6.383034,0,0,9.967326,0,0,0 +23,0,0,6.383034,0,1,20.7,0,0,1 +72,0,0,6.383034,0,1,20.7,0,0,1 +18,0,0,6.383034,0,1,20.7,0,0,1 +3,0,0,6.383034,0,0,9.967326,1,0,0 +1,0,0,6.383034,0,0,9.967326,1,0,0 +3,0,0,6.383034,0,0,9.967326,1,0,0 +3,0,0,6.383034,0,1,0,0,0,1 +8,0,0,6.383034,0,1,0,0,0,1 +4,0,0,6.383034,0,1,0,0,0,1 +1,0,1,5.703783,5.755076,0,9.967326,0,0,0 +1,0,1,5.703783,5.755076,0,9.967326,0,0,0 +0,0,1,5.703783,5.755076,0,9.967326,0,0,0 +3,0,1,5.703783,5.755076,1,31,0,0,0 +1,0,1,5.703783,5.755076,1,31,0,0,0 +1,0,1,5.703783,5.755076,1,31,0,0,0 +5,0,1,5.010635,5.061929,1,10.3,0,1,0 +2,0,1,5.010635,5.061929,1,10.3,0,1,0 +1,0,1,5.703783,5.755076,0,10.3,0,0,0 +2,0,1,5.703783,5.755076,0,10.3,0,0,0 +3,0,1,5.703783,5.755076,0,10.3,0,0,0 +1,0,1,5.703783,5.755076,0,0,0,0,0 +1,0,1,5.703783,5.755076,0,0,0,0,0 +0,0,1,5.703783,5.755076,0,0,0,0,0 +3,0,0,6.660473,0,0,9.967326,0,0,0 +1,0,0,6.660473,0,0,9.967326,0,0,0 +6,0,0,6.660473,0,0,9.967326,0,0,0 +2,0,0,6.660473,0,1,3.4,0,0,0 +0,0,0,6.660473,0,1,3.4,0,0,0 +3,0,0,6.660473,0,1,3.4,0,0,0 +1,0,0,6.660473,0,0,10.3,1,0,0 +1,0,0,6.660473,0,0,10.3,1,0,0 +2,0,0,6.660473,0,0,10.3,1,0,0 +0,3.258096,0,6.418039,7.804333,0,3.4,0,0,0 +0,3.258096,0,6.418039,7.804333,0,3.4,0,0,0 +0,3.258096,0,6.418039,7.804333,0,3.4,0,0,0 +1,3.258096,0,6.418039,7.804333,0,3.4,0,0,0 +1,3.258096,0,6.418039,7.804333,0,3.4,0,0,0 +2,3.258096,0,6.418039,7.804333,0,3.4,0,0,0 +4,0,0,5.741848,0,0,13.8,1,0,0 +2,0,0,5.741848,0,0,13.8,1,0,0 +2,0,0,5.741848,0,0,13.8,1,0,0 +1,0,1,0,0,0,10.3,0,0,0 +9,0,0,5.741848,0,1,10.3,0,0,1 +7,0,0,5.741848,0,1,10.3,0,0,1 +15,0,0,5.741848,0,1,10.3,0,0,1 +5,4.564348,0,5.024538,5.075831,0,9.967326,0,0,0 +4,4.564348,0,5.024538,5.075831,0,9.967326,0,0,0 +1,4.564348,0,5.024538,5.075831,0,9.967326,0,0,0 +3,4.564348,0,5.024538,5.075831,1,20.7,0,1,0 +1,4.564348,0,5.024538,5.075831,1,20.7,0,1,0 +2,4.564348,0,5.024538,5.075831,1,20.7,0,1,0 +0,0,1,6.109248,6.160541,0,9.967326,0,1,0 +3,0,1,6.109248,6.160541,0,9.967326,0,1,0 +2,0,1,6.109248,6.160541,0,9.967326,0,1,0 +0,0,1,6.109248,6.160541,1,3.4,1,0,0 +0,0,1,6.109248,6.160541,1,3.4,1,0,0 +1,0,1,6.109248,6.160541,1,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,5.289478,5.061929,1,10.3,0,1,0 +2,0,1,5.289478,5.061929,1,10.3,0,1,0 +1,0,1,5.289478,5.061929,1,10.3,0,1,0 +2,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +9,4.564348,0,6.407292,6.458586,0,13.8,0,0,0 +7,4.564348,0,6.407292,6.458586,0,13.8,0,0,0 +5,4.564348,0,6.407292,6.458586,0,13.8,0,0,0 +4,0,0,6.190643,0,1,6.9,1,0,0 +3,0,0,6.190643,0,1,6.9,1,0,0 +4,0,0,6.190643,0,1,6.9,1,0,0 +3,0,0,6.190643,0,0,6.9,1,0,0 +34,0,0,6.190643,0,0,6.9,1,0,0 +46,0,0,6.190643,0,0,6.9,1,0,0 +7,0,0,6.190643,0,1,13.8,0,0,0 +5,0,0,6.190643,0,1,13.8,0,0,0 +2,0,0,6.190643,0,1,13.8,0,0,0 +14,0,0,6.190643,0,0,3.4,0,0,0 +4,0,0,6.190643,0,0,3.4,0,0,0 +1,0,0,6.190643,0,0,3.4,0,0,0 +4,0,0,6.190643,0,0,0,0,0,0 +2,0,0,6.190643,0,0,0,0,0,0 +1,0,0,6.190643,0,0,0,0,0,0 +9,0,0,0,0,0,27.6,1,0,0 +5,0,0,0,0,0,27.6,1,0,0 +6,0,0,0,0,0,27.6,1,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +10,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +8,4.564348,0,6.052183,5.941943,1,24.1,0,1,0 +8,4.564348,0,6.052183,5.941943,1,24.1,0,1,0 +5,4.564348,0,6.052183,5.941943,1,24.1,0,1,0 +12,4.564348,0,6.052183,5.941943,1,24.1,0,1,0 +11,4.564348,0,6.052183,5.941943,1,24.1,0,1,0 +6,0,1,6.109248,6.160541,0,17.2,0,1,0 +13,0,1,6.109248,6.160541,0,17.2,0,1,0 +3,0,1,6.109248,6.160541,0,17.2,0,1,0 +8,0,1,6.109248,6.160541,0,17.2,0,1,0 +6,0,1,6.109248,6.160541,0,17.2,0,1,0 +5,0,1,6.109248,6.160541,0,17.2,1,0,0 +2,0,1,6.109248,6.160541,0,17.2,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,1,0,0 +3,0,1,6.109248,6.160541,0,3.4,1,0,0 +8,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +9,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,0,0,1,0,0 +0,3.258096,0,6.620073,8.006368,0,0,1,0,0 +9,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +7,0,0,5.352806,0,1,17.2,0,0,0 +6,0,0,5.352806,0,1,17.2,0,0,0 +2,0,0,5.352806,0,1,17.2,0,0,0 +7,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,1,24.1,1,0,0 +1,4.564348,0,6.907755,6.959049,1,24.1,1,0,0 +0,4.564348,0,6.907755,6.959049,1,24.1,1,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,1,0,0 +3,0,1,6.109248,6.160541,0,10.3,1,0,0 +1,0,1,6.109248,6.160541,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,10.3,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +4,0,1,6.109248,6.160541,0,6.9,0,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,1,9.967326,0,0,0 +2,0,1,6.109248,6.160541,1,9.967326,0,0,0 +1,0,1,6.109248,6.160541,1,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +4,0,1,6.109248,6.160541,0,0,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,1,0 +10,0,1,6.109248,6.160541,0,9.967326,0,1,0 +8,0,1,6.109248,6.160541,0,9.967326,0,1,0 +4,3.931826,0,6.835185,7.528332,0,3.4,0,0,0 +1,3.931826,0,6.835185,7.528332,0,3.4,0,0,0 +1,3.931826,0,6.835185,7.528332,0,3.4,0,0,0 +1,3.931826,0,6.835185,7.528332,0,27.6,1,0,0 +2,3.931826,0,6.835185,7.528332,0,27.6,1,0,0 +23,3.931826,0,6.835185,7.528332,0,27.6,1,0,0 +0,3.931826,0,6.835185,7.528332,0,9.967326,0,1,0 +1,3.931826,0,6.835185,7.528332,0,9.967326,0,1,0 +5,3.931826,0,6.835185,7.528332,0,9.967326,0,1,0 +0,3.931826,0,6.835185,7.528332,0,3.4,1,0,0 +0,3.931826,0,6.835185,7.528332,0,3.4,1,0,0 +5,3.931826,0,6.835185,7.528332,0,3.4,1,0,0 +6,4.564348,0,6.200184,6.249121,0,10.3,1,0,0 +2,4.564348,0,6.200184,6.249121,0,10.3,1,0,0 +6,4.564348,0,6.200184,6.249121,0,10.3,1,0,0 +7,3.258096,0,6.327937,7.714231,0,9.967326,0,0,0 +3,3.258096,0,6.327937,7.714231,0,9.967326,0,0,0 +5,3.258096,0,6.327937,7.714231,0,9.967326,0,0,0 +3,3.258096,0,6.327937,7.714231,0,3.4,0,0,0 +5,3.258096,0,6.327937,7.714231,0,3.4,0,0,0 +2,3.258096,0,6.327937,7.714231,0,3.4,0,0,0 +5,3.258096,0,6.327937,7.714231,0,9.967326,0,0,0 +5,3.258096,0,6.327937,7.714231,0,9.967326,0,0,0 +3,3.258096,0,6.327937,7.714231,0,9.967326,0,0,0 +3,3.258096,0,6.327937,7.714231,0,10.3,0,0,0 +0,3.258096,0,6.327937,7.714231,0,10.3,0,0,0 +2,3.258096,0,6.327937,7.714231,0,10.3,0,0,0 +2,0,1,5.010635,5.061929,0,10.3,1,0,0 +1,0,1,5.010635,5.061929,0,10.3,1,0,0 +2,0,1,5.010635,5.061929,0,10.3,1,0,0 +5,0,1,5.010635,5.061929,0,20.7,0,0,0 +14,0,1,5.010635,5.061929,0,20.7,0,0,0 +1,0,1,5.010635,5.061929,0,20.7,0,0,0 +8,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +8,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +13,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +5,3.258096,0,6.620073,8.006368,1,44.8,1,0,0 +4,3.258096,0,6.620073,8.006368,1,44.8,1,0,0 +1,3.258096,0,6.620073,8.006368,1,44.8,1,0,0 +5,3.258096,0,6.620073,8.006368,1,10.3,1,0,0 +1,3.258096,0,6.620073,8.006368,1,10.3,1,0,0 +2,3.258096,0,6.620073,8.006368,1,10.3,1,0,0 +4,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +9,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +2,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +4,3.258096,0,6.069814,7.456108,0,0,1,0,0 +5,3.258096,0,6.069814,7.456108,0,0,1,0,0 +3,3.258096,0,6.069814,7.456108,0,0,1,0,0 +0,3.258096,0,5.966147,7.352441,0,3.4,1,0,0 +1,3.258096,0,5.966147,7.352441,0,3.4,1,0,0 +1,3.258096,0,5.966147,7.352441,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,1,9.967326,0,1,0 +5,0,1,6.109248,6.160541,1,34.5,0,1,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +6,0,1,6.109248,6.160541,0,10.3,1,0,0 +7,0,1,6.109248,6.160541,0,10.3,1,0,0 +1,0,1,6.109248,6.160541,0,10.3,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +5,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +7,0,1,6.109248,6.160541,0,13.8,1,0,0 +4,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,1,3.4,1,0,0 +2,3.258096,0,6.620073,8.006368,1,3.4,1,0,0 +3,3.258096,0,6.620073,8.006368,1,3.4,1,0,0 +12,3.258096,0,6.620073,8.006368,1,20.7,0,1,0 +5,3.258096,0,6.620073,8.006368,1,20.7,0,1,0 +8,3.258096,0,6.620073,8.006368,1,20.7,0,1,0 +4,0,0,0,0,.1572505,9.967326,0,0,0 +3,0,0,0,0,.1572505,9.967326,0,0,0 +0,0,0,0,0,.1572505,9.967326,0,0,0 +5,0,0,0,0,.1572505,9.967326,0,0,0 +2,0,0,0,0,.1572505,9.967326,0,0,0 +3,0,0,0,0,.1572505,9.967326,0,0,0 +2,0,0,0,0,.1572505,9.967326,0,0,0 +1,0,0,0,0,.1572505,9.967326,0,0,0 +2,0,0,0,0,.1572505,9.967326,0,0,0 +1,0,0,0,0,.1572505,9.967326,0,0,0 +3,0,0,0,0,.1572505,9.967326,0,0,0 +0,0,0,0,0,.1572505,9.967326,0,0,0 +1,0,0,0,0,.1572505,9.967326,0,0,0 +2,0,0,0,0,.1572505,9.967326,0,0,0 +6,3.258096,0,6.49224,7.878534,1,17.2,0,1,0 +6,3.258096,0,6.49224,7.878534,1,17.2,0,1,0 +4,3.258096,0,6.49224,7.878534,1,17.2,0,1,0 +1,3.258096,0,6.49224,7.878534,1,17.2,0,1,0 +8,3.258096,0,6.49224,7.878534,1,17.2,0,1,0 +6,3.258096,0,6.49224,7.878534,0,13.8,1,0,0 +2,3.258096,0,6.49224,7.878534,0,13.8,1,0,0 +4,3.258096,0,6.49224,7.878534,0,13.8,1,0,0 +5,3.258096,0,6.49224,7.878534,0,13.8,1,0,0 +8,3.258096,0,6.49224,7.878534,0,13.8,1,0,0 +5,3.258096,0,6.49224,7.878534,1,9.967326,1,0,0 +2,3.258096,0,6.49224,7.878534,1,9.967326,1,0,0 +7,3.258096,0,6.49224,7.878534,1,9.967326,1,0,0 +6,3.258096,0,6.49224,7.878534,1,9.967326,1,0,0 +6,3.258096,0,6.49224,7.878534,1,9.967326,1,0,0 +6,3.258096,0,6.49224,7.878534,0,9.967326,1,0,0 +5,3.258096,0,6.49224,7.878534,0,9.967326,1,0,0 +8,3.258096,0,6.49224,7.878534,0,9.967326,1,0,0 +4,3.258096,0,6.49224,7.878534,0,9.967326,1,0,0 +2,3.258096,0,6.49224,7.878534,0,9.967326,1,0,0 +16,3.258096,0,6.49224,7.878534,1,13.8,1,0,0 +2,3.258096,0,6.49224,7.878534,1,13.8,1,0,0 +12,3.258096,0,6.49224,7.878534,1,13.8,1,0,0 +5,3.258096,0,6.49224,7.878534,1,13.8,1,0,0 +14,3.258096,0,6.49224,7.878534,1,13.8,1,0,0 +4,3.258096,0,6.49224,7.878534,0,20.7,1,0,0 +4,3.258096,0,6.49224,7.878534,0,20.7,1,0,0 +2,3.258096,0,6.49224,7.878534,0,20.7,1,0,0 +4,3.258096,0,6.49224,7.878534,0,20.7,1,0,0 +5,3.258096,0,6.49224,7.878534,0,20.7,1,0,0 +0,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +2,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +1,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +1,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +1,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +6,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,0,1,0,0 +1,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,1,31,1,0,0 +0,0,1,6.109248,6.160541,1,31,1,0,0 +0,0,1,6.109248,6.160541,1,31,1,0,0 +4,0,1,6.109248,6.160541,1,24.1,1,0,0 +10,0,1,6.109248,6.160541,1,24.1,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,0,4.276666,0,0,3.4,0,0,0 +0,0,0,4.276666,0,0,3.4,0,0,0 +0,0,0,4.276666,0,0,3.4,0,0,0 +12,0,0,4.276666,0,1,20.7,0,0,0 +4,0,0,4.276666,0,1,20.7,0,0,0 +5,0,0,4.276666,0,1,20.7,0,0,0 +1,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.3,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,24.1,1,0,0 +1,0,0,0,0,0,24.1,1,0,0 +1,0,0,0,0,0,24.1,1,0,0 +2,0,0,0,0,0,24.1,1,0,0 +6,0,0,0,0,0,24.1,1,0,0 +1,4.564348,0,5.741848,5.937397,0,13.8,0,0,0 +2,4.564348,0,5.741848,5.937397,0,13.8,0,0,0 +5,4.564348,0,5.741848,5.937397,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +14,0,1,0,5.061929,1,24.1,1,0,0 +13,0,1,0,5.061929,1,24.1,1,0,0 +7,0,1,0,5.061929,1,24.1,1,0,0 +4,0,1,5.010635,5.061929,0,24.1,1,0,0 +11,0,1,5.010635,5.061929,0,24.1,1,0,0 +11,0,1,5.010635,5.061929,0,24.1,1,0,0 +0,3.258096,0,6.119858,7.506152,0,3.4,1,0,0 +1,3.258096,0,6.119858,7.506152,0,3.4,1,0,0 +0,3.258096,0,6.119858,7.506152,0,3.4,1,0,0 +0,3.258096,0,6.119858,7.506152,0,9.967326,0,0,0 +1,3.258096,0,6.119858,7.506152,0,9.967326,0,0,0 +2,3.258096,0,6.119858,7.506152,0,9.967326,0,0,0 +0,3.258096,0,6.119858,7.506152,0,3.4,0,0,0 +0,3.258096,0,6.119858,7.506152,0,3.4,0,0,0 +0,3.258096,0,6.119858,7.506152,0,3.4,0,0,0 +2,3.258096,0,6.119858,7.506152,0,9.967326,0,0,0 +0,3.258096,0,6.119858,7.506152,0,9.967326,0,0,0 +1,3.258096,0,6.119858,7.506152,0,9.967326,0,0,0 +2,3.258096,0,6.119858,7.506152,0,6.9,0,0,0 +1,3.258096,0,6.119858,7.506152,0,6.9,0,0,0 +5,3.258096,0,6.119858,7.506152,0,6.9,0,0,0 +1,3.258096,0,6.119858,7.506152,0,3.4,0,0,0 +0,3.258096,0,6.119858,7.506152,0,3.4,0,0,0 +0,3.258096,0,6.119858,7.506152,0,3.4,0,0,0 +0,3.258096,0,5.497783,6.884077,0,6.9,0,0,0 +0,3.258096,0,5.497783,6.884077,0,6.9,0,0,0 +0,3.258096,0,5.497783,6.884077,0,6.9,0,0,0 +1,0,1,5.352806,5.061929,1,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,13.8,1,0,0 +1,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,1,3.4,1,0,0 +0,0,1,6.109248,6.160541,1,3.4,1,0,0 +0,0,1,6.109248,6.160541,1,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +1,0,1,6.109248,6.160541,0,13.8,1,0,0 +1,0,1,6.109248,6.160541,0,13.8,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +4,0,0,0,0,0,9.967326,1,0,0 +8,0,0,0,0,0,9.967326,0,0,0 +9,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,17.2,0,0,0 +1,0,0,0,0,0,17.2,0,0,0 +1,0,0,0,0,0,17.2,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +5,0,0,0,0,0,13.8,0,0,0 +2,4.564348,0,5.991465,6.042758,0,24.1,0,0,0 +1,4.564348,0,5.991465,6.042758,0,24.1,0,0,0 +0,4.564348,0,5.991465,6.042758,0,24.1,0,0,0 +0,0,1,6.109248,6.160541,0,17.2,0,0,0 +2,0,1,6.109248,6.160541,0,17.2,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +5,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +9,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +4,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +5,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,0,1,5.010635,5.061929,1,10.3,1,0,0 +0,0,1,5.010635,5.061929,1,10.3,1,0,0 +0,0,1,5.010635,5.061929,1,10.3,1,0,0 +0,0,1,5.010635,5.061929,1,10.3,1,0,0 +2,0,1,5.010635,5.061929,1,10.3,1,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +4,0,1,6.109248,6.160541,0,10.3,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +4,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,4.564348,0,6.605095,6.656388,0,10.3,1,0,0 +0,4.564348,0,6.605095,6.656388,0,10.3,1,0,0 +0,4.564348,0,6.605095,6.656388,0,10.3,1,0,0 +1,4.564348,0,6.605095,6.656388,0,3.4,0,0,0 +1,4.564348,0,6.605095,6.656388,0,3.4,0,0,0 +1,4.564348,0,6.605095,6.656388,0,3.4,0,0,0 +0,4.564348,0,6.605095,6.656388,0,6.9,0,0,0 +0,4.564348,0,6.605095,6.656388,0,6.9,0,0,0 +0,4.564348,0,6.605095,6.656388,0,6.9,0,0,0 +1,0,0,2.821379,0,0,10.3,0,0,0 +0,0,0,2.821379,0,0,10.3,0,0,0 +4,0,0,2.821379,0,0,10.3,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,5.352806,0,0,17.2,0,1,0 +3,0,0,5.352806,0,0,17.2,0,1,0 +2,0,0,5.352806,0,0,17.2,0,1,0 +6,0,0,6.953913,0,0,9.967326,0,0,0 +7,0,0,6.953913,0,0,9.967326,0,0,0 +4,0,0,6.953913,0,0,9.967326,0,0,0 +6,0,0,4.356709,0,0,9.967326,0,0,0 +16,0,0,4.356709,0,0,9.967326,0,0,0 +2,0,0,4.356709,0,0,9.967326,0,0,0 +5,0,0,4.356709,0,1,6.9,0,0,0 +5,0,0,4.356709,0,1,6.9,0,0,0 +5,0,0,4.356709,0,1,6.9,0,0,0 +8,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +9,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +3,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +3,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +4,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +1,0,0,6.364407,0,1,0,0,0,0 +0,0,0,6.364407,0,1,0,0,0,0 +2,0,0,6.364407,0,1,0,0,0,0 +0,0,0,6.364407,0,1,0,0,0,0 +1,0,0,6.364407,0,1,0,0,0,0 +4,0,0,6.364407,0,0,3.4,0,0,0 +2,0,0,6.364407,0,0,3.4,0,0,0 +4,0,0,6.364407,0,0,3.4,0,0,0 +1,0,0,6.364407,0,0,3.4,0,0,0 +2,0,0,6.364407,0,0,3.4,0,0,0 +5,4.564348,0,0,0,.0268456,9.967326,0,0,0 +0,4.564348,0,0,0,.0268456,9.967326,0,0,0 +2,4.564348,0,0,0,.0268456,9.967326,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,4.564348,0,6.620073,6.671367,0,6.9,0,0,0 +3,4.564348,0,6.620073,6.671367,0,6.9,0,0,0 +0,4.564348,0,6.620073,6.671367,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +1,3.931826,0,5.416101,6.109248,1,9.967326,0,0,0 +2,3.931826,0,5.416101,6.109248,1,9.967326,0,0,0 +1,3.931826,0,5.416101,6.109248,1,9.967326,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +9,0,1,6.109248,6.160541,0,9.967326,0,0,0 +11,0,1,6.109248,6.160541,0,9.967326,0,0,0 +17,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,0,0,6.087683,0,0,13.8,0,0,0 +2,0,0,6.087683,0,0,13.8,0,0,0 +9,0,0,6.087683,0,0,13.8,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +7,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +6,0,0,0,0,0,0,0,0,0 +1,4.564348,0,5.991465,6.042758,0,6.9,0,0,0 +2,4.564348,0,5.991465,6.042758,0,6.9,0,0,0 +2,4.564348,0,5.991465,6.042758,0,6.9,0,0,0 +4,0,0,5.629059,0,.0268456,9.967326,0,0,0 +1,0,0,5.629059,0,.0268456,9.967326,0,0,0 +2,0,0,5.629059,0,.0268456,9.967326,0,0,0 +2,0,0,5.629059,0,.0268456,9.967326,0,0,0 +5,3.931826,0,6.253829,7.600903,.0268456,9.967326,0,0,0 +1,3.931826,0,6.253829,7.600903,.0268456,9.967326,0,0,0 +7,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +1,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +13,0,0,6.953913,0,.0268456,9.967326,0,0,0 +14,0,0,6.953913,0,.0268456,9.967326,0,0,0 +5,0,0,0,0,.0268456,9.967326,0,0,0 +2,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +3,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +2,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +4,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,.0268456,9.967326,0,0,0 +7,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +6,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +9,3.258096,0,5.966147,7.352441,.0268456,9.967326,0,0,0 +5,3.258096,0,5.966147,7.352441,.0268456,9.967326,0,0,0 +1,0,1,6.694067,6.160541,.0268456,9.967326,0,0,0 +4,0,0,5.796483,0,.0268456,9.967326,0,0,0 +5,0,0,5.796483,0,.0268456,9.967326,0,0,0 +6,0,0,5.796483,0,.0268456,9.967326,0,0,0 +8,3.258096,0,6.49224,7.878534,.0268456,9.967326,0,0,0 +5,3.258096,0,6.49224,7.878534,.0268456,9.967326,0,0,0 +5,3.258096,0,6.49224,7.878534,.0268456,9.967326,0,0,0 +7,0,0,5.566358,0,.0268456,9.967326,0,0,0 +12,0,0,6.660473,0,.0268456,9.967326,0,0,0 +8,0,0,4.832943,0,.0268456,9.967326,0,0,0 +4,0,1,5.703783,5.755076,.0268456,9.967326,0,0,0 +6,4.564348,0,6.818924,6.870217,.0268456,9.967326,0,0,0 +7,4.564348,0,6.818924,6.870217,.0268456,9.967326,0,0,0 +12,4.564348,0,6.818924,6.870217,.0268456,9.967326,0,0,0 +9,4.564348,0,6.620073,6.671367,.0268456,9.967326,0,0,0 +3,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +4,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +5,3.258096,0,6.327937,7.714231,.0268456,9.967326,0,0,0 +9,0,0,2.821379,0,.0268456,9.967326,0,0,0 +1,4.564348,0,6.802395,6.959049,.0268456,9.967326,0,0,0 +0,4.564348,0,6.802395,6.959049,.0268456,9.967326,0,0,0 +3,3.258096,0,6.49224,7.878534,.0268456,9.967326,0,0,0 +5,3.258096,0,6.49224,7.878534,.0268456,9.967326,0,0,0 +6,0,0,5.426711,0,.0268456,9.967326,0,0,0 +7,0,0,5.052161,0,.0268456,9.967326,0,0,0 +17,4.564348,0,6.818924,6.870217,.0268456,9.967326,0,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +2,4.564348,0,6.55108,6.602374,1,10.3,1,0,0 +0,4.564348,0,6.55108,6.602374,1,10.3,1,0,0 +0,4.564348,0,6.55108,6.602374,1,10.3,1,0,0 +0,4.564348,0,6.55108,6.602374,0,9.967326,1,0,0 +0,4.564348,0,6.55108,6.602374,0,9.967326,1,0,0 +1,4.564348,0,6.55108,6.602374,0,9.967326,1,0,0 +0,4.564348,0,6.55108,6.602374,0,0,1,0,0 +0,4.564348,0,6.55108,6.602374,0,0,1,0,0 +8,4.564348,0,6.55108,6.602374,0,0,1,0,0 +0,4.564348,0,6.55108,6.602374,0,9.967326,1,0,0 +0,4.564348,0,6.55108,6.602374,0,9.967326,1,0,0 +0,4.564348,0,6.55108,6.602374,0,9.967326,1,0,0 +2,3.258096,0,6.586172,8.006368,0,6.9,0,0,0 +3,3.258096,0,6.586172,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.586172,8.006368,0,6.9,0,0,0 +4,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +6,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.586172,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.586172,8.006368,0,9.967326,1,0,0 +3,3.258096,0,6.586172,8.006368,0,9.967326,1,0,0 +0,3.258096,0,6.586172,8.006368,0,13.8,0,0,0 +2,3.258096,0,6.586172,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.586172,8.006368,0,13.8,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +3,0,1,0,5.061929,0,6.9,1,0,0 +2,0,1,0,5.061929,0,6.9,1,0,0 +1,0,1,0,5.061929,0,6.9,1,0,0 +1,0,0,5.399971,0,0,10.3,1,0,0 +1,0,0,5.399971,0,0,10.3,1,0,0 +0,0,0,5.399971,0,0,10.3,1,0,0 +5,0,0,0,0,1,10.3,1,0,0 +3,0,0,0,0,1,10.3,1,0,0 +2,0,0,0,0,1,10.3,1,0,0 +1,0,0,0,0,1,0,1,0,0 +1,0,0,0,0,1,0,1,0,0 +1,0,0,0,0,1,0,1,0,0 +7,0,0,0,0,0,9.967326,0,1,0 +3,0,0,0,0,0,9.967326,0,1,0 +8,0,0,0,0,0,9.967326,0,1,0 +8,0,0,0,0,0,9.967326,1,0,0 +4,0,0,0,0,0,9.967326,1,0,0 +4,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,17.2,0,0,0 +1,0,0,0,0,0,17.2,0,0,0 +2,0,0,0,0,0,17.2,0,0,0 +8,0,0,0,0,0,17.2,0,0,0 +4,0,0,0,0,0,17.2,0,0,0 +0,0,1,6.226378,6.160541,0,10.3,0,0,0 +0,0,1,6.226378,6.160541,0,10.3,0,0,0 +0,0,1,6.226378,6.160541,0,10.3,0,0,0 +4,0,1,6.226378,6.160541,0,6.9,1,0,0 +0,0,1,6.226378,6.160541,0,6.9,1,0,0 +0,0,1,6.226378,6.160541,0,6.9,1,0,0 +1,0,1,6.226378,6.160541,0,9.967326,0,0,0 +1,0,1,6.226378,6.160541,0,9.967326,0,0,0 +1,0,1,6.226378,6.160541,0,9.967326,0,0,0 +5,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +5,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +4,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,3.4,1,0,0 +5,0,0,5.676206,0,1,3.4,1,0,0 +1,0,0,5.676206,0,1,3.4,1,0,0 +1,0,0,5.676206,0,1,3.4,1,0,0 +4,0,0,5.676206,0,1,3.4,1,0,0 +2,0,0,5.676206,0,1,3.4,1,0,0 +1,0,0,5.676206,0,1,9.967326,0,1,0 +2,0,0,5.676206,0,1,9.967326,0,1,0 +1,0,0,5.676206,0,1,9.967326,0,1,0 +8,0,0,5.676206,0,1,9.967326,0,1,0 +5,0,0,5.676206,0,1,9.967326,0,1,0 +7,0,0,5.676206,0,0,9.967326,0,1,0 +5,0,0,5.676206,0,0,9.967326,0,1,0 +0,0,0,5.676206,0,0,9.967326,0,1,0 +0,0,0,5.676206,0,0,9.967326,0,1,0 +1,0,0,5.676206,0,0,9.967326,0,1,0 +2,0,0,5.676206,0,0,9.967326,1,0,0 +2,0,0,5.676206,0,0,9.967326,1,0,0 +2,0,0,5.676206,0,0,9.967326,1,0,0 +5,0,0,5.676206,0,0,9.967326,1,0,0 +7,0,0,5.676206,0,0,9.967326,1,0,0 +11,0,0,5.676206,0,0,17.2,1,0,0 +4,0,0,5.676206,0,0,17.2,1,0,0 +11,0,0,5.676206,0,0,17.2,1,0,0 +9,0,0,5.676206,0,0,17.2,1,0,0 +8,0,0,5.676206,0,0,17.2,1,0,0 +6,0,0,5.676206,0,0,9.967326,0,1,0 +9,0,0,5.676206,0,0,9.967326,0,1,0 +6,0,0,5.676206,0,0,9.967326,0,1,0 +10,0,0,5.676206,0,0,9.967326,0,1,0 +5,0,0,5.676206,0,0,9.967326,0,1,0 +2,0,1,5.010635,5.061929,0,6.9,1,0,0 +0,0,1,5.010635,5.061929,0,6.9,1,0,0 +0,0,1,5.010635,5.061929,0,6.9,1,0,0 +2,0,1,5.010635,5.061929,0,6.9,0,0,0 +1,0,1,5.010635,5.061929,0,6.9,0,0,0 +0,0,1,5.010635,5.061929,0,6.9,0,0,0 +3,0,1,6.104436,6.160541,0,3.4,0,0,0 +0,0,1,6.104436,6.160541,0,3.4,0,0,0 +1,0,1,6.104436,6.160541,0,3.4,0,0,0 +5,0,1,6.104436,6.160541,0,24.1,1,0,0 +3,0,1,6.104436,6.160541,0,24.1,1,0,0 +1,0,1,6.104436,6.160541,0,24.1,1,0,0 +8,0,1,6.104436,6.160541,0,9.967326,1,0,0 +2,0,1,6.104436,6.160541,0,9.967326,1,0,0 +2,0,1,6.104436,6.160541,0,9.967326,1,0,0 +3,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +7,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +4,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.586172,8.006368,0,0,0,0,0 +0,3.258096,0,6.586172,8.006368,0,0,0,0,0 +0,3.258096,0,6.586172,8.006368,0,0,0,0,0 +1,3.258096,0,6.586172,8.006368,0,0,0,0,0 +0,3.258096,0,6.586172,8.006368,0,0,0,0,0 +0,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +2,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +4,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.586172,8.006368,1,10.3,1,0,0 +2,3.258096,0,6.586172,8.006368,1,10.3,1,0,0 +3,3.258096,0,6.586172,8.006368,1,10.3,1,0,0 +3,3.258096,0,6.586172,8.006368,1,10.3,1,0,0 +1,3.258096,0,6.586172,8.006368,1,10.3,1,0,0 +2,0,0,5.974827,0,0,13.8,0,0,0 +4,0,0,5.974827,0,0,13.8,0,0,0 +2,0,0,5.974827,0,0,13.8,0,0,0 +0,0,1,6.005367,5.061929,0,10.3,0,0,1 +1,0,1,6.005367,5.061929,0,10.3,0,0,1 +0,0,1,6.005367,5.061929,0,10.3,0,0,1 +1,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +1,0,0,5.437731,0,0,17.2,1,0,0 +5,0,0,5.437731,0,0,17.2,1,0,0 +2,0,0,5.437731,0,0,17.2,1,0,0 +2,0,0,5.437731,0,0,10.3,0,0,0 +3,0,0,5.437731,0,0,10.3,0,0,0 +1,0,0,5.437731,0,0,10.3,0,0,0 +4,0,1,5.703783,5.755076,1,13.8,0,1,0 +1,0,1,5.703783,5.755076,1,13.8,0,1,0 +3,0,1,5.703783,5.755076,1,13.8,0,1,0 +2,0,1,5.703783,5.755076,0,20.7,1,0,0 +1,0,1,5.703783,5.755076,0,20.7,1,0,0 +3,0,1,5.703783,5.755076,0,20.7,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +4,0,1,6.109248,6.160541,0,6.9,0,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +6,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +5,0,0,5.418764,0,1,17.2,1,0,0 +5,0,0,5.418764,0,1,17.2,1,0,0 +3,0,0,5.418764,0,1,17.2,1,0,0 +3,0,0,5.418764,0,0,9.967326,0,0,0 +1,0,0,5.418764,0,0,9.967326,0,0,0 +2,0,0,5.418764,0,0,9.967326,0,0,0 +5,0,0,5.418764,0,0,9.967326,0,0,0 +0,0,0,5.418764,0,0,9.967326,0,0,0 +0,0,0,5.418764,0,0,9.967326,0,0,0 +5,0,0,5.418764,0,0,20.7,0,0,0 +4,0,0,5.418764,0,0,20.7,0,0,0 +7,0,0,5.418764,0,0,20.7,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,1,24.1,0,0,0 +2,4.564348,0,6.907755,6.959049,1,24.1,0,0,0 +0,4.564348,0,6.907755,6.959049,1,24.1,0,0,0 +0,4.564348,0,6.907755,6.959049,1,24.1,0,0,0 +0,4.564348,0,6.907755,6.959049,1,24.1,0,0,0 +3,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +5,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +6,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +2,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +8,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +4,0,0,6.346478,0,0,13.8,0,0,0 +1,0,0,6.346478,0,0,13.8,0,0,0 +10,0,0,6.346478,0,0,13.8,0,0,0 +3,0,0,6.346478,0,0,9.967326,0,0,0 +1,0,0,6.346478,0,0,9.967326,0,0,0 +2,0,0,6.346478,0,0,9.967326,0,0,0 +13,0,0,6.346478,0,0,9.967326,0,0,0 +4,0,0,6.346478,0,0,9.967326,0,0,0 +5,0,0,6.346478,0,0,9.967326,0,0,0 +3,0,1,5.703783,5.755076,0,3.4,1,0,0 +3,0,1,5.703783,5.755076,0,3.4,1,0,0 +0,0,1,5.703783,5.755076,0,3.4,1,0,0 +0,0,1,5.703783,5.755076,0,3.4,1,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +5,0,1,5.703783,5.755076,0,10.3,1,0,0 +5,0,1,5.703783,5.755076,0,10.3,1,0,0 +0,0,1,5.703783,5.755076,0,10.3,1,0,0 +3,0,1,5.703783,5.755076,0,10.3,1,0,0 +5,0,1,5.703783,5.755076,0,10.3,1,0,0 +4,0,0,0,0,0,0,1,0,0 +5,0,0,0,0,0,0,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +5,0,0,0,0,0,3.4,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +7,0,0,5.681128,0,1,27.6,1,0,0 +2,0,0,5.681128,0,1,27.6,1,0,0 +0,0,0,5.676206,0,0,9.967326,0,0,0 +1,0,0,5.676206,0,0,9.967326,0,0,0 +1,0,0,5.676206,0,0,9.967326,0,0,0 +4,0,0,5.676206,0,0,9.967326,0,0,0 +1,0,0,5.676206,0,0,9.967326,0,0,0 +1,0,0,5.676206,0,0,9.967326,0,0,0 +2,0,0,5.676206,0,0,13.8,0,0,0 +1,0,0,5.676206,0,0,13.8,0,0,0 +4,0,0,5.676206,0,0,13.8,0,0,0 +0,0,0,5.676206,0,1,24.1,0,0,0 +0,0,0,5.676206,0,1,24.1,0,0,0 +3,0,0,5.676206,0,1,24.1,0,0,0 +1,0,0,5.676206,0,0,9.967326,0,0,0 +1,0,0,5.676206,0,0,9.967326,0,0,0 +4,0,0,5.676206,0,0,9.967326,0,0,0 +4,0,0,5.676206,0,0,3.4,0,0,0 +0,0,0,5.676206,0,0,3.4,0,0,0 +1,0,0,5.676206,0,0,3.4,0,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +5,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +5,0,0,0,0,1,37.9,0,1,0 +7,0,0,0,0,1,37.9,0,1,0 +1,0,0,0,0,1,37.9,0,1,0 +0,0,0,0,0,1,37.9,0,1,0 +2,0,0,0,0,1,37.9,0,1,0 +8,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +7,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +8,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +6,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +6,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +2,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,0,1,6.22543,6.160541,0,3.4,0,0,0 +1,0,1,6.22543,6.160541,0,3.4,0,0,0 +0,0,1,6.22543,6.160541,0,3.4,0,0,0 +0,0,1,6.22543,6.160541,0,9.967326,0,0,0 +0,0,1,6.22543,6.160541,0,9.967326,0,0,0 +0,0,1,6.22543,6.160541,0,9.967326,0,0,0 +0,0,1,6.22543,6.160541,0,9.967326,0,0,0 +1,0,1,6.22543,6.160541,0,9.967326,0,0,0 +1,0,1,6.22543,6.160541,0,9.967326,0,0,0 +4,0,1,6.22543,6.160541,0,9.967326,0,0,0 +3,0,1,6.22543,6.160541,0,9.967326,0,0,0 +4,0,1,6.22543,6.160541,0,9.967326,0,0,0 +8,0,1,6.22543,6.160541,0,6.9,0,0,0 +2,0,1,6.22543,6.160541,0,6.9,0,0,0 +0,0,1,6.22543,6.160541,0,6.9,0,0,0 +1,0,0,6.094202,0,0,9.967326,0,0,0 +3,0,0,6.094202,0,0,9.967326,0,0,0 +3,0,0,6.094202,0,0,9.967326,0,0,0 +0,0,0,6.094202,0,0,3.4,0,0,0 +0,0,0,6.094202,0,0,3.4,0,0,0 +0,0,0,6.094202,0,0,3.4,0,0,0 +2,0,0,6.094202,0,0,9.967326,0,0,0 +4,0,0,6.094202,0,0,9.967326,0,0,0 +2,0,0,6.094202,0,0,9.967326,0,0,0 +1,0,0,6.094202,0,0,10.3,0,0,0 +2,0,0,6.094202,0,0,10.3,0,0,0 +1,0,0,6.094202,0,0,10.3,0,0,0 +0,4.564348,0,6.882438,6.933731,0,24.1,0,0,0 +2,4.564348,0,6.882438,6.933731,0,24.1,0,0,0 +0,4.564348,0,6.882438,6.933731,0,24.1,0,0,0 +2,0,0,5.313501,0,0,17.2,1,0,0 +1,0,0,5.313501,0,0,17.2,1,0,0 +3,0,0,5.313501,0,0,17.2,1,0,0 +3,0,0,4.880982,0,0,0,1,0,0 +5,0,0,4.880982,0,0,0,1,0,0 +7,0,0,4.880982,0,0,0,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,1,0,0 +6,0,1,6.109248,6.160541,0,13.8,1,0,0 +3,0,1,6.109248,6.160541,0,13.8,1,0,0 +9,0,1,6.109248,6.160541,0,13.8,1,0,0 +7,0,1,6.109248,6.160541,0,9.967326,0,1,0 +12,0,1,6.109248,6.160541,0,9.967326,0,1,0 +11,0,1,6.109248,6.160541,0,9.967326,0,1,0 +10,0,1,6.109248,6.160541,0,9.967326,1,0,0 +4,0,1,6.109248,6.160541,0,9.967326,1,0,0 +6,0,1,6.109248,6.160541,0,9.967326,1,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,17.2,0,0,0 +2,0,0,0,0,0,17.2,0,0,0 +0,0,0,0,0,0,17.2,0,0,0 +3,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +0,3.258096,0,5.703783,7.090077,0,3.4,0,0,0 +0,3.258096,0,5.703783,7.090077,0,3.4,0,0,0 +1,3.258096,0,5.703783,7.090077,0,3.4,0,0,0 +1,3.258096,0,5.703783,7.090077,0,3.4,0,0,0 +1,3.258096,0,5.703783,7.090077,0,3.4,0,0,0 +2,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +0,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +0,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +2,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +0,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +1,3.258096,0,0,6.659294,0,9.967326,0,0,0 +2,3.258096,0,0,6.659294,0,9.967326,0,0,0 +0,3.258096,0,0,6.659294,0,9.967326,0,0,0 +2,3.258096,0,0,6.659294,0,3.4,0,0,0 +1,3.258096,0,0,6.659294,0,3.4,0,0,0 +2,3.258096,0,0,6.659294,0,3.4,0,0,0 +1,3.258096,0,6.098074,7.484369,0,3.4,0,0,0 +1,3.258096,0,6.098074,7.484369,0,3.4,0,0,0 +1,3.258096,0,6.098074,7.484369,0,3.4,0,0,0 +3,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +2,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +1,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +3,3.258096,0,6.620073,8.006368,0,20.7,0,0,0 +4,3.258096,0,6.620073,8.006368,0,20.7,0,0,0 +1,3.258096,0,6.620073,8.006368,0,20.7,0,0,0 +2,0,0,6.094202,0,0,9.967326,0,0,0 +3,0,0,6.094202,0,0,9.967326,0,0,0 +0,0,0,6.094202,0,0,9.967326,0,0,0 +4,0,0,6.094202,0,0,9.967326,1,0,0 +1,0,0,6.094202,0,0,9.967326,1,0,0 +3,0,0,6.094202,0,0,9.967326,1,0,0 +7,0,0,6.094202,0,0,10.3,1,0,0 +18,0,0,6.094202,0,0,10.3,1,0,0 +9,0,0,6.094202,0,0,10.3,1,0,0 +7,0,0,6.094202,0,0,20.7,1,0,0 +34,0,0,6.094202,0,0,20.7,1,0,0 +16,0,0,6.094202,0,0,20.7,1,0,0 +0,3.258096,0,6.2105,7.596794,0,13.8,0,0,0 +2,3.258096,0,6.2105,7.596794,0,13.8,0,0,0 +2,3.258096,0,6.2105,7.596794,0,13.8,0,0,0 +4,3.258096,0,6.2105,7.596794,0,9.967326,0,0,0 +2,3.258096,0,6.2105,7.596794,0,9.967326,0,0,0 +1,3.258096,0,6.2105,7.596794,0,9.967326,0,0,0 +11,3.258096,0,6.2105,7.596794,0,3.4,0,0,0 +3,3.258096,0,6.2105,7.596794,0,3.4,0,0,0 +0,3.258096,0,6.2105,7.596794,0,3.4,0,0,0 +4,3.258096,0,6.2105,7.596794,0,9.967326,0,0,0 +2,3.258096,0,6.2105,7.596794,0,9.967326,0,0,0 +2,3.258096,0,6.2105,7.596794,0,9.967326,0,0,0 +0,4.564348,0,5.398163,5.449456,0,9.967326,0,0,0 +0,4.564348,0,5.398163,5.449456,0,9.967326,0,0,0 +2,4.564348,0,5.398163,5.449456,0,3.4,0,0,0 +2,4.564348,0,5.398163,5.449456,0,3.4,0,0,0 +0,4.564348,0,5.398163,5.449456,0,3.4,0,0,0 +1,4.564348,0,5.398163,5.449456,1,24.1,1,0,0 +1,4.564348,0,5.398163,5.449456,1,24.1,1,0,0 +0,4.564348,0,5.398163,5.449456,1,24.1,1,0,0 +1,4.564348,0,5.398163,5.449456,0,9.967326,0,0,0 +0,4.564348,0,5.398163,5.449456,0,9.967326,0,0,0 +0,4.564348,0,5.398163,5.449456,0,9.967326,0,0,0 +2,4.564348,0,5.398163,5.449456,0,9.967326,0,0,0 +0,4.564348,0,5.398163,5.449456,0,9.967326,0,0,0 +2,4.564348,0,5.398163,5.449456,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,20.7,0,0,0 +2,0,1,6.109248,6.160541,0,20.7,0,0,0 +3,0,1,6.109248,6.160541,0,20.7,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +11,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +5,3.258096,0,6.620073,8.006368,0,20.7,0,0,0 +3,3.258096,0,6.620073,8.006368,0,20.7,0,0,0 +4,3.258096,0,6.620073,8.006368,0,20.7,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,0,1,6.823765,5.755076,0,13.8,0,0,0 +1,0,1,6.823765,5.755076,0,13.8,0,0,0 +7,0,1,6.823765,5.755076,0,13.8,0,0,0 +0,0,1,6.823765,5.755076,0,3.4,0,0,0 +0,0,1,6.823765,5.755076,0,3.4,0,0,0 +0,0,1,6.823765,5.755076,0,3.4,0,0,0 +8,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,1,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,1,13.8,0,0,0 +2,3.258096,0,6.620073,8.006368,1,13.8,0,0,0 +5,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.931826,0,6.639876,7.333023,0,13.8,1,0,0 +3,3.931826,0,6.639876,7.333023,0,13.8,1,0,0 +1,3.931826,0,6.639876,7.333023,0,13.8,1,0,0 +1,4.564348,0,6.533062,6.584355,1,17.2,0,0,0 +1,4.564348,0,6.533062,6.584355,1,17.2,0,0,0 +8,4.564348,0,6.533062,6.584355,1,17.2,0,0,0 +10,4.564348,0,6.533062,6.584355,1,17.2,0,0,0 +3,4.564348,0,6.533062,6.584355,1,17.2,0,0,0 +3,4.564348,0,6.533062,6.584355,1,20.7,1,0,0 +1,4.564348,0,6.533062,6.584355,1,20.7,1,0,0 +1,4.564348,0,6.533062,6.584355,1,20.7,1,0,0 +3,4.564348,0,6.533062,6.584355,1,20.7,1,0,0 +1,4.564348,0,6.533062,6.584355,1,20.7,1,0,0 +4,0,0,6.094202,0,0,6.9,0,0,0 +0,0,0,6.094202,0,0,6.9,0,0,0 +0,0,0,6.094202,0,0,6.9,0,0,0 +2,0,0,6.094202,0,0,27.6,0,0,0 +3,0,0,6.094202,0,0,27.6,0,0,0 +13,0,0,6.094202,0,0,27.6,0,0,0 +0,0,0,6.094202,0,0,6.9,0,0,0 +0,0,0,6.094202,0,0,6.9,0,0,0 +1,0,0,6.094202,0,0,6.9,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +28,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +3,0,1,6.109248,6.160541,0,10.3,0,0,0 +4,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +3,0,1,6.109248,6.160541,0,10.3,0,0,0 +6,0,1,6.109248,6.160541,0,17.2,1,0,0 +4,0,1,6.109248,6.160541,0,17.2,1,0,0 +4,0,1,6.109248,6.160541,0,17.2,1,0,0 +4,0,1,6.109248,6.160541,0,17.2,1,0,0 +4,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +5,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.3,1,0,0 +6,0,0,0,0,0,10.3,1,0,0 +6,0,1,5.703783,5.755076,0,17.2,0,0,0 +3,0,1,5.703783,5.755076,0,17.2,0,0,0 +0,0,1,5.703783,5.755076,0,17.2,0,0,0 +2,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +4,0,0,4.836282,0,1,17.2,1,0,0 +7,0,0,4.836282,0,1,17.2,1,0,0 +6,0,0,4.836282,0,1,17.2,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +6,0,0,0,0,0,9.967326,1,0,0 +11,0,0,0,0,0,6.9,1,0,0 +10,0,0,0,0,0,6.9,1,0,0 +10,0,0,0,0,0,6.9,1,0,0 +5,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,3.4,1,0,0 +2,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +6,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +10,0,0,0,0,0,9.967326,1,0,0 +6,0,0,0,0,0,9.967326,1,0,0 +10,0,0,0,0,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +4,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +6,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,3.4,0,0,0 +4,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +7,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,0,4.836282,0,1,10.3,0,0,0 +0,0,0,4.836282,0,1,10.3,0,0,0 +0,0,0,4.836282,0,1,10.3,0,0,0 +2,0,0,4.836282,0,1,10.3,0,0,0 +4,0,0,4.836282,0,1,10.3,0,0,0 +1,0,0,4.836282,0,0,13.8,0,0,0 +0,0,0,4.836282,0,0,13.8,0,0,0 +1,0,0,4.836282,0,0,13.8,0,0,0 +1,0,0,4.836282,0,0,13.8,0,0,0 +1,0,0,4.836282,0,0,13.8,0,0,0 +8,0,0,0,0,0,13.8,1,0,0 +6,0,0,0,0,0,13.8,1,0,0 +17,0,0,0,0,0,13.8,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +4,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +3,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +8,3.931826,0,6.907755,7.600903,1,10.3,1,0,0 +4,3.931826,0,6.907755,7.600903,1,10.3,1,0,0 +4,3.931826,0,6.907755,7.600903,1,10.3,1,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +1,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,1,6.472594,5.755076,0,10.3,0,0,0 +0,0,1,6.472594,5.755076,0,10.3,0,0,0 +2,0,1,6.472594,5.755076,0,10.3,0,0,0 +4,0,1,6.472594,5.755076,0,0,0,0,0 +4,0,1,6.472594,5.755076,0,0,0,0,0 +2,0,1,6.472594,5.755076,0,0,0,0,0 +1,0,1,5.075674,5.061929,0,6.9,0,0,0 +7,0,1,5.075674,5.061929,0,6.9,0,0,0 +6,0,1,5.075674,5.061929,0,6.9,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,1,6.9,0,1,0 +1,0,0,0,0,1,6.9,0,1,0 +5,0,0,0,0,1,6.9,0,1,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,1,17.2,0,0,0 +2,0,1,6.109248,6.160541,1,17.2,0,0,0 +0,0,1,6.109248,6.160541,1,17.2,0,0,0 +3,0,1,6.109248,6.160541,1,17.2,0,0,0 +1,0,1,6.109248,6.160541,1,17.2,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +6,0,1,6.109248,6.160541,0,10.3,0,0,0 +5,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +3,0,1,6.109248,6.160541,0,10.3,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +8,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,0,0,0,0,24.1,1,0,0 +0,0,0,0,0,0,24.1,1,0,0 +1,0,0,0,0,0,24.1,1,0,0 +2,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +10,0,0,0,0,0,9.967326,0,0,0 +9,0,0,0,0,0,9.967326,0,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +4,0,0,5.676206,0,0,3.4,0,0,0 +3,0,0,5.676206,0,0,3.4,0,0,0 +6,0,0,5.676206,0,0,3.4,0,0,0 +6,0,0,5.676206,0,0,3.4,0,0,0 +5,0,0,5.676206,0,0,3.4,0,0,0 +2,0,0,5.676206,0,0,3.4,0,0,0 +0,0,0,5.676206,0,0,3.4,0,0,0 +5,0,0,5.676206,0,0,3.4,0,0,0 +3,0,0,5.676206,0,0,3.4,0,0,0 +7,0,0,5.676206,0,0,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +7,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +4,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +5,0,1,6.109248,6.160541,1,3.4,1,0,0 +2,0,1,6.109248,6.160541,1,3.4,1,0,0 +3,0,1,6.109248,6.160541,1,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +4,0,1,5.998539,5.755076,0,3.4,1,0,0 +0,0,1,5.998539,5.755076,0,3.4,1,0,0 +1,0,1,5.998539,5.755076,0,3.4,1,0,0 +1,0,1,5.998539,5.755076,0,10.3,0,0,0 +1,0,1,5.998539,5.755076,0,10.3,0,0,0 +0,0,1,5.998539,5.755076,0,10.3,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +1,0,1,5.676206,5.061929,0,10.3,0,0,0 +3,0,1,5.676206,5.061929,0,10.3,0,0,0 +6,0,1,5.676206,5.061929,0,10.3,0,0,0 +3,4.564348,0,0,5.061929,0,0,0,0,0 +1,4.564348,0,0,5.061929,0,0,0,0,0 +0,4.564348,0,0,5.061929,0,0,0,0,0 +2,4.564348,0,5.347107,5.398401,0,6.9,0,0,0 +2,4.564348,0,5.347107,5.398401,0,6.9,0,0,0 +7,4.564348,0,5.347107,5.398401,0,6.9,0,0,0 +0,4.564348,0,6.882438,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.882438,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.882438,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.882438,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.882438,6.959049,0,6.9,0,0,0 +3,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +3,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.882438,6.959049,0,10.3,1,0,0 +7,4.564348,0,6.882438,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.882438,6.959049,0,10.3,1,0,0 +2,4.564348,0,6.882438,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.882438,6.959049,0,10.3,1,0,0 +1,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.882438,6.959049,0,9.967326,0,0,0 +3,0,0,5.918894,0,0,13.8,0,0,0 +0,0,0,5.918894,0,0,13.8,0,0,0 +0,0,0,5.918894,0,0,13.8,0,0,0 +16,0,0,5.918894,0,0,9.967326,0,0,0 +40,0,0,5.918894,0,0,9.967326,0,0,0 +19,0,0,5.918894,0,0,9.967326,0,0,0 +7,0,0,5.918894,0,0,17.2,0,0,1 +5,0,0,5.918894,0,0,17.2,0,0,1 +0,0,0,5.918894,0,0,17.2,0,0,1 +1,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +7,0,1,5.703783,5.755076,0,3.4,0,0,0 +3,0,1,5.703783,5.755076,0,6.9,0,0,0 +1,0,1,5.703783,5.755076,0,6.9,0,0,0 +1,0,1,5.703783,5.755076,0,6.9,0,0,0 +3,0,0,5.824229,0,1,6.9,0,0,0 +1,0,0,5.824229,0,1,6.9,0,0,0 +2,0,0,5.824229,0,1,6.9,0,0,0 +1,0,0,5.824229,0,0,9.967326,0,0,0 +1,0,0,5.824229,0,0,9.967326,0,0,0 +2,0,0,5.824229,0,0,9.967326,0,0,0 +3,0,0,5.824229,0,0,3.4,0,0,0 +1,0,0,5.824229,0,0,3.4,0,0,0 +0,0,0,5.824229,0,0,3.4,0,0,0 +2,0,0,5.824229,0,0,9.967326,0,0,0 +1,0,0,5.824229,0,0,9.967326,0,0,0 +3,0,0,5.824229,0,0,9.967326,0,0,0 +1,0,0,5.532757,0,0,10.3,1,0,0 +2,0,0,5.532757,0,0,10.3,1,0,0 +1,0,0,5.532757,0,0,10.3,1,0,0 +2,0,0,5.532757,0,0,10.3,1,0,0 +3,0,0,5.532757,0,0,10.3,1,0,0 +2,0,1,5.010635,5.061929,0,10.3,1,0,0 +1,0,1,5.010635,5.061929,0,10.3,1,0,0 +0,0,1,5.010635,5.061929,0,10.3,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +1,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +3,0,1,5.703783,5.755076,0,10.3,0,0,0 +0,0,1,5.703783,5.755076,0,10.3,0,0,0 +4,0,1,5.703783,5.755076,0,10.3,0,0,0 +12,0,1,5.703783,5.755076,0,6.9,1,0,0 +5,0,1,5.703783,5.755076,0,6.9,1,0,0 +0,4.564348,0,6.427944,6.479237,0,6.9,0,0,0 +2,4.564348,0,6.427944,6.479237,0,9.967326,0,0,0 +1,4.564348,0,6.427944,6.479237,0,9.967326,0,0,0 +2,4.564348,0,6.427944,6.479237,0,9.967326,0,0,0 +0,4.564348,0,6.427944,6.479237,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,1,6.9,1,0,0 +8,0,1,6.109248,6.160541,1,6.9,1,0,0 +16,0,1,6.109248,6.160541,1,6.9,1,0,0 +16,0,1,6.109248,6.160541,1,6.9,1,0,0 +4,0,1,6.109248,6.160541,1,6.9,1,0,0 +1,0,1,6.109248,6.160541,1,9.967326,0,0,0 +2,0,1,6.109248,6.160541,1,9.967326,0,0,0 +0,0,1,6.109248,6.160541,1,9.967326,0,0,0 +1,0,1,6.109248,6.160541,1,9.967326,0,0,0 +1,0,1,6.109248,6.160541,1,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,20.7,0,1,0 +1,0,1,6.109248,6.160541,0,20.7,0,1,0 +1,0,1,6.109248,6.160541,0,20.7,0,1,0 +0,0,1,6.109248,6.160541,0,20.7,0,1,0 +1,0,1,6.109248,6.160541,0,20.7,0,1,0 +4,0,1,6.109248,6.160541,0,9.967326,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +4,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,1,0,0 +18,0,1,0,5.755076,1,41.4,0,1,0 +11,0,1,0,5.755076,1,41.4,0,1,0 +3,0,1,0,5.755076,1,41.4,0,1,0 +2,0,1,0,5.755076,1,41.4,0,1,0 +1,0,1,0,5.755076,0,13.8,0,0,0 +1,0,1,0,5.755076,0,13.8,0,0,0 +6,0,1,0,5.755076,0,13.8,0,0,0 +4,0,1,0,5.755076,0,13.8,0,0,0 +1,0,1,0,5.755076,0,13.8,0,0,0 +3,0,1,7.122189,5.755076,0,17.2,1,0,0 +2,0,1,7.122189,5.755076,0,17.2,1,0,0 +2,0,1,7.122189,5.755076,0,17.2,1,0,0 +2,0,1,7.122189,5.755076,0,17.2,1,0,0 +0,0,1,7.122189,5.755076,0,17.2,1,0,0 +0,0,1,7.122189,5.755076,0,17.2,1,0,0 +3,3.258096,0,6.401469,7.787764,.1572505,9.967326,1,0,0 +1,3.258096,0,6.401469,7.787764,.1572505,9.967326,1,0,0 +3,3.258096,0,6.401469,7.787764,.1572505,9.967326,1,0,0 +4,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +4,3.258096,0,6.586172,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.586172,8.006368,0,3.4,1,0,0 +4,3.258096,0,6.586172,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.586172,8.006368,0,20.7,1,0,0 +4,3.258096,0,6.586172,8.006368,0,20.7,1,0,0 +4,3.258096,0,6.586172,8.006368,0,20.7,1,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,1,0,0 +7,0,1,6.109248,6.160541,1,24.1,1,0,0 +8,0,1,6.109248,6.160541,1,24.1,1,0,0 +5,0,1,6.109248,6.160541,1,24.1,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +7,0,1,6.109248,6.160541,0,9.967326,0,0,0 +5,0,1,6.109248,6.160541,0,3.4,1,0,0 +6,0,1,6.109248,6.160541,0,3.4,1,0,0 +4,0,1,6.109248,6.160541,0,3.4,1,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,1,0 +5,0,1,6.109248,6.160541,0,9.967326,0,1,0 +3,0,1,6.109248,6.160541,0,9.967326,0,1,0 +5,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +5,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,27.6,0,0,1 +9,0,1,6.109248,6.160541,0,27.6,0,0,1 +4,0,1,6.109248,6.160541,0,27.6,0,0,1 +4,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +2,0,0,5.228324,0,0,6.9,1,0,0 +1,0,0,5.228324,0,0,6.9,1,0,0 +5,0,0,5.228324,0,0,6.9,1,0,0 +3,0,0,5.228324,0,0,6.9,1,0,0 +3,0,0,5.228324,0,0,6.9,1,0,0 +3,0,0,5.228324,0,0,6.9,1,0,0 +1,0,0,5.228324,0,0,3.4,0,0,0 +2,0,0,5.228324,0,0,3.4,0,0,0 +1,0,0,5.228324,0,0,3.4,0,0,0 +2,0,0,5.228324,0,0,9.967326,0,0,0 +2,0,0,5.228324,0,0,9.967326,0,0,0 +2,0,0,5.228324,0,0,9.967326,0,0,0 +0,0,0,5.228324,0,0,3.4,1,0,0 +2,0,0,5.228324,0,0,3.4,1,0,0 +1,0,0,5.228324,0,0,3.4,1,0,0 +0,0,0,5.228324,0,0,9.967326,0,0,0 +0,0,0,5.228324,0,0,9.967326,0,0,0 +2,0,0,5.228324,0,0,9.967326,0,0,0 +4,3.258096,0,6.620073,8.006368,1,27.6,1,0,0 +3,3.258096,0,6.620073,8.006368,1,27.6,1,0,0 +2,3.258096,0,6.620073,8.006368,1,27.6,1,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +7,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,1,20.7,0,0,0 +0,4.564348,0,6.907755,6.959049,1,20.7,0,0,0 +0,4.564348,0,6.907755,6.959049,1,20.7,0,0,0 +1,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +5,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,13.8,1,0,0 +2,0,0,0,0,0,13.8,1,0,0 +2,0,0,0,0,0,13.8,1,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +0,3.258096,0,5.010635,6.39693,0,9.967326,0,0,0 +9,3.258096,0,5.010635,6.39693,0,9.967326,0,0,0 +1,3.258096,0,5.010635,6.39693,0,9.967326,0,0,0 +1,3.258096,0,5.010635,6.39693,0,10.3,1,0,0 +2,3.258096,0,5.010635,6.39693,0,10.3,1,0,0 +6,3.258096,0,5.010635,6.39693,0,10.3,1,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +5,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +7,3.258096,0,5.68358,7.069874,1,13.8,1,0,0 +2,3.258096,0,5.68358,7.069874,1,13.8,1,0,0 +0,3.258096,0,5.68358,7.069874,1,13.8,1,0,0 +12,3.258096,0,5.68358,7.069874,1,13.8,1,0,0 +11,3.258096,0,5.68358,7.069874,1,13.8,1,0,0 +2,3.258096,0,5.68358,7.069874,0,17.2,0,0,0 +9,3.258096,0,5.68358,7.069874,0,17.2,0,0,0 +1,3.258096,0,5.68358,7.069874,0,17.2,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +0,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +2,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +5,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +7,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +4,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +0,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +2,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +0,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +3,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +0,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +0,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +3,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +1,3.258096,0,5.68358,7.069874,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +4,4.564348,0,6.907755,6.959049,1,3.4,1,0,0 +5,4.564348,0,6.907755,6.959049,1,3.4,1,0,0 +3,4.564348,0,6.907755,6.959049,1,3.4,1,0,0 +5,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +5,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +4,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,0,1,5.676206,5.755076,0,9.967326,0,0,0 +2,0,1,5.676206,5.755076,0,9.967326,0,0,0 +5,0,1,5.676206,5.755076,0,9.967326,0,0,0 +6,0,1,5.676206,5.755076,0,13.8,0,0,0 +5,0,1,5.676206,5.755076,0,13.8,0,0,0 +0,0,1,5.676206,5.755076,0,13.8,0,0,0 +6,0,1,5.676206,5.755076,0,9.967326,0,0,0 +3,0,1,5.676206,5.755076,0,9.967326,0,0,0 +1,0,1,5.676206,5.755076,0,9.967326,0,0,0 +1,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +0,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +2,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +2,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +8,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +4,3.258096,0,6.619806,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.619806,8.006368,0,10.3,0,0,0 +2,3.258096,0,6.619806,8.006368,0,10.3,0,0,0 +7,3.258096,0,6.619806,8.006368,0,10.3,0,0,0 +1,3.258096,0,6.619806,8.006368,0,10.3,0,0,0 +2,3.258096,0,6.619806,8.006368,0,10.3,0,0,0 +1,3.258096,0,6.619806,8.006368,0,0,0,0,0 +3,3.258096,0,6.619806,8.006368,0,0,0,0,0 +3,3.258096,0,6.619806,8.006368,0,0,0,0,0 +0,3.258096,0,6.619806,8.006368,0,0,0,0,0 +2,3.258096,0,6.619806,8.006368,0,0,0,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +6,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,0,1,0,0 +4,0,0,0,0,0,0,1,0,0 +3,0,0,0,0,0,0,1,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +8,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,1,0,0,0,0 +1,3.258096,0,6.620073,8.006368,1,0,0,0,0 +5,3.258096,0,6.620073,8.006368,1,0,0,0,0 +5,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +6,0,0,3.401197,0,0,37.9,1,0,0 +3,0,0,3.401197,0,0,37.9,1,0,0 +0,0,0,3.401197,0,0,37.9,1,0,0 +3,0,0,3.401197,0,0,37.9,1,0,0 +5,0,0,3.401197,0,0,37.9,1,0,0 +3,0,0,3.401197,0,0,9.967326,0,0,0 +4,0,0,3.401197,0,0,9.967326,0,0,0 +0,0,0,3.401197,0,0,9.967326,0,0,0 +1,0,0,3.401197,0,0,9.967326,0,0,0 +1,0,0,3.401197,0,0,9.967326,0,0,0 +1,0,0,3.401197,0,0,9.967326,0,0,0 +0,0,0,3.401197,0,0,9.967326,0,0,0 +0,0,0,3.401197,0,0,9.967326,0,0,0 +1,0,0,3.401197,0,0,9.967326,0,0,0 +1,0,0,3.401197,0,0,9.967326,0,0,0 +1,0,0,3.401197,0,0,0,0,0,0 +1,0,0,3.401197,0,0,0,0,0,0 +6,0,0,3.401197,0,0,6.9,1,0,0 +1,0,0,3.401197,0,0,6.9,1,0,0 +1,0,0,3.401197,0,0,6.9,1,0,0 +0,0,0,3.401197,0,0,6.9,1,0,0 +4,0,0,3.401197,0,0,6.9,1,0,0 +1,0,0,5.852202,0,0,20.7,1,0,0 +1,0,0,5.852202,0,0,20.7,1,0,0 +4,0,0,5.852202,0,0,20.7,1,0,0 +3,0,0,5.852202,0,0,20.7,1,0,0 +0,0,0,5.852202,0,0,20.7,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +2,0,0,5.321057,0,0,9.967326,0,0,0 +2,0,0,5.321057,0,0,9.967326,0,0,0 +1,0,0,5.321057,0,0,9.967326,0,0,0 +3,0,0,5.321057,0,0,9.967326,0,0,0 +3,0,0,5.321057,0,0,9.967326,0,0,0 +3,0,0,5.321057,0,0,9.967326,0,0,0 +4,0,0,5.321057,0,0,3.4,0,0,0 +0,0,0,5.321057,0,0,3.4,0,0,0 +7,0,0,5.321057,0,0,3.4,0,0,0 +3,0,0,5.321057,0,0,3.4,0,0,0 +1,0,0,5.321057,0,0,3.4,0,0,0 +2,0,0,5.321057,0,0,3.4,0,0,0 +3,0,1,5.703783,5.755076,0,9.967326,1,0,0 +5,0,1,5.703783,5.755076,0,9.967326,1,0,0 +8,0,1,5.703783,5.755076,0,9.967326,1,0,0 +1,0,1,5.703783,5.755076,0,17.2,0,0,0 +2,0,1,5.703783,5.755076,0,17.2,0,0,0 +0,0,1,5.703783,5.755076,0,17.2,0,0,0 +4,4.564348,0,5.774551,5.825845,0,9.967326,0,0,1 +7,4.564348,0,5.774551,5.825845,0,9.967326,0,0,1 +5,4.564348,0,5.774551,5.825845,0,9.967326,0,0,1 +0,4.564348,0,5.774551,5.825845,0,10.3,0,0,0 +4,4.564348,0,5.774551,5.825845,0,10.3,0,0,0 +4,4.564348,0,5.774551,5.825845,0,10.3,0,0,0 +1,4.564348,0,5.774551,5.825845,0,9.967326,1,0,0 +3,4.564348,0,5.774551,5.825845,0,9.967326,1,0,0 +2,4.564348,0,5.774551,5.825845,0,9.967326,1,0,0 +3,0,0,0,0,1,9.967326,0,0,0 +8,0,0,0,0,1,9.967326,0,0,0 +4,0,0,0,0,1,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,31,1,0,0 +3,0,0,0,0,0,31,1,0,0 +3,0,0,0,0,0,31,1,0,0 +7,0,0,0,0,0,9.967326,0,0,0 +8,0,0,0,0,0,9.967326,0,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +7,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,1,24.1,0,1,0 +7,0,0,0,0,1,24.1,0,1,0 +30,0,0,0,0,1,24.1,0,1,0 +2,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +4,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +2,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +3,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +9,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +2,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +4,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +2,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +1,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +1,3.258096,0,6.26957,7.702105,0,9.967326,1,0,0 +1,3.258096,0,6.26957,7.702105,1,13.8,1,0,0 +2,3.258096,0,6.26957,7.702105,1,13.8,1,0,0 +6,3.258096,0,6.26957,7.702105,1,13.8,1,0,0 +1,3.258096,0,6.26957,7.702105,1,13.8,1,0,0 +5,3.258096,0,6.26957,7.702105,1,13.8,1,0,0 +0,3.258096,0,6.26957,7.702105,0,0,1,0,0 +0,3.258096,0,6.26957,7.702105,0,0,1,0,0 +0,3.258096,0,6.26957,7.702105,0,0,1,0,0 +0,3.258096,0,6.26957,7.702105,0,0,1,0,0 +0,3.258096,0,6.26957,7.702105,0,0,1,0,0 +16,4.564348,0,6.907755,6.959049,1,24.1,0,1,0 +5,4.564348,0,6.907755,6.959049,1,24.1,0,1,0 +9,4.564348,0,6.907755,6.959049,1,24.1,0,1,0 +1,4.564348,0,6.907755,6.959049,0,37.9,0,1,0 +6,4.564348,0,6.907755,6.959049,0,37.9,0,1,0 +1,4.564348,0,6.907755,6.959049,0,37.9,0,1,0 +4,3.258096,0,6.620073,8.006368,0,0,0,0,0 +2,3.258096,0,6.620073,8.006368,0,0,0,0,0 +1,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,0,0,5.480639,0,0,6.9,0,0,0 +0,0,0,5.480639,0,0,6.9,0,0,0 +0,0,0,5.480639,0,0,6.9,0,0,0 +3,0,0,5.480639,0,0,3.4,0,0,0 +1,0,0,5.480639,0,0,3.4,0,0,0 +9,0,0,5.480639,0,0,3.4,0,0,0 +2,0,0,5.480639,0,0,13.8,0,0,0 +0,0,0,5.480639,0,0,13.8,0,0,0 +1,0,0,5.480639,0,0,13.8,0,0,0 +0,0,0,5.480639,0,0,9.967326,0,0,0 +0,0,0,5.480639,0,0,9.967326,0,0,0 +1,0,0,5.480639,0,0,9.967326,0,0,0 +2,0,0,5.480639,0,0,6.9,0,0,0 +1,0,0,5.480639,0,0,6.9,0,0,0 +0,0,0,5.480639,0,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,24.1,0,0,0 +3,3.258096,0,6.620073,8.006368,0,24.1,0,0,0 +0,3.258096,0,6.620073,8.006368,0,24.1,0,0,0 +3,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +2,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +2,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +4,0,1,6.109248,6.160541,0,24.1,0,0,0 +1,0,1,6.109248,6.160541,0,24.1,0,0,0 +1,0,1,6.109248,6.160541,0,24.1,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,20.7,1,0,0 +2,0,1,6.109248,6.160541,0,20.7,1,0,0 +8,0,1,6.109248,6.160541,0,20.7,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,1,13.8,1,0,0 +3,0,1,6.109248,6.160541,1,13.8,1,0,0 +2,0,1,6.109248,6.160541,1,13.8,1,0,0 +0,0,1,6.109248,6.160541,1,13.8,1,0,0 +0,0,1,6.109248,6.160541,1,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +2,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,1,9.967326,0,1,0 +2,0,1,6.109248,6.160541,1,9.967326,0,1,0 +0,0,1,6.109248,6.160541,1,9.967326,0,1,0 +3,0,1,6.109248,6.160541,1,9.967326,0,1,0 +1,0,1,6.109248,6.160541,1,9.967326,0,1,0 +2,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,0,1,0,0 +5,0,0,0,0,0,0,1,0,0 +3,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +4,0,0,0,0,0,13.8,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +19,0,0,0,0,0,24.1,1,0,0 +14,0,0,0,0,0,24.1,1,0,0 +4,0,0,0,0,0,24.1,1,0,0 +8,0,0,0,0,0,24.1,1,0,0 +6,0,0,0,0,0,24.1,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +3,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +4,3.258096,0,5.858676,7.24497,1,3.4,0,0,0 +5,3.258096,0,5.858676,7.24497,1,3.4,0,0,0 +4,3.258096,0,5.858676,7.24497,1,3.4,0,0,0 +0,3.931826,0,6.907935,7.600903,0,13.8,0,0,0 +3,3.931826,0,6.907935,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907935,7.600903,0,13.8,0,0,0 +4,3.931826,0,6.907935,7.600903,0,13.8,0,0,0 +2,3.931826,0,6.907935,7.600903,0,13.8,0,0,0 +3,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +6,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +4,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +6,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +6,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907935,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907935,7.600903,0,3.4,0,0,0 +5,3.931826,0,6.907935,7.600903,0,3.4,0,0,0 +2,3.931826,0,6.907935,7.600903,0,3.4,0,0,0 +5,3.931826,0,6.907935,7.600903,0,3.4,0,0,0 +3,3.931826,0,6.907935,7.600903,0,3.4,0,0,0 +3,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +2,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +2,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +4,3.258096,0,5.294309,7.156956,0,27.6,1,0,0 +2,3.258096,0,5.294309,7.156956,0,27.6,1,0,0 +3,3.258096,0,5.294309,7.156956,0,27.6,1,0,0 +3,3.258096,0,5.294309,7.156956,0,10.3,0,0,0 +3,3.258096,0,5.294309,7.156956,0,10.3,0,0,0 +5,3.258096,0,5.294309,7.156956,0,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +6,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +2,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +13,0,0,5.989262,0,1,13.8,1,0,0 +5,0,0,5.989262,0,1,13.8,1,0,0 +2,0,0,5.989262,0,1,13.8,1,0,0 +4,0,0,5.989262,0,0,6.9,1,0,0 +0,0,0,5.989262,0,0,6.9,1,0,0 +2,0,0,5.989262,0,0,6.9,1,0,0 +10,0,0,0,0,1,17.2,1,0,0 +4,0,0,0,0,1,17.2,1,0,0 +1,0,0,0,0,1,17.2,1,0,0 +5,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +7,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,6.9,0,0,0 +13,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +6,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +2,4.564348,0,6.372978,6.424272,0,3.4,1,0,0 +1,4.564348,0,6.372978,6.424272,0,3.4,1,0,0 +0,4.564348,0,6.372978,6.424272,0,3.4,1,0,0 +1,4.564348,0,6.372978,6.424272,0,3.4,1,0,0 +1,4.564348,0,6.372978,6.424272,0,3.4,1,0,0 +2,4.564348,0,6.372978,6.424272,0,17.2,1,0,0 +2,4.564348,0,6.372978,6.424272,0,17.2,1,0,0 +1,4.564348,0,6.372978,6.424272,0,17.2,1,0,0 +1,4.564348,0,6.372978,6.424272,0,17.2,1,0,0 +1,4.564348,0,6.372978,6.424272,0,17.2,1,0,0 +3,4.564348,0,6.372978,6.424272,0,9.967326,0,0,0 +2,4.564348,0,6.372978,6.424272,0,9.967326,0,0,0 +3,4.564348,0,6.372978,6.424272,0,9.967326,0,0,0 +4,4.564348,0,6.372978,6.424272,0,9.967326,0,0,0 +2,4.564348,0,6.372978,6.424272,0,9.967326,0,0,0 +0,3.931826,0,5.518898,5.442418,0,6.9,0,0,0 +0,3.931826,0,5.518898,5.442418,0,6.9,0,0,0 +1,3.931826,0,5.518898,5.442418,0,6.9,0,0,0 +2,0,1,0,5.061929,0,20.7,1,0,0 +3,0,1,0,5.061929,0,20.7,1,0,0 +0,0,1,0,5.061929,0,20.7,1,0,0 +3,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +8,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +4,0,0,0,0,0,9.967326,1,0,0 +4,0,0,0,0,1,24.1,1,0,0 +3,0,0,0,0,1,24.1,1,0,0 +7,0,0,0,0,1,24.1,1,0,0 +4,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +8,0,0,0,0,0,3.4,1,0,0 +2,4.564348,0,6.836635,6.887928,0,27.6,1,0,0 +0,4.564348,0,6.836635,6.887928,0,27.6,1,0,0 +4,4.564348,0,6.836635,6.887928,0,6.9,1,0,0 +3,4.564348,0,6.836635,6.887928,0,6.9,1,0,0 +0,4.564348,0,6.802395,6.853688,0,10.3,0,0,0 +1,4.564348,0,6.802395,6.853688,0,10.3,0,0,0 +0,4.564348,0,6.802395,6.853688,0,10.3,0,0,0 +0,4.564348,0,6.802395,6.853688,0,10.3,0,0,0 +0,4.564348,0,6.802395,6.853688,0,10.3,0,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +5,0,1,6.109248,6.160541,0,6.9,0,0,0 +5,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,4.564348,0,6.365267,6.41656,0,9.967326,0,1,0 +1,4.564348,0,6.365267,6.41656,0,9.967326,0,1,0 +0,4.564348,0,6.365267,6.41656,0,9.967326,0,1,0 +0,4.564348,0,6.365267,6.41656,0,3.4,1,0,0 +0,4.564348,0,6.365267,6.41656,0,3.4,1,0,0 +1,4.564348,0,6.365267,6.41656,0,3.4,1,0,0 +0,4.564348,0,6.365267,6.41656,0,9.967326,1,0,0 +0,4.564348,0,6.365267,6.41656,0,9.967326,1,0,0 +0,4.564348,0,6.365267,6.41656,0,9.967326,1,0,0 +2,4.564348,0,6.365267,6.41656,0,3.4,0,0,0 +0,4.564348,0,6.365267,6.41656,0,3.4,0,0,0 +0,4.564348,0,6.365267,6.41656,0,3.4,0,0,0 +4,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +3,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +4,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +6,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +6,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +4,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +4,3.258096,0,0,6.877296,0,0,0,0,0 +9,3.258096,0,0,6.877296,0,0,0,0,0 +8,3.258096,0,0,6.877296,0,0,0,0,0 +1,0,0,5.154216,0,0,3.4,0,0,0 +0,0,0,5.154216,0,0,3.4,0,0,0 +2,0,0,5.154216,0,0,3.4,0,0,0 +0,0,0,5.154216,0,0,3.4,0,0,0 +0,0,0,5.154216,0,0,3.4,0,0,0 +0,0,0,5.154216,0,0,3.4,0,0,0 +5,0,0,5.154216,0,0,3.4,0,0,0 +4,0,0,5.154216,0,0,3.4,0,0,0 +2,0,0,5.154216,0,0,6.9,0,0,0 +0,0,0,5.154216,0,0,6.9,0,0,0 +0,0,0,5.154216,0,0,9.967326,0,0,0 +0,0,0,5.154216,0,0,9.967326,0,0,0 +1,0,0,5.154216,0,0,9.967326,0,0,0 +2,3.258096,0,6.586172,8.006368,0,10.3,0,0,0 +10,3.258096,0,6.586172,8.006368,0,10.3,0,0,0 +1,3.258096,0,6.586172,8.006368,0,10.3,0,0,0 +3,3.258096,0,6.586172,8.006368,0,13.8,1,0,0 +0,3.258096,0,6.586172,8.006368,0,13.8,1,0,0 +7,0,1,6.823765,6.160541,0,9.967326,0,0,0 +3,0,1,6.823765,6.160541,0,9.967326,0,0,0 +3,0,1,6.823765,6.160541,0,9.967326,0,0,0 +4,0,1,6.823765,6.160541,1,24.1,1,0,0 +7,0,1,6.823765,6.160541,1,24.1,1,0,0 +4,0,1,6.823765,6.160541,1,24.1,1,0,0 +2,0,1,6.823765,6.160541,0,13.8,0,0,0 +1,0,1,6.823765,6.160541,0,13.8,0,0,0 +0,0,1,6.823765,6.160541,0,13.8,0,0,0 +2,0,0,6.218202,0,0,10.3,0,0,0 +0,0,0,6.218202,0,0,10.3,0,0,0 +1,0,0,6.218202,0,0,10.3,0,0,0 +3,0,0,6.218202,0,0,6.9,1,0,0 +5,0,0,6.218202,0,0,6.9,1,0,0 +0,0,0,6.218202,0,0,6.9,1,0,0 +2,3.931826,0,0,7.600903,0,9.967326,1,0,0 +1,3.931826,0,0,7.600903,0,9.967326,1,0,0 +4,3.931826,0,0,7.600903,0,9.967326,1,0,0 +1,3.931826,0,0,7.600903,0,9.967326,1,0,0 +0,3.931826,0,0,7.600903,0,9.967326,1,0,0 +1,3.931826,0,0,7.600903,0,9.967326,1,0,0 +1,3.931826,0,0,7.600903,0,9.967326,1,0,0 +1,3.931826,0,0,7.600903,0,9.967326,1,0,0 +2,3.931826,0,0,7.600903,0,9.967326,1,0,0 +1,3.931826,0,0,7.600903,0,9.967326,1,0,0 +14,3.931826,0,0,7.600903,0,10.3,0,1,0 +15,3.931826,0,0,7.600903,0,10.3,0,1,0 +16,3.931826,0,0,7.600903,0,10.3,0,1,0 +41,3.931826,0,0,7.600903,0,10.3,0,1,0 +7,3.931826,0,0,7.600903,0,6.9,1,0,0 +4,3.931826,0,0,7.600903,0,6.9,1,0,0 +0,3.931826,0,0,7.600903,0,6.9,1,0,0 +5,3.931826,0,0,7.600903,0,6.9,1,0,0 +4,3.931826,0,0,7.600903,0,6.9,1,0,0 +2,3.931826,0,0,7.600903,0,9.967326,1,0,0 +1,3.931826,0,0,7.600903,0,9.967326,1,0,0 +2,3.931826,0,0,7.600903,0,9.967326,1,0,0 +1,3.931826,0,0,7.600903,0,9.967326,1,0,0 +5,3.931826,0,0,7.600903,0,9.967326,1,0,0 +1,3.931826,0,0,7.600903,0,3.4,1,0,0 +2,3.931826,0,0,7.600903,0,3.4,1,0,0 +2,3.931826,0,0,7.600903,0,3.4,1,0,0 +0,3.931826,0,0,7.600903,0,3.4,1,0,0 +1,3.931826,0,0,7.600903,0,3.4,1,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +4,0,0,6.200184,0,0,9.967326,0,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +4,0,0,6.200184,0,0,9.967326,0,0,0 +1,0,0,6.200184,0,0,9.967326,0,0,0 +4,0,0,6.200184,0,0,9.967326,0,0,0 +3,0,0,6.200184,0,0,9.967326,0,0,0 +2,0,0,6.200184,0,0,9.967326,0,0,0 +3,0,0,6.200184,0,0,9.967326,0,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +1,0,0,6.200184,0,0,9.967326,0,0,0 +8,0,0,6.200184,0,0,9.967326,0,0,0 +2,0,0,6.200184,0,0,9.967326,0,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +4,0,0,6.200184,0,0,9.967326,0,0,0 +2,0,0,6.200184,0,0,10.3,0,1,0 +7,0,0,6.200184,0,0,10.3,0,1,0 +2,0,0,6.200184,0,0,10.3,0,1,0 +1,0,0,6.200184,0,0,10.3,0,1,0 +3,0,0,6.200184,0,0,10.3,0,1,0 +4,0,0,6.200184,0,1,6.9,0,0,0 +0,0,0,6.200184,0,1,6.9,0,0,0 +1,0,0,6.200184,0,1,6.9,0,0,0 +1,0,0,6.200184,0,1,6.9,0,0,0 +6,0,0,6.200184,0,1,6.9,0,0,0 +2,0,0,5.198276,0,0,6.9,0,0,0 +6,0,0,5.198276,0,0,6.9,0,0,0 +3,0,0,5.198276,0,0,6.9,0,0,0 +2,0,0,5.198276,0,0,6.9,0,0,0 +2,0,0,5.198276,0,0,6.9,0,0,0 +0,0,0,5.198276,0,0,13.8,0,0,0 +0,0,0,5.198276,0,0,13.8,0,0,0 +4,0,0,5.198276,0,0,13.8,0,0,0 +0,0,0,5.198276,0,0,13.8,0,0,0 +1,0,0,5.198276,0,0,13.8,0,0,0 +24,0,0,5.991664,0,0,9.967326,0,0,0 +6,0,0,5.991664,0,0,9.967326,0,0,0 +5,0,0,5.991664,0,0,9.967326,0,0,0 +5,0,0,5.991664,0,0,9.967326,0,0,0 +7,0,0,5.991664,0,0,9.967326,0,0,0 +0,0,0,5.991664,0,0,6.9,0,0,0 +0,0,0,5.991664,0,0,6.9,0,0,0 +0,0,0,5.991664,0,0,6.9,0,0,0 +1,0,0,5.991664,0,0,6.9,0,0,0 +0,0,0,5.991664,0,0,6.9,0,0,0 +3,0,0,5.991664,0,0,9.967326,0,0,0 +1,0,0,5.991664,0,0,9.967326,0,0,0 +5,0,0,5.991664,0,0,9.967326,0,0,0 +2,0,0,5.991664,0,0,9.967326,0,0,0 +1,0,0,5.991664,0,0,9.967326,0,0,0 +8,0,0,5.991664,0,0,27.6,0,0,0 +5,0,0,5.991664,0,0,27.6,0,0,0 +4,0,0,5.991664,0,0,27.6,0,0,0 +3,0,0,5.991664,0,0,27.6,0,0,0 +4,0,0,5.991664,0,0,27.6,0,0,0 +0,4.564348,0,0,3.592253,0,6.9,0,0,0 +0,4.564348,0,0,3.592253,0,6.9,0,0,0 +1,4.564348,0,0,3.592253,0,6.9,0,0,0 +0,3.931826,0,0,7.185387,0,0,0,0,0 +2,3.931826,0,0,7.185387,0,0,0,0,0 +0,3.931826,0,0,7.185387,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +6,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +2,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +2,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +2,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +2,0,0,5.527523,0,0,9.967326,0,0,0 +1,0,0,5.527523,0,0,9.967326,0,0,0 +1,0,0,5.527523,0,0,9.967326,0,0,0 +2,0,0,5.527523,0,0,6.9,1,0,0 +2,0,0,5.527523,0,0,6.9,1,0,0 +2,0,0,5.527523,0,0,6.9,1,0,0 +22,0,0,5.527523,0,0,9.967326,0,1,0 +25,0,0,5.527523,0,0,9.967326,0,1,0 +30,0,0,5.527523,0,0,9.967326,0,1,0 +2,0,0,5.527523,0,0,10.3,1,0,0 +0,0,0,5.527523,0,0,10.3,1,0,0 +4,0,0,5.527523,0,0,10.3,1,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.872128,6.948998,0,17.2,1,0,0 +2,4.564348,0,6.872128,6.948998,0,17.2,1,0,0 +3,4.564348,0,6.872128,6.948998,0,17.2,1,0,0 +2,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +2,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +2,3.931826,0,6.907755,7.600903,0,10.3,1,0,0 +6,3.931826,0,6.907755,7.600903,0,17.2,1,0,0 +4,3.931826,0,6.907755,7.600903,0,17.2,1,0,0 +4,3.931826,0,6.907755,7.600903,0,17.2,1,0,0 +0,3.258096,0,0,6.618472,0,10.3,1,0,0 +1,3.258096,0,0,6.618472,0,10.3,1,0,0 +7,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +2,0,0,5.11247,0,0,13.8,0,0,0 +6,0,0,5.11247,0,0,13.8,0,0,0 +3,0,0,5.11247,0,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,0,0,0,0 +3,3.931826,0,6.907755,7.600903,0,0,0,0,0 +4,3.931826,0,6.907755,7.600903,0,0,0,0,0 +8,3.931826,0,6.907755,7.600903,0,0,0,0,0 +6,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,0,1,5.703783,5.755076,0,17.2,0,0,0 +0,0,1,5.703783,5.755076,0,17.2,0,0,0 +0,0,1,5.703783,5.755076,0,17.2,0,0,0 +7,0,1,5.703783,5.755076,0,9.967326,0,0,0 +0,0,1,5.703783,5.755076,0,9.967326,0,0,0 +3,0,1,5.703783,5.755076,0,9.967326,0,0,0 +5,0,1,5.010635,5.061929,0,27.6,1,0,0 +0,0,1,5.010635,5.061929,0,27.6,1,0,0 +0,0,1,5.010635,5.061929,0,27.6,1,0,0 +1,0,1,5.010635,5.061929,0,27.6,1,0,0 +0,0,1,5.010635,5.061929,0,27.6,1,0,0 +7,0,0,0,0,1,6.9,1,0,0 +1,0,0,0,0,1,6.9,1,0,0 +4,0,0,0,0,1,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +5,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +4,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +5,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +1,0,0,4.836282,0,0,10.3,1,0,0 +1,0,0,4.836282,0,0,10.3,1,0,0 +2,0,0,4.836282,0,0,10.3,1,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +0,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +0,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +24,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +33,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +9,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +12,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +13,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +11,0,0,0,0,0,13.8,0,0,0 +5,0,0,0,0,0,13.8,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,17.2,1,0,0 +2,0,0,0,0,0,17.2,1,0,0 +6,0,0,0,0,0,17.2,1,0,0 +1,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +6,4.564348,0,0,4.573082,0,0,0,0,0 +3,4.564348,0,0,4.573082,0,0,0,0,0 +0,4.564348,0,0,4.573082,0,0,0,0,0 +1,4.564348,0,0,5.362033,0,10.3,1,0,0 +1,4.564348,0,0,5.362033,0,10.3,1,0,0 +2,4.564348,0,0,5.362033,0,10.3,1,0,0 +1,0,0,5.372497,0,0,3.4,0,0,0 +0,0,0,5.372497,0,0,3.4,0,0,0 +5,0,0,5.372497,0,0,3.4,0,0,0 +9,0,0,5.372497,0,0,9.967326,0,0,0 +1,0,0,5.372497,0,0,9.967326,0,0,0 +2,0,0,5.372497,0,0,9.967326,0,0,0 +2,0,0,5.372497,0,1,9.967326,0,0,0 +0,0,0,5.372497,0,1,9.967326,0,0,0 +3,0,0,5.372497,0,1,9.967326,0,0,0 +1,0,0,5.372497,0,0,13.8,0,0,0 +1,0,0,5.372497,0,0,13.8,0,0,0 +2,0,0,5.372497,0,0,13.8,0,0,0 +1,0,0,5.372497,0,0,9.967326,0,0,0 +0,0,0,5.372497,0,0,9.967326,0,0,0 +3,0,0,5.372497,0,0,9.967326,0,0,0 +2,0,1,6.200184,6.160541,0,9.967326,0,0,0 +1,0,1,6.200184,6.160541,0,9.967326,0,0,0 +6,0,1,6.200184,6.160541,0,9.967326,0,0,0 +0,0,1,6.200184,6.160541,0,3.4,0,0,0 +0,0,1,6.200184,6.160541,0,3.4,0,0,0 +0,0,1,6.200184,6.160541,0,3.4,0,0,0 +0,0,1,6.200184,6.160541,0,0,0,0,0 +0,0,1,6.200184,6.160541,0,0,0,0,0 +2,0,1,6.200184,6.160541,0,0,0,0,0 +0,0,1,6.200184,6.160541,0,9.967326,0,0,0 +0,0,1,6.200184,6.160541,0,9.967326,0,0,0 +1,0,1,6.200184,6.160541,0,9.967326,0,0,0 +5,0,0,0,0,1,6.9,0,0,0 +4,0,0,0,0,1,6.9,0,0,0 +7,0,0,0,0,1,6.9,0,0,0 +3,0,0,0,0,0,17.2,1,0,0 +3,0,0,0,0,0,17.2,1,0,0 +1,0,0,0,0,0,17.2,1,0,0 +3,3.258096,0,4.787492,6.173786,0,3.4,1,0,0 +7,3.258096,0,4.787492,6.173786,0,3.4,1,0,0 +10,3.258096,0,4.787492,6.173786,0,3.4,1,0,0 +23,3.258096,0,4.787492,6.173786,1,31,0,1,0 +18,3.258096,0,4.787492,6.173786,1,31,0,1,0 +4,3.258096,0,4.787492,6.173786,1,31,0,1,0 +7,3.258096,0,4.787492,6.173786,0,3.4,0,0,0 +5,3.258096,0,4.787492,6.173786,0,3.4,0,0,0 +1,3.258096,0,4.787492,6.173786,0,3.4,0,0,0 +0,3.258096,0,4.787492,6.173786,0,9.967326,0,0,0 +12,3.258096,0,4.787492,6.173786,0,9.967326,0,0,0 +3,3.258096,0,4.787492,6.173786,0,9.967326,0,0,0 +1,3.258096,0,4.787492,6.173786,0,13.8,0,0,0 +2,3.258096,0,4.787492,6.173786,0,13.8,0,0,0 +5,3.258096,0,4.787492,6.173786,0,13.8,0,0,0 +0,4.564348,0,6.141069,6.192362,0,13.8,1,0,0 +0,4.564348,0,6.141069,6.192362,0,13.8,1,0,0 +4,4.564348,0,6.141069,6.192362,0,13.8,1,0,0 +7,0,0,0,0,.1572505,9.967326,0,1,0 +2,0,0,0,0,.1572505,9.967326,0,1,0 +5,0,0,0,0,.1572505,9.967326,0,1,0 +4,0,0,0,0,.1572505,9.967326,1,0,0 +6,0,0,0,0,.1572505,9.967326,1,0,0 +3,0,0,0,0,.1572505,9.967326,1,0,0 +7,0,0,0,0,.1572505,9.967326,1,0,0 +1,0,0,0,0,.1572505,9.967326,1,0,0 +2,0,0,0,0,.1572505,9.967326,1,0,0 +8,0,0,0,0,.1572505,9.967326,1,0,0 +2,0,0,0,0,.1572505,9.967326,1,0,0 +0,0,0,0,0,.1572505,9.967326,1,0,0 +2,0,0,0,0,.1572505,9.967326,1,0,0 +2,0,0,0,0,.1572505,9.967326,1,0,0 +3,0,0,0,0,.1572505,9.967326,1,0,0 +2,0,1,3.73767,5.061929,0,6.9,1,0,0 +1,0,1,3.73767,5.061929,0,6.9,1,0,0 +1,0,1,3.73767,5.061929,0,6.9,1,0,0 +1,0,1,3.73767,5.061929,0,6.9,1,0,0 +5,0,1,3.73767,5.061929,0,6.9,1,0,0 +2,0,1,5.749202,5.755076,0,10.3,1,0,0 +1,0,1,5.749202,5.755076,0,10.3,1,0,0 +3,0,1,5.749202,5.755076,0,10.3,1,0,0 +0,0,1,5.749202,5.755076,0,10.3,1,0,0 +1,0,1,5.749202,5.755076,0,10.3,1,0,0 +1,0,1,5.881984,5.755076,0,9.967326,1,0,0 +2,0,1,5.881984,5.755076,0,9.967326,1,0,0 +1,0,1,5.881984,5.755076,0,9.967326,1,0,0 +1,0,1,5.881984,5.755076,0,9.967326,1,0,0 +0,0,1,5.881984,5.755076,0,17.2,1,0,0 +3,0,1,5.881984,5.755076,0,17.2,1,0,0 +2,0,1,5.881984,5.755076,0,17.2,1,0,0 +2,0,1,5.881984,5.755076,0,17.2,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +4,3.258096,0,6.476973,7.863267,0,9.967326,0,0,0 +2,3.258096,0,6.476973,7.863267,0,9.967326,0,0,0 +2,3.258096,0,6.476973,7.863267,0,9.967326,0,0,0 +1,3.258096,0,6.476973,7.863267,0,9.967326,0,0,0 +1,3.258096,0,6.476973,7.863267,0,9.967326,0,0,0 +1,3.258096,0,6.476973,7.863267,0,9.967326,0,0,0 +0,3.258096,0,6.476973,7.863267,0,6.9,0,0,0 +0,3.258096,0,6.476973,7.863267,0,6.9,0,0,0 +1,3.258096,0,6.476973,7.863267,0,6.9,0,0,0 +0,0,0,5.902633,0,0,17.2,0,0,0 +1,0,0,5.902633,0,0,17.2,0,0,0 +4,0,0,5.902633,0,0,17.2,0,0,0 +1,0,0,5.902633,0,0,9.967326,0,0,0 +0,0,0,5.902633,0,0,9.967326,0,0,0 +1,0,0,5.902633,0,0,9.967326,0,0,0 +1,0,0,5.902633,0,0,9.967326,0,0,0 +2,0,0,5.902633,0,0,9.967326,0,0,0 +1,0,0,5.902633,0,0,9.967326,0,0,0 +0,0,0,5.902633,0,0,6.9,0,0,0 +0,0,0,5.902633,0,0,6.9,0,0,0 +0,0,0,5.902633,0,0,6.9,0,0,0 +52,0,1,6.109248,6.160541,0,9.967326,0,0,0 +5,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +8,0,1,6.109248,6.160541,0,13.8,0,1,0 +2,0,1,6.109248,6.160541,0,13.8,0,1,0 +7,0,1,6.109248,6.160541,0,13.8,0,1,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +5,0,1,6.109248,6.160541,0,9.967326,1,0,0 +17,0,1,6.109248,6.160541,0,9.967326,0,0,0 +11,0,1,6.109248,6.160541,0,9.967326,0,0,0 +44,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,0,4.718499,0,0,6.9,1,0,0 +7,0,0,4.718499,0,0,6.9,1,0,0 +3,0,0,4.718499,0,0,6.9,1,0,0 +7,0,0,4.718499,0,0,20.7,1,0,0 +5,0,0,4.718499,0,0,20.7,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +10,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +3,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +4,0,1,6.109248,6.160541,0,6.9,1,0,0 +3,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,1,0,0 +4,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +2,4.564348,0,6.044199,6.095492,0,6.9,0,0,0 +4,4.564348,0,6.044199,6.095492,0,6.9,0,0,0 +3,4.564348,0,6.044199,6.095492,0,6.9,0,0,0 +3,4.564348,0,6.044199,6.095492,0,6.9,0,0,0 +2,4.564348,0,6.044199,6.095492,0,6.9,0,0,0 +7,4.564348,0,6.044199,6.095492,0,20.7,0,0,0 +10,4.564348,0,6.044199,6.095492,0,20.7,0,0,0 +2,4.564348,0,6.044199,6.095492,0,20.7,0,0,0 +1,4.564348,0,6.044199,6.095492,0,20.7,0,0,0 +4,4.564348,0,6.044199,6.095492,0,20.7,0,0,0 +2,4.564348,0,6.044199,6.095492,1,3.4,1,0,0 +6,4.564348,0,6.044199,6.095492,1,3.4,1,0,0 +2,4.564348,0,6.044199,6.095492,1,3.4,1,0,0 +2,4.564348,0,6.044199,6.095492,1,3.4,1,0,0 +0,4.564348,0,6.044199,6.095492,1,3.4,1,0,0 +8,4.564348,0,6.044199,6.095492,0,0,1,0,0 +4,4.564348,0,6.044199,6.095492,0,0,1,0,0 +2,4.564348,0,6.044199,6.095492,0,0,1,0,0 +19,4.564348,0,6.044199,6.095492,0,0,1,0,0 +8,4.564348,0,6.044199,6.095492,0,0,1,0,0 +5,4.564348,0,6.044199,6.095492,0,3.4,0,0,0 +5,4.564348,0,6.044199,6.095492,0,3.4,0,0,0 +5,4.564348,0,6.044199,6.095492,0,3.4,0,0,0 +12,4.564348,0,6.044199,6.095492,0,3.4,0,0,0 +2,4.564348,0,6.044199,6.095492,0,3.4,0,0,0 +6,4.564348,0,6.044199,6.095492,0,9.967326,0,0,0 +2,4.564348,0,6.044199,6.095492,0,9.967326,0,0,0 +6,4.564348,0,6.044199,6.095492,0,9.967326,0,0,0 +0,4.564348,0,6.044199,6.095492,0,9.967326,0,0,0 +7,4.564348,0,6.044199,6.095492,0,9.967326,0,0,0 +0,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +3,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +2,3.258096,0,6.586172,8.006368,1,10.3,1,0,0 +3,3.258096,0,6.586172,8.006368,1,10.3,1,0,0 +2,3.258096,0,6.586172,8.006368,1,10.3,1,0,0 +2,3.258096,0,6.371441,7.757735,0,10.3,1,0,0 +2,3.258096,0,6.371441,7.757735,0,10.3,1,0,0 +1,3.258096,0,6.371441,7.757735,0,10.3,1,0,0 +9,0,0,0,0,0,20.7,1,0,0 +11,0,0,0,0,0,20.7,1,0,0 +6,0,0,0,0,0,20.7,1,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +3,0,0,0,0,0,10.3,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +1,0,1,0,6.160541,0,9.967326,0,0,0 +1,0,1,0,6.160541,0,9.967326,0,0,0 +3,0,1,0,6.160541,0,9.967326,0,0,0 +5,0,1,0,6.160541,0,9.967326,0,0,0 +5,0,1,0,6.160541,0,9.967326,0,0,0 +2,0,1,0,6.160541,0,9.967326,0,0,0 +2,0,1,0,6.160541,0,0,0,0,0 +3,0,1,0,6.160541,0,0,0,0,0 +1,0,1,0,6.160541,0,0,0,0,0 +1,0,1,0,6.160541,0,3.4,0,0,0 +0,0,1,0,6.160541,0,3.4,0,0,0 +3,0,1,0,6.160541,0,3.4,0,0,0 +0,3.258096,0,6.497152,7.883446,0,0,0,0,0 +0,3.258096,0,6.497152,7.883446,0,0,0,0,0 +3,3.258096,0,6.497152,7.883446,0,0,0,0,0 +0,3.258096,0,6.497152,7.883446,0,6.9,1,0,0 +2,3.258096,0,6.497152,7.883446,0,6.9,1,0,0 +0,3.258096,0,6.497152,7.883446,0,6.9,1,0,0 +2,3.258096,0,6.497152,7.883446,0,9.967326,0,0,0 +3,3.258096,0,6.497152,7.883446,0,9.967326,0,0,0 +2,3.258096,0,6.497152,7.883446,0,9.967326,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +0,0,1,5.010635,5.061929,0,3.4,0,0,0 +1,0,1,5.010635,5.061929,0,3.4,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +7,3.931826,0,6.907755,7.600903,0,0,0,0,0 +1,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +7,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +3,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +2,3.258096,0,6.55108,7.937375,1,24.1,0,1,0 +1,3.258096,0,6.55108,7.937375,1,24.1,0,1,0 +2,3.258096,0,6.55108,7.937375,1,24.1,0,1,0 +8,3.258096,0,6.55108,7.937375,0,17.2,0,1,0 +3,3.258096,0,6.55108,7.937375,0,17.2,0,1,0 +6,3.258096,0,6.55108,7.937375,0,17.2,0,1,0 +2,3.258096,0,6.55108,7.937375,0,9.967326,0,0,0 +1,3.258096,0,6.55108,7.937375,0,9.967326,0,0,0 +3,3.258096,0,6.55108,7.937375,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,1,10.3,0,0,0 +0,3.931826,0,6.907755,7.600903,1,10.3,0,0,0 +0,3.931826,0,6.907755,7.600903,1,10.3,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,1,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +2,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +4,0,0,0,0,0,0,0,0,0 +5,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +21,0,0,0,0,1,13.8,0,0,0 +23,0,0,0,0,1,13.8,0,0,0 +15,0,0,0,0,1,13.8,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +0,4.564348,0,5.955423,5.911367,0,0,0,0,0 +0,4.564348,0,5.955423,5.911367,0,0,0,0,0 +0,4.564348,0,5.955423,5.911367,0,0,0,0,0 +2,4.564348,0,6.882438,6.959049,0,17.2,1,0,0 +0,4.564348,0,6.882438,6.959049,0,17.2,1,0,0 +4,4.564348,0,6.882438,6.959049,0,17.2,1,0,0 +0,4.564348,0,6.882438,6.959049,0,17.2,1,0,0 +5,4.564348,0,6.882438,6.959049,0,17.2,1,0,0 +5,4.564348,0,6.882438,6.959049,1,34.5,1,0,0 +4,4.564348,0,6.882438,6.959049,1,34.5,1,0,0 +5,4.564348,0,6.882438,6.959049,1,34.5,1,0,0 +4,4.564348,0,6.882438,6.959049,1,34.5,1,0,0 +11,4.564348,0,6.882438,6.959049,1,34.5,1,0,0 +1,4.564348,0,6.882438,6.959049,0,9.967326,1,0,0 +3,4.564348,0,6.882438,6.959049,0,9.967326,1,0,0 +4,4.564348,0,6.882438,6.959049,0,9.967326,1,0,0 +4,4.564348,0,6.882438,6.959049,0,9.967326,1,0,0 +1,4.564348,0,6.882438,6.959049,0,9.967326,1,0,0 +2,3.258096,0,6.620073,8.006368,1,9.967326,1,0,0 +5,3.258096,0,6.620073,8.006368,1,9.967326,1,0,0 +3,3.258096,0,6.620073,8.006368,1,9.967326,1,0,0 +1,3.258096,0,6.620073,8.006368,1,9.967326,1,0,0 +0,3.258096,0,6.620073,8.006368,1,9.967326,1,0,0 +2,3.258096,0,6.620073,8.006368,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,0,0,1,0,0 +2,3.258096,0,6.620073,8.006368,0,0,1,0,0 +2,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +1,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +1,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +1,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.842769,8.006368,0,13.8,1,0,0 +2,3.258096,0,6.842769,8.006368,0,13.8,1,0,0 +2,3.258096,0,6.842769,8.006368,0,13.8,1,0,0 +2,3.258096,0,6.842769,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.842769,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.842769,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.842769,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.842769,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.842769,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.842769,8.006368,0,0,0,0,0 +2,3.258096,0,6.842769,8.006368,0,0,0,0,0 +2,3.258096,0,6.842769,8.006368,0,0,0,0,0 +4,0,0,0,0,1,31,0,1,0 +2,0,0,0,0,1,31,0,1,0 +3,0,0,0,0,1,31,0,1,0 +6,0,0,0,0,1,20.7,0,1,0 +0,0,0,0,0,1,20.7,0,1,0 +2,0,0,0,0,1,20.7,0,1,0 +1,4.564348,0,6.907755,6.959049,1,13.8,0,0,0 +1,4.564348,0,6.907755,6.959049,1,13.8,0,0,0 +3,4.564348,0,6.907755,6.959049,1,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +9,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +9,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,1,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,1,10.3,1,0,0 +2,4.564348,0,6.907755,6.959049,1,10.3,1,0,0 +8,4.564348,0,6.907755,6.959049,1,27.6,0,0,0 +5,4.564348,0,6.907755,6.959049,1,27.6,0,0,0 +2,4.564348,0,6.907755,6.959049,1,27.6,0,0,0 +3,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +5,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +4,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +3,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +2,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +18,0,1,6.109248,6.160541,0,17.2,1,0,0 +13,0,1,6.109248,6.160541,0,17.2,1,0,0 +4,0,1,6.109248,6.160541,0,17.2,1,0,0 +1,0,1,6.109248,6.160541,0,17.2,1,0,0 +2,0,1,6.109248,6.160541,0,17.2,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +7,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,41.4,0,0,0 +3,0,1,6.109248,6.160541,0,41.4,0,0,0 +0,0,1,6.109248,6.160541,0,41.4,0,0,0 +0,0,1,6.109248,6.160541,0,41.4,0,0,0 +1,0,1,6.109248,6.160541,0,41.4,0,0,0 +8,0,1,6.109248,6.160541,0,10.3,1,0,0 +3,0,1,6.109248,6.160541,0,10.3,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,1,0 +2,0,1,6.109248,6.160541,0,10.3,0,1,0 +2,0,1,6.109248,6.160541,0,10.3,0,1,0 +7,3.258096,0,6.586172,8.006368,0,20.7,1,0,0 +3,3.258096,0,6.586172,8.006368,0,20.7,1,0,0 +4,3.258096,0,6.586172,8.006368,0,20.7,1,0,0 +1,3.258096,0,6.586172,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.586172,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.586172,8.006368,0,3.4,1,0,0 +3,3.258096,0,6.586172,8.006368,0,13.8,1,0,0 +3,3.258096,0,6.586172,8.006368,0,13.8,1,0,0 +14,3.258096,0,6.586172,8.006368,0,13.8,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +6,3.258096,0,6.620073,8.006368,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,0,0,1,0,0 +4,3.258096,0,6.620073,8.006368,0,0,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,0,0,0,0 +5,0,0,0,0,0,0,0,0,0 +4,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +5,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +5,0,0,0,0,1,34.5,1,0,0 +9,0,0,0,0,1,34.5,1,0,0 +44,0,0,0,0,1,34.5,1,0,0 +76,0,0,0,0,1,34.5,1,0,0 +77,0,0,0,0,1,34.5,1,0,0 +1,0,0,0,0,1,17.2,0,0,0 +1,0,0,0,0,1,17.2,0,0,0 +8,0,0,0,0,1,17.2,0,0,0 +25,0,0,0,0,1,17.2,0,0,0 +12,0,0,0,0,1,17.2,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +5,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +5,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +2,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +3,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +5,0,0,0,0,0,13.8,1,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +10,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +18,3.258096,0,6.802395,8.188689,0,27.6,0,0,0 +0,3.258096,0,6.802395,8.188689,0,27.6,0,0,0 +0,3.258096,0,6.802395,8.188689,0,27.6,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,13.8,1,0,0 +3,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +2,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +4,0,1,0,5.061929,0,6.9,1,0,0 +0,0,1,0,5.061929,0,6.9,1,0,0 +0,0,1,0,5.061929,0,6.9,1,0,0 +0,0,1,0,5.061929,0,6.9,1,0,0 +0,0,1,0,5.061929,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +5,0,1,6.109248,6.160541,0,24.1,1,0,0 +7,0,1,6.109248,6.160541,0,24.1,1,0,0 +1,0,1,6.109248,6.160541,0,24.1,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +5,3.931826,0,6.907755,7.600903,0,17.2,0,0,0 +1,3.931826,0,6.907755,7.600903,0,17.2,0,0,0 +0,3.931826,0,6.907755,7.600903,0,17.2,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +3,3.931826,0,6.907755,7.600903,1,20.7,1,0,0 +3,3.931826,0,6.907755,7.600903,1,20.7,1,0,0 +9,3.931826,0,6.907755,7.600903,1,20.7,1,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +3,3.931826,0,6.907755,7.600903,1,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,1,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,1,6.9,1,0,0 +1,3.931826,0,6.907755,7.600903,1,6.9,1,0,0 +2,3.931826,0,6.907755,7.600903,1,6.9,1,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +0,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +2,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +13,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +4,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +5,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +3,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +3,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +2,0,1,6.109248,6.160541,0,13.8,1,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,9.967326,0,0,0 +1,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,0,1,6.109248,6.160541,0,9.967326,0,0,0 +6,0,1,6.109248,6.160541,0,6.9,1,0,0 +3,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,5.711089,5.061929,0,10.3,1,0,0 +0,0,1,5.711089,5.061929,0,10.3,1,0,0 +2,0,1,5.711089,5.061929,0,10.3,1,0,0 +8,0,0,0,0,1,31,1,0,0 +4,0,0,0,0,1,31,1,0,0 +4,0,0,0,0,1,31,1,0,0 +2,0,0,5.015954,0,0,13.8,0,0,0 +0,0,0,5.015954,0,0,13.8,0,0,0 +0,0,0,5.015954,0,0,13.8,0,0,0 +8,0,1,5.703783,5.755076,1,17.2,0,1,0 +10,0,1,5.703783,5.755076,1,17.2,0,1,0 +7,0,1,5.703783,5.755076,1,17.2,0,1,0 +9,0,1,5.703783,5.755076,1,17.2,0,1,0 +9,0,1,5.703783,5.755076,1,17.2,0,1,0 +1,0,1,5.703783,5.755076,1,24.1,1,0,0 +7,0,1,5.703783,5.755076,1,24.1,1,0,0 +4,0,1,5.703783,5.755076,1,24.1,1,0,0 +4,0,1,5.703783,5.755076,1,24.1,1,0,0 +5,0,1,5.703783,5.755076,1,24.1,1,0,0 +3,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,1,0,0 +6,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +4,0,1,6.109248,6.160541,0,3.4,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,1,0,0 +1,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,1,0,0 +7,0,1,6.109248,6.160541,0,3.4,1,0,0 +6,0,1,6.109248,6.160541,0,3.4,1,0,0 +5,0,1,5.855989,5.061929,0,3.4,0,0,0 +9,0,1,5.855989,5.061929,0,3.4,0,0,0 +11,0,1,5.855989,5.061929,0,3.4,0,0,0 +4,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +7,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +17,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +5,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +6,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +2,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +6,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,1,0,0 +3,4.564348,0,2.890372,2.941665,0,9.967326,0,0,0 +0,4.564348,0,2.890372,2.941665,0,9.967326,0,0,0 +1,4.564348,0,2.890372,2.941665,0,9.967326,0,0,0 +6,4.564348,0,2.890372,2.941665,0,20.7,1,0,0 +2,4.564348,0,2.890372,2.941665,0,20.7,1,0,0 +1,4.564348,0,2.890372,2.941665,0,20.7,1,0,0 +4,3.258096,0,6.55108,7.937375,0,9.967326,0,1,0 +3,3.258096,0,6.55108,7.937375,0,9.967326,0,1,0 +2,3.258096,0,6.55108,7.937375,0,9.967326,0,1,0 +0,3.258096,0,6.55108,7.937375,0,9.967326,0,1,0 +1,3.258096,0,6.55108,7.937375,0,9.967326,0,1,0 +14,3.258096,0,6.55108,7.937375,0,24.1,0,1,0 +13,3.258096,0,6.55108,7.937375,0,24.1,0,1,0 +4,3.258096,0,6.55108,7.937375,0,24.1,0,1,0 +1,3.258096,0,6.55108,7.937375,0,24.1,0,1,0 +1,3.258096,0,6.55108,7.937375,0,24.1,0,1,0 +1,3.258096,0,6.55108,7.937375,0,6.9,1,0,0 +2,3.258096,0,6.55108,7.937375,0,6.9,1,0,0 +0,3.258096,0,6.55108,7.937375,0,6.9,1,0,0 +0,3.258096,0,6.55108,7.937375,0,6.9,1,0,0 +1,3.258096,0,6.55108,7.937375,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +3,4.564348,0,0,5.755076,0,10.3,0,0,0 +0,4.564348,0,0,5.755076,0,10.3,0,0,0 +2,0,1,6.052089,6.160541,0,3.4,1,0,0 +2,0,1,6.052089,6.160541,0,3.4,1,0,0 +2,0,1,6.052089,6.160541,0,3.4,1,0,0 +2,0,1,6.052089,6.160541,0,9.967326,0,0,0 +1,0,1,6.052089,6.160541,0,9.967326,0,0,0 +1,0,1,6.052089,6.160541,0,9.967326,0,0,0 +2,0,1,6.052089,6.160541,0,13.8,0,0,0 +2,0,1,6.052089,6.160541,0,13.8,0,0,0 +1,0,1,6.052089,6.160541,0,13.8,0,0,0 +1,0,1,6.052089,6.160541,0,9.967326,0,0,0 +0,0,1,6.052089,6.160541,0,9.967326,0,0,0 +0,0,1,6.052089,6.160541,0,9.967326,0,0,0 +3,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +6,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +6,0,1,6.109248,6.160541,0,24.1,1,0,0 +1,0,1,6.109248,6.160541,0,24.1,1,0,0 +1,0,1,6.109248,6.160541,0,24.1,1,0,0 +6,0,1,5.010635,5.061929,0,31,1,0,0 +2,0,1,5.010635,5.061929,0,31,1,0,0 +6,0,1,5.010635,5.061929,0,31,1,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +5,0,0,0,0,0,0,0,0,0 +0,0,0,6.200184,0,0,0,0,0,0 +4,0,0,6.200184,0,0,0,0,0,0 +5,0,0,6.200184,0,0,0,0,0,0 +0,0,0,6.200184,0,0,6.9,1,0,0 +0,0,0,6.200184,0,0,6.9,1,0,0 +0,0,0,6.200184,0,0,6.9,1,0,0 +0,0,0,6.200184,0,0,0,0,0,0 +1,0,0,6.200184,0,0,0,0,0,0 +0,0,0,6.200184,0,0,13.8,1,0,0 +2,0,0,6.200184,0,0,13.8,1,0,0 +3,0,0,6.200184,0,0,13.8,1,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +2,0,0,6.200184,0,0,9.967326,0,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +1,0,0,6.200184,0,0,9.967326,0,0,0 +0,0,0,6.200184,0,0,9.967326,0,0,0 +1,0,0,6.200184,0,0,9.967326,0,0,0 +1,0,0,6.200184,0,0,6.9,0,0,0 +0,0,0,6.200184,0,0,6.9,0,0,0 +0,0,0,6.200184,0,0,6.9,0,0,0 +3,0,1,5.352806,5.061929,0,10.3,0,0,0 +0,0,1,5.352806,5.061929,0,10.3,0,0,0 +4,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +3,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +25,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +10,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +3,4.564348,0,6.907755,6.959049,0,0,0,0,0 +2,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +2,4.564348,0,6.907755,6.959049,0,31,0,1,0 +3,4.564348,0,6.907755,6.959049,0,31,0,1,0 +1,4.564348,0,6.907755,6.959049,0,31,0,1,0 +4,0,0,5.154216,0,0,9.967326,0,0,0 +7,0,0,5.154216,0,0,9.967326,0,0,0 +4,0,0,5.154216,0,0,9.967326,0,0,0 +7,0,0,5.154216,0,0,17.2,1,0,0 +19,0,0,5.154216,0,0,17.2,1,0,0 +6,0,0,5.154216,0,0,17.2,1,0,0 +0,0,0,5.154216,0,0,3.4,0,0,0 +0,0,0,5.154216,0,0,3.4,0,0,0 +1,0,0,5.154216,0,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +2,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +2,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +3,3.258096,0,6.109248,8.006368,1,10.3,0,0,0 +8,3.258096,0,6.109248,8.006368,1,10.3,0,0,0 +0,3.258096,0,6.109248,8.006368,1,10.3,0,0,0 +3,4.564348,0,6.684612,6.735905,0,3.4,0,0,0 +3,4.564348,0,6.684612,6.735905,0,3.4,0,0,0 +9,4.564348,0,6.684612,6.735905,0,9.967326,0,1,0 +2,4.564348,0,6.684612,6.735905,0,9.967326,0,1,0 +0,4.564348,0,6.684612,6.735905,0,9.967326,0,1,0 +2,4.564348,0,6.684612,6.735905,0,17.2,0,0,0 +1,4.564348,0,6.684612,6.735905,0,17.2,0,0,0 +1,4.564348,0,6.684612,6.735905,0,17.2,0,0,0 +0,4.564348,0,6.684612,6.735905,0,9.967326,0,0,0 +0,4.564348,0,6.684612,6.735905,0,9.967326,0,0,0 +0,4.564348,0,6.684612,6.735905,0,9.967326,0,0,0 +3,4.564348,0,6.684612,6.735905,0,13.8,0,0,0 +2,4.564348,0,6.684612,6.735905,0,13.8,0,0,0 +1,4.564348,0,6.684612,6.735905,0,13.8,0,0,0 +2,4.564348,0,5.521461,5.572754,0,0,0,0,0 +0,4.564348,0,5.521461,5.572754,0,0,0,0,0 +0,4.564348,0,5.521461,5.572754,0,0,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +5,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +6,3.258096,0,6.620073,8.006368,1,24.1,1,0,0 +9,3.258096,0,6.620073,8.006368,1,24.1,1,0,0 +5,3.258096,0,6.620073,8.006368,1,24.1,1,0,0 +2,3.931826,0,6.620073,7.313221,0,6.9,0,0,0 +1,3.931826,0,6.620073,7.313221,0,6.9,0,0,0 +3,3.931826,0,6.620073,7.313221,0,6.9,0,0,0 +1,3.931826,0,6.620073,7.313221,0,6.9,0,0,0 +3,3.931826,0,6.620073,7.313221,0,6.9,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +5,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +0,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +3,0,0,0,0,0,9.967326,1,0,0 +2,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +1,0,0,0,0,0,9.967326,1,0,0 +4,0,1,5.010635,5.061929,1,0,1,0,0 +0,0,1,5.010635,5.061929,1,0,1,0,0 +0,0,1,5.010635,5.061929,1,0,1,0,0 +0,0,1,5.352806,5.061929,1,10.3,0,0,0 +1,0,1,5.352806,5.061929,1,10.3,0,0,0 +0,0,1,5.352806,5.061929,1,10.3,0,0,0 +0,0,1,5.703783,5.755076,0,9.967326,0,0,0 +2,0,1,5.703783,5.755076,0,9.967326,0,0,0 +0,0,1,5.703783,5.755076,0,9.967326,0,0,0 +3,0,1,5.703783,5.755076,0,34.5,1,0,0 +2,0,1,5.703783,5.755076,0,34.5,1,0,0 +0,0,1,5.703783,5.755076,0,34.5,1,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +2,0,0,6.468878,0,0,9.967326,0,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +2,0,0,6.468878,0,0,9.967326,0,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +3,0,0,6.468878,0,0,9.967326,0,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +3,0,0,6.468878,0,0,9.967326,0,0,0 +1,0,0,6.468878,0,0,9.967326,0,0,0 +0,0,0,6.468878,0,0,9.967326,0,0,0 +2,0,0,6.468878,0,0,17.2,1,0,0 +3,0,0,6.468878,0,0,17.2,1,0,0 +1,0,0,6.468878,0,0,17.2,1,0,0 +1,0,0,6.468878,0,0,17.2,1,0,0 +1,0,0,6.468878,0,0,17.2,1,0,0 +1,0,0,6.468878,0,0,17.2,0,0,0 +6,0,0,6.468878,0,0,17.2,0,0,0 +5,0,0,6.468878,0,0,17.2,0,0,0 +5,0,0,6.468878,0,0,17.2,0,0,0 +1,0,0,6.468878,0,0,17.2,0,0,0 +1,0,1,5.703783,5.755076,0,6.9,0,0,0 +1,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +3,0,1,5.703783,5.755076,0,6.9,0,0,0 +0,0,1,5.703783,5.755076,0,6.9,0,0,0 +2,0,1,5.703783,5.755076,0,6.9,0,0,0 +4,0,1,5.504844,5.061929,0,13.8,1,0,0 +3,0,1,5.504844,5.061929,0,13.8,1,0,0 +1,0,1,5.504844,5.061929,0,13.8,1,0,0 +18,0,1,6.109248,6.160541,.0431267,9.967326,0,0,0 +6,0,1,6.109248,6.160541,.0431267,9.967326,0,0,0 +4,0,1,6.109248,6.160541,.0431267,9.967326,0,0,0 +0,0,1,6.109248,6.160541,.1572505,9.967326,0,0,0 +0,0,1,6.109248,6.160541,.1572505,9.967326,0,0,0 +0,0,1,6.109248,6.160541,.1572505,9.967326,0,0,0 +1,0,1,6.109248,6.160541,.1572505,9.967326,0,1,0 +4,0,1,6.109248,6.160541,.1572505,9.967326,0,1,0 +2,0,1,6.109248,6.160541,.1572505,9.967326,0,1,0 +0,0,1,5.010635,5.061929,0,0,0,0,0 +0,0,1,5.010635,5.061929,0,0,0,0,0 +0,0,1,5.010635,5.061929,0,0,0,0,0 +1,0,1,6.109248,6.160541,.0431267,9.967326,0,0,0 +0,0,1,6.109248,6.160541,.0431267,9.967326,0,0,0 +1,0,1,6.109248,6.160541,.0431267,9.967326,0,0,0 +7,0,1,5.010635,5.061929,0,6.9,0,0,0 +4,0,1,5.010635,5.061929,0,6.9,0,0,0 +2,0,1,5.010635,5.061929,0,6.9,0,0,0 +2,3.258096,0,6.263398,7.649693,.1572505,9.967326,1,0,0 +0,3.258096,0,6.263398,7.649693,.1572505,9.967326,1,0,0 +8,3.258096,0,6.263398,7.649693,.1572505,9.967326,1,0,0 +4,3.258096,0,6.263398,7.649693,.1572505,9.967326,1,0,0 +3,3.258096,0,6.263398,7.649693,.1572505,9.967326,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,1,0,0 +4,0,1,6.109248,6.160541,0,3.4,1,0,0 +10,0,1,6.109248,6.160541,0,3.4,1,0,0 +10,0,1,6.109248,6.160541,0,9.967326,0,0,0 +12,0,1,6.109248,6.160541,0,9.967326,0,0,0 +6,0,1,6.109248,6.160541,0,9.967326,0,0,0 +8,0,1,6.109248,6.160541,0,13.8,0,0,0 +1,0,1,6.109248,6.160541,0,13.8,0,0,0 +7,0,1,6.109248,6.160541,0,13.8,0,0,0 +3,0,1,6.109248,6.160541,0,9.967326,0,0,0 +8,0,1,6.109248,6.160541,0,9.967326,0,0,0 +7,0,1,6.109248,6.160541,0,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,.1572505,9.967326,0,0,0 +3,4.564348,0,6.907755,6.959049,.1572505,9.967326,0,0,0 +6,4.564348,0,6.907755,6.959049,.1572505,9.967326,0,0,0 +5,4.564348,0,6.907755,6.959049,.1572505,9.967326,0,0,0 +0,4.564348,0,6.907755,6.959049,.1572505,9.967326,0,0,0 +4,4.564348,0,6.907755,6.959049,.1572505,9.967326,0,0,0 +12,4.564348,0,0,0,0,0,0,0,0 +5,4.564348,0,0,0,0,0,0,0,0 +5,4.564348,0,0,0,0,0,0,0,0 +2,4.564348,0,6.907755,6.959049,.1572505,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,.1572505,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,.1572505,9.967326,0,0,0 +3,0,0,6.828582,0,0,17.2,0,0,0 +2,0,0,6.828582,0,0,17.2,0,0,0 +4,0,0,6.828582,0,0,17.2,0,0,0 +5,0,0,6.828582,0,0,6.9,0,0,0 +9,0,0,6.828582,0,0,6.9,0,0,0 +7,0,0,6.828582,0,0,6.9,0,0,0 +0,4.564348,0,6.476973,6.528265,0,10.3,1,0,0 +1,4.564348,0,6.476973,6.528265,0,10.3,1,0,0 +0,4.564348,0,6.476973,6.528265,0,10.3,1,0,0 +3,4.564348,0,6.476973,6.528265,0,9.967326,0,0,0 +2,4.564348,0,6.476973,6.528265,0,9.967326,0,0,0 +3,4.564348,0,6.476973,6.528265,0,9.967326,0,0,0 +1,4.564348,0,6.476973,6.528265,0,9.967326,0,0,0 +8,4.564348,0,6.476973,6.528265,0,9.967326,0,0,0 +5,4.564348,0,6.476973,6.528265,0,9.967326,0,0,0 +4,4.564348,0,6.476973,6.528265,0,0,1,0,0 +1,4.564348,0,6.476973,6.528265,0,0,1,0,0 +3,4.564348,0,6.476973,6.528265,0,0,1,0,0 +2,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +2,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +4,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +7,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +4,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +5,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +5,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +0,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,1,0,0 +3,0,0,5.189618,0,0,17.2,1,0,0 +5,0,0,5.189618,0,0,17.2,1,0,0 +1,0,0,5.189618,0,0,17.2,1,0,0 +4,0,1,5.893411,5.755076,0,0,0,0,0 +0,0,1,5.893411,5.755076,0,0,0,0,0 +1,0,1,5.893411,5.755076,0,0,0,0,0 +3,0,1,5.893411,5.755076,0,3.4,0,0,0 +2,0,1,5.893411,5.755076,0,3.4,0,0,0 +2,0,1,5.893411,5.755076,0,3.4,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +5,0,0,0,0,0,9.967326,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +7,0,0,0,0,1,6.9,0,0,0 +1,0,0,0,0,1,6.9,0,0,0 +1,0,0,0,0,1,6.9,0,0,0 +2,0,0,0,0,1,6.9,0,0,0 +2,0,0,0,0,1,6.9,0,0,0 +5,3.258096,0,6.586172,8.006368,0,0,0,0,0 +8,3.258096,0,6.586172,8.006368,0,0,0,0,0 +6,3.258096,0,6.586172,8.006368,0,0,0,0,0 +2,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +10,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +4,3.258096,0,6.586172,8.006368,0,9.967326,0,0,0 +5,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +2,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +2,3.258096,0,6.586172,8.006368,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,20.7,1,0,0 +6,3.931826,0,6.907755,7.600903,0,20.7,1,0,0 +2,3.931826,0,6.907755,7.600903,0,20.7,1,0,0 +1,3.931826,0,6.907755,7.600903,1,10.3,1,0,0 +5,3.931826,0,6.907755,7.600903,1,10.3,1,0,0 +2,3.931826,0,6.907755,7.600903,1,10.3,1,0,0 +13,3.258096,0,6.611073,7.344202,0,0,1,0,0 +0,3.258096,0,6.611073,7.344202,0,0,1,0,0 +3,3.258096,0,6.611073,7.344202,0,0,1,0,0 +3,3.258096,0,6.611073,7.344202,0,9.967326,1,0,0 +2,3.258096,0,6.611073,7.344202,0,9.967326,1,0,0 +3,3.258096,0,6.611073,7.344202,0,9.967326,1,0,0 +0,0,1,6.611073,6.160541,1,3.4,1,0,0 +6,0,1,6.611073,6.160541,1,3.4,1,0,0 +5,0,1,6.611073,6.160541,1,3.4,1,0,0 +1,0,1,6.611073,6.160541,0,9.967326,1,0,0 +4,0,1,6.611073,6.160541,0,17.2,1,0,0 +5,0,1,6.611073,6.160541,0,17.2,1,0,0 +2,0,1,6.611073,6.160541,0,17.2,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +26,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +14,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +11,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +0,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +3,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +4,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +3,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,4.564348,0,6.907555,6.959049,0,9.967326,1,0,0 +2,4.564348,0,6.907555,6.959049,0,9.967326,1,0,0 +1,4.564348,0,6.907555,6.959049,0,9.967326,1,0,0 +3,4.564348,0,6.907555,6.959049,0,6.9,1,0,0 +2,4.564348,0,6.907555,6.959049,0,6.9,1,0,0 +1,4.564348,0,6.907555,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907555,6.959049,0,3.4,1,0,0 +3,4.564348,0,6.907555,6.959049,0,3.4,1,0,0 +5,4.564348,0,6.907555,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.756816,6.808109,0,13.8,0,1,0 +0,4.564348,0,6.756816,6.808109,0,13.8,0,1,0 +1,4.564348,0,6.756816,6.808109,0,9.967326,0,0,0 +0,4.564348,0,6.756816,6.808109,0,9.967326,0,0,0 +0,4.564348,0,6.756816,6.808109,0,6.9,0,0,1 +1,4.564348,0,6.756816,6.808109,0,6.9,0,0,1 +7,0,0,0,0,0,37.9,0,0,0 +6,0,0,0,0,0,37.9,0,0,0 +4,0,0,0,0,0,37.9,0,0,0 +3,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +1,0,0,0,0,0,0,1,0,0 +4,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +6,0,0,0,0,1,17.2,1,0,0 +8,0,0,0,0,1,17.2,1,0,0 +2,0,0,0,0,1,17.2,1,0,0 +8,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +1,0,0,0,0,0,9.967326,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +8,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,10.3,0,1,0 +2,0,0,0,0,0,10.3,0,1,0 +9,0,0,0,0,0,10.3,0,1,0 +8,0,0,0,0,0,10.3,0,1,0 +4,0,0,0,0,0,10.3,0,1,0 +9,0,0,0,0,0,9.967326,0,0,0 +10,0,0,0,0,0,9.967326,0,0,0 +9,0,0,0,0,0,9.967326,0,0,0 +6,0,0,0,0,0,9.967326,0,0,0 +3,0,0,0,0,0,9.967326,0,0,0 +11,0,0,0,0,1,9.967326,1,0,0 +11,0,0,0,0,1,9.967326,1,0,0 +14,0,0,0,0,1,9.967326,1,0,0 +9,0,0,0,0,1,9.967326,1,0,0 +11,0,0,0,0,1,9.967326,1,0,0 +0,4.564348,0,6.882438,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.882438,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.766191,6.817485,0,10.3,0,0,0 +0,4.564348,0,6.766191,6.817485,0,10.3,0,0,0 +0,4.564348,0,6.766191,6.817485,0,10.3,0,0,0 +0,0,1,6.052089,6.160541,0,6.9,1,0,0 +0,0,1,6.052089,6.160541,0,6.9,1,0,0 +1,0,1,6.052089,6.160541,0,6.9,1,0,0 +0,0,1,6.052089,6.160541,0,9.967326,0,0,0 +3,0,1,6.052089,6.160541,0,9.967326,0,0,0 +1,0,1,6.052089,6.160541,0,9.967326,0,0,0 +0,0,1,6.052089,6.160541,0,9.967326,0,0,0 +0,0,1,6.052089,6.160541,0,9.967326,0,0,0 +4,0,1,6.052089,6.160541,0,9.967326,0,0,0 +3,0,1,6.052089,6.160541,0,13.8,0,0,0 +0,0,1,6.052089,6.160541,0,13.8,0,0,0 +4,0,1,6.052089,6.160541,0,13.8,0,0,0 +1,0,1,6.052089,6.160541,0,9.967326,0,0,0 +0,0,1,6.052089,6.160541,0,9.967326,0,0,0 +0,0,1,6.052089,6.160541,0,9.967326,0,0,0 +4,0,0,4.836282,0,0,10.3,1,0,0 +8,0,0,4.836282,0,0,10.3,1,0,0 +10,0,0,4.836282,0,0,10.3,1,0,0 +9,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +2,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +4,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +2,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +6,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +8,3.931826,0,6.907755,7.600903,1,6.9,0,0,1 +8,3.931826,0,6.907755,7.600903,1,6.9,0,0,1 +5,3.931826,0,6.907755,7.600903,1,6.9,0,0,1 +4,3.931826,0,6.907755,7.600903,1,6.9,0,0,1 +8,3.931826,0,6.907755,7.600903,1,6.9,0,0,1 +7,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +8,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +5,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +7,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +7,3.931826,0,6.907755,7.600903,0,9.967326,0,0,0 +1,3.931826,0,6.907755,7.600903,0,27.6,0,0,0 +4,3.931826,0,6.907755,7.600903,0,27.6,0,0,0 +6,3.931826,0,6.907755,7.600903,0,27.6,0,0,0 +10,3.931826,0,6.907755,7.600903,0,27.6,0,0,0 +5,3.931826,0,6.907755,7.600903,0,27.6,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +7,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +16,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +1,0,1,7.122189,5.755076,0,3.4,0,0,0 +1,0,1,7.122189,5.755076,0,3.4,0,0,0 +2,0,1,7.122189,5.755076,0,3.4,0,0,0 +0,0,1,7.122189,5.755076,0,3.4,0,0,0 +5,0,1,7.122189,5.755076,0,3.4,0,0,0 +0,0,1,7.122189,5.755076,0,0,0,0,0 +0,0,1,7.122189,5.755076,0,0,0,0,0 +0,0,1,7.122189,5.755076,0,0,0,0,0 +0,0,1,7.122189,5.755076,0,0,0,0,0 +1,0,1,7.122189,5.755076,0,0,0,0,0 +6,0,1,5.010635,5.061929,0,3.4,0,0,0 +3,0,1,5.010635,5.061929,0,3.4,0,0,0 +5,0,1,5.010635,5.061929,0,3.4,0,0,0 +6,0,1,5.010635,5.061929,0,3.4,0,0,0 +2,0,1,5.010635,5.061929,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,1,10.3,1,0,0 +5,4.564348,0,6.907755,6.959049,1,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,1,10.3,1,0,0 +5,0,1,0,5.061929,0,6.9,1,0,0 +0,0,1,0,5.061929,0,6.9,1,0,0 +4,0,1,0,5.061929,0,6.9,1,0,0 +3,0,0,0,0,1,37.9,1,0,0 +1,0,0,0,0,1,37.9,1,0,0 +2,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,3.4,1,0,0 +6,0,0,0,0,0,3.4,0,1,0 +2,0,0,0,0,0,3.4,0,1,0 +6,0,0,0,0,0,3.4,0,1,0 +1,3.258096,0,6.612955,7.999249,0,10.3,1,0,0 +2,3.258096,0,6.612955,7.999249,0,10.3,1,0,0 +3,3.258096,0,6.612955,7.999249,0,10.3,1,0,0 +2,3.258096,0,6.612955,7.999249,0,10.3,1,0,0 +0,3.258096,0,6.612955,7.999249,0,10.3,1,0,0 +4,3.258096,0,5.703783,7.090077,1,6.9,0,0,0 +2,3.258096,0,5.703783,7.090077,1,6.9,0,0,0 +1,3.258096,0,5.703783,7.090077,1,6.9,0,0,0 +1,3.258096,0,5.703783,7.090077,1,6.9,0,0,0 +1,3.258096,0,5.703783,7.090077,1,6.9,0,0,0 +3,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +6,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +7,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +3,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +14,3.258096,0,5.703783,7.090077,0,10.3,1,0,0 +1,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +1,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +2,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +2,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +2,3.258096,0,5.703783,7.090077,0,9.967326,0,0,0 +1,4.564348,0,6.123589,6.174882,0,3.4,1,0,0 +0,4.564348,0,6.123589,6.174882,0,3.4,1,0,0 +2,4.564348,0,6.123589,6.174882,0,3.4,1,0,0 +0,4.564348,0,6.123589,6.174882,0,24.1,1,0,0 +0,4.564348,0,6.123589,6.174882,0,24.1,1,0,0 +0,4.564348,0,6.123589,6.174882,0,24.1,1,0,0 +0,4.564348,0,6.123589,6.174882,0,13.8,1,0,0 +0,4.564348,0,6.123589,6.174882,0,13.8,1,0,0 +0,4.564348,0,6.123589,6.174882,0,13.8,1,0,0 +3,4.564348,0,6.123589,6.174882,0,3.4,1,0,0 +0,4.564348,0,6.123589,6.174882,0,3.4,1,0,0 +4,4.564348,0,6.123589,6.174882,0,3.4,1,0,0 +0,4.564348,0,5.416101,5.467394,0,6.9,1,0,0 +0,4.564348,0,5.416101,5.467394,0,6.9,1,0,0 +0,4.564348,0,5.416101,5.467394,0,6.9,1,0,0 +0,4.564348,0,6.802395,6.853688,0,3.4,0,0,0 +0,4.564348,0,6.802395,6.853688,0,3.4,0,0,0 +3,4.564348,0,6.802395,6.853688,0,3.4,0,0,0 +0,4.564348,0,6.802395,6.853688,1,10.3,0,0,0 +5,4.564348,0,6.802395,6.853688,1,10.3,0,0,0 +8,4.564348,0,6.802395,6.853688,1,10.3,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +2,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +14,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +6,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +2,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +7,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,3.931826,0,5.741848,4.49981,0,0,0,0,0 +0,3.931826,0,5.741848,4.49981,0,0,0,0,0 +0,3.931826,0,5.741848,4.49981,0,0,0,0,0 +8,0,0,5.741848,0,0,10.3,0,1,0 +11,0,0,5.741848,0,0,10.3,0,1,0 +11,0,0,5.741848,0,0,10.3,0,1,0 +3,0,0,4.836282,0,0,6.9,1,0,0 +11,0,0,4.836282,0,0,6.9,1,0,0 +8,0,0,4.836282,0,0,6.9,1,0,0 +1,0,1,5.913449,5.755076,0,13.8,0,0,0 +0,0,1,5.913449,5.755076,0,13.8,0,0,0 +1,0,1,5.913449,5.755076,0,13.8,0,0,0 +2,0,1,5.913449,5.755076,0,13.8,0,0,0 +0,0,1,5.913449,5.755076,0,13.8,0,0,0 +2,0,1,5.913449,5.755076,0,10.3,1,0,0 +2,0,1,5.913449,5.755076,0,10.3,1,0,0 +1,0,1,5.913449,5.755076,0,10.3,1,0,0 +4,0,1,5.913449,5.755076,0,10.3,1,0,0 +1,0,1,5.913449,5.755076,0,10.3,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +10,0,0,0,0,0,6.9,1,0,0 +12,0,0,0,0,0,6.9,1,0,0 +11,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,0,6.9,1,0,0 +7,0,0,5.418764,0,0,9.967326,0,0,0 +3,0,0,5.418764,0,0,9.967326,0,0,0 +0,0,0,5.418764,0,0,9.967326,0,0,0 +5,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +7,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +5,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +2,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,3.258096,0,6.620073,8.006368,0,9.967326,0,0,0 +1,0,1,5.749202,5.755076,0,10.3,0,0,0 +0,0,1,5.749202,5.755076,0,10.3,0,0,0 +1,0,1,5.749202,5.755076,0,10.3,0,0,0 +0,0,1,5.749202,5.755076,0,10.3,0,0,0 +2,0,1,5.749202,5.755076,0,10.3,0,0,0 +6,4.564348,0,6.372978,6.424272,.0268456,9.967326,0,0,0 +3,4.564348,0,6.372978,6.424272,.0268456,9.967326,0,0,0 +2,4.564348,0,6.372978,6.424272,.0268456,9.967326,0,0,0 +3,4.564348,0,6.372978,6.424272,.0268456,9.967326,0,0,0 +2,4.564348,0,6.372978,6.424272,.0268456,9.967326,0,0,0 +1,0,0,6.346478,0,0,0,0,0,0 +2,0,0,6.346478,0,0,0,0,0,0 +1,0,0,6.346478,0,0,0,0,0,0 +5,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +4,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +1,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +2,4.564348,0,6.907755,6.959049,0,9.967326,0,0,0 +0,0,0,3.401197,0,0,6.9,0,0,0 +0,0,0,3.401197,0,0,6.9,0,0,0 +1,0,0,3.401197,0,0,6.9,0,0,0 +4,0,0,3.401197,0,0,6.9,0,0,0 +5,0,0,0,0,1,10.3,0,0,0 +2,0,0,0,0,1,10.3,0,0,0 +3,0,0,0,0,0,10.3,0,0,0 +5,0,0,0,0,0,10.3,0,0,0 +5,0,0,0,0,0,10.3,0,0,0 +5,3.258096,0,6.620073,8.006368,1,37.9,0,0,0 +6,3.258096,0,6.620073,8.006368,1,37.9,0,0,0 +3,3.258096,0,6.620073,8.006368,1,37.9,0,0,0 +2,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +3,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +1,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +3,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +7,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +0,0,0,0,0,.1572505,9.967326,0,0,0 +7,0,0,0,0,.0268456,9.967326,0,0,0 +4,0,0,0,0,.0268456,9.967326,0,0,0 +7,0,0,0,0,.0268456,9.967326,0,0,0 +2,0,0,0,0,.0268456,9.967326,0,0,0 +13,0,0,6.200184,0,.0268456,9.967326,0,0,0 +4,0,0,6.200184,0,.0268456,9.967326,0,0,0 +1,0,0,6.200184,0,.0268456,9.967326,0,0,0 +5,0,0,6.200184,0,.0268456,9.967326,0,0,0 +5,0,0,6.200184,0,.0268456,9.967326,0,0,0 +12,3.931826,0,6.907755,7.600903,.0268456,9.967326,0,0,0 +4,3.931826,0,6.907755,7.600903,.0268456,9.967326,0,0,0 +6,0,0,0,0,.0268456,9.967326,0,0,0 +7,0,0,0,0,.0268456,9.967326,0,0,0 +2,3.258096,0,5.703783,7.090077,.0268456,9.967326,0,0,0 +2,3.258096,0,5.703783,7.090077,.0268456,9.967326,0,0,0 +5,3.258096,0,5.703783,7.090077,.0268456,9.967326,0,0,0 +2,3.258096,0,5.703783,7.090077,.0268456,9.967326,0,0,0 +4,0,0,0,0,.0268456,9.967326,0,0,0 +3,0,0,0,0,.0268456,9.967326,0,0,0 +18,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +13,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +9,0,0,0,0,.0268456,9.967326,0,0,0 +10,0,0,0,0,.0268456,9.967326,0,0,0 +7,0,0,0,0,.0268456,9.967326,0,0,0 +7,0,0,0,0,.0268456,9.967326,0,0,0 +5,0,0,0,0,.0268456,9.967326,0,0,0 +4,0,0,0,0,.0268456,9.967326,0,0,0 +2,0,0,0,0,.0268456,9.967326,0,0,0 +4,0,0,0,0,.0268456,9.967326,0,0,0 +6,4.564348,0,6.907555,6.959049,.0268456,9.967326,0,0,0 +2,4.564348,0,6.907555,6.959049,.0268456,9.967326,0,0,0 +4,0,0,5.321057,0,.0268456,9.967326,0,0,0 +3,0,1,6.109248,6.160541,.0268456,9.967326,0,0,0 +3,0,0,0,0,.0268456,9.967326,0,0,0 +5,0,0,0,0,.0268456,9.967326,0,0,0 +3,0,1,5.703783,5.755076,.0268456,9.967326,0,0,0 +2,0,1,5.703783,5.755076,.0268456,9.967326,0,0,0 +1,0,1,5.703783,5.755076,.0268456,9.967326,0,0,0 +20,0,0,0,0,.0268456,9.967326,0,0,0 +6,4.564348,0,6.907755,6.959049,.0268456,9.967326,0,0,0 +1,0,0,0,0,.0268456,9.967326,0,0,0 +11,0,1,5.893411,5.755076,.0268456,9.967326,0,0,0 +7,4.564348,0,0,3.592253,.0268456,9.967326,0,0,0 +2,0,1,5.010635,5.061929,.0268456,9.967326,0,0,0 +3,0,1,5.010635,5.061929,.0268456,9.967326,0,0,0 +1,0,1,5.010635,5.061929,.0268456,9.967326,0,0,0 +7,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +2,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +1,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +0,4.564348,0,5.521461,5.572754,.0268456,9.967326,0,0,0 +8,0,0,0,0,.0268456,9.967326,0,0,0 +3,3.258096,0,6.619806,8.006368,.0268456,9.967326,0,0,0 +7,3.258096,0,6.619806,8.006368,.0268456,9.967326,0,0,0 +7,3.258096,0,5.703783,7.090077,.0268456,9.967326,0,0,0 +2,3.258096,0,5.703783,7.090077,.0268456,9.967326,0,0,0 +4,0,1,5.881984,5.755076,.0268456,9.967326,0,0,0 +0,0,1,5.881984,5.755076,.0268456,9.967326,0,0,0 +6,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +2,0,1,5.749202,5.755076,.0268456,9.967326,0,0,0 +7,0,1,0,0,.0268456,9.967326,0,0,0 +6,0,0,0,0,.0268456,9.967326,0,0,0 +8,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +7,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +9,3.258096,0,6.620073,8.006368,0,17.2,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,1,0 +2,0,0,0,0,0,10.57626,0,1,0 +2,0,0,0,0,0,10.57626,0,1,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +1,0,1,0,5.755076,1,13.8,0,1,0 +3,0,1,0,5.755076,1,13.8,0,1,0 +0,0,1,0,5.755076,1,13.8,0,1,0 +0,0,1,0,5.755076,1,13.8,0,1,0 +2,0,1,0,5.755076,1,13.8,0,1,0 +0,0,1,0,5.755076,0,6.9,0,0,0 +0,0,1,0,5.755076,0,6.9,0,0,0 +0,0,1,0,5.755076,0,6.9,0,0,0 +0,0,1,0,5.755076,0,6.9,0,0,0 +0,0,1,0,5.755076,0,6.9,0,0,0 +3,0,0,0,0,0,20.7,0,0,0 +1,0,0,0,0,0,20.7,0,0,0 +0,0,0,0,0,0,20.7,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +2,0,0,0,0,0,31,0,1,0 +2,0,0,0,0,0,31,0,1,0 +2,0,0,0,0,0,31,0,1,0 +1,0,0,0,0,0,31,0,1,0 +7,0,0,0,0,0,31,0,1,0 +3,0,0,0,0,1,27.6,0,0,1 +5,0,0,0,0,1,27.6,0,0,1 +4,0,0,0,0,1,27.6,0,0,1 +8,0,0,0,0,1,27.6,0,0,1 +9,0,0,0,0,1,27.6,0,0,1 +9,0,0,0,0,0,3.4,1,0,0 +5,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +2,0,0,0,0,0,3.4,1,0,0 +8,0,0,0,0,0,3.4,1,0,0 +3,3.258096,0,6.620073,8.006368,1,24.1,0,1,0 +7,3.258096,0,6.620073,8.006368,1,24.1,0,1,0 +6,3.258096,0,6.620073,8.006368,1,24.1,0,1,0 +2,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +5,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,0,0 +0,3.258096,0,0,6.866933,0,3.4,1,0,0 +0,3.258096,0,0,6.866933,0,3.4,1,0,0 +2,3.258096,0,0,6.866933,0,3.4,1,0,0 +1,0,1,0,5.061929,0,20.7,1,0,0 +3,0,1,0,5.061929,0,20.7,1,0,0 +1,0,1,0,5.061929,0,20.7,1,0,0 +0,0,0,0,0,1,27.6,0,0,1 +0,0,0,0,0,1,27.6,0,0,1 +0,0,0,0,0,1,27.6,0,0,1 +2,0,0,0,0,1,27.6,0,0,1 +0,0,0,0,0,1,27.6,0,0,1 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +2,0,0,2.484907,0,0,17.2,0,0,0 +1,0,0,2.484907,0,0,17.2,0,0,0 +8,0,0,2.484907,0,0,17.2,0,0,0 +4,0,0,2.484907,0,0,17.2,0,0,0 +3,0,0,2.484907,0,0,17.2,0,0,0 +4,0,1,6.761573,6.160541,0,10.3,0,1,0 +1,0,1,6.761573,6.160541,0,10.3,0,1,0 +0,0,1,6.761573,6.160541,0,10.57626,0,0,0 +1,0,1,6.761573,6.160541,0,10.57626,0,0,0 +2,0,1,6.761573,6.160541,0,10.57626,0,0,0 +0,0,1,6.761573,6.160541,0,10.57626,0,0,0 +6,0,1,6.761573,6.160541,1,6.9,0,1,0 +0,0,1,6.761573,6.160541,1,6.9,0,1,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,6.9,1,0,0 +13,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +5,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +5,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +5,0,1,6.109248,6.160541,0,20.7,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +4,0,1,6.109248,6.160541,0,20.7,1,0,0 +6,0,1,6.109248,6.160541,0,20.7,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +0,4.564348,0,5.991465,6.042758,0,6.9,0,1,0 +0,4.564348,0,5.991465,6.042758,0,6.9,0,1,0 +0,4.564348,0,5.991465,6.042758,0,6.9,0,1,0 +0,4.564348,0,5.991465,6.042758,0,10.57626,0,0,0 +0,4.564348,0,5.991465,6.042758,0,10.57626,0,0,0 +0,4.564348,0,5.991465,6.042758,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,17.2,0,1,0 +3,0,1,6.109248,6.160541,0,17.2,0,1,0 +0,0,1,6.109248,6.160541,0,17.2,0,1,0 +0,0,1,6.109248,6.160541,0,17.2,0,1,0 +2,0,1,6.109248,6.160541,0,17.2,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +2,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +4,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +4,0,1,5.010635,5.061929,0,10.3,1,0,0 +2,0,1,5.010635,5.061929,0,10.3,1,0,0 +5,0,1,5.010635,5.061929,0,10.3,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +6,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,24.1,0,1,0 +2,0,0,0,0,0,24.1,0,1,0 +8,0,0,0,0,0,24.1,0,1,0 +12,0,0,0,0,0,24.1,0,1,0 +16,0,0,0,0,0,24.1,0,1,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.3,1,0,0 +7,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +0,0,0,5.970139,0,0,3.4,0,0,0 +0,0,0,5.970139,0,0,3.4,0,0,0 +1,0,0,5.970139,0,0,3.4,0,0,0 +1,0,0,5.970139,0,0,3.4,0,0,0 +0,0,0,5.970139,0,0,3.4,0,0,0 +0,0,0,5.970139,0,0,0,1,0,0 +0,0,0,5.970139,0,0,0,1,0,0 +0,0,0,5.970139,0,0,0,1,0,0 +0,0,0,5.970139,0,0,0,1,0,0 +0,0,0,5.970139,0,0,0,1,0,0 +0,0,0,5.970139,0,0,10.57626,0,0,0 +0,0,0,5.970139,0,0,10.57626,0,0,0 +0,0,0,5.970139,0,0,10.57626,0,0,0 +0,0,0,5.970139,0,0,10.57626,0,0,0 +0,0,0,5.970139,0,0,10.57626,0,0,0 +1,0,0,5.970139,0,0,10.57626,1,0,0 +0,0,0,5.970139,0,0,10.57626,1,0,0 +0,0,0,5.970139,0,0,10.57626,1,0,0 +0,0,0,5.970139,0,0,10.57626,1,0,0 +0,0,0,5.970139,0,0,10.57626,1,0,0 +0,0,0,5.970139,0,0,10.57626,1,0,0 +0,0,0,5.970139,0,0,10.57626,1,0,0 +0,0,0,5.970139,0,0,10.57626,1,0,0 +0,0,0,5.970139,0,0,10.57626,1,0,0 +0,0,0,5.970139,0,0,10.57626,1,0,0 +5,0,1,6.109248,6.160541,0,20.7,0,0,0 +3,0,1,6.109248,6.160541,0,20.7,0,0,0 +3,0,1,6.109248,6.160541,0,20.7,0,0,0 +4,0,1,6.109248,6.160541,0,13.8,0,0,0 +1,0,1,6.109248,6.160541,0,13.8,0,0,0 +4,0,1,6.109248,6.160541,0,13.8,0,0,0 +5,0,0,6.240744,0,0,3.4,1,0,0 +7,0,0,6.240744,0,0,3.4,1,0,0 +4,0,0,6.240744,0,0,3.4,1,0,0 +1,0,0,6.240744,0,0,3.4,1,0,0 +1,0,0,6.240744,0,0,3.4,1,0,0 +11,0,0,6.240744,0,0,10.57626,1,0,0 +15,0,0,6.240744,0,0,10.57626,1,0,0 +6,0,0,6.240744,0,0,10.57626,1,0,0 +2,0,0,6.240744,0,0,10.57626,1,0,0 +2,0,0,6.240744,0,0,10.57626,1,0,0 +13,0,0,6.240744,0,0,10.57626,1,0,0 +17,0,0,6.240744,0,0,10.57626,1,0,0 +10,0,0,6.240744,0,0,10.57626,1,0,0 +13,0,0,6.240744,0,0,10.57626,1,0,0 +11,0,0,6.240744,0,0,10.57626,1,0,0 +5,0,0,6.240744,0,0,3.4,1,0,0 +7,0,0,6.240744,0,0,3.4,1,0,0 +5,0,0,6.240744,0,0,3.4,1,0,0 +4,0,0,6.240744,0,0,3.4,1,0,0 +3,0,0,6.240744,0,0,3.4,1,0,0 +7,0,1,5.703783,5.755076,0,13.8,1,0,0 +9,0,1,5.703783,5.755076,0,13.8,1,0,0 +11,0,1,5.703783,5.755076,0,13.8,1,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +2,0,1,5.703783,5.755076,0,3.4,1,0,0 +0,0,1,5.703783,5.755076,0,3.4,1,0,0 +0,0,1,5.010635,5.061929,0,3.4,1,0,0 +0,0,1,5.010635,5.061929,0,3.4,1,0,0 +0,0,1,5.010635,5.061929,0,3.4,1,0,0 +0,3.258096,0,6.471356,5.771441,0,10.57626,1,0,0 +0,3.258096,0,6.471356,5.771441,0,10.57626,1,0,0 +0,3.258096,0,6.471356,5.771441,0,10.57626,1,0,0 +0,3.258096,0,6.471356,5.771441,0,0,0,1,0 +1,3.258096,0,6.471356,5.771441,0,0,0,1,0 +0,3.258096,0,6.471356,5.771441,0,0,0,1,0 +0,3.258096,0,6.471356,5.771441,0,3.4,1,0,0 +0,3.258096,0,6.471356,5.771441,0,3.4,1,0,0 +0,3.258096,0,6.471356,5.771441,0,3.4,1,0,0 +0,3.258096,0,6.471356,5.771441,0,10.57626,1,0,0 +0,3.258096,0,6.471356,5.771441,0,10.57626,1,0,0 +0,3.258096,0,6.471356,5.771441,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +1,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +4,0,0,0,0,0,3.4,1,0,0 +1,4.564348,0,7.06732,6.675624,0,10.57626,0,0,0 +1,4.564348,0,7.06732,6.675624,0,10.57626,0,0,0 +0,4.564348,0,7.06732,6.675624,0,10.57626,0,0,0 +5,4.564348,0,7.06732,6.675624,0,10.57626,0,0,0 +8,4.564348,0,7.06732,6.675624,0,10.57626,0,0,0 +5,4.564348,0,7.06732,6.675624,0,13.8,0,0,0 +4,4.564348,0,7.06732,6.675624,0,13.8,0,0,0 +4,4.564348,0,7.06732,6.675624,0,13.8,0,0,0 +6,4.564348,0,7.06732,6.675624,0,13.8,0,0,0 +4,4.564348,0,7.06732,6.675624,0,13.8,0,0,0 +2,4.564348,0,7.06732,6.675624,0,3.4,0,0,0 +0,4.564348,0,7.06732,6.675624,0,3.4,0,0,0 +0,4.564348,0,7.06732,6.675624,0,3.4,0,0,0 +0,4.564348,0,7.06732,6.675624,0,3.4,0,0,0 +0,4.564348,0,7.06732,6.675624,0,3.4,0,0,0 +5,4.564348,0,7.06732,6.675624,1,10.57626,0,0,0 +9,4.564348,0,7.06732,6.675624,1,10.57626,0,0,0 +3,4.564348,0,7.06732,6.675624,1,10.57626,0,0,0 +4,4.564348,0,7.06732,6.675624,1,10.57626,0,0,0 +4,4.564348,0,7.06732,6.675624,1,10.57626,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +5,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +5,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +1,0,0,5.009835,0,0,0,1,0,0 +2,0,0,5.009835,0,0,0,1,0,0 +0,0,0,5.009835,0,0,0,1,0,0 +0,0,0,5.009835,0,0,6.9,0,0,0 +0,0,0,5.009835,0,0,6.9,0,0,0 +0,0,0,5.009835,0,0,6.9,0,0,0 +2,0,0,3.401197,0,0,10.57626,0,0,0 +4,0,0,3.401197,0,0,10.57626,0,0,0 +2,0,0,3.401197,0,0,10.57626,0,0,0 +7,0,0,3.401197,0,0,17.2,1,0,0 +3,0,0,3.401197,0,0,17.2,1,0,0 +2,0,0,3.401197,0,0,17.2,1,0,0 +11,0,0,3.401197,0,0,10.57626,1,0,0 +14,0,0,3.401197,0,0,10.57626,1,0,0 +14,0,0,3.401197,0,0,10.57626,1,0,0 +0,0,0,3.401197,0,0,13.8,1,0,0 +0,0,0,3.401197,0,0,13.8,1,0,0 +1,0,0,3.401197,0,0,13.8,1,0,0 +2,0,0,3.401197,0,0,3.4,0,0,0 +1,0,0,3.401197,0,0,3.4,0,0,0 +2,0,0,3.401197,0,0,3.4,0,0,0 +13,4.564348,0,6.907755,6.959049,0,24.1,0,0,0 +3,4.564348,0,6.907755,6.959049,0,24.1,0,0,0 +9,4.564348,0,6.907755,6.959049,0,24.1,0,0,0 +4,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +4,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +8,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +2,3.258096,0,6.620073,8.006368,1,27.6,0,0,0 +3,3.258096,0,6.620073,8.006368,1,27.6,0,0,0 +2,3.258096,0,6.620073,8.006368,1,27.6,0,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +5,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +5,0,1,6.109248,6.160541,0,17.2,0,0,0 +1,0,1,6.109248,6.160541,0,17.2,0,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,4.564348,0,6.537792,6.282464,0,10.57626,1,0,0 +0,4.564348,0,6.537792,6.282464,1,10.3,1,0,0 +0,4.564348,0,6.537792,6.282464,1,10.3,1,0,0 +0,4.564348,0,6.537792,6.282464,0,10.3,1,0,0 +0,4.564348,0,6.537792,6.282464,0,10.3,1,0,0 +0,4.564348,0,6.537792,6.282464,1,10.3,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +4,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,4.564348,0,6.235587,6.28688,0,10.57626,0,0,0 +0,4.564348,0,6.235587,6.28688,0,10.57626,0,0,0 +0,4.564348,0,6.235587,6.28688,0,10.57626,0,0,0 +0,4.564348,0,6.235587,6.28688,0,10.57626,0,0,0 +0,4.564348,0,6.235587,6.28688,0,10.57626,0,0,0 +6,4.564348,0,6.235587,6.28688,0,10.57626,0,0,0 +0,4.564348,0,6.235587,6.28688,0,0,0,0,0 +1,4.564348,0,6.235587,6.28688,0,0,0,0,0 +3,4.564348,0,6.235587,6.28688,0,0,0,0,0 +0,4.564348,0,6.235587,6.28688,0,6.9,1,0,0 +0,4.564348,0,6.235587,6.28688,0,6.9,1,0,0 +1,4.564348,0,6.235587,6.28688,0,6.9,1,0,0 +0,4.564348,0,6.235587,6.28688,0,10.57626,0,0,0 +0,4.564348,0,6.235587,6.28688,0,10.57626,0,0,0 +0,4.564348,0,6.235587,6.28688,0,10.57626,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +6,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +2,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +1,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +7,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +15,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +2,4.564348,0,0,5.714254,1,13.8,1,0,0 +1,4.564348,0,0,5.714254,1,13.8,1,0,0 +4,4.564348,0,0,5.714254,1,13.8,1,0,0 +0,4.564348,0,4.959693,5.010986,1,6.9,1,0,0 +0,4.564348,0,4.959693,5.010986,1,6.9,1,0,0 +0,4.564348,0,4.959693,5.010986,1,6.9,1,0,0 +0,4.564348,0,4.959693,5.010986,1,13.8,0,0,0 +0,4.564348,0,4.959693,5.010986,1,13.8,0,0,0 +0,4.564348,0,4.959693,5.010986,1,13.8,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,0,1,0 +0,0,0,0,0,0,10.57626,0,1,0 +0,0,0,0,0,0,10.57626,0,1,0 +0,0,0,4.992878,0,.1442925,10.57626,0,0,0 +0,0,0,4.992878,0,.1442925,10.57626,0,0,0 +0,0,0,4.992878,0,.1442925,10.57626,0,0,0 +0,0,0,4.992878,0,1,6.9,1,0,0 +0,0,0,4.992878,0,1,6.9,1,0,0 +0,0,0,4.992878,0,1,6.9,1,0,0 +0,0,0,4.992878,0,.1442925,10.57626,0,0,0 +4,0,0,4.992878,0,.1442925,10.57626,0,0,0 +0,0,0,4.992878,0,.1442925,10.57626,0,0,0 +0,0,0,4.992878,0,0,13.8,1,0,0 +0,0,0,4.992878,0,0,13.8,1,0,0 +0,0,0,4.992878,0,0,13.8,1,0,0 +0,4.564348,0,5.172754,5.224048,0,10.3,1,0,0 +0,4.564348,0,5.172754,5.224048,0,10.3,1,0,0 +0,4.564348,0,5.172754,5.224048,0,10.3,1,0,0 +0,4.564348,0,5.172754,5.224048,.1442925,10.57626,1,0,0 +0,4.564348,0,5.172754,5.224048,.1442925,10.57626,1,0,0 +0,4.564348,0,5.172754,5.224048,.1442925,10.57626,1,0,0 +0,4.564348,0,5.172754,5.224048,.1442925,10.57626,0,0,0 +0,4.564348,0,5.172754,5.224048,.1442925,10.57626,0,0,0 +0,4.564348,0,5.172754,5.224048,.1442925,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +12,0,0,6.471356,0,0,3.4,0,0,0 +10,0,0,6.471356,0,0,3.4,0,0,0 +10,0,0,6.471356,0,0,3.4,0,0,0 +8,0,0,6.471356,0,1,10.3,0,0,0 +2,0,0,6.471356,0,1,10.3,0,0,0 +7,0,0,6.471356,0,1,10.3,0,0,0 +0,0,0,6.471356,0,0,10.57626,0,0,0 +1,0,0,6.471356,0,0,10.57626,0,0,0 +1,0,0,6.471356,0,0,10.57626,0,0,0 +4,0,0,6.471356,0,0,10.57626,0,0,0 +2,0,0,6.471356,0,0,10.57626,0,0,0 +5,0,0,6.471356,0,0,10.57626,0,0,0 +8,0,0,6.471356,0,0,10.57626,0,0,0 +3,0,0,6.471356,0,0,10.57626,0,0,0 +2,0,0,6.471356,0,0,10.57626,0,0,0 +0,3.258096,0,5.810392,7.196687,0,0,0,0,0 +0,3.258096,0,5.810392,7.196687,0,0,0,0,0 +0,3.258096,0,5.810392,7.196687,0,0,0,0,0 +0,3.258096,0,5.810392,7.196687,0,0,0,0,0 +0,3.258096,0,5.810392,7.196687,0,0,0,0,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,0,1,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,0,1,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,0,1,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,0,1,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,0,1,0 +0,3.258096,0,5.810392,7.196687,0,6.9,0,1,0 +0,3.258096,0,5.810392,7.196687,0,6.9,0,1,0 +0,3.258096,0,5.810392,7.196687,0,6.9,0,1,0 +0,3.258096,0,5.810392,7.196687,0,6.9,0,1,0 +0,3.258096,0,5.810392,7.196687,0,6.9,0,1,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +2,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +0,3.258096,0,5.810392,7.196687,0,10.57626,1,0,0 +0,3.258096,0,5.810392,7.196687,0,3.4,0,1,0 +0,3.258096,0,5.810392,7.196687,0,3.4,0,1,0 +0,3.258096,0,5.810392,7.196687,0,3.4,0,1,0 +0,3.258096,0,5.810392,7.196687,0,3.4,0,1,0 +1,3.258096,0,5.810392,7.196687,0,3.4,0,1,0 +0,3.258096,0,5.810392,7.196687,0,0,0,1,0 +1,3.258096,0,5.810392,7.196687,0,0,0,1,0 +0,3.258096,0,5.810392,7.196687,0,0,0,1,0 +0,3.258096,0,5.810392,7.196687,0,0,0,1,0 +0,3.258096,0,5.810392,7.196687,0,0,0,1,0 +0,3.258096,0,5.810392,7.196687,0,3.4,1,0,0 +0,3.258096,0,5.810392,7.196687,0,3.4,1,0,0 +0,3.258096,0,5.810392,7.196687,0,3.4,1,0,0 +0,3.258096,0,5.810392,7.196687,0,3.4,1,0,0 +0,3.258096,0,5.810392,7.196687,0,3.4,1,0,0 +0,0,0,5.731462,0,0,0,0,0,0 +1,0,0,5.731462,0,0,0,0,0,0 +4,0,0,5.731462,0,0,0,0,0,0 +1,0,0,5.731462,0,0,13.8,0,1,0 +1,0,0,5.731462,0,0,13.8,0,1,0 +2,0,0,5.731462,0,0,13.8,0,1,0 +0,0,0,7.080969,0,0,10.3,1,0,0 +1,0,0,7.080969,0,0,10.3,1,0,0 +4,0,0,7.080969,0,0,10.3,1,0,0 +0,0,0,7.080969,0,.1442925,10.57626,1,0,0 +1,0,0,7.080969,0,.1442925,10.57626,1,0,0 +1,0,0,7.080969,0,.1442925,10.57626,1,0,0 +0,0,0,7.080969,0,0,0,1,0,0 +1,0,0,7.080969,0,0,0,1,0,0 +0,0,0,7.080969,0,0,0,1,0,0 +4,0,0,7.080969,0,0,3.4,1,0,0 +2,0,0,7.080969,0,0,3.4,1,0,0 +3,0,0,7.080969,0,0,3.4,1,0,0 +0,3.258096,0,0,8.006368,1,27.6,0,1,0 +0,3.258096,0,0,8.006368,1,27.6,0,1,0 +0,3.258096,0,0,8.006368,1,27.6,0,1,0 +4,3.258096,0,0,8.006368,1,27.6,0,1,0 +1,3.258096,0,0,8.006368,1,27.6,0,1,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +4,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +13,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,1,6.9,1,0,0 +2,4.564348,0,6.907755,6.959049,1,6.9,1,0,0 +1,4.564348,0,6.907755,6.959049,1,6.9,1,0,0 +0,0,0,3.809326,0,0,10.3,0,0,0 +0,0,0,3.809326,0,0,10.3,0,0,0 +0,0,0,3.809326,0,0,10.3,0,0,0 +0,0,0,3.809326,0,0,10.3,0,0,0 +1,0,0,3.809326,0,0,10.3,0,0,0 +1,0,0,3.809326,0,0,6.9,0,0,0 +1,0,0,3.809326,0,0,6.9,0,0,0 +0,0,0,3.809326,0,0,6.9,0,0,0 +0,0,0,3.809326,0,0,6.9,0,0,0 +2,0,0,3.809326,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +2,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +3,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,1,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,1,10.3,1,0,0 +2,4.564348,0,6.907755,6.959049,1,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +3,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +6,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +5,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +4,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +5,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +0,3.931826,0,0,7.600903,1,20.7,0,1,0 +0,3.931826,0,0,7.600903,1,20.7,0,1,0 +0,3.931826,0,0,7.600903,1,20.7,0,1,0 +0,3.931826,0,0,7.600903,0,3.4,0,0,0 +0,3.931826,0,0,7.600903,0,3.4,0,0,0 +0,3.931826,0,0,7.600903,0,3.4,0,0,0 +1,3.931826,0,0,7.600903,0,13.8,1,0,0 +1,3.931826,0,0,7.600903,0,13.8,1,0,0 +0,3.931826,0,0,7.600903,0,13.8,1,0,0 +0,0,1,0,6.160541,0,6.9,1,0,0 +0,0,1,0,6.160541,0,6.9,1,0,0 +0,0,1,0,6.160541,0,6.9,1,0,0 +0,0,1,0,6.160541,0,6.9,1,0,0 +0,0,1,0,6.160541,0,6.9,1,0,0 +1,0,1,0,6.160541,1,20.7,0,0,1 +0,0,1,0,6.160541,1,20.7,0,0,1 +0,0,1,0,6.160541,1,20.7,0,0,1 +0,0,1,0,6.160541,1,20.7,0,0,1 +0,0,1,0,6.160541,1,20.7,0,0,1 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,0,6.384047,0,0,10.57626,0,0,0 +3,0,0,6.384047,0,0,10.57626,0,0,0 +1,0,0,6.384047,0,0,10.57626,0,0,0 +1,0,0,6.384047,0,0,0,1,0,0 +2,0,0,6.384047,0,0,0,1,0,0 +1,0,0,6.384047,0,0,0,1,0,0 +1,0,0,6.384047,0,0,13.8,1,0,0 +4,0,0,6.384047,0,0,13.8,1,0,0 +1,0,0,6.384047,0,0,13.8,1,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,0,0,0,0,0,3.4,0,1,0 +1,0,0,0,0,0,3.4,0,1,0 +0,0,0,0,0,0,3.4,0,1,0 +7,0,0,6.437399,0,1,37.9,0,1,0 +5,0,0,6.437399,0,1,37.9,0,1,0 +6,0,0,6.437399,0,1,37.9,0,1,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,10.57626,1,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +5,0,0,0,0,0,10.57626,1,0,0 +9,0,0,6.437399,0,0,17.2,1,0,0 +3,0,0,6.437399,0,0,17.2,1,0,0 +5,0,0,6.437399,0,0,17.2,1,0,0 +2,0,0,0,0,1,13.8,1,0,0 +2,0,0,0,0,1,13.8,1,0,0 +1,0,0,0,0,1,13.8,1,0,0 +2,0,0,6.437399,0,0,0,0,1,0 +2,0,1,6.109248,6.160541,1,10.3,1,0,0 +2,0,1,6.109248,6.160541,1,10.3,1,0,0 +6,0,1,6.109248,6.160541,1,10.3,1,0,0 +5,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,0,1,6.109248,6.160541,0,10.57626,0,0,0 +4,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,1,0,0,0,0 +3,0,1,6.109248,6.160541,1,0,0,0,0 +0,0,1,6.109248,6.160541,1,0,0,0,0 +4,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +6,0,1,6.109248,6.160541,0,3.4,0,0,0 +3,0,1,6.109248,6.160541,0,3.4,0,0,0 +8,0,1,6.109248,6.160541,0,3.4,0,0,0 +9,0,0,6.148468,0,1,58.6,0,0,1 +1,0,0,6.148468,0,1,58.6,0,0,1 +7,0,0,6.148468,0,1,58.6,0,0,1 +19,0,0,6.148468,0,1,58.6,0,0,1 +21,0,0,6.148468,0,1,58.6,0,0,1 +1,0,0,6.148468,0,0,10.3,0,1,0 +0,0,0,6.148468,0,0,10.3,0,1,0 +1,0,0,6.148468,0,0,10.3,0,1,0 +0,0,0,6.148468,0,0,10.3,0,1,0 +2,0,0,6.148468,0,0,6.9,0,0,1 +0,0,0,6.148468,0,0,6.9,0,0,1 +0,0,0,6.148468,0,0,6.9,0,0,1 +4,0,0,6.148468,0,0,6.9,0,0,1 +7,0,0,6.148468,0,0,6.9,0,0,1 +0,0,0,6.148468,0,0,3.4,0,0,0 +0,0,0,6.148468,0,0,3.4,0,0,0 +0,0,0,6.148468,0,0,3.4,0,0,0 +0,0,0,6.148468,0,0,3.4,0,0,0 +1,0,0,6.148468,0,0,3.4,0,0,0 +0,0,0,4.032469,0,1,0,0,0,0 +0,0,0,4.032469,0,1,0,0,0,0 +0,0,0,4.032469,0,1,0,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +3,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,20.7,0,0,0 +3,0,0,0,0,0,20.7,0,0,0 +1,0,0,0,0,0,20.7,0,0,0 +1,0,0,0,0,0,20.7,0,0,0 +2,3.258096,0,5.646683,7.032977,0,3.4,0,0,0 +0,3.258096,0,5.646683,7.032977,0,3.4,0,0,0 +4,3.258096,0,5.646683,7.032977,0,3.4,0,0,0 +2,3.258096,0,5.646683,7.032977,0,10.57626,0,0,0 +2,3.258096,0,5.646683,7.032977,0,10.57626,0,0,0 +12,3.258096,0,5.646683,7.032977,0,10.57626,0,0,0 +0,3.258096,0,5.646683,7.032977,0,3.4,0,0,0 +0,3.258096,0,5.646683,7.032977,0,3.4,0,0,0 +2,3.258096,0,5.646683,7.032977,0,3.4,0,0,0 +3,0,0,5.879527,0,0,6.9,1,0,0 +4,0,0,5.879527,0,0,6.9,1,0,0 +1,0,0,5.879527,0,0,6.9,1,0,0 +0,0,0,5.879527,0,0,6.9,1,0,0 +0,0,0,5.879527,0,0,6.9,1,0,0 +0,0,0,5.879527,0,0,10.3,1,0,0 +3,0,0,5.879527,0,0,10.3,1,0,0 +0,0,0,5.879527,0,0,10.3,1,0,0 +0,0,0,5.879527,0,0,10.3,1,0,0 +0,0,0,5.879527,0,0,10.3,1,0,0 +2,0,0,5.879527,0,0,10.57626,0,0,0 +4,0,0,5.879527,0,0,10.57626,0,0,0 +3,0,0,5.879527,0,0,10.57626,0,0,0 +5,0,0,5.879527,0,0,10.57626,0,0,0 +0,0,0,5.879527,0,0,10.57626,0,0,0 +1,0,0,0,0,0,17.2,1,0,0 +5,0,0,0,0,0,17.2,1,0,0 +0,0,0,0,0,0,17.2,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +3,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,10.3,0,1,0 +2,0,0,0,0,0,10.3,0,1,0 +3,0,0,0,0,0,10.3,0,1,0 +3,0,0,0,0,0,10.3,0,1,0 +3,0,0,0,0,0,10.3,0,1,0 +1,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,1,3.4,1,0,0 +4,0,0,0,0,1,3.4,1,0,0 +1,0,0,0,0,1,3.4,1,0,0 +1,0,0,0,0,1,3.4,1,0,0 +3,0,0,0,0,1,3.4,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +2,0,0,0,0,0,17.2,0,0,0 +0,0,0,0,0,0,17.2,0,0,0 +0,0,0,0,0,0,17.2,0,0,0 +3,0,0,0,0,0,6.9,0,0,1 +1,0,0,0,0,0,6.9,0,0,1 +5,0,0,0,0,0,6.9,0,0,1 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +4,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +2,0,1,6.368736,5.755076,0,10.3,1,0,0 +0,0,1,6.368736,5.755076,0,10.3,1,0,0 +3,0,1,6.368736,5.755076,0,10.3,1,0,0 +1,0,1,6.368736,5.755076,0,6.9,0,0,0 +0,0,1,6.368736,5.755076,0,6.9,0,0,0 +2,0,1,6.368736,5.755076,0,6.9,0,0,0 +1,0,1,6.651572,5.755076,0,13.8,0,0,0 +1,0,1,6.651572,5.755076,0,13.8,0,0,0 +5,0,1,6.651572,5.755076,0,13.8,0,0,0 +2,0,1,6.651572,5.755076,0,13.8,0,0,0 +4,0,1,6.651572,5.755076,0,13.8,0,0,0 +0,0,1,6.651572,5.755076,0,10.57626,0,0,0 +3,0,1,6.651572,5.755076,0,10.57626,0,0,0 +4,0,1,6.651572,5.755076,0,10.57626,0,0,0 +2,0,1,6.651572,5.755076,0,10.57626,0,0,0 +1,0,1,6.651572,5.755076,0,10.57626,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +0,3.258096,0,6.55108,7.937375,0,3.4,0,0,0 +1,3.258096,0,6.55108,7.937375,0,3.4,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +2,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +1,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +2,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +1,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +3,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.57626,0,0,0 +1,3.258096,0,6.55108,7.937375,1,17.2,0,1,0 +2,3.258096,0,6.55108,7.937375,1,17.2,0,1,0 +2,3.258096,0,6.55108,7.937375,1,17.2,0,1,0 +3,3.258096,0,6.55108,7.937375,1,17.2,0,1,0 +3,3.258096,0,6.55108,7.937375,0,10.3,0,0,0 +2,3.258096,0,6.55108,7.937375,0,10.3,0,0,0 +1,3.258096,0,6.55108,7.937375,0,10.3,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.3,0,0,0 +5,0,0,6.031934,0,.1442925,10.57626,0,0,0 +2,0,0,6.031934,0,.1442925,10.57626,0,0,0 +4,0,0,6.031934,0,.1442925,10.57626,0,0,0 +2,0,0,6.031934,0,.1442925,10.57626,0,0,0 +1,0,0,6.031934,0,.1442925,10.57626,0,0,0 +2,0,0,6.031934,0,.1442925,10.57626,0,0,0 +5,0,1,6.183674,6.160541,0,3.4,0,0,0 +0,0,1,6.183674,6.160541,0,3.4,0,0,0 +0,0,1,6.183674,6.160541,0,3.4,0,0,0 +5,0,1,6.183674,6.160541,0,3.4,0,0,0 +0,0,1,6.183674,6.160541,0,3.4,0,0,0 +0,0,1,6.183674,6.160541,0,3.4,0,0,0 +8,0,1,6.183674,6.160541,0,10.3,1,0,0 +1,0,1,6.183674,6.160541,0,10.3,1,0,0 +4,0,1,6.183674,6.160541,0,10.3,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +3,3.258096,0,6.620073,8.006368,0,0,0,0,0 +1,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,1,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,1,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,1,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +5,0,0,0,0,0,20.7,1,0,0 +1,0,0,0,0,0,20.7,1,0,0 +0,0,0,0,0,0,20.7,1,0,0 +2,0,0,0,0,0,10.57626,1,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +5,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +13,0,0,0,0,0,13.8,0,0,0 +2,0,0,0,0,1,13.8,1,0,0 +3,0,0,0,0,1,13.8,1,0,0 +1,0,0,0,0,1,13.8,1,0,0 +2,0,0,0,0,1,13.8,1,0,0 +5,0,0,0,0,1,13.8,1,0,0 +0,4.564348,0,0,6.804848,0,10.57626,1,0,0 +0,4.564348,0,0,6.804848,0,10.57626,1,0,0 +0,4.564348,0,0,6.804848,0,10.57626,1,0,0 +0,4.564348,0,0,6.804848,0,10.57626,1,0,0 +0,4.564348,0,0,6.804848,0,10.57626,1,0,0 +0,4.564348,0,0,6.804848,0,10.57626,1,0,0 +0,4.564348,0,0,6.804848,0,10.57626,1,0,0 +0,4.564348,0,0,6.804848,0,10.57626,1,0,0 +0,4.564348,0,0,6.804848,0,10.57626,1,0,0 +0,4.564348,0,0,6.804848,0,10.3,0,0,0 +0,4.564348,0,0,6.804848,0,10.3,0,0,0 +0,4.564348,0,0,6.804848,0,10.3,0,0,0 +0,4.564348,0,0,6.804848,0,3.4,1,0,0 +0,4.564348,0,0,6.804848,0,3.4,1,0,0 +0,4.564348,0,0,6.804848,0,3.4,1,0,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +8,0,0,0,0,0,20.7,1,0,0 +1,0,0,0,0,0,20.7,1,0,0 +3,0,0,0,0,0,20.7,1,0,0 +16,4.564348,0,6.907755,6.959049,1,10.57626,0,0,1 +19,4.564348,0,6.907755,6.959049,1,10.57626,0,0,1 +14,4.564348,0,6.907755,6.959049,1,10.57626,0,0,1 +17,4.564348,0,6.907755,6.959049,1,10.57626,0,0,1 +7,4.564348,0,6.907755,6.959049,1,10.57626,0,0,1 +4,4.564348,0,6.907755,6.959049,1,3.4,0,1,0 +9,4.564348,0,6.907755,6.959049,1,3.4,0,1,0 +3,4.564348,0,6.907755,6.959049,1,3.4,0,1,0 +2,4.564348,0,6.907755,6.959049,1,3.4,0,1,0 +0,4.564348,0,6.907755,6.959049,1,3.4,0,1,0 +9,4.564348,0,6.907755,6.959049,1,24.1,0,1,0 +3,4.564348,0,6.907755,6.959049,1,24.1,0,1,0 +2,4.564348,0,6.907755,6.959049,1,24.1,0,1,0 +3,4.564348,0,6.907755,6.959049,1,24.1,0,1,0 +7,4.564348,0,6.907755,6.959049,1,24.1,0,1,0 +21,4.564348,0,6.907755,6.959049,1,27.6,0,0,1 +23,4.564348,0,6.907755,6.959049,1,27.6,0,0,1 +21,4.564348,0,6.907755,6.959049,1,27.6,0,0,1 +27,4.564348,0,6.907755,6.959049,1,27.6,0,0,1 +29,4.564348,0,6.907755,6.959049,1,27.6,0,0,1 +12,4.564348,0,6.907755,6.959049,1,31,0,1,0 +5,4.564348,0,6.907755,6.959049,1,31,0,1,0 +8,4.564348,0,6.907755,6.959049,1,31,0,1,0 +4,4.564348,0,6.907755,6.959049,0,10.57626,0,1,0 +4,4.564348,0,6.907755,6.959049,0,10.57626,0,1,0 +2,4.564348,0,6.907755,6.959049,0,10.57626,0,1,0 +2,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +5,4.564348,0,6.907755,6.959049,0,10.57626,0,1,0 +4,4.564348,0,6.907755,6.959049,0,10.57626,0,1,0 +3,4.564348,0,6.907755,6.959049,0,10.57626,0,1,0 +3,0,0,6.254329,0,0,10.57626,0,0,0 +1,0,0,6.254329,0,0,10.57626,0,0,0 +5,0,0,6.254329,0,0,10.57626,0,0,0 +7,0,0,6.254329,0,0,10.57626,0,0,0 +4,0,0,6.254329,0,0,10.57626,0,0,0 +0,0,0,6.254329,0,0,0,0,0,0 +5,0,0,6.254329,0,0,0,0,0,0 +0,0,0,6.254329,0,0,0,0,0,0 +3,0,0,6.254329,0,0,0,0,0,0 +10,0,0,6.254329,0,0,0,0,0,0 +9,0,0,6.254329,0,0,34.5,1,0,0 +13,0,0,6.254329,0,0,34.5,1,0,0 +22,0,0,6.254329,0,0,34.5,1,0,0 +14,0,0,6.254329,0,0,34.5,1,0,0 +17,0,0,6.254329,0,0,34.5,1,0,0 +2,0,0,6.254329,0,0,10.3,0,0,0 +1,0,0,6.254329,0,0,10.3,0,0,0 +1,0,0,6.254329,0,0,10.3,0,0,0 +1,0,0,6.254329,0,0,10.3,0,0,0 +5,0,0,6.254329,0,0,10.3,0,0,0 +2,3.258096,0,6.55108,7.937375,0,10.3,0,0,0 +0,3.258096,0,6.55108,7.937375,0,10.3,0,0,0 +8,3.258096,0,6.55108,7.937375,0,10.3,0,0,0 +3,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +0,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +1,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +0,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +1,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,1,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,1,10.57626,0,1,0 +1,3.258096,0,6.620073,8.006368,1,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,1,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,1,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,1,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,4.564348,0,4.945919,4.997212,0,10.3,1,0,0 +0,4.564348,0,4.945919,4.997212,0,10.3,1,0,0 +0,4.564348,0,4.945919,4.997212,0,10.3,1,0,0 +0,4.564348,0,4.945919,4.997212,0,10.57626,0,1,0 +0,4.564348,0,4.945919,4.997212,0,10.57626,0,1,0 +0,4.564348,0,4.945919,4.997212,0,10.57626,0,1,0 +0,4.564348,0,4.945919,4.997212,1,0,1,0,0 +3,4.564348,0,4.945919,4.997212,1,0,1,0,0 +3,4.564348,0,4.945919,4.997212,1,0,1,0,0 +0,4.564348,0,4.945919,4.997212,1,10.3,0,0,1 +0,4.564348,0,4.945919,4.997212,1,10.3,0,0,1 +1,4.564348,0,4.945919,4.997212,1,10.3,0,0,1 +0,4.564348,0,4.945919,4.997212,0,0,0,1,0 +0,4.564348,0,4.945919,4.997212,0,0,0,1,0 +1,4.564348,0,4.945919,4.997212,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,27.6,0,0,0 +2,0,1,6.109248,6.160541,0,27.6,0,0,0 +1,0,1,6.109248,6.160541,0,27.6,0,0,0 +0,0,1,6.109248,6.160541,0,27.6,0,0,0 +0,0,1,6.109248,6.160541,0,27.6,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,0,0 +4,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,4.564348,0,2.960105,3.011398,0,10.57626,1,0,0 +1,4.564348,0,2.960105,3.011398,0,10.57626,1,0,0 +0,4.564348,0,2.960105,3.011398,0,10.57626,1,0,0 +2,4.564348,0,2.960105,3.011398,0,13.8,1,0,0 +4,4.564348,0,2.960105,3.011398,0,13.8,1,0,0 +1,4.564348,0,2.960105,3.011398,0,13.8,1,0,0 +0,4.564348,0,2.960105,3.011398,0,0,1,0,0 +0,4.564348,0,2.960105,3.011398,0,0,1,0,0 +1,4.564348,0,2.960105,3.011398,0,10.57626,1,0,0 +0,4.564348,0,2.960105,3.011398,0,10.57626,1,0,0 +0,4.564348,0,2.960105,3.011398,0,10.57626,1,0,0 +0,4.564348,0,2.960105,3.011398,0,10.57626,1,0,0 +0,4.564348,0,2.960105,3.011398,0,10.57626,1,0,0 +0,4.564348,0,2.960105,3.011398,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +8,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +16,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +5,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,0,0,0 +1,0,0,5.294309,0,0,0,0,0,0 +4,0,0,5.294309,0,0,0,0,0,0 +2,0,0,5.294309,0,0,0,0,0,0 +2,0,0,5.294309,0,0,10.57626,0,0,0 +0,0,0,5.294309,0,0,10.57626,0,0,0 +1,0,0,5.294309,0,0,10.57626,0,0,0 +1,0,0,5.294309,0,0,0,0,0,0 +2,0,0,5.294309,0,0,0,0,0,0 +4,0,0,5.294309,0,0,0,0,0,0 +1,0,0,4.992878,0,0,20.7,0,0,0 +0,0,0,4.992878,0,0,20.7,0,0,0 +3,0,0,4.992878,0,0,10.57626,0,0,0 +5,0,0,4.992878,0,0,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,1,13.8,1,0,0 +2,3.258096,0,6.620073,8.006368,1,13.8,1,0,0 +4,3.258096,0,6.620073,8.006368,1,13.8,1,0,0 +3,3.258096,0,6.620073,8.006368,1,13.8,1,0,0 +4,3.258096,0,6.620073,8.006368,1,13.8,1,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +10,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +10,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +3,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +3,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,1,0 +0,0,1,6.109248,6.160541,0,10.3,0,1,0 +0,0,1,6.109248,6.160541,0,10.3,0,1,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +1,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +1,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,24.1,0,0,0 +0,4.564348,0,5.349961,5.401254,0,24.1,0,0,0 +2,4.564348,0,5.349961,5.401254,0,24.1,0,0,0 +1,4.564348,0,5.349961,5.401254,0,24.1,0,0,0 +2,4.564348,0,5.349961,5.401254,0,24.1,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +0,4.564348,0,5.349961,5.401254,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,24.1,0,0,0 +2,3.258096,0,6.620073,8.006368,0,24.1,0,0,0 +3,3.258096,0,6.620073,8.006368,0,24.1,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +1,3.258096,0,0,8.006368,0,10.57626,1,0,0 +0,3.258096,0,0,8.006368,0,10.57626,1,0,0 +0,3.258096,0,0,8.006368,0,10.57626,1,0,0 +0,3.258096,0,0,8.006368,0,10.57626,0,1,0 +0,3.258096,0,0,8.006368,0,10.57626,0,1,0 +1,3.258096,0,0,8.006368,0,10.57626,0,1,0 +3,3.258096,0,0,8.006368,0,6.9,1,0,0 +0,3.258096,0,0,8.006368,0,6.9,1,0,0 +1,3.258096,0,0,8.006368,0,6.9,1,0,0 +4,3.258096,0,0,8.006368,0,27.6,1,0,0 +1,3.258096,0,0,8.006368,0,27.6,1,0,0 +2,3.258096,0,0,8.006368,0,27.6,1,0,0 +2,3.258096,0,0,8.006368,0,10.57626,1,0,0 +0,3.258096,0,0,8.006368,0,10.57626,1,0,0 +0,3.258096,0,0,8.006368,0,10.57626,1,0,0 +6,0,1,6.507039,5.755076,1,17.2,0,1,0 +5,0,1,6.507039,5.755076,1,17.2,0,1,0 +7,0,1,6.507039,5.755076,1,17.2,0,1,0 +3,0,1,5.928099,5.755076,0,3.4,1,0,0 +0,0,1,5.928099,5.755076,0,3.4,1,0,0 +0,0,1,5.928099,5.755076,0,3.4,1,0,0 +2,0,1,6.507039,5.755076,0,10.3,1,0,0 +2,0,1,6.507039,5.755076,0,10.3,1,0,0 +4,0,1,6.507039,5.755076,0,10.3,1,0,0 +0,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,3.258096,0,0,8.006368,1,10.3,0,0,0 +0,3.258096,0,0,8.006368,1,10.3,0,0,0 +0,3.258096,0,0,8.006368,1,10.3,0,0,0 +0,3.258096,0,0,8.006368,1,10.57626,0,0,0 +0,3.258096,0,0,8.006368,1,10.57626,0,0,0 +0,3.258096,0,0,8.006368,1,10.57626,0,0,0 +0,3.258096,0,0,8.006368,0,13.8,1,0,0 +0,3.258096,0,0,8.006368,0,13.8,1,0,0 +1,3.258096,0,0,8.006368,0,13.8,1,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +5,0,1,6.109248,6.160541,0,6.9,0,1,0 +11,0,1,6.109248,6.160541,0,6.9,0,1,0 +1,0,1,6.109248,6.160541,0,6.9,0,1,0 +2,0,1,6.109248,6.160541,0,6.9,0,1,0 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +4,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,13.8,1,0,0 +2,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,13.8,0,0,0 +0,3.258096,0,0,6.635421,1,10.57626,0,1,0 +0,3.258096,0,0,6.635421,1,10.57626,0,1,0 +0,3.258096,0,0,6.635421,1,10.57626,0,1,0 +0,3.931826,0,0,6.984716,0,10.3,1,0,0 +0,3.931826,0,0,6.984716,0,10.3,1,0,0 +0,3.931826,0,0,6.984716,0,10.3,1,0,0 +0,3.931826,0,0,6.984716,0,10.3,1,0,0 +1,3.931826,0,0,6.984716,0,10.3,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,3.931826,0,0,6.984716,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,3.931826,0,6.867558,7.560705,1,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,1,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,1,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,1,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,1,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,10.57626,0,0,0 +0,3.931826,0,6.867558,7.560705,0,3.4,0,1,0 +0,3.931826,0,6.867558,7.560705,0,3.4,0,1,0 +1,3.931826,0,6.867558,7.560705,0,3.4,0,1,0 +1,3.931826,0,6.867558,7.560705,0,3.4,0,1,0 +0,3.931826,0,6.867558,7.560705,0,3.4,0,1,0 +0,0,0,6.656212,0,0,13.8,0,1,0 +0,0,0,6.656212,0,0,13.8,0,1,0 +0,0,0,6.656212,0,0,13.8,0,1,0 +0,0,0,6.656212,0,0,3.4,0,0,0 +3,0,0,6.656212,0,0,3.4,0,0,0 +2,0,0,6.656212,0,0,3.4,0,0,0 +0,0,0,6.656212,0,0,20.7,0,1,0 +0,0,0,6.656212,0,0,20.7,0,1,0 +0,0,0,6.656212,0,0,20.7,0,1,0 +0,0,1,0,6.160541,1,0,1,0,0 +0,0,1,0,6.160541,1,0,1,0,0 +0,0,1,0,6.160541,1,0,1,0,0 +2,0,1,0,6.160541,1,0,1,0,0 +7,0,1,0,6.160541,1,0,1,0,0 +0,0,1,0,6.160541,0,13.8,1,0,0 +0,0,1,0,6.160541,0,13.8,1,0,0 +0,0,1,0,6.160541,0,13.8,1,0,0 +1,0,1,0,6.160541,0,13.8,1,0,0 +1,0,1,0,6.160541,0,13.8,1,0,0 +0,0,1,0,6.160541,0,0,1,0,0 +0,0,1,0,6.160541,0,0,1,0,0 +3,0,1,0,6.160541,0,0,1,0,0 +3,0,1,0,6.160541,0,0,1,0,0 +2,0,1,0,6.160541,0,0,1,0,0 +1,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +3,0,1,0,6.160541,0,10.57626,1,0,0 +1,0,1,0,6.160541,0,10.57626,1,0,0 +2,0,1,0,6.160541,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,1,17.2,1,0,0 +3,4.564348,0,6.907755,6.959049,1,17.2,1,0,0 +7,4.564348,0,6.907755,6.959049,1,17.2,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +2,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +4,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +3,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +1,0,0,6.337321,0,0,10.3,1,0,0 +3,0,0,6.337321,0,0,10.3,1,0,0 +4,0,0,6.337321,0,0,10.3,1,0,0 +5,0,0,6.337321,0,0,10.3,1,0,0 +6,0,0,6.337321,0,0,10.3,1,0,0 +8,0,0,6.337321,0,0,10.3,1,0,0 +5,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +4,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +4,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +4,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +5,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +0,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +0,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +0,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +0,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +1,4.564348,0,6.476973,6.528265,0,10.3,0,1,0 +9,0,1,6.109248,6.160541,0,20.7,0,0,0 +5,0,1,6.109248,6.160541,0,20.7,0,0,0 +4,0,1,6.109248,6.160541,0,20.7,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +3,4.564348,0,6.907755,6.959049,0,0,0,0,0 +2,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,0,1,6.47148,5.755076,0,10.3,0,0,0 +8,0,1,6.47148,5.755076,0,10.3,0,0,0 +2,0,1,6.47148,5.755076,0,10.3,0,0,0 +3,0,1,6.47148,5.755076,1,27.6,0,0,0 +2,0,1,6.47148,5.755076,1,27.6,0,0,0 +4,0,1,6.47148,5.755076,1,27.6,0,0,0 +3,0,1,5.010635,5.061929,0,13.8,0,0,0 +2,0,1,5.010635,5.061929,0,13.8,0,0,0 +4,0,1,5.010635,5.061929,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +1,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +7,3.258096,0,6.620073,8.006368,1,20.7,0,1,0 +6,3.258096,0,6.620073,8.006368,1,20.7,0,1,0 +9,3.258096,0,6.620073,8.006368,1,20.7,0,1,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,1,0 +7,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +3,0,0,4.526127,0,0,20.7,0,0,1 +5,0,0,4.526127,0,0,20.7,0,0,1 +15,0,0,4.526127,0,0,20.7,0,0,1 +14,0,0,4.526127,0,0,24.1,0,1,0 +4,0,0,4.526127,0,0,24.1,0,1,0 +7,0,0,4.526127,0,0,24.1,0,1,0 +0,3.258096,0,0,5.243861,1,13.8,1,0,0 +7,3.258096,0,0,5.243861,1,13.8,1,0,0 +3,3.258096,0,0,5.243861,1,13.8,1,0,0 +0,3.258096,0,0,5.243861,0,0,0,0,0 +0,3.258096,0,0,5.243861,0,0,0,0,0 +2,3.258096,0,0,5.243861,0,0,0,0,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +2,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +0,4.564348,0,6.802395,6.853688,0,20.7,0,1,0 +2,4.564348,0,6.802395,6.853688,0,20.7,0,1,0 +4,4.564348,0,6.802395,6.853688,0,20.7,0,1,0 +12,4.564348,0,6.802395,6.853688,0,20.7,0,1,0 +5,4.564348,0,6.802395,6.853688,0,20.7,0,1,0 +0,4.564348,0,6.802395,6.853688,0,0,0,1,0 +0,4.564348,0,6.802395,6.853688,0,0,0,1,0 +0,4.564348,0,6.802395,6.853688,0,0,0,1,0 +0,4.564348,0,6.802395,6.853688,0,0,0,1,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +1,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +2,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +0,4.564348,0,6.802395,6.853688,0,3.4,1,0,0 +0,4.564348,0,6.802395,6.853688,0,3.4,1,0,0 +1,4.564348,0,6.802395,6.853688,0,3.4,1,0,0 +1,4.564348,0,6.802395,6.853688,0,3.4,1,0,0 +0,4.564348,0,6.802395,6.853688,0,3.4,1,0,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +0,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +6,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +3,4.564348,0,6.802395,6.853688,0,10.57626,1,0,0 +9,0,1,6.471356,6.160541,0,24.1,0,0,1 +10,0,1,6.471356,6.160541,0,24.1,0,0,1 +12,0,1,6.471356,6.160541,0,24.1,0,0,1 +18,0,1,6.471356,6.160541,0,10.3,0,0,0 +13,0,1,6.471356,6.160541,0,10.3,0,0,0 +11,0,1,6.471356,6.160541,0,10.3,0,0,0 +6,0,1,6.471356,6.160541,1,10.3,0,1,0 +4,0,1,6.471356,6.160541,1,10.3,0,1,0 +5,0,1,6.471356,6.160541,1,10.3,0,1,0 +0,0,0,5.671328,0,0,0,0,0,0 +4,0,0,5.671328,0,0,0,0,0,0 +3,0,0,5.671328,0,0,0,0,0,0 +1,4.564348,0,5.98202,5.799093,0,10.3,1,0,0 +0,4.564348,0,5.98202,5.799093,0,10.3,1,0,0 +0,4.564348,0,5.98202,5.799093,0,10.3,1,0,0 +3,4.564348,0,5.98202,5.799093,0,20.7,1,0,0 +5,4.564348,0,5.98202,5.799093,0,20.7,1,0,0 +2,4.564348,0,5.98202,5.799093,0,20.7,1,0,0 +6,0,0,6.819711,0,0,6.9,0,0,0 +7,0,0,6.819711,0,0,6.9,0,0,0 +1,0,0,6.819711,0,0,6.9,0,0,0 +1,0,0,6.819711,0,0,10.3,1,0,0 +3,0,0,6.819711,0,0,10.3,1,0,0 +0,0,0,6.819711,0,0,10.3,1,0,0 +0,0,1,0,5.061929,0,10.3,0,0,0 +4,0,1,0,5.061929,0,10.3,0,0,0 +0,0,1,0,5.061929,0,10.3,0,0,0 +0,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +10,0,0,0,0,0,0,1,0,0 +3,3.258096,0,6.210821,7.597116,0,10.57626,0,0,0 +1,3.258096,0,6.210821,7.597116,0,10.57626,0,0,0 +0,3.258096,0,6.210821,7.597116,0,10.57626,0,0,0 +3,3.258096,0,6.210821,7.597116,0,10.57626,0,0,0 +0,3.258096,0,6.210821,7.597116,0,10.57626,0,0,0 +0,3.258096,0,6.210821,7.597116,0,10.3,0,0,0 +0,3.258096,0,6.210821,7.597116,0,10.3,0,0,0 +1,3.258096,0,6.210821,7.597116,0,10.3,0,0,0 +0,3.258096,0,6.210821,7.597116,0,10.3,0,0,0 +0,3.258096,0,6.210821,7.597116,0,10.3,0,0,0 +1,3.258096,0,6.210821,7.597116,0,6.9,0,0,0 +0,3.258096,0,6.210821,7.597116,0,6.9,0,0,0 +0,3.258096,0,6.210821,7.597116,0,6.9,0,0,0 +0,3.258096,0,6.210821,7.597116,0,6.9,0,0,0 +1,3.258096,0,6.210821,7.597116,0,6.9,0,0,0 +2,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,10.57626,1,0,0 +0,0,1,5.703783,5.755076,0,10.57626,1,0,0 +0,0,1,5.703783,5.755076,0,10.57626,1,0,0 +0,0,0,4.510859,0,0,3.4,1,0,0 +2,0,0,4.510859,0,0,3.4,1,0,0 +0,0,0,4.510859,0,0,3.4,1,0,0 +0,0,0,4.510859,0,0,13.8,1,0,0 +0,0,0,4.510859,0,0,13.8,1,0,0 +0,0,0,4.510859,0,0,10.57626,1,0,0 +0,0,0,4.510859,0,0,10.57626,1,0,0 +4,0,0,6.437399,0,0,13.8,0,0,0 +4,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,0,1,5.671328,5.061929,0,6.9,0,0,0 +1,0,1,5.671328,5.061929,0,6.9,0,0,0 +2,0,1,5.671328,5.061929,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,1,0,0 +0,3.258096,0,6.620073,8.006368,0,0,1,0,0 +0,3.258096,0,6.620073,8.006368,0,0,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +7,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,4.564348,0,5.753049,5.804342,1,10.57626,1,0,0 +9,4.564348,0,5.753049,5.804342,1,10.57626,1,0,0 +0,4.564348,0,5.753049,5.804342,1,10.57626,1,0,0 +0,4.564348,0,5.753049,5.804342,1,10.57626,1,0,0 +1,4.564348,0,5.753049,5.804342,1,10.57626,1,0,0 +1,4.564348,0,5.753049,5.804342,1,10.57626,1,0,0 +0,4.564348,0,5.753049,5.804342,0,13.8,0,0,0 +0,4.564348,0,5.753049,5.804342,0,13.8,0,0,0 +6,4.564348,0,5.753049,5.804342,0,13.8,0,0,0 +15,0,0,6.23973,0,1,17.2,0,0,1 +4,0,0,6.23973,0,1,17.2,0,0,1 +12,0,0,6.23973,0,1,17.2,0,0,1 +14,0,0,6.23973,0,1,24.1,0,1,0 +16,0,0,6.23973,0,1,24.1,0,1,0 +14,0,0,6.23973,0,1,24.1,0,1,0 +8,0,0,6.23973,0,0,3.4,0,0,0 +4,0,0,6.23973,0,0,3.4,0,0,0 +10,0,0,6.23973,0,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +1,0,1,6.109248,6.160541,0,0,0,1,0 +4,0,1,6.109248,6.160541,0,24.1,0,1,0 +7,0,1,6.109248,6.160541,0,24.1,0,1,0 +11,0,1,6.109248,6.160541,0,24.1,0,1,0 +6,0,0,6.815157,0,0,17.2,1,0,0 +5,0,0,6.815157,0,0,17.2,1,0,0 +3,0,0,6.815157,0,0,17.2,1,0,0 +2,0,0,6.815157,0,0,17.2,1,0,0 +0,0,0,6.815157,0,0,17.2,1,0,0 +5,0,0,6.815157,0,0,0,1,0,0 +1,0,0,6.815157,0,0,0,1,0,0 +0,0,0,6.815157,0,0,0,1,0,0 +2,0,0,6.815157,0,0,0,1,0,0 +2,0,0,6.815157,0,0,0,1,0,0 +2,0,0,6.815157,0,0,10.57626,1,0,0 +0,0,0,6.815157,0,0,10.57626,1,0,0 +5,0,0,6.815157,0,0,10.57626,1,0,0 +1,0,0,6.815157,0,0,10.57626,1,0,0 +2,0,0,6.815157,0,0,10.57626,1,0,0 +2,0,1,5.010635,5.061929,0,0,0,0,0 +2,0,1,5.010635,5.061929,0,0,0,0,0 +0,0,1,5.010635,5.061929,0,0,0,0,0 +0,0,1,5.010635,5.061929,0,0,0,0,0 +0,0,1,5.010635,5.061929,0,0,0,0,0 +0,3.258096,0,6.129377,7.515671,0,10.3,0,0,0 +9,3.258096,0,6.129377,7.515671,0,6.9,1,0,0 +1,0,1,5.735281,5.755076,0,27.6,1,0,0 +3,0,1,5.735281,5.755076,0,27.6,1,0,0 +3,0,1,5.735281,5.755076,1,34.5,0,1,0 +1,0,1,5.735281,5.755076,1,34.5,0,1,0 +2,0,1,5.735281,5.755076,1,34.5,0,1,0 +0,3.258096,0,5.773309,7.034916,0,3.4,0,0,0 +0,3.258096,0,5.773309,7.034916,0,3.4,0,0,0 +1,3.258096,0,5.773309,7.034916,0,3.4,0,0,0 +0,3.258096,0,5.773309,7.034916,0,3.4,0,0,0 +0,3.258096,0,5.773309,7.034916,0,3.4,0,0,0 +1,3.258096,0,5.773309,7.034916,0,17.2,0,0,0 +1,3.258096,0,5.773309,7.034916,0,17.2,0,0,0 +1,3.258096,0,5.773309,7.034916,0,17.2,0,0,0 +1,3.258096,0,5.773309,7.034916,0,17.2,0,0,0 +2,3.258096,0,5.773309,7.034916,0,17.2,0,0,0 +0,4.564348,0,0,6.721172,.1442925,10.57626,1,0,0 +2,4.564348,0,0,6.721172,.1442925,10.57626,1,0,0 +2,4.564348,0,0,6.721172,.1442925,10.57626,1,0,0 +0,0,0,2.890372,0,0,0,0,0,0 +3,0,0,2.890372,0,0,0,0,0,0 +3,0,0,2.890372,0,0,0,0,0,0 +0,0,1,5.089077,5.061929,0,6.9,0,0,0 +0,0,1,5.089077,5.061929,0,6.9,0,0,0 +4,0,1,5.089077,5.061929,0,6.9,0,0,0 +0,4.564348,0,6.160574,6.211867,0,10.57626,1,0,0 +1,4.564348,0,6.160574,6.211867,0,10.57626,1,0,0 +1,4.564348,0,6.160574,6.211867,0,10.57626,1,0,0 +0,4.564348,0,6.160574,6.211867,0,20.7,0,1,0 +1,4.564348,0,6.160574,6.211867,0,20.7,0,1,0 +5,4.564348,0,6.160574,6.211867,0,20.7,0,1,0 +0,4.564348,0,6.160574,6.211867,0,10.57626,0,0,0 +2,4.564348,0,6.160574,6.211867,0,10.57626,0,0,0 +0,4.564348,0,6.160574,6.211867,0,10.57626,0,0,0 +1,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +2,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.3,0,1,0 +2,0,0,0,0,0,10.3,0,1,0 +6,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +1,4.564348,0,6.907755,6.959049,1,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,1,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,1,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,1,27.6,0,0,0 +0,4.564348,0,6.907755,6.959049,1,27.6,0,0,0 +0,0,0,0,0,0,17.2,1,0,0 +2,0,0,0,0,0,17.2,1,0,0 +0,0,0,0,0,0,17.2,1,0,0 +0,3.931826,0,6.39693,7.090077,0,3.4,1,0,0 +0,3.931826,0,6.39693,7.090077,0,3.4,1,0,0 +0,3.931826,0,6.39693,7.090077,0,3.4,1,0,0 +0,3.931826,0,6.39693,7.090077,.1442925,10.57626,0,1,0 +0,3.931826,0,6.39693,7.090077,.1442925,10.57626,0,1,0 +0,3.931826,0,6.39693,7.090077,.1442925,10.57626,0,1,0 +4,0,0,4.822859,0,1,37.9,1,0,0 +7,0,0,4.822859,0,1,37.9,1,0,0 +7,0,0,4.822859,0,1,37.9,1,0,0 +2,0,0,4.822859,0,1,37.9,1,0,0 +2,0,0,4.822859,0,1,37.9,1,0,0 +1,0,0,4.822859,0,0,10.57626,0,0,0 +2,0,0,4.822859,0,0,10.57626,0,0,0 +0,0,0,4.822859,0,0,10.57626,0,0,0 +1,0,0,4.822859,0,0,10.57626,0,0,0 +0,0,0,4.822859,0,0,10.57626,0,0,0 +1,0,0,4.822859,0,0,10.3,0,0,0 +1,0,0,4.822859,0,0,10.3,0,0,0 +1,0,0,4.822859,0,0,10.3,0,0,0 +1,0,0,4.822859,0,0,10.3,0,0,0 +0,0,0,4.822859,0,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +0,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +26,4.564348,0,6.907755,6.959049,1,20.7,1,0,0 +1,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,3.258096,0,6.347144,7.733438,0,10.3,1,0,0 +1,3.258096,0,6.347144,7.733438,0,10.3,1,0,0 +3,3.258096,0,6.347144,7.733438,0,10.3,1,0,0 +0,3.258096,0,5.420535,6.536633,0,6.9,0,0,0 +1,3.258096,0,5.420535,6.536633,0,6.9,0,0,0 +0,3.258096,0,5.420535,6.536633,0,6.9,0,0,0 +0,3.258096,0,5.420535,6.536633,0,3.4,0,0,0 +1,3.258096,0,5.420535,6.536633,0,3.4,0,0,0 +0,3.258096,0,5.420535,6.536633,0,3.4,0,0,0 +0,3.258096,0,5.420535,6.536633,.1442925,10.57626,0,0,0 +0,3.258096,0,5.420535,6.536633,.1442925,10.57626,0,0,0 +0,3.258096,0,5.420535,6.536633,.1442925,10.57626,0,0,0 +0,3.258096,0,5.420535,6.536633,.1442925,10.57626,0,0,0 +0,3.258096,0,5.420535,6.536633,.1442925,10.57626,0,0,0 +0,3.258096,0,5.420535,6.536633,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +1,0,1,6.109248,6.160541,0,6.9,0,1,0 +6,0,1,6.109248,6.160541,0,6.9,0,1,0 +3,0,1,6.109248,6.160541,0,6.9,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +3,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +2,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,4.564348,0,5.783825,5.835118,.1442925,3.4,1,0,0 +0,4.564348,0,5.783825,5.835118,.1442925,3.4,1,0,0 +0,4.564348,0,5.783825,5.835118,.1442925,3.4,1,0,0 +0,4.564348,0,5.783825,5.835118,0,6.9,1,0,0 +0,4.564348,0,5.783825,5.835118,0,6.9,1,0,0 +0,4.564348,0,5.783825,5.835118,0,6.9,1,0,0 +0,4.564348,0,5.783825,5.835118,.1442925,10.57626,0,0,0 +4,4.564348,0,5.783825,5.835118,.1442925,10.57626,0,0,0 +0,4.564348,0,5.783825,5.835118,.1442925,10.57626,0,0,0 +6,0,0,6.206979,0,0,10.57626,0,0,0 +4,0,0,6.206979,0,0,10.57626,0,0,0 +4,0,0,6.206979,0,0,10.57626,0,0,0 +2,0,0,6.206979,0,0,6.9,1,0,0 +0,0,0,6.206979,0,0,6.9,1,0,0 +2,0,0,6.206979,0,0,6.9,1,0,0 +1,0,0,6.206979,0,0,3.4,1,0,0 +1,0,0,6.206979,0,0,3.4,1,0,0 +2,0,0,6.206979,0,0,3.4,1,0,0 +0,0,1,5.010635,5.061929,0,13.8,0,0,0 +1,0,1,5.010635,5.061929,0,13.8,0,0,0 +1,0,1,5.010635,5.061929,0,13.8,0,0,0 +0,0,0,0,0,0,10.57626,0,1,0 +0,0,0,0,0,0,10.57626,0,1,0 +0,0,0,0,0,0,10.57626,0,1,0 +1,0,0,0,0,1,6.9,1,0,0 +2,0,0,0,0,1,6.9,1,0,0 +0,0,0,0,0,1,6.9,1,0,0 +0,0,0,6.66899,0,1,6.9,0,1,0 +0,0,0,6.66899,0,1,6.9,0,1,0 +2,0,0,6.66899,0,1,6.9,0,1,0 +0,0,0,6.66899,0,0,10.3,0,1,0 +0,0,0,6.66899,0,0,10.3,0,1,0 +0,0,0,6.66899,0,0,10.3,0,1,0 +0,0,0,6.66899,0,0,13.8,0,1,0 +0,0,0,6.66899,0,0,13.8,0,1,0 +0,0,0,6.66899,0,0,13.8,0,1,0 +0,0,0,6.66899,0,0,0,0,1,0 +0,0,0,6.66899,0,0,0,0,1,0 +0,0,0,6.66899,0,0,0,0,1,0 +0,3.258096,0,0,7.532195,0,3.4,0,0,1 +1,3.258096,0,0,7.532195,0,3.4,0,0,1 +0,3.258096,0,0,7.532195,0,3.4,0,0,1 +2,0,1,0,5.061929,0,13.8,1,0,0 +0,0,1,0,5.061929,0,13.8,1,0,0 +1,0,1,0,5.061929,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +3,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +5,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,1,3.4,0,1,0 +0,0,0,0,0,1,3.4,0,1,0 +0,0,0,0,0,1,3.4,0,1,0 +0,0,0,0,0,1,3.4,0,1,0 +1,0,0,0,0,1,3.4,0,1,0 +1,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,0,13.8,1,0,0 +0,4.564348,0,0,6.818751,0,13.8,1,0,0 +0,4.564348,0,0,6.818751,0,13.8,1,0,0 +0,4.564348,0,0,6.818751,0,13.8,1,0,0 +0,4.564348,0,0,6.818751,0,13.8,1,0,0 +1,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +1,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +1,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +2,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +1,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +1,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +1,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +1,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +0,4.564348,0,0,6.818751,.1442925,10.57626,1,0,0 +7,3.258096,0,0,4.884316,0,6.9,1,0,0 +4,3.258096,0,0,4.884316,0,6.9,1,0,0 +2,3.258096,0,0,4.884316,0,6.9,1,0,0 +2,0,1,0,5.061929,0,13.8,0,0,0 +5,0,1,0,5.061929,0,13.8,0,0,0 +6,0,1,0,5.061929,0,13.8,0,0,0 +0,0,0,0,0,0,37.9,1,0,0 +3,0,0,0,0,0,37.9,1,0,0 +4,0,0,0,0,0,37.9,1,0,0 +0,0,0,0,0,.1442925,10.57626,1,0,0 +0,0,0,0,0,.1442925,10.57626,1,0,0 +1,0,0,0,0,.1442925,10.57626,1,0,0 +1,0,0,0,0,.1442925,10.57626,1,0,0 +1,0,0,0,0,.1442925,10.57626,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,20.7,0,0,1 +3,0,0,0,0,0,20.7,0,0,1 +6,0,0,0,0,0,20.7,0,0,1 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,6.9,0,0,1 +1,0,0,0,0,0,6.9,0,0,1 +1,0,0,0,0,0,6.9,0,0,1 +2,0,0,6.030685,0,0,10.57626,1,0,0 +3,0,0,6.030685,0,0,10.57626,1,0,0 +5,0,0,6.030685,0,0,10.57626,1,0,0 +0,0,0,6.030685,0,1,10.3,0,1,0 +1,0,0,6.030685,0,1,10.3,0,1,0 +1,0,0,6.030685,0,1,10.3,0,1,0 +1,0,0,6.030685,0,0,6.9,0,0,0 +1,0,0,6.030685,0,0,6.9,0,0,0 +2,0,0,6.030685,0,0,6.9,0,0,0 +1,0,0,6.030685,0,0,10.57626,1,0,0 +0,0,0,6.030685,0,0,10.57626,1,0,0 +0,0,0,6.030685,0,0,10.57626,1,0,0 +2,0,0,2.890372,0,0,0,1,0,0 +3,0,0,2.890372,0,0,0,1,0,0 +7,0,0,2.890372,0,0,0,1,0,0 +0,0,0,6.030685,0,0,10.57626,1,0,0 +0,0,0,6.030685,0,0,10.57626,1,0,0 +0,0,0,6.030685,0,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,20.7,1,0,0 +2,0,1,6.109248,6.160541,0,20.7,1,0,0 +2,0,1,6.109248,6.160541,0,20.7,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,0,1,0 +0,0,1,6.109248,6.160541,0,10.3,0,1,0 +10,0,1,6.109248,6.160541,0,10.3,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,3.258096,0,5.8925,7.278795,0,6.9,1,0,0 +0,3.258096,0,5.8925,7.278795,0,6.9,1,0,0 +0,3.258096,0,5.8925,7.278795,0,6.9,1,0,0 +0,3.258096,0,5.8925,7.278795,0,3.4,1,0,0 +0,3.258096,0,5.8925,7.278795,0,3.4,1,0,0 +0,3.258096,0,5.8925,7.278795,0,3.4,1,0,0 +0,3.258096,0,5.8925,7.278795,1,10.3,0,1,0 +0,3.258096,0,5.8925,7.278795,1,10.3,0,1,0 +0,3.258096,0,5.8925,7.278795,1,10.3,0,1,0 +0,3.258096,0,5.8925,7.278795,0,10.57626,1,0,0 +0,3.258096,0,5.8925,7.278795,0,10.57626,1,0,0 +0,3.258096,0,5.8925,7.278795,0,10.57626,1,0,0 +3,0,1,5.010635,5.061929,0,3.4,1,0,0 +4,0,1,5.010635,5.061929,0,3.4,1,0,0 +2,0,1,5.010635,5.061929,0,3.4,1,0,0 +0,4.564348,0,6.620007,6.6713,0,6.9,1,0,0 +0,4.564348,0,6.620007,6.6713,0,6.9,1,0,0 +0,4.564348,0,6.620007,6.6713,0,6.9,1,0,0 +5,4.564348,0,6.620007,6.6713,0,20.7,1,0,0 +2,4.564348,0,6.620007,6.6713,0,20.7,1,0,0 +1,4.564348,0,6.620007,6.6713,0,20.7,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +12,0,1,6.109248,6.160541,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,13.8,1,0,0 +1,0,1,0,6.160541,0,13.8,1,0,0 +0,0,1,0,6.160541,0,13.8,1,0,0 +0,0,1,0,6.160541,0,10.3,0,1,0 +0,0,1,0,6.160541,0,10.3,0,1,0 +1,0,1,0,6.160541,0,10.3,0,1,0 +0,0,1,0,6.160541,0,10.57626,0,1,0 +0,0,1,0,6.160541,0,10.57626,0,1,0 +0,0,1,0,6.160541,0,10.57626,0,1,0 +1,0,0,4.268298,0,1,20.7,1,0,0 +1,0,0,4.268298,0,1,20.7,1,0,0 +0,0,0,4.268298,0,1,20.7,1,0,0 +0,0,0,4.564348,0,0,6.9,1,0,0 +0,0,0,4.564348,0,0,6.9,1,0,0 +0,0,0,4.564348,0,0,6.9,1,0,0 +5,0,1,5.594116,5.061929,0,10.3,1,0,0 +0,0,1,5.594116,5.061929,0,10.3,1,0,0 +4,0,1,5.594116,5.061929,0,10.3,1,0,0 +11,0,0,5.869636,0,0,6.9,0,0,0 +9,0,0,5.869636,0,0,6.9,0,0,0 +19,0,0,5.869636,0,0,6.9,0,0,0 +30,0,0,5.869636,0,0,6.9,0,0,0 +27,0,0,5.869636,0,0,6.9,0,0,0 +8,0,0,5.869636,0,0,3.4,0,0,0 +9,0,0,5.869636,0,0,3.4,0,0,0 +6,0,0,5.869636,0,0,3.4,0,0,0 +2,0,0,5.869636,0,0,3.4,0,0,0 +0,0,0,5.869636,0,0,3.4,0,0,0 +1,0,0,5.869636,0,0,6.9,0,0,0 +1,0,0,5.869636,0,0,6.9,0,0,0 +2,0,0,5.869636,0,0,6.9,0,0,0 +1,0,0,5.869636,0,0,6.9,0,0,0 +8,0,0,5.869636,0,0,6.9,0,0,0 +6,0,0,5.869636,0,0,10.57626,0,0,0 +1,0,0,5.869636,0,0,10.57626,0,0,0 +8,0,0,5.869636,0,0,10.57626,0,0,0 +9,0,0,5.869636,0,0,10.57626,0,0,0 +7,0,0,5.869636,0,0,10.57626,0,0,0 +2,4.564348,0,6.745236,6.79653,0,27.6,1,0,0 +1,4.564348,0,6.745236,6.79653,0,27.6,1,0,0 +2,0,0,6.152051,0,0,10.57626,1,0,0 +4,0,0,6.152051,0,0,10.57626,1,0,0 +2,0,0,6.152051,0,0,10.57626,1,0,0 +7,0,0,6.152051,0,0,10.57626,1,0,0 +2,0,0,6.152051,0,0,10.57626,1,0,0 +1,0,0,6.152051,0,0,6.9,1,0,0 +1,0,0,6.152051,0,0,6.9,1,0,0 +0,0,0,6.152051,0,0,6.9,1,0,0 +3,0,0,6.152051,0,0,6.9,1,0,0 +1,0,0,6.152051,0,0,6.9,1,0,0 +2,0,0,6.152051,0,0,24.1,1,0,0 +8,0,0,6.152051,0,0,24.1,1,0,0 +2,0,0,6.152051,0,0,24.1,1,0,0 +2,0,0,6.152051,0,0,24.1,1,0,0 +5,0,0,6.152051,0,0,24.1,1,0,0 +0,4.564348,0,0,0,0,3.4,1,0,0 +0,4.564348,0,0,0,0,3.4,1,0,0 +0,4.564348,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +2,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,5.713733,0,0,6.9,0,0,0 +4,0,0,5.713733,0,0,6.9,0,0,0 +2,0,0,5.713733,0,0,6.9,0,0,0 +4,0,0,5.713733,0,0,17.2,0,1,0 +3,0,0,5.713733,0,0,17.2,0,1,0 +1,0,0,5.713733,0,0,17.2,0,1,0 +1,3.258096,0,6.617403,8.003697,0,13.8,1,0,0 +2,3.258096,0,0,5.768321,0,20.7,1,0,0 +1,3.258096,0,0,5.768321,0,20.7,1,0,0 +5,3.258096,0,0,5.768321,0,20.7,1,0,0 +1,3.258096,0,0,5.768321,0,20.7,1,0,0 +0,3.258096,0,0,5.768321,0,20.7,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,1 +2,0,1,6.109248,6.160541,0,10.57626,0,0,1 +1,0,1,6.109248,6.160541,0,10.57626,0,0,1 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +4,0,1,6.109248,6.160541,0,10.57626,0,0,0 +5,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +1,0,0,5.379713,0,0,6.9,0,0,0 +2,0,0,5.379713,0,0,6.9,0,0,0 +0,0,0,5.379713,0,0,6.9,0,0,0 +5,0,0,5.379713,0,0,13.8,0,0,1 +2,0,0,5.379713,0,0,13.8,0,0,1 +3,0,0,5.379713,0,0,13.8,0,0,1 +0,0,0,5.379713,0,0,0,0,0,0 +1,0,0,5.379713,0,0,0,0,0,0 +0,0,0,5.379713,0,0,0,0,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,1,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,1,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +6,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +5,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +5,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +7,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +5,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +4,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +1,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +3,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +1,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +1,4.564348,0,6.649632,6.700925,0,3.4,1,0,0 +0,4.564348,0,6.649632,6.700925,0,3.4,1,0,0 +1,4.564348,0,6.649632,6.700925,0,3.4,1,0,0 +0,4.564348,0,6.649632,6.700925,0,10.3,0,0,0 +0,4.564348,0,6.649632,6.700925,0,10.3,0,0,0 +1,4.564348,0,6.649632,6.700925,0,10.3,0,0,0 +0,4.564348,0,6.649632,6.700925,0,3.4,1,0,0 +0,4.564348,0,6.649632,6.700925,0,3.4,1,0,0 +4,0,1,5.703783,5.755076,0,3.4,1,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +3,0,1,5.703783,5.755076,0,3.4,1,0,0 +1,0,1,5.703783,5.755076,0,3.4,1,0,0 +3,0,1,5.703783,5.755076,0,3.4,1,0,0 +2,0,1,5.703783,5.755076,0,10.3,1,0,0 +1,0,1,5.703783,5.755076,0,10.3,1,0,0 +1,0,1,5.703783,5.755076,0,10.3,1,0,0 +4,0,1,5.703783,5.755076,0,10.3,1,0,0 +1,0,1,5.703783,5.755076,0,10.3,1,0,0 +5,0,0,5.875043,0,1,17.2,1,0,0 +3,0,0,5.875043,0,1,17.2,1,0,0 +2,0,0,5.875043,0,1,17.2,1,0,0 +5,0,0,5.875043,0,.1442925,10.57626,0,0,0 +1,0,0,5.875043,0,.1442925,10.57626,0,0,0 +3,0,0,5.875043,0,.1442925,10.57626,0,0,0 +1,0,0,5.875043,0,.1442925,10.57626,0,0,0 +2,0,0,5.875043,0,.1442925,10.57626,0,0,0 +2,0,0,5.875043,0,.1442925,10.57626,0,0,0 +0,0,0,5.369708,0,0,0,0,0,0 +0,0,0,5.369708,0,0,0,0,0,0 +0,0,0,5.369708,0,0,0,0,0,0 +0,0,0,5.369708,0,0,10.57626,0,1,0 +0,0,0,5.369708,0,0,10.57626,0,1,0 +0,0,0,5.369708,0,0,10.57626,0,1,0 +0,0,0,5.369708,0,0,13.8,1,0,0 +0,0,0,5.369708,0,0,13.8,1,0,0 +0,0,0,5.369708,0,0,3.4,0,0,0 +0,0,0,5.369708,0,0,3.4,0,0,0 +2,0,0,5.369708,0,0,3.4,0,0,0 +0,0,1,0,6.160541,0,10.3,0,0,0 +0,0,1,0,6.160541,0,10.3,0,0,0 +0,0,1,0,6.160541,0,10.3,0,0,0 +0,0,1,0,6.160541,1,10.3,1,0,0 +1,0,1,0,6.160541,1,10.3,1,0,0 +4,0,1,0,6.160541,1,10.3,1,0,0 +1,4.564348,0,6.772966,6.824259,0,27.6,1,0,0 +1,4.564348,0,6.772966,6.824259,0,27.6,1,0,0 +6,4.564348,0,6.772966,6.824259,0,27.6,1,0,0 +0,4.564348,0,6.772966,6.824259,0,10.57626,0,0,0 +0,4.564348,0,6.772966,6.824259,0,10.57626,0,0,0 +2,4.564348,0,6.772966,6.824259,0,10.57626,0,0,0 +1,4.564348,0,6.772966,6.824259,0,6.9,1,0,0 +0,4.564348,0,6.772966,6.824259,0,6.9,1,0,0 +0,4.564348,0,6.772966,6.824259,0,6.9,1,0,0 +0,4.564348,0,6.19461,6.245903,0,10.57626,1,0,0 +0,4.564348,0,6.19461,6.245903,0,10.57626,1,0,0 +1,4.564348,0,6.19461,6.245903,0,10.57626,1,0,0 +1,4.564348,0,6.19461,6.245903,0,10.57626,1,0,0 +3,4.564348,0,6.19461,6.245903,0,10.57626,1,0,0 +0,4.564348,0,6.19461,6.245903,0,10.3,1,0,0 +1,4.564348,0,6.19461,6.245903,0,10.3,1,0,0 +0,4.564348,0,6.19461,6.245903,0,10.3,1,0,0 +3,4.564348,0,6.19461,6.245903,0,10.3,1,0,0 +4,4.564348,0,6.19461,6.245903,0,10.3,1,0,0 +12,0,0,6.934592,0,1,20.7,0,1,0 +8,0,0,6.934592,0,1,20.7,0,1,0 +4,0,0,6.934592,0,1,20.7,0,1,0 +0,0,0,6.934592,0,0,10.3,1,0,0 +0,0,0,6.934592,0,0,10.3,1,0,0 +0,0,0,6.934592,0,0,10.3,1,0,0 +7,4.564348,0,5.97269,5.046476,0,24.1,0,1,0 +13,4.564348,0,5.97269,5.046476,0,24.1,0,1,0 +5,4.564348,0,5.97269,5.046476,0,24.1,0,1,0 +1,0,1,5.703783,5.755076,0,6.9,1,0,0 +0,0,1,5.703783,5.755076,0,6.9,1,0,0 +0,0,1,5.703783,5.755076,0,6.9,1,0,0 +1,0,1,5.703783,5.755076,0,10.57626,1,0,0 +1,0,1,5.703783,5.755076,0,10.57626,1,0,0 +0,0,1,5.703783,5.755076,0,10.57626,1,0,0 +11,3.931826,0,6.907755,7.600903,0,41.4,1,0,0 +4,3.931826,0,6.907755,7.600903,0,41.4,1,0,0 +8,3.931826,0,6.907755,7.600903,0,41.4,1,0,0 +2,3.931826,0,6.907755,7.600903,0,17.2,1,0,0 +0,3.931826,0,6.907755,7.600903,0,17.2,1,0,0 +3,3.931826,0,6.907755,7.600903,0,17.2,1,0,0 +0,3.258096,0,0,7.091243,0,0,1,0,0 +0,3.258096,0,0,7.091243,0,0,1,0,0 +0,3.258096,0,0,7.091243,0,0,1,0,0 +0,3.258096,0,5.752573,7.138867,0,0,0,1,0 +0,3.258096,0,5.752573,7.138867,0,0,0,1,0 +0,3.258096,0,5.752573,7.138867,0,0,0,1,0 +7,0,1,5.703783,6.160541,0,6.9,1,0,0 +2,0,1,5.703783,6.160541,0,6.9,1,0,0 +4,0,1,5.703783,6.160541,0,6.9,1,0,0 +3,0,1,5.703783,6.160541,0,13.8,1,0,0 +10,0,1,5.703783,6.160541,0,13.8,1,0,0 +16,0,1,5.703783,6.160541,0,13.8,1,0,0 +1,0,1,5.703783,6.160541,1,24.1,0,1,0 +2,0,1,5.703783,6.160541,1,24.1,0,1,0 +2,0,1,5.703783,6.160541,1,24.1,0,1,0 +5,0,1,5.703783,6.160541,0,20.7,0,1,0 +3,0,1,5.703783,6.160541,0,20.7,0,1,0 +6,0,1,5.703783,6.160541,0,20.7,0,1,0 +2,0,1,5.703783,6.160541,1,20.7,1,0,0 +0,0,1,5.703783,6.160541,1,20.7,1,0,0 +2,0,1,5.703783,6.160541,1,20.7,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +4,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +8,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +5,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +3,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,13.8,0,1,0 +0,0,0,0,0,0,13.8,0,1,0 +0,0,0,0,0,0,13.8,0,1,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +6,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +10,0,1,5.010635,6.160541,0,6.9,1,0,0 +5,0,1,5.010635,6.160541,0,6.9,1,0,0 +0,0,1,5.010635,6.160541,0,6.9,1,0,0 +3,0,1,5.010635,6.160541,0,10.57626,1,0,0 +1,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +2,0,1,5.010635,6.160541,1,17.2,1,0,0 +1,0,1,5.010635,6.160541,1,17.2,1,0,0 +2,0,1,5.010635,6.160541,1,17.2,1,0,0 +0,0,0,6.030685,0,1,34.5,0,0,1 +3,0,0,6.030685,0,1,34.5,0,0,1 +10,0,0,6.030685,0,1,34.5,0,0,1 +1,0,0,6.030685,0,0,6.9,0,1,0 +10,0,0,6.030685,0,0,6.9,0,1,0 +12,0,0,6.030685,0,0,6.9,0,1,0 +0,0,0,6.030685,0,0,0,1,0,0 +0,0,0,6.030685,0,0,0,1,0,0 +2,0,0,6.030685,0,0,0,1,0,0 +1,0,0,6.030685,0,0,17.2,1,0,0 +0,0,0,6.030685,0,0,17.2,1,0,0 +4,0,0,6.030685,0,0,17.2,1,0,0 +1,0,1,5.703783,5.755076,0,10.3,0,0,0 +3,0,1,5.703783,5.755076,0,10.3,0,0,0 +2,0,1,5.703783,5.755076,0,10.3,0,0,0 +11,0,1,5.703783,5.755076,1,13.8,1,0,0 +1,0,1,5.703783,5.755076,1,13.8,1,0,0 +4,0,1,5.703783,5.755076,1,13.8,1,0,0 +0,3.258096,0,0,7.391662,1,31,0,1,0 +0,3.258096,0,0,7.391662,1,31,0,1,0 +3,3.258096,0,0,7.391662,1,31,0,1,0 +10,3.258096,0,0,7.391662,1,31,0,1,0 +22,3.258096,0,0,7.391662,1,31,0,1,0 +2,0,1,6.109248,6.160541,0,13.8,1,0,0 +5,0,1,6.109248,6.160541,0,13.8,1,0,0 +6,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +4,0,1,6.109248,6.160541,0,6.9,0,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +4,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +4,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +4,3.258096,0,7.006478,7.976801,0,13.8,0,0,0 +1,3.258096,0,7.006478,7.976801,0,13.8,0,0,0 +1,3.258096,0,7.006478,7.976801,0,13.8,0,0,0 +2,3.258096,0,7.006478,7.976801,0,10.57626,0,0,0 +2,3.258096,0,7.006478,7.976801,0,10.57626,0,0,0 +2,3.258096,0,7.006478,7.976801,0,10.57626,0,0,0 +1,3.258096,0,7.006478,7.976801,0,10.3,0,0,0 +0,3.258096,0,7.006478,7.976801,0,10.3,0,0,0 +0,3.258096,0,7.006478,7.976801,0,10.3,0,0,0 +0,3.258096,0,7.006478,7.976801,0,10.57626,0,0,0 +2,3.258096,0,7.006478,7.976801,0,10.57626,0,0,0 +0,3.258096,0,7.006478,7.976801,0,10.57626,0,0,0 +0,0,0,0,0,0,0,0,0,0 +4,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +8,3.258096,0,6.510258,7.896553,1,31,1,0,0 +3,3.258096,0,6.510258,7.896553,1,31,1,0,0 +7,3.258096,0,6.510258,7.896553,1,31,1,0,0 +1,3.258096,0,6.510258,7.896553,0,6.9,0,0,0 +2,3.258096,0,6.510258,7.896553,0,6.9,0,0,0 +2,3.258096,0,6.510258,7.896553,0,6.9,0,0,0 +0,3.258096,0,6.510258,7.896553,0,10.57626,0,0,0 +0,3.258096,0,6.510258,7.896553,0,10.57626,0,0,0 +1,3.258096,0,6.510258,7.896553,0,10.57626,0,0,0 +0,0,1,5.010635,5.061929,0,10.3,0,0,0 +0,0,1,5.010635,5.061929,0,10.3,0,0,0 +0,0,1,5.010635,5.061929,0,10.3,0,0,0 +3,3.258096,0,6.620073,8.006368,1,10.57626,1,0,0 +2,3.258096,0,6.620073,8.006368,1,10.57626,1,0,0 +2,3.258096,0,6.620073,8.006368,1,10.57626,1,0,0 +4,3.258096,0,6.620073,8.006368,1,27.6,1,0,0 +1,3.258096,0,6.620073,8.006368,1,27.6,1,0,0 +5,3.258096,0,6.620073,8.006368,1,27.6,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,1,37.9,0,0,1 +5,3.258096,0,6.620073,8.006368,1,37.9,0,0,1 +5,3.258096,0,6.620073,8.006368,1,37.9,0,0,1 +6,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +6,0,0,5.702181,0,0,17.2,0,0,0 +3,0,0,5.702181,0,0,17.2,0,0,0 +3,0,0,5.702181,0,0,17.2,0,0,0 +5,0,0,5.702181,0,0,17.2,0,0,0 +2,0,0,5.702181,0,0,17.2,0,0,0 +9,0,0,5.702181,0,0,13.8,0,0,0 +0,0,0,5.702181,0,0,13.8,0,0,0 +2,0,0,5.702181,0,0,13.8,0,0,0 +4,0,0,5.702181,0,0,13.8,0,0,0 +7,0,0,5.702181,0,0,13.8,0,0,0 +9,0,0,5.702181,0,0,3.4,1,0,0 +1,0,0,5.702181,0,0,3.4,1,0,0 +2,0,0,5.702181,0,0,3.4,1,0,0 +0,0,0,5.702181,0,0,3.4,1,0,0 +3,0,0,5.702181,0,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,1,20.7,0,0,0 +1,3.258096,0,6.620073,8.006368,1,20.7,0,0,0 +0,3.258096,0,6.620073,8.006368,1,20.7,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,1,13.8,0,0,0 +5,0,0,0,0,1,13.8,0,0,0 +1,0,0,0,0,1,13.8,0,0,0 +0,3.258096,0,6.357409,7.743703,0,3.4,1,0,0 +0,3.258096,0,6.357409,7.743703,0,3.4,1,0,0 +1,3.258096,0,6.357409,7.743703,0,3.4,1,0,0 +0,3.258096,0,6.357409,7.743703,0,0,1,0,0 +7,3.258096,0,6.357409,7.743703,0,0,1,0,0 +1,3.258096,0,6.357409,7.743703,0,0,1,0,0 +0,3.258096,0,6.223171,7.609466,1,27.6,1,0,0 +0,3.258096,0,6.223171,7.609466,1,27.6,1,0,0 +1,3.258096,0,6.223171,7.609466,1,27.6,1,0,0 +0,3.258096,0,6.223171,7.609466,0,10.57626,0,0,0 +0,3.258096,0,6.223171,7.609466,0,10.57626,0,0,0 +0,3.258096,0,6.223171,7.609466,0,10.57626,0,0,0 +0,3.258096,0,6.223171,7.609466,0,10.3,0,0,0 +0,3.258096,0,6.223171,7.609466,0,10.3,0,0,0 +0,3.258096,0,6.223171,7.609466,0,10.3,0,0,0 +1,3.931826,0,0,7.600903,0,6.9,1,0,0 +0,3.931826,0,0,7.600903,0,6.9,1,0,0 +2,3.931826,0,0,7.600903,0,6.9,1,0,0 +0,3.931826,0,0,7.600903,0,10.57626,0,0,0 +2,3.931826,0,0,7.600903,0,10.57626,0,0,0 +4,3.931826,0,0,7.600903,0,10.57626,0,0,0 +0,3.931826,0,0,7.600903,0,10.57626,0,0,0 +0,3.931826,0,0,7.600903,0,10.57626,0,0,0 +0,3.931826,0,0,7.600903,0,10.57626,0,0,0 +0,0,0,2.890372,0,.1442925,10.57626,0,0,0 +2,0,0,2.890372,0,.1442925,10.57626,0,0,0 +0,0,0,2.890372,0,.1442925,10.57626,0,0,0 +3,0,0,2.890372,0,0,17.2,1,0,0 +3,0,0,2.890372,0,0,17.2,1,0,0 +4,0,0,2.890372,0,0,17.2,1,0,0 +2,0,0,2.890372,0,0,6.9,0,0,0 +1,0,0,2.890372,0,0,6.9,0,0,0 +3,0,0,2.890372,0,0,6.9,0,0,0 +0,0,1,5.010635,5.061929,0,6.9,0,0,0 +0,0,1,5.010635,5.061929,0,6.9,0,0,0 +0,0,1,5.010635,5.061929,0,6.9,0,0,0 +10,0,0,5.273,0,0,24.1,1,0,0 +2,0,0,5.273,0,0,24.1,1,0,0 +1,0,0,5.273,0,0,24.1,1,0,0 +2,0,0,5.273,0,0,10.57626,1,0,0 +0,0,0,5.273,0,0,10.57626,1,0,0 +1,0,0,5.273,0,0,10.57626,1,0,0 +4,0,0,5.273,0,0,3.4,1,0,0 +2,0,0,5.273,0,0,3.4,1,0,0 +1,0,0,5.273,0,0,3.4,1,0,0 +0,0,0,5.273,0,0,10.57626,1,0,0 +7,0,0,5.273,0,0,10.57626,1,0,0 +3,0,0,5.273,0,0,10.57626,1,0,0 +0,0,0,5.273,0,0,6.9,0,1,0 +0,0,0,5.273,0,0,6.9,0,1,0 +0,0,0,5.273,0,0,6.9,0,1,0 +0,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +0,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +2,4.564348,0,6.907755,6.959049,0,24.1,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,1,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,1,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,1,0 +1,4.564348,0,6.383507,6.4348,0,17.2,0,0,0 +3,4.564348,0,6.383507,6.4348,0,17.2,0,0,0 +0,4.564348,0,6.383507,6.4348,0,17.2,0,0,0 +0,4.564348,0,6.383507,6.4348,0,0,0,0,0 +0,4.564348,0,6.383507,6.4348,0,0,0,0,0 +0,4.564348,0,6.383507,6.4348,0,0,0,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +5,0,0,0,0,.1442925,10.57626,0,0,0 +2,0,0,0,0,.1442925,10.57626,0,0,0 +4,0,0,0,0,.1442925,10.57626,0,0,0 +2,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +4,0,0,0,0,.1442925,10.57626,0,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +14,0,0,6.815157,0,0,10.57626,0,0,0 +12,0,0,6.815157,0,0,10.57626,0,0,0 +10,0,0,6.815157,0,0,10.57626,0,0,0 +5,0,0,6.815157,0,0,10.57626,0,0,0 +3,0,0,6.815157,0,0,10.57626,0,0,0 +6,0,0,0,0,1,6.9,0,0,0 +18,0,0,0,0,1,6.9,0,0,0 +11,0,0,0,0,1,6.9,0,0,0 +7,0,0,0,0,1,6.9,0,0,0 +4,0,0,0,0,1,6.9,0,0,0 +0,0,0,0,0,0,10.3,0,0,0 +7,0,0,0,0,0,10.3,0,0,0 +5,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +0,4.564348,0,0,5.714254,0,3.4,0,0,0 +0,4.564348,0,0,5.714254,0,3.4,0,0,0 +0,4.564348,0,0,5.714254,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,20.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,20.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,20.7,0,0,0 +1,3.931826,0,6.907755,7.600903,0,20.7,0,0,0 +0,3.931826,0,6.907755,7.600903,0,20.7,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,5.977771,5.755076,0,17.2,1,0,0 +5,0,1,5.977771,5.755076,0,17.2,1,0,0 +2,0,1,5.977771,5.755076,0,17.2,1,0,0 +0,0,1,5.977771,5.755076,1,3.4,1,0,0 +0,0,1,5.977771,5.755076,1,3.4,1,0,0 +0,0,1,5.977771,5.755076,1,3.4,1,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,20.7,1,0,0 +3,0,0,0,0,0,20.7,1,0,0 +7,0,0,0,0,0,20.7,1,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +10,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +10,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +4,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.931826,0,6.907755,7.600903,0,24.1,0,0,0 +0,3.931826,0,6.907755,7.600903,0,24.1,0,0,0 +1,3.931826,0,6.907755,7.600903,0,24.1,0,0,0 +1,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +5,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,1,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,1,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,1,10.57626,0,0,0 +1,0,0,6.287598,0,0,10.57626,0,0,0 +7,0,0,6.287598,0,0,10.57626,0,0,0 +7,0,0,6.287598,0,0,10.57626,0,0,0 +1,0,0,6.287598,0,0,10.57626,0,1,0 +3,0,0,6.287598,0,0,10.57626,0,1,0 +7,0,0,6.287598,0,0,10.57626,0,1,0 +1,0,0,6.287598,0,0,10.57626,0,1,0 +8,0,0,6.287598,0,0,10.57626,0,1,0 +5,0,0,6.287598,0,0,10.57626,0,1,0 +1,0,0,6.287598,0,0,6.9,0,0,0 +2,0,0,6.287598,0,0,6.9,0,0,0 +5,0,0,6.287598,0,0,6.9,0,0,0 +1,0,0,6.287598,0,0,10.3,0,1,0 +7,0,0,6.287598,0,0,10.3,0,1,0 +9,0,0,6.287598,0,0,10.3,0,1,0 +2,0,0,6.287598,0,0,10.57626,0,0,0 +3,0,0,6.287598,0,0,10.57626,0,0,0 +3,0,0,6.287598,0,0,10.57626,0,0,0 +6,0,0,6.287598,0,0,3.4,0,0,0 +6,0,0,6.287598,0,0,3.4,0,0,0 +0,0,0,6.287598,0,0,3.4,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +1,0,0,6.437399,0,0,6.9,0,0,0 +2,4.564348,0,6.745236,6.79653,0,13.8,0,0,0 +1,4.564348,0,6.745236,6.79653,0,13.8,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,6.384047,0,0,10.57626,0,0,0 +2,0,0,6.384047,0,0,10.57626,0,0,0 +1,0,0,6.384047,0,0,10.57626,0,0,0 +10,0,0,5.879527,0,.1442925,10.57626,0,0,0 +7,0,0,5.879527,0,.1442925,10.57626,0,0,0 +1,0,0,5.879527,0,.1442925,10.57626,0,0,0 +1,0,0,5.879527,0,.1442925,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,0,0,0 +0,4.564348,0,4.959693,5.010986,0,10.57626,0,0,0 +0,4.564348,0,4.959693,5.010986,0,10.57626,0,0,0 +0,4.564348,0,4.959693,5.010986,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +3,0,1,6.109248,6.160541,1,6.9,0,0,0 +5,0,1,6.109248,6.160541,1,6.9,0,0,0 +8,0,1,6.109248,6.160541,1,6.9,0,0,0 +11,0,1,5.010635,5.061929,.1442925,10.57626,0,0,0 +0,0,1,5.010635,5.061929,.1442925,10.57626,0,0,0 +1,0,1,5.010635,5.061929,.1442925,10.57626,0,0,0 +0,0,1,5.010635,5.061929,.1442925,10.57626,0,0,0 +1,4.564348,0,5.98202,5.799093,.1442925,10.57626,0,0,0 +0,4.564348,0,5.98202,5.799093,.1442925,10.57626,0,0,0 +0,4.564348,0,5.98202,5.799093,.1442925,10.57626,0,0,0 +5,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +12,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +11,0,0,6.152051,0,.1442925,10.57626,0,0,0 +12,0,0,6.152051,0,.1442925,10.57626,0,0,0 +5,0,0,6.152051,0,.1442925,10.57626,0,0,0 +4,0,0,6.152051,0,.1442925,10.57626,0,0,0 +28,0,0,0,0,.1442925,10.57626,0,0,0 +11,0,0,0,0,.1442925,10.57626,0,0,0 +5,0,0,0,0,.1442925,10.57626,0,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +0,3.258096,0,5.810392,7.196687,.1442925,10.57626,0,0,0 +1,3.258096,0,5.810392,7.196687,.1442925,10.57626,0,0,0 +0,3.258096,0,5.810392,7.196687,.1442925,10.57626,0,0,0 +0,3.258096,0,5.810392,7.196687,.1442925,10.57626,0,0,0 +5,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +1,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +5,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,0,1,6.109248,6.160541,0,10.57626,0,0,0 +4,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,.1442925,10.57626,0,0,0 +0,0,1,0,6.160541,.1442925,10.57626,0,0,0 +0,0,1,0,6.160541,.1442925,10.57626,0,0,0 +2,0,1,0,6.160541,.1442925,10.57626,0,0,0 +15,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +8,0,0,6.819711,0,0,10.57626,0,0,0 +11,0,0,6.819711,0,0,10.57626,0,0,0 +9,0,0,6.819711,0,0,10.57626,0,0,0 +2,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,5.753049,5.804342,0,13.8,0,0,0 +0,4.564348,0,5.753049,5.804342,0,13.8,0,0,0 +0,4.564348,0,5.753049,5.804342,0,13.8,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +6,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +6,0,1,5.928099,5.755076,0,10.3,0,0,0 +0,0,1,5.928099,5.755076,0,10.3,0,0,0 +3,0,1,5.928099,5.755076,0,10.3,0,0,0 +1,0,0,6.532596,0,0,10.57626,0,0,0 +2,0,0,6.532596,0,0,10.57626,0,0,0 +1,0,0,6.532596,0,0,10.57626,0,0,0 +2,0,0,6.532596,0,0,17.2,0,0,0 +10,0,0,6.532596,0,0,17.2,0,0,0 +7,0,0,6.532596,0,0,17.2,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,4.564348,0,5.783825,5.835118,0,10.57626,0,0,0 +2,4.564348,0,5.783825,5.835118,0,10.57626,0,0,0 +0,4.564348,0,5.783825,5.835118,0,10.57626,0,0,0 +4,0,1,6.761573,6.160541,0,10.57626,0,0,0 +1,0,1,6.761573,6.160541,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +5,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.471356,5.771441,0,10.57626,0,0,0 +0,3.258096,0,6.471356,5.771441,0,10.57626,0,0,0 +0,3.258096,0,6.471356,5.771441,0,10.57626,0,0,0 +8,3.931826,0,6.907755,7.600903,.1442925,10.57626,0,0,0 +4,3.931826,0,6.907755,7.600903,.1442925,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,.1442925,10.57626,0,0,0 +10,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +3,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +3,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,3.258096,0,0,6.635421,.1442925,10.57626,0,0,0 +0,3.258096,0,0,6.635421,.1442925,10.57626,0,0,0 +1,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +2,0,0,0,0,0,10.3,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +2,0,1,0,6.160541,0,10.57626,0,0,0 +4,0,1,5.010635,6.160541,0,10.57626,0,0,0 +1,0,1,5.010635,6.160541,0,10.57626,0,0,0 +4,0,1,5.010635,6.160541,0,10.57626,0,0,0 +8,0,0,0,0,0,10.57626,0,0,0 +7,0,0,0,0,0,10.57626,0,0,0 +8,0,0,0,0,0,10.57626,0,0,0 +11,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +9,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +2,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,0,4.510859,0,.1442925,10.57626,0,0,0 +0,0,0,4.510859,0,.1442925,10.57626,0,0,0 +1,0,0,0,0,1,0,0,0,0 +0,0,0,0,0,1,0,0,0,0 +0,0,0,0,0,1,0,0,0,0 +0,0,1,6.109248,6.160541,1,10.57626,0,0,0 +0,0,1,6.109248,6.160541,1,10.57626,0,0,0 +0,0,1,6.109248,6.160541,1,10.57626,0,0,0 +4,0,0,2.890372,0,0,10.57626,0,0,0 +3,0,0,2.890372,0,0,10.57626,0,0,0 +3,0,0,2.890372,0,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,7.080969,0,0,0,0,0,0 +0,0,0,7.080969,0,0,0,0,0,0 +0,0,0,7.080969,0,0,0,0,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +14,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +8,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +2,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +6,4.564348,0,4.945919,4.997212,.1442925,10.57626,0,0,0 +1,4.564348,0,4.945919,4.997212,.1442925,10.57626,0,0,0 +17,0,0,6.030685,0,.1442925,10.57626,0,0,0 +12,0,0,6.030685,0,.1442925,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,5.752573,7.138867,.1442925,10.57626,0,0,0 +0,3.258096,0,5.752573,7.138867,.1442925,10.57626,0,0,0 +11,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +10,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +6,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +13,0,0,6.819711,0,.1442925,10.57626,0,0,0 +8,0,0,6.819711,0,.1442925,10.57626,0,0,0 +2,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +7,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +3,0,0,5.294309,0,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,4.564348,0,7.06732,6.675624,.1442925,10.57626,0,0,0 +0,4.564348,0,7.06732,6.675624,.1442925,10.57626,0,0,0 +2,0,1,0,6.160541,.1442925,10.57626,0,0,0 +0,4.564348,0,5.783825,5.835118,.1442925,10.57626,0,0,0 +6,3.258096,0,6.357409,7.743703,.1442925,10.57626,0,0,0 +0,4.564348,0,6.160574,6.211867,.1442925,10.57626,0,0,0 +1,4.564348,0,6.160574,6.211867,.1442925,10.57626,0,0,0 +0,0,1,0,6.160541,.1442925,10.57626,0,0,0 +5,0,0,0,0,.1442925,10.57626,0,0,0 +6,4.564348,0,5.753049,5.804342,.1442925,10.57626,0,0,0 +5,0,0,0,0,.1442925,10.57626,0,0,0 +6,0,0,0,0,.1442925,10.57626,0,0,0 +18,0,0,0,0,.1442925,10.57626,0,0,0 +5,0,0,0,0,.1442925,10.57626,0,0,0 +8,0,0,0,0,.1442925,10.57626,0,0,0 +11,0,0,6.206979,0,.1442925,10.57626,0,0,0 +5,0,0,5.702181,0,.1442925,10.57626,0,0,0 +6,0,1,0,6.160541,.1442925,10.57626,0,0,0 +0,4.564348,0,6.649632,6.700925,.1442925,10.57626,0,0,0 +11,0,0,6.030685,0,.1442925,10.57626,0,0,0 +10,0,1,5.703783,5.755076,.1442925,10.57626,0,0,0 +0,3.258096,0,5.752573,7.138867,.1442925,10.57626,0,0,0 +0,4.564348,0,5.991465,6.042758,0,10.3,0,0,0 +0,4.564348,0,5.991465,6.042758,0,10.3,0,0,0 +0,4.564348,0,5.991465,6.042758,0,10.3,0,0,0 +0,4.564348,0,5.991465,6.042758,0,6.9,0,0,0 +2,4.564348,0,5.991465,6.042758,0,6.9,0,0,0 +2,4.564348,0,5.991465,6.042758,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,1,0 +0,4.564348,0,6.907755,6.959049,0,10.3,0,1,0 +1,4.564348,0,6.907755,6.959049,0,10.3,0,1,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +2,3.258096,0,6.311226,6.966024,0,10.57626,0,0,0 +3,3.258096,0,6.311226,6.966024,0,10.57626,0,0,0 +0,3.258096,0,6.311226,6.966024,0,10.57626,0,0,0 +4,3.258096,0,6.311226,6.966024,0,6.9,0,0,0 +5,3.258096,0,6.311226,6.966024,0,6.9,0,0,0 +1,3.258096,0,6.311226,6.966024,0,6.9,0,0,0 +1,0,0,5.634933,0,0,10.57626,1,0,0 +0,0,0,5.634933,0,0,10.57626,1,0,0 +2,0,0,5.634933,0,0,10.57626,1,0,0 +3,0,0,5.634933,0,0,10.57626,1,0,0 +1,0,0,5.634933,0,0,10.57626,1,0,0 +0,0,0,5.634933,0,0,0,0,0,0 +0,0,0,5.634933,0,0,0,0,0,0 +2,0,0,5.634933,0,0,0,0,0,0 +5,0,0,5.634933,0,0,0,0,0,0 +1,0,0,5.634933,0,0,0,0,0,0 +18,0,0,5.634933,0,0,17.2,0,0,1 +4,0,0,5.634933,0,0,17.2,0,0,1 +9,0,0,5.634933,0,0,17.2,0,0,1 +4,0,0,5.634933,0,0,17.2,0,0,1 +3,0,0,5.634933,0,0,17.2,0,0,1 +1,0,0,5.634933,0,0,6.9,1,0,0 +9,0,0,5.634933,0,0,6.9,1,0,0 +1,0,0,5.634933,0,0,6.9,1,0,0 +0,0,0,5.634933,0,0,6.9,1,0,0 +0,0,0,5.634933,0,0,6.9,1,0,0 +2,0,0,6.264845,0,0,10.3,0,0,0 +5,0,0,6.264845,0,0,10.3,0,0,0 +3,0,0,6.264845,0,0,10.3,0,0,0 +2,0,0,6.264845,0,0,10.3,0,0,0 +2,0,0,6.264845,0,0,10.3,0,0,0 +2,0,0,6.264845,0,1,0,0,0,0 +1,0,0,6.264845,0,1,0,0,0,0 +1,0,0,6.264845,0,1,0,0,0,0 +1,0,0,6.264845,0,1,0,0,0,0 +1,0,0,6.264845,0,1,0,0,0,0 +3,0,0,6.264845,0,0,3.4,0,0,0 +3,0,0,6.264845,0,0,3.4,0,0,0 +1,0,0,6.264845,0,0,3.4,0,0,0 +3,0,0,6.264845,0,0,3.4,0,0,0 +3,0,0,6.264845,0,0,3.4,0,0,0 +2,0,0,6.264845,0,0,10.3,0,0,0 +1,0,0,6.264845,0,0,10.3,0,0,0 +4,0,0,6.264845,0,0,10.3,0,0,0 +3,0,0,6.264845,0,0,10.3,0,0,0 +2,0,0,6.264845,0,0,10.3,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +1,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +1,4.564348,0,3.883624,3.934917,.1442925,10.57626,1,0,0 +3,4.564348,0,6.939874,6.602374,0,17.2,1,0,0 +0,4.564348,0,6.939874,6.602374,1,10.3,1,0,0 +2,4.564348,0,6.015181,5.734873,1,3.4,0,1,0 +1,4.564348,0,6.015181,5.734873,1,3.4,0,1,0 +1,4.564348,0,6.015181,5.734873,1,3.4,0,1,0 +9,4.564348,0,6.015181,5.734873,1,3.4,0,1,0 +3,4.564348,0,6.015181,5.734873,1,3.4,0,1,0 +2,4.564348,0,6.015181,5.734873,1,3.4,1,0,0 +0,4.564348,0,6.015181,5.734873,1,3.4,1,0,0 +2,4.564348,0,6.015181,5.734873,1,3.4,1,0,0 +0,4.564348,0,6.015181,5.734873,1,3.4,1,0,0 +3,4.564348,0,6.015181,5.734873,1,3.4,1,0,0 +7,4.564348,0,6.015181,5.734873,1,13.8,1,0,0 +13,4.564348,0,6.015181,5.734873,1,13.8,1,0,0 +7,4.564348,0,6.015181,5.734873,1,13.8,1,0,0 +17,4.564348,0,6.015181,5.734873,1,13.8,1,0,0 +10,4.564348,0,6.015181,5.734873,1,13.8,1,0,0 +1,4.564348,0,6.015181,5.734873,1,10.57626,1,0,0 +1,4.564348,0,6.015181,5.734873,1,10.57626,1,0,0 +0,4.564348,0,6.015181,5.734873,1,10.57626,1,0,0 +0,4.564348,0,6.015181,5.734873,1,10.57626,1,0,0 +0,4.564348,0,6.015181,5.734873,1,10.57626,1,0,0 +2,3.258096,0,0,6.907755,1,17.2,1,0,0 +1,3.258096,0,0,6.907755,1,17.2,1,0,0 +1,3.258096,0,0,6.907755,1,17.2,1,0,0 +0,0,0,0,0,1,31,1,0,0 +2,0,0,0,0,1,31,1,0,0 +2,0,0,0,0,1,31,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,20.7,1,0,0 +1,0,0,0,0,0,20.7,1,0,0 +1,0,0,0,0,0,20.7,1,0,0 +2,4.564348,0,6.232605,6.2643,1,13.8,1,0,0 +0,4.564348,0,6.232605,6.2643,1,13.8,1,0,0 +0,4.564348,0,6.232605,6.2643,1,13.8,1,0,0 +0,4.564348,0,6.232605,6.2643,1,13.8,1,0,0 +0,4.564348,0,6.232605,6.2643,1,13.8,1,0,0 +0,4.564348,0,6.232605,6.2643,1,10.3,1,0,0 +0,4.564348,0,6.232605,6.2643,1,10.3,1,0,0 +0,0,0,5.903944,0,0,10.3,1,0,0 +1,0,0,5.903944,0,0,10.3,1,0,0 +2,0,0,5.903944,0,0,10.3,1,0,0 +0,0,0,5.903944,0,0,10.57626,0,1,0 +2,0,0,5.903944,0,0,10.57626,0,1,0 +2,0,0,5.903944,0,0,10.57626,0,1,0 +1,0,0,4.094345,0,1,6.9,1,0,0 +3,0,0,4.094345,0,1,6.9,1,0,0 +4,0,0,4.094345,0,1,6.9,1,0,0 +4,0,0,4.094345,0,1,6.9,1,0,0 +2,0,0,4.094345,0,1,6.9,1,0,0 +4,0,0,4.094345,0,0,10.3,1,0,0 +14,0,0,4.094345,0,0,10.3,1,0,0 +13,0,0,4.094345,0,0,10.3,1,0,0 +7,0,0,4.094345,0,0,10.3,1,0,0 +1,0,0,4.094345,0,0,10.3,1,0,0 +0,0,1,5.703783,5.755076,0,0,1,0,0 +0,0,1,5.703783,5.755076,0,0,1,0,0 +1,0,1,5.703783,5.755076,0,0,1,0,0 +0,0,1,5.703783,5.755076,0,13.8,1,0,0 +1,0,1,5.703783,5.755076,0,13.8,1,0,0 +1,0,1,5.703783,5.755076,0,13.8,1,0,0 +2,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +5,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +5,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +1,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,17.2,0,0,0 +0,3.931826,0,6.907755,7.600903,0,17.2,0,0,0 +1,3.931826,0,6.907755,7.600903,0,17.2,0,0,0 +5,3.931826,0,6.907755,7.600903,0,20.7,0,1,0 +5,3.931826,0,6.907755,7.600903,0,20.7,0,1,0 +0,3.931826,0,6.907755,7.600903,0,20.7,0,1,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +2,0,0,5.039806,0,0,0,0,1,0 +3,0,0,5.039806,0,0,0,0,1,0 +0,0,0,5.039806,0,0,0,0,1,0 +4,0,0,5.039806,0,0,10.3,0,1,0 +1,0,0,5.039806,0,0,10.3,0,1,0 +3,0,0,5.039806,0,0,10.3,0,1,0 +0,0,0,5.259992,0,0,13.8,1,0,0 +2,0,0,5.259992,0,0,13.8,1,0,0 +1,0,0,5.259992,0,0,13.8,1,0,0 +6,0,0,5.259992,0,0,17.2,0,1,0 +10,0,0,5.259992,0,0,17.2,0,1,0 +3,0,0,5.259992,0,0,17.2,0,1,0 +2,4.564348,0,5.752731,5.804342,1,6.9,0,1,0 +1,4.564348,0,5.752731,5.804342,1,6.9,0,1,0 +3,4.564348,0,5.752731,5.804342,1,6.9,0,1,0 +4,4.564348,0,5.752731,5.804342,1,6.9,0,1,0 +4,4.564348,0,5.752731,5.804342,1,6.9,0,1,0 +0,0,1,5.010635,5.061929,0,3.4,1,0,0 +0,0,1,5.010635,5.061929,0,3.4,1,0,0 +1,0,1,5.010635,5.061929,0,3.4,1,0,0 +7,3.258096,0,5.762052,7.148346,1,24.1,0,1,0 +19,3.258096,0,5.762052,7.148346,1,24.1,0,1,0 +6,3.258096,0,5.762052,7.148346,1,24.1,0,1,0 +0,3.258096,0,0,5.991465,0,3.4,0,0,0 +0,3.258096,0,0,5.991465,0,3.4,0,0,0 +3,3.258096,0,0,5.991465,0,3.4,0,0,0 +1,3.258096,0,5.762052,7.148346,0,10.57626,0,0,0 +2,3.258096,0,5.762052,7.148346,0,10.57626,0,0,0 +3,3.258096,0,5.762052,7.148346,0,10.57626,0,0,0 +0,0,1,5.703783,5.755076,1,34.5,0,1,0 +0,0,1,5.703783,5.755076,1,34.5,0,1,0 +0,0,1,5.703783,5.755076,1,34.5,0,1,0 +0,0,1,5.703783,5.755076,1,34.5,0,1,0 +0,0,1,5.703783,5.755076,1,34.5,0,1,0 +0,0,1,5.703783,5.755076,1,10.3,1,0,0 +0,0,1,5.703783,5.755076,1,10.3,1,0,0 +0,0,1,5.703783,5.755076,1,10.3,1,0,0 +0,0,1,5.703783,5.755076,1,10.3,1,0,0 +0,0,1,5.703783,5.755076,1,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,0 +1,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +6,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +2,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +4,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +4,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +5,0,1,5.342525,5.061929,1,34.5,0,1,0 +6,0,1,5.342525,5.061929,1,34.5,0,1,0 +5,0,1,5.342525,5.061929,1,34.5,0,1,0 +0,0,1,0,6.160541,0,6.9,1,0,0 +0,0,1,0,6.160541,0,6.9,1,0,0 +0,0,1,0,6.160541,0,6.9,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +3,0,1,0,6.160541,0,3.4,1,0,0 +2,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,.1442925,10.57626,1,0,0 +0,0,1,0,6.160541,.1442925,10.57626,1,0,0 +0,0,1,0,6.160541,.1442925,10.57626,1,0,0 +1,3.258096,0,6.54002,7.926314,0,20.7,1,0,0 +4,3.258096,0,6.54002,7.926314,0,20.7,1,0,0 +1,3.258096,0,6.54002,7.926314,0,20.7,1,0,0 +0,3.258096,0,6.54002,7.926314,0,10.57626,0,0,0 +0,3.258096,0,6.54002,7.926314,0,10.57626,0,0,0 +0,3.258096,0,6.54002,7.926314,0,10.57626,0,0,0 +0,3.258096,0,6.54002,7.926314,0,10.3,1,0,0 +0,3.258096,0,6.54002,7.926314,0,10.3,1,0,0 +0,3.258096,0,6.54002,7.926314,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +2,0,1,6.109248,6.160541,0,6.9,0,1,0 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,1,10.57626,0,1,0 +0,0,1,6.109248,6.160541,1,10.57626,0,1,0 +0,0,1,6.109248,6.160541,1,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,4.564348,0,5.655992,4.646413,0,10.57626,0,0,0 +2,4.564348,0,5.655992,4.646413,0,10.57626,0,0,0 +0,4.564348,0,5.655992,4.646413,0,10.57626,0,0,0 +0,4.564348,0,5.655992,4.646413,.1442925,10.57626,0,0,0 +0,4.564348,0,5.655992,4.646413,.1442925,10.57626,0,0,0 +0,4.564348,0,5.655992,4.646413,.1442925,10.57626,0,0,0 +0,4.564348,0,5.655992,4.646413,0,0,0,0,0 +0,4.564348,0,5.655992,4.646413,0,0,0,0,0 +0,4.564348,0,5.655992,4.646413,0,0,0,0,0 +1,4.564348,0,5.655992,4.646413,0,34.5,0,0,0 +5,4.564348,0,5.655992,4.646413,0,34.5,0,0,0 +0,4.564348,0,5.655992,4.646413,0,34.5,0,0,0 +4,4.564348,0,5.655992,4.646413,1,27.6,1,0,0 +2,4.564348,0,5.655992,4.646413,1,27.6,1,0,0 +0,4.564348,0,5.655992,4.646413,1,27.6,1,0,0 +0,4.564348,0,5.655992,4.646413,.1442925,10.57626,0,0,0 +0,4.564348,0,5.655992,4.646413,.1442925,10.57626,0,0,0 +0,4.564348,0,5.655992,4.646413,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +3,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,0,6.160541,1,34.5,0,0,1 +0,0,1,0,6.160541,1,34.5,0,0,1 +1,0,1,0,6.160541,1,34.5,0,0,1 +0,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +1,0,1,0,6.160541,1,6.9,0,0,1 +2,0,1,0,6.160541,1,6.9,0,0,1 +1,0,1,0,6.160541,1,6.9,0,0,1 +5,4.564348,0,6.460843,6.512136,0,6.9,1,0,0 +0,4.564348,0,6.460843,6.512136,0,6.9,1,0,0 +0,4.564348,0,6.460843,6.512136,0,6.9,1,0,0 +0,3.931826,0,6.462249,7.155396,0,3.4,0,0,0 +1,3.931826,0,6.462249,7.155396,0,3.4,0,0,0 +0,3.931826,0,6.462249,7.155396,0,3.4,0,0,0 +40,0,0,5.315371,0,0,17.2,1,0,0 +12,0,0,5.315371,0,0,17.2,1,0,0 +9,0,0,5.315371,0,0,17.2,1,0,0 +9,0,0,5.315371,0,0,17.2,1,0,0 +3,0,0,5.315371,0,0,17.2,1,0,0 +3,0,0,5.315371,0,0,6.9,0,0,0 +0,0,0,5.315371,0,0,6.9,0,0,0 +0,0,0,5.315371,0,0,6.9,0,0,0 +3,0,0,5.315371,0,0,6.9,0,0,0 +6,0,0,5.315371,0,0,6.9,0,0,0 +3,0,0,6.100677,0,0,10.3,1,0,0 +2,0,0,6.100677,0,0,10.3,1,0,0 +1,0,0,6.100677,0,0,10.3,1,0,0 +1,0,0,6.100677,0,0,10.3,1,0,0 +0,0,0,6.100677,0,0,10.3,1,0,0 +2,0,0,6.100677,0,0,6.9,1,0,0 +0,0,0,6.100677,0,0,6.9,1,0,0 +0,0,0,6.100677,0,0,6.9,1,0,0 +0,0,0,6.100677,0,0,6.9,1,0,0 +1,0,0,6.100677,0,0,6.9,1,0,0 +0,0,0,6.100677,0,0,10.57626,1,0,0 +0,0,0,6.100677,0,0,10.57626,1,0,0 +1,0,0,6.100677,0,0,10.57626,1,0,0 +0,0,0,6.100677,0,0,10.57626,1,0,0 +2,0,0,6.100677,0,0,10.57626,1,0,0 +1,0,0,6.100677,0,0,17.2,1,0,0 +5,0,0,6.100677,0,0,17.2,1,0,0 +1,0,0,6.100677,0,0,17.2,1,0,0 +1,0,0,6.100677,0,0,17.2,1,0,0 +2,0,0,6.100677,0,0,17.2,1,0,0 +0,0,0,6.100677,0,0,20.7,0,1,0 +5,0,0,6.100677,0,0,20.7,0,1,0 +1,0,0,6.100677,0,0,20.7,0,1,0 +1,0,0,6.100677,0,0,20.7,0,1,0 +1,0,0,6.100677,0,0,20.7,0,1,0 +2,0,0,6.100677,0,0,6.9,1,0,0 +2,0,0,6.100677,0,0,6.9,1,0,0 +5,0,0,6.100677,0,0,6.9,1,0,0 +2,0,0,6.100677,0,0,6.9,1,0,0 +4,0,0,6.100677,0,0,6.9,1,0,0 +2,3.258096,0,6.507277,7.893572,0,6.9,0,1,0 +1,3.258096,0,6.507277,7.893572,0,6.9,0,1,0 +0,3.258096,0,6.507277,7.893572,0,6.9,0,1,0 +0,3.258096,0,6.507277,7.893572,.1442925,10.57626,1,0,0 +2,3.258096,0,6.507277,7.893572,.1442925,10.57626,1,0,0 +3,3.258096,0,6.507277,7.893572,.1442925,10.57626,1,0,0 +1,3.258096,0,6.507277,7.893572,.1442925,10.57626,1,0,0 +0,3.258096,0,6.507277,7.893572,.1442925,10.57626,1,0,0 +2,3.258096,0,6.507277,7.893572,.1442925,10.57626,1,0,0 +2,3.258096,0,6.507277,7.893572,0,10.3,0,1,0 +0,3.258096,0,6.507277,7.893572,0,10.3,0,1,0 +1,3.258096,0,6.507277,7.893572,0,10.3,0,1,0 +9,3.258096,0,5.156178,6.542472,0,3.4,1,0,0 +5,3.258096,0,5.156178,6.542472,0,3.4,1,0,0 +4,3.258096,0,5.156178,6.542472,0,3.4,1,0,0 +0,3.258096,0,5.156178,6.542472,0,6.9,0,0,0 +0,3.258096,0,5.156178,6.542472,0,6.9,0,0,0 +0,3.258096,0,5.156178,6.542472,0,6.9,0,0,0 +3,3.258096,0,5.156178,6.542472,1,24.1,0,1,0 +4,3.258096,0,5.156178,6.542472,1,24.1,0,1,0 +5,3.258096,0,5.156178,6.542472,1,24.1,0,1,0 +4,3.258096,0,5.156178,6.542472,0,6.9,1,0,0 +0,3.258096,0,5.156178,6.542472,0,6.9,1,0,0 +1,3.258096,0,5.156178,6.542472,0,6.9,1,0,0 +1,3.258096,0,5.156178,6.542472,1,17.2,0,0,0 +1,3.258096,0,5.156178,6.542472,1,17.2,0,0,0 +2,3.258096,0,5.156178,6.542472,1,17.2,0,0,0 +0,4.564348,0,0,6.679335,0,6.9,1,0,0 +0,4.564348,0,0,6.679335,0,6.9,1,0,0 +0,4.564348,0,0,6.679335,0,6.9,1,0,0 +0,4.564348,0,0,6.679335,0,17.2,0,1,0 +0,4.564348,0,0,6.679335,0,17.2,0,1,0 +0,4.564348,0,0,6.679335,0,17.2,0,1,0 +0,4.564348,0,0,6.679335,0,10.57626,0,0,0 +0,4.564348,0,0,6.679335,0,10.57626,0,0,0 +0,4.564348,0,0,6.679335,0,10.57626,0,0,0 +2,4.564348,0,5.857933,5.909226,0,3.4,1,0,0 +1,4.564348,0,5.857933,5.909226,1,10.57626,1,0,0 +2,4.564348,0,5.857933,5.909226,0,10.57626,1,0,0 +3,4.564348,0,5.857933,5.909226,1,10.3,1,0,0 +0,0,1,5.010635,6.160541,0,0,0,0,0 +0,0,1,5.010635,6.160541,0,0,0,0,0 +0,0,1,5.010635,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +6,0,0,3.401197,0,1,6.9,0,0,1 +8,0,0,3.401197,0,1,6.9,0,0,1 +3,0,0,3.401197,0,1,6.9,0,0,1 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +3,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,13.8,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +2,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +3,0,1,6.109248,6.160541,0,10.57626,1,0,0 +2,0,1,6.109248,6.160541,0,10.57626,1,0,0 +2,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +2,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +3,0,1,6.109248,6.160541,0,10.3,1,0,0 +16,0,1,6.109248,6.160541,0,10.3,1,0,0 +12,0,1,6.109248,6.160541,0,10.3,1,0,0 +5,3.258096,0,6.401171,7.787465,0,6.9,1,0,0 +1,3.258096,0,6.401171,7.787465,0,6.9,1,0,0 +1,3.258096,0,6.401171,7.787465,0,6.9,1,0,0 +0,3.258096,0,6.401171,7.787465,0,17.2,1,0,0 +0,3.258096,0,6.401171,7.787465,0,17.2,1,0,0 +0,3.258096,0,6.401171,7.787465,0,17.2,1,0,0 +0,3.258096,0,6.401171,7.787465,0,20.7,1,0,0 +1,3.258096,0,6.401171,7.787465,0,20.7,1,0,0 +3,3.258096,0,6.401171,7.787465,0,20.7,1,0,0 +11,0,0,5.030438,0,1,6.9,1,0,0 +11,0,0,5.030438,0,1,6.9,1,0,0 +9,0,0,5.030438,0,1,6.9,1,0,0 +7,0,0,5.030438,0,1,6.9,1,0,0 +2,0,0,5.030438,0,1,6.9,1,0,0 +0,0,1,5.010635,6.160541,0,0,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,0,1,0 +0,0,1,5.010635,6.160541,0,10.57626,0,1,0 +0,0,1,5.010635,6.160541,0,10.57626,0,1,0 +0,0,1,5.010635,6.160541,0,10.57626,0,1,0 +3,0,1,5.010635,6.160541,0,10.57626,0,1,0 +0,0,1,5.010635,6.160541,0,10.57626,0,1,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +1,0,1,5.010635,6.160541,1,13.8,1,0,0 +29,0,1,5.010635,6.160541,1,13.8,1,0,0 +0,0,1,5.010635,6.160541,1,13.8,1,0,0 +0,0,1,5.010635,6.160541,0,17.2,0,0,0 +0,0,1,5.010635,6.160541,0,17.2,0,0,0 +0,0,1,5.010635,6.160541,0,17.2,0,0,0 +0,0,1,5.010635,6.160541,0,20.7,1,0,0 +6,0,1,5.010635,6.160541,0,20.7,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +2,0,1,5.010635,5.755076,1,10.3,1,0,0 +0,0,1,5.010635,5.755076,1,10.3,1,0,0 +8,0,1,5.010635,5.755076,1,10.3,1,0,0 +0,0,1,5.010635,5.755076,0,0,0,0,0 +5,0,1,5.010635,5.755076,0,0,0,0,0 +1,0,1,5.010635,5.755076,0,0,0,0,0 +12,0,0,0,0,0,13.8,0,0,0 +8,0,0,0,0,0,13.8,0,0,0 +8,0,0,0,0,0,13.8,0,0,0 +8,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +8,0,0,0,0,0,17.2,0,0,0 +3,0,0,0,0,0,17.2,0,0,0 +3,0,0,0,0,0,17.2,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +6,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +6,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +2,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +2,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +4,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +3,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +2,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +2,0,0,5.482637,0,0,0,1,0,0 +1,0,0,5.482637,0,0,0,1,0,0 +2,0,0,5.482637,0,0,0,1,0,0 +1,0,1,6.109248,6.160541,1,31,0,1,0 +2,0,1,6.109248,6.160541,1,31,0,1,0 +7,0,1,6.109248,6.160541,1,31,0,1,0 +1,0,1,6.109248,6.160541,1,31,0,1,0 +2,0,1,6.109248,6.160541,1,31,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,0,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +1,0,1,6.109248,6.160541,0,10.3,0,1,0 +2,0,1,6.109248,6.160541,0,10.3,0,1,0 +1,0,1,6.109248,6.160541,0,10.3,0,1,0 +2,0,1,6.109248,6.160541,0,10.3,0,1,0 +2,0,1,6.109248,6.160541,0,10.3,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +1,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,1,3.4,1,0,0 +3,3.258096,0,6.620073,8.006368,1,3.4,1,0,0 +3,3.258096,0,6.620073,8.006368,1,3.4,1,0,0 +3,3.258096,0,6.620073,8.006368,0,27.6,0,0,0 +0,3.258096,0,6.620073,8.006368,0,27.6,0,0,0 +0,3.258096,0,6.620073,8.006368,0,27.6,0,0,0 +0,0,1,0,6.160541,0,3.4,0,1,0 +0,0,1,0,6.160541,0,3.4,0,1,0 +0,0,1,0,6.160541,0,3.4,0,1,0 +0,0,1,0,6.160541,0,6.9,0,1,0 +1,0,1,0,6.160541,0,6.9,0,1,0 +1,0,1,0,6.160541,0,6.9,0,1,0 +1,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,4.564348,0,6.461468,6.512762,0,3.4,1,0,0 +0,4.564348,0,6.461468,6.512762,0,3.4,1,0,0 +0,4.564348,0,6.461468,6.512762,0,3.4,1,0,0 +0,4.564348,0,6.461468,6.512762,0,10.57626,0,0,0 +0,4.564348,0,6.461468,6.512762,0,10.57626,0,0,0 +0,4.564348,0,6.461468,6.512762,0,10.57626,0,0,0 +0,4.564348,0,6.461468,6.512762,1,24.1,1,0,0 +1,4.564348,0,6.461468,6.512762,1,24.1,1,0,0 +0,4.564348,0,6.461468,6.512762,1,24.1,1,0,0 +0,4.564348,0,6.461468,6.512762,0,3.4,1,0,0 +0,4.564348,0,6.461468,6.512762,0,3.4,1,0,0 +0,4.564348,0,6.461468,6.512762,0,3.4,1,0,0 +0,4.564348,0,6.461468,6.512762,0,10.57626,0,0,0 +0,4.564348,0,6.461468,6.512762,0,10.57626,0,0,0 +0,4.564348,0,6.461468,6.512762,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +1,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,0 +1,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,0,4.822859,0,.1442925,10.57626,0,0,0 +0,0,0,4.822859,0,.1442925,10.57626,0,0,0 +3,0,0,4.822859,0,.1442925,10.57626,0,0,0 +0,0,0,4.822859,0,0,10.3,0,0,0 +1,0,0,4.822859,0,0,10.3,0,0,0 +9,0,0,4.822859,0,0,10.3,0,0,0 +7,0,0,5.042134,0,0,17.2,0,0,1 +9,0,0,5.042134,0,0,17.2,0,0,1 +5,0,0,5.042134,0,0,17.2,0,0,1 +3,0,0,5.042134,0,0,10.3,1,0,0 +2,0,0,5.042134,0,0,10.3,1,0,0 +0,0,0,5.042134,0,0,10.3,1,0,0 +3,0,0,5.042134,0,0,13.8,0,1,0 +1,0,0,5.042134,0,0,13.8,0,1,0 +3,0,0,5.042134,0,0,13.8,0,1,0 +2,0,0,5.042134,0,0,13.8,1,0,0 +6,0,0,5.042134,0,0,13.8,1,0,0 +4,0,0,5.042134,0,0,13.8,1,0,0 +7,0,0,5.042134,0,0,10.57626,1,0,0 +5,0,0,5.042134,0,0,10.57626,1,0,0 +4,0,0,5.042134,0,0,10.57626,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +2,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +4,0,0,0,0,0,13.8,1,0,0 +10,0,0,0,0,0,13.8,1,0,0 +10,0,0,0,0,0,13.8,1,0,0 +9,0,0,0,0,0,13.8,1,0,0 +7,0,0,0,0,0,17.2,1,0,0 +2,0,0,0,0,0,17.2,1,0,0 +1,0,0,0,0,0,17.2,1,0,0 +1,0,0,0,0,0,17.2,1,0,0 +6,0,0,0,0,0,17.2,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +5,0,0,0,0,0,13.8,1,0,0 +6,0,0,0,0,0,13.8,1,0,0 +3,0,0,0,0,0,13.8,1,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,17.2,1,0,0 +0,0,0,0,0,0,17.2,1,0,0 +1,0,0,0,0,0,17.2,1,0,0 +2,3.258096,0,0,8.006368,0,6.9,1,0,0 +1,3.258096,0,0,8.006368,0,6.9,1,0,0 +2,3.258096,0,0,8.006368,0,6.9,1,0,0 +5,0,1,6.109248,6.160541,0,3.4,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +15,0,0,0,0,0,20.7,0,0,0 +6,0,0,0,0,0,20.7,0,0,0 +6,0,0,0,0,0,20.7,0,0,0 +11,0,0,0,0,0,20.7,0,0,0 +8,0,0,0,0,0,20.7,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +7,0,1,0,6.160541,0,13.8,1,0,0 +1,0,1,0,6.160541,0,13.8,1,0,0 +2,0,1,0,6.160541,0,13.8,1,0,0 +4,0,1,0,6.160541,0,13.8,1,0,0 +10,0,1,0,6.160541,0,13.8,1,0,0 +2,0,1,0,6.160541,0,3.4,1,0,0 +1,0,1,0,6.160541,0,3.4,1,0,0 +1,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +3,0,1,0,6.160541,0,3.4,1,0,0 +4,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +1,0,1,0,6.160541,0,10.57626,1,0,0 +2,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +1,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +2,0,1,0,6.160541,0,10.57626,1,0,0 +1,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +1,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +4,0,1,6.268187,5.755076,1,37.9,0,0,1 +7,0,1,6.268187,5.755076,1,37.9,0,0,1 +29,0,1,6.268187,5.755076,1,37.9,0,0,1 +5,0,1,6.268187,5.755076,1,37.9,0,0,1 +5,0,1,6.268187,5.755076,1,27.6,0,0,1 +3,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +3,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +1,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +1,3.931826,0,6.907755,7.600903,1,10.3,1,0,0 +3,3.931826,0,6.907755,7.600903,1,10.3,1,0,0 +4,3.931826,0,6.907755,7.600903,1,10.3,1,0,0 +2,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +0,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,1,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,1,0 +4,3.931826,0,6.907755,7.600903,0,10.57626,0,1,0 +12,0,0,5.632071,0,1,10.3,0,0,1 +0,0,0,5.632071,0,1,10.3,0,0,1 +2,0,0,5.632071,0,1,10.3,0,0,1 +0,0,0,5.632071,0,1,10.3,0,0,1 +11,0,0,5.632071,0,1,10.3,0,0,1 +5,0,0,0,0,0,6.9,0,1,0 +2,0,0,0,0,0,6.9,0,1,0 +3,0,0,0,0,0,6.9,0,1,0 +0,0,0,0,0,0,6.9,0,1,0 +3,0,0,0,0,0,6.9,0,1,0 +3,0,0,5.632071,0,0,3.4,0,1,0 +2,0,0,5.632071,0,0,3.4,0,1,0 +2,0,0,5.632071,0,0,3.4,0,1,0 +0,0,0,5.632071,0,0,3.4,0,1,0 +2,0,0,5.632071,0,0,3.4,0,1,0 +0,0,0,5.632071,0,0,3.4,0,1,0 +0,0,0,5.632071,0,0,3.4,0,1,0 +0,0,0,5.632071,0,0,3.4,0,1,0 +0,0,0,5.632071,0,0,3.4,0,1,0 +3,0,0,5.632071,0,0,3.4,0,1,0 +4,0,0,5.632071,0,0,10.57626,0,1,0 +3,0,0,5.632071,0,0,10.57626,0,1,0 +2,0,0,5.632071,0,0,10.57626,0,1,0 +0,0,0,5.632071,0,0,10.57626,0,1,0 +2,0,0,5.632071,0,0,10.57626,0,1,0 +4,0,0,5.632071,0,0,13.8,0,1,0 +1,0,0,5.632071,0,0,13.8,0,1,0 +10,0,0,5.632071,0,0,13.8,0,1,0 +3,0,0,5.632071,0,0,13.8,0,1,0 +8,0,0,5.632071,0,0,13.8,0,1,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +10,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +4,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +4,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +2,4.564348,0,6.907755,6.959049,0,20.7,0,1,0 +8,4.564348,0,6.907755,6.959049,0,20.7,0,1,0 +7,4.564348,0,6.907755,6.959049,0,20.7,0,1,0 +0,0,1,0,5.755076,0,10.57626,1,0,0 +1,0,1,0,5.755076,0,10.57626,1,0,0 +0,0,1,0,5.755076,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,0,5.755076,0,3.4,1,0,0 +0,0,1,0,5.755076,0,3.4,1,0,0 +0,0,1,0,5.755076,0,3.4,1,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +2,0,0,0,0,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,3.258096,0,3.039749,4.426044,0,10.57626,1,0,0 +0,3.258096,0,3.039749,4.426044,0,10.57626,1,0,0 +1,3.258096,0,3.039749,4.426044,0,10.57626,1,0,0 +0,3.258096,0,3.039749,4.426044,0,10.57626,0,1,0 +0,3.258096,0,3.039749,4.426044,0,10.57626,0,1,0 +0,3.258096,0,3.039749,4.426044,0,10.57626,0,1,0 +0,3.258096,0,3.039749,4.426044,1,0,1,0,0 +0,3.258096,0,3.039749,4.426044,1,0,1,0,0 +0,3.258096,0,3.039749,4.426044,1,0,1,0,0 +0,3.258096,0,3.039749,4.426044,1,34.5,0,0,1 +1,3.258096,0,3.039749,4.426044,1,34.5,0,0,1 +8,3.258096,0,3.039749,4.426044,1,34.5,0,0,1 +1,0,1,5.941959,5.755076,1,6.9,0,1,0 +0,0,1,5.941959,5.755076,1,6.9,0,1,0 +0,0,1,5.941959,5.755076,1,6.9,0,1,0 +0,0,1,5.941959,5.755076,1,6.9,0,1,0 +0,0,1,5.941959,5.755076,1,6.9,0,1,0 +1,0,1,5.941959,5.755076,0,3.4,1,0,0 +3,0,1,5.941959,5.755076,0,3.4,1,0,0 +1,0,1,5.941959,5.755076,0,3.4,1,0,0 +1,0,1,5.941959,5.755076,0,3.4,1,0,0 +2,0,1,5.941959,5.755076,0,3.4,1,0,0 +10,0,0,5.126342,0,0,3.4,1,0,0 +6,0,0,5.126342,0,0,3.4,1,0,0 +3,0,0,5.126342,0,0,3.4,1,0,0 +1,0,0,5.126342,0,0,10.57626,1,0,0 +0,0,0,5.126342,0,0,10.57626,1,0,0 +0,0,0,5.126342,0,0,10.57626,1,0,0 +2,0,0,5.126342,0,0,10.57626,1,0,0 +0,0,0,5.126342,0,0,10.57626,1,0,0 +0,0,0,5.126342,0,0,10.57626,1,0,0 +0,0,0,5.126342,0,0,10.3,0,1,0 +0,0,0,5.126342,0,0,10.3,0,1,0 +3,0,0,5.126342,0,0,10.3,0,1,0 +0,0,1,5.010635,6.160541,0,10.57626,0,0,0 +0,0,1,5.010635,6.160541,0,10.57626,0,0,0 +0,0,1,5.010635,6.160541,0,10.57626,0,0,0 +1,0,1,5.010635,6.160541,0,10.3,0,0,0 +1,0,1,5.010635,6.160541,0,10.3,0,0,0 +0,0,1,5.010635,6.160541,0,10.3,0,0,0 +1,0,1,5.010635,6.160541,0,10.57626,0,0,0 +0,0,1,5.010635,6.160541,0,10.57626,0,0,0 +0,0,1,5.010635,6.160541,0,10.57626,0,0,0 +0,0,1,5.010635,6.160541,0,6.9,0,0,0 +0,0,1,5.010635,6.160541,0,6.9,0,0,0 +1,0,1,5.010635,6.160541,0,6.9,0,0,0 +4,0,1,6.109248,6.160541,0,13.8,1,0,0 +2,0,1,6.109248,6.160541,0,13.8,1,0,0 +3,0,1,6.109248,6.160541,0,13.8,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +3,0,1,6.109248,6.160541,0,6.9,0,0,0 +6,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +0,0,1,6.109248,6.160541,0,27.6,1,0,0 +1,0,0,5.259992,0,0,6.9,1,0,0 +0,0,0,5.259992,0,0,6.9,1,0,0 +8,0,0,5.259992,0,0,6.9,1,0,0 +0,0,0,5.259992,0,0,10.3,1,0,0 +5,0,0,5.259992,0,0,10.3,1,0,0 +1,0,0,5.259992,0,0,10.3,1,0,0 +1,0,0,5.259992,0,0,10.57626,1,0,0 +1,0,0,5.259992,0,0,10.57626,1,0,0 +0,0,0,5.259992,0,0,10.57626,1,0,0 +3,0,0,5.259992,0,0,10.57626,1,0,0 +1,0,0,5.259992,0,0,10.57626,1,0,0 +0,0,0,5.259992,0,0,10.57626,1,0,0 +1,0,1,5.703783,5.755076,0,6.9,1,0,0 +0,0,1,5.703783,5.755076,0,6.9,1,0,0 +3,0,1,5.703783,5.755076,0,6.9,1,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +3,0,0,0,0,0,3.4,0,0,0 +1,3.931826,0,6.07507,6.560323,0,17.2,0,1,0 +1,3.931826,0,6.07507,6.560323,0,17.2,0,1,0 +3,3.931826,0,6.07507,6.560323,0,17.2,0,1,0 +0,3.931826,0,6.07507,6.560323,0,3.4,0,0,1 +7,3.931826,0,6.07507,6.560323,0,3.4,0,0,1 +2,3.931826,0,6.07507,6.560323,0,3.4,0,0,1 +5,0,1,6.109248,6.160541,0,10.57626,0,1,0 +8,0,1,6.109248,6.160541,0,0,0,0,0 +3,0,1,6.109248,6.160541,0,0,1,0,0 +3,0,1,6.109248,6.160541,1,24.1,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,1,6.9,0,0,0 +0,3.258096,0,7.163699,8.006368,0,0,0,0,0 +0,3.258096,0,7.163699,8.006368,0,0,0,0,0 +0,3.258096,0,7.163699,8.006368,0,0,0,0,0 +0,3.258096,0,7.163699,8.006368,0,0,0,0,0 +0,3.258096,0,7.163699,8.006368,0,0,0,0,0 +1,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +1,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +2,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +5,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +1,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +2,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +0,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +0,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +2,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +0,3.258096,0,7.163699,8.006368,0,10.57626,0,0,0 +1,3.931826,0,6.907755,7.600903,0,17.2,0,0,0 +0,3.931826,0,6.907755,7.600903,0,17.2,0,0,0 +0,3.931826,0,6.907755,7.600903,0,17.2,0,0,0 +12,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +9,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,17.2,1,0,0 +5,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,17.2,1,0,0 +4,0,1,6.109248,6.160541,0,17.2,1,0,0 +1,0,1,6.109248,6.160541,0,17.2,1,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +5,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +3,0,1,6.109248,6.160541,0,3.4,0,0,0 +13,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +4,0,0,4.457134,0,0,24.1,1,0,0 +4,0,0,4.457134,0,0,24.1,1,0,0 +1,0,0,4.457134,0,0,24.1,1,0,0 +1,0,0,4.457134,0,0,3.4,0,0,0 +1,0,0,4.457134,0,0,3.4,0,0,0 +0,0,0,4.457134,0,0,3.4,0,0,0 +2,0,0,4.457134,0,0,27.6,1,0,0 +1,0,0,4.457134,0,0,27.6,1,0,0 +2,0,0,4.457134,0,0,27.6,1,0,0 +2,0,1,6.708963,6.160541,0,20.7,0,0,0 +1,0,1,6.708963,6.160541,0,20.7,0,0,0 +3,0,1,6.708963,6.160541,0,20.7,0,0,0 +3,0,1,6.708963,6.160541,0,10.57626,0,0,0 +1,0,1,6.708963,6.160541,0,10.57626,0,0,0 +3,0,1,6.708963,6.160541,0,10.57626,0,0,0 +3,0,1,6.708963,6.160541,0,10.3,0,0,0 +0,0,1,6.708963,6.160541,0,10.3,0,0,0 +3,0,1,6.708963,6.160541,0,10.3,0,0,0 +7,0,1,6.708963,6.160541,0,10.57626,0,0,0 +3,0,1,6.708963,6.160541,0,10.57626,0,0,0 +3,0,1,6.708963,6.160541,0,10.57626,0,0,0 +4,0,0,6.370175,0,1,31,0,0,1 +0,0,0,6.370175,0,1,31,0,0,1 +0,0,1,6.109248,6.160541,0,17.2,0,0,0 +0,0,1,6.109248,6.160541,0,17.2,0,0,0 +0,0,1,6.109248,6.160541,0,17.2,0,0,0 +3,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +3,0,1,6.109248,6.160541,0,10.3,0,0,0 +9,0,1,6.109248,6.160541,0,10.57626,1,0,0 +13,0,1,6.109248,6.160541,0,10.57626,1,0,0 +4,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,0,0,0,0,6.9,0,1,0 +1,0,0,0,0,0,6.9,0,1,0 +4,0,0,0,0,0,6.9,0,1,0 +0,0,0,0,0,0,6.9,0,1,0 +1,0,0,0,0,0,10.57626,0,1,0 +1,0,0,0,0,0,10.57626,0,1,0 +3,0,0,0,0,0,10.57626,0,1,0 +3,0,0,0,0,0,10.57626,0,1,0 +2,0,0,0,0,0,10.57626,0,1,0 +11,0,0,0,0,1,17.2,0,1,0 +21,0,0,0,0,1,17.2,0,1,0 +19,0,0,0,0,1,17.2,0,1,0 +2,0,0,0,0,0,10.57626,0,1,0 +5,0,0,0,0,0,10.57626,0,1,0 +2,0,0,0,0,0,10.57626,0,1,0 +4,0,0,0,0,0,10.57626,0,1,0 +2,0,0,0,0,0,10.57626,0,1,0 +0,0,0,0,0,0,6.9,0,1,0 +3,0,0,0,0,0,6.9,0,1,0 +3,0,0,0,0,0,6.9,0,1,0 +4,0,0,0,0,0,6.9,0,1,0 +8,0,0,0,0,1,10.3,0,0,0 +4,0,0,0,0,1,10.3,0,0,0 +0,0,0,0,0,1,10.3,0,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +3,0,1,5.010635,6.160541,0,3.4,1,0,0 +0,0,1,5.010635,6.160541,0,3.4,1,0,0 +0,0,1,5.010635,6.160541,0,3.4,1,0,0 +0,0,1,5.010635,6.160541,0,3.4,0,0,1 +0,0,1,5.010635,6.160541,0,3.4,0,0,1 +2,0,1,5.010635,6.160541,0,3.4,0,0,1 +1,0,1,5.010635,6.160541,0,10.57626,1,0,0 +1,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +2,3.931826,0,6.276455,6.969603,0,0,0,0,0 +0,3.931826,0,6.276455,6.969603,0,0,0,0,0 +2,3.931826,0,6.276455,6.969603,0,0,0,0,0 +1,3.931826,0,6.276455,6.969603,0,0,0,0,0 +2,3.931826,0,6.276455,6.969603,0,0,0,0,0 +4,0,0,5.377498,0,0,17.2,0,0,1 +10,0,0,5.377498,0,0,17.2,0,0,1 +4,0,0,5.377498,0,0,17.2,0,0,1 +1,0,0,5.377498,0,0,27.6,1,0,0 +3,0,0,5.377498,0,0,27.6,1,0,0 +3,0,0,5.377498,0,0,27.6,1,0,0 +2,0,0,5.377498,0,0,10.57626,0,0,1 +6,0,0,5.377498,0,0,10.57626,0,0,1 +6,0,0,5.377498,0,0,10.57626,0,0,1 +0,0,0,5.377498,0,0,0,0,0,0 +0,0,0,5.377498,0,0,0,0,0,0 +3,0,0,5.377498,0,0,3.4,1,0,0 +7,0,0,5.377498,0,0,3.4,1,0,0 +1,0,0,5.377498,0,0,3.4,1,0,0 +2,0,0,5.377498,0,0,10.57626,0,0,0 +1,0,0,5.377498,0,0,10.57626,0,0,0 +1,0,0,5.377498,0,0,10.57626,0,0,0 +2,0,0,5.377498,0,0,3.4,1,0,0 +0,0,0,5.377498,0,0,3.4,1,0,0 +0,0,0,5.377498,0,0,3.4,1,0,0 +4,4.564348,0,5.898527,5.94982,1,17.2,0,0,1 +0,4.564348,0,5.898527,5.94982,1,17.2,0,0,1 +1,4.564348,0,5.898527,5.94982,1,17.2,0,0,1 +2,0,0,0,0,1,0,0,1,0 +1,0,0,0,0,1,0,0,1,0 +1,0,0,0,0,1,0,0,1,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,3.4,0,1,0 +0,0,0,0,0,0,3.4,0,1,0 +3,0,0,0,0,0,3.4,0,1,0 +1,0,0,0,0,0,10.57626,1,0,0 +2,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +4,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +2,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +9,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +1,0,1,5.163185,6.160541,.1442925,10.57626,1,0,0 +0,0,1,5.163185,6.160541,.1442925,10.57626,1,0,0 +0,0,1,5.163185,6.160541,.1442925,10.57626,1,0,0 +1,0,1,5.163185,6.160541,.1442925,10.57626,1,0,0 +0,0,1,5.163185,6.160541,.1442925,10.57626,1,0,0 +0,0,1,5.163185,6.160541,.1442925,10.57626,1,0,0 +7,0,1,5.163185,6.160541,0,20.7,1,0,0 +1,0,1,5.163185,6.160541,0,20.7,1,0,0 +0,0,1,5.163185,6.160541,0,20.7,1,0,0 +0,0,1,5.163185,6.160541,0,13.8,1,0,0 +0,0,1,5.163185,6.160541,0,13.8,1,0,0 +0,0,1,5.163185,6.160541,0,13.8,1,0,0 +0,3.258096,0,6.620073,8.006368,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,0,0,1,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,0,1,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,0,1,0,0 +1,3.258096,0,6.620073,8.006368,.1442925,0,1,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,0,1,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,0,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,1,3.4,0,1,0 +0,3.258096,0,6.620073,8.006368,1,3.4,0,1,0 +1,3.258096,0,6.620073,8.006368,1,3.4,0,1,0 +0,3.258096,0,6.620073,8.006368,1,3.4,0,1,0 +0,3.258096,0,6.620073,8.006368,1,3.4,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +2,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +2,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +0,4.564348,0,6.436151,5.741653,0,10.57626,0,1,0 +1,4.564348,0,6.436151,5.741653,0,10.57626,0,1,0 +0,4.564348,0,6.436151,5.741653,0,10.57626,0,1,0 +0,4.564348,0,6.436151,5.741653,1,13.8,1,0,0 +0,4.564348,0,6.436151,5.741653,1,13.8,1,0,0 +0,4.564348,0,6.436151,5.741653,1,13.8,1,0,0 +0,4.564348,0,6.436151,5.741653,0,0,0,1,0 +0,4.564348,0,6.436151,5.741653,0,0,0,1,0 +0,4.564348,0,6.436151,5.741653,0,0,0,1,0 +0,4.564348,0,6.436151,5.741653,0,10.57626,0,1,0 +0,4.564348,0,6.436151,5.741653,0,10.57626,0,1,0 +0,4.564348,0,6.436151,5.741653,0,10.57626,0,1,0 +0,4.564348,0,6.436151,5.741653,0,6.9,0,1,0 +1,4.564348,0,6.436151,5.741653,0,6.9,0,1,0 +0,4.564348,0,6.436151,5.741653,0,6.9,0,1,0 +0,4.564348,0,6.55108,6.602374,1,27.6,0,0,0 +1,4.564348,0,6.55108,6.602374,1,27.6,0,0,0 +0,4.564348,0,6.55108,6.602374,1,27.6,0,0,0 +4,4.564348,0,6.55108,6.602374,1,27.6,0,0,0 +2,4.564348,0,6.55108,6.602374,1,27.6,0,0,0 +0,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +1,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +0,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +1,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +1,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +0,4.564348,0,6.55108,6.602374,1,6.9,0,0,0 +0,4.564348,0,6.55108,6.602374,1,6.9,0,0,0 +0,4.564348,0,6.55108,6.602374,1,6.9,0,0,0 +1,4.564348,0,6.55108,6.602374,1,6.9,0,0,0 +0,4.564348,0,6.55108,6.602374,1,6.9,0,0,0 +1,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +2,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +4,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +1,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +2,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +0,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +0,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +0,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +0,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +2,4.564348,0,6.55108,6.602374,0,10.57626,0,0,0 +1,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +1,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +5,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,0,0 +3,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +2,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +3,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +2,3.931826,0,6.907755,7.600903,0,6.9,0,0,0 +0,0,1,6.115627,6.160541,.1442925,10.57626,1,0,0 +1,0,1,6.115627,6.160541,.1442925,10.57626,1,0,0 +0,0,1,6.115627,6.160541,.1442925,10.57626,1,0,0 +3,0,1,6.115627,6.160541,0,10.3,1,0,0 +0,0,1,6.115627,6.160541,0,10.3,1,0,0 +0,0,1,6.115627,6.160541,0,10.3,1,0,0 +20,0,1,6.115627,6.160541,1,3.4,1,0,0 +0,0,1,6.115627,6.160541,1,3.4,1,0,0 +2,0,1,6.115627,6.160541,1,3.4,1,0,0 +1,0,1,6.109248,6.160541,1,17.2,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +0,0,1,6.109248,6.160541,1,17.2,1,0,0 +4,0,0,0,0,0,10.57626,1,0,0 +8,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +2,0,0,0,0,0,10.57626,1,0,0 +5,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +3,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +1,0,0,0,0,0,6.9,1,0,0 +8,0,0,0,0,1,13.8,1,0,0 +2,0,0,0,0,1,13.8,1,0,0 +6,0,0,0,0,1,13.8,1,0,0 +5,0,0,0,0,1,13.8,1,0,0 +4,0,0,0,0,1,13.8,1,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +8,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +12,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +21,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +18,3.258096,0,6.620073,8.006368,1,20.7,1,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +7,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +15,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +14,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,0,0,5.827062,0,0,20.7,1,0,0 +2,0,0,5.827062,0,0,20.7,1,0,0 +1,0,0,5.827062,0,0,20.7,1,0,0 +4,0,0,5.827062,0,0,20.7,1,0,0 +6,0,0,5.827062,0,0,20.7,1,0,0 +7,0,0,5.827062,0,0,20.7,1,0,0 +5,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +5,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +4,0,0,0,0,0,17.2,0,0,0 +3,0,0,0,0,0,17.2,0,0,0 +2,0,0,0,0,0,17.2,0,0,0 +4,0,0,5.567428,0,0,10.3,1,0,0 +0,0,0,5.567428,0,0,10.3,1,0,0 +2,0,0,5.567428,0,0,10.3,1,0,0 +8,0,0,5.567428,0,0,20.7,1,0,0 +8,0,0,5.567428,0,0,20.7,1,0,0 +7,0,0,5.567428,0,0,20.7,1,0,0 +2,0,1,5.703783,5.755076,1,37.9,0,1,0 +2,0,1,5.703783,5.755076,1,37.9,0,1,0 +5,0,1,5.703783,5.755076,1,37.9,0,1,0 +1,0,1,5.703783,5.755076,1,24.1,1,0,0 +9,0,1,5.703783,5.755076,1,24.1,1,0,0 +8,0,1,5.703783,5.755076,1,24.1,1,0,0 +2,3.258096,0,6.343529,7.729823,0,13.8,1,0,0 +1,3.258096,0,6.343529,7.729823,0,13.8,1,0,0 +0,3.258096,0,6.343529,7.729823,0,13.8,1,0,0 +0,3.258096,0,6.343529,7.729823,0,10.57626,1,0,0 +0,3.258096,0,6.343529,7.729823,0,10.57626,1,0,0 +0,3.258096,0,6.343529,7.729823,0,10.57626,1,0,0 +4,3.258096,0,6.343529,7.729823,0,3.4,1,0,0 +2,3.258096,0,6.343529,7.729823,0,3.4,1,0,0 +4,3.258096,0,6.343529,7.729823,0,3.4,1,0,0 +0,0,0,5.259992,0,0,6.9,0,0,0 +3,0,0,5.259992,0,0,6.9,0,0,0 +2,0,0,5.259992,0,0,6.9,0,0,0 +1,0,0,5.259992,0,0,10.3,1,0,0 +8,0,0,5.259992,0,0,10.3,1,0,0 +5,0,0,5.259992,0,0,10.3,1,0,0 +1,0,0,5.029653,0,0,3.4,0,1,0 +0,0,0,5.029653,0,0,3.4,0,1,0 +1,0,0,5.029653,0,0,3.4,0,1,0 +2,0,0,5.029653,0,0,3.4,0,1,0 +0,0,0,5.029653,0,0,3.4,0,1,0 +1,0,0,5.029653,0,1,10.3,0,0,1 +15,0,0,5.029653,0,1,10.3,0,0,1 +2,0,0,5.029653,0,1,10.3,0,0,1 +1,0,0,5.029653,0,1,10.3,0,0,1 +2,0,0,5.029653,0,1,10.3,0,0,1 +0,0,0,5.029653,0,0,13.8,0,0,1 +1,0,0,5.029653,0,0,13.8,0,0,1 +0,0,0,5.029653,0,0,13.8,0,0,1 +0,0,0,5.029653,0,0,13.8,0,0,1 +0,0,0,5.029653,0,0,13.8,0,0,1 +6,0,1,6.767757,6.160541,1,24.1,0,1,0 +22,0,1,6.767757,6.160541,1,24.1,0,1,0 +13,0,1,6.767757,6.160541,1,24.1,0,1,0 +2,0,1,6.767757,6.160541,0,0,0,0,0 +0,0,1,6.767757,6.160541,0,0,0,0,0 +0,0,1,6.767757,6.160541,0,0,0,0,0 +2,0,1,6.767757,6.160541,0,10.57626,0,0,0 +4,0,1,6.767757,6.160541,0,10.57626,0,0,0 +1,0,1,6.767757,6.160541,0,10.57626,0,0,0 +0,0,0,5.259992,0,1,20.7,1,0,0 +3,0,0,5.259992,0,1,20.7,1,0,0 +0,0,0,5.259992,0,1,20.7,1,0,0 +1,0,0,5.259992,0,0,6.9,0,0,0 +0,0,0,5.259992,0,0,6.9,0,0,0 +1,0,0,5.259992,0,0,6.9,0,0,0 +6,0,0,5.259992,0,1,20.7,1,0,0 +4,0,0,5.259992,0,1,20.7,1,0,0 +3,0,0,5.259992,0,1,20.7,1,0,0 +2,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +3,3.258096,0,6.620073,8.006368,.1442925,10.57626,1,0,0 +8,3.258096,0,6.620073,8.006368,.1442925,10.57626,1,0,0 +2,3.258096,0,6.620073,8.006368,.1442925,10.57626,1,0,0 +1,0,0,5.259992,0,0,10.57626,1,0,0 +2,0,0,5.259992,0,0,10.57626,1,0,0 +3,0,0,5.259992,0,0,10.57626,1,0,0 +1,0,0,5.259992,0,0,3.4,1,0,0 +1,0,0,5.259992,0,0,3.4,1,0,0 +1,0,0,5.259992,0,0,3.4,1,0,0 +1,0,0,5.259992,0,0,3.4,1,0,0 +4,0,0,5.259992,0,0,3.4,1,0,0 +2,0,0,5.259992,0,0,3.4,1,0,0 +4,0,1,5.703783,5.755076,0,10.3,1,0,0 +1,0,1,5.703783,5.755076,0,10.3,1,0,0 +6,0,1,5.703783,5.755076,0,10.3,1,0,0 +0,0,1,5.703783,5.755076,0,0,0,0,0 +0,0,1,5.703783,5.755076,0,0,0,0,0 +1,0,1,5.703783,5.755076,0,0,0,0,0 +0,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +0,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +0,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +0,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +0,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +0,3.258096,0,5.204007,6.590301,0,10.3,0,0,0 +0,3.258096,0,5.204007,6.590301,0,10.3,0,0,0 +0,3.258096,0,5.204007,6.590301,0,10.3,0,0,0 +1,3.258096,0,5.204007,6.590301,0,10.3,0,0,0 +2,3.258096,0,5.204007,6.590301,0,10.3,0,0,0 +2,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +2,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +0,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +5,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +3,3.258096,0,5.204007,6.590301,0,10.57626,0,0,0 +5,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +4,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +3,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +1,0,1,6.109248,6.160541,0,20.7,1,0,0 +1,0,1,6.109248,6.160541,0,20.7,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +4,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +4,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +2,0,1,6.109248,6.160541,1,37.9,0,1,0 +4,0,1,6.109248,6.160541,1,37.9,0,1,0 +0,0,1,6.109248,6.160541,1,37.9,0,1,0 +2,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,0 +1,0,1,6.109248,6.160541,0,13.8,0,0,0 +2,0,1,6.109248,6.160541,0,13.8,0,0,0 +2,0,1,6.109248,6.160541,0,13.8,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,4.564348,0,0,5.928188,0,6.9,1,0,0 +0,4.564348,0,0,5.928188,0,6.9,1,0,0 +0,4.564348,0,0,5.928188,0,6.9,1,0,0 +0,4.564348,0,6.709304,6.760598,0,3.4,1,0,0 +0,4.564348,0,6.709304,6.760598,0,3.4,1,0,0 +0,4.564348,0,6.709304,6.760598,0,3.4,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,13.8,1,0,0 +0,4.564348,0,6.709304,6.760598,0,13.8,1,0,0 +0,4.564348,0,6.709304,6.760598,0,13.8,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +0,4.564348,0,6.709304,6.760598,0,10.57626,1,0,0 +2,4.564348,0,4.393214,4.444507,0,10.3,0,1,0 +0,4.564348,0,4.393214,4.444507,0,10.3,0,1,0 +0,4.564348,0,4.393214,4.444507,0,10.3,0,1,0 +0,4.564348,0,4.393214,4.444507,0,10.57626,0,1,0 +0,4.564348,0,4.393214,4.444507,0,10.57626,0,1,0 +0,4.564348,0,4.393214,4.444507,0,10.57626,0,1,0 +0,4.564348,0,4.393214,4.444507,0,10.57626,0,0,0 +0,4.564348,0,4.393214,4.444507,0,10.57626,0,0,0 +0,4.564348,0,4.393214,4.444507,0,10.57626,0,0,0 +0,3.931826,0,0,7.600903,.1442925,10.57626,0,0,0 +14,3.931826,0,0,7.600903,.1442925,10.57626,0,0,0 +9,3.931826,0,0,7.600903,.1442925,10.57626,0,0,0 +0,3.931826,0,0,7.600903,.1442925,10.57626,0,0,0 +2,3.931826,0,0,7.600903,.1442925,10.57626,0,0,0 +13,0,0,0,0,0,3.4,1,0,0 +18,0,0,0,0,0,3.4,1,0,0 +16,0,0,0,0,0,3.4,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +2,0,0,0,0,0,6.9,1,0,0 +7,0,0,0,0,0,6.9,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +2,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +4,4.564348,0,5.283711,5.335004,1,24.1,0,0,1 +7,4.564348,0,5.283711,5.335004,1,24.1,0,0,1 +6,4.564348,0,5.283711,5.335004,1,24.1,0,0,1 +4,4.564348,0,5.283711,5.335004,1,24.1,0,0,1 +7,4.564348,0,5.283711,5.335004,1,24.1,0,0,1 +0,4.564348,0,5.283711,5.335004,0,20.7,0,0,1 +2,4.564348,0,5.283711,5.335004,0,20.7,0,0,1 +1,0,0,0,0,1,17.2,0,1,0 +0,0,0,0,0,1,17.2,0,1,0 +0,0,0,0,0,1,17.2,0,1,0 +0,0,0,0,0,1,17.2,0,1,0 +1,0,0,0,0,1,17.2,0,1,0 +6,0,0,0,0,0,24.1,1,0,0 +4,0,0,0,0,0,24.1,1,0,0 +6,0,0,0,0,0,24.1,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,1,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,1,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,1,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,1,0 +1,3.258096,0,6.620073,8.006368,0,13.8,0,1,0 +2,3.258096,0,6.620073,8.006368,0,13.8,0,1,0 +4,3.258096,0,6.620073,8.006368,0,13.8,0,1,0 +1,3.258096,0,6.620073,8.006368,.1442925,10.57626,1,0,0 +2,3.258096,0,6.620073,8.006368,.1442925,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,.1442925,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,0,31,0,1,0 +8,3.258096,0,6.620073,8.006368,0,31,0,1,0 +4,3.258096,0,6.620073,8.006368,0,31,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +4,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +5,3.258096,0,6.620073,8.006368,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +1,4.564348,0,6.907755,6.959049,1,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +2,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +5,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +4,0,1,6.109248,6.160541,1,13.8,0,1,0 +18,0,1,6.109248,6.160541,1,13.8,0,1,0 +6,0,1,6.109248,6.160541,1,13.8,0,1,0 +3,0,0,0,0,0,10.3,0,0,0 +3,0,0,0,0,0,10.3,0,0,0 +4,0,0,0,0,0,10.3,0,0,0 +3,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +7,0,0,0,0,0,6.9,0,0,0 +7,0,0,0,0,0,10.57626,0,0,0 +12,0,0,0,0,0,10.57626,0,0,0 +7,0,0,0,0,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,0,0,1,0 +0,0,1,0,6.160541,0,0,0,1,0 +0,0,1,0,6.160541,0,0,0,1,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,10.57626,1,0,0 +0,0,1,0,6.160541,0,13.8,1,0,0 +0,0,1,0,6.160541,0,13.8,1,0,0 +0,0,1,0,6.160541,0,13.8,1,0,0 +0,0,1,0,6.160541,0,3.4,0,0,0 +0,0,1,0,6.160541,0,3.4,0,0,0 +0,0,1,0,6.160541,0,3.4,0,0,0 +19,0,0,5.444493,0,1,37.9,0,1,0 +15,0,0,5.444493,0,1,37.9,0,1,0 +17,0,0,5.444493,0,1,37.9,0,1,0 +28,0,0,5.444493,0,1,20.7,1,0,0 +32,0,0,5.444493,0,1,20.7,1,0,0 +0,0,0,3.178054,0,0,0,0,0,0 +0,0,0,3.178054,0,0,0,0,0,0 +0,0,0,3.178054,0,0,0,0,0,0 +5,0,0,3.178054,0,1,27.6,1,0,0 +7,0,0,3.178054,0,1,27.6,1,0,0 +6,0,0,3.178054,0,1,27.6,1,0,0 +0,3.258096,0,6.021509,6.918102,1,24.1,0,1,0 +0,3.258096,0,6.021509,6.918102,1,24.1,0,1,0 +0,3.258096,0,6.021509,6.918102,1,24.1,0,1,0 +0,3.931826,0,5.753049,6.446196,0,24.1,0,1,0 +1,3.931826,0,5.753049,6.446196,0,24.1,0,1,0 +0,3.931826,0,5.753049,6.446196,0,24.1,0,1,0 +0,3.931826,0,5.753049,6.446196,1,17.2,1,0,0 +0,3.931826,0,5.753049,6.446196,1,17.2,1,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +8,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +5,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +7,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +4,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +16,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +5,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +8,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +6,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +7,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +1,3.258096,0,6.620073,8.006368,0,0,0,0,0 +2,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +6,3.258096,0,6.620073,8.006368,1,24.1,1,0,0 +3,3.258096,0,6.620073,8.006368,1,24.1,1,0,0 +1,3.258096,0,6.620073,8.006368,1,24.1,1,0,0 +5,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,0,0,5.285232,0,0,6.9,0,0,0 +1,0,0,5.285232,0,0,6.9,0,0,0 +2,0,0,5.285232,0,0,6.9,0,0,0 +1,0,0,5.285232,0,0,10.3,0,0,0 +3,0,0,5.285232,0,0,10.3,0,0,0 +2,0,0,5.285232,0,0,10.3,0,0,0 +0,0,0,5.285232,0,0,10.3,0,0,0 +0,0,0,5.285232,0,0,10.3,0,0,0 +1,0,0,5.285232,0,0,10.3,0,0,0 +2,0,0,4.97231,0,0,17.2,1,0,0 +0,0,0,4.97231,0,0,17.2,1,0,0 +0,0,0,4.97231,0,0,17.2,1,0,0 +0,0,0,4.97231,0,0,10.57626,0,0,0 +1,0,0,4.97231,0,0,10.57626,0,0,0 +0,0,0,4.97231,0,0,10.57626,0,0,0 +2,0,0,4.97231,0,0,31,1,0,0 +2,0,0,4.97231,0,0,31,1,0,0 +1,0,0,4.97231,0,0,31,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +2,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,0,1,0 +7,0,0,0,0,0,10.3,0,1,0 +13,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,0,0,1,0 +0,0,0,0,0,0,0,0,1,0 +0,0,0,0,0,0,0,0,1,0 +0,4.564348,0,5.572838,6.959049,0,0,1,0,0 +0,4.564348,0,5.572838,6.959049,0,0,1,0,0 +0,4.564348,0,5.572838,6.959049,0,0,1,0,0 +0,4.564348,0,5.572838,6.959049,0,10.57626,1,0,0 +0,4.564348,0,5.572838,6.959049,0,10.57626,1,0,0 +0,4.564348,0,5.572838,6.959049,0,10.57626,1,0,0 +0,4.564348,0,5.572838,6.959049,0,0,1,0,0 +0,4.564348,0,5.572838,6.959049,0,0,1,0,0 +0,4.564348,0,5.572838,6.959049,0,0,1,0,0 +0,4.564348,0,5.572838,6.959049,0,10.57626,0,0,0 +0,4.564348,0,5.572838,6.959049,0,10.57626,0,0,0 +0,4.564348,0,5.572838,6.959049,0,10.57626,0,0,0 +1,0,0,4.668708,0,1,17.2,1,0,0 +3,0,0,4.668708,0,1,17.2,1,0,0 +2,0,0,4.668708,0,1,17.2,1,0,0 +1,0,0,4.668708,0,0,10.57626,1,0,0 +1,0,0,4.668708,0,0,10.57626,1,0,0 +2,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,13.8,1,0,0 +1,0,0,4.668708,0,0,13.8,1,0,0 +1,0,0,4.668708,0,0,13.8,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +3,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +2,0,0,4.668708,0,0,13.8,1,0,0 +3,0,0,4.668708,0,0,13.8,1,0,0 +4,0,0,4.668708,0,0,13.8,1,0,0 +1,0,0,4.668708,0,0,10.57626,1,0,0 +1,0,0,4.668708,0,0,10.57626,1,0,0 +1,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +1,0,0,4.668708,0,0,10.57626,1,0,0 +0,0,0,4.668708,0,0,10.57626,1,0,0 +1,0,0,4.668708,0,0,3.4,1,0,0 +1,0,0,4.668708,0,0,3.4,1,0,0 +0,0,0,4.668708,0,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +1,4.564348,0,6.907755,6.959049,0,0,0,0,0 +2,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +4,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +3,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +4,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +8,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +5,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +0,0,1,6.109248,6.160541,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,1,10.3,1,0,0 +2,3.258096,0,6.620073,8.006368,1,10.3,1,0,0 +2,3.258096,0,6.620073,8.006368,1,10.3,1,0,0 +10,4.564348,0,6.50354,6.569703,0,17.2,1,0,0 +10,4.564348,0,6.50354,6.569703,0,17.2,1,0,0 +5,4.564348,0,6.50354,6.569703,0,17.2,1,0,0 +4,4.564348,0,6.50354,6.569703,0,17.2,1,0,0 +2,4.564348,0,6.50354,6.569703,0,17.2,1,0,0 +0,4.564348,0,6.50354,6.569703,0,6.9,0,0,0 +0,4.564348,0,6.50354,6.569703,0,6.9,0,0,0 +0,4.564348,0,6.50354,6.569703,0,6.9,0,0,0 +1,4.564348,0,6.50354,6.569703,0,6.9,0,0,0 +0,4.564348,0,6.50354,6.569703,0,6.9,0,0,0 +0,0,1,5.857819,5.755076,0,0,0,0,0 +0,0,1,5.857819,5.755076,0,0,0,0,0 +0,0,1,5.857819,5.755076,0,0,0,0,0 +1,0,1,5.857819,5.755076,0,0,0,0,0 +0,0,1,5.857819,5.755076,0,0,0,0,0 +0,0,1,5.857819,5.755076,0,13.8,0,0,0 +2,0,1,5.857819,5.755076,0,13.8,0,0,0 +1,0,1,5.857819,5.755076,0,13.8,0,0,0 +1,0,1,5.857819,5.755076,0,13.8,0,0,0 +0,0,1,5.857819,5.755076,0,13.8,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,1,0,0 +4,0,1,6.109248,6.160541,1,10.3,1,0,0 +7,0,1,6.109248,6.160541,1,10.3,1,0,0 +2,0,1,6.109248,6.160541,0,10.3,0,1,0 +3,0,1,6.109248,6.160541,0,10.3,0,1,0 +1,0,1,6.109248,6.160541,0,10.3,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,1,0,0 +2,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +2,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +2,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +1,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +0,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +0,0,1,6.109248,6.160541,1,10.57626,0,0,1 +2,0,1,6.109248,6.160541,1,10.57626,0,0,1 +0,0,1,6.109248,6.160541,1,10.57626,0,0,1 +0,0,1,6.109248,6.160541,1,6.9,1,0,0 +0,0,1,6.109248,6.160541,1,6.9,1,0,0 +3,0,1,6.109248,6.160541,1,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,0,0,1 +0,0,1,6.109248,6.160541,0,13.8,0,0,1 +0,0,1,6.109248,6.160541,0,13.8,0,0,1 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +0,0,1,6.109248,6.160541,0,6.9,0,1,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,1 +1,0,1,6.109248,6.160541,0,6.9,0,0,1 +0,0,1,6.109248,6.160541,0,6.9,0,0,1 +1,0,1,6.109248,6.160541,0,10.57626,0,0,1 +0,0,1,6.109248,6.160541,0,10.57626,0,0,1 +0,0,1,6.109248,6.160541,0,10.57626,0,0,1 +0,0,1,5.615461,5.061929,0,0,0,1,0 +0,0,1,5.615461,5.061929,0,0,0,1,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,1,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,1,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,1,0 +2,3.258096,0,6.094923,7.481217,0,10.57626,0,0,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,0,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,0,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +2,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +3,3.258096,0,6.094923,7.481217,0,10.3,0,1,0 +4,3.258096,0,6.094923,7.481217,0,10.3,0,1,0 +12,3.258096,0,6.094923,7.481217,0,10.3,0,1,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +1,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +2,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +3,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,1,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,1,0 +1,3.258096,0,6.094923,7.481217,0,10.57626,0,1,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,1,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,1,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,0,1,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +2,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +0,3.258096,0,6.094923,7.481217,0,10.57626,1,0,0 +4,3.258096,0,6.094923,7.481217,1,10.3,1,0,0 +3,3.258096,0,6.094923,7.481217,1,10.3,1,0,0 +3,3.258096,0,6.094923,7.481217,1,10.3,1,0,0 +0,0,0,5.986854,0,0,0,1,0,0 +1,0,0,5.986854,0,0,0,1,0,0 +0,0,0,5.986854,0,0,0,1,0,0 +12,0,0,5.743003,0,1,6.9,0,1,0 +5,0,0,5.743003,0,1,6.9,0,1,0 +7,0,0,5.743003,0,1,6.9,0,1,0 +1,0,0,5.743003,0,0,10.57626,1,0,0 +3,0,0,5.743003,0,0,10.57626,1,0,0 +1,0,0,5.743003,0,0,10.57626,1,0,0 +1,0,0,6.148468,0,0,6.9,1,0,0 +0,0,0,6.148468,0,0,6.9,1,0,0 +10,0,0,6.148468,0,0,6.9,1,0,0 +0,0,0,5.743003,0,0,0,1,0,0 +2,0,0,5.743003,0,0,0,1,0,0 +3,0,0,5.743003,0,0,0,1,0,0 +0,0,0,5.743003,0,1,6.9,0,1,0 +0,0,0,5.743003,0,1,6.9,0,1,0 +1,0,0,5.743003,0,1,6.9,0,1,0 +9,0,1,6.701961,5.755076,1,20.7,0,0,1 +14,0,1,6.701961,5.755076,1,20.7,0,0,1 +2,0,1,6.701961,5.755076,1,20.7,0,0,1 +1,0,1,6.701961,5.755076,0,6.9,0,1,0 +1,0,1,6.701961,5.755076,0,6.9,0,1,0 +2,0,1,6.701961,5.755076,0,6.9,0,1,0 +0,3.258096,0,6.476973,7.863267,0,10.57626,0,1,0 +0,3.258096,0,6.476973,7.863267,0,10.57626,0,1,0 +0,3.258096,0,6.476973,7.863267,0,10.57626,0,1,0 +1,3.258096,0,6.476973,7.863267,0,10.57626,0,1,0 +4,3.258096,0,6.476973,7.863267,0,10.57626,0,1,0 +1,3.258096,0,6.476973,7.863267,0,3.4,0,0,0 +0,3.258096,0,6.476973,7.863267,0,3.4,0,0,0 +0,3.258096,0,6.476973,7.863267,0,3.4,0,0,0 +1,3.258096,0,6.476973,7.863267,0,3.4,0,0,0 +2,3.258096,0,6.476973,7.863267,0,3.4,0,0,0 +2,3.258096,0,6.476973,7.863267,0,10.3,0,0,0 +0,3.258096,0,6.476973,7.863267,0,10.3,0,0,0 +1,3.258096,0,6.476973,7.863267,0,10.3,0,0,0 +3,3.258096,0,6.476973,7.863267,0,10.3,0,0,0 +8,3.258096,0,6.476973,7.863267,0,10.3,0,0,0 +0,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +1,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +2,4.564348,0,6.907755,6.959049,0,20.7,1,0,0 +1,0,1,6.109248,6.160541,0,20.7,1,0,0 +22,0,1,6.109248,6.160541,0,20.7,1,0,0 +1,0,1,6.109248,6.160541,0,20.7,1,0,0 +3,0,1,6.109248,6.160541,0,6.9,1,0,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +2,0,1,6.109248,6.160541,0,10.57626,1,0,0 +3,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +6,0,1,0,5.755076,1,37.9,0,0,1 +3,0,1,0,5.755076,1,37.9,0,0,1 +7,0,1,0,5.755076,1,37.9,0,0,1 +2,0,1,0,5.755076,1,20.7,1,0,0 +5,0,1,0,5.755076,1,20.7,1,0,0 +1,0,1,0,5.755076,1,20.7,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,3.4,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +5,0,1,6.109248,6.160541,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,17.2,1,0,0 +3,0,1,6.109248,6.160541,0,17.2,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,1,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,3.258096,0,6.603266,7.989561,0,3.4,0,0,0 +0,3.258096,0,6.603266,7.989561,0,3.4,0,0,0 +1,3.258096,0,6.603266,7.989561,0,3.4,0,0,0 +2,3.258096,0,6.603266,7.989561,0,3.4,0,0,0 +0,3.258096,0,6.603266,7.989561,0,3.4,0,0,0 +1,3.258096,0,6.603266,7.989561,0,0,1,0,0 +3,3.258096,0,6.603266,7.989561,0,0,1,0,0 +3,3.258096,0,6.603266,7.989561,0,0,1,0,0 +5,3.258096,0,6.603266,7.989561,0,0,1,0,0 +1,3.258096,0,6.603266,7.989561,0,0,1,0,0 +1,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +0,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +1,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +1,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +1,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +0,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +1,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +2,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +3,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +2,3.258096,0,6.603266,7.989561,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +1,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,0,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.3,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +2,3.258096,0,6.408595,6.293789,0,17.2,0,1,0 +1,3.258096,0,6.408595,6.293789,0,17.2,0,1,0 +2,3.258096,0,6.408595,6.293789,0,17.2,0,1,0 +0,4.564348,0,5.933306,5.929029,0,10.57626,1,0,0 +0,4.564348,0,5.933306,5.929029,0,10.57626,1,0,0 +0,4.564348,0,5.933306,5.929029,0,10.57626,1,0,0 +0,4.564348,0,5.933306,5.929029,0,3.4,0,0,0 +0,4.564348,0,5.933306,5.929029,0,3.4,0,0,0 +0,4.564348,0,5.933306,5.929029,0,3.4,0,0,0 +0,4.564348,0,5.933306,5.929029,0,6.9,0,0,0 +0,4.564348,0,5.933306,5.929029,0,6.9,0,0,0 +0,4.564348,0,5.933306,5.929029,0,6.9,0,0,0 +0,4.564348,0,5.933306,5.929029,0,10.57626,0,0,0 +0,4.564348,0,5.933306,5.929029,0,10.57626,0,0,0 +0,4.564348,0,5.933306,5.929029,0,10.57626,0,0,0 +3,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +5,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +1,4.564348,0,6.907755,6.959049,1,6.9,0,0,1 +0,4.564348,0,6.907755,6.959049,1,6.9,0,0,1 +1,4.564348,0,6.907755,6.959049,1,6.9,0,0,1 +1,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +2,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +0,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +7,4.564348,0,6.907755,6.959049,0,17.2,0,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +4,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +3,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +3,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,1,10.3,1,0,0 +0,0,0,0,0,1,10.3,1,0,0 +0,0,0,0,0,1,10.3,1,0,0 +3,0,0,0,0,1,17.2,1,0,0 +3,0,0,0,0,1,17.2,1,0,0 +2,0,0,0,0,1,17.2,1,0,0 +0,3.258096,0,6.262826,7.649121,0,20.7,0,0,0 +0,3.258096,0,6.262826,7.649121,0,20.7,0,0,0 +0,3.258096,0,6.262826,7.649121,0,20.7,0,0,0 +0,3.258096,0,6.262826,7.649121,1,27.6,0,0,0 +4,3.258096,0,6.262826,7.649121,1,27.6,0,0,0 +0,3.258096,0,6.262826,7.649121,1,27.6,0,0,0 +0,3.258096,0,6.262826,7.649121,0,10.57626,0,0,0 +0,3.258096,0,6.262826,7.649121,0,10.57626,0,0,0 +0,3.258096,0,6.262826,7.649121,0,10.57626,0,0,0 +6,0,0,5.72984,0,1,20.7,0,1,0 +5,0,0,5.72984,0,1,20.7,0,1,0 +4,0,0,5.72984,0,1,20.7,0,1,0 +9,0,0,5.72984,0,1,20.7,0,1,0 +8,0,0,5.72984,0,1,20.7,0,1,0 +7,0,0,5.72984,0,1,24.1,1,0,0 +12,0,0,5.72984,0,1,24.1,1,0,0 +6,0,0,5.72984,0,1,24.1,1,0,0 +5,0,0,5.72984,0,0,10.57626,1,0,0 +6,0,0,5.72984,0,0,10.57626,1,0,0 +4,0,0,5.72984,0,0,10.57626,1,0,0 +4,0,0,5.72984,0,0,10.57626,1,0,0 +1,0,0,5.72984,0,0,10.57626,1,0,0 +1,0,1,5.010635,6.160541,0,10.57626,1,0,0 +3,0,1,5.010635,6.160541,0,10.57626,1,0,0 +1,0,1,5.010635,6.160541,0,10.57626,1,0,0 +1,0,1,5.010635,6.160541,0,10.57626,1,0,0 +1,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.57626,1,0,0 +0,0,1,5.010635,6.160541,0,10.3,0,0,0 +4,0,1,5.010635,6.160541,0,10.3,0,0,0 +5,0,1,5.010635,6.160541,0,10.3,0,0,0 +4,0,1,5.010635,6.160541,0,6.9,0,0,0 +0,0,1,5.010635,6.160541,0,6.9,0,0,0 +3,0,1,5.010635,6.160541,0,6.9,0,0,0 +13,0,0,0,0,0,10.57626,1,0,0 +7,0,0,0,0,0,10.57626,1,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +6,0,0,0,0,0,10.3,1,0,0 +9,0,0,0,0,0,10.3,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +20,0,0,0,0,0,10.57626,1,0,0 +7,0,0,0,0,0,10.57626,1,0,0 +4,0,0,0,0,0,10.57626,1,0,0 +3,3.258096,0,6.620073,8.006368,0,24.1,1,0,0 +1,3.258096,0,6.620073,8.006368,0,24.1,1,0,0 +1,3.258096,0,6.620073,8.006368,0,24.1,1,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +0,0,1,5.703783,6.160541,0,10.3,0,1,0 +1,0,1,5.703783,6.160541,0,10.3,0,1,0 +9,0,1,5.703783,6.160541,0,10.3,0,1,0 +0,0,1,5.703783,6.160541,0,10.3,1,0,0 +0,0,1,5.703783,6.160541,0,10.3,1,0,0 +0,0,1,5.703783,6.160541,0,10.3,1,0,0 +10,0,0,5.560835,0,1,31,0,1,0 +8,0,0,5.560835,0,1,31,0,1,0 +10,0,0,5.560835,0,1,31,0,1,0 +7,0,0,5.560835,0,1,31,0,1,0 +9,0,0,5.560835,0,1,31,0,1,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +1,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,0,6.9,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +1,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +6,4.564348,0,6.907755,6.959049,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +1,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +9,0,1,5.593967,5.061929,1,37.9,0,1,0 +3,0,1,5.593967,5.061929,1,37.9,0,1,0 +5,0,1,5.593967,5.061929,1,37.9,0,1,0 +13,0,0,5.766538,0,1,31,1,0,0 +8,0,0,5.766538,0,1,31,1,0,0 +15,0,0,5.766538,0,1,31,1,0,0 +10,0,0,5.766538,0,1,27.6,0,1,0 +6,0,0,5.766538,0,1,27.6,0,1,0 +14,0,0,5.766538,0,1,27.6,0,1,0 +13,0,1,6.109248,6.160541,0,27.6,1,0,0 +5,0,1,6.109248,6.160541,0,27.6,1,0,0 +4,0,1,6.109248,6.160541,0,27.6,1,0,0 +3,0,1,6.109248,6.160541,0,10.3,1,0,0 +1,0,1,6.109248,6.160541,0,10.3,1,0,0 +4,0,1,6.109248,6.160541,0,10.3,1,0,0 +17,0,1,6.109248,6.160541,0,10.57626,1,0,0 +10,0,1,6.109248,6.160541,0,10.57626,1,0,0 +11,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +1,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,0,1,6.109248,6.160541,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +3,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +4,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +8,0,1,6.109248,6.160541,0,10.3,0,0,0 +3,0,1,6.109248,6.160541,0,10.3,0,0,0 +6,0,1,6.109248,6.160541,0,10.3,0,0,0 +9,0,1,6.109248,6.160541,0,10.3,0,0,0 +4,0,1,6.109248,6.160541,0,17.2,1,0,0 +4,0,1,6.109248,6.160541,0,17.2,1,0,0 +6,0,1,6.109248,6.160541,0,17.2,1,0,0 +11,0,1,6.109248,6.160541,0,17.2,1,0,0 +8,0,1,6.109248,6.160541,0,17.2,1,0,0 +3,0,0,0,0,1,24.1,0,0,1 +1,0,0,0,0,1,10.57626,0,1,0 +13,3.258096,0,6.238403,6.915723,1,37.9,0,0,1 +0,3.931826,0,0,7.37149,0,10.3,0,1,0 +3,3.931826,0,0,7.37149,0,10.3,0,1,0 +2,3.931826,0,0,7.37149,0,10.3,0,1,0 +0,3.931826,0,0,7.37149,1,10.57626,0,1,0 +3,3.931826,0,0,7.37149,1,10.57626,0,1,0 +0,3.931826,0,0,7.37149,1,10.57626,0,1,0 +0,3.931826,0,0,7.37149,1,10.57626,0,1,0 +0,3.931826,0,0,7.37149,1,10.57626,0,1,0 +0,3.931826,0,0,7.37149,1,10.57626,0,1,0 +0,3.931826,0,0,7.37149,1,10.57626,0,0,0 +0,3.931826,0,0,7.37149,1,10.57626,0,0,0 +1,3.931826,0,0,7.37149,1,10.57626,0,0,0 +0,3.931826,0,0,7.37149,1,10.57626,0,0,0 +0,3.931826,0,0,7.37149,1,10.57626,0,0,0 +0,3.931826,0,0,7.37149,1,10.57626,0,0,0 +1,3.931826,0,0,7.37149,0,3.4,0,1,0 +7,3.931826,0,0,7.37149,0,3.4,0,1,0 +2,3.931826,0,0,7.37149,0,3.4,0,1,0 +0,0,0,0,0,.1442925,3.4,0,0,0 +0,0,0,0,0,.1442925,3.4,0,0,0 +0,0,0,0,0,.1442925,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,10.3,0,1,0 +0,0,0,0,0,0,3.4,0,1,0 +2,0,0,4.094345,0,0,10.3,0,0,0 +3,0,0,4.094345,0,0,10.3,0,0,0 +4,0,0,4.094345,0,0,10.3,0,0,0 +4,0,0,4.094345,0,0,10.3,0,0,0 +1,0,0,4.094345,0,0,10.3,0,0,0 +3,0,0,4.094345,0,0,17.2,0,0,0 +2,0,0,4.094345,0,0,17.2,0,0,0 +2,0,0,4.094345,0,0,17.2,0,0,0 +1,0,0,4.094345,0,0,17.2,0,0,0 +7,0,0,4.094345,0,0,17.2,0,0,0 +0,0,0,5.094976,0,0,0,0,0,0 +0,0,0,5.094976,0,0,3.4,0,0,0 +1,0,0,5.094976,0,0,3.4,0,0,0 +0,0,0,5.094976,0,0,3.4,0,0,0 +0,0,0,5.094976,0,0,10.57626,0,0,0 +0,0,0,5.094976,0,0,10.57626,0,0,0 +0,0,0,5.094976,0,0,10.57626,0,0,0 +0,0,0,5.094976,0,0,10.57626,0,0,0 +1,0,0,5.094976,0,0,10.57626,0,0,0 +0,0,0,5.094976,0,0,10.57626,0,0,0 +0,0,0,5.094976,0,0,0,1,0,0 +1,0,0,5.094976,0,0,0,1,0,0 +0,0,0,5.094976,0,0,0,1,0,0 +0,0,0,5.094976,0,0,13.8,1,0,0 +1,0,0,5.094976,0,0,13.8,1,0,0 +0,0,0,5.094976,0,0,13.8,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +6,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +3,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,13.8,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +5,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,1,0,0 +4,0,0,5.145166,0,0,6.9,0,0,0 +1,0,0,5.145166,0,0,6.9,0,0,0 +7,0,0,5.145166,0,0,6.9,0,0,0 +4,0,1,5.703783,5.755076,1,17.2,1,0,0 +3,0,1,5.703783,5.755076,1,17.2,1,0,0 +2,0,1,5.703783,5.755076,1,24.1,1,0,0 +7,0,1,5.703783,5.755076,1,24.1,1,0,0 +9,0,1,5.703783,5.755076,1,24.1,1,0,0 +0,3.931826,0,6.907755,7.600903,1,3.4,0,0,1 +0,3.931826,0,6.907755,7.600903,1,3.4,0,0,1 +0,3.931826,0,6.907755,7.600903,1,3.4,0,0,1 +3,3.931826,0,6.907755,7.600903,1,20.7,0,0,1 +2,3.931826,0,6.907755,7.600903,1,20.7,0,0,1 +2,3.931826,0,6.907755,7.600903,1,20.7,0,0,1 +12,0,0,5.046517,0,0,20.7,1,0,0 +21,0,0,5.046517,0,0,20.7,1,0,0 +16,0,0,5.046517,0,0,20.7,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +0,4.564348,0,6.907755,6.959049,0,6.9,1,0,0 +1,4.564348,0,6.907755,6.959049,0,27.6,0,1,0 +9,4.564348,0,6.907755,6.959049,0,27.6,0,1,0 +1,4.564348,0,6.907755,6.959049,0,27.6,0,1,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,1,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,1,0 +0,4.564348,0,6.907755,6.959049,0,6.9,0,1,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,1 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,1 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,1 +0,0,0,5.436556,0,0,3.4,1,0,0 +1,0,0,5.436556,0,0,3.4,1,0,0 +2,0,0,5.436556,0,0,3.4,1,0,0 +3,0,0,5.436556,0,0,13.8,1,0,0 +3,0,0,5.436556,0,0,13.8,1,0,0 +8,0,0,5.436556,0,0,13.8,1,0,0 +6,0,0,5.436556,0,0,10.57626,1,0,0 +1,0,0,5.436556,0,0,10.57626,1,0,0 +2,0,0,5.436556,0,0,10.57626,1,0,0 +4,3.258096,0,6.579251,7.965546,0,6.9,1,0,0 +2,3.258096,0,6.579251,7.965546,0,6.9,1,0,0 +1,3.258096,0,6.579251,7.965546,0,6.9,1,0,0 +6,3.258096,0,6.579251,7.965546,0,27.6,0,1,0 +5,3.258096,0,6.579251,7.965546,0,27.6,0,1,0 +1,3.258096,0,6.579251,7.965546,0,27.6,0,1,0 +2,3.258096,0,6.579251,7.965546,0,3.4,0,1,0 +1,3.258096,0,6.579251,7.965546,0,3.4,0,1,0 +0,3.258096,0,6.579251,7.965546,0,3.4,0,1,0 +1,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,1,17.2,0,1,0 +0,3.931826,0,6.907755,7.600903,1,17.2,0,1,0 +0,3.931826,0,6.907755,7.600903,1,17.2,0,1,0 +0,3.931826,0,6.907755,7.600903,1,17.2,0,1,0 +0,3.931826,0,6.907755,7.600903,1,17.2,0,1,0 +1,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +1,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +1,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +0,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +0,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +4,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +3,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +3,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +4,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +3,3.931826,0,6.907755,7.600903,0,10.3,0,1,0 +1,0,0,5.943534,0,0,17.2,1,0,0 +2,0,0,5.943534,0,0,17.2,1,0,0 +0,0,0,5.943534,0,0,17.2,1,0,0 +0,0,0,0,0,0,27.6,0,1,0 +9,0,0,0,0,0,27.6,0,1,0 +13,0,0,0,0,0,27.6,0,1,0 +0,4.564348,0,5.160491,5.467394,0,3.4,0,1,0 +0,4.564348,0,5.160491,5.467394,0,3.4,0,1,0 +0,4.564348,0,5.160491,5.467394,0,3.4,0,0,0 +0,4.564348,0,5.160491,5.467394,0,3.4,0,0,0 +0,4.564348,0,5.160491,5.467394,0,3.4,0,0,0 +1,4.564348,0,5.160491,5.467394,0,3.4,0,0,0 +0,4.564348,0,5.160491,5.467394,0,3.4,0,0,0 +0,4.564348,0,5.160491,5.467394,0,10.57626,0,0,0 +0,4.564348,0,5.160491,5.467394,0,10.57626,0,0,0 +0,4.564348,0,0,4.420108,0,0,1,0,0 +0,4.564348,0,0,4.420108,0,0,1,0,0 +0,4.564348,0,0,4.420108,0,0,1,0,0 +0,4.564348,0,0,4.420108,0,0,1,0,0 +0,4.564348,0,0,4.420108,0,0,1,0,0 +9,0,0,5.757007,0,0,17.2,1,0,0 +6,0,0,5.757007,0,0,17.2,1,0,0 +3,0,0,5.757007,0,0,17.2,1,0,0 +5,0,0,5.757007,0,0,10.57626,1,0,0 +2,0,0,5.757007,0,0,10.57626,1,0,0 +2,0,0,5.757007,0,0,10.57626,1,0,0 +9,0,0,5.757007,0,0,17.2,1,0,0 +2,0,0,5.757007,0,0,17.2,1,0,0 +2,0,0,5.757007,0,0,17.2,1,0,0 +2,0,0,5.757007,0,0,10.57626,1,0,0 +3,0,0,5.757007,0,0,10.57626,1,0,0 +2,0,0,5.757007,0,0,10.57626,1,0,0 +2,0,0,5.470083,0,1,24.1,1,0,0 +26,0,0,5.470083,0,1,24.1,1,0,0 +11,0,0,5.470083,0,1,24.1,1,0,0 +8,0,0,5.470083,0,0,10.57626,1,0,0 +14,0,0,5.470083,0,0,10.57626,1,0,0 +5,0,0,5.470083,0,0,10.57626,1,0,0 +34,0,0,5.470083,0,1,44.8,1,0,0 +48,0,0,5.470083,0,1,44.8,1,0,0 +31,0,0,5.470083,0,1,44.8,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,0,0,1,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +0,0,1,0,6.160541,0,3.4,1,0,0 +4,0,1,0,6.160541,0,3.4,1,0,0 +0,4.564348,0,0,6.448223,0,3.4,0,0,0 +0,4.564348,0,0,6.448223,0,3.4,0,0,0 +0,4.564348,0,0,6.448223,0,3.4,0,0,0 +0,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +1,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +0,3.258096,0,6.620073,8.006368,0,20.7,1,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.3,0,0,0 +1,0,1,6.109248,6.160541,0,10.3,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +5,0,1,6.109248,6.160541,0,27.6,0,0,0 +1,0,1,6.109248,6.160541,0,27.6,0,0,0 +1,3.258096,0,5.269815,6.656109,0,24.1,0,0,0 +2,3.258096,0,5.269815,6.656109,0,24.1,0,0,0 +3,3.258096,0,5.269815,6.656109,0,24.1,0,0,0 +0,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +4,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +4,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +0,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +6,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +1,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +2,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,1,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,1,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,1,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,1,13.8,1,0,0 +8,3.258096,0,6.620073,8.006368,1,13.8,1,0,0 +4,3.258096,0,6.620073,8.006368,1,13.8,1,0,0 +5,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +4,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +4,3.258096,0,6.620073,8.006368,0,17.2,1,0,0 +5,0,1,5.703783,5.755076,0,0,1,0,0 +4,0,1,5.703783,5.755076,0,0,1,0,0 +1,0,1,5.703783,5.755076,0,0,1,0,0 +0,0,1,5.703783,5.755076,0,0,1,0,0 +1,0,1,5.703783,5.755076,0,0,1,0,0 +10,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +1,0,1,5.703783,5.755076,0,3.4,0,0,0 +0,0,1,5.703783,5.755076,0,3.4,0,0,0 +5,4.564348,0,6.907755,6.959049,1,3.4,1,0,0 +4,4.564348,0,6.907755,6.959049,1,3.4,1,0,0 +6,4.564348,0,6.907755,6.959049,1,3.4,1,0,0 +13,4.564348,0,6.907755,6.959049,0,41.4,0,1,0 +11,4.564348,0,6.907755,6.959049,0,41.4,0,1,0 +13,4.564348,0,6.907755,6.959049,0,41.4,0,1,0 +1,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +6,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +0,0,1,6.109248,6.160541,0,13.8,1,0,0 +3,0,1,6.109248,6.160541,0,20.7,1,0,0 +1,0,1,6.109248,6.160541,0,20.7,1,0,0 +2,0,1,6.109248,6.160541,0,20.7,1,0,0 +0,0,1,6.109248,6.160541,0,20.7,1,0,0 +1,0,1,6.109248,6.160541,0,20.7,1,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,0,0,0,1,13.8,0,0,0 +0,0,0,0,0,1,13.8,0,0,0 +4,0,0,0,0,1,13.8,0,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +7,0,0,0,0,0,6.9,0,0,0 +5,0,0,0,0,0,6.9,0,0,0 +10,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +4,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,3.4,1,0,0 +0,0,0,6.050488,0,.1442925,10.3,0,1,0 +0,0,0,6.050488,0,.1442925,10.3,0,1,0 +0,0,0,6.050488,0,.1442925,10.3,0,1,0 +9,0,0,6.050488,0,.1442925,10.3,0,1,0 +3,0,0,6.050488,0,.1442925,10.3,0,1,0 +5,0,0,6.050488,0,0,10.3,1,0,0 +0,0,0,6.050488,0,0,10.3,1,0,0 +0,0,0,6.050488,0,0,10.3,1,0,0 +14,0,0,6.050488,0,0,10.3,1,0,0 +7,0,0,6.050488,0,0,10.3,1,0,0 +5,0,0,5.88566,0,1,27.6,1,0,0 +0,0,0,5.88566,0,1,27.6,1,0,0 +2,0,0,5.88566,0,1,27.6,1,0,0 +2,0,0,5.88566,0,0,10.57626,0,0,0 +0,0,0,5.88566,0,0,10.57626,0,0,0 +0,0,0,5.88566,0,0,10.57626,0,0,0 +4,0,0,5.88566,0,0,10.57626,1,0,0 +1,0,0,5.88566,0,0,10.57626,1,0,0 +0,0,0,5.88566,0,0,10.57626,1,0,0 +1,0,0,5.88566,0,0,10.3,0,0,0 +2,0,0,5.88566,0,0,10.3,0,0,0 +3,0,0,5.88566,0,0,10.3,0,0,0 +5,0,0,5.88566,0,1,10.57626,1,0,0 +0,0,0,5.88566,0,1,10.57626,1,0,0 +0,0,0,5.88566,0,1,10.57626,1,0,0 +0,0,0,0,0,0,13.8,1,0,0 +3,0,0,0,0,0,13.8,1,0,0 +7,0,0,0,0,1,17.2,0,0,1 +18,0,0,0,0,1,17.2,0,0,1 +0,0,1,5.703783,6.160541,1,6.9,0,0,0 +0,0,1,5.703783,6.160541,1,6.9,0,0,0 +1,0,1,5.703783,6.160541,1,6.9,0,0,0 +0,0,1,5.703783,6.160541,0,10.3,0,0,0 +0,0,1,5.703783,6.160541,0,10.3,0,0,0 +0,0,1,5.703783,6.160541,0,10.3,0,0,0 +1,0,1,5.703783,6.160541,0,10.3,1,0,0 +0,0,1,5.703783,6.160541,0,10.3,1,0,0 +0,0,1,5.703783,6.160541,0,10.3,1,0,0 +1,0,0,6.704414,0,0,6.9,0,1,0 +3,0,0,6.704414,0,0,6.9,0,1,0 +0,0,0,6.704414,0,0,6.9,0,1,0 +1,0,0,6.704414,0,0,6.9,0,1,0 +0,0,0,6.704414,0,0,6.9,0,1,0 +1,0,0,6.704414,0,0,10.57626,1,0,0 +0,0,0,6.704414,0,0,10.57626,1,0,0 +2,0,0,6.704414,0,0,10.57626,1,0,0 +1,0,0,6.704414,0,0,10.57626,1,0,0 +1,0,0,6.704414,0,0,10.57626,1,0,0 +11,0,0,6.704414,0,0,10.3,0,1,0 +5,0,0,6.704414,0,0,10.3,0,1,0 +1,0,0,6.704414,0,0,10.3,0,1,0 +5,0,0,6.704414,0,0,10.3,0,1,0 +7,0,0,6.704414,0,0,10.3,0,1,0 +13,0,1,5.703783,5.755076,1,6.9,0,0,0 +3,0,1,5.703783,5.755076,1,6.9,0,0,0 +0,0,1,5.703783,5.755076,1,6.9,0,0,0 +1,0,1,5.703783,5.755076,0,6.9,0,0,1 +6,0,1,5.703783,5.755076,0,6.9,0,0,1 +6,0,1,5.703783,5.755076,0,6.9,0,0,1 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,1,6.109248,6.160541,0,3.4,1,0,0 +1,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,1,0,0 +3,0,1,6.109248,6.160541,0,0,1,0,0 +1,0,1,6.109248,6.160541,0,0,1,0,0 +2,0,1,6.109248,6.160541,0,0,1,0,0 +1,3.258096,0,6.620073,8.006368,1,24.1,0,1,0 +2,3.258096,0,6.620073,8.006368,1,24.1,0,1,0 +2,3.258096,0,6.620073,8.006368,1,24.1,0,1,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +4,3.258096,0,6.620073,8.006368,0,0,0,0,0 +1,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +2,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +5,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +3,0,0,5.957701,0,0,6.9,1,0,0 +1,0,0,5.957701,0,0,6.9,1,0,0 +1,0,0,5.957701,0,0,6.9,1,0,0 +0,0,0,5.957701,0,0,6.9,1,0,0 +3,0,0,5.957701,0,0,10.57626,0,0,0 +1,0,0,5.957701,0,0,10.57626,0,0,0 +3,0,0,5.957701,0,0,10.57626,0,0,0 +2,0,0,5.957701,0,0,10.57626,0,0,0 +1,0,0,5.957701,0,0,10.57626,0,0,0 +0,0,0,5.957701,0,0,10.57626,0,0,0 +3,0,0,5.957701,0,0,10.57626,0,0,0 +2,0,0,5.957701,0,0,10.57626,0,0,0 +1,0,0,5.957701,0,0,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,0,6.9,1,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,3.931826,0,6.907755,7.600903,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +7,0,1,6.109248,6.160541,1,17.2,1,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +1,0,1,5.703783,5.755076,0,6.9,0,0,0 +2,0,1,5.703783,5.755076,0,6.9,0,0,0 +2,0,1,5.703783,5.755076,0,6.9,0,0,0 +1,0,1,5.703783,5.755076,0,10.3,1,0,0 +7,0,1,5.703783,5.755076,0,10.3,1,0,0 +0,0,1,5.703783,5.755076,0,10.3,1,0,0 +2,0,0,4.094345,0,0,3.4,0,0,0 +2,0,0,4.094345,0,0,3.4,0,0,0 +1,0,0,4.094345,0,0,3.4,0,0,0 +20,4.564348,0,6.49224,5.781393,0,20.7,1,0,0 +24,4.564348,0,6.49224,5.781393,0,20.7,1,0,0 +17,4.564348,0,6.49224,5.781393,0,20.7,1,0,0 +0,4.564348,0,6.49224,5.781393,0,3.4,1,0,0 +0,4.564348,0,6.49224,5.781393,0,3.4,1,0,0 +0,4.564348,0,6.49224,5.781393,0,3.4,1,0,0 +9,4.564348,0,6.49224,5.781393,0,10.57626,1,0,0 +4,4.564348,0,6.49224,5.781393,0,10.57626,1,0,0 +5,4.564348,0,6.49224,5.781393,0,10.57626,1,0,0 +1,0,0,5.482637,0,1,10.3,1,0,0 +2,0,0,5.482637,0,1,10.3,1,0,0 +2,0,0,5.482637,0,1,10.3,1,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +0,3.258096,0,6.055495,7.44179,0,10.57626,1,0,0 +0,3.258096,0,6.055495,7.44179,0,10.57626,1,0,0 +0,3.258096,0,6.055495,7.44179,0,10.57626,1,0,0 +0,3.258096,0,6.055495,7.44179,0,10.57626,1,0,0 +0,3.258096,0,6.055495,7.44179,0,10.57626,1,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,1,0 +2,3.258096,0,6.055495,7.44179,0,10.3,0,0,1 +0,3.258096,0,6.055495,7.44179,0,10.3,0,0,1 +0,3.258096,0,6.055495,7.44179,0,10.3,0,0,1 +0,3.258096,0,6.055495,7.44179,0,10.3,0,0,1 +0,3.258096,0,6.055495,7.44179,0,10.3,0,0,1 +5,3.258096,0,6.055495,7.44179,0,20.7,1,0,0 +1,3.258096,0,6.055495,7.44179,0,20.7,1,0,0 +0,3.258096,0,6.055495,7.44179,0,20.7,1,0,0 +0,3.258096,0,6.055495,7.44179,0,20.7,1,0,0 +1,3.258096,0,6.055495,7.44179,0,20.7,1,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,3.258096,0,0,8.006368,0,0,0,0,0 +0,3.258096,0,0,8.006368,0,0,0,0,0 +0,3.258096,0,0,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +2,3.258096,0,6.620073,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,1,24.1,0,0,0 +0,3.258096,0,6.620073,8.006368,1,24.1,0,0,0 +0,3.258096,0,6.620073,8.006368,1,24.1,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +0,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +4,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +6,0,0,0,0,0,6.9,0,0,0 +8,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.3,0,0,0 +5,0,0,0,0,0,10.3,0,0,0 +11,0,0,0,0,0,10.3,0,0,0 +5,0,0,0,0,0,10.57626,0,0,0 +10,0,0,0,0,0,10.57626,0,0,0 +5,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,3.4,0,1,0 +0,0,0,0,0,0,3.4,0,1,0 +2,0,0,0,0,0,3.4,0,1,0 +1,0,0,0,0,0,3.4,1,0,0 +3,0,0,0,0,0,3.4,1,0,0 +2,0,0,0,0,0,3.4,1,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +3,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +3,0,0,0,0,0,10.3,0,1,0 +7,0,0,0,0,0,10.3,0,1,0 +4,0,0,0,0,0,10.3,0,1,0 +0,0,1,6.119022,5.755076,0,3.4,0,0,0 +1,0,1,6.119022,5.755076,0,3.4,0,0,0 +0,0,1,6.119022,5.755076,0,3.4,0,0,0 +0,0,1,6.119022,5.755076,0,3.4,0,0,0 +0,0,1,6.119022,5.755076,0,3.4,0,0,0 +1,0,1,6.119022,5.755076,0,6.9,0,0,0 +0,0,1,6.119022,5.755076,0,6.9,0,0,0 +0,0,1,6.119022,5.755076,0,6.9,0,0,0 +1,0,1,6.119022,5.755076,0,6.9,0,0,0 +3,0,1,6.119022,5.755076,0,6.9,0,0,0 +2,0,0,5.285232,0,0,3.4,0,0,0 +6,0,0,5.285232,0,0,3.4,0,0,0 +6,0,0,5.285232,0,0,3.4,0,0,0 +1,0,0,5.285232,0,0,3.4,0,0,0 +8,0,0,5.285232,0,0,3.4,0,0,0 +5,0,0,5.285232,0,0,3.4,0,0,0 +6,0,0,5.285232,0,0,10.57626,0,0,0 +5,0,0,5.285232,0,0,10.57626,0,0,0 +4,0,0,5.285232,0,0,10.57626,0,0,0 +24,0,0,5.285232,0,0,10.3,0,0,0 +12,0,0,5.285232,0,0,10.3,0,0,0 +9,0,0,5.285232,0,0,10.3,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +2,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,1,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +6,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +8,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +5,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +9,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +3,3.258096,0,6.620073,8.006368,0,6.9,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,0,1,6.313548,6.160541,0,6.9,0,0,0 +0,0,1,6.313548,6.160541,0,6.9,0,0,0 +0,0,1,6.313548,6.160541,0,6.9,0,0,0 +11,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +0,4.564348,0,6.907755,6.959049,0,0,0,0,0 +4,4.564348,0,6.907755,6.959049,0,31,0,0,0 +1,4.564348,0,6.907755,6.959049,0,31,0,0,0 +3,4.564348,0,6.907755,6.959049,0,31,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,3.258096,0,6.067036,7.45333,0,6.9,0,0,0 +0,3.258096,0,6.067036,7.45333,0,6.9,0,0,0 +0,3.258096,0,6.067036,7.45333,0,6.9,0,0,0 +0,3.258096,0,6.067036,7.45333,0,13.8,0,0,0 +0,3.258096,0,6.067036,7.45333,0,13.8,0,0,0 +7,3.258096,0,6.067036,7.45333,0,13.8,0,0,0 +0,3.258096,0,6.067036,7.45333,0,3.4,0,0,0 +0,3.258096,0,6.067036,7.45333,0,3.4,0,0,0 +0,3.258096,0,6.067036,7.45333,0,10.57626,0,0,0 +0,3.258096,0,6.067036,7.45333,0,10.57626,0,0,0 +0,3.258096,0,6.067036,7.45333,0,10.57626,0,0,0 +0,3.258096,0,6.067036,7.45333,0,3.4,0,0,0 +0,3.258096,0,6.067036,7.45333,0,3.4,0,0,0 +3,3.258096,0,6.067036,7.45333,0,3.4,0,0,0 +1,3.258096,0,6.067036,7.45333,0,3.4,0,0,0 +0,3.258096,0,6.067036,7.45333,0,3.4,0,0,0 +0,3.258096,0,6.067036,7.45333,0,10.57626,0,0,0 +0,3.258096,0,6.067036,7.45333,0,10.57626,0,0,0 +0,3.258096,0,6.067036,7.45333,0,10.57626,0,0,0 +0,3.258096,0,6.067036,7.45333,0,10.57626,0,0,0 +0,3.258096,0,6.067036,7.45333,0,10.57626,0,0,0 +1,3.258096,0,6.067036,7.45333,0,10.57626,0,0,0 +6,3.258096,0,6.874819,8.006368,0,3.4,1,0,0 +3,3.258096,0,6.874819,8.006368,0,3.4,1,0,0 +6,3.258096,0,6.874819,8.006368,0,3.4,1,0,0 +0,3.258096,0,6.874819,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.874819,8.006368,0,17.2,1,0,0 +4,3.258096,0,6.874819,8.006368,0,17.2,1,0,0 +0,3.258096,0,6.874819,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.874819,8.006368,0,3.4,1,0,0 +3,3.258096,0,6.874819,8.006368,0,3.4,1,0,0 +1,3.258096,0,6.874819,8.006368,1,10.3,1,0,0 +0,3.258096,0,6.874819,8.006368,1,10.3,1,0,0 +7,3.258096,0,6.874819,8.006368,1,10.3,1,0,0 +7,0,0,6.243312,0,0,10.3,1,0,0 +8,0,0,6.243312,0,0,10.3,1,0,0 +8,0,0,6.243312,0,0,10.3,1,0,0 +4,0,0,6.243312,0,0,10.57626,0,0,0 +4,0,0,6.243312,0,0,10.57626,0,0,0 +8,0,0,6.243312,0,0,10.57626,0,0,0 +4,0,0,6.243312,0,0,13.8,0,0,0 +4,0,0,6.243312,0,0,13.8,0,0,0 +0,0,0,6.243312,0,0,13.8,0,0,0 +1,3.258096,0,6.841616,8.006368,1,20.7,1,0,0 +3,3.258096,0,6.841616,8.006368,1,20.7,1,0,0 +1,3.258096,0,6.841616,8.006368,1,20.7,1,0,0 +1,3.258096,0,6.841616,8.006368,1,24.1,1,0,0 +1,3.258096,0,6.841616,8.006368,1,24.1,1,0,0 +4,3.258096,0,6.841616,8.006368,1,24.1,1,0,0 +1,0,0,5.267652,0,0,3.4,0,0,0 +8,0,0,5.267652,0,0,3.4,0,0,0 +4,0,0,5.267652,0,0,3.4,0,0,0 +2,0,0,5.267652,0,0,6.9,0,0,0 +0,0,0,5.267652,0,0,6.9,0,0,0 +0,0,0,5.267652,0,0,6.9,0,0,0 +0,0,0,5.267652,0,.1442925,10.57626,0,0,0 +0,0,0,5.267652,0,.1442925,10.57626,0,0,0 +2,0,0,5.267652,0,.1442925,10.57626,0,0,0 +2,0,0,5.267652,0,.1442925,10.57626,0,0,0 +2,0,0,5.267652,0,.1442925,10.57626,0,0,0 +0,0,0,5.267652,0,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,1,0,0 +0,4.564348,0,6.907755,6.959049,1,17.2,1,0,0 +2,4.564348,0,6.907755,6.959049,1,17.2,1,0,0 +0,4.564348,0,6.907755,6.959049,1,17.2,1,0,0 +1,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,1,0,0 +2,4.564348,0,6.907755,6.959049,0,24.1,0,0,0 +2,0,0,6.717563,0,0,10.3,0,0,0 +2,0,0,6.717563,0,0,10.3,0,0,0 +5,0,0,6.717563,0,0,10.3,0,0,0 +2,0,0,6.717563,0,0,10.57626,0,0,0 +2,0,0,6.717563,0,0,10.57626,0,0,0 +3,0,0,6.717563,0,0,10.57626,0,0,0 +17,0,0,6.717563,0,0,6.9,0,0,0 +19,0,0,6.717563,0,0,6.9,0,0,0 +20,0,0,6.717563,0,0,6.9,0,0,0 +2,0,0,6.717563,0,0,10.57626,0,0,0 +3,0,0,6.717563,0,0,10.57626,0,0,0 +7,0,0,6.717563,0,0,10.57626,0,0,0 +4,0,0,6.717563,0,0,10.57626,0,0,0 +6,0,0,6.717563,0,0,10.57626,0,0,0 +3,0,0,6.717563,0,0,10.57626,0,0,0 +0,0,1,5.56268,5.061929,0,24.1,0,0,1 +2,0,1,5.56268,5.061929,0,24.1,0,0,1 +1,0,1,5.56268,5.061929,0,24.1,0,0,1 +0,4.564348,0,5.969474,6.020768,0,6.9,0,1,0 +0,4.564348,0,5.969474,6.020768,0,6.9,0,1,0 +2,4.564348,0,5.969474,6.020768,1,20.7,0,1,0 +0,4.564348,0,5.969474,6.020768,1,20.7,0,1,0 +0,4.564348,0,5.969474,6.020768,1,20.7,0,1,0 +0,4.564348,0,6.265776,6.31707,0,20.7,1,0,0 +5,4.564348,0,6.265776,6.31707,0,20.7,1,0,0 +0,4.564348,0,6.265776,6.31707,0,20.7,1,0,0 +6,3.258096,0,6.174827,7.561121,0,10.57626,0,0,0 +4,3.258096,0,6.174827,7.561121,0,10.57626,0,0,0 +8,3.258096,0,6.174827,7.561121,0,10.57626,0,0,0 +6,3.258096,0,6.174827,7.561121,0,10.57626,0,0,0 +11,3.258096,0,6.174827,7.561121,0,10.57626,0,0,0 +6,3.258096,0,6.174827,7.561121,0,10.57626,1,0,0 +9,3.258096,0,6.174827,7.561121,0,10.57626,1,0,0 +9,3.258096,0,6.174827,7.561121,0,10.57626,1,0,0 +3,3.258096,0,6.174827,7.561121,0,10.57626,1,0,0 +3,3.258096,0,6.174827,7.561121,0,10.57626,1,0,0 +1,3.258096,0,6.174827,7.561121,0,17.2,1,0,0 +0,3.258096,0,6.174827,7.561121,0,17.2,1,0,0 +1,3.258096,0,6.174827,7.561121,0,17.2,1,0,0 +3,3.258096,0,6.174827,7.561121,0,17.2,1,0,0 +0,3.258096,0,6.174827,7.561121,0,17.2,1,0,0 +3,3.258096,0,6.174827,7.561121,0,24.1,1,0,0 +2,3.258096,0,6.174827,7.561121,0,24.1,1,0,0 +3,3.258096,0,6.174827,7.561121,0,24.1,1,0,0 +4,3.258096,0,6.174827,7.561121,0,24.1,1,0,0 +1,3.258096,0,6.174827,7.561121,0,24.1,1,0,0 +0,3.258096,0,6.500689,7.886983,1,24.1,0,0,0 +2,3.258096,0,6.500689,7.886983,1,24.1,0,0,0 +2,3.258096,0,6.500689,7.886983,1,24.1,0,0,0 +1,3.258096,0,6.500689,7.886983,1,24.1,0,0,0 +2,3.258096,0,6.500689,7.886983,0,3.4,0,0,0 +0,3.258096,0,6.500689,7.886983,0,3.4,0,0,0 +0,3.258096,0,6.500689,7.886983,0,3.4,0,0,0 +0,3.258096,0,6.500689,7.886983,0,3.4,0,0,0 +0,3.258096,0,6.500689,7.886983,0,3.4,0,0,0 +2,3.258096,0,6.500689,7.886983,0,13.8,0,0,0 +0,3.258096,0,6.500689,7.886983,0,13.8,0,0,0 +1,3.258096,0,6.500689,7.886983,0,13.8,0,0,0 +1,3.258096,0,6.500689,7.886983,0,13.8,0,0,0 +2,3.258096,0,6.500689,7.886983,0,13.8,0,0,0 +0,3.258096,0,6.500689,7.886983,0,6.9,0,0,0 +0,3.258096,0,6.500689,7.886983,0,6.9,0,0,0 +0,3.258096,0,6.500689,7.886983,0,6.9,0,0,0 +0,3.258096,0,6.500689,7.886983,0,6.9,0,0,0 +0,3.258096,0,6.500689,7.886983,0,6.9,0,0,0 +5,0,0,6.163736,0,0,10.57626,0,0,0 +5,0,0,6.163736,0,0,10.57626,0,0,0 +3,0,0,6.163736,0,0,10.57626,0,0,0 +8,0,0,6.163736,0,0,10.57626,0,0,0 +8,0,0,6.163736,0,0,10.57626,0,0,0 +2,0,0,6.163736,0,0,10.57626,0,0,0 +2,0,0,6.163736,0,0,10.57626,0,0,0 +2,0,0,6.163736,0,0,10.57626,0,0,0 +2,0,0,6.163736,0,0,10.57626,0,0,0 +3,0,0,6.163736,0,0,10.57626,0,0,0 +2,0,0,6.163736,0,0,0,0,0,0 +2,0,0,6.163736,0,0,0,0,0,0 +2,0,0,6.163736,0,0,0,0,0,0 +1,0,0,6.163736,0,0,0,0,0,0 +3,0,0,6.163736,0,0,0,0,0,0 +8,0,0,6.163736,0,1,10.3,0,0,0 +5,0,0,6.163736,0,1,10.3,0,0,0 +4,0,0,6.163736,0,1,10.3,0,0,0 +2,0,0,6.163736,0,1,10.3,0,0,0 +2,0,0,6.163736,0,1,10.3,0,0,0 +2,0,0,6.690892,0,0,6.9,0,1,0 +0,0,0,6.690892,0,0,6.9,0,1,0 +0,0,0,6.690892,0,0,6.9,0,1,0 +2,0,0,6.690892,0,0,3.4,0,1,0 +0,0,0,6.690892,0,0,3.4,0,1,0 +1,0,0,6.690892,0,0,3.4,0,1,0 +1,0,0,6.690892,0,0,3.4,0,1,0 +2,0,0,6.690892,0,0,3.4,0,1,0 +2,0,0,6.690892,0,0,3.4,0,1,0 +3,0,0,6.690892,0,0,10.57626,0,1,0 +1,0,0,6.690892,0,0,10.57626,0,1,0 +1,0,0,6.690892,0,0,10.57626,0,1,0 +0,0,0,6.690892,0,0,10.57626,0,1,0 +0,0,0,6.690892,0,0,10.57626,0,1,0 +0,0,0,6.690892,0,0,10.57626,0,1,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +3,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +0,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +1,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,3.4,0,0,0 +2,0,1,6.109248,6.160541,0,17.2,0,0,0 +0,0,1,6.109248,6.160541,0,17.2,0,0,0 +1,0,1,6.109248,6.160541,0,17.2,0,0,0 +2,0,1,6.109248,6.160541,0,17.2,0,0,0 +2,0,1,6.109248,6.160541,0,17.2,0,0,0 +0,3.931826,0,6.907755,7.600903,.1442925,10.57626,1,0,0 +0,3.931826,0,6.907755,7.600903,.1442925,10.57626,1,0,0 +3,3.931826,0,6.907755,7.600903,.1442925,10.57626,1,0,0 +1,3.931826,0,6.907755,7.600903,0,0,1,0,0 +1,3.931826,0,6.907755,7.600903,0,0,1,0,0 +4,3.931826,0,6.907755,7.600903,0,0,1,0,0 +8,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +1,3.931826,0,6.907755,7.600903,0,13.8,0,1,0 +4,3.931826,0,6.907755,7.600903,.1442925,10.57626,0,0,0 +1,3.931826,0,6.907755,7.600903,.1442925,10.57626,0,0,0 +1,3.931826,0,6.907755,7.600903,.1442925,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +0,3.931826,0,6.907755,7.600903,0,0,1,0,0 +4,0,1,6.109248,6.160541,0,6.9,1,0,0 +8,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +0,0,1,6.109248,6.160541,0,6.9,1,0,0 +5,0,1,6.109248,6.160541,1,24.1,1,0,0 +0,0,1,6.109248,6.160541,1,24.1,1,0,0 +0,0,1,6.109248,6.160541,1,24.1,1,0,0 +0,0,1,6.109248,6.160541,1,24.1,1,0,0 +0,0,1,6.109248,6.160541,1,24.1,1,0,0 +1,0,1,6.109248,6.160541,0,24.1,1,0,0 +0,0,1,6.109248,6.160541,0,24.1,1,0,0 +0,0,1,6.109248,6.160541,0,24.1,1,0,0 +2,0,1,6.109248,6.160541,0,24.1,1,0,0 +0,0,1,6.109248,6.160541,0,24.1,1,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +4,0,1,5.703783,5.755076,0,10.3,1,0,0 +1,0,1,5.703783,5.755076,0,10.3,1,0,0 +3,0,1,5.703783,5.755076,0,10.3,1,0,0 +17,0,1,5.703783,5.755076,1,31,1,0,0 +17,0,1,5.703783,5.755076,1,31,1,0,0 +21,0,1,5.703783,5.755076,1,31,1,0,0 +15,0,0,4.094345,0,0,3.4,0,0,0 +2,0,0,4.094345,0,0,3.4,0,0,0 +1,0,0,4.094345,0,0,3.4,0,0,0 +3,0,0,4.094345,0,1,13.8,1,0,0 +3,0,0,4.094345,0,1,13.8,1,0,0 +6,0,0,4.094345,0,1,13.8,1,0,0 +6,0,0,4.094345,0,1,10.57626,1,0,0 +3,0,0,4.094345,0,1,10.57626,1,0,0 +8,0,0,4.094345,0,1,10.57626,1,0,0 +2,0,0,4.094345,0,0,3.4,0,0,0 +3,0,0,4.094345,0,0,3.4,0,0,0 +4,0,0,4.094345,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,1,0 +4,0,0,0,0,0,3.4,0,1,0 +0,0,0,0,0,0,3.4,0,1,0 +2,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +2,0,0,0,0,0,6.9,0,0,0 +0,0,0,0,0,0,6.9,0,0,0 +1,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +16,0,0,0,0,1,10.3,0,1,0 +9,0,0,0,0,1,10.3,0,1,0 +10,0,0,0,0,1,10.3,0,1,0 +0,0,0,5.796544,0,0,3.4,1,0,0 +1,0,0,5.796544,0,0,3.4,1,0,0 +4,0,0,5.796544,0,0,3.4,1,0,0 +5,0,0,0,0,0,17.2,0,0,0 +4,0,0,0,0,0,17.2,0,0,0 +4,0,0,0,0,0,17.2,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,1,3.4,0,0,0 +0,0,0,0,0,1,3.4,0,0,0 +1,0,0,0,0,1,3.4,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,13.8,1,0,0 +3,0,0,0,0,0,13.8,1,0,0 +4,0,0,0,0,0,13.8,1,0,0 +4,0,0,0,0,1,10.3,1,0,0 +0,0,0,0,0,1,10.3,1,0,0 +2,0,0,0,0,1,10.3,1,0,0 +2,0,0,0,0,0,10.57626,0,1,0 +1,0,0,0,0,0,10.57626,0,1,0 +2,0,0,0,0,0,10.57626,0,1,0 +0,0,0,0,0,1,10.57626,1,0,0 +4,0,0,0,0,1,10.57626,1,0,0 +3,0,0,0,0,1,10.57626,1,0,0 +0,0,0,0,0,1,6.9,1,0,0 +9,0,0,0,0,1,6.9,1,0,0 +8,0,0,0,0,1,6.9,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +6,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.3,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +2,0,0,0,0,0,10.57626,1,0,0 +0,0,1,5.703783,5.755076,0,10.57626,0,0,0 +0,0,1,5.703783,5.755076,0,10.57626,0,0,0 +4,0,1,5.703783,5.755076,1,6.9,1,0,0 +5,0,1,5.703783,5.755076,1,6.9,1,0,0 +3,0,1,5.703783,5.755076,1,6.9,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,1,10.57626,1,0,0 +0,0,0,0,0,1,10.57626,1,0,0 +0,0,0,0,0,1,10.57626,1,0,0 +0,0,0,0,0,1,10.57626,1,0,0 +0,0,0,0,0,1,10.57626,1,0,0 +0,0,0,0,0,1,10.57626,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +0,0,0,0,0,0,3.4,1,0,0 +2,0,0,0,0,0,3.4,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,10.3,1,0,0 +5,0,0,0,0,0,10.3,1,0,0 +4,0,0,0,0,0,10.3,1,0,0 +3,0,0,0,0,0,10.3,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,1,0,0 +1,0,1,5.010635,5.061929,0,31,1,0,0 +16,0,1,5.010635,5.061929,0,31,1,0,0 +16,0,1,5.010635,5.061929,0,31,1,0,0 +17,0,1,5.010635,5.061929,0,31,1,0,0 +11,0,1,5.010635,5.061929,0,31,1,0,0 +3,0,0,5.33001,0,0,20.7,1,0,0 +2,0,0,5.33001,0,0,20.7,1,0,0 +4,0,0,5.33001,0,0,20.7,1,0,0 +2,0,0,5.33001,0,0,20.7,1,0,0 +3,0,0,5.33001,0,0,20.7,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +1,0,0,5.33001,0,0,10.57626,1,0,0 +8,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +3,0,0,5.33001,0,0,10.57626,1,0,0 +7,0,0,5.33001,0,0,10.57626,1,0,0 +5,0,0,5.33001,0,0,10.57626,1,0,0 +4,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +5,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +2,0,0,5.33001,0,0,10.57626,1,0,0 +1,0,0,5.33001,0,0,10.57626,1,0,0 +1,0,0,5.33001,0,0,3.4,1,0,0 +1,0,0,5.33001,0,0,3.4,1,0,0 +0,0,0,5.33001,0,0,3.4,1,0,0 +2,0,0,5.33001,0,0,3.4,1,0,0 +2,0,0,5.33001,0,0,3.4,1,0,0 +1,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +1,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,0,5.33001,0,0,10.57626,1,0,0 +3,0,0,5.33001,0,0,10.57626,1,0,0 +1,0,0,5.33001,0,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +4,0,1,6.109248,6.160541,0,10.57626,1,0,0 +0,0,1,6.109248,6.160541,0,10.57626,1,0,0 +1,0,1,6.109248,6.160541,0,3.4,1,0,0 +3,0,1,6.109248,6.160541,0,3.4,1,0,0 +4,0,1,6.109248,6.160541,0,3.4,1,0,0 +6,0,1,6.109248,6.160541,0,3.4,1,0,0 +5,0,1,6.109248,6.160541,0,3.4,1,0,0 +2,0,1,6.109248,6.160541,0,3.4,1,0,0 +0,0,0,4.97231,0,0,6.9,0,0,0 +3,0,0,4.97231,0,0,6.9,0,0,0 +5,0,0,4.97231,0,0,6.9,0,0,0 +0,0,0,4.97231,0,0,24.1,0,0,0 +0,0,0,4.97231,0,0,24.1,0,0,0 +4,0,0,4.97231,0,0,24.1,0,0,0 +2,0,0,4.97231,0,0,10.57626,0,0,0 +4,0,0,4.97231,0,0,10.57626,0,0,0 +3,0,0,4.97231,0,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,0,0,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,1,0,0 +0,0,1,6.109248,6.160541,1,10.3,1,0,0 +0,0,1,6.109248,6.160541,1,10.3,1,0,0 +1,0,1,6.109248,6.160541,1,10.3,1,0,0 +4,0,1,6.109248,6.160541,1,10.3,1,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +2,0,0,5.796544,0,.1442925,10.57626,1,0,0 +2,0,0,5.796544,0,.1442925,10.57626,1,0,0 +0,0,0,5.796544,0,.1442925,10.57626,1,0,0 +2,0,0,0,0,.1442925,10.57626,0,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +1,0,0,0,0,0,10.57626,1,0,0 +0,0,0,0,0,0,10.57626,1,0,0 +1,4.564348,0,6.907755,6.959049,1,17.2,0,0,0 +2,4.564348,0,6.907755,6.959049,1,17.2,0,0,0 +1,4.564348,0,6.907755,6.959049,1,17.2,0,0,0 +4,0,0,3.178054,0,0,10.57626,0,0,0 +3,0,0,3.178054,0,0,10.57626,0,0,0 +8,0,0,3.178054,0,0,10.57626,0,0,0 +11,0,0,0,0,0,10.57626,0,0,0 +7,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +5,0,0,0,0,0,3.4,0,0,0 +4,0,0,0,0,0,3.4,0,0,0 +6,0,0,0,0,0,3.4,0,0,0 +0,0,0,0,0,0,3.4,0,0,0 +0,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,3.258096,0,0,8.006368,0,0,0,0,0 +0,3.258096,0,0,8.006368,0,0,0,0,0 +0,3.258096,0,0,8.006368,0,0,0,0,0 +0,3.258096,0,0,8.006368,0,0,0,0,0 +0,3.258096,0,0,8.006368,0,0,0,0,0 +0,3.258096,0,0,8.006368,0,10.57626,0,0,0 +0,3.258096,0,0,8.006368,0,10.57626,0,0,0 +2,3.258096,0,0,8.006368,0,10.57626,0,0,0 +0,3.258096,0,0,8.006368,0,10.57626,0,0,0 +0,3.258096,0,0,8.006368,0,10.57626,0,0,0 +0,0,0,5.029653,0,0,3.4,0,0,0 +0,0,0,5.029653,0,0,3.4,0,0,0 +0,0,0,5.029653,0,0,3.4,0,0,0 +2,3.258096,0,6.476973,7.863267,0,10.57626,0,0,0 +0,3.258096,0,6.476973,7.863267,0,10.57626,0,0,0 +0,3.258096,0,6.476973,7.863267,0,10.57626,0,0,0 +0,3.258096,0,6.476973,7.863267,0,10.57626,0,0,0 +1,3.258096,0,6.476973,7.863267,0,10.57626,0,0,0 +4,0,1,6.109248,6.160541,0,10.57626,0,0,0 +7,0,1,6.109248,6.160541,0,10.57626,0,0,0 +13,0,1,6.109248,6.160541,0,10.57626,0,0,0 +7,0,1,6.109248,6.160541,0,10.57626,0,0,0 +9,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,3.258096,0,6.055495,7.44179,1,10.57626,0,0,0 +0,0,0,5.126342,0,0,10.57626,0,0,0 +3,0,0,5.126342,0,0,10.57626,0,0,0 +0,0,0,5.126342,0,0,10.57626,0,0,0 +5,0,0,0,0,0,10.3,0,0,0 +8,0,0,0,0,0,10.3,0,0,0 +12,0,0,0,0,0,10.3,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,0,4.668708,0,0,10.57626,0,0,0 +0,0,0,4.668708,0,0,10.57626,0,0,0 +0,0,0,4.668708,0,0,10.57626,0,0,0 +0,0,0,5.145166,0,0,3.4,0,0,0 +0,0,0,5.145166,0,0,3.4,0,0,0 +1,0,0,5.145166,0,0,3.4,0,0,0 +1,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +5,0,0,4.094345,0,1,27.6,0,0,0 +4,0,0,4.094345,0,1,27.6,0,0,0 +0,0,0,4.094345,0,1,27.6,0,0,0 +0,0,0,4.094345,0,0,10.57626,0,0,0 +1,0,0,4.094345,0,0,10.57626,0,0,0 +1,0,0,4.094345,0,0,10.57626,0,0,0 +3,0,0,4.094345,0,0,10.57626,0,0,0 +2,0,0,4.094345,0,0,10.57626,0,0,0 +4,0,0,4.094345,0,0,10.57626,0,0,0 +3,0,0,4.458988,0,0,20.7,0,0,0 +3,0,0,4.458988,0,0,20.7,0,0,0 +5,0,0,4.458988,0,0,20.7,0,0,0 +4,0,0,4.458988,0,0,10.3,0,0,0 +4,0,0,4.458988,0,0,10.3,0,0,0 +2,0,0,4.458988,0,0,10.3,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +0,3.258096,0,6.620073,8.006368,0,13.8,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,0,0,0,0 +6,3.258096,0,6.620073,8.006368,0,0,0,0,0 +5,3.258096,0,6.620073,8.006368,0,24.1,0,0,0 +3,3.258096,0,6.620073,8.006368,0,24.1,0,0,0 +2,3.258096,0,6.620073,8.006368,0,24.1,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.3,0,0,0 +0,3.258096,0,6.784457,7.932075,0,10.57626,0,0,0 +0,3.258096,0,6.784457,7.932075,0,10.57626,0,0,0 +1,3.258096,0,6.784457,7.932075,0,10.57626,0,0,0 +3,3.258096,0,6.784457,7.932075,1,10.3,0,0,0 +1,3.258096,0,6.784457,7.932075,1,10.3,0,0,0 +2,3.258096,0,6.784457,7.932075,1,10.3,0,0,0 +0,3.258096,0,6.784457,7.932075,0,3.4,1,0,0 +1,3.258096,0,6.784457,7.932075,0,3.4,1,0,0 +0,3.258096,0,6.784457,7.932075,0,3.4,1,0,0 +0,3.258096,0,6.784457,7.932075,0,10.3,1,0,0 +0,3.258096,0,6.784457,7.932075,0,10.3,1,0,0 +1,3.258096,0,6.784457,7.932075,0,10.3,1,0,0 +1,3.258096,0,6.784457,7.932075,0,10.57626,0,0,0 +2,3.258096,0,6.784457,7.932075,0,10.57626,0,0,0 +2,3.258096,0,6.784457,7.932075,0,10.57626,0,0,0 +0,3.258096,0,6.784457,7.932075,0,10.57626,0,0,0 +1,3.258096,0,6.784457,7.932075,0,10.57626,0,0,0 +6,3.258096,0,6.784457,7.932075,0,10.57626,0,0,0 +0,0,1,5.010635,6.160541,0,0,0,0,0 +0,0,1,5.010635,6.160541,0,0,0,0,0 +0,0,1,5.010635,6.160541,0,0,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,0,0,0 +0,0,1,6.109248,6.160541,1,10.3,0,0,0 +4,0,1,6.109248,6.160541,1,10.3,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +1,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +0,0,1,0,6.160541,0,10.57626,0,0,0 +3,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +1,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +4,0,1,0,5.061929,0,6.9,0,0,0 +0,0,1,0,5.061929,0,6.9,0,0,0 +0,0,1,0,5.061929,0,6.9,0,0,0 +0,0,1,0,5.061929,0,6.9,0,0,0 +1,0,1,0,5.061929,0,6.9,0,0,0 +0,0,0,6.050488,0,.1442925,10.57626,0,0,0 +0,0,0,6.050488,0,.1442925,10.57626,0,0,0 +0,0,0,6.050488,0,.1442925,10.57626,0,0,0 +0,0,0,6.050488,0,.1442925,10.57626,0,0,0 +0,0,0,6.050488,0,.1442925,10.57626,0,0,0 +0,0,0,6.050488,0,.1442925,20.7,0,0,0 +0,0,0,6.050488,0,.1442925,20.7,0,0,0 +0,0,0,6.050488,0,.1442925,20.7,0,0,0 +4,0,0,6.050488,0,.1442925,20.7,0,0,0 +9,0,0,6.050488,0,.1442925,20.7,0,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +1,0,0,0,0,0,13.8,0,0,0 +13,0,0,0,0,0,13.8,0,0,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +2,0,0,0,0,0,0,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +9,0,0,0,0,0,10.57626,0,0,0 +6,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +4,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +5,0,0,0,0,0,10.57626,0,0,0 +0,3.258096,0,6.579251,7.965546,0,10.57626,0,0,0 +1,3.258096,0,6.579251,7.965546,0,10.57626,0,0,0 +0,3.258096,0,6.579251,7.965546,0,10.57626,0,0,0 +0,4.564348,0,5.160491,5.467394,0,6.9,0,0,0 +0,4.564348,0,5.160491,5.467394,0,6.9,0,0,0 +0,4.564348,0,5.160491,5.467394,0,6.9,0,0,0 +0,4.564348,0,5.160491,5.467394,0,6.9,0,0,0 +0,4.564348,0,5.160491,5.467394,0,6.9,0,0,0 +8,0,0,4.094345,0,.1442925,10.57626,0,0,0 +2,0,0,4.094345,0,.1442925,10.57626,0,0,0 +2,0,0,4.094345,0,.1442925,10.57626,0,0,0 +2,0,0,4.094345,0,.1442925,10.57626,0,0,0 +0,4.564348,0,5.572838,6.959049,0,10.57626,0,0,0 +0,4.564348,0,5.572838,6.959049,0,10.57626,0,0,0 +0,4.564348,0,5.572838,6.959049,0,10.57626,0,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +4,0,0,0,0,.1442925,10.57626,0,0,0 +2,0,0,0,0,.1442925,10.57626,0,0,0 +6,0,0,0,0,1,13.8,0,0,0 +4,0,0,0,0,1,13.8,0,0,0 +5,0,0,0,0,1,13.8,0,0,0 +0,4.564348,0,6.015181,5.734873,.1442925,10.57626,0,0,0 +0,4.564348,0,6.015181,5.734873,.1442925,10.57626,0,0,0 +0,4.564348,0,6.015181,5.734873,.1442925,10.57626,0,0,0 +0,4.564348,0,6.015181,5.734873,.1442925,10.57626,0,0,0 +2,0,1,5.010635,6.160541,0,10.57626,0,0,0 +0,0,1,5.010635,6.160541,0,10.57626,0,0,0 +0,0,1,5.010635,6.160541,0,10.57626,0,0,0 +3,0,0,0,0,0,10.57626,0,0,0 +1,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,4.564348,0,6.709304,6.760598,.1442925,10.57626,0,0,0 +0,4.564348,0,6.709304,6.760598,.1442925,10.57626,0,0,0 +0,4.564348,0,6.709304,6.760598,.1442925,10.57626,0,0,0 +7,0,0,0,0,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +5,0,0,0,0,.1442925,10.57626,0,0,0 +4,0,0,0,0,.1442925,10.57626,0,0,0 +4,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +7,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +0,4.564348,0,6.907755,6.959049,0,13.8,0,0,0 +12,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +3,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +1,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +6,0,0,4.094345,0,.1442925,10.57626,0,0,0 +3,0,0,4.094345,0,.1442925,10.57626,0,0,0 +2,0,0,4.094345,0,.1442925,10.57626,0,0,0 +6,0,0,4.094345,0,.1442925,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +8,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +2,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +5,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +1,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +1,3.258096,0,0,5.991465,0,10.57626,0,0,0 +5,3.258096,0,0,5.991465,0,10.57626,0,0,0 +2,3.258096,0,0,5.991465,0,10.57626,0,0,0 +2,0,0,6.050488,0,.1442925,10.57626,0,0,0 +2,0,0,6.050488,0,.1442925,10.57626,0,0,0 +4,0,0,6.050488,0,.1442925,10.57626,0,0,0 +2,0,0,6.050488,0,.1442925,10.57626,0,0,0 +5,0,0,6.050488,0,.1442925,10.57626,0,0,0 +0,0,0,6.050488,0,.1442925,10.57626,0,0,0 +3,0,0,6.050488,0,.1442925,10.57626,0,0,0 +1,0,0,6.050488,0,.1442925,10.57626,0,0,0 +14,0,1,5.857819,5.755076,.1442925,10.57626,0,0,0 +4,0,1,5.857819,5.755076,.1442925,10.57626,0,0,0 +1,0,1,5.857819,5.755076,.1442925,10.57626,0,0,0 +0,3.258096,0,0,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,0,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,0,8.006368,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +1,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +3,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +1,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +4,0,1,6.109248,6.160541,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +4,0,1,6.109248,6.160541,0,10.57626,0,0,0 +20,4.564348,0,6.49224,5.781393,0,10.57626,0,0,0 +21,4.564348,0,6.49224,5.781393,0,10.57626,0,0,0 +28,4.564348,0,6.49224,5.781393,0,10.57626,0,0,0 +1,0,0,5.267652,0,1,10.57626,0,0,0 +9,0,0,5.267652,0,1,10.57626,0,0,0 +9,0,0,5.267652,0,1,10.57626,0,0,0 +1,0,1,6.109248,6.160541,1,10.57626,0,0,0 +1,0,1,6.109248,6.160541,1,10.57626,0,0,0 +0,0,1,6.109248,6.160541,1,10.57626,0,0,0 +0,0,1,6.109248,6.160541,1,20.7,0,0,0 +6,0,1,6.109248,6.160541,1,20.7,0,0,0 +5,0,1,6.109248,6.160541,1,20.7,0,0,0 +0,3.258096,0,5.269815,6.656109,0,0,0,0,0 +0,3.258096,0,5.269815,6.656109,0,0,0,0,0 +0,3.258096,0,5.269815,6.656109,0,0,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +0,0,0,0,0,0,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +2,0,0,4.668708,0,0,10.57626,0,0,0 +0,0,0,4.668708,0,0,10.57626,0,0,0 +1,0,0,4.668708,0,0,10.57626,0,0,0 +1,0,0,4.668708,0,.1442925,10.57626,0,0,0 +1,0,0,4.668708,0,.1442925,10.57626,0,0,0 +3,0,0,4.668708,0,.1442925,10.57626,0,0,0 +1,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0 +2,0,0,5.796544,0,0,10.57626,0,0,0 +2,0,0,5.796544,0,0,10.57626,0,0,0 +3,0,0,5.796544,0,0,10.57626,0,0,0 +0,0,1,5.703783,5.755076,1,27.6,0,0,0 +0,0,1,5.703783,5.755076,1,27.6,0,0,0 +0,0,1,5.703783,5.755076,1,27.6,0,0,0 +0,0,1,5.703783,5.755076,.1442925,10.57626,0,0,0 +0,0,1,5.703783,5.755076,.1442925,10.57626,0,0,0 +0,0,1,5.703783,5.755076,.1442925,10.57626,0,0,0 +1,0,1,5.703783,5.755076,0,10.57626,0,0,0 +0,0,1,5.703783,5.755076,0,10.57626,0,0,0 +1,0,1,5.703783,5.755076,0,10.57626,0,0,0 +1,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +0,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +2,3.931826,0,6.907755,7.600903,0,10.57626,0,0,0 +0,0,0,5.126342,0,0,10.57626,0,0,0 +1,0,0,5.126342,0,0,10.57626,0,0,0 +2,0,0,5.126342,0,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,10.57626,0,0,0 +1,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,0,1,6.109248,6.160541,0,10.57626,0,0,0 +0,4.564348,0,6.015181,5.734873,.1442925,10.57626,0,0,0 +0,4.564348,0,6.015181,5.734873,.1442925,10.57626,0,0,0 +0,4.564348,0,6.015181,5.734873,.1442925,10.57626,0,0,0 +13,0,0,0,0,0,10.57626,0,0,0 +11,0,0,0,0,0,10.57626,0,0,0 +12,0,0,0,0,0,10.57626,0,0,0 +10,4.564348,0,6.50354,6.569703,.1442925,10.57626,0,0,0 +10,4.564348,0,6.50354,6.569703,.1442925,10.57626,0,0,0 +6,4.564348,0,6.50354,6.569703,.1442925,10.57626,0,0,0 +1,0,0,6.050488,0,.1442925,10.57626,0,0,0 +0,0,0,6.050488,0,.1442925,10.57626,0,0,0 +2,0,0,6.050488,0,.1442925,10.57626,0,0,0 +11,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +7,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +5,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +2,0,0,0,0,0,10.57626,0,0,0 +2,0,1,6.109248,6.160541,0,17.2,0,0,0 +0,0,1,6.109248,6.160541,0,17.2,0,0,0 +0,0,1,6.109248,6.160541,0,17.2,0,0,0 +8,0,1,6.109248,6.160541,1,10.57626,0,0,0 +5,0,1,6.109248,6.160541,1,10.57626,0,0,0 +3,0,1,6.109248,6.160541,1,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,3.931826,0,6.07507,6.560323,0,10.57626,0,0,0 +2,3.931826,0,6.07507,6.560323,0,10.57626,0,0,0 +0,3.931826,0,6.07507,6.560323,0,10.57626,0,0,0 +3,0,0,6.148468,0,0,10.57626,0,0,0 +6,0,0,6.148468,0,0,10.57626,0,0,0 +5,0,0,6.148468,0,0,10.57626,0,0,0 +8,3.258096,0,6.579251,7.965546,0,10.57626,0,0,0 +7,3.258096,0,6.579251,7.965546,0,10.57626,0,0,0 +0,3.258096,0,6.579251,7.965546,0,10.57626,0,0,0 +0,3.258096,0,0,8.006368,0,0,0,0,0 +3,3.258096,0,0,8.006368,0,0,0,0,0 +2,0,0,5.482637,0,0,10.57626,0,0,0 +1,0,0,5.482637,0,0,10.57626,0,0,0 +0,0,0,5.482637,0,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +2,4.564348,0,6.907755,6.959049,0,3.4,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +1,4.564348,0,6.907755,6.959049,0,10.57626,0,0,0 +4,3.258096,0,0,8.006368,0,6.9,0,0,0 +1,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,3.258096,0,0,8.006368,0,6.9,0,0,0 +0,0,1,6.313548,6.160541,0,10.57626,0,0,0 +0,0,1,6.313548,6.160541,0,10.57626,0,0,0 +1,0,1,6.313548,6.160541,0,10.57626,0,0,0 +5,0,1,6.313548,6.160541,0,24.1,0,0,0 +0,0,1,6.313548,6.160541,0,24.1,0,0,0 +6,0,1,6.313548,6.160541,0,24.1,0,0,0 +8,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +4,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,3.258096,0,6.620073,8.006368,0,10.57626,0,0,0 +2,0,1,5.703783,6.160541,0,10.57626,0,0,0 +0,0,1,5.703783,6.160541,0,10.57626,0,0,0 +0,0,1,5.703783,6.160541,0,10.57626,0,0,0 +12,0,0,0,0,0,17.2,0,0,0 +9,0,0,0,0,0,17.2,0,0,0 +1,0,0,0,0,0,17.2,0,0,0 +20,4.564348,0,6.49224,5.781393,0,10.57626,0,0,0 +15,4.564348,0,6.49224,5.781393,0,10.57626,0,0,0 +12,4.564348,0,6.49224,5.781393,0,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +1,4.564348,0,6.232605,6.2643,.1442925,10.57626,0,0,0 +0,4.564348,0,6.232605,6.2643,.1442925,10.57626,0,0,0 +0,4.564348,0,6.232605,6.2643,.1442925,10.57626,0,0,0 +25,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +16,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +8,0,0,0,0,.1442925,10.57626,0,0,0 +0,4.564348,0,4.393214,4.444507,.1442925,10.57626,0,0,0 +0,4.564348,0,4.393214,4.444507,.1442925,10.57626,0,0,0 +0,4.564348,0,0,6.679335,.1442925,10.57626,0,0,0 +0,4.564348,0,0,6.679335,.1442925,10.57626,0,0,0 +6,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +2,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +9,0,0,0,0,.1442925,10.57626,0,0,0 +3,0,0,0,0,.1442925,10.57626,0,0,0 +2,0,0,0,0,.1442925,10.57626,0,0,0 +1,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,0,0,.1442925,10.57626,0,0,0 +2,0,1,5.703783,5.755076,.1442925,10.57626,0,0,0 +1,0,1,5.703783,5.755076,.1442925,10.57626,0,0,0 +14,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +14,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +14,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +1,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +1,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +1,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +5,0,1,5.703783,6.160541,.1442925,10.57626,0,0,0 +0,0,1,5.703783,6.160541,.1442925,10.57626,0,0,0 +9,0,0,4.094345,0,.1442925,10.57626,0,0,0 +5,0,0,4.094345,0,.1442925,10.57626,0,0,0 +15,0,0,0,0,.1442925,10.57626,0,0,0 +6,0,0,0,0,.1442925,10.57626,0,0,0 +0,3.258096,0,0,8.006368,.1442925,10.57626,0,0,0 +0,3.258096,0,0,8.006368,.1442925,10.57626,0,0,0 +16,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +0,4.564348,0,6.907755,6.959049,.1442925,10.57626,0,0,0 +3,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +9,0,1,5.857819,5.755076,.1442925,10.57626,0,0,0 +0,0,1,5.857819,5.755076,.1442925,10.57626,0,0,0 +2,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +12,0,0,5.33001,0,.1442925,10.57626,0,0,0 +2,0,0,5.33001,0,.1442925,10.57626,0,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +0,0,1,5.010635,6.160541,.1442925,10.57626,0,0,0 +8,0,0,6.264845,0,.1442925,10.57626,0,0,0 +10,0,0,6.264845,0,.1442925,10.57626,0,0,0 +7,0,0,5.259992,0,.1442925,10.57626,0,0,0 +7,0,0,6.050488,0,.1442925,10.57626,0,0,0 +1,0,0,6.050488,0,.1442925,10.57626,0,0,0 +1,0,0,5.029653,0,.1442925,10.57626,0,0,0 +21,3.258096,0,5.269815,6.656109,.1442925,10.57626,0,0,0 +0,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +3,0,0,4.668708,0,.1442925,10.57626,0,0,0 +5,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +8,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 +8,0,1,5.703783,5.755076,.1442925,10.57626,0,0,0 +11,0,0,0,0,.1442925,10.57626,0,0,0 +0,0,0,5.126342,0,.1442925,10.57626,0,0,0 +6,0,0,0,0,.1442925,10.57626,0,0,0 +20,0,0,0,0,.1442925,10.57626,0,0,0 +2,3.258096,0,6.784457,7.932075,.1442925,10.57626,0,0,0 +1,3.258096,0,6.784457,7.932075,.1442925,10.57626,0,0,0 +3,3.931826,0,0,7.37149,.1442925,10.57626,0,0,0 +0,0,1,6.109248,6.160541,.1442925,10.57626,0,0,0 +5,3.258096,0,6.476973,7.863267,.1442925,10.57626,0,0,0 +0,3.258096,0,6.507277,7.893572,.1442925,10.57626,0,0,0 +1,4.564348,0,3.883624,3.934917,.1442925,10.57626,0,0,0 +0,3.258096,0,6.262826,7.649121,.1442925,10.57626,0,0,0 +2,0,0,5.377498,0,.1442925,10.57626,0,0,0 +0,0,0,5.377498,0,.1442925,10.57626,0,0,0 +8,3.258096,0,6.874819,8.006368,.1442925,10.57626,0,0,0 +8,3.258096,0,5.156178,6.542472,.1442925,10.57626,0,0,0 +6,3.258096,0,6.620073,8.006368,.1442925,10.57626,0,0,0 diff --git a/shared/package-files/9f/9f6e3810c3f02715f5f570fd948d9f7341236e5ae4e52b193477c029e8ad9229/blob b/shared/package-files/9f/9f6e3810c3f02715f5f570fd948d9f7341236e5ae4e52b193477c029e8ad9229/blob new file mode 100644 index 0000000000000000000000000000000000000000..74c7d4f6cd8c10cf3532824661bfb25000cb783b --- /dev/null +++ b/shared/package-files/9f/9f6e3810c3f02715f5f570fd948d9f7341236e5ae4e52b193477c029e8ad9229/blob @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API pdist { + using schema = at::Tensor (const at::Tensor &, double); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::pdist") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "pdist(Tensor self, float p=2) -> Tensor") + static at::Tensor call(const at::Tensor & self, double p); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, double p); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9f/9f6fd44605be9668b64a9067960282e622c5e2d65cec898d112e77683c08eb38/blob b/shared/package-files/9f/9f6fd44605be9668b64a9067960282e622c5e2d65cec898d112e77683c08eb38/blob new file mode 100644 index 0000000000000000000000000000000000000000..5374b7030dd4285d7a6fa16d4347d10b75965dbe Binary files /dev/null and b/shared/package-files/9f/9f6fd44605be9668b64a9067960282e622c5e2d65cec898d112e77683c08eb38/blob differ diff --git a/shared/package-files/9f/9f71e26d577572189654bbe70ff7e703d35b279c7a618e2a86f160908cded0ae/blob b/shared/package-files/9f/9f71e26d577572189654bbe70ff7e703d35b279c7a618e2a86f160908cded0ae/blob new file mode 100644 index 0000000000000000000000000000000000000000..dfc811a8c1b51a7bb6a8aa780527b588f56f43bd --- /dev/null +++ b/shared/package-files/9f/9f71e26d577572189654bbe70ff7e703d35b279c7a618e2a86f160908cded0ae/blob @@ -0,0 +1,39 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { +namespace _ops { + + +struct TORCH_API hardshrink_backward_grad_input { + using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, const at::Scalar &, at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::hardshrink_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "grad_input") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "hardshrink_backward.grad_input(Tensor grad_out, Tensor self, Scalar lambd, *, Tensor(a!) grad_input) -> Tensor(a!)") + static at::Tensor & call(const at::Tensor & grad_out, const at::Tensor & self, const at::Scalar & lambd, at::Tensor & grad_input); + static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_out, const at::Tensor & self, const at::Scalar & lambd, at::Tensor & grad_input); +}; + +struct TORCH_API hardshrink_backward { + using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Scalar &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::hardshrink_backward") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "hardshrink_backward(Tensor grad_out, Tensor self, Scalar lambd) -> Tensor") + static at::Tensor call(const at::Tensor & grad_out, const at::Tensor & self, const at::Scalar & lambd); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_out, const at::Tensor & self, const at::Scalar & lambd); +}; + +}} // namespace at::_ops diff --git a/shared/package-files/9f/9f726a2d4fddddd00aacfd6e3b99538a95446b18222e10d1dac4a4f1301713f3/blob b/shared/package-files/9f/9f726a2d4fddddd00aacfd6e3b99538a95446b18222e10d1dac4a4f1301713f3/blob new file mode 100644 index 0000000000000000000000000000000000000000..7630ba6e54b91dacf533aa196ab12c5570cc76d2 --- /dev/null +++ b/shared/package-files/9f/9f726a2d4fddddd00aacfd6e3b99538a95446b18222e10d1dac4a4f1301713f3/blob @@ -0,0 +1,767 @@ +""" +Scales define the distribution of data values on an axis, e.g. a log scaling. + +The mapping is implemented through `.Transform` subclasses. + +The following scales are built-in: + +.. _builtin_scales: + +============= ===================== ================================ ================================= +Name Class Transform Inverted transform +============= ===================== ================================ ================================= +"asinh" `AsinhScale` `AsinhTransform` `InvertedAsinhTransform` +"function" `FuncScale` `FuncTransform` `FuncTransform` +"functionlog" `FuncScaleLog` `FuncTransform` + `LogTransform` `InvertedLogTransform` + `FuncTransform` +"linear" `LinearScale` `.IdentityTransform` `.IdentityTransform` +"log" `LogScale` `LogTransform` `InvertedLogTransform` +"logit" `LogitScale` `LogitTransform` `LogisticTransform` +"symlog" `SymmetricalLogScale` `SymmetricalLogTransform` `InvertedSymmetricalLogTransform` +============= ===================== ================================ ================================= + +A user will often only use the scale name, e.g. when setting the scale through +`~.Axes.set_xscale`: ``ax.set_xscale("log")``. + +See also the :ref:`scales examples ` in the documentation. + +Custom scaling can be achieved through `FuncScale`, or by creating your own +`ScaleBase` subclass and corresponding transforms (see :doc:`/gallery/scales/custom_scale`). +Third parties can register their scales by name through `register_scale`. +""" # noqa: E501 + +import inspect +import textwrap + +import numpy as np + +import matplotlib as mpl +from matplotlib import _api, _docstring +from matplotlib.ticker import ( + NullFormatter, ScalarFormatter, LogFormatterSciNotation, LogitFormatter, + NullLocator, LogLocator, AutoLocator, AutoMinorLocator, + SymmetricalLogLocator, AsinhLocator, LogitLocator) +from matplotlib.transforms import Transform, IdentityTransform + + +class ScaleBase: + """ + The base class for all scales. + + Scales are separable transformations, working on a single dimension. + + Subclasses should override + + :attr:`name` + The scale's name. + :meth:`get_transform` + A method returning a `.Transform`, which converts data coordinates to + scaled coordinates. This transform should be invertible, so that e.g. + mouse positions can be converted back to data coordinates. + :meth:`set_default_locators_and_formatters` + A method that sets default locators and formatters for an `~.axis.Axis` + that uses this scale. + :meth:`limit_range_for_scale` + An optional method that "fixes" the axis range to acceptable values, + e.g. restricting log-scaled axes to positive values. + """ + + def __init__(self, axis): + r""" + Construct a new scale. + + Notes + ----- + The following note is for scale implementers. + + For back-compatibility reasons, scales take an `~matplotlib.axis.Axis` + object as first argument. However, this argument should not + be used: a single scale object should be usable by multiple + `~matplotlib.axis.Axis`\es at the same time. + """ + + def get_transform(self): + """ + Return the `.Transform` object associated with this scale. + """ + raise NotImplementedError() + + def set_default_locators_and_formatters(self, axis): + """ + Set the locators and formatters of *axis* to instances suitable for + this scale. + """ + raise NotImplementedError() + + def limit_range_for_scale(self, vmin, vmax, minpos): + """ + Return the range *vmin*, *vmax*, restricted to the + domain supported by this scale (if any). + + *minpos* should be the minimum positive value in the data. + This is used by log scales to determine a minimum value. + """ + return vmin, vmax + + +class LinearScale(ScaleBase): + """ + The default linear scale. + """ + + name = 'linear' + + def __init__(self, axis): + # This method is present only to prevent inheritance of the base class' + # constructor docstring, which would otherwise end up interpolated into + # the docstring of Axis.set_scale. + """ + """ # noqa: D419 + + def set_default_locators_and_formatters(self, axis): + # docstring inherited + axis.set_major_locator(AutoLocator()) + axis.set_major_formatter(ScalarFormatter()) + axis.set_minor_formatter(NullFormatter()) + # update the minor locator for x and y axis based on rcParams + if (axis.axis_name == 'x' and mpl.rcParams['xtick.minor.visible'] or + axis.axis_name == 'y' and mpl.rcParams['ytick.minor.visible']): + axis.set_minor_locator(AutoMinorLocator()) + else: + axis.set_minor_locator(NullLocator()) + + def get_transform(self): + """ + Return the transform for linear scaling, which is just the + `~matplotlib.transforms.IdentityTransform`. + """ + return IdentityTransform() + + +class FuncTransform(Transform): + """ + A simple transform that takes and arbitrary function for the + forward and inverse transform. + """ + + input_dims = output_dims = 1 + + def __init__(self, forward, inverse): + """ + Parameters + ---------- + forward : callable + The forward function for the transform. This function must have + an inverse and, for best behavior, be monotonic. + It must have the signature:: + + def forward(values: array-like) -> array-like + + inverse : callable + The inverse of the forward function. Signature as ``forward``. + """ + super().__init__() + if callable(forward) and callable(inverse): + self._forward = forward + self._inverse = inverse + else: + raise ValueError('arguments to FuncTransform must be functions') + + def transform_non_affine(self, values): + return self._forward(values) + + def inverted(self): + return FuncTransform(self._inverse, self._forward) + + +class FuncScale(ScaleBase): + """ + Provide an arbitrary scale with user-supplied function for the axis. + """ + + name = 'function' + + def __init__(self, axis, functions): + """ + Parameters + ---------- + axis : `~matplotlib.axis.Axis` + The axis for the scale. + functions : (callable, callable) + two-tuple of the forward and inverse functions for the scale. + The forward function must be monotonic. + + Both functions must have the signature:: + + def forward(values: array-like) -> array-like + """ + forward, inverse = functions + transform = FuncTransform(forward, inverse) + self._transform = transform + + def get_transform(self): + """Return the `.FuncTransform` associated with this scale.""" + return self._transform + + def set_default_locators_and_formatters(self, axis): + # docstring inherited + axis.set_major_locator(AutoLocator()) + axis.set_major_formatter(ScalarFormatter()) + axis.set_minor_formatter(NullFormatter()) + # update the minor locator for x and y axis based on rcParams + if (axis.axis_name == 'x' and mpl.rcParams['xtick.minor.visible'] or + axis.axis_name == 'y' and mpl.rcParams['ytick.minor.visible']): + axis.set_minor_locator(AutoMinorLocator()) + else: + axis.set_minor_locator(NullLocator()) + + +class LogTransform(Transform): + input_dims = output_dims = 1 + + def __init__(self, base, nonpositive='clip'): + super().__init__() + if base <= 0 or base == 1: + raise ValueError('The log base cannot be <= 0 or == 1') + self.base = base + self._clip = _api.check_getitem( + {"clip": True, "mask": False}, nonpositive=nonpositive) + + def __str__(self): + return "{}(base={}, nonpositive={!r})".format( + type(self).__name__, self.base, "clip" if self._clip else "mask") + + def transform_non_affine(self, values): + # Ignore invalid values due to nans being passed to the transform. + with np.errstate(divide="ignore", invalid="ignore"): + log = {np.e: np.log, 2: np.log2, 10: np.log10}.get(self.base) + if log: # If possible, do everything in a single call to NumPy. + out = log(values) + else: + out = np.log(values) + out /= np.log(self.base) + if self._clip: + # SVG spec says that conforming viewers must support values up + # to 3.4e38 (C float); however experiments suggest that + # Inkscape (which uses cairo for rendering) runs into cairo's + # 24-bit limit (which is apparently shared by Agg). + # Ghostscript (used for pdf rendering appears to overflow even + # earlier, with the max value around 2 ** 15 for the tests to + # pass. On the other hand, in practice, we want to clip beyond + # np.log10(np.nextafter(0, 1)) ~ -323 + # so 1000 seems safe. + out[values <= 0] = -1000 + return out + + def inverted(self): + return InvertedLogTransform(self.base) + + +class InvertedLogTransform(Transform): + input_dims = output_dims = 1 + + def __init__(self, base): + super().__init__() + self.base = base + + def __str__(self): + return f"{type(self).__name__}(base={self.base})" + + def transform_non_affine(self, values): + return np.power(self.base, values) + + def inverted(self): + return LogTransform(self.base) + + +class LogScale(ScaleBase): + """ + A standard logarithmic scale. Care is taken to only plot positive values. + """ + name = 'log' + + def __init__(self, axis, *, base=10, subs=None, nonpositive="clip"): + """ + Parameters + ---------- + axis : `~matplotlib.axis.Axis` + The axis for the scale. + base : float, default: 10 + The base of the logarithm. + nonpositive : {'clip', 'mask'}, default: 'clip' + Determines the behavior for non-positive values. They can either + be masked as invalid, or clipped to a very small positive number. + subs : sequence of int, default: None + Where to place the subticks between each major tick. For example, + in a log10 scale, ``[2, 3, 4, 5, 6, 7, 8, 9]`` will place 8 + logarithmically spaced minor ticks between each major tick. + """ + self._transform = LogTransform(base, nonpositive) + self.subs = subs + + base = property(lambda self: self._transform.base) + + def set_default_locators_and_formatters(self, axis): + # docstring inherited + axis.set_major_locator(LogLocator(self.base)) + axis.set_major_formatter(LogFormatterSciNotation(self.base)) + axis.set_minor_locator(LogLocator(self.base, self.subs)) + axis.set_minor_formatter( + LogFormatterSciNotation(self.base, + labelOnlyBase=(self.subs is not None))) + + def get_transform(self): + """Return the `.LogTransform` associated with this scale.""" + return self._transform + + def limit_range_for_scale(self, vmin, vmax, minpos): + """Limit the domain to positive values.""" + if not np.isfinite(minpos): + minpos = 1e-300 # Should rarely (if ever) have a visible effect. + + return (minpos if vmin <= 0 else vmin, + minpos if vmax <= 0 else vmax) + + +class FuncScaleLog(LogScale): + """ + Provide an arbitrary scale with user-supplied function for the axis and + then put on a logarithmic axes. + """ + + name = 'functionlog' + + def __init__(self, axis, functions, base=10): + """ + Parameters + ---------- + axis : `~matplotlib.axis.Axis` + The axis for the scale. + functions : (callable, callable) + two-tuple of the forward and inverse functions for the scale. + The forward function must be monotonic. + + Both functions must have the signature:: + + def forward(values: array-like) -> array-like + + base : float, default: 10 + Logarithmic base of the scale. + """ + forward, inverse = functions + self.subs = None + self._transform = FuncTransform(forward, inverse) + LogTransform(base) + + @property + def base(self): + return self._transform._b.base # Base of the LogTransform. + + def get_transform(self): + """Return the `.Transform` associated with this scale.""" + return self._transform + + +class SymmetricalLogTransform(Transform): + input_dims = output_dims = 1 + + def __init__(self, base, linthresh, linscale): + super().__init__() + if base <= 1.0: + raise ValueError("'base' must be larger than 1") + if linthresh <= 0.0: + raise ValueError("'linthresh' must be positive") + if linscale <= 0.0: + raise ValueError("'linscale' must be positive") + self.base = base + self.linthresh = linthresh + self.linscale = linscale + self._linscale_adj = (linscale / (1.0 - self.base ** -1)) + self._log_base = np.log(base) + + def transform_non_affine(self, values): + abs_a = np.abs(values) + with np.errstate(divide="ignore", invalid="ignore"): + out = np.sign(values) * self.linthresh * ( + self._linscale_adj + + np.log(abs_a / self.linthresh) / self._log_base) + inside = abs_a <= self.linthresh + out[inside] = values[inside] * self._linscale_adj + return out + + def inverted(self): + return InvertedSymmetricalLogTransform(self.base, self.linthresh, + self.linscale) + + +class InvertedSymmetricalLogTransform(Transform): + input_dims = output_dims = 1 + + def __init__(self, base, linthresh, linscale): + super().__init__() + symlog = SymmetricalLogTransform(base, linthresh, linscale) + self.base = base + self.linthresh = linthresh + self.invlinthresh = symlog.transform(linthresh) + self.linscale = linscale + self._linscale_adj = (linscale / (1.0 - self.base ** -1)) + + def transform_non_affine(self, values): + abs_a = np.abs(values) + with np.errstate(divide="ignore", invalid="ignore"): + out = np.sign(values) * self.linthresh * ( + np.power(self.base, + abs_a / self.linthresh - self._linscale_adj)) + inside = abs_a <= self.invlinthresh + out[inside] = values[inside] / self._linscale_adj + return out + + def inverted(self): + return SymmetricalLogTransform(self.base, + self.linthresh, self.linscale) + + +class SymmetricalLogScale(ScaleBase): + """ + The symmetrical logarithmic scale is logarithmic in both the + positive and negative directions from the origin. + + Since the values close to zero tend toward infinity, there is a + need to have a range around zero that is linear. The parameter + *linthresh* allows the user to specify the size of this range + (-*linthresh*, *linthresh*). + + See :doc:`/gallery/scales/symlog_demo` for a detailed description. + + Parameters + ---------- + base : float, default: 10 + The base of the logarithm. + + linthresh : float, default: 2 + Defines the range ``(-x, x)``, within which the plot is linear. + This avoids having the plot go to infinity around zero. + + subs : sequence of int + Where to place the subticks between each major tick. + For example, in a log10 scale: ``[2, 3, 4, 5, 6, 7, 8, 9]`` will place + 8 logarithmically spaced minor ticks between each major tick. + + linscale : float, optional + This allows the linear range ``(-linthresh, linthresh)`` to be + stretched relative to the logarithmic range. Its value is the number of + decades to use for each half of the linear range. For example, when + *linscale* == 1.0 (the default), the space used for the positive and + negative halves of the linear range will be equal to one decade in + the logarithmic range. + """ + name = 'symlog' + + def __init__(self, axis, *, base=10, linthresh=2, subs=None, linscale=1): + self._transform = SymmetricalLogTransform(base, linthresh, linscale) + self.subs = subs + + base = property(lambda self: self._transform.base) + linthresh = property(lambda self: self._transform.linthresh) + linscale = property(lambda self: self._transform.linscale) + + def set_default_locators_and_formatters(self, axis): + # docstring inherited + axis.set_major_locator(SymmetricalLogLocator(self.get_transform())) + axis.set_major_formatter(LogFormatterSciNotation(self.base)) + axis.set_minor_locator(SymmetricalLogLocator(self.get_transform(), + self.subs)) + axis.set_minor_formatter(NullFormatter()) + + def get_transform(self): + """Return the `.SymmetricalLogTransform` associated with this scale.""" + return self._transform + + +class AsinhTransform(Transform): + """Inverse hyperbolic-sine transformation used by `.AsinhScale`""" + input_dims = output_dims = 1 + + def __init__(self, linear_width): + super().__init__() + if linear_width <= 0.0: + raise ValueError("Scale parameter 'linear_width' " + + "must be strictly positive") + self.linear_width = linear_width + + def transform_non_affine(self, values): + return self.linear_width * np.arcsinh(values / self.linear_width) + + def inverted(self): + return InvertedAsinhTransform(self.linear_width) + + +class InvertedAsinhTransform(Transform): + """Hyperbolic sine transformation used by `.AsinhScale`""" + input_dims = output_dims = 1 + + def __init__(self, linear_width): + super().__init__() + self.linear_width = linear_width + + def transform_non_affine(self, values): + return self.linear_width * np.sinh(values / self.linear_width) + + def inverted(self): + return AsinhTransform(self.linear_width) + + +class AsinhScale(ScaleBase): + """ + A quasi-logarithmic scale based on the inverse hyperbolic sine (asinh) + + For values close to zero, this is essentially a linear scale, + but for large magnitude values (either positive or negative) + it is asymptotically logarithmic. The transition between these + linear and logarithmic regimes is smooth, and has no discontinuities + in the function gradient in contrast to + the `.SymmetricalLogScale` ("symlog") scale. + + Specifically, the transformation of an axis coordinate :math:`a` is + :math:`a \\rightarrow a_0 \\sinh^{-1} (a / a_0)` where :math:`a_0` + is the effective width of the linear region of the transformation. + In that region, the transformation is + :math:`a \\rightarrow a + \\mathcal{O}(a^3)`. + For large values of :math:`a` the transformation behaves as + :math:`a \\rightarrow a_0 \\, \\mathrm{sgn}(a) \\ln |a| + \\mathcal{O}(1)`. + + .. note:: + + This API is provisional and may be revised in the future + based on early user feedback. + """ + + name = 'asinh' + + auto_tick_multipliers = { + 3: (2, ), + 4: (2, ), + 5: (2, ), + 8: (2, 4), + 10: (2, 5), + 16: (2, 4, 8), + 64: (4, 16), + 1024: (256, 512) + } + + def __init__(self, axis, *, linear_width=1.0, + base=10, subs='auto', **kwargs): + """ + Parameters + ---------- + linear_width : float, default: 1 + The scale parameter (elsewhere referred to as :math:`a_0`) + defining the extent of the quasi-linear region, + and the coordinate values beyond which the transformation + becomes asymptotically logarithmic. + base : int, default: 10 + The number base used for rounding tick locations + on a logarithmic scale. If this is less than one, + then rounding is to the nearest integer multiple + of powers of ten. + subs : sequence of int + Multiples of the number base used for minor ticks. + If set to 'auto', this will use built-in defaults, + e.g. (2, 5) for base=10. + """ + super().__init__(axis) + self._transform = AsinhTransform(linear_width) + self._base = int(base) + if subs == 'auto': + self._subs = self.auto_tick_multipliers.get(self._base) + else: + self._subs = subs + + linear_width = property(lambda self: self._transform.linear_width) + + def get_transform(self): + return self._transform + + def set_default_locators_and_formatters(self, axis): + axis.set(major_locator=AsinhLocator(self.linear_width, + base=self._base), + minor_locator=AsinhLocator(self.linear_width, + base=self._base, + subs=self._subs), + minor_formatter=NullFormatter()) + if self._base > 1: + axis.set_major_formatter(LogFormatterSciNotation(self._base)) + else: + axis.set_major_formatter('{x:.3g}') + + +class LogitTransform(Transform): + input_dims = output_dims = 1 + + def __init__(self, nonpositive='mask'): + super().__init__() + _api.check_in_list(['mask', 'clip'], nonpositive=nonpositive) + self._nonpositive = nonpositive + self._clip = {"clip": True, "mask": False}[nonpositive] + + def transform_non_affine(self, values): + """logit transform (base 10), masked or clipped""" + with np.errstate(divide="ignore", invalid="ignore"): + out = np.log10(values / (1 - values)) + if self._clip: # See LogTransform for choice of clip value. + out[values <= 0] = -1000 + out[1 <= values] = 1000 + return out + + def inverted(self): + return LogisticTransform(self._nonpositive) + + def __str__(self): + return f"{type(self).__name__}({self._nonpositive!r})" + + +class LogisticTransform(Transform): + input_dims = output_dims = 1 + + def __init__(self, nonpositive='mask'): + super().__init__() + self._nonpositive = nonpositive + + def transform_non_affine(self, values): + """logistic transform (base 10)""" + return 1.0 / (1 + 10**(-values)) + + def inverted(self): + return LogitTransform(self._nonpositive) + + def __str__(self): + return f"{type(self).__name__}({self._nonpositive!r})" + + +class LogitScale(ScaleBase): + """ + Logit scale for data between zero and one, both excluded. + + This scale is similar to a log scale close to zero and to one, and almost + linear around 0.5. It maps the interval ]0, 1[ onto ]-infty, +infty[. + """ + name = 'logit' + + def __init__(self, axis, nonpositive='mask', *, + one_half=r"\frac{1}{2}", use_overline=False): + r""" + Parameters + ---------- + axis : `~matplotlib.axis.Axis` + Currently unused. + nonpositive : {'mask', 'clip'} + Determines the behavior for values beyond the open interval ]0, 1[. + They can either be masked as invalid, or clipped to a number very + close to 0 or 1. + use_overline : bool, default: False + Indicate the usage of survival notation (\overline{x}) in place of + standard notation (1-x) for probability close to one. + one_half : str, default: r"\frac{1}{2}" + The string used for ticks formatter to represent 1/2. + """ + self._transform = LogitTransform(nonpositive) + self._use_overline = use_overline + self._one_half = one_half + + def get_transform(self): + """Return the `.LogitTransform` associated with this scale.""" + return self._transform + + def set_default_locators_and_formatters(self, axis): + # docstring inherited + # ..., 0.01, 0.1, 0.5, 0.9, 0.99, ... + axis.set_major_locator(LogitLocator()) + axis.set_major_formatter( + LogitFormatter( + one_half=self._one_half, + use_overline=self._use_overline + ) + ) + axis.set_minor_locator(LogitLocator(minor=True)) + axis.set_minor_formatter( + LogitFormatter( + minor=True, + one_half=self._one_half, + use_overline=self._use_overline + ) + ) + + def limit_range_for_scale(self, vmin, vmax, minpos): + """ + Limit the domain to values between 0 and 1 (excluded). + """ + if not np.isfinite(minpos): + minpos = 1e-7 # Should rarely (if ever) have a visible effect. + return (minpos if vmin <= 0 else vmin, + 1 - minpos if vmax >= 1 else vmax) + + +_scale_mapping = { + 'linear': LinearScale, + 'log': LogScale, + 'symlog': SymmetricalLogScale, + 'asinh': AsinhScale, + 'logit': LogitScale, + 'function': FuncScale, + 'functionlog': FuncScaleLog, + } + + +def get_scale_names(): + """Return the names of the available scales.""" + return sorted(_scale_mapping) + + +def scale_factory(scale, axis, **kwargs): + """ + Return a scale class by name. + + Parameters + ---------- + scale : {%(names)s} + axis : `~matplotlib.axis.Axis` + """ + scale_cls = _api.check_getitem(_scale_mapping, scale=scale) + return scale_cls(axis, **kwargs) + + +if scale_factory.__doc__: + scale_factory.__doc__ = scale_factory.__doc__ % { + "names": ", ".join(map(repr, get_scale_names()))} + + +def register_scale(scale_class): + """ + Register a new kind of scale. + + Parameters + ---------- + scale_class : subclass of `ScaleBase` + The scale to register. + """ + _scale_mapping[scale_class.name] = scale_class + + +def _get_scale_docs(): + """ + Helper function for generating docstrings related to scales. + """ + docs = [] + for name, scale_class in _scale_mapping.items(): + docstring = inspect.getdoc(scale_class.__init__) or "" + docs.extend([ + f" {name!r}", + "", + textwrap.indent(docstring, " " * 8), + "" + ]) + return "\n".join(docs) + + +_docstring.interpd.register( + scale_type='{%s}' % ', '.join([repr(x) for x in get_scale_names()]), + scale_docs=_get_scale_docs().rstrip(), + ) diff --git a/shared/package-files/9f/9f7738790b624744415a4acf5c663c7e2ddb4538c43e53a7a44c1ac2c425a234/blob b/shared/package-files/9f/9f7738790b624744415a4acf5c663c7e2ddb4538c43e53a7a44c1ac2c425a234/blob new file mode 100644 index 0000000000000000000000000000000000000000..4334186dd9d193b81276df3a0afa98718bb5a346 --- /dev/null +++ b/shared/package-files/9f/9f7738790b624744415a4acf5c663c7e2ddb4538c43e53a7a44c1ac2c425a234/blob @@ -0,0 +1,12 @@ +from typing import Any, List, Optional, Union + +from django.template.base import Origin +from django.template.engine import Engine + +from .base import Loader as BaseLoader + +class Loader(BaseLoader): + dirs: Optional[List[str]] = ... + def __init__(self, engine: Engine, dirs: Optional[List[str]] = ...) -> None: ... + def get_dirs(self) -> Union[List[bytes], List[str]]: ... + def get_contents(self, origin: Origin) -> Any: ... diff --git a/shared/package-files/9f/9f7a583cfb870624cbd185d7f002887c5ddfd7c43657d9e2faad48172440fead/blob b/shared/package-files/9f/9f7a583cfb870624cbd185d7f002887c5ddfd7c43657d9e2faad48172440fead/blob new file mode 100644 index 0000000000000000000000000000000000000000..0c09a82413fec8ceb9c277d3e036b7f8061fc3da --- /dev/null +++ b/shared/package-files/9f/9f7a583cfb870624cbd185d7f002887c5ddfd7c43657d9e2faad48172440fead/blob @@ -0,0 +1,58 @@ +import collections + + +Entry = collections.namedtuple('Entry', 'version, hash') + + +def update_hash(seed, value): + # Good old boost::hash_combine + # https://www.boost.org/doc/libs/1_35_0/doc/html/boost/hash_combine_id241013.html + return seed ^ (hash(value) + 0x9e3779b9 + (seed << 6) + (seed >> 2)) + + +def hash_source_files(hash_value, source_files): + for filename in source_files: + with open(filename) as file: + hash_value = update_hash(hash_value, file.read()) + return hash_value + + +def hash_build_arguments(hash_value, build_arguments): + for group in build_arguments: + if group: + for argument in group: + hash_value = update_hash(hash_value, argument) + return hash_value + + +class ExtensionVersioner: + def __init__(self): + self.entries = {} + + def get_version(self, name): + entry = self.entries.get(name) + return None if entry is None else entry.version + + def bump_version_if_changed(self, + name, + source_files, + build_arguments, + build_directory, + with_cuda, + is_python_module, + is_standalone): + hash_value = 0 + hash_value = hash_source_files(hash_value, source_files) + hash_value = hash_build_arguments(hash_value, build_arguments) + hash_value = update_hash(hash_value, build_directory) + hash_value = update_hash(hash_value, with_cuda) + hash_value = update_hash(hash_value, is_python_module) + hash_value = update_hash(hash_value, is_standalone) + + entry = self.entries.get(name) + if entry is None: + self.entries[name] = entry = Entry(0, hash_value) + elif hash_value != entry.hash: + self.entries[name] = entry = Entry(entry.version + 1, hash_value) + + return entry.version diff --git a/shared/package-files/9f/9f7af3466bf661b803e86caca54663be8db9adc15ec3e1dc3ef583629f85c8b3/blob b/shared/package-files/9f/9f7af3466bf661b803e86caca54663be8db9adc15ec3e1dc3ef583629f85c8b3/blob new file mode 100644 index 0000000000000000000000000000000000000000..cfd2ece75b09e9a670328808dd00b05eec5d6ff4 --- /dev/null +++ b/shared/package-files/9f/9f7af3466bf661b803e86caca54663be8db9adc15ec3e1dc3ef583629f85c8b3/blob @@ -0,0 +1,604 @@ +# The Tensor classes are added to this module by python_tensor.cpp +from typing import Optional, Tuple, List, Union, Any + +import torch +from torch._C import _add_docstr, _sparse # type: ignore[attr-defined] +from torch import Tensor + +# Semi structured sparsity support +from .semi_structured import ( + SparseSemiStructuredTensor, + SparseSemiStructuredTensorCUSPARSELT, + SparseSemiStructuredTensorCUTLASS, + to_sparse_semi_structured +) + +# A workaround to support both TorchScript and MyPy: +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from torch.types import _dtype as DType + DimOrDims = Optional[Union[int, Tuple[int], List[int]]] +else: + # The JIT doesn't understand Union, nor torch.dtype here + DType = int + DimOrDims = Optional[Tuple[int]] + + +__all__ = [ + 'addmm', + 'check_sparse_tensor_invariants', + 'mm', + 'sum', + 'softmax', + 'log_softmax', + 'SparseSemiStructuredTensor', + 'SparseSemiStructuredTensorCUTLASS', + 'SparseSemiStructuredTensorCUSPARSELT', + 'to_sparse_semi_structured', + 'as_sparse_gradcheck', +] + +addmm = _add_docstr(_sparse._sparse_addmm, r""" +sparse.addmm(mat, mat1, mat2, *, beta=1., alpha=1.) -> Tensor + +This function does exact same thing as :func:`torch.addmm` in the forward, +except that it supports backward for sparse COO matrix :attr:`mat1`. +When :attr:`mat1` is a COO tensor it must have `sparse_dim = 2`. +When inputs are COO tensors, this function also supports backward for both inputs. + +Supports both CSR and COO storage formats. + +.. note:: + This function doesn't support computing derivaties with respect to CSR matrices. + +Args: + mat (Tensor): a dense matrix to be added + mat1 (Tensor): a sparse matrix to be multiplied + mat2 (Tensor): a dense matrix to be multiplied + beta (Number, optional): multiplier for :attr:`mat` (:math:`\beta`) + alpha (Number, optional): multiplier for :math:`mat1 @ mat2` (:math:`\alpha`) +""") + + +mm = _add_docstr(_sparse._sparse_mm, r""" + Performs a matrix multiplication of the sparse matrix :attr:`mat1` + and the (sparse or strided) matrix :attr:`mat2`. Similar to :func:`torch.mm`, if :attr:`mat1` is a + :math:`(n \times m)` tensor, :attr:`mat2` is a :math:`(m \times p)` tensor, out will be a + :math:`(n \times p)` tensor. + When :attr:`mat1` is a COO tensor it must have `sparse_dim = 2`. + When inputs are COO tensors, this function also supports backward for both inputs. + + Supports both CSR and COO storage formats. + +.. note:: + This function doesn't support computing derivaties with respect to CSR matrices. + + This function also additionally accepts an optional :attr:`reduce` argument that allows + specification of an optional reduction operation, mathematically performs the following operation: + +.. math:: + + z_{ij} = \bigoplus_{k = 0}^{K - 1} x_{ik} y_{kj} + +where :math:`\bigoplus` defines the reduce operator. :attr:`reduce` is implemented only for +CSR storage format on CPU device. + +Args: + mat1 (Tensor): the first sparse matrix to be multiplied + mat2 (Tensor): the second matrix to be multiplied, which could be sparse or dense + reduce (str, optional): the reduction operation to apply for non-unique indices + (:obj:`"sum"`, :obj:`"mean"`, :obj:`"amax"`, :obj:`"amin"`). Default :obj:`"sum"`. + +Shape: + The format of the output tensor of this function follows: + - sparse x sparse -> sparse + - sparse x dense -> dense + +Example:: + + >>> a = torch.tensor([[1., 0, 2], [0, 3, 0]]).to_sparse().requires_grad_() + >>> a + tensor(indices=tensor([[0, 0, 1], + [0, 2, 1]]), + values=tensor([1., 2., 3.]), + size=(2, 3), nnz=3, layout=torch.sparse_coo, requires_grad=True) + >>> b = torch.tensor([[0, 1.], [2, 0], [0, 0]], requires_grad=True) + >>> b + tensor([[0., 1.], + [2., 0.], + [0., 0.]], requires_grad=True) + >>> y = torch.sparse.mm(a, b) + >>> y + tensor([[0., 1.], + [6., 0.]], grad_fn=) + >>> y.sum().backward() + >>> a.grad + tensor(indices=tensor([[0, 0, 1], + [0, 2, 1]]), + values=tensor([1., 0., 2.]), + size=(2, 3), nnz=3, layout=torch.sparse_coo) + >>> c = a.detach().to_sparse_csr() + >>> c + tensor(crow_indices=tensor([0, 2, 3]), + col_indices=tensor([0, 2, 1]), + values=tensor([1., 2., 3.]), size=(2, 3), nnz=3, + layout=torch.sparse_csr) + >>> y1 = torch.sparse.mm(c, b, 'sum') + >>> y1 + tensor([[0., 1.], + [6., 0.]], grad_fn=) + >>> y2 = torch.sparse.mm(c, b, 'max') + >>> y2 + tensor([[0., 1.], + [6., 0.]], grad_fn=) +""") + + +sampled_addmm = _add_docstr(_sparse.sparse_sampled_addmm, r""" +sparse.sampled_addmm(input, mat1, mat2, *, beta=1., alpha=1., out=None) -> Tensor + +Performs a matrix multiplication of the dense matrices :attr:`mat1` and :attr:`mat2` at the locations +specified by the sparsity pattern of :attr:`input`. The matrix :attr:`input` is added to the final result. + +Mathematically this performs the following operation: + +.. math:: + + \text{out} = \alpha\ (\text{mat1} \mathbin{@} \text{mat2})*\text{spy}(\text{input}) + \beta\ \text{input} + +where :math:`\text{spy}(\text{input})` is the sparsity pattern matrix of :attr:`input`, :attr:`alpha` +and :attr:`beta` are the scaling factors. +:math:`\text{spy}(\text{input})` has value 1 at the positions where :attr:`input` has non-zero values, and 0 elsewhere. + +.. note:: + :attr:`input` must be a sparse CSR tensor. :attr:`mat1` and :attr:`mat2` must be dense tensors. + +Args: + input (Tensor): a sparse CSR matrix of shape `(m, n)` to be added and used to compute + the sampled matrix multiplication + mat1 (Tensor): a dense matrix of shape `(m, k)` to be multiplied + mat2 (Tensor): a dense matrix of shape `(k, n)` to be multiplied + +Keyword args: + beta (Number, optional): multiplier for :attr:`input` (:math:`\beta`) + alpha (Number, optional): multiplier for :math:`mat1 @ mat2` (:math:`\alpha`) + out (Tensor, optional): output tensor. Ignored if `None`. Default: `None`. + +Examples:: + + >>> input = torch.eye(3, device='cuda').to_sparse_csr() + >>> mat1 = torch.randn(3, 5, device='cuda') + >>> mat2 = torch.randn(5, 3, device='cuda') + >>> torch.sparse.sampled_addmm(input, mat1, mat2) + tensor(crow_indices=tensor([0, 1, 2, 3]), + col_indices=tensor([0, 1, 2]), + values=tensor([ 0.2847, -0.7805, -0.1900]), device='cuda:0', + size=(3, 3), nnz=3, layout=torch.sparse_csr) + >>> torch.sparse.sampled_addmm(input, mat1, mat2).to_dense() + tensor([[ 0.2847, 0.0000, 0.0000], + [ 0.0000, -0.7805, 0.0000], + [ 0.0000, 0.0000, -0.1900]], device='cuda:0') + >>> torch.sparse.sampled_addmm(input, mat1, mat2, beta=0.5, alpha=0.5) + tensor(crow_indices=tensor([0, 1, 2, 3]), + col_indices=tensor([0, 1, 2]), + values=tensor([ 0.1423, -0.3903, -0.0950]), device='cuda:0', + size=(3, 3), nnz=3, layout=torch.sparse_csr) +""") + +def sum(input: Tensor, dim: DimOrDims = None, + dtype: Optional[DType] = None) -> Tensor: + r"""Return the sum of each row of the given sparse tensor. + + Returns the sum of each row of the sparse tensor :attr:`input` in the given + dimensions :attr:`dim`. If :attr:`dim` is a list of dimensions, + reduce over all of them. When sum over all ``sparse_dim``, this method + returns a dense tensor instead of a sparse tensor. + + All summed :attr:`dim` are squeezed (see :func:`torch.squeeze`), resulting an output + tensor having :attr:`dim` fewer dimensions than :attr:`input`. + + During backward, only gradients at ``nnz`` locations of :attr:`input` + will propagate back. Note that the gradients of :attr:`input` is coalesced. + + Args: + input (Tensor): the input sparse tensor + dim (int or tuple of ints): a dimension or a list of dimensions to reduce. Default: reduce + over all dims. + dtype (:class:`torch.dtype`, optional): the desired data type of returned Tensor. + Default: dtype of :attr:`input`. + + Example:: + + >>> nnz = 3 + >>> dims = [5, 5, 2, 3] + >>> I = torch.cat([torch.randint(0, dims[0], size=(nnz,)), + torch.randint(0, dims[1], size=(nnz,))], 0).reshape(2, nnz) + >>> V = torch.randn(nnz, dims[2], dims[3]) + >>> size = torch.Size(dims) + >>> # xdoctest: +IGNORE_WANT("non-deterministic") + >>> S = torch.sparse_coo_tensor(I, V, size) + >>> S + tensor(indices=tensor([[2, 0, 3], + [2, 4, 1]]), + values=tensor([[[-0.6438, -1.6467, 1.4004], + [ 0.3411, 0.0918, -0.2312]], + + [[ 0.5348, 0.0634, -2.0494], + [-0.7125, -1.0646, 2.1844]], + + [[ 0.1276, 0.1874, -0.6334], + [-1.9682, -0.5340, 0.7483]]]), + size=(5, 5, 2, 3), nnz=3, layout=torch.sparse_coo) + + # when sum over only part of sparse_dims, return a sparse tensor + >>> torch.sparse.sum(S, [1, 3]) + tensor(indices=tensor([[0, 2, 3]]), + values=tensor([[-1.4512, 0.4073], + [-0.8901, 0.2017], + [-0.3183, -1.7539]]), + size=(5, 2), nnz=3, layout=torch.sparse_coo) + + # when sum over all sparse dim, return a dense tensor + # with summed dims squeezed + >>> torch.sparse.sum(S, [0, 1, 3]) + tensor([-2.6596, -1.1450]) + """ + if dtype is None: + if dim is not None: + return torch._sparse_sum(input, dim) + else: + return torch._sparse_sum(input) + else: + if dim is not None: + return torch._sparse_sum(input, dim, dtype=dtype) + else: + return torch._sparse_sum(input, dtype=dtype) + + +softmax = _add_docstr(_sparse._sparse_softmax, r""" +sparse.softmax(input, dim, *, dtype=None) -> Tensor + +Applies a softmax function. + +Softmax is defined as: + +:math:`\text{Softmax}(x_{i}) = \frac{exp(x_i)}{\sum_j exp(x_j)}` + +where :math:`i, j` run over sparse tensor indices and unspecified +entries are ignores. This is equivalent to defining unspecified +entries as negative infinity so that :math:`exp(x_k) = 0` when the +entry with index :math:`k` has not specified. + +It is applied to all slices along `dim`, and will re-scale them so +that the elements lie in the range `[0, 1]` and sum to 1. + +Args: + input (Tensor): input + dim (int): A dimension along which softmax will be computed. + dtype (:class:`torch.dtype`, optional): the desired data type + of returned tensor. If specified, the input tensor is + casted to :attr:`dtype` before the operation is + performed. This is useful for preventing data type + overflows. Default: None +""") + + +log_softmax = _add_docstr(_sparse._sparse_log_softmax, r""" +sparse.log_softmax(input, dim, *, dtype=None) -> Tensor + +Applies a softmax function followed by logarithm. + +See :class:`~torch.sparse.softmax` for more details. + +Args: + input (Tensor): input + dim (int): A dimension along which softmax will be computed. + dtype (:class:`torch.dtype`, optional): the desired data type + of returned tensor. If specified, the input tensor is + casted to :attr:`dtype` before the operation is + performed. This is useful for preventing data type + overflows. Default: None +""") + + +spdiags = _add_docstr( + _sparse._spdiags, + r""" +sparse.spdiags(diagonals, offsets, shape, layout=None) -> Tensor + +Creates a sparse 2D tensor by placing the values from rows of +:attr:`diagonals` along specified diagonals of the output + +The :attr:`offsets` tensor controls which diagonals are set. + +- If :attr:`offsets[i]` = 0, it is the main diagonal +- If :attr:`offsets[i]` < 0, it is below the main diagonal +- If :attr:`offsets[i]` > 0, it is above the main diagonal + +The number of rows in :attr:`diagonals` must match the length of :attr:`offsets`, +and an offset may not be repeated. + +Args: + diagonals (Tensor): Matrix storing diagonals row-wise + offsets (Tensor): The diagonals to be set, stored as a vector + shape (2-tuple of ints): The desired shape of the result +Keyword args: + layout (:class:`torch.layout`, optional): The desired layout of the + returned tensor. ``torch.sparse_coo``, ``torch.sparse_csc`` and ``torch.sparse_csr`` + are supported. Default: ``torch.sparse_coo`` + +Examples: + +Set the main and first two lower diagonals of a matrix:: + + >>> diags = torch.arange(9).reshape(3, 3) + >>> diags + tensor([[0, 1, 2], + [3, 4, 5], + [6, 7, 8]]) + >>> s = torch.sparse.spdiags(diags, torch.tensor([0, -1, -2]), (3, 3)) + >>> s + tensor(indices=tensor([[0, 1, 2, 1, 2, 2], + [0, 1, 2, 0, 1, 0]]), + values=tensor([0, 1, 2, 3, 4, 6]), + size=(3, 3), nnz=6, layout=torch.sparse_coo) + >>> s.to_dense() + tensor([[0, 0, 0], + [3, 1, 0], + [6, 4, 2]]) + + +Change the output layout:: + + >>> diags = torch.arange(9).reshape(3, 3) + >>> diags + tensor([[0, 1, 2],[3, 4, 5], [6, 7, 8]) + >>> s = torch.sparse.spdiags(diags, torch.tensor([0, -1, -2]), (3, 3), layout=torch.sparse_csr) + >>> s + tensor(crow_indices=tensor([0, 1, 3, 6]), + col_indices=tensor([0, 0, 1, 0, 1, 2]), + values=tensor([0, 3, 1, 6, 4, 2]), size=(3, 3), nnz=6, + layout=torch.sparse_csr) + >>> s.to_dense() + tensor([[0, 0, 0], + [3, 1, 0], + [6, 4, 2]]) + +Set partial diagonals of a large output:: + + >>> diags = torch.tensor([[1, 2], [3, 4]]) + >>> offsets = torch.tensor([0, -1]) + >>> torch.sparse.spdiags(diags, offsets, (5, 5)).to_dense() + tensor([[1, 0, 0, 0, 0], + [3, 2, 0, 0, 0], + [0, 4, 0, 0, 0], + [0, 0, 0, 0, 0], + [0, 0, 0, 0, 0]]) + +.. note:: + + When setting the values along a given diagonal the index into the diagonal + and the index into the row of :attr:`diagonals` is taken as the + column index in the output. This has the effect that when setting a diagonal + with a positive offset `k` the first value along that diagonal will be + the value in position `k` of the row of :attr:`diagonals` + +Specifying a positive offset:: + + >>> diags = torch.tensor([[1, 2, 3], [1, 2, 3], [1, 2, 3]]) + >>> torch.sparse.spdiags(diags, torch.tensor([0, 1, 2]), (5, 5)).to_dense() + tensor([[1, 2, 3, 0, 0], + [0, 2, 3, 0, 0], + [0, 0, 3, 0, 0], + [0, 0, 0, 0, 0], + [0, 0, 0, 0, 0]]) +""") + + +class check_sparse_tensor_invariants: + """A tool to control checking sparse tensor invariants. + + The following options exists to manage sparsr tensor invariants + checking in sparse tensor construction: + + 1. Using a context manager: + + .. code:: python + + with torch.sparse.check_sparse_tensor_invariants(): + run_my_model() + + 2. Using a procedural approach: + + .. code:: python + + prev_checks_enabled = torch.sparse.check_sparse_tensor_invariants.is_enabled() + torch.sparse.check_sparse_tensor_invariants.enable() + + run_my_model() + + if not prev_checks_enabled: + torch.sparse.check_sparse_tensor_invariants.disable() + + 3. Using function decoration: + + .. code:: python + + @torch.sparse.check_sparse_tensor_invariants() + def run_my_model(): + ... + + run_my_model() + + 4. Using ``check_invariants`` keyword argument in sparse tensor constructor call. + For example: + + >>> torch.sparse_csr_tensor([0, 1, 3], [0, 1], [1, 2], check_invariants=True) + Traceback (most recent call last): + File "", line 1, in + RuntimeError: `crow_indices[..., -1] == nnz` is not satisfied. + """ + + @staticmethod + def is_enabled(): + r"""Return True if the sparse tensor invariants checking is enabled. + + .. note:: + + Use :func:`torch.sparse.check_sparse_tensor_invariants.enable` or + :func:`torch.sparse.check_sparse_tensor_invariants.disable` to + manage the state of the sparse tensor invariants checks. + """ + return torch._C._check_sparse_tensor_invariants() + + @staticmethod + def enable(): + r"""Enable sparse tensor invariants checking in sparse tensor constructors. + + .. note:: + + By default, the sparse tensor invariants checks are disabled. Use + :func:`torch.sparse.check_sparse_tensor_invariants.is_enabled` to + retrieve the current state of sparse tensor invariants checking. + + .. note:: + + The sparse tensor invariants check flag is effective to all sparse + tensor constructors, both in Python and ATen. + + The flag can be locally overridden by the ``check_invariants`` + optional argument of the sparse tensor constructor functions. + """ + torch._C._set_check_sparse_tensor_invariants(True) + + @staticmethod + def disable(): + r"""Disable sparse tensor invariants checking in sparse tensor constructors. + + See :func:`torch.sparse.check_sparse_tensor_invariants.enable` for more information. + """ + torch._C._set_check_sparse_tensor_invariants(False) + + # context manager support + def __init__(self, enable=True): + self.state = enable + self.saved_state : Optional[bool] = None + + def __enter__(self): + if self.saved_state is not None: + raise RuntimeError('This context manager instance is already activated.' + ' Use a different context manager instance for context nesting.') + self.saved_state = self.is_enabled() + torch._C._set_check_sparse_tensor_invariants(self.state) + + def __exit__(self, type, value, traceback): + assert self.saved_state is not None + torch._C._set_check_sparse_tensor_invariants(self.saved_state) + self.saved_state = None + + # decorator support + def __call__(self, mth): + + def test_mth(*args, **kwargs): + with type(self)(self.state): + return mth(*args, **kwargs) + + return test_mth + + +def as_sparse_gradcheck(gradcheck): + """Decorate function, to extend gradcheck for sparse tensors. + + Decorator for torch.autograd.gradcheck or its functools.partial + variants that extends the gradcheck function with support to input + functions that operate on or/and return sparse tensors. + + The specified gradcheck function itself is guaranteed to operate + on strided tensors only. + + For example: + + >>> gradcheck = torch.sparse.as_sparse_gradcheck(torch.autograd.gradcheck) + >>> x = torch.tensor([[0, 1], [2, 3]], dtype=torch.float64).to_sparse_coo().requires_grad_(True) + >>> gradcheck(lambda x: x.to_sparse_csr(), x) + True + """ + + def gradcheck_with_sparse_support(func, inputs, **kwargs): + """ + Create gradcheck with support for sparse tensors. + + Same as :func:`torch.autograd.gradcheck` but with sparse tensors inputs and outputs support. + """ + masked = kwargs.pop('masked', False) + sparse_layouts = {torch.sparse_coo, torch.sparse_csr, torch.sparse_csc, torch.sparse_bsr, torch.sparse_bsc} + sparse_compressed_layouts = {torch.sparse_csr, torch.sparse_csc, torch.sparse_bsr, torch.sparse_bsc} + sparse_block_layouts = {torch.sparse_bsr, torch.sparse_bsc} + STRIDED_REPRESENTATION = '__STRIDED_REPRESENTATION__' + + def convert_to_strided_representation(args): + """Convert differentiable non-strided tensors to a representation containing differentiable strided tensors.""" + if not isinstance(args, (list, tuple)): + args = args, + new_args: List[Any] = [] + for obj in args: + if isinstance(obj, torch.Tensor) and obj.requires_grad and obj.layout in sparse_layouts: + d = dict(layout=obj.layout, shape=obj.shape) + if not masked: + # Materialize unspecified elements with zero values + batch_dim = obj.ndim - obj.dense_dim() - obj.sparse_dim() + blocksize = obj.values().shape[batch_dim + 1:batch_dim + 3] if obj.layout in sparse_block_layouts else None + full_mask = torch.ones(obj.shape, device=obj.device, dtype=torch.bool).to_sparse( + layout=obj.layout, blocksize=blocksize, dense_dim=obj.dense_dim()) + obj = obj.to_dense().sparse_mask(full_mask) + if obj.layout is torch.sparse_coo: + d.update(indices=obj._indices(), is_coalesced=obj.is_coalesced()) + values = obj._values() + elif obj.layout in {torch.sparse_csr, torch.sparse_bsr}: + d.update(compressed_indices=obj.crow_indices(), plain_indices=obj.col_indices()) + values = obj.values() + else: + d.update(compressed_indices=obj.ccol_indices(), plain_indices=obj.row_indices()) + values = obj.values() + new_args.extend((STRIDED_REPRESENTATION, d, values.requires_grad_(True))) + else: + new_args.append(obj) + return tuple(new_args) + + def restore_from_strided_representation(args): + """Restore non-strided differentiable tensosr from their strided representations.""" + new_args = [] + args = list(args) + while args: + a = args.pop(0) + if a == STRIDED_REPRESENTATION: + d, values = args.pop(0), args.pop(0) + if d['layout'] is torch.sparse_coo: + a = torch.sparse_coo_tensor(d['indices'], values, size=d['shape'], is_coalesced=d['is_coalesced']) + elif d['layout'] in sparse_compressed_layouts: + a = torch.sparse_compressed_tensor(d['compressed_indices'], d['plain_indices'], values, + size=d['shape'], layout=d['layout']) + else: + raise NotImplementedError(f'conversion of {d["layout"]} strided representation to tensor') + new_args.append(a) + return tuple(new_args) + + def func_wrapper(*args, **kwargs): + restored_args = restore_from_strided_representation(args) + + # convert differentiable output sparse tensors to strided + # tensors: + outputs = func(*restored_args, **kwargs) + + strided_outputs = tuple(outputs) if isinstance(outputs, (list, tuple)) else (outputs,) + strided_outputs = tuple((o.to_dense(masked_grad=masked) + if isinstance(o, torch.Tensor) and o.requires_grad and o.layout in sparse_layouts else o) + for o in strided_outputs) + + return strided_outputs if isinstance(outputs, (list, tuple)) else strided_outputs[0] + + args = (func_wrapper, convert_to_strided_representation(inputs)) + + return gradcheck(*args, **kwargs) + + return gradcheck_with_sparse_support diff --git a/shared/package-files/9f/9f7d03571efc3a1d330c8b6329da83689a625d2c953ea1d81a4eb76b5fb93598/blob b/shared/package-files/9f/9f7d03571efc3a1d330c8b6329da83689a625d2c953ea1d81a4eb76b5fb93598/blob new file mode 100644 index 0000000000000000000000000000000000000000..30d46aa3f4465f31b32e5f13f0b01b940981d489 --- /dev/null +++ b/shared/package-files/9f/9f7d03571efc3a1d330c8b6329da83689a625d2c953ea1d81a4eb76b5fb93598/blob @@ -0,0 +1,1154 @@ +""" +Python wrappers for Orthogonal Distance Regression (ODRPACK). + +Notes +===== + +* Array formats -- FORTRAN stores its arrays in memory column first, i.e., an + array element A(i, j, k) will be next to A(i+1, j, k). In C and, consequently, + NumPy, arrays are stored row first: A[i, j, k] is next to A[i, j, k+1]. For + efficiency and convenience, the input and output arrays of the fitting + function (and its Jacobians) are passed to FORTRAN without transposition. + Therefore, where the ODRPACK documentation says that the X array is of shape + (N, M), it will be passed to the Python function as an array of shape (M, N). + If M==1, the 1-D case, then nothing matters; if M>1, then your + Python functions will be dealing with arrays that are indexed in reverse of + the ODRPACK documentation. No real issue, but watch out for your indexing of + the Jacobians: the i,jth elements (@f_i/@x_j) evaluated at the nth + observation will be returned as jacd[j, i, n]. Except for the Jacobians, it + really is easier to deal with x[0] and x[1] than x[:,0] and x[:,1]. Of course, + you can always use the transpose() function from SciPy explicitly. + +* Examples -- See the accompanying file test/test.py for examples of how to set + up fits of your own. Some are taken from the User's Guide; some are from + other sources. + +* Models -- Some common models are instantiated in the accompanying module + models.py . Contributions are welcome. + +Credits +======= + +* Thanks to Arnold Moene and Gerard Vermeulen for fixing some killer bugs. + +Robert Kern +robert.kern@gmail.com + +""" +import os +from threading import Lock + +import numpy as np +from warnings import warn +from scipy.odr import __odrpack + +__all__ = ['odr', 'OdrWarning', 'OdrError', 'OdrStop', + 'Data', 'RealData', 'Model', 'Output', 'ODR', + 'odr_error', 'odr_stop'] + +odr = __odrpack.odr +ODR_LOCK = Lock() + + +class OdrWarning(UserWarning): + """ + Warning indicating that the data passed into + ODR will cause problems when passed into 'odr' + that the user should be aware of. + """ + pass + + +class OdrError(Exception): + """ + Exception indicating an error in fitting. + + This is raised by `~scipy.odr.odr` if an error occurs during fitting. + """ + pass + + +class OdrStop(Exception): + """ + Exception stopping fitting. + + You can raise this exception in your objective function to tell + `~scipy.odr.odr` to stop fitting. + """ + pass + + +# Backwards compatibility +odr_error = OdrError +odr_stop = OdrStop + +__odrpack._set_exceptions(OdrError, OdrStop) + + +def _conv(obj, dtype=None): + """ Convert an object to the preferred form for input to the odr routine. + """ + + if obj is None: + return obj + else: + if dtype is None: + obj = np.asarray(obj) + else: + obj = np.asarray(obj, dtype) + if obj.shape == (): + # Scalar. + return obj.dtype.type(obj) + else: + return obj + + +def _report_error(info): + """ Interprets the return code of the odr routine. + + Parameters + ---------- + info : int + The return code of the odr routine. + + Returns + ------- + problems : list(str) + A list of messages about why the odr() routine stopped. + """ + + stopreason = ('Blank', + 'Sum of squares convergence', + 'Parameter convergence', + 'Both sum of squares and parameter convergence', + 'Iteration limit reached')[info % 5] + + if info >= 5: + # questionable results or fatal error + + I = (info//10000 % 10, + info//1000 % 10, + info//100 % 10, + info//10 % 10, + info % 10) + problems = [] + + if I[0] == 0: + if I[1] != 0: + problems.append('Derivatives possibly not correct') + if I[2] != 0: + problems.append('Error occurred in callback') + if I[3] != 0: + problems.append('Problem is not full rank at solution') + problems.append(stopreason) + elif I[0] == 1: + if I[1] != 0: + problems.append('N < 1') + if I[2] != 0: + problems.append('M < 1') + if I[3] != 0: + problems.append('NP < 1 or NP > N') + if I[4] != 0: + problems.append('NQ < 1') + elif I[0] == 2: + if I[1] != 0: + problems.append('LDY and/or LDX incorrect') + if I[2] != 0: + problems.append('LDWE, LD2WE, LDWD, and/or LD2WD incorrect') + if I[3] != 0: + problems.append('LDIFX, LDSTPD, and/or LDSCLD incorrect') + if I[4] != 0: + problems.append('LWORK and/or LIWORK too small') + elif I[0] == 3: + if I[1] != 0: + problems.append('STPB and/or STPD incorrect') + if I[2] != 0: + problems.append('SCLB and/or SCLD incorrect') + if I[3] != 0: + problems.append('WE incorrect') + if I[4] != 0: + problems.append('WD incorrect') + elif I[0] == 4: + problems.append('Error in derivatives') + elif I[0] == 5: + problems.append('Error occurred in callback') + elif I[0] == 6: + problems.append('Numerical error detected') + + return problems + + else: + return [stopreason] + + +class Data: + """ + The data to fit. + + Parameters + ---------- + x : array_like + Observed data for the independent variable of the regression + y : array_like, optional + If array-like, observed data for the dependent variable of the + regression. A scalar input implies that the model to be used on + the data is implicit. + we : array_like, optional + If `we` is a scalar, then that value is used for all data points (and + all dimensions of the response variable). + If `we` is a rank-1 array of length q (the dimensionality of the + response variable), then this vector is the diagonal of the covariant + weighting matrix for all data points. + If `we` is a rank-1 array of length n (the number of data points), then + the i'th element is the weight for the i'th response variable + observation (single-dimensional only). + If `we` is a rank-2 array of shape (q, q), then this is the full + covariant weighting matrix broadcast to each observation. + If `we` is a rank-2 array of shape (q, n), then `we[:,i]` is the + diagonal of the covariant weighting matrix for the i'th observation. + If `we` is a rank-3 array of shape (q, q, n), then `we[:,:,i]` is the + full specification of the covariant weighting matrix for each + observation. + If the fit is implicit, then only a positive scalar value is used. + wd : array_like, optional + If `wd` is a scalar, then that value is used for all data points + (and all dimensions of the input variable). If `wd` = 0, then the + covariant weighting matrix for each observation is set to the identity + matrix (so each dimension of each observation has the same weight). + If `wd` is a rank-1 array of length m (the dimensionality of the input + variable), then this vector is the diagonal of the covariant weighting + matrix for all data points. + If `wd` is a rank-1 array of length n (the number of data points), then + the i'th element is the weight for the ith input variable observation + (single-dimensional only). + If `wd` is a rank-2 array of shape (m, m), then this is the full + covariant weighting matrix broadcast to each observation. + If `wd` is a rank-2 array of shape (m, n), then `wd[:,i]` is the + diagonal of the covariant weighting matrix for the ith observation. + If `wd` is a rank-3 array of shape (m, m, n), then `wd[:,:,i]` is the + full specification of the covariant weighting matrix for each + observation. + fix : array_like of ints, optional + The `fix` argument is the same as ifixx in the class ODR. It is an + array of integers with the same shape as data.x that determines which + input observations are treated as fixed. One can use a sequence of + length m (the dimensionality of the input observations) to fix some + dimensions for all observations. A value of 0 fixes the observation, + a value > 0 makes it free. + meta : dict, optional + Free-form dictionary for metadata. + + Notes + ----- + Each argument is attached to the member of the instance of the same name. + The structures of `x` and `y` are described in the Model class docstring. + If `y` is an integer, then the Data instance can only be used to fit with + implicit models where the dimensionality of the response is equal to the + specified value of `y`. + + The `we` argument weights the effect a deviation in the response variable + has on the fit. The `wd` argument weights the effect a deviation in the + input variable has on the fit. To handle multidimensional inputs and + responses easily, the structure of these arguments has the n'th + dimensional axis first. These arguments heavily use the structured + arguments feature of ODRPACK to conveniently and flexibly support all + options. See the ODRPACK User's Guide for a full explanation of how these + weights are used in the algorithm. Basically, a higher value of the weight + for a particular data point makes a deviation at that point more + detrimental to the fit. + + """ + + def __init__(self, x, y=None, we=None, wd=None, fix=None, meta=None): + self.x = _conv(x) + + if not isinstance(self.x, np.ndarray): + raise ValueError("Expected an 'ndarray' of data for 'x', " + f"but instead got data of type '{type(self.x).__name__}'") + + self.y = _conv(y) + self.we = _conv(we) + self.wd = _conv(wd) + self.fix = _conv(fix) + self.meta = {} if meta is None else meta + + def set_meta(self, **kwds): + """ Update the metadata dictionary with the keywords and data provided + by keywords. + + Examples + -------- + :: + + data.set_meta(lab="Ph 7; Lab 26", title="Ag110 + Ag108 Decay") + """ + + self.meta.update(kwds) + + def __getattr__(self, attr): + """ Dispatch attribute access to the metadata dictionary. + """ + if attr != "meta" and attr in self.meta: + return self.meta[attr] + else: + raise AttributeError(f"'{attr}' not in metadata") + + +class RealData(Data): + """ + The data, with weightings as actual standard deviations and/or + covariances. + + Parameters + ---------- + x : array_like + Observed data for the independent variable of the regression + y : array_like, optional + If array-like, observed data for the dependent variable of the + regression. A scalar input implies that the model to be used on + the data is implicit. + sx : array_like, optional + Standard deviations of `x`. + `sx` are standard deviations of `x` and are converted to weights by + dividing 1.0 by their squares. + sy : array_like, optional + Standard deviations of `y`. + `sy` are standard deviations of `y` and are converted to weights by + dividing 1.0 by their squares. + covx : array_like, optional + Covariance of `x` + `covx` is an array of covariance matrices of `x` and are converted to + weights by performing a matrix inversion on each observation's + covariance matrix. + covy : array_like, optional + Covariance of `y` + `covy` is an array of covariance matrices and are converted to + weights by performing a matrix inversion on each observation's + covariance matrix. + fix : array_like, optional + The argument and member fix is the same as Data.fix and ODR.ifixx: + It is an array of integers with the same shape as `x` that + determines which input observations are treated as fixed. One can + use a sequence of length m (the dimensionality of the input + observations) to fix some dimensions for all observations. A value + of 0 fixes the observation, a value > 0 makes it free. + meta : dict, optional + Free-form dictionary for metadata. + + Notes + ----- + The weights `wd` and `we` are computed from provided values as follows: + + `sx` and `sy` are converted to weights by dividing 1.0 by their squares. + For example, ``wd = 1./np.power(`sx`, 2)``. + + `covx` and `covy` are arrays of covariance matrices and are converted to + weights by performing a matrix inversion on each observation's covariance + matrix. For example, ``we[i] = np.linalg.inv(covy[i])``. + + These arguments follow the same structured argument conventions as wd and + we only restricted by their natures: `sx` and `sy` can't be rank-3, but + `covx` and `covy` can be. + + Only set *either* `sx` or `covx` (not both). Setting both will raise an + exception. Same with `sy` and `covy`. + + """ + + def __init__(self, x, y=None, sx=None, sy=None, covx=None, covy=None, + fix=None, meta=None): + if (sx is not None) and (covx is not None): + raise ValueError("cannot set both sx and covx") + if (sy is not None) and (covy is not None): + raise ValueError("cannot set both sy and covy") + + # Set flags for __getattr__ + self._ga_flags = {} + if sx is not None: + self._ga_flags['wd'] = 'sx' + else: + self._ga_flags['wd'] = 'covx' + if sy is not None: + self._ga_flags['we'] = 'sy' + else: + self._ga_flags['we'] = 'covy' + + self.x = _conv(x) + + if not isinstance(self.x, np.ndarray): + raise ValueError("Expected an 'ndarray' of data for 'x', " + f"but instead got data of type '{type(self.x).__name__}'") + + self.y = _conv(y) + self.sx = _conv(sx) + self.sy = _conv(sy) + self.covx = _conv(covx) + self.covy = _conv(covy) + self.fix = _conv(fix) + self.meta = {} if meta is None else meta + + def _sd2wt(self, sd): + """ Convert standard deviation to weights. + """ + + return 1./np.power(sd, 2) + + def _cov2wt(self, cov): + """ Convert covariance matrix(-ices) to weights. + """ + + from scipy.linalg import inv + + if len(cov.shape) == 2: + return inv(cov) + else: + weights = np.zeros(cov.shape, float) + + for i in range(cov.shape[-1]): # n + weights[:,:,i] = inv(cov[:,:,i]) + + return weights + + def __getattr__(self, attr): + + if attr not in ('wd', 'we'): + if attr != "meta" and attr in self.meta: + return self.meta[attr] + else: + raise AttributeError(f"'{attr}' not in metadata") + else: + lookup_tbl = {('wd', 'sx'): (self._sd2wt, self.sx), + ('wd', 'covx'): (self._cov2wt, self.covx), + ('we', 'sy'): (self._sd2wt, self.sy), + ('we', 'covy'): (self._cov2wt, self.covy)} + + func, arg = lookup_tbl[(attr, self._ga_flags[attr])] + + if arg is not None: + return func(*(arg,)) + else: + return None + + +class Model: + """ + The Model class stores information about the function you wish to fit. + + It stores the function itself, at the least, and optionally stores + functions which compute the Jacobians used during fitting. Also, one + can provide a function that will provide reasonable starting values + for the fit parameters possibly given the set of data. + + Parameters + ---------- + fcn : function + fcn(beta, x) --> y + fjacb : function + Jacobian of fcn wrt the fit parameters beta. + + fjacb(beta, x) --> @f_i(x,B)/@B_j + fjacd : function + Jacobian of fcn wrt the (possibly multidimensional) input + variable. + + fjacd(beta, x) --> @f_i(x,B)/@x_j + extra_args : tuple, optional + If specified, `extra_args` should be a tuple of extra + arguments to pass to `fcn`, `fjacb`, and `fjacd`. Each will be called + by `apply(fcn, (beta, x) + extra_args)` + estimate : array_like of rank-1 + Provides estimates of the fit parameters from the data + + estimate(data) --> estbeta + implicit : boolean + If TRUE, specifies that the model + is implicit; i.e `fcn(beta, x)` ~= 0 and there is no y data to fit + against + meta : dict, optional + freeform dictionary of metadata for the model + + Notes + ----- + Note that the `fcn`, `fjacb`, and `fjacd` operate on NumPy arrays and + return a NumPy array. The `estimate` object takes an instance of the + Data class. + + Here are the rules for the shapes of the argument and return + arrays of the callback functions: + + `x` + if the input data is single-dimensional, then `x` is rank-1 + array; i.e., ``x = array([1, 2, 3, ...]); x.shape = (n,)`` + If the input data is multi-dimensional, then `x` is a rank-2 array; + i.e., ``x = array([[1, 2, ...], [2, 4, ...]]); x.shape = (m, n)``. + In all cases, it has the same shape as the input data array passed to + `~scipy.odr.odr`. `m` is the dimensionality of the input data, + `n` is the number of observations. + `y` + if the response variable is single-dimensional, then `y` is a + rank-1 array, i.e., ``y = array([2, 4, ...]); y.shape = (n,)``. + If the response variable is multi-dimensional, then `y` is a rank-2 + array, i.e., ``y = array([[2, 4, ...], [3, 6, ...]]); y.shape = + (q, n)`` where `q` is the dimensionality of the response variable. + `beta` + rank-1 array of length `p` where `p` is the number of parameters; + i.e. ``beta = array([B_1, B_2, ..., B_p])`` + `fjacb` + if the response variable is multi-dimensional, then the + return array's shape is ``(q, p, n)`` such that ``fjacb(x,beta)[l,k,i] = + d f_l(X,B)/d B_k`` evaluated at the ith data point. If ``q == 1``, then + the return array is only rank-2 and with shape ``(p, n)``. + `fjacd` + as with fjacb, only the return array's shape is ``(q, m, n)`` + such that ``fjacd(x,beta)[l,j,i] = d f_l(X,B)/d X_j`` at the ith data + point. If ``q == 1``, then the return array's shape is ``(m, n)``. If + ``m == 1``, the shape is (q, n). If `m == q == 1`, the shape is ``(n,)``. + + """ + + def __init__(self, fcn, fjacb=None, fjacd=None, + extra_args=None, estimate=None, implicit=0, meta=None): + + self.fcn = fcn + self.fjacb = fjacb + self.fjacd = fjacd + + if extra_args is not None: + extra_args = tuple(extra_args) + + self.extra_args = extra_args + self.estimate = estimate + self.implicit = implicit + self.meta = meta if meta is not None else {} + + def set_meta(self, **kwds): + """ Update the metadata dictionary with the keywords and data provided + here. + + Examples + -------- + set_meta(name="Exponential", equation="y = a exp(b x) + c") + """ + + self.meta.update(kwds) + + def __getattr__(self, attr): + """ Dispatch attribute access to the metadata. + """ + + if attr != "meta" and attr in self.meta: + return self.meta[attr] + else: + raise AttributeError(f"'{attr}' not in metadata") + + +class Output: + """ + The Output class stores the output of an ODR run. + + Attributes + ---------- + beta : ndarray + Estimated parameter values, of shape (q,). + sd_beta : ndarray + Standard deviations of the estimated parameters, of shape (p,). + cov_beta : ndarray + Covariance matrix of the estimated parameters, of shape (p,p). + Note that this `cov_beta` is not scaled by the residual variance + `res_var`, whereas `sd_beta` is. This means + ``np.sqrt(np.diag(output.cov_beta * output.res_var))`` is the same + result as `output.sd_beta`. + delta : ndarray, optional + Array of estimated errors in input variables, of same shape as `x`. + eps : ndarray, optional + Array of estimated errors in response variables, of same shape as `y`. + xplus : ndarray, optional + Array of ``x + delta``. + y : ndarray, optional + Array ``y = fcn(x + delta)``. + res_var : float, optional + Residual variance. + sum_square : float, optional + Sum of squares error. + sum_square_delta : float, optional + Sum of squares of delta error. + sum_square_eps : float, optional + Sum of squares of eps error. + inv_condnum : float, optional + Inverse condition number (cf. ODRPACK UG p. 77). + rel_error : float, optional + Relative error in function values computed within fcn. + work : ndarray, optional + Final work array. + work_ind : dict, optional + Indices into work for drawing out values (cf. ODRPACK UG p. 83). + info : int, optional + Reason for returning, as output by ODRPACK (cf. ODRPACK UG p. 38). + stopreason : list of str, optional + `info` interpreted into English. + + Notes + ----- + Takes one argument for initialization, the return value from the + function `~scipy.odr.odr`. The attributes listed as "optional" above are + only present if `~scipy.odr.odr` was run with ``full_output=1``. + + """ + + def __init__(self, output): + self.beta = output[0] + self.sd_beta = output[1] + self.cov_beta = output[2] + + if len(output) == 4: + # full output + self.__dict__.update(output[3]) + self.stopreason = _report_error(self.info) + + def pprint(self): + """ Pretty-print important results. + """ + + print('Beta:', self.beta) + print('Beta Std Error:', self.sd_beta) + print('Beta Covariance:', self.cov_beta) + if hasattr(self, 'info'): + print('Residual Variance:',self.res_var) + print('Inverse Condition #:', self.inv_condnum) + print('Reason(s) for Halting:') + for r in self.stopreason: + print(f' {r}') + + +class ODR: + """ + The ODR class gathers all information and coordinates the running of the + main fitting routine. + + Members of instances of the ODR class have the same names as the arguments + to the initialization routine. + + Parameters + ---------- + data : Data class instance + instance of the Data class + model : Model class instance + instance of the Model class + + Other Parameters + ---------------- + beta0 : array_like of rank-1 + a rank-1 sequence of initial parameter values. Optional if + model provides an "estimate" function to estimate these values. + delta0 : array_like of floats of rank-1, optional + a (double-precision) float array to hold the initial values of + the errors in the input variables. Must be same shape as data.x + ifixb : array_like of ints of rank-1, optional + sequence of integers with the same length as beta0 that determines + which parameters are held fixed. A value of 0 fixes the parameter, + a value > 0 makes the parameter free. + ifixx : array_like of ints with same shape as data.x, optional + an array of integers with the same shape as data.x that determines + which input observations are treated as fixed. One can use a sequence + of length m (the dimensionality of the input observations) to fix some + dimensions for all observations. A value of 0 fixes the observation, + a value > 0 makes it free. + job : int, optional + an integer telling ODRPACK what tasks to perform. See p. 31 of the + ODRPACK User's Guide if you absolutely must set the value here. Use the + method set_job post-initialization for a more readable interface. + iprint : int, optional + an integer telling ODRPACK what to print. See pp. 33-34 of the + ODRPACK User's Guide if you absolutely must set the value here. Use the + method set_iprint post-initialization for a more readable interface. + errfile : str, optional + string with the filename to print ODRPACK errors to. If the file already + exists, an error will be thrown. The `overwrite` argument can be used to + prevent this. *Do Not Open This File Yourself!* + rptfile : str, optional + string with the filename to print ODRPACK summaries to. If the file + already exists, an error will be thrown. The `overwrite` argument can be + used to prevent this. *Do Not Open This File Yourself!* + ndigit : int, optional + integer specifying the number of reliable digits in the computation + of the function. + taufac : float, optional + float specifying the initial trust region. The default value is 1. + The initial trust region is equal to taufac times the length of the + first computed Gauss-Newton step. taufac must be less than 1. + sstol : float, optional + float specifying the tolerance for convergence based on the relative + change in the sum-of-squares. The default value is eps**(1/2) where eps + is the smallest value such that 1 + eps > 1 for double precision + computation on the machine. sstol must be less than 1. + partol : float, optional + float specifying the tolerance for convergence based on the relative + change in the estimated parameters. The default value is eps**(2/3) for + explicit models and ``eps**(1/3)`` for implicit models. partol must be less + than 1. + maxit : int, optional + integer specifying the maximum number of iterations to perform. For + first runs, maxit is the total number of iterations performed and + defaults to 50. For restarts, maxit is the number of additional + iterations to perform and defaults to 10. + stpb : array_like, optional + sequence (``len(stpb) == len(beta0)``) of relative step sizes to compute + finite difference derivatives wrt the parameters. + stpd : optional + array (``stpd.shape == data.x.shape`` or ``stpd.shape == (m,)``) of relative + step sizes to compute finite difference derivatives wrt the input + variable errors. If stpd is a rank-1 array with length m (the + dimensionality of the input variable), then the values are broadcast to + all observations. + sclb : array_like, optional + sequence (``len(stpb) == len(beta0)``) of scaling factors for the + parameters. The purpose of these scaling factors are to scale all of + the parameters to around unity. Normally appropriate scaling factors + are computed if this argument is not specified. Specify them yourself + if the automatic procedure goes awry. + scld : array_like, optional + array (scld.shape == data.x.shape or scld.shape == (m,)) of scaling + factors for the *errors* in the input variables. Again, these factors + are automatically computed if you do not provide them. If scld.shape == + (m,), then the scaling factors are broadcast to all observations. + work : ndarray, optional + array to hold the double-valued working data for ODRPACK. When + restarting, takes the value of self.output.work. + iwork : ndarray, optional + array to hold the integer-valued working data for ODRPACK. When + restarting, takes the value of self.output.iwork. + overwrite : bool, optional + If it is True, output files defined by `errfile` and `rptfile` are + overwritten. The default is False. + + Attributes + ---------- + data : Data + The data for this fit + model : Model + The model used in fit + output : Output + An instance if the Output class containing all of the returned + data from an invocation of ODR.run() or ODR.restart() + + """ + + def __init__(self, data, model, beta0=None, delta0=None, ifixb=None, + ifixx=None, job=None, iprint=None, errfile=None, rptfile=None, + ndigit=None, taufac=None, sstol=None, partol=None, maxit=None, + stpb=None, stpd=None, sclb=None, scld=None, work=None, iwork=None, + overwrite=False): + + self.data = data + self.model = model + + if beta0 is None: + if self.model.estimate is not None: + self.beta0 = _conv(self.model.estimate(self.data)) + else: + raise ValueError( + "must specify beta0 or provide an estimator with the model" + ) + else: + self.beta0 = _conv(beta0) + + if ifixx is None and data.fix is not None: + ifixx = data.fix + + if overwrite: + # remove output files for overwriting. + if rptfile is not None and os.path.exists(rptfile): + os.remove(rptfile) + if errfile is not None and os.path.exists(errfile): + os.remove(errfile) + + self.delta0 = _conv(delta0) + # These really are 32-bit integers in FORTRAN (gfortran), even on 64-bit + # platforms. + # XXX: some other FORTRAN compilers may not agree. + self.ifixx = _conv(ifixx, dtype=np.int32) + self.ifixb = _conv(ifixb, dtype=np.int32) + self.job = job + self.iprint = iprint + self.errfile = errfile + self.rptfile = rptfile + self.ndigit = ndigit + self.taufac = taufac + self.sstol = sstol + self.partol = partol + self.maxit = maxit + self.stpb = _conv(stpb) + self.stpd = _conv(stpd) + self.sclb = _conv(sclb) + self.scld = _conv(scld) + self.work = _conv(work) + self.iwork = _conv(iwork) + + self.output = None + + self._check() + + def _check(self): + """ Check the inputs for consistency, but don't bother checking things + that the builtin function odr will check. + """ + + x_s = list(self.data.x.shape) + + if isinstance(self.data.y, np.ndarray): + y_s = list(self.data.y.shape) + if self.model.implicit: + raise OdrError("an implicit model cannot use response data") + else: + # implicit model with q == self.data.y + y_s = [self.data.y, x_s[-1]] + if not self.model.implicit: + raise OdrError("an explicit model needs response data") + self.set_job(fit_type=1) + + if x_s[-1] != y_s[-1]: + raise OdrError("number of observations do not match") + + n = x_s[-1] + + if len(x_s) == 2: + m = x_s[0] + else: + m = 1 + if len(y_s) == 2: + q = y_s[0] + else: + q = 1 + + p = len(self.beta0) + + # permissible output array shapes + + fcn_perms = [(q, n)] + fjacd_perms = [(q, m, n)] + fjacb_perms = [(q, p, n)] + + if q == 1: + fcn_perms.append((n,)) + fjacd_perms.append((m, n)) + fjacb_perms.append((p, n)) + if m == 1: + fjacd_perms.append((q, n)) + if p == 1: + fjacb_perms.append((q, n)) + if m == q == 1: + fjacd_perms.append((n,)) + if p == q == 1: + fjacb_perms.append((n,)) + + # try evaluating the supplied functions to make sure they provide + # sensible outputs + + arglist = (self.beta0, self.data.x) + if self.model.extra_args is not None: + arglist = arglist + self.model.extra_args + res = self.model.fcn(*arglist) + + if res.shape not in fcn_perms: + print(res.shape) + print(fcn_perms) + raise OdrError(f"fcn does not output {y_s}-shaped array") + + if self.model.fjacd is not None: + res = self.model.fjacd(*arglist) + if res.shape not in fjacd_perms: + raise OdrError( + f"fjacd does not output {repr((q, m, n))}-shaped array") + if self.model.fjacb is not None: + res = self.model.fjacb(*arglist) + if res.shape not in fjacb_perms: + raise OdrError( + f"fjacb does not output {repr((q, p, n))}-shaped array") + + # check shape of delta0 + + if self.delta0 is not None and self.delta0.shape != self.data.x.shape: + raise OdrError( + f"delta0 is not a {repr(self.data.x.shape)}-shaped array") + + if self.data.x.size == 0: + warn("Empty data detected for ODR instance. " + "Do not expect any fitting to occur", + OdrWarning, stacklevel=3) + + def _gen_work(self): + """ Generate a suitable work array if one does not already exist. + """ + + n = self.data.x.shape[-1] + p = self.beta0.shape[0] + + if len(self.data.x.shape) == 2: + m = self.data.x.shape[0] + else: + m = 1 + + if self.model.implicit: + q = self.data.y + elif len(self.data.y.shape) == 2: + q = self.data.y.shape[0] + else: + q = 1 + + if self.data.we is None: + ldwe = ld2we = 1 + elif len(self.data.we.shape) == 3: + ld2we, ldwe = self.data.we.shape[1:] + else: + we = self.data.we + ldwe = 1 + ld2we = 1 + if we.ndim == 1 and q == 1: + ldwe = n + elif we.ndim == 2: + if we.shape == (q, q): + ld2we = q + elif we.shape == (q, n): + ldwe = n + + if self.job % 10 < 2: + # ODR not OLS + lwork = (18 + 11*p + p*p + m + m*m + 4*n*q + 6*n*m + 2*n*q*p + + 2*n*q*m + q*q + 5*q + q*(p+m) + ldwe*ld2we*q) + else: + # OLS not ODR + lwork = (18 + 11*p + p*p + m + m*m + 4*n*q + 2*n*m + 2*n*q*p + + 5*q + q*(p+m) + ldwe*ld2we*q) + + if isinstance(self.work, np.ndarray) and self.work.shape == (lwork,)\ + and self.work.dtype.str.endswith('f8'): + # the existing array is fine + return + else: + self.work = np.zeros((lwork,), float) + + def set_job(self, fit_type=None, deriv=None, var_calc=None, + del_init=None, restart=None): + """ + Sets the "job" parameter is a hopefully comprehensible way. + + If an argument is not specified, then the value is left as is. The + default value from class initialization is for all of these options set + to 0. + + Parameters + ---------- + fit_type : {0, 1, 2} int + 0 -> explicit ODR + + 1 -> implicit ODR + + 2 -> ordinary least-squares + deriv : {0, 1, 2, 3} int + 0 -> forward finite differences + + 1 -> central finite differences + + 2 -> user-supplied derivatives (Jacobians) with results + checked by ODRPACK + + 3 -> user-supplied derivatives, no checking + var_calc : {0, 1, 2} int + 0 -> calculate asymptotic covariance matrix and fit + parameter uncertainties (V_B, s_B) using derivatives + recomputed at the final solution + + 1 -> calculate V_B and s_B using derivatives from last iteration + + 2 -> do not calculate V_B and s_B + del_init : {0, 1} int + 0 -> initial input variable offsets set to 0 + + 1 -> initial offsets provided by user in variable "work" + restart : {0, 1} int + 0 -> fit is not a restart + + 1 -> fit is a restart + + Notes + ----- + The permissible values are different from those given on pg. 31 of the + ODRPACK User's Guide only in that one cannot specify numbers greater than + the last value for each variable. + + If one does not supply functions to compute the Jacobians, the fitting + procedure will change deriv to 0, finite differences, as a default. To + initialize the input variable offsets by yourself, set del_init to 1 and + put the offsets into the "work" variable correctly. + + """ + + if self.job is None: + job_l = [0, 0, 0, 0, 0] + else: + job_l = [self.job // 10000 % 10, + self.job // 1000 % 10, + self.job // 100 % 10, + self.job // 10 % 10, + self.job % 10] + + if fit_type in (0, 1, 2): + job_l[4] = fit_type + if deriv in (0, 1, 2, 3): + job_l[3] = deriv + if var_calc in (0, 1, 2): + job_l[2] = var_calc + if del_init in (0, 1): + job_l[1] = del_init + if restart in (0, 1): + job_l[0] = restart + + self.job = (job_l[0]*10000 + job_l[1]*1000 + + job_l[2]*100 + job_l[3]*10 + job_l[4]) + + def set_iprint(self, init=None, so_init=None, + iter=None, so_iter=None, iter_step=None, final=None, so_final=None): + """ Set the iprint parameter for the printing of computation reports. + + If any of the arguments are specified here, then they are set in the + iprint member. If iprint is not set manually or with this method, then + ODRPACK defaults to no printing. If no filename is specified with the + member rptfile, then ODRPACK prints to stdout. One can tell ODRPACK to + print to stdout in addition to the specified filename by setting the + so_* arguments to this function, but one cannot specify to print to + stdout but not a file since one can do that by not specifying a rptfile + filename. + + There are three reports: initialization, iteration, and final reports. + They are represented by the arguments init, iter, and final + respectively. The permissible values are 0, 1, and 2 representing "no + report", "short report", and "long report" respectively. + + The argument iter_step (0 <= iter_step <= 9) specifies how often to make + the iteration report; the report will be made for every iter_step'th + iteration starting with iteration one. If iter_step == 0, then no + iteration report is made, regardless of the other arguments. + + If the rptfile is None, then any so_* arguments supplied will raise an + exception. + """ + if self.iprint is None: + self.iprint = 0 + + ip = [self.iprint // 1000 % 10, + self.iprint // 100 % 10, + self.iprint // 10 % 10, + self.iprint % 10] + + # make a list to convert iprint digits to/from argument inputs + # rptfile, stdout + ip2arg = [[0, 0], # none, none + [1, 0], # short, none + [2, 0], # long, none + [1, 1], # short, short + [2, 1], # long, short + [1, 2], # short, long + [2, 2]] # long, long + + if (self.rptfile is None and + (so_init is not None or + so_iter is not None or + so_final is not None)): + raise OdrError( + "no rptfile specified, cannot output to stdout twice") + + iprint_l = ip2arg[ip[0]] + ip2arg[ip[1]] + ip2arg[ip[3]] + + if init is not None: + iprint_l[0] = init + if so_init is not None: + iprint_l[1] = so_init + if iter is not None: + iprint_l[2] = iter + if so_iter is not None: + iprint_l[3] = so_iter + if final is not None: + iprint_l[4] = final + if so_final is not None: + iprint_l[5] = so_final + + if iter_step in range(10): + # 0..9 + ip[2] = iter_step + + ip[0] = ip2arg.index(iprint_l[0:2]) + ip[1] = ip2arg.index(iprint_l[2:4]) + ip[3] = ip2arg.index(iprint_l[4:6]) + + self.iprint = ip[0]*1000 + ip[1]*100 + ip[2]*10 + ip[3] + + def run(self): + """ Run the fitting routine with all of the information given and with ``full_output=1``. + + Returns + ------- + output : Output instance + This object is also assigned to the attribute .output . + """ # noqa: E501 + + args = (self.model.fcn, self.beta0, self.data.y, self.data.x) + kwds = {'full_output': 1} + kwd_l = ['ifixx', 'ifixb', 'job', 'iprint', 'errfile', 'rptfile', + 'ndigit', 'taufac', 'sstol', 'partol', 'maxit', 'stpb', + 'stpd', 'sclb', 'scld', 'work', 'iwork'] + + if self.delta0 is not None and (self.job // 10000) % 10 == 0: + # delta0 provided and fit is not a restart + self._gen_work() + + d0 = np.ravel(self.delta0) + + self.work[:len(d0)] = d0 + + # set the kwds from other objects explicitly + if self.model.fjacb is not None: + kwds['fjacb'] = self.model.fjacb + if self.model.fjacd is not None: + kwds['fjacd'] = self.model.fjacd + if self.data.we is not None: + kwds['we'] = self.data.we + if self.data.wd is not None: + kwds['wd'] = self.data.wd + if self.model.extra_args is not None: + kwds['extra_args'] = self.model.extra_args + + # implicitly set kwds from self's members + for attr in kwd_l: + obj = getattr(self, attr) + if obj is not None: + kwds[attr] = obj + + with ODR_LOCK: + self.output = Output(odr(*args, **kwds)) + + return self.output + + def restart(self, iter=None): + """ Restarts the run with iter more iterations. + + Parameters + ---------- + iter : int, optional + ODRPACK's default for the number of new iterations is 10. + + Returns + ------- + output : Output instance + This object is also assigned to the attribute .output . + """ + + if self.output is None: + raise OdrError("cannot restart: run() has not been called before") + + self.set_job(restart=1) + self.work = self.output.work + self.iwork = self.output.iwork + + self.maxit = iter + + return self.run() diff --git a/shared/package-files/9f/9f8285f6f932f3fe6261e5dcc993c4bf3c8ba655a50ef14b90ce4923406cd3c0/blob b/shared/package-files/9f/9f8285f6f932f3fe6261e5dcc993c4bf3c8ba655a50ef14b90ce4923406cd3c0/blob new file mode 100644 index 0000000000000000000000000000000000000000..8b0a315f32466ac03a205898394f958f221818a7 --- /dev/null +++ b/shared/package-files/9f/9f8285f6f932f3fe6261e5dcc993c4bf3c8ba655a50ef14b90ce4923406cd3c0/blob @@ -0,0 +1,1702 @@ +import io +import sys +import typing +import warnings +from abc import ABC, abstractmethod +from collections import deque +from dataclasses import dataclass, field +from datetime import timedelta +from io import RawIOBase, UnsupportedOperation +from math import ceil +from mmap import mmap +from operator import length_hint +from os import PathLike, stat +from threading import Event, RLock, Thread +from types import TracebackType +from typing import ( + Any, + BinaryIO, + Callable, + ContextManager, + Deque, + Dict, + Generic, + Iterable, + List, + NamedTuple, + NewType, + Optional, + Sequence, + TextIO, + Tuple, + Type, + TypeVar, + Union, +) + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from pip._vendor.typing_extensions import Literal # pragma: no cover + +from . import filesize, get_console +from .console import Console, Group, JustifyMethod, RenderableType +from .highlighter import Highlighter +from .jupyter import JupyterMixin +from .live import Live +from .progress_bar import ProgressBar +from .spinner import Spinner +from .style import StyleType +from .table import Column, Table +from .text import Text, TextType + +TaskID = NewType("TaskID", int) + +ProgressType = TypeVar("ProgressType") + +GetTimeCallable = Callable[[], float] + + +_I = typing.TypeVar("_I", TextIO, BinaryIO) + + +class _TrackThread(Thread): + """A thread to periodically update progress.""" + + def __init__(self, progress: "Progress", task_id: "TaskID", update_period: float): + self.progress = progress + self.task_id = task_id + self.update_period = update_period + self.done = Event() + + self.completed = 0 + super().__init__() + + def run(self) -> None: + task_id = self.task_id + advance = self.progress.advance + update_period = self.update_period + last_completed = 0 + wait = self.done.wait + while not wait(update_period): + completed = self.completed + if last_completed != completed: + advance(task_id, completed - last_completed) + last_completed = completed + + self.progress.update(self.task_id, completed=self.completed, refresh=True) + + def __enter__(self) -> "_TrackThread": + self.start() + return self + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + self.done.set() + self.join() + + +def track( + sequence: Union[Sequence[ProgressType], Iterable[ProgressType]], + description: str = "Working...", + total: Optional[float] = None, + auto_refresh: bool = True, + console: Optional[Console] = None, + transient: bool = False, + get_time: Optional[Callable[[], float]] = None, + refresh_per_second: float = 10, + style: StyleType = "bar.back", + complete_style: StyleType = "bar.complete", + finished_style: StyleType = "bar.finished", + pulse_style: StyleType = "bar.pulse", + update_period: float = 0.1, + disable: bool = False, + show_speed: bool = True, +) -> Iterable[ProgressType]: + """Track progress by iterating over a sequence. + + Args: + sequence (Iterable[ProgressType]): A sequence (must support "len") you wish to iterate over. + description (str, optional): Description of task show next to progress bar. Defaults to "Working". + total: (float, optional): Total number of steps. Default is len(sequence). + auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True. + transient: (bool, optional): Clear the progress on exit. Defaults to False. + console (Console, optional): Console to write to. Default creates internal Console instance. + refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10. + style (StyleType, optional): Style for the bar background. Defaults to "bar.back". + complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete". + finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished". + pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse". + update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1. + disable (bool, optional): Disable display of progress. + show_speed (bool, optional): Show speed if total isn't known. Defaults to True. + Returns: + Iterable[ProgressType]: An iterable of the values in the sequence. + + """ + + columns: List["ProgressColumn"] = ( + [TextColumn("[progress.description]{task.description}")] if description else [] + ) + columns.extend( + ( + BarColumn( + style=style, + complete_style=complete_style, + finished_style=finished_style, + pulse_style=pulse_style, + ), + TaskProgressColumn(show_speed=show_speed), + TimeRemainingColumn(elapsed_when_finished=True), + ) + ) + progress = Progress( + *columns, + auto_refresh=auto_refresh, + console=console, + transient=transient, + get_time=get_time, + refresh_per_second=refresh_per_second or 10, + disable=disable, + ) + + with progress: + yield from progress.track( + sequence, total=total, description=description, update_period=update_period + ) + + +class _Reader(RawIOBase, BinaryIO): + """A reader that tracks progress while it's being read from.""" + + def __init__( + self, + handle: BinaryIO, + progress: "Progress", + task: TaskID, + close_handle: bool = True, + ) -> None: + self.handle = handle + self.progress = progress + self.task = task + self.close_handle = close_handle + self._closed = False + + def __enter__(self) -> "_Reader": + self.handle.__enter__() + return self + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + self.close() + + def __iter__(self) -> BinaryIO: + return self + + def __next__(self) -> bytes: + line = next(self.handle) + self.progress.advance(self.task, advance=len(line)) + return line + + @property + def closed(self) -> bool: + return self._closed + + def fileno(self) -> int: + return self.handle.fileno() + + def isatty(self) -> bool: + return self.handle.isatty() + + @property + def mode(self) -> str: + return self.handle.mode + + @property + def name(self) -> str: + return self.handle.name + + def readable(self) -> bool: + return self.handle.readable() + + def seekable(self) -> bool: + return self.handle.seekable() + + def writable(self) -> bool: + return False + + def read(self, size: int = -1) -> bytes: + block = self.handle.read(size) + self.progress.advance(self.task, advance=len(block)) + return block + + def readinto(self, b: Union[bytearray, memoryview, mmap]): # type: ignore[no-untyped-def, override] + n = self.handle.readinto(b) # type: ignore[attr-defined] + self.progress.advance(self.task, advance=n) + return n + + def readline(self, size: int = -1) -> bytes: # type: ignore[override] + line = self.handle.readline(size) + self.progress.advance(self.task, advance=len(line)) + return line + + def readlines(self, hint: int = -1) -> List[bytes]: + lines = self.handle.readlines(hint) + self.progress.advance(self.task, advance=sum(map(len, lines))) + return lines + + def close(self) -> None: + if self.close_handle: + self.handle.close() + self._closed = True + + def seek(self, offset: int, whence: int = 0) -> int: + pos = self.handle.seek(offset, whence) + self.progress.update(self.task, completed=pos) + return pos + + def tell(self) -> int: + return self.handle.tell() + + def write(self, s: Any) -> int: + raise UnsupportedOperation("write") + + +class _ReadContext(ContextManager[_I], Generic[_I]): + """A utility class to handle a context for both a reader and a progress.""" + + def __init__(self, progress: "Progress", reader: _I) -> None: + self.progress = progress + self.reader: _I = reader + + def __enter__(self) -> _I: + self.progress.start() + return self.reader.__enter__() + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + self.progress.stop() + self.reader.__exit__(exc_type, exc_val, exc_tb) + + +def wrap_file( + file: BinaryIO, + total: int, + *, + description: str = "Reading...", + auto_refresh: bool = True, + console: Optional[Console] = None, + transient: bool = False, + get_time: Optional[Callable[[], float]] = None, + refresh_per_second: float = 10, + style: StyleType = "bar.back", + complete_style: StyleType = "bar.complete", + finished_style: StyleType = "bar.finished", + pulse_style: StyleType = "bar.pulse", + disable: bool = False, +) -> ContextManager[BinaryIO]: + """Read bytes from a file while tracking progress. + + Args: + file (Union[str, PathLike[str], BinaryIO]): The path to the file to read, or a file-like object in binary mode. + total (int): Total number of bytes to read. + description (str, optional): Description of task show next to progress bar. Defaults to "Reading". + auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True. + transient: (bool, optional): Clear the progress on exit. Defaults to False. + console (Console, optional): Console to write to. Default creates internal Console instance. + refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10. + style (StyleType, optional): Style for the bar background. Defaults to "bar.back". + complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete". + finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished". + pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse". + disable (bool, optional): Disable display of progress. + Returns: + ContextManager[BinaryIO]: A context manager yielding a progress reader. + + """ + + columns: List["ProgressColumn"] = ( + [TextColumn("[progress.description]{task.description}")] if description else [] + ) + columns.extend( + ( + BarColumn( + style=style, + complete_style=complete_style, + finished_style=finished_style, + pulse_style=pulse_style, + ), + DownloadColumn(), + TimeRemainingColumn(), + ) + ) + progress = Progress( + *columns, + auto_refresh=auto_refresh, + console=console, + transient=transient, + get_time=get_time, + refresh_per_second=refresh_per_second or 10, + disable=disable, + ) + + reader = progress.wrap_file(file, total=total, description=description) + return _ReadContext(progress, reader) + + +@typing.overload +def open( + file: Union[str, "PathLike[str]", bytes], + mode: Union[Literal["rt"], Literal["r"]], + buffering: int = -1, + encoding: Optional[str] = None, + errors: Optional[str] = None, + newline: Optional[str] = None, + *, + total: Optional[int] = None, + description: str = "Reading...", + auto_refresh: bool = True, + console: Optional[Console] = None, + transient: bool = False, + get_time: Optional[Callable[[], float]] = None, + refresh_per_second: float = 10, + style: StyleType = "bar.back", + complete_style: StyleType = "bar.complete", + finished_style: StyleType = "bar.finished", + pulse_style: StyleType = "bar.pulse", + disable: bool = False, +) -> ContextManager[TextIO]: + pass + + +@typing.overload +def open( + file: Union[str, "PathLike[str]", bytes], + mode: Literal["rb"], + buffering: int = -1, + encoding: Optional[str] = None, + errors: Optional[str] = None, + newline: Optional[str] = None, + *, + total: Optional[int] = None, + description: str = "Reading...", + auto_refresh: bool = True, + console: Optional[Console] = None, + transient: bool = False, + get_time: Optional[Callable[[], float]] = None, + refresh_per_second: float = 10, + style: StyleType = "bar.back", + complete_style: StyleType = "bar.complete", + finished_style: StyleType = "bar.finished", + pulse_style: StyleType = "bar.pulse", + disable: bool = False, +) -> ContextManager[BinaryIO]: + pass + + +def open( + file: Union[str, "PathLike[str]", bytes], + mode: Union[Literal["rb"], Literal["rt"], Literal["r"]] = "r", + buffering: int = -1, + encoding: Optional[str] = None, + errors: Optional[str] = None, + newline: Optional[str] = None, + *, + total: Optional[int] = None, + description: str = "Reading...", + auto_refresh: bool = True, + console: Optional[Console] = None, + transient: bool = False, + get_time: Optional[Callable[[], float]] = None, + refresh_per_second: float = 10, + style: StyleType = "bar.back", + complete_style: StyleType = "bar.complete", + finished_style: StyleType = "bar.finished", + pulse_style: StyleType = "bar.pulse", + disable: bool = False, +) -> Union[ContextManager[BinaryIO], ContextManager[TextIO]]: + """Read bytes from a file while tracking progress. + + Args: + path (Union[str, PathLike[str], BinaryIO]): The path to the file to read, or a file-like object in binary mode. + mode (str): The mode to use to open the file. Only supports "r", "rb" or "rt". + buffering (int): The buffering strategy to use, see :func:`io.open`. + encoding (str, optional): The encoding to use when reading in text mode, see :func:`io.open`. + errors (str, optional): The error handling strategy for decoding errors, see :func:`io.open`. + newline (str, optional): The strategy for handling newlines in text mode, see :func:`io.open` + total: (int, optional): Total number of bytes to read. Must be provided if reading from a file handle. Default for a path is os.stat(file).st_size. + description (str, optional): Description of task show next to progress bar. Defaults to "Reading". + auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True. + transient: (bool, optional): Clear the progress on exit. Defaults to False. + console (Console, optional): Console to write to. Default creates internal Console instance. + refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10. + style (StyleType, optional): Style for the bar background. Defaults to "bar.back". + complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete". + finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished". + pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse". + disable (bool, optional): Disable display of progress. + encoding (str, optional): The encoding to use when reading in text mode. + + Returns: + ContextManager[BinaryIO]: A context manager yielding a progress reader. + + """ + + columns: List["ProgressColumn"] = ( + [TextColumn("[progress.description]{task.description}")] if description else [] + ) + columns.extend( + ( + BarColumn( + style=style, + complete_style=complete_style, + finished_style=finished_style, + pulse_style=pulse_style, + ), + DownloadColumn(), + TimeRemainingColumn(), + ) + ) + progress = Progress( + *columns, + auto_refresh=auto_refresh, + console=console, + transient=transient, + get_time=get_time, + refresh_per_second=refresh_per_second or 10, + disable=disable, + ) + + reader = progress.open( + file, + mode=mode, + buffering=buffering, + encoding=encoding, + errors=errors, + newline=newline, + total=total, + description=description, + ) + return _ReadContext(progress, reader) # type: ignore[return-value, type-var] + + +class ProgressColumn(ABC): + """Base class for a widget to use in progress display.""" + + max_refresh: Optional[float] = None + + def __init__(self, table_column: Optional[Column] = None) -> None: + self._table_column = table_column + self._renderable_cache: Dict[TaskID, Tuple[float, RenderableType]] = {} + self._update_time: Optional[float] = None + + def get_table_column(self) -> Column: + """Get a table column, used to build tasks table.""" + return self._table_column or Column() + + def __call__(self, task: "Task") -> RenderableType: + """Called by the Progress object to return a renderable for the given task. + + Args: + task (Task): An object containing information regarding the task. + + Returns: + RenderableType: Anything renderable (including str). + """ + current_time = task.get_time() + if self.max_refresh is not None and not task.completed: + try: + timestamp, renderable = self._renderable_cache[task.id] + except KeyError: + pass + else: + if timestamp + self.max_refresh > current_time: + return renderable + + renderable = self.render(task) + self._renderable_cache[task.id] = (current_time, renderable) + return renderable + + @abstractmethod + def render(self, task: "Task") -> RenderableType: + """Should return a renderable object.""" + + +class RenderableColumn(ProgressColumn): + """A column to insert an arbitrary column. + + Args: + renderable (RenderableType, optional): Any renderable. Defaults to empty string. + """ + + def __init__( + self, renderable: RenderableType = "", *, table_column: Optional[Column] = None + ): + self.renderable = renderable + super().__init__(table_column=table_column) + + def render(self, task: "Task") -> RenderableType: + return self.renderable + + +class SpinnerColumn(ProgressColumn): + """A column with a 'spinner' animation. + + Args: + spinner_name (str, optional): Name of spinner animation. Defaults to "dots". + style (StyleType, optional): Style of spinner. Defaults to "progress.spinner". + speed (float, optional): Speed factor of spinner. Defaults to 1.0. + finished_text (TextType, optional): Text used when task is finished. Defaults to " ". + """ + + def __init__( + self, + spinner_name: str = "dots", + style: Optional[StyleType] = "progress.spinner", + speed: float = 1.0, + finished_text: TextType = " ", + table_column: Optional[Column] = None, + ): + self.spinner = Spinner(spinner_name, style=style, speed=speed) + self.finished_text = ( + Text.from_markup(finished_text) + if isinstance(finished_text, str) + else finished_text + ) + super().__init__(table_column=table_column) + + def set_spinner( + self, + spinner_name: str, + spinner_style: Optional[StyleType] = "progress.spinner", + speed: float = 1.0, + ) -> None: + """Set a new spinner. + + Args: + spinner_name (str): Spinner name, see python -m rich.spinner. + spinner_style (Optional[StyleType], optional): Spinner style. Defaults to "progress.spinner". + speed (float, optional): Speed factor of spinner. Defaults to 1.0. + """ + self.spinner = Spinner(spinner_name, style=spinner_style, speed=speed) + + def render(self, task: "Task") -> RenderableType: + text = ( + self.finished_text + if task.finished + else self.spinner.render(task.get_time()) + ) + return text + + +class TextColumn(ProgressColumn): + """A column containing text.""" + + def __init__( + self, + text_format: str, + style: StyleType = "none", + justify: JustifyMethod = "left", + markup: bool = True, + highlighter: Optional[Highlighter] = None, + table_column: Optional[Column] = None, + ) -> None: + self.text_format = text_format + self.justify: JustifyMethod = justify + self.style = style + self.markup = markup + self.highlighter = highlighter + super().__init__(table_column=table_column or Column(no_wrap=True)) + + def render(self, task: "Task") -> Text: + _text = self.text_format.format(task=task) + if self.markup: + text = Text.from_markup(_text, style=self.style, justify=self.justify) + else: + text = Text(_text, style=self.style, justify=self.justify) + if self.highlighter: + self.highlighter.highlight(text) + return text + + +class BarColumn(ProgressColumn): + """Renders a visual progress bar. + + Args: + bar_width (Optional[int], optional): Width of bar or None for full width. Defaults to 40. + style (StyleType, optional): Style for the bar background. Defaults to "bar.back". + complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete". + finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished". + pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse". + """ + + def __init__( + self, + bar_width: Optional[int] = 40, + style: StyleType = "bar.back", + complete_style: StyleType = "bar.complete", + finished_style: StyleType = "bar.finished", + pulse_style: StyleType = "bar.pulse", + table_column: Optional[Column] = None, + ) -> None: + self.bar_width = bar_width + self.style = style + self.complete_style = complete_style + self.finished_style = finished_style + self.pulse_style = pulse_style + super().__init__(table_column=table_column) + + def render(self, task: "Task") -> ProgressBar: + """Gets a progress bar widget for a task.""" + return ProgressBar( + total=max(0, task.total) if task.total is not None else None, + completed=max(0, task.completed), + width=None if self.bar_width is None else max(1, self.bar_width), + pulse=not task.started, + animation_time=task.get_time(), + style=self.style, + complete_style=self.complete_style, + finished_style=self.finished_style, + pulse_style=self.pulse_style, + ) + + +class TimeElapsedColumn(ProgressColumn): + """Renders time elapsed.""" + + def render(self, task: "Task") -> Text: + """Show time elapsed.""" + elapsed = task.finished_time if task.finished else task.elapsed + if elapsed is None: + return Text("-:--:--", style="progress.elapsed") + delta = timedelta(seconds=int(elapsed)) + return Text(str(delta), style="progress.elapsed") + + +class TaskProgressColumn(TextColumn): + """Show task progress as a percentage. + + Args: + text_format (str, optional): Format for percentage display. Defaults to "[progress.percentage]{task.percentage:>3.0f}%". + text_format_no_percentage (str, optional): Format if percentage is unknown. Defaults to "". + style (StyleType, optional): Style of output. Defaults to "none". + justify (JustifyMethod, optional): Text justification. Defaults to "left". + markup (bool, optional): Enable markup. Defaults to True. + highlighter (Optional[Highlighter], optional): Highlighter to apply to output. Defaults to None. + table_column (Optional[Column], optional): Table Column to use. Defaults to None. + show_speed (bool, optional): Show speed if total is unknown. Defaults to False. + """ + + def __init__( + self, + text_format: str = "[progress.percentage]{task.percentage:>3.0f}%", + text_format_no_percentage: str = "", + style: StyleType = "none", + justify: JustifyMethod = "left", + markup: bool = True, + highlighter: Optional[Highlighter] = None, + table_column: Optional[Column] = None, + show_speed: bool = False, + ) -> None: + + self.text_format_no_percentage = text_format_no_percentage + self.show_speed = show_speed + super().__init__( + text_format=text_format, + style=style, + justify=justify, + markup=markup, + highlighter=highlighter, + table_column=table_column, + ) + + @classmethod + def render_speed(cls, speed: Optional[float]) -> Text: + """Render the speed in iterations per second. + + Args: + task (Task): A Task object. + + Returns: + Text: Text object containing the task speed. + """ + if speed is None: + return Text("", style="progress.percentage") + unit, suffix = filesize.pick_unit_and_suffix( + int(speed), + ["", "×10³", "×10⁶", "×10⁹", "×10¹²"], + 1000, + ) + data_speed = speed / unit + return Text(f"{data_speed:.1f}{suffix} it/s", style="progress.percentage") + + def render(self, task: "Task") -> Text: + if task.total is None and self.show_speed: + return self.render_speed(task.finished_speed or task.speed) + text_format = ( + self.text_format_no_percentage if task.total is None else self.text_format + ) + _text = text_format.format(task=task) + if self.markup: + text = Text.from_markup(_text, style=self.style, justify=self.justify) + else: + text = Text(_text, style=self.style, justify=self.justify) + if self.highlighter: + self.highlighter.highlight(text) + return text + + +class TimeRemainingColumn(ProgressColumn): + """Renders estimated time remaining. + + Args: + compact (bool, optional): Render MM:SS when time remaining is less than an hour. Defaults to False. + elapsed_when_finished (bool, optional): Render time elapsed when the task is finished. Defaults to False. + """ + + # Only refresh twice a second to prevent jitter + max_refresh = 0.5 + + def __init__( + self, + compact: bool = False, + elapsed_when_finished: bool = False, + table_column: Optional[Column] = None, + ): + self.compact = compact + self.elapsed_when_finished = elapsed_when_finished + super().__init__(table_column=table_column) + + def render(self, task: "Task") -> Text: + """Show time remaining.""" + if self.elapsed_when_finished and task.finished: + task_time = task.finished_time + style = "progress.elapsed" + else: + task_time = task.time_remaining + style = "progress.remaining" + + if task.total is None: + return Text("", style=style) + + if task_time is None: + return Text("--:--" if self.compact else "-:--:--", style=style) + + # Based on https://github.com/tqdm/tqdm/blob/master/tqdm/std.py + minutes, seconds = divmod(int(task_time), 60) + hours, minutes = divmod(minutes, 60) + + if self.compact and not hours: + formatted = f"{minutes:02d}:{seconds:02d}" + else: + formatted = f"{hours:d}:{minutes:02d}:{seconds:02d}" + + return Text(formatted, style=style) + + +class FileSizeColumn(ProgressColumn): + """Renders completed filesize.""" + + def render(self, task: "Task") -> Text: + """Show data completed.""" + data_size = filesize.decimal(int(task.completed)) + return Text(data_size, style="progress.filesize") + + +class TotalFileSizeColumn(ProgressColumn): + """Renders total filesize.""" + + def render(self, task: "Task") -> Text: + """Show data completed.""" + data_size = filesize.decimal(int(task.total)) if task.total is not None else "" + return Text(data_size, style="progress.filesize.total") + + +class MofNCompleteColumn(ProgressColumn): + """Renders completed count/total, e.g. ' 10/1000'. + + Best for bounded tasks with int quantities. + + Space pads the completed count so that progress length does not change as task progresses + past powers of 10. + + Args: + separator (str, optional): Text to separate completed and total values. Defaults to "/". + """ + + def __init__(self, separator: str = "/", table_column: Optional[Column] = None): + self.separator = separator + super().__init__(table_column=table_column) + + def render(self, task: "Task") -> Text: + """Show completed/total.""" + completed = int(task.completed) + total = int(task.total) if task.total is not None else "?" + total_width = len(str(total)) + return Text( + f"{completed:{total_width}d}{self.separator}{total}", + style="progress.download", + ) + + +class DownloadColumn(ProgressColumn): + """Renders file size downloaded and total, e.g. '0.5/2.3 GB'. + + Args: + binary_units (bool, optional): Use binary units, KiB, MiB etc. Defaults to False. + """ + + def __init__( + self, binary_units: bool = False, table_column: Optional[Column] = None + ) -> None: + self.binary_units = binary_units + super().__init__(table_column=table_column) + + def render(self, task: "Task") -> Text: + """Calculate common unit for completed and total.""" + completed = int(task.completed) + + unit_and_suffix_calculation_base = ( + int(task.total) if task.total is not None else completed + ) + if self.binary_units: + unit, suffix = filesize.pick_unit_and_suffix( + unit_and_suffix_calculation_base, + ["bytes", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"], + 1024, + ) + else: + unit, suffix = filesize.pick_unit_and_suffix( + unit_and_suffix_calculation_base, + ["bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], + 1000, + ) + precision = 0 if unit == 1 else 1 + + completed_ratio = completed / unit + completed_str = f"{completed_ratio:,.{precision}f}" + + if task.total is not None: + total = int(task.total) + total_ratio = total / unit + total_str = f"{total_ratio:,.{precision}f}" + else: + total_str = "?" + + download_status = f"{completed_str}/{total_str} {suffix}" + download_text = Text(download_status, style="progress.download") + return download_text + + +class TransferSpeedColumn(ProgressColumn): + """Renders human readable transfer speed.""" + + def render(self, task: "Task") -> Text: + """Show data transfer speed.""" + speed = task.finished_speed or task.speed + if speed is None: + return Text("?", style="progress.data.speed") + data_speed = filesize.decimal(int(speed)) + return Text(f"{data_speed}/s", style="progress.data.speed") + + +class ProgressSample(NamedTuple): + """Sample of progress for a given time.""" + + timestamp: float + """Timestamp of sample.""" + completed: float + """Number of steps completed.""" + + +@dataclass +class Task: + """Information regarding a progress task. + + This object should be considered read-only outside of the :class:`~Progress` class. + + """ + + id: TaskID + """Task ID associated with this task (used in Progress methods).""" + + description: str + """str: Description of the task.""" + + total: Optional[float] + """Optional[float]: Total number of steps in this task.""" + + completed: float + """float: Number of steps completed""" + + _get_time: GetTimeCallable + """Callable to get the current time.""" + + finished_time: Optional[float] = None + """float: Time task was finished.""" + + visible: bool = True + """bool: Indicates if this task is visible in the progress display.""" + + fields: Dict[str, Any] = field(default_factory=dict) + """dict: Arbitrary fields passed in via Progress.update.""" + + start_time: Optional[float] = field(default=None, init=False, repr=False) + """Optional[float]: Time this task was started, or None if not started.""" + + stop_time: Optional[float] = field(default=None, init=False, repr=False) + """Optional[float]: Time this task was stopped, or None if not stopped.""" + + finished_speed: Optional[float] = None + """Optional[float]: The last speed for a finished task.""" + + _progress: Deque[ProgressSample] = field( + default_factory=lambda: deque(maxlen=1000), init=False, repr=False + ) + + _lock: RLock = field(repr=False, default_factory=RLock) + """Thread lock.""" + + def get_time(self) -> float: + """float: Get the current time, in seconds.""" + return self._get_time() + + @property + def started(self) -> bool: + """bool: Check if the task as started.""" + return self.start_time is not None + + @property + def remaining(self) -> Optional[float]: + """Optional[float]: Get the number of steps remaining, if a non-None total was set.""" + if self.total is None: + return None + return self.total - self.completed + + @property + def elapsed(self) -> Optional[float]: + """Optional[float]: Time elapsed since task was started, or ``None`` if the task hasn't started.""" + if self.start_time is None: + return None + if self.stop_time is not None: + return self.stop_time - self.start_time + return self.get_time() - self.start_time + + @property + def finished(self) -> bool: + """Check if the task has finished.""" + return self.finished_time is not None + + @property + def percentage(self) -> float: + """float: Get progress of task as a percentage. If a None total was set, returns 0""" + if not self.total: + return 0.0 + completed = (self.completed / self.total) * 100.0 + completed = min(100.0, max(0.0, completed)) + return completed + + @property + def speed(self) -> Optional[float]: + """Optional[float]: Get the estimated speed in steps per second.""" + if self.start_time is None: + return None + with self._lock: + progress = self._progress + if not progress: + return None + total_time = progress[-1].timestamp - progress[0].timestamp + if total_time == 0: + return None + iter_progress = iter(progress) + next(iter_progress) + total_completed = sum(sample.completed for sample in iter_progress) + speed = total_completed / total_time + return speed + + @property + def time_remaining(self) -> Optional[float]: + """Optional[float]: Get estimated time to completion, or ``None`` if no data.""" + if self.finished: + return 0.0 + speed = self.speed + if not speed: + return None + remaining = self.remaining + if remaining is None: + return None + estimate = ceil(remaining / speed) + return estimate + + def _reset(self) -> None: + """Reset progress.""" + self._progress.clear() + self.finished_time = None + self.finished_speed = None + + +class Progress(JupyterMixin): + """Renders an auto-updating progress bar(s). + + Args: + console (Console, optional): Optional Console instance. Default will an internal Console instance writing to stdout. + auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()`. + refresh_per_second (Optional[float], optional): Number of times per second to refresh the progress information or None to use default (10). Defaults to None. + speed_estimate_period: (float, optional): Period (in seconds) used to calculate the speed estimate. Defaults to 30. + transient: (bool, optional): Clear the progress on exit. Defaults to False. + redirect_stdout: (bool, optional): Enable redirection of stdout, so ``print`` may be used. Defaults to True. + redirect_stderr: (bool, optional): Enable redirection of stderr. Defaults to True. + get_time: (Callable, optional): A callable that gets the current time, or None to use Console.get_time. Defaults to None. + disable (bool, optional): Disable progress display. Defaults to False + expand (bool, optional): Expand tasks table to fit width. Defaults to False. + """ + + def __init__( + self, + *columns: Union[str, ProgressColumn], + console: Optional[Console] = None, + auto_refresh: bool = True, + refresh_per_second: float = 10, + speed_estimate_period: float = 30.0, + transient: bool = False, + redirect_stdout: bool = True, + redirect_stderr: bool = True, + get_time: Optional[GetTimeCallable] = None, + disable: bool = False, + expand: bool = False, + ) -> None: + assert refresh_per_second > 0, "refresh_per_second must be > 0" + self._lock = RLock() + self.columns = columns or self.get_default_columns() + self.speed_estimate_period = speed_estimate_period + + self.disable = disable + self.expand = expand + self._tasks: Dict[TaskID, Task] = {} + self._task_index: TaskID = TaskID(0) + self.live = Live( + console=console or get_console(), + auto_refresh=auto_refresh, + refresh_per_second=refresh_per_second, + transient=transient, + redirect_stdout=redirect_stdout, + redirect_stderr=redirect_stderr, + get_renderable=self.get_renderable, + ) + self.get_time = get_time or self.console.get_time + self.print = self.console.print + self.log = self.console.log + + @classmethod + def get_default_columns(cls) -> Tuple[ProgressColumn, ...]: + """Get the default columns used for a new Progress instance: + - a text column for the description (TextColumn) + - the bar itself (BarColumn) + - a text column showing completion percentage (TextColumn) + - an estimated-time-remaining column (TimeRemainingColumn) + If the Progress instance is created without passing a columns argument, + the default columns defined here will be used. + + You can also create a Progress instance using custom columns before + and/or after the defaults, as in this example: + + progress = Progress( + SpinnerColumn(), + *Progress.default_columns(), + "Elapsed:", + TimeElapsedColumn(), + ) + + This code shows the creation of a Progress display, containing + a spinner to the left, the default columns, and a labeled elapsed + time column. + """ + return ( + TextColumn("[progress.description]{task.description}"), + BarColumn(), + TaskProgressColumn(), + TimeRemainingColumn(), + ) + + @property + def console(self) -> Console: + return self.live.console + + @property + def tasks(self) -> List[Task]: + """Get a list of Task instances.""" + with self._lock: + return list(self._tasks.values()) + + @property + def task_ids(self) -> List[TaskID]: + """A list of task IDs.""" + with self._lock: + return list(self._tasks.keys()) + + @property + def finished(self) -> bool: + """Check if all tasks have been completed.""" + with self._lock: + if not self._tasks: + return True + return all(task.finished for task in self._tasks.values()) + + def start(self) -> None: + """Start the progress display.""" + if not self.disable: + self.live.start(refresh=True) + + def stop(self) -> None: + """Stop the progress display.""" + self.live.stop() + if not self.console.is_interactive: + self.console.print() + + def __enter__(self) -> "Progress": + self.start() + return self + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + self.stop() + + def track( + self, + sequence: Union[Iterable[ProgressType], Sequence[ProgressType]], + total: Optional[float] = None, + task_id: Optional[TaskID] = None, + description: str = "Working...", + update_period: float = 0.1, + ) -> Iterable[ProgressType]: + """Track progress by iterating over a sequence. + + Args: + sequence (Sequence[ProgressType]): A sequence of values you want to iterate over and track progress. + total: (float, optional): Total number of steps. Default is len(sequence). + task_id: (TaskID): Task to track. Default is new task. + description: (str, optional): Description of task, if new task is created. + update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1. + + Returns: + Iterable[ProgressType]: An iterable of values taken from the provided sequence. + """ + if total is None: + total = float(length_hint(sequence)) or None + + if task_id is None: + task_id = self.add_task(description, total=total) + else: + self.update(task_id, total=total) + + if self.live.auto_refresh: + with _TrackThread(self, task_id, update_period) as track_thread: + for value in sequence: + yield value + track_thread.completed += 1 + else: + advance = self.advance + refresh = self.refresh + for value in sequence: + yield value + advance(task_id, 1) + refresh() + + def wrap_file( + self, + file: BinaryIO, + total: Optional[int] = None, + *, + task_id: Optional[TaskID] = None, + description: str = "Reading...", + ) -> BinaryIO: + """Track progress file reading from a binary file. + + Args: + file (BinaryIO): A file-like object opened in binary mode. + total (int, optional): Total number of bytes to read. This must be provided unless a task with a total is also given. + task_id (TaskID): Task to track. Default is new task. + description (str, optional): Description of task, if new task is created. + + Returns: + BinaryIO: A readable file-like object in binary mode. + + Raises: + ValueError: When no total value can be extracted from the arguments or the task. + """ + # attempt to recover the total from the task + total_bytes: Optional[float] = None + if total is not None: + total_bytes = total + elif task_id is not None: + with self._lock: + total_bytes = self._tasks[task_id].total + if total_bytes is None: + raise ValueError( + f"unable to get the total number of bytes, please specify 'total'" + ) + + # update total of task or create new task + if task_id is None: + task_id = self.add_task(description, total=total_bytes) + else: + self.update(task_id, total=total_bytes) + + return _Reader(file, self, task_id, close_handle=False) + + @typing.overload + def open( + self, + file: Union[str, "PathLike[str]", bytes], + mode: Literal["rb"], + buffering: int = -1, + encoding: Optional[str] = None, + errors: Optional[str] = None, + newline: Optional[str] = None, + *, + total: Optional[int] = None, + task_id: Optional[TaskID] = None, + description: str = "Reading...", + ) -> BinaryIO: + pass + + @typing.overload + def open( + self, + file: Union[str, "PathLike[str]", bytes], + mode: Union[Literal["r"], Literal["rt"]], + buffering: int = -1, + encoding: Optional[str] = None, + errors: Optional[str] = None, + newline: Optional[str] = None, + *, + total: Optional[int] = None, + task_id: Optional[TaskID] = None, + description: str = "Reading...", + ) -> TextIO: + pass + + def open( + self, + file: Union[str, "PathLike[str]", bytes], + mode: Union[Literal["rb"], Literal["rt"], Literal["r"]] = "r", + buffering: int = -1, + encoding: Optional[str] = None, + errors: Optional[str] = None, + newline: Optional[str] = None, + *, + total: Optional[int] = None, + task_id: Optional[TaskID] = None, + description: str = "Reading...", + ) -> Union[BinaryIO, TextIO]: + """Track progress while reading from a binary file. + + Args: + path (Union[str, PathLike[str]]): The path to the file to read. + mode (str): The mode to use to open the file. Only supports "r", "rb" or "rt". + buffering (int): The buffering strategy to use, see :func:`io.open`. + encoding (str, optional): The encoding to use when reading in text mode, see :func:`io.open`. + errors (str, optional): The error handling strategy for decoding errors, see :func:`io.open`. + newline (str, optional): The strategy for handling newlines in text mode, see :func:`io.open`. + total (int, optional): Total number of bytes to read. If none given, os.stat(path).st_size is used. + task_id (TaskID): Task to track. Default is new task. + description (str, optional): Description of task, if new task is created. + + Returns: + BinaryIO: A readable file-like object in binary mode. + + Raises: + ValueError: When an invalid mode is given. + """ + # normalize the mode (always rb, rt) + _mode = "".join(sorted(mode, reverse=False)) + if _mode not in ("br", "rt", "r"): + raise ValueError("invalid mode {!r}".format(mode)) + + # patch buffering to provide the same behaviour as the builtin `open` + line_buffering = buffering == 1 + if _mode == "br" and buffering == 1: + warnings.warn( + "line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used", + RuntimeWarning, + ) + buffering = -1 + elif _mode in ("rt", "r"): + if buffering == 0: + raise ValueError("can't have unbuffered text I/O") + elif buffering == 1: + buffering = -1 + + # attempt to get the total with `os.stat` + if total is None: + total = stat(file).st_size + + # update total of task or create new task + if task_id is None: + task_id = self.add_task(description, total=total) + else: + self.update(task_id, total=total) + + # open the file in binary mode, + handle = io.open(file, "rb", buffering=buffering) + reader = _Reader(handle, self, task_id, close_handle=True) + + # wrap the reader in a `TextIOWrapper` if text mode + if mode in ("r", "rt"): + return io.TextIOWrapper( + reader, + encoding=encoding, + errors=errors, + newline=newline, + line_buffering=line_buffering, + ) + + return reader + + def start_task(self, task_id: TaskID) -> None: + """Start a task. + + Starts a task (used when calculating elapsed time). You may need to call this manually, + if you called ``add_task`` with ``start=False``. + + Args: + task_id (TaskID): ID of task. + """ + with self._lock: + task = self._tasks[task_id] + if task.start_time is None: + task.start_time = self.get_time() + + def stop_task(self, task_id: TaskID) -> None: + """Stop a task. + + This will freeze the elapsed time on the task. + + Args: + task_id (TaskID): ID of task. + """ + with self._lock: + task = self._tasks[task_id] + current_time = self.get_time() + if task.start_time is None: + task.start_time = current_time + task.stop_time = current_time + + def update( + self, + task_id: TaskID, + *, + total: Optional[float] = None, + completed: Optional[float] = None, + advance: Optional[float] = None, + description: Optional[str] = None, + visible: Optional[bool] = None, + refresh: bool = False, + **fields: Any, + ) -> None: + """Update information associated with a task. + + Args: + task_id (TaskID): Task id (returned by add_task). + total (float, optional): Updates task.total if not None. + completed (float, optional): Updates task.completed if not None. + advance (float, optional): Add a value to task.completed if not None. + description (str, optional): Change task description if not None. + visible (bool, optional): Set visible flag if not None. + refresh (bool): Force a refresh of progress information. Default is False. + **fields (Any): Additional data fields required for rendering. + """ + with self._lock: + task = self._tasks[task_id] + completed_start = task.completed + + if total is not None and total != task.total: + task.total = total + task._reset() + if advance is not None: + task.completed += advance + if completed is not None: + task.completed = completed + if description is not None: + task.description = description + if visible is not None: + task.visible = visible + task.fields.update(fields) + update_completed = task.completed - completed_start + + current_time = self.get_time() + old_sample_time = current_time - self.speed_estimate_period + _progress = task._progress + + popleft = _progress.popleft + while _progress and _progress[0].timestamp < old_sample_time: + popleft() + if update_completed > 0: + _progress.append(ProgressSample(current_time, update_completed)) + if ( + task.total is not None + and task.completed >= task.total + and task.finished_time is None + ): + task.finished_time = task.elapsed + + if refresh: + self.refresh() + + def reset( + self, + task_id: TaskID, + *, + start: bool = True, + total: Optional[float] = None, + completed: int = 0, + visible: Optional[bool] = None, + description: Optional[str] = None, + **fields: Any, + ) -> None: + """Reset a task so completed is 0 and the clock is reset. + + Args: + task_id (TaskID): ID of task. + start (bool, optional): Start the task after reset. Defaults to True. + total (float, optional): New total steps in task, or None to use current total. Defaults to None. + completed (int, optional): Number of steps completed. Defaults to 0. + visible (bool, optional): Enable display of the task. Defaults to True. + description (str, optional): Change task description if not None. Defaults to None. + **fields (str): Additional data fields required for rendering. + """ + current_time = self.get_time() + with self._lock: + task = self._tasks[task_id] + task._reset() + task.start_time = current_time if start else None + if total is not None: + task.total = total + task.completed = completed + if visible is not None: + task.visible = visible + if fields: + task.fields = fields + if description is not None: + task.description = description + task.finished_time = None + self.refresh() + + def advance(self, task_id: TaskID, advance: float = 1) -> None: + """Advance task by a number of steps. + + Args: + task_id (TaskID): ID of task. + advance (float): Number of steps to advance. Default is 1. + """ + current_time = self.get_time() + with self._lock: + task = self._tasks[task_id] + completed_start = task.completed + task.completed += advance + update_completed = task.completed - completed_start + old_sample_time = current_time - self.speed_estimate_period + _progress = task._progress + + popleft = _progress.popleft + while _progress and _progress[0].timestamp < old_sample_time: + popleft() + while len(_progress) > 1000: + popleft() + _progress.append(ProgressSample(current_time, update_completed)) + if ( + task.total is not None + and task.completed >= task.total + and task.finished_time is None + ): + task.finished_time = task.elapsed + task.finished_speed = task.speed + + def refresh(self) -> None: + """Refresh (render) the progress information.""" + if not self.disable and self.live.is_started: + self.live.refresh() + + def get_renderable(self) -> RenderableType: + """Get a renderable for the progress display.""" + renderable = Group(*self.get_renderables()) + return renderable + + def get_renderables(self) -> Iterable[RenderableType]: + """Get a number of renderables for the progress display.""" + table = self.make_tasks_table(self.tasks) + yield table + + def make_tasks_table(self, tasks: Iterable[Task]) -> Table: + """Get a table to render the Progress display. + + Args: + tasks (Iterable[Task]): An iterable of Task instances, one per row of the table. + + Returns: + Table: A table instance. + """ + table_columns = ( + ( + Column(no_wrap=True) + if isinstance(_column, str) + else _column.get_table_column().copy() + ) + for _column in self.columns + ) + table = Table.grid(*table_columns, padding=(0, 1), expand=self.expand) + + for task in tasks: + if task.visible: + table.add_row( + *( + ( + column.format(task=task) + if isinstance(column, str) + else column(task) + ) + for column in self.columns + ) + ) + return table + + def __rich__(self) -> RenderableType: + """Makes the Progress class itself renderable.""" + with self._lock: + return self.get_renderable() + + def add_task( + self, + description: str, + start: bool = True, + total: Optional[float] = 100.0, + completed: int = 0, + visible: bool = True, + **fields: Any, + ) -> TaskID: + """Add a new 'task' to the Progress display. + + Args: + description (str): A description of the task. + start (bool, optional): Start the task immediately (to calculate elapsed time). If set to False, + you will need to call `start` manually. Defaults to True. + total (float, optional): Number of total steps in the progress if known. + Set to None to render a pulsing animation. Defaults to 100. + completed (int, optional): Number of steps completed so far. Defaults to 0. + visible (bool, optional): Enable display of the task. Defaults to True. + **fields (str): Additional data fields required for rendering. + + Returns: + TaskID: An ID you can use when calling `update`. + """ + with self._lock: + task = Task( + self._task_index, + description, + total, + completed, + visible=visible, + fields=fields, + _get_time=self.get_time, + _lock=self._lock, + ) + self._tasks[self._task_index] = task + if start: + self.start_task(self._task_index) + new_task_index = self._task_index + self._task_index = TaskID(int(self._task_index) + 1) + self.refresh() + return new_task_index + + def remove_task(self, task_id: TaskID) -> None: + """Delete a task if it exists. + + Args: + task_id (TaskID): A task ID. + + """ + with self._lock: + del self._tasks[task_id] + + +if __name__ == "__main__": # pragma: no coverage + + import random + import time + + from .panel import Panel + from .rule import Rule + from .syntax import Syntax + from .table import Table + + syntax = Syntax( + '''def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]: + """Iterate and generate a tuple with a flag for last value.""" + iter_values = iter(values) + try: + previous_value = next(iter_values) + except StopIteration: + return + for value in iter_values: + yield False, previous_value + previous_value = value + yield True, previous_value''', + "python", + line_numbers=True, + ) + + table = Table("foo", "bar", "baz") + table.add_row("1", "2", "3") + + progress_renderables = [ + "Text may be printed while the progress bars are rendering.", + Panel("In fact, [i]any[/i] renderable will work"), + "Such as [magenta]tables[/]...", + table, + "Pretty printed structures...", + {"type": "example", "text": "Pretty printed"}, + "Syntax...", + syntax, + Rule("Give it a try!"), + ] + + from itertools import cycle + + examples = cycle(progress_renderables) + + console = Console(record=True) + + with Progress( + SpinnerColumn(), + *Progress.get_default_columns(), + TimeElapsedColumn(), + console=console, + transient=False, + ) as progress: + + task1 = progress.add_task("[red]Downloading", total=1000) + task2 = progress.add_task("[green]Processing", total=1000) + task3 = progress.add_task("[yellow]Thinking", total=None) + + while not progress.finished: + progress.update(task1, advance=0.5) + progress.update(task2, advance=0.3) + time.sleep(0.01) + if random.randint(0, 100) < 1: + progress.log(next(examples)) diff --git a/shared/package-files/9f/9f83dd0309ed621100f3187ffcdae50b75f5973bbe74af550a78ef0010495ded/blob b/shared/package-files/9f/9f83dd0309ed621100f3187ffcdae50b75f5973bbe74af550a78ef0010495ded/blob new file mode 100644 index 0000000000000000000000000000000000000000..2e1b4bd30853a43c313d484e7293f7ffb08cf74c --- /dev/null +++ b/shared/package-files/9f/9f83dd0309ed621100f3187ffcdae50b75f5973bbe74af550a78ef0010495ded/blob @@ -0,0 +1,73 @@ +namespace eval ::tk { + ::msgcat::mcset it "&Abort" "&Interrompi" + ::msgcat::mcset it "&About..." "Informazioni..." + ::msgcat::mcset it "All Files" "Tutti i file" + ::msgcat::mcset it "Application Error" "Errore dell' applicazione" + ::msgcat::mcset it "&Blue" "&Blu" + ::msgcat::mcset it "Cancel" "Annulla" + ::msgcat::mcset it "&Cancel" "&Annulla" + ::msgcat::mcset it "Cannot change to the directory \"%1\$s\".\nPermission denied." "Impossibile accedere alla directory \"%1\$s\".\nPermesso negato." + ::msgcat::mcset it "Choose Directory" "Scegli una directory" + ::msgcat::mcset it "Cl&ear" "Azzera" + ::msgcat::mcset it "&Clear Console" "Azzera Console" + ::msgcat::mcset it "Color" "Colore" + ::msgcat::mcset it "Console" + ::msgcat::mcset it "&Copy" "Copia" + ::msgcat::mcset it "Cu&t" "Taglia" + ::msgcat::mcset it "Delete" "Cancella" + ::msgcat::mcset it "Details >>" "Dettagli >>" + ::msgcat::mcset it "Directory \"%1\$s\" does not exist." "La directory \"%1\$s\" non esiste." + ::msgcat::mcset it "&Directory:" + ::msgcat::mcset it "Error: %1\$s" "Errore: %1\$s" + ::msgcat::mcset it "E&xit" "Esci" + ::msgcat::mcset it "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Il file \"%1\$s\" esiste gi\u00e0.\nVuoi sovrascriverlo?" + ::msgcat::mcset it "File \"%1\$s\" already exists.\n\n" "Il file \"%1\$s\" esiste gi\u00e0.\n\n" + ::msgcat::mcset it "File \"%1\$s\" does not exist." "Il file \"%1\$s\" non esiste." + ::msgcat::mcset it "File &name:" "&Nome del file:" + ::msgcat::mcset it "File &names:" "&Nomi dei file:" + ::msgcat::mcset it "Files of &type:" "File di &tipo:" + ::msgcat::mcset it "Fi&les:" "Fi&le:" + ::msgcat::mcset it "&Filter" "&Filtro" + ::msgcat::mcset it "Fil&ter:" "Fil&tro:" + ::msgcat::mcset it "&Green" "&Verde" + ::msgcat::mcset it "Hi" "Salve" + ::msgcat::mcset it "&Hide Console" "Nascondi la console" + ::msgcat::mcset it "&Ignore" "&Ignora" + ::msgcat::mcset it "Invalid file name \"%1\$s\"." "Nome di file non valido \"%1\$s\"." + ::msgcat::mcset it "Log Files" "File di log" + ::msgcat::mcset it "&No" + ::msgcat::mcset it "&OK" + ::msgcat::mcset it "OK" + ::msgcat::mcset it "Ok" + ::msgcat::mcset it "Open" "Apri" + ::msgcat::mcset it "&Open" "A&pri" + ::msgcat::mcset it "Open Multiple Files" "Apri file multipli" + ::msgcat::mcset it "P&aste" "Incolla" + ::msgcat::mcset it "&Quit" "Esci" + ::msgcat::mcset it "&Red" "&Rosso" + ::msgcat::mcset it "Replace existing file?" "Sostituisci il file esistente?" + ::msgcat::mcset it "&Retry" "&Riprova" + ::msgcat::mcset it "&Save" "&Salva" + ::msgcat::mcset it "Save As" "Salva come" + ::msgcat::mcset it "Save To Log" "Salva il log" + ::msgcat::mcset it "Select Log File" "Scegli un file di log" + ::msgcat::mcset it "Select a file to source" "Scegli un file da eseguire" + ::msgcat::mcset it "&Selection:" "&Selezione:" + ::msgcat::mcset it "Skip Messages" "Salta i messaggi" + ::msgcat::mcset it "Source..." "Esegui..." + ::msgcat::mcset it "Tcl Scripts" "Script Tcl" + ::msgcat::mcset it "Tcl for Windows" "Tcl per Windows" + ::msgcat::mcset it "Text Files" "File di testo" + ::msgcat::mcset it "&Yes" "&S\u00ec" + ::msgcat::mcset it "abort" "interrompi" + ::msgcat::mcset it "blue" "blu" + ::msgcat::mcset it "cancel" "annulla" + ::msgcat::mcset it "extension" "estensione" + ::msgcat::mcset it "extensions" "estensioni" + ::msgcat::mcset it "green" "verde" + ::msgcat::mcset it "ignore" "ignora" + ::msgcat::mcset it "ok" + ::msgcat::mcset it "red" "rosso" + ::msgcat::mcset it "retry" "riprova" + ::msgcat::mcset it "yes" "s\u00ec" +} diff --git a/shared/package-files/9f/9f841cef13d1faa597b9dccfa569d35f94b63afda43da7f48e717d7e78285ce0/blob b/shared/package-files/9f/9f841cef13d1faa597b9dccfa569d35f94b63afda43da7f48e717d7e78285ce0/blob new file mode 100644 index 0000000000000000000000000000000000000000..9ad83b7570290cdba887fba298f49649ea8ba51b --- /dev/null +++ b/shared/package-files/9f/9f841cef13d1faa597b9dccfa569d35f94b63afda43da7f48e717d7e78285ce0/blob @@ -0,0 +1,150 @@ +from datetime import datetime + +import numpy as np + +import pandas as pd +from pandas import ( + Period, + Series, + date_range, + period_range, + to_datetime, +) +import pandas._testing as tm + + +class TestCombineFirst: + def test_combine_first_period_datetime(self): + # GH#3367 + didx = date_range(start="1950-01-31", end="1950-07-31", freq="ME") + pidx = period_range(start=Period("1950-1"), end=Period("1950-7"), freq="M") + # check to be consistent with DatetimeIndex + for idx in [didx, pidx]: + a = Series([1, np.nan, np.nan, 4, 5, np.nan, 7], index=idx) + b = Series([9, 9, 9, 9, 9, 9, 9], index=idx) + + result = a.combine_first(b) + expected = Series([1, 9, 9, 4, 5, 9, 7], index=idx, dtype=np.float64) + tm.assert_series_equal(result, expected) + + def test_combine_first_name(self, datetime_series): + result = datetime_series.combine_first(datetime_series[:5]) + assert result.name == datetime_series.name + + def test_combine_first(self, using_infer_string): + values = np.arange(20, dtype=np.float64) + series = Series(values, index=np.arange(20, dtype=np.int64)) + + series_copy = series * 2 + series_copy[::2] = np.nan + + # nothing used from the input + combined = series.combine_first(series_copy) + + tm.assert_series_equal(combined, series) + + # Holes filled from input + combined = series_copy.combine_first(series) + assert np.isfinite(combined).all() + + tm.assert_series_equal(combined[::2], series[::2]) + tm.assert_series_equal(combined[1::2], series_copy[1::2]) + + # mixed types + index = pd.Index([str(i) for i in range(20)]) + floats = Series(np.random.default_rng(2).standard_normal(20), index=index) + strings = Series([str(i) for i in range(10)], index=index[::2], dtype=object) + + combined = strings.combine_first(floats) + + tm.assert_series_equal(strings, combined.loc[index[::2]]) + tm.assert_series_equal(floats[1::2].astype(object), combined.loc[index[1::2]]) + + # corner case + ser = Series([1.0, 2, 3], index=[0, 1, 2]) + empty = Series([], index=[], dtype=object) + msg = "The behavior of array concatenation with empty entries is deprecated" + with tm.assert_produces_warning(FutureWarning, match=msg): + result = ser.combine_first(empty) + if not using_infer_string: + ser.index = ser.index.astype("O") + tm.assert_series_equal(ser, result) + + def test_combine_first_dt64(self, unit): + s0 = to_datetime(Series(["2010", np.nan])).dt.as_unit(unit) + s1 = to_datetime(Series([np.nan, "2011"])).dt.as_unit(unit) + rs = s0.combine_first(s1) + xp = to_datetime(Series(["2010", "2011"])).dt.as_unit(unit) + tm.assert_series_equal(rs, xp) + + s0 = to_datetime(Series(["2010", np.nan])).dt.as_unit(unit) + s1 = Series([np.nan, "2011"]) + rs = s0.combine_first(s1) + + xp = Series([datetime(2010, 1, 1), "2011"], dtype="datetime64[ns]") + + tm.assert_series_equal(rs, xp) + + def test_combine_first_dt_tz_values(self, tz_naive_fixture): + ser1 = Series( + pd.DatetimeIndex(["20150101", "20150102", "20150103"], tz=tz_naive_fixture), + name="ser1", + ) + ser2 = Series( + pd.DatetimeIndex(["20160514", "20160515", "20160516"], tz=tz_naive_fixture), + index=[2, 3, 4], + name="ser2", + ) + result = ser1.combine_first(ser2) + exp_vals = pd.DatetimeIndex( + ["20150101", "20150102", "20150103", "20160515", "20160516"], + tz=tz_naive_fixture, + ) + exp = Series(exp_vals, name="ser1") + tm.assert_series_equal(exp, result) + + def test_combine_first_timezone_series_with_empty_series(self): + # GH 41800 + time_index = date_range( + datetime(2021, 1, 1, 1), + datetime(2021, 1, 1, 10), + freq="h", + tz="Europe/Rome", + ) + s1 = Series(range(10), index=time_index) + s2 = Series(index=time_index) + msg = "The behavior of array concatenation with empty entries is deprecated" + with tm.assert_produces_warning(FutureWarning, match=msg): + result = s1.combine_first(s2) + tm.assert_series_equal(result, s1) + + def test_combine_first_preserves_dtype(self): + # GH51764 + s1 = Series([1666880195890293744, 1666880195890293837]) + s2 = Series([1, 2, 3]) + result = s1.combine_first(s2) + expected = Series([1666880195890293744, 1666880195890293837, 3]) + tm.assert_series_equal(result, expected) + + def test_combine_mixed_timezone(self): + # GH 26283 + uniform_tz = Series({pd.Timestamp("2019-05-01", tz="UTC"): 1.0}) + multi_tz = Series( + { + pd.Timestamp("2019-05-01 01:00:00+0100", tz="Europe/London"): 2.0, + pd.Timestamp("2019-05-02", tz="UTC"): 3.0, + } + ) + + result = uniform_tz.combine_first(multi_tz) + expected = Series( + [1.0, 3.0], + index=pd.Index( + [ + pd.Timestamp("2019-05-01 00:00:00+00:00", tz="UTC"), + pd.Timestamp("2019-05-02 00:00:00+00:00", tz="UTC"), + ], + dtype="object", + ), + ) + tm.assert_series_equal(result, expected) diff --git a/shared/package-files/9f/9f850dde78e69d420f66b02f39ca1bf86293854b54a68b8ddb481a3d9bccba74/blob b/shared/package-files/9f/9f850dde78e69d420f66b02f39ca1bf86293854b54a68b8ddb481a3d9bccba74/blob new file mode 100644 index 0000000000000000000000000000000000000000..74958804b3329861f71999c15279ea78ab449482 --- /dev/null +++ b/shared/package-files/9f/9f850dde78e69d420f66b02f39ca1bf86293854b54a68b8ddb481a3d9bccba74/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor bitwise_or(const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & bitwise_or_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other); +TORCH_API at::Tensor & bitwise_or_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out); +TORCH_API at::Tensor & bitwise_or_(at::Tensor & self, const at::Tensor & other); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/9f/9f859a9098fd89162476b445a0b2e8844e226e1b8d872e930d0f08dcb330bee3/blob b/shared/package-files/9f/9f859a9098fd89162476b445a0b2e8844e226e1b8d872e930d0f08dcb330bee3/blob new file mode 100644 index 0000000000000000000000000000000000000000..34278903dec5335b0aaa37063a19afc0e5f65865 --- /dev/null +++ b/shared/package-files/9f/9f859a9098fd89162476b445a0b2e8844e226e1b8d872e930d0f08dcb330bee3/blob @@ -0,0 +1,72 @@ +import re +import warnings + +from numba.core import typing, sigutils +from numba.pycc.compiler import ExportEntry + +# Registry is okay to be a global because we are using pycc as a standalone +# commandline tool. +export_registry = [] + + +def export(prototype): + warnings.warn("export() is deprecated, use the numba.pycc.CC API instead", + DeprecationWarning, stacklevel=2) + + sym, sig = parse_prototype(prototype) + + def wrappped(func): + fn_argtys, fn_retty = sigutils.normalize_signature(sig) + signature = typing.signature(fn_retty, *fn_argtys) + entry = ExportEntry(symbol=sym, signature=signature, function=func) + export_registry.append(entry) + + return wrappped + + +def exportmany(prototypes): + warnings.warn("exportmany() is deprecated, use the numba.pycc.CC API instead", + DeprecationWarning, stacklevel=2) + + def wrapped(func): + for proto in prototypes: + export(proto)(func) + return wrapped + + +def process_input_files(inputs): + """ + Read input source files for execution of legacy @export / @exportmany + decorators. + """ + for ifile in inputs: + with open(ifile) as fin: + exec(compile(fin.read(), ifile, 'exec')) + + +def clear_export_registry(): + export_registry[:] = [] + + +# --------------------------------- Internal --------------------------------- + +re_symbol = re.compile(r'[_a-z][_a-z0-9]*', re.I) + + +def parse_prototype(text): + """Separate the symbol and function-type in a a string with + "symbol function-type" (e.g. "mult float(float, float)") + + Returns + --------- + (symbol_string, functype_string) + """ + m = re_symbol.match(text) + if not m: + raise ValueError("Invalid function name for export prototype") + s = m.start(0) + e = m.end(0) + symbol = text[s:e] + functype = text[e + 1:] + return symbol, functype + diff --git a/shared/package-files/9f/9f85e6ab17a8e2c5e9c31808144721aff7a419f7d2afde0b29c4cd7c02ac9b3d/blob b/shared/package-files/9f/9f85e6ab17a8e2c5e9c31808144721aff7a419f7d2afde0b29c4cd7c02ac9b3d/blob new file mode 100644 index 0000000000000000000000000000000000000000..5dc37003fb2d0490d18fdb08cba77e239e7ef4c2 --- /dev/null +++ b/shared/package-files/9f/9f85e6ab17a8e2c5e9c31808144721aff7a419f7d2afde0b29c4cd7c02ac9b3d/blob @@ -0,0 +1,60 @@ +import warnings +from typing import Tuple, Union + +from torch.distributed._tensor import DeviceMesh +from torch.distributed._tensor.placement_types import Placement +from torch.distributed.device_mesh import _mesh_resources +try: + from torch._dynamo.external_utils import is_compiling as is_torchdynamo_compiling +except Exception: + def is_torchdynamo_compiling(): # type: ignore[misc] + return False + +LayoutsType = Union[Placement, Tuple[Placement, ...]] + + +def _deprecate_warnings(func_name: str, extra_msg: str) -> None: + """ + Inject common validation logics for `_prepare_input` funcs via this decorator. + + Include verifying that input needs to be either a :class:`Tensor` or :class:`DTensor` + and only 1D :class:`DeviceMesh` is passed in. + """ + # TODO: Will follow up with dynamo POC to make warnings.warn working with dynamo. + if not is_torchdynamo_compiling(): + warnings.warn(f"{func_name} is deprecated and will be removed soon. {extra_msg}") + + +def _validate_tp_mesh_dim( + device_mesh: DeviceMesh, +) -> None: + """ + Check whether TP mesh dimension is valid or not. + + Args: + device_mesh (:class:`DeviceMesh`): + The `device_mesh` where we perform + Tensor Parallelism on. + + Return: + `True` if the mesh dimension + is valid, `False` otherwise. + """ + if device_mesh.ndim > 1: + raise ValueError(f"Tensor Parallel only accepts a 1D DeviceMesh, but found {device_mesh.ndim}D!" + "If you have a 2-D or N-D device_mesh, consider passing in device_mesh[\"tp\"]") + + parent_mesh = _mesh_resources.get_parent_mesh(device_mesh) + if parent_mesh: + if parent_mesh.ndim != 2: + raise RuntimeError( + f"Found TP device_mesh has a parent mesh with dims {parent_mesh.ndim}", + "Currently we only support 2D TP composition with DP.", + ) + + tp_mesh_dim = _mesh_resources.get_parent_mesh_dim(device_mesh) + if tp_mesh_dim != 1: + raise RuntimeError( + f"Found TP device_mesh on the {tp_mesh_dim} dimension of its parent mesh.", + "Currently we only support intranode TP and TP needs to be the innermost dimension on its parent mesh.", + ) diff --git a/shared/package-files/9f/9f86ecac72b643ccdb62c404c8d685a8dbbffefbea830a3501facb2c2c5f9295/blob b/shared/package-files/9f/9f86ecac72b643ccdb62c404c8d685a8dbbffefbea830a3501facb2c2c5f9295/blob new file mode 100644 index 0000000000000000000000000000000000000000..ac63cf70cd9ae9c05189f89e2f96c4d216d09573 --- /dev/null +++ b/shared/package-files/9f/9f86ecac72b643ccdb62c404c8d685a8dbbffefbea830a3501facb2c2c5f9295/blob @@ -0,0 +1,85 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +#pragma once + +#include + +#include "arrow/util/macros.h" +#include "arrow/util/visibility.h" + +namespace arrow { +namespace util { + +/// A wrapper around std::mutex since we can't use it directly in +/// public headers due to C++/CLI. +/// https://docs.microsoft.com/en-us/cpp/standard-library/mutex#remarks +class ARROW_EXPORT Mutex { + public: + Mutex(); + Mutex(Mutex&&) = default; + Mutex& operator=(Mutex&&) = default; + + /// A Guard is falsy if a lock could not be acquired. + class ARROW_EXPORT Guard { + public: + Guard() : locked_(NULLPTR, [](Mutex* mutex) {}) {} + Guard(Guard&&) = default; + Guard& operator=(Guard&&) = default; + + explicit operator bool() const { return bool(locked_); } + + void Unlock() { locked_.reset(); } + + private: + explicit Guard(Mutex* locked); + + std::unique_ptr locked_; + friend Mutex; + }; + + Guard TryLock(); + Guard Lock(); + + private: + struct Impl; + std::unique_ptr impl_; +}; + +#ifndef _WIN32 +/// Return a pointer to a process-wide, process-specific Mutex that can be used +/// at any point in a child process. NULL is returned when called in the parent. +/// +/// The rule is to first check that getpid() corresponds to the parent process pid +/// and, if not, call this function to lock any after-fork reinitialization code. +/// Like this: +/// +/// std::atomic pid{getpid()}; +/// ... +/// if (pid.load() != getpid()) { +/// // In child process +/// auto lock = GlobalForkSafeMutex()->Lock(); +/// if (pid.load() != getpid()) { +/// // Reinitialize internal structures after fork +/// ... +/// pid.store(getpid()); +ARROW_EXPORT +Mutex* GlobalForkSafeMutex(); +#endif + +} // namespace util +} // namespace arrow diff --git a/shared/package-files/9f/9f88aa504772f1dcf366a456628a4ef4ccbaec9b998cd02feb84b5889df63e2b/blob b/shared/package-files/9f/9f88aa504772f1dcf366a456628a4ef4ccbaec9b998cd02feb84b5889df63e2b/blob new file mode 100644 index 0000000000000000000000000000000000000000..b8e1002fcacd38d90d8d272b0948f9f9d6b39a9b --- /dev/null +++ b/shared/package-files/9f/9f88aa504772f1dcf366a456628a4ef4ccbaec9b998cd02feb84b5889df63e2b/blob @@ -0,0 +1,53 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::quantile(Tensor self, Tensor q, int? dim=None, bool keepdim=False, *, str interpolation='linear') -> Tensor +inline at::Tensor quantile(const at::Tensor & self, const at::Tensor & q, c10::optional dim=c10::nullopt, bool keepdim=false, c10::string_view interpolation="linear") { + return at::_ops::quantile::call(self, q, dim, keepdim, interpolation); +} + +// aten::quantile.out(Tensor self, Tensor q, int? dim=None, bool keepdim=False, *, str interpolation='linear', Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & quantile_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & q, c10::optional dim=c10::nullopt, bool keepdim=false, c10::string_view interpolation="linear") { + return at::_ops::quantile_out::call(self, q, dim, keepdim, interpolation, out); +} +// aten::quantile.out(Tensor self, Tensor q, int? dim=None, bool keepdim=False, *, str interpolation='linear', Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & quantile_outf(const at::Tensor & self, const at::Tensor & q, c10::optional dim, bool keepdim, c10::string_view interpolation, at::Tensor & out) { + return at::_ops::quantile_out::call(self, q, dim, keepdim, interpolation, out); +} + +// aten::quantile.scalar(Tensor self, float q, int? dim=None, bool keepdim=False, *, str interpolation='linear') -> Tensor +inline at::Tensor quantile(const at::Tensor & self, double q, c10::optional dim=c10::nullopt, bool keepdim=false, c10::string_view interpolation="linear") { + return at::_ops::quantile_scalar::call(self, q, dim, keepdim, interpolation); +} + +// aten::quantile.scalar_out(Tensor self, float q, int? dim=None, bool keepdim=False, *, str interpolation='linear', Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & quantile_out(at::Tensor & out, const at::Tensor & self, double q, c10::optional dim=c10::nullopt, bool keepdim=false, c10::string_view interpolation="linear") { + return at::_ops::quantile_scalar_out::call(self, q, dim, keepdim, interpolation, out); +} +// aten::quantile.scalar_out(Tensor self, float q, int? dim=None, bool keepdim=False, *, str interpolation='linear', Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & quantile_outf(const at::Tensor & self, double q, c10::optional dim, bool keepdim, c10::string_view interpolation, at::Tensor & out) { + return at::_ops::quantile_scalar_out::call(self, q, dim, keepdim, interpolation, out); +} + +} diff --git a/shared/package-files/9f/9f89786afeeda3d6aad53e3aacc24888aef1e5043e65dbdeb98ab62adff538aa/blob b/shared/package-files/9f/9f89786afeeda3d6aad53e3aacc24888aef1e5043e65dbdeb98ab62adff538aa/blob new file mode 100644 index 0000000000000000000000000000000000000000..5ac7db91e25df7ee4eae5d59a12f50249715d4f9 --- /dev/null +++ b/shared/package-files/9f/9f89786afeeda3d6aad53e3aacc24888aef1e5043e65dbdeb98ab62adff538aa/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API at::Tensor amin(const at::Tensor & self, at::IntArrayRef dim={}, bool keepdim=false); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/shared/package-files/9f/9f93ab1d9eb903d0aa0c5c6919fa61e7fb56180ba2461741234c40196a18c7d2/blob b/shared/package-files/9f/9f93ab1d9eb903d0aa0c5c6919fa61e7fb56180ba2461741234c40196a18c7d2/blob new file mode 100644 index 0000000000000000000000000000000000000000..663550b8ddd6fa905d3cec6e02be50faa43859c3 --- /dev/null +++ b/shared/package-files/9f/9f93ab1d9eb903d0aa0c5c6919fa61e7fb56180ba2461741234c40196a18c7d2/blob @@ -0,0 +1,11 @@ +Changes to Libsvm + +This is here mainly as checklist for incorporation of new versions of libsvm. + + * Add copyright to files svm.cpp and svm.h + * Add random_seed support and call to srand in fit function + * Improved random number generator (fix on windows, enhancement on other + platforms). See + * invoke scipy blas api for svm kernel function to improve performance with speedup rate of 1.5X to 2X for dense data only. See + * Expose the number of iterations run in optimization. See +The changes made with respect to upstream are detailed in the heading of svm.cpp diff --git a/shared/package-files/9f/9f9843ed1feb92d263de188763312aaf7089087496e2291f39b287994ad7070d/blob b/shared/package-files/9f/9f9843ed1feb92d263de188763312aaf7089087496e2291f39b287994ad7070d/blob new file mode 100644 index 0000000000000000000000000000000000000000..c15c8c0440b5e4817384341f18351d5a078ba237 --- /dev/null +++ b/shared/package-files/9f/9f9843ed1feb92d263de188763312aaf7089087496e2291f39b287994ad7070d/blob @@ -0,0 +1 @@ +from email.mime.nonmultipart import * diff --git a/shared/package-files/9f/9f9cd590155ae09e2e894ee35f22bfee52d3113b074f6610dc62e3481324d5bb/README.md b/shared/package-files/9f/9f9cd590155ae09e2e894ee35f22bfee52d3113b074f6610dc62e3481324d5bb/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5c9cb7f4c077a44ee5a0275e005aa350aa873811 --- /dev/null +++ b/shared/package-files/9f/9f9cd590155ae09e2e894ee35f22bfee52d3113b074f6610dc62e3481324d5bb/README.md @@ -0,0 +1 @@ +E421 portable inverse: selected E420arm combined, fixed TRAIN M2covariance rank512/damping.75, E310primaryhead replacing E144: True. All other ensemble weights and scoring terms exact E411. Feature workers explicitly spawn, as losslessly qualified in E419. No inference fitting or development cache. Runtime resolves owned assets relative to this package and uses verifier-supplied /opt/glacier/bin/python. Wholehybrid qualification required before publication. diff --git a/shared/package-files/9f/9fa0106a2d72a123ebb858775f16a38414f2a0d3c133dc731e9b0204109e0df9/blob b/shared/package-files/9f/9fa0106a2d72a123ebb858775f16a38414f2a0d3c133dc731e9b0204109e0df9/blob new file mode 100644 index 0000000000000000000000000000000000000000..ff771b9e71824df7ea2298ec3f94106db61a5869 --- /dev/null +++ b/shared/package-files/9f/9fa0106a2d72a123ebb858775f16a38414f2a0d3c133dc731e9b0204109e0df9/blob @@ -0,0 +1,25 @@ +import numpy as np +import pandas as pd + +import statsmodels.datasets.macrodata +from statsmodels.tsa.vector_ar.svar_model import SVAR + +mdatagen = statsmodels.datasets.macrodata.load().data +mdata = mdatagen[["realgdp", "realcons", "realinv"]] +names = mdata.dtype.names +start = pd.datetime(1959, 3, 31) +end = pd.datetime(2009, 9, 30) +# qtr = pd.DatetimeIndex(start=start, end=end, freq=pd.datetools.BQuarterEnd()) +qtr = pd.date_range(start=start, end=end, freq="BQ-MAR") +data = pd.DataFrame(mdata, index=qtr) +data = (np.log(data)).diff().dropna() + +# define structural inputs +A = np.asarray([[1, 0, 0], ["E", 1, 0], ["E", "E", 1]]) +B = np.asarray([["E", 0, 0], [0, "E", 0], [0, 0, "E"]]) +A_guess = np.asarray([0.5, 0.25, -0.38]) +B_guess = np.asarray([0.5, 0.1, 0.05]) +mymodel = SVAR(data, svar_type="AB", A=A, B=B, freq="Q") +res = mymodel.fit(maxlags=3, maxiter=10000, maxfun=10000, solver="bfgs") +res.irf(periods=30).plot(impulse="realgdp", plot_stderr=True, + stderr_type="mc", repl=100) diff --git a/shared/package-files/9f/9fa24acde0661dd3fe7de694bab719d3fee7edfac2ddad344b0a50246d2aee4a/blob b/shared/package-files/9f/9fa24acde0661dd3fe7de694bab719d3fee7edfac2ddad344b0a50246d2aee4a/blob new file mode 100644 index 0000000000000000000000000000000000000000..ad4187b7cd6200ca956c8fdcb057139afbe2a69f Binary files /dev/null and b/shared/package-files/9f/9fa24acde0661dd3fe7de694bab719d3fee7edfac2ddad344b0a50246d2aee4a/blob differ diff --git a/shared/package-files/9f/9fa2e873ba608253b6e3d2158e36baf02433a46e68071b76b5e961a7accec2d2/blob b/shared/package-files/9f/9fa2e873ba608253b6e3d2158e36baf02433a46e68071b76b5e961a7accec2d2/blob new file mode 100644 index 0000000000000000000000000000000000000000..50100e90e477c86c7e7bd3419486dc717987e3cc --- /dev/null +++ b/shared/package-files/9f/9fa2e873ba608253b6e3d2158e36baf02433a46e68071b76b5e961a7accec2d2/blob @@ -0,0 +1,1452 @@ +"""Test case implementation""" + +import sys +import functools +import difflib +import pprint +import re +import warnings +import collections +import contextlib +import traceback +import types + +from . import result +from .util import (strclass, safe_repr, _count_diff_all_purpose, + _count_diff_hashable, _common_shorten_repr) + +__unittest = True + +_subtest_msg_sentinel = object() + +DIFF_OMITTED = ('\nDiff is %s characters long. ' + 'Set self.maxDiff to None to see it.') + +class SkipTest(Exception): + """ + Raise this exception in a test to skip it. + + Usually you can use TestCase.skipTest() or one of the skipping decorators + instead of raising this directly. + """ + +class _ShouldStop(Exception): + """ + The test should stop. + """ + +class _UnexpectedSuccess(Exception): + """ + The test was supposed to fail, but it didn't! + """ + + +class _Outcome(object): + def __init__(self, result=None): + self.expecting_failure = False + self.result = result + self.result_supports_subtests = hasattr(result, "addSubTest") + self.success = True + self.skipped = [] + self.expectedFailure = None + self.errors = [] + + @contextlib.contextmanager + def testPartExecutor(self, test_case, isTest=False): + old_success = self.success + self.success = True + try: + yield + except KeyboardInterrupt: + raise + except SkipTest as e: + self.success = False + self.skipped.append((test_case, str(e))) + except _ShouldStop: + pass + except: + exc_info = sys.exc_info() + if self.expecting_failure: + self.expectedFailure = exc_info + else: + self.success = False + self.errors.append((test_case, exc_info)) + # explicitly break a reference cycle: + # exc_info -> frame -> exc_info + exc_info = None + else: + if self.result_supports_subtests and self.success: + self.errors.append((test_case, None)) + finally: + self.success = self.success and old_success + + +def _id(obj): + return obj + + +_module_cleanups = [] +def addModuleCleanup(function, /, *args, **kwargs): + """Same as addCleanup, except the cleanup items are called even if + setUpModule fails (unlike tearDownModule).""" + _module_cleanups.append((function, args, kwargs)) + + +def doModuleCleanups(): + """Execute all module cleanup functions. Normally called for you after + tearDownModule.""" + exceptions = [] + while _module_cleanups: + function, args, kwargs = _module_cleanups.pop() + try: + function(*args, **kwargs) + except Exception as exc: + exceptions.append(exc) + if exceptions: + # Swallows all but first exception. If a multi-exception handler + # gets written we should use that here instead. + raise exceptions[0] + + +def skip(reason): + """ + Unconditionally skip a test. + """ + def decorator(test_item): + if not isinstance(test_item, type): + @functools.wraps(test_item) + def skip_wrapper(*args, **kwargs): + raise SkipTest(reason) + test_item = skip_wrapper + + test_item.__unittest_skip__ = True + test_item.__unittest_skip_why__ = reason + return test_item + if isinstance(reason, types.FunctionType): + test_item = reason + reason = '' + return decorator(test_item) + return decorator + +def skipIf(condition, reason): + """ + Skip a test if the condition is true. + """ + if condition: + return skip(reason) + return _id + +def skipUnless(condition, reason): + """ + Skip a test unless the condition is true. + """ + if not condition: + return skip(reason) + return _id + +def expectedFailure(test_item): + test_item.__unittest_expecting_failure__ = True + return test_item + +def _is_subtype(expected, basetype): + if isinstance(expected, tuple): + return all(_is_subtype(e, basetype) for e in expected) + return isinstance(expected, type) and issubclass(expected, basetype) + +class _BaseTestCaseContext: + + def __init__(self, test_case): + self.test_case = test_case + + def _raiseFailure(self, standardMsg): + msg = self.test_case._formatMessage(self.msg, standardMsg) + raise self.test_case.failureException(msg) + +class _AssertRaisesBaseContext(_BaseTestCaseContext): + + def __init__(self, expected, test_case, expected_regex=None): + _BaseTestCaseContext.__init__(self, test_case) + self.expected = expected + self.test_case = test_case + if expected_regex is not None: + expected_regex = re.compile(expected_regex) + self.expected_regex = expected_regex + self.obj_name = None + self.msg = None + + def handle(self, name, args, kwargs): + """ + If args is empty, assertRaises/Warns is being used as a + context manager, so check for a 'msg' kwarg and return self. + If args is not empty, call a callable passing positional and keyword + arguments. + """ + try: + if not _is_subtype(self.expected, self._base_type): + raise TypeError('%s() arg 1 must be %s' % + (name, self._base_type_str)) + if not args: + self.msg = kwargs.pop('msg', None) + if kwargs: + raise TypeError('%r is an invalid keyword argument for ' + 'this function' % (next(iter(kwargs)),)) + return self + + callable_obj, *args = args + try: + self.obj_name = callable_obj.__name__ + except AttributeError: + self.obj_name = str(callable_obj) + with self: + callable_obj(*args, **kwargs) + finally: + # bpo-23890: manually break a reference cycle + self = None + + +class _AssertRaisesContext(_AssertRaisesBaseContext): + """A context manager used to implement TestCase.assertRaises* methods.""" + + _base_type = BaseException + _base_type_str = 'an exception type or tuple of exception types' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, tb): + if exc_type is None: + try: + exc_name = self.expected.__name__ + except AttributeError: + exc_name = str(self.expected) + if self.obj_name: + self._raiseFailure("{} not raised by {}".format(exc_name, + self.obj_name)) + else: + self._raiseFailure("{} not raised".format(exc_name)) + else: + traceback.clear_frames(tb) + if not issubclass(exc_type, self.expected): + # let unexpected exceptions pass through + return False + # store exception, without traceback, for later retrieval + self.exception = exc_value.with_traceback(None) + if self.expected_regex is None: + return True + + expected_regex = self.expected_regex + if not expected_regex.search(str(exc_value)): + self._raiseFailure('"{}" does not match "{}"'.format( + expected_regex.pattern, str(exc_value))) + return True + + __class_getitem__ = classmethod(types.GenericAlias) + + +class _AssertWarnsContext(_AssertRaisesBaseContext): + """A context manager used to implement TestCase.assertWarns* methods.""" + + _base_type = Warning + _base_type_str = 'a warning type or tuple of warning types' + + def __enter__(self): + # The __warningregistry__'s need to be in a pristine state for tests + # to work properly. + for v in list(sys.modules.values()): + if getattr(v, '__warningregistry__', None): + v.__warningregistry__ = {} + self.warnings_manager = warnings.catch_warnings(record=True) + self.warnings = self.warnings_manager.__enter__() + warnings.simplefilter("always", self.expected) + return self + + def __exit__(self, exc_type, exc_value, tb): + self.warnings_manager.__exit__(exc_type, exc_value, tb) + if exc_type is not None: + # let unexpected exceptions pass through + return + try: + exc_name = self.expected.__name__ + except AttributeError: + exc_name = str(self.expected) + first_matching = None + for m in self.warnings: + w = m.message + if not isinstance(w, self.expected): + continue + if first_matching is None: + first_matching = w + if (self.expected_regex is not None and + not self.expected_regex.search(str(w))): + continue + # store warning for later retrieval + self.warning = w + self.filename = m.filename + self.lineno = m.lineno + return + # Now we simply try to choose a helpful failure message + if first_matching is not None: + self._raiseFailure('"{}" does not match "{}"'.format( + self.expected_regex.pattern, str(first_matching))) + if self.obj_name: + self._raiseFailure("{} not triggered by {}".format(exc_name, + self.obj_name)) + else: + self._raiseFailure("{} not triggered".format(exc_name)) + + +class _OrderedChainMap(collections.ChainMap): + def __iter__(self): + seen = set() + for mapping in self.maps: + for k in mapping: + if k not in seen: + seen.add(k) + yield k + + +class TestCase(object): + """A class whose instances are single test cases. + + By default, the test code itself should be placed in a method named + 'runTest'. + + If the fixture may be used for many test cases, create as + many test methods as are needed. When instantiating such a TestCase + subclass, specify in the constructor arguments the name of the test method + that the instance is to execute. + + Test authors should subclass TestCase for their own tests. Construction + and deconstruction of the test's environment ('fixture') can be + implemented by overriding the 'setUp' and 'tearDown' methods respectively. + + If it is necessary to override the __init__ method, the base class + __init__ method must always be called. It is important that subclasses + should not change the signature of their __init__ method, since instances + of the classes are instantiated automatically by parts of the framework + in order to be run. + + When subclassing TestCase, you can set these attributes: + * failureException: determines which exception will be raised when + the instance's assertion methods fail; test methods raising this + exception will be deemed to have 'failed' rather than 'errored'. + * longMessage: determines whether long messages (including repr of + objects used in assert methods) will be printed on failure in *addition* + to any explicit message passed. + * maxDiff: sets the maximum length of a diff in failure messages + by assert methods using difflib. It is looked up as an instance + attribute so can be configured by individual tests if required. + """ + + failureException = AssertionError + + longMessage = True + + maxDiff = 80*8 + + # If a string is longer than _diffThreshold, use normal comparison instead + # of difflib. See #11763. + _diffThreshold = 2**16 + + def __init_subclass__(cls, *args, **kwargs): + # Attribute used by TestSuite for classSetUp + cls._classSetupFailed = False + cls._class_cleanups = [] + super().__init_subclass__(*args, **kwargs) + + def __init__(self, methodName='runTest'): + """Create an instance of the class that will use the named test + method when executed. Raises a ValueError if the instance does + not have a method with the specified name. + """ + self._testMethodName = methodName + self._outcome = None + self._testMethodDoc = 'No test' + try: + testMethod = getattr(self, methodName) + except AttributeError: + if methodName != 'runTest': + # we allow instantiation with no explicit method name + # but not an *incorrect* or missing method name + raise ValueError("no such test method in %s: %s" % + (self.__class__, methodName)) + else: + self._testMethodDoc = testMethod.__doc__ + self._cleanups = [] + self._subtest = None + + # Map types to custom assertEqual functions that will compare + # instances of said type in more detail to generate a more useful + # error message. + self._type_equality_funcs = {} + self.addTypeEqualityFunc(dict, 'assertDictEqual') + self.addTypeEqualityFunc(list, 'assertListEqual') + self.addTypeEqualityFunc(tuple, 'assertTupleEqual') + self.addTypeEqualityFunc(set, 'assertSetEqual') + self.addTypeEqualityFunc(frozenset, 'assertSetEqual') + self.addTypeEqualityFunc(str, 'assertMultiLineEqual') + + def addTypeEqualityFunc(self, typeobj, function): + """Add a type specific assertEqual style function to compare a type. + + This method is for use by TestCase subclasses that need to register + their own type equality functions to provide nicer error messages. + + Args: + typeobj: The data type to call this function on when both values + are of the same type in assertEqual(). + function: The callable taking two arguments and an optional + msg= argument that raises self.failureException with a + useful error message when the two arguments are not equal. + """ + self._type_equality_funcs[typeobj] = function + + def addCleanup(self, function, /, *args, **kwargs): + """Add a function, with arguments, to be called when the test is + completed. Functions added are called on a LIFO basis and are + called after tearDown on test failure or success. + + Cleanup items are called even if setUp fails (unlike tearDown).""" + self._cleanups.append((function, args, kwargs)) + + @classmethod + def addClassCleanup(cls, function, /, *args, **kwargs): + """Same as addCleanup, except the cleanup items are called even if + setUpClass fails (unlike tearDownClass).""" + cls._class_cleanups.append((function, args, kwargs)) + + def setUp(self): + "Hook method for setting up the test fixture before exercising it." + pass + + def tearDown(self): + "Hook method for deconstructing the test fixture after testing it." + pass + + @classmethod + def setUpClass(cls): + "Hook method for setting up class fixture before running tests in the class." + + @classmethod + def tearDownClass(cls): + "Hook method for deconstructing the class fixture after running all tests in the class." + + def countTestCases(self): + return 1 + + def defaultTestResult(self): + return result.TestResult() + + def shortDescription(self): + """Returns a one-line description of the test, or None if no + description has been provided. + + The default implementation of this method returns the first line of + the specified test method's docstring. + """ + doc = self._testMethodDoc + return doc.strip().split("\n")[0].strip() if doc else None + + + def id(self): + return "%s.%s" % (strclass(self.__class__), self._testMethodName) + + def __eq__(self, other): + if type(self) is not type(other): + return NotImplemented + + return self._testMethodName == other._testMethodName + + def __hash__(self): + return hash((type(self), self._testMethodName)) + + def __str__(self): + return "%s (%s)" % (self._testMethodName, strclass(self.__class__)) + + def __repr__(self): + return "<%s testMethod=%s>" % \ + (strclass(self.__class__), self._testMethodName) + + def _addSkip(self, result, test_case, reason): + addSkip = getattr(result, 'addSkip', None) + if addSkip is not None: + addSkip(test_case, reason) + else: + warnings.warn("TestResult has no addSkip method, skips not reported", + RuntimeWarning, 2) + result.addSuccess(test_case) + + @contextlib.contextmanager + def subTest(self, msg=_subtest_msg_sentinel, **params): + """Return a context manager that will return the enclosed block + of code in a subtest identified by the optional message and + keyword parameters. A failure in the subtest marks the test + case as failed but resumes execution at the end of the enclosed + block, allowing further test code to be executed. + """ + if self._outcome is None or not self._outcome.result_supports_subtests: + yield + return + parent = self._subtest + if parent is None: + params_map = _OrderedChainMap(params) + else: + params_map = parent.params.new_child(params) + self._subtest = _SubTest(self, msg, params_map) + try: + with self._outcome.testPartExecutor(self._subtest, isTest=True): + yield + if not self._outcome.success: + result = self._outcome.result + if result is not None and result.failfast: + raise _ShouldStop + elif self._outcome.expectedFailure: + # If the test is expecting a failure, we really want to + # stop now and register the expected failure. + raise _ShouldStop + finally: + self._subtest = parent + + def _feedErrorsToResult(self, result, errors): + for test, exc_info in errors: + if isinstance(test, _SubTest): + result.addSubTest(test.test_case, test, exc_info) + elif exc_info is not None: + if issubclass(exc_info[0], self.failureException): + result.addFailure(test, exc_info) + else: + result.addError(test, exc_info) + + def _addExpectedFailure(self, result, exc_info): + try: + addExpectedFailure = result.addExpectedFailure + except AttributeError: + warnings.warn("TestResult has no addExpectedFailure method, reporting as passes", + RuntimeWarning) + result.addSuccess(self) + else: + addExpectedFailure(self, exc_info) + + def _addUnexpectedSuccess(self, result): + try: + addUnexpectedSuccess = result.addUnexpectedSuccess + except AttributeError: + warnings.warn("TestResult has no addUnexpectedSuccess method, reporting as failure", + RuntimeWarning) + # We need to pass an actual exception and traceback to addFailure, + # otherwise the legacy result can choke. + try: + raise _UnexpectedSuccess from None + except _UnexpectedSuccess: + result.addFailure(self, sys.exc_info()) + else: + addUnexpectedSuccess(self) + + def _callSetUp(self): + self.setUp() + + def _callTestMethod(self, method): + method() + + def _callTearDown(self): + self.tearDown() + + def _callCleanup(self, function, /, *args, **kwargs): + function(*args, **kwargs) + + def run(self, result=None): + if result is None: + result = self.defaultTestResult() + startTestRun = getattr(result, 'startTestRun', None) + stopTestRun = getattr(result, 'stopTestRun', None) + if startTestRun is not None: + startTestRun() + else: + stopTestRun = None + + result.startTest(self) + try: + testMethod = getattr(self, self._testMethodName) + if (getattr(self.__class__, "__unittest_skip__", False) or + getattr(testMethod, "__unittest_skip__", False)): + # If the class or method was skipped. + skip_why = (getattr(self.__class__, '__unittest_skip_why__', '') + or getattr(testMethod, '__unittest_skip_why__', '')) + self._addSkip(result, self, skip_why) + return result + + expecting_failure = ( + getattr(self, "__unittest_expecting_failure__", False) or + getattr(testMethod, "__unittest_expecting_failure__", False) + ) + outcome = _Outcome(result) + try: + self._outcome = outcome + + with outcome.testPartExecutor(self): + self._callSetUp() + if outcome.success: + outcome.expecting_failure = expecting_failure + with outcome.testPartExecutor(self, isTest=True): + self._callTestMethod(testMethod) + outcome.expecting_failure = False + with outcome.testPartExecutor(self): + self._callTearDown() + + self.doCleanups() + for test, reason in outcome.skipped: + self._addSkip(result, test, reason) + self._feedErrorsToResult(result, outcome.errors) + if outcome.success: + if expecting_failure: + if outcome.expectedFailure: + self._addExpectedFailure(result, outcome.expectedFailure) + else: + self._addUnexpectedSuccess(result) + else: + result.addSuccess(self) + return result + finally: + # explicitly break reference cycles: + # outcome.errors -> frame -> outcome -> outcome.errors + # outcome.expectedFailure -> frame -> outcome -> outcome.expectedFailure + outcome.errors.clear() + outcome.expectedFailure = None + + # clear the outcome, no more needed + self._outcome = None + + finally: + result.stopTest(self) + if stopTestRun is not None: + stopTestRun() + + def doCleanups(self): + """Execute all cleanup functions. Normally called for you after + tearDown.""" + outcome = self._outcome or _Outcome() + while self._cleanups: + function, args, kwargs = self._cleanups.pop() + with outcome.testPartExecutor(self): + self._callCleanup(function, *args, **kwargs) + + # return this for backwards compatibility + # even though we no longer use it internally + return outcome.success + + @classmethod + def doClassCleanups(cls): + """Execute all class cleanup functions. Normally called for you after + tearDownClass.""" + cls.tearDown_exceptions = [] + while cls._class_cleanups: + function, args, kwargs = cls._class_cleanups.pop() + try: + function(*args, **kwargs) + except Exception: + cls.tearDown_exceptions.append(sys.exc_info()) + + def __call__(self, *args, **kwds): + return self.run(*args, **kwds) + + def debug(self): + """Run the test without collecting errors in a TestResult""" + testMethod = getattr(self, self._testMethodName) + if (getattr(self.__class__, "__unittest_skip__", False) or + getattr(testMethod, "__unittest_skip__", False)): + # If the class or method was skipped. + skip_why = (getattr(self.__class__, '__unittest_skip_why__', '') + or getattr(testMethod, '__unittest_skip_why__', '')) + raise SkipTest(skip_why) + + self._callSetUp() + self._callTestMethod(testMethod) + self._callTearDown() + while self._cleanups: + function, args, kwargs = self._cleanups.pop() + self._callCleanup(function, *args, **kwargs) + + def skipTest(self, reason): + """Skip this test.""" + raise SkipTest(reason) + + def fail(self, msg=None): + """Fail immediately, with the given message.""" + raise self.failureException(msg) + + def assertFalse(self, expr, msg=None): + """Check that the expression is false.""" + if expr: + msg = self._formatMessage(msg, "%s is not false" % safe_repr(expr)) + raise self.failureException(msg) + + def assertTrue(self, expr, msg=None): + """Check that the expression is true.""" + if not expr: + msg = self._formatMessage(msg, "%s is not true" % safe_repr(expr)) + raise self.failureException(msg) + + def _formatMessage(self, msg, standardMsg): + """Honour the longMessage attribute when generating failure messages. + If longMessage is False this means: + * Use only an explicit message if it is provided + * Otherwise use the standard message for the assert + + If longMessage is True: + * Use the standard message + * If an explicit message is provided, plus ' : ' and the explicit message + """ + if not self.longMessage: + return msg or standardMsg + if msg is None: + return standardMsg + try: + # don't switch to '{}' formatting in Python 2.X + # it changes the way unicode input is handled + return '%s : %s' % (standardMsg, msg) + except UnicodeDecodeError: + return '%s : %s' % (safe_repr(standardMsg), safe_repr(msg)) + + def assertRaises(self, expected_exception, *args, **kwargs): + """Fail unless an exception of class expected_exception is raised + by the callable when invoked with specified positional and + keyword arguments. If a different type of exception is + raised, it will not be caught, and the test case will be + deemed to have suffered an error, exactly as for an + unexpected exception. + + If called with the callable and arguments omitted, will return a + context object used like this:: + + with self.assertRaises(SomeException): + do_something() + + An optional keyword argument 'msg' can be provided when assertRaises + is used as a context object. + + The context manager keeps a reference to the exception as + the 'exception' attribute. This allows you to inspect the + exception after the assertion:: + + with self.assertRaises(SomeException) as cm: + do_something() + the_exception = cm.exception + self.assertEqual(the_exception.error_code, 3) + """ + context = _AssertRaisesContext(expected_exception, self) + try: + return context.handle('assertRaises', args, kwargs) + finally: + # bpo-23890: manually break a reference cycle + context = None + + def assertWarns(self, expected_warning, *args, **kwargs): + """Fail unless a warning of class warnClass is triggered + by the callable when invoked with specified positional and + keyword arguments. If a different type of warning is + triggered, it will not be handled: depending on the other + warning filtering rules in effect, it might be silenced, printed + out, or raised as an exception. + + If called with the callable and arguments omitted, will return a + context object used like this:: + + with self.assertWarns(SomeWarning): + do_something() + + An optional keyword argument 'msg' can be provided when assertWarns + is used as a context object. + + The context manager keeps a reference to the first matching + warning as the 'warning' attribute; similarly, the 'filename' + and 'lineno' attributes give you information about the line + of Python code from which the warning was triggered. + This allows you to inspect the warning after the assertion:: + + with self.assertWarns(SomeWarning) as cm: + do_something() + the_warning = cm.warning + self.assertEqual(the_warning.some_attribute, 147) + """ + context = _AssertWarnsContext(expected_warning, self) + return context.handle('assertWarns', args, kwargs) + + def assertLogs(self, logger=None, level=None): + """Fail unless a log message of level *level* or higher is emitted + on *logger_name* or its children. If omitted, *level* defaults to + INFO and *logger* defaults to the root logger. + + This method must be used as a context manager, and will yield + a recording object with two attributes: `output` and `records`. + At the end of the context manager, the `output` attribute will + be a list of the matching formatted log messages and the + `records` attribute will be a list of the corresponding LogRecord + objects. + + Example:: + + with self.assertLogs('foo', level='INFO') as cm: + logging.getLogger('foo').info('first message') + logging.getLogger('foo.bar').error('second message') + self.assertEqual(cm.output, ['INFO:foo:first message', + 'ERROR:foo.bar:second message']) + """ + # Lazy import to avoid importing logging if it is not needed. + from ._log import _AssertLogsContext + return _AssertLogsContext(self, logger, level, no_logs=False) + + def assertNoLogs(self, logger=None, level=None): + """ Fail unless no log messages of level *level* or higher are emitted + on *logger_name* or its children. + + This method must be used as a context manager. + """ + from ._log import _AssertLogsContext + return _AssertLogsContext(self, logger, level, no_logs=True) + + def _getAssertEqualityFunc(self, first, second): + """Get a detailed comparison function for the types of the two args. + + Returns: A callable accepting (first, second, msg=None) that will + raise a failure exception if first != second with a useful human + readable error message for those types. + """ + # + # NOTE(gregory.p.smith): I considered isinstance(first, type(second)) + # and vice versa. I opted for the conservative approach in case + # subclasses are not intended to be compared in detail to their super + # class instances using a type equality func. This means testing + # subtypes won't automagically use the detailed comparison. Callers + # should use their type specific assertSpamEqual method to compare + # subclasses if the detailed comparison is desired and appropriate. + # See the discussion in http://bugs.python.org/issue2578. + # + if type(first) is type(second): + asserter = self._type_equality_funcs.get(type(first)) + if asserter is not None: + if isinstance(asserter, str): + asserter = getattr(self, asserter) + return asserter + + return self._baseAssertEqual + + def _baseAssertEqual(self, first, second, msg=None): + """The default assertEqual implementation, not type specific.""" + if not first == second: + standardMsg = '%s != %s' % _common_shorten_repr(first, second) + msg = self._formatMessage(msg, standardMsg) + raise self.failureException(msg) + + def assertEqual(self, first, second, msg=None): + """Fail if the two objects are unequal as determined by the '==' + operator. + """ + assertion_func = self._getAssertEqualityFunc(first, second) + assertion_func(first, second, msg=msg) + + def assertNotEqual(self, first, second, msg=None): + """Fail if the two objects are equal as determined by the '!=' + operator. + """ + if not first != second: + msg = self._formatMessage(msg, '%s == %s' % (safe_repr(first), + safe_repr(second))) + raise self.failureException(msg) + + def assertAlmostEqual(self, first, second, places=None, msg=None, + delta=None): + """Fail if the two objects are unequal as determined by their + difference rounded to the given number of decimal places + (default 7) and comparing to zero, or by comparing that the + difference between the two objects is more than the given + delta. + + Note that decimal places (from zero) are usually not the same + as significant digits (measured from the most significant digit). + + If the two objects compare equal then they will automatically + compare almost equal. + """ + if first == second: + # shortcut + return + if delta is not None and places is not None: + raise TypeError("specify delta or places not both") + + diff = abs(first - second) + if delta is not None: + if diff <= delta: + return + + standardMsg = '%s != %s within %s delta (%s difference)' % ( + safe_repr(first), + safe_repr(second), + safe_repr(delta), + safe_repr(diff)) + else: + if places is None: + places = 7 + + if round(diff, places) == 0: + return + + standardMsg = '%s != %s within %r places (%s difference)' % ( + safe_repr(first), + safe_repr(second), + places, + safe_repr(diff)) + msg = self._formatMessage(msg, standardMsg) + raise self.failureException(msg) + + def assertNotAlmostEqual(self, first, second, places=None, msg=None, + delta=None): + """Fail if the two objects are equal as determined by their + difference rounded to the given number of decimal places + (default 7) and comparing to zero, or by comparing that the + difference between the two objects is less than the given delta. + + Note that decimal places (from zero) are usually not the same + as significant digits (measured from the most significant digit). + + Objects that are equal automatically fail. + """ + if delta is not None and places is not None: + raise TypeError("specify delta or places not both") + diff = abs(first - second) + if delta is not None: + if not (first == second) and diff > delta: + return + standardMsg = '%s == %s within %s delta (%s difference)' % ( + safe_repr(first), + safe_repr(second), + safe_repr(delta), + safe_repr(diff)) + else: + if places is None: + places = 7 + if not (first == second) and round(diff, places) != 0: + return + standardMsg = '%s == %s within %r places' % (safe_repr(first), + safe_repr(second), + places) + + msg = self._formatMessage(msg, standardMsg) + raise self.failureException(msg) + + def assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None): + """An equality assertion for ordered sequences (like lists and tuples). + + For the purposes of this function, a valid ordered sequence type is one + which can be indexed, has a length, and has an equality operator. + + Args: + seq1: The first sequence to compare. + seq2: The second sequence to compare. + seq_type: The expected datatype of the sequences, or None if no + datatype should be enforced. + msg: Optional message to use on failure instead of a list of + differences. + """ + if seq_type is not None: + seq_type_name = seq_type.__name__ + if not isinstance(seq1, seq_type): + raise self.failureException('First sequence is not a %s: %s' + % (seq_type_name, safe_repr(seq1))) + if not isinstance(seq2, seq_type): + raise self.failureException('Second sequence is not a %s: %s' + % (seq_type_name, safe_repr(seq2))) + else: + seq_type_name = "sequence" + + differing = None + try: + len1 = len(seq1) + except (TypeError, NotImplementedError): + differing = 'First %s has no length. Non-sequence?' % ( + seq_type_name) + + if differing is None: + try: + len2 = len(seq2) + except (TypeError, NotImplementedError): + differing = 'Second %s has no length. Non-sequence?' % ( + seq_type_name) + + if differing is None: + if seq1 == seq2: + return + + differing = '%ss differ: %s != %s\n' % ( + (seq_type_name.capitalize(),) + + _common_shorten_repr(seq1, seq2)) + + for i in range(min(len1, len2)): + try: + item1 = seq1[i] + except (TypeError, IndexError, NotImplementedError): + differing += ('\nUnable to index element %d of first %s\n' % + (i, seq_type_name)) + break + + try: + item2 = seq2[i] + except (TypeError, IndexError, NotImplementedError): + differing += ('\nUnable to index element %d of second %s\n' % + (i, seq_type_name)) + break + + if item1 != item2: + differing += ('\nFirst differing element %d:\n%s\n%s\n' % + ((i,) + _common_shorten_repr(item1, item2))) + break + else: + if (len1 == len2 and seq_type is None and + type(seq1) != type(seq2)): + # The sequences are the same, but have differing types. + return + + if len1 > len2: + differing += ('\nFirst %s contains %d additional ' + 'elements.\n' % (seq_type_name, len1 - len2)) + try: + differing += ('First extra element %d:\n%s\n' % + (len2, safe_repr(seq1[len2]))) + except (TypeError, IndexError, NotImplementedError): + differing += ('Unable to index element %d ' + 'of first %s\n' % (len2, seq_type_name)) + elif len1 < len2: + differing += ('\nSecond %s contains %d additional ' + 'elements.\n' % (seq_type_name, len2 - len1)) + try: + differing += ('First extra element %d:\n%s\n' % + (len1, safe_repr(seq2[len1]))) + except (TypeError, IndexError, NotImplementedError): + differing += ('Unable to index element %d ' + 'of second %s\n' % (len1, seq_type_name)) + standardMsg = differing + diffMsg = '\n' + '\n'.join( + difflib.ndiff(pprint.pformat(seq1).splitlines(), + pprint.pformat(seq2).splitlines())) + + standardMsg = self._truncateMessage(standardMsg, diffMsg) + msg = self._formatMessage(msg, standardMsg) + self.fail(msg) + + def _truncateMessage(self, message, diff): + max_diff = self.maxDiff + if max_diff is None or len(diff) <= max_diff: + return message + diff + return message + (DIFF_OMITTED % len(diff)) + + def assertListEqual(self, list1, list2, msg=None): + """A list-specific equality assertion. + + Args: + list1: The first list to compare. + list2: The second list to compare. + msg: Optional message to use on failure instead of a list of + differences. + + """ + self.assertSequenceEqual(list1, list2, msg, seq_type=list) + + def assertTupleEqual(self, tuple1, tuple2, msg=None): + """A tuple-specific equality assertion. + + Args: + tuple1: The first tuple to compare. + tuple2: The second tuple to compare. + msg: Optional message to use on failure instead of a list of + differences. + """ + self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple) + + def assertSetEqual(self, set1, set2, msg=None): + """A set-specific equality assertion. + + Args: + set1: The first set to compare. + set2: The second set to compare. + msg: Optional message to use on failure instead of a list of + differences. + + assertSetEqual uses ducktyping to support different types of sets, and + is optimized for sets specifically (parameters must support a + difference method). + """ + try: + difference1 = set1.difference(set2) + except TypeError as e: + self.fail('invalid type when attempting set difference: %s' % e) + except AttributeError as e: + self.fail('first argument does not support set difference: %s' % e) + + try: + difference2 = set2.difference(set1) + except TypeError as e: + self.fail('invalid type when attempting set difference: %s' % e) + except AttributeError as e: + self.fail('second argument does not support set difference: %s' % e) + + if not (difference1 or difference2): + return + + lines = [] + if difference1: + lines.append('Items in the first set but not the second:') + for item in difference1: + lines.append(repr(item)) + if difference2: + lines.append('Items in the second set but not the first:') + for item in difference2: + lines.append(repr(item)) + + standardMsg = '\n'.join(lines) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertIn(self, member, container, msg=None): + """Just like self.assertTrue(a in b), but with a nicer default message.""" + if member not in container: + standardMsg = '%s not found in %s' % (safe_repr(member), + safe_repr(container)) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertNotIn(self, member, container, msg=None): + """Just like self.assertTrue(a not in b), but with a nicer default message.""" + if member in container: + standardMsg = '%s unexpectedly found in %s' % (safe_repr(member), + safe_repr(container)) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertIs(self, expr1, expr2, msg=None): + """Just like self.assertTrue(a is b), but with a nicer default message.""" + if expr1 is not expr2: + standardMsg = '%s is not %s' % (safe_repr(expr1), + safe_repr(expr2)) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertIsNot(self, expr1, expr2, msg=None): + """Just like self.assertTrue(a is not b), but with a nicer default message.""" + if expr1 is expr2: + standardMsg = 'unexpectedly identical: %s' % (safe_repr(expr1),) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertDictEqual(self, d1, d2, msg=None): + self.assertIsInstance(d1, dict, 'First argument is not a dictionary') + self.assertIsInstance(d2, dict, 'Second argument is not a dictionary') + + if d1 != d2: + standardMsg = '%s != %s' % _common_shorten_repr(d1, d2) + diff = ('\n' + '\n'.join(difflib.ndiff( + pprint.pformat(d1).splitlines(), + pprint.pformat(d2).splitlines()))) + standardMsg = self._truncateMessage(standardMsg, diff) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertDictContainsSubset(self, subset, dictionary, msg=None): + """Checks whether dictionary is a superset of subset.""" + warnings.warn('assertDictContainsSubset is deprecated', + DeprecationWarning, + stacklevel=2) + missing = [] + mismatched = [] + for key, value in subset.items(): + if key not in dictionary: + missing.append(key) + elif value != dictionary[key]: + mismatched.append('%s, expected: %s, actual: %s' % + (safe_repr(key), safe_repr(value), + safe_repr(dictionary[key]))) + + if not (missing or mismatched): + return + + standardMsg = '' + if missing: + standardMsg = 'Missing: %s' % ','.join(safe_repr(m) for m in + missing) + if mismatched: + if standardMsg: + standardMsg += '; ' + standardMsg += 'Mismatched values: %s' % ','.join(mismatched) + + self.fail(self._formatMessage(msg, standardMsg)) + + + def assertCountEqual(self, first, second, msg=None): + """Asserts that two iterables have the same elements, the same number of + times, without regard to order. + + self.assertEqual(Counter(list(first)), + Counter(list(second))) + + Example: + - [0, 1, 1] and [1, 0, 1] compare equal. + - [0, 0, 1] and [0, 1] compare unequal. + + """ + first_seq, second_seq = list(first), list(second) + try: + first = collections.Counter(first_seq) + second = collections.Counter(second_seq) + except TypeError: + # Handle case with unhashable elements + differences = _count_diff_all_purpose(first_seq, second_seq) + else: + if first == second: + return + differences = _count_diff_hashable(first_seq, second_seq) + + if differences: + standardMsg = 'Element counts were not equal:\n' + lines = ['First has %d, Second has %d: %r' % diff for diff in differences] + diffMsg = '\n'.join(lines) + standardMsg = self._truncateMessage(standardMsg, diffMsg) + msg = self._formatMessage(msg, standardMsg) + self.fail(msg) + + def assertMultiLineEqual(self, first, second, msg=None): + """Assert that two multi-line strings are equal.""" + self.assertIsInstance(first, str, 'First argument is not a string') + self.assertIsInstance(second, str, 'Second argument is not a string') + + if first != second: + # don't use difflib if the strings are too long + if (len(first) > self._diffThreshold or + len(second) > self._diffThreshold): + self._baseAssertEqual(first, second, msg) + firstlines = first.splitlines(keepends=True) + secondlines = second.splitlines(keepends=True) + if len(firstlines) == 1 and first.strip('\r\n') == first: + firstlines = [first + '\n'] + secondlines = [second + '\n'] + standardMsg = '%s != %s' % _common_shorten_repr(first, second) + diff = '\n' + ''.join(difflib.ndiff(firstlines, secondlines)) + standardMsg = self._truncateMessage(standardMsg, diff) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertLess(self, a, b, msg=None): + """Just like self.assertTrue(a < b), but with a nicer default message.""" + if not a < b: + standardMsg = '%s not less than %s' % (safe_repr(a), safe_repr(b)) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertLessEqual(self, a, b, msg=None): + """Just like self.assertTrue(a <= b), but with a nicer default message.""" + if not a <= b: + standardMsg = '%s not less than or equal to %s' % (safe_repr(a), safe_repr(b)) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertGreater(self, a, b, msg=None): + """Just like self.assertTrue(a > b), but with a nicer default message.""" + if not a > b: + standardMsg = '%s not greater than %s' % (safe_repr(a), safe_repr(b)) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertGreaterEqual(self, a, b, msg=None): + """Just like self.assertTrue(a >= b), but with a nicer default message.""" + if not a >= b: + standardMsg = '%s not greater than or equal to %s' % (safe_repr(a), safe_repr(b)) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertIsNone(self, obj, msg=None): + """Same as self.assertTrue(obj is None), with a nicer default message.""" + if obj is not None: + standardMsg = '%s is not None' % (safe_repr(obj),) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertIsNotNone(self, obj, msg=None): + """Included for symmetry with assertIsNone.""" + if obj is None: + standardMsg = 'unexpectedly None' + self.fail(self._formatMessage(msg, standardMsg)) + + def assertIsInstance(self, obj, cls, msg=None): + """Same as self.assertTrue(isinstance(obj, cls)), with a nicer + default message.""" + if not isinstance(obj, cls): + standardMsg = '%s is not an instance of %r' % (safe_repr(obj), cls) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertNotIsInstance(self, obj, cls, msg=None): + """Included for symmetry with assertIsInstance.""" + if isinstance(obj, cls): + standardMsg = '%s is an instance of %r' % (safe_repr(obj), cls) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertRaisesRegex(self, expected_exception, expected_regex, + *args, **kwargs): + """Asserts that the message in a raised exception matches a regex. + + Args: + expected_exception: Exception class expected to be raised. + expected_regex: Regex (re.Pattern object or string) expected + to be found in error message. + args: Function to be called and extra positional args. + kwargs: Extra kwargs. + msg: Optional message used in case of failure. Can only be used + when assertRaisesRegex is used as a context manager. + """ + context = _AssertRaisesContext(expected_exception, self, expected_regex) + return context.handle('assertRaisesRegex', args, kwargs) + + def assertWarnsRegex(self, expected_warning, expected_regex, + *args, **kwargs): + """Asserts that the message in a triggered warning matches a regexp. + Basic functioning is similar to assertWarns() with the addition + that only warnings whose messages also match the regular expression + are considered successful matches. + + Args: + expected_warning: Warning class expected to be triggered. + expected_regex: Regex (re.Pattern object or string) expected + to be found in error message. + args: Function to be called and extra positional args. + kwargs: Extra kwargs. + msg: Optional message used in case of failure. Can only be used + when assertWarnsRegex is used as a context manager. + """ + context = _AssertWarnsContext(expected_warning, self, expected_regex) + return context.handle('assertWarnsRegex', args, kwargs) + + def assertRegex(self, text, expected_regex, msg=None): + """Fail the test unless the text matches the regular expression.""" + if isinstance(expected_regex, (str, bytes)): + assert expected_regex, "expected_regex must not be empty." + expected_regex = re.compile(expected_regex) + if not expected_regex.search(text): + standardMsg = "Regex didn't match: %r not found in %r" % ( + expected_regex.pattern, text) + # _formatMessage ensures the longMessage option is respected + msg = self._formatMessage(msg, standardMsg) + raise self.failureException(msg) + + def assertNotRegex(self, text, unexpected_regex, msg=None): + """Fail the test if the text matches the regular expression.""" + if isinstance(unexpected_regex, (str, bytes)): + unexpected_regex = re.compile(unexpected_regex) + match = unexpected_regex.search(text) + if match: + standardMsg = 'Regex matched: %r matches %r in %r' % ( + text[match.start() : match.end()], + unexpected_regex.pattern, + text) + # _formatMessage ensures the longMessage option is respected + msg = self._formatMessage(msg, standardMsg) + raise self.failureException(msg) + + + def _deprecate(original_func): + def deprecated_func(*args, **kwargs): + warnings.warn( + 'Please use {0} instead.'.format(original_func.__name__), + DeprecationWarning, 2) + return original_func(*args, **kwargs) + return deprecated_func + + # see #9424 + failUnlessEqual = assertEquals = _deprecate(assertEqual) + failIfEqual = assertNotEquals = _deprecate(assertNotEqual) + failUnlessAlmostEqual = assertAlmostEquals = _deprecate(assertAlmostEqual) + failIfAlmostEqual = assertNotAlmostEquals = _deprecate(assertNotAlmostEqual) + failUnless = assert_ = _deprecate(assertTrue) + failUnlessRaises = _deprecate(assertRaises) + failIf = _deprecate(assertFalse) + assertRaisesRegexp = _deprecate(assertRaisesRegex) + assertRegexpMatches = _deprecate(assertRegex) + assertNotRegexpMatches = _deprecate(assertNotRegex) + + + +class FunctionTestCase(TestCase): + """A test case that wraps a test function. + + This is useful for slipping pre-existing test functions into the + unittest framework. Optionally, set-up and tidy-up functions can be + supplied. As with TestCase, the tidy-up ('tearDown') function will + always be called if the set-up ('setUp') function ran successfully. + """ + + def __init__(self, testFunc, setUp=None, tearDown=None, description=None): + super(FunctionTestCase, self).__init__() + self._setUpFunc = setUp + self._tearDownFunc = tearDown + self._testFunc = testFunc + self._description = description + + def setUp(self): + if self._setUpFunc is not None: + self._setUpFunc() + + def tearDown(self): + if self._tearDownFunc is not None: + self._tearDownFunc() + + def runTest(self): + self._testFunc() + + def id(self): + return self._testFunc.__name__ + + def __eq__(self, other): + if not isinstance(other, self.__class__): + return NotImplemented + + return self._setUpFunc == other._setUpFunc and \ + self._tearDownFunc == other._tearDownFunc and \ + self._testFunc == other._testFunc and \ + self._description == other._description + + def __hash__(self): + return hash((type(self), self._setUpFunc, self._tearDownFunc, + self._testFunc, self._description)) + + def __str__(self): + return "%s (%s)" % (strclass(self.__class__), + self._testFunc.__name__) + + def __repr__(self): + return "<%s tec=%s>" % (strclass(self.__class__), + self._testFunc) + + def shortDescription(self): + if self._description is not None: + return self._description + doc = self._testFunc.__doc__ + return doc and doc.split("\n")[0].strip() or None + + +class _SubTest(TestCase): + + def __init__(self, test_case, message, params): + super().__init__() + self._message = message + self.test_case = test_case + self.params = params + self.failureException = test_case.failureException + + def runTest(self): + raise NotImplementedError("subtests cannot be run directly") + + def _subDescription(self): + parts = [] + if self._message is not _subtest_msg_sentinel: + parts.append("[{}]".format(self._message)) + if self.params: + params_desc = ', '.join( + "{}={!r}".format(k, v) + for (k, v) in self.params.items()) + parts.append("({})".format(params_desc)) + return " ".join(parts) or '()' + + def id(self): + return "{} {}".format(self.test_case.id(), self._subDescription()) + + def shortDescription(self): + """Returns a one-line description of the subtest, or None if no + description has been provided. + """ + return self.test_case.shortDescription() + + def __str__(self): + return "{} {}".format(self.test_case, self._subDescription()) diff --git a/shared/package-files/9f/9fa426cd9f17629f6320700ed18baa94839304cf1bcabbee7edb501747dc055d/blob b/shared/package-files/9f/9fa426cd9f17629f6320700ed18baa94839304cf1bcabbee7edb501747dc055d/blob new file mode 100644 index 0000000000000000000000000000000000000000..72b87aea68862f2fabbb7b30274e683a6654d4ae --- /dev/null +++ b/shared/package-files/9f/9fa426cd9f17629f6320700ed18baa94839304cf1bcabbee7edb501747dc055d/blob @@ -0,0 +1,39 @@ +# +# euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004 +# +# Written by Hye-Shik Chang +# + +import _codecs_jp, codecs +import _multibytecodec as mbc + +codec = _codecs_jp.getcodec('euc_jis_2004') + +class Codec(codecs.Codec): + encode = codec.encode + decode = codec.decode + +class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, + codecs.IncrementalEncoder): + codec = codec + +class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, + codecs.IncrementalDecoder): + codec = codec + +class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): + codec = codec + +class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): + codec = codec + +def getregentry(): + return codecs.CodecInfo( + name='euc_jis_2004', + encode=Codec().encode, + decode=Codec().decode, + incrementalencoder=IncrementalEncoder, + incrementaldecoder=IncrementalDecoder, + streamreader=StreamReader, + streamwriter=StreamWriter, + ) diff --git a/shared/package-files/9f/9fa802bd46564846ee1d22e5ee7afa55da41d774b55ce3d85759171f8d76f2bd/blob b/shared/package-files/9f/9fa802bd46564846ee1d22e5ee7afa55da41d774b55ce3d85759171f8d76f2bd/blob new file mode 100644 index 0000000000000000000000000000000000000000..c325c2db84bdf99835ec86493a1e84aa296c4344 --- /dev/null +++ b/shared/package-files/9f/9fa802bd46564846ee1d22e5ee7afa55da41d774b55ce3d85759171f8d76f2bd/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fa802bd46564846ee1d22e5ee7afa55da41d774b55ce3d85759171f8d76f2bd +size 395696 diff --git a/shared/package-files/9f/9faa58d24167d58a5cd87235f0727540ae015e8ada86d16df5ab0efb95153c52/blob b/shared/package-files/9f/9faa58d24167d58a5cd87235f0727540ae015e8ada86d16df5ab0efb95153c52/blob new file mode 100644 index 0000000000000000000000000000000000000000..ba95b2515a2c59eef35f1ed764102c2720aeb547 --- /dev/null +++ b/shared/package-files/9f/9faa58d24167d58a5cd87235f0727540ae015e8ada86d16df5ab0efb95153c52/blob @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9faa58d24167d58a5cd87235f0727540ae015e8ada86d16df5ab0efb95153c52 +size 7813024 diff --git a/shared/package-files/9f/9faa7830545711e8d809efdbd10ec27c8bb73979e0e239f59c79cc3d3f6008e0/blob b/shared/package-files/9f/9faa7830545711e8d809efdbd10ec27c8bb73979e0e239f59c79cc3d3f6008e0/blob new file mode 100644 index 0000000000000000000000000000000000000000..0fc89a328cf20da0fd243ab7603cf316ecf2acb4 --- /dev/null +++ b/shared/package-files/9f/9faa7830545711e8d809efdbd10ec27c8bb73979e0e239f59c79cc3d3f6008e0/blob @@ -0,0 +1,719 @@ +import importlib.resources + +import numpy as np +from numpy.testing import suppress_warnings +import pytest + +from scipy.special import ( + lpn, lpmn, lpmv, lqn, lqmn, sph_harm, eval_legendre, eval_hermite, + eval_laguerre, eval_genlaguerre, binom, cbrt, expm1, log1p, zeta, + jn, jv, jvp, yn, yv, yvp, iv, ivp, kn, kv, kvp, + gamma, gammaln, gammainc, gammaincc, gammaincinv, gammainccinv, digamma, + beta, betainc, betaincinv, poch, + ellipe, ellipeinc, ellipk, ellipkm1, ellipkinc, + elliprc, elliprd, elliprf, elliprg, elliprj, + erf, erfc, erfinv, erfcinv, exp1, expi, expn, + bdtrik, btdtria, btdtrib, chndtr, gdtr, gdtrc, gdtrix, gdtrib, + nbdtrik, pdtrik, owens_t, + mathieu_a, mathieu_b, mathieu_cem, mathieu_sem, mathieu_modcem1, + mathieu_modsem1, mathieu_modcem2, mathieu_modsem2, + ellip_harm, ellip_harm_2, spherical_jn, spherical_yn, wright_bessel +) +from scipy.integrate import IntegrationWarning + +from scipy.special._testutils import FuncData + + +# The npz files are generated, and hence may live in the build dir. We can only +# access them through `importlib.resources`, not an explicit path from `__file__` +_datadir = importlib.resources.files('scipy.special.tests.data') + +_boost_npz = _datadir.joinpath('boost.npz') +with importlib.resources.as_file(_boost_npz) as f: + DATASETS_BOOST = np.load(f) + +_gsl_npz = _datadir.joinpath('gsl.npz') +with importlib.resources.as_file(_gsl_npz) as f: + DATASETS_GSL = np.load(f) + +_local_npz = _datadir.joinpath('local.npz') +with importlib.resources.as_file(_local_npz) as f: + DATASETS_LOCAL = np.load(f) + + +def data(func, dataname, *a, **kw): + kw.setdefault('dataname', dataname) + return FuncData(func, DATASETS_BOOST[dataname], *a, **kw) + + +def data_gsl(func, dataname, *a, **kw): + kw.setdefault('dataname', dataname) + return FuncData(func, DATASETS_GSL[dataname], *a, **kw) + + +def data_local(func, dataname, *a, **kw): + kw.setdefault('dataname', dataname) + return FuncData(func, DATASETS_LOCAL[dataname], *a, **kw) + + +# The functions lpn, lpmn, clpmn, and sph_harm appearing below are +# deprecated in favor of legendre_p_all, assoc_legendre_p_all, +# assoc_legendre_p_all (assoc_legendre_p_all covers lpmn and clpmn), +# and sph_harm_y respectively. The deprecated functions listed above are +# implemented as shims around their respective replacements. The replacements +# are tested separately, but tests for the deprecated functions remain to +# verify the correctness of the shims. + + +def ellipk_(k): + return ellipk(k*k) + + +def ellipkinc_(f, k): + return ellipkinc(f, k*k) + + +def ellipe_(k): + return ellipe(k*k) + + +def ellipeinc_(f, k): + return ellipeinc(f, k*k) + + +def zeta_(x): + return zeta(x, 1.) + + +def assoc_legendre_p_boost_(nu, mu, x): + # the boost test data is for integer orders only + return lpmv(mu, nu.astype(int), x) + +def legendre_p_via_assoc_(nu, x): + return lpmv(0, nu, x) + +def lpn_(n, x): + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + return lpn(n.astype('l'), x)[0][-1] + +def lqn_(n, x): + return lqn(n.astype('l'), x)[0][-1] + +def legendre_p_via_lpmn(n, x): + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + return lpmn(0, n, x)[0][0,-1] + +def legendre_q_via_lqmn(n, x): + return lqmn(0, n, x)[0][0,-1] + +def mathieu_ce_rad(m, q, x): + return mathieu_cem(m, q, x*180/np.pi)[0] + + +def mathieu_se_rad(m, q, x): + return mathieu_sem(m, q, x*180/np.pi)[0] + + +def mathieu_mc1_scaled(m, q, x): + # GSL follows a different normalization. + # We follow Abramowitz & Stegun, they apparently something else. + return mathieu_modcem1(m, q, x)[0] * np.sqrt(np.pi/2) + + +def mathieu_ms1_scaled(m, q, x): + return mathieu_modsem1(m, q, x)[0] * np.sqrt(np.pi/2) + + +def mathieu_mc2_scaled(m, q, x): + return mathieu_modcem2(m, q, x)[0] * np.sqrt(np.pi/2) + + +def mathieu_ms2_scaled(m, q, x): + return mathieu_modsem2(m, q, x)[0] * np.sqrt(np.pi/2) + +def eval_legendre_ld(n, x): + return eval_legendre(n.astype('l'), x) + +def eval_legendre_dd(n, x): + return eval_legendre(n.astype('d'), x) + +def eval_hermite_ld(n, x): + return eval_hermite(n.astype('l'), x) + +def eval_laguerre_ld(n, x): + return eval_laguerre(n.astype('l'), x) + +def eval_laguerre_dd(n, x): + return eval_laguerre(n.astype('d'), x) + +def eval_genlaguerre_ldd(n, a, x): + return eval_genlaguerre(n.astype('l'), a, x) + +def eval_genlaguerre_ddd(n, a, x): + return eval_genlaguerre(n.astype('d'), a, x) + +def bdtrik_comp(y, n, p): + return bdtrik(1-y, n, p) + +def btdtria_comp(p, b, x): + return btdtria(1-p, b, x) + +def btdtrib_comp(a, p, x): + return btdtrib(a, 1-p, x) + +def gdtr_(p, x): + return gdtr(1.0, p, x) + +def gdtrc_(p, x): + return gdtrc(1.0, p, x) + +def gdtrix_(b, p): + return gdtrix(1.0, b, p) + +def gdtrix_comp(b, p): + return gdtrix(1.0, b, 1-p) + +def gdtrib_(p, x): + return gdtrib(1.0, p, x) + +def gdtrib_comp(p, x): + return gdtrib(1.0, 1-p, x) + +def nbdtrik_comp(y, n, p): + return nbdtrik(1-y, n, p) + +def pdtrik_comp(p, m): + return pdtrik(1-p, m) + +def poch_(z, m): + return 1.0 / poch(z, m) + +def poch_minus(z, m): + return 1.0 / poch(z, -m) + +def spherical_jn_(n, x): + return spherical_jn(n.astype('l'), x) + +def spherical_yn_(n, x): + return spherical_yn(n.astype('l'), x) + +def sph_harm_(m, n, theta, phi): + with suppress_warnings() as sup: + sup.filter(category=DeprecationWarning) + y = sph_harm(m, n, theta, phi) + return (y.real, y.imag) + +def cexpm1(x, y): + z = expm1(x + 1j*y) + return z.real, z.imag + +def clog1p(x, y): + z = log1p(x + 1j*y) + return z.real, z.imag + + +BOOST_TESTS = [ + data(assoc_legendre_p_boost_, 'assoc_legendre_p_ipp-assoc_legendre_p', + (0,1,2), 3, rtol=1e-11), + + data(legendre_p_via_assoc_, 'legendre_p_ipp-legendre_p', + (0,1), 2, rtol=1e-11), + data(legendre_p_via_assoc_, 'legendre_p_large_ipp-legendre_p_large', + (0,1), 2, rtol=9.6e-14), + data(legendre_p_via_lpmn, 'legendre_p_ipp-legendre_p', + (0,1), 2, rtol=5e-14, vectorized=False), + data(legendre_p_via_lpmn, 'legendre_p_large_ipp-legendre_p_large', + (0,1), 2, rtol=3e-13, vectorized=False), + data(lpn_, 'legendre_p_ipp-legendre_p', + (0,1), 2, rtol=5e-14, vectorized=False), + data(lpn_, 'legendre_p_large_ipp-legendre_p_large', + (0,1), 2, rtol=3e-13, vectorized=False), + data(eval_legendre_ld, 'legendre_p_ipp-legendre_p', + (0,1), 2, rtol=6e-14), + data(eval_legendre_ld, 'legendre_p_large_ipp-legendre_p_large', + (0,1), 2, rtol=2e-13), + data(eval_legendre_dd, 'legendre_p_ipp-legendre_p', + (0,1), 2, rtol=2e-14), + data(eval_legendre_dd, 'legendre_p_large_ipp-legendre_p_large', + (0,1), 2, rtol=2e-13), + + data(lqn_, 'legendre_p_ipp-legendre_p', + (0,1), 3, rtol=2e-14, vectorized=False), + data(lqn_, 'legendre_p_large_ipp-legendre_p_large', + (0,1), 3, rtol=2e-12, vectorized=False), + data(legendre_q_via_lqmn, 'legendre_p_ipp-legendre_p', + (0,1), 3, rtol=2e-14, vectorized=False), + data(legendre_q_via_lqmn, 'legendre_p_large_ipp-legendre_p_large', + (0,1), 3, rtol=2e-12, vectorized=False), + + data(beta, 'beta_exp_data_ipp-beta_exp_data', + (0,1), 2, rtol=1e-13), + data(beta, 'beta_exp_data_ipp-beta_exp_data', + (0,1), 2, rtol=1e-13), + data(beta, 'beta_med_data_ipp-beta_med_data', + (0,1), 2, rtol=5e-13), + + data(betainc, 'ibeta_small_data_ipp-ibeta_small_data', + (0,1,2), 5, rtol=6e-15), + data(betainc, 'ibeta_data_ipp-ibeta_data', + (0,1,2), 5, rtol=5e-13), + data(betainc, 'ibeta_int_data_ipp-ibeta_int_data', + (0,1,2), 5, rtol=2e-14), + data(betainc, 'ibeta_large_data_ipp-ibeta_large_data', + (0,1,2), 5, rtol=4e-10), + + data(betaincinv, 'ibeta_inv_data_ipp-ibeta_inv_data', + (0,1,2), 3, rtol=1e-5), + + data(btdtria, 'ibeta_inva_data_ipp-ibeta_inva_data', + (2,0,1), 3, rtol=5e-9), + data(btdtria_comp, 'ibeta_inva_data_ipp-ibeta_inva_data', + (2,0,1), 4, rtol=5e-9), + + data(btdtrib, 'ibeta_inva_data_ipp-ibeta_inva_data', + (0,2,1), 5, rtol=5e-9), + data(btdtrib_comp, 'ibeta_inva_data_ipp-ibeta_inva_data', + (0,2,1), 6, rtol=5e-9), + + data(binom, 'binomial_data_ipp-binomial_data', + (0,1), 2, rtol=1e-13), + data(binom, 'binomial_large_data_ipp-binomial_large_data', + (0,1), 2, rtol=5e-13), + + data(bdtrik, 'binomial_quantile_ipp-binomial_quantile_data', + (2,0,1), 3, rtol=5e-9), + data(bdtrik_comp, 'binomial_quantile_ipp-binomial_quantile_data', + (2,0,1), 4, rtol=5e-9), + + data(nbdtrik, 'negative_binomial_quantile_ipp-negative_binomial_quantile_data', + (2,0,1), 3, rtol=4e-9), + data(nbdtrik_comp, + 'negative_binomial_quantile_ipp-negative_binomial_quantile_data', + (2,0,1), 4, rtol=4e-9), + + data(pdtrik, 'poisson_quantile_ipp-poisson_quantile_data', + (1,0), 2, rtol=3e-9), + data(pdtrik_comp, 'poisson_quantile_ipp-poisson_quantile_data', + (1,0), 3, rtol=4e-9), + + data(cbrt, 'cbrt_data_ipp-cbrt_data', 1, 0), + + data(digamma, 'digamma_data_ipp-digamma_data', 0, 1), + data(digamma, 'digamma_data_ipp-digamma_data', 0j, 1), + data(digamma, 'digamma_neg_data_ipp-digamma_neg_data', 0, 1, rtol=2e-13), + data(digamma, 'digamma_neg_data_ipp-digamma_neg_data', 0j, 1, rtol=1e-13), + data(digamma, 'digamma_root_data_ipp-digamma_root_data', 0, 1, rtol=1e-15), + data(digamma, 'digamma_root_data_ipp-digamma_root_data', 0j, 1, rtol=1e-15), + data(digamma, 'digamma_small_data_ipp-digamma_small_data', 0, 1, rtol=1e-15), + data(digamma, 'digamma_small_data_ipp-digamma_small_data', 0j, 1, rtol=1e-14), + + data(ellipk_, 'ellint_k_data_ipp-ellint_k_data', 0, 1), + data(ellipkinc_, 'ellint_f_data_ipp-ellint_f_data', (0,1), 2, rtol=1e-14), + data(ellipe_, 'ellint_e_data_ipp-ellint_e_data', 0, 1), + data(ellipeinc_, 'ellint_e2_data_ipp-ellint_e2_data', (0,1), 2, rtol=1e-14), + + data(erf, 'erf_data_ipp-erf_data', 0, 1), + data(erf, 'erf_data_ipp-erf_data', 0j, 1, rtol=1e-13), + data(erfc, 'erf_data_ipp-erf_data', 0, 2, rtol=6e-15), + data(erf, 'erf_large_data_ipp-erf_large_data', 0, 1), + data(erf, 'erf_large_data_ipp-erf_large_data', 0j, 1), + data(erfc, 'erf_large_data_ipp-erf_large_data', 0, 2, rtol=4e-14), + data(erf, 'erf_small_data_ipp-erf_small_data', 0, 1), + data(erf, 'erf_small_data_ipp-erf_small_data', 0j, 1, rtol=1e-13), + data(erfc, 'erf_small_data_ipp-erf_small_data', 0, 2), + + data(erfinv, 'erf_inv_data_ipp-erf_inv_data', 0, 1), + data(erfcinv, 'erfc_inv_data_ipp-erfc_inv_data', 0, 1), + data(erfcinv, 'erfc_inv_big_data_ipp-erfc_inv_big_data', 0, 1, + param_filter=(lambda s: s > 0)), + + data(exp1, 'expint_1_data_ipp-expint_1_data', 1, 2, rtol=1e-13), + data(exp1, 'expint_1_data_ipp-expint_1_data', 1j, 2, rtol=5e-9), + data(expi, 'expinti_data_ipp-expinti_data', 0, 1, rtol=1e-13), + data(expi, 'expinti_data_double_ipp-expinti_data_double', 0, 1, rtol=1e-13), + data(expi, 'expinti_data_long_ipp-expinti_data_long', 0, 1), + + data(expn, 'expint_small_data_ipp-expint_small_data', (0,1), 2), + data(expn, 'expint_data_ipp-expint_data', (0,1), 2, rtol=1e-14), + + data(gamma, 'test_gamma_data_ipp-near_0', 0, 1), + data(gamma, 'test_gamma_data_ipp-near_1', 0, 1), + data(gamma, 'test_gamma_data_ipp-near_2', 0, 1), + data(gamma, 'test_gamma_data_ipp-near_m10', 0, 1), + data(gamma, 'test_gamma_data_ipp-near_m55', 0, 1, rtol=7e-12), + data(gamma, 'test_gamma_data_ipp-factorials', 0, 1, rtol=4e-14), + data(gamma, 'test_gamma_data_ipp-near_0', 0j, 1, rtol=2e-9), + data(gamma, 'test_gamma_data_ipp-near_1', 0j, 1, rtol=2e-9), + data(gamma, 'test_gamma_data_ipp-near_2', 0j, 1, rtol=2e-9), + data(gamma, 'test_gamma_data_ipp-near_m10', 0j, 1, rtol=2e-9), + data(gamma, 'test_gamma_data_ipp-near_m55', 0j, 1, rtol=2e-9), + data(gamma, 'test_gamma_data_ipp-factorials', 0j, 1, rtol=2e-13), + data(gammaln, 'test_gamma_data_ipp-near_0', 0, 2, rtol=5e-11), + data(gammaln, 'test_gamma_data_ipp-near_1', 0, 2, rtol=5e-11), + data(gammaln, 'test_gamma_data_ipp-near_2', 0, 2, rtol=2e-10), + data(gammaln, 'test_gamma_data_ipp-near_m10', 0, 2, rtol=5e-11), + data(gammaln, 'test_gamma_data_ipp-near_m55', 0, 2, rtol=5e-11), + data(gammaln, 'test_gamma_data_ipp-factorials', 0, 2), + + data(gammainc, 'igamma_small_data_ipp-igamma_small_data', (0,1), 5, rtol=5e-15), + data(gammainc, 'igamma_med_data_ipp-igamma_med_data', (0,1), 5, rtol=2e-13), + data(gammainc, 'igamma_int_data_ipp-igamma_int_data', (0,1), 5, rtol=2e-13), + data(gammainc, 'igamma_big_data_ipp-igamma_big_data', (0,1), 5, rtol=1e-12), + + data(gdtr_, 'igamma_small_data_ipp-igamma_small_data', (0,1), 5, rtol=1e-13), + data(gdtr_, 'igamma_med_data_ipp-igamma_med_data', (0,1), 5, rtol=2e-13), + data(gdtr_, 'igamma_int_data_ipp-igamma_int_data', (0,1), 5, rtol=2e-13), + data(gdtr_, 'igamma_big_data_ipp-igamma_big_data', (0,1), 5, rtol=2e-9), + + data(gammaincc, 'igamma_small_data_ipp-igamma_small_data', + (0,1), 3, rtol=1e-13), + data(gammaincc, 'igamma_med_data_ipp-igamma_med_data', + (0,1), 3, rtol=2e-13), + data(gammaincc, 'igamma_int_data_ipp-igamma_int_data', + (0,1), 3, rtol=4e-14), + data(gammaincc, 'igamma_big_data_ipp-igamma_big_data', + (0,1), 3, rtol=1e-11), + + data(gdtrc_, 'igamma_small_data_ipp-igamma_small_data', (0,1), 3, rtol=1e-13), + data(gdtrc_, 'igamma_med_data_ipp-igamma_med_data', (0,1), 3, rtol=2e-13), + data(gdtrc_, 'igamma_int_data_ipp-igamma_int_data', (0,1), 3, rtol=4e-14), + data(gdtrc_, 'igamma_big_data_ipp-igamma_big_data', (0,1), 3, rtol=1e-11), + + data(gdtrib_, 'igamma_inva_data_ipp-igamma_inva_data', (1,0), 2, rtol=5e-9), + data(gdtrib_comp, 'igamma_inva_data_ipp-igamma_inva_data', (1,0), 3, rtol=5e-9), + + data(poch_, 'tgamma_delta_ratio_data_ipp-tgamma_delta_ratio_data', + (0,1), 2, rtol=2e-13), + data(poch_, 'tgamma_delta_ratio_int_ipp-tgamma_delta_ratio_int', + (0,1), 2,), + data(poch_, 'tgamma_delta_ratio_int2_ipp-tgamma_delta_ratio_int2', + (0,1), 2,), + data(poch_minus, 'tgamma_delta_ratio_data_ipp-tgamma_delta_ratio_data', + (0,1), 3, rtol=2e-13), + data(poch_minus, 'tgamma_delta_ratio_int_ipp-tgamma_delta_ratio_int', + (0,1), 3), + data(poch_minus, 'tgamma_delta_ratio_int2_ipp-tgamma_delta_ratio_int2', + (0,1), 3), + + data(eval_hermite_ld, 'hermite_ipp-hermite', + (0,1), 2, rtol=2e-14), + + data(eval_laguerre_ld, 'laguerre2_ipp-laguerre2', + (0,1), 2, rtol=7e-12), + data(eval_laguerre_dd, 'laguerre2_ipp-laguerre2', + (0,1), 2, knownfailure='hyp2f1 insufficiently accurate.'), + data(eval_genlaguerre_ldd, 'laguerre3_ipp-laguerre3', + (0,1,2), 3, rtol=2e-13), + data(eval_genlaguerre_ddd, 'laguerre3_ipp-laguerre3', + (0,1,2), 3, knownfailure='hyp2f1 insufficiently accurate.'), + + data(log1p, 'log1p_expm1_data_ipp-log1p_expm1_data', 0, 1), + data(expm1, 'log1p_expm1_data_ipp-log1p_expm1_data', 0, 2), + + data(iv, 'bessel_i_data_ipp-bessel_i_data', + (0,1), 2, rtol=1e-12), + data(iv, 'bessel_i_data_ipp-bessel_i_data', + (0,1j), 2, rtol=2e-10, atol=1e-306), + data(iv, 'bessel_i_int_data_ipp-bessel_i_int_data', + (0,1), 2, rtol=1e-9), + data(iv, 'bessel_i_int_data_ipp-bessel_i_int_data', + (0,1j), 2, rtol=2e-10), + + data(ivp, 'bessel_i_prime_int_data_ipp-bessel_i_prime_int_data', + (0,1), 2, rtol=1.2e-13), + data(ivp, 'bessel_i_prime_int_data_ipp-bessel_i_prime_int_data', + (0,1j), 2, rtol=1.2e-13, atol=1e-300), + + data(jn, 'bessel_j_int_data_ipp-bessel_j_int_data', (0,1), 2, rtol=1e-12), + data(jn, 'bessel_j_int_data_ipp-bessel_j_int_data', (0,1j), 2, rtol=1e-12), + data(jn, 'bessel_j_large_data_ipp-bessel_j_large_data', (0,1), 2, rtol=6e-11), + data(jn, 'bessel_j_large_data_ipp-bessel_j_large_data', (0,1j), 2, rtol=6e-11), + + data(jv, 'bessel_j_int_data_ipp-bessel_j_int_data', (0,1), 2, rtol=1e-12), + data(jv, 'bessel_j_int_data_ipp-bessel_j_int_data', (0,1j), 2, rtol=1e-12), + data(jv, 'bessel_j_data_ipp-bessel_j_data', (0,1), 2, rtol=1e-12), + data(jv, 'bessel_j_data_ipp-bessel_j_data', (0,1j), 2, rtol=1e-12), + + data(jvp, 'bessel_j_prime_int_data_ipp-bessel_j_prime_int_data', + (0,1), 2, rtol=1e-13), + data(jvp, 'bessel_j_prime_int_data_ipp-bessel_j_prime_int_data', + (0,1j), 2, rtol=1e-13), + data(jvp, 'bessel_j_prime_large_data_ipp-bessel_j_prime_large_data', + (0,1), 2, rtol=1e-11), + data(jvp, 'bessel_j_prime_large_data_ipp-bessel_j_prime_large_data', + (0,1j), 2, rtol=2e-11), + + data(kn, 'bessel_k_int_data_ipp-bessel_k_int_data', (0,1), 2, rtol=1e-12), + + data(kv, 'bessel_k_int_data_ipp-bessel_k_int_data', (0,1), 2, rtol=1e-12), + data(kv, 'bessel_k_int_data_ipp-bessel_k_int_data', (0,1j), 2, rtol=1e-12), + data(kv, 'bessel_k_data_ipp-bessel_k_data', (0,1), 2, rtol=1e-12), + data(kv, 'bessel_k_data_ipp-bessel_k_data', (0,1j), 2, rtol=1e-12), + + data(kvp, 'bessel_k_prime_int_data_ipp-bessel_k_prime_int_data', + (0,1), 2, rtol=3e-14), + data(kvp, 'bessel_k_prime_int_data_ipp-bessel_k_prime_int_data', + (0,1j), 2, rtol=3e-14), + data(kvp, 'bessel_k_prime_data_ipp-bessel_k_prime_data', (0,1), 2, rtol=7e-14), + data(kvp, 'bessel_k_prime_data_ipp-bessel_k_prime_data', (0,1j), 2, rtol=7e-14), + + data(yn, 'bessel_y01_data_ipp-bessel_y01_data', (0,1), 2, rtol=1e-12), + data(yn, 'bessel_yn_data_ipp-bessel_yn_data', (0,1), 2, rtol=1e-12), + + data(yv, 'bessel_yn_data_ipp-bessel_yn_data', (0,1), 2, rtol=1e-12), + data(yv, 'bessel_yn_data_ipp-bessel_yn_data', (0,1j), 2, rtol=1e-12), + data(yv, 'bessel_yv_data_ipp-bessel_yv_data', (0,1), 2, rtol=1e-10), + data(yv, 'bessel_yv_data_ipp-bessel_yv_data', (0,1j), 2, rtol=1e-10), + + data(yvp, 'bessel_yv_prime_data_ipp-bessel_yv_prime_data', + (0, 1), 2, rtol=4e-9), + data(yvp, 'bessel_yv_prime_data_ipp-bessel_yv_prime_data', + (0, 1j), 2, rtol=4e-9), + + data(zeta_, 'zeta_data_ipp-zeta_data', 0, 1, + param_filter=(lambda s: s > 1)), + data(zeta_, 'zeta_neg_data_ipp-zeta_neg_data', 0, 1, + param_filter=(lambda s: s > 1)), + data(zeta_, 'zeta_1_up_data_ipp-zeta_1_up_data', 0, 1, + param_filter=(lambda s: s > 1)), + data(zeta_, 'zeta_1_below_data_ipp-zeta_1_below_data', 0, 1, + param_filter=(lambda s: s > 1)), + + data(gammaincinv, 'gamma_inv_small_data_ipp-gamma_inv_small_data', + (0,1), 2, rtol=1e-11), + data(gammaincinv, 'gamma_inv_data_ipp-gamma_inv_data', + (0,1), 2, rtol=1e-14), + data(gammaincinv, 'gamma_inv_big_data_ipp-gamma_inv_big_data', + (0,1), 2, rtol=1e-11), + + data(gammainccinv, 'gamma_inv_small_data_ipp-gamma_inv_small_data', + (0,1), 3, rtol=1e-12), + data(gammainccinv, 'gamma_inv_data_ipp-gamma_inv_data', + (0,1), 3, rtol=1e-14), + data(gammainccinv, 'gamma_inv_big_data_ipp-gamma_inv_big_data', + (0,1), 3, rtol=1e-14), + + data(gdtrix_, 'gamma_inv_small_data_ipp-gamma_inv_small_data', + (0,1), 2, rtol=3e-13, knownfailure='gdtrix unflow some points'), + data(gdtrix_, 'gamma_inv_data_ipp-gamma_inv_data', + (0,1), 2, rtol=3e-15), + data(gdtrix_, 'gamma_inv_big_data_ipp-gamma_inv_big_data', + (0,1), 2), + data(gdtrix_comp, 'gamma_inv_small_data_ipp-gamma_inv_small_data', + (0,1), 2, knownfailure='gdtrix bad some points'), + data(gdtrix_comp, 'gamma_inv_data_ipp-gamma_inv_data', + (0,1), 3, rtol=6e-15), + data(gdtrix_comp, 'gamma_inv_big_data_ipp-gamma_inv_big_data', + (0,1), 3), + + data(chndtr, 'nccs_ipp-nccs', + (2,0,1), 3, rtol=3e-5), + data(chndtr, 'nccs_big_ipp-nccs_big', + (2,0,1), 3, rtol=5e-4, knownfailure='chndtr inaccurate some points'), + + data(sph_harm_, 'spherical_harmonic_ipp-spherical_harmonic', + (1,0,3,2), (4,5), rtol=5e-11, + param_filter=(lambda p: np.ones(p.shape, '?'), + lambda p: np.ones(p.shape, '?'), + lambda p: np.logical_and(p < 2*np.pi, p >= 0), + lambda p: np.logical_and(p < np.pi, p >= 0))), + + data(spherical_jn_, 'sph_bessel_data_ipp-sph_bessel_data', + (0,1), 2, rtol=1e-13), + data(spherical_yn_, 'sph_neumann_data_ipp-sph_neumann_data', + (0,1), 2, rtol=8e-15), + + data(owens_t, 'owens_t_ipp-owens_t', + (0, 1), 2, rtol=5e-14), + data(owens_t, 'owens_t_large_data_ipp-owens_t_large_data', + (0, 1), 2, rtol=8e-12), + + # -- test data exists in boost but is not used in scipy -- + + # ibeta_derivative_data_ipp/ibeta_derivative_data.txt + # ibeta_derivative_int_data_ipp/ibeta_derivative_int_data.txt + # ibeta_derivative_large_data_ipp/ibeta_derivative_large_data.txt + # ibeta_derivative_small_data_ipp/ibeta_derivative_small_data.txt + + # bessel_y01_prime_data_ipp/bessel_y01_prime_data.txt + # bessel_yn_prime_data_ipp/bessel_yn_prime_data.txt + # sph_bessel_prime_data_ipp/sph_bessel_prime_data.txt + # sph_neumann_prime_data_ipp/sph_neumann_prime_data.txt + + # ellint_d2_data_ipp/ellint_d2_data.txt + # ellint_d_data_ipp/ellint_d_data.txt + # ellint_pi2_data_ipp/ellint_pi2_data.txt + # ellint_pi3_data_ipp/ellint_pi3_data.txt + # ellint_pi3_large_data_ipp/ellint_pi3_large_data.txt + data(elliprc, 'ellint_rc_data_ipp-ellint_rc_data', (0, 1), 2, + rtol=5e-16), + data(elliprd, 'ellint_rd_data_ipp-ellint_rd_data', (0, 1, 2), 3, + rtol=5e-16), + data(elliprd, 'ellint_rd_0xy_ipp-ellint_rd_0xy', (0, 1, 2), 3, + rtol=5e-16), + data(elliprd, 'ellint_rd_0yy_ipp-ellint_rd_0yy', (0, 1, 2), 3, + rtol=5e-16), + data(elliprd, 'ellint_rd_xxx_ipp-ellint_rd_xxx', (0, 1, 2), 3, + rtol=5e-16), + # Some of the following rtol for elliprd may be larger than 5e-16 to + # work around some hard cases in the Boost test where we get slightly + # larger error than the ideal bound when the x (==y) input is close to + # zero. + # Also the accuracy on 32-bit builds with g++ may suffer from excess + # loss of precision; see GCC bugzilla 323 + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323 + data(elliprd, 'ellint_rd_xxz_ipp-ellint_rd_xxz', (0, 1, 2), 3, + rtol=6.5e-16), + data(elliprd, 'ellint_rd_xyy_ipp-ellint_rd_xyy', (0, 1, 2), 3, + rtol=6e-16), + data(elliprf, 'ellint_rf_data_ipp-ellint_rf_data', (0, 1, 2), 3, + rtol=5e-16), + data(elliprf, 'ellint_rf_xxx_ipp-ellint_rf_xxx', (0, 1, 2), 3, + rtol=5e-16), + data(elliprf, 'ellint_rf_xyy_ipp-ellint_rf_xyy', (0, 1, 2), 3, + rtol=5e-16), + data(elliprf, 'ellint_rf_xy0_ipp-ellint_rf_xy0', (0, 1, 2), 3, + rtol=5e-16), + data(elliprf, 'ellint_rf_0yy_ipp-ellint_rf_0yy', (0, 1, 2), 3, + rtol=5e-16), + # The accuracy of R_G is primarily limited by R_D that is used + # internally. It is generally worse than R_D. Notice that we increased + # the rtol for R_G here. The cases with duplicate arguments are + # slightly less likely to be unbalanced (at least two arguments are + # already balanced) so the error bound is slightly better. Again, + # precision with g++ 32-bit is even worse. + data(elliprg, 'ellint_rg_ipp-ellint_rg', (0, 1, 2), 3, + rtol=8.0e-16), + data(elliprg, 'ellint_rg_xxx_ipp-ellint_rg_xxx', (0, 1, 2), 3, + rtol=6e-16), + data(elliprg, 'ellint_rg_xyy_ipp-ellint_rg_xyy', (0, 1, 2), 3, + rtol=7.5e-16), + data(elliprg, 'ellint_rg_xy0_ipp-ellint_rg_xy0', (0, 1, 2), 3, + rtol=5e-16), + data(elliprg, 'ellint_rg_00x_ipp-ellint_rg_00x', (0, 1, 2), 3, + rtol=5e-16), + data(elliprj, 'ellint_rj_data_ipp-ellint_rj_data', (0, 1, 2, 3), 4, + rtol=5e-16, atol=1e-25, + param_filter=(lambda s: s <= 5e-26,)), + # ellint_rc_data_ipp/ellint_rc_data.txt + # ellint_rd_0xy_ipp/ellint_rd_0xy.txt + # ellint_rd_0yy_ipp/ellint_rd_0yy.txt + # ellint_rd_data_ipp/ellint_rd_data.txt + # ellint_rd_xxx_ipp/ellint_rd_xxx.txt + # ellint_rd_xxz_ipp/ellint_rd_xxz.txt + # ellint_rd_xyy_ipp/ellint_rd_xyy.txt + # ellint_rf_0yy_ipp/ellint_rf_0yy.txt + # ellint_rf_data_ipp/ellint_rf_data.txt + # ellint_rf_xxx_ipp/ellint_rf_xxx.txt + # ellint_rf_xy0_ipp/ellint_rf_xy0.txt + # ellint_rf_xyy_ipp/ellint_rf_xyy.txt + # ellint_rg_00x_ipp/ellint_rg_00x.txt + # ellint_rg_ipp/ellint_rg.txt + # ellint_rg_xxx_ipp/ellint_rg_xxx.txt + # ellint_rg_xy0_ipp/ellint_rg_xy0.txt + # ellint_rg_xyy_ipp/ellint_rg_xyy.txt + # ellint_rj_data_ipp/ellint_rj_data.txt + # ellint_rj_e2_ipp/ellint_rj_e2.txt + # ellint_rj_e3_ipp/ellint_rj_e3.txt + # ellint_rj_e4_ipp/ellint_rj_e4.txt + # ellint_rj_zp_ipp/ellint_rj_zp.txt + + # jacobi_elliptic_ipp/jacobi_elliptic.txt + # jacobi_elliptic_small_ipp/jacobi_elliptic_small.txt + # jacobi_large_phi_ipp/jacobi_large_phi.txt + # jacobi_near_1_ipp/jacobi_near_1.txt + # jacobi_zeta_big_phi_ipp/jacobi_zeta_big_phi.txt + # jacobi_zeta_data_ipp/jacobi_zeta_data.txt + + # heuman_lambda_data_ipp/heuman_lambda_data.txt + + # hypergeometric_0F2_ipp/hypergeometric_0F2.txt + # hypergeometric_1F1_big_ipp/hypergeometric_1F1_big.txt + # hypergeometric_1F1_ipp/hypergeometric_1F1.txt + # hypergeometric_1F1_small_random_ipp/hypergeometric_1F1_small_random.txt + # hypergeometric_1F2_ipp/hypergeometric_1F2.txt + # hypergeometric_1f1_large_regularized_ipp/hypergeometric_1f1_large_regularized.txt # noqa: E501 + # hypergeometric_1f1_log_large_unsolved_ipp/hypergeometric_1f1_log_large_unsolved.txt # noqa: E501 + # hypergeometric_2F0_half_ipp/hypergeometric_2F0_half.txt + # hypergeometric_2F0_integer_a2_ipp/hypergeometric_2F0_integer_a2.txt + # hypergeometric_2F0_ipp/hypergeometric_2F0.txt + # hypergeometric_2F0_large_z_ipp/hypergeometric_2F0_large_z.txt + # hypergeometric_2F1_ipp/hypergeometric_2F1.txt + # hypergeometric_2F2_ipp/hypergeometric_2F2.txt + + # ncbeta_big_ipp/ncbeta_big.txt + # nct_small_delta_ipp/nct_small_delta.txt + # nct_asym_ipp/nct_asym.txt + # ncbeta_ipp/ncbeta.txt + + # powm1_data_ipp/powm1_big_data.txt + # powm1_sqrtp1m1_test_hpp/sqrtp1m1_data.txt + + # sinc_data_ipp/sinc_data.txt + + # test_gamma_data_ipp/gammap1m1_data.txt + # tgamma_ratio_data_ipp/tgamma_ratio_data.txt + + # trig_data_ipp/trig_data.txt + # trig_data2_ipp/trig_data2.txt +] + + +@pytest.mark.thread_unsafe +@pytest.mark.parametrize('test', BOOST_TESTS, ids=repr) +def test_boost(test): + _test_factory(test) + + +GSL_TESTS = [ + data_gsl(mathieu_a, 'mathieu_ab', (0, 1), 2, rtol=1e-13, atol=1e-13), + data_gsl(mathieu_b, 'mathieu_ab', (0, 1), 3, rtol=1e-13, atol=1e-13), + + # Also the GSL output has limited accuracy... + data_gsl(mathieu_ce_rad, 'mathieu_ce_se', (0, 1, 2), 3, rtol=1e-7, atol=1e-13), + data_gsl(mathieu_se_rad, 'mathieu_ce_se', (0, 1, 2), 4, rtol=1e-7, atol=1e-13), + + data_gsl(mathieu_mc1_scaled, 'mathieu_mc_ms', + (0, 1, 2), 3, rtol=1e-7, atol=1e-13), + data_gsl(mathieu_ms1_scaled, 'mathieu_mc_ms', + (0, 1, 2), 4, rtol=1e-7, atol=1e-13), + + data_gsl(mathieu_mc2_scaled, 'mathieu_mc_ms', + (0, 1, 2), 5, rtol=1e-7, atol=1e-13), + data_gsl(mathieu_ms2_scaled, 'mathieu_mc_ms', + (0, 1, 2), 6, rtol=1e-7, atol=1e-13), +] + + +@pytest.mark.parametrize('test', GSL_TESTS, ids=repr) +def test_gsl(test): + _test_factory(test) + + +LOCAL_TESTS = [ + data_local(ellipkinc, 'ellipkinc_neg_m', (0, 1), 2), + data_local(ellipkm1, 'ellipkm1', 0, 1), + data_local(ellipeinc, 'ellipeinc_neg_m', (0, 1), 2), + data_local(clog1p, 'log1p_expm1_complex', (0,1), (2,3), rtol=1e-14), + data_local(cexpm1, 'log1p_expm1_complex', (0,1), (4,5), rtol=1e-14), + data_local(gammainc, 'gammainc', (0, 1), 2, rtol=1e-12), + data_local(gammaincc, 'gammaincc', (0, 1), 2, rtol=1e-11), + data_local(ellip_harm_2, 'ellip',(0, 1, 2, 3, 4), 6, rtol=1e-10, atol=1e-13), + data_local(ellip_harm, 'ellip',(0, 1, 2, 3, 4), 5, rtol=1e-10, atol=1e-13), + data_local(wright_bessel, 'wright_bessel', (0, 1, 2), 3, rtol=1e-11), +] + + +@pytest.mark.parametrize('test', LOCAL_TESTS, ids=repr) +def test_local(test): + _test_factory(test) + + +def _test_factory(test, dtype=np.float64): + """Boost test""" + with suppress_warnings() as sup: + sup.filter(IntegrationWarning, "The occurrence of roundoff error is detected") + with np.errstate(all='ignore'): + test.check(dtype=dtype) diff --git a/shared/package-files/9f/9fabe5c0bb3d66326f5bbe1737987fab1d307f20ac81a31f1406a63190abb24a/blob b/shared/package-files/9f/9fabe5c0bb3d66326f5bbe1737987fab1d307f20ac81a31f1406a63190abb24a/blob new file mode 100644 index 0000000000000000000000000000000000000000..e06fdc1fa200d05b15d63e7c92b8868afac6972a Binary files /dev/null and b/shared/package-files/9f/9fabe5c0bb3d66326f5bbe1737987fab1d307f20ac81a31f1406a63190abb24a/blob differ diff --git a/shared/package-files/9f/9fad90df09845d5dd4b654f375c929f5532e2e243f77ab102aaeabf39a71e7e5/blob b/shared/package-files/9f/9fad90df09845d5dd4b654f375c929f5532e2e243f77ab102aaeabf39a71e7e5/blob new file mode 100644 index 0000000000000000000000000000000000000000..8671cd2fc5c148a3ddcc752a71bdce62ff0572dc --- /dev/null +++ b/shared/package-files/9f/9fad90df09845d5dd4b654f375c929f5532e2e243f77ab102aaeabf39a71e7e5/blob @@ -0,0 +1,87 @@ +"""Tests for distutils.version.""" +import unittest +from distutils.version import LooseVersion +from distutils.version import StrictVersion +from test.support import run_unittest + +class VersionTestCase(unittest.TestCase): + + def test_prerelease(self): + version = StrictVersion('1.2.3a1') + self.assertEqual(version.version, (1, 2, 3)) + self.assertEqual(version.prerelease, ('a', 1)) + self.assertEqual(str(version), '1.2.3a1') + + version = StrictVersion('1.2.0') + self.assertEqual(str(version), '1.2') + + def test_cmp_strict(self): + versions = (('1.5.1', '1.5.2b2', -1), + ('161', '3.10a', ValueError), + ('8.02', '8.02', 0), + ('3.4j', '1996.07.12', ValueError), + ('3.2.pl0', '3.1.1.6', ValueError), + ('2g6', '11g', ValueError), + ('0.9', '2.2', -1), + ('1.2.1', '1.2', 1), + ('1.1', '1.2.2', -1), + ('1.2', '1.1', 1), + ('1.2.1', '1.2.2', -1), + ('1.2.2', '1.2', 1), + ('1.2', '1.2.2', -1), + ('0.4.0', '0.4', 0), + ('1.13++', '5.5.kw', ValueError)) + + for v1, v2, wanted in versions: + try: + res = StrictVersion(v1)._cmp(StrictVersion(v2)) + except ValueError: + if wanted is ValueError: + continue + else: + raise AssertionError(("cmp(%s, %s) " + "shouldn't raise ValueError") + % (v1, v2)) + self.assertEqual(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + res = StrictVersion(v1)._cmp(v2) + self.assertEqual(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + res = StrictVersion(v1)._cmp(object()) + self.assertIs(res, NotImplemented, + 'cmp(%s, %s) should be NotImplemented, got %s' % + (v1, v2, res)) + + + def test_cmp(self): + versions = (('1.5.1', '1.5.2b2', -1), + ('161', '3.10a', 1), + ('8.02', '8.02', 0), + ('3.4j', '1996.07.12', -1), + ('3.2.pl0', '3.1.1.6', 1), + ('2g6', '11g', -1), + ('0.960923', '2.2beta29', -1), + ('1.13++', '5.5.kw', -1)) + + + for v1, v2, wanted in versions: + res = LooseVersion(v1)._cmp(LooseVersion(v2)) + self.assertEqual(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + res = LooseVersion(v1)._cmp(v2) + self.assertEqual(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + res = LooseVersion(v1)._cmp(object()) + self.assertIs(res, NotImplemented, + 'cmp(%s, %s) should be NotImplemented, got %s' % + (v1, v2, res)) + +def test_suite(): + return unittest.makeSuite(VersionTestCase) + +if __name__ == "__main__": + run_unittest(test_suite()) diff --git a/shared/package-files/9f/9fb0a8008e1ab5171419ed12c9d8e20c3646762393e2d532a9536421d8fdba71/blob b/shared/package-files/9f/9fb0a8008e1ab5171419ed12c9d8e20c3646762393e2d532a9536421d8fdba71/blob new file mode 100644 index 0000000000000000000000000000000000000000..fdbf44b7c04c0bac689bb16e864b8ffeefeed957 --- /dev/null +++ b/shared/package-files/9f/9fb0a8008e1ab5171419ed12c9d8e20c3646762393e2d532a9536421d8fdba71/blob @@ -0,0 +1,26 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace cuda { + +TORCH_API at::Tensor index_add(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source, const at::Scalar & alpha=1); +TORCH_API at::Tensor & index_add_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source, const at::Scalar & alpha=1); +TORCH_API at::Tensor & index_add_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source, const at::Scalar & alpha, at::Tensor & out); +TORCH_API at::Tensor & index_add_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source, const at::Scalar & alpha=1); + +} // namespace cuda +} // namespace at diff --git a/shared/package-files/9f/9fb13d3870add1108426cec6d70324d888aff6afc5c6e31f8987fcb0bfe0db2e/blob b/shared/package-files/9f/9fb13d3870add1108426cec6d70324d888aff6afc5c6e31f8987fcb0bfe0db2e/blob new file mode 100644 index 0000000000000000000000000000000000000000..89e6fa63619746d28a3b513866c501ab3b34038d --- /dev/null +++ b/shared/package-files/9f/9fb13d3870add1108426cec6d70324d888aff6afc5c6e31f8987fcb0bfe0db2e/blob @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor expand_as(const at::Tensor & self, const at::Tensor & other); +} // namespace native +} // namespace at diff --git a/shared/package-files/9f/9fb30d607c3b8b4df0e197154cce8692844ded8ed4206c67b218c7a61d9e0cfb/blob b/shared/package-files/9f/9fb30d607c3b8b4df0e197154cce8692844ded8ed4206c67b218c7a61d9e0cfb/blob new file mode 100644 index 0000000000000000000000000000000000000000..02edf1a09387766d71097ea0baedc2640cfb824b --- /dev/null +++ b/shared/package-files/9f/9fb30d607c3b8b4df0e197154cce8692844ded8ed4206c67b218c7a61d9e0cfb/blob @@ -0,0 +1,222 @@ +import numpy as np +import pytest + +from pandas._libs.tslibs.dtypes import NpyDatetimeUnit +from pandas._libs.tslibs.np_datetime import ( + OutOfBoundsDatetime, + OutOfBoundsTimedelta, + astype_overflowsafe, + is_unitless, + py_get_unit_from_dtype, + py_td64_to_tdstruct, +) + +import pandas._testing as tm + + +def test_is_unitless(): + dtype = np.dtype("M8[ns]") + assert not is_unitless(dtype) + + dtype = np.dtype("datetime64") + assert is_unitless(dtype) + + dtype = np.dtype("m8[ns]") + assert not is_unitless(dtype) + + dtype = np.dtype("timedelta64") + assert is_unitless(dtype) + + msg = "dtype must be datetime64 or timedelta64" + with pytest.raises(ValueError, match=msg): + is_unitless(np.dtype(np.int64)) + + msg = "Argument 'dtype' has incorrect type" + with pytest.raises(TypeError, match=msg): + is_unitless("foo") + + +def test_get_unit_from_dtype(): + # datetime64 + assert py_get_unit_from_dtype(np.dtype("M8[Y]")) == NpyDatetimeUnit.NPY_FR_Y.value + assert py_get_unit_from_dtype(np.dtype("M8[M]")) == NpyDatetimeUnit.NPY_FR_M.value + assert py_get_unit_from_dtype(np.dtype("M8[W]")) == NpyDatetimeUnit.NPY_FR_W.value + # B has been deprecated and removed -> no 3 + assert py_get_unit_from_dtype(np.dtype("M8[D]")) == NpyDatetimeUnit.NPY_FR_D.value + assert py_get_unit_from_dtype(np.dtype("M8[h]")) == NpyDatetimeUnit.NPY_FR_h.value + assert py_get_unit_from_dtype(np.dtype("M8[m]")) == NpyDatetimeUnit.NPY_FR_m.value + assert py_get_unit_from_dtype(np.dtype("M8[s]")) == NpyDatetimeUnit.NPY_FR_s.value + assert py_get_unit_from_dtype(np.dtype("M8[ms]")) == NpyDatetimeUnit.NPY_FR_ms.value + assert py_get_unit_from_dtype(np.dtype("M8[us]")) == NpyDatetimeUnit.NPY_FR_us.value + assert py_get_unit_from_dtype(np.dtype("M8[ns]")) == NpyDatetimeUnit.NPY_FR_ns.value + assert py_get_unit_from_dtype(np.dtype("M8[ps]")) == NpyDatetimeUnit.NPY_FR_ps.value + assert py_get_unit_from_dtype(np.dtype("M8[fs]")) == NpyDatetimeUnit.NPY_FR_fs.value + assert py_get_unit_from_dtype(np.dtype("M8[as]")) == NpyDatetimeUnit.NPY_FR_as.value + + # timedelta64 + assert py_get_unit_from_dtype(np.dtype("m8[Y]")) == NpyDatetimeUnit.NPY_FR_Y.value + assert py_get_unit_from_dtype(np.dtype("m8[M]")) == NpyDatetimeUnit.NPY_FR_M.value + assert py_get_unit_from_dtype(np.dtype("m8[W]")) == NpyDatetimeUnit.NPY_FR_W.value + # B has been deprecated and removed -> no 3 + assert py_get_unit_from_dtype(np.dtype("m8[D]")) == NpyDatetimeUnit.NPY_FR_D.value + assert py_get_unit_from_dtype(np.dtype("m8[h]")) == NpyDatetimeUnit.NPY_FR_h.value + assert py_get_unit_from_dtype(np.dtype("m8[m]")) == NpyDatetimeUnit.NPY_FR_m.value + assert py_get_unit_from_dtype(np.dtype("m8[s]")) == NpyDatetimeUnit.NPY_FR_s.value + assert py_get_unit_from_dtype(np.dtype("m8[ms]")) == NpyDatetimeUnit.NPY_FR_ms.value + assert py_get_unit_from_dtype(np.dtype("m8[us]")) == NpyDatetimeUnit.NPY_FR_us.value + assert py_get_unit_from_dtype(np.dtype("m8[ns]")) == NpyDatetimeUnit.NPY_FR_ns.value + assert py_get_unit_from_dtype(np.dtype("m8[ps]")) == NpyDatetimeUnit.NPY_FR_ps.value + assert py_get_unit_from_dtype(np.dtype("m8[fs]")) == NpyDatetimeUnit.NPY_FR_fs.value + assert py_get_unit_from_dtype(np.dtype("m8[as]")) == NpyDatetimeUnit.NPY_FR_as.value + + +def test_td64_to_tdstruct(): + val = 12454636234 # arbitrary value + + res1 = py_td64_to_tdstruct(val, NpyDatetimeUnit.NPY_FR_ns.value) + exp1 = { + "days": 0, + "hrs": 0, + "min": 0, + "sec": 12, + "ms": 454, + "us": 636, + "ns": 234, + "seconds": 12, + "microseconds": 454636, + "nanoseconds": 234, + } + assert res1 == exp1 + + res2 = py_td64_to_tdstruct(val, NpyDatetimeUnit.NPY_FR_us.value) + exp2 = { + "days": 0, + "hrs": 3, + "min": 27, + "sec": 34, + "ms": 636, + "us": 234, + "ns": 0, + "seconds": 12454, + "microseconds": 636234, + "nanoseconds": 0, + } + assert res2 == exp2 + + res3 = py_td64_to_tdstruct(val, NpyDatetimeUnit.NPY_FR_ms.value) + exp3 = { + "days": 144, + "hrs": 3, + "min": 37, + "sec": 16, + "ms": 234, + "us": 0, + "ns": 0, + "seconds": 13036, + "microseconds": 234000, + "nanoseconds": 0, + } + assert res3 == exp3 + + # Note this out of bounds for nanosecond Timedelta + res4 = py_td64_to_tdstruct(val, NpyDatetimeUnit.NPY_FR_s.value) + exp4 = { + "days": 144150, + "hrs": 21, + "min": 10, + "sec": 34, + "ms": 0, + "us": 0, + "ns": 0, + "seconds": 76234, + "microseconds": 0, + "nanoseconds": 0, + } + assert res4 == exp4 + + +class TestAstypeOverflowSafe: + def test_pass_non_dt64_array(self): + # check that we raise, not segfault + arr = np.arange(5) + dtype = np.dtype("M8[ns]") + + msg = ( + "astype_overflowsafe values.dtype and dtype must be either " + "both-datetime64 or both-timedelta64" + ) + with pytest.raises(TypeError, match=msg): + astype_overflowsafe(arr, dtype, copy=True) + + with pytest.raises(TypeError, match=msg): + astype_overflowsafe(arr, dtype, copy=False) + + def test_pass_non_dt64_dtype(self): + # check that we raise, not segfault + arr = np.arange(5, dtype="i8").view("M8[D]") + dtype = np.dtype("m8[ns]") + + msg = ( + "astype_overflowsafe values.dtype and dtype must be either " + "both-datetime64 or both-timedelta64" + ) + with pytest.raises(TypeError, match=msg): + astype_overflowsafe(arr, dtype, copy=True) + + with pytest.raises(TypeError, match=msg): + astype_overflowsafe(arr, dtype, copy=False) + + def test_astype_overflowsafe_dt64(self): + dtype = np.dtype("M8[ns]") + + dt = np.datetime64("2262-04-05", "D") + arr = dt + np.arange(10, dtype="m8[D]") + + # arr.astype silently overflows, so this + wrong = arr.astype(dtype) + roundtrip = wrong.astype(arr.dtype) + assert not (wrong == roundtrip).all() + + msg = "Out of bounds nanosecond timestamp" + with pytest.raises(OutOfBoundsDatetime, match=msg): + astype_overflowsafe(arr, dtype) + + # But converting to microseconds is fine, and we match numpy's results. + dtype2 = np.dtype("M8[us]") + result = astype_overflowsafe(arr, dtype2) + expected = arr.astype(dtype2) + tm.assert_numpy_array_equal(result, expected) + + def test_astype_overflowsafe_td64(self): + dtype = np.dtype("m8[ns]") + + dt = np.datetime64("2262-04-05", "D") + arr = dt + np.arange(10, dtype="m8[D]") + arr = arr.view("m8[D]") + + # arr.astype silently overflows, so this + wrong = arr.astype(dtype) + roundtrip = wrong.astype(arr.dtype) + assert not (wrong == roundtrip).all() + + msg = r"Cannot convert 106752 days to timedelta64\[ns\] without overflow" + with pytest.raises(OutOfBoundsTimedelta, match=msg): + astype_overflowsafe(arr, dtype) + + # But converting to microseconds is fine, and we match numpy's results. + dtype2 = np.dtype("m8[us]") + result = astype_overflowsafe(arr, dtype2) + expected = arr.astype(dtype2) + tm.assert_numpy_array_equal(result, expected) + + def test_astype_overflowsafe_disallow_rounding(self): + arr = np.array([-1500, 1500], dtype="M8[ns]") + dtype = np.dtype("M8[us]") + + msg = "Cannot losslessly cast '-1500 ns' to us" + with pytest.raises(ValueError, match=msg): + astype_overflowsafe(arr, dtype, round_ok=False) + + result = astype_overflowsafe(arr, dtype, round_ok=True) + expected = arr.astype(dtype) + tm.assert_numpy_array_equal(result, expected) diff --git a/shared/package-files/9f/9fc4ee6204143dca223e10eb41605adc871d8ee98f28a28c692b5818be1e660d/blob b/shared/package-files/9f/9fc4ee6204143dca223e10eb41605adc871d8ee98f28a28c692b5818be1e660d/blob new file mode 100644 index 0000000000000000000000000000000000000000..828680f95a3d47eb0eba605d42ee2f4ce2206b88 --- /dev/null +++ b/shared/package-files/9f/9fc4ee6204143dca223e10eb41605adc871d8ee98f28a28c692b5818be1e660d/blob @@ -0,0 +1,2108 @@ +# Generated automatically from Makefile.pre by makesetup. +# Top-level Makefile for Python +# +# As distributed, this file is called Makefile.pre.in; it is processed +# into the real Makefile by running the script ./configure, which +# replaces things like @spam@ with values appropriate for your system. +# This means that if you edit Makefile, your changes get lost the next +# time you run the configure script. Ideally, you can do: +# +# ./configure +# make +# make test +# make install +# +# If you have a previous version of Python installed that you don't +# want to overwrite, you can use "make altinstall" instead of "make +# install". Refer to the "Installing" section in the README file for +# additional details. +# +# See also the section "Build instructions" in the README file. + +# === Variables set by makesetup === + +MODBUILT_NAMES= posix errno pwd _sre _codecs _weakref _functools _operator _collections _abc itertools atexit _signal _stat time _thread _locale _io faulthandler _tracemalloc _symtable xxsubtype +MODDISABLED_NAMES= +MODOBJS= Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/_operator.o Modules/_collectionsmodule.o Modules/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/symtablemodule.o Modules/xxsubtype.o +MODLIBS= $(LOCALMODLIBS) $(BASEMODLIBS) + +# === Variables set by configure +VERSION= 3.10 +srcdir= /croot/python-split_1711037784081/work +VPATH= /croot/python-split_1711037784081/work +abs_srcdir= /croot/python-split_1711037784081/work +abs_builddir= /croot/python-split_1711037784081/work/build-static + + +CC= x86_64-conda-linux-gnu-gcc -pthread +CXX= x86_64-conda-linux-gnu-c++ -pthread +MAINCC= $(CC) +LINKCC= $(PURIFY) $(MAINCC) +AR= x86_64-conda-linux-gnu-ar +READELF= x86_64-conda-linux-gnu-readelf +SOABI= cpython-310-x86_64-linux-gnu +LDVERSION= $(VERSION)$(ABIFLAGS) +LIBPYTHON= +GITVERSION= +GITTAG= +GITBRANCH= +PGO_PROF_GEN_FLAG=-fprofile-generate +PGO_PROF_USE_FLAG= +LLVM_PROF_MERGER=true +LLVM_PROF_FILE= +LLVM_PROF_ERR=no +DTRACE= +DFLAGS= +DTRACE_HEADERS= +DTRACE_OBJS= + +GNULD= yes + +# Shell used by make (some versions default to the login shell, which is bad) +SHELL= /bin/sh + +# Use this to make a link between python$(VERSION) and python in $(BINDIR) +LN= ln + +# Portable install script (configure doesn't always guess right) +INSTALL= /usr/bin/install -c +INSTALL_PROGRAM=${INSTALL} +INSTALL_SCRIPT= ${INSTALL} +INSTALL_DATA= ${INSTALL} -m 644 +# Shared libraries must be installed with executable mode on some systems; +# rather than figuring out exactly which, we always give them executable mode. +INSTALL_SHARED= ${INSTALL} -m 755 + +MKDIR_P= /usr/bin/mkdir -p + +MAKESETUP= $(srcdir)/Modules/makesetup + +# Compiler options +OPT= -DNDEBUG -fwrapv -O2 -Wall +BASECFLAGS= -Wno-unused-result -Wsign-compare +BASECPPFLAGS= -IObjects -IInclude -IPython +CONFIGURE_CFLAGS= -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /opt/conda/include -fdebug-prefix-map=/croot/python-split_1711037784081/work=/usr/local/src/conda/python-3.10.14 -fdebug-prefix-map=/opt/conda=/usr/local/src/conda-prefix +# CFLAGS_NODIST is used for building the interpreter and stdlib C extensions. +# Use it when a compiler flag should _not_ be part of the distutils CFLAGS +# once Python is installed (Issue #21121). +CONFIGURE_CFLAGS_NODIST= -fno-semantic-interposition -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden +# LDFLAGS_NODIST is used in the same manner as CFLAGS_NODIST. +# Use it when a linker flag should _not_ be part of the distutils LDFLAGS +# once Python is installed (bpo-35257) +CONFIGURE_LDFLAGS_NODIST= -fno-semantic-interposition -g +CONFIGURE_CPPFLAGS= -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /opt/conda/include -I/opt/conda/include +CONFIGURE_LDFLAGS= -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/opt/conda/lib -Wl,-rpath-link,/opt/conda/lib -L/opt/conda/lib +# Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the +# command line to append to these values without stomping the pre-set +# values. +PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) +PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal +# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to +# be able to build extension modules using the directories specified in the +# environment variables +PY_CPPFLAGS= $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS) +PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS) +PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST) +NO_AS_NEEDED= -Wl,--no-as-needed +CCSHARED= -fPIC +# LINKFORSHARED are the flags passed to the $(CC) command that links +# the python executable -- this is only needed for a few systems +LINKFORSHARED= -Xlinker -export-dynamic +ARFLAGS= rcs +# Extra C flags added for building the interpreter object files. +CFLAGSFORSHARED= +# C flags used for building the interpreter object files +PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) +PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN +PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE +# Linker flags used for building the interpreter object files +PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST) +# Strict or non-strict aliasing flags used to compile dtoa.c, see above +CFLAGS_ALIASING= + + +# Machine-dependent subdirectories +MACHDEP= linux + +# Multiarch directory (may be empty) +MULTIARCH= x86_64-linux-gnu +MULTIARCH_CPPFLAGS = -DMULTIARCH=\"x86_64-linux-gnu\" + +# Install prefix for architecture-independent files +prefix= /opt/conda + +# Install prefix for architecture-dependent files +exec_prefix= ${prefix} + +# Install prefix for data files +datarootdir= ${prefix}/share + +# Expanded directories +BINDIR= ${exec_prefix}/bin +LIBDIR= ${exec_prefix}/lib +MANDIR= ${datarootdir}/man +INCLUDEDIR= ${prefix}/include +CONFINCLUDEDIR= $(exec_prefix)/include +PLATLIBDIR= lib +SCRIPTDIR= $(prefix)/$(PLATLIBDIR) +ABIFLAGS= +# Variable used by ensurepip +WHEEL_PKG_DIR= + +# Detailed destination directories +BINLIBDEST= ${exec_prefix}/${PLATLIBDIR}/python$(VERSION) +LIBDEST= $(SCRIPTDIR)/python$(VERSION) +INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION) +CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION) + +# Symbols used for using shared libraries +SHLIB_SUFFIX= .so +EXT_SUFFIX= .cpython-310-x86_64-linux-gnu.so +LDSHARED= $(CC) -shared $(PY_LDFLAGS) +BLDSHARED= $(CC) -shared $(PY_CORE_LDFLAGS) +LDCXXSHARED= $(CXX) -shared +DESTSHARED= $(BINLIBDEST)/lib-dynload + +# List of exported symbols for AIX +EXPORTSYMS= +EXPORTSFROM= + +# Executable suffix (.exe on Windows and Mac OS X) +EXE= +BUILDEXE= + +# Short name and location for Mac OS X Python framework +UNIVERSALSDK= +PYTHONFRAMEWORK= +PYTHONFRAMEWORKDIR= no-framework +PYTHONFRAMEWORKPREFIX= +PYTHONFRAMEWORKINSTALLDIR= +# Deployment target selected during configure, to be checked +# by distutils. The export statement is needed to ensure that the +# deployment target is active during build. +MACOSX_DEPLOYMENT_TARGET= +#export MACOSX_DEPLOYMENT_TARGET + +# Option to install to strip binaries +STRIPFLAG=-s + +# Flags to lipo to produce a 32-bit-only universal executable +LIPO_32BIT_FLAGS= + +# Flags to lipo to produce an intel-64-only universal executable +LIPO_INTEL64_FLAGS= + +# Options to enable prebinding (for fast startup prior to Mac OS X 10.3) +OTHER_LIBTOOL_OPT= + +# Environment to run shared python without installed libraries +RUNSHARED= + +# ensurepip options +ENSUREPIP= no + +# OpenSSL options for setup.py so sysconfig can pick up AC_SUBST() vars. +OPENSSL_INCLUDES=-I/opt/conda/include +OPENSSL_LIBS=-lssl -lcrypto +OPENSSL_LDFLAGS=-L/opt/conda/lib +OPENSSL_RPATH= + +# Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var +TZPATH=/opt/conda/share/zoneinfo + +# Modes for directories, executables and data files created by the +# install process. Default to user-only-writable for all file types. +DIRMODE= 755 +EXEMODE= 755 +FILEMODE= 644 + +# configure script arguments +CONFIG_ARGS= '--prefix=/opt/conda' '--build=x86_64-conda-linux-gnu' '--host=x86_64-conda-linux-gnu' '--enable-ipv6' '--with-ensurepip=no' '--with-tzpath=/opt/conda/share/zoneinfo' '--with-computed-gotos' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-tcltk-includes=-I/opt/conda/include' '--with-tcltk-libs=-L/opt/conda/lib -ltcl8.6 -ltk8.6' '--with-platlibdir=lib' '--with-lto' '--enable-optimizations' '-oldincludedir=/croot/python-split_1711037784081/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include' '--disable-shared' 'PROFILE_TASK=-m test --pgo' 'build_alias=x86_64-conda-linux-gnu' 'host_alias=x86_64-conda-linux-gnu' 'MACHDEP=linux' 'CC=x86_64-conda-linux-gnu-gcc' 'CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /opt/conda/include -fdebug-prefix-map=/croot/python-split_1711037784081/work=/usr/local/src/conda/python-3.10.14 -fdebug-prefix-map=/opt/conda=/usr/local/src/conda-prefix ' 'LDFLAGS=-Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/opt/conda/lib -Wl,-rpath-link,/opt/conda/lib -L/opt/conda/lib' 'CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /opt/conda/include -I/opt/conda/include' 'CPP=/croot/python-split_1711037784081/_build_env/bin/x86_64-conda-linux-gnu-cpp' 'PKG_CONFIG_PATH=/opt/conda/lib/pkgconfig' + + +# Subdirectories with code +SRCDIRS= Parser Objects Python Modules Modules/_io Programs + +# Other subdirectories +SUBDIRSTOO= Include Lib Misc + +# Files and directories to be distributed +CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in +DISTFILES= README.rst ChangeLog $(CONFIGFILES) +DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy +DIST= $(DISTFILES) $(DISTDIRS) + + +LIBRARY= libpython$(VERSION)$(ABIFLAGS).a +LDLIBRARY= libpython$(VERSION)$(ABIFLAGS).a +BLDLIBRARY= $(LDLIBRARY) +PY3LIBRARY= +DLLLIBRARY= +LDLIBRARYDIR= +INSTSONAME= $(LDLIBRARY) +LIBRARY_DEPS= $(LIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) +PY_ENABLE_SHARED= 0 +STATIC_LIBPYTHON= 1 + + +LIBS= -lcrypt -lpthread -ldl -lutil -lm +LIBM= -lm +LIBC= +SYSLIBS= $(LIBM) $(LIBC) +SHLIBS= $(LIBS) + +DLINCLDIR= . +DYNLOADFILE= dynload_shlib.o +MACHDEP_OBJS= +LIBOBJDIR= Python/ +LIBOBJS= + +PYTHON= python$(EXE) +BUILDPYTHON= python$(BUILDEXE) + +PYTHON_FOR_REGEN?=python3 +UPDATE_FILE=$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/update_file.py +PY_BUILD_ENVIRON= +PYTHON_FOR_BUILD=./$(BUILDPYTHON) -E +_PYTHON_HOST_PLATFORM=linux-x86_64 +BUILD_GNU_TYPE= x86_64-conda-linux-gnu +HOST_GNU_TYPE= x86_64-conda-linux-gnu + +# Tcl and Tk config info from --with-tcltk-includes and -libs options +TCLTK_INCLUDES= -I/opt/conda/include +TCLTK_LIBS= -L/opt/conda/lib -ltcl8.6 -ltk8.6 + +# The task to run while instrumented when building the profile-opt target. +# To speed up profile generation, we don't run the full unit test suite +# by default. The default is "-m test --pgo". To run more tests, use +# PROFILE_TASK="-m test --pgo-extended" +PROFILE_TASK= -m test --pgo + +# report files for gcov / lcov coverage report +COVERAGE_INFO= $(abs_builddir)/coverage.info +COVERAGE_REPORT=$(abs_builddir)/lcov-report +COVERAGE_REPORT_OPTIONS=--no-branch-coverage --title "CPython lcov report" + + +# === Definitions added by makesetup === + +LOCALMODLIBS= +BASEMODLIBS= +PYTHONPATH=$(COREPYTHONPATH) +COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH) +TESTPATH= +SITEPATH= +DESTPATH= +MACHDESTLIB=$(BINLIBDEST) +DESTLIB=$(LIBDEST) + + + +########################################################################## +# Modules +MODULE_OBJS= \ + Modules/config.o \ + Modules/getpath.o \ + Modules/main.o \ + Modules/gcmodule.o + +IO_H= Modules/_io/_iomodule.h + +IO_OBJS= \ + Modules/_io/_iomodule.o \ + Modules/_io/iobase.o \ + Modules/_io/fileio.o \ + Modules/_io/bufferedio.o \ + Modules/_io/textio.o \ + Modules/_io/bytesio.o \ + Modules/_io/stringio.o + +########################################################################## + +LIBFFI_INCLUDEDIR= /opt/conda/include + +########################################################################## +# Parser + +PEGEN_OBJS= \ + Parser/pegen.o \ + Parser/parser.o \ + Parser/string_parser.o \ + Parser/peg_api.o + + +PEGEN_HEADERS= \ + $(srcdir)/Include/internal/pycore_parser.h \ + $(srcdir)/Parser/pegen.h \ + $(srcdir)/Parser/string_parser.h + +POBJS= \ + Parser/token.o \ + +PARSER_OBJS= $(POBJS) $(PEGEN_OBJS) Parser/myreadline.o Parser/tokenizer.o + +PARSER_HEADERS= \ + $(PEGEN_HEADERS) \ + $(srcdir)/Parser/tokenizer.h + +########################################################################## +# Python + +PYTHON_OBJS= \ + Python/_warnings.o \ + Python/Python-ast.o \ + Python/asdl.o \ + Python/ast.o \ + Python/ast_opt.o \ + Python/ast_unparse.o \ + Python/bltinmodule.o \ + Python/ceval.o \ + Python/codecs.o \ + Python/compile.o \ + Python/context.o \ + Python/dynamic_annotations.o \ + Python/errors.o \ + Python/frozenmain.o \ + Python/future.o \ + Python/getargs.o \ + Python/getcompiler.o \ + Python/getcopyright.o \ + Python/getplatform.o \ + Python/getversion.o \ + Python/hamt.o \ + Python/hashtable.o \ + Python/import.o \ + Python/importdl.o \ + Python/initconfig.o \ + Python/marshal.o \ + Python/modsupport.o \ + Python/mysnprintf.o \ + Python/mystrtoul.o \ + Python/pathconfig.o \ + Python/preconfig.o \ + Python/pyarena.o \ + Python/pyctype.o \ + Python/pyfpe.o \ + Python/pyhash.o \ + Python/pylifecycle.o \ + Python/pymath.o \ + Python/pystate.o \ + Python/pythonrun.o \ + Python/pytime.o \ + Python/bootstrap_hash.o \ + Python/structmember.o \ + Python/symtable.o \ + Python/sysmodule.o \ + Python/thread.o \ + Python/traceback.o \ + Python/getopt.o \ + Python/pystrcmp.o \ + Python/pystrtod.o \ + Python/pystrhex.o \ + Python/dtoa.o \ + Python/formatter_unicode.o \ + Python/fileutils.o \ + Python/suggestions.o \ + Python/$(DYNLOADFILE) \ + $(LIBOBJS) \ + $(MACHDEP_OBJS) \ + $(DTRACE_OBJS) + + +########################################################################## +# Objects +OBJECT_OBJS= \ + Objects/abstract.o \ + Objects/accu.o \ + Objects/boolobject.o \ + Objects/bytes_methods.o \ + Objects/bytearrayobject.o \ + Objects/bytesobject.o \ + Objects/call.o \ + Objects/capsule.o \ + Objects/cellobject.o \ + Objects/classobject.o \ + Objects/codeobject.o \ + Objects/complexobject.o \ + Objects/descrobject.o \ + Objects/enumobject.o \ + Objects/exceptions.o \ + Objects/genericaliasobject.o \ + Objects/genobject.o \ + Objects/fileobject.o \ + Objects/floatobject.o \ + Objects/frameobject.o \ + Objects/funcobject.o \ + Objects/interpreteridobject.o \ + Objects/iterobject.o \ + Objects/listobject.o \ + Objects/longobject.o \ + Objects/dictobject.o \ + Objects/odictobject.o \ + Objects/memoryobject.o \ + Objects/methodobject.o \ + Objects/moduleobject.o \ + Objects/namespaceobject.o \ + Objects/object.o \ + Objects/obmalloc.o \ + Objects/picklebufobject.o \ + Objects/rangeobject.o \ + Objects/setobject.o \ + Objects/sliceobject.o \ + Objects/structseq.o \ + Objects/tupleobject.o \ + Objects/typeobject.o \ + Objects/unicodeobject.o \ + Objects/unicodectype.o \ + Objects/unionobject.o \ + Objects/weakrefobject.o + +########################################################################## +# objects that get linked into the Python library +LIBRARY_OBJS_OMIT_FROZEN= \ + Modules/getbuildinfo.o \ + $(PARSER_OBJS) \ + $(OBJECT_OBJS) \ + $(PYTHON_OBJS) \ + $(MODULE_OBJS) \ + $(MODOBJS) + +LIBRARY_OBJS= \ + $(LIBRARY_OBJS_OMIT_FROZEN) \ + Python/frozen.o + +########################################################################## +# DTrace + +# On some systems, object files that reference DTrace probes need to be modified +# in-place by dtrace(1). +DTRACE_DEPS = \ + Python/ceval.o Python/import.o Python/sysmodule.o Modules/gcmodule.o + +######################################################################### +# Rules + +# Default target +all: profile-opt +build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks \ + Programs/_testembed python-config + +# Check that the source is clean when building out of source. +check-clean-src: + @if test -n "$(VPATH)" -a -f "$(srcdir)/Programs/python.o"; then \ + echo "Error: The source directory ($(srcdir)) is not clean" ; \ + echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \ + echo "Try to run: make -C \"$(srcdir)\" clean" ; \ + exit 1; \ + fi + +# Profile generation build must start from a clean tree. +profile-clean-stamp: + $(MAKE) clean + touch $@ + +# Compile with profile generation enabled. +profile-gen-stamp: profile-clean-stamp + @if [ $(LLVM_PROF_ERR) = yes ]; then \ + echo "Error: Cannot perform PGO build because llvm-profdata was not found in PATH" ;\ + echo "Please add it to PATH and run ./configure again" ;\ + exit 1;\ + fi + @echo "Building with support for profile generation:" + $(MAKE) build_all_generate_profile + touch $@ + +# Run task with profile generation build to create profile information. +profile-run-stamp: + @echo "Running code to generate profile data (this can take a while):" + # First, we need to create a clean build with profile generation + # enabled. + $(MAKE) profile-gen-stamp + # Next, run the profile task to generate the profile information. + $(MAKE) run_profile_task + $(MAKE) build_all_merge_profile + # Remove profile generation binary since we are done with it. + $(MAKE) clean-retain-profile + # This is an expensive target to build and it does not have proper + # makefile dependency information. So, we create a "stamp" file + # to record its completion and avoid re-running it. + touch $@ + +build_all_generate_profile: + $(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)" + +run_profile_task: + @ # FIXME: can't run for a cross build + $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true + +build_all_merge_profile: + $(LLVM_PROF_MERGER) + +# Compile Python binary with profile guided optimization. +# To force re-running of the profile task, remove the profile-run-stamp file. +profile-opt: profile-run-stamp + @echo "Rebuilding with profile guided optimizations:" + -rm -f profile-clean-stamp + $(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)" + +# Compile and run with gcov +.PHONY=coverage coverage-lcov coverage-report +coverage: + @echo "Building with support for coverage checking:" + $(MAKE) clean + $(MAKE) build_all CFLAGS="$(CFLAGS) -O0 -pg --coverage" LIBS="$(LIBS) --coverage" + +coverage-lcov: + @echo "Creating Coverage HTML report with LCOV:" + @rm -f $(COVERAGE_INFO) + @rm -rf $(COVERAGE_REPORT) + @lcov --capture --directory $(abs_builddir) \ + --base-directory $(realpath $(abs_builddir)) \ + --path $(realpath $(abs_srcdir)) \ + --output-file $(COVERAGE_INFO) + @ # remove 3rd party modules, system headers and internal files with + @ # debug, test or dummy functions. + @lcov --remove $(COVERAGE_INFO) \ + '*/Modules/_blake2/impl/*' \ + '*/Modules/_ctypes/libffi*/*' \ + '*/Modules/_decimal/libmpdec/*' \ + '*/Modules/_sha3/kcp/*' \ + '*/Modules/expat/*' \ + '*/Modules/zlib/*' \ + '*/Include/*' \ + '*/Modules/xx*.c' \ + '*/Python/pyfpe.c' \ + '*/Python/pystrcmp.c' \ + '/usr/include/*' \ + '/usr/local/include/*' \ + '/usr/lib/gcc/*' \ + --output-file $(COVERAGE_INFO) + @genhtml $(COVERAGE_INFO) --output-directory $(COVERAGE_REPORT) \ + $(COVERAGE_REPORT_OPTIONS) + @echo + @echo "lcov report at $(COVERAGE_REPORT)/index.html" + @echo + +# Force regeneration of parser and importlib +coverage-report: regen-token regen-importlib + @ # build with coverage info + $(MAKE) coverage + @ # run tests, ignore failures + $(TESTRUNNER) $(TESTOPTS) || true + @ # build lcov report + $(MAKE) coverage-lcov + +# Run "Argument Clinic" over all source files +.PHONY=clinic +clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir) + +# Build the interpreter +$(BUILDPYTHON): Programs/python.o $(LIBRARY_DEPS) + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) + +platform: $(BUILDPYTHON) pybuilddir.txt + $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform + +# Create build directory and generate the sysconfig build-time data there. +# pybuilddir.txt contains the name of the build dir and is used for +# sys.path fixup -- see Modules/getpath.c. +# Since this step runs before shared modules are built, try to avoid bootstrap +# problems by creating a dummy pybuilddir.txt just to allow interpreter +# initialization to succeed. It will be overwritten by generate-posix-vars +# or removed in case of failure. +pybuilddir.txt: $(BUILDPYTHON) + @echo "none" > ./pybuilddir.txt + $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\ + if test $$? -ne 0 ; then \ + echo "generate-posix-vars failed" ; \ + rm -f ./pybuilddir.txt ; \ + exit 1 ; \ + fi + +# This is shared by the math and cmath modules +Modules/_math.o: Modules/_math.c Modules/_math.h + $(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $< + +# blake2s is auto-generated from blake2b +$(srcdir)/Modules/_blake2/blake2s_impl.c: $(srcdir)/Modules/_blake2/blake2b_impl.c $(srcdir)/Modules/_blake2/blake2b2s.py + $(PYTHON_FOR_REGEN) $(srcdir)/Modules/_blake2/blake2b2s.py + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $@ + +# Build the shared modules +# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for +# -s, --silent or --quiet is always the first char. +# Under BSD make, MAKEFLAGS might be " -s -v x=y". +# Ignore macros passed by GNU make, passed after -- +sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o + @case "`echo X $$MAKEFLAGS | sed 's/^X //;s/ -- .*//'`" in \ + *\ -s*|s*) quiet="-q";; \ + *) quiet="";; \ + esac; \ + echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ + $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build + + +# Build static library +$(LIBRARY): $(LIBRARY_OBJS) + -rm -f $@ + $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS) + +libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS) + if test $(INSTSONAME) != $(LDLIBRARY); then \ + $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \ + $(LN) -f $(INSTSONAME) $@; \ + else \ + $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \ + fi + +libpython3.so: libpython$(LDVERSION).so + $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ + +libpython$(LDVERSION).dylib: $(LIBRARY_OBJS) + $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ + + +libpython$(VERSION).sl: $(LIBRARY_OBJS) + $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) + +# List of exported symbols for AIX +Modules/python.exp: $(LIBRARY) + $(srcdir)/Modules/makexp_aix $@ "$(EXPORTSFROM)" $? + +# Copy up the gdb python hooks into a position where they can be automatically +# loaded by gdb during Lib/test/test_gdb.py +# +# Distributors are likely to want to install this somewhere else e.g. relative +# to the stripped DWARF data for the shared library. +gdbhooks: $(BUILDPYTHON)-gdb.py + +SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py +$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS) + $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py + +# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary +# minimal framework (not including the Lib directory and such) in the current +# directory. +RESSRCDIR=Mac/Resources/framework +$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \ + $(LIBRARY) \ + $(RESSRCDIR)/Info.plist + $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION) + $(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \ + -all_load $(LIBRARY) -Wl,-single_module \ + -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \ + -compatibility_version $(VERSION) \ + -current_version $(VERSION) \ + -framework CoreFoundation $(LIBS); + $(INSTALL) -d -m $(DIRMODE) \ + $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj + $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \ + $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist + $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current + $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK) + $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources + +# This rule builds the Cygwin Python DLL and import library if configured +# for a shared core library; otherwise, this rule is a noop. +$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) + if test -n "$(DLLLIBRARY)"; then \ + $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ + $(LIBS) $(MODLIBS) $(SYSLIBS); \ + else true; \ + fi + + +oldsharedmods: $(SHAREDMODS) + + +Makefile Modules/config.c: Makefile.pre \ + $(srcdir)/Modules/config.c.in \ + $(MAKESETUP) \ + $(srcdir)/Modules/Setup \ + Modules/Setup.local + $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \ + -s Modules \ + Modules/Setup.local \ + $(srcdir)/Modules/Setup + @mv config.c Modules + @echo "The Makefile was updated, you may need to re-run make." + + +Programs/_testembed: Programs/_testembed.o $(LIBRARY_DEPS) + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) + +############################################################################ +# Importlib + +Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile + +Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) + $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) + +.PHONY: regen-importlib +regen-importlib: Programs/_freeze_importlib + # Regenerate Python/importlib_external.h + # from Lib/importlib/_bootstrap_external.py using _freeze_importlib + ./Programs/_freeze_importlib importlib._bootstrap_external \ + $(srcdir)/Lib/importlib/_bootstrap_external.py \ + $(srcdir)/Python/importlib_external.h.new + $(UPDATE_FILE) $(srcdir)/Python/importlib_external.h $(srcdir)/Python/importlib_external.h.new + # Regenerate Python/importlib.h from Lib/importlib/_bootstrap.py + # using _freeze_importlib + ./Programs/_freeze_importlib importlib._bootstrap \ + $(srcdir)/Lib/importlib/_bootstrap.py \ + $(srcdir)/Python/importlib.h.new + $(UPDATE_FILE) $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib.h.new + # Regenerate Python/importlib_zipimport.h from Lib/zipimport.py + # using _freeze_importlib + ./Programs/_freeze_importlib zipimport \ + $(srcdir)/Lib/zipimport.py \ + $(srcdir)/Python/importlib_zipimport.h.new + $(UPDATE_FILE) $(srcdir)/Python/importlib_zipimport.h $(srcdir)/Python/importlib_zipimport.h.new + +regen-abidump: all + @$(MKDIR_P) $(srcdir)/Doc/data/ + abidw "libpython$(LDVERSION).so" --no-architecture --out-file $(srcdir)/Doc/data/python$(LDVERSION).abi.new + @$(UPDATE_FILE) $(srcdir)/Doc/data/python$(LDVERSION).abi $(srcdir)/Doc/data/python$(LDVERSION).abi.new + +check-abidump: all + abidiff $(srcdir)/Doc/data/python$(LDVERSION).abi "libpython$(LDVERSION).so" --drop-private-types --no-architecture --no-added-syms + +regen-limited-abi: all + $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/stable_abi.py --generate-all $(srcdir)/Misc/stable_abi.txt + + +############################################################################ +# Regenerate all generated files + +regen-all: regen-opcode regen-opcode-targets regen-typeslots \ + regen-token regen-ast regen-keyword regen-importlib clinic \ + regen-pegen-metaparser regen-pegen regen-frozen + @echo + @echo "Note: make regen-stdlib-module-names and autoconf should be run manually" + +############################################################################ +# Special rules for object files + +Modules/getbuildinfo.o: $(PARSER_OBJS) \ + $(OBJECT_OBJS) \ + $(PYTHON_OBJS) \ + $(MODULE_OBJS) \ + $(MODOBJS) \ + $(DTRACE_OBJS) \ + $(srcdir)/Modules/getbuildinfo.c + $(CC) -c $(PY_CORE_CFLAGS) \ + -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \ + -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \ + -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \ + -o $@ $(srcdir)/Modules/getbuildinfo.c + +Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile + $(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ + -DPREFIX='"$(prefix)"' \ + -DEXEC_PREFIX='"$(exec_prefix)"' \ + -DVERSION='"$(VERSION)"' \ + -DVPATH='"$(VPATH)"' \ + -o $@ $(srcdir)/Modules/getpath.c + +Programs/python.o: $(srcdir)/Programs/python.c + $(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/python.c + +Programs/_testembed.o: $(srcdir)/Programs/_testembed.c + $(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c + +Modules/_sre.o: $(srcdir)/Modules/_sre.c $(srcdir)/Modules/sre.h $(srcdir)/Modules/sre_constants.h $(srcdir)/Modules/sre_lib.h + +Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h + +Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h + +Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h + +Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(srcdir)/Modules/posixmodule.h + +Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile + $(CC) -c $(PY_CORE_CFLAGS) \ + -DSOABI='"$(SOABI)"' \ + -o $@ $(srcdir)/Python/dynload_shlib.c + +Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile + $(CC) -c $(PY_CORE_CFLAGS) \ + -DSHLIB_EXT='"$(EXT_SUFFIX)"' \ + -o $@ $(srcdir)/Python/dynload_hpux.c + +Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h + $(CC) -c $(PY_CORE_CFLAGS) \ + -DABIFLAGS='"$(ABIFLAGS)"' \ + $(MULTIARCH_CPPFLAGS) \ + -o $@ $(srcdir)/Python/sysmodule.c + +Python/initconfig.o: $(srcdir)/Python/initconfig.c + $(CC) -c $(PY_CORE_CFLAGS) \ + -DPLATLIBDIR='"$(PLATLIBDIR)"' \ + -o $@ $(srcdir)/Python/initconfig.c + +$(IO_OBJS): $(IO_H) + +.PHONY: regen-pegen-metaparser +regen-pegen-metaparser: + @$(MKDIR_P) $(srcdir)/Tools/peg_generator/pegen + PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q python \ + $(srcdir)/Tools/peg_generator/pegen/metagrammar.gram \ + -o $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new + $(UPDATE_FILE) $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py \ + $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new + +.PHONY: regen-pegen +regen-pegen: + @$(MKDIR_P) $(srcdir)/Parser + PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q c \ + $(srcdir)/Grammar/python.gram \ + $(srcdir)/Grammar/Tokens \ + -o $(srcdir)/Parser/parser.new.c + $(UPDATE_FILE) $(srcdir)/Parser/parser.c $(srcdir)/Parser/parser.new.c + +.PHONY=regen-ast +regen-ast: + # Regenerate 3 files using using Parser/asdl_c.py: + # - Include/internal/pycore_ast.h + # - Include/internal/pycore_ast_state.h + # - Python/Python-ast.c + $(MKDIR_P) $(srcdir)/Include + $(MKDIR_P) $(srcdir)/Python + $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \ + $(srcdir)/Parser/Python.asdl \ + -H $(srcdir)/Include/internal/pycore_ast.h.new \ + -I $(srcdir)/Include/internal/pycore_ast_state.h.new \ + -C $(srcdir)/Python/Python-ast.c.new + + $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new + $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new + $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new + +.PHONY: regen-opcode +regen-opcode: + # Regenerate Include/opcode.h from Lib/opcode.py + # using Tools/scripts/generate_opcode_h.py + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_opcode_h.py \ + $(srcdir)/Lib/opcode.py \ + $(srcdir)/Include/opcode.h.new + $(UPDATE_FILE) $(srcdir)/Include/opcode.h $(srcdir)/Include/opcode.h.new + +.PHONY: regen-frozen +regen-frozen: Programs/_freeze_importlib + # Regenerate code for frozen module "__hello__". + ./Programs/_freeze_importlib hello \ + $(srcdir)/Tools/freeze/flag.py \ + $(srcdir)/Python/frozen_hello.h.new + $(UPDATE_FILE) $(srcdir)/Python/frozen_hello.h \ + $(srcdir)/Python/frozen_hello.h.new + +.PHONY: regen-token +regen-token: + # Regenerate Doc/library/token-list.inc from Grammar/Tokens + # using Tools/scripts/generate_token.py + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py rst \ + $(srcdir)/Grammar/Tokens \ + $(srcdir)/Doc/library/token-list.inc + # Regenerate Include/token.h from Grammar/Tokens + # using Tools/scripts/generate_token.py + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py h \ + $(srcdir)/Grammar/Tokens \ + $(srcdir)/Include/token.h + # Regenerate Parser/token.c from Grammar/Tokens + # using Tools/scripts/generate_token.py + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py c \ + $(srcdir)/Grammar/Tokens \ + $(srcdir)/Parser/token.c + # Regenerate Lib/token.py from Grammar/Tokens + # using Tools/scripts/generate_token.py + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py py \ + $(srcdir)/Grammar/Tokens \ + $(srcdir)/Lib/token.py + +.PHONY: regen-keyword +regen-keyword: + # Regenerate Lib/keyword.py from Grammar/python.gram and Grammar/Tokens + # using Tools/peg_generator/pegen + PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen.keywordgen \ + $(srcdir)/Grammar/python.gram \ + $(srcdir)/Grammar/Tokens \ + $(srcdir)/Lib/keyword.py.new + $(UPDATE_FILE) $(srcdir)/Lib/keyword.py $(srcdir)/Lib/keyword.py.new + +.PHONY: regen-stdlib-module-names +regen-stdlib-module-names: build_all Programs/_testembed + # Regenerate Python/stdlib_module_names.h + # using Tools/scripts/generate_stdlib_module_names.py + $(RUNSHARED) ./$(BUILDPYTHON) \ + $(srcdir)/Tools/scripts/generate_stdlib_module_names.py \ + > $(srcdir)/Python/stdlib_module_names.h.new + $(UPDATE_FILE) $(srcdir)/Python/stdlib_module_names.h $(srcdir)/Python/stdlib_module_names.h.new + +Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/internal/pycore_ast.h + +Python/getplatform.o: $(srcdir)/Python/getplatform.c + $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c + +Python/importdl.o: $(srcdir)/Python/importdl.c + $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c + +Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \ + $(srcdir)/Objects/unicodetype_db.h + +BYTESTR_DEPS = \ + $(srcdir)/Objects/stringlib/count.h \ + $(srcdir)/Objects/stringlib/ctype.h \ + $(srcdir)/Objects/stringlib/fastsearch.h \ + $(srcdir)/Objects/stringlib/find.h \ + $(srcdir)/Objects/stringlib/join.h \ + $(srcdir)/Objects/stringlib/partition.h \ + $(srcdir)/Objects/stringlib/split.h \ + $(srcdir)/Objects/stringlib/stringdefs.h \ + $(srcdir)/Objects/stringlib/transmogrify.h + +UNICODE_DEPS = \ + $(srcdir)/Objects/stringlib/asciilib.h \ + $(srcdir)/Objects/stringlib/codecs.h \ + $(srcdir)/Objects/stringlib/count.h \ + $(srcdir)/Objects/stringlib/fastsearch.h \ + $(srcdir)/Objects/stringlib/find.h \ + $(srcdir)/Objects/stringlib/find_max_char.h \ + $(srcdir)/Objects/stringlib/localeutil.h \ + $(srcdir)/Objects/stringlib/partition.h \ + $(srcdir)/Objects/stringlib/replace.h \ + $(srcdir)/Objects/stringlib/split.h \ + $(srcdir)/Objects/stringlib/ucs1lib.h \ + $(srcdir)/Objects/stringlib/ucs2lib.h \ + $(srcdir)/Objects/stringlib/ucs4lib.h \ + $(srcdir)/Objects/stringlib/undef.h \ + $(srcdir)/Objects/stringlib/unicode_format.h \ + $(srcdir)/Objects/stringlib/unicodedefs.h + +Objects/bytes_methods.o: $(srcdir)/Objects/bytes_methods.c $(BYTESTR_DEPS) +Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS) +Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) + +Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c $(UNICODE_DEPS) + +Objects/odictobject.o: $(srcdir)/Objects/dict-common.h +Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h $(srcdir)/Objects/dict-common.h +Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h + +.PHONY: regen-opcode-targets +regen-opcode-targets: + # Regenerate Python/opcode_targets.h from Lib/opcode.py + # using Python/makeopcodetargets.py + $(PYTHON_FOR_REGEN) $(srcdir)/Python/makeopcodetargets.py \ + $(srcdir)/Python/opcode_targets.h.new + $(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new + +Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h \ + $(srcdir)/Python/condvar.h + +Python/frozen.o: $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib_external.h \ + $(srcdir)/Python/importlib_zipimport.h $(srcdir)/Python/frozen_hello.h + +# Generate DTrace probe macros, then rename them (PYTHON_ -> PyDTrace_) to +# follow our naming conventions. dtrace(1) uses the output filename to generate +# an include guard, so we can't use a pipeline to transform its output. +Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d + $(MKDIR_P) Include + $(DTRACE) $(DFLAGS) -o $@ -h -s $< + : sed in-place edit with POSIX-only tools + sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp + mv $@.tmp $@ + +Python/ceval.o: $(srcdir)/Include/pydtrace.h +Python/import.o: $(srcdir)/Include/pydtrace.h +Modules/gcmodule.o: $(srcdir)/Include/pydtrace.h + +Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS) + $(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS) + +Objects/typeobject.o: Objects/typeslots.inc + +.PHONY: regen-typeslots +regen-typeslots: + # Regenerate Objects/typeslots.inc from Include/typeslotsh + # using Objects/typeslots.py + $(PYTHON_FOR_REGEN) $(srcdir)/Objects/typeslots.py \ + < $(srcdir)/Include/typeslots.h \ + $(srcdir)/Objects/typeslots.inc.new + $(UPDATE_FILE) $(srcdir)/Objects/typeslots.inc $(srcdir)/Objects/typeslots.inc.new + +############################################################################ +# Header files + +PYTHON_HEADERS= \ + $(srcdir)/Include/Python.h \ + $(srcdir)/Include/abstract.h \ + $(srcdir)/Include/bltinmodule.h \ + $(srcdir)/Include/boolobject.h \ + $(srcdir)/Include/bytearrayobject.h \ + $(srcdir)/Include/bytesobject.h \ + $(srcdir)/Include/cellobject.h \ + $(srcdir)/Include/ceval.h \ + $(srcdir)/Include/classobject.h \ + $(srcdir)/Include/code.h \ + $(srcdir)/Include/codecs.h \ + $(srcdir)/Include/compile.h \ + $(srcdir)/Include/complexobject.h \ + $(srcdir)/Include/context.h \ + $(srcdir)/Include/descrobject.h \ + $(srcdir)/Include/dictobject.h \ + $(srcdir)/Include/dynamic_annotations.h \ + $(srcdir)/Include/enumobject.h \ + $(srcdir)/Include/errcode.h \ + $(srcdir)/Include/eval.h \ + $(srcdir)/Include/fileobject.h \ + $(srcdir)/Include/fileutils.h \ + $(srcdir)/Include/floatobject.h \ + $(srcdir)/Include/frameobject.h \ + $(srcdir)/Include/funcobject.h \ + $(srcdir)/Include/genobject.h \ + $(srcdir)/Include/import.h \ + $(srcdir)/Include/interpreteridobject.h \ + $(srcdir)/Include/intrcheck.h \ + $(srcdir)/Include/iterobject.h \ + $(srcdir)/Include/listobject.h \ + $(srcdir)/Include/longintrepr.h \ + $(srcdir)/Include/longobject.h \ + $(srcdir)/Include/marshal.h \ + $(srcdir)/Include/memoryobject.h \ + $(srcdir)/Include/methodobject.h \ + $(srcdir)/Include/modsupport.h \ + $(srcdir)/Include/moduleobject.h \ + $(srcdir)/Include/namespaceobject.h \ + $(srcdir)/Include/object.h \ + $(srcdir)/Include/objimpl.h \ + $(srcdir)/Include/opcode.h \ + $(srcdir)/Include/osdefs.h \ + $(srcdir)/Include/osmodule.h \ + $(srcdir)/Include/patchlevel.h \ + $(srcdir)/Include/pycapsule.h \ + $(srcdir)/Include/pydtrace.h \ + $(srcdir)/Include/pyerrors.h \ + $(srcdir)/Include/pyframe.h \ + $(srcdir)/Include/pyhash.h \ + $(srcdir)/Include/pylifecycle.h \ + $(srcdir)/Include/pymacconfig.h \ + $(srcdir)/Include/pymacro.h \ + $(srcdir)/Include/pymath.h \ + $(srcdir)/Include/pymem.h \ + $(srcdir)/Include/pyport.h \ + $(srcdir)/Include/pystate.h \ + $(srcdir)/Include/pystrcmp.h \ + $(srcdir)/Include/pystrhex.h \ + $(srcdir)/Include/pystrtod.h \ + $(srcdir)/Include/pythonrun.h \ + $(srcdir)/Include/pythread.h \ + $(srcdir)/Include/rangeobject.h \ + $(srcdir)/Include/setobject.h \ + $(srcdir)/Include/sliceobject.h \ + $(srcdir)/Include/structmember.h \ + $(srcdir)/Include/structseq.h \ + $(srcdir)/Include/sysmodule.h \ + $(srcdir)/Include/token.h \ + $(srcdir)/Include/traceback.h \ + $(srcdir)/Include/tracemalloc.h \ + $(srcdir)/Include/tupleobject.h \ + $(srcdir)/Include/unicodeobject.h \ + $(srcdir)/Include/warnings.h \ + $(srcdir)/Include/weakrefobject.h \ + \ + pyconfig.h \ + $(PARSER_HEADERS) \ + \ + $(srcdir)/Include/cpython/abstract.h \ + $(srcdir)/Include/cpython/bytearrayobject.h \ + $(srcdir)/Include/cpython/bytesobject.h \ + $(srcdir)/Include/cpython/ceval.h \ + $(srcdir)/Include/cpython/code.h \ + $(srcdir)/Include/cpython/compile.h \ + $(srcdir)/Include/cpython/dictobject.h \ + $(srcdir)/Include/cpython/fileobject.h \ + $(srcdir)/Include/cpython/fileutils.h \ + $(srcdir)/Include/cpython/frameobject.h \ + $(srcdir)/Include/cpython/import.h \ + $(srcdir)/Include/cpython/initconfig.h \ + $(srcdir)/Include/cpython/interpreteridobject.h \ + $(srcdir)/Include/cpython/listobject.h \ + $(srcdir)/Include/cpython/methodobject.h \ + $(srcdir)/Include/cpython/object.h \ + $(srcdir)/Include/cpython/objimpl.h \ + $(srcdir)/Include/cpython/odictobject.h \ + $(srcdir)/Include/cpython/picklebufobject.h \ + $(srcdir)/Include/cpython/pyctype.h \ + $(srcdir)/Include/cpython/pydebug.h \ + $(srcdir)/Include/cpython/pyerrors.h \ + $(srcdir)/Include/cpython/pyfpe.h \ + $(srcdir)/Include/cpython/pylifecycle.h \ + $(srcdir)/Include/cpython/pymem.h \ + $(srcdir)/Include/cpython/pystate.h \ + $(srcdir)/Include/cpython/pythonrun.h \ + $(srcdir)/Include/cpython/pytime.h \ + $(srcdir)/Include/cpython/sysmodule.h \ + $(srcdir)/Include/cpython/traceback.h \ + $(srcdir)/Include/cpython/tupleobject.h \ + $(srcdir)/Include/cpython/unicodeobject.h \ + \ + $(srcdir)/Include/internal/pycore_abstract.h \ + $(srcdir)/Include/internal/pycore_accu.h \ + $(srcdir)/Include/internal/pycore_asdl.h \ + $(srcdir)/Include/internal/pycore_ast.h \ + $(srcdir)/Include/internal/pycore_ast_state.h \ + $(srcdir)/Include/internal/pycore_atomic.h \ + $(srcdir)/Include/internal/pycore_atomic_funcs.h \ + $(srcdir)/Include/internal/pycore_bitutils.h \ + $(srcdir)/Include/internal/pycore_bytes_methods.h \ + $(srcdir)/Include/internal/pycore_call.h \ + $(srcdir)/Include/internal/pycore_ceval.h \ + $(srcdir)/Include/internal/pycore_code.h \ + $(srcdir)/Include/internal/pycore_compile.h \ + $(srcdir)/Include/internal/pycore_condvar.h \ + $(srcdir)/Include/internal/pycore_context.h \ + $(srcdir)/Include/internal/pycore_dtoa.h \ + $(srcdir)/Include/internal/pycore_fileutils.h \ + $(srcdir)/Include/internal/pycore_format.h \ + $(srcdir)/Include/internal/pycore_getopt.h \ + $(srcdir)/Include/internal/pycore_gil.h \ + $(srcdir)/Include/internal/pycore_hamt.h \ + $(srcdir)/Include/internal/pycore_hashtable.h \ + $(srcdir)/Include/internal/pycore_import.h \ + $(srcdir)/Include/internal/pycore_initconfig.h \ + $(srcdir)/Include/internal/pycore_interp.h \ + $(srcdir)/Include/internal/pycore_list.h \ + $(srcdir)/Include/internal/pycore_long.h \ + $(srcdir)/Include/internal/pycore_moduleobject.h \ + $(srcdir)/Include/internal/pycore_object.h \ + $(srcdir)/Include/internal/pycore_pathconfig.h \ + $(srcdir)/Include/internal/pycore_pyarena.h \ + $(srcdir)/Include/internal/pycore_pyerrors.h \ + $(srcdir)/Include/internal/pycore_pyhash.h \ + $(srcdir)/Include/internal/pycore_pylifecycle.h \ + $(srcdir)/Include/internal/pycore_pymem.h \ + $(srcdir)/Include/internal/pycore_pystate.h \ + $(srcdir)/Include/internal/pycore_runtime.h \ + $(srcdir)/Include/internal/pycore_structseq.h \ + $(srcdir)/Include/internal/pycore_symtable.h \ + $(srcdir)/Include/internal/pycore_sysmodule.h \ + $(srcdir)/Include/internal/pycore_traceback.h \ + $(srcdir)/Include/internal/pycore_tuple.h \ + $(srcdir)/Include/internal/pycore_ucnhash.h \ + $(srcdir)/Include/internal/pycore_unionobject.h \ + $(srcdir)/Include/internal/pycore_warnings.h \ + $(DTRACE_HEADERS) \ + \ + $(srcdir)/Python/stdlib_module_names.h + +$(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS) + + +###################################################################### + +TESTOPTS= $(EXTRATESTOPTS) +TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS) +TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py +TESTTIMEOUT= 1200 + +.PHONY: test testall testuniversal buildbottest pythoninfo + +# Remove "test_python_*" directories of previous failed test jobs. +# Pass TESTOPTS options because it can contain --tempdir option. +cleantest: build_all + $(TESTRUNNER) $(TESTOPTS) --cleanup + +# Run a basic set of regression tests. +# This excludes some tests that are particularly resource-intensive. +test: build_all platform + $(TESTRUNNER) $(TESTOPTS) + +# Run the full test suite twice - once without .pyc files, and once with. +# In the past, we've had problems where bugs in the marshalling or +# elsewhere caused bytecode read from .pyc files to behave differently +# than bytecode generated directly from a .py source file. Sometimes +# the bytecode read from a .pyc file had the bug, sometimes the directly +# generated bytecode. This is sometimes a very shy bug needing a lot of +# sample data. +testall: build_all platform + -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f + $(TESTPYTHON) -E $(srcdir)/Lib/compileall.py + -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f + -$(TESTRUNNER) -u all $(TESTOPTS) + $(TESTRUNNER) -u all $(TESTOPTS) + +# Run the test suite for both architectures in a Universal build on OSX. +# Must be run on an Intel box. +testuniversal: build_all platform + @if [ `arch` != 'i386' ]; then \ + echo "This can only be used on OSX/i386" ;\ + exit 1 ;\ + fi + $(TESTRUNNER) -u all $(TESTOPTS) + $(RUNSHARED) /usr/libexec/oah/translate \ + ./$(BUILDPYTHON) -E -m test -j 0 -u all $(TESTOPTS) + +# Like testall, but with only one pass and without multiple processes. +# Run an optional script to include information about the build environment. +buildbottest: build_all platform + -@if which pybuildbot.identify >/dev/null 2>&1; then \ + pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \ + fi + $(TESTRUNNER) -j 1 -u all -W --slowest --fail-env-changed --timeout=$(TESTTIMEOUT) $(TESTOPTS) + +pythoninfo: build_all + $(RUNSHARED) ./$(BUILDPYTHON) -m test.pythoninfo + +QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \ + test_multibytecodec test_urllib2_localnet test_itertools \ + test_multiprocessing_fork test_multiprocessing_spawn \ + test_multiprocessing_forkserver \ + test_mailbox test_socket test_poll \ + test_select test_zipfile test_concurrent_futures +quicktest: build_all platform + $(TESTRUNNER) $(QUICKTESTOPTS) + +# SSL tests +.PHONY: multisslcompile multissltest +multisslcompile: build_all + $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py --steps=modules + +multissltest: build_all + $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py + +install: commoninstall bininstall maninstall + if test "x$(ENSUREPIP)" != "xno" ; then \ + case $(ENSUREPIP) in \ + upgrade) ensurepip="--upgrade" ;; \ + install|*) ensurepip="" ;; \ + esac; \ + $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \ + $$ensurepip --root=$(DESTDIR)/ ; \ + fi + +altinstall: commoninstall + if test "x$(ENSUREPIP)" != "xno" ; then \ + case $(ENSUREPIP) in \ + upgrade) ensurepip="--altinstall --upgrade" ;; \ + install|*) ensurepip="--altinstall" ;; \ + esac; \ + $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \ + $$ensurepip --root=$(DESTDIR)/ ; \ + fi + +commoninstall: check-clean-src \ + altbininstall libinstall inclinstall libainstall \ + sharedinstall oldsharedinstall altmaninstall \ + + +# Install shared libraries enabled by Setup +DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) + +oldsharedinstall: $(DESTSHARED) $(SHAREDMODS) + @for i in X $(SHAREDMODS); do \ + if test $$i != X; then \ + echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \ + $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \ + fi; \ + done + +$(DESTSHARED): + @for i in $(DESTDIRS); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ + else true; \ + fi; \ + done + +# Install the interpreter with $(VERSION) affixed +# This goes into $(exec_prefix) +altbininstall: $(BUILDPYTHON) + @for i in $(BINDIR) $(LIBDIR); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ + else true; \ + fi; \ + done + if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \ + $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ + else \ + $(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ + fi + -if test "$(VERSION)" != "$(LDVERSION)"; then \ + if test -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \ + then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \ + fi; \ + (cd $(DESTDIR)$(BINDIR); $(LN) python$(LDVERSION)$(EXE) python$(VERSION)$(EXE)); \ + fi + @if test "$(PY_ENABLE_SHARED)" = 1 -o "$(STATIC_LIBPYTHON)" = 1; then \ + if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \ + if test -n "$(DLLLIBRARY)" ; then \ + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ + else \ + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ + if test $(LDLIBRARY) != $(INSTSONAME); then \ + (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ + fi \ + fi; \ + if test -n "$(PY3LIBRARY)"; then \ + $(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \ + fi; \ + else true; \ + fi; \ + fi + if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ + rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-32$(EXE); \ + lipo $(LIPO_32BIT_FLAGS) \ + -output $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE) \ + $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \ + fi + if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \ + rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-intel64$(EXE); \ + lipo $(LIPO_INTEL64_FLAGS) \ + -output $(DESTDIR)$(BINDIR)/python$(VERSION)-intel64$(EXE) \ + $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \ + fi + +bininstall: altbininstall + if test ! -d $(DESTDIR)$(LIBPC); then \ + echo "Creating directory $(LIBPC)"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC); \ + fi + -if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \ + then rm -f $(DESTDIR)$(BINDIR)/python3$(EXE); \ + else true; \ + fi + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python3$(EXE)) + -if test "$(VERSION)" != "$(LDVERSION)"; then \ + rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config; \ + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config); \ + rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION).pc; \ + (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python-$(LDVERSION).pc); \ + rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION)-embed.pc; \ + (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python-$(LDVERSION)-embed.pc); \ + fi + -rm -f $(DESTDIR)$(BINDIR)/python3-config + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config) + -rm -f $(DESTDIR)$(LIBPC)/python3.pc + (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc) + -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc + (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc) + -rm -f $(DESTDIR)$(BINDIR)/idle3 + (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3) + -rm -f $(DESTDIR)$(BINDIR)/pydoc3 + (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) + -rm -f $(DESTDIR)$(BINDIR)/2to3 + (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) + if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ + rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \ + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \ + fi + if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \ + rm -f $(DESTDIR)$(BINDIR)/python3-intel64$(EXE); \ + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-intel64$(EXE) python3-intel64$(EXE)) \ + fi + +# Install the versioned manual page +altmaninstall: + @for i in $(MANDIR) $(MANDIR)/man1; \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ + else true; \ + fi; \ + done + $(INSTALL_DATA) $(srcdir)/Misc/python.man \ + $(DESTDIR)$(MANDIR)/man1/python$(VERSION).1 + +# Install the unversioned manual page +maninstall: altmaninstall + -rm -f $(DESTDIR)$(MANDIR)/man1/python3.1 + (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python3.1) + +# Install the library +XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax +LIBSUBDIRS= asyncio \ + collections \ + concurrent concurrent/futures \ + csv \ + ctypes ctypes/macholib \ + curses \ + dbm \ + distutils distutils/command \ + email email/mime \ + encodings \ + ensurepip ensurepip/_bundled \ + html \ + http \ + idlelib idlelib/Icons \ + importlib importlib/metadata \ + json \ + lib2to3 lib2to3/fixes lib2to3/pgen2 \ + logging \ + multiprocessing multiprocessing/dummy \ + pydoc_data \ + site-packages \ + sqlite3 \ + tkinter \ + turtledemo \ + unittest \ + urllib \ + venv venv/scripts venv/scripts/common venv/scripts/posix \ + wsgiref \ + $(XMLLIBSUBDIRS) \ + xmlrpc \ + zoneinfo +TESTSUBDIRS= ctypes/test \ + distutils/tests \ + idlelib/idle_test \ + lib2to3/tests \ + lib2to3/tests/data \ + lib2to3/tests/data/fixers \ + lib2to3/tests/data/fixers/myfixes \ + sqlite3/test \ + test test/audiodata \ + test/capath test/cjkencodings \ + test/data test/decimaltestdata \ + test/dtracedata test/eintrdata \ + test/encoded_modules test/imghdrdata \ + test/libregrtest test/sndhdrdata \ + test/subprocessdata test/support \ + test/test_asyncio \ + test/test_email test/test_email/data \ + test/test_import \ + test/test_import/data \ + test/test_import/data/circular_imports \ + test/test_import/data/circular_imports/subpkg \ + test/test_import/data/package \ + test/test_import/data/package2 \ + test/test_import/data/unwritable \ + test/test_importlib \ + test/test_importlib/builtin \ + test/test_importlib/data \ + test/test_importlib/data01 \ + test/test_importlib/data01/subdirectory \ + test/test_importlib/data02 \ + test/test_importlib/data02/one \ + test/test_importlib/data02/two \ + test/test_importlib/data03 \ + test/test_importlib/data03/namespace \ + test/test_importlib/data03/namespace/portion1 \ + test/test_importlib/data03/namespace/portion2 \ + test/test_importlib/extension \ + test/test_importlib/frozen \ + test/test_importlib/import_ \ + test/test_importlib/namespace_pkgs \ + test/test_importlib/namespace_pkgs/both_portions \ + test/test_importlib/namespace_pkgs/both_portions/foo \ + test/test_importlib/namespace_pkgs/module_and_namespace_package \ + test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \ + test/test_importlib/namespace_pkgs/not_a_namespace_pkg \ + test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo \ + test/test_importlib/namespace_pkgs/portion1 \ + test/test_importlib/namespace_pkgs/portion1/foo \ + test/test_importlib/namespace_pkgs/portion2 \ + test/test_importlib/namespace_pkgs/portion2/foo \ + test/test_importlib/namespace_pkgs/project1 \ + test/test_importlib/namespace_pkgs/project1/parent \ + test/test_importlib/namespace_pkgs/project1/parent/child \ + test/test_importlib/namespace_pkgs/project2 \ + test/test_importlib/namespace_pkgs/project2/parent \ + test/test_importlib/namespace_pkgs/project2/parent/child \ + test/test_importlib/namespace_pkgs/project3 \ + test/test_importlib/namespace_pkgs/project3/parent \ + test/test_importlib/namespace_pkgs/project3/parent/child \ + test/test_importlib/namespacedata01 \ + test/test_importlib/partial \ + test/test_importlib/source \ + test/test_importlib/zipdata01 \ + test/test_importlib/zipdata02 \ + test/test_json \ + test/test_peg_generator \ + test/test_tools \ + test/test_warnings test/test_warnings/data \ + test/test_zoneinfo test/test_zoneinfo/data \ + test/tracedmodules \ + test/typinganndata \ + test/xmltestdata test/xmltestdata/c14n-20 \ + test/ziptestdata \ + tkinter/test tkinter/test/test_tkinter \ + tkinter/test/test_ttk \ + unittest/test unittest/test/testmock + +TEST_MODULES=yes +libinstall: build_all $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ + else true; \ + fi; \ + done + @if test "$(TEST_MODULES)" = yes; then \ + subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \ + else \ + subdirs="$(LIBSUBDIRS)"; \ + fi; \ + for d in $$subdirs; \ + do \ + a=$(srcdir)/Lib/$$d; \ + if test ! -d $$a; then continue; else true; fi; \ + b=$(LIBDEST)/$$d; \ + if test ! -d $(DESTDIR)$$b; then \ + echo "Creating directory $$b"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \ + else true; \ + fi; \ + done + @for i in $(srcdir)/Lib/*.py; \ + do \ + if test -x $$i; then \ + $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \ + echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \ + else \ + $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \ + echo $(INSTALL_DATA) $$i $(LIBDEST); \ + fi; \ + done + @if test "$(TEST_MODULES)" = yes; then \ + subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \ + else \ + subdirs="$(LIBSUBDIRS)"; \ + fi; \ + for d in $$subdirs; \ + do \ + a=$(srcdir)/Lib/$$d; \ + if test ! -d $$a; then continue; else true; fi; \ + if test `ls $$a | wc -l` -lt 1; then continue; fi; \ + b=$(LIBDEST)/$$d; \ + for i in $$a/*; \ + do \ + case $$i in \ + *CVS) ;; \ + *.py[co]) ;; \ + *.orig) ;; \ + *~) ;; \ + *) \ + if test -d $$i; then continue; fi; \ + if test -x $$i; then \ + echo $(INSTALL_SCRIPT) $$i $$b; \ + $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \ + else \ + echo $(INSTALL_DATA) $$i $$b; \ + $(INSTALL_DATA) $$i $(DESTDIR)$$b; \ + fi;; \ + esac; \ + done; \ + done + $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \ + $(DESTDIR)$(LIBDEST); \ + $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt + if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \ + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt + +# bpo-21536: Misc/python-config.sh is generated in the build directory +# from $(srcdir)Misc/python-config.sh.in. +python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh + @ # Substitution happens here, as the completely-expanded BINDIR + @ # is not available in configure + sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py + @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} + LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config + @ # On Darwin, always use the python version of the script, the shell + @ # version doesn't use the compiler customizations that are provided + @ # in python (_osx_support.py). + @if test `uname -s` = Darwin; then \ + cp python-config.py python-config; \ + fi + + +# Install the include files +INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) +inclinstall: + @for i in $(INCLDIRSTOMAKE); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ + else true; \ + fi; \ + done + @if test ! -d $(DESTDIR)$(INCLUDEPY)/cpython; then \ + echo "Creating directory $(DESTDIR)$(INCLUDEPY)/cpython"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/cpython; \ + else true; \ + fi + @if test ! -d $(DESTDIR)$(INCLUDEPY)/internal; then \ + echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \ + else true; \ + fi + @for i in $(srcdir)/Include/*.h; \ + do \ + echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ + $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \ + done + @for i in $(srcdir)/Include/cpython/*.h; \ + do \ + echo $(INSTALL_DATA) $$i $(INCLUDEPY)/cpython; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/cpython; \ + done + @for i in $(srcdir)/Include/internal/*.h; \ + do \ + echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \ + done + $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h + +# Install the library and miscellaneous stuff needed for extending/embedding +# This goes into $(exec_prefix) +LIBPL= $(prefix)/lib/python3.10/config-$(VERSION)$(ABIFLAGS)-x86_64-linux-gnu + +# pkgconfig directory +LIBPC= $(LIBDIR)/pkgconfig + +libainstall: build_all python-config + @for i in $(LIBDIR) $(LIBPL) $(LIBPC) $(BINDIR); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ + else true; \ + fi; \ + done + @if test "$(STATIC_LIBPYTHON)" = 1; then \ + if test -d $(LIBRARY); then :; else \ + if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ + if test "$(SHLIB_SUFFIX)" = .dll; then \ + $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ + else \ + $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ + fi; \ + else \ + echo Skip install of $(LIBRARY) - use make frameworkinstall; \ + fi; \ + fi; \ + $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o; \ + fi + $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c + $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in + $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile + $(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup + $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local + $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc + $(INSTALL_DATA) Misc/python-embed.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc + $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup + $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh + $(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py + $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config + @if [ -s Modules/python.exp -a \ + "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \ + echo; echo "Installing support files for building shared extension modules on AIX:"; \ + $(INSTALL_DATA) Modules/python.exp \ + $(DESTDIR)$(LIBPL)/python.exp; \ + echo; echo "$(LIBPL)/python.exp"; \ + $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \ + $(DESTDIR)$(LIBPL)/makexp_aix; \ + echo "$(LIBPL)/makexp_aix"; \ + $(INSTALL_SCRIPT) Modules/ld_so_aix \ + $(DESTDIR)$(LIBPL)/ld_so_aix; \ + echo "$(LIBPL)/ld_so_aix"; \ + echo; echo "See Misc/README.AIX for details."; \ + else true; \ + fi + +# Install the dynamically loadable modules +# This goes into $(exec_prefix) +sharedinstall: sharedmods + $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --install-platlib=$(DESTSHARED) \ + --root=$(DESTDIR)/ + -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py + -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__ + +# Here are a couple of targets for MacOSX again, to install a full +# framework-based Python. frameworkinstall installs everything, the +# subtargets install specific parts. Much of the actual work is offloaded to +# the Makefile in Mac +# +# +# This target is here for backward compatibility, previous versions of Python +# hadn't integrated framework installation in the normal install process. +frameworkinstall: install + +# On install, we re-make the framework +# structure in the install location, /Library/Frameworks/ or the argument to +# --enable-framework. If --enable-framework has been specified then we have +# automatically set prefix to the location deep down in the framework, so we +# only have to cater for the structural bits of the framework. + +frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib + +frameworkinstallstructure: $(LDLIBRARY) + @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ + echo Not configured with --enable-framework; \ + exit 1; \ + else true; \ + fi + @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $(DESTDIR)$$i"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ + else true; \ + fi; \ + done + $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers + sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist + $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current + $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) + $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers + $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources + $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) + +# This installs Mac/Lib into the framework +# Install a number of symlinks to keep software that expects a normal unix +# install (which includes python-config) happy. +frameworkinstallmaclib: + $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).a" + $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).dylib" + $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).a" + $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).dylib" + $(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(LDVERSION).dylib" + $(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib" + +# This installs the IDE, the Launcher and other apps into /Applications +frameworkinstallapps: + cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)" + +# Build the bootstrap executable that will spawn the interpreter inside +# an app bundle within the framework. This allows the interpreter to +# run OS X GUI APIs. +frameworkpythonw: + cd Mac && $(MAKE) pythonw + +# This installs the python* and other bin symlinks in $prefix/bin or in +# a bin directory relative to the framework root +frameworkinstallunixtools: + cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)" + +frameworkaltinstallunixtools: + cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)" + +# This installs the Tools into the applications directory. +# It is not part of a normal frameworkinstall +frameworkinstallextras: + cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)" + +# Build the toplevel Makefile +Makefile.pre: $(srcdir)/Makefile.pre.in config.status + CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status + $(MAKE) -f Makefile.pre Makefile + +# Run the configure script. +config.status: $(srcdir)/configure + $(SHELL) $(srcdir)/configure $(CONFIG_ARGS) + +.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre + +# Some make's put the object file in the current directory +.c.o: + $(CC) -c $(PY_CORE_CFLAGS) -o $@ $< + +# bpo-30104: dtoa.c uses union to cast double to unsigned long[2]. clang 4.0 +# with -O2 or higher and strict aliasing miscompiles the ratio() function +# causing rounding issues. Compile dtoa.c using -fno-strict-aliasing on clang. +# https://bugs.llvm.org//show_bug.cgi?id=31928 +Python/dtoa.o: Python/dtoa.c + $(CC) -c $(PY_CORE_CFLAGS) $(CFLAGS_ALIASING) -o $@ $< + +# Run reindent on the library +reindent: + ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib + +# Rerun configure with the same options as it was run last time, +# provided the config.status script exists +recheck: + $(SHELL) config.status --recheck + $(SHELL) config.status + +# Regenerate configure and pyconfig.h.in +.PHONY: autoconf +autoconf: + # Regenerate the configure script from configure.ac using autoconf + (cd $(srcdir); autoconf -Wall) + # Regenerate pyconfig.h.in from configure.ac using autoheader + (cd $(srcdir); autoheader -Wall) + +# See https://github.com/tiran/cpython_autoconf container +.PHONY: regen-configure +regen-configure: + @if command -v podman >/dev/null; then RUNTIME="podman"; else RUNTIME="docker"; fi; \ + if ! command -v $$RUNTIME; then echo "$@ needs either Podman or Docker container runtime." >&2; exit 1; fi; \ + if command -v selinuxenabled >/dev/null && selinuxenabled; then OPT=":Z"; fi; \ + # Manifest corresponds with tag '269' \ + CPYTHON_AUTOCONF_MANIFEST="sha256:f370fee95eefa3d57b00488bce4911635411fa83e2d293ced8cf8a3674ead939" \ + CMD="$$RUNTIME run --rm --pull=missing -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf@$$CPYTHON_AUTOCONF_MANIFEST"; \ + echo $$CMD; \ + $$CMD || exit $? + +# Create a tags file for vi +tags:: + ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h + for i in $(SRCDIRS); do ctags -f tags -w -a $(srcdir)/$$i/*.[ch]; done + ctags -f tags -w -a $(srcdir)/Modules/_ctypes/*.[ch] + find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | ctags -f tags -w -a -L - + LC_ALL=C sort -o tags tags + +# Create a tags file for GNU Emacs +TAGS:: + cd $(srcdir); \ + etags Include/*.h Include/cpython/*.h Include/internal/*.h; \ + for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done + etags -a $(srcdir)/Modules/_ctypes/*.[ch] + find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | etags - -a + +# Sanitation targets -- clean leaves libraries, executables and tags +# files, which clobber removes as well +pycremoval: + -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';' + -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';' + +rmtestturds: + -rm -f *BAD *GOOD *SKIPPED + -rm -rf OUT + -rm -f *.TXT + -rm -f *.txt + -rm -f gb-18030-2000.xml + +docclean: + $(MAKE) -C $(srcdir)/Doc clean + +# like the 'clean' target but retain the profile guided optimization (PGO) +# data. The PGO data is only valid if source code remains unchanged. +clean-retain-profile: pycremoval + find . -name '*.[oa]' -exec rm -f {} ';' + find . -name '*.s[ol]' -exec rm -f {} ';' + find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' + find . -name '*.lst' -exec rm -f {} ';' + find build -name 'fficonfig.h' -exec rm -f {} ';' || true + find build -name '*.py' -exec rm -f {} ';' || true + find build -name '*.py[co]' -exec rm -f {} ';' || true + -rm -f pybuilddir.txt + -rm -f Lib/lib2to3/*Grammar*.pickle + -rm -f Programs/_testembed Programs/_freeze_importlib + -find build -type f -a ! -name '*.gc??' -exec rm -f {} ';' + -rm -f Include/pydtrace_probes.h + -rm -f profile-gen-stamp + +profile-removal: + find . -name '*.gc??' -exec rm -f {} ';' + find . -name '*.profclang?' -exec rm -f {} ';' + find . -name '*.dyn' -exec rm -f {} ';' + rm -f $(COVERAGE_INFO) + rm -rf $(COVERAGE_REPORT) + rm -f profile-run-stamp + +clean: clean-retain-profile + @if test profile-opt = profile-opt; then \ + rm -f profile-gen-stamp profile-clean-stamp; \ + $(MAKE) profile-removal; \ + fi + +clobber: clean + -rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ + tags TAGS \ + config.cache config.log pyconfig.h Modules/config.c + -rm -rf build platform + -rm -rf $(PYTHONFRAMEWORKDIR) + -rm -f python-config.py python-config + +# Make things extra clean, before making a distribution: +# remove all generated files, even Makefile[.pre] +# Keep configure and Python-ast.[ch], it's possible they can't be generated +distclean: clobber docclean + for file in $(srcdir)/Lib/test/data/* ; do \ + if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \ + done + -rm -f core Makefile Makefile.pre config.status Modules/Setup.local \ + Modules/ld_so_aix Modules/python.exp Misc/python.pc \ + Misc/python-embed.pc Misc/python-config.sh + -rm -f python*-gdb.py + # Issue #28258: set LC_ALL to avoid issues with Estonian locale. + # Expansion is performed here by shell (spawned by make) itself before + # arguments are passed to find. So LC_ALL=C must be set as a separate + # command. + LC_ALL=C; find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o -name '*~' \ + -o -name '[@,#]*' -o -name '*.old' \ + -o -name '*.orig' -o -name '*.rej' \ + -o -name '*.bak' ')' \ + -exec rm -f {} ';' + +# Check that all symbols exported by libpython start with "Py" or "_Py" +smelly: build_all + $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/smelly.py + +# Find files with funny names +funny: + find $(SUBDIRS) $(SUBDIRSTOO) \ + -type d \ + -o -name '*.[chs]' \ + -o -name '*.py' \ + -o -name '*.pyw' \ + -o -name '*.dat' \ + -o -name '*.el' \ + -o -name '*.fd' \ + -o -name '*.in' \ + -o -name '*.gif' \ + -o -name '*.txt' \ + -o -name '*.xml' \ + -o -name '*.xbm' \ + -o -name '*.xpm' \ + -o -name '*.uue' \ + -o -name '*.decTest' \ + -o -name '*.tmCommand' \ + -o -name '*.tmSnippet' \ + -o -name 'Setup' \ + -o -name 'Setup.*' \ + -o -name README \ + -o -name NEWS \ + -o -name HISTORY \ + -o -name Makefile \ + -o -name ChangeLog \ + -o -name .hgignore \ + -o -name MANIFEST \ + -o -print + +# Perform some verification checks on any modified files. +patchcheck: build_all + $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py + +check-limited-abi: all + $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/stable_abi.py --all $(srcdir)/Misc/stable_abi.txt + +.PHONY: update-config +update-config: + curl -sL -o config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' + curl -sL -o config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' + chmod +x config.guess config.sub + +# Dependencies + +Python/thread.o: $(srcdir)/Python/thread_nt.h $(srcdir)/Python/thread_pthread.h $(srcdir)/Python/condvar.h + +# Declare targets that aren't real files +.PHONY: all build_all sharedmods check-clean-src oldsharedmods test quicktest +.PHONY: install altinstall oldsharedinstall bininstall altbininstall +.PHONY: maninstall libinstall inclinstall libainstall sharedinstall +.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure +.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools +.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean +.PHONY: smelly funny patchcheck touch altmaninstall commoninstall +.PHONY: clean-retain-profile profile-removal run_profile_task +.PHONY: build_all_generate_profile build_all_merge_profile +.PHONY: gdbhooks + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY +# Local Variables: +# mode: makefile +# End: + +# Rules appended by makesetup + +Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o +Modules/posix$(EXT_SUFFIX): Modules/posixmodule.o; $(BLDSHARED) Modules/posixmodule.o -o Modules/posix$(EXT_SUFFIX) +Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o +Modules/errno$(EXT_SUFFIX): Modules/errnomodule.o; $(BLDSHARED) Modules/errnomodule.o -o Modules/errno$(EXT_SUFFIX) +Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/pwdmodule.c -o Modules/pwdmodule.o +Modules/pwd$(EXT_SUFFIX): Modules/pwdmodule.o; $(BLDSHARED) Modules/pwdmodule.o -o Modules/pwd$(EXT_SUFFIX) +Modules/_sre.o: $(srcdir)/Modules/_sre.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_sre.c -o Modules/_sre.o +Modules/_sre$(EXT_SUFFIX): Modules/_sre.o; $(BLDSHARED) Modules/_sre.o -o Modules/_sre$(EXT_SUFFIX) +Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o +Modules/_codecs$(EXT_SUFFIX): Modules/_codecsmodule.o; $(BLDSHARED) Modules/_codecsmodule.o -o Modules/_codecs$(EXT_SUFFIX) +Modules/_weakref.o: $(srcdir)/Modules/_weakref.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_weakref.c -o Modules/_weakref.o +Modules/_weakref$(EXT_SUFFIX): Modules/_weakref.o; $(BLDSHARED) Modules/_weakref.o -o Modules/_weakref$(EXT_SUFFIX) +Modules/_functoolsmodule.o: $(srcdir)/Modules/_functoolsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/_functoolsmodule.c -o Modules/_functoolsmodule.o +Modules/_functools$(EXT_SUFFIX): Modules/_functoolsmodule.o; $(BLDSHARED) Modules/_functoolsmodule.o -o Modules/_functools$(EXT_SUFFIX) +Modules/_operator.o: $(srcdir)/Modules/_operator.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_operator.c -o Modules/_operator.o +Modules/_operator$(EXT_SUFFIX): Modules/_operator.o; $(BLDSHARED) Modules/_operator.o -o Modules/_operator$(EXT_SUFFIX) +Modules/_collectionsmodule.o: $(srcdir)/Modules/_collectionsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_collectionsmodule.c -o Modules/_collectionsmodule.o +Modules/_collections$(EXT_SUFFIX): Modules/_collectionsmodule.o; $(BLDSHARED) Modules/_collectionsmodule.o -o Modules/_collections$(EXT_SUFFIX) +Modules/_abc.o: $(srcdir)/Modules/_abc.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_abc.c -o Modules/_abc.o +Modules/_abc$(EXT_SUFFIX): Modules/_abc.o; $(BLDSHARED) Modules/_abc.o -o Modules/_abc$(EXT_SUFFIX) +Modules/itertoolsmodule.o: $(srcdir)/Modules/itertoolsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/itertoolsmodule.c -o Modules/itertoolsmodule.o +Modules/itertools$(EXT_SUFFIX): Modules/itertoolsmodule.o; $(BLDSHARED) Modules/itertoolsmodule.o -o Modules/itertools$(EXT_SUFFIX) +Modules/atexitmodule.o: $(srcdir)/Modules/atexitmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/atexitmodule.c -o Modules/atexitmodule.o +Modules/atexit$(EXT_SUFFIX): Modules/atexitmodule.o; $(BLDSHARED) Modules/atexitmodule.o -o Modules/atexit$(EXT_SUFFIX) +Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o +Modules/_signal$(EXT_SUFFIX): Modules/signalmodule.o; $(BLDSHARED) Modules/signalmodule.o -o Modules/_signal$(EXT_SUFFIX) +Modules/_stat.o: $(srcdir)/Modules/_stat.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_stat.c -o Modules/_stat.o +Modules/_stat$(EXT_SUFFIX): Modules/_stat.o; $(BLDSHARED) Modules/_stat.o -o Modules/_stat$(EXT_SUFFIX) +Modules/timemodule.o: $(srcdir)/Modules/timemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/timemodule.c -o Modules/timemodule.o +Modules/time$(EXT_SUFFIX): Modules/timemodule.o; $(BLDSHARED) Modules/timemodule.o -o Modules/time$(EXT_SUFFIX) +Modules/_threadmodule.o: $(srcdir)/Modules/_threadmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/_threadmodule.c -o Modules/_threadmodule.o +Modules/_thread$(EXT_SUFFIX): Modules/_threadmodule.o; $(BLDSHARED) Modules/_threadmodule.o -o Modules/_thread$(EXT_SUFFIX) +Modules/_localemodule.o: $(srcdir)/Modules/_localemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_localemodule.c -o Modules/_localemodule.o +Modules/_locale$(EXT_SUFFIX): Modules/_localemodule.o; $(BLDSHARED) Modules/_localemodule.o -o Modules/_locale$(EXT_SUFFIX) +Modules/_iomodule.o: $(srcdir)/Modules/_io/_iomodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/_iomodule.c -o Modules/_iomodule.o +Modules/iobase.o: $(srcdir)/Modules/_io/iobase.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/iobase.c -o Modules/iobase.o +Modules/fileio.o: $(srcdir)/Modules/_io/fileio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/fileio.c -o Modules/fileio.o +Modules/bytesio.o: $(srcdir)/Modules/_io/bytesio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/bytesio.c -o Modules/bytesio.o +Modules/bufferedio.o: $(srcdir)/Modules/_io/bufferedio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/bufferedio.c -o Modules/bufferedio.o +Modules/textio.o: $(srcdir)/Modules/_io/textio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/textio.c -o Modules/textio.o +Modules/stringio.o: $(srcdir)/Modules/_io/stringio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/stringio.c -o Modules/stringio.o +Modules/_io$(EXT_SUFFIX): Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o; $(BLDSHARED) Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o -o Modules/_io$(EXT_SUFFIX) +Modules/faulthandler.o: $(srcdir)/Modules/faulthandler.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/faulthandler.c -o Modules/faulthandler.o +Modules/faulthandler$(EXT_SUFFIX): Modules/faulthandler.o; $(BLDSHARED) Modules/faulthandler.o -o Modules/faulthandler$(EXT_SUFFIX) +Modules/_tracemalloc.o: $(srcdir)/Modules/_tracemalloc.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_tracemalloc.c -o Modules/_tracemalloc.o +Modules/_tracemalloc$(EXT_SUFFIX): Modules/_tracemalloc.o; $(BLDSHARED) Modules/_tracemalloc.o -o Modules/_tracemalloc$(EXT_SUFFIX) +Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o +Modules/_symtable$(EXT_SUFFIX): Modules/symtablemodule.o; $(BLDSHARED) Modules/symtablemodule.o -o Modules/_symtable$(EXT_SUFFIX) +Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o +Modules/xxsubtype$(EXT_SUFFIX): Modules/xxsubtype.o; $(BLDSHARED) Modules/xxsubtype.o -o Modules/xxsubtype$(EXT_SUFFIX) diff --git a/shared/package-files/9f/9fc887068b2cd8ab3376b849654e9f0c4abb4863ba3ce6ae3bac3ce1946e6087/blob b/shared/package-files/9f/9fc887068b2cd8ab3376b849654e9f0c4abb4863ba3ce6ae3bac3ce1946e6087/blob new file mode 100644 index 0000000000000000000000000000000000000000..4fa6a8499e83dd61ac333e0c6e523d05258fad10 Binary files /dev/null and b/shared/package-files/9f/9fc887068b2cd8ab3376b849654e9f0c4abb4863ba3ce6ae3bac3ce1946e6087/blob differ diff --git a/shared/package-files/9f/9fc996b0af7f124fccd80a8628f2e82e570a698187d8fac5da5e7f5bce2804c9/blob b/shared/package-files/9f/9fc996b0af7f124fccd80a8628f2e82e570a698187d8fac5da5e7f5bce2804c9/blob new file mode 100644 index 0000000000000000000000000000000000000000..a21e2af8e016568e79b25e35ec774f39f0595c3a --- /dev/null +++ b/shared/package-files/9f/9fc996b0af7f124fccd80a8628f2e82e570a698187d8fac5da5e7f5bce2804c9/blob @@ -0,0 +1,51 @@ +from typing import Any, List, Optional, Union + +import torch +from torch import nn + + +def _replace_relu(module: nn.Module) -> None: + reassign = {} + for name, mod in module.named_children(): + _replace_relu(mod) + # Checking for explicit type instead of instance + # as we only want to replace modules of the exact type + # not inherited classes + if type(mod) is nn.ReLU or type(mod) is nn.ReLU6: + reassign[name] = nn.ReLU(inplace=False) + + for key, value in reassign.items(): + module._modules[key] = value + + +def quantize_model(model: nn.Module, backend: str) -> None: + _dummy_input_data = torch.rand(1, 3, 299, 299) + if backend not in torch.backends.quantized.supported_engines: + raise RuntimeError("Quantized backend not supported ") + torch.backends.quantized.engine = backend + model.eval() + # Make sure that weight qconfig matches that of the serialized models + if backend == "fbgemm": + model.qconfig = torch.ao.quantization.QConfig( # type: ignore[assignment] + activation=torch.ao.quantization.default_observer, + weight=torch.ao.quantization.default_per_channel_weight_observer, + ) + elif backend == "qnnpack": + model.qconfig = torch.ao.quantization.QConfig( # type: ignore[assignment] + activation=torch.ao.quantization.default_observer, weight=torch.ao.quantization.default_weight_observer + ) + + # TODO https://github.com/pytorch/vision/pull/4232#pullrequestreview-730461659 + model.fuse_model() # type: ignore[operator] + torch.ao.quantization.prepare(model, inplace=True) + model(_dummy_input_data) + torch.ao.quantization.convert(model, inplace=True) + + +def _fuse_modules( + model: nn.Module, modules_to_fuse: Union[List[str], List[List[str]]], is_qat: Optional[bool], **kwargs: Any +): + if is_qat is None: + is_qat = model.training + method = torch.ao.quantization.fuse_modules_qat if is_qat else torch.ao.quantization.fuse_modules + return method(model, modules_to_fuse, **kwargs) diff --git a/shared/package-files/9f/9fcde8d584dea0585f5c8727aaf35f48a149e0dbd3a83bf6cef8bca9c14021e3/blob b/shared/package-files/9f/9fcde8d584dea0585f5c8727aaf35f48a149e0dbd3a83bf6cef8bca9c14021e3/blob new file mode 100644 index 0000000000000000000000000000000000000000..4c49bbf52440631eca750cacb7d79f259eeb8bd2 Binary files /dev/null and b/shared/package-files/9f/9fcde8d584dea0585f5c8727aaf35f48a149e0dbd3a83bf6cef8bca9c14021e3/blob differ diff --git a/shared/package-files/9f/9fcf20ed45ae92c8449eac61a98288c6ea9ea8104820f252abfd0b300ab792f0/blob b/shared/package-files/9f/9fcf20ed45ae92c8449eac61a98288c6ea9ea8104820f252abfd0b300ab792f0/blob new file mode 100644 index 0000000000000000000000000000000000000000..f9db73ef95a67ceaeaa2e3e62713c5fa13a32261 --- /dev/null +++ b/shared/package-files/9f/9fcf20ed45ae92c8449eac61a98288c6ea9ea8104820f252abfd0b300ab792f0/blob @@ -0,0 +1,6 @@ +from .conf import SparkConf # noqa: D104 +from .context import SparkContext +from .exception import ContributionsAcceptedError +from .sql import DataFrame, SparkSession + +__all__ = ["ContributionsAcceptedError", "DataFrame", "SparkConf", "SparkContext", "SparkSession"] diff --git a/shared/package-files/9f/9fd05b33026bb9ae11472e949fe5042233b6fe4c3d4dc83090b053cb3689eaa5/blob b/shared/package-files/9f/9fd05b33026bb9ae11472e949fe5042233b6fe4c3d4dc83090b053cb3689eaa5/blob new file mode 100644 index 0000000000000000000000000000000000000000..9b8e7849dc868f7646a79c7c55b7a706eb4e9bc6 --- /dev/null +++ b/shared/package-files/9f/9fd05b33026bb9ae11472e949fe5042233b6fe4c3d4dc83090b053cb3689eaa5/blob @@ -0,0 +1,63 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::clamp_min(Tensor self, Scalar min) -> Tensor +inline at::Tensor clamp_min(const at::Tensor & self, const at::Scalar & min) { + return at::_ops::clamp_min::call(self, min); +} + +// aten::clamp_min.Tensor(Tensor self, Tensor min) -> Tensor +inline at::Tensor clamp_min(const at::Tensor & self, const at::Tensor & min) { + return at::_ops::clamp_min_Tensor::call(self, min); +} + +// aten::clamp_min_(Tensor(a!) self, Scalar min) -> Tensor(a!) +inline at::Tensor & clamp_min_(at::Tensor & self, const at::Scalar & min) { + return at::_ops::clamp_min_::call(self, min); +} + +// aten::clamp_min_.Tensor(Tensor(a!) self, Tensor min) -> Tensor(a!) +inline at::Tensor & clamp_min_(at::Tensor & self, const at::Tensor & min) { + return at::_ops::clamp_min__Tensor::call(self, min); +} + +// aten::clamp_min.out(Tensor self, Scalar min, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & clamp_min_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & min) { + return at::_ops::clamp_min_out::call(self, min, out); +} +// aten::clamp_min.out(Tensor self, Scalar min, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & clamp_min_outf(const at::Tensor & self, const at::Scalar & min, at::Tensor & out) { + return at::_ops::clamp_min_out::call(self, min, out); +} + +// aten::clamp_min.Tensor_out(Tensor self, Tensor min, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & clamp_min_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & min) { + return at::_ops::clamp_min_Tensor_out::call(self, min, out); +} +// aten::clamp_min.Tensor_out(Tensor self, Tensor min, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & clamp_min_outf(const at::Tensor & self, const at::Tensor & min, at::Tensor & out) { + return at::_ops::clamp_min_Tensor_out::call(self, min, out); +} + +} diff --git a/shared/package-files/9f/9fd3abc049ebae8ce12d1698c09356607acbeb977b507a662db4c37d536da668/blob b/shared/package-files/9f/9fd3abc049ebae8ce12d1698c09356607acbeb977b507a662db4c37d536da668/blob new file mode 100644 index 0000000000000000000000000000000000000000..40a960cba6283a16fb961f7408cd938ae5575e38 --- /dev/null +++ b/shared/package-files/9f/9fd3abc049ebae8ce12d1698c09356607acbeb977b507a662db4c37d536da668/blob @@ -0,0 +1,34 @@ +import os +import textwrap + +import pytest + +from sklearn import __version__ +from sklearn.utils._openmp_helpers import _openmp_parallelism_enabled + + +def test_openmp_parallelism_enabled(): + # Check that sklearn is built with OpenMP-based parallelism enabled. + # This test can be skipped by setting the environment variable + # ``SKLEARN_SKIP_OPENMP_TEST``. + if os.getenv("SKLEARN_SKIP_OPENMP_TEST"): + pytest.skip("test explicitly skipped (SKLEARN_SKIP_OPENMP_TEST)") + + base_url = "dev" if __version__.endswith(".dev0") else "stable" + err_msg = textwrap.dedent( + """ + This test fails because scikit-learn has been built without OpenMP. + This is not recommended since some estimators will run in sequential + mode instead of leveraging thread-based parallelism. + + You can find instructions to build scikit-learn with OpenMP at this + address: + + https://scikit-learn.org/{}/developers/advanced_installation.html + + You can skip this test by setting the environment variable + SKLEARN_SKIP_OPENMP_TEST to any value. + """ + ).format(base_url) + + assert _openmp_parallelism_enabled(), err_msg diff --git a/shared/package-files/9f/9fd40a2056532f8452b225ed03104ff571929f18f269ebd043d6c1a700ecbc08/blob b/shared/package-files/9f/9fd40a2056532f8452b225ed03104ff571929f18f269ebd043d6c1a700ecbc08/blob new file mode 100644 index 0000000000000000000000000000000000000000..d98b7063b6ae6292b65b61abf5a30c58b7d28e95 --- /dev/null +++ b/shared/package-files/9f/9fd40a2056532f8452b225ed03104ff571929f18f269ebd043d6c1a700ecbc08/blob @@ -0,0 +1,14 @@ +#ifndef TT_KERNEL_INCLUDES +#define TT_KERNEL_INCLUDES + +#include +#include +#include +#include + +#endif + +void unload_{kernel_name}(void); +void load_{kernel_name}(void); +// tt-linker: {kernel_name}:{full_signature}:{algo_info} +CUresult{_placeholder} {kernel_name}(CUstream stream, {signature}); diff --git a/shared/package-files/9f/9fd449fa0e7183f64997bf9cdd31b8553e0122d47730f343081cb040d8b9e3c2/blob b/shared/package-files/9f/9fd449fa0e7183f64997bf9cdd31b8553e0122d47730f343081cb040d8b9e3c2/blob new file mode 100644 index 0000000000000000000000000000000000000000..702173c3780c3b1474d634d6e9c4f205f8173579 --- /dev/null +++ b/shared/package-files/9f/9fd449fa0e7183f64997bf9cdd31b8553e0122d47730f343081cb040d8b9e3c2/blob @@ -0,0 +1,38 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API at::Tensor hamming_window(int64_t window_length, at::TensorOptions options={}); +TORCH_API at::Tensor hamming_window(int64_t window_length, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +TORCH_API at::Tensor & hamming_window_out(at::Tensor & out, int64_t window_length); +TORCH_API at::Tensor & hamming_window_outf(int64_t window_length, at::Tensor & out); +TORCH_API at::Tensor hamming_window(int64_t window_length, bool periodic, at::TensorOptions options={}); +TORCH_API at::Tensor hamming_window(int64_t window_length, bool periodic, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +TORCH_API at::Tensor & hamming_window_out(at::Tensor & out, int64_t window_length, bool periodic); +TORCH_API at::Tensor & hamming_window_outf(int64_t window_length, bool periodic, at::Tensor & out); +TORCH_API at::Tensor hamming_window(int64_t window_length, bool periodic, double alpha, at::TensorOptions options={}); +TORCH_API at::Tensor hamming_window(int64_t window_length, bool periodic, double alpha, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +TORCH_API at::Tensor & hamming_window_out(at::Tensor & out, int64_t window_length, bool periodic, double alpha); +TORCH_API at::Tensor & hamming_window_outf(int64_t window_length, bool periodic, double alpha, at::Tensor & out); +TORCH_API at::Tensor hamming_window(int64_t window_length, bool periodic, double alpha, double beta, at::TensorOptions options={}); +TORCH_API at::Tensor hamming_window(int64_t window_length, bool periodic, double alpha, double beta, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory); +TORCH_API at::Tensor & hamming_window_out(at::Tensor & out, int64_t window_length, bool periodic, double alpha, double beta); +TORCH_API at::Tensor & hamming_window_outf(int64_t window_length, bool periodic, double alpha, double beta, at::Tensor & out); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/shared/package-files/9f/9fd4dd97a0c691b12e39aca25ab1fc921f95cf1c8583175a86f82f795baa4cc5/blob b/shared/package-files/9f/9fd4dd97a0c691b12e39aca25ab1fc921f95cf1c8583175a86f82f795baa4cc5/blob new file mode 100644 index 0000000000000000000000000000000000000000..32fb0e84cf49441265dff50fc24367a89f9e4f63 --- /dev/null +++ b/shared/package-files/9f/9fd4dd97a0c691b12e39aca25ab1fc921f95cf1c8583175a86f82f795baa4cc5/blob @@ -0,0 +1,23 @@ +#pragma once +// @generated by torchgen/gen.py from DispatchKeyFunction.h + +// NB: The implementing C++ file is RegisterDispatchKey.cpp + +// The only #includes we need are for custom classes that have defaults in the C++ API +#include +#include +#include + +// Forward declarations of any types needed in the operator signatures. +// We can't directly include these classes because it will cause circular include dependencies. +// This file is included by TensorBody.h, which defines the Tensor class. +#include + +namespace at { + +namespace meta { + +TORCH_API at::Tensor & _index_put_impl_(at::Tensor & self, const c10::List> & indices, const at::Tensor & values, bool accumulate=false, bool unsafe=false); + +} // namespace meta +} // namespace at diff --git a/shared/package-files/9f/9fd5a9c62049fc0be5b630c6987f152c9c97e845cb5b385042818a4cb6186c42/blob b/shared/package-files/9f/9fd5a9c62049fc0be5b630c6987f152c9c97e845cb5b385042818a4cb6186c42/blob new file mode 100644 index 0000000000000000000000000000000000000000..c4f9e3eb00ffd6adfbd713f96e345fe97be1dbc2 --- /dev/null +++ b/shared/package-files/9f/9fd5a9c62049fc0be5b630c6987f152c9c97e845cb5b385042818a4cb6186c42/blob @@ -0,0 +1,284 @@ +import textwrap +from io import BytesIO + +import pytest + +from sklearn.datasets._arff_parser import ( + _liac_arff_parser, + _pandas_arff_parser, + _post_process_frame, + load_arff_from_gzip_file, +) + + +@pytest.mark.parametrize( + "feature_names, target_names", + [ + ( + [ + "col_int_as_integer", + "col_int_as_numeric", + "col_float_as_real", + "col_float_as_numeric", + ], + ["col_categorical", "col_string"], + ), + ( + [ + "col_int_as_integer", + "col_int_as_numeric", + "col_float_as_real", + "col_float_as_numeric", + ], + ["col_categorical"], + ), + ( + [ + "col_int_as_integer", + "col_int_as_numeric", + "col_float_as_real", + "col_float_as_numeric", + ], + [], + ), + ], +) +def test_post_process_frame(feature_names, target_names): + """Check the behaviour of the post-processing function for splitting a dataframe.""" + pd = pytest.importorskip("pandas") + + X_original = pd.DataFrame( + { + "col_int_as_integer": [1, 2, 3], + "col_int_as_numeric": [1, 2, 3], + "col_float_as_real": [1.0, 2.0, 3.0], + "col_float_as_numeric": [1.0, 2.0, 3.0], + "col_categorical": ["a", "b", "c"], + "col_string": ["a", "b", "c"], + } + ) + + X, y = _post_process_frame(X_original, feature_names, target_names) + assert isinstance(X, pd.DataFrame) + if len(target_names) >= 2: + assert isinstance(y, pd.DataFrame) + elif len(target_names) == 1: + assert isinstance(y, pd.Series) + else: + assert y is None + + +def test_load_arff_from_gzip_file_error_parser(): + """An error will be raised if the parser is not known.""" + # None of the input parameters are required to be accurate since the check + # of the parser will be carried out first. + + err_msg = "Unknown parser: 'xxx'. Should be 'liac-arff' or 'pandas'" + with pytest.raises(ValueError, match=err_msg): + load_arff_from_gzip_file("xxx", "xxx", "xxx", "xxx", "xxx", "xxx") + + +@pytest.mark.parametrize("parser_func", [_liac_arff_parser, _pandas_arff_parser]) +def test_pandas_arff_parser_strip_single_quotes(parser_func): + """Check that we properly strip single quotes from the data.""" + pd = pytest.importorskip("pandas") + + arff_file = BytesIO( + textwrap.dedent( + """ + @relation 'toy' + @attribute 'cat_single_quote' {'A', 'B', 'C'} + @attribute 'str_single_quote' string + @attribute 'str_nested_quote' string + @attribute 'class' numeric + @data + 'A','some text','\"expect double quotes\"',0 + """ + ).encode("utf-8") + ) + + columns_info = { + "cat_single_quote": { + "data_type": "nominal", + "name": "cat_single_quote", + }, + "str_single_quote": { + "data_type": "string", + "name": "str_single_quote", + }, + "str_nested_quote": { + "data_type": "string", + "name": "str_nested_quote", + }, + "class": { + "data_type": "numeric", + "name": "class", + }, + } + + feature_names = [ + "cat_single_quote", + "str_single_quote", + "str_nested_quote", + ] + target_names = ["class"] + + # We don't strip single quotes for string columns with the pandas parser. + expected_values = { + "cat_single_quote": "A", + "str_single_quote": ( + "some text" if parser_func is _liac_arff_parser else "'some text'" + ), + "str_nested_quote": ( + '"expect double quotes"' + if parser_func is _liac_arff_parser + else "'\"expect double quotes\"'" + ), + "class": 0, + } + + _, _, frame, _ = parser_func( + arff_file, + output_arrays_type="pandas", + openml_columns_info=columns_info, + feature_names_to_select=feature_names, + target_names_to_select=target_names, + ) + + assert frame.columns.tolist() == feature_names + target_names + pd.testing.assert_series_equal(frame.iloc[0], pd.Series(expected_values, name=0)) + + +@pytest.mark.parametrize("parser_func", [_liac_arff_parser, _pandas_arff_parser]) +def test_pandas_arff_parser_strip_double_quotes(parser_func): + """Check that we properly strip double quotes from the data.""" + pd = pytest.importorskip("pandas") + + arff_file = BytesIO( + textwrap.dedent( + """ + @relation 'toy' + @attribute 'cat_double_quote' {"A", "B", "C"} + @attribute 'str_double_quote' string + @attribute 'str_nested_quote' string + @attribute 'class' numeric + @data + "A","some text","\'expect double quotes\'",0 + """ + ).encode("utf-8") + ) + + columns_info = { + "cat_double_quote": { + "data_type": "nominal", + "name": "cat_double_quote", + }, + "str_double_quote": { + "data_type": "string", + "name": "str_double_quote", + }, + "str_nested_quote": { + "data_type": "string", + "name": "str_nested_quote", + }, + "class": { + "data_type": "numeric", + "name": "class", + }, + } + + feature_names = [ + "cat_double_quote", + "str_double_quote", + "str_nested_quote", + ] + target_names = ["class"] + + expected_values = { + "cat_double_quote": "A", + "str_double_quote": "some text", + "str_nested_quote": "'expect double quotes'", + "class": 0, + } + + _, _, frame, _ = parser_func( + arff_file, + output_arrays_type="pandas", + openml_columns_info=columns_info, + feature_names_to_select=feature_names, + target_names_to_select=target_names, + ) + + assert frame.columns.tolist() == feature_names + target_names + pd.testing.assert_series_equal(frame.iloc[0], pd.Series(expected_values, name=0)) + + +@pytest.mark.parametrize( + "parser_func", + [ + # internal quotes are not considered to follow the ARFF spec in LIAC ARFF + pytest.param(_liac_arff_parser, marks=pytest.mark.xfail), + _pandas_arff_parser, + ], +) +def test_pandas_arff_parser_strip_no_quotes(parser_func): + """Check that we properly parse with no quotes characters.""" + pd = pytest.importorskip("pandas") + + arff_file = BytesIO( + textwrap.dedent( + """ + @relation 'toy' + @attribute 'cat_without_quote' {A, B, C} + @attribute 'str_without_quote' string + @attribute 'str_internal_quote' string + @attribute 'class' numeric + @data + A,some text,'internal' quote,0 + """ + ).encode("utf-8") + ) + + columns_info = { + "cat_without_quote": { + "data_type": "nominal", + "name": "cat_without_quote", + }, + "str_without_quote": { + "data_type": "string", + "name": "str_without_quote", + }, + "str_internal_quote": { + "data_type": "string", + "name": "str_internal_quote", + }, + "class": { + "data_type": "numeric", + "name": "class", + }, + } + + feature_names = [ + "cat_without_quote", + "str_without_quote", + "str_internal_quote", + ] + target_names = ["class"] + + expected_values = { + "cat_without_quote": "A", + "str_without_quote": "some text", + "str_internal_quote": "'internal' quote", + "class": 0, + } + + _, _, frame, _ = parser_func( + arff_file, + output_arrays_type="pandas", + openml_columns_info=columns_info, + feature_names_to_select=feature_names, + target_names_to_select=target_names, + ) + + assert frame.columns.tolist() == feature_names + target_names + pd.testing.assert_series_equal(frame.iloc[0], pd.Series(expected_values, name=0)) diff --git a/shared/package-files/9f/9fd66aa0c23c72bf77c75778b49ffc252345433ff8e2838aefab1bc871855c74/blob b/shared/package-files/9f/9fd66aa0c23c72bf77c75778b49ffc252345433ff8e2838aefab1bc871855c74/blob new file mode 100644 index 0000000000000000000000000000000000000000..dd028fe732a5de98e98a937ad577a34c3c5541f3 --- /dev/null +++ b/shared/package-files/9f/9fd66aa0c23c72bf77c75778b49ffc252345433ff8e2838aefab1bc871855c74/blob @@ -0,0 +1,25 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API void _foreach_trunc_out(at::TensorList self, at::TensorList out); +TORCH_API ::std::vector foreach_tensor_trunc_slow(at::TensorList self); +TORCH_API void foreach_tensor_trunc_slow_(at::TensorList self); +TORCH_API ::std::vector foreach_tensor_trunc_cuda(at::TensorList self); +TORCH_API void foreach_tensor_trunc_cuda_(at::TensorList self); +} // namespace native +} // namespace at diff --git a/shared/package-files/9f/9fd69e8599b1d2c18b63f45bb954c190376ab41bacb357d8860105ceef32b2ca/blob b/shared/package-files/9f/9fd69e8599b1d2c18b63f45bb954c190376ab41bacb357d8860105ceef32b2ca/blob new file mode 100644 index 0000000000000000000000000000000000000000..70664f9d279fe516ed47754ad2f54d6d466d3ac5 --- /dev/null +++ b/shared/package-files/9f/9fd69e8599b1d2c18b63f45bb954c190376ab41bacb357d8860105ceef32b2ca/blob @@ -0,0 +1,26 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_upsample_nearest2d_backward_out_cpu : public at::meta::structured_upsample_nearest2d_backward { +void impl(const at::Tensor & grad_output, at::ArrayRef output_size, at::ArrayRef input_size, c10::optional scales_h, c10::optional scales_w, const at::Tensor & grad_input); +}; +struct TORCH_API structured_upsample_nearest2d_backward_out_cuda : public at::meta::structured_upsample_nearest2d_backward { +void impl(const at::Tensor & grad_output, at::ArrayRef output_size, at::ArrayRef input_size, c10::optional scales_h, c10::optional scales_w, const at::Tensor & grad_input); +}; +} // namespace native +} // namespace at diff --git a/shared/package-files/9f/9fd6c691a2030049bf770a9111d01f84e5a59d4cfb76202fc907b8daa24ffa9d/blob b/shared/package-files/9f/9fd6c691a2030049bf770a9111d01f84e5a59d4cfb76202fc907b8daa24ffa9d/blob new file mode 100644 index 0000000000000000000000000000000000000000..16eff73638e4693bbc29e4476fa2486dfd6ca0fb --- /dev/null +++ b/shared/package-files/9f/9fd6c691a2030049bf770a9111d01f84e5a59d4cfb76202fc907b8daa24ffa9d/blob @@ -0,0 +1,190 @@ +""" +Where should I add a new type? `types_base.py` vs `types.py` + +This file defines data model classes for torchgen typing system, as well as some base types such as int32_t. + +`types.py` defines ATen Tensor type and some c10 types, along with signatures that use these types. + +The difference between these two files, is `types_base.py` should be implementation-agnostic, meaning it shouldn't +contain any type definition that is tight to a specific C++ library (e.g., ATen), so that it can be easily reused +if we want to generate code for another C++ library. + +Add new types to `types.py` if these types are ATen/c10 related. +Add new types to `types_base.py` if they are basic and not attached to ATen/c10. +""" +from dataclasses import dataclass +from typing import Dict + +from torchgen.model import BaseTy, ScalarType + +from .types_base import ( + BaseCppType, + BaseCType, + boolT, + byteT, + charT, + CType, + doubleT, + floatT, + int32T, + longT, + shortT, +) + + +TENSOR_LIST_LIKE_CTYPES = [ + "at::TensorList", + "const c10::List> &", + "const at::ITensorListRef &", +] + + +halfT = BaseCppType("at", "Half") +complexHalfT = BaseCppType( + "c10", "complex" +) # stuffing template param here is an abuse +complexFloatT = BaseCppType("c10", "complex") +complexDoubleT = BaseCppType("c10", "complex") +bfloat16T = BaseCppType("at", "BFloat16") +float8_e5m2T = BaseCppType("at", "Float8_e5m2") +float8_e5m2fnuzT = BaseCppType("at", "Float8_e5m2fnuz") +float8_e4m3fnT = BaseCppType("at", "Float8_e4m3fn") +float8_e4m3fnuzT = BaseCppType("at", "Float8_e4m3fnuz") +stringT = BaseCppType("c10", "string_view") +generatorT = BaseCppType("at", "Generator") +scalarTypeT = BaseCppType("at", "ScalarType") +tensorT = BaseCppType("at", "Tensor") +optionalTensorRefT = BaseCppType("at", "OptionalTensorRef") +tensorListT = BaseCppType("at", "TensorList") +iTensorListRefT = BaseCppType("at", "ITensorListRef") +iOptTensorListRefT = BaseCppType("at", "IOptTensorListRef") +dimnameT = BaseCppType("at", "Dimname") +dimnameListT = BaseCppType("at", "DimnameList") +dimVectorT = BaseCppType("at", "DimVector") +layoutT = BaseCppType("at", "Layout") +deviceT = BaseCppType("at", "Device") +deviceIndexT = BaseCppType("at", "DeviceIndex") +scalarT = BaseCppType("at", "Scalar") +optionalScalarRefT = BaseCppType("at", "OptionalScalarRef") +memoryFormatT = BaseCppType("at", "MemoryFormat") +qschemeT = BaseCppType("at", "QScheme") +storageT = BaseCppType("at", "Storage") +streamT = BaseCppType("at", "Stream") +intArrayRefT = BaseCppType("at", "IntArrayRef") +optionalIntArrayRefT = BaseCppType("at", "OptionalIntArrayRef") +optionalSymIntArrayRefT = BaseCppType("at", "OptionalSymIntArrayRef") +tensorOptionsT = BaseCppType("at", "TensorOptions") +typeAndSizeT = BaseCppType("torch::autograd::generated", "TypeAndSize") +tensorGeometryT = BaseCppType("at", "TensorGeometry") +SymIntT = BaseCppType("c10", "SymInt") +symIntArrayRefT = BaseCppType("c10", "SymIntArrayRef") + +# Types representing template parameters. Technically, we probably shouldn't +# represent them this way in codegen, but it was pretty convenient. +scalar_t = BaseCppType("", "scalar_t") +opmath_t = BaseCppType("", "opmath_t") + +ScalarTypeToCppMapping: Dict[ScalarType, BaseCppType] = { + ScalarType.Byte: byteT, + ScalarType.Char: charT, + ScalarType.Short: shortT, + ScalarType.Int: int32T, + ScalarType.Long: longT, + ScalarType.Half: halfT, + ScalarType.Float: floatT, + ScalarType.Double: doubleT, + ScalarType.ComplexHalf: complexHalfT, + ScalarType.ComplexFloat: complexFloatT, + ScalarType.ComplexDouble: complexDoubleT, + ScalarType.Bool: boolT, + ScalarType.Float8_e5m2: float8_e5m2T, + ScalarType.Float8_e5m2fnuz: float8_e5m2fnuzT, + ScalarType.Float8_e4m3fn: float8_e4m3fnT, + ScalarType.Float8_e4m3fnuz: float8_e4m3fnuzT, +} + +BaseTypeToCppMapping: Dict[BaseTy, BaseCppType] = { + BaseTy.int: longT, + BaseTy.float: doubleT, + BaseTy.bool: boolT, + BaseTy.str: stringT, + BaseTy.Generator: generatorT, + BaseTy.ScalarType: scalarTypeT, + BaseTy.Tensor: tensorT, + BaseTy.Dimname: dimnameT, + BaseTy.DimVector: dimVectorT, + BaseTy.Layout: layoutT, + BaseTy.Device: deviceT, + BaseTy.DeviceIndex: deviceIndexT, + BaseTy.Scalar: scalarT, + BaseTy.MemoryFormat: memoryFormatT, + BaseTy.QScheme: qschemeT, + BaseTy.Storage: storageT, + BaseTy.Stream: streamT, + BaseTy.SymInt: SymIntT, +} + +# CTypes encode C++ type structure as needed for translation. + + +@dataclass(frozen=True) +class OptionalCType(CType): + elem: "CType" + + def cpp_type(self, *, strip_ref: bool = False) -> str: + # Do not pass `strip_ref` recursively. + return f"c10::optional<{self.elem.cpp_type()}>" + + def cpp_type_registration_declarations(self) -> str: + return f"c10::optional<{self.elem.cpp_type_registration_declarations()}>" + + def remove_const_ref(self) -> "CType": + return OptionalCType(self.elem.remove_const_ref()) + + +@dataclass(frozen=True) +class ListCType(CType): + elem: "CType" + + def cpp_type(self, *, strip_ref: bool = False) -> str: + # Do not pass `strip_ref` recursively. + return f"c10::List<{self.elem.cpp_type()}>" + + def cpp_type_registration_declarations(self) -> str: + return f"c10::List<{self.elem.cpp_type_registration_declarations()}>" + + def remove_const_ref(self) -> "CType": + return ListCType(self.elem.remove_const_ref()) + + +@dataclass(frozen=True) +class ArrayRefCType(CType): + elem: "CType" + + def cpp_type(self, *, strip_ref: bool = False) -> str: + # Do not pass `strip_ref` recursively. + return f"at::ArrayRef<{self.elem.cpp_type()}>" + + def cpp_type_registration_declarations(self) -> str: + return f"ArrayRef<{self.elem.cpp_type_registration_declarations()}>" + + def remove_const_ref(self) -> "CType": + return ArrayRefCType(self.elem.remove_const_ref()) + + +@dataclass(frozen=True) +class VectorizedCType(CType): + # This template is explicitly specialized, so the only valid + # elems are those we have specializations for (e.g., float, double, ...) + # scalar_t is also a common argument here (when we are codegen in + # a templated context) + elem: BaseCType + + def cpp_type(self, *, strip_ref: bool = False) -> str: + return f"at::vec::Vectorized<{self.elem.cpp_type()}>" + + def cpp_type_registration_declarations(self) -> str: + raise NotImplementedError + + def remove_const_ref(self) -> "CType": + return self diff --git a/shared/package-files/9f/9fd7f79a5562a9414e6b72a87ddc28a39daa0be598569c85d988a546c978b9ac/blob b/shared/package-files/9f/9fd7f79a5562a9414e6b72a87ddc28a39daa0be598569c85d988a546c978b9ac/blob new file mode 100644 index 0000000000000000000000000000000000000000..ddbceabcb00ade7a3d760f4e1663819571584d8e --- /dev/null +++ b/shared/package-files/9f/9fd7f79a5562a9414e6b72a87ddc28a39daa0be598569c85d988a546c978b9ac/blob @@ -0,0 +1,529 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +from __future__ import annotations + +import enum +from typing import ( + Any, + Dict, + Iterable, + Optional, + Tuple, +) + +import sys +if sys.version_info >= (3, 8): + from typing import TypedDict +else: + from typing_extensions import TypedDict + +import pyarrow as pa +import pyarrow.compute as pc +from pyarrow.interchange.buffer import _PyArrowBuffer + + +class DtypeKind(enum.IntEnum): + """ + Integer enum for data types. + + Attributes + ---------- + INT : int + Matches to signed integer data type. + UINT : int + Matches to unsigned integer data type. + FLOAT : int + Matches to floating point data type. + BOOL : int + Matches to boolean data type. + STRING : int + Matches to string data type (UTF-8 encoded). + DATETIME : int + Matches to datetime data type. + CATEGORICAL : int + Matches to categorical data type. + """ + + INT = 0 + UINT = 1 + FLOAT = 2 + BOOL = 20 + STRING = 21 # UTF-8 + DATETIME = 22 + CATEGORICAL = 23 + + +Dtype = Tuple[DtypeKind, int, str, str] # see Column.dtype + + +_PYARROW_KINDS = { + pa.int8(): (DtypeKind.INT, "c"), + pa.int16(): (DtypeKind.INT, "s"), + pa.int32(): (DtypeKind.INT, "i"), + pa.int64(): (DtypeKind.INT, "l"), + pa.uint8(): (DtypeKind.UINT, "C"), + pa.uint16(): (DtypeKind.UINT, "S"), + pa.uint32(): (DtypeKind.UINT, "I"), + pa.uint64(): (DtypeKind.UINT, "L"), + pa.float16(): (DtypeKind.FLOAT, "e"), + pa.float32(): (DtypeKind.FLOAT, "f"), + pa.float64(): (DtypeKind.FLOAT, "g"), + pa.bool_(): (DtypeKind.BOOL, "b"), + pa.string(): (DtypeKind.STRING, "u"), + pa.large_string(): (DtypeKind.STRING, "U"), +} + + +class ColumnNullType(enum.IntEnum): + """ + Integer enum for null type representation. + + Attributes + ---------- + NON_NULLABLE : int + Non-nullable column. + USE_NAN : int + Use explicit float NaN value. + USE_SENTINEL : int + Sentinel value besides NaN. + USE_BITMASK : int + The bit is set/unset representing a null on a certain position. + USE_BYTEMASK : int + The byte is set/unset representing a null on a certain position. + """ + + NON_NULLABLE = 0 + USE_NAN = 1 + USE_SENTINEL = 2 + USE_BITMASK = 3 + USE_BYTEMASK = 4 + + +class ColumnBuffers(TypedDict): + # first element is a buffer containing the column data; + # second element is the data buffer's associated dtype + data: Tuple[_PyArrowBuffer, Dtype] + + # first element is a buffer containing mask values indicating missing data; + # second element is the mask value buffer's associated dtype. + # None if the null representation is not a bit or byte mask + validity: Optional[Tuple[_PyArrowBuffer, Dtype]] + + # first element is a buffer containing the offset values for + # variable-size binary data (e.g., variable-length strings); + # second element is the offsets buffer's associated dtype. + # None if the data buffer does not have an associated offsets buffer + offsets: Optional[Tuple[_PyArrowBuffer, Dtype]] + + +class CategoricalDescription(TypedDict): + # whether the ordering of dictionary indices is semantically meaningful + is_ordered: bool + # whether a dictionary-style mapping of categorical values to other objects + # exists + is_dictionary: bool + # Python-level only (e.g. ``{int: str}``). + # None if not a dictionary-style categorical. + categories: Optional[_PyArrowColumn] + + +class Endianness: + """Enum indicating the byte-order of a data-type.""" + + LITTLE = "<" + BIG = ">" + NATIVE = "=" + NA = "|" + + +class NoBufferPresent(Exception): + """Exception to signal that there is no requested buffer.""" + + +class _PyArrowColumn: + """ + A column object, with only the methods and properties required by the + interchange protocol defined. + + A column can contain one or more chunks. Each chunk can contain up to three + buffers - a data buffer, a mask buffer (depending on null representation), + and an offsets buffer (if variable-size binary; e.g., variable-length + strings). + + TBD: Arrow has a separate "null" dtype, and has no separate mask concept. + Instead, it seems to use "children" for both columns with a bit mask, + and for nested dtypes. Unclear whether this is elegant or confusing. + This design requires checking the null representation explicitly. + + The Arrow design requires checking: + 1. the ARROW_FLAG_NULLABLE (for sentinel values) + 2. if a column has two children, combined with one of those children + having a null dtype. + + Making the mask concept explicit seems useful. One null dtype would + not be enough to cover both bit and byte masks, so that would mean + even more checking if we did it the Arrow way. + + TBD: there's also the "chunk" concept here, which is implicit in Arrow as + multiple buffers per array (= column here). Semantically it may make + sense to have both: chunks were meant for example for lazy evaluation + of data which doesn't fit in memory, while multiple buffers per column + could also come from doing a selection operation on a single + contiguous buffer. + + Given these concepts, one would expect chunks to be all of the same + size (say a 10,000 row dataframe could have 10 chunks of 1,000 rows), + while multiple buffers could have data-dependent lengths. Not an issue + in pandas if one column is backed by a single NumPy array, but in + Arrow it seems possible. + Are multiple chunks *and* multiple buffers per column necessary for + the purposes of this interchange protocol, or must producers either + reuse the chunk concept for this or copy the data? + + Note: this Column object can only be produced by ``__dataframe__``, so + doesn't need its own version or ``__column__`` protocol. + """ + + def __init__( + self, column: pa.Array | pa.ChunkedArray, allow_copy: bool = True + ) -> None: + """ + Handles PyArrow Arrays and ChunkedArrays. + """ + # Store the column as a private attribute + if isinstance(column, pa.ChunkedArray): + if column.num_chunks == 1: + column = column.chunk(0) + else: + if not allow_copy: + raise RuntimeError( + "Chunks will be combined and a copy is required which " + "is forbidden by allow_copy=False" + ) + column = column.combine_chunks() + + self._allow_copy = allow_copy + + if pa.types.is_boolean(column.type): + if not allow_copy: + raise RuntimeError( + "Boolean column will be casted to uint8 and a copy " + "is required which is forbidden by allow_copy=False" + ) + self._dtype = self._dtype_from_arrowdtype(column.type, 8) + self._col = pc.cast(column, pa.uint8()) + else: + self._col = column + dtype = self._col.type + try: + bit_width = dtype.bit_width + except ValueError: + # in case of a variable-length strings, considered as array + # of bytes (8 bits) + bit_width = 8 + self._dtype = self._dtype_from_arrowdtype(dtype, bit_width) + + def size(self) -> int: + """ + Size of the column, in elements. + + Corresponds to DataFrame.num_rows() if column is a single chunk; + equal to size of this current chunk otherwise. + + Is a method rather than a property because it may cause a (potentially + expensive) computation for some dataframe implementations. + """ + return len(self._col) + + @property + def offset(self) -> int: + """ + Offset of first element. + + May be > 0 if using chunks; for example for a column with N chunks of + equal size M (only the last chunk may be shorter), + ``offset = n * M``, ``n = 0 .. N-1``. + """ + return self._col.offset + + @property + def dtype(self) -> Tuple[DtypeKind, int, str, str]: + """ + Dtype description as a tuple ``(kind, bit-width, format string, + endianness)``. + + Bit-width : the number of bits as an integer + Format string : data type description format string in Apache Arrow C + Data Interface format. + Endianness : current only native endianness (``=``) is supported + + Notes: + - Kind specifiers are aligned with DLPack where possible (hence the + jump to 20, leave enough room for future extension) + - Masks must be specified as boolean with either bit width 1 (for + bit masks) or 8 (for byte masks). + - Dtype width in bits was preferred over bytes + - Endianness isn't too useful, but included now in case in the + future we need to support non-native endianness + - Went with Apache Arrow format strings over NumPy format strings + because they're more complete from a dataframe perspective + - Format strings are mostly useful for datetime specification, and + for categoricals. + - For categoricals, the format string describes the type of the + categorical in the data buffer. In case of a separate encoding of + the categorical (e.g. an integer to string mapping), this can + be derived from ``self.describe_categorical``. + - Data types not included: complex, Arrow-style null, binary, + decimal, and nested (list, struct, map, union) dtypes. + """ + return self._dtype + + def _dtype_from_arrowdtype( + self, dtype: pa.DataType, bit_width: int + ) -> Tuple[DtypeKind, int, str, str]: + """ + See `self.dtype` for details. + """ + # Note: 'c' (complex) not handled yet (not in array spec v1). + # 'b', 'B' (bytes), 'S', 'a', (old-style string) 'V' (void) + # not handled datetime and timedelta both map to datetime + # (is timedelta handled?) + + if pa.types.is_timestamp(dtype): + kind = DtypeKind.DATETIME + ts = dtype.unit[0] + tz = dtype.tz if dtype.tz else "" + f_string = f"ts{ts}:{tz}" + return kind, bit_width, f_string, Endianness.NATIVE + elif pa.types.is_dictionary(dtype): + kind = DtypeKind.CATEGORICAL + arr = self._col + indices_dtype = arr.indices.type + _, f_string = _PYARROW_KINDS.get(indices_dtype) + return kind, bit_width, f_string, Endianness.NATIVE + else: + kind, f_string = _PYARROW_KINDS.get(dtype, (None, None)) + if kind is None: + raise ValueError( + f"Data type {dtype} not supported by interchange protocol") + + return kind, bit_width, f_string, Endianness.NATIVE + + @property + def describe_categorical(self) -> CategoricalDescription: + """ + If the dtype is categorical, there are two options: + - There are only values in the data buffer. + - There is a separate non-categorical Column encoding categorical + values. + + Raises TypeError if the dtype is not categorical + + Returns the dictionary with description on how to interpret the + data buffer: + - "is_ordered" : bool, whether the ordering of dictionary indices + is semantically meaningful. + - "is_dictionary" : bool, whether a mapping of + categorical values to other objects exists + - "categories" : Column representing the (implicit) mapping of + indices to category values (e.g. an array of + cat1, cat2, ...). None if not a dictionary-style + categorical. + + TBD: are there any other in-memory representations that are needed? + """ + arr = self._col + if not pa.types.is_dictionary(arr.type): + raise TypeError( + "describe_categorical only works on a column with " + "categorical dtype!" + ) + + return { + "is_ordered": self._col.type.ordered, + "is_dictionary": True, + "categories": _PyArrowColumn(arr.dictionary), + } + + @property + def describe_null(self) -> Tuple[ColumnNullType, Any]: + """ + Return the missing value (or "null") representation the column dtype + uses, as a tuple ``(kind, value)``. + + Value : if kind is "sentinel value", the actual value. If kind is a bit + mask or a byte mask, the value (0 or 1) indicating a missing value. + None otherwise. + """ + # In case of no missing values, we need to set ColumnNullType to + # non nullable as in the current __dataframe__ protocol bit/byte masks + # cannot be None + if self.null_count == 0: + return ColumnNullType.NON_NULLABLE, None + else: + return ColumnNullType.USE_BITMASK, 0 + + @property + def null_count(self) -> int: + """ + Number of null elements, if known. + + Note: Arrow uses -1 to indicate "unknown", but None seems cleaner. + """ + arrow_null_count = self._col.null_count + n = arrow_null_count if arrow_null_count != -1 else None + return n + + @property + def metadata(self) -> Dict[str, Any]: + """ + The metadata for the column. See `DataFrame.metadata` for more details. + """ + pass + + def num_chunks(self) -> int: + """ + Return the number of chunks the column consists of. + """ + return 1 + + def get_chunks( + self, n_chunks: Optional[int] = None + ) -> Iterable[_PyArrowColumn]: + """ + Return an iterator yielding the chunks. + + See `DataFrame.get_chunks` for details on ``n_chunks``. + """ + if n_chunks and n_chunks > 1: + chunk_size = self.size() // n_chunks + if self.size() % n_chunks != 0: + chunk_size += 1 + + array = self._col + i = 0 + for start in range(0, chunk_size * n_chunks, chunk_size): + yield _PyArrowColumn( + array.slice(start, chunk_size), self._allow_copy + ) + i += 1 + else: + yield self + + def get_buffers(self) -> ColumnBuffers: + """ + Return a dictionary containing the underlying buffers. + + The returned dictionary has the following contents: + + - "data": a two-element tuple whose first element is a buffer + containing the data and whose second element is the data + buffer's associated dtype. + - "validity": a two-element tuple whose first element is a buffer + containing mask values indicating missing data and + whose second element is the mask value buffer's + associated dtype. None if the null representation is + not a bit or byte mask. + - "offsets": a two-element tuple whose first element is a buffer + containing the offset values for variable-size binary + data (e.g., variable-length strings) and whose second + element is the offsets buffer's associated dtype. None + if the data buffer does not have an associated offsets + buffer. + """ + buffers: ColumnBuffers = { + "data": self._get_data_buffer(), + "validity": None, + "offsets": None, + } + + try: + buffers["validity"] = self._get_validity_buffer() + except NoBufferPresent: + pass + + try: + buffers["offsets"] = self._get_offsets_buffer() + except NoBufferPresent: + pass + + return buffers + + def _get_data_buffer( + self, + ) -> Tuple[_PyArrowBuffer, Any]: # Any is for self.dtype tuple + """ + Return the buffer containing the data and the buffer's + associated dtype. + """ + array = self._col + dtype = self.dtype + + # In case of dictionary arrays, use indices + # to define a buffer, codes are transferred through + # describe_categorical() + if pa.types.is_dictionary(array.type): + array = array.indices + dtype = _PyArrowColumn(array).dtype + + n = len(array.buffers()) + if n == 2: + return _PyArrowBuffer(array.buffers()[1]), dtype + elif n == 3: + return _PyArrowBuffer(array.buffers()[2]), dtype + + def _get_validity_buffer(self) -> Tuple[_PyArrowBuffer, Any]: + """ + Return the buffer containing the mask values indicating missing data + and the buffer's associated dtype. + Raises NoBufferPresent if null representation is not a bit or byte + mask. + """ + # Define the dtype of the returned buffer + dtype = (DtypeKind.BOOL, 1, "b", Endianness.NATIVE) + array = self._col + buff = array.buffers()[0] + if buff: + return _PyArrowBuffer(buff), dtype + else: + raise NoBufferPresent( + "There are no missing values so " + "does not have a separate mask") + + def _get_offsets_buffer(self) -> Tuple[_PyArrowBuffer, Any]: + """ + Return the buffer containing the offset values for variable-size binary + data (e.g., variable-length strings) and the buffer's associated dtype. + Raises NoBufferPresent if the data buffer does not have an associated + offsets buffer. + """ + array = self._col + n = len(array.buffers()) + if n == 2: + raise NoBufferPresent( + "This column has a fixed-length dtype so " + "it does not have an offsets buffer" + ) + elif n == 3: + # Define the dtype of the returned buffer + dtype = self._col.type + if pa.types.is_large_string(dtype): + dtype = (DtypeKind.INT, 64, "l", Endianness.NATIVE) + else: + dtype = (DtypeKind.INT, 32, "i", Endianness.NATIVE) + return _PyArrowBuffer(array.buffers()[1]), dtype diff --git a/shared/package-files/9f/9fd8144a1eb56437c76bf7428eb9544559d774017c7696ed6ed8be4a85d68817/blob b/shared/package-files/9f/9fd8144a1eb56437c76bf7428eb9544559d774017c7696ed6ed8be4a85d68817/blob new file mode 100644 index 0000000000000000000000000000000000000000..bbd0e4502aa39ac5c9f4c5ae6658c01610973f2e --- /dev/null +++ b/shared/package-files/9f/9fd8144a1eb56437c76bf7428eb9544559d774017c7696ed6ed8be4a85d68817/blob @@ -0,0 +1,23 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_tanh_backward_out : public at::meta::structured_tanh_backward { +void impl(const at::Tensor & grad_output, const at::Tensor & output, const at::Tensor & grad_input); +}; +} // namespace native +} // namespace at diff --git a/shared/package-files/9f/9fd9d340ecc96f7f999d9e8092631d650e5361c4d43e7a87a1581a9749985df8/blob b/shared/package-files/9f/9fd9d340ecc96f7f999d9e8092631d650e5361c4d43e7a87a1581a9749985df8/blob new file mode 100644 index 0000000000000000000000000000000000000000..26995f95a282ab72d7cf9bf7d8f05adca86ad68c --- /dev/null +++ b/shared/package-files/9f/9fd9d340ecc96f7f999d9e8092631d650e5361c4d43e7a87a1581a9749985df8/blob @@ -0,0 +1,1304 @@ +# -*- coding: utf-8 -*- +"""Tests for Beautiful Soup's tree traversal methods. + +The tree traversal methods are the main advantage of using Beautiful +Soup over just using a parser. + +Different parsers will build different Beautiful Soup trees given the +same markup, but all Beautiful Soup trees can be traversed with the +methods tested here. +""" + +from pdb import set_trace +import pytest +import re +import warnings +from bs4 import BeautifulSoup +from bs4.builder import ( + builder_registry, + HTMLParserTreeBuilder, +) +from bs4.element import ( + CData, + Comment, + Declaration, + Doctype, + Formatter, + NavigableString, + Script, + SoupStrainer, + Stylesheet, + Tag, + TemplateString, +) +from . import ( + SoupTest, +) + +class TestFind(SoupTest): + """Basic tests of the find() method. + + find() just calls find_all() with limit=1, so it's not tested all + that thouroughly here. + """ + + def test_find_tag(self): + soup = self.soup("1234") + assert soup.find("b").string == "2" + + def test_unicode_text_find(self): + soup = self.soup('

Räksmörgås

') + assert soup.find(string='Räksmörgås') == 'Räksmörgås' + + def test_unicode_attribute_find(self): + soup = self.soup('

here it is

') + str(soup) + assert "here it is" == soup.find(id='Räksmörgås').text + + + def test_find_everything(self): + """Test an optimization that finds all tags.""" + soup = self.soup("foobar") + assert 2 == len(soup.find_all()) + + def test_find_everything_with_name(self): + """Test an optimization that finds all tags with a given name.""" + soup = self.soup("foobarbaz") + assert 2 == len(soup.find_all('a')) + +class TestFindAll(SoupTest): + """Basic tests of the find_all() method.""" + + def test_find_all_text_nodes(self): + """You can search the tree for text nodes.""" + soup = self.soup("Foobar\xbb") + # Exact match. + assert soup.find_all(string="bar") == ["bar"] + + + # Match any of a number of strings. + assert soup.find_all(string=["Foo", "bar"]) == ["Foo", "bar"] + # Match a regular expression. + assert soup.find_all(string=re.compile('.*')) == ["Foo", "bar", '\xbb'] + # Match anything. + assert soup.find_all(string=True) == ["Foo", "bar", '\xbb'] + + def test_find_all_limit(self): + """You can limit the number of items returned by find_all.""" + soup = self.soup("12345") + self.assert_selects(soup.find_all('a', limit=3), ["1", "2", "3"]) + self.assert_selects(soup.find_all('a', limit=1), ["1"]) + self.assert_selects( + soup.find_all('a', limit=10), ["1", "2", "3", "4", "5"]) + + # A limit of 0 means no limit. + self.assert_selects( + soup.find_all('a', limit=0), ["1", "2", "3", "4", "5"]) + + def test_calling_a_tag_is_calling_findall(self): + soup = self.soup("123") + self.assert_selects(soup('a', limit=1), ["1"]) + self.assert_selects(soup.b(id="foo"), ["3"]) + + def test_find_all_with_self_referential_data_structure_does_not_cause_infinite_recursion(self): + soup = self.soup("") + # Create a self-referential list. + l = [] + l.append(l) + + # Without special code in _normalize_search_value, this would cause infinite + # recursion. + assert [] == soup.find_all(l) + + def test_find_all_resultset(self): + """All find_all calls return a ResultSet""" + soup = self.soup("") + result = soup.find_all("a") + assert hasattr(result, "source") + + result = soup.find_all(True) + assert hasattr(result, "source") + + result = soup.find_all(string="foo") + assert hasattr(result, "source") + + +class TestFindAllBasicNamespaces(SoupTest): + + def test_find_by_namespaced_name(self): + soup = self.soup('4') + assert "4" == soup.find("mathml:msqrt").string + assert "a" == soup.find(attrs= { "svg:fill" : "red" }).name + + +class TestFindAllByName(SoupTest): + """Test ways of finding tags by tag name.""" + + def setup_method(self): + self.tree = self.soup("""First tag. + Second tag. + Third Nested tag. tag.""") + + def test_find_all_by_tag_name(self): + # Find all the tags. + self.assert_selects( + self.tree.find_all('a'), ['First tag.', 'Nested tag.']) + + def test_find_all_by_name_and_text(self): + self.assert_selects( + self.tree.find_all('a', string='First tag.'), ['First tag.']) + + self.assert_selects( + self.tree.find_all('a', string=True), ['First tag.', 'Nested tag.']) + + self.assert_selects( + self.tree.find_all('a', string=re.compile("tag")), + ['First tag.', 'Nested tag.']) + + + def test_find_all_on_non_root_element(self): + # You can call find_all on any node, not just the root. + self.assert_selects(self.tree.c.find_all('a'), ['Nested tag.']) + + def test_calling_element_invokes_find_all(self): + self.assert_selects(self.tree('a'), ['First tag.', 'Nested tag.']) + + def test_find_all_by_tag_strainer(self): + self.assert_selects( + self.tree.find_all(SoupStrainer('a')), + ['First tag.', 'Nested tag.']) + + def test_find_all_by_tag_names(self): + self.assert_selects( + self.tree.find_all(['a', 'b']), + ['First tag.', 'Second tag.', 'Nested tag.']) + + def test_find_all_by_tag_dict(self): + self.assert_selects( + self.tree.find_all({'a' : True, 'b' : True}), + ['First tag.', 'Second tag.', 'Nested tag.']) + + def test_find_all_by_tag_re(self): + self.assert_selects( + self.tree.find_all(re.compile('^[ab]$')), + ['First tag.', 'Second tag.', 'Nested tag.']) + + def test_find_all_with_tags_matching_method(self): + # You can define an oracle method that determines whether + # a tag matches the search. + def id_matches_name(tag): + return tag.name == tag.get('id') + + tree = self.soup("""Match 1. + Does not match. + Match 2.""") + + self.assert_selects( + tree.find_all(id_matches_name), ["Match 1.", "Match 2."]) + + def test_find_with_multi_valued_attribute(self): + soup = self.soup( + "
1
2
3
" + ) + r1 = soup.find('div', 'a d'); + r2 = soup.find('div', re.compile(r'a d')); + r3, r4 = soup.find_all('div', ['a b', 'a d']); + assert '3' == r1.string + assert '3' == r2.string + assert '1' == r3.string + assert '3' == r4.string + + +class TestFindAllByAttribute(SoupTest): + + def test_find_all_by_attribute_name(self): + # You can pass in keyword arguments to find_all to search by + # attribute. + tree = self.soup(""" + Matching a. + + Non-matching Matching b.a. + """) + self.assert_selects(tree.find_all(id='first'), + ["Matching a.", "Matching b."]) + + def test_find_all_by_utf8_attribute_value(self): + peace = "םולש".encode("utf8") + data = ''.encode("utf8") + soup = self.soup(data) + assert [soup.a] == soup.find_all(title=peace) + assert [soup.a] == soup.find_all(title=peace.decode("utf8")) + assert [soup.a], soup.find_all(title=[peace, "something else"]) + + def test_find_all_by_attribute_dict(self): + # You can pass in a dictionary as the argument 'attrs'. This + # lets you search for attributes like 'name' (a fixed argument + # to find_all) and 'class' (a reserved word in Python.) + tree = self.soup(""" + Name match. + Class match. + Non-match. + A tag called 'name1'. + """) + + # This doesn't do what you want. + self.assert_selects(tree.find_all(name='name1'), + ["A tag called 'name1'."]) + # This does what you want. + self.assert_selects(tree.find_all(attrs={'name' : 'name1'}), + ["Name match."]) + + self.assert_selects(tree.find_all(attrs={'class' : 'class2'}), + ["Class match."]) + + def test_find_all_by_class(self): + tree = self.soup(""" + Class 1. + Class 2. + Class 1. + Class 3 and 4. + """) + + # Passing in the class_ keyword argument will search against + # the 'class' attribute. + self.assert_selects(tree.find_all('a', class_='1'), ['Class 1.']) + self.assert_selects(tree.find_all('c', class_='3'), ['Class 3 and 4.']) + self.assert_selects(tree.find_all('c', class_='4'), ['Class 3 and 4.']) + + # Passing in a string to 'attrs' will also search the CSS class. + self.assert_selects(tree.find_all('a', '1'), ['Class 1.']) + self.assert_selects(tree.find_all(attrs='1'), ['Class 1.', 'Class 1.']) + self.assert_selects(tree.find_all('c', '3'), ['Class 3 and 4.']) + self.assert_selects(tree.find_all('c', '4'), ['Class 3 and 4.']) + + def test_find_by_class_when_multiple_classes_present(self): + tree = self.soup("Found it") + + f = tree.find_all("gar", class_=re.compile("o")) + self.assert_selects(f, ["Found it"]) + + f = tree.find_all("gar", class_=re.compile("a")) + self.assert_selects(f, ["Found it"]) + + # If the search fails to match the individual strings "foo" and "bar", + # it will be tried against the combined string "foo bar". + f = tree.find_all("gar", class_=re.compile("o b")) + self.assert_selects(f, ["Found it"]) + + def test_find_all_with_non_dictionary_for_attrs_finds_by_class(self): + soup = self.soup("Found it") + + self.assert_selects(soup.find_all("a", re.compile("ba")), ["Found it"]) + + def big_attribute_value(value): + return len(value) > 3 + + self.assert_selects(soup.find_all("a", big_attribute_value), []) + + def small_attribute_value(value): + return len(value) <= 3 + + self.assert_selects( + soup.find_all("a", small_attribute_value), ["Found it"]) + + def test_find_all_with_string_for_attrs_finds_multiple_classes(self): + soup = self.soup('') + a, a2 = soup.find_all("a") + assert [a, a2], soup.find_all("a", "foo") + assert [a], soup.find_all("a", "bar") + + # If you specify the class as a string that contains a + # space, only that specific value will be found. + assert [a] == soup.find_all("a", class_="foo bar") + assert [a] == soup.find_all("a", "foo bar") + assert [] == soup.find_all("a", "bar foo") + + def test_find_all_by_attribute_soupstrainer(self): + tree = self.soup(""" + Match. + Non-match.""") + + strainer = SoupStrainer(attrs={'id' : 'first'}) + self.assert_selects(tree.find_all(strainer), ['Match.']) + + def test_find_all_with_missing_attribute(self): + # You can pass in None as the value of an attribute to find_all. + # This will match tags that do not have that attribute set. + tree = self.soup("""ID present. + No ID present. + ID is empty.""") + self.assert_selects(tree.find_all('a', id=None), ["No ID present."]) + + def test_find_all_with_defined_attribute(self): + # You can pass in None as the value of an attribute to find_all. + # This will match tags that have that attribute set to any value. + tree = self.soup("""ID present. + No ID present. + ID is empty.""") + self.assert_selects( + tree.find_all(id=True), ["ID present.", "ID is empty."]) + + def test_find_all_with_numeric_attribute(self): + # If you search for a number, it's treated as a string. + tree = self.soup("""Unquoted attribute. + Quoted attribute.""") + + expected = ["Unquoted attribute.", "Quoted attribute."] + self.assert_selects(tree.find_all(id=1), expected) + self.assert_selects(tree.find_all(id="1"), expected) + + def test_find_all_with_list_attribute_values(self): + # You can pass a list of attribute values instead of just one, + # and you'll get tags that match any of the values. + tree = self.soup("""1 + 2 + 3 + No ID.""") + self.assert_selects(tree.find_all(id=["1", "3", "4"]), + ["1", "3"]) + + def test_find_all_with_regular_expression_attribute_value(self): + # You can pass a regular expression as an attribute value, and + # you'll get tags whose values for that attribute match the + # regular expression. + tree = self.soup("""One a. + Two as. + Mixed as and bs. + One b. + No ID.""") + + self.assert_selects(tree.find_all(id=re.compile("^a+$")), + ["One a.", "Two as."]) + + def test_find_by_name_and_containing_string(self): + soup = self.soup("foobarfoo") + a = soup.a + + assert [a] == soup.find_all("a", string="foo") + assert [] == soup.find_all("a", string="bar") + + def test_find_by_name_and_containing_string_when_string_is_buried(self): + soup = self.soup("foofoo") + assert soup.find_all("a") == soup.find_all("a", string="foo") + + def test_find_by_attribute_and_containing_string(self): + soup = self.soup('foofoo') + a = soup.a + + assert [a] == soup.find_all(id=2, string="foo") + assert [] == soup.find_all(id=1, string="bar") + + +class TestSmooth(SoupTest): + """Test Tag.smooth.""" + + def test_smooth(self): + soup = self.soup("
a
") + div = soup.div + div.append("b") + div.append("c") + div.append(Comment("Comment 1")) + div.append(Comment("Comment 2")) + div.append("d") + builder = self.default_builder() + span = Tag(soup, builder, 'span') + span.append('1') + span.append('2') + div.append(span) + + # At this point the tree has a bunch of adjacent + # NavigableStrings. This is normal, but it has no meaning in + # terms of HTML, so we may want to smooth things out for + # output. + + # Since the tag has two children, its .string is None. + assert None == div.span.string + + assert 7 == len(div.contents) + div.smooth() + assert 5 == len(div.contents) + + # The three strings at the beginning of div.contents have been + # merged into on string. + # + assert 'abc' == div.contents[0] + + # The call is recursive -- the tag was also smoothed. + assert '12' == div.span.string + + # The two comments have _not_ been merged, even though + # comments are strings. Merging comments would change the + # meaning of the HTML. + assert 'Comment 1' == div.contents[1] + assert 'Comment 2' == div.contents[2] + + +class TestIndex(SoupTest): + """Test Tag.index""" + def test_index(self): + tree = self.soup("""
+ Identical + Not identical + Identical + + Identical with child + Also not identical + Identical with child +
""") + div = tree.div + for i, element in enumerate(div.contents): + assert i == div.index(element) + with pytest.raises(ValueError): + tree.index(1) + + +class TestParentOperations(SoupTest): + """Test navigation and searching through an element's parents.""" + + def setup_method(self): + self.tree = self.soup('''
    +