hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a13dc2e5a4417dac9c88a4aea701e8ec3dc8c40 | 450 | py | Python | Music Generator/General Tests/jazziness weighting equation.py | sambowyer/musicgenerator | 8d4b74e136e9a1df944f7125ab1b1d39c74224b5 | [
"MIT"
] | null | null | null | Music Generator/General Tests/jazziness weighting equation.py | sambowyer/musicgenerator | 8d4b74e136e9a1df944f7125ab1b1d39c74224b5 | [
"MIT"
] | null | null | null | Music Generator/General Tests/jazziness weighting equation.py | sambowyer/musicgenerator | 8d4b74e136e9a1df944f7125ab1b1d39c74224b5 | [
"MIT"
] | null | null | null | chord=[9,6,4,3,2]
notes=[3,4,5,6,7]
"""
def q(j):
for x in notes:
print(-((0.5*x)**2)-5)
"""
def e(j):
coefficients = []
for x in notes:
coefficients.append((0.5+j)**x)
for c in coefficients:
print(c)
comparison = coefficients[0]/coefficients[4]
print()
print("... | 15.517241 | 47 | 0.515556 |
4a13dc8855b6859c9dc60a83252b31a48efe94de | 2,984 | py | Python | tests/test_smoketest.py | etesync/etebase-py | ee7bf21e9f57f0ce37f08d1f5cefd8ef0d3bb2f7 | [
"BSD-3-Clause"
] | 50 | 2020-08-14T07:56:19.000Z | 2022-03-27T12:33:10.000Z | tests/test_smoketest.py | etesync/etebase-py | ee7bf21e9f57f0ce37f08d1f5cefd8ef0d3bb2f7 | [
"BSD-3-Clause"
] | 6 | 2020-11-26T11:53:38.000Z | 2021-12-19T21:30:21.000Z | tests/test_smoketest.py | etesync/etebase-py | ee7bf21e9f57f0ce37f08d1f5cefd8ef0d3bb2f7 | [
"BSD-3-Clause"
] | 5 | 2020-08-31T12:12:10.000Z | 2021-04-11T23:28:40.000Z | import unittest
from etebase import Client, Account, FetchOptions
STORED_SESSION = "gqd2ZXJzaW9uAa1lbmNyeXB0ZWREYXRhxQGr_KWyDChQ6tXOJwJKf0Kw3QyR99itPIF3vZ5w6pVXSIq7AWul3fIXjIZOsBEwTVRumw7e9Af38D5oIL2VLNPLlmTOMjzIvuB00z3zDMFbH8pwrg2p_FvAhLHGjUGoXzU2XIxS4If7rQUfEz1zWkHPqWMrj4hACML5fks302dOUw7OsSMekcQaaVqMyj82MY3lG2qj8C... | 43.882353 | 625 | 0.72252 |
4a13dc9d462ff2ad819ddb39c3379b45a4db07d6 | 1,210 | py | Python | preprocessing/mtat_read.py | maahhi/sota-music-tagging-models | 14f0f9b89bb6f9ecb0fdb17eb6895905c0515027 | [
"MIT"
] | null | null | null | preprocessing/mtat_read.py | maahhi/sota-music-tagging-models | 14f0f9b89bb6f9ecb0fdb17eb6895905c0515027 | [
"MIT"
] | null | null | null | preprocessing/mtat_read.py | maahhi/sota-music-tagging-models | 14f0f9b89bb6f9ecb0fdb17eb6895905c0515027 | [
"MIT"
] | null | null | null | import os
import numpy as np
import glob
import librosa
import fire
import tqdm
class Processor:
def __init__(self):
print(1)
self.fs = 16000
def get_paths(self, data_path):
self.files = glob.glob(os.path.join(data_path, 'mtat', 'mp3', '*/*.mp3'))
self.npy_path = os.path.join(... | 26.888889 | 81 | 0.531405 |
4a13de84b0c64585eaa71cbd972d5f3ab2d7241c | 9,709 | py | Python | nephelae/array/DimensionHelper.py | pnarvor/nephelae_base | d5f1abeae0b0473b895b4735f182ddae0516a1bd | [
"BSD-3-Clause"
] | null | null | null | nephelae/array/DimensionHelper.py | pnarvor/nephelae_base | d5f1abeae0b0473b895b4735f182ddae0516a1bd | [
"BSD-3-Clause"
] | null | null | null | nephelae/array/DimensionHelper.py | pnarvor/nephelae_base | d5f1abeae0b0473b895b4735f182ddae0516a1bd | [
"BSD-3-Clause"
] | null | null | null | """DimensionHelper module
Contains a bunch of helper classes mostly used in the array.ScaledArray type.
The goal of the ScaledArray type is to be able to access a data array using
floating point indexes instead of integer indexes.
The idea behind this is that the data array represent a section of space.
For example ... | 33.136519 | 99 | 0.564322 |
4a13dfc18b6f468a9f2aec81c693e4c62a952a4d | 2,420 | py | Python | vulture/lines.py | rahulatdeepsource/vulture | 91044108b651c580339738e6812a91f0951fbef5 | [
"MIT"
] | null | null | null | vulture/lines.py | rahulatdeepsource/vulture | 91044108b651c580339738e6812a91f0951fbef5 | [
"MIT"
] | 1 | 2020-02-05T18:34:58.000Z | 2020-02-05T18:34:58.000Z | vulture/lines.py | rahulatdeepsource/vulture | 91044108b651c580339738e6812a91f0951fbef5 | [
"MIT"
] | null | null | null | import ast
def _get_last_child_with_lineno(node):
"""
Return the last direct child of `node` that has a lineno attribute,
or None if `node` has no such children.
Almost all node._field lists are sorted by the order in which they
appear in source code. For some nodes however, we have to skip some
... | 36.666667 | 72 | 0.658678 |
4a13e0a006324e97183a9b93612c6b7d94d4ab6f | 150 | py | Python | src/car.py | TestowanieAutomatyczneUG/laboratorium-9-maciej-witkowski | 9ebeb58814ab4921b7c1006d4b70e7a706627077 | [
"MIT"
] | null | null | null | src/car.py | TestowanieAutomatyczneUG/laboratorium-9-maciej-witkowski | 9ebeb58814ab4921b7c1006d4b70e7a706627077 | [
"MIT"
] | null | null | null | src/car.py | TestowanieAutomatyczneUG/laboratorium-9-maciej-witkowski | 9ebeb58814ab4921b7c1006d4b70e7a706627077 | [
"MIT"
] | null | null | null | class Car:
def needsFuel(self):
pass
def getEngineTemperature(self):
pass
def driveTo(self, destination):
pass
| 13.636364 | 35 | 0.586667 |
4a13e0b22ad98e68cf268aecf9f53a9289df631a | 28,237 | py | Python | pyNastran/op2/writer/geom2_writer.py | JohannesSeidel/pyNastran | 91ccd2756b201a7a3e4bb81cc6dc53b947d43bbf | [
"BSD-3-Clause"
] | null | null | null | pyNastran/op2/writer/geom2_writer.py | JohannesSeidel/pyNastran | 91ccd2756b201a7a3e4bb81cc6dc53b947d43bbf | [
"BSD-3-Clause"
] | null | null | null | pyNastran/op2/writer/geom2_writer.py | JohannesSeidel/pyNastran | 91ccd2756b201a7a3e4bb81cc6dc53b947d43bbf | [
"BSD-3-Clause"
] | null | null | null | from collections import defaultdict
from struct import pack, Struct
from .geom1_writer import write_geom_header, close_geom_table
integer_types = int
def write_geom2(op2, op2_ascii, obj, endian=b'<'):
if not hasattr(obj, 'elements'):
return
#if not hasattr(obj, 'nodes'):
#return
nspoints =... | 40.39628 | 109 | 0.487446 |
4a13e581461b5b1bd962fb9b2e16c814a425e981 | 4,627 | py | Python | tflib/ops/linear.py | SAP-samples/security-research-differentially-private-generative-models | c0eced81da3bc0064beb538557f042732cda459f | [
"Apache-2.0"
] | 19 | 2019-08-23T08:08:38.000Z | 2022-03-24T01:31:32.000Z | tflib/ops/linear.py | SAP-samples/security-research-differentially-private-generative-models | c0eced81da3bc0064beb538557f042732cda459f | [
"Apache-2.0"
] | 2 | 2020-04-23T15:12:48.000Z | 2020-09-29T13:44:15.000Z | tflib/ops/linear.py | SAP-samples/security-research-differentially-private-generative-models | c0eced81da3bc0064beb538557f042732cda459f | [
"Apache-2.0"
] | 5 | 2019-12-03T17:24:38.000Z | 2022-03-24T11:35:40.000Z | # SPDX-FileCopyrightText: 2020 SAP SE
#
# SPDX-License-Identifier: Apache-2.0
import tflib as lib
import numpy as np
import tensorflow as tf
_default_weightnorm = False
def enable_default_weightnorm():
global _default_weightnorm
_default_weightnorm = True
def disable_default_weightnorm():
global _defaul... | 30.440789 | 98 | 0.528852 |
4a13e64cf4e9f965c93a14d8f0588a9193bacc05 | 1,008 | py | Python | src/Main/DispatcherBase.py | mozafari/vprofiler | 23e44f04ba7476d35080bd3bc3a03c8e941e762a | [
"Apache-2.0"
] | 107 | 2016-03-11T04:45:42.000Z | 2022-03-06T05:06:38.000Z | src/Main/DispatcherBase.py | mozafari/vprofiler | 23e44f04ba7476d35080bd3bc3a03c8e941e762a | [
"Apache-2.0"
] | 14 | 2016-03-02T21:30:54.000Z | 2019-12-22T18:56:17.000Z | src/Main/DispatcherBase.py | mozafari/vprofiler | 23e44f04ba7476d35080bd3bc3a03c8e941e762a | [
"Apache-2.0"
] | 12 | 2017-05-31T02:05:21.000Z | 2021-11-27T13:59:57.000Z | import subprocess
class Dispatcher(object):
def __init__(self, disallowedOptions, optionalOptions, requiredOptions):
self.disallowedOptions = disallowedOptions
self.optionalOptions = optionalOptions
self.requiredOptions = requiredOptions
def ParseOptions(self, options):
for bar... | 34.758621 | 77 | 0.649802 |
4a13e68ae09bad8ded0afbe850d79c5ac3cff80a | 5,052 | py | Python | modules/io/python/drivers/io/tests/test_serialize.py | TREiop/v6d | 9ad80c65c226405b0c7b4ed6b6c9b1229bbf9175 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | modules/io/python/drivers/io/tests/test_serialize.py | TREiop/v6d | 9ad80c65c226405b0c7b4ed6b6c9b1229bbf9175 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | modules/io/python/drivers/io/tests/test_serialize.py | TREiop/v6d | 9ad80c65c226405b0c7b4ed6b6c9b1229bbf9175 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 Alibaba Group Holding Limited.
#
# 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/LI... | 36.085714 | 92 | 0.621932 |
4a13e6f872eb959dde254d7286bccba073f7c130 | 5,779 | py | Python | PyEntrezId/Conversion.py | lwgray/pyEntrezId | 28286cf21b876dd4894bf21a222dfd1022441b75 | [
"MIT"
] | 28 | 2015-10-19T14:22:36.000Z | 2022-01-30T19:52:52.000Z | PyEntrezId/Conversion.py | lwgray/pyEntrezId | 28286cf21b876dd4894bf21a222dfd1022441b75 | [
"MIT"
] | 8 | 2016-05-06T20:55:54.000Z | 2017-09-30T12:14:41.000Z | PyEntrezId/Conversion.py | lwgray/pyEntrezId | 28286cf21b876dd4894bf21a222dfd1022441b75 | [
"MIT"
] | 6 | 2017-02-15T15:15:23.000Z | 2018-12-15T12:38:41.000Z | #!/usr/bin/python
import requests
import sys
import xmltodict
import re
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
class Conversion(object):
def __init__(self, email):
"""Must Include Email"""
self.params = {}
self.email = email
... | 38.271523 | 134 | 0.545077 |
4a13e834e2862101aa1bcdd45be044958ed47ec7 | 958 | py | Python | tests/frontend/verifier/test_ransac.py | yuancaimaiyi/gtsfm | cc5781c35af23498d45cd96a1818e4786c5cca80 | [
"Apache-2.0"
] | null | null | null | tests/frontend/verifier/test_ransac.py | yuancaimaiyi/gtsfm | cc5781c35af23498d45cd96a1818e4786c5cca80 | [
"Apache-2.0"
] | null | null | null | tests/frontend/verifier/test_ransac.py | yuancaimaiyi/gtsfm | cc5781c35af23498d45cd96a1818e4786c5cca80 | [
"Apache-2.0"
] | 1 | 2021-09-23T13:08:49.000Z | 2021-09-23T13:08:49.000Z | """Tests for frontend's RANSAC verifier.
Authors: Ayush Baid
"""
import unittest
import tests.frontend.verifier.test_verifier_base as test_verifier_base
from gtsfm.frontend.verifier.ransac import Ransac
class TestRansacForEssentialMatrix(test_verifier_base.TestVerifierBase):
"""Unit tests for the RANSAC verifie... | 27.371429 | 78 | 0.75261 |
4a13e8c4288fcc20b116fc1a5e2fa77fb244d601 | 12,324 | py | Python | tensorflow/python/lib/io/tf_record_test.py | sbalk/tensorflow | 2997f48954e0877258579efa10e03ad783c164bf | [
"Apache-2.0"
] | 8 | 2017-03-20T12:04:21.000Z | 2021-06-24T20:34:30.000Z | tensorflow/python/lib/io/tf_record_test.py | sbalk/tensorflow | 2997f48954e0877258579efa10e03ad783c164bf | [
"Apache-2.0"
] | null | null | null | tensorflow/python/lib/io/tf_record_test.py | sbalk/tensorflow | 2997f48954e0877258579efa10e03ad783c164bf | [
"Apache-2.0"
] | 2 | 2017-03-20T12:10:56.000Z | 2017-11-12T00:15:54.000Z | # Copyright 2015 The TensorFlow Authors. 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 applica... | 34.424581 | 80 | 0.705128 |
4a13e8d601e0f9158382f7efb96ecd9b1b91baac | 236 | py | Python | intermediate_algorithms/maior_e_menor_peso.py | Yta-ux/python_algorithms | 62dd2d897e2f2de8783e68df3022170a86e9132e | [
"MIT"
] | 1 | 2022-01-26T22:15:17.000Z | 2022-01-26T22:15:17.000Z | intermediate_algorithms/maior_e_menor_peso.py | Yta-ux/python_algorithms | 62dd2d897e2f2de8783e68df3022170a86e9132e | [
"MIT"
] | null | null | null | intermediate_algorithms/maior_e_menor_peso.py | Yta-ux/python_algorithms | 62dd2d897e2f2de8783e68df3022170a86e9132e | [
"MIT"
] | null | null | null | m=0
me=0
for x in range (1,6):
p=float(input('Peso:'))
if x == 1:
m = p
me = p
else:
if p > m:
m = p
if p < me:
me = p
print(f'''Maior: {m}
Menor: {me}''') | 16.857143 | 28 | 0.334746 |
4a13e9810eb664970dd18577c07783f37da0ef8b | 20,082 | py | Python | KeyboardGuitar/venv/lib/python3.6/site-packages/serial/meta.py | Rezillien/stmmidi | 5d259cc30dcd08cba4e5225f8ced679c0d1675f7 | [
"Unlicense"
] | null | null | null | KeyboardGuitar/venv/lib/python3.6/site-packages/serial/meta.py | Rezillien/stmmidi | 5d259cc30dcd08cba4e5225f8ced679c0d1675f7 | [
"Unlicense"
] | null | null | null | KeyboardGuitar/venv/lib/python3.6/site-packages/serial/meta.py | Rezillien/stmmidi | 5d259cc30dcd08cba4e5225f8ced679c0d1675f7 | [
"Unlicense"
] | 1 | 2018-01-24T19:54:13.000Z | 2018-01-24T19:54:13.000Z | # region Backwards Compatibility
from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, \
with_statement
from future import standard_library
standard_library.install_aliases()
from builtins import *
from future.utils import native_str
# endregion
import ope... | 34.328205 | 122 | 0.501693 |
4a13eaf01e9957acee52f227fb58f92b392fdcf4 | 1,427 | py | Python | great_expectations/dataset/autoinspect.py | mastratton3/great_expectations | 151970d776c942bfc23cdd90c7ed00b57a34559d | [
"Apache-2.0"
] | null | null | null | great_expectations/dataset/autoinspect.py | mastratton3/great_expectations | 151970d776c942bfc23cdd90c7ed00b57a34559d | [
"Apache-2.0"
] | null | null | null | great_expectations/dataset/autoinspect.py | mastratton3/great_expectations | 151970d776c942bfc23cdd90c7ed00b57a34559d | [
"Apache-2.0"
] | null | null | null | """
Autoinspect utilities to automatically generate expectations by evaluating a data_asset.
"""
from __future__ import division
import warnings
from six import string_types
from .util import create_multiple_expectations
class AutoInspectError(Exception):
"""Exception raised for errors in autoinspection.
A... | 35.675 | 136 | 0.749124 |
4a13eb01f15ac9552c64065af2a83377c17f00c2 | 2,245 | py | Python | backend/homefieldtest_dev_22864/urls.py | crowdbotics-apps/homefieldtest-dev-22864 | 1dc12ae100cb170bde4aff0a8790451f61076a24 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/homefieldtest_dev_22864/urls.py | crowdbotics-apps/homefieldtest-dev-22864 | 1dc12ae100cb170bde4aff0a8790451f61076a24 | [
"FTL",
"AML",
"RSA-MD"
] | 28 | 2021-08-15T15:11:19.000Z | 2022-03-06T17:22:23.000Z | backend/homefieldtest_dev_22864/urls.py | crowdbotics-apps/homefieldtest-dev-22864 | 1dc12ae100cb170bde4aff0a8790451f61076a24 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """homefieldtest_dev_22864 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='ho... | 35.634921 | 87 | 0.716704 |
4a13ec6f73b137a21c5fcfe02bebd235068fe3e0 | 1,206 | py | Python | qiskit/qasm/node/format.py | TheGupta2012/qiskit-terra | 5ea6e9557655b144228c29d7099375f5d2c91120 | [
"Apache-2.0"
] | 1,599 | 2018-07-10T10:59:12.000Z | 2022-03-31T23:56:25.000Z | qiskit/qasm/node/format.py | TheGupta2012/qiskit-terra | 5ea6e9557655b144228c29d7099375f5d2c91120 | [
"Apache-2.0"
] | 5,244 | 2018-07-10T06:20:13.000Z | 2022-03-31T22:18:48.000Z | qiskit/qasm/node/format.py | TheGupta2012/qiskit-terra | 5ea6e9557655b144228c29d7099375f5d2c91120 | [
"Apache-2.0"
] | 1,409 | 2018-07-10T02:16:12.000Z | 2022-03-31T09:01:32.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 31.736842 | 77 | 0.669154 |
4a13eca57f1c8d1f678d11d4ca459ae292baf2fe | 11,351 | py | Python | salt/modules/openbsdpkg.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 2 | 2015-06-18T19:07:20.000Z | 2017-09-27T18:54:29.000Z | salt/modules/openbsdpkg.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-04-15T22:17:42.000Z | 2016-03-22T08:46:27.000Z | salt/modules/openbsdpkg.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 4 | 2015-04-16T03:24:08.000Z | 2015-04-22T15:33:28.000Z | # -*- coding: utf-8 -*-
'''
Package support for OpenBSD
.. note::
The package repository is configured on each host using ``/etc/installurl``
from OpenBSD 6.1 onwards. Earlier releases relied on ``/etc/pkg.conf``.
.. versionchanged:: 2016.3.5
Package versions on OpenBSD are not normally specified explic... | 27.417874 | 90 | 0.592547 |
4a13eca929294d81b9eafc4b074db6f1eeeeba5c | 3,970 | py | Python | src/appengine/appengine_config.py | ABHIsHEk122811/clusterfuzz | 7cac0ee869787e6f547a4b3dac18196c60f03383 | [
"Apache-2.0"
] | 4 | 2019-11-26T01:50:51.000Z | 2021-08-14T20:32:43.000Z | src/appengine/appengine_config.py | ABHIsHEk122811/clusterfuzz | 7cac0ee869787e6f547a4b3dac18196c60f03383 | [
"Apache-2.0"
] | 22 | 2019-12-26T17:02:34.000Z | 2022-03-21T22:16:52.000Z | src/appengine/appengine_config.py | ABHIsHEk122811/clusterfuzz | 7cac0ee869787e6f547a4b3dac18196c60f03383 | [
"Apache-2.0"
] | 2 | 2019-02-09T09:09:20.000Z | 2019-02-15T05:25:13.000Z | # -*- coding: utf-8 -*-
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.765766 | 80 | 0.733249 |
4a13eea02daac82ec05633c28b4384ad9eefdd65 | 3,765 | py | Python | Legacy/run.py | puat133/MCMC-MultiSPDE | 2beca39f32c0cdd7664baeacd495b193850d8e7d | [
"Apache-2.0"
] | 1 | 2020-06-23T09:32:43.000Z | 2020-06-23T09:32:43.000Z | Legacy/run.py | puat133/MCMC-MultiSPDE | 2beca39f32c0cdd7664baeacd495b193850d8e7d | [
"Apache-2.0"
] | null | null | null | Legacy/run.py | puat133/MCMC-MultiSPDE | 2beca39f32c0cdd7664baeacd495b193850d8e7d | [
"Apache-2.0"
] | null | null | null | #%%
import mcmc.simulation as s
import mcmc.plotting as p
import matplotlib.pyplot as plt
import numpy as np
import argparse
import parser_help as ph
#%%
# n = 2**6
# kappa_default =1e17
# sigma_0_default = 5e6#5e6
# sigma_v_default = 1e1#1e2
# kappa_factor = 1
# kappa = kappa_default/kappa_factor
# sigma_0 = sigma_0_d... | 61.721311 | 199 | 0.747676 |
4a13eec9ef09f9d7fdb8dac0dad1b508f1e50084 | 5,711 | py | Python | core/sawtooth_poet/poet_consensus/consensus_state_store.py | blockchaintp/sawtooth-poet | 724b9fd723cfcc6fccdb8a5b4a22f18b8a6b9c80 | [
"Apache-2.0"
] | 14 | 2018-07-27T06:06:31.000Z | 2021-12-03T00:30:39.000Z | core/sawtooth_poet/poet_consensus/consensus_state_store.py | blockchaintp/sawtooth-poet | 724b9fd723cfcc6fccdb8a5b4a22f18b8a6b9c80 | [
"Apache-2.0"
] | 20 | 2018-07-24T00:58:10.000Z | 2021-12-05T22:42:14.000Z | core/sawtooth_poet/poet_consensus/consensus_state_store.py | blockchaintp/sawtooth-poet | 724b9fd723cfcc6fccdb8a5b4a22f18b8a6b9c80 | [
"Apache-2.0"
] | 38 | 2018-07-20T19:54:48.000Z | 2022-03-20T07:27:46.000Z | # Copyright 2017 Intel Corporation
#
# 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 wri... | 35.253086 | 80 | 0.611627 |
4a13ef7c70899048bb65823287937e4f8867bc5f | 357 | py | Python | RaspberryPiOS Scripts/learningMode.py | joy-it/MultimediaCase-for-Raspberry-Pi | 909522521b2d53175b8460d9ef5bb1a51cfaec44 | [
"MIT"
] | 9 | 2020-12-29T22:17:13.000Z | 2021-12-14T09:12:47.000Z | RaspberryPiOS Scripts/learningMode.py | joy-it/MultimediaCase-for-Raspberry-Pi | 909522521b2d53175b8460d9ef5bb1a51cfaec44 | [
"MIT"
] | null | null | null | RaspberryPiOS Scripts/learningMode.py | joy-it/MultimediaCase-for-Raspberry-Pi | 909522521b2d53175b8460d9ef5bb1a51cfaec44 | [
"MIT"
] | 2 | 2021-12-07T15:55:35.000Z | 2022-03-21T11:43:43.000Z | #!/usr/bin/env python
import serial
import os
import time
ser = serial.Serial(
port='/dev/serial0',
baudrate = 38400,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
ser.write(str.encode('\x0D'))
ser.write(str.encode('X04'))
ser.write(str.encode('\x0D'))
time.slee... | 17.85 | 30 | 0.722689 |
4a13ef8acbce72cd9a53aa3b1ddaf336143bd322 | 515 | py | Python | characters/character_classes.py | kovitikus/hecate | b40526e393b3ac8011480d7359ef7145e6425a47 | [
"Unlicense"
] | 10 | 2020-09-21T04:47:23.000Z | 2022-02-12T09:50:45.000Z | characters/character_classes.py | kovitikus/hecate | b40526e393b3ac8011480d7359ef7145e6425a47 | [
"Unlicense"
] | 41 | 2020-12-14T10:21:23.000Z | 2021-09-02T07:43:27.000Z | characters/character_classes.py | kovitikus/hecate | b40526e393b3ac8011480d7359ef7145e6425a47 | [
"Unlicense"
] | 1 | 2020-08-30T19:00:21.000Z | 2020-08-30T19:00:21.000Z | # Main Classes
main_classes = {
'mage': {
'skillsets': ['fire', 'staves'],
'char_armor_type': 'cloth',
'base_health_bonus': 0,
'base_energy_bonus': 5
},
'paladin': {
'skillsets': ['holy'],
'char_armor_type': 'plate',
'base_health_bonus': 5,
... | 21.458333 | 40 | 0.491262 |
4a13f0954b943ad6526068a2663710b6db8eb29d | 9,087 | py | Python | tensorpack/tfutils/sessinit.py | ChriPo92/tensorpack | 45d2155850d3870bbf110c94c73508c707e1ae42 | [
"Apache-2.0"
] | null | null | null | tensorpack/tfutils/sessinit.py | ChriPo92/tensorpack | 45d2155850d3870bbf110c94c73508c707e1ae42 | [
"Apache-2.0"
] | null | null | null | tensorpack/tfutils/sessinit.py | ChriPo92/tensorpack | 45d2155850d3870bbf110c94c73508c707e1ae42 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File: sessinit.py
import os
import numpy as np
import six
import tensorflow as tf
from ..utils import logger
from .common import get_op_tensor_name
from .varmanip import SessionUpdate, get_checkpoint_path, get_savename_from_varname, is_training_name
__all__ = ['SessionInit', 'ChainInit',
... | 34.420455 | 110 | 0.619676 |
4a13f09f5f12bd8b00a6aed1003ccf6067ab4e68 | 6,322 | py | Python | emacs-the-best-python-editor/PyEval/pyeval_expression.py | TheTwoCentsRespository/materials | ebb5eefb2ac86dadff5f99856cc1542858e4dcfd | [
"MIT"
] | 2 | 2021-02-11T09:09:00.000Z | 2021-02-25T15:05:54.000Z | emacs-the-best-python-editor/PyEval/pyeval_expression.py | TheTwoCentsRespository/materials | ebb5eefb2ac86dadff5f99856cc1542858e4dcfd | [
"MIT"
] | 12 | 2021-05-01T05:30:36.000Z | 2022-02-01T22:01:27.000Z | emacs-the-best-python-editor/PyEval/pyeval_expression.py | Greentash/materials | c18a5b4384fcea51b7138871b6567e17bf706720 | [
"MIT"
] | 5 | 2021-08-09T04:20:23.000Z | 2022-03-11T06:18:48.000Z | """
Expression - defines an infix expression
Uses Operator to break the infix expression down, and
outputs an RPN string using the shunting yard approach.
Algorithm outlined at https://en.wikipedia.org/wiki/Shunting-yard_algorithm
"""
from pyeval_operator import Operator
class Expression:
"""
Defines and pa... | 36.333333 | 79 | 0.584941 |
4a13f300deb89c54eed42acfd7d0c86232c6b40d | 8,234 | py | Python | userena/tests/tests_forms.py | bsavelev/django-userena | 1b841560ceef95c3f4dfd8f7e2bdef9f845bc417 | [
"BSD-3-Clause"
] | null | null | null | userena/tests/tests_forms.py | bsavelev/django-userena | 1b841560ceef95c3f4dfd8f7e2bdef9f845bc417 | [
"BSD-3-Clause"
] | null | null | null | userena/tests/tests_forms.py | bsavelev/django-userena | 1b841560ceef95c3f4dfd8f7e2bdef9f845bc417 | [
"BSD-3-Clause"
] | 1 | 2019-07-27T19:23:35.000Z | 2019-07-27T19:23:35.000Z | # encoding: utf-8
from __future__ import unicode_literals
from django.test import TestCase
from django.utils.translation import ugettext_lazy as _, override
from userena import forms
from userena import settings as userena_settings
from userena.utils import get_user_model
class SignupFormTests(TestCase):
""" Te... | 37.9447 | 136 | 0.546393 |
4a13f3af69aac6787069234fbf7ca4895d7e3699 | 1,561 | py | Python | problems/test_0640.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0640.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0640.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | import unittest
# O(n)
class Solution:
def solveEquation(self, equation):
"""
:type equation: str
:rtype: str
"""
coeff = const = num = 0
sign = side = 1
for i, ch in enumerate(equation):
if ch.isdigit():
num = num * 10 + ord(ch)... | 26.913793 | 67 | 0.429212 |
4a13f457b250522e49e9fa74777565b440214a37 | 410 | py | Python | PythonExecicios/ex017.py | lucasohara98/Python_CursoemVideo | e5266abaf67ef3e27fe8928458b3860feb0ed46d | [
"MIT"
] | null | null | null | PythonExecicios/ex017.py | lucasohara98/Python_CursoemVideo | e5266abaf67ef3e27fe8928458b3860feb0ed46d | [
"MIT"
] | null | null | null | PythonExecicios/ex017.py | lucasohara98/Python_CursoemVideo | e5266abaf67ef3e27fe8928458b3860feb0ed46d | [
"MIT"
] | null | null | null | '''from math import hypot
op = float(input('Qual o comprimento do cateto oposto: '))
ad = float(input('Qual o comprimento do cateto adjacente: '))
print(f'A hipotenusa é: {hypot(op,ad):.2f}')'''
#sem importação
co = float(input('Qual o comprimento do cateto oposto: '))
ca = float (input('Qual o compriemento do ... | 34.166667 | 64 | 0.653659 |
4a13f69fed51e27fda345129f8940f3e4581555d | 10,345 | py | Python | python/src/main/python/pyalink/alink/common/types/vector.py | Yankee24/Alink | fb06bd7f0e3f7e298679e13a2e0e6f38db9e2242 | [
"Apache-2.0"
] | null | null | null | python/src/main/python/pyalink/alink/common/types/vector.py | Yankee24/Alink | fb06bd7f0e3f7e298679e13a2e0e6f38db9e2242 | [
"Apache-2.0"
] | null | null | null | python/src/main/python/pyalink/alink/common/types/vector.py | Yankee24/Alink | fb06bd7f0e3f7e298679e13a2e0e6f38db9e2242 | [
"Apache-2.0"
] | null | null | null | from abc import ABC
from py4j.java_gateway import JavaObject
from .bases.j_obj_wrapper import JavaObjectWrapperWithAutoTypeConversion
from .conversion.java_method_call import auto_convert_java_type, call_java_method
from .data_type_display import DataTypeDisplay
__all__ = ['Vector', 'DenseVector', 'SparseVector', 'D... | 25.109223 | 131 | 0.616336 |
4a13f781a9901807b000192cfdc1ce6b4d6d2594 | 8,027 | py | Python | tensor2tensor/trax/rl/ppo_trainer_test.py | levskaya/tensor2tensor | 4643800137f802693f880a1fab9e10de7ba32e66 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/trax/rl/ppo_trainer_test.py | levskaya/tensor2tensor | 4643800137f802693f880a1fab9e10de7ba32e66 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/trax/rl/ppo_trainer_test.py | levskaya/tensor2tensor | 4643800137f802693f880a1fab9e10de7ba32e66 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# 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... | 32.630081 | 77 | 0.645696 |
4a13f7e2e16d614459714645c2e64963fe214d03 | 34,846 | py | Python | synapse/api/auth.py | iot-factory/synapse | d3ac8fd87d85bd40d40b475d7a6f12f74ea0ddb0 | [
"Apache-2.0"
] | null | null | null | synapse/api/auth.py | iot-factory/synapse | d3ac8fd87d85bd40d40b475d7a6f12f74ea0ddb0 | [
"Apache-2.0"
] | null | null | null | synapse/api/auth.py | iot-factory/synapse | d3ac8fd87d85bd40d40b475d7a6f12f74ea0ddb0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 applica... | 36.564533 | 89 | 0.558142 |
4a13f8cc2a9a2d4216a8c31d30199dcf11cc710b | 1,737 | py | Python | scripts/scrape_bus_stops.py | yi-jiayu/bus-eta-bot | 3f0d21f540c5ce162960698f698ce85bc4f76f06 | [
"MIT"
] | 19 | 2017-05-09T18:19:18.000Z | 2021-07-30T14:42:18.000Z | scripts/scrape_bus_stops.py | yi-jiayu/bus-eta-bot | 3f0d21f540c5ce162960698f698ce85bc4f76f06 | [
"MIT"
] | 20 | 2017-02-12T15:28:59.000Z | 2020-02-08T04:22:49.000Z | scripts/scrape_bus_stops.py | yi-jiayu/bus-eta-bot | 3f0d21f540c5ce162960698f698ce85bc4f76f06 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import json
import os
import sys
import urllib.request
endpoint = 'http://datamall2.mytransport.sg/ltaodataservice/BusStops?$skip='
def get_bus_stops(account_key: str, offset: int):
url = '{}{}'.format(endpoint, offset)
req = urllib.request.Request(url, headers={'AccountKey': account_... | 27.571429 | 82 | 0.599885 |
4a13f9023194a8d4542f0eb96c6357471b291b71 | 51,883 | py | Python | python/federatedml/util/data_transform.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 715 | 2019-01-24T10:52:03.000Z | 2019-10-31T12:19:22.000Z | python/federatedml/util/data_transform.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 270 | 2019-02-11T02:57:36.000Z | 2019-08-29T11:22:33.000Z | python/federatedml/util/data_transform.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 200 | 2019-01-26T14:21:35.000Z | 2019-11-01T01:14:36.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE Authors. 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/lic... | 43.308013 | 141 | 0.570823 |
4a13f95263e1c00cea2eae418a8f4b3f3e691536 | 3,216 | py | Python | alexandria/api.py | HarkonenBade/alexandria | 2e16dbf2d11c7928d0a661b28bfc2552b68cb3fe | [
"MIT"
] | null | null | null | alexandria/api.py | HarkonenBade/alexandria | 2e16dbf2d11c7928d0a661b28bfc2552b68cb3fe | [
"MIT"
] | null | null | null | alexandria/api.py | HarkonenBade/alexandria | 2e16dbf2d11c7928d0a661b28bfc2552b68cb3fe | [
"MIT"
] | null | null | null | import datetime
import functools
from flask import (abort, g, jsonify, redirect,
request, render_template, url_for)
from . import app, db
def render(template, **kwargs):
if hasattr(g, "user"):
kwargs['user'] = db.obj_to_dict(g.user)
kwargs['urls'] = {'root': url_for('root'),
... | 26.360656 | 69 | 0.52643 |
4a13fa09997acc0602b445a7a17b76d60dc822ca | 4,831 | py | Python | src/sklearn_evaluation/util.py | edublancas/sklearn-model-evaluation | 1f35d5bcc689a5f4d54c14fde60abf09af9fc374 | [
"MIT"
] | 351 | 2016-01-27T19:15:27.000Z | 2022-03-09T15:40:56.000Z | src/sklearn_evaluation/util.py | edublancas/sklearn-model-evaluation | 1f35d5bcc689a5f4d54c14fde60abf09af9fc374 | [
"MIT"
] | 37 | 2016-03-16T03:57:59.000Z | 2021-06-26T14:02:33.000Z | src/sklearn_evaluation/util.py | edublancas/sklearn-model-evaluation | 1f35d5bcc689a5f4d54c14fde60abf09af9fc374 | [
"MIT"
] | 30 | 2016-01-27T19:27:08.000Z | 2022-03-31T06:09:59.000Z | from copy import copy
from inspect import signature, _empty
import re
from collections.abc import Iterable
from collections import defaultdict
from itertools import product
from six import string_types
def isiter(obj):
try:
iter(obj)
except TypeError:
return False
else:
return True... | 25.426316 | 124 | 0.628027 |
4a13fac25fdb0e1045ab625574d9b38e9f6e1ad3 | 1,707 | py | Python | tests/test_keys.py | rcarmo/miniredis | 39f49249cddd11a4b333932fdb8157273a8a1dc4 | [
"MIT"
] | 1 | 2020-11-15T13:35:55.000Z | 2020-11-15T13:35:55.000Z | tests/test_keys.py | rcarmo/miniredis | 39f49249cddd11a4b333932fdb8157273a8a1dc4 | [
"MIT"
] | null | null | null | tests/test_keys.py | rcarmo/miniredis | 39f49249cddd11a4b333932fdb8157273a8a1dc4 | [
"MIT"
] | null | null | null | # vim :set ts=4 sw=4 sts=4 et :
import os, sys, signal, time
from nose.tools import ok_, eq_, istest
sys.path.append('..')
import miniredis.server
from miniredis.client import RedisClient
pid = None
r = None
def setup_module(module):
global pid, r
pid = miniredis.server.fork()
print("Launched server wit... | 22.460526 | 47 | 0.588166 |
4a13fc45f84ebec2881ee5fc2831a856bfaef01b | 3,994 | py | Python | everything_at_once/model/utils/layers.py | ninatu/everything_at_once | b4cd3a70076ea3ea2b40832aa3e2afab50495c47 | [
"BSD-3-Clause"
] | null | null | null | everything_at_once/model/utils/layers.py | ninatu/everything_at_once | b4cd3a70076ea3ea2b40832aa3e2afab50495c47 | [
"BSD-3-Clause"
] | null | null | null | everything_at_once/model/utils/layers.py | ninatu/everything_at_once | b4cd3a70076ea3ea2b40832aa3e2afab50495c47 | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch as th
from torch import nn as nn
from torch.nn import functional as F
from timm.models.vision_transformer import DropPath, Mlp, Attention
class GatedEmbeddingUnit(nn.Module):
def __init__(self, input_dimension, output_dimension):
super().__init__()
self.fc = nn.Linear(inp... | 35.035088 | 125 | 0.646219 |
4a13fd68c16215e96b21d46451d11dbc3b68ac5e | 7,547 | py | Python | ogb_examples/nodeproppred/unimp/main_arxiv.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 1,389 | 2019-06-11T03:29:20.000Z | 2022-03-29T18:25:43.000Z | ogb_examples/nodeproppred/unimp/main_arxiv.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 232 | 2019-06-21T06:52:10.000Z | 2022-03-29T08:20:31.000Z | ogb_examples/nodeproppred/unimp/main_arxiv.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 229 | 2019-06-20T12:13:58.000Z | 2022-03-25T12:04:48.000Z | import math
import torch
import paddle
import pgl
import numpy as np
import paddle.fluid as F
import paddle.fluid.layers as L
from pgl.contrib.ogb.nodeproppred.dataset_pgl import PglNodePropPredDataset
from ogb.nodeproppred import Evaluator
from utils import to_undirected, add_self_loop, linear_warmup_decay
from model... | 36.635922 | 94 | 0.610706 |
4a140054186605cc7c0d95d5c1eb54658b66007c | 4,970 | py | Python | out_feature.py | WilliamGong/traffic-analyze | 687481f1f53d334a534f8cbdcc66bc2420d18f6c | [
"MIT"
] | null | null | null | out_feature.py | WilliamGong/traffic-analyze | 687481f1f53d334a534f8cbdcc66bc2420d18f6c | [
"MIT"
] | null | null | null | out_feature.py | WilliamGong/traffic-analyze | 687481f1f53d334a534f8cbdcc66bc2420d18f6c | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# solve Chinese font
plt.rcParams['font.sans-serif'] = ['KaiTi']
plt.rcParams['font.serif'] = ['KaiTi']
# plt.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题,或者转换负号为字符串
class OutFeature:
numOutDaily = {
'每天6次以上': 0,
... | 28.238636 | 78 | 0.502414 |
4a1400883fa783f1b08216737c25aef2ecd73c10 | 2,811 | py | Python | Assignment_3/2016csb1032.py | atlkdr/Social_Networks | 54b7c3face9f2d54248dc39d30bfd15ae96eb257 | [
"MIT"
] | null | null | null | Assignment_3/2016csb1032.py | atlkdr/Social_Networks | 54b7c3face9f2d54248dc39d30bfd15ae96eb257 | [
"MIT"
] | null | null | null | Assignment_3/2016csb1032.py | atlkdr/Social_Networks | 54b7c3face9f2d54248dc39d30bfd15ae96eb257 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import networkx as nx
import random as rd
def random_path(G,cwl,show_teleport): # CRAWLS THE GRAPH BY TAKING RANDOM PATHS GENERATED FROM RANDOM NODES WITH PROBABILITY OF 0.2
dictionary={} # Containging key=node , value=times visited while crawling in total
temp=list(G.nodes())
for... | 34.280488 | 132 | 0.712914 |
4a1401af54706e4e30252e371cf5b39414a4be25 | 2,118 | py | Python | python_client/comm.py | slaclab/pabv_control | 329193bfe219d3472d9d9ab9e9b28a18ff341c2c | [
"BSD-3-Clause"
] | 2 | 2020-04-17T22:25:47.000Z | 2021-06-05T07:44:26.000Z | python_client/comm.py | slaclab/pabv_control | 329193bfe219d3472d9d9ab9e9b28a18ff341c2c | [
"BSD-3-Clause"
] | 85 | 2020-04-24T14:55:52.000Z | 2020-09-13T16:36:21.000Z | python_client/comm.py | slaclab/pabv_control | 329193bfe219d3472d9d9ab9e9b28a18ff341c2c | [
"BSD-3-Clause"
] | 6 | 2020-04-24T05:21:41.000Z | 2020-12-12T23:25:52.000Z | import serial
import serial.tools.list_ports
import io
import message
import traceback
class Comm:
def __init__(self):
self._ser=None
self.port=None
self.id=None
self.connects=0
def connect(self):
self.connects=self.connects+1
ports = list(serial.tools.list_ports... | 29.013699 | 78 | 0.435788 |
4a1402fcbf066e4fdfa139e3f69b3d7c5fb2d9d9 | 11,698 | py | Python | src/olympia/amo/templatetags/jinja_helpers.py | aki21j/addons-server | fbabd4f2933de12507f1df9c9b3f5dd4183c3ae6 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/templatetags/jinja_helpers.py | aki21j/addons-server | fbabd4f2933de12507f1df9c9b3f5dd4183c3ae6 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/templatetags/jinja_helpers.py | aki21j/addons-server | fbabd4f2933de12507f1df9c9b3f5dd4183c3ae6 | [
"BSD-3-Clause"
] | null | null | null | import json as jsonlib
import os
import random
from urllib.parse import urljoin
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.forms import CheckboxInput
from django.template import defaultfilters, Library, loader
from django.templatetags.static import static
from d... | 27.654846 | 87 | 0.68345 |
4a140369aaeffc195770c49d6ce4b42e788e91b0 | 1,281 | py | Python | src/biotite/sequence/align/__init__.py | danijoo/biotite | 22072e64676e4e917236eac8493eed4c6a22cc33 | [
"BSD-3-Clause"
] | 2 | 2020-11-06T13:06:14.000Z | 2021-11-08T09:46:18.000Z | src/biotite/sequence/align/__init__.py | danielmuthama/biotite | cb238a8d8d7dc82b3bcea274d7d91d5c876badcd | [
"BSD-3-Clause"
] | null | null | null | src/biotite/sequence/align/__init__.py | danielmuthama/biotite | cb238a8d8d7dc82b3bcea274d7d91d5c876badcd | [
"BSD-3-Clause"
] | null | null | null | # This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
"""
This subpackage provides functionality for sequence alignemnts.
The two central classes involved are :class:`SubstitutionMatrix` and
:class:`Alignment`:
Every... | 36.6 | 72 | 0.800937 |
4a1403897ff25d312f6d958b7b52cc05c0e2034d | 2,100 | py | Python | google/ads/googleads/v9/errors/types/conversion_adjustment_upload_error.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/errors/types/conversion_adjustment_upload_error.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/errors/types/conversion_adjustment_upload_error.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 34.42623 | 86 | 0.725238 |
4a1403cdccac1399e1d5251a9854850992749fe8 | 189 | py | Python | codeforces.com/734A/solution.py | zubtsov/competitive-programming | 919d63130144347d7f6eddcf8f5bc2afb85fddf3 | [
"MIT"
] | null | null | null | codeforces.com/734A/solution.py | zubtsov/competitive-programming | 919d63130144347d7f6eddcf8f5bc2afb85fddf3 | [
"MIT"
] | null | null | null | codeforces.com/734A/solution.py | zubtsov/competitive-programming | 919d63130144347d7f6eddcf8f5bc2afb85fddf3 | [
"MIT"
] | null | null | null | input()
games_result = sum(map(lambda n: 1 if n == 'A' else -1, input()))
if games_result > 0:
print('Anton')
elif games_result == 0:
print('Friendship')
else:
print('Danik')
| 17.181818 | 65 | 0.613757 |
4a1403ec32929fcb4173dd77c1c11cefe3376511 | 2,443 | py | Python | src/sentry/tagstore/v2/models/grouptagkey.py | apragacz/sf-sentry | 2fdd6c1195c29a1d401d1cd538c22ea68556699a | [
"BSD-3-Clause"
] | 1 | 2018-03-05T15:40:12.000Z | 2018-03-05T15:40:12.000Z | src/sentry/tagstore/v2/models/grouptagkey.py | pkaminski/sentry | 27e948283e27d93ca5192ca7b580830e092c25c7 | [
"BSD-3-Clause"
] | 1 | 2018-08-22T16:49:48.000Z | 2018-08-22T16:49:48.000Z | src/sentry/tagstore/v2/models/grouptagkey.py | pkaminski/sentry | 27e948283e27d93ca5192ca7b580830e092c25c7 | [
"BSD-3-Clause"
] | 1 | 2018-07-02T09:46:44.000Z | 2018-07-02T09:46:44.000Z | """
sentry.tagstore.v2.models.grouptagkey
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2017 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
from django.db import router, transaction, DataError
from sentry.api.seri... | 28.406977 | 82 | 0.605813 |
4a140412c253bc4fc7a7f2eec4ef2f0b40a005b7 | 889 | py | Python | app/dao/letter_branding_dao.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | app/dao/letter_branding_dao.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | app/dao/letter_branding_dao.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | from app import db
from app.dao.dao_utils import transactional
from app.models import LetterBranding
def dao_get_letter_branding_by_id(letter_branding_id):
return LetterBranding.query.filter(LetterBranding.id == letter_branding_id).one()
def dao_get_letter_branding_by_name(letter_branding_name):
return Lett... | 29.633333 | 85 | 0.807649 |
4a1404a292d30a5a79c43e9fbe09aa129b85b775 | 410 | py | Python | tests/parser/functions/test_length.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 1,471 | 2017-12-25T05:47:57.000Z | 2019-11-19T07:47:53.000Z | tests/parser/functions/test_length.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 915 | 2019-11-21T05:48:16.000Z | 2022-03-31T23:51:03.000Z | tests/parser/functions/test_length.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 321 | 2017-12-25T16:37:21.000Z | 2019-11-15T17:44:06.000Z | def test_test_length(get_contract_with_gas_estimation):
test_length = """
y: Bytes[10]
@external
def foo(inp: Bytes[10]) -> uint256:
x: Bytes[5] = slice(inp,1, 5)
self.y = slice(inp, 2, 4)
return len(inp) * 100 + len(x) * 10 + len(self.y)
"""
c = get_contract_with_gas_estimation(test_length)
... | 27.333333 | 58 | 0.643902 |
4a140513ab80401a2810d4684d789f9bf0cc60bb | 4,226 | py | Python | tests/test_tracing.py | xvillaneau/sentry-python | 8cc48dc1b9e944d1842271af69d8a2aef43cc4ee | [
"BSD-2-Clause"
] | null | null | null | tests/test_tracing.py | xvillaneau/sentry-python | 8cc48dc1b9e944d1842271af69d8a2aef43cc4ee | [
"BSD-2-Clause"
] | null | null | null | tests/test_tracing.py | xvillaneau/sentry-python | 8cc48dc1b9e944d1842271af69d8a2aef43cc4ee | [
"BSD-2-Clause"
] | null | null | null | import weakref
import gc
import pytest
from sentry_sdk import Hub, capture_message
from sentry_sdk.tracing import Span
@pytest.mark.parametrize("sample_rate", [0.0, 1.0])
def test_basic(sentry_init, capture_events, sample_rate):
sentry_init(traces_sample_rate=sample_rate)
events = capture_events()
with... | 29.144828 | 77 | 0.622101 |
4a14064f41d19634c8b26199dad07601a75a30da | 1,867 | py | Python | tests/iterators/compact_test.py | SSouik/pyutil | d2250fb585679e49eb9056a3051bf239a58c2e8b | [
"MIT"
] | null | null | null | tests/iterators/compact_test.py | SSouik/pyutil | d2250fb585679e49eb9056a3051bf239a58c2e8b | [
"MIT"
] | 21 | 2022-01-05T04:51:33.000Z | 2022-01-28T05:45:57.000Z | tests/iterators/compact_test.py | SSouik/pyutil | d2250fb585679e49eb9056a3051bf239a58c2e8b | [
"MIT"
] | null | null | null | import pytest
from pyutil import compact
def test_compact_with_false():
lst = [1, 2, False]
actual = list(compact(lst))
expected = [1, 2]
assert actual == expected
def test_compact_with_true():
lst = [1, 2, True]
actual = list(compact(lst))
expected = [1, 2, True]
assert actual == ex... | 20.516484 | 41 | 0.619711 |
4a14076d61754255ffd5f17337bda00dde6cb01c | 14,259 | py | Python | sdk/python/pulumi_azure_native/databoxedge/v20200901preview/device.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/databoxedge/v20200901preview/device.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/databoxedge/v20200901preview/device.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 40.856734 | 1,162 | 0.641349 |
4a14081aa75584c2aeef6b284d51475074eda36b | 9,960 | py | Python | syntrain.py | ShichengChen/self-supervised-hand-pose-estimation | c086b0c3cea2ee92f3ff6177ee37af91f815343e | [
"MIT"
] | 2 | 2021-06-09T07:57:44.000Z | 2021-07-15T19:13:08.000Z | syntrain.py | ShichengChen/self-supervised-hand-pose-estimation | c086b0c3cea2ee92f3ff6177ee37af91f815343e | [
"MIT"
] | null | null | null | syntrain.py | ShichengChen/self-supervised-hand-pose-estimation | c086b0c3cea2ee92f3ff6177ee37af91f815343e | [
"MIT"
] | null | null | null | import os
import platform
if (platform.node()=='csc-G7-7590'):
os.environ["CUDA_VISIBLE_DEVICES"] = '0'
else:
os.environ["CUDA_VISIBLE_DEVICES"] = '2'
import torchvision.models as models
from torch.optim.lr_scheduler import MultiStepLR
import torch
from cscPy.Nets.AligningHandnet import encoderRGB,decPoseNet
f... | 48.115942 | 140 | 0.607631 |
4a140847022acc877c91c0d1da4231daad62b057 | 5,266 | py | Python | tests/report_tests/test_image_report.py | chainer/chainerui | 91c5c26d9154a008079dbb0bcbf69b5590d105f7 | [
"MIT"
] | 185 | 2017-12-15T09:24:07.000Z | 2022-01-20T11:20:13.000Z | tests/report_tests/test_image_report.py | chainer/chainerui | 91c5c26d9154a008079dbb0bcbf69b5590d105f7 | [
"MIT"
] | 191 | 2017-12-15T09:14:52.000Z | 2022-02-17T14:09:19.000Z | tests/report_tests/test_image_report.py | chainer/chainerui | 91c5c26d9154a008079dbb0bcbf69b5590d105f7 | [
"MIT"
] | 29 | 2017-12-15T09:40:45.000Z | 2022-03-13T11:21:11.000Z | import os
import unittest
import warnings
import numpy as np
import pytest
import six
try:
import chainer # NOQA
_chainer_installed = True
except (ImportError, TypeError):
_chainer_installed = False
if _chainer_installed:
from chainerui.report import image_report
_image_report_available = image_... | 34.644737 | 78 | 0.707938 |
4a1408a343d120bf40fab6c48ffc2e7cb606f534 | 1,216 | py | Python | apps/identifyabill/support_functions.py | joelmpiper/bill_taxonomy | 9284dfae905ca8efa558b4fd93469d03cf4b8074 | [
"MIT"
] | null | null | null | apps/identifyabill/support_functions.py | joelmpiper/bill_taxonomy | 9284dfae905ca8efa558b4fd93469d03cf4b8074 | [
"MIT"
] | null | null | null | apps/identifyabill/support_functions.py | joelmpiper/bill_taxonomy | 9284dfae905ca8efa558b4fd93469d03cf4b8074 | [
"MIT"
] | null | null | null |
def formatted_query(query_results, col):
bills = []
for i in range(0, query_results.shape[0]):
bills.append(dict(bill_num=query_results.iloc[i]['bill_num'],
bill_name=query_results.iloc[i]['bill_name'],
score=query_results.iloc[i][col]))
seen = s... | 39.225806 | 77 | 0.519737 |
4a140a5d7451028abe313a9d08b5ffcf432f2a66 | 35,363 | py | Python | post_optimization_studies/mad_analyses/pre_select_two_signal/Output/Histos/MadAnalysis5job_0/selection_8.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/pre_select_two_signal/Output/Histos/MadAnalysis5job_0/selection_8.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/pre_select_two_signal/Output/Histos/MadAnalysis5job_0/selection_8.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | def selection_8():
# Library import
import numpy
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# Library version
matplotlib_version = matplotlib.__version__
numpy_version = numpy.__version__
# Histo binning
xBinning = numpy.lin... | 175.064356 | 1,545 | 0.799451 |
4a140ac72a4fbbcbc6796a97ff95340ff9cffe53 | 814 | py | Python | foreshadow/intents/intent_type.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 25 | 2018-07-26T17:30:31.000Z | 2021-02-23T22:54:01.000Z | foreshadow/intents/intent_type.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 150 | 2018-11-02T18:09:12.000Z | 2020-05-15T01:01:35.000Z | foreshadow/intents/intent_type.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 1 | 2019-02-20T22:24:00.000Z | 2019-02-20T22:24:00.000Z | """A utility class for the intents."""
class IntentType:
"""A utility class for the intents."""
NUMERIC = "Numeric"
CATEGORICAL = "Categorical"
TEXT = "Text"
DROPPABLE = "Droppable"
_registered_types = [NUMERIC, CATEGORICAL, TEXT, DROPPABLE]
@classmethod
def is_valid(cls, intent):
... | 20.871795 | 63 | 0.579853 |
4a140ace888b1d71375e73e89bf32fc66787eb96 | 15,080 | py | Python | utils/render.py | Yosshi999/Tokyo2020-Pictogram-using-MediaPipe | edd5a8721d12376d3ea2155de8cbd139f59aea76 | [
"Apache-2.0"
] | null | null | null | utils/render.py | Yosshi999/Tokyo2020-Pictogram-using-MediaPipe | edd5a8721d12376d3ea2155de8cbd139f59aea76 | [
"Apache-2.0"
] | null | null | null | utils/render.py | Yosshi999/Tokyo2020-Pictogram-using-MediaPipe | edd5a8721d12376d3ea2155de8cbd139f59aea76 | [
"Apache-2.0"
] | null | null | null | import math
import cv2 as cv
import numpy as np
__all__ = ['draw_stick_figure', 'draw_landmarks']
def draw_stick_figure(
image,
landmarks,
color=(100, 33, 3),
bg_color=(255, 255, 255),
visibility_th=0.5,
):
image_width, image_height = image.shape[1], image.shape[0]
# ... | 39.067358 | 106 | 0.5437 |
4a140b1a501f10649df140d49b2e67da9a015d68 | 3,612 | py | Python | train.py | vpekar/forecastml | 55f667c33c5c0b17062117fb271748ef2a0a784e | [
"MIT"
] | 2 | 2020-02-10T17:30:34.000Z | 2021-04-05T22:02:21.000Z | train.py | vpekar/forecastml | 55f667c33c5c0b17062117fb271748ef2a0a784e | [
"MIT"
] | 1 | 2020-06-25T05:01:35.000Z | 2020-06-25T08:49:09.000Z | train.py | vpekar/forecastml | 55f667c33c5c0b17062117fb271748ef2a0a784e | [
"MIT"
] | 1 | 2020-06-24T14:57:42.000Z | 2020-06-24T14:57:42.000Z | # -*- coding: utf-8 -*-
"""
Run multiple configurations
Created on Mon May 21 19:03:56 2018
@author: user
"""
import settings
import importlib
import json
import time
import os
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from utils import run_config_space
from get_logger import g... | 26.173913 | 74 | 0.620709 |
4a140b97f29928c17796b441cd18064b423638c5 | 14,217 | py | Python | stor/test.py | anujkumar93/stor | dd51ea53784f30b12c4d43fefe646cda13246084 | [
"MIT"
] | null | null | null | stor/test.py | anujkumar93/stor | dd51ea53784f30b12c4d43fefe646cda13246084 | [
"MIT"
] | 6 | 2018-09-11T18:04:42.000Z | 2018-12-04T01:30:57.000Z | stor/test.py | anujkumar93/stor | dd51ea53784f30b12c4d43fefe646cda13246084 | [
"MIT"
] | null | null | null | import inspect
import mock
import unittest
import os
import sys
import uuid
import dxpy
import vcr
from stor import Path
from stor import s3
from stor.s3 import S3Path
from stor.swift import SwiftPath
from stor import settings
class SwiftTestMixin(object):
"""A mixin with helpers for mocking out swift.
Swi... | 40.853448 | 98 | 0.650489 |
4a140bb97029c8fcac912d9476db9eb28380e5e2 | 2,499 | py | Python | data/p4VQE/R2/benchmark/startQiskit_noisy96.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R2/benchmark/startQiskit_noisy96.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R2/benchmark/startQiskit_noisy96.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=13
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 27.461538 | 118 | 0.633854 |
4a140c3c79d11b64e2f60eddaba9639b92aea32e | 1,651 | py | Python | parser/fase2/team25/analizer/statement/pl/codeblock.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/fase2/team25/analizer/statement/pl/codeblock.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/fase2/team25/analizer/statement/pl/codeblock.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z |
from analizer.abstract import instruction
from analizer.reports.Nodo import Nodo
from analizer.reports.AST import AST
class CodeBlock(instruction.Instruction):
def __init__(self, lista_instrucciones, row , column , lista_declaraciones = None ):
instruction.Instruction.__init__(self, row , column)
... | 38.395349 | 89 | 0.67656 |
4a140d89fbc983352c6ca42614ed7896e977c541 | 881 | py | Python | tests/routes/authentication_test.py | ajorpheus/sbr-ui | ea79ace6abb0b2c4aea8c4040c7134da9b873a4c | [
"MIT"
] | 1 | 2019-01-11T12:34:16.000Z | 2019-01-11T12:34:16.000Z | tests/routes/authentication_test.py | ajorpheus/sbr-ui | ea79ace6abb0b2c4aea8c4040c7134da9b873a4c | [
"MIT"
] | 2 | 2017-10-11T09:40:12.000Z | 2018-10-17T14:06:19.000Z | tests/routes/authentication_test.py | ajorpheus/sbr-ui | ea79ace6abb0b2c4aea8c4040c7134da9b873a4c | [
"MIT"
] | 4 | 2017-10-19T09:24:57.000Z | 2021-04-11T08:10:09.000Z | from sbr_ui import app
app.testing = True
# TODO: fix tests below, the response is 200 even if the login failed, due to rendering of a template returning 200
def test_login():
with app.test_client() as c:
login_response = c.post('/Login', data={
"username": "admin",
"password":... | 33.884615 | 116 | 0.668558 |
4a140e53ca915217379ec66d0341919746bb8c0d | 58 | py | Python | src/apps/trainings/viewsets/__init__.py | sanderland/katago-server | 6414fab080d007c05068a06ff4f25907b92848bd | [
"MIT"
] | 27 | 2020-05-03T11:01:27.000Z | 2022-03-17T05:33:10.000Z | src/apps/trainings/viewsets/__init__.py | sanderland/katago-server | 6414fab080d007c05068a06ff4f25907b92848bd | [
"MIT"
] | 54 | 2020-05-09T01:18:41.000Z | 2022-01-22T10:31:15.000Z | src/apps/trainings/viewsets/__init__.py | sanderland/katago-server | 6414fab080d007c05068a06ff4f25907b92848bd | [
"MIT"
] | 9 | 2020-09-29T11:31:32.000Z | 2022-03-09T01:37:50.000Z | from .network import NetworkViewSet, NetworkViewSetForElo
| 29 | 57 | 0.87931 |
4a140ecc339e32205dccfb6627fb537694ab936a | 40,679 | py | Python | test/base/driver_util.py | nzahara1/galaxy | fcaeb857b8bbf41d11c40fb7c27e58827d7038c8 | [
"CC-BY-3.0"
] | null | null | null | test/base/driver_util.py | nzahara1/galaxy | fcaeb857b8bbf41d11c40fb7c27e58827d7038c8 | [
"CC-BY-3.0"
] | null | null | null | test/base/driver_util.py | nzahara1/galaxy | fcaeb857b8bbf41d11c40fb7c27e58827d7038c8 | [
"CC-BY-3.0"
] | 1 | 2020-06-30T17:53:16.000Z | 2020-06-30T17:53:16.000Z | """Scripts for drivers of Galaxy functional tests."""
import fcntl
import logging
import os
import random
import shutil
import signal
import socket
import string
import struct
import subprocess
import sys
import tempfile
import threading
import time
import nose.config
import nose.core
import nose.loader
import nose.p... | 38.160413 | 138 | 0.683571 |
4a140f0da6d6360fa1bec14486cd86f9d90bba50 | 715 | py | Python | detection/configs/retinanet_pcpvt_s_fpn_1x_coco_pvt_setting.py | dumpmemory/Twins | 4700293a2d0a91826ab357fc5b9bc1468ae0e987 | [
"Apache-2.0"
] | 394 | 2021-04-29T02:20:32.000Z | 2022-03-24T12:12:15.000Z | detection/configs/retinanet_pcpvt_s_fpn_1x_coco_pvt_setting.py | dumpmemory/Twins | 4700293a2d0a91826ab357fc5b9bc1468ae0e987 | [
"Apache-2.0"
] | 27 | 2021-05-13T10:03:46.000Z | 2022-03-17T05:22:24.000Z | detection/configs/retinanet_pcpvt_s_fpn_1x_coco_pvt_setting.py | dumpmemory/Twins | 4700293a2d0a91826ab357fc5b9bc1468ae0e987 | [
"Apache-2.0"
] | 49 | 2021-04-30T03:28:40.000Z | 2022-02-28T06:51:01.000Z | _base_ = [
'_base_/models/retinanet_r50_fpn.py',
'_base_/datasets/coco_detection.py',
'_base_/default_runtime.py'
]
model = dict(
pretrained='pretrained/pcpvt_small.pth',
backbone=dict(
type='pcpvt_small',
style='pytorch'),
neck=dict(
type='FPN',
in_channels=[64, ... | 24.655172 | 62 | 0.639161 |
4a140f6e64f1093dd7f74f2520edc17c74b5a114 | 2,039 | py | Python | BackEnd/site_receitas/migrations/0004_descricaoreceita_ingrediente_receita.py | GutoSantos/TrabSiteReceita | 477dce89a0b6b8ac9396f9656de02b56c01c75d3 | [
"Unlicense"
] | null | null | null | BackEnd/site_receitas/migrations/0004_descricaoreceita_ingrediente_receita.py | GutoSantos/TrabSiteReceita | 477dce89a0b6b8ac9396f9656de02b56c01c75d3 | [
"Unlicense"
] | null | null | null | BackEnd/site_receitas/migrations/0004_descricaoreceita_ingrediente_receita.py | GutoSantos/TrabSiteReceita | 477dce89a0b6b8ac9396f9656de02b56c01c75d3 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-16 00:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('site_receitas', '0003_usuario_is_staff'),
]
operat... | 41.612245 | 141 | 0.590486 |
4a1412598ef0e9d9c57321e362a438df9b8a75fa | 3,808 | py | Python | frappe/utils/autodoc.py | badili/frappe | 8177d7e745f511fcc4da50fed9e291a58172a613 | [
"MIT"
] | null | null | null | frappe/utils/autodoc.py | badili/frappe | 8177d7e745f511fcc4da50fed9e291a58172a613 | [
"MIT"
] | 7 | 2016-05-30T04:03:38.000Z | 2019-02-03T03:10:03.000Z | frappe/utils/autodoc.py | badili/frappe | 8177d7e745f511fcc4da50fed9e291a58172a613 | [
"MIT"
] | 5 | 2015-07-22T04:52:43.000Z | 2016-10-07T01:51:21.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""
frappe.utils.autodoc
~~~~~~~~~~~~~~~~~~~~
Inspect elements of a given module and return its objects
"""
from __future__ import unicode_literals
import inspect, importlib, re, frappe
from frappe.model.document imp... | 23.361963 | 87 | 0.675158 |
4a1413959d92254a8bc735376cc11e5efee06ef9 | 10,816 | py | Python | pyecsca/ec/curve.py | Tomko10/pyecsca | 900503e602c3079c6293e17f297e3b111ba9611a | [
"MIT"
] | 24 | 2019-07-01T00:27:24.000Z | 2022-02-17T00:46:28.000Z | pyecsca/ec/curve.py | Tomko10/pyecsca | 900503e602c3079c6293e17f297e3b111ba9611a | [
"MIT"
] | 18 | 2020-12-10T15:08:56.000Z | 2022-03-01T11:44:37.000Z | pyecsca/ec/curve.py | Tomko10/pyecsca | 900503e602c3079c6293e17f297e3b111ba9611a | [
"MIT"
] | 7 | 2020-02-20T18:44:29.000Z | 2021-11-30T21:16:44.000Z | """This module provides an elliptic curve class."""
from ast import Module
from copy import copy
from typing import MutableMapping, Union, List, Optional
from public import public
from .coordinates import CoordinateModel, AffineCoordinateModel
from .mod import Mod
from .model import CurveModel
from .point import Poin... | 37.950877 | 134 | 0.588018 |
4a1413fbf280e430621d2995bfeb782f15631737 | 800 | py | Python | baseCoverter.py | oof2win2/cs_igcse | 8c5a6a23f2eeca9414d8d720c1dce4df7f62f324 | [
"MIT"
] | null | null | null | baseCoverter.py | oof2win2/cs_igcse | 8c5a6a23f2eeca9414d8d720c1dce4df7f62f324 | [
"MIT"
] | null | null | null | baseCoverter.py | oof2win2/cs_igcse | 8c5a6a23f2eeca9414d8d720c1dce4df7f62f324 | [
"MIT"
] | null | null | null | import random
def convertQues(rng):
# num = random.randint(0, rng)
num = rng
modes = ["hex", "bin"]
mode = random.choice(modes)
wrongAnswer = True
if mode == "hex":
while wrongAnswer:
inp = input(f"What is hex {hex(num)[2:]} in decimal: ")
if int(inp, 10) == nu... | 26.666667 | 70 | 0.50375 |
4a141600267458a9a686d062305cd303823da220 | 5,207 | py | Python | fhir/immunizations_demo/scripts/assemble_training_data.py | mevans845/healthcare | 55a1d08cddb344821feb3abe207ca4d62c6419ed | [
"Apache-2.0"
] | null | null | null | fhir/immunizations_demo/scripts/assemble_training_data.py | mevans845/healthcare | 55a1d08cddb344821feb3abe207ca4d62c6419ed | [
"Apache-2.0"
] | null | null | null | fhir/immunizations_demo/scripts/assemble_training_data.py | mevans845/healthcare | 55a1d08cddb344821feb3abe207ca4d62c6419ed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.03268 | 78 | 0.710966 |
4a1416244345f6066c435cd61203af14687c52df | 5,351 | py | Python | setup.py | hollerith/pattern | 302c38f63e4f3580eb546864a2c1c90381a9c263 | [
"BSD-3-Clause"
] | null | null | null | setup.py | hollerith/pattern | 302c38f63e4f3580eb546864a2c1c90381a9c263 | [
"BSD-3-Clause"
] | null | null | null | setup.py | hollerith/pattern | 302c38f63e4f3580eb546864a2c1c90381a9c263 | [
"BSD-3-Clause"
] | null | null | null | #### PATTERN #######################################################################################
from __future__ import print_function
import sys
import os
from io import open
from setuptools import setup
from pattern import __version__
#------------------------------------------------------------------------... | 35.203947 | 100 | 0.484209 |
4a1416e6acb9f0b154e7dd9e740fe385db9f4456 | 1,944 | py | Python | tests/homework/test_homework6.py | acc-cosc-1336/cosc-1336-spring-2018-vcruz350 | 0cee9fde3d4129c51626c4e0c870972aebec9b95 | [
"MIT"
] | null | null | null | tests/homework/test_homework6.py | acc-cosc-1336/cosc-1336-spring-2018-vcruz350 | 0cee9fde3d4129c51626c4e0c870972aebec9b95 | [
"MIT"
] | 1 | 2018-03-08T19:46:08.000Z | 2018-03-08T20:00:47.000Z | tests/homework/test_homework6.py | acc-cosc-1336/cosc-1336-spring-2018-vcruz350 | 0cee9fde3d4129c51626c4e0c870972aebec9b95 | [
"MIT"
] | null | null | null | import unittest
#write import statement for homework 6 file
from src.homework.homework6 import get_point_mutations
from src.homework.homework6 import get_dna_complement
from src.homework.homework6 import transcribe_dna_into_rna
from src.homework.homework6 import get_gc_content
class TestHomework6(unittest.TestCase):
... | 46.285714 | 142 | 0.817901 |
4a1416eaa4366e01fc19c26a95c3dd9bb2d80782 | 12,760 | py | Python | data/migrations/versions/703298a825c2_backfill_new_encrypted_fields.py | kbrwn/quay | 733c44922b039464641926107bc75c583973468e | [
"Apache-2.0"
] | 1 | 2021-03-02T21:15:04.000Z | 2021-03-02T21:15:04.000Z | data/migrations/versions/703298a825c2_backfill_new_encrypted_fields.py | kbrwn/quay | 733c44922b039464641926107bc75c583973468e | [
"Apache-2.0"
] | 20 | 2019-12-26T17:32:34.000Z | 2022-03-21T22:18:06.000Z | data/migrations/versions/703298a825c2_backfill_new_encrypted_fields.py | kbrwn/quay | 733c44922b039464641926107bc75c583973468e | [
"Apache-2.0"
] | 1 | 2020-05-31T16:28:40.000Z | 2020-05-31T16:28:40.000Z | """Backfill new encrypted fields
Revision ID: 703298a825c2
Revises: c13c8052f7a6
Create Date: 2019-08-19 16:07:48.109889
"""
# revision identifiers, used by Alembic.
revision = '703298a825c2'
down_revision = 'c13c8052f7a6'
import logging
import uuid
from datetime import datetime
from peewee import (JOIN, Integrity... | 44 | 122 | 0.728918 |
4a1417629c281856b7d2c6a41fd84e3c19768de3 | 9,910 | py | Python | rank-change-precompute-1.py | stressosaurus/a-statistical-model-of-word-rank-evolution | 4a06a872b5c84b561510958aed18e76d931443f4 | [
"MIT"
] | null | null | null | rank-change-precompute-1.py | stressosaurus/a-statistical-model-of-word-rank-evolution | 4a06a872b5c84b561510958aed18e76d931443f4 | [
"MIT"
] | null | null | null | rank-change-precompute-1.py | stressosaurus/a-statistical-model-of-word-rank-evolution | 4a06a872b5c84b561510958aed18e76d931443f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
print('Initializing...')
import pickle as pkl
import os
import numpy as np
import pandas as pd
import googleNgram as gn
import wf2020 as wf20 # module for the wright-fisher inspired model
import languageCompute as lc # module for time-series computations
from scipy.stats import variation
# make... | 44.241071 | 151 | 0.638951 |
4a1417c543098e5d445f7fa867a6883e22a04bc8 | 9,779 | py | Python | gammapy/utils/gauss.py | Jaleleddine/gammapy | de9195df40fa5bbf8840cda4e7cd5e8cc5eaadbb | [
"BSD-3-Clause"
] | null | null | null | gammapy/utils/gauss.py | Jaleleddine/gammapy | de9195df40fa5bbf8840cda4e7cd5e8cc5eaadbb | [
"BSD-3-Clause"
] | 1 | 2017-02-22T23:12:30.000Z | 2017-02-22T23:12:30.000Z | gammapy/utils/gauss.py | Jaleleddine/gammapy | de9195df40fa5bbf8840cda4e7cd5e8cc5eaadbb | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Multi-Gaussian distribution utilities (Gammapy internal)."""
import numpy as np
import scipy.optimize
class Gauss2DPDF:
"""2D symmetric Gaussian PDF.
Reference: http://en.wikipedia.org/wiki/Multivariate_normal_distribution#Bivariate_case
... | 27.94 | 91 | 0.568054 |
4a14182229060d0e5d55c98f056dc5f915f500ef | 8,230 | py | Python | docs/conf.py | leckronz/django-dynamic-attachments | e77fa6a59375bb19c71d1bcc58dbacfde191c45c | [
"BSD-2-Clause"
] | 1 | 2021-10-15T14:02:14.000Z | 2021-10-15T14:02:14.000Z | docs/conf.py | leckronz/django-dynamic-attachments | e77fa6a59375bb19c71d1bcc58dbacfde191c45c | [
"BSD-2-Clause"
] | 6 | 2018-07-02T20:16:05.000Z | 2021-04-14T14:02:22.000Z | docs/conf.py | leckronz/django-dynamic-attachments | e77fa6a59375bb19c71d1bcc58dbacfde191c45c | [
"BSD-2-Clause"
] | 14 | 2018-06-29T12:46:46.000Z | 2022-01-03T19:08:10.000Z | # -*- coding: utf-8 -*-
#
# Attachments documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 03 15:34:43 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | 31.412214 | 79 | 0.715431 |
4a141825741197b3531f854c917157e35f05077d | 115 | py | Python | tests/test_methods/test_ratings.py | NationalJournal/py-votesmart | 9194f28564d8d005386f498b1fc915cc7772f38b | [
"BSD-3-Clause"
] | 7 | 2018-03-08T16:33:02.000Z | 2020-12-22T08:12:31.000Z | tests/test_methods/test_ratings.py | NationalJournal/py-votesmart | 9194f28564d8d005386f498b1fc915cc7772f38b | [
"BSD-3-Clause"
] | 7 | 2018-02-13T02:40:29.000Z | 2018-03-08T17:04:53.000Z | tests/test_methods/test_ratings.py | NationalJournal/py-votesmart | 9194f28564d8d005386f498b1fc915cc7772f38b | [
"BSD-3-Clause"
] | 4 | 2018-02-13T13:41:28.000Z | 2021-12-21T22:14:54.000Z | import pytest
from votesmart.methods.ratings import *
def test_Rating():
method = Rating(api_instance='test')
| 19.166667 | 40 | 0.756522 |
4a1418440f655da964689ff78f7877549a33a469 | 7,197 | py | Python | ILSVRC15-curation/gen_image_crops_VID.py | ralphc1212/SiamFC-PyTorch | b99de369c5802a717168e509518043c3a02084ce | [
"Apache-2.0"
] | 131 | 2018-10-26T21:04:52.000Z | 2022-02-24T20:17:03.000Z | ILSVRC15-curation/gen_image_crops_VID.py | ralphc1212/SiamFC-PyTorch | b99de369c5802a717168e509518043c3a02084ce | [
"Apache-2.0"
] | 19 | 2018-10-30T15:43:32.000Z | 2020-03-25T23:24:15.000Z | ILSVRC15-curation/gen_image_crops_VID.py | ralphc1212/SiamFC-PyTorch | b99de369c5802a717168e509518043c3a02084ce | [
"Apache-2.0"
] | 36 | 2018-11-03T04:31:39.000Z | 2022-02-21T16:00:30.000Z | '''
Written by Heng Fan
'''
import numpy as np
import os
import glob
import xml.etree.ElementTree as ET
import cv2
import datetime
'''
# default setting for cropping
'''
examplar_size = 127.0
instance_size = 255.0
context_amount = 0.5
def get_subwindow_avg(im, pos, model_sz, original_sz):
'''
# obtain image... | 38.486631 | 167 | 0.593442 |
4a1418e10c51cac77f5eee3cc7affbb8e116cee7 | 5,345 | py | Python | examples/pendulum/analyze_pend_SO3.py | thaipduong/SE3HamiltonianDynsLearning | caf385cf810055e88314e6e4b39b566f9a0be419 | [
"MIT"
] | 6 | 2021-06-25T03:08:19.000Z | 2022-03-24T08:54:28.000Z | examples/pendulum/analyze_pend_SO3.py | nishr/SE3HamDL | 72dc5070178948f7c307678421bea80fa6d25796 | [
"MIT"
] | null | null | null | examples/pendulum/analyze_pend_SO3.py | nishr/SE3HamDL | 72dc5070178948f7c307678421bea80fa6d25796 | [
"MIT"
] | 4 | 2021-07-15T18:31:00.000Z | 2022-02-23T14:00:15.000Z | # Hamiltonian-based Neural ODE Networks on the SE(3) Manifold For Dynamics Learning and Control, RSS 2021
# Thai Duong, Nikolay Atanasov
# code structure follows the style of HNN by Greydanus et al. and SymODEM by Zhong et al.
# https://github.com/greydanus/hamiltonian-nn
# https://github.com/Physics-aware-AI/Symplect... | 41.434109 | 115 | 0.658934 |
4a1418ed35077a879f566c6512bebed54544561c | 251 | py | Python | CircuitPython_Quick_Starts/CircuitPython_AnalogIn/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 665 | 2017-09-27T21:20:14.000Z | 2022-03-31T09:09:25.000Z | CircuitPython_Quick_Starts/CircuitPython_AnalogIn/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 641 | 2017-10-03T19:46:37.000Z | 2022-03-30T18:28:46.000Z | CircuitPython_Quick_Starts/CircuitPython_AnalogIn/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 734 | 2017-10-02T22:47:38.000Z | 2022-03-30T14:03:51.000Z | # CircuitPython AnalogIn Demo
import time
import board
from analogio import AnalogIn
analog_in = AnalogIn(board.A1)
def get_voltage(pin):
return (pin.value * 3.3) / 65536
while True:
print((get_voltage(analog_in),))
time.sleep(0.1)
| 13.944444 | 36 | 0.713147 |
4a141905ac5fc26d42c0c679ff6ad40114ac21fa | 1,824 | py | Python | cluster/cluster_clean.py | pelagia/votca-scripts | 5c10cabe6458b4682cd9c214bc665d389f34a939 | [
"Apache-2.0"
] | 2 | 2017-10-17T16:46:28.000Z | 2020-01-09T15:06:14.000Z | cluster/cluster_clean.py | pelagia/votca-scripts | 5c10cabe6458b4682cd9c214bc665d389f34a939 | [
"Apache-2.0"
] | null | null | null | cluster/cluster_clean.py | pelagia/votca-scripts | 5c10cabe6458b4682cd9c214bc665d389f34a939 | [
"Apache-2.0"
] | 2 | 2018-05-25T09:15:47.000Z | 2020-06-25T07:18:31.000Z | import os
def checkmethod():
check=raw_input("Are you sure?\nEnter \"yes\" or \"no\" \n")
checklist={'yes':True,'no':False}
if check not in checklist:
print 'enter either \"yes\" or \"no\" '
check=checkmethod()
else:
print check
... | 29.419355 | 79 | 0.560855 |
4a141a4b3d699cf75ba14f7b2288a970a8519ce1 | 6,681 | py | Python | CLN/pl_testTube_CLN.py | KirillShmilovich/coarse2fine_VAE | e4c1022f9570934a2be59ea0989c80102dc46ad4 | [
"MIT"
] | null | null | null | CLN/pl_testTube_CLN.py | KirillShmilovich/coarse2fine_VAE | e4c1022f9570934a2be59ea0989c80102dc46ad4 | [
"MIT"
] | null | null | null | CLN/pl_testTube_CLN.py | KirillShmilovich/coarse2fine_VAE | e4c1022f9570934a2be59ea0989c80102dc46ad4 | [
"MIT"
] | null | null | null | """
Runs a model on a single node across multiple gpus.
"""
import os
from pl_vae_CLN import VAE
from pytorch_lightning import Trainer, seed_everything, loggers
from pl_callbacks import CheckpointEveryNSteps
from test_tube import HyperOptArgumentParser, SlurmCluster
def main(args, cluster_manager):
""" Main tra... | 31.074419 | 88 | 0.580901 |
4a141da62e7e54023546ab5a2eef1c90e8e183f3 | 169 | py | Python | project/settings/components/locale.py | gyukebox/drf-basic-settings | 53c3df89b8f11169ee924c1c8000624384781c3a | [
"MIT"
] | null | null | null | project/settings/components/locale.py | gyukebox/drf-basic-settings | 53c3df89b8f11169ee924c1c8000624384781c3a | [
"MIT"
] | null | null | null | project/settings/components/locale.py | gyukebox/drf-basic-settings | 53c3df89b8f11169ee924c1c8000624384781c3a | [
"MIT"
] | null | null | null | # Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
| 13 | 52 | 0.721893 |
4a141f847b694cb56d9487370048f6fafebebfcb | 1,626 | py | Python | robotsscan.py | Moxin1044/Easy-Bird-CMS-Scan-tools | 639fa05ec3b7d6d10ed4dd0c0f1652ae6f564bf9 | [
"MulanPSL-1.0"
] | 1 | 2020-12-09T23:58:45.000Z | 2020-12-09T23:58:45.000Z | robotsscan.py | Moxin1044/Easy-Bird-CMS-Scan-tools | 639fa05ec3b7d6d10ed4dd0c0f1652ae6f564bf9 | [
"MulanPSL-1.0"
] | null | null | null | robotsscan.py | Moxin1044/Easy-Bird-CMS-Scan-tools | 639fa05ec3b7d6d10ed4dd0c0f1652ae6f564bf9 | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2020-2021 Moxin
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BAS... | 38.714286 | 205 | 0.686962 |
4a142260fe091c8dc12654ea8c1b8a5d284e77c0 | 464 | py | Python | Mundo 1/ex_015.py | Shock3/Python_Exercicios | 4420569e881b883728168aabe76b0e9f3a42597f | [
"MIT"
] | null | null | null | Mundo 1/ex_015.py | Shock3/Python_Exercicios | 4420569e881b883728168aabe76b0e9f3a42597f | [
"MIT"
] | null | null | null | Mundo 1/ex_015.py | Shock3/Python_Exercicios | 4420569e881b883728168aabe76b0e9f3a42597f | [
"MIT"
] | null | null | null | """
Escreva um programa que pergunte a quantidade de Km percorridos por um carro
alugado e a quantidade de dias pelos quais ele foi alugado.
Calcule o preço a pagar, sabendo que o carro custa R$60 por dia
e R$0,15 por Km rodado
"""
print('**' * 19)
distancia = int(input('Qual a distância percorrida: '))
dias = int(inpu... | 35.692308 | 76 | 0.698276 |
4a1422e86da930a9a635871b24a5a16f98140c89 | 2,873 | py | Python | cfai/cf/plainCF.py | wangyongjie-ntu/Baselines_CF | 9b68011e21b26d91c87ac6c9a384cfa0b615f50f | [
"MIT"
] | 12 | 2021-04-01T08:22:51.000Z | 2022-01-30T18:26:14.000Z | cfai/cf/plainCF.py | wangyongjie-ntu/Baselines_CF | 9b68011e21b26d91c87ac6c9a384cfa0b615f50f | [
"MIT"
] | null | null | null | cfai/cf/plainCF.py | wangyongjie-ntu/Baselines_CF | 9b68011e21b26d91c87ac6c9a384cfa0b615f50f | [
"MIT"
] | 4 | 2021-04-21T13:53:55.000Z | 2021-11-01T12:15:02.000Z | #Filename: plainCF.py
#Author: Wang Yongjie
#Email: yongjie.wang@ntu.edu.sg
#Date: Min 13 Des 2020 09:15:05 WIB
import torch
import numpy as np
import torch.nn.functional as F
import copy
import time
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from cf.baseCF import ExplainerBase
class PlainCF(Ex... | 36.833333 | 124 | 0.670031 |
4a1423b6c0529233844636fa72d286ea18898e55 | 1,252 | py | Python | tests/grammpy_test/oldapi_tests/term-nonterm-grammar-handling_tests/TerminalHaveTest.py | PatrikValkovic/grammpy | 8308a1fd349bf9ea0d267360cc9a4ab20d1629e8 | [
"MIT"
] | 1 | 2021-02-04T12:41:08.000Z | 2021-02-04T12:41:08.000Z | tests/grammpy_test/oldapi_tests/term-nonterm-grammar-handling_tests/TerminalHaveTest.py | PatrikValkovic/grammpy | 8308a1fd349bf9ea0d267360cc9a4ab20d1629e8 | [
"MIT"
] | 3 | 2017-07-08T16:28:52.000Z | 2020-04-23T18:06:24.000Z | tests/grammpy_test/oldapi_tests/term-nonterm-grammar-handling_tests/TerminalHaveTest.py | PatrikValkovic/grammpy | 8308a1fd349bf9ea0d267360cc9a4ab20d1629e8 | [
"MIT"
] | 1 | 2021-02-04T12:41:10.000Z | 2021-02-04T12:41:10.000Z | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 03.08.2017 12:28
:Licence MIT
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.old_api import Grammar
class TempClass:
pass
class TerminalHaveTest(TestCase):
def test_haveTermEmpty(self):
gr = Grammar()
self.ass... | 24.076923 | 56 | 0.632588 |
4a1424db31a7267c4aef39b9f05bce5a6210e58a | 282 | py | Python | modelproject/modelproject.py | NumEconCopenhagen/projects-2020-group-xxv | b41f503ee389c8cb4a887807f81caa3bfe6a3aab | [
"MIT"
] | null | null | null | modelproject/modelproject.py | NumEconCopenhagen/projects-2020-group-xxv | b41f503ee389c8cb4a887807f81caa3bfe6a3aab | [
"MIT"
] | 12 | 2020-04-10T16:03:44.000Z | 2020-05-11T21:32:34.000Z | modelproject/modelproject.py | NumEconCopenhagen/projects-2020-group-xxv | b41f503ee389c8cb4a887807f81caa3bfe6a3aab | [
"MIT"
] | null | null | null | def Y_t(D,K,A,L,E,a,b,e):
return D*(K**a)*((A*L)**b)*(E**e)
def D_t(R,R_0,phi):
return (R/R_0)**phi
def A_t1(A,g):
return A*(1+g)
def L_t1(L,n):
return L*(1+n)
def K_t1(s,Y,d,K):
return s*Y+(1-d)*K
def R_t1(R,E):
return R-E
def E_t(sE,R):
return sE*R | 20.142857 | 37 | 0.521277 |
4a14259b696687312d53d32e1e522f2e078cf511 | 4,514 | py | Python | nova/servicegroup/drivers/db.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 5 | 2017-06-23T07:37:39.000Z | 2020-10-21T07:07:50.000Z | nova/servicegroup/drivers/db.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | null | null | null | nova/servicegroup/drivers/db.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 4 | 2017-06-23T07:37:43.000Z | 2020-12-28T09:57:22.000Z | # Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | 40.303571 | 79 | 0.647319 |
4a1425e96fba53c00e7c3584594eba581e796cf0 | 739 | py | Python | day02.py | jjhelmus/adventofcode | d421c3ea8c85614d91aa6ca2e4af68bae08cbf98 | [
"MIT"
] | 5 | 2015-12-06T16:08:33.000Z | 2022-01-19T11:14:55.000Z | day02.py | jjhelmus/adventofcode | d421c3ea8c85614d91aa6ca2e4af68bae08cbf98 | [
"MIT"
] | null | null | null | day02.py | jjhelmus/adventofcode | d421c3ea8c85614d91aa6ca2e4af68bae08cbf98 | [
"MIT"
] | 11 | 2016-01-26T18:53:38.000Z | 2022-01-26T02:35:57.000Z | from __future__ import print_function
verbose = False
f = open('inputs/input02.txt')
total_paper = 0
total_ribbon = 0
for line in f:
if verbose:
print("line:", line)
l, w, d = line.split('x')
l, w, d = int(l), int(w), int(d)
if verbose:
print("Dimensions:", l, w, d)
# paper
s... | 21.735294 | 56 | 0.576455 |
4a1425f4830c5273550555b97144c24f57c8fc2a | 6,027 | py | Python | examples/classify_students.py | dssg/diogenes | 52eda2a7adb22044e82779d05f91c927c1b95f3f | [
"MIT"
] | 21 | 2015-09-28T15:04:53.000Z | 2017-11-19T22:21:31.000Z | examples/classify_students.py | dssg/diogenes | 52eda2a7adb22044e82779d05f91c927c1b95f3f | [
"MIT"
] | 28 | 2015-09-27T09:51:12.000Z | 2021-11-08T17:26:39.000Z | examples/classify_students.py | dssg/diogenes | 52eda2a7adb22044e82779d05f91c927c1b95f3f | [
"MIT"
] | 10 | 2015-11-21T19:50:14.000Z | 2018-05-21T16:16:25.000Z | import sys
import os
import cPickle
import re
import numpy as np
from diogenes.grid_search.experiment import Experiment
from diogenes.grid_search.subset import BaseSubsetIter
from diogenes.grid_search.partition_iterator import SlidingWindowValue
from diogenes.modify import replace_missing_vals
from diogenes.utils impo... | 34.244318 | 86 | 0.652066 |
4a1425fb8316affd73250c6314440e0fc6f365d7 | 730 | py | Python | links/migrations/0002_auto_20160726_0326.py | rmad17/crawler | d7f28eac23e0fe61b81c9178302847602edba59d | [
"MIT"
] | null | null | null | links/migrations/0002_auto_20160726_0326.py | rmad17/crawler | d7f28eac23e0fe61b81c9178302847602edba59d | [
"MIT"
] | null | null | null | links/migrations/0002_auto_20160726_0326.py | rmad17/crawler | d7f28eac23e0fe61b81c9178302847602edba59d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-07-26 03:26
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('links', '0001_initial'),
]
operations = [
... | 27.037037 | 128 | 0.631507 |
4a1426d46d36e1e1da0606199d946d9a0013d866 | 392 | py | Python | sh-ip-int.py | rogerperkin/nornir-course | 7d78adc2fae41da6d695be2fcb71a7ba662ecf4c | [
"MIT"
] | 1 | 2020-10-29T17:21:49.000Z | 2020-10-29T17:21:49.000Z | sh-ip-int.py | rogerperkin/nornir-course | 7d78adc2fae41da6d695be2fcb71a7ba662ecf4c | [
"MIT"
] | null | null | null | sh-ip-int.py | rogerperkin/nornir-course | 7d78adc2fae41da6d695be2fcb71a7ba662ecf4c | [
"MIT"
] | null | null | null | from nornir import InitNornir
from nornir_utils.plugins.functions import print_result
from nornir_netmiko import netmiko_send_command
from nornir.core.filter import F
nr = InitNornir(config_file="/home/roger/nornir-course/config.yml")
Router = nr.filter(F(groups__contains="CSR_Routers"))
result = Router.run(netmiko... | 28 | 75 | 0.818878 |
4a142726b502549711140a3d26c1b2596757d1cb | 839 | py | Python | neoask/bps/neovis/view.py | psiace-archive/neoask | 4a47b8ca65813535b4399a879dca845729c1cb6e | [
"MIT"
] | 2 | 2021-05-19T15:40:42.000Z | 2021-05-19T15:43:43.000Z | neoask/bps/neovis/view.py | PsiACE/neoask | 4a47b8ca65813535b4399a879dca845729c1cb6e | [
"MIT"
] | null | null | null | neoask/bps/neovis/view.py | PsiACE/neoask | 4a47b8ca65813535b4399a879dca845729c1cb6e | [
"MIT"
] | null | null | null | import base64
import functools
import socket
from flask import (
Blueprint,
flash,
g,
redirect,
render_template,
request,
session,
url_for,
)
from werkzeug.security import check_password_hash, generate_password_hash
from neoask.bps.auth.view import login_required
from neoask.core.setti... | 20.463415 | 88 | 0.698451 |
4a14277c767255db0f3f7479cba6648ae338f8ed | 3,604 | py | Python | groupdocs_conversion_cloud/models/igs_load_options.py | groupdocs-conversion-cloud/groupdocs-conversion-cloud-python | 841d06ad3205e10e8f2726517779ac2d7c33a02a | [
"MIT"
] | 5 | 2019-11-21T04:58:45.000Z | 2021-02-05T05:22:37.000Z | groupdocs_conversion_cloud/models/igs_load_options.py | groupdocs-conversion-cloud/groupdocs-conversion-cloud-python | 841d06ad3205e10e8f2726517779ac2d7c33a02a | [
"MIT"
] | null | null | null | groupdocs_conversion_cloud/models/igs_load_options.py | groupdocs-conversion-cloud/groupdocs-conversion-cloud-python | 841d06ad3205e10e8f2726517779ac2d7c33a02a | [
"MIT"
] | null | null | null | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose Pty Ltd" file="IgsLoadOptions.py">
# Copyright (c) 2003-2021 Aspose Pty Ltd
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | 34.653846 | 85 | 0.596004 |
4a142832115c4983bf13b0d285e30089a58aa66c | 107,702 | py | Python | tests/unit/gapic/dialogflowcx_v3/test_versions.py | LaudateCorpus1/python-dialogflow-cx | cf9579171290ecf5afeeb6a38a3504857808a4ef | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/dialogflowcx_v3/test_versions.py | LaudateCorpus1/python-dialogflow-cx | cf9579171290ecf5afeeb6a38a3504857808a4ef | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/dialogflowcx_v3/test_versions.py | LaudateCorpus1/python-dialogflow-cx | cf9579171290ecf5afeeb6a38a3504857808a4ef | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.10748 | 111 | 0.690247 |
4a1428bcf6287d7e0e6c31e4a5c96e55bc92b0f4 | 3,332 | py | Python | movie_ns_project/settings.py | KenCz94/movie-ns-api | b5cd0ff5974ea9ea4f212ee30bc7716bb2bbc440 | [
"MIT"
] | null | null | null | movie_ns_project/settings.py | KenCz94/movie-ns-api | b5cd0ff5974ea9ea4f212ee30bc7716bb2bbc440 | [
"MIT"
] | null | null | null | movie_ns_project/settings.py | KenCz94/movie-ns-api | b5cd0ff5974ea9ea4f212ee30bc7716bb2bbc440 | [
"MIT"
] | null | null | null | from pathlib import Path
import pymysql
pymysql.install_as_MySQLdb()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist... | 26.23622 | 91 | 0.689676 |
4a142a3512ffb5d880da06ca91f3f422b124aa1a | 30,952 | py | Python | jax/interpreters/pxla.py | tomhennigan/jax | fb6c9f64e49880e3c3d0ff9a2ef7345fc9bbe717 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/interpreters/pxla.py | tomhennigan/jax | fb6c9f64e49880e3c3d0ff9a2ef7345fc9bbe717 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/interpreters/pxla.py | tomhennigan/jax | fb6c9f64e49880e3c3d0ff9a2ef7345fc9bbe717 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 41.104914 | 101 | 0.721117 |
4a142bea80acebce2114d51813b42ac41121e091 | 1,087 | py | Python | logging_0330.py | Jianyang-Hu/numpypractice | f4d4a3e28f5dd10f9722f83b1ac66f0f2ccef8b9 | [
"Apache-2.0"
] | null | null | null | logging_0330.py | Jianyang-Hu/numpypractice | f4d4a3e28f5dd10f9722f83b1ac66f0f2ccef8b9 | [
"Apache-2.0"
] | null | null | null | logging_0330.py | Jianyang-Hu/numpypractice | f4d4a3e28f5dd10f9722f83b1ac66f0f2ccef8b9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @version : Python3.6
# @Time : 2017/3/30 10:12
# @Author : Jianyang-Hu
# @contact : jianyang1993@163.com
# @File : logging_0330.py
# @Software: PyCharm
"""
Logging模块构成主要分为四个部分:
Loggers:提供应用程序直接使用的接口
Handlers:将Loggers产生的日志传到指定位置
Filters:对输出日志进行过滤
Formatters:控制输出格式
场景 ... | 27.175 | 97 | 0.638454 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.